Revision: 200951
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 07 Jan 2010 16:19:19 +0200
changeset 0 62f9d29f7211
child 1 272b002df977
Revision: 200951 Kit: 201001
group/bld.inf
layers.sysdef.xml
package_definition.xml
sysdef_1_4_0.dtd
webservices/group/backup_registration.xml
webservices/group/bld.inf
webservices/idwsfplugin/data/101f96f8.rss
webservices/idwsfplugin/data/101f96fb.rss
webservices/idwsfplugin/data/101f972f.rss
webservices/idwsfplugin/data/101f9732.rss
webservices/idwsfplugin/group/bld.inf
webservices/idwsfplugin/group/senidwsfplugin.mmp
webservices/idwsfplugin/inc/idwsfauthenticationserviceclient.h
webservices/idwsfplugin/inc/idwsfcoreserviceconsumer.h
webservices/idwsfplugin/inc/idwsfcorrelationheader.h
webservices/idwsfplugin/inc/idwsfdiscoveryserviceclient.h
webservices/idwsfplugin/inc/idwsfdsqueryresponse.h
webservices/idwsfplugin/inc/idwsfmessage.h
webservices/idwsfplugin/inc/idwsfresourceoffering.h
webservices/idwsfplugin/inc/idwsfsaslmechanism.h
webservices/idwsfplugin/inc/idwsfsaslmessage.h
webservices/idwsfplugin/inc/idwsfsecurityheader.h
webservices/idwsfplugin/inc/idwsfserviceinstance.h
webservices/idwsfplugin/inc/idwsfserviceprovider.h
webservices/idwsfplugin/inc/idwsfservicesession.h
webservices/idwsfplugin/inc/idwsfsessionconsumer.h
webservices/idwsfplugin/inc/idwsfsiuheader.h
webservices/idwsfplugin/inc/idwsfsoapmessage.h
webservices/idwsfplugin/inc/midwsfsessionvalidator.h
webservices/idwsfplugin/inc/senidwsfanonymoussaslmechanism.h
webservices/idwsfplugin/inc/senidwsfcrammd5saslmechanism.h
webservices/idwsfplugin/inc/senidwsfplainsaslmechanism.h
webservices/idwsfplugin/inc/senidwsfplugin.h
webservices/idwsfplugin/rom/idwsfplugin.iby
webservices/idwsfplugin/src/idwsfauthenticationserviceclient.cpp
webservices/idwsfplugin/src/idwsfcoreserviceconsumer.cpp
webservices/idwsfplugin/src/idwsfcorrelationheader.cpp
webservices/idwsfplugin/src/idwsfdiscoveryserviceclient.cpp
webservices/idwsfplugin/src/idwsfdsqueryresponse.cpp
webservices/idwsfplugin/src/idwsfmessage.cpp
webservices/idwsfplugin/src/idwsfresourceoffering.cpp
webservices/idwsfplugin/src/idwsfsaslmessage.cpp
webservices/idwsfplugin/src/idwsfsecurityheader.cpp
webservices/idwsfplugin/src/idwsfserviceinstance.cpp
webservices/idwsfplugin/src/idwsfserviceprovider.cpp
webservices/idwsfplugin/src/idwsfservicesession.cpp
webservices/idwsfplugin/src/idwsfsessionconsumer.cpp
webservices/idwsfplugin/src/idwsfsiuheader.cpp
webservices/idwsfplugin/src/idwsfsoapmessage.cpp
webservices/idwsfplugin/src/senidwsfanonymoussaslmechanism.cpp
webservices/idwsfplugin/src/senidwsfcrammd5saslmechanism.cpp
webservices/idwsfplugin/src/senidwsfplainsaslmechanism.cpp
webservices/idwsfplugin/src/senidwsfplugin.cpp
webservices/idwsfplugin/src/senidwsfpluginmain.cpp
webservices/idwsfplugin/src/senidwsfpluginproxy.cpp
webservices/idwsfplugin/src/senidwsfsecmechmain.cpp
webservices/idwsfplugin/src/senidwsfsecmechproxy.cpp
webservices/idwsfsecuritymechanism/data/101f96fb.rss
webservices/idwsfsecuritymechanism/data/101f9732.rss
webservices/idwsfsecuritymechanism/group/bld.inf
webservices/idwsfsecuritymechanism/group/senidwsfsecuritymechanism.mmp
webservices/idwsfsecuritymechanism/inc/senidwsfanonymoussaslmechanism.h
webservices/idwsfsecuritymechanism/inc/senidwsfcrammd5saslmechanism.h
webservices/idwsfsecuritymechanism/inc/senidwsfplainsaslmechanism.h
webservices/idwsfsecuritymechanism/rom/idwsfsecuritymechanism.iby
webservices/idwsfsecuritymechanism/src/senidwsfanonymoussaslmechanism.cpp
webservices/idwsfsecuritymechanism/src/senidwsfcrammd5saslmechanism.cpp
webservices/idwsfsecuritymechanism/src/senidwsfplainsaslmechanism.cpp
webservices/idwsfsecuritymechanism/src/senidwsfsecmechmain.cpp
webservices/idwsfsecuritymechanism/src/senidwsfsecmechproxy.cpp
webservices/inc/webservices.hrh
webservices/rom/Note_BuildImage.txt
webservices/wsconnection/BMARM/SENSERVCONNU.DEF
webservices/wsconnection/BWINS/SENSERVCONNU.DEF
webservices/wsconnection/BWINSCW/SENSERVCONNU.DEF
webservices/wsconnection/eabi/SENSERVCONNu.DEF
webservices/wsconnection/group/bld.inf
webservices/wsconnection/group/senserviceconnection.mmp
webservices/wsconnection/inc/rsenserviceconnection.h
webservices/wsconnection/inc/seninternalserviceconnectioninterfaces.h
webservices/wsconnection/inc/senregistrationtimer.h
webservices/wsconnection/inc/senserviceconnectionimpl.h
webservices/wsconnection/inc/senservicedispatcher.h
webservices/wsconnection/rom/wsconnection.iby
webservices/wsconnection/src/rsenserviceconnection.cpp
webservices/wsconnection/src/senregistrationtimer.cpp
webservices/wsconnection/src/senserviceconnectiondll.cpp
webservices/wsconnection/src/senserviceconnectionimpl.cpp
webservices/wsconnection/src/senservicedispatcher.cpp
webservices/wsconnectionagent/BWINSCW/senconnagentU.def
webservices/wsconnectionagent/eabi/senconnagent32u.def
webservices/wsconnectionagent/eabi/senconnagentu.def
webservices/wsconnectionagent/group/bld.inf
webservices/wsconnectionagent/group/senconnagent.mmp
webservices/wsconnectionagent/inc/senconnagentserver.h
webservices/wsconnectionagent/inc/senconnagentsession.h
webservices/wsconnectionagent/rom/wsconnectionagent.iby
webservices/wsconnectionagent/src/senconnagentserver.cpp
webservices/wsconnectionagent/src/senconnagentsession.cpp
webservices/wscore/group/bld.inf
webservices/wscore/group/sencore.mmp
webservices/wscore/inc/msendao.h
webservices/wscore/inc/senclientsession.h
webservices/wscore/inc/sencoreservicemanager.h
webservices/wscore/inc/sencoreshutdowntimer.h
webservices/wscore/inc/senmobilityobserver.h
webservices/wscore/inc/senservicemanagerdefines.h
webservices/wscore/inc/senxmldao.h
webservices/wscore/rom/wscore.iby
webservices/wscore/sis/S60SOA.pkg
webservices/wscore/sis/S60SOA.sis
webservices/wscore/src/senclientsession.cpp
webservices/wscore/src/sencoreservicemanager.cpp
webservices/wscore/src/sencoreservicemanagermain.cpp
webservices/wscore/src/sencoreshutdowntimer.cpp
webservices/wscore/src/senmobilityobserver.cpp
webservices/wscore/src/senxmldao.cpp
webservices/wscredentialmanager/BWINSCW/SENCREDENTIALMANAGERU.DEF
webservices/wscredentialmanager/eabi/SENCREDENTIALMANAGERu.DEF
webservices/wscredentialmanager/group/bld.inf
webservices/wscredentialmanager/group/sencredentialmanager.mmp
webservices/wscredentialmanager/inc/sencredentialmanager.h
webservices/wscredentialmanager/inc/seninternalcredential.h
webservices/wscredentialmanager/rom/wscredentialmanager.iby
webservices/wscredentialmanager/src/sencredentialmanager.cpp
webservices/wscredentialmanager/src/sencredentialmanagerdll.cpp
webservices/wscredentialmanager/src/seninternalcredential.cpp
webservices/wsdescription/BMARM/SENSERVDESCU.DEF
webservices/wsdescription/BWINS/SenServDescU.DEF
webservices/wsdescription/BWINSCW/SenServDescU.DEF
webservices/wsdescription/BWINSCW/SenServDesc_V2U.DEF
webservices/wsdescription/eabi/SenServDesc_V2U.DEF
webservices/wsdescription/eabi/SenServDescu.DEF
webservices/wsdescription/group/bld.inf
webservices/wsdescription/group/senservicedescription.mmp
webservices/wsdescription/inc/msenpolicy.h
webservices/wsdescription/inc/mservicepolicy.h
webservices/wsdescription/inc/senconsumerpolicy.h
webservices/wsdescription/inc/senpolicy.h
webservices/wsdescription/inc/senproviderpolicy.h
webservices/wsdescription/inc/senservicepolicy.h
webservices/wsdescription/inc/servicepolicy.h
webservices/wsdescription/rom/wsdescription.iby
webservices/wsdescription/src/senconsumerpolicy.cpp
webservices/wsdescription/src/sencredential.cpp
webservices/wsdescription/src/sencredential2.cpp
webservices/wsdescription/src/senfacet.cpp
webservices/wsdescription/src/senidentityprovider.cpp
webservices/wsdescription/src/senidentityprovideridarray8.cpp
webservices/wsdescription/src/senpolicy.cpp
webservices/wsdescription/src/senproviderpolicy.cpp
webservices/wsdescription/src/senservdescdll.cpp
webservices/wsdescription/src/senservicepattern.cpp
webservices/wsdescription/src/senservicepolicy.cpp
webservices/wsdescription/src/senxmlservicedescription.cpp
webservices/wsdescription/src/servicepolicy.cpp
webservices/wsfragment/BWINSCW/SenFragmentU.DEF
webservices/wsfragment/BWINSCW/SenFragment_3.0U.DEF
webservices/wsfragment/eabi/SenFragment_3.0U.DEF
webservices/wsfragment/eabi/SenFragmentu.DEF
webservices/wsfragment/group/bld.inf
webservices/wsfragment/group/senfragment.mmp
webservices/wsfragment/inc/senparserimpl.h
webservices/wsfragment/inc/wslibxml2utils.h
webservices/wsfragment/rom/wsfragment.iby
webservices/wsfragment/src/rsendocument.cpp
webservices/wsfragment/src/sendomfragmentbase.cpp
webservices/wsfragment/src/senfragmentbase.cpp
webservices/wsfragment/src/senparser.cpp
webservices/wsfragment/src/senparserimpl.cpp
webservices/wsfragment/src/wslibxml2utils.cpp
webservices/wsframework/BMARM/SENFRAMEWORKU.DEF
webservices/wsframework/BWINS/SENFRAMEWORKU.DEF
webservices/wsframework/BWINSCW/SENFRAMEWORKU.DEF
webservices/wsframework/eabi/SENFRAMEWORKu.DEF
webservices/wsframework/group/bld.inf
webservices/wsframework/group/senframework.mmp
webservices/wsframework/inc/msencontext.h
webservices/wsframework/inc/msencontextitem.h
webservices/wsframework/inc/msencoreservicemanager.h
webservices/wsframework/inc/msencredentialmanager.h
webservices/wsframework/inc/msenhandler.h
webservices/wsframework/inc/msenhandlercontext.h
webservices/wsframework/inc/msenlayeredproperties.h
webservices/wsframework/inc/msenmessagecontext.h
webservices/wsframework/inc/msenprovider.h
webservices/wsframework/inc/msenremotehostlet.h
webservices/wsframework/inc/msenremoteserviceconsumer.h
webservices/wsframework/inc/msenremoteservicesession.h
webservices/wsframework/inc/msensaslmessage.h
webservices/wsframework/inc/msenserviceinvocationframework.h
webservices/wsframework/inc/msenservicemanager.h
webservices/wsframework/inc/msenservicesession.h
webservices/wsframework/inc/msensessioncontext.h
webservices/wsframework/inc/msentransport.h
webservices/wsframework/inc/msentransportcontext.h
webservices/wsframework/inc/msentransportfactory.h
webservices/wsframework/inc/saslmechanism.h
webservices/wsframework/inc/senapplicationcontext.h
webservices/wsframework/inc/senclientcontext.h
webservices/wsframework/inc/sencontext.h
webservices/wsframework/inc/sencontextitem.h
webservices/wsframework/inc/senhandlerbase.h
webservices/wsframework/inc/seninternalserviceconsumer.h
webservices/wsframework/inc/senlayeredhttptransportproperties.h
webservices/wsframework/inc/senlayeredtransportproperties.h
webservices/wsframework/inc/senlayeredvtcptransportproperties.h
webservices/wsframework/inc/senlayeredxmlproperties.h
webservices/wsframework/inc/senmessagecontext.h
webservices/wsframework/inc/senmessagehandler.h
webservices/wsframework/inc/senmessagehandler.inl
webservices/wsframework/inc/senmtomutils.h
webservices/wsframework/inc/senmultipartutils.h
webservices/wsframework/inc/senpasswordtransform.h
webservices/wsframework/inc/senpasswordtransform.inl
webservices/wsframework/inc/senprovider.h
webservices/wsframework/inc/senprovider.inl
webservices/wsframework/inc/sensecuritymechanism.h
webservices/wsframework/inc/sensecuritymechanism.inl
webservices/wsframework/inc/senservercontext.h
webservices/wsframework/inc/senserviceinvocationframework.h
webservices/wsframework/inc/senserviceinvocationframework.inl
webservices/wsframework/inc/senservicesession.h
webservices/wsframework/inc/sensessioncontext.h
webservices/wsframework/inc/sensessionhandler.h
webservices/wsframework/inc/sensessionhandler.inl
webservices/wsframework/inc/sensyncrequester.h
webservices/wsframework/inc/sentransport.h
webservices/wsframework/inc/sentransport.inl
webservices/wsframework/inc/sentransportbase.h
webservices/wsframework/inc/sentransportcontext.h
webservices/wsframework/inc/senwebservicesession.h
webservices/wsframework/inc/senwsdescription.h
webservices/wsframework/inc/senwspattern.h
webservices/wsframework/inc/xmllocalnameconstants.h
webservices/wsframework/rom/wsframework.iby
webservices/wsframework/src/saslmechanism.cpp
webservices/wsframework/src/senapplicationcontext.cpp
webservices/wsframework/src/senclientcontext.cpp
webservices/wsframework/src/sencontext.cpp
webservices/wsframework/src/sencontextitem.cpp
webservices/wsframework/src/senframeworkdll.cpp
webservices/wsframework/src/senhandlerbase.cpp
webservices/wsframework/src/senhttptransportproperties.cpp
webservices/wsframework/src/seninternalserviceconsumer.cpp
webservices/wsframework/src/senlayeredhttptransportproperties.cpp
webservices/wsframework/src/senlayeredtransportproperties.cpp
webservices/wsframework/src/senlayeredvtcptransportproperties.cpp
webservices/wsframework/src/senlayeredxmlproperties.cpp
webservices/wsframework/src/senmessagecontext.cpp
webservices/wsframework/src/senmtomutils.cpp
webservices/wsframework/src/senmultipartutils.cpp
webservices/wsframework/src/senservercontext.cpp
webservices/wsframework/src/senservicesession.cpp
webservices/wsframework/src/sensessioncontext.cpp
webservices/wsframework/src/sensyncrequester.cpp
webservices/wsframework/src/sentransportcontext.cpp
webservices/wsframework/src/senwebservicesession.cpp
webservices/wsframework/src/senwsdescription.cpp
webservices/wsframework/src/senwspattern.cpp
webservices/wshostletconnection/BMARM/SENHOSTCONNU.DEF
webservices/wshostletconnection/BWINS/SENHOSTCONNU.DEF
webservices/wshostletconnection/BWINSCW/SENHOSTCONNU.DEF
webservices/wshostletconnection/eabi/SENHOSTCONNu.DEF
webservices/wshostletconnection/group/bld.inf
webservices/wshostletconnection/group/senhostletconnection.mmp
webservices/wshostletconnection/inc/rsenhostletconnection.h
webservices/wshostletconnection/inc/senhostletconnectionimpl.h
webservices/wshostletconnection/inc/senregistrationtimer.h
webservices/wshostletconnection/rom/wshostletconnection.iby
webservices/wshostletconnection/src/rsenhostletconnection.cpp
webservices/wshostletconnection/src/senhostletconnectiondll.cpp
webservices/wshostletconnection/src/senhostletconnectionimpl.cpp
webservices/wshostletconnection/src/senregistrationtimer.cpp
webservices/wshostlettransportplugin/data/101f974c.rss
webservices/wshostlettransportplugin/data/2000039e.rss
webservices/wshostlettransportplugin/group/bld.inf
webservices/wshostlettransportplugin/group/senhostlettransportplugin.mmp
webservices/wshostlettransportplugin/inc/senhostlettransportplugin.h
webservices/wshostlettransportplugin/rom/wshostlettransportplugin.iby
webservices/wshostlettransportplugin/src/senhostlettransportplugin.cpp
webservices/wshostlettransportplugin/src/senhostlettransportpluginmain.cpp
webservices/wshostlettransportplugin/src/senhostlettransportpluginproxy.cpp
webservices/wshttpchanneltransportplugin/data/101f974d.rss
webservices/wshttpchanneltransportplugin/data/10274c73.rss
webservices/wshttpchanneltransportplugin/group/bld.inf
webservices/wshttpchanneltransportplugin/group/senhttpchanneltransportplugin.mmp
webservices/wshttpchanneltransportplugin/inc/senasynctimeout.h
webservices/wshttpchanneltransportplugin/inc/senatomtxnstate.h
webservices/wshttpchanneltransportplugin/inc/senhttpchannel.h
webservices/wshttpchanneltransportplugin/inc/senhttpchannelimpl.h
webservices/wshttpchanneltransportplugin/inc/senhttpchanneltransportplugin.h
webservices/wshttpchanneltransportplugin/inc/senhttpeventhandler.h
webservices/wshttpchanneltransportplugin/inc/senhttpsyncrequester.h
webservices/wshttpchanneltransportplugin/inc/senmtomtxnstate.h
webservices/wshttpchanneltransportplugin/inc/senmultiparttxnstate.h
webservices/wshttpchanneltransportplugin/inc/senresponseobserver.h
webservices/wshttpchanneltransportplugin/inc/senrfiletxnstate.h
webservices/wshttpchanneltransportplugin/inc/sentxnstate.h
webservices/wshttpchanneltransportplugin/rom/wshttpchanneltransportplugin.iby
webservices/wshttpchanneltransportplugin/src/senasynctimeout.cpp
webservices/wshttpchanneltransportplugin/src/senatomtxnstate.cpp
webservices/wshttpchanneltransportplugin/src/senhttpchannelimpl.cpp
webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportplugin.cpp
webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportpluginmain.cpp
webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportpluginproxy.cpp
webservices/wshttpchanneltransportplugin/src/senhttpeventhandler.cpp
webservices/wshttpchanneltransportplugin/src/senhttpsyncrequester.cpp
webservices/wshttpchanneltransportplugin/src/senmtomtxnstate.cpp
webservices/wshttpchanneltransportplugin/src/senmultiparttxnstate.cpp
webservices/wshttpchanneltransportplugin/src/senrfiletxnstate.cpp
webservices/wshttpchanneltransportplugin/src/sentxnstate.cpp
webservices/wsibasicplugin/data/10274c6d.rss
webservices/wsibasicplugin/data/10282c46.rss
webservices/wsibasicplugin/group/bld.inf
webservices/wsibasicplugin/group/senwsibasicplugin.mmp
webservices/wsibasicplugin/inc/senbasicwebservicesession.h
webservices/wsibasicplugin/inc/senwsiplugin.h
webservices/wsibasicplugin/rom/wsibasicplugin.iby
webservices/wsibasicplugin/src/senbasicwebservicesession.cpp
webservices/wsibasicplugin/src/senwsiplugin.cpp
webservices/wsibasicplugin/src/senwsipluginmain.cpp
webservices/wsibasicplugin/src/senwsipluginproxy.cpp
webservices/wsidentitymanager/BMARM/SENIDENTITYMANAGERU.DEF
webservices/wsidentitymanager/BWINS/SENIDENTITYMANAGERU.DEF
webservices/wsidentitymanager/BWINSCW/SENIDENTITYMANAGERU.DEF
webservices/wsidentitymanager/eabi/SENIDENTITYMANAGERu.DEF
webservices/wsidentitymanager/group/bld.inf
webservices/wsidentitymanager/group/senidentitymanager.mmp
webservices/wsidentitymanager/inc/msenidentity.h
webservices/wsidentitymanager/inc/msenidentitymanager.h
webservices/wsidentitymanager/inc/senbaseidentity.h
webservices/wsidentitymanager/inc/senbaseidentitymanager.h
webservices/wsidentitymanager/inc/senmultiuseridentitymanager.h
webservices/wsidentitymanager/inc/sensecuritymechanismobserver.h
webservices/wsidentitymanager/inc/senuser.h
webservices/wsidentitymanager/inc/senuser.inl
webservices/wsidentitymanager/inc/senwiseidentityprovider.h
webservices/wsidentitymanager/rom/wsidentitymanager.iby
webservices/wsidentitymanager/src/senbaseidentity.cpp
webservices/wsidentitymanager/src/senbaseidentitymanager.cpp
webservices/wsidentitymanager/src/senidentitymanagerdll.cpp
webservices/wsidentitymanager/src/senmultiuseridentitymanager.cpp
webservices/wsidentitymanager/src/sensecuritymechanismobserver.cpp
webservices/wsidentitymanager/src/senuser.cpp
webservices/wsidentitymanager/src/senwiseidentityprovider.cpp
webservices/wslocaltransportplugin/data/101f974e.rss
webservices/wslocaltransportplugin/data/10274c75.rss
webservices/wslocaltransportplugin/group/bld.inf
webservices/wslocaltransportplugin/group/senlocaltransportplugin.mmp
webservices/wslocaltransportplugin/inc/senlocaltransportplugin.h
webservices/wslocaltransportplugin/rom/wslocaltransportplugin.iby
webservices/wslocaltransportplugin/src/senlocaltransportplugin.cpp
webservices/wslocaltransportplugin/src/senlocaltransportpluginmain.cpp
webservices/wslocaltransportplugin/src/senlocaltransportpluginproxy.cpp
webservices/wslogger/BMARM/SENLOGGERU.DEF
webservices/wslogger/BWINS/SENLOGGERU.DEF
webservices/wslogger/BWINSCW/SENLOGGERU.DEF
webservices/wslogger/eabi/SENLOGGERu.DEF
webservices/wslogger/group/bld.inf
webservices/wslogger/group/senlogger.mmp
webservices/wslogger/inc/senlogger.h
webservices/wslogger/rom/wslogger.iby
webservices/wslogger/src/senlogger.cpp
webservices/wslogger/src/senloggerdll.cpp
webservices/wsmanager/BMARM/SENSERVMGRU.DEF
webservices/wsmanager/BWINS/SENSERVMGRU.DEF
webservices/wsmanager/BWINSCW/SENSERVMGRU.DEF
webservices/wsmanager/eabi/SENSERVMGRu.DEF
webservices/wsmanager/group/bld.inf
webservices/wsmanager/group/senservicemanager.mmp
webservices/wsmanager/inc/rsenservicemanager.h
webservices/wsmanager/inc/senservicemanagerimpl.h
webservices/wsmanager/inc/senservicemanagerinterfaces.h
webservices/wsmanager/rom/wsmanager.iby
webservices/wsmanager/src/rsenservicemanager.cpp
webservices/wsmanager/src/senservicemanagerdll.cpp
webservices/wsmanager/src/senservicemanagerimpl.cpp
webservices/wsmessages/BWINSCW/SenMessagesU.DEF
webservices/wsmessages/eabi/SenMessagesu.DEF
webservices/wsmessages/group/bld.inf
webservices/wsmessages/group/senmessages.mmp
webservices/wsmessages/inc/senatomentry.h
webservices/wsmessages/inc/senatomfeed.h
webservices/wsmessages/inc/senatommessage.h
webservices/wsmessages/inc/senmessagebase.h
webservices/wsmessages/inc/sensoapmessagedom2.h
webservices/wsmessages/rom/wsmessages.iby
webservices/wsmessages/src/senatomentry.cpp
webservices/wsmessages/src/senatomfeed.cpp
webservices/wsmessages/src/senatommessage.cpp
webservices/wsmessages/src/senmessagebase.cpp
webservices/wsmessages/src/sensoapenvelope2.cpp
webservices/wsmessages/src/sensoapfault2.cpp
webservices/wsmessages/src/sensoapmessage2.cpp
webservices/wsmessages/src/sensoapmessagedom2.cpp
webservices/wsmessages/src/senwssecurityheader2.cpp
webservices/wsnotifierplugins/BMARM/SENNOTIFIERPLUGINU.DEF
webservices/wsnotifierplugins/BMARM/SENNOTPLUGINDLGCLIENT_2.6U.DEF
webservices/wsnotifierplugins/BWINS/SENNOTDLGU.DEF
webservices/wsnotifierplugins/BWINS/SENNOTIFIERPLUGINU.DEF
webservices/wsnotifierplugins/BWINS/SENNOTIFIERPLUGIN_2.6U.DEF
webservices/wsnotifierplugins/BWINS/SENNOTPLUGINDLGCLIENT_2.6U.DEF
webservices/wsnotifierplugins/BWINSCW/SENNOTDLGIMPLU.DEF
webservices/wsnotifierplugins/BWINSCW/SENNOTIFIERPLUGINU.DEF
webservices/wsnotifierplugins/BWINSCW/SENNOTIFIERPLUGIN_2.6U.DEF
webservices/wsnotifierplugins/BWINSCW/SENNOTPLUGINDLGCLIENTU.DEF
webservices/wsnotifierplugins/BWINSCW/SENNOTPLUGINDLGCLIENT_2.6U.DEF
webservices/wsnotifierplugins/data/1005f8d1.rss
webservices/wsnotifierplugins/data/101f9743.rss
webservices/wsnotifierplugins/data/101f9764.rss
webservices/wsnotifierplugins/data/sennotifierplugin_reg.rss
webservices/wsnotifierplugins/data/sennotifierplugindlgimpl.rss
webservices/wsnotifierplugins/data/wsnotifierplugin_reg.rss
webservices/wsnotifierplugins/eabi/SENNOTIFIERPLUGINu.DEF
webservices/wsnotifierplugins/eabi/SENNOTPLUGINDLGCLIENTu.DEF
webservices/wsnotifierplugins/group/bld.inf
webservices/wsnotifierplugins/group/sennotifierplugin.mmp
webservices/wsnotifierplugins/group/sennotplugindlgclient.mmp
webservices/wsnotifierplugins/inc/logger.h
webservices/wsnotifierplugins/inc/sennotplugindlg.h
webservices/wsnotifierplugins/inc/sennotplugindlgimpl.h
webservices/wsnotifierplugins/inc/sennotplugindlgimpl.hrh
webservices/wsnotifierplugins/loc/sennotplugindlgimpl.loc
webservices/wsnotifierplugins/rom/wsnotifierplugindlg.iby
webservices/wsnotifierplugins/rom/wsnotifierplugindlg_resources.iby
webservices/wsnotifierplugins/rom/wsnotifierplugins.iby
webservices/wsnotifierplugins/src/logger.cpp
webservices/wsnotifierplugins/src/sennotplugindlg.cpp
webservices/wsnotifierplugins/src/sennotplugindlgimpl.cpp
webservices/wsnotifierplugins/src/sennotplugindlgmain.cpp
webservices/wsoviplugin/data/101F9759.rss
webservices/wsoviplugin/group/bld.inf
webservices/wsoviplugin/group/wsovi.mmp
webservices/wsoviplugin/inc/wsovicons.h
webservices/wsoviplugin/inc/wsovicredentialcollectorhandler.h
webservices/wsoviplugin/inc/wsovicredentialobserver.h
webservices/wsoviplugin/inc/wsovidevicehandler.h
webservices/wsoviplugin/inc/wsoviencoderhandler.h
webservices/wsoviplugin/inc/wsovierrorresponse.h
webservices/wsoviplugin/inc/wsovihandlercontext.h
webservices/wsoviplugin/inc/wsovimessagecontext.h
webservices/wsoviplugin/inc/wsovioauthclient.h
webservices/wsoviplugin/inc/wsoviplugin.h
webservices/wsoviplugin/inc/wsoviregisterhandler.h
webservices/wsoviplugin/inc/wsovisecurityhandler.h
webservices/wsoviplugin/inc/wsoviservicesession.h
webservices/wsoviplugin/inc/wsoviserviceupdatehandler.h
webservices/wsoviplugin/inc/wsovisessionconsumer.h
webservices/wsoviplugin/inc/wsovisessioncontext.h
webservices/wsoviplugin/inc/wsovitokencreationresponse.h
webservices/wsoviplugin/inc/wsoviutils.h
webservices/wsoviplugin/inc/wsovivalidatehandler.h
webservices/wsoviplugin/rom/wsoviplugin.iby
webservices/wsoviplugin/src/wsovicredentialcollectorhandler.cpp
webservices/wsoviplugin/src/wsovicredentialobserver.cpp
webservices/wsoviplugin/src/wsovidevicehandler.cpp
webservices/wsoviplugin/src/wsoviencoderhandler.cpp
webservices/wsoviplugin/src/wsovierrorresponse.cpp
webservices/wsoviplugin/src/wsovihandlercontext.cpp
webservices/wsoviplugin/src/wsovimessagecontext.cpp
webservices/wsoviplugin/src/wsovioauthclient.cpp
webservices/wsoviplugin/src/wsoviplugin.cpp
webservices/wsoviplugin/src/wsoviproxy.cpp
webservices/wsoviplugin/src/wsoviregisterhandler.cpp
webservices/wsoviplugin/src/wsovisecurityhandler.cpp
webservices/wsoviplugin/src/wsoviservicesession.cpp
webservices/wsoviplugin/src/wsoviserviceupdatehandler.cpp
webservices/wsoviplugin/src/wsovisessionconsumer.cpp
webservices/wsoviplugin/src/wsovisessioncontext.cpp
webservices/wsoviplugin/src/wsovitokencreationresponse.cpp
webservices/wsoviplugin/src/wsoviutils.cpp
webservices/wsoviplugin/src/wsovivalidatehandler.cpp
webservices/wspasswordtransforms/data/101f9706.rss
webservices/wspasswordtransforms/data/101f973c.rss
webservices/wspasswordtransforms/group/bld.inf
webservices/wspasswordtransforms/group/senpasswordtransforms.mmp
webservices/wspasswordtransforms/inc/senlowercasetransform.h
webservices/wspasswordtransforms/inc/senselecttransform.h
webservices/wspasswordtransforms/inc/sentruncatetransform.h
webservices/wspasswordtransforms/inc/senuppercasetransform.h
webservices/wspasswordtransforms/rom/wspasswordtransforms.iby
webservices/wspasswordtransforms/src/senlowercasetransform.cpp
webservices/wspasswordtransforms/src/senpasswordtransformmain.cpp
webservices/wspasswordtransforms/src/senpasswordtransformproxy.cpp
webservices/wspasswordtransforms/src/senselecttransform.cpp
webservices/wspasswordtransforms/src/sentruncatetransform.cpp
webservices/wspasswordtransforms/src/senuppercasetransform.cpp
webservices/wsprovider/BMARM/SENPROVIDERU.DEF
webservices/wsprovider/BWINS/SENPROVIDERU.DEF
webservices/wsprovider/BWINSCW/SENPROVIDERU.DEF
webservices/wsprovider/eabi/SENPROVIDERu.DEF
webservices/wsprovider/group/bld.inf
webservices/wsprovider/group/senprovider.mmp
webservices/wsprovider/inc/senhostletrequest.h
webservices/wsprovider/inc/senhostletresponse.h
webservices/wsprovider/rom/wsprovider.iby
webservices/wsprovider/src/senhostletrequest.cpp
webservices/wsprovider/src/senhostletresponse.cpp
webservices/wsprovider/src/senproviderdll.cpp
webservices/wsrestplugin/data/10274c6f.rss
webservices/wsrestplugin/data/10282c43.rss
webservices/wsrestplugin/group/bld.inf
webservices/wsrestplugin/group/senrestplugin.mmp
webservices/wsrestplugin/inc/senrestplugin.h
webservices/wsrestplugin/inc/senrestservicesession.h
webservices/wsrestplugin/rom/wsrestplugin.iby
webservices/wsrestplugin/src/senrestplugin.cpp
webservices/wsrestplugin/src/senrestpluginmain.cpp
webservices/wsrestplugin/src/senrestpluginproxy.cpp
webservices/wsrestplugin/src/senrestservicesession.cpp
webservices/wsstar/group/bld.inf
webservices/wsstar/wsstarmessagehandlers/data/101f971c.rss
webservices/wsstar/wsstarmessagehandlers/data/10282c48.rss
webservices/wsstar/wsstarmessagehandlers/group/bld.inf
webservices/wsstar/wsstarmessagehandlers/group/wsstarmessagehandlers.mmp
webservices/wsstar/wsstarmessagehandlers/inc/wsstaraddressingepr.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstaraddressinghandler.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstaraddressingheaderinbound.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarcredentialcollectorhandler.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarenveloperhandler.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarmessagehandlerscons.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarmessageutils.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarpassporthandler.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarpassportheaderinbound.h
webservices/wsstar/wsstarmessagehandlers/inc/wsstarsecurityhandler.h
webservices/wsstar/wsstarmessagehandlers/rom/wsstarmessagehandlers.iby
webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressingepr.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressinghandler.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressingheaderinbound.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarcredentialcollectorhandler.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarenveloperhandler.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarmessagehandlersproxy.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarmessageutils.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarpassporthandler.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarpassportheaderinbound.cpp
webservices/wsstar/wsstarmessagehandlers/src/wsstarsecurityhandler.cpp
webservices/wsstar/wsstarplugin/data/101f9717.rss
webservices/wsstar/wsstarplugin/data/101f9717_vtcp.rss
webservices/wsstar/wsstarplugin/data/10282c49.rss
webservices/wsstar/wsstarplugin/data/10282c49_vtcp.rss
webservices/wsstar/wsstarplugin/group/bld.inf
webservices/wsstar/wsstarplugin/group/wsstarplugin.mmp
webservices/wsstar/wsstarplugin/inc/wsstarcobrandingclient.h
webservices/wsstar/wsstarplugin/inc/wsstarcobrandinghandler.h
webservices/wsstar/wsstarplugin/inc/wsstarcons.h
webservices/wsstar/wsstarplugin/inc/wsstarcredentialobserver.h
webservices/wsstar/wsstarplugin/inc/wsstardicthttpclient.h
webservices/wsstar/wsstarplugin/inc/wsstardictionary.h
webservices/wsstar/wsstarplugin/inc/wsstarhandlercontext.h
webservices/wsstar/wsstarplugin/inc/wsstarhttpclient.h
webservices/wsstar/wsstarplugin/inc/wsstarmessagecontext.h
webservices/wsstar/wsstarplugin/inc/wsstarplugin.h
webservices/wsstar/wsstarplugin/inc/wsstarpolicy.h
webservices/wsstar/wsstarplugin/inc/wsstarpolicyhandler.h
webservices/wsstar/wsstarplugin/inc/wsstarpolicymanager.h
webservices/wsstar/wsstarplugin/inc/wsstarpolicyrequest.h
webservices/wsstar/wsstarplugin/inc/wsstarpolicyvalidator.h
webservices/wsstar/wsstarplugin/inc/wsstarregisterhandler.h
webservices/wsstar/wsstarplugin/inc/wsstarrstresponse.h
webservices/wsstar/wsstarplugin/inc/wsstarservicesession.h
webservices/wsstar/wsstarplugin/inc/wsstarserviceupdatehandler.h
webservices/wsstar/wsstarplugin/inc/wsstarsessionconsumer.h
webservices/wsstar/wsstarplugin/inc/wsstarsessioncontext.h
webservices/wsstar/wsstarplugin/inc/wsstarsessionvalidator.h
webservices/wsstar/wsstarplugin/inc/wsstartrustclient.h
webservices/wsstar/wsstarplugin/inc/wsstarvalidatehandler.h
webservices/wsstar/wsstarplugin/rom/wsstarplugin.iby
webservices/wsstar/wsstarplugin/src/wsstarcobrandingclient.cpp
webservices/wsstar/wsstarplugin/src/wsstarcobrandinghandler.cpp
webservices/wsstar/wsstarplugin/src/wsstarcredentialobserver.cpp
webservices/wsstar/wsstarplugin/src/wsstardictionary.cpp
webservices/wsstar/wsstarplugin/src/wsstarhandlercontext.cpp
webservices/wsstar/wsstarplugin/src/wsstarhttpclient.cpp
webservices/wsstar/wsstarplugin/src/wsstarmessagecontext.cpp
webservices/wsstar/wsstarplugin/src/wsstarplugin.cpp
webservices/wsstar/wsstarplugin/src/wsstarpolicy.cpp
webservices/wsstar/wsstarplugin/src/wsstarpolicyhandler.cpp
webservices/wsstar/wsstarplugin/src/wsstarpolicymanager.cpp
webservices/wsstar/wsstarplugin/src/wsstarpolicyrequest.cpp
webservices/wsstar/wsstarplugin/src/wsstarproxy.cpp
webservices/wsstar/wsstarplugin/src/wsstarregisterhandler.cpp
webservices/wsstar/wsstarplugin/src/wsstarrstresponse.cpp
webservices/wsstar/wsstarplugin/src/wsstarservicesession.cpp
webservices/wsstar/wsstarplugin/src/wsstarserviceupdatehandler.cpp
webservices/wsstar/wsstarplugin/src/wsstarsessionconsumer.cpp
webservices/wsstar/wsstarplugin/src/wsstarsessioncontext.cpp
webservices/wsstar/wsstarplugin/src/wsstartrustclient.cpp
webservices/wsstar/wsstarplugin/src/wsstarvalidatehandler.cpp
webservices/wsstar/wsstarpolicy/BWINSCW/WsPolicyU.def
webservices/wsstar/wsstarpolicy/data/101f9722.rss
webservices/wsstar/wsstarpolicy/eabi/WsPolicyu.def
webservices/wsstar/wsstarpolicy/group/bld.inf
webservices/wsstar/wsstarpolicy/group/wspolicy.mmp
webservices/wsstar/wsstarpolicy/inc/andcompositeassertion.h
webservices/wsstar/wsstarpolicy/inc/assertion.h
webservices/wsstar/wsstarpolicy/inc/compositeassertion.h
webservices/wsstar/wsstarpolicy/inc/massertion.h
webservices/wsstar/wsstarpolicy/inc/msenwspolicy.h
webservices/wsstar/wsstarpolicy/inc/msenwspolicymanager.h
webservices/wsstar/wsstarpolicy/inc/policyassertion.h
webservices/wsstar/wsstarpolicy/inc/policyintersecter.h
webservices/wsstar/wsstarpolicy/inc/policymerger.h
webservices/wsstar/wsstarpolicy/inc/policynormalizer.h
webservices/wsstar/wsstarpolicy/inc/policyreferenceassertion.h
webservices/wsstar/wsstarpolicy/inc/primitiveassertion.h
webservices/wsstar/wsstarpolicy/inc/seninternalwspolicy.h
webservices/wsstar/wsstarpolicy/inc/senwspolicymanager.h
webservices/wsstar/wsstarpolicy/inc/wsdlpolicyattachment.h
webservices/wsstar/wsstarpolicy/inc/wspolicy.h
webservices/wsstar/wsstarpolicy/inc/wspolicyreader.h
webservices/wsstar/wsstarpolicy/inc/wspolicyregistry.h
webservices/wsstar/wsstarpolicy/inc/wspolicyutils.h
webservices/wsstar/wsstarpolicy/inc/wspolicywriter.h
webservices/wsstar/wsstarpolicy/inc/wssecuritypolicy.h
webservices/wsstar/wsstarpolicy/inc/wssecuritypolicyconstants.h
webservices/wsstar/wsstarpolicy/inc/xorcompositeassertion.h
webservices/wsstar/wsstarpolicy/rom/wsstarpolicy.iby
webservices/wsstar/wsstarpolicy/src/PolicyIntersecter.cpp
webservices/wsstar/wsstarpolicy/src/PolicyMerger.cpp
webservices/wsstar/wsstarpolicy/src/PolicyNormalizer.cpp
webservices/wsstar/wsstarpolicy/src/WSStarPolicyMain.cpp
webservices/wsstar/wsstarpolicy/src/WSStarPolicyProxy.cpp
webservices/wsstar/wsstarpolicy/src/WsSecurityPolicy.cpp
webservices/wsstar/wsstarpolicy/src/WsdlPolicyAttachment.cpp
webservices/wsstar/wsstarpolicy/src/andcompositeassertion.cpp
webservices/wsstar/wsstarpolicy/src/assertion.cpp
webservices/wsstar/wsstarpolicy/src/compositeassertion.cpp
webservices/wsstar/wsstarpolicy/src/policyassertion.cpp
webservices/wsstar/wsstarpolicy/src/policyreferenceassertion.cpp
webservices/wsstar/wsstarpolicy/src/primitiveassertion.cpp
webservices/wsstar/wsstarpolicy/src/seninternalwspolicy.cpp
webservices/wsstar/wsstarpolicy/src/senwspolicymanager.cpp
webservices/wsstar/wsstarpolicy/src/wspolicy.cpp
webservices/wsstar/wsstarpolicy/src/wspolicyreader.cpp
webservices/wsstar/wsstarpolicy/src/wspolicyregistry.cpp
webservices/wsstar/wsstarpolicy/src/wspolicyutils.cpp
webservices/wsstar/wsstarpolicy/src/wspolicywriter.cpp
webservices/wsstar/wsstarpolicy/src/xorcompositeassertion.cpp
webservices/wsutils/BMARM/SENUTILSU.DEF
webservices/wsutils/BWINS/SENUTILSU.DEF
webservices/wsutils/BWINSCW/SENUTILSU.DEF
webservices/wsutils/BWINSCW/SENUTILS_V2U.DEF
webservices/wsutils/eabi/SENUTILSu.DEF
webservices/wsutils/eabi/senutils_v2u.def
webservices/wsutils/group/bld.inf
webservices/wsutils/group/senutils.mmp
webservices/wsutils/inc/senattribute.h
webservices/wsutils/inc/senattributes.h
webservices/wsutils/inc/sencertutils.h
webservices/wsutils/inc/senchunk.h
webservices/wsutils/inc/sencryptoutils.h
webservices/wsutils/inc/sendebug.h
webservices/wsutils/inc/senguidgen.h
webservices/wsutils/inc/senidentifier.h
webservices/wsutils/inc/senpointermap.h
webservices/wsutils/inc/senpropertieselement.h
webservices/wsutils/inc/senpropertiesfragment.h
webservices/wsutils/inc/sensaxutils.h
webservices/wsutils/inc/senvtcptransportproperties.h
webservices/wsutils/inc/senwsaepr.h
webservices/wsutils/rom/wsutils.iby
webservices/wsutils/src/senattribute.cpp
webservices/wsutils/src/senattributes.cpp
webservices/wsutils/src/sencertutils.cpp
webservices/wsutils/src/senchunk.cpp
webservices/wsutils/src/sencryptoutils.cpp
webservices/wsutils/src/sendateutils.cpp
webservices/wsutils/src/senguidgen.cpp
webservices/wsutils/src/senhttptransportproperties.cpp
webservices/wsutils/src/senidentifier.cpp
webservices/wsutils/src/senpropertieselement.cpp
webservices/wsutils/src/senpropertiesfragment.cpp
webservices/wsutils/src/sensaxutils.cpp
webservices/wsutils/src/sensoapenvelope.cpp
webservices/wsutils/src/sensoapfault.cpp
webservices/wsutils/src/sensoapmessage.cpp
webservices/wsutils/src/sentransportproperties.cpp
webservices/wsutils/src/senutilsdll.cpp
webservices/wsutils/src/senvtcptransportproperties.cpp
webservices/wsutils/src/senwssecurityheader.cpp
webservices/wsutils/src/senxmlproperties.cpp
webservices/wsxml/BMARM/SENXMLU.DEF
webservices/wsxml/BWINS/SENXMLU.DEF
webservices/wsxml/BWINSCW/SENXMLU.DEF
webservices/wsxml/eabi/SENXMLu.DEF
webservices/wsxml/group/bld.inf
webservices/wsxml/group/senxml.mmp
webservices/wsxml/inc/msenfilteraction.h
webservices/wsxml/inc/msenfiltercollector.h
webservices/wsxml/inc/senfiltercondition.h
webservices/wsxml/inc/senfilterfragment.h
webservices/wsxml/inc/senfilterstatemachine.h
webservices/wsxml/inc/senxmldebug.h
webservices/wsxml/rom/wsxml.iby
webservices/wsxml/src/senbaseattribute.cpp
webservices/wsxml/src/senbaseelement.cpp
webservices/wsxml/src/senbasefragment.cpp
webservices/wsxml/src/sendomfragment.cpp
webservices/wsxml/src/senfiltercondition.cpp
webservices/wsxml/src/senfilterfragment.cpp
webservices/wsxml/src/senfilterstatemachine.cpp
webservices/wsxml/src/sennamespace.cpp
webservices/wsxml/src/senxmldll.cpp
webservices/wsxml/src/senxmlelement.cpp
webservices/wsxml/src/senxmlreader.cpp
webservices/wsxml/src/senxmlutils.cpp
websrv_pub/group/bld.inf
websrv_pub/hostlet_connection_api/group/bld.inf
websrv_pub/hostlet_connection_api/hostlet_connection_api.metaxml
websrv_pub/hostlet_connection_api/inc/MSenHostlet.h
websrv_pub/hostlet_connection_api/inc/MSenHostletRequest.h
websrv_pub/hostlet_connection_api/inc/MSenHostletResponse.h
websrv_pub/hostlet_connection_api/inc/SenHostletConnection.h
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/bmarm/hostletconnectionu.def
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/bwins/hostletconnectionbctestu.def
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/bwins/hostletconnectionu.def
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/eabi/HostletConnectionBCTestu.def
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/bld.inf
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/hostletconnection.mmp
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testframework.ini
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_c.bat
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_z.bat
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/inc/senhostletconnectionbctest.h
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/inc/testconsumer.h
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/inc/testhostlet.h
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.pkg
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.sis
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnection.cpp
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnectioncases.cpp
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/testconsumer.cpp
websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/testhostlet.cpp
websrv_pub/hostlet_connection_api/tsrc/group/bld.inf
websrv_pub/hostlet_connection_api/tsrc/hostconn/bmarm/hostletconnectionu.def
websrv_pub/hostlet_connection_api/tsrc/hostconn/bwins/hostletconnectionbctestu.def
websrv_pub/hostlet_connection_api/tsrc/hostconn/bwins/hostletconnectionu.def
websrv_pub/hostlet_connection_api/tsrc/hostconn/eabi/HostletConnectionBCTestu.def
websrv_pub/hostlet_connection_api/tsrc/hostconn/group/bld.inf
websrv_pub/hostlet_connection_api/tsrc/hostconn/group/hostconn.pkg
websrv_pub/hostlet_connection_api/tsrc/hostconn/group/hostletconnection.mmp
websrv_pub/hostlet_connection_api/tsrc/hostconn/init/HostletBCTest.ini
websrv_pub/hostlet_connection_api/tsrc/hostconn/rom/hostconn.iby
websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/HostletBCTest.ini
websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/hostconn.pkg
websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/hostconn.sis
websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/testframework.ini
websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/testhc_c.bat
websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/testhc_z.bat
websrv_pub/hostlet_connection_api/tsrc/hostconn/src/hostletconnection.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconn/src/hostletconnectioncases.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconn/src/testconsumer.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconn/src/testhostlet.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/Bmarm/hostconnTesterU.DEF
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/Bwins/hostconnTesterU.DEF
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/conf/hostconnTester.cfg
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/eabi/hostconnTesteru.def
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/bld.inf
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.mmp
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.pkg
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/inc/hostconnTester.h
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/inc/testconsumer.h
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/inc/testhostlet.h
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/init/TestFramework.ini
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/hostconnTester.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/hostconnTesterBlocks.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/testconsumer.cpp
websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/testhostlet.cpp
websrv_pub/web_service_connection_api/group/bld.inf
websrv_pub/web_service_connection_api/inc/MSenAuthenticationProvider.h
websrv_pub/web_service_connection_api/inc/MSenProperties.h
websrv_pub/web_service_connection_api/inc/MSenProperty.h
websrv_pub/web_service_connection_api/inc/MSenServiceConsumer.h
websrv_pub/web_service_connection_api/inc/SenDateUtils.h
websrv_pub/web_service_connection_api/inc/SenHttpTransportProperties.h
websrv_pub/web_service_connection_api/inc/SenServiceConnection.h
websrv_pub/web_service_connection_api/inc/SenSoapConstants.h
websrv_pub/web_service_connection_api/inc/SenSoapEnvelope.h
websrv_pub/web_service_connection_api/inc/SenSoapFault.h
websrv_pub/web_service_connection_api/inc/SenSoapMessage.h
websrv_pub/web_service_connection_api/inc/SenTransportProperties.h
websrv_pub/web_service_connection_api/inc/SenWsSecurityHeader.h
websrv_pub/web_service_connection_api/inc/SenXmlProperties.h
websrv_pub/web_service_connection_api/inc/msencobrandinginterface.h
websrv_pub/web_service_connection_api/inc/sencryptoutils.h
websrv_pub/web_service_connection_api/inc/senpointermap.h
websrv_pub/web_service_connection_api/inc/senserviceconnectioninterfaces.h
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/Bmarm/SenConnectionTimeoutsTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/Bwins/SenConnectionTimeoutsTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/conf/SenConnectionTimeoutsTester.cfg
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/eabi/SenConnectionTimeoutsTesteru.def
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/group/SenConnectionTimeoutsTester.mmp
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/group/SenConnectionTimeoutsTester.pkg
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/inc/SenConnectionTimeoutsTester.h
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/init/TestFramework.ini
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/src/SenConnectionTimeoutsTester.cpp
websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/src/SenConnectionTimeoutsTesterBlocks.cpp
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/Bmarm/SenLayeredPropertiesTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/Bwins/SenLayeredPropertiesTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/conf/SenLayeredPropertiesTester.cfg
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/eabi/SenLayeredPropertiesTesteru.def
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/group/SenLayeredPropertiesTester.mmp
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/group/SenLayeredPropertiesTester.pkg
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/inc/SenLayeredPropertiesTester.h
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/init/TestFramework.ini
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/src/SenLayeredPropertiesTester.cpp
websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/src/SenLayeredPropertiesTesterBlocks.cpp
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/Bmarm/WsStarMessageHandlerTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/Bwins/WsStarMessageHandlerTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/conf/WsStarMessageHandlerTester.cfg
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/eabi/WsStarMessageHandlerTesteru.def
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/group/WsStarMessageHandlerTester.mmp
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/group/WsStarMessageHandlerTester.pkg
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/inc/WsStarMessageHandlerTester.h
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/init/TestFramework.ini
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/src/WsStarMessageHandlerTester.cpp
websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/src/WsStarMessageHandlerTesterBlocks.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/bmarm/SenServiceConnectionBCTest.def
websrv_pub/web_service_connection_api/tsrc/bc/connection/bwins/SenServiceConnectionBCTest.def
websrv_pub/web_service_connection_api/tsrc/bc/connection/bwins/SenServiceConnectionBCTestu.def
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/Thumbs.db
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/sunset.jpg
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/sunset2.jpg
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/testpic3.jpg
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/testpic4.jpg
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/winter.jpg
websrv_pub/web_service_connection_api/tsrc/bc/connection/data/winter2.jpg
websrv_pub/web_service_connection_api/tsrc/bc/connection/eabi/SenServiceConnectionBCTestu.def
websrv_pub/web_service_connection_api/tsrc/bc/connection/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/bc/connection/group/senserviceconnection.mmp
websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testframework.ini
websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_c.bat
websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_z.bat
websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/SenServiceConnectionBCTest.h
websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/TestConnection.h
websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testconsumer.h
websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testfileobserver.h
websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testproperty.h
websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testprovider.h
websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.pkg
websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.sis
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/TestConnection.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnection.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnectioncases.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testconsumer.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testfileobserver.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testproperty.cpp
websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testprovider.cpp
websrv_pub/web_service_connection_api/tsrc/bc/senutils/bmarm/senutilsbctestu.def
websrv_pub/web_service_connection_api/tsrc/bc/senutils/bwins/senutilsbctestu.def
websrv_pub/web_service_connection_api/tsrc/bc/senutils/eabi/SenUtilsBCTestu.def
websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/senutils.mmp
websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testframework.ini
websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_c.bat
websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_z.bat
websrv_pub/web_service_connection_api/tsrc/bc/senutils/inc/senutilsbctest.h
websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.pkg
websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.sis
websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutils.cpp
websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutilscases.cpp
websrv_pub/web_service_connection_api/tsrc/connection/bmarm/SenServiceConnectionBCTest.def
websrv_pub/web_service_connection_api/tsrc/connection/bwins/SenServiceConnectionBCTest.def
websrv_pub/web_service_connection_api/tsrc/connection/bwins/SenServiceConnectionBCTestu.def
websrv_pub/web_service_connection_api/tsrc/connection/data/Thumbs.db
websrv_pub/web_service_connection_api/tsrc/connection/data/sunset.jpg
websrv_pub/web_service_connection_api/tsrc/connection/data/sunset2.jpg
websrv_pub/web_service_connection_api/tsrc/connection/data/testpic3.jpg
websrv_pub/web_service_connection_api/tsrc/connection/data/testpic4.jpg
websrv_pub/web_service_connection_api/tsrc/connection/data/winter.jpg
websrv_pub/web_service_connection_api/tsrc/connection/data/winter2.jpg
websrv_pub/web_service_connection_api/tsrc/connection/eabi/SenServiceConnectionBCTestu.def
websrv_pub/web_service_connection_api/tsrc/connection/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/connection/group/connection.pkg
websrv_pub/web_service_connection_api/tsrc/connection/group/senserviceconnection.mmp
websrv_pub/web_service_connection_api/tsrc/connection/inc/SenServiceConnectionBCTest.h
websrv_pub/web_service_connection_api/tsrc/connection/inc/TestConnection.h
websrv_pub/web_service_connection_api/tsrc/connection/inc/testconsumer.h
websrv_pub/web_service_connection_api/tsrc/connection/inc/testfileobserver.h
websrv_pub/web_service_connection_api/tsrc/connection/inc/testproperty.h
websrv_pub/web_service_connection_api/tsrc/connection/inc/testprovider.h
websrv_pub/web_service_connection_api/tsrc/connection/init/ConnectionBCTest.ini
websrv_pub/web_service_connection_api/tsrc/connection/rom/connection.iby
websrv_pub/web_service_connection_api/tsrc/connection/sis/ConnectionBCTest.ini
websrv_pub/web_service_connection_api/tsrc/connection/sis/connection.pkg
websrv_pub/web_service_connection_api/tsrc/connection/sis/sis.cmd
websrv_pub/web_service_connection_api/tsrc/connection/sis/testframework.ini
websrv_pub/web_service_connection_api/tsrc/connection/sis/testsc_c.bat
websrv_pub/web_service_connection_api/tsrc/connection/sis/testsc_z.bat
websrv_pub/web_service_connection_api/tsrc/connection/sis/ut_connection.sis
websrv_pub/web_service_connection_api/tsrc/connection/sis/ut_connectionx.sis
websrv_pub/web_service_connection_api/tsrc/connection/src/TestConnection.cpp
websrv_pub/web_service_connection_api/tsrc/connection/src/senserviceconnection.cpp
websrv_pub/web_service_connection_api/tsrc/connection/src/senserviceconnectioncases.cpp
websrv_pub/web_service_connection_api/tsrc/connection/src/testconsumer.cpp
websrv_pub/web_service_connection_api/tsrc/connection/src/testfileobserver.cpp
websrv_pub/web_service_connection_api/tsrc/connection/src/testproperty.cpp
websrv_pub/web_service_connection_api/tsrc/connection/src/testprovider.cpp
websrv_pub/web_service_connection_api/tsrc/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/Bmarm/senConnectionTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/Bwins/senConnectionTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/conf/senConnectionTester.cfg
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/eabi/senConnectionTesteru.def
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/group/senConnectionTester.mmp
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/group/senConnectionTester.pkg
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/inc/senConnectionTester.h
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/init/TestFramework.ini
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/src/senConnectionTester.cpp
websrv_pub/web_service_connection_api/tsrc/senConnectionTester/src/senConnectionTesterBlocks.cpp
websrv_pub/web_service_connection_api/tsrc/senutils/bmarm/senutilsbctestu.def
websrv_pub/web_service_connection_api/tsrc/senutils/bwins/senutilsbctestu.def
websrv_pub/web_service_connection_api/tsrc/senutils/eabi/SenUtilsBCTestu.def
websrv_pub/web_service_connection_api/tsrc/senutils/group/SenUtilsBCTest_UID_.cpp
websrv_pub/web_service_connection_api/tsrc/senutils/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/senutils/group/senutils.mmp
websrv_pub/web_service_connection_api/tsrc/senutils/group/senutils.pkg
websrv_pub/web_service_connection_api/tsrc/senutils/inc/senutilsbctest.h
websrv_pub/web_service_connection_api/tsrc/senutils/init/SenUtilsBCTest.ini
websrv_pub/web_service_connection_api/tsrc/senutils/rom/senutils.iby
websrv_pub/web_service_connection_api/tsrc/senutils/sis/SenUtilsBCTest.ini
websrv_pub/web_service_connection_api/tsrc/senutils/sis/senutils.pkg
websrv_pub/web_service_connection_api/tsrc/senutils/sis/senutils.sis
websrv_pub/web_service_connection_api/tsrc/senutils/sis/testframework.ini
websrv_pub/web_service_connection_api/tsrc/senutils/sis/testsu_c.bat
websrv_pub/web_service_connection_api/tsrc/senutils/sis/testsu_z.bat
websrv_pub/web_service_connection_api/tsrc/senutils/src/senutils.cpp
websrv_pub/web_service_connection_api/tsrc/senutils/src/senutilscases.cpp
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/BWINSCW/senutilsTestCasesU.DEF
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/conf/senutilsTestCases.cfg
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/eabi/senutilsTestCasesu.def
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.mmp
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.pkg
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/inc/senutilsTestCases.h
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/init/TestFramework.ini
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/src/senutilsTestCases.cpp
websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/src/senutilsTestCasesBlocks.cpp
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/Bmarm/wsPolicyTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/Bwins/wsPolicyTesterU.DEF
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/conf/wsPolicyTester.cfg
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/eabi/wsPolicyTesteru.def
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/group/bld.inf
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/group/wsPolicyTester.mmp
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/group/wsPolicyTester.pkg
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/inc/myxml.h
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/inc/testinternalwspolicy.h
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/inc/wsPolicyTester.h
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/init/TestFramework.ini
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/myxml.cpp
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/testinternalwspolicy.cpp
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/wsPolicyTester.cpp
websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/wsPolicyTesterBlocks.cpp
websrv_pub/web_service_connection_api/tsrc/wsstarPluginTester/init/TestFramework.ini
websrv_pub/web_service_connection_api/web_service_connection_api.metaxml
websrv_pub/web_service_description_api/group/bld.inf
websrv_pub/web_service_description_api/inc/MSenConsumerPolicy.h
websrv_pub/web_service_description_api/inc/MSenIdentityProviderIdArray.h
websrv_pub/web_service_description_api/inc/MSenProviderPolicy.h
websrv_pub/web_service_description_api/inc/MSenServiceDescription.h
websrv_pub/web_service_description_api/inc/MSenServicePolicy.h
websrv_pub/web_service_description_api/inc/SenCredential.h
websrv_pub/web_service_description_api/inc/SenCredential2.h
websrv_pub/web_service_description_api/inc/SenFacet.h
websrv_pub/web_service_description_api/inc/SenIdentityProvider.h
websrv_pub/web_service_description_api/inc/SenIdentityProviderIdArray8.h
websrv_pub/web_service_description_api/inc/SenServicePattern.h
websrv_pub/web_service_description_api/inc/SenXmlServiceDescription.h
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/bmarm/SenServDescBCTestU.DEF
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/bwins/SenServDescBCTestU.DEF
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/eabi/SenServDescBCTestu.DEF
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/group/SenServDesc.mmp
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/group/bld.inf
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/inc/SenServDescBCTest.h
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/inc/TestServiceDescription.h
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.SIS
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.pkg
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_c.bat
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_z.bat
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/testframework.ini
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDesc.cpp
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDescCases.cpp
websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/TestServiceDescription.cpp
websrv_pub/web_service_description_api/tsrc/group/bld.inf
websrv_pub/web_service_description_api/tsrc/senservdesc/bmarm/senservdescbctestu.def
websrv_pub/web_service_description_api/tsrc/senservdesc/bwins/senservdescbctestu.def
websrv_pub/web_service_description_api/tsrc/senservdesc/eabi/SenServDescBCTestu.def
websrv_pub/web_service_description_api/tsrc/senservdesc/group/SenServDescBCTest_UID_.cpp
websrv_pub/web_service_description_api/tsrc/senservdesc/group/bld.inf
websrv_pub/web_service_description_api/tsrc/senservdesc/group/senservdesc.mmp
websrv_pub/web_service_description_api/tsrc/senservdesc/group/senservdesc.pkg
websrv_pub/web_service_description_api/tsrc/senservdesc/inc/TestServiceDescription.h
websrv_pub/web_service_description_api/tsrc/senservdesc/inc/senservdescbctest.h
websrv_pub/web_service_description_api/tsrc/senservdesc/init/SenServDescBCTest.ini
websrv_pub/web_service_description_api/tsrc/senservdesc/rom/senservdesc.iby
websrv_pub/web_service_description_api/tsrc/senservdesc/sis/SenServDescBCTest.ini
websrv_pub/web_service_description_api/tsrc/senservdesc/sis/senservdesc.pkg
websrv_pub/web_service_description_api/tsrc/senservdesc/sis/senservdesc.sis
websrv_pub/web_service_description_api/tsrc/senservdesc/sis/testframework.ini
websrv_pub/web_service_description_api/tsrc/senservdesc/sis/testsd_c.bat
websrv_pub/web_service_description_api/tsrc/senservdesc/sis/testsd_z.bat
websrv_pub/web_service_description_api/tsrc/senservdesc/src/TestServiceDescription.cpp
websrv_pub/web_service_description_api/tsrc/senservdesc/src/senservdesc.cpp
websrv_pub/web_service_description_api/tsrc/senservdesc/src/senservdesccases.cpp
websrv_pub/web_service_description_api/tsrc/senservdescTester/Bmarm/senservdescTesterU.DEF
websrv_pub/web_service_description_api/tsrc/senservdescTester/Bwins/senservdescTesterU.DEF
websrv_pub/web_service_description_api/tsrc/senservdescTester/conf/senservdescTester.cfg
websrv_pub/web_service_description_api/tsrc/senservdescTester/eabi/senservdescTesteru.def
websrv_pub/web_service_description_api/tsrc/senservdescTester/group/bld.inf
websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.mmp
websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.pkg
websrv_pub/web_service_description_api/tsrc/senservdescTester/inc/TestServiceDescription.h
websrv_pub/web_service_description_api/tsrc/senservdescTester/inc/senservdescTester.h
websrv_pub/web_service_description_api/tsrc/senservdescTester/init/TestFramework.ini
websrv_pub/web_service_description_api/tsrc/senservdescTester/src/TestServiceDescription.cpp
websrv_pub/web_service_description_api/tsrc/senservdescTester/src/senservdescTester.cpp
websrv_pub/web_service_description_api/tsrc/senservdescTester/src/senservdescTesterBlocks.cpp
websrv_pub/web_service_description_api/web_service_description_api.metaxml
websrv_pub/web_service_manager_api/group/bld.inf
websrv_pub/web_service_manager_api/inc/SenServiceManager.h
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/bmarm/SenServiceManagerBCTestU.DEF
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/bwins/SenServiceManagerBCTestU.DEF
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/eabi/SenServiceManagerBCTestu.DEF
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/group/SenServiceManager.mmp
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/group/bld.inf
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/inc/SenServiceManagerBCTest.h
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.SIS
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.pkg
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_c.bat
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_z.bat
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/testframework.ini
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManager.cpp
websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManagerCases.cpp
websrv_pub/web_service_manager_api/tsrc/group/bld.inf
websrv_pub/web_service_manager_api/tsrc/senservicemanager/bmarm/senservicemanagerbctestu.def
websrv_pub/web_service_manager_api/tsrc/senservicemanager/bwins/SenServiceManagerBCTestu.def
websrv_pub/web_service_manager_api/tsrc/senservicemanager/eabi/senservicemanagerbctestu.def
websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/SenServiceManagerBCTest_UID_.cpp
websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/bld.inf
websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/senservicemanager.mmp
websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/senservicemanager.pkg
websrv_pub/web_service_manager_api/tsrc/senservicemanager/inc/senservicemanagerbctest.h
websrv_pub/web_service_manager_api/tsrc/senservicemanager/init/SenServiceManagerBCTest.ini
websrv_pub/web_service_manager_api/tsrc/senservicemanager/rom/senservicemanager.iby
websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/SenServiceManagerBCTest.ini
websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/senservicemanager.pkg
websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/senservicemanager.sis
websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/testframework.ini
websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/testsm_c.bat
websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/testsm_z.bat
websrv_pub/web_service_manager_api/tsrc/senservicemanager/src/senservicemanager.cpp
websrv_pub/web_service_manager_api/tsrc/senservicemanager/src/senservicemanagercases.cpp
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/Bmarm/senservicemanagerTesterU.DEF
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/Bwins/senservicemanagerTesterU.DEF
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/conf/senservicemanagerTester.cfg
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/eabi/senservicemanagerTesteru.def
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/bld.inf
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.mmp
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.pkg
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/inc/senservicemanagerTester.h
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/init/TestFramework.ini
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/src/senservicemanagerTester.cpp
websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/src/senservicemanagerTesterBlocks.cpp
websrv_pub/web_service_manager_api/web_service_manager_api.metaxml
websrv_pub/web_service_messaging_api/group/bld.inf
websrv_pub/web_service_messaging_api/inc/MSenMessage.h
websrv_pub/web_service_messaging_api/inc/SenSoapEnvelope2.h
websrv_pub/web_service_messaging_api/inc/SenSoapFault2.h
websrv_pub/web_service_messaging_api/inc/SenSoapMessage2.h
websrv_pub/web_service_messaging_api/inc/SenWsSecurityHeader2.h
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/bwins/newsoapclassesbctestu.def
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/eabi/NewSoapClassesBCTestu.def
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/bld.inf
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/newsoapclasses.mmp
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testframework.ini
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_c.bat
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_z.bat
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/inc/newsoapclassesbctest.h
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/inc/testmsenmessage.h
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.pkg
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.sis
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclasses.cpp
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclassescases.cpp
websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/testmsenmessage.cpp
websrv_pub/web_service_messaging_api/tsrc/group/bld.inf
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/bwins/newsoapclassesbctestu.def
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/eabi/NewSoapClassesBCTestu.def
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group/bld.inf
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group/newsoapclasses.mmp
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group/newsoapclasses.pkg
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/inc/newsoapclassesbctest.h
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/inc/testmsenmessage.h
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/init/NewSoapClassesBCTest.ini
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/rom/newsoapclasses.iby
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/NewSoapClassesBCTest.ini
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/newsoapclasses.pkg
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/testframework.ini
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/testnsc_c.bat
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/testnsc_z.bat
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/src/newsoapclasses.cpp
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/src/newsoapclassescases.cpp
websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/src/testmsenmessage.cpp
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/Bmarm/newsoapclassesTesterU.DEF
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/Bwins/newsoapclassesTesterU.DEF
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/conf/newsoapclassesTester.cfg
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/eabi/newsoapclassesTesteru.def
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/bld.inf
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.mmp
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.pkg
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/inc/newsoapclassesTester.h
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/init/TestFramework.ini
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/src/newsoapclassesTester.cpp
websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/src/newsoapclassesTesterBlocks.cpp
websrv_pub/web_service_messaging_api/web_service_messaging_api.metaxml
websrv_pub/xml_extensions_api/group/bld.inf
websrv_pub/xml_extensions_api/inc/MSenContentHandlerClient.h
websrv_pub/xml_extensions_api/inc/MSenElement.h
websrv_pub/xml_extensions_api/inc/MSenFragment.h
websrv_pub/xml_extensions_api/inc/SenBaseAttribute.h
websrv_pub/xml_extensions_api/inc/SenBaseElement.h
websrv_pub/xml_extensions_api/inc/SenBaseFragment.h
websrv_pub/xml_extensions_api/inc/SenDomFragment.h
websrv_pub/xml_extensions_api/inc/SenElement.h
websrv_pub/xml_extensions_api/inc/SenFragment.h
websrv_pub/xml_extensions_api/inc/SenNameSpace.h
websrv_pub/xml_extensions_api/inc/SenXmlConstants.h
websrv_pub/xml_extensions_api/inc/SenXmlElement.h
websrv_pub/xml_extensions_api/inc/SenXmlReader.h
websrv_pub/xml_extensions_api/inc/SenXmlUtils.h
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/Bwins/WSTesterU.DEF
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/WS.zip
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/eabi/WSTesteru.def
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/WSTester.mmp
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/bld.inf
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/ConnectionTimer.h
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/SAXTester.h
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/WSTester.h
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.pkg
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.sis
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/TestInit.bat
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/ConnectionTimer.cpp
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/SAXTester.cpp
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTester.cpp
websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp
websrv_pub/xml_extensions_api/tsrc/group/bld.inf
websrv_pub/xml_extensions_api/tsrc/senxml/bwins/senxmlbctestu.def
websrv_pub/xml_extensions_api/tsrc/senxml/eabi/SenXmlBCTestu.def
websrv_pub/xml_extensions_api/tsrc/senxml/group/SenXmlBCTest_UID_.cpp
websrv_pub/xml_extensions_api/tsrc/senxml/group/bld.inf
websrv_pub/xml_extensions_api/tsrc/senxml/group/senxml.mmp
websrv_pub/xml_extensions_api/tsrc/senxml/group/senxml.pkg
websrv_pub/xml_extensions_api/tsrc/senxml/group/wf_constraint_elem.xml
websrv_pub/xml_extensions_api/tsrc/senxml/inc/senxmlbctest.h
websrv_pub/xml_extensions_api/tsrc/senxml/inc/testxml.h
websrv_pub/xml_extensions_api/tsrc/senxml/init/SenXmlBCTest.ini
websrv_pub/xml_extensions_api/tsrc/senxml/rom/senxml.iby
websrv_pub/xml_extensions_api/tsrc/senxml/sis/SenXmlBCTest.ini
websrv_pub/xml_extensions_api/tsrc/senxml/sis/senxml.pkg
websrv_pub/xml_extensions_api/tsrc/senxml/sis/senxml.sis
websrv_pub/xml_extensions_api/tsrc/senxml/sis/testframework.ini
websrv_pub/xml_extensions_api/tsrc/senxml/sis/testsx_c.bat
websrv_pub/xml_extensions_api/tsrc/senxml/sis/testsx_z.bat
websrv_pub/xml_extensions_api/tsrc/senxml/src/senxml.cpp
websrv_pub/xml_extensions_api/tsrc/senxml/src/senxmlcases.cpp
websrv_pub/xml_extensions_api/tsrc/senxml/src/testxml.cpp
websrv_pub/xml_extensions_api/tsrc/senxmlTester/Bmarm/senxmlTesterU.DEF
websrv_pub/xml_extensions_api/tsrc/senxmlTester/Bwins/senxmlTesterU.DEF
websrv_pub/xml_extensions_api/tsrc/senxmlTester/conf/senxmlTester.cfg
websrv_pub/xml_extensions_api/tsrc/senxmlTester/eabi/senxmlTesteru.def
websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/bld.inf
websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.mmp
websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.pkg
websrv_pub/xml_extensions_api/tsrc/senxmlTester/inc/senxmlTester.h
websrv_pub/xml_extensions_api/tsrc/senxmlTester/inc/testxml.h
websrv_pub/xml_extensions_api/tsrc/senxmlTester/init/TestFramework.ini
websrv_pub/xml_extensions_api/tsrc/senxmlTester/src/senxmlTester.cpp
websrv_pub/xml_extensions_api/tsrc/senxmlTester/src/senxmlTesterBlocks.cpp
websrv_pub/xml_extensions_api/tsrc/senxmlTester/src/testxml.cpp
websrv_pub/xml_extensions_api/xml_extensions_api.metaxml
websrv_pub/xml_fragment_api/group/bld.inf
websrv_pub/xml_fragment_api/inc/RSenDocument.h
websrv_pub/xml_fragment_api/inc/SenDomFragmentBase.h
websrv_pub/xml_fragment_api/inc/SenFragmentBase.h
websrv_pub/xml_fragment_api/inc/SenParser.h
websrv_pub/xml_fragment_api/tsrc/group/bld.inf
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/Bmarm/SenFragmentTesterU.DEF
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/Bwins/SenFragmentTesterU.DEF
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/conf/SenFragmentTester.cfg
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/eabi/SenFragmentTesteru.def
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/group/SenFragmentTester.mmp
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/group/SenFragmentTester.pkg
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/group/bld.inf
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/SenFragmentTester.h
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/delegatedomfragment.h
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/delegatefragment.h
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/maindomfragment.h
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/mainfragment.h
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/init/TestFramework.ini
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/SenFragmentTester.cpp
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/SenFragmentTesterBlocks.cpp
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/delegatedomfragment.cpp
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/delegatefragment.cpp
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/maindomfragment.cpp
websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/mainfragment.cpp
websrv_pub/xml_fragment_api/xml_fragment_api.metaxml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for websrv
+*
+*/
+#include "../webservices/inc/webservices.hrh"
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+#include "../websrv_pub/group/bld.inf"
+#include "../webservices/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/mw/websrv" >
+]>
+
+<SystemDefinition name="websrv" schema="1.4.0">
+  <systemModel>
+    <layer name="mw_layer">
+      <module name="websrv">
+        <unit unitID="WSDo.websrv" mrp="" bldFile="&layer_real_source_path;/group" name="websrv" />        
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+  <package id="websrv" name="Web Services" levels="plugin framework server generic specific">
+    <collection id="webservices" name="Web Services Framework" level="generic">
+    	<!-- consider breaking this collection into more meaningful subsets -->
+      <component id="wsnotifierplugins" filter="s60" name="WS Notifier Plugins" class="plugin">
+        <unit bldFile="webservices/wsnotifierplugins/group"/>
+      </component>
+      <component id="wslogger" filter="s60" name="WS Logger">
+        <unit bldFile="webservices/wslogger/group"/>
+      </component>
+      <component id="wsxml" filter="s60" name="WS XML Extensions">
+        <unit bldFile="webservices/wsxml/group"/>
+      </component>
+      <component id="wsutils" filter="s60" name="WS Utils">
+        <unit bldFile="webservices/wsutils/group"/>
+      </component>
+      <component id="wsfragment" filter="s60" name="WS Fragment">
+        <unit bldFile="webservices/wsfragment/group"/>
+      </component>
+      <component id="wsdescription" filter="s60" name="WS Service Description">
+        <unit bldFile="webservices/wsdescription/group"/>
+      </component>
+      <component id="wshttpchanneltransportplugin" filter="s60" name="WS HTTP Channel Transport Plugin" class="plugin">
+        <unit bldFile="webservices/wshttpchanneltransportplugin/group"/>
+      </component>
+      <component id="wsconnection" filter="s60" name="WS Service Connection">
+        <unit bldFile="webservices/wsconnection/group"/>
+      </component>
+      <component id="wshostletconnection" filter="s60" name="WS Hostlet Connection">
+        <unit bldFile="webservices/wshostletconnection/group"/>
+      </component>
+      <component id="wscredentialmanager" filter="s60" name="WS Credential Manager">
+        <unit bldFile="webservices/wscredentialmanager/group"/>
+      </component>
+      <component id="wsmanager" filter="s60" name="WS Service Manager">
+        <unit bldFile="webservices/wsmanager/group"/>
+      </component>
+      <component id="wsidentitymanager" filter="s60" name="WS Identity Manager">
+        <unit bldFile="webservices/wsidentitymanager/group"/>
+      </component>
+      <component id="wsframework" filter="s60" name="WS Framework">
+        <unit bldFile="webservices/wsframework/group"/>
+      </component>
+      <component id="wsmessages" filter="s60" name="WS Messages">
+        <unit bldFile="webservices/wsmessages/group"/>
+      </component>
+      <component id="wsconnectionagent" filter="s60" name="WS Connection Agent">
+        <unit bldFile="webservices/wsconnectionagent/group"/>
+      </component>
+      <component id="idwsfplugin" filter="s60" name="ID-WSF Plugin" class="plugin">
+        <unit bldFile="webservices/idwsfplugin/group"/>
+      </component>
+      <component id="wsibasicplugin" filter="s60" name="WS-I Basic Plugin" class="plugin">
+        <unit bldFile="webservices/wsibasicplugin/group"/>
+      </component>
+      <component id="wsrestplugin" filter="s60" name="WS REST Plugin" class="plugin">
+        <unit bldFile="webservices/wsrestplugin/group"/>
+      </component>
+      <component id="idwsfsecuritymechanism" filter="s60" name="ID-WSF Security Mechanism">
+        <unit bldFile="webservices/idwsfsecuritymechanism/group"/>
+      </component>
+      <component id="wspasswordtransforms" filter="s60" name="WS Password Transforms">
+        <unit bldFile="webservices/wspasswordtransforms/group"/>
+      </component>
+      <component id="wscore" filter="s60" name="WS Core Service Manager">
+        <unit bldFile="webservices/wscore/group"/>
+      </component>
+      <component id="wsprovider" filter="s60" name="WS Provider">
+        <unit bldFile="webservices/wsprovider/group"/>
+      </component>
+      <component id="wslocaltransportplugin" filter="s60" name="WS Local Transport Plugin" class="plugin">
+        <unit bldFile="webservices/wslocaltransportplugin/group"/>
+      </component>
+      <component id="wshostlettransportplugin" filter="s60" name="WS Hostlet Transport Plugin" class="plugin">
+        <unit bldFile="webservices/wshostlettransportplugin/group"/>
+      </component>
+      <component id="wsstar" filter="s60" name="WS Star">
+        <!-- <unit bldFile="webservices/wsstar/group"/> -->
+      </component>
+      <component id="wsoviplugin" filter="s60" name="WS Ovi Plugin">
+        <unit bldFile="webservices/wsoviplugin/group"/>
+      </component>
+      <component id="webservices_build" filter="s60" name="Web Services Build">
+        <unit bldFile="webservices/group"/>
+      </component>
+    </collection>
+    <collection id="websrv_info" name="Web Services Info" level="specific">
+      <component id="websrv_pub" filter="s60" name="Web Services Public Interfaces" class="api">
+        <unit bldFile="websrv_pub/group"/>
+        	<!-- should these be #included? -->
+        <!-- <unit bldFile="websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group"/> -->
+        <!-- <unit bldFile="websrv_pub/hostlet_connection_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/hostlet_connection_api/tsrc/hostconn/group"/> -->
+        <!-- <unit bldFile="websrv_pub/hostlet_connection_api/tsrc/hostconntester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/bc/connection/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/bc/senutils/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/connection/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/senconnectiontester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/senconnectiontimeoutstester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/senlayeredpropertiestester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/senutils/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/senutilstestcases/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/wspolicytester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_connection_api/tsrc/wsstarmessagehandlertester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_description_api/tsrc/bc/senservdesc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_description_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_description_api/tsrc/senservdesc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_description_api/tsrc/senservdesctester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_manager_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_manager_api/tsrc/senservicemanager/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_manager_api/tsrc/senservicemanagertester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_messaging_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group"/> -->
+        <!-- <unit bldFile="websrv_pub/web_service_messaging_api/tsrc/newsoapclassestester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/xml_extensions_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/xml_extensions_api/tsrc/senxml/group"/> -->
+        <!-- <unit bldFile="websrv_pub/xml_extensions_api/tsrc/senxmltester/group"/> -->
+        <!-- <unit bldFile="websrv_pub/xml_fragment_api/tsrc/group"/> -->
+        <!-- <unit bldFile="websrv_pub/xml_fragment_api/tsrc/senfragmenttester/group"/> -->
+      </component>
+    </collection>
+  </package>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/group/backup_registration.xml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+    <passive_backup>
+      <include_directory name = "\"/>
+    </passive_backup>
+    <restore requires_reboot = "no"/>
+</backup_registration>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for webservices
+*
+*/
+
+
+#include "../inc/webservices.hrh"
+
+// S60 5.x edition, or newer:
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+//../internal/secpol.xml                                      /epoc32/winscw/c/secpol.xml
+//../internal/WLMServiceCodePages.xml                         /Epoc32/winscw/c/Data/WindowsLive/WLMServiceCodePages.xml
+
+//Backup registration file
+backup_registration.xml                                     /epoc32/data/z/private/101F96F4/backup_registration.xml
+backup_registration.xml                                     /epoc32/release/winscw/udeb/z/private/101F96F4/backup_registration.xml
+backup_registration.xml                                     /epoc32/release/winscw/urel/z/private/101F96F4/backup_registration.xml
+
+PRJ_MMPFILES
+
+#include "../wsnotifierplugins/group/bld.inf"		//SenNotPluginDlgClient.inf
+#include "../wslogger/group/bld.inf"   //SenLogger.inf
+#include "../wsxml/group/bld.inf"   //SenXml.inf
+#include "../wsutils/group/bld.inf"   //SenUtils.inf
+#include "../wsfragment/group/bld.inf"   //SenFragment.inf 
+
+#include "../wsdescription/group/bld.inf"   //SenServiceDescription.inf
+
+#include "../wsconnection/group/bld.inf"   //SenServiceConnection.inf
+
+#include "../wsmessages/group/bld.inf"	//SenMessages.inf
+#include "../wscredentialmanager/group/bld.inf"   //SenCredentialManager.inf
+#include "../wsframework/group/bld.inf"   //SenFramework.inf
+#include "../wshttpchanneltransportplugin/group/bld.inf"   //SenHttpChannelTransportPlugin.inf
+#include "../wsconnectionagent/group/bld.inf"
+// Web Service Provider utility (Hostlet request & response) library:
+#include "../wsprovider/group/bld.inf"   //SenProvider.inf
+#include "../wshostletconnection/group/bld.inf"   //SenHostletConnection.inf
+
+
+#include "../wsmanager/group/bld.inf"   //SenServiceManager.inf
+#include "../wsidentitymanager/group/bld.inf"   //SenIdentityManager.inf
+
+
+#include "../idwsfplugin/group/bld.inf"   //SenIdWsfPlugin.inf
+#include "../wsibasicplugin/group/bld.inf"   //SenWsiBasicPlugin.inf
+#include "../wsrestplugin/group/bld.inf"   //SenRestPlugin.inf
+#include "../idwsfsecuritymechanism/group/bld.inf"   //SenIdWsfSecurityMechanism.inf
+#include "../wspasswordtransforms/group/bld.inf"   //SenPasswordTransforms.inf
+
+// Core Service Manager (Symbian server):
+#include "../wscore/group/bld.inf"   //SenCore.inf
+
+
+
+// Local Transport plug-in (proxy for Local Providers)
+#include "../wslocaltransportplugin/group/bld.inf"   //SenLocalTransportPlugin.inf
+
+#include "../wshostlettransportplugin/group/bld.inf"   //SenHostletTransportPlugin.inf
+
+// WS Star components
+#include "../wsstar/wsstarpolicy/group/bld.inf"   //WSPolicy.inf
+#include "../wsstar/wsstarplugin/group/bld.inf"   //WSStarPlugin.inf
+#include "../wsstar/wsstarmessagehandlers/group/bld.inf"   //WSStarMessageHandlers.inf
+
+//NCIM Components
+#include "../wsoviplugin/group/bld.inf"
+
+#ifdef __BUILD_VTCP_
+	#include "../internal/v2tomcl/wsvtcp/vtcp/group/bld.inf" //vtcp.inf
+	#include "../internal/v2tomcl/wsvtcp/vtcpchanneltransport/group/bld.inf" //vtcpchanneltransport.inf
+#endif //__BUILD_VTCP_
+
+// ATOM-PUB 
+//#include "../wsatompubplugin/group/bld.inf"
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/data/101f96f8.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ID-WSF Service Invocation ECOM plugin
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include <ecom/registryinfo.rh>
+ 
+// #include <ecom/RegistryInfoV2.rh> // RESOURCE_FORMAT_VERSION_2
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+//    resource.format.version = RESOURCE_FORMAT_VERSION_2; // to enable use of "rom_only" field
+    
+    // UID for the DLL
+    dll_uid = 0x101F96F8;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96F9;
+            implementations = 
+                {
+                // Info for CSenIdWsfPlugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FA;
+                    version_no         = 1;
+                    display_name       = "SenIdWsfPlugin SIF";
+                    default_data       = "com.nokia.Sen.idwsf.IdentityBasedWebServicesFramework";
+                    opaque_data        = "";
+//                    rom_only           = 0; // can be overridden in ram
+                    }
+                
+                };
+            }
+        };
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/data/101f96fb.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES 
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F96FB;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96FC;
+            implementations = 
+                {
+                // Info for CIdWsfAnonymousSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FD;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Anonymous SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.AnonymousSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfPlainSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FE;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Plain SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.PlainSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfCramMD5SaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FF;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.CramMD5SASLMechanism";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/data/101f972f.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ID-WSF Service Invocation ECOM plugin
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include <ecom/RegistryInfo.rh>
+ 
+// #include <ecom/RegistryInfoV2.rh> // RESOURCE_FORMAT_VERSION_2
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+//    resource.format.version = RESOURCE_FORMAT_VERSION_2; // to enable use of "rom_only" field
+    
+    // UID for the DLL
+    dll_uid = 0x101F972F;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9730;
+            implementations = 
+                {
+                // Info for CSenIdWsfPlugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9731;
+                    version_no         = 1;
+                    display_name       = "SenIdWsfPlugin SIF";
+                    default_data       = "com.nokia.Sen.idwsf.IdentityBasedWebServicesFramework";
+                    opaque_data        = "";
+//                    rom_only           = 0; // can be overridden in ram
+                    }
+                
+                };
+            }
+        };
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/data/101f9732.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES 
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9732;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9733;
+            implementations = 
+                {
+                // Info for CIdWsfAnonymousSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9734;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Anonymous SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.AnonymousSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfPlainSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9735;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Plain SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.PlainSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfCramMD5SaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9736;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.CramMD5SASLMechanism";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for idwsfplugin   
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/idwsfplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(idwsfplugin.iby)
+PRJ_MMPFILES
+../../idwsfplugin/group/senidwsfplugin.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/group/senidwsfplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ID-WSF Service Invocation ECOM plugin
+*
+*/
+
+
+#include "../../inc/webservices.hrh"
+
+SMPSAFE
+
+#ifdef SYMBIAN_SECURE_ECOM 
+TARGETTYPE PLUGIN
+#else
+TARGETTYPE ECOMIIC
+#endif
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenIDWSFplugin.dll
+UID 0x10009D8D 0x101F96F8
+#else
+TARGET wsIDWSFplugin.dll
+UID 0x10009D8D 0x101F972F
+#endif
+
+paged
+//For enabling bytepair compression for code paging
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+VENDORID 0x101FB657
+    #else
+VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+CAPABILITY ALL -TCB
+    #else
+CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH          ../src
+SOURCE          senidwsfpluginmain.cpp
+SOURCE          senidwsfpluginproxy.cpp
+SOURCE          senidwsfplugin.cpp
+SOURCE          idwsfsaslmessage.cpp
+SOURCE          idwsfresourceoffering.cpp
+SOURCE          idwsfdsqueryresponse.cpp
+SOURCE          idwsfsiuheader.cpp
+SOURCE          idwsfcorrelationheader.cpp
+SOURCE          idwsfmessage.cpp
+SOURCE          idwsfserviceprovider.cpp
+SOURCE          idwsfsessionconsumer.cpp
+SOURCE          idwsfserviceinstance.cpp
+SOURCE          idwsfcoreserviceconsumer.cpp
+SOURCE          idwsfservicesession.cpp
+SOURCE          idwsfauthenticationserviceclient.cpp
+SOURCE          idwsfdiscoveryserviceclient.cpp
+
+SOURCE          idwsfsecurityheader.cpp
+SOURCE          idwsfsoapmessage.cpp
+                
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  101f96f8.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenIDWSFplugin.rsc
+#endif 
+
+#else
+START RESOURCE  101F972F.RSS
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsIDWSFplugin.rsc
+#endif 
+
+#endif
+END
+
+USERINCLUDE         ../inc
+USERINCLUDE     ../../wscore/inc
+USERINCLUDE     ../../wsframework/inc     // internal headers
+USERINCLUDE     ../../wsutils/inc                 // SenDebug.h
+USERINCLUDE     ../../wsidentitymanager/inc
+USERINCLUDE     ../../wscredentialmanager/inc   // SenInternalCredential.h
+USERINCLUDE     ../../wslogger/inc 
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+SYSTEMINCLUDE   /epoc32/include/libc
+
+// System libs
+LIBRARY ecom.lib
+LIBRARY euser.lib 
+LIBRARY estor.lib 
+LIBRARY bafl.lib    // CDesC8Array
+LIBRARY flogger.lib // RFileLogger
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// Web Service libs
+LIBRARY senlogger.lib   // for TLS based logging
+LIBRARY SenFramework.lib
+LIBRARY SenServDesc.lib
+LIBRARY SenXml.lib
+LIBRARY SenUtils.lib
+LIBRARY SenCredentialManager.lib
+#else
+LIBRARY wslogger.lib   // for TLS based logging
+LIBRARY wsFramework.lib
+LIBRARY wsServDesc.lib
+LIBRARY wsXml.lib
+LIBRARY wsUtils.lib
+LIBRARY wsCredentialManager.lib
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfauthenticationserviceclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_AUTHENTICATION_SERVICE_CLIENT_H
+#define IDWSF_AUTHENTICATION_SERVICE_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <flogger.h>
+
+#include "idwsfdiscoveryserviceclient.h"
+#include "sensecuritymechanism.h"
+#include "midwsfsessionvalidator.h"
+
+// FORWARD DECLARATIONS
+class MIdWsfSessionValidator;
+
+// CLASS DECLARATION
+class CIdWsfAuthenticationServiceClient : public CIdWsfDiscoveryServiceClient
+    {
+    public: // Constructors and destructor
+    
+        static CIdWsfAuthenticationServiceClient* NewL( CSIF& aSIF);//,
+                                                        //RFileLogger& aLogger);
+    
+        static CIdWsfAuthenticationServiceClient* NewLC(CSIF& aSIF);//,
+                                                        //RFileLogger& aLogger);
+
+        ~CIdWsfAuthenticationServiceClient();
+        
+        // New functions
+        
+        virtual TInt ValidateL(CIdWsfServiceSession &aSession,
+                               MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        virtual TInt ValidateL(CIdWsfServiceSession &aSession, const TDesC8& aAuthContext,
+                               MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        void SetStatusL(const TInt aStatus);
+        void SetAccount(CSenIdentityProvider* aIdentityProvicer);
+
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+		virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; 			
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfAuthenticationServiceClient(  CSIF& aSIF,
+                                        TDescriptionClassType aType);//,
+                                        //RFileLogger& aLogger);
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL();
+        
+        private: // New functions
+        
+            TInt ParseResponseL(TDesC8& aResponse, HBufC8*& aParsedMessage);
+
+    private: // Data
+        CSenSecurityMechanism* iAuthenticator;
+        CIdWsfServiceSession* iDsSession; // Not owned
+        CSenIdentityProvider* ipAccount; // Not owned
+        TInt iAttempts;
+        TInt iMaxAttempts;
+        TSenDataTrafficDetails iAuthDetails; 
+    };
+
+#endif // IDWSF_AUTHENTICATION_SERVICE_CLIENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfcoreserviceconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_CORE_SERVICE_CONSUMER_H
+#define IDWSF_CORE_SERVICE_CONSUMER_H
+
+// INCLUDERS
+#include <MSenServiceDescription.h>
+
+#include "seninternalserviceconsumer.h"
+
+// FORWARD DECLARATIONS
+class CIdWsfServiceSession;
+class MIdWsfSessionValidator;
+class MSenRemoteHostlet;
+
+// CLASS DECLARATION
+class CIdWsfCoreServiceConsumer : public CSenInternalServiceConsumer
+    {
+    public: // Constructors and destructor
+    
+        static CIdWsfCoreServiceConsumer* NewL(CSIF& aSIF);
+        static CIdWsfCoreServiceConsumer* NewLC(CSIF& aSIF);
+        
+        virtual ~CIdWsfCoreServiceConsumer();
+
+        // New functions
+    
+        virtual TPtrC8 TrustAnchor() const;
+        virtual TPtrC8 ProviderId() const;
+        virtual void SetServiceSessionL(CIdWsfServiceSession* aSession);
+        virtual const TTime& ValidUntilL();
+
+        // Functions from base classes
+
+        // From MSenRemoteServiceSession
+        virtual TInt SetSessionL(MSenRemoteServiceSession& aSession);
+        virtual void StartTransaction();
+        virtual void TransactionCompleted();
+
+        // From ServiceDescription
+        virtual void SetContractL(const TDesC8& aContract);
+        virtual void SetEndPointL(const TDesC8& aEndpoint);
+        virtual TPtrC8 Contract();
+        virtual TPtrC8 Endpoint();
+        virtual TPtrC8 FrameworkId();
+        virtual TPtrC8 FrameworkVersion();
+        virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet);
+        virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo);
+        virtual TInt AddFacetL(const CSenFacet& aFacet);
+        virtual TInt SetFacetL(const CSenFacet& aFacet);
+        virtual TInt RemoveFacet(const TDesC8& aURI);
+        virtual TInt FacetsL(RFacetArray& aFacetArray);
+        virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
+        virtual TBool Matches(MSenServiceDescription& aPattern);
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+        virtual CSenServiceSession* ServiceSession();
+
+        // for framework's internal use
+        
+        virtual CIdWsfServiceSession* IdWsfServiceSession();
+        virtual void SetValidator(MIdWsfSessionValidator* aValidator);
+        virtual MIdWsfSessionValidator* Validator();
+        virtual MSenTransport& TransportL();
+        virtual MSenRemoteServiceConsumer* ServedConsumer();
+        virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+        virtual MSenRemoteHostlet* Hostlet() const;
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfCoreServiceConsumer(CSIF& aSIF, TDescriptionClassType aType);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL();
+
+    protected: // Data
+        CIdWsfServiceSession* iService; // not owned
+        MSenRemoteServiceConsumer* iServedConsumer; // not owned
+    };
+    
+#endif // IDWSF_CORE_SERVICE_CONSUMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfcorrelationheader.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_CORRELATION_HEADER_H
+#define IDWSF_CORRELATION_HEADER_H
+
+// INCLUDES
+#include <SenXmlElement.h>
+
+// CONSTANTS
+_LIT8(KCorrelationName, "Correlation");
+_LIT8(KCorrelationQName, "sb:Correlation");
+
+// CLASS DECLARATION  // we could use internal element here (to optimize mem)
+class CIdWsfCorrelationHeader :  public CSenXmlElement
+    {
+    public: // Constructors and destructors
+        
+        static CIdWsfCorrelationHeader* NewL(
+                                const TDesC8& aRefToMessageId = KNullDesC8);
+        
+        static CIdWsfCorrelationHeader* NewL(const RAttributeArray& aAttributes);
+
+        virtual ~CIdWsfCorrelationHeader();
+
+        // New functions
+        
+        virtual TPtrC8 MessageId();
+        virtual TPtrC8 RefToMessageId();
+        virtual TPtrC8 Timestamp();
+        virtual void SetCorrelationL(const TDesC8& aRefToMessageId);
+
+    protected: // Functions from base classes
+    
+        // From CBaseElement
+        virtual void WriteAttrsToL(RWriteStream& aWriteStream);
+
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfCorrelationHeader();
+        
+        /**
+        * By default Symbian 2nd phase constructors are private.
+        */
+        void ConstructL(const TDesC8& aRefToMessageId);
+        void ConstructL(const RAttributeArray& aAttributes);
+
+    private: // Data
+        HBufC8* ipMessageId;         // Owned
+        HBufC8* ipRefToMessageId;    // Owned
+        HBufC8* ipTimestamp;         // Owned
+    };
+
+#endif // IDWSF_CORRELATION_HEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfdiscoveryserviceclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_DISCOVERY_SERVICE_CLIENT
+#define IDWSF_DISCOVERY_SERVICE_CLIENT
+
+// INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <flogger.h>
+
+#include "midwsfsessionvalidator.h"
+
+#include "idwsfcoreserviceconsumer.h"
+
+
+// CONSTANTS 
+_LIT8(KDiscoOption,"urn:com.nokia.serene.idwsf:disco:option");
+
+// FORWARD DECLARATIONS
+class CIdWsfServiceSession;
+class CIdWsfDsQueryResponse;
+
+// DATA TYPES
+typedef RPointerArray<CIdWsfServiceSession> RSessionArray;
+
+// CLASS DECLARATION
+class CIdWsfDiscoveryServiceClient : public CIdWsfCoreServiceConsumer, 
+                                     public MIdWsfSessionValidator
+{
+    public: // Constructors and destructor
+    
+        static CIdWsfDiscoveryServiceClient* NewL(CSIF& aSIF);//,
+                                                  //RFileLogger& aLogger);
+
+        static CIdWsfDiscoveryServiceClient* NewLC(CSIF& aSIF);//,
+                                                   //RFileLogger& aLogger);
+
+        ~CIdWsfDiscoveryServiceClient();
+
+        // New functions
+        
+        /**
+        * @return KErrNotFound, if no known security mechanism was found
+        *         KErrNotReady, if no service session has been initialized
+        */
+        virtual TInt ValidateL(CIdWsfServiceSession& aSession,
+                               MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        virtual void SetStatusL(const TInt aStatus);
+
+        /**
+        * @return KErrNotFound, if no known security mechanism was found
+        */
+        virtual TInt FindServiceL(RPointerArray<CSenWSDescription>& aServiceArray, 
+                                  MSenServiceDescription& aPattern,
+                                  MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        static TInt DSOptionsL(RFacetArray& aOptionArray,
+                               MSenServiceDescription& aServiceDescription);
+
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+		virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; 		
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfDiscoveryServiceClient(CSIF& aSIF, TDescriptionClassType aType);//RFileLogger& aLogger);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL();
+
+        // New functions
+        
+        /**
+        * @return KErrNotFound, if no known security mechanism was found
+        */
+        virtual TInt ProcessResponseL(CIdWsfDsQueryResponse* aResponse);
+        //RFileLogger* Log() const;
+        
+    private: // New functions
+    
+        HBufC8* CIdWsfDiscoveryServiceClient::DsLookupRequestL(MSenServiceDescription& aPattern);
+        
+        CIdWsfDsQueryResponse* ParseResponseLC(TDesC8& aMessage);
+        //void SetStatusL(TInt aStatus);
+
+    protected: // Data
+        enum TClientState
+        {
+        ENotInitialized = 1,
+        EHasSession,
+        EHasResults,
+        EAuthServiceClient,
+        ESaslMechanism
+        };
+
+        TClientState iCState;
+        CIdWsfServiceSession* iSession; // Not owned
+
+    private: // Data
+        //RFileLogger& iLog;
+        RSessionArray iResults;
+        TSenDataTrafficDetails iDiscDetails;
+    };
+
+#endif //IDWSF_DISCOVERY_SERVICE_CLIENT
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfdsqueryresponse.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_DS_QUERY_RESPONSE_H
+#define IDWSF_DS_QUERY_RESPONSE_H
+
+// INCLUDES
+#include <SenBaseFragment.h>
+
+#include "idwsfresourceoffering.h"
+#include "idwsfdiscoveryserviceclient.h" // Only constants needed
+
+// CONSTANTS
+const TInt KStateParsingResourceOffering    = 11;
+const TInt KStateParsingEncryptedResourceId = 111;
+
+_LIT8(KQueryResponseXmlns, "urn:liberty:disco:2003-08");
+_LIT8(KQueryResponseName, "QueryResponse");
+_LIT8(KQueryResponseQName, "ds:QueryResponse");
+_LIT8(KStatusName, "Status");
+_LIT8(KStatusCodeName, "code");
+
+// CLASS DECLARATIONS
+class CIdWsfDsQueryResponse :  public CSenBaseFragment
+    {
+    public: // Constructors and destructor
+        
+        static CIdWsfDsQueryResponse* NewL();
+        static CIdWsfDsQueryResponse* NewLC();
+        static CIdWsfDsQueryResponse* NewL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName);
+        static CIdWsfDsQueryResponse* NewLC(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName);
+        virtual ~CIdWsfDsQueryResponse();
+
+        // New functions
+    
+        /**
+        * Ownership of array elements is retained.
+        */
+        virtual void GetAllServicesL(RPointerArray<CIdWsfServiceInstance>& aDest);
+        virtual TBool IsOk();
+        virtual TPtrC8 ResourceId();
+        virtual RPointerArray<CIdWsfResourceOffering>& ResourceOfferingsL();
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfDsQueryResponse();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL();
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            const TDesC8& aQName);
+        
+        // Functions from base classes
+        
+        // From CSenBaseFragment
+        virtual void StartElementL(const TDesC8& aNsUri,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName,
+                                   const RAttributeArray& aAttributes);
+    
+        virtual void EndElementL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName);
+
+    protected: // Data
+        HBufC8* ipStatus;  // Owned
+
+    private: // Data
+        CIdWsfResourceOffering* ipResourceOffering;               // Owned
+        RPointerArray<CIdWsfResourceOffering> iResourceOfferings; // Elements owned
+        CSenCredential* ipCredential;                             // Owned
+        CIdWsfServiceInstance* ipServiceInstance;                 // Owned
+        TTime iNotOnOrAfter;
+    };
+
+#endif // IDWSF_DS_QUERY_RESPONSE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfmessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_MESSAGE_H
+#define IDWSF_MESSAGE_H
+
+// INCLUDES
+#include "idwsfcorrelationheader.h"
+#include "idwsfsiuheader.h"
+#include "idwsfsoapmessage.h"
+
+// CONSTANTS
+_LIT8(KSBXmlNs,                         "urn:liberty:sb:2003-08");
+_LIT8(KStatusEndpointMoved,             "EndpointMoved");
+_LIT8(KStatusInappropriateCredentials,  "InappropriateCredentials");
+
+// CLASS DECLARATION
+class CIdWsfMessage : public CIdWsfSoapMessage
+    {
+    public: // Constructors and destructor
+    
+        static CIdWsfMessage* NewL(const TDesC8& aRefToMessageId = KNullDesC8);
+        virtual ~CIdWsfMessage();
+
+        // New functions
+    
+        /**
+        * Convenience methods
+        */
+        virtual void SetCorrelationL(const TDesC8& aRefToMessageId);
+        virtual TPtrC8 MessageId();
+        virtual TPtrC8 RefToMessageId();
+        virtual TPtrC8 Timestamp();
+
+        /**
+        * Retains ownership.
+        */
+        virtual CIdWsfSiuHeader* SiuHeader();
+
+        /**
+        * @return the value of the "code" attribute in a possible Status element.
+        * The Status element is expected to be a child of the first child of the
+        * S:Body. Or the child of a <detail> element of a <s:Fault>
+        */
+        virtual const TDesC8* StatusCodeL();
+
+        // Functions from base classes
+        
+        // From CSenSoapMessage
+        virtual void ParseHeaderL(const TDesC8& aNsUri,
+                                  const TDesC8& aLocalName,
+                                  const TDesC8& aQName,
+                                  const RAttributeArray& aAttributes);
+
+
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfMessage();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL(const TDesC8& aRefToMessageId);
+
+    private: // Data
+        CIdWsfCorrelationHeader* ipCorrelationHeader;// Not owned (owned by header)
+        CIdWsfSiuHeader* ipSiuHeader;                // Owned, but element not owned
+    };
+
+#endif // IDWSF_MESSAGE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfresourceoffering.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_RESOURCE_OFFERING_H
+#define IDWSF_RESOURCE_OFFERING_H
+
+// INCLUDES
+#include <e32base.h>
+#include <SenXmlUtils.h>
+
+#include "idwsfserviceinstance.h"
+
+// FORWARD DECLARATION
+class CSenCredential;
+
+// CLASS DECLARATION
+class CIdWsfResourceOffering :  public CBase
+    {
+    public: // Constructors and destructor
+        
+        static CIdWsfResourceOffering* NewL();
+        virtual ~CIdWsfResourceOffering();
+
+        // New functions
+        
+        TPtrC8 ResourceId();
+        void SetResourceIdL(const TDesC8& aId);
+        CIdWsfServiceInstance& LastServiceL();
+
+        /**
+        * Takes ownership of aInstance
+        */
+        void AddServiceInstanceL(CIdWsfServiceInstance* aInstance);
+        void AddCredentialL(const CSenCredential& aCredential);
+
+        RPointerArray<CIdWsfServiceInstance>& ServicesL();
+        TInt SetFacetL(CSenFacet& aFacet);
+
+    private:
+    
+         /**
+        * C++ default constructor.
+        */
+        CIdWsfResourceOffering();
+    
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */  
+        void ConstructL();
+
+    private: // Data
+        HBufC8* ipResourceId;                            // Owned
+        RPointerArray<CIdWsfServiceInstance> iServices; // Elements owned
+    };
+
+#endif // IDWSF_RESOURCE_OFFERING_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfsaslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SASL_MECHANISM_H
+#define IDWSF_SASL_MECHANISM_H
+
+// INCLUDES
+#include <e32base.h>
+
+#include "MSenCoreServiceManager.h"
+
+// FORWARD DECLARATIONS
+class CIdWsfSaslMessage;
+
+// CLASS DECLARATION
+class CIdWsfSaslMechanism : public CBase
+    {
+    public:
+        
+        /**
+        *  "Owner" of the mechanism that supports credentials, etc. Typically
+        *  the IdWsfClient implements this interface.
+        */
+        class MOwner
+            {
+            public:
+                /**
+                * @return the name of the user, in case there is one, e.g. when
+                *            multiple users use this device.
+                */
+                virtual const TDesC& SaslAuthzIdL() { return KNullDesC(); }
+
+                /**
+                * @return depending on the IdP this could be a deviceID.
+                */
+                virtual const TDesC& SaslAdvisoryAuthnIdL() { return KNullDesC(); }
+
+                virtual const TDesC& SaslAuthnIdL() { return KNullDesC(); }
+
+                /**
+                * Ask password from the user or identity manager.
+                */
+                virtual const TDesC& SaslPasswordL() { return KNullDesC(); }
+            };
+
+    public:
+        
+        // New functions
+        
+        /**
+        * @return the name of the mechanism, like "PLAIN".
+        */
+        virtual const TDesC& Name() = 0;
+
+        /**
+        * @return a SASL request that is a response to the passed response.
+        *      Caller takes ownership of the returned object. Never returns NULL.
+        */
+        virtual CIdWsfSaslMessage* HandleResponseL(MOwner& aOwner,
+                                                   CIdWsfSaslMessage& aResponse) = 0;
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfSaslMechanism(MSenCoreServiceManager& aServiceManager)
+        :iServiceManager(aServiceManager)
+        {
+        }
+
+    protected: // Data
+        // to access base64 encoding/decoding
+        MSenCoreServiceManager& iServiceManager; 
+    };
+
+#endif // IDWSF_SASL_MECHANISM_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfsaslmessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SASL_MESSAGE_H
+#define IDWSF_SASL_MESSAGE_H
+
+// INCLUDES
+#include "msensaslmessage.h"
+#include "idwsfdsqueryresponse.h"
+
+// CONSTANTS
+const TInt KStateParsingPwTransforms = 15; 
+
+_LIT8(KSaslXmlns, "urn:liberty:sa:2004-04");
+_LIT8(KSaslRequestName, "SASLRequest");
+_LIT8(KSaslRequestQName, "sa:SASLRequest");
+_LIT8(KSaslResponseName, "SASLResponse");
+_LIT8(KSaslResponseQName, "sa:SASLRequest");
+
+// FORWARD DECLARATIONS
+class CSenPasswordTransform;
+
+// CLASS DECLARATION
+class CIdWsfSaslMessage :  public CIdWsfDsQueryResponse,
+                           public MSenSaslMessage
+    {
+    public: // Constructors and destructor
+        
+        static CIdWsfSaslMessage* NewL(MSenCoreServiceManager& aServiceManager);
+        static CIdWsfSaslMessage* NewL( MSenCoreServiceManager& aServiceManager,
+                                        const TDesC8& aXmlns,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName     );
+        virtual ~CIdWsfSaslMessage();
+
+        // New functions
+        
+        /**
+        *  Accepts KNullDesC.
+        */
+        virtual TInt ConstructInitRequestFromL(const TDesC8& aAllMechanismNames,
+                                               CSenIdentityProvider& aAccount);
+        virtual TInt ConstructRequestFromL(const TDesC8& aMech);
+        virtual TInt ConstructRequestFromL(const TDesC8& aMech,
+                                           const TDesC8& aData);
+
+        TBool IsContinue();
+        TBool IsAbort();
+
+        /**
+        * @return KNullDesC if not set.
+        */
+        TPtrC8 Mechanism();
+
+        /**
+        * @return KNullDesC if not set.
+        */
+        TPtrC8 ParameterName();
+
+        /**
+        * @return KNullDesC if not set.
+        */
+        TPtrC8 Data();
+
+        /**
+        * @return array of PasswordTransform ECOM plugins
+        * which may be empty if none have been parsed.
+        */
+        RPointerArray<CSenPasswordTransform> Transforms();
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfSaslMessage(MSenCoreServiceManager& aServiceManager);
+        
+        /**
+        * By default Symbian 2nd phase constructors is private.
+        */
+        void ConstructL();
+        void ConstructL(const TDesC8& aXmlns,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName);
+        
+        // New functions
+        
+        /**
+        * helper
+        * @return NULL if list is empty
+        */
+        CSenPasswordTransform* LastParsedPasswordTransform();
+
+        RFileLogger* Log() const;
+        
+        // Functions from base classes
+        
+        // From CBaseFragment
+        virtual void StartElementL(const TDesC8& aNsUri,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName,
+                                   const RAttributeArray& aAttributes);
+        
+        virtual void EndElementL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName);
+
+
+    protected: // Data
+    
+        // to access base64, encoding/decoding
+        MSenCoreServiceManager& iServiceManager;
+
+    private: // Data
+        HBufC8* ipMechanism;         // Owned
+        HBufC8* ipParameterName;     // Owned
+        RPointerArray<CSenPasswordTransform> iTransforms; // NOT owned
+    };
+
+#endif // IDWSF_SASL_MESSAGE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfsecurityheader.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSFSECURITYHEADER_H
+#define IDWSFSECURITYHEADER_H
+
+// INCLUDES
+#include "SenWsSecurityHeader.h"
+
+// CONSTANTS
+_LIT8(KSecurityDraftXmlns, "http://schemas.xmlsoap.org/ws/2003/06/secext");
+_LIT8(KSecurityDraftXmlnsPrefix, "wsse");
+
+// CLASS DECLARATION
+class CIdWsfSecurityHeader : public CSenWsSecurityHeader
+    {
+    public: // Constructors and destructor
+    
+        static CIdWsfSecurityHeader* NewL();
+        static CIdWsfSecurityHeader* NewL(const TDesC8& aData);
+        virtual ~CIdWsfSecurityHeader();
+
+        // New functions
+        
+        virtual TPtrC8 XmlNs();
+        virtual TPtrC8 XmlNsPrefix();
+        static HBufC8* UsernameToken8L(CSenIdentityProvider &aIdentityProvider);
+        static TInt UsernameTokenL(const TDesC8& username, HBufC8*& aToken);
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfSecurityHeader();
+    };
+
+#endif // IDWSFSECURITYHEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfserviceinstance.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SERVICE_INSTANCE_H
+#define IDWSF_SERVICE_INSTANCE_H
+
+// INCLUDES
+#include "senwsdescription.h"
+#include "senidwsfplugin.h"
+
+// FORWARD DECLARATION
+class CSenCredential;
+
+// CLASS DECLARATION
+class CIdWsfServiceInstance : public CSenWSDescription
+    {
+    public:
+        
+        static CIdWsfServiceInstance* NewL();
+        static CIdWsfServiceInstance* NewLC();
+        static CIdWsfServiceInstance* NewL(const TDesC8& aUri);
+        static CIdWsfServiceInstance* NewLC(const TDesC8& aUri);
+        static CIdWsfServiceInstance* NewL(CIdWsfServiceInstance& aTemplate);
+        static CIdWsfServiceInstance* NewLC(CIdWsfServiceInstance& aTemplate);
+
+        virtual ~CIdWsfServiceInstance();
+
+        // New functions
+        
+        virtual HBufC8* AsXmlL();
+        virtual HBufC* AsXmlUnicodeL();
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+        virtual TBool Matches(CIdWsfServiceInstance& aOtherServiceInstance);
+        virtual TPtrC8 ProviderId();
+        virtual TPtrC8 ResourceId();
+        virtual TPtrC8 ServiceType();
+        virtual TInt SetProviderIdL(const TDesC8& aURI);
+        virtual void SetResourceIdL(const TDesC8& aURI);
+        virtual void SetServiceTypeL(const TDesC8& aURI);
+        virtual CDesC8Array& MechanismsL();
+        virtual CDesC8Array& CredentialRefsL();
+        virtual TBool SupportsMechanism(const TDesC8& aURI);
+        CSenCredential* Credential();
+        virtual void SetCredentialL(const TDesC8& aIdRef,
+                                    const CSenCredential& aCredential);
+
+        virtual void SetCredentialL(const CSenCredential& aCredential);
+        virtual void AddSecurityMechL(const TDesC8& aUri);
+        virtual void AddCredentialRefL(const TDesC8& aIdRef);
+
+        // Functions from base classes
+
+        // From MSenServiceDescription
+        virtual TBool Matches(MSenServiceDescription& aPattern);
+        virtual TPtrC8 Endpoint();
+        virtual TPtrC8 Contract();
+        virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet);
+        virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo);
+        virtual TInt AddFacetL(const CSenFacet& aFacet);
+        virtual TInt SetFacetL(const CSenFacet& aFacet);
+        virtual TInt RemoveFacet(const TDesC8& aURI);
+        virtual TInt FacetsL(RFacetArray& aFacetArray);
+        virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
+        virtual TPtrC8 FrameworkId();
+        virtual TPtrC8 FrameworkVersion();
+        virtual void SetEndPointL(const TDesC8& aURI);
+        virtual void SetContractL(const TDesC8& aContract);
+        virtual TBool HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate);
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfServiceInstance();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(const TDesC8& aUri, const TDesC8& aProviderId);
+
+    private:
+        HBufC8* ipProviderId;               // Owned
+        HBufC8* ipEndpoint;                 // Owned
+        HBufC8* ipServiceType;              // Owned
+        HBufC8* ipResourceId;               // Owned
+        CDesC8Array* ipMechanisms;          // Owned
+        CDesC8Array* ipCredentialRefs;      // Owned
+        RCredentialList iCredentialList;    // Owned
+        RFacetArray iFacets;                // Owned
+    };
+
+#endif // IDWSF_SERVICE_INSTANCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfserviceprovider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SERVICE_PROVIDER_H
+#define IDWSF_SERVICE_PROVIDER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+class CIdWsfServiceProvider : public CBase
+    {
+    public: // Constructors and destructor
+    
+        static CIdWsfServiceProvider* NewL(const TDesC8& aProviderID = KNullDesC8,
+                                           const TDesC8& aServiceURL = KNullDesC8);
+
+        static CIdWsfServiceProvider* NewLC(const TDesC8& aProviderID = KNullDesC8,
+                                            const TDesC8& aServiceURL = KNullDesC8);
+        virtual ~CIdWsfServiceProvider();
+
+        // New functions
+        
+        TInt SetProviderIdL(const TDesC8& aProviderID);
+        TInt SetEndPointL(const TDesC8& aServiceURL);
+        TPtrC8 ProviderId();
+        TPtrC8 Endpoint();
+        TBool Equals(const TDesC8& aProviderID);
+
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfServiceProvider();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(const TDesC8& aProviderID, const TDesC8& aEndpoint);
+
+    private: // Data
+        HBufC8* ipProviderId;   // Owned
+        HBufC8* ipEndpoint;     // Owned
+    };
+
+#endif // IDWSF_SERVICE_PROVIDER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SERVICE_SESSION_H
+#define IDWSF_SERVICE_SESSION_H
+
+// INCLUDES
+#include "msenremoteserviceconsumer.h"
+#include "msenserviceinvocationframework.h"
+#include "midwsfsessionvalidator.h"
+#include "senidwsfplugin.h"
+#include "senwebservicesession.h"
+#include "idwsfserviceprovider.h"
+#include "idwsfserviceinstance.h"
+#include "idwsfsessionconsumer.h"
+#include "idwsfsiuheader.h"
+#include "idwsfmessage.h"
+
+// CONSTANTS
+_LIT8(KSecNullNull,     "urn:liberty:security:2003-08:null:null"); // IOP
+_LIT8(KSecNullBearer,   "urn:liberty:security:2004-04:null:Bearer");
+_LIT8(KSecTlsNull,      "urn:liberty:security:2003-08:TLS:null"); // IOP
+_LIT8(KSecTlsBearer,    "urn:liberty:security:2004-04:TLS:Bearer");
+
+// ID-WSF 1.1 namespaces
+_LIT8(KSecNullBearer11, "urn:liberty:security:2005-02:null:Bearer");
+_LIT8(KSecTlsBearer11,  "urn:liberty:security:2005-02:TLS:Bearer");
+
+// FORWARD DECLARATIONS
+class CIdWsfSessionConsumer;
+class CIdWsfServiceInstance;
+class MIdWsfSessionValidator;
+
+// CLASS DECLARATION
+class CIdWsfServiceSession : public CSenWebServiceSession
+    {
+    public: // Constructors and destructor
+    
+        static CIdWsfServiceSession* NewL(MSIF& aFramework);
+        static CIdWsfServiceSession* NewLC(MSIF& aFramework);
+
+        virtual ~CIdWsfServiceSession();
+
+        // New functions
+        
+        virtual TBool Matches(MSenServiceDescription& aPattern);
+        virtual TInt ConstructSecurityTokenL(const TDesC& aToken,
+                                             HBufC8*& aSecurityToken);
+
+        virtual TInt InitializeFromL(CIdWsfServiceInstance& aServiceInstance);
+        virtual TBool IsSAMLL(const TDesC8& aSecMechURI);
+        virtual TBool IsBearerL(const TDesC8& aSecMechURI);
+        TPtrC8 ProviderId();
+        TPtrC8 ServiceType();
+        TInt UpdateFromL(CIdWsfSiuHeader& aHeader);
+        void SetProviderL(CIdWsfServiceProvider *aProvider);
+        CIdWsfServiceProvider* Provider();
+        void SetResourceIdL(const TDesC8& aURI);
+        TPtrC8 ResourceId();
+        void SetServiceTypeL(const TDesC8& aServiceType);
+        void SetTrustAnchorL(const TDesC8& aProviderId);
+        virtual TInt CanHandleErrorL(CIdWsfMessage& aSOAPMessage);
+    
+        /**
+        * Read the facets of the given pattern ServiceDescription.
+        * Take on those facets that we understand.
+        * @param pattern
+        */
+        virtual void CopyFacetsFromL(MSenServiceDescription& aPattern);
+    
+        void SetValidator(MIdWsfSessionValidator* aValidator);
+        MIdWsfSessionValidator* Validator();
+
+        // Functions from base classes
+        
+        // From SenServiceSession
+        virtual MSenRemoteServiceConsumer* RemoteConsumerL(
+                                                    const TDesC8& aSenderID);
+        virtual void StartTransaction();
+        virtual void TransactionCompleted();
+        virtual TInt SetStatusL();
+
+        // From SenWebServiceSession
+        virtual TInt RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer);
+        virtual TInt AddConsumerL(MSenRemoteServiceConsumer& aConsumer);
+        virtual TPtrC8 FrameworkId();
+        virtual TInt MessageForSendingL(const TDesC8& aBody,
+                                        const TDesC8& aSenderID,
+                                        CSenSoapMessage*& aMessage);
+
+        virtual TInt NewMessageL(CSenSoapMessage*& aMessage);
+        virtual TInt InitializeFromL(MSenServiceDescription& aServiceDescription);
+        virtual TInt ParseMessageL(CSenSoapMessage& aSOAPMessage);
+
+        virtual TInt SendSoapMessageToConsumerL( CSenSoapMessage* apMessage,
+                                                 const TInt aTxnId,
+                                                 MSenRemoteServiceConsumer& aConsumer,
+                                                 MSenProperties* aResponseTransportProperties );
+
+        virtual void SetEndPointL(const TDesC8& aURI);
+        virtual void SetFrameworkHeadersL(CSenSoapMessage& aMsg);
+        virtual TPtrC8 TrustAnchor();
+        
+        virtual TInt SendL( const TDesC8& aMessage, 
+                            const TDesC8& aTransportProperties,
+                            MSenRemoteServiceConsumer& aConsumer,
+                            TInt& aTxnId,
+                            HBufC8*& aRevalidationError );
+        
+        virtual TInt SubmitL( const TDesC8& aMessage, 
+                              const TDesC8& aTransportProperties,
+                              MSenRemoteServiceConsumer& aConsumer,
+                              HBufC8*& aResponse );
+                              
+        TInt SendSoapL( const TDesC8& aSoapMessage, 
+                        const TDesC8& aTransportProperties,
+                        MSenRemoteServiceConsumer& aConsumer,
+                        TInt& aTxnId,
+                        HBufC8*& /*aRevalidationError*/ );
+      
+                              
+        TInt SubmitSoapL( const TDesC8& aSoapMessage, 
+                          const TDesC8& aTransportProperties,
+                          MSenRemoteServiceConsumer& aConsumer,
+                          HBufC8*& aResponse );
+
+        /**
+        * Method checks if ID-WSF framework can handle this fault, if not, then
+        * error is delivered to session consumer
+        *
+        * @param apSoapMessage is the SOAP message representing fault.
+        * @param aResponse is where either SOAP fault OR - if ID-WSF
+        *        framework was able to handle this fault (recover)
+        *        - the valid response from the service, achieved
+        *        by re-submitted request (for example to new endpoint,
+        *        if the handled fault was "endpoint moved" -type fault.
+        *        
+        * 
+        * @return KErrSenSoapFault, if this error (fault) could not be handled.
+        *         In this case, aResponse contains (extracted) SOAP fault
+        *         element.
+        *         KErrNone, if recovery was possible and successful, and
+        *                   then aResponse contains valid response from 
+        *                   the service. The SOAP fault, which was taken
+        *                   care here - between (remote) service and ID-WSF 
+        *                   framework - remains thus "hidden" from actual 
+        *                   web service consumer.
+        *         KErrSenSoapFault, if fault could not be handled. Now
+        *                   aResponse will contain the extracted SOAP
+        *                   fault element as UTF-8 descriptor (TDesC8)
+        *         KErrSenInternal, the SOAP fault could not be found from
+        *                   aSoapMessage.
+        *         KErrNotFound - the consumer could not be found.
+        */
+        virtual TInt HandleSoapFaultL( CSenSoapMessage* apSOAPMessage,
+                                       HBufC8*& aResponse );
+
+        /**
+        * Method checks if ID-WSF framework can handle this fault, if not, then
+        * error is delivered to session consumer
+        *
+        * @param apSoapMessage is the SOAP message representing fault.
+        * @param aErrorCode, is the error code received from transport
+        * @param aTxnId is the transaaction id from transport, which 
+        *        can be used to map this error response to consumer's 
+        *        request.
+        * @param aConsumer is the consumer which was calling the transport
+        *        and originally sent the request.
+        * @param aResponseTransportProperties includes response properties
+        *        from transport.
+        * @return KErrNone, if error was either succesfully handled or
+        *         processed (delivered to consumer) The SOAP fault, which was taken care between (remote)
+        *         service and ID-WSF framework is hereby "hidden" from
+        *         actual web service consumer.
+        */
+        virtual TInt HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                      const TInt aErrorCode,
+                                      const TInt aTxnId,
+                                      MSenRemoteServiceConsumer& aConsumer,
+                                      MSenProperties* aResponseTransportProperties);
+
+        virtual void WriteExtensionsAsXMLToL(RWriteStream& aWriteStream);
+
+        /**
+        * @see CSenWSDescription
+        */
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+        
+        virtual void FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier);
+
+    private: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfServiceSession(TDescriptionClassType aType, MSIF& aFramework);
+    
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        // New functions
+        
+        TInt SessionConsumerL(  CIdWsfMessage& aMessage,
+                                CIdWsfSessionConsumer*& aSessionConsumer);
+        
+        TInt SessionConsumerL(  const TDesC8& aSenderID,
+                                CIdWsfSessionConsumer*& aSessionConsumer);
+                                
+        // NOTE: this is temporary method which MUST be removed when message context is made available in SendL/SubmitL                                
+        TInt SetFrameworkPropertiesL(MSenTransport& aTransport);                                
+    
+        void SetSenSecurityMechanismL(const TDesC8& aSenSecurityMechanism);
+        TPtrC8 SenSecurityMechanism();
+        TInt SetOptionsFromL(MSenServiceDescription& aServiceDescription);
+
+    private: // Data
+        CIdWsfServiceProvider*  iProvider;
+        HBufC8* ipResourceId;
+        HBufC8* ipTrustAnchor;
+        HBufC8* ipReceivedMessageId;
+        HBufC8* ipSenSecurityMechanism;
+        //no need to store received message IDs;
+        TBool  iMessageThread; 
+        MIdWsfSessionValidator* ipValidator; // not owned
+        TInt iSubmitState;
+    };
+    
+#endif // IDWSF_SERVICE_SESSION_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfsessionconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SESSION_CONSUMER_H
+#define IDWSF_SESSION_CONSUMER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <e32des8.h>    // HBufC8
+
+#include "msenremoteserviceconsumer.h"
+#include "senpointermap.h"
+
+#include "idwsfmessage.h"
+
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, HBufC8> RSentMessagesPointerMap;
+
+// FORWARD DECLARATIONS
+class CIdWsfMessage;
+class RFileLogger;
+
+//class CSenPolicy; // deprecated, not in use
+
+// CLASS DECLARATION
+class CIdWsfSessionConsumer : public CBase, public MSenRemoteServiceConsumer
+    {
+    public: // Constructors and destructor
+        
+        static CIdWsfSessionConsumer* NewL(MSenRemoteServiceConsumer& aServiceConsumer,
+                                           RFileLogger& aLogger);
+
+        static CIdWsfSessionConsumer* NewLC(MSenRemoteServiceConsumer& aServiceConsumer,
+                                            RFileLogger& aLogger);
+
+        virtual ~CIdWsfSessionConsumer();
+
+        // New functions
+
+        /**
+        * Expects() is called by CIdWsfServiceSession to check
+        * whether or not this consumer expects certain response
+        */
+        virtual TBool Expects(const TDesC8& aRefToMessageID);
+
+        const TDesC8& Id() const;
+        TInt SetSessionL(MSenRemoteServiceSession& iServiceSession);
+
+        TInt HandleIdWsfMessageL( CIdWsfMessage* apMessage,
+                                  const TInt aTxnId,
+                                  MSenProperties* aResponseTransportProperties,
+                                  TBool aCompleteMessage );
+
+        TInt HandleMessageL( HBufC8* aMessage,
+                             const TInt aTxnId,
+                             MSenProperties* aResponseTransportProperties );
+
+        TInt HandleErrorL( HBufC8* aError,
+                           const TInt aErrorCode,
+                           const TInt aTxnId,
+                           MSenProperties* aResponseTransportProperties );
+
+        void SetStatusL(const TInt status);
+
+        TInt MessageForSendingL(const TDesC8& aBody,
+                                const TDesC8& aReceivedMessageId,
+                                CIdWsfMessage*& aMessage);
+
+        void SetSentMessageIdL(const TDesC8& aSentMessageId);
+        TPtrC8 SentMessageId();
+        void SetReceivedMessageIdL(const TDesC8& aReceivedMessageId);
+        TPtrC8 ReceivedMessageId();
+        CSenIdentifier& Identifier() const;
+        TDesC8* BodyL(const TDesC8& aMessageID) const;
+        MSenTransport& TransportL();
+        virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);    
+        virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress);
+		virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; 	
+    protected:
+        RFileLogger* Log() const;
+
+    
+    private: 
+    
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer,
+                              RFileLogger& aLogger);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+
+
+    private: // Data
+        MSenRemoteServiceConsumer& iConsumer;
+        RFileLogger& iLogger;
+        HBufC8* iSentMessageId;     // owned
+        HBufC8* iReceivedMessageId; // owned
+        RSentMessagesPointerMap iSentMessages; // owned
+    };
+    
+#endif // IDWSF_SESSION_CONSUMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfsiuheader.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SIU_HEADER_H
+#define IDWSF_SIU_HEADER_H
+
+// INCLUDES
+#include "SenCredential.h"
+#include "SenBaseFragment.h"
+
+// CONSTANTS
+_LIT8(KSiuXmlns, "urn:liberty:sb:2004-04");
+_LIT8(KSiuName, "ServiceInstanceUpdate");
+_LIT8(KCredentialElementLocalNameName, "Credential");
+
+// CLASS DECLARATION
+class CIdWsfSiuHeader :  public CSenBaseFragment
+    {
+    public: // Constructors and destructor
+        
+        static CIdWsfSiuHeader* NewL();
+        virtual ~CIdWsfSiuHeader();
+        
+        // New functions
+        
+        TPtrC8 Endpoint();
+        TPtrC8 SecurityMechId();
+        const TTime& NotOnOrAfter();
+        TBool IsNotOnOrAfterSet();
+
+        /**
+        * Retains ownership.
+        */
+        CSenCredential* Credential();
+
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfSiuHeader();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        // From CBaseFragment
+        virtual void StartElementL(const TDesC8& aNsUri,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName,
+                                   const RAttributeArray& aAttributes);
+    
+        virtual void EndElementL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName);
+
+    private: // Data
+        CSenCredential* ipCredential;   // Owned
+        TTime iNotOnOrAfter;
+    };
+
+#endif // IDWSF_SIU_HEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/idwsfsoapmessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_SOAP_MESSAGE_H
+#define SEN_IDWSF_SOAP_MESSAGE_H
+
+// INCLUDES
+#include "idwsfsecurityheader.h"
+#include "SenSoapMessage.h"
+
+// CLASS DECLARATION
+class CIdWsfSoapMessage : public CSenSoapMessage
+    {
+    
+    public: // Constructors and destructor
+    
+        static CIdWsfSoapMessage* NewL();
+        virtual ~CIdWsfSoapMessage();
+        
+        // New functions
+        
+        virtual void SetSecurityMechanism(HBufC8* apSecurityMechanismURI);
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CIdWsfSoapMessage();
+        
+        void BaseConstructL();
+        virtual CSenWsSecurityHeader* NewSecurityHeaderLC(
+                                                    const TDesC8* aData=NULL);
+
+    private: // Data
+        HBufC8* ipSecurityMechanismURI; // not owned
+    };
+
+#endif // SEN_IDWSF_SOAP_MESSAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/midwsfsessionvalidator.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef IDWSF_SESSION_VALIDATOR
+#define IDWSF_SESSION_VALIDATOR
+
+// INCLUDES
+#include <e32base.h>
+
+//#include "IdWsfServiceSession.h"
+
+// FORWARD DECLARAtions
+class MSenRemoteServiceConsumer;
+class CIdWsfServiceSession;
+
+// CLASS DECLARATION
+class MIdWsfSessionValidator
+    {
+    public:
+    
+        /**
+        * @return KErrNotFound, if no known security mechanism was found
+        *         KErrNotReady, if no service session has been initialized
+        */
+        virtual TInt ValidateL(CIdWsfServiceSession& aSession,
+                               MSenRemoteServiceConsumer& aValidator) = 0;
+
+    };
+
+#endif //IDWSF_SESSION_VALIDATOR
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/senidwsfanonymoussaslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_ANONYMOUS_SASL_MECHANISM_H
+#define SEN_IDWSF_ANONYMOUS_SASL_MECHANISM_H
+
+// INCLUDES
+#include "SenSecurityMechanism.h"
+#include "MSenCoreServiceManager.h"
+
+// FORWARD DECLARATIONS
+class MSenSaslMessage;
+
+// CLASS DECLARATION
+class CSenIdWsfAnonymousSaslMechanism :  public CSenSecurityMechanism
+    {
+    public: // Constructors and destructor
+    
+        static CSenIdWsfAnonymousSaslMechanism* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenIdWsfAnonymousSaslMechanism* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+
+        // New functions
+    
+        virtual const TDesC8& Name();
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest);
+        
+        virtual TBool IsPasswordFromUser();
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenIdWsfAnonymousSaslMechanism(MSenCoreServiceManager& aServiceManager);
+    };
+
+#endif // SEN_IDWSF_ANONYMOUS_SASL_MECHANISM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/senidwsfcrammd5saslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_CRAMMD5_SASL_MECHANISM_H
+#define SEN_IDWSF_CRAMMD5_SASL_MECHANISM_H
+
+// INCLUDES
+#include <hash.h>
+
+#include "SenSecurityMechanism.h"
+#include "SenIdWsfPlainSaslMechanism.h"
+
+
+// FORWARD DECLARATIONS
+class CMessageDigest;
+class MSenSaslMessage;
+
+// CLASS DECLARATION
+class CSenIdWsfCrammd5SaslMechanism :  public CSenIdWsfPlainSaslMechanism
+    {
+    public: // Constructors and destructor
+    
+        static CSenIdWsfCrammd5SaslMechanism* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenIdWsfCrammd5SaslMechanism* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        
+        virtual ~CSenIdWsfCrammd5SaslMechanism();
+
+        // New functions
+        
+        virtual const TDesC8& Name();
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest);
+
+    protected: // Data
+        CSenIdWsfCrammd5SaslMechanism(MSenCoreServiceManager& aServiceManager);
+    };
+
+#endif // SEN_IDWSF_CRAMMD5_SASL_MECHANISM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/senidwsfplainsaslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_PLAIN_SASL_MECHANISM_H
+#define SEN_IDWSF_PLAIN_SASL_MECHANISM_H
+
+// INCLUDES
+#include "SenSecurityMechanism.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class CSenIdWsfPlainSaslMechanism : public CSenSecurityMechanism
+    {
+    public: // Constructors and destructor
+        
+        static CSenIdWsfPlainSaslMechanism* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenIdWsfPlainSaslMechanism* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        virtual ~CSenIdWsfPlainSaslMechanism();
+
+        // Functions from base classes
+        
+        // From CSaslMechanism
+        virtual void SetIdentity(   CSenIdentityProvider* aIdentityProvider,
+                                    MSenIdentityManager* aIdentityManager);
+
+        virtual TBool IsPasswordFromUser();
+        virtual void ClearPasswordL();
+        virtual TInt MaxAttempts();
+
+        // From CSenSecurityMechanism
+        virtual const TDesC8& Name();
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest);
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenIdWsfPlainSaslMechanism(MSenCoreServiceManager& aServiceManager);
+    
+    private: // New functions
+        
+        /**
+        * Leaving version of the method
+        */
+        void SetIdentityL(  CSenIdentityProvider* aIdentityProvider,
+                            MSenIdentityManager* aIdentityManager);
+
+    protected: // Data
+        HBufC8* ipPassword;
+    };
+
+#endif // IDWSF_PLAIN_SASL_MECHANISM_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/inc/senidwsfplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_PLUGIN_H
+#define SEN_IDWSF_PLUGIN_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+
+#include <SenXmlUtils.h>
+#include <SenIdentityProvider.h>
+
+#include "idwsfauthenticationserviceclient.h"
+#include "idwsfserviceinstance.h"
+
+#include "senserviceinvocationframework.h" // internal Framework\inc
+
+
+// CONSTANTS
+_LIT8(KIdWsfFrameworkVersion, "1.0");
+_LIT8(KIdWsfFrameworkXMLNS, "urn:com.nokia.Sen.idwsf.config.1.0");
+_LIT8(KIdWsFrameworkCue, "com.nokia.Sen.idwsf.IdentityBasedWebServicesFramework");
+_LIT8(KIdWsfFrameworkLocalname, "Framework");
+_LIT8(KIdWsfFrameworkAuthenticationServiceContract, "urn:liberty:as:2004-04");
+_LIT8(KIdWsfFrameworkDiscoveryServiceContract, "urn:liberty:disco:2003-08");
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+class CSenBaseFragment;
+class CIdWsfCoreServiceConsumer;
+class CIdWsfAuthenticationServiceClient;
+class CIdWsfDiscoveryServiceClient;
+class CIdWsfServiceSession;
+
+typedef struct
+{
+    CSenWSDescription*  iSD;
+    TInt                        iScore;
+} TSDScore;
+
+// CLASS DECLARATION 
+/**
+* An implementation of the CSIF definition. This is concrete
+* class, instance of which ECOM framework gives to ECOM clients.
+*/
+class CSenIdWsfPlugin : public CSIF
+    {
+    public: // Constructors and destructor
+                
+        /**
+        * Create instance of concrete implementation. Note that ECOM
+        * interface implementations can only have two signatures for
+        * NewL:
+        *   - NewL without parameters (used here)
+        *   - NewL with TAny* pointer, which may provide some client data
+        * Note: The interface, which is abstract base class of this
+        * implementation, also provides NewL method. Normally abstract
+        * classes do not provide NewL, because they cannot create
+        * instances of themselves.
+        * @return Instance of this class.
+        */
+        static CSenIdWsfPlugin* NewL(TAny* aManager);
+
+        virtual ~CSenIdWsfPlugin();
+
+        // New functions
+        
+        // Methods implementing CSIF ECOM interface
+    
+        /**
+        * For convenience of components classes
+        */
+        //RFileLogger* Log() const;
+
+        /**
+        * @return TDesC8 that uniquely identifies this framework.
+        */
+        virtual const TDesC8& Id();
+
+        /**
+        * Try to find one or more services that match the given
+        * ServiceDescription.
+        * Register ServiceDescriptions for these to the owner of the framework,
+        * i.e. to the ServiceManager. Return the number of ServiceDescriptions
+        * that were added.
+        * @param    aPattern - A ServiceDescriptin that should be treated as a
+        *           pattern
+        * @return (TInt) count of matching ServiceDescriptions that were added
+        */
+        virtual TInt AddServiceDescriptionL( MSenServiceDescription& aPattern,
+                                             MSenRemoteServiceConsumer& aRemoteConsumer, 
+                                             HBufC8*& /* aErrorMsg */ );
+
+        virtual TInt AddServiceDescriptionL( const TDesC8& aServiceTypeContract,
+                                             MSenRemoteServiceConsumer& aRemoteConsumer,
+                                             HBufC8*& /* aErrorMsg */  );
+
+        /**
+        * Attempt to register the ServiceDescription to the ServiceManager that
+        * owns the framework.
+        * This is a callback used by the ServiceManager to give frameworks a
+        * chance to replace a generic ServiceDescription into something that is
+        * more specific, and more useful, to the ServiceInvocationFramework.
+        * @param aServiceDescription A ServiceDescription
+        * @return TInt aError - indicates the error or KErrNone if successful
+        */
+        virtual TInt RegisterServiceDescriptionL(
+                                MSenServiceDescription& aServiceDescription);
+
+        /**
+        * Attempt to unregister the ServiceDescription from the ServiceManager
+        * that owns the framework.
+        * This is a callback used by the ServiceManager.
+        * @param aServiceDescription A ServiceDescription
+        * @return TInt aError - indicates the error or KErrNone if successful
+        */
+        virtual TInt UnregisterServiceDescriptionL(
+                                MSenServiceDescription& aServiceDescription);
+
+        /**
+        * Create a ServiceSession based upon the given ServiceDescription.
+        * The ServiceSession is expected to be "valid", i.e. ready for use
+        * by a client.
+        * @param aServiceDescription A ServiceDescription
+        * @param aNewSession (CSenServiceSession)
+        * @return TInt error or KErrNone if successful
+        */
+        virtual TInt CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                            MSenServiceDescription& aPattern,
+                                            CSenServiceSession*& aNewSession,
+                                            MSenRemoteServiceConsumer& aRemoteConsumer,
+                                            HBufC8*& aErrorMsg );
+
+        /**
+        * Return a new instance of a framework specific class that
+        * implements the ServiceDesccription interface.
+        * @param new service description 
+        *        (which typically derives from CSenServiceSession)
+        * @return TInt error or KErrNone if successful
+        */
+        virtual CSenWSDescription* NewServiceDescriptionL();
+
+        /**
+        * @return the ServiceManager for which this instance is working.
+        * This is used by the ServiceSession instances created by this framework.
+        * Note, in WSF, MSenCoreServiceManager IS SINGLETON(!), so all Frameworks
+        * return their "owner" - that is - the only service manager in
+        * WS Framework
+        */
+        virtual MSenCoreServiceManager& Manager();
+
+        /**
+        * Set the ServiceManager to which this instance reports.
+        * The (singleton) ServiceManager calls this method when
+        * it instantiates a framework.
+        * @param aServiceManager The singleton ServiceManager in the system.
+        */
+        virtual void SetManager(MSenCoreServiceManager& aServiceManager);
+
+        /** 
+        * @return an object that can do SAX based parsing of a XML fragment
+        * that contains framework specific configuration information.
+        * The ServiceManager asks for this BaseFragment upon startup
+        * in order to give this framework a chance to read its configuration
+        * information from the central ServiceManager configuration document.
+        */
+        virtual CSenBaseFragment& ConfigParser();
+
+        /**
+        * Write the ServiceInvocationFramework configuration as XML to a HBufC8.
+        * This method is invoked by the ServiceManager when it saves
+        * its state and/or configuration.
+        * Upon startup the chunk of XML that is written will be passed back to
+        * the configuration parser of the framework.
+        * The "schema" that shall be adhered to is:
+        * <pre>
+        * &lt;element name="Framework"&gt;
+        *       &lt;any/&gt;&lt;!-- this is where implementations write additional
+        *       information --&gt;
+        *       &lt;attribute name="class" type="String"&gt;
+        *    &lt;!-- In Symbian the class attribute is used as cue for the
+        *       ECOM Resolver --&gt;
+        * &lt;/element&gt;
+        * </pre>
+        *
+        * @param aTo - a HBufC8 to which the framework should write its
+        *               configuration
+        */
+        virtual HBufC8* AsXmlL();
+
+        virtual HBufC* AsXmlUnicodeL();
+        virtual void EndElementL(   const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName);
+
+        virtual TInt OnEvent(const TInt aEvent,
+                             TAny* /* aArgument */);
+
+        virtual TAny* ExtendedInterface();
+        
+        // From MSIF:
+        /**
+        * ID-WSF specifies at least following: 
+        * - empty SOAPAction HTTP header value.
+        *   KSenSoapActionHeaderValueEmpty ==  ""
+        * It is forced to BOTH framework and message layer (!)
+        * to prevent breaking the Liberty specs in this
+        * (empty SOAPAction value is MUST)
+        * @return KErrNone on success, system-wide error code otherwise
+        */    
+        virtual TInt SetTransportPropertiesL(MSenTransport& aTransport);        
+
+    protected:
+    
+        /**
+        * Perform the first phase of two phase construction
+        */
+        CSenIdWsfPlugin(MSenCoreServiceManager& aManager);
+
+        /**
+        * Perform the second phase construction of a
+        *             CImplementationClassPlus object.
+        */
+        void ConstructL();
+
+        // New functions
+        
+        TBool ValidateL(CIdWsfServiceSession& aSession,
+                        MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        CIdWsfDiscoveryServiceClient* DSClientL(
+                                const TDesC8& aTrustAnchor,
+                                MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        CIdWsfDiscoveryServiceClient* DSClientL(
+                                CSenIdentityProvider* aProvider,
+                                MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        CIdWsfAuthenticationServiceClient* ASClientL(
+                                            CSenIdentityProvider* aProvider);
+
+        TInt CoreServiceDescriptionsL(
+                            RPointerArray<CSenWSDescription>& aMatches,
+                            const TDesC8& aContract,
+                            const TDesC8& aProviderID);
+
+        TInt AssignSessionValidatorsL();
+
+    private:
+        
+        // New functions
+        
+        CSenIdentityProvider* IdentityProviderL(const TDesC8& aProviderId);
+        CSenIdentityProvider* IdentityProviderL(MSenServiceDescription *aPattern);
+        TBool ValidateDSL(  CIdWsfDiscoveryServiceClient *aDSClient,
+                            CSenIdentityProvider *aIDP,
+                            MSenRemoteServiceConsumer& aRemoteConsumer);
+
+        virtual TInt RegisterASClientL(
+                                MSenServiceDescription* aServiceDescription);
+
+        virtual TInt RegisterDSClientL(
+                                MSenServiceDescription* aServiceDescription);
+
+        virtual TInt UnRegisterASClientL(
+                                MSenServiceDescription* aServiceDescription);
+
+        virtual TInt UnRegisterDSClientL(
+                                MSenServiceDescription* aServiceDescription);
+                                
+        static TInt CompareSDScore(const TSDScore& aSDScoreLeft,
+                                    const TSDScore& aSDScoreRight);
+
+    private: // Data
+            MSenCoreServiceManager& iManager;
+    };
+
+
+#endif // SEN_IDWSF_PLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/rom/idwsfplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSIDWSFPLUGIN_IBY__
+#define __WSIDWSFPLUGIN_IBY__
+
+//IdWsfPlugin
+ECOM_PLUGIN(SenIDWSFplugin.dll, 101F96F8.rsc)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfauthenticationserviceclient.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,451 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "idwsfauthenticationserviceclient.h"
+
+#include <s32mem.h>
+#include <f32file.h>
+#include <s32file.h>
+
+#include <MSenServiceDescription.h>
+#include <SenServiceConnection.h>
+#include <SenXmlUtils.h>
+
+#include "idwsfsaslmessage.h"
+#include "idwsfmessage.h"  // for response parsing and request building
+#include "idwsfdsqueryresponse.h"
+#include "idwsfdiscoveryserviceclient.h"
+#include "idwsfservicesession.h"
+
+#include "msencoreservicemanager.h"
+#include "sendebug.h" // internal Utils\inc - filelogging MACROs
+#include "senlogger.h"
+
+CIdWsfAuthenticationServiceClient* CIdWsfAuthenticationServiceClient::NewL(
+                                                        CSIF& aSIF)//,
+                                                        //RFileLogger& aLogger)
+    {
+    CIdWsfAuthenticationServiceClient* pNew = NewLC(aSIF);//, aLogger);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CIdWsfAuthenticationServiceClient* CIdWsfAuthenticationServiceClient::NewLC(
+                                                        CSIF& aSIF)//,
+                                                        //RFileLogger& aLogger)
+    {
+    CIdWsfAuthenticationServiceClient* pNew =
+        new (ELeave) CIdWsfAuthenticationServiceClient(
+                    aSIF,
+                    MSenServiceDescription::EIdWsfAuthenticationServiceClient);//,
+                    //aLogger);
+
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+CIdWsfAuthenticationServiceClient::CIdWsfAuthenticationServiceClient(
+                                                CSIF& aSIF,
+                                                TDescriptionClassType aType)//,
+                                                //RFileLogger& aLogger)
+    : CIdWsfDiscoveryServiceClient(aSIF, aType),// aLogger),
+    iAuthenticator(NULL),
+    iDsSession(NULL),
+    iAttempts(0),
+    iMaxAttempts(1)
+    {
+    }
+
+void CIdWsfAuthenticationServiceClient::BaseConstructL()
+    {
+    CIdWsfDiscoveryServiceClient::BaseConstructL();
+		TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("CIdWsfAuthenticationServiceClient::ConstructL()")));
+    }
+
+CIdWsfAuthenticationServiceClient::~CIdWsfAuthenticationServiceClient()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,
+    "CIdWsfAuthenticationServiceClient::~CIdWsfAuthenticationServiceClient");
+    delete iAuthenticator;
+    }
+
+TInt CIdWsfAuthenticationServiceClient::ValidateL(
+                                        CIdWsfServiceSession& aSession,
+                                        MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfAuthenticationServiceClient::ValidateL()");
+    return CIdWsfAuthenticationServiceClient::ValidateL(aSession, 
+                                                        KNullDesC8(), 
+                                                        aRemoteConsumer);
+    }
+
+
+TInt CIdWsfAuthenticationServiceClient::ValidateL(
+                                    CIdWsfServiceSession &aSession,
+                                    const TDesC8& /*authnContext*/,
+                                    MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfAuthenticationServiceClient::ValidateL(..)");
+    // keep this as first line
+    iServedConsumer = &aRemoteConsumer;
+
+    if(!ipAccount)
+        {
+        return KErrSenNoEndpoint; 
+        }
+
+    TInt retVal(KErrNone);          // for returning error codes
+    iCState = EAuthServiceClient;   // set state
+    iDsSession = &aSession;         // save session
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"- starting transaction.");
+    StartTransaction();
+
+    TPtrC8 mechanismNames =
+                        Framework().Manager().SenSecurityMechanismNames8L();
+
+    CIdWsfSaslMessage* pInitMessage =
+        CIdWsfSaslMessage::NewL(Framework().Manager(),
+                                KSaslXmlns,
+                                KSaslRequestName,
+                                KSaslRequestQName);
+    CleanupStack::PushL(pInitMessage); // push pInitMessage
+
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"- constructing initial request.");
+    pInitMessage->ConstructInitRequestFromL(mechanismNames, *ipAccount);
+
+    HBufC8* pInitRequest8 = pInitMessage->AsXmlL();
+    CleanupStack::PushL(pInitRequest8); // push pInitRequest
+
+    if(iService)
+        {
+        HBufC8* pResponse8 = NULL;
+
+        HBufC8* pNextMessage = NULL;
+
+#ifdef _SENDEBUG
+        TPtr8 initRequest = pInitRequest8->Des();
+//wslog        FILELOGALL(_L("SenCoreServiceManager"), _L("AS_init_req.xml"), initRequest);
+#endif // _SENDEBUG
+
+        retVal = iService->SubmitL(*pInitRequest8, KNullDesC8, *this, pResponse8);
+        aRemoteConsumer.SetDataTrafficDetails(iAuthDetails); 
+        CleanupStack::PushL(pResponse8); // pResponse8
+
+        if(retVal == KErrNone && pResponse8)
+            {
+#ifdef _SENDEBUG
+            TPtr8 initResponse = pResponse8->Des();
+//wslog            FILELOGALL(_L("SenCoreServiceManager"), _L("AS_init_rsp.xml"), initResponse);
+#endif // _SENDEBUG
+            retVal = ParseResponseL(*pResponse8, pNextMessage);
+            }
+#ifdef _SENDEBUG
+        else
+            {
+            CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfAuthenticationServiceClient::ValidateL:");
+            CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("- SubmitL failed: %d"), retVal));
+            }
+#endif // _SENDEBUG
+
+        CleanupStack::PopAndDestroy(1); // pResponse8
+
+        while ( pNextMessage )
+            {
+#ifdef _SENDEBUG
+            TPtr8 authRequest = pNextMessage->Des();
+//wslog            FILELOGALL(_L("SenCoreServiceManager"), _L("AS_req.xml"), authRequest);
+#endif // _SENDEBUG
+            CleanupStack::PushL(pNextMessage); // pNextMessage
+            retVal = iService->SubmitL(*pNextMessage, KNullDesC8, *this, pResponse8); 
+            aRemoteConsumer.SetDataTrafficDetails(iAuthDetails); 	
+            CleanupStack::PopAndDestroy(); // pNextMessage
+            pNextMessage = NULL;
+
+            if (retVal == KErrNone && pResponse8)
+                {
+                CleanupStack::PushL(pResponse8); // pResponse8
+#ifdef _SENDEBUG
+                TPtr8 authResponse = pResponse8->Des();
+//wslog                FILELOGALL(_L("WsLog"), _L("AS_rsp.xml"), authResponse);
+#endif // _SENDEBUG
+                retVal = ParseResponseL(*pResponse8, pNextMessage);
+                CleanupStack::PopAndDestroy(); // pResponse8
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(2); // pInitRequest8, pInitMessage
+    
+    if ((retVal == KErrNone) && iDsSession->IsReadyL())
+        {
+         CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"- starting transaction.");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- setting validator for DS session.");
+
+        iDsSession->SetValidator(this);
+        }
+
+    return retVal;
+    }
+
+
+TInt CIdWsfAuthenticationServiceClient::ParseResponseL(TDesC8& aMessage,
+                                                       HBufC8*& aParsedMessage)
+    {
+    TInt retVal(KErrNone); 
+
+    HBufC8* pNextMessage = NULL;
+
+    CSenSecurityMechanism* pAuthenticator = NULL;
+    CIdWsfSaslMessage* pSaslResponse =
+                            CIdWsfSaslMessage::NewL(Framework().Manager());
+    CleanupStack::PushL(pSaslResponse);
+
+    pSaslResponse->SetReader(*Framework().Manager().XMLReader());
+    pSaslResponse->BuildFrom(aMessage);
+
+    if(pSaslResponse->IsOk())
+        {
+        iCState = EHasSession;
+        TransactionCompleted();
+        iSession = iDsSession;  // The "stateObject" in Java is
+                                // a "iSession" in here
+        delete iAuthenticator;
+        iAuthenticator = NULL;
+        }
+
+
+    if(iCState == EAuthServiceClient)
+        {
+        // expect a SASLResponse and look for the Status,
+        // if "continue" instantiate a SASLMechanism
+        // and let it deal with the message
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("Parse Response - EAuthServiceClient")));
+
+        TPtrC8 mechName = pSaslResponse->Mechanism();
+
+        if(pSaslResponse->IsContinue())
+            {
+            pAuthenticator = Framework().Manager().MechanismNamedL(mechName);
+            if(pAuthenticator)
+                {
+                // mechanism ECOM plugin found...
+
+                pAuthenticator->SetTransforms(pSaslResponse->Transforms());
+                
+                if (ipAccount->Password() == KNullDesC8)
+                    {
+                    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("Password will be asked from user.")));
+                    iAttempts++;
+                    }
+                
+                // This may invoke username/password UI prompt
+                pAuthenticator->SetIdentity(ipAccount, &Framework().Manager());
+
+                //if (pAuthenticator->IsPasswordFromUser() &&
+                //  pAuthenticator->MaxAttempts()>0)
+                if (pAuthenticator->MaxAttempts()>0)
+                    {
+                    //iAttempts++;
+                    iMaxAttempts = pAuthenticator->MaxAttempts();
+                    }
+                delete iAuthenticator;
+                iAuthenticator = NULL;
+                iAuthenticator = pAuthenticator;
+                iCState = ESaslMechanism;
+                }
+            else
+                {
+                retVal = KErrNotFound;
+                }
+            }
+        if(pSaslResponse->IsAbort())
+            {
+            // if response is "abort" that means there is no matching
+            // SASLMechanism and we should quite the whole process
+            TransactionCompleted();
+            pNextMessage = NULL;
+            }
+        }
+
+    if(iCState == ESaslMechanism)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("Parse Response - ESaslMechanism")));
+        pAuthenticator = iAuthenticator;
+
+        if (pSaslResponse->IsAbort())
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("SASL Response: Abort")));
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L("      Attempts : %d, Max Attempts : %d"),
+                                iAttempts, iMaxAttempts));
+            // we could retry if allowed, otherwise quit the process
+            if (iAttempts < iMaxAttempts)
+                {
+                pAuthenticator->ClearPasswordL();
+                iAttempts++;    // even if we cannot get a new password
+                                // we count this as an attempt!
+
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("ESaslMechanism - Create a new init request")));
+
+                CIdWsfSaslMessage* pInitMessage =
+                    CIdWsfSaslMessage::NewL(Framework().Manager(),
+                                            KSaslXmlns,
+                                            KSaslRequestName,
+                                            KSaslRequestQName);
+                CleanupStack::PushL(pInitMessage); // push pInitMessage
+                pInitMessage->ConstructInitRequestFromL(iAuthenticator->Name(),
+                                                        *ipAccount);
+                pNextMessage = pInitMessage->AsXmlL();
+                CleanupStack::PopAndDestroy(); // pInitMessage
+                CleanupStack::PushL(pNextMessage);
+                }
+            else
+                {
+                TransactionCompleted();
+                }
+            }
+        else if (pSaslResponse->IsContinue())
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("SASL Response: Continue")));
+            TPtrC8 mechanism = pSaslResponse->Mechanism();
+            TPtrC8 authName = pAuthenticator->Name();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+                _L8(" Mechanism : %S, Authenticator Name : %S"), &mechanism,
+                                                                 &authName
+                ));
+
+            if(mechanism != authName)
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,(
+                _L("pSaslResponse->Mechanism() != pAuthenticator->Name()")));
+                //switch to another mechanism
+                pAuthenticator = Framework().Manager().MechanismNamedL(
+                                                pSaslResponse->Mechanism());
+                if(pAuthenticator)
+                    {
+                    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("Delete iAuthenticator")));
+                    delete iAuthenticator; // free memory
+
+                    // no need to delete after initialize from is in use,
+                    // because iAuthenticator == pAuthenticator !!
+                    iAuthenticator = pAuthenticator;
+                    }
+                else
+                    {
+                    retVal = KErrNotFound;
+                    }
+                }
+            if(pAuthenticator)
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,
+                "ESaslMechanism - Handle response and create a new request");
+                CIdWsfSaslMessage* pSaslRequest =
+                    CIdWsfSaslMessage::NewL(Framework().Manager(),
+                                            KSaslXmlns,
+                                            KSaslRequestName,
+                                            KSaslRequestQName);
+
+                CleanupStack::PushL(pSaslRequest); // pSaslRequest
+
+                retVal = pAuthenticator->HandleResponseL(*pSaslResponse,
+                                                            *pSaslRequest);
+                pNextMessage = pSaslRequest->AsXmlL();
+                CleanupStack::PopAndDestroy();  // pSaslRequest
+                CleanupStack::PushL(pNextMessage);
+                }
+            else
+                {
+                retVal = KErrNotFound;
+                }
+            } // end IsContinue()
+        }
+
+    if(iCState == EHasSession)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("Parse Response - EHasSession")));
+        // expect a DSQueryResponse with the ResourceOffering for the DS
+        retVal = CIdWsfDiscoveryServiceClient::ProcessResponseL(pSaslResponse);
+
+        if (iService)
+            {
+            iDsSession->SetClientServerIntervalL(
+                                            iService->ClientServerInterval());// codescannerwarnings
+            }
+
+        if ( iService && iDsSession && iDsSession->IsReadyL())
+            {
+            TPtrC8 providerId = iService->ProviderId();
+            iDsSession->SetTrustAnchorL(providerId);
+            iCState = ENotInitialized;  // check if iSession should
+                                        // be deleted here!?
+            }
+        }
+
+    if(pNextMessage)
+        {
+        CleanupStack::Pop(); // pNextMessage
+        }
+
+    CleanupStack::PopAndDestroy(); // pSaslResponse
+    aParsedMessage = pNextMessage;  // assign data pointer
+
+    return retVal;
+    }
+
+
+void CIdWsfAuthenticationServiceClient::SetStatusL(const TInt /*aStatus */)
+    {
+    // No implementation in Java
+    }
+
+void CIdWsfAuthenticationServiceClient::SetAccount(
+                                    CSenIdentityProvider* aIdentityProvicer)
+    {
+    ipAccount = aIdentityProvicer;
+    }
+
+
+TBool CIdWsfAuthenticationServiceClient::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EIdWsfDiscoveryServiceClient ) // direct superclass!    
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CIdWsfDiscoveryServiceClient::HasSuperClass( aType ); 
+        }
+    }
+
+void CIdWsfAuthenticationServiceClient::SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) 
+	{
+	iAuthDetails = aDetails;
+	}
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfcoreserviceconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,356 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "idwsfcoreserviceconsumer.h"
+
+#include "idwsfservicesession.h"
+#include "sendebug.h" // internal Utils\inc - filelogging MACROs
+#include "midwsfsessionvalidator.h"
+#include "msenremotehostlet.h"
+#include "senlogger.h"
+
+
+
+CIdWsfCoreServiceConsumer* CIdWsfCoreServiceConsumer::NewL(CSIF& aSIF)
+    {
+    CIdWsfCoreServiceConsumer* self = CIdWsfCoreServiceConsumer::NewLC(aSIF);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CIdWsfCoreServiceConsumer* CIdWsfCoreServiceConsumer::NewLC(CSIF& aSIF)
+    {
+    CIdWsfCoreServiceConsumer* self =
+        new (ELeave) CIdWsfCoreServiceConsumer(
+                                aSIF,
+                                MSenServiceDescription::ECoreServiceConsumer);
+    CleanupStack::PushL(self);
+    self->BaseConstructL();
+    return self;
+    }
+
+// constructor
+CIdWsfCoreServiceConsumer::CIdWsfCoreServiceConsumer(
+                                                 CSIF& aSIF,
+                                                 TDescriptionClassType aType)
+    : CSenInternalServiceConsumer(aType,aSIF),
+    iService(NULL),
+    iServedConsumer(NULL)
+    {
+    }
+
+void CIdWsfCoreServiceConsumer::BaseConstructL()
+    {
+    CSenInternalServiceConsumer::ConstructL();
+    }
+
+// destructor
+CIdWsfCoreServiceConsumer::~CIdWsfCoreServiceConsumer()
+    {
+    delete iService;
+    }
+
+// GETTERS
+
+CSenServiceSession* CIdWsfCoreServiceConsumer::ServiceSession()
+    {
+    return iService;
+    }
+
+CIdWsfServiceSession* CIdWsfCoreServiceConsumer::IdWsfServiceSession()
+    {
+    return iService;
+    }
+
+MSenRemoteServiceConsumer* CIdWsfCoreServiceConsumer::ServedConsumer()
+    {
+    return iServedConsumer;
+    }
+
+TPtrC8 CIdWsfCoreServiceConsumer::TrustAnchor() const
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::TrustAnchor");
+    TPtrC8 trustAnchor = iService->TrustAnchor();
+
+#ifdef _SENDEBUG
+    if(trustAnchor.Length()>0)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(trustAnchor));
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," - trust anchor not set - ");
+        }
+#endif
+
+    return trustAnchor;
+    }
+
+TPtrC8 CIdWsfCoreServiceConsumer::ProviderId() const
+    {
+    TPtrC8 providerId = iService->ProviderId();
+    return providerId;
+    }
+
+TPtrC8 CIdWsfCoreServiceConsumer::Endpoint()
+    {
+    TPtrC8 endpoint = iService->Endpoint();
+    return endpoint;
+    }
+
+TPtrC8 CIdWsfCoreServiceConsumer::Contract()
+    {
+    TPtrC8 contract =  iService->Contract();
+    return contract;
+    }
+
+TPtrC8 CIdWsfCoreServiceConsumer::FrameworkId()
+    {
+    return iService->FrameworkId();
+    }
+
+const TTime& CIdWsfCoreServiceConsumer::ValidUntilL()
+    {
+    return iService->ValidUntilL();
+    }
+
+
+TPtrC8 CIdWsfCoreServiceConsumer::FrameworkVersion()
+    {
+    TPtrC8 fwVersion = iService->FrameworkVersion();
+
+#ifdef _SENDEBUG
+    if(fwVersion.Length()>0)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(fwVersion));
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," - framework version not set - ");
+        }
+#endif
+
+    return fwVersion;
+    }
+
+void CIdWsfCoreServiceConsumer::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    iService->WriteAsXMLToL(aWriteStream);
+    }
+
+
+// SETTERS
+
+// 2004-07-28: the ownership of the given session should be transferred in here
+// note: current implementation leaves iService in NULL state, if such arg is
+// given(!). But, it might be as well bad idea to preserve old iService
+// (session) in case of NULL arg.
+void CIdWsfCoreServiceConsumer::SetServiceSessionL( CIdWsfServiceSession* aSession )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::SetServiceSessionL");
+
+	_LIT8(KTouch, "touch");
+	
+    const TDesC8* attrValue = aSession->AsElement().AttrValue(KTouch);
+    if(attrValue != NULL)
+    	{
+    	AsElement().AddAttrL(KTouch, *attrValue);
+    	}
+    // free memory
+    delete iService;
+    iService = aSession;
+
+    if(iService)
+        {
+        iService->AddConsumerL(*this);
+        }
+    }
+
+TInt CIdWsfCoreServiceConsumer::SetSessionL(MSenRemoteServiceSession& /* aSession */)
+    {
+    return KErrNone;
+    }
+
+void CIdWsfCoreServiceConsumer::SetEndPointL(const TDesC8& aURI)
+    {
+    iService->SetEndPointL(aURI);
+    }
+
+void CIdWsfCoreServiceConsumer::SetContractL(const TDesC8& aContract)
+    {
+    iService->SetContractL(aContract);
+    }
+
+// CHECKERS
+TBool CIdWsfCoreServiceConsumer::Matches(MSenServiceDescription& aPattern)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::Matches");
+    TBool retVal = iService->Matches(aPattern);
+#ifdef _SENDEBUG
+    if(retVal)  TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("- TRUE")));
+    else        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("- FALSE")));
+#endif
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::HasFacetL(const TDesC8& aURI, TBool& aHasFacet)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::HasFacetL");
+    TInt retVal = iService->HasFacetL(aURI, aHasFacet);
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,(aURI));
+#ifdef _SENDEBUG
+    if(aHasFacet)   TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("- TRUE")));
+    else            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("- FALSE")));
+#endif
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::FacetValue(TDesC8& aURI, HBufC8*& aValueTo)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::FacetValue");
+    TInt retVal = iService->FacetValue(aURI, aValueTo);
+#ifdef _SENDEBUG
+    if(aValueTo)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,(*aValueTo));
+        }
+#endif
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::AddFacetL(const CSenFacet& aFacet)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::AddFacetL");
+    TInt retVal = iService->AddFacetL(aFacet);
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::SetFacetL(const CSenFacet& aFacet)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::SetFacetL");
+    TInt retVal = iService->SetFacetL(aFacet);
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::FacetsL(RFacetArray& aFacetArray)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::FacetsL");
+    TInt retVal = iService->FacetsL(aFacetArray);
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::RemoveFacet(const TDesC8& aURI)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::RemoveFacetL");
+    TInt retVal = iService->RemoveFacet(aURI);
+    return retVal;
+    }
+
+TInt CIdWsfCoreServiceConsumer::ScoreMatchL(MSenServiceDescription& aPattern)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::ScoreMatch");
+    TInt retVal = iService->ScoreMatchL(aPattern);
+    return retVal;
+    }
+
+void CIdWsfCoreServiceConsumer::StartTransaction()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::StartTransaction");
+    iService->StartTransaction();
+    }
+
+void CIdWsfCoreServiceConsumer::TransactionCompleted()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::TransactionCompleted");
+    iService->TransactionCompleted();
+    }
+
+    
+void CIdWsfCoreServiceConsumer::SetValidator(MIdWsfSessionValidator* aValidator)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::SetValidator");
+    iService->SetValidator(aValidator);
+    }
+
+MIdWsfSessionValidator* CIdWsfCoreServiceConsumer::Validator()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::Validator");
+    return iService->Validator();
+    }
+
+MSenTransport& CIdWsfCoreServiceConsumer::TransportL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::TransportL");
+
+    if(!iServedConsumer)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Fatal error: served remote consumer is NULL!");
+        User::Leave(KErrNotFound);
+        }
+    return iServedConsumer->TransportL();
+    }
+
+TInt CIdWsfCoreServiceConsumer::ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk)
+    {
+    if(iServedConsumer)
+        {
+        return iServedConsumer->ChunkByTxnIdL(aTxnId, aChunk);
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfCoreServiceConsumer::TransportL:");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Consumer not found!");
+        return KErrNotFound;
+        }
+    }
+
+TBool CIdWsfCoreServiceConsumer::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == CSenInternalServiceConsumer::DescriptionClassType() ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenInternalServiceConsumer::HasSuperClass( aType ); 
+        }
+    }
+
+
+MSenRemoteHostlet* CIdWsfCoreServiceConsumer::Hostlet() const
+    {
+    MSenRemoteHostlet* pHostlet = NULL;
+    if( iService )
+        {
+        pHostlet = iService->Hostlet();
+        }
+    return pHostlet;
+    }
+
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfcorrelationheader.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+
+#include "idwsfcorrelationheader.h"
+#include "senguidgen.h"
+#include "idwsfmessage.h"
+
+
+namespace
+    {
+    _LIT8(KAttrMessageId, "messageID");
+    _LIT8(KAttrRefToMessageId, "refToMessageID");
+    _LIT8(KAttrTimestamp, "timestamp");
+    }
+
+CIdWsfCorrelationHeader* CIdWsfCorrelationHeader::NewL(
+                                                const TDesC8& aRefToMessageId)
+    {
+    CIdWsfCorrelationHeader* pNew = new (ELeave) CIdWsfCorrelationHeader;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aRefToMessageId);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfCorrelationHeader* CIdWsfCorrelationHeader::NewL(
+                                            const RAttributeArray& aAttributes)
+    {
+    CIdWsfCorrelationHeader* pNew = new (ELeave) CIdWsfCorrelationHeader;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfCorrelationHeader::CIdWsfCorrelationHeader()
+    {
+    }
+
+void CIdWsfCorrelationHeader::ConstructL(const TDesC8& aRefToMessageId)
+    {
+    BaseConstructL(KSBXmlNs, KCorrelationName, KCorrelationQName);
+
+    CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
+    ipMessageId = pGuidGenerator->GetRandomGuid8LC();
+    CleanupStack::Pop();            // ipMessageId
+    CleanupStack::PopAndDestroy(); // pGuidGenerator
+
+    ipRefToMessageId = aRefToMessageId.AllocL();
+
+    // Init timestamp
+    TTime t;
+    t.UniversalTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf82L(ts, t);
+    ipTimestamp = ts.AllocL();
+    }
+
+void CIdWsfCorrelationHeader::ConstructL(const RAttributeArray& aAttributes)
+    {
+    BaseConstructL(KSBXmlNs, KCorrelationName);
+
+    ipMessageId = SenXmlUtils::AllocAttrValueL(aAttributes, KAttrMessageId);
+    ipRefToMessageId = SenXmlUtils::AllocAttrValueL(aAttributes, KAttrRefToMessageId);
+    ipTimestamp = SenXmlUtils::AllocAttrValueL(aAttributes, KAttrTimestamp);
+
+    __ASSERT_ALWAYS(ipMessageId != NULL, User::Leave(KErrArgument));
+    __ASSERT_ALWAYS(ipTimestamp != NULL, User::Leave(KErrArgument));
+    }
+
+CIdWsfCorrelationHeader::~CIdWsfCorrelationHeader()
+    {
+    delete ipMessageId;
+    delete ipRefToMessageId;
+    delete ipTimestamp;
+    }
+
+TPtrC8 CIdWsfCorrelationHeader::MessageId()
+    {
+    return *ipMessageId;
+    }
+
+TPtrC8 CIdWsfCorrelationHeader::RefToMessageId()
+    {
+    if (!ipRefToMessageId)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return *ipRefToMessageId;
+        }
+    }
+
+TPtrC8 CIdWsfCorrelationHeader::Timestamp()
+    {
+    if(ipTimestamp)
+        return *ipTimestamp;
+    else
+        {
+        return KNullDesC8(); // should not happen(!)
+        }
+    }
+
+void CIdWsfCorrelationHeader::SetCorrelationL(const TDesC8& aRefToMessageId)
+    {
+    HBufC8* pRefToMessageId = NULL;aRefToMessageId.AllocL();
+    delete ipRefToMessageId;
+    ipRefToMessageId = pRefToMessageId;
+    }
+
+void CIdWsfCorrelationHeader::WriteAttrsToL(RWriteStream& aWriteStream)
+    {
+    WriteAttrToL(aWriteStream, KAttrMessageId, *ipMessageId);
+
+    // check that reftomessageid exists and is over zero-length
+    // IOP: empty reftomessageid is not allowed by specs(!):
+    if (ipRefToMessageId && ipRefToMessageId->Length()>0)
+        {
+        WriteAttrToL(aWriteStream, KAttrRefToMessageId, *ipRefToMessageId);
+        }
+    WriteAttrToL(aWriteStream, KAttrTimestamp, *ipTimestamp);
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfdiscoveryserviceclient.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,562 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+#include <s32mem.h>
+
+#include <SenFacet.h>
+#include <SenServiceConnection.h>
+#include <SenXmlReader.h>
+#include <SenXmlUtils.h>
+
+#include "msencoreservicemanager.h"
+#include "sendebug.h"
+
+#include "idwsfmessage.h"  // for response parsing and request building
+#include "idwsfdsqueryresponse.h"
+#include "idwsfdiscoveryserviceclient.h"
+#include "idwsfservicesession.h"
+#include "idwsfdsqueryresponse.h"
+
+#include "senlogger.h"
+// for the parsing and the construction of outgoing DSLookups
+
+namespace
+    {
+    // 2004-07-21:
+    _LIT8(KDiscoReqStart1,"<Query xmlns=\"urn:liberty:disco:2003-08\" >");
+
+    // the resouse id element is not needed if no content is available
+    _LIT8(KDiscoReqResIdStart,"<ResourceID>");
+    _LIT8(KDiscoReqResIdEnd,"</ResourceID>");
+
+    _LIT8(KEncrStart,"<Encrypted");
+    _LIT8(KDiscoReqEncrResIdStart,"<EncryptedResourceID>");
+    _LIT8(KDiscoReqEncrResIdEnd,"</EncryptedResourceID>");
+
+    _LIT8(KDiscoReqStart2,"<RequestedServiceType><ServiceType>");
+    _LIT8(KDiscoReqEnd2,"</ServiceType>");
+    _LIT8(KDiscoOptionsStart,"<Options>");
+    _LIT8(KDiscoOptionsEnd,"</Options>");
+    _LIT8(KSenOption,"Option");
+    _LIT8(KDiscoReqEnd, " </RequestedServiceType> </Query>");
+
+    const TInt KFLATBUF_SIZE = 128;
+    }
+
+
+CIdWsfDiscoveryServiceClient* CIdWsfDiscoveryServiceClient::NewL(
+                                                         CSIF& aSIF)//,
+                                                         //RFileLogger& aLogger)
+    {
+    CIdWsfDiscoveryServiceClient* pNew = NewLC(aSIF);//, aLogger);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CIdWsfDiscoveryServiceClient* CIdWsfDiscoveryServiceClient::NewLC(
+                                                        CSIF& aSIF)//,
+                                                        //RFileLogger& aLogger)
+    {
+    CIdWsfDiscoveryServiceClient* pNew =
+        new (ELeave) CIdWsfDiscoveryServiceClient(
+                        aSIF,
+                        MSenServiceDescription::EIdWsfDiscoveryServiceClient);//,
+                        //aLogger);
+
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+CIdWsfDiscoveryServiceClient::CIdWsfDiscoveryServiceClient(CSIF& aSIF,
+                                                           TDescriptionClassType aType)//,
+                                                           //RFileLogger& aLogger) 
+    : CIdWsfCoreServiceConsumer(aSIF, aType),
+    iCState(ENotInitialized),
+    iSession(NULL)//,
+    //iLog(aLogger)
+    {
+    }
+
+// returns KErrNotFound, if no matching security mechanism was found
+// in ProcessResponce() call
+// returns KErrNotReady, if no service session has been initilized
+TInt CIdWsfDiscoveryServiceClient::FindServiceL(
+                    RPointerArray<CSenWSDescription>& aServiceArray,
+                    MSenServiceDescription& aPattern,
+                    MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfDiscoveryServiceClient::FindServiceL()");
+
+    // keep this line first
+    iServedConsumer = &aRemoteConsumer;
+
+    iResults.ResetAndDestroy(); // clear array and destroy its contents
+    iCState = EHasResults;
+
+    HBufC8* pLookupReq = NULL;
+    TPtrC8 contract = aPattern.Contract();
+
+    TInt retVal(KErrNone);
+    if(contract.Length()>0)
+        {
+        // DsLookupRequestL never returns NULL
+        pLookupReq = DsLookupRequestL(aPattern);
+
+        CleanupStack::PushL(pLookupReq);
+
+        if(iService)
+            {
+            HBufC8* pResponse = NULL;
+    #ifdef _SENDEBUG
+            TPtr8 lookupRequest = pLookupReq->Des();
+//wslog            FILELOGALL(_L("SenCoreServiceManager"), _L("DS_lookup_req.xml"), lookupRequest);
+    #endif // _SENDEBUG
+
+            retVal = iService->SubmitL(*pLookupReq, KNullDesC8, *this, pResponse); 
+            aRemoteConsumer.SetDataTrafficDetails(iDiscDetails);           
+        
+            
+       
+            CleanupStack::PushL(pResponse);
+            if(retVal == KErrNone && pResponse)
+                {
+    #ifdef _SENDEBUG
+                TPtr8 lookupResponse= pResponse->Des();
+//wslog                FILELOGALL(_L("SenCoreServiceManager"), _L("DS_lookup_rsp.xml"), lookupResponse);
+    #endif // _SENDEBUG
+
+                CIdWsfDsQueryResponse* pDsQueryResponse =
+                    ParseResponseLC(*pResponse); // push #3
+
+                retVal = ProcessResponseL(pDsQueryResponse);
+
+                CleanupStack::PopAndDestroy(1); // pDsQueryResponse
+
+                TInt count(iResults.Count());
+                for(TInt i=0; i<count; i++)
+                    {
+    #ifdef _SENDEBUG
+                    if(iResults[0])
+                        {
+                        HBufC* pAsXml = iResults[0]->AsXmlUnicodeL();
+                        if(pAsXml)
+                            {
+                            CleanupStack::PushL(pAsXml);
+                            CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("Result (%d):"), i));
+                            CSLOG_ALL(aRemoteConsumer.ConnectionId(), KMaxLogLevel ,(*pAsXml));
+                            CleanupStack::PopAndDestroy(); // pAsXml
+                            }
+
+                        }
+    #endif
+                    // we now could annotate any new service (session) with
+                    // relevant facets from the input ServiceDescription,
+                    // but not with disco_options!
+                    ((CIdWsfServiceSession*)iResults[0])->CopyFacetsFromL(
+                                                                    aPattern);
+                    ((CIdWsfServiceSession*)iResults[0])->SetValidator(this);
+                    TInt appendRetVal = aServiceArray.Append(
+                                    (CSenWSDescription*)iResults[0]);
+                    if(appendRetVal!=KErrNone)
+                        {
+                        // out of memory, free orphan
+                        delete iResults[0];
+                        }
+                    iResults.Remove(0);
+                    }
+                }
+            CleanupStack::PopAndDestroy(); // pResponse
+            }
+        else
+            {
+            retVal = KErrNotReady;
+            }
+        CleanupStack::PopAndDestroy(); // pLookupReq
+        }
+    else
+        {
+        retVal = KErrSenNoContract;
+        }
+    return retVal;
+    }
+
+
+
+void CIdWsfDiscoveryServiceClient::BaseConstructL()
+    {
+    CIdWsfCoreServiceConsumer::BaseConstructL();
+
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("CIdWsfDiscoveryServiceClient::BaseConstructL()")));
+    }
+
+TInt CIdWsfDiscoveryServiceClient::ValidateL(
+                                    CIdWsfServiceSession& aSession,
+                                    MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfDiscoveryServiceClient::ValidateL");
+
+    // keep this line first
+    iServedConsumer = &aRemoteConsumer;
+    iSession = &aSession; // iSession == Java's stateObject !!!
+
+    iCState = EHasSession;
+    CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"- creating discovery lookup request.");
+
+
+    HBufC8* pLookupReqUtf8 = DsLookupRequestL(aSession);
+    CleanupStack::PushL(pLookupReqUtf8);
+
+    HBufC8* pSubmitResponse = NULL; // for ref-to-ptr
+
+#ifdef _SENDEBUG
+    TPtr8 lookupRequest= pLookupReqUtf8->Des();
+//wslog    FILELOGALL(_L("SenCoreServiceManager"), _L("DS_lookup_req.xml"), lookupRequest);
+#endif // _SENDEBUG
+
+    TInt retVal = iService->SubmitL(*pLookupReqUtf8, KNullDesC8, *this, pSubmitResponse); 
+    CleanupStack::PopAndDestroy(); // pLookupReqUtf8
+
+    CleanupStack::PushL(pSubmitResponse);
+	aRemoteConsumer.SetDataTrafficDetails(iDiscDetails);	
+
+    if(retVal == KErrNone && pSubmitResponse)
+        {
+        // submit ok
+#ifdef _SENDEBUG
+        TPtr8 lookupResponse = pSubmitResponse->Des();
+//wslog        FILELOGALL(_L("SenCoreServiceManager"), _L("DS_lookup_rsp.xml"), lookupResponse);
+#endif // _SENDEBUG
+        CIdWsfDsQueryResponse* theResponse = ParseResponseLC(*pSubmitResponse);
+        retVal = ProcessResponseL(theResponse);
+        CleanupStack::PopAndDestroy(); // theResponse
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfDiscoveryServiceClient::ValidateL");
+        CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("- SubmitL failed: %d"), retVal));
+        }
+#endif // _SENDEBUG
+    CleanupStack::PopAndDestroy(); // pSubmitResponse
+        
+    if ((retVal == KErrNone) && iSession->IsReadyL())
+        {
+        CSLOG_L(aRemoteConsumer.ConnectionId(), KMinLogLevel ,"- setting this DS client as validator for ID-WFS session.");
+        iSession->SetValidator(this);
+        }
+
+    return retVal;
+    }
+
+CIdWsfDsQueryResponse* CIdWsfDiscoveryServiceClient::ParseResponseLC(
+                                                            TDesC8& aMessage)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("CIdWsfDiscoveryServiceClient::ParseResponseLC")));
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(aMessage));
+
+    // must be first, if we promise LC in this method..
+    CIdWsfDsQueryResponse* pResponse = CIdWsfDsQueryResponse::NewLC();
+
+
+    pResponse->SetReader(*Framework().Manager().XMLReader());
+    pResponse->ParseL(aMessage);
+    return pResponse; // item resides in cleanupstack
+    }
+
+// returns KErrNotFound, if no matching security mechanism was found
+TInt CIdWsfDiscoveryServiceClient::ProcessResponseL(
+                                            CIdWsfDsQueryResponse* aResponse)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("CIdWsfDiscoveryServiceClient::ProcessResponseL")));
+
+    TInt retVal(KErrNone);
+
+    RPointerArray<CIdWsfServiceInstance> services; // 2004-08-09, bugfix
+
+    CleanupClosePushL(services);
+    aResponse->GetAllServicesL(services);
+
+    CIdWsfServiceSession* pTempSession = NULL; // session in Java!
+
+    switch(iCState)
+        {
+        case EHasSession:
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("   State: EHasSession")));
+            pTempSession = iSession; // iSession == stateObject in Java!
+            if (pTempSession)
+                {
+#ifdef _SENDEBUG
+                if(pTempSession->IsReadyL())
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"   Current session is valid.");
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"   Current session is expired.");
+                    }
+#endif
+
+                if (iService)
+                    {
+                    pTempSession->SetClientServerIntervalL(
+                                                iService->ClientServerInterval());// codescannerwarnings
+                    }
+
+                TInt count(services.Count());
+                for(TInt i=0; !pTempSession->IsReadyL()
+                            && i<count; i++) // not-operation bugfix, 2004-07-20
+                    {
+                    if(services[i])
+                        {
+                        retVal = pTempSession->InitializeFromL(*services[i]);
+                        }
+                    }
+
+                if(pTempSession->IsReadyL() && iService)
+                    {
+                    pTempSession->SetTrustAnchorL(iService->TrustAnchor());
+                    }
+                }
+            iCState = ENotInitialized;
+            }
+            break;
+
+        case EHasResults:
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("   State: EHasResults")));
+            TInt count(services.Count());
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L("Response included %d services."),count));
+            for (TInt i=0; i<count; i++)
+                {
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L("Trying to initialize service number %d "),i));
+                pTempSession =
+                    (CIdWsfServiceSession*)Framework().NewServiceDescriptionL();
+                CleanupStack::PushL(pTempSession);
+
+                if (iService)
+                    {
+                    pTempSession->SetClientServerIntervalL(
+                                            iService->ClientServerInterval());	//codescannerwarnings
+                    }
+
+                for(TInt j=i; j<count && !pTempSession->IsReadyL(); j++)
+                    {
+                    retVal = pTempSession->InitializeFromL(*services[j]);
+                    if(!pTempSession->IsReadyL())
+                        {
+                        i++;
+                        }
+                    }
+                
+
+                if(pTempSession->IsReadyL())
+                    {
+                    if(iService)
+                        {
+                        pTempSession->SetTrustAnchorL(iService->TrustAnchor());
+                        }
+                    TInt appendRetVal = iResults.Append(pTempSession); // only ready ones goto list
+                    if(appendRetVal == KErrNone)
+                        {
+                        CleanupStack::Pop(); //pTempSession
+                        }
+                    else
+                        {
+                        CleanupStack::PopAndDestroy(); // pTempSession
+                        }
+                    }
+                else
+                    {
+                    // No ready Session found
+                    CleanupStack::PopAndDestroy(); //pTempSession
+                    }
+                }
+            }
+            break;
+
+        default:
+            // do nothing
+            break;
+        }
+
+    CleanupStack::PopAndDestroy(); // close services, // 2004-08-09, bugfix
+    return retVal;
+    }
+
+void CIdWsfDiscoveryServiceClient::SetStatusL(const TInt /* aStatus */ )
+    {
+    }
+
+
+
+CIdWsfDiscoveryServiceClient::~CIdWsfDiscoveryServiceClient()
+    {
+    iResults.ResetAndDestroy();
+    }
+
+
+// overrides the internalserviceconsumer.log() function
+// to enable using the log delivered as constructor arg.
+/*RFileLogger* CIdWsfDiscoveryServiceClient::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+*/
+
+
+HBufC8* CIdWsfDiscoveryServiceClient::DsLookupRequestL(
+                                            MSenServiceDescription& aPattern)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,(_L("CIdWsfDiscoveryServiceClient::DsLookupRequestL")));
+
+    RFacetArray options;
+    CleanupClosePushL(options);
+
+    CIdWsfDiscoveryServiceClient::DSOptionsL(options, aPattern);
+
+    CBufFlat* pFlat = CBufFlat::NewL(KFLATBUF_SIZE);
+    CleanupStack::PushL(pFlat);
+
+    RBufWriteStream ws;
+    ws.Open(*pFlat);
+    CleanupClosePushL(ws);
+
+    // create the disco lookup query and fill it with the passed service type
+    ws.WriteL(KDiscoReqStart1);
+    TPtrC8 resourceId = iService->ResourceId();
+    if(resourceId.Length()>0)
+        {
+        if(resourceId.Find(KEncrStart) == 0)
+            {
+            ws.WriteL(KDiscoReqEncrResIdStart);
+            ws.WriteL(resourceId);
+            ws.WriteL(KDiscoReqEncrResIdEnd);
+            }
+        else
+            {
+            ws.WriteL(KDiscoReqResIdStart);
+            ws.WriteL(resourceId);
+            ws.WriteL(KDiscoReqResIdEnd);
+            }
+        }
+    ws.WriteL(KDiscoReqStart2);
+    ws.WriteL(aPattern.Contract());
+    ws.WriteL(KDiscoReqEnd2);
+
+    if (options.Count())
+        {
+        ws.WriteL(KDiscoOptionsStart);
+
+        CSenXmlElement* pOption = NULL; 
+        HBufC8* pOptionAsXml = NULL;
+
+        TInt count(options.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            pOption = CSenXmlElement::NewL(KSenOption); 
+            CleanupStack::PushL(pOption);
+            pOption->CopyFromL(*options[i]);
+            pOptionAsXml = pOption->AsXmlL();
+            CleanupStack::PushL(pOptionAsXml);
+            ws.WriteL(*pOptionAsXml);
+            CleanupStack::PopAndDestroy(2); // pOptionAsXml, pOption
+            }
+        ws.WriteL(KDiscoOptionsEnd);
+        }
+
+    ws.WriteL(KDiscoReqEnd);
+
+    CleanupStack::PopAndDestroy(); // ws.Close();
+
+    TPtr8 p8 = pFlat->Ptr(0);
+    HBufC8* pReq8 = p8.AllocL();
+    CleanupStack::PopAndDestroy( pFlat );
+    
+#ifdef _SENDEBUG   
+    CleanupStack::PushL( pReq8 );
+    if( pReq8 )
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(_L8("Returning Discovery Service Lookup Request:")));
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(*pReq8));
+        
+        }
+    CleanupStack::Pop( pReq8 ); // pReq8 == return value
+#endif // _SENDEBUG        
+    options.ResetAndDestroy();
+    CleanupStack::Pop(); // options
+    return pReq8;
+    }
+
+TInt CIdWsfDiscoveryServiceClient::DSOptionsL(
+                                RFacetArray& aOptionArray,
+                                MSenServiceDescription& aServiceDescription)
+    {
+    TInt retVal = KErrNone;
+
+    RFacetArray facets;
+    CleanupClosePushL(facets);
+    aServiceDescription.FacetsL(facets);
+
+    CSenFacet* pFacet = NULL;
+    TInt count(facets.Count());
+    for (TInt i=0; i<count && retVal == KErrNone; i++)
+        {
+        if (facets[i]->Type() == KDiscoOption)
+            {
+            pFacet = CSenFacet::NewL(*facets[i]);
+            retVal = aOptionArray.Append(pFacet);
+            }
+        }
+    facets.ResetAndDestroy();
+    CleanupStack::Pop(); //facets
+
+    return retVal;
+    }
+
+
+
+
+TBool CIdWsfDiscoveryServiceClient::HasSuperClass( TDescriptionClassType aType )
+    {
+   if( aType == MSenServiceDescription::ECoreServiceConsumer ) // direct superclass!    
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CIdWsfCoreServiceConsumer::HasSuperClass( aType ); 
+        }
+    }
+
+void CIdWsfDiscoveryServiceClient::SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) 
+	{
+	iDiscDetails = aDetails;
+	}
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfdsqueryresponse.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,411 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenDateUtils.h>
+#include <SenFacet.h>
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include <SenXmlUtils.h>
+#include <SenCredential.h>
+
+#include "idwsfdsqueryresponse.h"
+#include "sendebug.h"
+
+
+namespace
+    {
+    _LIT8(KOkLowerCase, "ok");
+    _LIT8(KOkUpperCase, "OK");
+
+    _LIT8(KResourceIdName, "ResourceID");
+    _LIT8(KResourceOfferingName, "ResourceOffering");
+    _LIT8(KServiceInstanceName, "ServiceInstance");
+    _LIT8(KEncryptedResourceIdName, "EncryptedResourceID");
+    _LIT8(KProviderIdName, "ProviderID");
+    _LIT8(KCredentialRefName, "CredentialRef");
+    _LIT8(KServiceTypeName, "ServiceType");
+    _LIT8(KOptionName, "Option");
+
+    _LIT8(KVal_NotOnOrAfter, "NotOnOrAfter");
+
+    _LIT8(KDescriptionElementLocalName, "Description");
+    }
+
+CIdWsfDsQueryResponse* CIdWsfDsQueryResponse::NewL()
+    {
+    CIdWsfDsQueryResponse* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfDsQueryResponse* CIdWsfDsQueryResponse::NewLC()
+    {
+    CIdWsfDsQueryResponse* pNew = new (ELeave) CIdWsfDsQueryResponse;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+CIdWsfDsQueryResponse* CIdWsfDsQueryResponse::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CIdWsfDsQueryResponse* pNew = NewLC( aNsUri, aLocalName, aQName );
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfDsQueryResponse* CIdWsfDsQueryResponse::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CIdWsfDsQueryResponse* pNew = new (ELeave) CIdWsfDsQueryResponse;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    return pNew;
+    }
+
+
+CIdWsfDsQueryResponse::CIdWsfDsQueryResponse()
+: ipResourceOffering(NULL),
+  ipCredential(NULL),
+  ipServiceInstance(NULL)
+    {
+    }
+
+void CIdWsfDsQueryResponse::BaseConstructL()
+    {
+    CSenBaseFragment::BaseConstructL(
+        KQueryResponseXmlns,
+        KQueryResponseName,
+        KQueryResponseQName
+        );
+    }
+
+void CIdWsfDsQueryResponse::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CSenBaseFragment::BaseConstructL(aNsUri, aLocalName, aQName);
+    iNotOnOrAfter = Time::NullTTime();
+    }
+
+CIdWsfDsQueryResponse::~CIdWsfDsQueryResponse()
+    {
+    delete ipStatus;
+    iResourceOfferings.ResetAndDestroy();
+
+    // should be NULL if appended to iResourceOfferings:
+    delete ipResourceOffering;
+    delete ipCredential;
+    delete ipServiceInstance;
+    }
+
+void CIdWsfDsQueryResponse::GetAllServicesL(
+        RPointerArray<CIdWsfServiceInstance>& aDest )
+    {
+    // Return all CIdWsfServiceInstance's
+    for (TInt i = 0; i < iResourceOfferings.Count(); i++)
+        {
+        RPointerArray<CIdWsfServiceInstance>& services =
+            iResourceOfferings[i]->ServicesL();
+        for (TInt j = 0; j < services.Count(); j++)
+            {
+            User::LeaveIfError(aDest.Append(services[j]));
+            }
+        }
+    }
+
+void CIdWsfDsQueryResponse::StartElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            SaveNamespacesL(aAttributes, EFalse);
+
+            // we are interested in the Status element
+            if (aLocalName == KStatusName)
+                {
+                // we should save the status code
+                HBufC8* pNew =
+                    SenXmlUtils::AllocAttrValueL(aAttributes, 
+                                                    KStatusCodeName);
+                delete ipStatus;
+                ipStatus = pNew;
+                }
+
+            // we are interested in ResourceOffering
+            else if (aLocalName == KResourceOfferingName)
+                {
+                // odd state: starts saving content
+                iState = KStateParsingResourceOffering;
+                ipResourceOffering = CIdWsfResourceOffering::NewL();
+                }
+
+            //or in a Credentials
+            else if (aLocalName == KCredentialsName)
+                {
+                iState = KStateParsingCredentials;
+                TPtrC8 ptr = SenXmlUtils::AttrValue(aAttributes, 
+                                                    KVal_NotOnOrAfter);
+                if (ptr.Length()>0)
+                    {
+                    iNotOnOrAfter = SenDateUtils::FromXmlDateTimeL(ptr);
+                    }
+                }
+            break;
+            }
+        case KStateParsingResourceOffering:
+            {
+            // We clean the buffer so that we can save the element content
+            // At endElement we will know what member of the resource offering
+            // to set.
+            ResetContentL();
+            // save namespace declarations and ensure that all local prefixes
+            // are noted.
+            SaveNamespacesL(aAttributes, ETrue);
+            if (aLocalName == KServiceInstanceName)
+                {
+                // if this is second RO, delete the ipServiceInstance made
+                // ready
+                // previous RO's possible (but not encountered) next service
+                // instance.
+                // bugfix 2004-11-09
+                if(ipServiceInstance)
+                    {
+                    delete ipServiceInstance;
+                    ipServiceInstance = NULL;
+                    }
+
+                ipServiceInstance = CIdWsfServiceInstance::NewL();
+                }
+            if (aLocalName == KEncryptedResourceIdName)
+                {
+                iState = KStateParsingEncryptedResourceId;
+                }
+            break;
+            }
+        case KStateParsingEncryptedResourceId:
+            {
+            AllocContentSaverL();
+            WriteStartElementL(aNsUri, aLocalName, aQName, aAttributes);
+            break;
+            }
+        case KStateParsingCredentials:
+            {
+            CSenCredential* pCredential = CSenCredential::NewL(
+                aNsUri, aLocalName, aQName, aAttributes, AsElement());
+
+            CleanupStack::PushL(pCredential);  // bugfix 2004-08-09
+
+            if (iNotOnOrAfter != Time::NullTTime())
+                {
+                pCredential->SetValidUntil(iNotOnOrAfter);
+                }
+
+            delete ipCredential;
+            ipCredential = pCredential;
+            CleanupStack::Pop(); // class owns the pCredential now..
+            DelegateParsingL(*ipCredential);
+            iState = KStateParsingSingleCredential;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+void CIdWsfDsQueryResponse::EndElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName)
+    {
+    switch(iState)
+        {
+        case KStateParsingResourceOffering:
+            {
+            if (aLocalName == KResourceOfferingName)
+                {
+                User::LeaveIfError(
+                            iResourceOfferings.Append(ipResourceOffering));
+                ipResourceOffering = NULL;
+                iState = KStateIgnore;
+                }
+            else if (aLocalName == KResourceIdName ||
+                        aLocalName == KEncryptedResourceIdName)
+                {
+                ipResourceOffering->SetResourceIdL(Content());
+                }
+
+            else if (aLocalName == KDescriptionElementLocalName)
+                {
+                ipResourceOffering->AddServiceInstanceL(ipServiceInstance);
+
+                // alloc new instance for the next parsing cycle
+                ipServiceInstance =
+                        CIdWsfServiceInstance::NewL(*ipServiceInstance);
+                break;
+                }
+            else
+                {
+                if (aLocalName == KProviderIdName)
+                    {
+                    ipServiceInstance->SetProviderIdL(Content());
+                    break;
+                    }
+                else if (aLocalName == KSecurityMechIdName)
+                    {
+                    ipServiceInstance->AddSecurityMechL(Content());
+                    break;
+                    }
+                else if (aLocalName == KCredentialRefName)
+                    {
+                    ipServiceInstance->AddCredentialRefL(Content());
+                    break;
+                    }
+                else if (aLocalName == KEndpointName)
+                    {
+                    ipServiceInstance->SetEndPointL(Content());
+                    break;
+                    }
+                else if (aLocalName == KServiceTypeName)
+                    {
+                    ipServiceInstance->SetServiceTypeL(Content());
+                    break;
+                    }
+                else if (aLocalName == KOptionName)
+                    {
+                    CSenFacet* pFacet = CSenFacet::NewL();
+                    CleanupStack::PushL( pFacet );
+                    pFacet->SetNameL(Content());
+                    pFacet->SetTypeL(KDiscoOption);
+                    ipResourceOffering->SetFacetL(*pFacet);
+                    CleanupStack::PopAndDestroy( pFacet ); // SetFacetL does not take ownership but makes a copy of the facet insteadfs
+                    break;
+                    }
+                }
+            break;
+            }
+        case KStateParsingEncryptedResourceId:
+            {
+            if (aLocalName == KResourceIdName ||
+                aLocalName == KEncryptedResourceIdName)
+                {
+                ipResourceOffering->SetResourceIdL(Content());
+                iState = KStateParsingResourceOffering;
+                }
+            else WriteEndElementL(aNsUri, aLocalName, aQName);
+            break;
+            }
+        case KStateParsingCredentials:
+            {
+            if (aLocalName == KCredentialsName)
+                {
+                iNotOnOrAfter = Time::NullTTime();
+                iState = KStateIgnore;
+                }
+            break;
+            }
+        case KStateParsingSingleCredential:
+            {
+
+            HBufC8* pAsXml = ipCredential->AsXmlL();
+            CleanupStack::PushL(pAsXml);
+            const TDesC8& refId = ipCredential->Id();
+
+            if(pAsXml && refId.Length()>0)
+                {
+                ipCredential->DetachL();
+
+                TInt count(iResourceOfferings.Count());
+                for (TInt i = 0; i < count; i++)
+                    {
+                    iResourceOfferings[i]->AddCredentialL(*ipCredential);
+                    }
+                delete ipCredential;
+                }
+            else
+                delete ipCredential; // ownership was _not_ transferred(!),
+                                     // forced to delete here
+
+            CleanupStack::PopAndDestroy(); // pAsXml;
+
+            ipCredential = NULL;
+            iState = KStateParsingCredentials;
+            break;
+            }
+        default: // corresponds with ref-impl (Java) having case
+                 // BaseFragment.IGNORE: break;
+            {
+            break;
+            }
+        }
+    }
+
+TBool CIdWsfDsQueryResponse::IsOk()
+    {
+    if (!ipStatus)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return (SenXmlUtils::EndsWith(*ipStatus, KOkLowerCase) ||
+                SenXmlUtils::EndsWith(*ipStatus, KOkUpperCase));
+        }
+    }
+
+// returns the first one (oldest) added..
+TPtrC8 CIdWsfDsQueryResponse::ResourceId()
+    {
+    if (iResourceOfferings.Count() > 0)
+        {
+        return iResourceOfferings[0]->ResourceId();
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+RPointerArray<CIdWsfResourceOffering>&
+                                    CIdWsfDsQueryResponse::ResourceOfferingsL()
+    {
+    return iResourceOfferings;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfmessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenDateUtils.h>
+
+#include "idwsfmessage.h"
+
+namespace
+    {
+    _LIT8(KSB11XmlNs,           "urn:liberty:sb:2004-04");
+    _LIT8(KStatus,              "Status");
+    _LIT8(KStatusCodeAttr,      "code");
+    //_LIT8(KStatusOK,          "ok");
+    _LIT8(KDetail,              "detail");
+    }
+
+CIdWsfMessage* CIdWsfMessage::NewL(const TDesC8& aRefToMessageId)
+    {
+    CIdWsfMessage* pNew = new (ELeave) CIdWsfMessage;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aRefToMessageId);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfMessage::~CIdWsfMessage()
+    {
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, delete CSenSoapEnvelope::HeaderL().RemoveElement(KSiuXmlns, KSiuName);)
+    leaveCode=0; // not used
+    if(ipSiuHeader)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipSiuHeader->ExtractElement();
+        delete ipSiuHeader;
+        }
+    }
+
+CIdWsfMessage::CIdWsfMessage()
+    {
+    }
+
+void CIdWsfMessage::BaseConstructL(const TDesC8& aRefToMessageId)
+    {
+    CIdWsfSoapMessage::BaseConstructL();
+
+    // Add correlation header
+    ipCorrelationHeader = CIdWsfCorrelationHeader::NewL(aRefToMessageId);
+    AddHeaderL(*ipCorrelationHeader);
+    }
+
+void CIdWsfMessage::ParseHeaderL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    if ((aNsUri == KSBXmlNs) && (aLocalName == KCorrelationName))
+        {
+        // Remove existing stuff
+        delete HeaderL().RemoveElement(KSBXmlNs, KCorrelationName);
+
+        // Add new correlation header
+        ipCorrelationHeader = NULL;
+        ipCorrelationHeader = CIdWsfCorrelationHeader::NewL(aAttributes);
+        AddHeaderL(*ipCorrelationHeader);
+        }
+    else if ((aNsUri == KSB11XmlNs) && (aLocalName == KSiuName))
+        {
+        // Remove existing stuff
+        delete HeaderL().RemoveElement(KSB11XmlNs, KSiuName);
+        if (ipSiuHeader)
+            {
+            // We do not own the element, so remove it from the fragment.
+            ipSiuHeader->ExtractElement();
+            delete ipSiuHeader;
+            }
+        ipSiuHeader = NULL;
+        ipSiuHeader = CIdWsfSiuHeader::NewL();
+        DelegateParsingL(*ipSiuHeader);
+        AddHeaderL(ipSiuHeader->AsElement());
+        }
+    else
+        {
+        CIdWsfSoapMessage::ParseHeaderL(aNsUri, aLocalName, aQName, aAttributes);
+        }
+    }
+
+void CIdWsfMessage::SetCorrelationL(const TDesC8& aRefToMessageId)
+    {
+    ipCorrelationHeader->SetCorrelationL(aRefToMessageId);
+    }
+
+TPtrC8 CIdWsfMessage::MessageId()
+    {
+    return ipCorrelationHeader->MessageId();
+    }
+
+
+TPtrC8 CIdWsfMessage::RefToMessageId()
+    {
+    return ipCorrelationHeader->RefToMessageId();
+    }
+
+TPtrC8 CIdWsfMessage::Timestamp()
+    {
+    return ipCorrelationHeader->Timestamp();
+    }
+
+CIdWsfSiuHeader* CIdWsfMessage::SiuHeader()
+    {
+    return ipSiuHeader;
+    }
+
+const TDesC8* CIdWsfMessage::StatusCodeL()
+    {
+    const TDesC8* pCode = NULL;
+    CSenElement* pStatus = NULL;
+    // this fetched first child of Body,not yet the status
+    CSenElement* pBodyChild = CIdWsfSoapMessage::BodyL().Child(0);
+
+    if (pBodyChild)
+        {
+        //now we should have the S:Fault/detail element
+        pStatus = pBodyChild->Element(KSBXmlNs,KStatus);
+        }
+
+    if (!pStatus && pBodyChild)
+        {
+        //now we should have the S:Fault/detail element
+        pBodyChild = pBodyChild->Element(KNullDesC8, KDetail);
+        if (pBodyChild)
+            {
+            //now we should have the S:Fault/detail element
+            pStatus = pBodyChild->Element(KSBXmlNs,KStatus);
+            }
+        }
+
+    if (pStatus)
+        {
+        pCode = pStatus->AttrValue(KStatusCodeAttr);
+        }
+
+    return pCode;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfresourceoffering.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenCredential.h>
+
+#include "idwsfresourceoffering.h"
+
+CIdWsfResourceOffering* CIdWsfResourceOffering::NewL()
+    {
+    CIdWsfResourceOffering* pNew = new (ELeave) CIdWsfResourceOffering;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfResourceOffering::CIdWsfResourceOffering()
+    {
+    }
+
+void CIdWsfResourceOffering::ConstructL()
+    {
+    // Leave everything uninitialized for now
+    }
+
+CIdWsfResourceOffering::~CIdWsfResourceOffering()
+    {
+    delete ipResourceId;
+    iServices.ResetAndDestroy();
+    }
+
+TPtrC8 CIdWsfResourceOffering::ResourceId()
+    {
+    if(ipResourceId)
+        return *ipResourceId;
+    else
+        return KNullDesC8();
+    }
+
+void CIdWsfResourceOffering::SetResourceIdL(const TDesC8& aId)
+    {
+    HBufC8* pNew = NULL;
+    if(aId.Length()>0)
+        pNew = aId.AllocL();
+    delete ipResourceId;
+    ipResourceId = pNew;
+    }
+
+CIdWsfServiceInstance& CIdWsfResourceOffering::LastServiceL()
+    {
+    __ASSERT_ALWAYS(iServices.Count() > 0, User::Leave(KErrNotFound));
+    return *(iServices[iServices.Count() - 1]);
+    }
+
+void CIdWsfResourceOffering::AddServiceInstanceL(
+                                            CIdWsfServiceInstance* aInstance)
+    {
+    if(ipResourceId)
+        {
+        aInstance->SetResourceIdL(*ipResourceId);
+        }
+    User::LeaveIfError(iServices.Append(aInstance));
+    }
+
+void CIdWsfResourceOffering::AddCredentialL(const CSenCredential& aCredential)
+    {
+    // Replace all credentials with the given id, with the credential
+    for (TInt i = 0; i < iServices.Count(); i++)
+        {
+        iServices[i]->SetCredentialL(aCredential);
+        }
+    }
+
+RPointerArray<CIdWsfServiceInstance>& CIdWsfResourceOffering::ServicesL()
+    {
+    return iServices;
+    }
+
+TInt CIdWsfResourceOffering::SetFacetL(CSenFacet& aFacet)
+    {
+    TInt retVal = KErrNone;
+
+    TInt count(iServices.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        retVal = iServices[i]->SetFacetL(aFacet);
+        if (retVal != KErrNone) return retVal;
+        }
+
+    return retVal;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfsaslmessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include <SenXmlUtils.h>
+
+#include "idwsfsaslmessage.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+#include "senpasswordtransform.h"
+
+namespace
+    {
+    _LIT8(KContinue, "continue");
+    _LIT8(KAbort, "abort");
+
+    _LIT8(KPasswordTransformsName, "PasswordTransforms");
+    _LIT8(KTransformName, "Transform");
+    _LIT8(KParameterName, "Parameter");
+
+    _LIT8(KDataName, "Data");
+    _LIT8(KNameAttr, "name");
+    _LIT8(KAuthzIdName, "authzID");
+    _LIT8(KAdvisoryAuthnIdName, "advisoryAuthnID");
+    _LIT8(KServerMechanismName, "serverMechanism");
+    _LIT8(KMechanismName, "mechanism");
+    }
+
+CIdWsfSaslMessage* CIdWsfSaslMessage::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CIdWsfSaslMessage* pNew = new (ELeave) CIdWsfSaslMessage(aServiceManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CIdWsfSaslMessage* CIdWsfSaslMessage::NewL(
+    MSenCoreServiceManager& aServiceManager,
+    const TDesC8& aXmlns,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CIdWsfSaslMessage* pNew = new (ELeave) CIdWsfSaslMessage(aServiceManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aXmlns, aLocalName, aQName);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CIdWsfSaslMessage::CIdWsfSaslMessage(MSenCoreServiceManager& aServiceManager)
+:   iServiceManager(aServiceManager),
+    ipMechanism(NULL),
+    ipParameterName(NULL)
+    {
+    }
+
+void CIdWsfSaslMessage::ConstructL()
+    {
+    BaseConstructL(KSaslXmlns, KSaslResponseName, KSaslResponseQName);
+    }
+
+void CIdWsfSaslMessage::ConstructL(
+    const TDesC8& aXmlns,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    BaseConstructL(aXmlns, aLocalName, aQName);
+    }
+
+CIdWsfSaslMessage::~CIdWsfSaslMessage()
+    {
+    delete ipMechanism;
+    delete ipParameterName;
+    }
+
+TInt CIdWsfSaslMessage::ConstructInitRequestFromL(
+                                              const TDesC8& aAllMechanismNames,
+                                              CSenIdentityProvider& aAccount)
+    {
+    // fresh start
+    delete ipMechanism;
+    ipMechanism=NULL;
+    delete ipParameterName;
+    ipParameterName=NULL;
+
+    MSenElement& element = AsElement();
+    element.AddAttrL(KMechanismName, aAllMechanismNames);
+
+    TPtrC8 authzId = aAccount.AuthzID();
+    if (authzId.Length() > 0)
+        {
+        element.AddAttrL(KAuthzIdName, authzId);
+        }
+
+    TPtrC8 advisoryAuthnId = aAccount.AdvisoryAuthnID();
+    if (advisoryAuthnId.Length() > 0)
+        {
+        element.AddAttrL(KAdvisoryAuthnIdName, advisoryAuthnId);
+        }
+    return KErrNone;
+    }
+
+TInt CIdWsfSaslMessage::ConstructRequestFromL(
+    const TDesC8& aMech)
+    {
+    // fresh start
+    delete ipMechanism;
+    ipMechanism=NULL;
+    delete ipParameterName;
+    ipParameterName=NULL;
+
+    AsElement().AddAttrL(KMechanismName, aMech);
+    return KErrNone;
+    }
+
+TInt CIdWsfSaslMessage::ConstructRequestFromL(
+    const TDesC8& aMech,
+    const TDesC8& aData
+    )
+    {
+    // fresh start
+    delete ipMechanism;
+    ipMechanism=NULL;
+    delete ipParameterName;
+    ipParameterName=NULL;
+
+    TInt retVal = ConstructRequestFromL(aMech);
+    HBufC8* pDataBase64 = iServiceManager.EncodeToBase64LC(aData);
+
+    AsElement().AddElementL(
+        AsElement().NamespaceURI(), KDataName).SetContentL(*pDataBase64);
+
+    CleanupStack::PopAndDestroy(); // delete pDataBase64;
+    return retVal;
+    }
+
+TBool CIdWsfSaslMessage::IsContinue()
+    {
+    if(!ipStatus)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return SenXmlUtils::EndsWith(*ipStatus, KContinue);
+        }
+    }
+
+TBool CIdWsfSaslMessage::IsAbort()
+    {
+    if (ipStatus == NULL)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return SenXmlUtils::EndsWith(*ipStatus, KAbort);
+        }
+    }
+
+TPtrC8 CIdWsfSaslMessage::Mechanism()
+    {
+    if (!ipMechanism)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return *ipMechanism;
+        }
+    }
+
+TPtrC8 CIdWsfSaslMessage::ParameterName()
+    {
+    if (!ipParameterName)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return *ipParameterName;
+        }
+    }
+
+TPtrC8 CIdWsfSaslMessage::Data()
+    {
+    MSenElement* pDataElement = AsElement().Element(KDataName);
+    if(pDataElement)
+        {
+        return pDataElement->Content();
+        }
+    return KNullDesC8();
+    }
+
+// @return NULL if list is empty
+CSenPasswordTransform* CIdWsfSaslMessage::LastParsedPasswordTransform()
+    {
+    TInt count(iTransforms.Count());
+    if(count>0)
+        {
+        return iTransforms[count-1];
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+
+
+void CIdWsfSaslMessage::StartElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes )
+    {
+    if (IsOk())
+        {
+        CIdWsfDsQueryResponse::StartElementL(aNsUri, aLocalName, aQName,
+                                                aAttributes);
+        }
+    else
+        {
+        switch (iState)
+            {
+            case KStateIgnore:
+                {
+                if (aLocalName == KSaslResponseName)
+                    {
+                    HBufC8* pNew = SenXmlUtils::AllocAttrValueL(
+                        aAttributes,
+                        KServerMechanismName
+                        );
+                    delete ipMechanism;
+                    ipMechanism = pNew;
+                    }
+                else if (aLocalName == KStatusName)
+                    {
+                    HBufC8* pNew = SenXmlUtils::AllocAttrValueL(
+                        aAttributes,
+                        KStatusCodeName
+                        );
+                    delete ipStatus;
+                    ipStatus = pNew;
+                    }
+                else if (aLocalName == KDataName)
+                    {
+                    DelegateParsingL(aNsUri, aLocalName, aQName, aAttributes);
+                    }
+                else if (aLocalName == KPasswordTransformsName)
+                    {
+                    iTransforms.Reset(); // NOT owned..
+                    iState = KStateParsingPwTransforms;
+                    }
+                break;
+                }
+            case KStateParsingPwTransforms:
+                {
+                if (aLocalName == KTransformName)
+                    {
+
+                    TPtrC8 name = SenXmlUtils::AttrValue(aAttributes, 
+                                                            KNameAttr);
+                    CSenPasswordTransform* pTransform =
+                        CSenPasswordTransform::NewL(name, iServiceManager);
+
+                    if(pTransform)
+                        {
+                        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+                            _L8("CIdWsfSaslMessage::StartElementL - \
+                            appending password transform: '%S'"), &name));
+                        iTransforms.Append(pTransform);
+                        }
+                    }
+                else if (aLocalName == KParameterName)
+                    {
+                    HBufC8* pNew = SenXmlUtils::AllocAttrValueL(
+                        aAttributes,
+                        KNameAttr
+                        );
+                    delete ipParameterName; // free memory
+                    ipParameterName = pNew;
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+                        _L("CIdWsfSaslMessage::StartElementL - \
+                        parsing PasswordTransform parameter: '%S'"),
+                            ipParameterName));
+                    ResetContentL();
+                    }
+                break;
+                }
+            }
+        }
+    }
+
+void CIdWsfSaslMessage::EndElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    if (IsOk())
+        {
+        CIdWsfDsQueryResponse::EndElementL(aNsUri, aLocalName, aQName);
+        }
+    else
+        {
+        switch (iState)
+            {
+            case KStateParsingPwTransforms:
+                {
+                if (aLocalName == KParameterName)
+                    {
+                    CSenPasswordTransform* pLast =
+                            LastParsedPasswordTransform();
+                    if(pLast)
+                        {
+                        pLast->SetParameterL(*ipParameterName, Content());
+                        }
+                    }
+                else if (aLocalName == KPasswordTransformsName)
+                    {
+                    ResetContentL();
+                    iState = KStateIgnore;
+                    }
+                break;
+                }
+            default:
+                break;
+            }
+        }
+    }
+
+RPointerArray<CSenPasswordTransform> CIdWsfSaslMessage::Transforms()
+    {
+    return iTransforms;
+    }
+
+
+RFileLogger* CIdWsfSaslMessage::Log() const
+    {
+    return iServiceManager.Log();
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfsecurityheader.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenIdentityProvider.h>
+
+#include "idwsfsecurityheader.h"
+
+namespace
+    {
+    _LIT8(KNameTokenFormatString8,
+        "<%S:UsernameToken><%S:Username>%S</%S:Username></%S:UsernameToken>");
+    // NEW 1.0:
+    //_LIT8(KSecurityXmlns8,
+    //  "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd");
+    //_LIT8(KSecurityXmlnsPrefix8, "wsu");
+
+    // DRAFT:
+    //_LIT8(KSecurityXmlns8,
+    //  "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
+    //_LIT8(KSecurityXmlnsPrefix8, "wsse");
+
+    // AOL demo:
+    //_LIT8(KSecurityXmlns8, "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlnsPrefix8, "wsse");
+
+    }
+
+
+CIdWsfSecurityHeader* CIdWsfSecurityHeader::NewL()
+    {
+    CIdWsfSecurityHeader* pNew = new (ELeave) CIdWsfSecurityHeader;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfSecurityHeader* CIdWsfSecurityHeader::NewL(const TDesC8& aData)
+    {
+    CIdWsfSecurityHeader* pNew = new (ELeave) CIdWsfSecurityHeader;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aData);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfSecurityHeader::CIdWsfSecurityHeader()
+    {
+    }
+
+CIdWsfSecurityHeader::~CIdWsfSecurityHeader()
+    {
+    }
+
+HBufC8* CIdWsfSecurityHeader::UsernameToken8L(
+                                CSenIdentityProvider &aIdentityProvider)
+    {
+    TPtrC8 nsPrefix = KSecurityDraftXmlnsPrefix();
+    TPtrC8 username = aIdentityProvider.AuthzID();
+    HBufC8* pToken = HBufC8::NewLC(50+KNameTokenFormatString8().Length()+
+        username.Length() + nsPrefix.Length()*4);	//CodeScannerWarnings
+    TPtr8 ptr = pToken->Des();
+    ptr.Format(KNameTokenFormatString8, &nsPrefix, &nsPrefix, &username,
+        &nsPrefix, &nsPrefix);
+    CleanupStack::Pop(pToken);    // pToken
+    return pToken;
+    }
+
+TPtrC8 CIdWsfSecurityHeader::XmlNs()
+    {
+    return KSecurityDraftXmlns();
+    }
+
+TPtrC8 CIdWsfSecurityHeader::XmlNsPrefix()
+    {
+    return KSecurityDraftXmlnsPrefix();
+    }
+
+
+TInt CIdWsfSecurityHeader::UsernameTokenL(const TDesC8& aUsername,
+                                                   HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlnsPrefix8();
+    aToken = HBufC8::NewLC(KNameTokenFormatString8().Length()
+        + aUsername.Length() + nsPrefix.Length()*4);
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KNameTokenFormatString8, &nsPrefix, &nsPrefix, &aUsername,
+        &nsPrefix, &nsPrefix);
+    CleanupStack::Pop(aToken);    // aToken CodeScannerWarnings
+    return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfserviceinstance.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,521 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <SenXmlUtils.h>
+#include <SenCredential.h>
+#include <SenFacet.h>
+#include <SenServiceConnection.h>
+#include <SenXmlElement.h>
+
+#include "idwsfserviceinstance.h"
+
+namespace
+    {
+    const TInt KFLATBUF_SIZE = 128;
+    }
+
+CIdWsfServiceInstance* CIdWsfServiceInstance::NewL()
+    {
+    CIdWsfServiceInstance* pNew = CIdWsfServiceInstance::NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CIdWsfServiceInstance* CIdWsfServiceInstance::NewLC()
+    {
+    CIdWsfServiceInstance* pNew = new (ELeave) CIdWsfServiceInstance;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(KNullDesC8(), KNullDesC8());
+    return pNew;
+    }
+
+CIdWsfServiceInstance* CIdWsfServiceInstance::NewL(const TDesC8& aUri)
+    {
+    CIdWsfServiceInstance* pNew = CIdWsfServiceInstance::NewLC(aUri);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CIdWsfServiceInstance* CIdWsfServiceInstance::NewLC(const TDesC8& aUri)
+    {
+    CIdWsfServiceInstance* pNew = new (ELeave) CIdWsfServiceInstance;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aUri, KNullDesC8());
+    return pNew;
+    }
+
+CIdWsfServiceInstance* CIdWsfServiceInstance::NewL(
+                                            CIdWsfServiceInstance& aTemplate)
+    {
+    CIdWsfServiceInstance* pNew = CIdWsfServiceInstance::NewLC(aTemplate);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CIdWsfServiceInstance* CIdWsfServiceInstance::NewLC(
+                                            CIdWsfServiceInstance& aTemplate)
+    {
+    CIdWsfServiceInstance* pNew = new (ELeave) CIdWsfServiceInstance;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aTemplate.ServiceType(), aTemplate.ProviderId());
+    return pNew;
+    }
+
+CIdWsfServiceInstance::CIdWsfServiceInstance() :
+    CSenWSDescription( EIdWsfServiceInstance ),
+    ipProviderId( NULL ),
+    ipEndpoint( NULL ),
+    ipServiceType( NULL ),
+    ipResourceId( NULL ),
+    ipMechanisms( NULL ),
+    ipCredentialRefs( NULL )
+    {
+    }
+    
+void CIdWsfServiceInstance::ConstructL(const TDesC8& aUri,
+                                       const TDesC8& aProviderId)
+    {
+    CSenDomFragment::BaseConstructL(NewElementName());
+
+    HBufC8* pNew = NULL;
+    if (aUri != KNullDesC8)
+        {
+        pNew = aUri.AllocL();
+        }
+    ipServiceType = pNew;
+    SetProviderIdL(aProviderId);
+    }
+
+CIdWsfServiceInstance::~CIdWsfServiceInstance()
+    {
+    delete ipProviderId;
+    delete ipResourceId;
+    delete ipEndpoint;
+
+    delete ipServiceType;
+    delete ipMechanisms;
+    delete ipCredentialRefs;
+
+    iCredentialList.ResetAndDestroy();
+    iFacets.ResetAndDestroy();
+    }
+
+TBool CIdWsfServiceInstance::Matches(
+                            MSenServiceDescription& aOtherServiceDescription)
+    {
+    TPtrC8 patternEndpoint = aOtherServiceDescription.Endpoint();
+    TPtrC8 thisEndpoint = Endpoint();
+
+    if(patternEndpoint.Length()>0)
+        {
+        if(!(thisEndpoint.Length()>0 && patternEndpoint == thisEndpoint))
+            {
+            return EFalse;
+            }
+        }
+
+    TPtrC8 patternContract = aOtherServiceDescription.Contract();
+    TPtrC8 thisContract = Contract();
+
+    if(patternContract.Length()>0)
+        {
+        if(!(thisContract.Length()>0 && patternContract == thisContract))
+            {
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+TBool CIdWsfServiceInstance::Matches(
+                                CIdWsfServiceInstance& aOtherServiceInstance)
+    {
+    if (!Matches((MSenServiceDescription&)aOtherServiceInstance)) return EFalse;
+
+    TPtrC8 patternProvider = aOtherServiceInstance.ProviderId();
+    TPtrC8 thisProvider = ProviderId();
+
+    if(patternProvider.Length()>0)
+        {
+        if(!(thisProvider.Length()>0 && patternProvider == thisProvider))
+            return EFalse;
+        }
+    return ETrue;
+    }
+
+
+TPtrC8 CIdWsfServiceInstance::Contract()
+    {
+    if (ipServiceType)
+        return *ipServiceType;
+    else
+        return KNullDesC8();
+    }
+
+TPtrC8 CIdWsfServiceInstance::FrameworkId()
+    {
+    return KDefaultIdWsfFrameworkID();
+    }
+
+TPtrC8 CIdWsfServiceInstance::FrameworkVersion()
+    {
+    return KIdWsfFrameworkVersion();
+    }
+
+void CIdWsfServiceInstance::SetContractL(const TDesC8& aContract)
+    {
+    HBufC8* pNew = NULL;
+    if(aContract.Length()>0)
+        pNew = aContract.AllocL();
+
+    delete ipServiceType;
+    ipServiceType = pNew;
+    }
+
+void  CIdWsfServiceInstance::WriteAsXMLToL(RWriteStream& /* aWriteStream */)
+    {
+    // Nothing to do, because for ID-WSF we never save ServiceInstances,
+    // only sessions.
+    return;
+    }
+
+HBufC* CIdWsfServiceInstance::AsXmlUnicodeL()
+    {
+    // Nothing to do, because for ID-WSF we never save ServiceInstances,
+    // only sessions.
+    // note: could return NULL
+    return KNullDesC().AllocL();
+    }
+
+HBufC8* CIdWsfServiceInstance::AsXmlL()
+    {
+    // Nothing to do, because for ID-WSF we never save ServiceInstances,
+    // only sessions.
+    // note: could return NULL
+    return KNullDesC8().AllocL();
+    }
+
+TPtrC8 CIdWsfServiceInstance::ProviderId()
+    {
+    if(ipProviderId)
+        return *ipProviderId;
+    else
+        return KNullDesC8();
+    }
+
+TPtrC8 CIdWsfServiceInstance::ResourceId()
+    {
+    if (ipResourceId)
+        return *ipResourceId;
+    else
+        return KNullDesC8();
+    }
+
+TPtrC8 CIdWsfServiceInstance::Endpoint()
+    {
+    if (ipEndpoint)
+        return *ipEndpoint;
+    else
+        return KNullDesC8();
+    }
+
+TPtrC8 CIdWsfServiceInstance::ServiceType()
+    {
+    if (ipServiceType)
+        return *ipServiceType;
+    else
+        return KNullDesC8();
+    }
+
+TInt CIdWsfServiceInstance::SetProviderIdL( const TDesC8& aURI )
+    {
+    TInt retVal( KErrNone );
+    HBufC8* pNew = NULL;
+    if( aURI.Length() > 0 )
+        {
+        pNew = aURI.AllocL();
+        }
+//    else
+//        {
+//        retVal = KErrArgument;
+//        }
+    delete ipProviderId;
+    ipProviderId = pNew;
+    return retVal;
+    }
+
+void CIdWsfServiceInstance::SetResourceIdL( const TDesC8& aURI )
+    {
+    HBufC8* pNew = NULL;
+    if(aURI.Length()>0)
+        pNew = aURI.AllocL();
+    delete ipResourceId;
+    ipResourceId = pNew;
+    }
+
+void CIdWsfServiceInstance::SetEndPointL(const TDesC8& aURI)
+    {
+    HBufC8* pNew = NULL;
+    if(aURI.Length()>0)
+        pNew = aURI.AllocL();
+    delete ipEndpoint;
+    ipEndpoint = pNew;
+    }
+
+void CIdWsfServiceInstance::SetServiceTypeL(const TDesC8& aURI)
+    {
+    HBufC8* pNew = NULL;
+    if(aURI.Length()>0)
+        pNew = aURI.AllocL();
+    delete ipServiceType;
+    ipServiceType = pNew;
+    }
+
+CDesC8Array& CIdWsfServiceInstance::MechanismsL()
+    {
+    if(!ipMechanisms)
+        {
+        ipMechanisms = new (ELeave) CDesC8ArrayFlat(KFLATBUF_SIZE);
+        }
+    return *ipMechanisms;
+    }
+
+CDesC8Array& CIdWsfServiceInstance::CredentialRefsL()
+    {
+    if(!ipCredentialRefs)
+        {
+        ipCredentialRefs = new (ELeave) CDesC8ArrayFlat(KFLATBUF_SIZE);
+        }
+    return *ipCredentialRefs;
+    }
+
+TBool CIdWsfServiceInstance::SupportsMechanism(const TDesC8& aURI)
+    {
+    if (ipMechanisms)
+        {
+        TInt pos;
+        return (ipMechanisms->Find(aURI, pos, ECmpNormal) == KErrNone);
+        }
+    return EFalse;
+    }
+
+CSenCredential* CIdWsfServiceInstance::Credential()
+    {
+    CSenCredential* pCredential = NULL;
+    TInt count(iCredentialList.Count());
+    for(TInt i=0; i<count && pCredential == NULL; i++)
+        {
+        pCredential = iCredentialList[i];
+        }
+    return pCredential;
+    }
+
+
+void CIdWsfServiceInstance::SetCredentialL(const TDesC8& aIdRef,
+                                           const CSenCredential& aCredential)
+    {
+    TInt refCount(CredentialRefsL().Count());
+    for (TInt i = 0; i < refCount; i++)
+        {
+        // Remove IDREFs and add actual credential
+        if (CredentialRefsL()[i] == aIdRef)
+            {
+            CSenCredential* pCredential = CSenCredential::NewL(aCredential);
+            iCredentialList.Append(pCredential);
+            ipCredentialRefs->Delete(i);
+            break;
+            }
+        }
+    }
+
+void CIdWsfServiceInstance::SetCredentialL(const CSenCredential& aCredential)
+    {
+    const TDesC8& idRef = ((CSenCredential&)aCredential).Id();
+    SetCredentialL(idRef, aCredential);
+    }
+
+void CIdWsfServiceInstance::AddSecurityMechL(const TDesC8& aUri)
+    {
+    MechanismsL().AppendL(aUri);
+    }
+
+void CIdWsfServiceInstance::AddCredentialRefL(const TDesC8& aIdRef)
+    {
+    CredentialRefsL().AppendL(aIdRef);
+    }
+
+TInt CIdWsfServiceInstance::HasFacetL(const TDesC8& aURI, TBool& aHasFacet)
+    {
+    aHasFacet = EFalse;
+    TInt count(iFacets.Count());
+
+    for (TInt i=0;i<count && !aHasFacet;i++)
+        {
+        if (iFacets[i]->Name() == aURI)
+            {
+            aHasFacet = ETrue;
+            }
+        }
+
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceInstance::FacetValue(TDesC8& aURI, HBufC8*& aValueTo)
+    {
+    delete aValueTo;
+    aValueTo = NULL;
+
+    TInt retVal = KErrNotFound;
+    TInt count(iFacets.Count());
+
+    for (TInt i=0;i<count && retVal == KErrNotFound;i++)
+        {
+        if (iFacets[i]->Name() == aURI)
+            {
+            aValueTo = iFacets[i]->Value().Alloc();
+            if (aValueTo == NULL) retVal = KErrNoMemory;
+            else retVal = KErrNone;
+            }
+        }
+    return retVal;
+    }
+
+TInt CIdWsfServiceInstance::AddFacetL(const CSenFacet& aFacet)
+    {
+    return SetFacetL(aFacet);
+    }
+
+TInt CIdWsfServiceInstance::SetFacetL(const CSenFacet& aFacet)
+    {
+    TBool hasFacet;
+    HasFacetL(((CSenFacet&)aFacet).Name(),hasFacet);
+    if (hasFacet)
+        {
+        RemoveFacet(((CSenFacet&)aFacet).Name());
+        }
+    CSenFacet* pNewFacet = CSenFacet::NewL(((CSenFacet&)aFacet));
+    return iFacets.Append(pNewFacet);
+    }
+
+TInt CIdWsfServiceInstance::RemoveFacet(const TDesC8& aURI)
+    {
+    TInt count(iFacets.Count());
+
+    for (TInt i=0;i<count;i++)
+        {
+        if (iFacets[i]->Name() == aURI)
+            {
+            delete iFacets[i];
+            iFacets.Remove(i);
+            return KErrNone;
+            }
+        }
+
+    return KErrNotFound;
+    }
+
+TInt CIdWsfServiceInstance::FacetsL(RFacetArray& aFacetArray)
+    {
+    CSenFacet* pFacet = NULL;
+    TInt count(iFacets.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        pFacet = CSenFacet::NewL(*iFacets[i]);
+        aFacetArray.Append(pFacet);
+        }
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceInstance::ScoreMatchL(MSenServiceDescription& aPattern)
+    {
+    TInt score(0);
+
+    if ((aPattern.Endpoint().Length() > 0) &&
+        (aPattern.Endpoint() == Endpoint()))
+        {
+        score++;
+        }
+    if ((aPattern.Contract().Length() > 0) &&
+        (aPattern.Contract() == Contract()))
+        {
+        score++;
+        }
+
+    RFacetArray otherFacets;
+    CleanupClosePushL(otherFacets);
+    aPattern.FacetsL(otherFacets);
+
+    HBufC8* pFacetValue = NULL;
+    TPtrC8 facetName;
+
+    TInt count(otherFacets.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        facetName.Set(otherFacets[i]->Name());
+        FacetValue(facetName,pFacetValue);
+        if (pFacetValue && *pFacetValue == otherFacets[i]->Value())
+            {
+            score++;
+            }
+        delete pFacetValue;
+        pFacetValue = NULL;
+        }
+
+    otherFacets.ResetAndDestroy();
+    CleanupStack::Pop(); // otherFacets
+
+    return score;
+    }
+
+// equals to CSenWSDescription implementation at the moment
+TBool CIdWsfServiceInstance::HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate)
+    {
+    TBool retVal(EFalse);
+    if(aCandidate.Endpoint()  == Endpoint() &&
+       aCandidate.Contract() == Contract() &&
+       aCandidate.FrameworkId() == FrameworkId())
+        {
+        retVal = ETrue;
+        }
+    return retVal;    
+    }
+
+
+TBool CIdWsfServiceInstance::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWSDescription ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWSDescription::HasSuperClass( aType ); 
+        }
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfserviceprovider.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES 
+#include "idwsfserviceprovider.h"
+
+CIdWsfServiceProvider* CIdWsfServiceProvider::NewL(const TDesC8& aProviderID,
+                                                   const TDesC8& aServiceURL)
+    {
+    CIdWsfServiceProvider* self =
+                    CIdWsfServiceProvider::NewLC(aProviderID,aServiceURL);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CIdWsfServiceProvider* CIdWsfServiceProvider::NewLC(const TDesC8& aProviderID,
+                                                    const TDesC8& aServiceURL)
+    {
+    CIdWsfServiceProvider* self = new (ELeave) CIdWsfServiceProvider();
+    CleanupStack::PushL(self);
+    self->ConstructL(aProviderID,aServiceURL);
+    return self;
+    }
+
+CIdWsfServiceProvider::CIdWsfServiceProvider()
+    {
+    }
+
+void CIdWsfServiceProvider::ConstructL(const TDesC8& aProviderID,
+                                       const TDesC8& aEndpoint)
+    {
+    SetProviderIdL(aProviderID);
+    SetEndPointL(aEndpoint);
+    }
+
+
+CIdWsfServiceProvider::~CIdWsfServiceProvider()
+    {
+    delete ipProviderId;
+    delete ipEndpoint;
+    }
+
+TInt CIdWsfServiceProvider::SetProviderIdL(const TDesC8& aProviderID)
+    {
+    HBufC8* pNew = NULL;
+    if(aProviderID.Length()>0)
+        {
+        pNew = aProviderID.AllocL();
+        }
+    delete ipProviderId;
+    ipProviderId = pNew;
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceProvider::SetEndPointL(const TDesC8& aServiceURL)
+    {
+    HBufC8* pNew = NULL;
+    if(aServiceURL.Length()>0)
+        {
+        pNew = aServiceURL.AllocL();
+        }
+    delete ipEndpoint;
+    ipEndpoint = pNew;
+    return KErrNone;
+    }
+
+TPtrC8 CIdWsfServiceProvider::ProviderId()
+    {
+    if(ipProviderId)
+        return *ipProviderId;
+    else
+        return KNullDesC8();
+    }
+
+TPtrC8 CIdWsfServiceProvider::Endpoint()
+    {
+    if(ipEndpoint)
+        return *ipEndpoint;
+    else
+        return KNullDesC8();
+    }
+
+
+TBool CIdWsfServiceProvider::Equals(const TDesC8& aProviderID)
+    {
+    TPtrC8 provider(KNullDesC8());
+    if(ipProviderId)
+        {
+        provider.Set(*ipProviderId);
+        }
+
+    if(provider == aProviderID)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1488 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE
+#include <SenServiceConnection.h> // error code definitions
+#include <SenDateUtils.h>
+#include <SenSoapFault.h>
+#include <SenWsSecurityHeader.h>
+#include <SenTransportProperties.h>
+#include <SenSoapConstants.h> // SOAPAction constants, like KSenSoapActionHeaderName
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+#include "msencoreservicemanager.h"
+#include "senservicemanagerdefines.h"
+#include "senserviceinvocationframework.h"
+
+#include "midwsfsessionvalidator.h"
+#include "idwsfservicesession.h"
+#include "idwsfsessionconsumer.h"
+#include "idwsfserviceinstance.h"
+#include "seninternalcredential.h"
+#include <SenXmlReader.h>
+
+namespace
+    {
+    _LIT8(KSAML,                        "SAML");
+    _LIT8(KBEARER,                      "Bearer");
+
+    _LIT8(KProviderID,                  "<ProviderID>");
+    _LIT8(KProviderIDEnd,               "</ProviderID>");
+    _LIT8(KResourceID,                  "<ResourceID>");
+    _LIT8(KResourceIDEnd,               "</ResourceID>");
+    _LIT8(KTrustAnchor,                 "<TrustAnchor>");
+    _LIT8(KTrustAnchorEnd,              "</TrustAnchor>");
+    _LIT8(KServiceInterval,             "<ServiceInterval>");
+    _LIT8(KServiceIntervalEnd,          "</ServiceInterval>");
+
+    _LIT8(KProviderIdElementLocalName,  "ProviderID");
+    _LIT8(KResourceIDElementLocalName,  "ResourceID");
+    _LIT8(TrustAnchorElementLocalName,  "TrustAnchor");
+    //_LIT8(KServiceIntervalElementLocalName, "ServiceInterval");
+
+    const TInt KSubmitStateOK                       = 1;
+    const TInt KSubmitStateInvalidCredentials       = 2;
+    const TInt KSubmitStateRevalidationAttempted    = 3;
+    const TInt KSubmitStateRevalidationFailed       = 4;
+    //const TInt KSubmitSateResend					= 5;
+    //const TInt KSubmitSateResendFailed			= 6;
+    }
+
+CIdWsfServiceSession* CIdWsfServiceSession::NewL(MSIF& aFramework)
+    {
+    CIdWsfServiceSession* self = CIdWsfServiceSession::NewLC(aFramework);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CIdWsfServiceSession* CIdWsfServiceSession::NewLC(MSIF& aFramework)
+    {
+    CIdWsfServiceSession* self = new (ELeave) CIdWsfServiceSession(
+        MSenServiceDescription::EIdWSFServiceSession, aFramework);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CIdWsfServiceSession::CIdWsfServiceSession(TDescriptionClassType aType,
+                                           MSIF& aSIF)
+    : CSenWebServiceSession(aType, aSIF),
+        iProvider(NULL),
+        ipResourceId(NULL),
+        ipTrustAnchor(NULL),
+        ipReceivedMessageId(NULL),
+        ipSenSecurityMechanism(NULL),
+        iMessageThread(EFalse),
+        ipValidator(NULL),
+        iSubmitState(KSubmitStateOK)
+    {
+    }
+
+CIdWsfServiceSession::~CIdWsfServiceSession()
+    {
+    delete iProvider;
+    delete ipResourceId;
+    delete ipTrustAnchor;
+    delete ipReceivedMessageId;
+    delete ipSenSecurityMechanism;
+
+    TInt count(iConsumerList.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        // we can assume that every remote consumer
+        // has been wrapped inside IdWsfSessionConsumer
+        // -wrapperclass. Cast and destroy:
+        CIdWsfSessionConsumer* pConsumer
+            = (CIdWsfSessionConsumer*) iConsumerList[i];
+
+        // this destroys the wrapper, but the remote
+        // consumer objects ownership remains in either
+        // XMLDao or ClientSession (etc)
+        delete pConsumer;
+        }
+    }
+
+void CIdWsfServiceSession::ConstructL()
+    {
+    // sets local name to "ServiceDescription" and
+    // initiates the inner ipElement
+    CSenWebServiceSession::ConstructL();
+    }
+
+TInt CIdWsfServiceSession::AddConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    const TInt consumerCount(iConsumerList.Count());
+    for(TInt i=0; i<consumerCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aConsumer.Id())
+            return KErrAlreadyExists; // already added, nothing to do
+        }
+
+    CIdWsfSessionConsumer* pSessionConsumer =
+        CIdWsfSessionConsumer::NewL(aConsumer, *Log());
+
+    iConsumerList.Append(pSessionConsumer);
+
+    // clears the array and inserts item as the only one..
+    // remove next line, when NEW routing is in use:
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    const TInt consumerCount(iConsumerList.Count());
+    for(TInt i=0; i<consumerCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aConsumer.Id())
+            {
+            CIdWsfSessionConsumer* pConsumer
+                            = (CIdWsfSessionConsumer*) iConsumerList[i];
+            delete pConsumer;
+            iConsumerList.Remove(i);
+            break;
+            }
+        }
+    return CSenServiceSession::RemoveConsumerL(aConsumer);
+    }
+
+TPtrC8 CIdWsfServiceSession::FrameworkId()
+    {
+    return iFramework.Id();
+    }
+
+TInt CIdWsfServiceSession::MessageForSendingL(const TDesC8& aBody,
+                                              const TDesC8& aSenderID,
+                                              CSenSoapMessage*& aMessage)
+    {
+    CIdWsfSessionConsumer* pConsumer = NULL;
+    TInt retVal = SessionConsumerL(aSenderID, pConsumer);
+    if (retVal != KErrNone)
+        {
+        return retVal; 
+        }
+    if(ipReceivedMessageId)
+        {
+        retVal = pConsumer->MessageForSendingL(aBody,
+                                                *ipReceivedMessageId,
+                                                (CIdWsfMessage*&)aMessage);
+        }
+    else
+        {
+        retVal = pConsumer->MessageForSendingL( aBody,
+                                                KNullDesC8(),
+                                                (CIdWsfMessage*&)aMessage);
+        }
+    if (retVal != KErrNone)
+        {
+        return retVal; 
+        }
+
+    SetFrameworkHeadersL(*aMessage);
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceSession::NewMessageL(CSenSoapMessage*& aMessage)
+    {
+    aMessage = CIdWsfMessage::NewL();
+    return KErrNone;
+    }
+
+// from XML service description
+TInt CIdWsfServiceSession::InitializeFromL(
+                    MSenServiceDescription& aDescription)
+    {
+    CSenWebServiceSession::SetSecurityL(KNullDesC8);
+    CSenWebServiceSession::InitializeFromL(aDescription);
+        
+    if ( StatusL() != KSenConnectionStatusReady )
+        {
+        if ( TryToSearchValidCredentialL() == KErrNone )	//codescannerwarnings
+            {
+            SetStatusL();
+            }
+        }
+
+    aDescription.HasFacetL(KMessageThread,iMessageThread);
+
+    TDescriptionClassType classType = aDescription.DescriptionClassType();
+    if( classType == MSenServiceDescription::EWSDescription
+                                            ||
+        classType == MSenServiceDescription::EWSPattern
+                                            ||
+        classType == MSenServiceDescription::EIdentityProvider
+        )
+        {
+        MSenElement& xmlSdAsElement = (
+            (CSenWSDescription*)&aDescription)->AsElement();
+
+
+        MSenElement* pElement =
+                        xmlSdAsElement.Element(KProviderIdElementLocalName);
+        if(pElement)
+            {
+            TPtrC8 providerId = pElement->Content();
+            TPtrC8 endPoint = aDescription.Endpoint();
+
+            CIdWsfServiceProvider* pNewProvider =
+                CIdWsfServiceProvider::NewL(providerId, endPoint);
+            // now it is safe to free & re-assign
+            delete iProvider;
+            iProvider = pNewProvider;
+            }
+
+        pElement = xmlSdAsElement.Element(KResourceIDElementLocalName);
+        if(pElement)
+            {
+            HBufC8* pNewResourceId = (pElement->Content()).AllocL();
+            // now it is safe to free & re-assign
+            delete ipResourceId;
+            ipResourceId = pNewResourceId;
+            }
+
+        pElement = xmlSdAsElement.Element(TrustAnchorElementLocalName);
+        if(pElement)
+            {
+            HBufC8* pNewTrustAnchor = (pElement->Content()).AllocL();
+            delete ipTrustAnchor;
+            ipTrustAnchor = pNewTrustAnchor;
+            }
+        }
+    TPtrC8  contract = Contract(); 
+    if (contract == KNullDesC8)
+        {
+        return KErrSenNoContract;
+        }
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceSession::ParseMessageL(CSenSoapMessage& aSOAPMessage)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::ParseMessageL");
+
+    if (iMessageThread)
+        {
+        delete ipReceivedMessageId;
+        ipReceivedMessageId =
+                        ((CIdWsfMessage&)aSOAPMessage).MessageId().Alloc();
+        if (!ipReceivedMessageId)
+            return KErrNoMemory;
+        }
+
+    TInt error = CSenWebServiceSession::ParseMessageL(aSOAPMessage);
+    if (error != KErrNone)
+        {
+        return error;
+        }
+
+    CIdWsfMessage& message = (CIdWsfMessage&)aSOAPMessage;
+
+    TTime serverTime;
+    if (message.Timestamp().Length() > 0)
+        {
+        serverTime = SenDateUtils::FromXmlDateTimeL(message.Timestamp());
+        }
+    else serverTime = Time::NullTTime();
+
+    TTime clientTime;
+    clientTime.UniversalTime();
+
+#ifdef _SENDEBUG
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::ParseMessageL:");
+    if (clientTime != Time::NullTTime())
+        {
+        TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+        SenDateUtils::ToXmlDateTimeUtf82L(ts, clientTime);
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("- Client (device) time : %S"), &ts));
+        }
+#endif // _SENDEBUG
+
+    if ( serverTime != Time::NullTTime() )
+        {
+#ifdef _SENDEBUG
+        TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts2;
+        SenDateUtils::ToXmlDateTimeUtf82L(ts2, serverTime);
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("- Server (remote service) time : %S"), &ts2));
+
+#endif // _SENDEBUG
+
+        iClientServerInterval = serverTime.MicroSecondsFrom(clientTime);
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("- Interval in microseconds : %d"),  iClientServerInterval.Int64()));
+        }
+
+    delete ipReceivedMessageId;
+    ipReceivedMessageId = NULL;
+    ipReceivedMessageId = message.MessageId().AllocL();
+
+    CIdWsfSiuHeader* siuheader = message.SiuHeader();
+    if (siuheader)
+        {
+        error = UpdateFromL(*siuheader);
+        if (error != KErrNone) return error;
+        }
+    return KErrNone;
+    }
+
+TInt CIdWsfServiceSession::SendSoapMessageToConsumerL( CSenSoapMessage* apMessage,
+                                                       const TInt aTxnId,
+                                                       MSenRemoteServiceConsumer& aConsumer,
+                                                       MSenProperties* aResponseTransportProperties ) 
+    {
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendSoapMessageToConsumerL");
+    TInt retVal(KErrNone);
+    
+    if( apMessage )
+        {
+        CleanupStack::PushL( apMessage ); // ownership is here
+        
+        CIdWsfMessage* pIdWsfMessage = (CIdWsfMessage*)apMessage;
+    
+        if ( iMessageThread )
+            {
+            // store the Id of the last received message here:
+            delete ipReceivedMessageId;
+            ipReceivedMessageId = pIdWsfMessage->MessageId().Alloc();
+            if ( !ipReceivedMessageId ) 
+                {
+                CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- OOM occured!");
+                CleanupStack::PopAndDestroy( apMessage ); // de-alloc the response immediately
+                retVal = SendErrorToConsumerL( KErrNoMemory, NULL, aTxnId, aConsumer, aResponseTransportProperties );
+                CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- OOM occured. Sent KErrNoMemory to remote consumer. SendErrorToConsumerL returned: %d "), retVal));
+                return KErrNoMemory;
+                }
+            }
+    
+        CIdWsfSessionConsumer* pConsumer = NULL;
+        // This takes care of messageIDs:
+        retVal = SessionConsumerL( *pIdWsfMessage, pConsumer );
+        if (!pConsumer)
+            {
+            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Session consumer not found! Invoking remote consumer via a call to base class functionality.");
+            CleanupStack::Pop( apMessage ); // Next method takes ownership:
+            retVal = CSenWebServiceSession::SendSoapMessageToConsumerL( apMessage, aTxnId, aConsumer, aResponseTransportProperties );
+            CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- SendSoapMessageToConsumerL returned: %d "), retVal));
+            return KErrNotFound;
+            }
+        else
+            {
+            //TSW ID: EMKY-6S4CGS & ID:EMKY-6N3AGA
+            //check for completemessage flag
+            TBool completeServerMessages;
+            HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+            CleanupStack::Pop( apMessage ); // Next method takes ownership:
+            retVal = pConsumer->HandleIdWsfMessageL( pIdWsfMessage, aTxnId, aResponseTransportProperties, completeServerMessages );
+            }
+        }
+    else // apMessage == NULL!
+        {
+        // There is no SOAP to handle
+        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Fatal(!): CIdWsfServiceSession::SendSoapMessageToConsumerL, apMessage == NULL, sending internal error to remote consumer!");
+        retVal = SendErrorToConsumerL( KErrSenInternal, NULL, aTxnId, aConsumer, aResponseTransportProperties );
+        }        
+    return retVal;
+    }
+
+void CIdWsfServiceSession::SetEndPointL(const TDesC8& aURI)
+    {
+    CSenWebServiceSession::SetEndPointL(aURI);
+    if(iProvider)
+        {
+        iProvider->SetEndPointL(aURI);
+        }
+    }
+
+void CIdWsfServiceSession::SetFrameworkHeadersL(CSenSoapMessage& aMsg)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders(CSenSoapMessage& aMsg)");
+
+#ifdef _SENDEBUG
+    if(ipSenSecurityMechanism)
+        {
+        TPtrC8 secMec = ipSenSecurityMechanism->Des();
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,"Security mechanism: \n");
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(secMec));
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,"Note: ipSenSecurityMechanism == NULL!");
+        }
+
+    if (ipSenSecurityMechanism &&
+         (*ipSenSecurityMechanism).Compare(KSecTlsBearer11) != 0 &&
+         (*ipSenSecurityMechanism).Compare(KSecNullBearer11) != 0 )
+        {
+       TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders");
+       TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," - header for ID-WSF 1.0 needs to be used");
+        }
+    else
+        {
+       TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders");
+       TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," - header for ID-WSF 1.1 needs to be used");
+        }
+#endif
+
+    CIdWsfMessage& idWsfMessage = (CIdWsfMessage&)aMsg;
+    idWsfMessage.SetSecurityMechanism(ipSenSecurityMechanism);
+    CSenWebServiceSession::SetFrameworkHeadersL(aMsg);
+    
+
+
+        /*
+
+    //Changes for IDWSF 1.1 support
+    // Added the condition to add the old-style WsSecurity header 
+    // for non-IDWSF11 security mechanisms
+
+    if (ipSenSecurityMechanism &&
+             (*ipSenSecurityMechanism).Compare(KSecTlsBearer11) != 0 &&
+             (*ipSenSecurityMechanism).Compare(KSecNullBearer11) != 0 )
+        {
+           TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders \
+               - Setting header for ID-WSF 1.0");
+          // Add new OLD WsSecurityHeader to msg
+
+          
+          CIdWsfSecurityHeader* pHeader = NULL;
+          if(iSecurity)
+            {
+            pHeader = 
+                CIdWsfSecurityHeader::NewL(*iSecurity); 
+            }
+          else
+            {
+            pHeader = 
+                CIdWsfSecurityHeader::NewL(); 
+            }
+          aMsg.AddHeaderL( pHeader->AsElement() ) ;
+          
+          // Above is equal with next line, if an aMsg argument 
+          // is actually SenIdWsfSoapMessage(!), ID-WSF 1.1, matmatt
+          //CSenWebServiceSession::SetFrameworkHeaders(aMsg);
+        }
+       else // NOTE: now we default to 1.1 if !ipSenSecurityMechanism 
+       {
+           TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders \
+               - Setting header for ID-WSF 1.1");
+            // We need to use (newer) security header for ID-WSF 1.1
+            // this could be done in IdWsfSoapMessage class, if it would
+            // somehow know in NewSecurityHeaderL() method, that it is
+            // actually 1.0 or 1.1. But this current solution is rather
+            // clear also. Each new header type, we need a new 
+            // else-if code segment inside this session class method,
+            // -> in here.
+           CSenWsSecurityHeader* pHeader = NULL;
+
+          if(iSecurity)
+            {
+            // ID-WSF 1.1, matmatt
+            pHeader = 
+                CSenWsSecurityHeader::NewL(*iSecurity); 
+            }
+          else
+            {
+            pHeader = 
+                CSenWsSecurityHeader::NewL(); 
+            }
+           aMsg.AddHeaderL( pHeader->AsElement() ) ;
+        }
+       */
+
+    // CorrelationHeader adjustment is already done in the SessionConsumer
+
+    }
+
+void CIdWsfServiceSession::WriteExtensionsAsXMLToL(RWriteStream& aWriteStream)
+    {
+    CSenWebServiceSession::WriteExtensionsAsXMLToL(aWriteStream);
+
+    if(iProvider)
+        {
+        aWriteStream.WriteL(KProviderID);
+        aWriteStream.WriteL(ProviderId());
+        aWriteStream.WriteL(KProviderIDEnd);
+        }
+
+    if(ipResourceId)
+        {
+        aWriteStream.WriteL(KResourceID);
+        aWriteStream.WriteL(*ipResourceId);
+        aWriteStream.WriteL(KResourceIDEnd);
+        }
+
+    if(ipTrustAnchor)
+        {
+        aWriteStream.WriteL(KTrustAnchor);
+        aWriteStream.WriteL(*ipTrustAnchor);
+        aWriteStream.WriteL(KTrustAnchorEnd);
+        }
+
+    if(iClientServerInterval.Int64() != 0)
+        {
+        aWriteStream.WriteL(KServiceInterval);
+        TBuf8<64> buf;
+        buf.AppendNum(iClientServerInterval.Int64());
+        aWriteStream.WriteL(buf);
+        aWriteStream.WriteL(KServiceIntervalEnd);
+        }
+    }
+
+// Note: no ref-impl for this method in Java either yet
+TInt CIdWsfServiceSession::ConstructSecurityTokenL(
+                                               const TDesC& /* aToken */,
+                                               HBufC8*& /* aSecurityToken */)
+    {
+    return KErrNotSupported;
+    }
+
+// from service instance
+// NOTE(!): returns KErrNotFound if no known security mechanism was found.
+TInt CIdWsfServiceSession::InitializeFromL(
+                                CIdWsfServiceInstance& aServiceInstance)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("CIdWsfServiceSession::InitializeFromL")));
+    CSenWebServiceSession::SetSecurityL(KNullDesC8);
+    CSenWebServiceSession::InitializeFromL(
+        (MSenServiceDescription&)aServiceInstance);
+
+    TPtrC8 providerid = aServiceInstance.ProviderId();
+    if (providerid.Length()>0)
+        {
+        TPtrC8 endPoint = aServiceInstance.Endpoint();
+        CIdWsfServiceProvider* pProvider = CIdWsfServiceProvider::NewL(providerid,
+                                                endPoint);
+        delete iProvider;
+        iProvider = pProvider;
+        }
+
+    // the description should support one, and only one(!) of mechanisms:
+
+    if(aServiceInstance.SupportsMechanism(KSecNullBearer))
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(KSecNullBearer()));
+        delete ipSenSecurityMechanism;
+        ipSenSecurityMechanism = KSecNullBearer().AllocL();
+        }
+    else if(aServiceInstance.SupportsMechanism(KSecTlsBearer))
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(KSecTlsBearer()));
+        delete ipSenSecurityMechanism;
+        ipSenSecurityMechanism = KSecTlsBearer().AllocL();
+        }
+    else if(aServiceInstance.SupportsMechanism(KSecTlsNull))
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(KSecTlsNull()));
+        delete ipSenSecurityMechanism;
+        ipSenSecurityMechanism = KSecTlsNull().AllocL();
+        }
+    else if(aServiceInstance.SupportsMechanism(KSecNullNull))
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(KSecNullNull()));
+        delete ipSenSecurityMechanism;
+        ipSenSecurityMechanism = KSecNullNull().AllocL();
+        }
+
+        //Added following two conditions for ID-WSF 1.1 support
+    else if(aServiceInstance.SupportsMechanism(KSecNullBearer11)) 
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(KSecNullBearer11()));
+        delete ipSenSecurityMechanism;
+        ipSenSecurityMechanism = KSecNullBearer11().AllocL();
+        }
+    else if(aServiceInstance.SupportsMechanism(KSecTlsBearer11)) 
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(KSecTlsBearer11()));
+        delete ipSenSecurityMechanism;
+        ipSenSecurityMechanism = KSecTlsBearer11().AllocL();
+        }
+        
+    if(!ipSenSecurityMechanism)
+        {
+        _LIT(KInvalidDate,"19000101:");	//CodeScannerWarnigs
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("FATAL ERROR in CIdWsfServiceSession::InitializeFromL: \
+            ipSenSecurityMechanism == NULL!")));
+
+        // invalidate the session, because we don't know any mechanism
+        // and we have no credential 
+        iValidUntil.Set(KInvalidDate); // way back in history: January 1st 1900 // CodeScannerWarnig
+        SetStatusL();
+        return KErrNotFound;
+        }
+
+    if(IsBearerL(*ipSenSecurityMechanism) || IsSAMLL(*ipSenSecurityMechanism))
+        {
+        TPtrC8 endpoint = Endpoint();
+        if(endpoint.Length() > 0)
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," Adding credential, endpoint is:");
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(endpoint));
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," Endpoint <not set>, adding credential.");
+            }
+
+        CSenCredential* pCredential = (CSenCredential *) aServiceInstance.Credential();
+                                    
+        if(pCredential)
+            {
+            /*
+            if(IsBearerL(*ipSenSecurityMechanism))
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"Sun does not send validUntil, so let's trust Bearer mech creds valid. Service will tell when they do expire");
+                iValidUntil.Set(_L("22000101:"));
+                pCredential->SetValidUntil(iValidUntil);
+                }
+            */
+            AddCredentialL(*pCredential);
+            }
+        }
+
+    TPtrC8 resourceId = aServiceInstance.ResourceId();
+    HBufC8* pResourceId = resourceId.AllocL();
+    delete ipResourceId;
+    ipResourceId = pResourceId;
+    SetOptionsFromL(aServiceInstance);
+
+    /*
+    if(IsBearerL(*ipSenSecurityMechanism))
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"Sun does not send validUntil, so let's trus Bearer mech creds valid. Service will tell when they do expire");
+        iValidUntil.Set(_L("22000101:")); // way back in history: January 1st 1900
+        }
+    */
+    SetStatusL();
+
+    return KErrNone;
+    }
+
+TBool CIdWsfServiceSession::IsSAMLL(const TDesC8& aSecMechURI)
+    {
+    TInt index(KErrNotFound);
+
+    index = aSecMechURI.Find(KSAML);
+
+    TInt rightPosition = aSecMechURI.Length()-KSAML().Length();
+
+    if(rightPosition > 0 && index == rightPosition)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+TBool CIdWsfServiceSession::IsBearerL(const TDesC8& aSecMechURI)
+    {
+    TInt index(KErrNotFound);
+
+    index = aSecMechURI.Find(KBEARER);
+
+    TInt rightPosition = aSecMechURI.Length()-KBEARER().Length();
+
+    if(rightPosition > 0 && index == rightPosition)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+TPtrC8 CIdWsfServiceSession::ProviderId()
+    {
+    if(iProvider) 
+        {
+        return iProvider->ProviderId();
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+TPtrC8 CIdWsfServiceSession::ServiceType()
+    {
+    return CSenWebServiceSession::Contract();
+    }
+
+TInt CIdWsfServiceSession::UpdateFromL(CIdWsfSiuHeader& aHeader)
+    {
+    TInt retVal = KErrNone;
+
+    if (aHeader.Endpoint().Length()>0)
+        {
+        TPtrC8 endpoint = aHeader.Endpoint();
+        SetEndPointL(endpoint);
+        }
+
+    if (aHeader.SecurityMechId().Length()>0)
+        {
+        TPtrC8 securityMechId = aHeader.SecurityMechId();
+        SetSenSecurityMechanismL(securityMechId);
+        }
+
+    if (aHeader.Credential())
+        {
+        CSenWebServiceSession::SetSecurityL(KNullDesC8());
+        retVal = AddCredentialL(*aHeader.Credential());
+        }
+
+    SaveL();
+
+    return retVal;
+    }
+
+void CIdWsfServiceSession::SetProviderL(CIdWsfServiceProvider *aProvider)
+    {
+    delete iProvider;
+    iProvider = aProvider;
+    CSenWebServiceSession::SetEndPointL(aProvider->Endpoint());
+    }
+
+CIdWsfServiceProvider* CIdWsfServiceSession::Provider()
+    {
+    return iProvider;
+    }
+
+void CIdWsfServiceSession::SetResourceIdL(const TDesC8& aURI)
+    {
+    HBufC8* pNew = NULL;
+    if(aURI.Length()>0)
+        pNew = aURI.AllocL();
+    delete ipResourceId;
+    ipResourceId = pNew;
+    }
+
+TPtrC8 CIdWsfServiceSession::ResourceId()
+    {
+    if(ipResourceId)
+        return *ipResourceId;
+    else
+        return KNullDesC8();
+    }
+
+void CIdWsfServiceSession::SetServiceTypeL(const TDesC8& aURI)
+    {
+    if(aURI.Length()>0)
+        {
+        CSenWebServiceSession::SetContractL(aURI);
+        }
+    else
+        {
+        CSenWebServiceSession::SetContractL(KNullDesC8());
+        }
+    }
+
+void CIdWsfServiceSession::SetTrustAnchorL(const TDesC8& aURI)
+    {
+
+    HBufC8* pNew = NULL;
+    if(aURI.Length()>0)
+        {
+        pNew = aURI.AllocL();
+        }
+    delete ipTrustAnchor;
+    ipTrustAnchor = pNew;
+    }
+TPtrC8 CIdWsfServiceSession::TrustAnchor()
+    {
+    if(ipTrustAnchor)
+        return *ipTrustAnchor;
+    else
+        return KNullDesC8();
+    }
+
+void CIdWsfServiceSession::SetSenSecurityMechanismL(
+                                        const TDesC8& aSenSecurityMechanism)
+    {
+
+    HBufC8* pNew = NULL;
+    if(aSenSecurityMechanism.Length()>0)
+        pNew = aSenSecurityMechanism.AllocL();
+
+    delete ipSenSecurityMechanism;
+    ipSenSecurityMechanism = pNew;
+    }
+
+TPtrC8 CIdWsfServiceSession::SenSecurityMechanism()
+    {
+    if(ipSenSecurityMechanism)
+        {
+        return *ipSenSecurityMechanism;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+// Override the method from SenServiceSession to provide simple search from
+// list, because ID-WSF service sessions may have several consumers.
+MSenRemoteServiceConsumer* CIdWsfServiceSession::RemoteConsumerL(
+        const TDesC8& aSenderID)
+    {
+    TInt consumersCount(iConsumerList.Count());
+
+    for(TInt i=0; i<consumersCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aSenderID)
+            {
+            return iConsumerList[i];
+            }
+        }
+    return NULL; // not found
+    }
+
+
+TInt CIdWsfServiceSession::SessionConsumerL(
+                            CIdWsfMessage& aMessage,
+                            CIdWsfSessionConsumer*& aSessionConsumer)
+    {
+    TInt consumersCount(iConsumerList.Count());
+
+    for(TInt i=0; i<consumersCount; i++)
+        {
+        CIdWsfSessionConsumer* pConsumer =
+                            (CIdWsfSessionConsumer*) iConsumerList[i];
+        if (pConsumer->Expects(aMessage.RefToMessageId()))
+            {
+            aSessionConsumer = pConsumer;
+            return KErrNone;
+            }
+        }
+
+    aSessionConsumer = NULL; // not found
+    return KErrNotFound;
+    }
+
+TInt CIdWsfServiceSession::SessionConsumerL(const TDesC8& aSenderID,
+                                    CIdWsfSessionConsumer*& aSessionConsumer)
+    {
+    aSessionConsumer = (CIdWsfSessionConsumer*) RemoteConsumerL(aSenderID);
+    if(aSessionConsumer)
+        {
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+// SYNC IMPLEMENTATION(!)
+// aSOAPMessage.IsFault() should always be TRUE.
+
+/**
+* Method checks if ID-WSF framework can handle this fault, if not, then
+* error is delivered to session consumer
+*/
+TInt CIdWsfServiceSession::HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                            HBufC8*& aResponse)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::HandleSoapFaultL [sync]");
+    
+    TInt retVal(KErrNone);
+    
+    if ( apSOAPMessage )
+    	{
+    	 
+	    CIdWsfMessage& idWsfMessage = (CIdWsfMessage&)*apSOAPMessage;
+		CleanupStack::PushL( apSOAPMessage ); // ownerhip is here 
+		
+	    TInt answer = CanHandleErrorL(idWsfMessage);
+	    
+	    if(answer == KErrSenReinitRequired) // ESenReAuthAndResendNeeded
+	        {
+	        TBool status(EFalse);
+	        SetValidator(NULL);
+	        iFramework.Manager().NotifyFrameworksL(
+	            KDefaultIdWsfFrameworkID,
+	            KSenEventIdWsfSessionValidatorRequested);
+
+	        MIdWsfSessionValidator* pValidator = Validator();
+	        if (pValidator)
+	            {
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,"* validator is available *");
+	            TInt retVal(KErrNone);
+	            iSubmitState = KSubmitStateInvalidCredentials;
+	            // invalidate the current session
+	            SetStatusL();
+	            iSubmitState = KSubmitStateRevalidationAttempted;
+	            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("Validator ptr: 0x%x"), pValidator));
+	            
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Looking for session consumer.");
+	            CIdWsfSessionConsumer* pConsumer = NULL;
+	    
+	            // this takes care of messageIDs
+	            TInt getConsumerRetVal = SessionConsumerL(idWsfMessage, pConsumer);
+	            if(getConsumerRetVal != KErrNone) 
+	                {
+	                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+	                    _L8(" - SessionConsumerL returned an error: %d"), 
+	                    getConsumerRetVal));
+	                status = EFalse;
+	                }
+	            else if(!pConsumer)
+	                {
+	                // consumer not found
+	                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," - Consumer not found!");
+	                status = EFalse;
+	                }                   
+	            else
+	                {
+	                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("Revalidating needed")));
+	                retVal = pValidator->ValidateL(*this, *pConsumer); // this actually can call either ASC or DSC
+	                status = (retVal == KErrNone) && IsReadyL();
+	                }
+	            }
+	        
+	#ifdef _SENDEBUG
+	        if(status)
+	            {
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"HandleErrorL: InappropriateCredentials -> TRUE");
+	            }
+	        else
+	            {
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"HandleErrorL: InappropriateCredentials -> FALSE");
+	            }
+	#endif
+	        if( !status ) 
+	            {
+	            // notify consumers (applications) about expired connection
+	            SetStatusL();
+	            answer = KErrNone;
+	            // Change state to "re-validation failed" in order to indicate other, 
+	            // pending async messages  that there is no use re-sending as one lacks 
+	            // valid credential(s)
+	            iSubmitState = KSubmitStateRevalidationFailed;
+	            }
+	        }
+
+	    if (iSubmitState != KSubmitStateRevalidationFailed && ( answer > KErrNone || answer == KErrSenReinitRequired || answer == KErrSenResendRequired ))
+	        {
+	        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CanHandleErrorL == TRUE");
+
+	        CIdWsfSessionConsumer* pConsumer = NULL;
+
+	        // this takes care of messageIDs
+	        retVal = SessionConsumerL(idWsfMessage, pConsumer);
+	        if(retVal != KErrNone) 
+	            {
+	            CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed 
+	            return retVal;
+	            }
+	        else if(!pConsumer)
+	            {
+	            CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed 
+	            // consumer not found
+	            return KErrNotFound;
+	            }
+	        
+	        TDesC8* pBody = pConsumer->BodyL(idWsfMessage.RefToMessageId());
+	        if (pBody)
+	            {
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Re-submitting the request");
+	            retVal = SubmitL(*pBody, KNullDesC8, *pConsumer, aResponse);
+	            }
+	        }
+	    else 
+	        {
+	        CSenSoapFault* pDetached = idWsfMessage.DetachFaultL();
+	        if(pDetached)
+	            {
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Detached a SOAP fault");
+	            CleanupStack::PushL(pDetached);
+	            aResponse = pDetached->AsXmlL();
+	            CleanupStack::PopAndDestroy(); // pDetached
+	            CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed 
+	            return KErrSenSoapFault; // this is 2nd OK return code!
+	            }
+	        else
+	            {
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"No SOAP fault was received.");
+	            retVal = KErrSenInternal;
+	            }
+	        }
+	    CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed 
+	    }
+	    
+	return retVal;
+    }
+
+/**
+* Method checks if ID-WSF framework can handle this fault, if not, then
+* error is delivered to session consumer
+*/
+TInt CIdWsfServiceSession::HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                            const TInt aErrorCode,
+                                            const TInt aTxnId,
+                                            MSenRemoteServiceConsumer& aConsumer,
+                                            MSenProperties* aResponseTransportProperties) 
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CIdWsfServiceSession::HandleSoapFaultL [async]");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::HandleSoapFaultL [async]");
+
+    TInt retVal(KErrNone);
+    
+    if ( apSOAPMessage )
+        {
+	    CIdWsfMessage& idWsfMessage = (CIdWsfMessage&)*apSOAPMessage;
+		CleanupStack::PushL( apSOAPMessage ); // ownerhip is here 
+
+	    TInt answer = CanHandleErrorL(idWsfMessage);
+	    if ( answer > KErrNone || answer == KErrSenReinitRequired || answer == KErrSenResendRequired )
+	        {
+	        CSLOG_L(aConsumer.ConnectionId(), KNormalLogLevel ,"CanHandleErrorL == TRUE");
+	        //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CanHandleErrorL == TRUE");
+	        
+	        aConsumer.HandleErrorL(NULL, answer, aTxnId, aResponseTransportProperties);
+	        }
+	    else
+	        {
+	        CSenSoapFault* pDetached = idWsfMessage.DetachFaultL();
+	        if(pDetached)
+	            {
+	            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"Detached a SOAP fault");
+	            //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"Detached a SOAP fault");
+	            CleanupStack::PushL(pDetached);
+	            // pass KErrSenSoapFault // which is 2nd "OK" return code!
+	            HBufC8* pAsXml = pDetached->AsXmlL();
+	            if(pAsXml)
+	                {
+	                aConsumer.HandleErrorL(pAsXml, KErrSenSoapFault, aTxnId, aResponseTransportProperties);
+	                }
+	            CleanupStack::PopAndDestroy(); // pDetached
+	            retVal = KErrNone; // OK
+	            }
+	        else
+	            {
+	            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"No SOAP fault was received.");
+	            //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"No SOAP fault was received.");
+	            aConsumer.HandleErrorL(NULL, aErrorCode, aTxnId, aResponseTransportProperties);
+	            retVal = KErrSenInternal; // one *could* pass on the orig error code
+	            }
+        	}
+		CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed 
+        }
+        
+    return retVal;
+    }
+    
+TInt CIdWsfServiceSession::CanHandleErrorL(CIdWsfMessage& aMessage)
+    {
+    TInt answer(KErrNone);
+
+    const TDesC8* pCode = aMessage.StatusCodeL();
+
+    if(pCode)
+        {
+        if(SenXmlUtils::EndsWith(*pCode, KStatusEndpointMoved))
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CanHandleErrorL: Endpoint moved -> TRUE");
+            // We could probably re-submit the body of our outgoing message
+            // check if we received a SIU header with an endpoint
+            CIdWsfSiuHeader* pSIUHeader = aMessage.SiuHeader();
+            if(pSIUHeader && pSIUHeader->Endpoint().Length() > 0)
+                {
+                answer = KErrSenResendRequired; // ESenResendNeeded;
+                }
+            }
+        else if(SenXmlUtils::EndsWith(*pCode, KStatusInappropriateCredentials))
+            {
+            _LIT(KInvalidDate,"18000101:");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CanHandleErrorL: InappropriateCredentials -> invalidating this session");
+            // ensure that session is CERTAINLY INVALID!
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+                _L8("Credentials expired. Handling SOAP fault %S"),
+                &KStatusInappropriateCredentials() ));
+
+            iValidUntil.Set(KInvalidDate); // way way back in history: January 1st 1800 //CodescannerWarnings
+
+
+            if (iSubmitState == KSubmitStateOK)
+                {
+                // Clear the current validator
+                SetValidator(NULL);
+                iFramework.Manager().NotifyFrameworksL(
+                    KDefaultIdWsfFrameworkID,
+                    KSenEventIdWsfSessionValidatorRequested);
+
+                MIdWsfSessionValidator* pValidator = Validator();
+                if (pValidator)
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,"* validator is available *");
+                    iSubmitState = KSubmitStateInvalidCredentials;
+                    // Invalidate the current session
+                    SetStatusL();
+                    iSubmitState = KSubmitStateRevalidationAttempted;
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("Validator ptr: 0x%x"), pValidator));
+                    
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Looking for session consumer.");
+                    CIdWsfSessionConsumer* pConsumer = NULL;
+            
+                    // This takes care of messageIDs
+                    TInt getConsumerRetVal = SessionConsumerL(aMessage, pConsumer);
+                    if(getConsumerRetVal != KErrNone) 
+                        {
+                        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+                            _L8(" - SessionConsumerL returned an error: %d"), 
+                            getConsumerRetVal));
+                        answer = KErrNone;
+                        }
+                    else if(!pConsumer)
+                        {
+                        // Consumer not found
+                        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ," - Consumer not found!");
+                        answer = KErrNone;
+                        }                   
+                    else
+                        {
+                        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("- Revalidation needed")));
+                        answer = KErrSenReinitRequired; // ESenReAuthAndResendNeeded;
+                        }
+                    }
+
+                }
+            else if ( iSubmitState == KSubmitStateRevalidationAttempted )
+                {
+                // Another message already triggered the re-validation phase, 
+                // so: this operation requires re-sending only
+                answer = KErrSenResendRequired; // ESenResendNeeded; 
+                iSubmitState = KSubmitStateRevalidationFailed; //ESenResend
+                }
+			//else if ( iSubmitState == KSubmitSateResend )  
+			//	{
+			//	answer = KErrSenResendComplete; //ESenResendFailed
+			//	iSubmitState = KSubmitSateResendFailed; //ESenResendFailed
+            //    }
+            }
+        }
+
+    return answer;
+    }
+
+TBool CIdWsfServiceSession::Matches(MSenServiceDescription& aPattern)
+    {
+    TBool matches = CSenWebServiceSession::Matches(aPattern);
+
+    // for now the only interesting facet is the messageThread facet
+    // if this session uses messageThreads it should not match any
+    // description, as it essentially makes the session unique
+    // (unless nobody is using this session).
+    if (iMessageThread && HasConsumer())
+        {
+        // a new session is needed in any case
+        matches = EFalse;
+        }
+    else
+        {
+        TBool hasFacet(EFalse);
+        TInt leaveCode(KErrNone);
+        TRAP( leaveCode, aPattern.HasFacetL(KMessageThread, hasFacet); )
+        if (leaveCode != KErrNone) 
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfServiceSession::Matches - HasFacetL() leaved!");
+            matches = EFalse;
+            }
+        if (hasFacet)
+            {
+            if (matches && !HasConsumer()) matches = ETrue;
+            else matches = EFalse;
+            }
+        }
+    return matches;
+    }
+
+void CIdWsfServiceSession::CopyFacetsFromL(MSenServiceDescription& aPattern)
+    {
+    aPattern.HasFacetL(KMessageThread,iMessageThread);
+
+    if (iMessageThread)
+        {
+        CSenFacet* pNewFacet = CSenFacet::NewL();
+        CleanupStack::PushL(pNewFacet);
+        pNewFacet->SetValueL(KSenFacetValTrue);
+        SetFacetL(*pNewFacet);
+        CleanupStack::Pop(); // pNewFacet
+        }
+    else
+        {
+        RemoveFacet(KMessageThread);
+        }
+    }
+
+TInt CIdWsfServiceSession::SetOptionsFromL(MSenServiceDescription& aPattern)
+    {
+    RFacetArray options;
+    CleanupClosePushL(options);
+
+    CIdWsfDiscoveryServiceClient::DSOptionsL(options, aPattern);
+    if (options.Count() > 0)
+        {
+        TInt count(options.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            SetFacetL(*options[i]);
+            }
+        }
+    options.ResetAndDestroy();
+    CleanupStack::Pop(); //options
+
+    return KErrNone;
+    }
+
+void CIdWsfServiceSession::StartTransaction()
+    {
+    iMessageThread = ETrue;
+    }
+
+void CIdWsfServiceSession::TransactionCompleted()
+    {
+    delete ipReceivedMessageId;
+    ipReceivedMessageId = NULL;
+    }
+
+void CIdWsfServiceSession::SetValidator(MIdWsfSessionValidator* aValidator)
+    {
+    ipValidator = aValidator;
+    }
+
+MIdWsfSessionValidator* CIdWsfServiceSession::Validator()
+    {
+    return ipValidator;
+    }
+
+TInt CIdWsfServiceSession::SendL( const TDesC8& aMessage, 
+                                  const TDesC8& aTransportProperties,
+                                  MSenRemoteServiceConsumer& aConsumer,
+                                  TInt& aTxnId,
+                                  HBufC8*& aRevalidationError )
+    {
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendL");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SendL");
+    // Temporary START
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL( transport ); // retVal surpressed
+    // Temporary END
+    TInt retVal = CSenWebServiceSession::SendL( aMessage, aTransportProperties, aConsumer, aTxnId, aRevalidationError );
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendL:");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SendL:");
+    CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Return value from CSenWebServiceSession::SendL %d: "), retVal));
+    //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase   , KSenCoreServiceManagerLogLevel  ,(_L8("- Return value from CSenWebServiceSession::SendL %d: "), retVal));
+    CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Transaction ID (from transport): %d"), aTxnId));
+    //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase   , KSenCoreServiceManagerLogLevel  ,(_L8("- Transaction ID (from transport): %d"), aTxnId));
+    return retVal;
+    }
+
+TInt CIdWsfServiceSession::SubmitL( const TDesC8& aMessage, 
+                                    const TDesC8& aTransportProperties,
+                                    MSenRemoteServiceConsumer& aConsumer,
+                                    HBufC8*& aResponse )
+    {
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SubmitL");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SubmitL");
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL(transport); // retVal surpressed
+    TInt retVal = CSenWebServiceSession::SubmitL( aMessage, aTransportProperties, aConsumer, aResponse);
+    if (retVal == KErrNone)
+        {
+        iSubmitState = KSubmitStateOK; 
+        }
+    return retVal;
+    }
+
+TInt CIdWsfServiceSession::SetStatusL()
+    {
+    // check if we are re-submitting
+    if ( iSubmitState == KSubmitStateInvalidCredentials )
+        {
+        TInt count(iConsumerList.Count());
+
+        // Create a local array to hold pointer(s) to consumer(s)
+        RServiceConsumerArray consumerList;
+        CleanupClosePushL(consumerList);
+
+        // Copy the consumers into temporary array
+        for (TInt i=0; i<count; i++)
+            {
+            TInt errorCode = consumerList.Append(iConsumerList[i]);
+            if(errorCode!=KErrNone)
+                {
+                User::Leave(errorCode); // out-of-memory occurred
+                }
+            }
+        // Clear the actual array to prevent false
+        // callbacks to SetStatusL() etc:
+        iConsumerList.Reset();
+
+        // Now it is safe to calculate the status
+        TInt retVal = CSenWebServiceSession::SetStatusL();
+
+        // The iConsumerList may be populated with original 
+        // consumer(s)
+        for ( TInt j = 0; j < count; j++ )
+            {
+            iConsumerList.Append(consumerList[j]);
+            }
+        
+        // Reset the temporary array and let it go out of scope
+        consumerList.Reset();
+        CleanupStack::Pop(); //consumerList
+        return retVal;
+        } 
+
+    // Note: call to SetStatusL() can always result consumers being
+    // notified of their state changed
+    return CSenWebServiceSession::SetStatusL();
+    }
+    
+/*
+* ID-WSF always expect that consumer application  is providing the application body only.
+* So, we are extracting the Soap body from aSoapMessage and SendL of
+* ID-WSF has been called
+*/
+TInt CIdWsfServiceSession::SendSoapL( const TDesC8& aSoapMessage, 
+                                      const TDesC8& aTransportProperties,
+                                      MSenRemoteServiceConsumer& aConsumer,
+                                      TInt& aTxnId,
+                                      HBufC8*& aRevalidationError )
+    {
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendSoapL(TDesC8&, ...)");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SendSoapL(TDesC8&, ...)");
+	
+    TInt retVal(KErrNone);    	
+    CSenXmlReader* pReader = iFramework.Manager().XMLReader(); // re-use the XML reader instance owned by core 
+    CSenSoapMessage* pMsg = CSenSoapMessage::NewL();
+    CleanupStack::PushL( pMsg );
+    pMsg->SetReader( *pReader ); 
+    pReader->SetContentHandler( *pMsg );
+    TInt leaveCode( KErrNone );
+    TRAP( leaveCode,  pMsg->ParseL( aSoapMessage ); )
+    if ( leaveCode )
+        {
+        CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode ));
+        //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase   , KSenCoreServiceManagerLogLevel  ,( _L("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode ));
+        CleanupStack::PopAndDestroy( pMsg ); // de-alloc the SOAP-MSG object immediately
+	  retVal = leaveCode;
+        }
+    else // parsing ok
+        { 
+        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Successfully parsed descriptor into SOAP-MSG.");
+        //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"- Successfully parsed descriptor into SOAP-MSG.");
+        HBufC8* pHttpBody = pMsg->BodyAsStringL(); // extract the SOAP body
+        CleanupStack::PopAndDestroy( pMsg );
+        CleanupStack::PushL( pHttpBody );
+        retVal = SendL( *pHttpBody, aTransportProperties, aConsumer, aTxnId, aRevalidationError );    
+        CleanupStack::PopAndDestroy( pHttpBody ); // assert in proper order
+        }	
+    return retVal;
+    }
+
+/*
+* ID-WSF always expect that consumer application  is providing the application body only.
+* So, we are extracting the Soap body from aSoapMessage and SubmitL of 
+* ID-WSF has been called
+*/
+TInt CIdWsfServiceSession::SubmitSoapL( const TDesC8& aSoapMessage, 
+                                        const TDesC8& aTransportProperties,
+                                        MSenRemoteServiceConsumer& aConsumer,
+                                        HBufC8*& aResponse )
+    {
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SubmitSoapL(TDesC8, ...");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SubmitSoapL(TDesC8, ...");
+    CSLOG_L(aConsumer.ConnectionId(), KMaxLogLevel ,"///////////////////////////////////////////////////////");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"///////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId(), KMaxLogLevel , _L8("- Message (%d bytes):"), aSoapMessage.Length()));
+    //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase   , KSenCoreServiceManagerLogLevel  ,(_L8("- Message (%d bytes):"), aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId(), KMaxLogLevel ,(aSoapMessage));
+    //TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,(aSoapMessage));
+    CSLOG_L(aConsumer.ConnectionId(), KMaxLogLevel ,"///////////////////////////////////////////////////////");
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"///////////////////////////////////////////////////////");
+#endif
+    TInt retVal(KErrNone);    	
+    CSenXmlReader* pReader = iFramework.Manager().XMLReader(); // re-use the XML reader instance owned by core 
+    CSenSoapMessage* pMsg = CSenSoapMessage::NewL();
+    CleanupStack::PushL( pMsg );
+    pMsg->SetReader( *pReader ); 
+    pReader->SetContentHandler( *pMsg );
+    TInt leaveCode( KErrNone );
+    TRAP( leaveCode,  pMsg->ParseL( aSoapMessage ); ) 
+    if ( leaveCode )
+        {
+        CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode ));
+        //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase   , KSenCoreServiceManagerLogLevel  ,( _L("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode ));
+        CleanupStack::PopAndDestroy( pMsg ); // de-alloc the SOAP-MSG object immediately
+	  retVal = leaveCode;
+        }
+    else // parsing ok
+        { 
+        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Successfully parsed descriptor into SOAP-MSG.");
+        //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel ,"- Successfully parsed descriptor into SOAP-MSG.");
+        HBufC8* pHttpBody = pMsg->BodyAsStringL(); //Extracting the body
+        CleanupStack::PopAndDestroy( pMsg );
+        CleanupStack::PushL( pHttpBody );
+        retVal = SubmitL(*pHttpBody, aTransportProperties, aConsumer, aResponse);    
+        CleanupStack::PopAndDestroy( pHttpBody ); // assert proper order
+        }
+    return retVal;
+    }
+    
+
+TBool CIdWsfServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if ( aType == MSenServiceDescription::EWebServiceSession ) // direct superclass!    
+    {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+    } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWebServiceSession::HasSuperClass( aType ); 
+        }
+    }
+
+// Temporary
+TInt CIdWsfServiceSession::SetFrameworkPropertiesL(MSenTransport& aTransport)
+    {
+    return iFramework.SetTransportPropertiesL(aTransport);
+    }
+
+void CIdWsfServiceSession::FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier)
+    {
+    CSenWebServiceSession::FillCredentialIdentifierL(aIdentifier);
+
+    _LIT8(KProviderIdElementLocalName,  "ProviderID");
+    aIdentifier.SetPropertyL(KProviderIdElementLocalName, ProviderId());
+    }    
+
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfsessionconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,278 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+#include <SenServiceConnection.h>
+
+
+#include "idwsfsessionconsumer.h"
+#include "idwsfmessage.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+#include <flogger.h>
+
+CIdWsfSessionConsumer* CIdWsfSessionConsumer::NewL(MSenRemoteServiceConsumer& aServiceConsumer,
+                                                   RFileLogger& aLogger)
+    {
+    CIdWsfSessionConsumer* pSelf =
+        CIdWsfSessionConsumer::NewLC(aServiceConsumer, aLogger);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CIdWsfSessionConsumer* CIdWsfSessionConsumer::NewLC(MSenRemoteServiceConsumer& aServiceConsumer,
+                                                    RFileLogger& aLogger)
+    {
+    CIdWsfSessionConsumer* pSelf =
+                        new (ELeave) CIdWsfSessionConsumer(aServiceConsumer, aLogger);
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+    }
+
+CIdWsfSessionConsumer::~CIdWsfSessionConsumer()
+    {
+    delete iSentMessageId;
+    delete iReceivedMessageId;
+    iSentMessages.Reset();
+    }
+
+CIdWsfSessionConsumer::CIdWsfSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer,
+                                             RFileLogger& aLogger)
+:   iConsumer(aServiceConsumer),
+    iLogger(aLogger),
+    iSentMessageId(NULL),
+    iReceivedMessageId(NULL),
+    iSentMessages(ETrue, ETrue)
+    {
+    }
+
+
+const TDesC8& CIdWsfSessionConsumer::Id() const
+    {
+    return iConsumer.Id();
+    }
+
+TInt CIdWsfSessionConsumer::SetSessionL(MSenRemoteServiceSession& aServiceSession)
+    {
+    iConsumer.SetSessionL(aServiceSession);
+    return KErrNone;
+    }
+
+TInt CIdWsfSessionConsumer::HandleIdWsfMessageL( CIdWsfMessage* apMessage,
+                                                 const TInt aTxnId,
+                                                 MSenProperties* aResponseTransportProperties,
+                                                 TBool aCompleteMessage )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::HandleIdWsfMessageL");
+    
+    TInt retVal(KErrNone);
+    if ( apMessage )
+        {
+        CleanupStack::PushL( apMessage ); // ownership is here
+    
+        iSentMessages.RemoveByKey( apMessage->MessageId() );
+    
+        HBufC8* pMessageAsString = NULL;
+        
+    	//TSW ID: EMKY-6S4CGS & ID:EMKY-6N3AGA
+    	// Check if aCompleteMessage in ON then get entire envelope or else only body
+        if ( aCompleteMessage )
+            {
+            pMessageAsString = apMessage->AsXmlL();
+            }
+        else
+            {
+            pMessageAsString = apMessage->BodyAsStringL();
+            }
+        CleanupStack::PopAndDestroy( apMessage ); // object serialized to descriptor, de-alloc!
+    
+        if( pMessageAsString )
+            {
+            retVal = iConsumer.HandleMessageL(pMessageAsString, aTxnId, aResponseTransportProperties);
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::HandleIdWsfMessageL:");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Fatal(!): pMessageAsString == NULL, calling remote consumer's HandleErrorL with KErrSenNoSoapBody");
+            retVal = iConsumer.HandleErrorL(NULL, KErrSenNoSoapBody, aTxnId, aResponseTransportProperties);
+            }
+        }
+    else // apMessage == NULL
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::HandleIdWsfMessageL:");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Fatal(!): apMessage == NULL, calling remote consumer's HandleErrorL with KErrSenInternalError");
+        retVal = iConsumer.HandleErrorL( NULL, KErrSenInternal, aTxnId, aResponseTransportProperties);
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L("CIdWsfSessionConsumer::HandleIdWsfMessageL - HandleErrorL returned: %d. Returning KErrSenInternalError in ANY case."), retVal));
+        retVal = KErrSenInternal;            
+        }        
+    return retVal;
+    }
+
+TInt CIdWsfSessionConsumer::HandleMessageL( HBufC8* apMessage,
+                                            const TInt aTxnId,
+                                            MSenProperties* aResponseTransportProperties ) 
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::HandleMessageL - passing message to consumer");
+    return iConsumer.HandleMessageL( apMessage, aTxnId, aResponseTransportProperties );
+    }
+
+TInt CIdWsfSessionConsumer::HandleErrorL( HBufC8* apError,
+                                          const TInt aErrorCode,
+                                          const TInt aTxnId,
+                                          MSenProperties* aResponseTransportProperties )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::HandleErrorL - passing error to consumer");
+    return iConsumer.HandleErrorL( apError, aErrorCode, aTxnId, aResponseTransportProperties );
+    }
+
+void CIdWsfSessionConsumer::SetStatusL(const TInt status)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::SetStatusL");
+    iConsumer.SetStatusL(status);
+    }
+
+TInt CIdWsfSessionConsumer::MessageForSendingL( const TDesC8& aBody,
+                                                const TDesC8& aReceivedMessageId,
+                                                CIdWsfMessage*& apMessage )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CIdWsfSessionConsumer::MessageForSendingL");
+    if(aReceivedMessageId.Length()>0)
+        {
+        apMessage = CIdWsfMessage::NewL(aReceivedMessageId);
+        }
+    else
+        {
+        apMessage = CIdWsfMessage::NewL();
+        }
+
+    apMessage->SetBodyL(aBody);
+    iSentMessages.Append(apMessage->MessageId().AllocL(), aBody.AllocL());
+    return KErrNone;
+    }
+
+void CIdWsfSessionConsumer::ConstructL()
+    {
+    }
+
+void CIdWsfSessionConsumer::SetSentMessageIdL(const TDesC8& aSentMessageId)
+    {
+    HBufC8* pNew = NULL;
+    if(aSentMessageId.Length()>0)
+    pNew = aSentMessageId.AllocL();    
+    delete iSentMessageId;
+    iSentMessageId = pNew;
+    }
+
+TPtrC8 CIdWsfSessionConsumer::SentMessageId()
+    {
+    if(iSentMessageId)
+        {
+        return *iSentMessageId;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+void CIdWsfSessionConsumer::SetReceivedMessageIdL(
+                                            const TDesC8& aReceivedMessageId)
+    {
+    HBufC8* pNew =NULL;
+    if(aReceivedMessageId.Length()>0)
+        pNew = aReceivedMessageId.AllocL();
+    delete iReceivedMessageId;
+    iReceivedMessageId = pNew;
+    }
+
+TPtrC8 CIdWsfSessionConsumer::ReceivedMessageId()
+    {
+    if(iReceivedMessageId)
+        return *iReceivedMessageId;
+    else
+        return KNullDesC8();
+    }
+
+
+
+TBool CIdWsfSessionConsumer::Expects(const TDesC8& aRefToMessageID)
+    {
+    TInt index = iSentMessages.Find(aRefToMessageID);
+    if (index != KErrNotFound)
+        {
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+
+TDesC8* CIdWsfSessionConsumer::BodyL(const TDesC8& aMessageID) const
+    {
+    HBufC8* pBody = NULL;
+
+    TInt index = iSentMessages.Find(aMessageID);
+    if (index != KErrNotFound)
+        {
+        pBody = (HBufC8*)iSentMessages.ValueAt(index);
+        }
+
+    return pBody;
+    }
+
+MSenTransport& CIdWsfSessionConsumer::TransportL()
+    {
+    return iConsumer.TransportL();
+    }
+
+CSenIdentifier& CIdWsfSessionConsumer::Identifier() const
+    {
+    return iConsumer.Identifier();
+    }
+
+
+// enable file logging (macros)
+RFileLogger* CIdWsfSessionConsumer::Log() const
+    {
+    return (RFileLogger*) &iLogger;
+    }
+
+
+TInt CIdWsfSessionConsumer::ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk)
+    {
+    return iConsumer.ChunkByTxnIdL(aTxnId, aChunk);
+    }
+
+void CIdWsfSessionConsumer::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
+                const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
+    {
+    }
+void CIdWsfSessionConsumer::SetDataTrafficDetails( TSenDataTrafficDetails& /* aDetails*/)  
+	{
+	}
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfsiuheader.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include "senwsdescription.h" // state constants for credentials
+
+#include "idwsfsiuheader.h"
+
+CIdWsfSiuHeader* CIdWsfSiuHeader::NewL()
+    {
+    CIdWsfSiuHeader* pNew = new (ELeave) CIdWsfSiuHeader;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfSiuHeader::CIdWsfSiuHeader()
+    {
+    }
+
+void CIdWsfSiuHeader::ConstructL()
+    {
+    BaseConstructL(KSiuXmlns, KSiuName);
+    iNotOnOrAfter = Time::NullTTime();
+    }
+
+CIdWsfSiuHeader::~CIdWsfSiuHeader()
+    {
+    delete ipCredential;
+    }
+
+TPtrC8 CIdWsfSiuHeader::Endpoint()
+    {
+    MSenElement* pElement = this->AsElement().Element(KEndpointName);
+    if(!pElement)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return pElement->Content();
+        }
+    }
+
+TPtrC8 CIdWsfSiuHeader::SecurityMechId()
+    {
+    MSenElement* pElement = this->AsElement().Element(KSecurityMechIdName);
+    if(!pElement)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return pElement->Content();
+        }
+    }
+
+const TTime& CIdWsfSiuHeader::NotOnOrAfter()
+    {
+    return iNotOnOrAfter;
+    }
+
+TBool CIdWsfSiuHeader::IsNotOnOrAfterSet()
+    {
+    return (iNotOnOrAfter.Int64() != 0);
+    }
+
+CSenCredential* CIdWsfSiuHeader::Credential()
+    {
+    return ipCredential;
+    }
+
+void CIdWsfSiuHeader::StartElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    switch (iState)
+        {
+        case KStateParsingCredentials:
+            {
+             // change to even state which ignores and does not save content
+            iState = KStateParsingSingleCredential;
+
+            CSenCredential* pCredential = CSenCredential::NewL(aNsUri,
+                aLocalName, aQName, aAttributes, AsElement());
+            delete ipCredential;
+            ipCredential = pCredential;
+            if (iNotOnOrAfter != Time::NullTTime())
+                {
+                ipCredential->SetValidUntil(iNotOnOrAfter);
+                }
+            DelegateParsingL(*ipCredential);
+            break;
+            }
+        default:
+            {
+            if ((aLocalName == KEndpointName) ||
+                (aLocalName == KSecurityMechIdName))
+                {
+                DelegateParsingL(aNsUri, aLocalName, aQName, aAttributes);
+                }
+            else if (aLocalName == KCredentialElementLocalNameName ||
+                        aLocalName == KCredentialsName)
+                {
+                TPtrC8 notOnOrAfter =
+                        SenXmlUtils::AttrValue(aAttributes, KNotOnOrAfterName);
+                if (notOnOrAfter.Length() > 0)
+                    {
+                    iNotOnOrAfter =
+                                SenDateUtils::FromXmlDateTimeL(notOnOrAfter);
+                    }
+                else
+                    {
+                    iNotOnOrAfter = Time::NullTTime();
+                    }
+
+                // even state stops saving content
+                iState = KStateParsingCredentials;
+                CSenBaseFragment::StartElementL(aNsUri, aLocalName,
+                                                aQName, aAttributes);
+                }
+            else
+                {
+                CSenBaseFragment::StartElementL(aNsUri, aLocalName,
+                                                aQName, aAttributes);
+                }
+            break;
+            }
+        }
+    }
+
+void CIdWsfSiuHeader::EndElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    switch (iState)
+        {
+        // this is due the SAX parsing nature of CXMLReader:
+        // in start element delegateparsing(),
+        // AO is blocked, and thats why the state really is
+        // PARSING single CREDENTIAL,
+        // when we arrive to the end element </Credential>
+        case KStateParsingSingleCredential:
+            {
+
+            if (aLocalName == KCredentialElementLocalNameName ||
+                aLocalName == KCredentialsName)
+
+                {
+                iState = KStateIgnore;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+        CSenBaseFragment::EndElementL(aNsUri, aLocalName, aQName);
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/idwsfsoapmessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <badesca.h>
+#include <SenXmlReader.h>
+#include <s32mem.h>
+#include <utf.h>
+
+#include <SenWsSecurityHeader.h>
+
+#include "sendebug.h"
+
+#include "idwsfsoapmessage.h"
+#include "idwsfservicesession.h"
+
+
+CIdWsfSoapMessage* CIdWsfSoapMessage::NewL()
+    {
+    CIdWsfSoapMessage* pNew = new (ELeave) CIdWsfSoapMessage;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CIdWsfSoapMessage::CIdWsfSoapMessage() :
+    ipSecurityMechanismURI(NULL)
+    {
+    }
+
+
+CIdWsfSoapMessage::~CIdWsfSoapMessage()
+    {
+    }
+
+void CIdWsfSoapMessage::BaseConstructL()
+    {
+    CSenSoapMessage::BaseConstructL();
+    }
+
+CSenWsSecurityHeader* CIdWsfSoapMessage::NewSecurityHeaderLC(
+                                                        const TDesC8* aData)
+    {
+    /*
+    CIdWsfSecurityHeader* pNew = NULL;
+    if(aData)
+        {
+        // ID-WSF 1.0 compliant security header with credential
+        pNew = CIdWsfSecurityHeader::NewL(*aData);
+        }
+    else
+        {
+        // ID-WSF 1.0 compliant security header WITHOUT credential
+        pNew = CIdWsfSecurityHeader::NewL();
+        }
+    CleanupStack::PushL(pNew);
+    return pNew;
+    */
+
+    CSenWsSecurityHeader* pHeader = NULL;
+
+    if(ipSecurityMechanismURI && (
+        (*ipSecurityMechanismURI).Compare(KSecTlsBearer11) == 0 
+                                ||
+        (*ipSecurityMechanismURI).Compare(KSecNullBearer11) == 0))
+        {
+          SENDEBUG_L("CIdWsfSoapMessage::NewSecurityHeaderLC \
+               - Setting header for ID-WSF 1.1");
+            // We need to use (newer) security header for ID-WSF 1.1
+            // this could be done in IdWsfSoapMessage class, if it would
+            // somehow know in NewSecurityHeaderL() method, that it is
+            // actually 1.0 or 1.1. But this current solution is rather
+            // clear also. Each new header type, we need a new 
+            // else-if code segment inside this session class method,
+            // -> in here.
+           
+
+          if(aData)
+            {
+            // ID-WSF 1.1 compliant security header with credential
+            pHeader = 
+                CSenWsSecurityHeader::NewL(*aData); 
+            }
+          else
+            {
+            // ID-WSF 1.1 compliant security header WITHOUT credential
+            pHeader = 
+                CSenWsSecurityHeader::NewL(); 
+            }
+        }
+       else // either no security mechanism or 1.0 some compliant mechanism
+        {
+           SENDEBUG_L("CIdWsfSoapMessage::NewSecurityHeaderLC \
+               - Setting header for ID-WSF 1.0");
+          // Add new ID-WSF 1.0 compliant (draft) security header to msg
+          if(aData)
+            {
+            // ID-WSF 1.0 compliant security header with credential
+            pHeader = 
+                CIdWsfSecurityHeader::NewL(*aData); 
+            }
+          else
+            {
+            // ID-WSF 1.0 compliant security header WITHOUT credential
+            pHeader = 
+                CIdWsfSecurityHeader::NewL(); 
+            }
+          // Above is equal with next line, if an aMsg argument 
+          // is actually SenIdWsfSoapMessage(!), ID-WSF 1.1, matmatt
+          //CSenWebServiceSession::SetFrameworkHeaders(aMsg);
+
+        }
+    CleanupStack::PushL(pHeader);
+    return pHeader;
+    }
+
+
+void CIdWsfSoapMessage::SetSecurityMechanism(HBufC8* apSecurityMechanismURI)
+    {
+    // this method is used to indicate which security mechanism is
+    // being used. Further on, this info can be used when creating
+    // new security header. For example, in ID-WSF 1.0, we can
+    // use the draft namespace in the header, and in ID-WSF 1.1 
+    // newer (oasis) version.
+    ipSecurityMechanismURI = apSecurityMechanismURI;
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfanonymoussaslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenIdWsfAnonymousSaslMechanism.h"
+#include "MSenSaslMessage.h"
+
+namespace
+    {
+    _LIT8(KAnonymous, "ANONYMOUS");
+    _LIT8(KAnonUsername, "Anonymous");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfAnonymousSaslMechanism* CSenIdWsfAnonymousSaslMechanism::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfAnonymousSaslMechanism* pNew =
+                    CSenIdWsfAnonymousSaslMechanism::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenIdWsfAnonymousSaslMechanism* CSenIdWsfAnonymousSaslMechanism::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfAnonymousSaslMechanism* pNew =
+                new (ELeave) CSenIdWsfAnonymousSaslMechanism(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+CSenIdWsfAnonymousSaslMechanism::CSenIdWsfAnonymousSaslMechanism(
+                                    MSenCoreServiceManager& aServiceManager)
+: CSenSecurityMechanism(aServiceManager)
+    {
+    }
+
+
+const TDesC8& CSenIdWsfAnonymousSaslMechanism::Name()
+    {
+    return KAnonymous();
+    }
+
+TInt CSenIdWsfAnonymousSaslMechanism::HandleResponseL(
+    MSenSaslMessage& /*aResponse*/,
+    MSenSaslMessage& aNewRequest
+    )
+    {
+    // Return a SASLRequest that continues
+    // ANONYMOUS with response, should not happen though!
+    return aNewRequest.ConstructInitRequestFromL(KAnonUsername, *ipAccount);
+    }
+
+TBool CSenIdWsfAnonymousSaslMechanism::IsPasswordFromUser()
+    {
+        return ETrue;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfcrammd5saslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+
+#include "SenIdWsfCrammd5SaslMechanism.h"
+#include "MSenSaslMessage.h"
+
+#include <flogger.h>
+
+namespace
+    {
+    _LIT8(KCrammd5, "CRAM-MD5");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfCrammd5SaslMechanism* CSenIdWsfCrammd5SaslMechanism::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfCrammd5SaslMechanism* pNew =
+                        CSenIdWsfCrammd5SaslMechanism::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenIdWsfCrammd5SaslMechanism*
+            CSenIdWsfCrammd5SaslMechanism::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfCrammd5SaslMechanism* pNew =
+                new (ELeave) CSenIdWsfCrammd5SaslMechanism(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenIdWsfCrammd5SaslMechanism::CSenIdWsfCrammd5SaslMechanism(
+                                    MSenCoreServiceManager& aServiceManager)
+:CSenIdWsfPlainSaslMechanism(aServiceManager)
+    {
+    }
+
+CSenIdWsfCrammd5SaslMechanism::~CSenIdWsfCrammd5SaslMechanism()
+    {
+    }
+
+const TDesC8& CSenIdWsfCrammd5SaslMechanism::Name()
+    {
+    return KCrammd5();
+    }
+
+TInt CSenIdWsfCrammd5SaslMechanism::HandleResponseL(
+                                                MSenSaslMessage& aResponse,
+                                                MSenSaslMessage& aNewRequest
+    )
+    {
+    const TInt KPasswordMinLength = 64;
+
+    TInt retVal = KErrNone;
+
+    TPtrC8 authzId = ipAccount->AuthzID();
+    TPtrC8 authnId = ipAccount->AdvisoryAuthnID();
+    if (authnId == KNullDesC8)
+        {
+        authnId.Set(authzId);
+        }
+
+    // Get challenge
+    TPtrC8 theChallengeDataBase64 = aResponse.Data();
+
+    HBufC8* pChallengeData = // push pChallengeData;
+        iServiceManager.DecodeFromBase64LC(theChallengeDataBase64);
+    if (pChallengeData->Length() == 0)
+        {
+        iServiceManager.Log()->Write(_L(
+        "ERROR: CSenIdWsfCrammd5SaslMechanism::HandleResponseL \
+        challenge date length = 0"));
+        User::Leave(KErrArgument);
+        }
+
+    // Create MD5 hash generator
+    CMD5* pMd5Gen = CMD5::NewL();
+    CleanupStack::PushL(pMd5Gen);
+
+    // The password is the shared secret
+    // transform password
+    TPtrC8 password(KNullDesC8);
+    if(ipPassword)
+        {
+        password.Set(ipPassword->Des());
+        }
+
+    HBufC8* pPassword8 = TransformL(password);
+    CleanupStack::PushL(pPassword8);
+
+    if (pPassword8->Length() <= KPasswordMinLength)
+        {
+        // Pad with 0 bytes
+        pPassword8 = pPassword8->ReAllocL(KPasswordMinLength);
+        CleanupStack::Pop();    // Replace pwd on cleanup stack,
+                                // might have changed(!)
+        CleanupStack::PushL(pPassword8);
+        pPassword8->Des().AppendFill(TChar(0),
+                                    KPasswordMinLength - pPassword8->Length());
+        }
+    else
+        {
+        // Password is longer than 64 bytes, replace pwd with MD5 hash
+        HBufC8* pPasswordHash = pMd5Gen->Hash(*pPassword8).AllocL();
+        CleanupStack::PopAndDestroy(); // pPassword8;
+        pPassword8 = pPasswordHash;
+        CleanupStack::PushL(pPassword8);
+        }
+
+    // Create HMAC generator
+    CHMAC* pHmacGen = CHMAC::NewL(*pPassword8, pMd5Gen); // takes ownership of
+                                                         // pMd5Gen AND makes
+                                                         // use of pPassword8
+    CleanupStack::PopAndDestroy(); // pPassword8
+    CleanupStack::Pop(); // pMd5Gen
+
+
+    CleanupStack::PushL(pHmacGen); // push
+
+    // Calculate hash
+    TPtrC8 ptrHash = pHmacGen->Hash(*pChallengeData);
+    if (ptrHash.Length() > 0)
+        {
+			_LIT8(KSpace," ");  //CodeScannerWarnings
+        HBufC8 *pResponseData8 = HBufC8::NewLC(
+            authnId.Length() + 1 + ptrHash.Length() * 2); // push pData8
+        TPtr8 ptrResponseData8 = pResponseData8->Des();
+
+        ptrResponseData8.Append(authnId);
+        ptrResponseData8.Append(KSpace);
+
+        // ptrHash needs to be converted to a lowercase hex value
+        for (TInt i = 0; i < ptrHash.Length(); i++)
+            {
+            ptrResponseData8.AppendNumFixedWidth(ptrHash[i], EHex, 2);
+            }
+
+        retVal = aNewRequest.ConstructRequestFromL(KCrammd5, ptrResponseData8);
+
+        CleanupStack::PopAndDestroy();  // pResponseData8;
+        }
+
+    CleanupStack::PopAndDestroy(); // pHmacGen
+
+
+    CleanupStack::PopAndDestroy(); // pChallengeData;
+    return retVal;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfplainsaslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+
+#include "SenIdWsfPlainSaslMechanism.h"
+#include "MSenCoreServiceManager.h"
+
+namespace
+    {
+    //_LIT(KPlain,  "PLAIN");
+    _LIT8(KPlain,   "PLAIN");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfPlainSaslMechanism* CSenIdWsfPlainSaslMechanism::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfPlainSaslMechanism* pNew =
+                        CSenIdWsfPlainSaslMechanism::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+
+CSenIdWsfPlainSaslMechanism* CSenIdWsfPlainSaslMechanism::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfPlainSaslMechanism* pNew =
+                    new (ELeave) CSenIdWsfPlainSaslMechanism(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenIdWsfPlainSaslMechanism::CSenIdWsfPlainSaslMechanism(
+                                    MSenCoreServiceManager& aServiceManager)
+: CSenSecurityMechanism(aServiceManager)
+    {
+    }
+
+CSenIdWsfPlainSaslMechanism::~CSenIdWsfPlainSaslMechanism()
+    {
+    delete ipPassword;
+    }
+
+
+void CSenIdWsfPlainSaslMechanism::SetIdentity(
+                                    CSenIdentityProvider* aIdentityProvider,
+                                    MSenIdentityManager* aIdentityManager)
+    {
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, SetIdentityL(aIdentityProvider, aIdentityManager);)
+    leaveCode=0; // not used
+    }
+
+void CSenIdWsfPlainSaslMechanism::SetIdentityL(
+                                    CSenIdentityProvider* aIdentityProvider,
+                                    MSenIdentityManager* aIdentityManager)
+    {
+    CSaslMechanism::SetIdentity(aIdentityProvider,aIdentityManager);
+
+    TPtrC8 password = ipAccount->Password();
+
+    delete ipPassword;
+    ipPassword = NULL;
+
+    if (password != KNullDesC8)
+        {
+        ipPassword = SenXmlUtils::DecodeHttpCharactersLC(password);
+        CleanupStack::Pop(); // DecodeHttpCharactersLC
+        }
+    else
+        {
+        HBufC8* pPassword2 = CSaslMechanism::Password8L();
+        if(pPassword2)
+            {
+            ipPassword = pPassword2;
+            }
+        else
+            {
+            ipPassword = KNullDesC8().AllocL();
+            }
+        }
+    }
+    
+
+TBool CSenIdWsfPlainSaslMechanism::IsPasswordFromUser()
+    {
+        TBool retVal;
+
+        if (!ipAccount)
+            {
+            retVal = EFalse;
+            }
+        else
+            {
+            retVal = (ipAccount->Password() == KNullDesC8);
+            }
+
+        return retVal;
+    }
+
+void CSenIdWsfPlainSaslMechanism::ClearPasswordL()
+    {
+    if (ipAccount)
+        {
+        CSenElement& element = ipAccount->AsElement();
+        delete element.RemoveElement(KSenIdpPasswordLocalname);
+        }
+    delete ipPassword;
+    ipPassword = NULL;
+    HBufC8* pPassword = Password8L();
+    if (pPassword)
+        {
+        ipPassword = pPassword;
+        }
+    }
+
+TInt CSenIdWsfPlainSaslMechanism::MaxAttempts()
+    {
+    return 3;
+    }
+
+const TDesC8& CSenIdWsfPlainSaslMechanism::Name()
+    {
+    return KPlain();
+    }
+
+TInt CSenIdWsfPlainSaslMechanism::HandleResponseL(
+    MSenSaslMessage& /* aResponse */,
+    MSenSaslMessage& aNewRequest
+    )
+    {
+    TPtrC8 authzId = ipAccount->AuthzID();
+    TPtrC8 authnId = ipAccount->AdvisoryAuthnID();
+
+    if (authnId == KNullDesC8)
+        {
+        authnId.Set(authzId);
+        authzId.Set(KNullDesC8);
+        }
+
+    TPtrC8 password(KNullDesC8);
+
+    if(ipPassword)
+        {
+        password.Set(ipPassword->Des());
+        }
+
+    HBufC8* pSharedSecret = TransformL(password);
+    CleanupStack::PushL(pSharedSecret);
+
+    HBufC8* pData = HBufC8::NewLC(authzId.Length()
+                                + authnId.Length()
+                                + pSharedSecret->Length() + 2);
+    TPtr8 data = pData->Des();
+
+    if(authnId!=authzId)
+        {
+        data.Append(authzId); //  if authzId == authnId, leave out authzId
+        }
+
+    data.Append('\x00');    // NOTE, this zero line is a MUST,
+                            // even if no authzId was added
+    data.Append(authnId);
+    data.Append('\x00');
+    data.Append(*pSharedSecret);
+    TInt retVal = aNewRequest.ConstructRequestFromL(KPlain, *pData);
+    CleanupStack::PopAndDestroy(); // pData;
+    CleanupStack::PopAndDestroy(); // pSharedSecret
+    return retVal;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1458 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <w32std.h>
+
+#include <SenServiceConnection.h> // error codes and framework ids
+#include <SenBaseFragment.h>
+#include <MSenServiceDescription.h>
+
+#include "msencoreservicemanager.h"
+#include "msentransport.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+#include "senidwsfplugin.h"
+#include "idwsfdiscoveryserviceclient.h"
+#include "idwsfservicesession.h"
+#include "idwsfcoreserviceconsumer.h"
+#include "midwsfsessionvalidator.h"
+
+#include <SenTransportProperties.h>
+#include <SenSoapConstants.h>
+
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfPlugin* CSenIdWsfPlugin::NewL(TAny* aManager)
+    {
+    MSenCoreServiceManager* manager =
+                        reinterpret_cast<MSenCoreServiceManager*>(aManager);
+
+    CSenIdWsfPlugin* self = new (ELeave) CSenIdWsfPlugin(*manager);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Implementation of CSIF
+
+// Constructor
+CSenIdWsfPlugin::CSenIdWsfPlugin(MSenCoreServiceManager& aManager)
+:   iManager(aManager)
+    {
+    }
+
+CSenIdWsfPlugin::~CSenIdWsfPlugin()
+    {
+    //CSenIdWsfPlugin::Log()->Write(_L8("CSenIdWsfPlugin::~CSenIdWsfPlugin()"));
+    }
+
+// Second phase construction.
+void CSenIdWsfPlugin::ConstructL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::ConstructL - Version 2 [2006-05-09]");
+
+    // Results to add a DUPLICATE xmlns in parse!
+    BaseConstructL(KIdWsfFrameworkXMLNS, KIdWsfFrameworkLocalname);
+    }
+
+// New methods
+
+/*
+RFileLogger* CSenIdWsfPlugin::Log() const
+    {
+    return iManager.Log();
+    }*/
+
+//////////////////////////////////////////////////////////////////////////
+
+
+// Implementation of CSIF
+
+/**
+* Return a system wide unique string to identify this framework
+*
+* @return TDesC8 that uniquely identifies this framework.
+*/
+const TDesC8& CSenIdWsfPlugin::Id()
+    {
+    return KDefaultIdWsfFrameworkID();
+    }
+    
+TInt CSenIdWsfPlugin::CompareSDScore(const TSDScore& aSDScoreLeft,
+                                                const TSDScore& aSDScoreRight)
+    {
+     //"greater" means better matchScore, i.e. further down in a list!
+    return (aSDScoreLeft.iScore - aSDScoreRight.iScore);
+    }
+
+/**
+* Try to find one or more services that match the given ServiceDescription.
+* Register ServiceDescriptions for these to the owner of the framework,
+* i.e. to the ServiceManager. Return the number of ServiceDescriptions that
+* were added.
+*
+* @param    aPattern - A ServiceDescriptin that should be treated as a pattern
+* @param    aRemoteConsumer - the consumer sending the request
+* @param    aErrorMsg - in case that return value is negative, this may contain
+*           error as descriptor (SOAP Fault etc)
+*
+*   return (TInt) aCount of matching ServiceDescriptions that were added
+*/
+TInt CSenIdWsfPlugin::AddServiceDescriptionL( MSenServiceDescription& aPattern,
+                                              MSenRemoteServiceConsumer& aRemoteConsumer,
+                                              HBufC8*& /* aErrorMsg */ )
+    {
+    CSLOG(aRemoteConsumer.ConnectionId() , KMinLogLevel,(_L("Entered CSenIdWsfPlugin::AddServiceDescriptionL")));
+
+    if( aPattern.Contract().Length() == 0 
+        || ( aPattern.FrameworkId() != KDefaultIdWsfFrameworkID &&
+             aPattern.FrameworkId() != KNullDesC8 ) )
+        {
+        return 0;
+        }
+
+
+#ifdef _SENDEBUG
+    HBufC8* pAsXml = aPattern.AsXmlL();
+    if(pAsXml)
+        {
+        CleanupStack::PushL(pAsXml);
+        CSLOG_ALL(aRemoteConsumer.ConnectionId()  , KMaxLogLevel,(*pAsXml));
+        CleanupStack::PopAndDestroy(); // pAsXml
+        }
+#endif
+
+    RArray<TSDScore> searchResults;
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    RPointerArray<CSenWSDescription> tempArray;
+
+    CleanupClosePushL(searchResults);
+    CleanupClosePushL(serviceDescriptions);
+    CleanupClosePushL(tempArray);
+    
+    TLinearOrder<TSDScore> order(&CSenIdWsfPlugin::CompareSDScore);
+
+    TInt retVal =
+        Manager().ServiceDescriptionsL(serviceDescriptions,
+                                    KIdWsfFrameworkDiscoveryServiceContract);
+
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(3); // close the RPointerArrays
+        return 0; // zero SD's were added
+        }
+
+    CIdWsfDiscoveryServiceClient* pDSClient = NULL;
+    CSenIdentityProvider* pIdentityProvider = IdentityProviderL(&aPattern);
+
+    //////////////////////////////////////////////////////////////////////////
+
+    if(!pIdentityProvider)
+        {
+        CleanupStack::PopAndDestroy(3); // close the RPointerArrays
+        return 0;//no possibility to add any SD as long as NO IdP is available!
+        }
+    //////////////////////////////////////////////////////////////////////////
+
+    TInt attempts = 0;
+
+    RPointerArray<CSenWSDescription> invalidDSClients;
+    CleanupClosePushL(invalidDSClients);
+    MSenServiceDescription *pDSDescription = NULL;
+
+    TInt i = 0;
+    while((i < serviceDescriptions.Count()) && (searchResults.Count() < 1))
+        {
+        pDSDescription = (MSenServiceDescription*) serviceDescriptions[i];
+        if(pDSDescription->DescriptionClassType() ==
+                    MSenServiceDescription::EIdWsfDiscoveryServiceClient)
+            {
+            pDSClient = (CIdWsfDiscoveryServiceClient*) pDSDescription;
+            if(pDSClient->IsReadyL())
+                {
+                if( (!pIdentityProvider &&
+                            (pDSClient->TrustAnchor() == KNullDesC8())) ||
+                     (pIdentityProvider &&
+                            (pDSClient->TrustAnchor() ==
+                                    pIdentityProvider->ProviderID()) ))
+                    {
+                    pDSClient->FindServiceL(tempArray, 
+                                            aPattern, 
+                                            aRemoteConsumer);
+                    attempts++;
+                    for(TInt j = 0; j < tempArray.Count(); j++)
+                        {
+                        TSDScore temp;
+                        temp.iSD = tempArray[j];
+                        temp.iScore = tempArray[j]->ScoreMatchL(aPattern);
+                        searchResults.Append(temp);
+                        //searchResults.Append(tempArray[j]);
+                        }
+                    tempArray.Reset();
+                    searchResults.Sort(order);
+                    }
+                else
+                    {
+                    invalidDSClients.Append(
+                                (CSenWSDescription*)pDSDescription);
+                    }
+                }
+            else
+                {
+                invalidDSClients.Append(
+                                (CSenWSDescription*)pDSDescription);
+                }
+            }
+        else
+            {
+            invalidDSClients.Append(
+                                (CSenWSDescription*)pDSDescription);
+            }
+        i++;
+        }
+
+    if(searchResults.Count() < 1)
+        {
+        if(attempts < 1)    // no DS trusted by the IDP
+                            //that was in the database (senidentities.xml)
+            {
+            // get a DS with the IdP as trust anchor
+            pDSClient = DSClientL(pIdentityProvider, aRemoteConsumer);
+            if(pDSClient && pDSClient->IsReadyL())
+                {
+                pDSClient->FindServiceL(tempArray, 
+                                        aPattern,
+                                        aRemoteConsumer);
+                for(TInt j = 0; j < tempArray.Count(); j++)
+                    {
+                    TSDScore temp;
+                    temp.iSD = tempArray[j];
+                    temp.iScore = tempArray[j]->ScoreMatchL(aPattern);
+                    searchResults.Append(temp);
+                    //searchResults.Append(tempArray[j]);
+                    }
+                tempArray.Reset();
+                searchResults.Sort(order);
+                }
+            }
+        }
+
+    if(searchResults.Count() < 1)
+        {
+        // try to validate invalid DS descriptions (clients)
+        i = 0;
+        while((i < invalidDSClients.Count()) && (searchResults.Count() < 1))
+            {
+            pDSDescription = (MSenServiceDescription*) invalidDSClients[i];
+            if(pDSDescription->DescriptionClassType() ==
+                        MSenServiceDescription::EIdWsfDiscoveryServiceClient)
+                {
+                pDSClient = (CIdWsfDiscoveryServiceClient*) pDSDescription;
+                if(ValidateDSL(pDSClient,pIdentityProvider, aRemoteConsumer))
+                    {
+                    retVal = pDSClient->FindServiceL(tempArray, 
+                                                     aPattern,
+                                                     aRemoteConsumer);
+                    CSLOG_FORMAT((aRemoteConsumer.ConnectionId()  , KNormalLogLevel, _L8("DS client FindServiceL() returned: (%d)"),
+                        retVal));
+                    retVal = 0;
+
+                    for(TInt j = 0; j < tempArray.Count(); j++)
+                        {
+                        TSDScore temp;
+                        temp.iSD = tempArray[j];
+                        temp.iScore = tempArray[j]->ScoreMatchL(aPattern);
+                        searchResults.Append(temp);
+                        //searchResults.Append(tempArray[j]);
+                        }
+                    searchResults.Sort(order);
+                    }
+                }
+            i++;
+            }
+        }
+
+    for(i=0; i<searchResults.Count(); i++)
+        {
+        Manager().AddServiceDescriptionL(searchResults[i].iSD);
+        }
+
+    TInt countOfAddedSDs = searchResults.Count();
+
+    // close: invalidDSClients, tempArray, serviceDescriptions, searchResults
+    CleanupStack::PopAndDestroy(4);
+                                  
+	
+		
+	
+
+    return countOfAddedSDs;
+    }
+
+TInt CSenIdWsfPlugin::AddServiceDescriptionL( const TDesC8& aServiceTypeContract,
+                                              MSenRemoteServiceConsumer& aRemoteConsumer,
+                                              HBufC8*& aErrorMsg )
+    {
+
+    /*
+    * Ask the DiscoveryService client to search for services of
+    * the given type;
+    * Add these services to the framework manager.
+    */
+    CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L("IdWsf-plugin: Searching for session with contract:")));
+    CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(aServiceTypeContract));
+
+
+    MSenServiceDescription *pPattern = CIdWsfServiceInstance::NewLC(aServiceTypeContract);
+
+    TInt count = AddServiceDescriptionL(*pPattern, aRemoteConsumer, aErrorMsg);
+    CleanupStack::PopAndDestroy( pPattern  );
+    return count;
+    }
+
+/**
+* Attempt to register the ServiceDescription to the ServiceManager that
+* owns the framework.
+* This is a callback used by the ServiceManager to give frameworks a chance
+* to replace a generic ServiceDescription into something that is more specific,
+* and more useful, to the ServiceInvocationFramework.
+*
+* @param aServiceDescription A ServiceDescription
+*
+*   return TInt aError - indicates the error or KErrNone if successfull
+*/
+TInt CSenIdWsfPlugin::RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::RegisterServiceDescriptionL");
+
+    // Sanity checks
+
+#ifdef _SENDEBUG
+    HBufC8* pAsXml = aServiceDescription.AsXmlL();
+    if(pAsXml)
+        {
+        CleanupStack::PushL(pAsXml);
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(*pAsXml));
+        CleanupStack::PopAndDestroy(); // ptr
+        }
+#endif // _SENDEBUG
+
+
+    TInt retval = KErrNone;
+
+    CIdWsfServiceSession *pSession = NULL;
+
+    TPtrC8 contract = aServiceDescription.Contract();
+
+    if(contract == KIdWsfFrameworkAuthenticationServiceContract)
+        {
+        retval = RegisterASClientL(&aServiceDescription);
+        }
+    else if(contract.Length()>0 &&
+            (contract == KIdWsfFrameworkDiscoveryServiceContract))
+        {
+        retval = RegisterDSClientL(&aServiceDescription);
+        }
+    else
+        {
+        if(aServiceDescription.DescriptionClassType() ==
+                    MSenServiceDescription::EIdWSFServiceSession)
+            {
+            pSession = (CIdWsfServiceSession*) &aServiceDescription;
+
+            retval = Manager().AddServiceDescriptionL(pSession);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("Creating session from description...")));
+#ifdef _SENDEBUG
+            TPtrC8 con = aServiceDescription.Contract();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8(" Using Contract: '%S'"), &con));
+#endif
+
+            pSession = CIdWsfServiceSession::NewLC(*this);
+            retval = pSession->InitializeFromL(aServiceDescription);
+            if (retval == KErrNone)
+                {
+                retval = Manager().AddServiceDescriptionL(pSession);
+                CleanupStack::Pop(pSession);
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(pSession);
+                }
+            }
+        }
+
+    return retval;
+    }
+
+TInt CSenIdWsfPlugin::UnregisterServiceDescriptionL(
+                                MSenServiceDescription& aServiceDescription)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("UnRegisterServiceDescriptionL(.)")));
+
+
+#ifdef _SENDEBUG
+    HBufC8* pAsXml = aServiceDescription.AsXmlL();
+    if(pAsXml)
+        {
+        CleanupStack::PushL(pAsXml);
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(*pAsXml));
+        CleanupStack::PopAndDestroy(); // ptr
+        }
+#endif // _SENDEBUG
+
+
+    TInt retval = KErrNone;
+    CIdWsfServiceSession *pSession = NULL;
+    TPtrC8 contract = aServiceDescription.Contract();
+
+    if(contract == KIdWsfFrameworkAuthenticationServiceContract)
+        {
+        retval = UnRegisterASClientL(&aServiceDescription);
+        }
+    else if(contract.Length()>0 &&
+        (contract == KIdWsfFrameworkDiscoveryServiceContract))
+        {
+        retval = UnRegisterDSClientL(&aServiceDescription);
+        }
+    else
+        {
+        if(aServiceDescription.DescriptionClassType() ==
+                MSenServiceDescription::EIdWSFServiceSession)
+            {
+            pSession = (CIdWsfServiceSession*) &aServiceDescription;
+            retval = Manager().RemoveServiceDescriptionL(*pSession);
+            }
+        else
+            {
+#ifdef _SENDEBUG
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Creating session from description...");
+            TPtrC8 con = aServiceDescription.Contract();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("-contract: '%S'"), &con));
+#endif // _SENDEBUG
+
+            pSession = CIdWsfServiceSession::NewLC(*this);
+            retval = pSession->InitializeFromL(aServiceDescription);
+            if (retval == KErrNone)
+                {
+                retval = Manager().RemoveServiceDescriptionL(*pSession);
+                }
+            CleanupStack::PopAndDestroy(pSession);
+            }
+        }
+
+    return retval;
+    }
+
+TInt CSenIdWsfPlugin::UnRegisterASClientL(
+                                MSenServiceDescription *aServiceDescription)
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::UnRegisterASClientL");
+     TPtrC8 endpoint = aServiceDescription->Endpoint();
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(endpoint));
+#endif
+
+    TInt retval = KErrNone;
+
+    CIdWsfServiceSession *pSession = NULL;
+    CIdWsfAuthenticationServiceClient *pASClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                MSenServiceDescription::EIdWsfAuthenticationServiceClient)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("This ServiceDescription is already an AS Client")));
+        pASClient = (CIdWsfAuthenticationServiceClient*)aServiceDescription;
+
+        retval = Manager().RemoveServiceDescriptionL(*pASClient);
+        }
+    else
+        {
+        pSession = CIdWsfServiceSession::NewLC(*this);
+        retval = pSession->InitializeFromL(*aServiceDescription);
+        if(retval != KErrNone)
+            {
+            CleanupStack::PopAndDestroy(pSession); 
+            return retval;
+            }
+#ifdef _SENDEBUG
+        TPtrC8 sessionEndpoint = pSession->Endpoint();
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Creating ASClient and new Session using Endpoint:");
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(sessionEndpoint));
+#endif
+
+        pASClient = CIdWsfAuthenticationServiceClient::NewLC(*this);//, *Log());
+        pASClient->SetServiceSessionL(pSession);    // pSession will be owned by ASClient
+        CleanupStack::Pop(2); // pASClient, pSession
+        CleanupStack::PushL(pASClient);
+
+        retval = Manager().RemoveServiceDescriptionL(*pASClient);
+        if(retval != KErrNone)
+            {
+            delete pASClient;
+            }
+        CleanupStack::Pop(); // pASClient
+        }
+
+    return retval;
+    }
+
+TInt CSenIdWsfPlugin::RegisterASClientL(
+                                MSenServiceDescription *aServiceDescription)
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::RegisterASClientL");
+    TPtrC8 endpoint = aServiceDescription->Endpoint();
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(endpoint));
+#endif // _SENDEBUG
+
+    TInt retval = KErrNone;
+
+    CIdWsfServiceSession *pSession = NULL;
+    CIdWsfAuthenticationServiceClient *pASClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                MSenServiceDescription::EIdWsfAuthenticationServiceClient)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("This ServiceDescription is already an AS Client")));
+        pASClient = (CIdWsfAuthenticationServiceClient*)aServiceDescription;
+
+        retval = Manager().AddServiceDescriptionL(pASClient);
+        }
+    else
+        {
+        // Create new Authentication Service client and initialize
+        // it from given description
+        pSession = CIdWsfServiceSession::NewLC(*this);
+        retval = pSession->InitializeFromL(*aServiceDescription);
+
+        if(retval != KErrNone)
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::RegisterASClientL");
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L("- InitializeFromL(SD) failed: %d"), retval));
+            CleanupStack::PopAndDestroy(); // pSession
+            return retval;
+            }
+        else if(pSession->Endpoint() == KNullDesC8)
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- InitializeFromL => KErrSenNoEndpoint");
+            CleanupStack::PopAndDestroy(); // pSession
+            return KErrSenNoEndpoint;
+            }
+
+#ifdef _SENDEBUG
+        TPtrC8 sessionEndpoint = pSession->Endpoint();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+            _L8("- Creating AS client and new session using endpoint: '%S'"),
+            &sessionEndpoint));
+#endif // _SENDEBUG
+
+        pASClient = CIdWsfAuthenticationServiceClient::NewLC(*this);//, *Log());
+        pASClient->SetServiceSessionL(pSession);    // pSession will be
+                                                    // owned by ASClient
+        CleanupStack::Pop(2); // pASClient, pSession
+        CleanupStack::PushL(pASClient);
+
+        retval = Manager().AddServiceDescriptionL(pASClient);
+        if(retval != KErrNone)
+            {
+            delete pASClient;
+            }
+        CleanupStack::Pop(); // pASClient
+        }
+
+    return retval;
+    }
+
+TInt CSenIdWsfPlugin::RegisterDSClientL(
+                                MSenServiceDescription* aServiceDescription)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("RegisterDSClientL(..)")));
+
+    TInt retval = KErrNone;
+
+    CIdWsfServiceSession *pSession = NULL;
+    CIdWsfDiscoveryServiceClient *pDSClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                    MSenServiceDescription::EIdWsfDiscoveryServiceClient)
+        {
+        /* There already is a session, but it may be necessary
+         * to reset the user information.
+         */
+        pDSClient = (CIdWsfDiscoveryServiceClient*)aServiceDescription;
+        retval = Manager().AddServiceDescriptionL(pDSClient);
+        }
+    else
+        {
+        pSession = CIdWsfServiceSession::NewLC(*this);
+        retval = pSession->InitializeFromL(*aServiceDescription);
+        if(retval != KErrNone)
+            {
+            CleanupStack::PopAndDestroy(); // pSession
+            return retval;
+            }
+#ifdef _SENDEBUG
+        TPtrC8 endpoint = pSession->Endpoint();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("Creating DSClient for %S"), &endpoint));
+#endif // _SENDEBUG
+
+        pDSClient = CIdWsfDiscoveryServiceClient::NewLC(*this);//, *Log());
+        pDSClient->SetServiceSessionL(pSession);
+        CleanupStack::Pop(2); // pDSClient, pSession
+        CleanupStack::PushL(pDSClient);
+
+        retval = Manager().AddServiceDescriptionL(pDSClient);
+        if(retval != KErrNone)
+            {
+            delete pDSClient;
+            }
+        CleanupStack::Pop(); // pDSClient
+        }
+    return retval;
+    }
+
+TInt CSenIdWsfPlugin::UnRegisterDSClientL(
+                                MSenServiceDescription* aServiceDescription)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("RegisterDSClientL(..)")));
+
+    TInt retval = KErrNone;
+
+    CIdWsfServiceSession *pSession = NULL;
+    CIdWsfDiscoveryServiceClient *pDSClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+            MSenServiceDescription::EIdWsfDiscoveryServiceClient)
+        {
+        // There already is a session, but it may be necessary
+        // to reset the user information.
+        //
+        pDSClient = (CIdWsfDiscoveryServiceClient*)aServiceDescription;
+        retval = Manager().RemoveServiceDescriptionL(*pDSClient);
+        }
+    else
+        {
+        pSession = CIdWsfServiceSession::NewLC(*this);
+        retval = pSession->InitializeFromL(*aServiceDescription);
+        if(retval != KErrNone)
+            {
+            CleanupStack::PopAndDestroy(); // pSession
+            return retval;
+            }
+#ifdef _SENDEBUG
+        TPtrC8 endpoint = pSession->Endpoint();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("Creating DSClient for %S"), &endpoint));
+#endif
+
+        pDSClient = CIdWsfAuthenticationServiceClient::NewLC(*this);//, *Log());
+        pDSClient->SetServiceSessionL(pSession);
+        CleanupStack::Pop(2); // pDSClient, pSession
+        CleanupStack::PushL(pDSClient);
+
+        retval = Manager().RemoveServiceDescriptionL(*pDSClient);
+        if(retval != KErrNone)
+            {
+            delete pDSClient;
+            }
+        CleanupStack::Pop(); // pDSClient
+        }
+    return retval;
+    }
+
+/**
+* Create a ServiceSession based upon the given ServiceDescription.
+* The ServiceSession is expected to be "valid", i.e. ready for use
+* by a client.
+*
+* @param aServiceDescription A ServiceDescription
+*
+* @param aNewSession (CSenServiceSession)
+*
+* return TInt error or KErrNone if successful
+*/
+TInt CSenIdWsfPlugin::CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                             MSenServiceDescription& aPattern,
+                                             CSenServiceSession*& aNewSession,
+                                             MSenRemoteServiceConsumer& aRemoteConsumer,
+                                             HBufC8*& /* aErrorMsg */ ) // TODO: start providing aErrorMsg on SOAP faults(!)
+    {
+#ifdef _SENDEBUG
+    CSLOG(aRemoteConsumer.ConnectionId()  , KMinLogLevel,(_L("CreateServiceSessionL()")));
+    TPtrC8 contract = aServiceDescription.Contract();
+    CSLOG_FORMAT((aRemoteConsumer.ConnectionId()  , KMinLogLevel, _L8("- Asked to create ServiceSession using '%S' as Contract...)"),
+            &contract));
+#endif
+
+    delete aNewSession;
+    aNewSession = NULL;
+
+    if(aServiceDescription.DescriptionClassType() == MSenServiceDescription::EIdWSFServiceSession)
+        {
+        aNewSession = (CIdWsfServiceSession*) &aServiceDescription;
+        CSLOG_L(aRemoteConsumer.ConnectionId()  , KMinLogLevel,"- service description is already an ID-WSF service session.");
+        // Check for messageThreading! (and other facets that may have to be
+        // set or cleared)
+        // We can assume that the current session matches with the pattern
+        // but that there may be a need to adjust some settings.
+        ((CIdWsfServiceSession*)aNewSession)->CopyFacetsFromL(aPattern);
+        }
+    else
+        {
+        aNewSession = (CIdWsfServiceSession*) NewServiceDescriptionL();
+        ((CIdWsfServiceSession*)aNewSession)->InitializeFromL( aServiceDescription );
+        }
+
+    if(aNewSession)
+        {
+        if(!aNewSession->IsReadyL())
+            {
+            if(ValidateL(*((CIdWsfServiceSession*)aNewSession), aRemoteConsumer))
+                {
+                // note (below): sessions were just previously written(!)
+                // -> due to nature of current CSenXmlDao implementation:
+                // it writes everything and every time it is saving some
+                // new object.
+                Manager().SaveL(*this);
+                return KErrNone;
+                }
+            else
+                {
+                return KErrNotReady;
+                }
+            }
+        }
+    return KErrNone;
+    }
+
+
+TBool CSenIdWsfPlugin::ValidateL(CIdWsfServiceSession& aSession,
+                                MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+#ifdef _SENDEBUG
+    TPtrC8 endpoint = aSession.Endpoint();
+    CSLOG_FORMAT((aRemoteConsumer.ConnectionId()  , KMinLogLevel, _L8("Session to '%S' Endpoint needs to be revalidated!"),
+                            &endpoint));
+#endif // _SENDEBUG
+
+    CIdWsfDiscoveryServiceClient* pDSClient = NULL;
+    TPtrC8 trustAnchor = aSession.TrustAnchor();
+    pDSClient = DSClientL(trustAnchor, aRemoteConsumer);
+
+    if(!pDSClient)
+        {
+        // this typically occurs, if no IDP was obtained
+        // the file might have been empty, or no matching
+        // IDP was found(!)
+        return EFalse;
+        }
+
+    TInt retVal = pDSClient->ValidateL(aSession, aRemoteConsumer);
+
+    TBool success = (retVal == KErrNone) && aSession.IsReadyL();
+    if(success)
+        {
+        // note (above): this leads to instant, second-time-write of sessions
+        // -> due to nature of current CSenXmlDao implementation:
+        // it writes everything and every time it is saving some new object.
+        Manager().SaveL(aSession);
+        }
+
+    return success;
+    }
+
+
+CIdWsfDiscoveryServiceClient* CSenIdWsfPlugin::DSClientL(
+            const TDesC8& aTrustAnchor,
+            MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L("DSClientL(const TDesC& aTrustAnchor, MSenRemoteServiceConsumer&)")));
+    CSenIdentityProvider* pIdentityProvider = IdentityProviderL(aTrustAnchor);
+    if(pIdentityProvider)
+        {
+        return DSClientL(pIdentityProvider, aRemoteConsumer);
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+
+CSenIdentityProvider* CSenIdWsfPlugin::IdentityProviderL(
+                                                    const TDesC8& aProviderId)
+    {
+    CIdWsfServiceInstance *pPattern = CIdWsfServiceInstance::NewLC();
+    pPattern->SetProviderIdL( aProviderId );
+
+    // 2004-08-10. one-line fix // this is checked by ID-MGR for matches
+    if(aProviderId.Length()>0)
+        {
+        pPattern->SetEndPointL( aProviderId );
+        }
+
+    CSenIdentityProvider* pIdentityProvider = IdentityProviderL( pPattern );
+    CleanupStack::PopAndDestroy( pPattern ); 
+
+    return pIdentityProvider;
+
+    }
+
+CSenIdentityProvider* CSenIdWsfPlugin::IdentityProviderL(
+                                            MSenServiceDescription* aPattern)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::IdentityProviderL");
+
+    CSenIdentityProvider* pIdentityProvider = NULL;
+
+    if(aPattern)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Querying IdentityProvider using a pattern.");
+        pIdentityProvider = Manager().IdentityProviderL(*aPattern);
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"No pattern given for IdentityProvider query.");
+        }
+
+    if(!pIdentityProvider)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Querying IdentityProvider without a pattern.");
+        pIdentityProvider = Manager().IdentityProviderL();
+        }
+
+#ifdef _SENDEBUG
+    if(!pIdentityProvider)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"FATAL: Did not obtain an IdentityProvider!");
+        }
+#endif
+
+    return pIdentityProvider;
+    }
+
+TBool CSenIdWsfPlugin::ValidateDSL(CIdWsfDiscoveryServiceClient* aDSClient,
+                                   CSenIdentityProvider* aIDP,
+                                   MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CIdWsfAuthenticationServiceClient *pASClient = ASClientL(aIDP);
+    if(!pASClient)
+        {
+        return EFalse;
+        }
+
+    CIdWsfServiceSession* pSession = aDSClient->IdWsfServiceSession();
+    if(pSession)
+        {
+        pASClient->ValidateL(*pSession, aRemoteConsumer);
+        }
+    return aDSClient->IsReadyL();
+    }
+
+/**
+* Obtain or construct a valid DiscoveryServiceClient. Ask
+* the owning ServiceManager for ServiceDescriptions that match
+* the ID-WSF Discovery Service contract, and that have the
+* given trust anchor (aIdentityProvider).
+* if given.
+*
+* @param aIdentityProvider
+* @return DiscoveryServiceClient
+*/
+CIdWsfDiscoveryServiceClient* CSenIdWsfPlugin::DSClientL(
+            CSenIdentityProvider* aIdentityProvider,
+            MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L("DSClientL(CSenIdentityProvider*, MSenRemoteServiceConsumer&)")));
+
+    TPtrC8 trustAnchor(KNullDesC8);
+    if(aIdentityProvider)
+        {
+        trustAnchor.Set(aIdentityProvider->ProviderID());
+        }
+
+    CIdWsfDiscoveryServiceClient* pDSClient = NULL;
+
+    RPointerArray<CSenWSDescription> matches;
+    CleanupClosePushL(matches);
+
+    CoreServiceDescriptionsL(matches, KIdWsfFrameworkDiscoveryServiceContract,
+                                KNullDesC8);
+    CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L(">>> TrustAnchor to match:")));
+
+    CSLOG(aRemoteConsumer.ConnectionId()   , KMaxLogLevel,(trustAnchor));
+
+    // we now should have DiscoveryServiceClients or nothing
+    for(TInt i = 0; i < matches.Count(); i++)
+        {
+        CIdWsfDiscoveryServiceClient* pCandidate =
+            reinterpret_cast<CIdWsfDiscoveryServiceClient*>(matches[i]);
+
+        if(pCandidate && trustAnchor.Length()>0)
+            {
+            TPtrC8 candidatesTrustAnchor = pCandidate->TrustAnchor();
+            CSLOG(aRemoteConsumer.ConnectionId()   , KMaxLogLevel,(_L(">>> DS Candidate TrustAnchor:")));
+            CSLOG(aRemoteConsumer.ConnectionId()   , KMaxLogLevel,(candidatesTrustAnchor));
+
+            if(candidatesTrustAnchor.Length() == 0 ||
+                trustAnchor != candidatesTrustAnchor)
+                {
+                CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L(">>> DS Candidate not trusted")));
+                pCandidate = NULL;
+                }
+            }
+
+        if(pCandidate)
+            {
+            CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L(">>> DS Candidate trusted")));
+            if(!pDSClient)
+                {
+                pDSClient = pCandidate;
+                }
+            else if(pCandidate->ValidUntilL() > pDSClient->ValidUntilL())
+                {
+                CSLOG(aRemoteConsumer.ConnectionId()   , KMinLogLevel,(_L("Found: Discovery Service Session having longer validity!")));
+                pDSClient = pCandidate;
+                }
+            }
+        }
+
+    if(!pDSClient)
+        {
+        /* Obtain an AuthenticationServiceClient and ask it to validate
+        * a new DiscoveryServiceClient.
+        */
+        pDSClient = CIdWsfDiscoveryServiceClient::NewLC(*this);//, *Log());
+        CIdWsfServiceSession* pBrandNewSession =
+                                CIdWsfServiceSession::NewL(*this);
+
+        // The SetServiceSessionL() will also set the DS client
+        // as the first consumer of this new service session.
+        // Ownership of pBrandNewSession is transferred to pDSClient:
+        pDSClient->SetServiceSessionL(pBrandNewSession);
+
+        // NOTE
+        //
+        // This policy related feature is in still in progress, and
+        // therefore: NO ready implementation has been provided.
+        //
+        // add the _REAL_ consumer to assure policy transaction(!)
+        //pBrandNewSession->AddConsumerL(aRemoteConsumer);
+        //
+        // NOTE
+
+        CIdWsfAuthenticationServiceClient* pASClient =
+                                                ASClientL(aIdentityProvider);
+        if(pASClient)
+            {
+            CIdWsfServiceSession* pSession = pDSClient->IdWsfServiceSession();
+            if(pSession)
+                {
+                pASClient->ValidateL(*pSession, aRemoteConsumer);
+                }
+            }
+
+        if(pDSClient->IsReadyL())
+            {
+            TInt retVal = Manager().AddServiceDescriptionL(pDSClient);
+            if(retVal != KErrNone)
+                {
+                CleanupStack::PopAndDestroy(); // pDSClient
+                pDSClient = NULL;
+                }
+            else 
+                {
+                CleanupStack::Pop(); // pDSClient
+                }
+            }
+        else
+            {
+            // bugfix 2005-03-02, matmatt
+            CleanupStack::PopAndDestroy(); // pDSClient 
+            pDSClient = NULL; // not valid
+            }
+        }
+    else
+        {
+        if(!pDSClient->IsReadyL())
+            {
+            CIdWsfAuthenticationServiceClient* pASClient =
+                                            ASClientL(aIdentityProvider);
+            if(pASClient)
+                {
+                CIdWsfServiceSession* pSession = pDSClient->IdWsfServiceSession();
+                if(pSession)
+                    {
+                    pASClient->ValidateL(*pSession, aRemoteConsumer);
+                    }
+                }
+
+            if(pDSClient->IsReadyL())
+                {
+                Manager().SaveL(*this);
+                }
+            else
+                {
+                pDSClient = NULL; // not valid, fixed 2005-12-07
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(); //matches.Close();
+
+    return pDSClient;
+    }
+
+/**
+* Obtain or construct a valid AuthenticationServiceClient. Ask
+* the owning ServiceManager for ServiceDescriptions that match
+* the ID-WSF Authentication Service contract, and the ProviderID
+* of the ServiceDescription, if given.
+*
+* @param providerID
+* @return AuthenticationServiceClient
+*/
+CIdWsfAuthenticationServiceClient* CSenIdWsfPlugin::ASClientL(
+                                    CSenIdentityProvider* aIdentityProvider)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("ASClientL(..)")));
+
+    TPtrC8 providerId(KNullDesC8);
+    if(aIdentityProvider)
+        {
+        providerId.Set(aIdentityProvider->ProviderID());
+        }
+
+    if(providerId.Length()>0)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("Searching for AS at %S"), &providerId));
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel ,(_L8("Searching for AS at NULL")));
+        }
+
+    CIdWsfAuthenticationServiceClient* pASClient = NULL;
+
+    RPointerArray<CSenWSDescription> matches;
+    CleanupClosePushL(matches);
+
+    CoreServiceDescriptionsL(matches,
+                             KIdWsfFrameworkAuthenticationServiceContract(),
+                             providerId);
+
+    if(matches.Count() > 0)
+        {
+        pASClient =
+            reinterpret_cast<CIdWsfAuthenticationServiceClient*>(matches[0]);
+        pASClient->SetAccount(aIdentityProvider);
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L("No matching AS description available!")));
+        }
+
+    if(matches.Count() > 1)
+        {
+        // search for a instance with longest validity
+        for(TInt i = 0; i < matches.Count(); i++)
+            {
+            CIdWsfAuthenticationServiceClient* pNewerASClient =
+              reinterpret_cast<CIdWsfAuthenticationServiceClient*>(matches[i]);
+            pNewerASClient->SetAccount(aIdentityProvider);
+            if(pNewerASClient->ValidUntilL() > pASClient->ValidUntilL())
+                {
+                pASClient = pNewerASClient;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // matches.Close();
+    return pASClient;
+    }
+
+TInt CSenIdWsfPlugin::CoreServiceDescriptionsL(
+                RPointerArray<CSenWSDescription>& aMatches,
+                const TDesC8& aContract,
+                const TDesC8& aProviderID)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("CoreServiceDescriptionsL(..)")));
+
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    CleanupClosePushL(serviceDescriptions);
+
+    TInt retVal =
+        Manager().ServiceDescriptionsL(serviceDescriptions, aContract);
+    if(retVal != KErrNone)
+        {
+        return retVal;
+        }
+
+    CIdWsfCoreServiceConsumer* pDescription = NULL;
+    for(TInt i = 0; i < serviceDescriptions.Count(); i++)
+        {
+        pDescription = (CIdWsfCoreServiceConsumer*)serviceDescriptions[i];
+        if(aProviderID.Length()>0)
+            {
+#ifdef _SENDEBUG
+            HBufC8* pAsXml = pDescription->AsXmlL();
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::CoreServiceDescriptionsL:");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ," - CoreServiceConsumer as XML:");
+            if(pAsXml)
+                {
+                CleanupStack::PushL(pAsXml);
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(*pAsXml));
+                CleanupStack::PopAndDestroy(); // asXml
+                }
+#endif
+
+            TPtrC8 providerID = pDescription->ProviderId();
+            if(providerID.Length()>0 && (aProviderID == providerID))
+                {
+#ifdef _SENDEBUG
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(_L8("    > added to matches")));
+#endif
+                aMatches.Append(pDescription);
+                }
+            }
+        else
+            {
+            aMatches.Append(pDescription);
+            }
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("Found %d matches for"), aMatches.Count()));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("     a contract: %S"), &aContract));
+
+    CleanupStack::PopAndDestroy(); // serviceDescriptions.Close();
+    return KErrNone;
+    }
+
+/**
+* Return a new instance of a framework specific class that
+* implements the ServiceDesccription interface.
+*
+* @param aNewSession (CSenServiceSession)
+*
+* return TInt error or KErrNone if successful
+*/
+CSenWSDescription* CSenIdWsfPlugin::NewServiceDescriptionL()
+
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("CSenIdWsfPlugin::NewServiceDescriptionL()")));
+    CIdWsfServiceSession* pSD = CIdWsfServiceSession::NewL(*this);
+    return pSD;
+    }
+
+/**
+* Return the ServiceManager for which this instance is working.
+* This is used by the ServiceSession instances created by this framework.
+*
+* Note, in Sen, MSenCoreServiceManager so all Frameworks
+* return their "owner" - i.e. - the only service manager in Sen Framework
+*
+* @return (MSenCoreServiceManager)
+*/
+MSenCoreServiceManager& CSenIdWsfPlugin::Manager()
+    {
+    return iManager;
+    }
+
+/**
+* Set the ServiceManager to which this instance reports.
+* The (singleton) ServiceManager calls this method when
+* it instantiates a framework.
+*
+* @param aServiceManager The singleton ServiceManager in the system.
+*/
+void CSenIdWsfPlugin::SetManager(MSenCoreServiceManager& aServiceManager)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("CSenIdWsfPlugin::SetManager(.)")));
+    iManager = aServiceManager;
+    }
+
+
+/**
+* Return an object that can do SAX based parsing of a XML fragment
+* that contains framework specific configuration information.
+* The ServiceManager asks for this BaseFragment upon startup
+* in order to give this framework a chance to read its configuration
+* information from the central ServiceManager configuration document.
+*
+* @return (CSenBaseFragment)
+*/
+CSenBaseFragment& CSenIdWsfPlugin::ConfigParser()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,(_L8("CSenIdWsfPlugin::ConfigParser()")));
+    return *this;
+    }
+
+/**
+* Write the ServiceInvocationFramework configuration as XML to a HBufC8.
+*
+* This method is invoked by the ServiceManager when it saves
+* its state and/or configuration.
+*
+* Upon startup the chunk of XML that is written will be passed back to
+* the configuation parser of the framework.
+*
+* The "schema" that shall be adhered to is:
+* <pre>
+* &lt;element name="Framework"&gt;
+*       &lt;any/&gt;&lt;!-- this is where implementations write additional
+*       information --&gt;
+*       &lt;attribute name="class" type="String"&gt;
+*    &lt;!-- In Symbian the class attribute is used as cue for
+*    the ECOM Resolver --&gt;
+* &lt;/element&gt;
+* </pre>
+*
+* @param aTo - a HBufC8 to which the framework should write its configuration
+*/
+
+
+void CSenIdWsfPlugin::EndElementL(const TDesC8& aNsUri,
+                                  const TDesC8& aLocalName,
+                                  const TDesC8& aQName)
+    {
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,
+        _L8("ID-WSF plugin @ end of element: %S (xmlns='%S', localname='%S')"),
+                &aQName, &aNsUri, &aLocalName));
+    CSIF::EndElementL(aNsUri,aLocalName,aQName);
+    }
+
+// over-ride CSenBaseFragment
+HBufC* CSenIdWsfPlugin::AsXmlUnicodeL()
+    {
+    HBufC8* pUtf8 = AsXmlL();
+    CleanupStack::PushL(pUtf8);
+    HBufC* pAsAxlInUnicode = SenXmlUtils::ToUnicodeLC(*pUtf8);
+    CleanupStack::Pop();           // pAsAxlInUnicode
+    CleanupStack::PopAndDestroy(); // pUtf8
+    return pAsAxlInUnicode;
+    }
+
+HBufC8* CSenIdWsfPlugin::AsXmlL()
+    {
+    _LIT8(KFramework,"<Framework ");
+    _LIT8(KXmlns,"xmlns=\"");
+    _LIT8(KQuot,"\" ");
+    _LIT8(KClass,"class=\"");
+    _LIT8(KClosedTag,"\"/>\n");
+    HBufC8* retVal = HBufC8::NewLC(256);
+    TPtr8 ptr = retVal->Des();
+    ptr.Append(KFramework); // Codescanner warnings
+    ptr.Append(KXmlns);
+    ptr.Append(KIdWsfFrameworkXMLNS);
+    ptr.Append(KQuot);
+
+    ptr.Append(KClass);
+    ptr.Append(KIdWsFrameworkCue);
+    ptr.Append(KClosedTag);
+    CleanupStack::Pop(); // retVal
+    return retVal;
+    }
+
+TInt CSenIdWsfPlugin::OnEvent(const TInt aEvent,
+                            TAny* /* aArgument */)
+    {
+    TInt retVal(KErrNone);
+    TInt leaveCode(KErrNone);
+    switch(aEvent)
+        {
+        case KSenEventWsfReady:
+            // Core constructed                             
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"KSenEventWsfReady");
+            {
+            TRAP(leaveCode, retVal = AssignSessionValidatorsL());
+            }
+        break;
+        case KSenEventIdWsfSessionValidatorRequested:
+            {
+            // Someone needs validator
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"KSenEventIdWsfSessionValidatorRequested");
+            TRAP(leaveCode, retVal = AssignSessionValidatorsL());
+            }
+        break;
+#ifdef _SENDEBUG
+        default:
+            {
+            //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"==> no action taken.");
+            }
+        break;
+#endif // _SENDEBUG
+        }
+    // if leave occurred, return leave code instead
+    if(leaveCode)
+        {
+        retVal = leaveCode;
+        }
+
+    return retVal;
+    }
+
+TAny* CSenIdWsfPlugin::ExtendedInterface()
+    {
+    // there is no extended interface in ID-WSF framework at the moment
+    return NULL;
+    }
+
+TInt CSenIdWsfPlugin::AssignSessionValidatorsL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenIdWsfPlugin::AssignSessionValidatorsL()");
+
+    CSenWSDescription* pOpenMask = CSenWSDescription::NewLC(
+            KNullDesC8, KNullDesC8); // this matches with *any* ServDescription
+    pOpenMask->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    
+    RWSDescriptionArray all;
+    iManager.ServiceDescriptionsL(all, *pOpenMask);
+    CleanupClosePushL(all);
+
+    RWSDescriptionArray asClients;
+    iManager.ServiceDescriptionsL(asClients, 
+                                KIdWsfFrameworkAuthenticationServiceContract);
+    CleanupClosePushL(asClients);
+
+    RWSDescriptionArray dsClients;
+    iManager.ServiceDescriptionsL(dsClients,
+                                KIdWsfFrameworkDiscoveryServiceContract);
+    CleanupClosePushL(dsClients);
+
+    TInt count(all.Count());
+    TInt asCount(asClients.Count());
+    TInt dsCount(dsClients.Count());
+
+    for(TInt i=0; i<count; i++)
+        {   
+        CSenWSDescription* pSD = (CSenWSDescription*)all[i];
+
+        if(pSD->DescriptionClassType() ==
+            MSenServiceDescription::EIdWSFServiceSession)
+            {
+            CIdWsfServiceSession* pSession = (CIdWsfServiceSession*)pSD;
+            if(!pSession->Validator() && pSession->TrustAnchor().Length()>0)
+                {
+                // session does not have validator, attempt to find one
+                for(TInt d=0; d<dsCount; d++)
+                    {
+                    pSD = (CSenWSDescription*)dsClients[d];
+                    if(pSD->DescriptionClassType() ==
+                        MSenServiceDescription::EIdWsfDiscoveryServiceClient)
+                        {
+                        CIdWsfDiscoveryServiceClient* pDsClient =
+                            (CIdWsfDiscoveryServiceClient*)dsClients[d];
+                        TPtrC8 trustAnchor = pSession->TrustAnchor();
+                        if(trustAnchor == pDsClient->TrustAnchor())
+                            {
+                            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("Validator (DSC): 0x%x"), pDsClient));
+                            pSession->SetValidator(pDsClient);
+                            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("Validator (DSC): 0x%x"), pDsClient));
+                            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("Validator for ID-WSF session found, trustanchor: %S"), &trustAnchor));
+                            d = dsCount; // break this loop
+                            }
+                        }
+
+                    }
+                }
+            }
+
+        if(pSD->DescriptionClassType() ==
+            MSenServiceDescription::EIdWsfDiscoveryServiceClient)
+            {
+            CIdWsfDiscoveryServiceClient* pDsClient = 
+                        (CIdWsfDiscoveryServiceClient*)pSD;
+            if(!pDsClient->Validator() && 
+                pDsClient->TrustAnchor().Length()>0)
+                {
+                // session does not have validator, attempt to find one
+                for(TInt a=0; a<asCount; a++)
+                    {
+                    pSD = (CSenWSDescription*)asClients[a];
+                    if(pSD->DescriptionClassType() ==
+                        MSenServiceDescription::EIdWsfAuthenticationServiceClient)
+                        {
+                        CIdWsfAuthenticationServiceClient* pAsClient =
+                            (CIdWsfAuthenticationServiceClient*)asClients[a];
+
+                        TPtrC8 trustAnchor = pDsClient->TrustAnchor();
+
+                        if(trustAnchor == pAsClient->ProviderId())
+                            {
+                            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("Validator (ASC): 0x%x"), pAsClient));
+                            CSenIdentityProvider* pAccount =
+                                IdentityProviderL(pAsClient->ProviderId());
+                            if(pAccount)
+                                {
+                                pAsClient->SetAccount(pAccount);
+                                //pDsClient->SetValidator(pAsClient);
+
+                                pDsClient->IdWsfServiceSession()->SetValidator(pAsClient);
+                                //pAsClient->ValidateL(*pDsClient->IdWsfServiceSession()); // TEST ONLY!!!!!
+                                a = asCount; // break the loop, validator was found
+                                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  ,_L8("Validator for DS client found, trustanchor: %S"), &trustAnchor));
+                                }
+#ifdef _SENDEBUG
+                            else
+                                {
+                                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"Account (IDP) for ASC not found! No DS validator available");
+                                }
+#endif
+                            }
+                        }
+
+                    }
+                }
+            }
+        }
+    
+    CleanupStack::PopAndDestroy(4); // close dsClients, close asClients
+                                    // close all, delete pOpenMask
+    return KErrNone;
+    }
+
+TInt CSenIdWsfPlugin::SetTransportPropertiesL(MSenTransport& aTransport)
+    {
+    //CSenHttpTransportProperties* pProps = CSenHttpTransportProperties::NewLC();
+    CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+    pProps->SetPropertyL(KSenSoapActionHeaderName, KSenSoapActionHeaderValueEmpty, KHttpHeaderType);        
+    HBufC8* pPropsAsXml = pProps->AsUtf8L();
+    CleanupStack::PopAndDestroy(pProps);
+
+    CleanupStack::PushL( pPropsAsXml );
+    // In ID-WSF, even message layer will be forced to have an empty SOAPAction value(!), only
+    // the message's transport properties sent by consumer applicatoin may override this 
+    // (although they never should do that, it has been made possible for the application messages).
+    TInt retVal = aTransport.SetPropertiesL( *pPropsAsXml, MSenLayeredProperties::ESenMessageLayer, NULL );
+    TInt retVal2 = aTransport.SetPropertiesL( *pPropsAsXml, MSenLayeredProperties::ESenFrameworkLayer, NULL );
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    return retVal<retVal2?retVal:retVal2;
+    }
+
+    
+// End of File
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfpluginmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfpluginproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "senidwsfplugin.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TInt32 KIDWSFInterfaceUid = 0x101F96FA;
+#else
+const TInt32 KIDWSFInterfaceUid = 0x101F9731;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+        IMPLEMENTATION_PROXY_ENTRY(KIDWSFInterfaceUid,  CSenIdWsfPlugin::NewL)
+#else
+        {{KIDWSFInterfaceUid},  CSenIdWsfPlugin::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfsecmechmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfplugin/src/senidwsfsecmechproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "SenIdWsfAnonymousSaslMechanism.h"
+#include "SenIdWsfPlainSaslMechanism.h"
+#include "SenIdWsfCrammd5SaslMechanism.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+const TInt32 KAnonymousSaslPluginUid = 0x101F96FD;
+const TInt32 KIdwsfPlainSaslPluginUid = 0x101F96FE;
+const TInt32 KIdwsfCrammd5SaslPluginUid = 0x101F96FF;
+
+#else
+const TInt32 KAnonymousSaslPluginUid = 0x101F9734;
+const TInt32 KIdwsfPlainSaslPluginUid = 0x101F9735;
+const TInt32 KIdwsfCrammd5SaslPluginUid = 0x101F9736;
+
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+        IMPLEMENTATION_PROXY_ENTRY(KAnonymousSaslPluginUid,  CSenIdWsfAnonymousSaslMechanism::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KIdwsfPlainSaslPluginUid,  CSenIdWsfPlainSaslMechanism::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KIdwsfCrammd5SaslPluginUid,  CSenIdWsfCrammd5SaslMechanism::NewL)
+#else
+        {{KAnonymousSaslPluginUid},  CSenIdWsfAnonymousSaslMechanism::NewL},
+        {{KIdwsfPlainSaslPluginUid},  CSenIdWsfPlainSaslMechanism::NewL},
+        {{KIdwsfCrammd5SaslPluginUid},  CSenIdWsfCrammd5SaslMechanism::NewL}
+#endif
+    };
+
+
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                        TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/data/101f96fb.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES 
+#include <ecom/registryinfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F96FB;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96FC;
+            implementations = 
+                {
+                // Info for CIdWsfAnonymousSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FD;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Anonymous SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.AnonymousSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfPlainSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FE;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Plain SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.PlainSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfCramMD5SaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F96FF;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.CramMD5SASLMechanism";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/data/101f9732.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES 
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9732;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9733;
+            implementations = 
+                {
+                // Info for CIdWsfAnonymousSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9734;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Anonymous SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.AnonymousSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfPlainSaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9735;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Plain SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.PlainSASLMechanism";
+                    opaque_data        = "";
+                    },
+                // Info for CIdWsfCramMD5SaslMechanism
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9736;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "com.nokia.Sen.idwsf.CramMD5SASLMechanism";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for idwsfsecuritymechanism   
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/idwsfsecuritymechanism.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(idwsfsecuritymechanism.iby)
+PRJ_MMPFILES
+../../idwsfsecuritymechanism/group/senidwsfsecuritymechanism.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/group/senidwsfsecuritymechanism.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for idwsfsecuritymechanism    
+*
+*/
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+SMPSAFE
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+// ECOM DLL recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenIdWsfSecMech.dll
+UID 0x10009D8D 0x101F96FB
+#else
+TARGET wsIdWsfSecMech.dll
+UID 0x10009D8D 0x101F9732
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senidwsfsecmechmain.cpp
+SOURCE          senidwsfsecmechproxy.cpp
+
+SOURCE          senidwsfanonymoussaslmechanism.cpp
+SOURCE          senidwsfplainsaslmechanism.cpp
+SOURCE          senidwsfcrammd5saslmechanism.cpp
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  101f96fb.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenIdWsfSecMech.rsc
+#endif 
+
+#else
+START RESOURCE  101F9732.RSS
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsIdWsfSecMech.rsc
+#endif 
+
+#endif
+
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wscore/inc
+USERINCLUDE     ../../wsframework/inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wsidentitymanager/inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+
+LIBRARY ECom.lib
+LIBRARY euser.lib 
+LIBRARY flogger.lib
+LIBRARY hash.lib
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY SenFramework.lib // CSaslMechanism
+LIBRARY SenXml.lib
+#else
+LIBRARY wsFramework.lib // CSaslMechanism
+LIBRARY wsXml.lib
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/inc/senidwsfanonymoussaslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_ANONYMOUS_SASL_MECHANISM_H
+#define SEN_IDWSF_ANONYMOUS_SASL_MECHANISM_H
+
+// INCLUDES
+#include "sensecuritymechanism.h"
+#include "msencoreservicemanager.h"
+
+// FORWARD DECLARATIONS
+class MSenSaslMessage;
+
+// CLASS DECLARATION
+class CSenIdWsfAnonymousSaslMechanism :  public CSenSecurityMechanism
+    {
+    public: // Constructors and destructor
+    
+        static CSenIdWsfAnonymousSaslMechanism* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenIdWsfAnonymousSaslMechanism* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+
+        // New functions
+    
+        virtual const TDesC8& Name();
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest);
+        
+        virtual TBool IsPasswordFromUser();
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenIdWsfAnonymousSaslMechanism(MSenCoreServiceManager& aServiceManager);
+    };
+
+#endif // SEN_IDWSF_ANONYMOUS_SASL_MECHANISM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/inc/senidwsfcrammd5saslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_CRAMMD5_SASL_MECHANISM_H
+#define SEN_IDWSF_CRAMMD5_SASL_MECHANISM_H
+
+// INCLUDES
+#include <hash.h>
+
+#include "sensecuritymechanism.h"
+#include "senidwsfplainsaslmechanism.h"
+
+
+// FORWARD DECLARATIONS
+class CMessageDigest;
+class MSenSaslMessage;
+
+// CLASS DECLARATION
+class CSenIdWsfCrammd5SaslMechanism :  public CSenIdWsfPlainSaslMechanism
+    {
+    public: // Constructors and destructor
+    
+        static CSenIdWsfCrammd5SaslMechanism* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenIdWsfCrammd5SaslMechanism* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        
+        virtual ~CSenIdWsfCrammd5SaslMechanism();
+
+        // New functions
+        
+        virtual const TDesC8& Name();
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest);
+
+    protected: // Data
+        CSenIdWsfCrammd5SaslMechanism(MSenCoreServiceManager& aServiceManager);
+    };
+
+#endif // SEN_IDWSF_CRAMMD5_SASL_MECHANISM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/inc/senidwsfplainsaslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDWSF_PLAIN_SASL_MECHANISM_H
+#define SEN_IDWSF_PLAIN_SASL_MECHANISM_H
+
+// INCLUDES
+#include "sensecuritymechanism.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class CSenIdWsfPlainSaslMechanism : public CSenSecurityMechanism
+    {
+    public: // Constructors and destructor
+        
+        static CSenIdWsfPlainSaslMechanism* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenIdWsfPlainSaslMechanism* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        virtual ~CSenIdWsfPlainSaslMechanism();
+
+        // Functions from base classes
+        
+        // From CSaslMechanism
+        virtual void SetIdentity(   CSenIdentityProvider* aIdentityProvider,
+                                    MSenIdentityManager* aIdentityManager);
+
+        virtual TBool IsPasswordFromUser();
+        virtual void ClearPasswordL();
+        virtual TInt MaxAttempts();
+
+        // From CSenSecurityMechanism
+        virtual const TDesC8& Name();
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest);
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenIdWsfPlainSaslMechanism(MSenCoreServiceManager& aServiceManager);
+    
+    private: // New functions
+        
+        /**
+        * Leaving version of the method
+        */
+        void SetIdentityL(  CSenIdentityProvider* aIdentityProvider,
+                            MSenIdentityManager* aIdentityManager);
+
+    protected: // Data
+        HBufC8* ipPassword;
+    };
+
+#endif // IDWSF_PLAIN_SASL_MECHANISM_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/rom/idwsfsecuritymechanism.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSIDWSFSECURITYMECHANISM_IBY__
+#define __WSIDWSFSECURITYMECHANISM_IBY__
+
+//IdWsfSecurityMechanism
+ECOM_PLUGIN(SenIdWsfSecMech.dll, 101F96FB.rsc)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/src/senidwsfanonymoussaslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senidwsfanonymoussaslmechanism.h"
+#include "msensaslmessage.h"
+
+namespace
+    {
+    _LIT8(KAnonymous, "ANONYMOUS");
+    _LIT8(KAnonUsername, "Anonymous");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfAnonymousSaslMechanism* CSenIdWsfAnonymousSaslMechanism::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfAnonymousSaslMechanism* pNew =
+                    CSenIdWsfAnonymousSaslMechanism::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenIdWsfAnonymousSaslMechanism* CSenIdWsfAnonymousSaslMechanism::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfAnonymousSaslMechanism* pNew =
+                new (ELeave) CSenIdWsfAnonymousSaslMechanism(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+CSenIdWsfAnonymousSaslMechanism::CSenIdWsfAnonymousSaslMechanism(
+                                    MSenCoreServiceManager& aServiceManager)
+: CSenSecurityMechanism(aServiceManager)
+    {
+    }
+
+
+const TDesC8& CSenIdWsfAnonymousSaslMechanism::Name()
+    {
+    return KAnonymous();
+    }
+
+TInt CSenIdWsfAnonymousSaslMechanism::HandleResponseL(
+    MSenSaslMessage& /*aResponse*/,
+    MSenSaslMessage& aNewRequest
+    )
+    {
+    // Return a SASLRequest that continues
+    // ANONYMOUS with response, should not happen though!
+    return aNewRequest.ConstructInitRequestFromL(KAnonUsername, *ipAccount);
+    }
+
+TBool CSenIdWsfAnonymousSaslMechanism::IsPasswordFromUser()
+    {
+        return ETrue;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/src/senidwsfcrammd5saslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+
+#include "senidwsfcrammd5saslmechanism.h"
+#include "msensaslmessage.h"
+
+#include <flogger.h>
+
+namespace
+    {
+    _LIT8(KCrammd5, "CRAM-MD5");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfCrammd5SaslMechanism* CSenIdWsfCrammd5SaslMechanism::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfCrammd5SaslMechanism* pNew =
+                        CSenIdWsfCrammd5SaslMechanism::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenIdWsfCrammd5SaslMechanism*
+            CSenIdWsfCrammd5SaslMechanism::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfCrammd5SaslMechanism* pNew =
+                new (ELeave) CSenIdWsfCrammd5SaslMechanism(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenIdWsfCrammd5SaslMechanism::CSenIdWsfCrammd5SaslMechanism(
+                                    MSenCoreServiceManager& aServiceManager)
+:CSenIdWsfPlainSaslMechanism(aServiceManager)
+    {
+    }
+
+CSenIdWsfCrammd5SaslMechanism::~CSenIdWsfCrammd5SaslMechanism()
+    {
+    }
+
+const TDesC8& CSenIdWsfCrammd5SaslMechanism::Name()
+    {
+    return KCrammd5();
+    }
+
+TInt CSenIdWsfCrammd5SaslMechanism::HandleResponseL(
+                                                MSenSaslMessage& aResponse,
+                                                MSenSaslMessage& aNewRequest
+    )
+    {
+    const TInt KPasswordMinLength = 64;
+
+    TInt retVal = KErrNone;
+
+    TPtrC8 authzId = ipAccount->AuthzID();
+    TPtrC8 authnId = ipAccount->AdvisoryAuthnID();
+    if (authnId == KNullDesC8)
+        {
+        authnId.Set(authzId);
+        }
+
+    // Get challenge
+    TPtrC8 theChallengeDataBase64 = aResponse.Data();
+
+    HBufC8* pChallengeData = // push pChallengeData;
+        iServiceManager.DecodeFromBase64LC(theChallengeDataBase64);
+    if (pChallengeData->Length() == 0)
+        {
+        iServiceManager.Log()->Write(_L(
+        "ERROR: CSenIdWsfCrammd5SaslMechanism::HandleResponseL \
+        challenge date length = 0"));
+        User::Leave(KErrArgument);
+        }
+
+    // Create MD5 hash generator
+    CMD5* pMd5Gen = CMD5::NewL();
+    CleanupStack::PushL(pMd5Gen);
+
+    // The password is the shared secret
+    // transform password
+    TPtrC8 password(KNullDesC8);
+    if(ipPassword)
+        {
+        password.Set(ipPassword->Des());
+        }
+
+    HBufC8* pPassword8 = TransformL(password);
+    CleanupStack::PushL(pPassword8);
+
+    if (pPassword8->Length() <= KPasswordMinLength)
+        {
+        // Pad with 0 bytes
+        pPassword8 = pPassword8->ReAllocL(KPasswordMinLength);
+        CleanupStack::Pop();    // Replace pwd on cleanup stack,
+                                // might have changed(!)
+        CleanupStack::PushL(pPassword8);
+        pPassword8->Des().AppendFill(TChar(0),
+                                    KPasswordMinLength - pPassword8->Length());
+        }
+    else
+        {
+        // Password is longer than 64 bytes, replace pwd with MD5 hash
+        HBufC8* pPasswordHash = pMd5Gen->Hash(*pPassword8).AllocL();
+        CleanupStack::PopAndDestroy(); // pPassword8;
+        pPassword8 = pPasswordHash;
+        CleanupStack::PushL(pPassword8);
+        }
+
+    // Create HMAC generator
+    CHMAC* pHmacGen = CHMAC::NewL(*pPassword8, pMd5Gen); // takes ownership of
+                                                         // pMd5Gen AND makes
+                                                         // use of pPassword8
+    CleanupStack::PopAndDestroy(); // pPassword8
+    CleanupStack::Pop(); // pMd5Gen
+
+
+    CleanupStack::PushL(pHmacGen); // push
+
+    // Calculate hash
+    TPtrC8 ptrHash = pHmacGen->Hash(*pChallengeData);
+    if (ptrHash.Length() > 0)
+        {
+        _LIT8(KSpace," ");
+        HBufC8 *pResponseData8 = HBufC8::NewLC(
+            authnId.Length() + 1 + ptrHash.Length() * 2); // push pData8
+        TPtr8 ptrResponseData8 = pResponseData8->Des();
+
+        ptrResponseData8.Append(authnId);
+        ptrResponseData8.Append(KSpace);//CodeScannerWarning
+
+        // ptrHash needs to be converted to a lowercase hex value
+        for (TInt i = 0; i < ptrHash.Length(); i++)
+            {
+            ptrResponseData8.AppendNumFixedWidth(ptrHash[i], EHex, 2);
+            }
+
+        retVal = aNewRequest.ConstructRequestFromL(KCrammd5, ptrResponseData8);
+
+        CleanupStack::PopAndDestroy();  // pResponseData8;
+        }
+
+    CleanupStack::PopAndDestroy(); // pHmacGen
+
+
+    CleanupStack::PopAndDestroy(); // pChallengeData;
+    return retVal;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/src/senidwsfplainsaslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+
+#include "senidwsfplainsaslmechanism.h"
+#include "msencoreservicemanager.h"
+
+namespace
+    {
+    //_LIT(KPlain,  "PLAIN");
+    _LIT8(KPlain,   "PLAIN");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenIdWsfPlainSaslMechanism* CSenIdWsfPlainSaslMechanism::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfPlainSaslMechanism* pNew =
+                        CSenIdWsfPlainSaslMechanism::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+
+CSenIdWsfPlainSaslMechanism* CSenIdWsfPlainSaslMechanism::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenIdWsfPlainSaslMechanism* pNew =
+                    new (ELeave) CSenIdWsfPlainSaslMechanism(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenIdWsfPlainSaslMechanism::CSenIdWsfPlainSaslMechanism(
+                                    MSenCoreServiceManager& aServiceManager)
+: CSenSecurityMechanism(aServiceManager)
+    {
+    }
+
+CSenIdWsfPlainSaslMechanism::~CSenIdWsfPlainSaslMechanism()
+    {
+    delete ipPassword;
+    }
+
+
+void CSenIdWsfPlainSaslMechanism::SetIdentity(
+                                    CSenIdentityProvider* aIdentityProvider,
+                                    MSenIdentityManager* aIdentityManager)
+    {
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, SetIdentityL(aIdentityProvider, aIdentityManager);)
+    leaveCode=0; // not used
+    }
+
+void CSenIdWsfPlainSaslMechanism::SetIdentityL(
+                                    CSenIdentityProvider* aIdentityProvider,
+                                    MSenIdentityManager* aIdentityManager)
+    {
+    CSaslMechanism::SetIdentity(aIdentityProvider,aIdentityManager);
+
+    TPtrC8 password = ipAccount->Password();
+
+    delete ipPassword;
+    ipPassword = NULL;
+
+    if (password != KNullDesC8)
+        {
+        ipPassword = SenXmlUtils::DecodeHttpCharactersLC(password);
+        CleanupStack::Pop(); // DecodeHttpCharactersLC
+        }
+    else
+        {
+        HBufC8* pPassword2 = CSaslMechanism::Password8L();
+        if(pPassword2)
+            {
+            ipPassword = pPassword2;
+            }
+        else
+            {
+            ipPassword = KNullDesC8().AllocL();
+            }
+        }
+    }
+    
+
+TBool CSenIdWsfPlainSaslMechanism::IsPasswordFromUser()
+    {
+        TBool retVal;
+
+        if (!ipAccount)
+            {
+            retVal = EFalse;
+            }
+        else
+            {
+            retVal = (ipAccount->Password() == KNullDesC8);
+            }
+
+        return retVal;
+    }
+
+void CSenIdWsfPlainSaslMechanism::ClearPasswordL()
+    {
+    if (ipAccount)
+        {
+        CSenElement& element = ipAccount->AsElement();
+        delete element.RemoveElement(KSenIdpPasswordLocalname);
+        }
+    delete ipPassword;
+    ipPassword = NULL;
+    HBufC8* pPassword = Password8L();
+    if (pPassword)
+        {
+        ipPassword = pPassword;
+        }
+    }
+
+TInt CSenIdWsfPlainSaslMechanism::MaxAttempts()
+    {
+    return 3;
+    }
+
+const TDesC8& CSenIdWsfPlainSaslMechanism::Name()
+    {
+    return KPlain();
+    }
+
+TInt CSenIdWsfPlainSaslMechanism::HandleResponseL(
+    MSenSaslMessage& /* aResponse */,
+    MSenSaslMessage& aNewRequest
+    )
+    {
+    TPtrC8 authzId = ipAccount->AuthzID();
+    TPtrC8 authnId = ipAccount->AdvisoryAuthnID();
+
+    if (authnId == KNullDesC8)
+        {
+        authnId.Set(authzId);
+        authzId.Set(KNullDesC8);
+        }
+
+    TPtrC8 password(KNullDesC8);
+
+    if(ipPassword)
+        {
+        password.Set(ipPassword->Des());
+        }
+
+    HBufC8* pSharedSecret = TransformL(password);
+    CleanupStack::PushL(pSharedSecret);
+
+    HBufC8* pData = HBufC8::NewLC(authzId.Length()
+                                + authnId.Length()
+                                + pSharedSecret->Length() + 2);
+    TPtr8 data = pData->Des();
+
+    if(authnId!=authzId)
+        {
+        data.Append(authzId); //  if authzId == authnId, leave out authzId
+        }
+
+    data.Append('\x00');    // NOTE, this zero line is a MUST,
+                            // even if no authzId was added
+    data.Append(authnId);
+    data.Append('\x00');
+    data.Append(*pSharedSecret);
+    TInt retVal = aNewRequest.ConstructRequestFromL(KPlain, *pData);
+    CleanupStack::PopAndDestroy(); // pData;
+    CleanupStack::PopAndDestroy(); // pSharedSecret
+    return retVal;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/src/senidwsfsecmechmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/idwsfsecuritymechanism/src/senidwsfsecmechproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "senidwsfanonymoussaslmechanism.h"
+#include "senidwsfplainsaslmechanism.h"
+#include "senidwsfcrammd5saslmechanism.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+const TInt32 KAnonymousSaslPluginUid = 0x101F96FD;
+const TInt32 KIdwsfPlainSaslPluginUid = 0x101F96FE;
+const TInt32 KIdwsfCrammd5SaslPluginUid = 0x101F96FF;
+
+#else
+const TInt32 KAnonymousSaslPluginUid = 0x101F9734;
+const TInt32 KIdwsfPlainSaslPluginUid = 0x101F9735;
+const TInt32 KIdwsfCrammd5SaslPluginUid = 0x101F9736;
+
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+        IMPLEMENTATION_PROXY_ENTRY(KAnonymousSaslPluginUid,  CSenIdWsfAnonymousSaslMechanism::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KIdwsfPlainSaslPluginUid,  CSenIdWsfPlainSaslMechanism::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KIdwsfCrammd5SaslPluginUid,  CSenIdWsfCrammd5SaslMechanism::NewL)
+#else
+        {{KAnonymousSaslPluginUid},  CSenIdWsfAnonymousSaslMechanism::NewL},
+        {{KIdwsfPlainSaslPluginUid},  CSenIdWsfPlainSaslMechanism::NewL},
+        {{KIdwsfCrammd5SaslPluginUid},  CSenIdWsfCrammd5SaslMechanism::NewL}
+#endif
+    };
+
+
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                        TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/inc/webservices.hrh	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+#ifndef WEBSERVICES_VARIANT_HRH
+#define WEBSERVICES_VARIANT_HRH
+
+#include <platform_paths.hrh>
+
+// Disable UHEAP mark start / end in (ws)sen.exe process main thread(!):
+#ifndef _DEBUG
+MACRO _RD_SEN_DO_NOT_USE_UHEAP_MARKING
+ #if !defined( _RD_SEN_DO_NOT_USE_UHEAP_MARKING )
+	#define _RD_SEN_DO_NOT_USE_UHEAP_MARKING 1
+ #endif 
+#endif 
+
+
+
+#if !defined( WINS )
+macro RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_HW_TARGET
+    #if !defined ( RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_ARMV5_TARGET )
+    	#define RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_ARMV5_TARGET 1
+    #endif
+#endif    
+
+macro RD_SEN_SC_MSG_DISPATCHER_ENABLED
+ #if !defined ( RD_SEN_SC_MSG_DISPATCHER_ENABLED )
+   #define RD_SEN_SC_MSG_DISPATCHER_ENABLED 1
+#endif
+
+//macro RD_SEN_SC_PROXY_ENABLED_BY_DEFAULT
+//#if !defined ( RD_SEN_SC_PROXY_ENABLED_BY_DEFAULT )
+//    #define RD_SEN_SC_PROXY_ENABLED_BY_DEFAULT 1
+//#endif
+//macro RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS
+//#if !defined ( RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS )
+//    #define RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS 1
+//#endif
+#if defined ( RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS )
+macro RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+    #if !defined ( RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS )
+        #define RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS 1
+    #endif
+#endif // 
+
+macro RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC
+#if !defined ( RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC )
+    #define RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC 1
+#endif
+
+/*
+macro RD_SEN_FORCE_LIBXML_SAX_PLUGIN_MIMETYPE
+#if !defined ( RD_SEN_FORCE_LIBXML_SAX_PLUGIN_MIMETYPE )
+	#define RD_SEN_FORCE_LIBXML_SAX_PLUGIN_MIMETYPE 1
+#endif
+*/
+/*
+macro RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES
+#if !defined ( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+	#define RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES 1
+#endif
+*/
+//macro RD_SEN_DISABLE_TRANSPORT_STATUS_CODE_CALLBACK
+//#if !defined ( RD_SEN_DISABLE_TRANSPORT_STATUS_CODE_CALLBACK )
+//	#define RD_SEN_DISABLE_TRANSPORT_STATUS_CODE_CALLBACK 1
+//#endif
+
+// By defult should be turned off for platform release. For automated testing just enable this flag 
+macro RD_SEN_DISABLE_USER_PERMISSION_DIALOGS
+#if !defined ( RD_SEN_DISABLE_USER_PERMISSION_DIALOGS )
+	#define RD_SEN_DISABLE_USER_PERMISSION_DIALOGS 1
+#endif
+
+//macro RD_SEN_USE_NEW_SYSTEM_INCLUDE_DIR_FOR_WSSTAR_XML_ENG
+//#if !defined ( RD_SEN_USE_NEW_SYSTEM_INCLUDE_DIR_FOR_WSSTAR_XML_ENG )
+//	#define RD_SEN_USE_NEW_SYSTEM_INCLUDE_DIR_FOR_WSSTAR_XML_ENG 1
+//#endif
+
+/*
+macro RD_SEN_COMPILE_SIS_PACKAGE_FILES
+#if !defined ( RD_SEN_COMPILE_SIS_PACKAGE_FILES )
+	#define RD_SEN_COMPILE_SIS_PACKAGE_FILES 1
+#endif
+*/
+// -------------------------------------
+// --- WS-* dedicated MACROS *START* ---
+// -------------------------------------
+
+// IF BELOW "do not prompt authinfo" MACRO IS DEFINED: attribute has to exist, otherwise logic defaults to: DO NOT PROMPT
+//MACRO _RD_SEN_WS_STAR_DO_NOT_PROMPT_AUTHINFO_BY_DEFAULT
+//#if !defined ( _RD_SEN_WS_STAR_DO_NOT_PROMPT_AUTHINFO_BY_DEFAULT )
+//    #define _RD_SEN_WS_STAR_DO_NOT_PROMPT_AUTHINFO_BY_DEFAULT 1
+//#endif    
+// ELSE: even when attribute does NOT exist, or when it does and has any other value but "false", default to: PROMPT
+
+//MACRO RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET
+//#if !defined( RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET )
+//	#define RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET 1
+//#endif    
+
+MACRO RD_SEN_WS_STAR_DISABLE_DICTIONARY_FETCHING
+#if !defined( RD_SEN_WS_STAR_DISABLE_DICTIONARY_FETCHING )
+	#define RD_SEN_WS_STAR_DISABLE_DICTIONARY_FETCHING 1
+#endif    
+
+// **** RD_SEN_WS_STAR__WBXML -- START --
+// * Comment OUT these lines IF NOT USING WBXML Compression(!) 
+//MACRO RD_SEN_WS_STAR__WBXML 
+//#if !defined( RD_SEN_WS_STAR__WBXML )
+//    #define RD_SEN_WS_STAR__WBXML 1
+//#endif    
+// **** RD_SEN_WS_STAR__WBXML -- END --
+
+
+// **** RD_SEN_VTCP_SUPPORT -- START --
+// * Comment OUT these lines IF NOT USING VTCP
+MACRO RD_SEN_VTCP_SUPPORT
+#if !defined(RD_SEN_VTCP_SUPPORT )
+    #define RD_SEN_VTCP_SUPPORT 1
+#endif    
+
+// * Comment OUT these lines IF NOT USING VTCP
+MACRO RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES
+#if !defined(RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES )
+    #define RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES 1
+#endif  
+
+//**** RD_SEN_VTCP_SUPPORT -- END --
+
+// -----------------------------------
+// --- WS-* dedicated MACROS *END* ---
+// -----------------------------------
+
+
+
+
+// For Enabling ALR Feature in 3.2 and above SDK
+//Note: Must Disable for other SDK
+//macro __ENABLE_ALR__ 
+//#if !defined ( __ENABLE_ALR__ )
+//	#define __ENABLE_ALR__ 1
+//#endif
+
+
+//macro __TEST_RETRY_TTL //LongLived Retry logic
+//#if !defined ( __TEST_RETRY_TTL )
+//	#define __TEST_RETRY_TTL
+//#endif
+/*
+//To build vtcp and vtcp channel transport plugin
+macro __BUILD_VTCP_
+#if !defined ( __BUILD_VTCP_ )
+	#define __BUILD_VTCP_
+#endif
+*/
+
+// To Encrypt/Decrypt the password
+// This macro will be enabled once adaptation API exposed to MW
+//macro __CRYPTO_HW__ 
+//#if !defined ( __CRYPTO_HW__ )
+//	#define __CRYPTO_HW__ 1
+//#endif
+
+//By default this macro will be enabled for TB 9.2 and more. 
+//It has to be disabled for other platforms
+macro __SINGLE_CLICK_CONNECTIVITY_ENABLED__ 
+#if !defined ( __SINGLE_CLICK_CONNECTIVITY_ENABLED__ )
+	#define __SINGLE_CLICK_CONNECTIVITY_ENABLED__ 1
+#endif
+
+
+#endif//WEBSERVICES_VARIANT_HRH
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/rom/Note_BuildImage.txt	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2 @@
+1. Copy WebServices.iby to \epoc32\rom\include path
+2. Comment all WS related iby files in S60.iby and include WebServices.iby at the same place. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/BMARM/SENSERVCONNU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	NewLC__21CSenServiceConnectionR19MSenServiceConsumerR18CSenServicePattern @ 1 NONAME R3UNUSED ; CSenServiceConnection::NewLC(MSenServiceConsumer &, CSenServicePattern &)
+	NewLC__21CSenServiceConnectionR19MSenServiceConsumerR22MSenServiceDescription @ 2 NONAME R3UNUSED ; CSenServiceConnection::NewLC(MSenServiceConsumer &, MSenServiceDescription &)
+	NewLC__21CSenServiceConnectionR19MSenServiceConsumerRC6TDesC8 @ 3 NONAME R3UNUSED ; CSenServiceConnection::NewLC(MSenServiceConsumer &, TDesC8 const &)
+	NewL__21CSenServiceConnectionR19MSenServiceConsumerR18CSenServicePattern @ 4 NONAME R3UNUSED ; CSenServiceConnection::NewL(MSenServiceConsumer &, CSenServicePattern &)
+	NewL__21CSenServiceConnectionR19MSenServiceConsumerR22MSenServiceDescription @ 5 NONAME R3UNUSED ; CSenServiceConnection::NewL(MSenServiceConsumer &, MSenServiceDescription &)
+	NewL__21CSenServiceConnectionR19MSenServiceConsumerRC6TDesC8 @ 6 NONAME R3UNUSED ; CSenServiceConnection::NewL(MSenServiceConsumer &, TDesC8 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/BWINS/SENSERVCONNU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVCSenServicePattern@@@Z @ 1 NONAME ; public: static class CSenServiceConnection * __cdecl CSenServiceConnection::NewL(class MSenServiceConsumer &,class CSenServicePattern &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVMSenServiceDescription@@@Z @ 2 NONAME ; public: static class CSenServiceConnection * __cdecl CSenServiceConnection::NewL(class MSenServiceConsumer &,class MSenServiceDescription &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@ABVTDesC8@@@Z @ 3 NONAME ; public: static class CSenServiceConnection * __cdecl CSenServiceConnection::NewL(class MSenServiceConsumer &,class TDesC8 const &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVCSenServicePattern@@@Z @ 4 NONAME ; public: static class CSenServiceConnection * __cdecl CSenServiceConnection::NewLC(class MSenServiceConsumer &,class CSenServicePattern &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVMSenServiceDescription@@@Z @ 5 NONAME ; public: static class CSenServiceConnection * __cdecl CSenServiceConnection::NewLC(class MSenServiceConsumer &,class MSenServiceDescription &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@ABVTDesC8@@@Z @ 6 NONAME ; public: static class CSenServiceConnection * __cdecl CSenServiceConnection::NewLC(class MSenServiceConsumer &,class TDesC8 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/BWINSCW/SENSERVCONNU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,13 @@
+EXPORTS
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVCSenServicePattern@@@Z @ 1 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewL(class MSenServiceConsumer &, class CSenServicePattern &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVMSenServiceDescription@@@Z @ 2 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewL(class MSenServiceConsumer &, class MSenServiceDescription &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@ABVTDesC8@@@Z @ 3 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewL(class MSenServiceConsumer &, class TDesC8 const &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVCSenServicePattern@@@Z @ 4 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewLC(class MSenServiceConsumer &, class CSenServicePattern &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVMSenServiceDescription@@@Z @ 5 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewLC(class MSenServiceConsumer &, class MSenServiceDescription &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@ABVTDesC8@@@Z @ 6 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewLC(class MSenServiceConsumer &, class TDesC8 const &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVCSenServicePattern@@AAVMSenExtendedConsumerInterface@@@Z @ 7 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewL(class MSenServiceConsumer &, class CSenServicePattern &, class MSenExtendedConsumerInterface &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVMSenServiceDescription@@AAVMSenExtendedConsumerInterface@@@Z @ 8 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewL(class MSenServiceConsumer &, class MSenServiceDescription &, class MSenExtendedConsumerInterface &)
+	?NewL@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@ABVTDesC8@@AAVMSenExtendedConsumerInterface@@@Z @ 9 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewL(class MSenServiceConsumer &, class TDesC8 const &, class MSenExtendedConsumerInterface &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVCSenServicePattern@@AAVMSenExtendedConsumerInterface@@@Z @ 10 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewLC(class MSenServiceConsumer &, class CSenServicePattern &, class MSenExtendedConsumerInterface &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@AAVMSenServiceDescription@@AAVMSenExtendedConsumerInterface@@@Z @ 11 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewLC(class MSenServiceConsumer &, class MSenServiceDescription &, class MSenExtendedConsumerInterface &)
+	?NewLC@CSenServiceConnection@@SAPAV1@AAVMSenServiceConsumer@@ABVTDesC8@@AAVMSenExtendedConsumerInterface@@@Z @ 12 NONAME ; class CSenServiceConnection * CSenServiceConnection::NewLC(class MSenServiceConsumer &, class TDesC8 const &, class MSenExtendedConsumerInterface &)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/eabi/SENSERVCONNu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,15 @@
+EXPORTS
+	_ZN21CSenServiceConnection4NewLER19MSenServiceConsumerR18CSenServicePattern @ 1 NONAME
+	_ZN21CSenServiceConnection4NewLER19MSenServiceConsumerR22MSenServiceDescription @ 2 NONAME
+	_ZN21CSenServiceConnection4NewLER19MSenServiceConsumerRK6TDesC8 @ 3 NONAME
+	_ZN21CSenServiceConnection5NewLCER19MSenServiceConsumerR18CSenServicePattern @ 4 NONAME
+	_ZN21CSenServiceConnection5NewLCER19MSenServiceConsumerR22MSenServiceDescription @ 5 NONAME
+	_ZN21CSenServiceConnection5NewLCER19MSenServiceConsumerRK6TDesC8 @ 6 NONAME
+	_ZTI25CSenServiceConnectionImpl @ 7 NONAME ; #<TI>#
+	_ZTV25CSenServiceConnectionImpl @ 8 NONAME ; #<VT>#
+	_ZN21CSenServiceConnection4NewLER19MSenServiceConsumerR18CSenServicePatternR29MSenExtendedConsumerInterface @ 9 NONAME
+	_ZN21CSenServiceConnection4NewLER19MSenServiceConsumerR22MSenServiceDescriptionR29MSenExtendedConsumerInterface @ 10 NONAME
+	_ZN21CSenServiceConnection4NewLER19MSenServiceConsumerRK6TDesC8R29MSenExtendedConsumerInterface @ 11 NONAME
+	_ZN21CSenServiceConnection5NewLCER19MSenServiceConsumerR18CSenServicePatternR29MSenExtendedConsumerInterface @ 12 NONAME
+	_ZN21CSenServiceConnection5NewLCER19MSenServiceConsumerR22MSenServiceDescriptionR29MSenExtendedConsumerInterface @ 13 NONAME
+	_ZN21CSenServiceConnection5NewLCER19MSenServiceConsumerRK6TDesC8R29MSenExtendedConsumerInterface @ 14 NONAME
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsconnection    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsconnection.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsconnection.iby)
+PRJ_MMPFILES
+senserviceconnection.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/group/senserviceconnection.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senserviceconnection    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenServConn.dll
+  #ifdef RD_SEN_USE_CLASHING_UIDS_FOR_TESTING
+    // UID 0x101F9707 is reserved for legacy (S60 3.0) PasswordTransforms ECOM interface!!
+    UID             0x1000008d 0x101F9707
+  #else
+    // This is the "new" ROM UID
+    UID             0x1000008d 0x101F9700
+  #endif  
+#else
+TARGET          wsservconn.dll
+  // This is the new RAM (.SIS target) UID:
+  UID             0x1000008d 0x101F9737
+#endif
+
+#ifdef EKA2
+    #if defined ( RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_ARMV5_TARGET )
+		// use WSD only in hardware builds, since in emulator environment, only a single process can use WSD(!)
+		    EPOCALLOWDLLDATA
+	#endif // _WINS 
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_CLIENT_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_CLIENT_DLL
+    #endif
+#endif
+
+
+
+SOURCEPATH      ../src
+SOURCE          senserviceconnectionimpl.cpp
+SOURCE          rsenserviceconnection.cpp
+SOURCE          senserviceconnectiondll.cpp
+SOURCE          senservicedispatcher.cpp
+SOURCE          senregistrationtimer.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc // SenDebug.h - filelogging macros
+USERINCLUDE     ../../wscore/inc  // SenServiceManagerDefines.h  - IPC enumerations
+USERINCLUDE     ../../wsmessages/inc
+USERINCLUDE     ../../wslogger/inc // SenLogger.h - filelogging macros
+USERINCLUDE 		../../wsxml/inc								//senxmldebug.h
+USERINCLUDE     ../../wsconnectionagent/inc
+
+//USERINCLUDE     ../../ServiceDescription/inc  // SD headers now system included
+//USERINCLUDE     ../../XML/inc          // SenXmlUtils.h  is now system included
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+// System libs:
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libs:
+LIBRARY         wsconnagent.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenFragment.lib // CSenParser
+LIBRARY         SenMessages.lib
+LIBRARY         SenXml.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenLogger.lib    // for TLS based file logging
+#else
+LIBRARY         senconnagent.lib
+LIBRARY         wsServDesc.lib
+LIBRARY         wsFragment.lib // CSenParser
+LIBRARY         wsMessages.lib
+LIBRARY         wsXml.lib
+LIBRARY         wsUtils.lib
+LIBRARY         wsLogger.lib    // for TLS based file logging
+#endif
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+    LIBRARY         XmlEngineSerializer.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineSerializer.lib
+#endif
+
+LANG        SC
+#if defined(ARMCC)
+  DEFFILE ../eabi/SENSERVCONN.DEF
+#elif defined(WINSCW)
+  DEFFILE ../BWINSCW/SENSERVCONN.DEF
+#elif defined(WINS)
+  DEFFILE ../BWINS/SENSERVCONN.DEF
+#else 
+  DEFFILE ../BMARM/SENSERVCONN.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/inc/rsenserviceconnection.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef R_SEN_SERVICE_CONNECTION_H
+#define R_SEN_SERVICE_CONNECTION_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include "senchunk.h"
+#include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations
+#include "SenServiceConnection.h" 
+
+// FORWARD DECLARE
+class CSenSoapEnvelope;
+class CSenChunk;
+class RFile;
+class RSenServiceConnection;
+#ifdef __ENABLE_ALR__
+class MMobilityProtocolResp;
+#endif
+
+class TFourInts
+    {
+    public:
+    	TInt iInt1;
+    	TInt iInt2;
+    	TInt iInt3;
+    	TInt iInt4;
+	};
+
+NONSHARABLE_CLASS(CSenProgressResourceHandler): private CActive
+    {
+    friend class RSenServiceConnection;
+    private:
+    CSenProgressResourceHandler(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+            TInt aProgress, RSenServiceConnection* aOwner);
+    ~CSenProgressResourceHandler();
+    void DoCancel();
+    void RunL();
+    TInt SetBuffer(const TDesC8& aSoapOrCid);
+    
+    private:
+    TPckgBuf<TTransferProgress> iProgressData;
+    HBufC8* iSoapOrCid;
+    RSenServiceConnection* iOwner;
+    CSenProgressResourceHandler* iNext;
+    CSenProgressResourceHandler* iPrevious;
+    };
+
+NONSHARABLE_CLASS(CSenConnAgentSync): public CActive
+    {
+    friend class RSenServiceConnection;
+private:
+    CSenConnAgentSync();
+    ~CSenConnAgentSync();
+    void DoCancel();
+    void RunL();
+    void Start();
+    };
+
+// CLASS DECLARATION
+class RSenServiceConnection : public RSessionBase
+    {
+public:
+        /**
+        * C++ default constructor.
+        */
+        RSenServiceConnection(RFileLogger* aLog);
+        
+        // New functions
+        TInt Connect();
+        TVersion Version() const;
+        void Initialize( TRequestStatus& aStatus, 
+        				 TDes8& aErrPtr, 
+        				 TDes& aSessionId, 
+        				 CSenChunk& aSenChunk,
+                         TInt aSdLength,
+                         TInt aCpLength,
+                         TBool aHasAuthenticationCallback );
+
+
+        /**
+        * Transaction method is asynchronous
+        * 
+        * @param aStatus is the AO's status
+        * @param aErrPtr is where error will be written by server
+        * @param aTxnPtr is where transaction ID received from 
+        * transport (in the server-side) will be written by server
+        * @param aChunk is reference to new chunk, which will be opened
+        * RChunk (S60 3rd Edition) or RFile (S60 2nd Edition)
+        * @param aChunkName defines the global name for new RChunk (S60 2nd edition)
+        * @param aRequest is the message copied into RChunk
+        * @return KErrNone or system-wide error code. Note that if
+        * an error is returned, then SendReceive has not been called
+        * and caller (SC implementation class) does not need to call 
+        * SetActive()
+        */
+        void Transaction(TRequestStatus& aStatus, 
+                         TDes8& aErrPtr, 
+                         TDes8& aTxnPtr, 
+                         CSenChunk& aClientOp);
+
+        TInt SendMsgAndReceiveTxnId(CSenChunk& aClientOp);
+
+        TInt IsReady(TBool& aReady);
+        TInt HasFacet(TDesC8& aUri, TBool& aHasFacet);
+        TInt CompleteServerMessagesOnOff( TBool& aOnOff );
+        void SetLog(RFileLogger* aLog);
+        TInt RequestServiceDescription(TDes8& aSdLength);
+        TInt ReceiveServiceDescription(TDes8& aServiceDescription);
+        TInt StartTransaction();
+        TInt TransactionCompleted();
+        void CancelSession(TRequestStatus& aStatus);
+        void CancelRequests(TRequestStatus& aStatus);
+        void CancelRequest(TInt aTransactionID);
+   	    void DataTrafficDetails(TSenDataTrafficDetails& aDetails,TSenDataTrafficOperations& aOperation);  
+        TInt SetTransportPropertiesL(CSenChunk& aSenChunk);
+        TInt TransportPropertiesL(CSenChunk& aSenChunk);        
+
+        TInt MoveFile(CSenChunk& aSenChunk, 
+                      const TDesC8& aCid, 
+                      RFile& aFile);
+
+        TInt SendFileHandle(CSenChunk& aSenChunk, 
+                      		RFile& aFile);
+        TInt MoveChunk(CSenChunk& aSenChunk, 
+                       const TDesC8& aCid, 
+                       RChunk& aChunk,
+                       TInt aDataOffset, 
+                       TInt aDataSize);
+                       
+        TInt ConnectionID();
+        
+        TInt IdentityProviderL(CSenChunk& aSenChunk);
+        TInt RegisterIdentityProvider(TDesC8& aMessage);
+        void SetChannel(TInt aChannel);
+        
+        TInt RegisterTransferObserver(const TDesC* aServerName, TAny* aConnection);
+        // @return KErrNoMemory if out of heap
+        TInt SendFileProgress( TInt aTxnId, TBool aIncoming,TBool aIsSoap,
+                               const TDesC8& aSoapOrCid, TInt aProgress );
+        void Remove(CSenProgressResourceHandler* aResourceHandler);
+        void Close();
+        
+        TInt SearchIdentityProviderL(CSenChunk& aSenChunk, const TDesC8& aProviderId);
+        TInt RegisterAuthenticationObserver(const TDesC* aServerName, TAny* aConnection);
+        TInt RegisterCoBrandingObserver(const TDesC* aServerName, TAny* aConnection);
+#ifdef __ENABLE_ALR__
+	    TInt RegisterMobilityObserverL(const TDesC* aServerName, TAny* aConnection) ;
+	    TInt MigrateToPrefferedCarrierL(TBool &aUserChoice) ;
+	    TInt NewCarrierAcceptedL(TBool &aUserChoice) ;
+#endif
+
+    private: // Helper functions
+        RFileLogger* Log() const;
+
+    private: // Data
+        TInt                iMessageContextId; // locally (in SC scope) unique message context ID counter
+        RFileLogger*        iLog;
+        TPckgBuf<TFourInts> iFourInts;
+        CSenProgressResourceHandler* iFirst;
+        TInt                iTLSLogChannel;
+    };
+    
+#endif //R_SEN_SERVICE_CONNECTION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/inc/seninternalserviceconnectioninterfaces.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     In case that Service Consumer (owner of SC instance) needs
+*                some special, even properietary interface, it can request
+*                an implementation of such interface by calling
+*                CSenServiceConnection::InterfaceByUid(UID) and acquire
+*                on of the M-class interfaces defined in this file.    
+*
+*/
+
+
+
+
+#ifndef M_SEN_INTERNAL_SERVICE_CONNNECTION_INTERFACES_H
+#define M_SEN_INTERNAL_SERVICE_CONNNECTION_INTERFACES_H
+
+// CONST
+// UIDs for the supported, new *service connection interfaces*:
+const TUid KSenInterfaceUidInternalServiceConnection = { 0xE760F698 }; // MSenInternalServiceConnection
+
+// CLASS DECLARATION
+/**
+ * Callback interface for service consumers
+ */
+class MSenInternalServiceConnection
+    {
+    public: 
+        virtual TInt PendingTrasanctionsCount() = 0;
+        /**
+        * Sends information about BLOB transfer progres to hostlet.
+        *
+        * @param aTxnId Transaction ID.
+        * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
+        * @param aMessage SOAP message for incoming messages with BLOBs.
+        * @param aCid CID of current BLOB.
+        * @param aProgress Count of sent/received BLOB bytes.
+        */
+        virtual TInt SendProgressToHostlet( TInt aTxnId, 
+                                            TBool aIncoming,
+                                            const TDesC8& aMessage, 
+                                            const TDesC8& aCid, 
+                                            TInt aProgress ) = 0;
+        
+    };
+   
+#endif //  M_SEN_INTERNAL_SERVICE_CONNNECTION_INTERFACES_H   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/inc/senregistrationtimer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Registration Timer class declaration     
+*
+*/
+
+
+
+
+#ifndef SEN_REGISTRATION_TIMER
+#define SEN_REGISTRATION_TIMER
+
+// INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+const TInt KSenDefaultRegistrationTimeout = 1; // 1 second
+
+// CLASS DECLARATION
+
+#ifdef EKA2
+NONSHARABLE_CLASS( MSenRegistrationActor )
+#else
+class MSenRegistrationActor
+#endif
+    {
+    public:
+        // Registers the files observer (connection agent) and/or RProperty subscription for (file) progress (BLOB) info
+        virtual TInt RegisterAndSubscribeFileProgressObserversL() = 0;
+    };
+
+
+#ifdef EKA2
+//NONSHARABLE_CLASS(CSenRegistrationTimer) : public CTimer
+NONSHARABLE_CLASS( CSenRegistrationTimer ) : public CActive
+#else
+//class CSenRegistrationTimer : public CTimer
+class CSenRegistrationTimer : public CActive
+#endif
+    {
+    public:
+        static CSenRegistrationTimer* NewL( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs = KSenDefaultRegistrationTimeout );
+        static CSenRegistrationTimer* NewLC( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs = KSenDefaultRegistrationTimeout );
+            
+        ~CSenRegistrationTimer();
+
+        /**
+        * Calling this method will activate the registration, that will happen N seconds.
+        */
+        void IssueRegistrations( TBool aRegisterFilesObserver = ETrue );
+
+        virtual void RunL();
+        void DoCancel();
+
+        //virtual TInt RunError(TInt aError);
+    
+    private:
+        CSenRegistrationTimer( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs );
+        void ConstructL();
+        
+    private: // Data:
+		MSenRegistrationActor& iActor;
+        TInt iRegistrationTimeoutInSecs;		
+		RTimer iTimer;
+		// Registration flags
+		TBool iRegisterFilesObserver;
+    };
+
+#endif // SEN_REGISTRATION_TIMER
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/inc/senserviceconnectionimpl.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,636 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Custom plug-in implementations offer their own API documentation
+*                where detailed characteristics about how methods declared in this
+*                class are implemented.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_CONNECTION_IMPL_H
+#define SEN_SERVICE_CONNECTION_IMPL_H
+
+// INCLUDES
+#include <flogger.h>
+#include <e32property.h>
+
+#include "sendebug.h"
+
+#include "SenServiceConnection.h"
+#ifdef __ENABLE_ALR__
+	#include "senserviceconnectioninterfaces.h"
+#endif //__ENABLE_ALR__
+#include "seninternalserviceconnectioninterfaces.h"
+
+#include "MSenServiceDescription.h"
+#include "rsenserviceconnection.h"
+#include "senpointermap.h"
+#include "SenHttpTransportProperties.h"
+
+#include "msencobrandinginterface.h"
+
+#include "senservicedispatcher.h"
+#include "senregistrationtimer.h"
+
+// CONSTANTS
+_LIT8(KServiceConnectionElementLocalName, "ServiceConnection");
+
+// FORWARD DECLARATIONS
+class CSenConnectionChunk;
+class CSenAsyncOperation;
+class CSenConnectionStatusObserver;
+class CSenFileProgressObserver;
+class CSenBinaryContainer;
+class RProperty;
+
+// TYPEDEFS
+typedef RSenPointerMap<TInt, CSenConnectionChunk> RChunkMap;
+typedef RSenPointerMap<TDesC8, CSenBinaryContainer> RBinaryMap;
+typedef RArray<TXmlEngDataContainer> RDataContainerArray;
+typedef RSenPointerMap<TInt, RDataContainerArray> RDataContainerMap;
+
+// CLASS DECLARATION
+
+/**
+* Custom plug-in implementations offer their own API documentation
+* where detailed characteristics about how methods declared in this
+* class are implemented.
+*/
+#ifdef __ENABLE_ALR__
+	class CSenServiceConnectionImpl : public CSenServiceConnection, MSenInternalServiceConnection, MSenAlrServiceConnection, MSenRegistrationActor
+#else
+	class CSenServiceConnectionImpl : public CSenServiceConnection, MSenInternalServiceConnection, MSenRegistrationActor
+#endif //__ENABLE_ALR__
+    {
+        friend class CSenAsyncOperation;
+        friend class CSenUnderTakerWaiter;        
+    public:
+
+        // Constructors and destructor:
+        static CSenServiceConnectionImpl* NewL(MSenServiceConsumer& aObserver,
+                                                const TDesC8& aUri);
+
+        static CSenServiceConnectionImpl* NewLC(MSenServiceConsumer& aObserver,
+                                                const TDesC8& aUri);
+
+        static CSenServiceConnectionImpl* NewL(MSenServiceConsumer& aObserver,
+                                    MSenServiceDescription& aServiceDescription);
+
+        static CSenServiceConnectionImpl* NewLC(MSenServiceConsumer& aObserver,
+                                    MSenServiceDescription& aServiceDescription);
+
+        static CSenServiceConnectionImpl* NewL(MSenServiceConsumer& aObserver,
+                                    CSenServicePattern& aServicePattern);
+
+        static CSenServiceConnectionImpl* NewLC(MSenServiceConsumer& aObserver,
+                                    CSenServicePattern& aServicePattern);
+
+		static CSenServiceConnectionImpl* NewL(MSenServiceConsumer& aConsumer,
+                                               const TDesC8& aContract,
+                                               MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        static CSenServiceConnectionImpl* NewLC(MSenServiceConsumer& aConsumer,
+                                                const TDesC8& aContract,
+                                                MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        static CSenServiceConnectionImpl* NewL(MSenServiceConsumer& aConsumer,
+                                               MSenServiceDescription& aServiceDescription,
+                                               MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        static CSenServiceConnectionImpl* NewLC(MSenServiceConsumer& aConsumer,
+                                                MSenServiceDescription& aServiceDescription,
+                                                MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        static CSenServiceConnectionImpl* NewL(MSenServiceConsumer& aConsumer,
+                                               CSenServicePattern& aServicePattern,
+                                               MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        static CSenServiceConnectionImpl* NewLC(MSenServiceConsumer& aConsumer,
+                                                CSenServicePattern& aServicePattern,
+                                                MSenExtendedConsumerInterface& aExtendedConsumer);
+        // Opens connection to WSF Symbian Server
+        void ConnectL();  
+        
+        void SetConsumer( MSenServiceConsumer& aConsumer, MSenExtendedConsumerInterface* apExtConsumer = NULL );
+        void Consumer( MSenServiceConsumer*& aConsumer, MSenExtendedConsumerInterface*& apExtConsumer );
+
+        virtual ~CSenServiceConnectionImpl();
+
+        // New functions:
+        virtual TInt SendL(const TDesC8& aRequest);
+        virtual TInt SubmitL(const TDesC8& aRequest, HBufC8*& aResponse);
+        virtual TInt CompleteServerMessagesOnOff(const TBool& aCompleteOnOff);
+        virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet);
+        virtual TInt IsReady(TBool& aReady);
+        virtual TInt SendL(RFile& aFile);
+        virtual TInt SubmitL(RFile& aFileHandle, HBufC8*& aResponse);
+//        virtual TBool IsServChunkSlotAvailable();
+        virtual TInt SendL(CSenSoapEnvelope& aMessage);
+        virtual TInt SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo);
+
+        virtual TInt ServiceDescriptionL(HBufC8*& aServiceDescription);
+        virtual TInt StartTransaction();
+        virtual TInt TransactionCompleted();
+        virtual TInt CancelAllRequests();
+
+        virtual void WriteStartElementL( const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes);
+
+        virtual void WriteEndElementL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName);
+
+        virtual const TDesC8& LocalName() const;
+        virtual const TDesC8& NsUri() const;
+        virtual const TDesC8& NsPrefix() const;
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+        virtual HBufC* AsXmlUnicodeL();
+        virtual HBufC8* AsXmlL();
+        virtual TBool ConsistsOfL(MSenFragment& aCandidate);
+
+        // Functions from base classes
+
+        // from MSenFragment
+        /**
+        * @return the current object as element.
+        *          Retains ownership.
+        */
+        virtual CSenElement& AsElement();
+
+        /**
+        * @return the current object as element. May return NULL.
+        *          Caller takes ownership.
+        */
+        virtual CSenElement* ExtractElement();
+
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual CSenXmlReader* Reader();
+
+        /**
+        * SetReader() must be called before this method can be used.
+        */
+        virtual void ParseL(const TDesC8& aBuf);
+
+        /**
+        * Same as ParseL() except that it takes 16-bit input and does silently
+        * fail in case of all errors.
+        * SetReader() must be called before this method can be used.
+        * @return error code, if any.
+        */
+        virtual TInt BuildFrom(const TDesC8& aBuf);
+
+        /**
+        * Let the delegate CSenFragment handle with SAX events.
+        * "this" CSenFragment is made the owner of the delegate and
+        * the delegate is expected to make this CSenFragment the receiver
+        * of SAX events once it has seen the end element for itself.
+        */
+        virtual void DelegateParsingL(MSenFragment& aDelegate);
+
+        /**
+        * Let a new CSenFragment for a new CSenBaseElement with the given
+        * namespace and name handle SAX events. The new MSenElement is made
+        * a child of the MSenElement of this CSenFragment.
+        */
+        virtual void DelegateParsingL(  const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttributes);
+
+        virtual void ParseWithL(CSenXmlReader& aReader);
+        virtual void SetOwner(MSenFragment& aFragment);
+        virtual void ResumeParsingFromL( const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName );
+
+        virtual void SetAttributesL(const RAttributeArray& aAttributes);
+        virtual TInt TxnId();
+        virtual MSenMessage* Response();
+        virtual TInt CancelTransaction(TInt aTransactionID);
+        virtual TInt SetTransportPropertiesL(const TDesC8& aProperties);
+        virtual TInt TransportPropertiesL(HBufC8*& aProperties);
+        virtual TInt SendL(const TDesC8& aRequest, const TDesC8& aProperties);
+        virtual TInt SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties);
+        virtual TInt SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo);
+        virtual TInt SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse);
+        virtual TInt AssignMessageToChunkL(CSenChunk& aChunk, MSenMessage& aMessage);	//codescannerwarnings
+        virtual TInt SendL(MSenMessage& aMessage);
+        virtual TInt SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo);
+        virtual TInt IdentityProviderL(CSenIdentityProvider*& apIdentityProvider);
+        virtual TInt Identifier();
+		
+				virtual void DataTrafficDetails( TSenDataTrafficDetails& aDetails,
+										 TSenDataTrafficOperations& aOperations );
+										 
+
+
+#ifdef __ENABLE_ALR__
+    	virtual void MigrateToPrefferedCarrierL(TBool &aUserChoice) ;
+			virtual void NewCarrierAcceptedL(TBool &aUserChoice) ;		
+#endif
+      virtual TInt PendingTrasanctionsCount();
+      
+      // From MSenInternalServiceConnection
+			/**
+        * Sends information about BLOB transfer progres to hostlet.
+        *
+        * @param aTxnId Transaction ID.
+        * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
+        * @param aMessage SOAP message for incoming messages with BLOBs.
+        * @param aCid CID of current BLOB.
+        * @param aProgress Count of sent/received BLOB bytes.
+        */
+        virtual TInt SendProgressToHostlet(TInt aTxnId, TBool aIncoming, const TDesC8& aMessage, const TDesC8& aCid, TInt aProgress);
+        
+        TPtrC8 InitDescription();
+        
+    protected: // Functions from base classes
+
+        // from CActive
+        void RunL();
+        void DoCancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceConnectionImpl(MSenServiceConsumer& aObserver,
+                                  MSenExtendedConsumerInterface* aExtendedConsumerInteface);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(MSenServiceDescription& aPattern);
+
+        // New functions
+        TInt SendL(CSenSoapEnvelope2& aMessage);
+
+        TInt SubmitL(CSenSoapEnvelope2& aMessage, CSenSoapEnvelope2*& aResponseTo);
+
+
+        TInt SendL(CSenConnectionChunk* aClientOp);
+
+        TInt SubmitL(CSenConnectionChunk& aClientOp);
+
+        TInt ResponseFromChunk(CSenChunk& aClientOp, HBufC8*& aResponseTo);
+
+        TInt SubmitL(CSenConnectionChunk& aClientOp, CSenSoapEnvelope2*& aResponseTo);
+
+        TInt CheckConnection();
+
+        void InitializeL( /*MSenServiceDescription& aPattern */ );
+
+        void DeliverResponseL(const TInt aErrorCode, CSenChunk* apOperation = NULL);
+
+        RChunkMap& ChunkMapL();
+
+        TPtrC SessionID();
+
+        TPtrC NextChunkName();
+
+        RPointerArray<CSenAsyncOperation>& AsyncOpsArrayL();	//codescannerwarnings
+
+        void HandleMessageFromChildAOL(TInt aStatus);
+
+        TInt AssignPropertiesToChunkL(CSenChunk& aChunk, CSenSoapEnvelope& aMessage,
+                                     const TDesC8& aProperties = KNullDesC8);	////codescannerwarnings
+
+        TInt MoveBinaryContainersToServer(CSenConnectionChunk& aOperation,
+                                          RArray<TXmlEngDataContainer>& aList);
+		TInt MoveFileChunkHandleToServer(CSenConnectionChunk& aOperation);
+
+
+        RFileLogger* Log() const;
+
+        void DeliverStatus(TInt aStatus);
+
+        /*
+        * Method gets the Http method from the transport properties
+        * @param aProperties contains the transport properties in serialized (UTF-8) form.
+        * @param aMethod A TSenHttpMethod reference to be filled in with
+        *                    the value of the Http method.
+        * @return KErrNone if successful or otherwise some system-wide error code.
+        * KErrNotFound if Http method is not found
+        */
+        TInt HttpMethodFromPropertiesL( const TDesC8& aProperties,
+                                        CSenHttpTransportProperties::TSenHttpMethod& aMethod );
+
+		TInt SearchIdentityProviderL(CSenIdentityProvider*& aSenChunk, const TDesC8& aProviderId);
+        TInt RegisterAuthenticationObserver();
+        TBool HasConnectionAgentCallbackInitialized();
+        TInt ReauthNeededL(const TDesC8& aProviderId);
+		TInt RegisterFilesObserver();
+        const TThreadId OwnerThreadId() const;
+        TInt RegisterCoBrandingObserver();
+        
+        TInt RegisterAndSubscribeFileProgressObserversL();
+        
+        virtual TAny* InterfaceByUid( TUid aUID );
+        
+        
+#ifdef __ENABLE_ALR__
+	TInt RegisterMobilityObserverL() ;
+#endif
+
+    private: // Data
+        RFileLogger                         iLog;
+        RSenServiceConnection               iConnection;    // owned
+        MSenServiceConsumer*                iObserver;      // not owned
+        HBufC8*                             iInBuf;         // owned
+        TPtr8                               iInBuffer;
+        HBufC8*                             iOutBuf;        // owned
+        TPtr8                               iOutBuffer;
+        TBool                               iInitialized;
+        CSenBaseFragment*                   iFragment;
+        TInt                                iResponseLength;
+        TInt                                iErrorNumber;
+        TPtr8                               iErrorNumberBuffer;
+        TInt                                iTxnId;
+        TPtr8                               iTxnIdBuffer;
+
+        RChunkMap*                          iChunkMap;
+
+        HBufC*                              ipSessionId;
+        TPtr                                iSessionIdBuffer;
+        TInt                                iChunkNameNumber;
+        HBufC*                              ipChunkName;
+
+        TBool                               iTransactionIdKnown;
+        TUint                               iAsyncOpsCount;
+        RPointerArray<CSenAsyncOperation>*  iAsyncOpsArray;
+
+        MSenMessage*                        iResponse;
+
+        CSenChunk*                          ipInitChunk; // owned
+        TBool*                              ipCompleteServerMsgsOnOff; // owned
+
+        CSenConnectionStatusObserver*       ipConnectionStatusObserver; // owned
+        CSenFileProgressObserver*			ipFileProgressObserver;     // owned
+
+        TInt                                iConnectionID;
+        MSenFilesObserver*                  iFilesObserver;	// connectionagent observer
+        //TInt                                iTlsLogChannel;
+        TInt                                iTlsLogStatusChannel;
+
+        HBufC8*                             ipInitPatternAsXml;
+        HBufC8*                             ipInitConsumerPolicyAsXml;
+        MSenAuthenticationProvider*         ipAuthProvider; // connectionagent observer
+        TBool								iConnectionAgentCallbackInitialized;
+        TBool								iRegisterFileObserverDone;
+        TBool							    iRegisterMobilityObserverDone;
+    	TBool								iRegisterAuthObserverDone;
+    	TBool								iRegisterCoBrandingObserverDone;
+        TBool								iReauthenticationNeeded;
+        MSenCoBrandingObserver*             ipCoBrandingObserver;
+        MSenHostletConsumer*                ipHostletConsumer;
+        MSenExtendedConsumerInterface*      ipExtendedConsumerInterface; // connectionagent observer
+        TAny*                               ipInterface;
+#ifdef __ENABLE_ALR__
+        MMobilityProtocolResp *				iMobiltyObserver;
+		TBool                               iMobiltyCallBackReceived;
+#endif
+        TBool 								iCancelSession;
+        TBool 								iIsInternalSC;
+    
+        TThreadId                           iOwnerThreadId;
+        CSenServiceDispatcher*              ipSenServiceDispatcher;
+        CSenUnderTakerWaiter*               ipSenUnderTakerWaiter;
+        TInt                                iVirtualTransactionCounter;
+        TBool 								iDispatcherEnabled;
+        CSenRegistrationTimer*              ipRegistrationTimer;
+        RFile 								iSharedFileHandle ;		
+    };
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenAsyncOperation) : public CActive
+#else
+class CSenAsyncOperation : public CActive
+#endif
+    {
+    public: // Constructors and destructor
+        static CSenAsyncOperation* NewL(CSenServiceConnectionImpl* aActive);
+        static CSenAsyncOperation* NewLC(CSenServiceConnectionImpl* aActive);
+        virtual ~CSenAsyncOperation();
+
+    protected: // Functions from base classes
+        // from CActive
+        void RunL();
+        void DoCancel();
+       /* TInt RunError(TInt aError); */
+
+
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        CSenAsyncOperation(CSenServiceConnectionImpl* iActive);
+
+    public: // Data
+        CSenServiceConnectionImpl* iActive;
+        TInt    iErrorNumber;
+        TPtr8   iErrorNumberBuffer;
+        TInt    iTxnId;
+        TPtr8   iTxnIdBuffer;
+		TInt	iReauthTxnId; // This is used to find connection chunk in the reauthentication loop
+    };
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenConnectionStatusObserver) : public CActive
+#else
+class CSenConnectionStatusObserver : public CActive
+#endif
+    {
+    public:
+        static CSenConnectionStatusObserver* NewL(MSenServiceConsumer& aObserver,
+                                                  TInt aConnectionID);
+        static CSenConnectionStatusObserver* NewLC(MSenServiceConsumer& aObserver,
+                                                   TInt aConnectionID);
+        ~CSenConnectionStatusObserver();
+
+    private:
+        CSenConnectionStatusObserver(MSenServiceConsumer& aObserver,
+                                     TInt aConnectionID);
+        void ConstructL();
+        void RunL();
+        void DoCancel();
+
+    private:
+        RProperty                   iConnectionStatusProperty;
+        MSenServiceConsumer*        iObserver;                  // not owned
+        TInt                        iConnectionID;
+    };
+    
+    
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenFileProgressObserver) : public CActive
+#else
+class CSenFileProgressObserver : public CActive
+#endif
+    {
+    public:
+        static CSenFileProgressObserver* NewL( MSenFilesObserver& aObserver,
+                                               TInt aConnectionID,
+                                               TBool aIsDispatcherEnabled,
+                                               CSenServiceDispatcher* apSenServiceDispatcher, 
+                                               RChunkMap& aChunkMap );
+
+        static CSenFileProgressObserver* NewLC( MSenFilesObserver& aObserver,
+                                                TInt aConnectionID,
+                                                TBool aIsDispatcherEnabled,
+                                                CSenServiceDispatcher* apSenServiceDispatcher, 
+                                                RChunkMap& aChunkMap );
+        ~CSenFileProgressObserver();
+
+    private:
+        CSenFileProgressObserver( MSenFilesObserver& aObserver,
+                                  TInt aConnectionID,
+                                  TBool aIsDispatcherEnabled,
+                                  CSenServiceDispatcher* apSenServiceDispatcher, 
+                                  RChunkMap& aChunkMap );
+        void ConstructL();
+         /*
+        * Method update the consumer about the file progress transfer info
+        */
+        void RunL();
+        void DoCancel();
+        TInt RunError(TInt aError);
+
+    private:
+        RProperty                   iFileProgressProperty;
+        MSenFilesObserver*        	iFileProgressObserver;        // not owned
+        TInt                        iConnectionID;
+        TBool                       iIsDispatcherEnabled;
+        CSenServiceDispatcher*      ipSenServiceDispatcher;
+        RChunkMap&                  iChunkMap;
+    };    
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenBinaryContainer) : public CBase
+#else
+class CSenBinaryContainer : public CBase
+#endif
+    {
+    public:
+    
+    
+        enum TDataType
+            {
+            EFile     = 0,
+            EChunk      = 1,
+            ENumberOfTypes = 2
+            };
+
+        // Constructors and destructor
+        static CSenBinaryContainer* NewL( const TDesC8& aCid, RFile aFile );
+        static CSenBinaryContainer* NewLC( const TDesC8& aCid, RFile aFile );
+
+        static CSenBinaryContainer* NewL( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset );
+        static CSenBinaryContainer* NewLC( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset  );
+
+        TBool IsFile() const;  // checks iType (TDataType)
+        TBool IsChunk() const; // checks iType (TDataType)
+        TDataType Type() const;
+        
+        TPtrC8 Cid() const;
+        const HBufC8* CidPtr() const;
+        RFile File() const;
+        RChunk Chunk() const;
+        TInt ChunkSize() const;
+        TInt ChunkOffset() const;
+
+        ~CSenBinaryContainer();
+
+    private:
+        void ConstructL( const TDesC8& aCid, RFile aFile );
+        void ConstructL( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset );
+
+        CSenBinaryContainer( TDataType aType );
+        
+
+    private: // Data
+        // "a temporary fix" for issue 21  => in reality, A MAP IS NEEDED (cid, <handle>)  in here (or ipDataContainerArray needs to hold a copy!)
+        TDataType                     iType;
+        HBufC8* 					  ipCid;
+        RFile				   		  iFile;
+        RChunk				   		  iChunk;
+        TInt                          iChunkSize;
+        TInt                          iChunkOffset;
+    };
+
+
+
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenConnectionChunk) : public CSenChunk
+#else
+class CSenConnectionChunk : public CSenChunk
+#endif
+    {
+    friend class CSenServiceConnectionImpl;
+    
+    public:
+        // Constructors and destructor
+         static CSenConnectionChunk* NewL(const TDesC& aChunkName, TBool aInternal = EFalse );
+        static CSenConnectionChunk* NewLC(const TDesC& aChunkName, TBool aInternal = EFalse );
+
+        ~CSenConnectionChunk();
+
+        // New methods:
+        RArray<TXmlEngDataContainer>& BinaryDataArrayL();	//codescannerwarnings
+        TBool HasBinaryDataArray();
+         TBool HasSharedFileHandle();
+        void HasSharedFileHandle(TBool aHasSharedFileHandle);
+        void RemoveBinaryDataArrayIfEmpty();
+        TInt AddFileToContainerMap( const TDesC8& aCid, RFile aFile );
+        TInt AddChunkToContainerMap( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset );
+        RBinaryMap& ContainerMap();
+        TInt ContainerCount();
+
+#ifndef RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_HW_TARGET
+        // in WINSCW environment, we don't need to use WSD, since there is no limitation for how many chunk handles a single process can have open
+        TInt ServOpenChunkCount();
+#else
+		// use WSD only in hardware builds, since in emulator environment, only a single process can use WSD(!)
+		static TInt ServOpenChunkCount();
+#endif       
+    private:
+        void ConstructL(const TDesC& aChunkName);
+
+        CSenConnectionChunk();
+
+    private: // Data
+        RArray<TXmlEngDataContainer>* ipDataContainerArray; // owned
+        TBool iHasSharedFileHandle ;		
+        // Proper solution uses the map(!):
+        RBinaryMap                    iMap;
+#ifndef RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_HW_TARGET
+    	TInt iServOpenChunkCount; // WINS env: no need to have static member. To monitor Server side Open chunk count
+#else
+    	static TInt iServOpenChunkCount; // ARMv5 env: we need stati member. To monitor Server side Open chunk count
+#endif        
+    };
+
+#endif //SEN_SERVICE_CONNECTION_IMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/inc/senservicedispatcher.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Custom plug-in implementations offer their own API documentation
+*                where detailed characteristics about how methods declared in this
+*                class are implemented.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_DISPATCHER_H
+#define SEN_SERVICE_DISPATCHER_H
+
+#include <flogger.h>
+#include <e32property.h>
+#include <e32std.h>
+#include "senlogger.h"
+#include "sendebug.h"
+
+typedef RSenPointerMap<TInt, TInt> RTransactionsMap;
+
+// FORWARD DECLARATIONS
+class CSenConnectionChunk;
+class CSenAsyncOperation;
+class CSenServiceConnectionImpl;
+    
+struct TMessage
+{
+    CSenConnectionChunk* iSenConnectionChunk;   // Not Owned
+    CSenAsyncOperation* iSenAsyncOperation; // Not Owned
+};
+        
+struct TThreadMessage
+{
+    TMessage iMessage;
+    TInt iVrtalTrnsnID;
+};
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenServiceDispatcher) : public CBase
+#else
+class CSenServiceDispatcher : public CBase
+#endif
+    {
+    private:
+    protected:
+    public:
+
+        // Constructors and destructor:
+        static CSenServiceDispatcher* NewL(   RSenServiceConnection&  aConnection,
+                                                        TInt aConnectionID);
+
+        static CSenServiceDispatcher* NewLC(  RSenServiceConnection&  aConnection,
+                                                        TInt aConnectionID);
+
+
+        static TInt DispatcherThreadL(CSenServiceDispatcher* aThis);
+
+        static TInt ExecuteL(CSenServiceDispatcher* aThis);
+
+        TInt GetDispactherThreadId();
+
+        TInt AddToTheQueue(TThreadMessage aThreadMessage);
+
+        TBool RemoveFromQueue(TInt aTransactionID);
+
+        TInt AddToTheTransMap(TInt* pVrtlaTxnId,TInt* pActlTxnId);
+
+        TInt RemoveFromTransMap(TInt* pVrtlaTxnId);
+
+        TInt UpdateTransMap(TInt* pVrtlaTxnId,TInt* pActlTxnId);
+
+        TInt GetActualTransactionID(TInt* pVrtlaTxnId);
+
+        TInt GetVirtualTransactionID(TInt* pActlTxnId);
+
+        void SetOwnerThreadId(TInt aOwnerThreadID);
+
+        void ResetQueue();
+
+        TMessage GetMessageFromQueue(TInt aTransactionID);
+        
+        virtual ~CSenServiceDispatcher();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceDispatcher(RSenServiceConnection&  aConnection);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(TInt aConnectionID);
+
+        RTransactionsMap& TransactionMap();
+        
+        void OpenDispatcherLogL();
+
+        void CloseDispatcherLogL();
+        
+    private:
+
+        RThread                             iDispatcherThread;
+        
+        //Message queue to dispacth messages in FIFO order.
+        RArray<TThreadMessage>              iMessageQueue;
+        TInt                                iMessagesQueueCounter;
+        
+        //Map of virtual and actual transaction ID's.
+        RTransactionsMap*                   ipTransactionsMap;
+        
+        //Flag for dispatching messages. Stops dispatching messages
+        //when set to FALSE.
+        TBool                               iDispatchMessages;
+        
+        //Synchronizer critical section. Used to lock while dispatching
+        //messages.
+        RCriticalSection                    iCsSynchronizer;
+        
+        //Crtitical senction for message queue. 
+        RCriticalSection                    iCsMessageQueue;
+        
+        //Crtitical senction for transaction map. 
+        RCriticalSection                    iCsTransctnsMap;
+        
+        TThreadId                           iOwnerThreadId;
+        RSenServiceConnection&              iConnection;    // not owned        
+        TInt                                iConnectionID;
+
+    };
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenUnderTakerWaiter) : public CActive
+#else
+class CSenUnderTakerWaiter : public CActive
+#endif
+    {
+    public:
+        // Constructors and destructor
+        static CSenUnderTakerWaiter* NewL(CSenServiceConnectionImpl* aSenServiceConnectionImpl,
+                                          TInt aDispatcherThreadID );
+        static CSenUnderTakerWaiter* NewLC(CSenServiceConnectionImpl* aSenServiceConnectionImpl,
+                                           TInt aDispatcherThreadID);
+
+        void StartWaiter();
+        void StopWaiter();
+
+        ~CSenUnderTakerWaiter();
+
+    private:
+        CSenUnderTakerWaiter();
+        void ConstructL(CSenServiceConnectionImpl* aSenServiceConnectionImpl,
+                        TInt iDispatcherThreadID );
+        void RunL();
+        void DoCancel();
+    private: // Data
+        CSenServiceConnectionImpl*          iSenServiceConnectionImpl;  // not owned        
+        RUndertaker                         iUnderTaker;
+        TInt                                iDyingThreadNumber ;
+        TInt                                iDispatcherThreadID ;
+    };
+
+#endif  //SEN_SERVICE_DISPATCHER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/rom/wsconnection.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSCONNECTION_IBY__
+#define __WSCONNECTION_IBY__
+
+// ServiceConnection
+file=ABI_DIR\BUILD_DIR\SenServConn.dll          PROGRAMS_DIR\SenServConn.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/src/rsenserviceconnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,870 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <e32math.h>
+#include <f32file.h>
+
+#include "sendebug.h"                 // internal Utils\inc - logging MACROs
+#include "senlogger.h"
+#include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations
+
+#include "rsenserviceconnection.h"
+
+#include <SenSoapMessage.h>
+
+#if defined (__WINS__) && !defined(EKA2)
+static const TUint KServerMinHeapSize =    0x1000;     //  4K
+static const TUint KServerMaxHeapSize =    0x100000;   // 1000K
+#endif
+
+static TInt StartServerL();
+static TInt CreateServerProcessL();
+
+CSenProgressResourceHandler::CSenProgressResourceHandler(TInt aTxnId,
+        TBool aIncoming, TBool aIsSoap, TInt aProgress,
+        RSenServiceConnection* aOwner): CActive(EPriorityStandard),
+        iOwner(aOwner)
+    {
+    TTransferProgress& data = iProgressData();
+    data.iTxnId = aTxnId;
+    data.iIncoming = aIncoming;
+    data.iSoap = aIsSoap;
+    data.iProgress = aProgress;
+    }
+
+CSenProgressResourceHandler::~CSenProgressResourceHandler()
+    {
+    delete iSoapOrCid;
+    }
+
+void CSenProgressResourceHandler::DoCancel()
+    {
+    
+    }
+
+void CSenProgressResourceHandler::RunL()
+    {
+    iOwner->Remove(this);
+    delete this;
+    }
+
+TInt CSenProgressResourceHandler::SetBuffer(const TDesC8& aSoapOrCid)
+    {
+    iSoapOrCid = aSoapOrCid.Alloc();
+    if (iSoapOrCid)
+        {
+        return KErrNone;
+        }
+    return KErrNoMemory;
+    }
+
+CSenConnAgentSync::CSenConnAgentSync(): CActive(EPriorityStandard)
+	{
+	CActiveScheduler::Add(this);
+	iStatus = KRequestPending;
+	}
+
+CSenConnAgentSync::~CSenConnAgentSync()
+	{
+	if(IsActive())
+		{
+		Cancel();
+		}
+	}
+
+void CSenConnAgentSync::DoCancel()
+	{	
+	}
+
+void CSenConnAgentSync::RunL()
+	{
+	}
+
+void CSenConnAgentSync::Start()
+	{
+	SetActive();
+	}
+
+RSenServiceConnection::RSenServiceConnection(RFileLogger* aLog)
+    : RSessionBase(),
+      iMessageContextId(0),
+      iLog(aLog)
+    {
+    // No implementation required
+    }
+
+void RSenServiceConnection::SetLog(RFileLogger* aLog)
+    {
+    iLog = aLog;
+    }
+void RSenServiceConnection::SetChannel(TInt aChannel)
+{
+     iTLSLogChannel=aChannel;
+}
+
+TInt RSenServiceConnection::Connect()
+    {
+    TInt error(KErrNone);
+    TRAPD( leave, error = ::StartServerL(); )
+    
+    if( leave != KErrNone )
+        {
+        error = leave;
+        }
+        
+    if( error == KErrNone )
+        {
+        error = CreateSession( KSenServiceManager, Version(), KDefaultMessageSlots );
+        /// By defining TRequestStatus (last arg) to NULL, one could force 
+        /// error = CreateSession( KSenServiceManager, Version(), KDefaultMessageSlots, NULL, NULL ); 
+#ifdef _SENDEBUG
+        if(error != KErrNone)
+            {
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannel, KMinLogLevel , _L8("RSenServiceConnection::Connect - CreateSession returned error: (%d)"), error));
+            }
+        else
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannel, KMinLogLevel,"RSenServiceConnection::Connect - CreateSession returned KErrNone");
+            }
+#endif // _SENDEBUG
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannel, KMinLogLevel , _L8("RSenServiceConnection::Connect - StartServerL failed, error: (%d)"), error));
+        }
+#endif // _SENDEBUG
+    return error;
+    }
+
+TVersion RSenServiceConnection::Version() const
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::Version");
+    return(TVersion( KWsfServMajorVersionNumber, KWsfServMinorVersionNumber, KWsfServBuildVersionNumber) );
+    }
+
+void RSenServiceConnection::Initialize( TRequestStatus& aStatus,
+                                        TDes8& aErrPtr,
+                                        TDes& aSessionID,
+                                        CSenChunk& aSenChunk,
+                                        TInt aSdLength,
+                                        TInt /* aCpLength */,
+                                        TBool aHasAuthenticationCallback)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::Initialize");
+    TIpcArgs args;
+    args.Set(0, &aErrPtr);
+    args.Set(1, &aSessionID);
+    // Note: chunk will carry XML SD - and possibly consumer policy -
+    // over the process boundary.
+    aSenChunk.ChunkToArgs(args, 2);
+    
+    iFourInts().iInt1 = aSdLength;
+    iFourInts().iInt2 = aHasAuthenticationCallback;
+    args.Set(3,&iFourInts);
+    
+    SendReceive(ESenServInitialize, args, aStatus);
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::Initialize Completed");
+    }
+
+
+TInt RSenServiceConnection::IsReady(TBool& aReady)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::IsReady");
+    TPtr8 descriptor(reinterpret_cast<TUint8*>(&aReady), sizeof(aReady), sizeof(aReady));
+    TIpcArgs args;
+    args.Set(0, &descriptor);
+    return SendReceive(ESenServIsReady, args);
+    }
+
+TInt RSenServiceConnection::HasFacet(TDesC8& aUri, TBool& aHasFacet)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::HasFacet");
+    TLSLOG_ALL(iTLSLogChannel, KMaxLogLevel,(aUri));
+    TPtr8 descriptor(reinterpret_cast<TUint8*>(&aHasFacet), sizeof(aHasFacet), sizeof(aHasFacet));
+    TInt length = aUri.Length();
+    TIpcArgs args;
+    args.Set(0, &aUri);
+    args.Set(1, &descriptor);
+    args.Set(2, length);
+    return SendReceive(ESenServHasFacet, args);
+    }
+
+TInt RSenServiceConnection::CompleteServerMessagesOnOff(TBool& aOnOff)
+    {
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceConnection::CompleteServerMessagesOnOff")));
+
+    // Note : Using TPtr8 since this is binary information
+    TPtr8 descriptor(reinterpret_cast<TUint8*>(&aOnOff),sizeof(aOnOff),
+        sizeof(aOnOff));
+
+    TIpcArgs args;
+    args.Set(0, &descriptor);
+
+    return SendReceive(ESenServServerMessagesOnOff, args);
+    }
+
+void RSenServiceConnection::Transaction( TRequestStatus& aStatus,
+                                         TDes8& aErrPtr,
+                                         TDes8& aTxnPtr,
+                                         CSenChunk& aClientOp )
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::Transaction");
+
+    // Set the message context ID in here: it is only locally unique, inside each service connection - "in client scope"
+    // Context IDs use negative range, to avoid collisions with txnIDs (which are always positive integers)
+    aClientOp.ChunkHeader().SetContextId( --iMessageContextId );
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Transaction - SetContextId: %d"), iMessageContextId));
+    
+    TIpcArgs args;
+    args.Set(0, &aErrPtr);
+    args.Set(1, &aTxnPtr);
+    // This RChunk will pass message to server and include response when this
+    // txn is complete
+    aClientOp.ChunkToArgs(args,2);
+    SendReceive(ESenServTransaction, args, aStatus);
+    }
+
+TInt RSenServiceConnection::SendMsgAndReceiveTxnId(CSenChunk& aClientOp)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::SendMsgAndReceiveTxnId");
+    TInt retVal(KErrNone);
+
+    TIpcArgs args;
+    aClientOp.ChunkToArgs(args,0);
+    args.Set(1,aClientOp.ChunkHeader().ContextId());
+    retVal = SendReceive(ESenServSendMsgAndGetTxnId, args);
+
+    return retVal;
+    }
+TInt RSenServiceConnection::MoveFile(CSenChunk& aClientOp,
+                                     const TDesC8& aCid,
+                                     RFile& aFile)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::SendFile");
+    
+    TInt retVal = aClientOp.DescToChunk(aCid,2);
+    
+    TIpcArgs args;
+
+    if ( retVal == KErrNone)
+        {
+        aClientOp.ChunkToArgs(args,0);
+        aFile.TransferToServer(args, 1, 2);
+        
+        retVal = SendReceive(ESenServMoveFile, args);
+        }
+
+    return retVal;
+    }
+    
+TInt RSenServiceConnection::SendFileHandle(CSenChunk& aSenChunk, 
+                      						RFile& aFile)
+	{
+  	 TInt retVal(KErrNone);
+     TIpcArgs args;
+
+     if ( retVal == KErrNone)
+        {
+         aSenChunk.ChunkToArgs(args,0);
+         aFile.TransferToServer(args, 1, 2);       
+         retVal = SendReceive(ESenServSendFileHandle, args);
+        }
+
+     return retVal;
+	}
+
+TInt RSenServiceConnection::MoveChunk(CSenChunk& aClientOp,
+                                      const TDesC8& aCid,
+                                      RChunk& aChunk,
+                                      TInt aDataOffset,
+                                      TInt aDataSize)
+    {
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceConnection::SendChunk")));
+    
+    TInt retVal = aClientOp.DescToChunk(aCid,2);
+    
+    TIpcArgs args;
+    
+    if ( retVal == KErrNone )
+        {
+        TIpcArgs args;
+        aClientOp.ChunkToArgs(args,0);
+        args.Set(1, aChunk);
+        args.Set(2, aDataOffset);
+        args.Set(3, aDataSize);
+        retVal = SendReceive(ESenServMoveChunk, args);
+        }
+
+    return retVal;
+    }
+
+TInt RSenServiceConnection::RequestServiceDescription(TDes8& aSdLength)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RequestServiceDescription");
+    TIpcArgs args;
+    args.Set(0, &aSdLength);
+    return SendReceive(ESenServRequestServiceDescription, args);
+    }
+
+
+TInt RSenServiceConnection::ReceiveServiceDescription(TDes8& aServiceDescription)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::ReceiveServiceDescription");
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Waiting for SD: maxlength(%d):"),
+                                aServiceDescription.MaxLength()));
+    TIpcArgs args;
+    args.Set(0, &aServiceDescription);
+    return SendReceive(ESenServReceiveServiceDescription, args);
+    }
+
+TInt RSenServiceConnection::StartTransaction()
+    {
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceConnection::StartTransaction")));
+    return SendReceive(ESenServStartTransaction);
+    }
+
+TInt RSenServiceConnection::TransactionCompleted()
+    {
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceConnection::TransactionCompleted")));
+    return SendReceive(ESenServTransactionCompleted);
+    }
+
+TInt RSenServiceConnection::SetTransportPropertiesL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::SetTransportPropertiesL");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+
+    TInt retVal = SendReceive(ESenServSetTransportProperties, args);
+    
+    return retVal;
+    }
+
+TInt RSenServiceConnection::TransportPropertiesL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::TransportPropertiesL");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+
+    TInt retVal = SendReceive(ESenServTransportProperties, args);
+    
+    return retVal;
+    }
+
+void  RSenServiceConnection::CancelSession(TRequestStatus& aStatus)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::CancelSession(sync)");
+    SendReceive(ESenServCancelSession, aStatus);
+    }
+
+// ASYNC VERSION
+void RSenServiceConnection::CancelRequests(TRequestStatus& aStatus)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::CancelSession(async)");
+    TIpcArgs args; // empty
+    SendReceive(ESenServCancelSession, args, aStatus);
+    }
+
+void RSenServiceConnection::CancelRequest(TInt aTransactionID)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::CancelRequest");
+    TIpcArgs args;
+    args.Set(0, aTransactionID);
+    SendReceive(ESenServCancelRequest, args);
+    }
+
+void RSenServiceConnection::DataTrafficDetails(TSenDataTrafficDetails& aDetails,
+											   TSenDataTrafficOperations& aOperations) 
+	{
+	TLSLOG_L(iTLSLogChannel, KSenServiceConnectionLogLevel,"RSenServiceConnection::DataTrafficDetails");
+    TPtr8 trafficDetailsDesc(reinterpret_cast<TUint8*>(&aDetails),sizeof(aDetails),
+        					sizeof(aDetails));
+    TIpcArgs args;
+    args.Set(0,&trafficDetailsDesc);
+    args.Set(1,&aOperations.iReset);
+    SendReceive(ESenTrafficDetails, args);
+    }
+
+TInt RSenServiceConnection::ConnectionID()
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::ConnectionID");
+    TInt connectionID = SendReceive( ESenServConnectionID );
+    //LOG_WRITEFORMAT((_L("- Connection ID: (%d)"), connectionID));
+    return connectionID;
+    }
+
+TInt RSenServiceConnection::IdentityProviderL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::IdentityProviderL");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+
+    TInt retVal = SendReceive(ESenServConnectionIdentityProvider, args);
+    
+    return retVal;
+    }
+    
+TInt RSenServiceConnection::RegisterIdentityProvider(TDesC8& aMessage)
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterIdentityProvider");
+
+    TPtrC8 outBufferLeft = aMessage.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"), &outBufferLeft,
+        aMessage.Length()));
+#endif // _SENDEBUG
+
+    TInt length = aMessage.Length();
+
+    TIpcArgs args;
+    args.Set(0, &aMessage);
+    args.Set(1, length);
+
+    return SendReceive(ESenServRegisterIdentityProvider, args);
+    }
+	
+TInt RSenServiceConnection::RegisterTransferObserver(
+        const TDesC* aServerName, TAny* aConnection)
+    {
+    TInt retVal(KErrNone);
+    CActiveSchedulerWait asWait;
+    TIpcArgs args(aServerName, aConnection, &asWait);
+    CSenConnAgentSync* caSync = new CSenConnAgentSync();
+    if(caSync)
+    	{
+	    SendReceive(ESenObserveTransfer, args, caSync->iStatus);
+	    caSync->Start();
+	    Mem::FillZ(&asWait, sizeof(asWait));
+	    asWait.Start();
+	    retVal = caSync->iStatus.Int();
+	    delete caSync;
+    	}
+    else
+    	{
+    	retVal = KErrNoMemory;
+    	}
+    return retVal;
+    }
+
+TInt RSenServiceConnection::SendFileProgress( TInt aTxnId, 
+                                              TBool aIncoming,
+                                              TBool aIsSoap, 
+                                              const TDesC8& aSoapOrCid, 
+                                              TInt aProgress)
+    {
+    CSenProgressResourceHandler* resHandler = new CSenProgressResourceHandler(
+            aTxnId, aIncoming, aIsSoap, aProgress, this);
+    if (!resHandler)
+        {
+        return KErrNoMemory; // new (ELeave) was not used!
+        }
+    TInt retVal = resHandler->SetBuffer(aSoapOrCid);
+    if ( retVal != KErrNone)
+        {
+        delete resHandler;
+        }
+    else
+        {
+        if (iFirst)
+            {
+            iFirst->iPrevious = resHandler;
+            }
+        resHandler->iNext = iFirst;
+        iFirst = resHandler;
+
+        CActiveScheduler::Add(resHandler);
+        resHandler->SetActive();
+        resHandler->iStatus = KRequestPending;
+
+        TIpcArgs args(&resHandler->iProgressData, resHandler->iSoapOrCid);
+        SendReceive(ESenTransferProgress, args, resHandler->iStatus);
+        }
+    return retVal;
+    }
+
+void RSenServiceConnection::Remove(
+        CSenProgressResourceHandler* aResourceHandler)
+    {
+    if (aResourceHandler == iFirst)
+        {
+        iFirst = aResourceHandler->iNext;
+        if (iFirst)
+            {
+            iFirst->iPrevious = NULL;
+            }
+        }
+    else
+        {
+        aResourceHandler->iPrevious->iNext = aResourceHandler->iNext;
+        }
+    }
+
+
+void RSenServiceConnection::Close()
+    {
+    CSenProgressResourceHandler* resHandler = iFirst;
+    while (resHandler)
+        {
+        resHandler->Cancel();
+        CSenProgressResourceHandler* tmp = resHandler;
+        resHandler = resHandler->iNext;
+        delete tmp;
+        }
+    RSessionBase::Close();
+    }
+
+TInt RSenServiceConnection::SearchIdentityProviderL(CSenChunk& aSenChunk, const TDesC8& aProviderId)
+	{
+	TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::SearchIdentityProviderL");
+	
+	TInt length = aProviderId.Length();
+	
+	TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+    args.Set(1, &aProviderId);
+    args.Set(2, length);
+  
+    TInt retVal = SendReceive(ESenServSearchIdentityProvider, args);
+    return retVal;
+	}
+
+TInt RSenServiceConnection::RegisterAuthenticationObserver(const TDesC* aServerName, TAny* aConnection)
+	{
+	TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterAuthenticationObserver");
+	CActiveSchedulerWait asWait;
+    TIpcArgs args(aServerName, aConnection, &asWait);
+    TRequestStatus rs = KRequestPending;
+    SendReceive(ESenObserveAuthCallback, args, rs);
+    Mem::FillZ(&asWait, sizeof(asWait));
+    asWait.Start();
+    User::WaitForRequest(rs);
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterAuthenticationObserver Completed");
+    return rs.Int();
+	}
+
+TInt RSenServiceConnection::RegisterCoBrandingObserver(
+        const TDesC* aServerName, TAny* aConnection)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterCoBrandingObserver");
+	CActiveSchedulerWait asWait;
+    TIpcArgs args(aServerName, aConnection, &asWait);
+    TRequestStatus rs = KRequestPending;
+    SendReceive(ESenObserveCoBranding, args, rs);
+    Mem::FillZ(&asWait, sizeof(asWait));
+    asWait.Start();
+    User::WaitForRequest(rs);
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterCoBrandingObserver Completed");
+    return rs.Int();
+    }
+#ifdef __ENABLE_ALR__
+TInt RSenServiceConnection::RegisterMobilityObserverL(
+        const TDesC* aServerName, TAny* aConnection)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterMobilityObserverL");
+    TInt retVal(KErrNone);
+    CActiveSchedulerWait asWait;
+    TIpcArgs args(aServerName, aConnection, &asWait);
+    CSenConnAgentSync* caSync = new CSenConnAgentSync();
+    if(caSync)
+    	{
+	    SendReceive(ESenServRegisterMobiltyObserver, args, caSync->iStatus);
+	    caSync->Start();
+	    Mem::FillZ(&asWait, sizeof(asWait));
+	    asWait.Start();
+	    retVal = caSync->iStatus.Int();
+	    delete caSync;
+    	}
+    else
+    	{
+    	retVal = KErrNoMemory;
+    	}
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::RegisterMobilityObserverL Completed");
+    return retVal;
+    }
+
+
+TInt RSenServiceConnection::MigrateToPrefferedCarrierL(TBool &aUserChoice)
+	{
+	TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::MigrateToPrefferedCarrierL");
+	
+	 // Note : Using TPtr8 since this is binary information
+	TPtr8 descriptor(reinterpret_cast<TUint8*>(&aUserChoice),sizeof(aUserChoice),
+        sizeof(aUserChoice));
+
+    TInt retVal(KErrNone);
+    TIpcArgs args(&descriptor) ; 
+    
+    CSenConnAgentSync* caSync = new CSenConnAgentSync();
+    if(caSync)
+    	{
+        caSync->Start();    	
+	    SendReceive(ESenServMigrateToPreffredCarrier, args, caSync->iStatus);
+	    retVal = caSync->iStatus.Int();
+	    delete caSync;
+    	}
+    else
+    	{
+    	retVal = KErrNoMemory;
+    	}
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::MigrateToPrefferedCarrierL Completed");
+    return retVal;
+	    
+	}	
+
+TInt RSenServiceConnection::NewCarrierAcceptedL(TBool &aUserChoice)
+	{
+	TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::MigrateToPrefferedCarrierL");
+	
+	 // Note : Using TPtr8 since this is binary information
+	 TPtr8 descriptor(reinterpret_cast<TUint8*>(&aUserChoice),sizeof(aUserChoice),
+        sizeof(aUserChoice));
+
+    TInt retVal(KErrNone);
+    TIpcArgs args(&descriptor) ;
+    CSenConnAgentSync* caSync = new CSenConnAgentSync();
+    if(caSync)
+    	{
+        caSync->Start();    	
+	    SendReceive(ESenServNewCarrierAccepted, args, caSync->iStatus);
+	    retVal = caSync->iStatus.Int();
+	    delete caSync;
+    	}
+    else
+    	{
+    	retVal = KErrNoMemory;
+    	}
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceConnection::MigrateToPrefferedCarrierL Completed");
+    return retVal;	    
+	}	
+#endif
+
+RFileLogger* RSenServiceConnection::Log() const
+    {
+    return iLog;
+    }
+
+static TInt StartServerL()
+    {
+    TInt result(KErrNotFound);
+
+#ifdef _SENDEBUG   
+    RFileLogger log;
+    CleanupClosePushL(log);
+    User::LeaveIfError( log.Connect() );
+    log.CreateLog( KSenServiceConnectionLogDir, _L("SenStartServer.log"), EFileLoggingModeAppend );
+    log.Write(_L("- StartServerL() - invoked by SC."));
+#endif // _SENDEBUG
+
+    TFindServer findSenServiceManager(KSenServiceManager);
+    TFullName name;
+
+    result = findSenServiceManager.Next(name);
+    if (result == KErrNone)
+        {
+        // Server already running
+#ifdef _SENDEBUG        
+        log.Write(_L8("- Server already running, KErrNone"));
+        log.CloseLog();
+        CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG        
+        return KErrNone;
+        }
+
+    RSemaphore semaphore;
+    CleanupClosePushL(semaphore);
+
+    // First, try to open the semaphore (if someone else created it already):
+    result = semaphore.OpenGlobal( KSenServiceManagerSemaphoreName );
+    if( result == KErrNone )
+        {
+        // If another client is starting up SEN.EXE, this client should return
+        // to re-connect loop (wait one sec, max 5 times)
+#ifdef _SENDEBUG        
+        log.Write(_L8("- OpenGlobal OK => Another client already starting up SEN.EXE. About to WAIT and RE-CONNECT."));
+#endif        
+        result = KErrServerBusy;
+        }
+    else // could not find any already opened global semaphore ==> it is safe to create new one
+        {   
+        // Semaphore has not yet been created, so instantiate it now(!)
+        result = semaphore.CreateGlobal( KSenServiceManagerSemaphoreName, 0 );
+#ifdef _SENDEBUG        
+        if( result != KErrNone )
+            {
+            log.Write(_L8("CreateGlobal failed"));
+            log.WriteFormat(_L8("- error: %d"), result);
+            }
+#endif        
+        }
+        
+    if (result != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // semaphore.Close()
+#ifdef _SENDEBUG        
+        log.CloseLog();
+#endif // _SENDEBUG        
+        if( result != KErrServerBusy )
+            {
+#ifdef _SENDEBUG        
+            log.Write(_L8("- CreateGlobal failed => Another client already starting up SEN.EXE. About to WAIT and RE-CONNECT."));
+            CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG        
+            result = KErrServerBusy; // again, this error will activate re-connect loop (max 5 times)
+            }
+        return result;
+        }
+
+    result = CreateServerProcessL();
+    if (result != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // semaphore.Close()
+#ifdef _SENDEBUG        
+        log.Write(_L8("CreateServerProcessL failed"));
+        log.CloseLog();
+        CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG         
+        return result;
+        }
+
+    // Now start waiting for signal from server: it will release this semaphore from wait:
+    semaphore.Wait();  
+    CleanupStack::PopAndDestroy(); // semaphore.Close()
+    
+#ifdef _SENDEBUG        
+    log.Write(_L("Log file closed."));
+    log.CloseLog();
+    CleanupStack::PopAndDestroy(); // log.Close()    
+#endif // _SENDEBUG
+    return  KErrNone;
+    }
+
+static TInt CreateServerProcessL()
+    {
+    TInt result(KErrNone);
+
+#ifdef _SENDEBUG
+    RFileLogger log;
+    CleanupClosePushL(log);
+    User::LeaveIfError( log.Connect() );
+    // Note: appends to the log created in StartServer(), as it already exists
+    log.CreateLog( KSenServiceConnectionLogDir, _L("SenStartServer.log"), EFileLoggingModeAppend );
+    log.Write(_L("- CreateServerProcessL() - invoked by SC."));
+#endif //_SENDEBUG
+
+    const TUidType serverUid(KNullUid, KNullUid, KServerUid3);
+
+#if defined( __WINS__ ) && !defined(EKA2)
+    // WINDOWS emulator version
+    RLibrary lib;
+    CleanupClosePushL(lib);
+
+    RThread server;
+    CleanupClosePushL(server);
+
+    result = lib.Load( KSenServiceManagerFileName, serverUid );
+
+    if(result==KErrNone)
+        {
+#ifdef _SENDEBUG
+        log.Write(_L8("Library successfully loaded, KErrNone"));
+#endif // _SENDEBUG
+        
+        //  Get the WinsMain function
+        TLibraryFunction functionWinsMain = lib.Lookup(1);
+
+        //  Call it and cast the result to a thread function
+        TThreadFunction serverThreadFunction =
+            reinterpret_cast<TThreadFunction>(functionWinsMain());
+
+        TName threadName(KSenServiceManagerFileName);
+
+        // Append a random number to make it unique
+        threadName.AppendNum(Math::Random(), EHex);
+
+        result = server.Create(threadName,   // create new server thread
+                               serverThreadFunction, // thread's main function
+                               KDefaultStackSize,
+                               NULL,
+                               &lib,
+                               NULL,
+                               KServerMinHeapSize,
+                               KServerMaxHeapSize,
+                               EOwnerProcess);
+
+        // if successful, server thread now has the handle to library:
+
+        if(result== KErrNone)
+            {
+            server.SetPriority(EPriorityMore);
+            }
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        log.Write(_L8("- Could not load library"));
+        }
+#endif // _SENDEBUG
+
+    CleanupStack::Pop(); // server (thread)
+    CleanupStack::PopAndDestroy(); // lib
+    CleanupClosePushL(server);
+
+#else // _WINS_ not defined (EKA2, for example)
+    RProcess server;
+    CleanupClosePushL(server);
+    result = server.Create( KSenServiceManagerFileName, _L(""), serverUid );
+#endif // _WINS_
+
+    if( result == KErrNone )
+        {
+#ifdef _SENDEBUG
+        log.Write( _L8("- Server successfully created (KErrNone)") );
+#endif // _SENDEBUG
+        server.Resume();
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        log.Write( _L8("- Could not create server") );
+        }
+#endif // _SENDEBUG
+
+    CleanupStack::PopAndDestroy(); // server.Close();
+
+#ifdef _SENDEBUG
+    CleanupStack::PopAndDestroy(); // log.Close();
+#endif // _SENDEBUG
+
+    return result;
+    }
+    
+
+// End of file
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/src/senregistrationtimer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       not a public class
+*
+*/
+
+
+
+
+// INCLUDES
+#include "senregistrationtimer.h"
+
+// CLASS DECLARATION
+CSenRegistrationTimer* CSenRegistrationTimer::NewL( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs )
+    {
+    CSenRegistrationTimer* pNew = CSenRegistrationTimer::NewLC( aActor, aRegistrationTimeoutInSecs );
+    CleanupStack::Pop( pNew );
+    return pNew;
+    }
+
+CSenRegistrationTimer* CSenRegistrationTimer::NewLC( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs )
+    {
+    CSenRegistrationTimer* pNew = new (ELeave)CSenRegistrationTimer( aActor, aRegistrationTimeoutInSecs );
+    CleanupStack::PushL( pNew );
+    pNew->ConstructL();
+    return pNew;
+    }
+     
+CSenRegistrationTimer::CSenRegistrationTimer( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs )
+//:CTimer( EPriorityNormal ), iActor(aActor), iRegistrationTimeoutInSecs( aRegistrationTimeoutInSecs ), iRegisterFilesObserver(EFalse)
+:CActive( EPriorityNormal ), iActor(aActor), iRegistrationTimeoutInSecs( aRegistrationTimeoutInSecs ), iRegisterFilesObserver(EFalse)
+    {
+    }     
+
+void CSenRegistrationTimer::ConstructL()
+	{
+	User::LeaveIfError (iTimer.CreateLocal());	
+	CActiveScheduler::Add(this);	
+	}
+
+          
+CSenRegistrationTimer::~CSenRegistrationTimer()
+    {
+	CActive::Cancel();
+	iTimer.Close();	
+    }
+
+void CSenRegistrationTimer::IssueRegistrations( TBool aRegisterFilesObserver )
+    {
+    iRegisterFilesObserver = aRegisterFilesObserver;
+    // iRegisterMobilityObserver = aRegisterMobilityObserver;
+    // iRegister<some>Observer = aRegister<some>Observer ;
+
+    TInt interval( KErrNone );
+	if( iRegistrationTimeoutInSecs > 0 )
+		{
+		interval = iRegistrationTimeoutInSecs * 1000 * 1000;
+		}
+	else // use the timeout value of 1 second (default)
+		{
+		interval = KSenDefaultRegistrationTimeout * 1000 * 1000;
+		}
+	if (!IsActive())
+        {
+        iTimer.After( iStatus, interval );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSenRegistrationTimer::DoCancel
+// -----------------------------------------------------------------------------
+//	
+void CSenRegistrationTimer::DoCancel ()
+    {
+    iRegisterFilesObserver = EFalse;
+	iTimer.Cancel();
+    }
+
+void CSenRegistrationTimer::RunL()
+    {
+    if (iStatus.Int() == KErrNone)
+    	{
+    	if( iRegisterFilesObserver )
+        	{
+        	/* TInt err = */ 
+        	TRAP_IGNORE( iActor.RegisterAndSubscribeFileProgressObserversL(); )
+    		// err = 0; // not used in release builds
+        	}
+        // if ( iRegisterMobilityObserver  ) {} ...
+        // if ( iRegister<some>Observer  ) {} ...
+    	}
+    }
+
+//virtual TInt CSenRegistrationTimer::RunError(TInt aError) { ; }
+//void CSenRegistrationTimer::DoCancel() { ; }    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/src/senserviceconnectiondll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+
+#include "senserviceconnectionimpl.h"
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewL( MSenServiceConsumer& aObserver,
+                                                             const TDesC8& aContract )
+    {
+    return CSenServiceConnectionImpl::NewL( aObserver, aContract );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewLC( MSenServiceConsumer& aObserver,
+                                                              const TDesC8& aContract )
+    {
+    return CSenServiceConnectionImpl::NewLC( aObserver, aContract );
+    }
+
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewL( MSenServiceConsumer& aObserver,
+                                                             MSenServiceDescription& aServiceDescription )
+    {
+    return CSenServiceConnectionImpl::NewL( aObserver, aServiceDescription );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewLC( MSenServiceConsumer& aObserver,
+                                                              MSenServiceDescription& aServiceDescription )
+    {
+    return CSenServiceConnectionImpl::NewLC( aObserver, aServiceDescription );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewL( MSenServiceConsumer& aObserver,
+                                                             CSenServicePattern& aServicePattern )
+    {
+    return CSenServiceConnectionImpl::NewL( aObserver, aServicePattern );
+    }
+
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewLC( MSenServiceConsumer& aObserver,
+                                                              CSenServicePattern& aServicePattern )
+    {
+    return CSenServiceConnectionImpl::NewLC( aObserver, aServicePattern );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewL( MSenServiceConsumer& aConsumer,
+                                                             const TDesC8& aContract,
+                                                             MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    return CSenServiceConnectionImpl::NewL( aConsumer, aContract, aExtendedConsumer );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewLC( MSenServiceConsumer& aConsumer,
+                                                              const TDesC8& aContract,
+                                                              MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    return CSenServiceConnectionImpl::NewLC( aConsumer, aContract, aExtendedConsumer );
+    }
+
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewL( MSenServiceConsumer& aConsumer,
+                                                             MSenServiceDescription& aServiceDescription,
+                                                             MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    return CSenServiceConnectionImpl::NewL( aConsumer, aServiceDescription, aExtendedConsumer );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewLC( MSenServiceConsumer& aConsumer,
+                                                              MSenServiceDescription& aServiceDescription,
+                                                              MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    return CSenServiceConnectionImpl::NewLC( aConsumer, aServiceDescription, aExtendedConsumer );
+    }
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewL( MSenServiceConsumer& aConsumer,
+                                                             CSenServicePattern& aServicePattern,
+                                                             MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    return CSenServiceConnectionImpl::NewL( aConsumer, aServicePattern, aExtendedConsumer );
+    }
+
+
+EXPORT_C CSenServiceConnection* CSenServiceConnection::NewLC( MSenServiceConsumer& aConsumer,
+                                                              CSenServicePattern& aServicePattern,
+                                                              MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    return CSenServiceConnectionImpl::NewLC( aConsumer, aServicePattern, aExtendedConsumer );
+    }
+
+
+CSenServiceConnection::CSenServiceConnection()
+    : CActive(EPriorityStandard)
+    {
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/src/senserviceconnectionimpl.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4426 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+#include <s32strm.h>
+#include <f32file.h>
+#include <e32property.h>
+
+#include "senserviceconnectionimpl.h"
+
+#include "sendebug.h"                 // internal Utils\inc - logging MACROs
+#include "senlogger.h"
+#include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations, plus 
+                                      // to include KServerUid3 for SEN.EXE SecureID 
+                                      // (UID3) that can be nicely used as Property 
+                                      // Category UID
+
+#include <SenServicePattern.h>
+#include <SenXmlServiceDescription.h>
+#include <SenXmlUtils.h>
+#include "SenHttpTransportProperties.h"
+#include <SenIdentityProvider.h>
+
+#include "senguidgen.h"  // internal: Utils\inc - the prefix length constant for WSF GUIDs
+#include "senchunk.h"
+#include "senmessagebase.h"
+
+#include "SenSoapEnvelope2.h"
+#include "SenParser.h"
+
+#include "senservicemanagerdefines.h"
+#include "SenBaseAttribute.h"
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+#include <xmlengserializer.h>
+#include "senconnagentserver.h"
+#include "senxmldebug.h"
+#include "senatomentry.h"
+
+
+namespace
+    {
+    const TInt KMaxChunkNumDecimals = 64;
+    _LIT8(KIdentityProviderName, "IdentityProvider");
+    _LIT8( KSenCidPostfix, "@example.org" );
+    const TInt KMaxCidLength = 512;
+    }
+
+#ifdef RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_HW_TARGET
+// in hardware, we can use static variable
+TInt CSenConnectionChunk::iServOpenChunkCount;   
+#endif    
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewL(MSenServiceConsumer& aObserver,
+                                                           const TDesC8& aContract)
+    {
+    CSenServiceConnectionImpl* pNew = NewLC(aObserver, aContract);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewLC(MSenServiceConsumer& aObserver,
+                                                            const TDesC8& aContract)
+    {
+
+    CSenServiceConnectionImpl* pNew = new (ELeave) CSenServiceConnectionImpl(aObserver, NULL);
+
+    CleanupStack::PushL(pNew);
+
+
+    CSenXmlServiceDescription* pSD =
+            CSenXmlServiceDescription::NewLC(KNullDesC8, aContract);
+    pNew->ConstructL(*pSD);
+    CleanupStack::PopAndDestroy(); // pServicePattern
+    return pNew;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewL(MSenServiceConsumer& aObserver,
+                                                           MSenServiceDescription& aPattern)
+    {
+    CSenServiceConnectionImpl* pNew = NewLC(aObserver, aPattern);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewLC(MSenServiceConsumer& aObserver,
+                                                            MSenServiceDescription& aPattern)
+    {
+    CSenServiceConnectionImpl* pNew =
+                            new (ELeave) CSenServiceConnectionImpl(aObserver, NULL);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aPattern);
+    return pNew;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewL(MSenServiceConsumer& aObserver,
+                                                           CSenServicePattern& aServicePattern)
+    {
+    CSenServiceConnectionImpl* pNew = NewLC(aObserver, aServicePattern);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewLC(MSenServiceConsumer& aObserver,
+                                                            CSenServicePattern& aServicePattern)
+    {
+    CSenServiceConnectionImpl* pNew = new (ELeave) CSenServiceConnectionImpl(aObserver, NULL);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aServicePattern);
+    return pNew;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewL(MSenServiceConsumer& aConsumer,
+                                                           const TDesC8& aContract,
+                                                           MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    CSenServiceConnectionImpl* pNew = NewLC(aConsumer, aContract, aExtendedConsumer);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewLC(MSenServiceConsumer& aConsumer,
+                                                            const TDesC8& aContract,
+                                                            MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+
+    CSenServiceConnectionImpl* pNew = new (ELeave) CSenServiceConnectionImpl(aConsumer, &aExtendedConsumer);
+
+    CleanupStack::PushL(pNew);
+
+
+    CSenXmlServiceDescription* pSD =
+            CSenXmlServiceDescription::NewLC(KNullDesC8, aContract);
+    pNew->ConstructL(*pSD);
+    CleanupStack::PopAndDestroy(); // pServicePattern
+    return pNew;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewL(MSenServiceConsumer& aConsumer,
+                                                                MSenServiceDescription& aServiceDescription,
+                                                           MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+
+    CSenServiceConnectionImpl* pNew = NewLC(aConsumer, aServiceDescription, aExtendedConsumer);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewLC(MSenServiceConsumer& aConsumer,
+                                                                MSenServiceDescription& aServiceDescription,
+                                                                MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    CSenServiceConnectionImpl* pNew =
+                            new (ELeave) CSenServiceConnectionImpl(aConsumer,&aExtendedConsumer);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aServiceDescription);
+    return pNew;        
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewL(MSenServiceConsumer& aConsumer,
+                                                           CSenServicePattern& aServicePattern,
+                                                           MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    CSenServiceConnectionImpl* pNew = NewLC(aConsumer, aServicePattern, aExtendedConsumer);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceConnectionImpl* CSenServiceConnectionImpl::NewLC(MSenServiceConsumer& aConsumer,
+                                                            CSenServicePattern& aServicePattern,
+                                                            MSenExtendedConsumerInterface& aExtendedConsumer)
+    {
+    CSenServiceConnectionImpl* pNew = new (ELeave) CSenServiceConnectionImpl(aConsumer,&aExtendedConsumer);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aServicePattern);
+    return pNew;
+    }
+
+void CSenServiceConnectionImpl::ConstructL(MSenServiceDescription& aSD)
+    {
+
+    CSenElement& sdAsElement = ((CSenXmlServiceDescription&)aSD).AsElement();
+
+    // Check if this is an internal service connection:
+    const TDesC8* pInternal = sdAsElement.AttrValue( KSenAttrInternalSC );
+    if( pInternal )
+        {
+        iIsInternalSC = ETrue;
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"This is 'internal SC' => Will NOT create CSenConnectionStatusObserver.");
+        delete SenXmlUtils::RemoveAttributeL(sdAsElement, KSenAttrInternalSC);
+        iDispatcherEnabled = EFalse;
+        }
+    else // not internal, but starndard SC
+        {
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"This is normal SC => Creating CSenConnectionStatusObserver.");
+#ifdef RD_SEN_SC_MSG_DISPATCHER_ENABLED
+        // Dispatcher is enabled ONLY IF the feature is NOT DISABLED AT COMPILER LEVEL:
+        iDispatcherEnabled = ETrue; // ==> Default to using the dispatcher with any "normal" SC
+#endif // RD_SEN_SC_MSG_DISPATCHER_ENABLED
+        }
+
+    // Check if dispatcher is EXPLICITELY DISABLED (no matter if this is internal or not)
+    const TDesC8* pDispatcherDisabled = sdAsElement.AttrValue( KSenAttrDisableDispatcherSC );
+    if( pDispatcherDisabled )
+        {
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"Dispatcher is EXPLICITELY DISABLED for this SC.");
+        delete SenXmlUtils::RemoveAttributeL(sdAsElement, KSenAttrDisableDispatcherSC );
+        // Dispatcher is NOW EXPLICITELY DISABLED
+        iDispatcherEnabled = EFalse; 
+        }
+
+    ipInitPatternAsXml = aSD.AsXmlL();
+    if( aSD.DescriptionClassType() == MSenServiceDescription::EServicePattern )
+        {
+        CSenServicePattern* pServicePattern = (CSenServicePattern*)&aSD;
+        ipInitConsumerPolicyAsXml = pServicePattern->ConsumerPolicyAsXmlL();
+        }
+        
+        
+    ipRegistrationTimer = CSenRegistrationTimer::NewL( *this );        
+/*    
+#ifdef _SENDEBUG
+    TPtrC8 frameworkID = aSD.FrameworkId();
+    TPtrC8 endpoint    = aSD.Endpoint();
+    TPtrC8 contract    = aSD.Contract();
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel , _L8("- FrameworkID: %S"), &frameworkID ));
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel , _L8("- Endpoint:    %S"), &endpoint ));
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel , _L8("- Contract:    %S"), &contract ));
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
+#endif //_SENDEBUG           
+*/
+#ifndef RD_SEN_SC_PROXY_ENABLED_BY_DEFAULT
+    ConnectL(); 
+// #else // ConnectL occurs on  "proxy" / factory  -level
+#endif    
+    }
+
+
+void CSenServiceConnectionImpl::ConnectL()
+    {
+    ipSessionId = HBufC::NewL(KSenUuidMaxLength); 
+    ipChunkName = HBufC::NewL(KSenUuidMaxLength+KMaxChunkNumDecimals);
+
+    iSessionIdBuffer.Set(ipSessionId->Des());
+
+    TLSLOG_OPEN(KSenServiceConnectionLogChannel, KSenServiceConnectionLogLevel, KSenServiceConnectionLogDir, KSenServiceConnectionLogFile);
+    TInt connErr = iConnection.Connect();
+    TInt connAttemp(0); // max 5 attempts are allowed (KMaxConnectionOpeningAttempts)
+    while ( (connErr == KErrServerTerminated
+                     ||
+             connErr == KErrServerBusy)
+                     &&
+             connAttemp < KSenMaxClientConnectionOpeningAttempts )
+        {
+//        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel," - Server terminated/busy/max_conns => waiting.");
+        User::After(1000000); // wait for a second if server has been shut down  
+//        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel," - Wait is over.");
+        connErr = iConnection.Connect();
+        connAttemp++;
+        }
+    if ( connErr != KErrNone )
+        {
+        User::Leave( connErr );
+        }
+    
+    if( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+        {
+        TInt iShareAuto = iConnection.ShareAuto();
+        if(iShareAuto != KErrNone )
+            {
+            User::Leave( iShareAuto );
+            }
+        }
+        
+    iConnectionID = iConnection.ConnectionID();
+    iConnection.SetChannel(KSenServiceConnectionLogChannelBase+iConnectionID);   
+    iTlsLogStatusChannel = KSenServiceConnectionStatusLogChannelBase + iConnectionID;
+
+#ifdef _SENDEBUG   
+    RProcess process; 
+    RThread thread;
+    TFileName logFile;
+    logFile.Append( KSenServiceConnectionLogFile().Left(KSenServiceConnectionLogFile().Length()-4) ); // exclude ".log" file extension
+    logFile.AppendNum( iConnectionID );
+    logFile.Append( KSenUnderline );
+    logFile.Append( process.Name().Left(32));
+    logFile.Append( KSenUnderline );
+    logFile.Append( thread.Name().Left(20));
+    logFile.Append( KSenServiceConnectionLogFile().Right(4) ); // postfix with ".log" file extension
+    
+    
+//    KSenServiceConnectionChannelBase
+    TLSLOG_OPEN(KSenServiceConnectionLogChannelBase+iConnectionID, KSenServiceConnectionLogLevel, KSenServiceConnectionLogDir, logFile);
+    // Open connection to the file logger server
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,"CSenServiceConnection::ConstructL - Log file opened");
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- About to initialize service connection");
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Connection ID: (%d)"), iConnectionID));
+
+    logFile.Zero();
+    logFile.Append( KSenServiceConnectionStatusLogFile().Left(KSenServiceConnectionStatusLogFile().Length()-4) ); // exclude ".log" file extension
+    logFile.AppendNum( iConnectionID );
+    logFile.Append( KSenUnderline );
+    logFile.Append( process.Name().Left(32));
+    logFile.Append( KSenUnderline );
+    logFile.Append( thread.Name().Left(20));
+    logFile.Append( KSenServiceConnectionStatusLogFile().Right(4) ); // postfix with ".log" file extension
+    TLSLOG_OPEN( iTlsLogStatusChannel, KSenServiceConnectionStatusLogLevel, KSenServiceConnectionLogDir, logFile );
+
+
+    TLSLOG_OPEN(KSenMessagesLogChannel, KSenMessagesLogLevel, KSenMessages, KSenMessagesLog);
+#endif // _SENDEBUG    
+
+    iFragment = CSenBaseFragment::NewL(KServiceConnectionElementLocalName);
+     
+    InitializeL( /*aSD*/ );
+
+    if( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+        {
+        RThread aThread;
+        iOwnerThreadId = aThread.Id();
+        ipSenServiceDispatcher = CSenServiceDispatcher::NewL(iConnection,iConnectionID);
+        ipSenServiceDispatcher->SetOwnerThreadId(iOwnerThreadId);
+        TInt dispatcherThreadID = ipSenServiceDispatcher->GetDispactherThreadId();
+        //    ipSenUnderTakerWaiter = CSenUnderTakerWaiter::NewL(this,dispatcherThreadID);
+        //    ipSenUnderTakerWaiter->StartWaiter();
+        }
+    }
+
+void CSenServiceConnectionImpl::SetConsumer( MSenServiceConsumer& aConsumer, MSenExtendedConsumerInterface* apExtConsumer )
+    {
+    iObserver = &aConsumer;
+    ipExtendedConsumerInterface = apExtConsumer;
+    }
+   
+void CSenServiceConnectionImpl::Consumer( MSenServiceConsumer*& aConsumer, MSenExtendedConsumerInterface*& apExtConsumer )
+    {
+    aConsumer = iObserver;
+    apExtConsumer = ipExtendedConsumerInterface;
+    }   
+
+TPtrC8 CSenServiceConnectionImpl::InitDescription()
+    {
+    return *ipInitPatternAsXml;
+    }
+CSenServiceConnectionImpl::CSenServiceConnectionImpl(MSenServiceConsumer& aObserver,
+                                                     MSenExtendedConsumerInterface* aExtendedConsumerInteface)
+ :  iConnection(&iLog),
+    iObserver(&aObserver),
+    iInBuf(NULL),
+    iInBuffer(NULL,0),
+    iOutBuf(NULL),
+    iOutBuffer(NULL,0),
+    iInitialized(EFalse),
+    iFragment(NULL),
+    iResponseLength(0),
+    iErrorNumber(0),
+    iErrorNumberBuffer(NULL, 0),
+    iTxnId(0),
+    iTxnIdBuffer(NULL, 0),
+    iChunkMap(NULL),
+    ipSessionId(NULL),
+    iSessionIdBuffer(NULL, 0),
+    iChunkNameNumber(0),
+    ipChunkName(NULL),
+    iResponse(NULL),
+    ipInitChunk(NULL),
+    ipCompleteServerMsgsOnOff(NULL),
+    iConnectionID( KErrNotReady ),
+    //iTlsLogChannel( KSenServiceConnectionLogChannelBase )
+    iTlsLogStatusChannel( KSenServiceConnectionStatusLogChannelBase ),
+    iConnectionAgentCallbackInitialized(EFalse),
+    iRegisterFileObserverDone(EFalse),
+    iRegisterMobilityObserverDone(EFalse),
+    iRegisterAuthObserverDone(EFalse),
+    iRegisterCoBrandingObserverDone(EFalse),
+    iReauthenticationNeeded(EFalse),
+    ipExtendedConsumerInterface(aExtendedConsumerInteface),
+#ifdef __ENABLE_ALR__
+    iMobiltyObserver(NULL),
+#endif
+    iCancelSession(EFalse),
+    iIsInternalSC(EFalse),
+    iDispatcherEnabled(EFalse),
+    ipRegistrationTimer(NULL)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CSenServiceConnectionImpl::~CSenServiceConnectionImpl()
+    {
+    delete ipRegistrationTimer;
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::~CSenServiceConnectionImpl")));
+    CSenServiceConnectionImpl::Cancel(); // Causes call to DoCancel()
+
+#if !defined (RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS) && !defined( RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS ) // pub&sub is not in use for outgoing file progress
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::~CSenServiceConnectionImpl(): RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == FALSE")));
+    if (ipAuthProvider || iFilesObserver || ipCoBrandingObserver)
+#else // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::~CSenServiceConnectionImpl(): RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE")));
+    if (ipAuthProvider || ipCoBrandingObserver) // iFilesObserver is not used
+#endif // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS end
+        {
+        CSenConnAgentServer::Close();
+        iConnectionAgentCallbackInitialized = EFalse;
+        }
+
+#ifdef __ENABLE_ALR__        
+    if (iMobiltyObserver)
+        {
+        CSenConnAgentServer::Close();
+        iRegisterMobilityObserverDone = EFalse;
+        }
+#endif //__ENABLE_ALR__
+
+//    delete ipSenUnderTakerWaiter;
+    delete ipSenServiceDispatcher;
+
+    if ( iAsyncOpsArray )
+        {
+        TInt count(iAsyncOpsArray->Count());
+        for ( TInt i = 0; i < count; i++ )
+            {
+            CSenAsyncOperation* pOp = (*iAsyncOpsArray)[i];
+            if ( pOp )
+                {
+                pOp->iActive = NULL;
+                pOp->Deque();
+                delete pOp;
+                }
+            }
+        iAsyncOpsArray->Close();
+        delete iAsyncOpsArray;
+        }
+
+    if(iChunkMap)
+        {
+        iChunkMap->Reset();
+        delete iChunkMap;
+        }
+
+    delete iInBuf;
+    delete iOutBuf;
+    delete iFragment;
+    delete ipSessionId;
+    delete ipChunkName;
+    delete ipInitPatternAsXml;
+    delete ipInitConsumerPolicyAsXml;
+    delete ipInitChunk;
+    delete ipCompleteServerMsgsOnOff;
+    
+    // Close the log file and the connection to the server.
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("Log file closed.")));
+    TLSLOG_CLOSE (KSenServiceConnectionLogChannelBase+iConnectionID);
+    TLSLOG_CLOSE(KSenServiceConnectionLogChannel);
+    TLSLOG_CLOSE( iTlsLogStatusChannel );
+    TLSLOG_CLOSE( KSenMessagesLogChannel );
+
+    iConnection.Close();
+    delete ipConnectionStatusObserver;
+    delete ipFileProgressObserver;
+    }
+
+
+TPtrC CSenServiceConnectionImpl::SessionID()
+    {
+    if(ipSessionId)
+        {
+        return *ipSessionId;
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+
+TInt CSenServiceConnectionImpl::RegisterAndSubscribeFileProgressObserversL()
+    {
+    TInt retCode( KErrNone );
+    if(iFilesObserver && !iRegisterFileObserverDone)
+    	{
+    	
+#ifndef RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS // pub&sub not in use for outgoing file progress
+        TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == FALSE")));
+    	retCode = RegisterFilesObserver();
+#else // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE
+        TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE")));
+    	ipFileProgressObserver = CSenFileProgressObserver::NewL( *iFilesObserver, iConnectionID, iDispatcherEnabled, ipSenServiceDispatcher, ChunkMapL() );
+
+    #ifdef RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel, "CSenServiceConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == TRUE");
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel, "=> calling RegisterFilesObserver()");
+        retCode = RegisterFilesObserver(); // MIXED MODE, using conn agent for SOAP progress..
+    #else // RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == FALSE
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel, "CSenServiceConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == FALSE");
+    #endif // RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+
+#endif // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS end 	
+    	iRegisterFileObserverDone = ETrue; // register only once
+    	}
+    return retCode;
+    }
+    
+TInt CSenServiceConnectionImpl::SubmitL(CSenConnectionChunk& aClientOp)
+    {
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::SubmitL(CSenChunk)")));
+    TInt retVal(KErrNone);
+    
+    iErrorNumber = 0;
+    iErrorNumberBuffer.Set(reinterpret_cast<TUint8*>(&iErrorNumber),
+                           sizeof(TInt),
+                           sizeof(TInt));
+
+    iTxnId = 0;
+    iTxnIdBuffer.Set(reinterpret_cast<TUint8*>(&iTxnId),
+                     sizeof(TInt),
+                     sizeof(TInt));
+
+    TRequestStatus status;
+
+    iAsyncOpsCount++;
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("CSenServiceConnectionImpl::SubmitL(CSenChunk) - iAsyncOpsCount: %d"), iAsyncOpsCount));
+    iConnection.Transaction(status, iErrorNumberBuffer, iTxnIdBuffer, aClientOp);
+    
+    if ( aClientOp.HasBinaryDataArray() )
+        {
+        RegisterAndSubscribeFileProgressObserversL();
+        retVal = MoveBinaryContainersToServer(aClientOp, aClientOp.BinaryDataArrayL());		//codescannerwarnings
+        }
+    else if (aClientOp.HasSharedFileHandle())
+       {
+       	retVal = MoveFileChunkHandleToServer(aClientOp) ;
+       }
+
+    // Pass handle to SendMsgAndReceiveTxnId, so that RHandleBase can be re-used:
+    retVal = iConnection.SendMsgAndReceiveTxnId( aClientOp );
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Waiting for response.)");
+
+    User::WaitForRequest(status);   // Wait here until response is received (TXN == COMPLETE)
+    iAsyncOpsCount--;
+
+    switch(status.Int())
+        {
+        case ESenServRequestResponsed:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL - ESenServRequestResponsed");
+            retVal = iErrorNumber;
+            }
+            break;
+
+        case ESenReAuthAndResendNeeded:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL: ESenReAuthAndResendNeeded");
+            
+            if ( iAsyncOpsCount >= KAsyncMessageSlots)
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Cannot re-init, max simultaneous async ops on-going: KErrSenServiceConnectionBusy");
+                retVal = KErrSenServiceConnectionBusy;
+                }
+            else
+                {
+                aClientOp.ChunkHeader().SetDoInitBeforeSending(ETrue);
+                if(ipAuthProvider)
+                	{
+                	if(iReauthenticationNeeded)
+                		{
+                		TInt lerror(KErrNone);
+                		TRAP(lerror, ReauthNeededL(KNullDesC8)); // ignore errors
+                		}
+                	else
+                		{
+                		iReauthenticationNeeded = ETrue;
+                		}
+                	}
+                retVal = SubmitL(aClientOp); 
+                iReauthenticationNeeded = EFalse;
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL: ESenReAuthAndResendNeeded Completed");
+                return retVal;
+                }
+            }
+            break;
+
+        case ESenResendNeeded:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL: ESenResendNeeded");
+            
+            if ( iAsyncOpsCount >= KAsyncMessageSlots)
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Cannot re-send, max simultaneous async ops on-going: KErrSenServiceConnectionBusy");
+                retVal = KErrSenServiceConnectionBusy;
+                }
+            else
+                {
+                return SubmitL(aClientOp);
+                }
+            }
+            break;
+
+        case ESenInternalError:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL - ESenInternalError");
+            retVal = KErrSenInternal;
+            }
+        default:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL - default");
+#ifdef _SENDEBUG                
+            if(status.Int() == KErrPermissionDenied)
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL: default - KErrPermissionDenied");
+                }
+            else
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL: default - unexpected error.");
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("Last received error from server: (%d)"), iErrorNumber));
+                }
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("SubmitL, request status.Int(): (%d)"), status.Int()));
+            
+#endif // _SENDEBUG             
+            // WSF does not generalize errors:
+            retVal = status.Int();
+            }
+            break;
+        }
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::SubmitL(CSenChunk) Completed")));
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::ResponseFromChunk(CSenChunk& aClientOp,
+                                                  HBufC8*& aResponseTo)
+    {
+    TInt leaveCode(KErrNone); // handle OOM case:
+    // Read response message, SOAP fault OR error
+    TPtrC8 response;
+    TInt retVal = aClientOp.DescFromChunk(response); // if handle is closed, this will panic.
+    if(retVal==KErrNone)
+        {
+        // It is *mandatory* tor TRAP AllocL(), since HandleBase MUST be closed(!):
+        TRAP( leaveCode, aResponseTo = response.AllocL(); )
+        }
+    
+    if(leaveCode!=KErrNone)
+        {
+        // OOM occured
+        retVal = leaveCode;
+        }
+        
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SubmitL(const TDesC8& aRequest,
+                                        HBufC8*& aResponseTo )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL");
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+        if( pOperation )
+        	{
+	        CleanupStack::PushL( pOperation );        	    
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif //_SENDEBUG  
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = pOperation->DescToChunk(aRequest);
+	            if (retVal == KErrNone)
+	                {
+	                retVal = SubmitL(*pOperation);
+	                if (retVal != KErrNone && retVal != KErrSenSoapFault)
+	                    {
+	                    aResponseTo = NULL;
+	                    }
+	                else
+	                    {
+	                    retVal = ResponseFromChunk(*pOperation, aResponseTo);
+	                    }
+	                }
+	            }
+	        CleanupStack::PopAndDestroy(pOperation);
+        	}
+        	
+	     else
+	     	{
+#ifdef _SENDEBUG        
+				TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+	     	}
+
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("CSenServiceConnectionImpl::SubmitL - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+        
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL Completed");
+    return retVal;
+    }
+
+TInt  CSenServiceConnectionImpl::SubmitL(RFile& aFile, HBufC8*& aResponse)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL");
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName() ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+        if( pOperation )
+        	{
+	        CleanupStack::PushL( pOperation );        	    
+	        pOperation->SetLogger(&iLog);
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            pOperation->HasSharedFileHandle(ETrue);
+	        	iSharedFileHandle = aFile;
+	          	retVal = SubmitL(*pOperation);
+                if (retVal != KErrNone && retVal != KErrSenSoapFault)
+                    {
+                    aResponse = NULL;
+                    }
+                else
+                    {
+                    retVal = ResponseFromChunk(*pOperation, aResponse);
+                    }
+	            }
+	        CleanupStack::PopAndDestroy(pOperation);
+        	}
+        	
+	     else
+	     	{
+#ifdef _SENDEBUG        
+				TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+	     	}
+
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("CSenServiceConnectionImpl::SubmitL - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+        
+
+    return retVal;
+    }
+	
+// Setter
+TInt CSenServiceConnectionImpl::CompleteServerMessagesOnOff( const TBool& aCompleteOnOff )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::CompleteServerMessagesOnOff");
+    if( !iInitialized )
+        {
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- SC is not yet initialized; saving facet value for post CTR use.");
+        //TInt leaveCode(KErrNone);
+        delete ipCompleteServerMsgsOnOff; // to prevent memory leaks in sequal calls
+        ipCompleteServerMsgsOnOff = NULL;
+        //TRAP( leaveCode, ipCompleteServerMsgsOnOff = new (ELeave) TBool(aCompleteOnOff); )
+        // if ( leaveCode )
+        ipCompleteServerMsgsOnOff = new TBool(aCompleteOnOff); // it is better to make NULL check than trap new (ELeave)
+        if ( !ipCompleteServerMsgsOnOff )
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- FATAL: OOM occurred!");
+            //return leaveCode;
+            return KErrNoMemory;
+            }
+        //return KErrSenNotInitialized;
+#ifdef _SENDEBUG        
+        if( *ipCompleteServerMsgsOnOff )
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- CompleteServerMessagesOnOff mode: ON (TRUE) saved.");
+            }
+        else
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- CompleteServerMessagesOnOff mode: OFF (FALSE) saved.");
+            }
+#endif // _SENDEBUG            
+        return KErrNone;
+        }
+    
+    TInt retVal = iConnection.CompleteServerMessagesOnOff((TBool&)aCompleteOnOff);
+
+    if (retVal == KErrConnectionInitializing)
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8(" CSenServiceConnectionImpl::CompleteServerMessagesOnOff - Calling SetStatus(%d)"), 
+            KSenConnectionStatusNew ));
+        DeliverStatus( KSenConnectionStatusNew );
+        }
+    else if (retVal == KErrConnectionExpired)
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8(" CSenServiceConnectionImpl::CompleteServerMessagesOnOff - Calling SetStatus(%d)"), 
+            KErrConnectionExpired ));
+        DeliverStatus( KSenConnectionStatusExpired );
+        }
+    return retVal;
+    }
+
+// Getter
+TInt CSenServiceConnectionImpl::HasFacetL(const TDesC8& aURI, TBool& aHasFacet)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::HasFacetL");
+    TInt retVal(iConnection.HasFacet((TDesC8&)aURI, aHasFacet));
+
+    if (retVal == KErrConnectionInitializing)
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8(" CSenServiceConnectionImpl::HasFacetL - Calling SetStatus(%d)"), 
+            KSenConnectionStatusNew ));
+        DeliverStatus( KSenConnectionStatusNew );
+        }
+    else if (retVal == KErrConnectionExpired)
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8(" CSenServiceConnectionImpl::HasFacetL - Calling SetStatus(%d)"), 
+            KSenConnectionStatusExpired ));
+        DeliverStatus( KSenConnectionStatusExpired );
+        }
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::HasFacetL Completed");
+    return retVal;
+    }
+
+// Getter
+TInt CSenServiceConnectionImpl::IsReady(TBool& aReady)
+    {
+//     TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::IsReady"); // DO NOT ADD LOGGING IN HERE
+    if( !iInitialized && iIsInternalSC )
+        {
+        aReady = EFalse;
+        return KErrNone;
+        }	
+    TInt retVal(iConnection.IsReady(aReady));
+//    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::IsReady Completed"); // DO NOT ADD LOGGING IN HERE
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::CheckConnection()
+    {
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::CheckConnection")));
+    TInt retVal(KErrNone);
+    
+    if(!iInitialized)
+        {
+        TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::CheckConnection - KErrSenNotInitialized")));
+        retVal = KErrSenNotInitialized;
+        }
+     else if (iAsyncOpsCount > KAsyncMessageSlots-1)
+        {
+        TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::CheckConnection - KErrServerBusy (not enough message slots)")));
+        retVal = KErrServerBusy;
+        }
+    else if (!IsActive())
+        {
+        SetActive();
+        iStatus = KRequestPending;
+        }
+	TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::CheckConnection Completed")));
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SendL(CSenConnectionChunk* apClientOp)
+    {
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::SendL(CSenChunk)")));
+    TInt retVal( KErrNone );
+    CleanupStack::PushL( apClientOp );
+    
+    iErrorNumber = 0;
+    iTxnId = 0;
+    
+    iAsyncOpsCount++;
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("iAsyncOpsCount: %d"), iAsyncOpsCount));
+    
+    CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+    iConnection.Transaction(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer, *apClientOp);
+    
+    if ( apClientOp->HasBinaryDataArray() )
+        {
+        RegisterAndSubscribeFileProgressObserversL();
+        retVal = MoveBinaryContainersToServer(*apClientOp, apClientOp->BinaryDataArrayL());
+        }
+	    else if (apClientOp->HasSharedFileHandle())
+	    {
+	    retVal = MoveFileChunkHandleToServer(*apClientOp) ;
+	    }
+
+
+    if( iDispatcherEnabled )  // DISPATCHER IS ENABLED
+        {
+        //iTxnId = retVal;
+        TInt* pTxnId = new (ELeave) TInt(++iVirtualTransactionCounter);
+        CleanupStack::PushL(pTxnId);
+
+        TInt appendRetVal(KErrNone);
+        appendRetVal = ChunkMapL().Append( pTxnId, apClientOp );
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- ChunkMapL().Append(%d, %d) returned: %d"), *pTxnId, apClientOp->Chunk().Handle(), appendRetVal));
+        if( appendRetVal == KErrNone )
+            {
+            TMessage msg;
+            msg.iSenConnectionChunk = apClientOp;
+            msg.iSenAsyncOperation = pSenAO;
+
+            TThreadMessage thrMsg = { msg, iVirtualTransactionCounter };
+    		
+    		// INSTEAD OF DOING ANY IPC OPERATION WITH WSF (Core), THE REQUEST IS ADDED TO THE QUEUE!
+            appendRetVal = ipSenServiceDispatcher->AddToTheQueue( thrMsg ); //NOTE THAT CHUNK MAP IS NOT USED IN HERE (!)
+            if( appendRetVal==KErrNone )
+                {
+                //Required transaction id to respond back to the client
+                iTxnId = *pTxnId;
+                // OK, pTxnId, was appended successfully to the dispatchers map                
+                CleanupStack::Pop( pTxnId ); // now owned by the map
+                CleanupStack::Pop( apClientOp ); // now owned by the map
+                retVal = iVirtualTransactionCounter;
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy( pTxnId ); // orphanized
+                CleanupStack::PopAndDestroy( apClientOp ); // orphanized
+                retVal = appendRetVal;
+                }
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- ipSenServiceDispatcher->AddToTheQueue() returned: %d"), appendRetVal));
+                
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy( pTxnId ); // orphanized
+            CleanupStack::PopAndDestroy( apClientOp ); // orphanized
+            }
+        }
+    else // DISPATCHER IS DISABLED
+        {
+        // This is EXPECTED TO BE "quick" synchronous operation and returns the TxnId:        
+        retVal = iConnection.SendMsgAndReceiveTxnId(*apClientOp);
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher NOT used]: SendMsgAndReceiveTxnId returned: %d"), retVal));
+        if ( retVal > KErrNone )
+            {
+            iTxnId = retVal;
+            TInt* pTxnId = new (ELeave) TInt( iTxnId );
+            CleanupStack::PushL(pTxnId);
+
+            TInt appendRetVal(KErrNone);
+            appendRetVal = ChunkMapL().Append( pTxnId, apClientOp );
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- ChunkMapL().Append(%d, %d) returned: %d"), *pTxnId, apClientOp->Chunk().Handle(), appendRetVal));
+            if(appendRetVal==KErrNone)
+                {
+                // OK, pTxnId, was appended successfully to iChunkMap
+                CleanupStack::Pop( pTxnId ); // now owned by the map
+                CleanupStack::Pop( apClientOp ); // now owned by the map
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy( pTxnId ); // orphanized
+                CleanupStack::PopAndDestroy( apClientOp ); // orphanized
+                retVal = appendRetVal;
+                }
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy( apClientOp ); // orphanized
+            }
+        }
+	TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::SendL(CSenChunk) Completed")));        
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SendL(const TDesC8& aRequest)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(TDesC8)");
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+		if( pOperation )
+			{
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif //_SENDEBUG  
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = pOperation->DescToChunk(aRequest);
+	            if (retVal == KErrNone)
+	                {
+	                retVal = SendL(pOperation);
+	                }
+	            }
+    	    }
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("CSenServiceConnectionImpl::SendL - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(TDesC8) Completed");    	
+    return retVal;
+    }
+
+// This method is executed when one of the static constructors of service connection (NewL or NewLC) is called.
+void CSenServiceConnectionImpl::InitializeL( /* MSenServiceDescription& aSD */ )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::InitializeL");
+    if (!IsActive())
+        {
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Opening a new chunk for connection initialization descriptors");
+        delete ipInitChunk; // added
+        ipInitChunk = NULL; // added
+        TInt error( KErrConnectionInitializing );
+
+        if( iIsInternalSC )
+            {
+            ipInitChunk = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); 
+            if( !ipInitChunk )
+                {
+                error = KErrConnectionInitializing;
+                //User::Leave( error );
+                }
+            }
+        else
+            {
+            ipInitChunk = CSenChunk::NewL(NextChunkName()); // added
+            }
+        
+        
+        if( /* !error && */ ipInitChunk ) 
+            {
+            ipInitChunk->SetLogger(&iLog);
+            error = ipInitChunk->CreateChunk();
+            }
+
+        TInt serviceDescriptionLength(0);
+        TInt consumerPolicyLength(0);
+
+        // => ipInitPatternAsXml & ipInitConsumerPolicyAsXml  allocated now in ConstructL, old ConstructL moved to ConnectL
+        if( !error )
+            {
+            TPtrC8 serviceDescPtr = ipInitPatternAsXml->Des();
+            serviceDescriptionLength = serviceDescPtr.Length();
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- SD as XML:");
+            TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,( serviceDescPtr ));
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
+/*
+            if( aSD.DescriptionClassType() == MSenServiceDescription::EServicePattern )
+                {
+                CSenServicePattern* pServicePattern = (CSenServicePattern*)&aSD;
+*/                
+            if( ipInitConsumerPolicyAsXml )
+                {
+    	        TPtrC8 consumerPolicyPtr(ipInitConsumerPolicyAsXml->Des());
+    	        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::InitializeL - ConsumerPolicy:");
+    	        TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(*ipInitConsumerPolicyAsXml));
+            	error = ipInitChunk->DescsToChunk(serviceDescPtr, consumerPolicyPtr);
+                consumerPolicyLength = consumerPolicyPtr.Length();
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- DescsToChunk returned: %d"), error));
+                }
+            else
+            	{
+            	// No consumer policy provided by the service consumer application
+            	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::InitializeL - No consumer policy is used.");
+            	error = ipInitChunk->DescToChunk(serviceDescPtr);
+            	TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- DescToChunk returned: %d"), error));
+            	}
+            }
+
+        if( error )
+            {
+            // At the moment, pass through the original error code. 
+            // error code constant ("KErrSenDescToChunkFailed") 
+            TInt leaveCode(KErrNone);
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::InitializeL");
+
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Since the SC is NOT ready, pass KSenConnectionStatusCreateFailed to SetStatus. Error: (%d)"), error ));
+            DeliverStatus( KSenConnectionStatusCreateFailed );
+            TRAP( leaveCode, iObserver->HandleErrorL( error, KNullDesC8 ); )
+            if(leaveCode)
+                {
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("MSenServiceConsumer::HandleErrorL leaved: %d"), leaveCode));
+                }
+            }
+        else // no errors
+            {
+            iErrorNumber = 0;
+            iErrorNumberBuffer.Set(reinterpret_cast<TUint8*>(&iErrorNumber), sizeof(TInt), sizeof(TInt));
+            iAsyncOpsCount++;
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- iAsyncOpsCount: %d"), iAsyncOpsCount));
+            CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+
+            if( !iIsInternalSC )
+                {
+                ipConnectionStatusObserver = CSenConnectionStatusObserver::NewL(*iObserver, iConnectionID);
+                }
+            
+            if( ipExtendedConsumerInterface )
+                {
+                ipInterface = NULL;
+                ipInterface = ipExtendedConsumerInterface->GetInterfaceByUid( KSenInterfaceUidAuthenticationProvider );
+                if(ipInterface)
+                    {
+                    ipAuthProvider = (MSenAuthenticationProvider*) ipInterface;
+                    // Register authentication observer
+					
+                    error = RegisterAuthenticationObserver();
+#ifdef _SENDEBUG                    
+                    if( error )
+                        {
+                        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- RegisterAuthenticationObserver() failed!");                            
+                        }
+#endif // _SENDEBUG                        
+                    }
+                TInt retCode( KErrNone );
+                ipInterface = NULL;
+                ipInterface = ipExtendedConsumerInterface->GetInterfaceByUid( KSenInterfaceUidCoBrandingObserver );
+                if(ipInterface)
+                    {
+                    ipCoBrandingObserver = (MSenCoBrandingObserver*) ipInterface;
+                    
+                    // Register CoBranding observer
+                    retCode = RegisterCoBrandingObserver();
+              
+                    if( retCode )
+                        {
+                        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- RegisterCoBrandingObserver() failed!");
+                        if( !error )
+                            {
+                            // none of the previous "register" IPC operations have failed so far:
+                            error = retCode;  // ok to assign this as the error
+                            }
+                        }
+                    }
+                ipInterface = NULL;
+                ipInterface = ipExtendedConsumerInterface->GetInterfaceByUid( KSenInterfaceUidFilesObserver );
+                if( ipInterface )
+                    {
+                    iFilesObserver = (MSenFilesObserver*) ipInterface;
+                    // Register Files observer
+
+                    //retCode = RegisterFilesObserver();// Moved to SendL and SubmitL to avoid unnecessary calls of RegisterFilesObserver
+									 					// and making the constructor light weight
+ 					
+ 					// ==> 2008-11-05 mmattola: 
+ 					// commenting RegisterFilesObserver() OUT would be OK otherwise,
+ 					//  BUT(!): that would mean that that the client CANNOT receive any "progress" info BEFORE / PRIOR sending something out(!) => not good!
+						
+				    
+                    
+                    if ( !iRegisterFileObserverDone )
+                        {
+                        TLSLOG_L( KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel, "InitializeL(): - Calling IssueRegistrations()");
+                        //ipRegistrationTimer->IssueRegistrations( ETrue );
+                        
+                        /*
+                        retCode = RegisterAndSubscribeFileProgressObserversL(); // returning this in here, to ENABLE early reception
+                        if( retCode )
+                            {
+                            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- RegisterFilesObserver() failed!");
+                            if( !error )
+                                {
+                                // none of the previous "register" IPC operations have failed so far:
+                                error = retCode; // ok to assign this as the error
+                                }
+                            }
+                        */
+                        } // end of if ( !iRegisterFileObserverDone )
+                    }
+                ipInterface = NULL;
+                ipInterface = ipExtendedConsumerInterface->GetInterfaceByUid( KSenInterfaceUidHostletConsumer );
+                if(ipInterface)
+                    {
+                    ipHostletConsumer = (MSenHostletConsumer*) ipInterface;
+                    }
+                    
+                ipInterface = NULL;
+                ipInterface = ipExtendedConsumerInterface->GetInterfaceByUid( KSenInterfaceUidUserinfoProvider );
+                //if(ipInterface)
+                //    {
+                //    iUserinfoProvider = (MSenUserinfoProvider*) ipInterface;
+                //    }
+                
+                ipInterface = NULL;
+                ipInterface = ipExtendedConsumerInterface->GetInterfaceByUid( KSenInterfaceUidAlrObserver );
+
+#ifdef __ENABLE_ALR__
+                if(ipInterface)
+                    {
+                    iMobiltyObserver = (MMobilityProtocolResp*) ipInterface;
+                    
+                    // Register mobility observer
+                    retCode = RegisterMobilityObserverL();
+
+                    if( retCode )
+                        {
+                        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- RegisterMobilityObserver() failed!");
+                        if( !error )
+                            {
+                            // none of the previous "register" IPC operations have failed so far:
+                            error = retCode; // ok to assign this as the error
+                            }
+                        }
+                    }
+#endif //__ENABLE_ALR__
+
+                if( !error )
+                	{
+                	if(ipAuthProvider)
+                    	{
+                    	iConnection.Initialize( pSenAO->iStatus,
+                                            	pSenAO->iErrorNumberBuffer,
+                                            	iSessionIdBuffer,
+                                            	*ipInitChunk,
+                                            	serviceDescriptionLength,
+                                            	consumerPolicyLength,
+                                            	ETrue );
+                    	}
+                    	else
+                    	{
+                    	iConnection.Initialize( pSenAO->iStatus,
+                                            	pSenAO->iErrorNumberBuffer,
+                                            	iSessionIdBuffer,
+                                            	*ipInitChunk,
+                                            	serviceDescriptionLength,
+                                            	consumerPolicyLength,
+                                            	EFalse );
+                    	}
+                	}
+                else // occured
+                	{
+                	// Initialization of connection agent / some of the "register" -alike IPC ops failed 
+                	TInt leaveCode(KErrNone);
+                	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::InitializeL");
+
+                	TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Since the SC is NOT ready, pass KSenConnectionStatusCreateFailed to SetStatus. Error: (%d)"), error ));
+                	DeliverStatus( KSenConnectionStatusCreateFailed );
+                	TRAP( leaveCode, iObserver->HandleErrorL( error, KNullDesC8 ); )
+                	if(leaveCode)
+                		{
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("MSenServiceConsumer::HandleErrorL leaved: %d"), leaveCode));
+                	    }
+                	}
+                                    
+                
+            }
+            else
+                {
+                iConnection.Initialize( pSenAO->iStatus,
+                                        pSenAO->iErrorNumberBuffer,
+                                        iSessionIdBuffer,
+                                        *ipInitChunk,
+                                        serviceDescriptionLength,
+                                        consumerPolicyLength,
+                                        EFalse );
+                }
+            }
+        }
+    else
+        {
+        // Error occurred!
+        TInt leaveCode(KErrNone);
+        // This is actually AO "busy" case, but due sequential calls to SC's ConstructL()
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::InitializeL");
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Since the SC is NOT ready (AO is busy), pass KSenConnectionStatusCreateFailed to SetStatus.");
+        DeliverStatus( KSenConnectionStatusCreateFailed );
+
+        TRAP( leaveCode, iObserver->HandleErrorL(KErrConnectionInitializing, KNullDesC8); )
+        if(leaveCode)
+            {
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("MSenServiceConsumer::HandleErrorL leaved: %d"), leaveCode ));
+            }
+        }
+		        
+    }
+
+TPtrC CSenServiceConnectionImpl::NextChunkName()
+    {
+    if(ipChunkName)
+        {
+        iChunkNameNumber++;
+        TPtr chunkname = ipChunkName->Des();
+        chunkname.Zero();
+        TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,(iSessionIdBuffer));
+
+        if(iSessionIdBuffer.Length()>KSenUuidPrefixLength)
+            {
+            chunkname.Append(iSessionIdBuffer.Right(iSessionIdBuffer.Length()-KSenUuidPrefixLength));
+            }
+        chunkname.AppendNum(iChunkNameNumber);
+
+        // Remove dashes
+         _LIT(KDash, "-");
+        TInt pos = chunkname.Find(KDash);
+        while (pos != KErrNotFound)
+            {
+            chunkname.Replace(pos, KDash().Length(), KNullDesC);
+            pos = chunkname.Find(KDash);
+            }
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L("CSenServiceConnectionImpl::NextChunkName(): %S"), &chunkname));
+        return chunkname.Left(KMaxName); // max length of TName
+        }
+    else
+        {
+        return KNullDesC();
+        }  
+    }
+void CSenServiceConnectionImpl::RunL()
+    {
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::RunL( %d )"),
+                                            iStatus.Int()));
+    }
+void CSenServiceConnectionImpl::HandleMessageFromChildAOL(TInt aStatus)
+    {
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::HandleMessageFromChildAOL( %d )"),
+                                            aStatus));
+    iAsyncOpsCount--;
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- One async op completed. Pending iAsyncOpsCount: %d"), iAsyncOpsCount));
+                                            
+    switch (aStatus)
+        {
+        case ESenServInitialized:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: ESenServInitialized");
+
+            TInt leaveCode(KErrNone);
+            if ( iErrorNumber == KErrNone )
+                {
+                iInitialized = ETrue;
+
+                if ( ipCompleteServerMsgsOnOff )
+                    {
+                    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Performing ctr-implicit call to pending CompleteServerMessagesOnOff" );
+                    TBool complete = *ipCompleteServerMsgsOnOff;
+                    TInt errorCode = CompleteServerMessagesOnOff( complete );
+#ifdef _SENDEBUG                        
+                    if ( errorCode )
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8( "´- Ctr-implicit call to CompleteServerMessagesOnOff failed: (%d)!"), errorCode));
+                        }
+                    else
+                        {
+                        if( complete )
+                            {
+                            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , "- Ctr-implicit call ok. Complete msgs mode: ON (true)" );
+                            }
+                        else
+                            {
+                            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , "- Ctr-implicit call ok. Complete msgs mode: OFF (false)" );
+                            }
+                        }                        
+#endif // _SENDEBUG                    
+
+
+                    }
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::HandleMessageFromChildAOL - Calling SetStatus(%d)"), KSenConnectionStatusReady ));
+                DeliverStatus( KSenConnectionStatusReady ); // Service session is valid and ready to be used!
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- Session ID (%d bytes):"), iSessionIdBuffer.Length()));
+                TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel ,( iSessionIdBuffer.Right(iSessionIdBuffer.Length()-5) ));
+                }
+            else
+                {
+                // Error occurred   
+                DeliverStatus( KSenConnectionStatusCreateFailed );
+                
+                TPtrC8 errorDescription;
+                TInt retVal = ipInitChunk->DescFromChunk(errorDescription);
+
+                TInt error = iErrorNumber;
+                if ( error == KErrSenSoapFault && !iInitialized ) // China DC
+                    {
+                    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Since the SC is NOT ready, pass KErrSenAuthenticationFault to HandleErrorL instead of KErrSenSoapFault");
+                    error = KErrSenAuthenticationFault;
+                    }
+                    
+                if ( retVal == KErrNone )
+                    {
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("HandleMessageFromChildAOL: ESenServInitialize failed: %d"), error ));
+                    TRAP( leaveCode, iObserver->HandleErrorL(error, errorDescription); )
+                    if( leaveCode )
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("MSenServiceConsumer::HandleMessageFromChildAOL - HandleErrorL leaves with %d"), leaveCode));
+                        }
+                    }
+                else
+                    {
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- DescFromChunk failed: %d - callback will provide err code (%d) only."), retVal, error));
+                    DeliverResponseL( error );
+                    }
+                }
+            delete ipInitChunk;
+            ipInitChunk = NULL;
+            delete ipInitPatternAsXml;
+            ipInitPatternAsXml = NULL;
+            delete ipInitConsumerPolicyAsXml;
+            ipInitConsumerPolicyAsXml = NULL;
+
+            break;
+            }
+
+        case ESenServRequestResponsed:       
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: ESenServRequestResponsed");
+            if ( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+                {
+                TInt keyAt = ipSenServiceDispatcher->GetVirtualTransactionID( &iTxnId );
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: Looking for virtual transaction ID");
+                if( keyAt != KErrNotFound )
+                    {
+                    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: Found virtual transaction ID");
+                    TInt index = ChunkMapL().Find(keyAt);
+                    if ( index != KErrNotFound )
+                        {
+                        CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                        TPtrC8 response;
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher is enabled]: HandleMessageFromChildAOL - mapped RChunk's handle: %d"), pOperation->Chunk().Handle()));
+
+                        TInt retVal = pOperation->DescFromChunk(response);
+                        if ( retVal == KErrNone )
+                            {
+                            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- [dispatcher is enabled]: DescFromChunk ok");
+                            DeliverResponseL(iErrorNumber, pOperation);
+                            }
+                        else
+                            {
+                            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is enabled]: DescFromChunk failed: %d"), retVal));
+                            DeliverResponseL(retVal);
+                            }
+                        // Delete TxnId and CSenClientOp
+                        retVal = ChunkMapL().Remove(*pOperation);
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is enabled]: ChunkMap().Remove() returned: %d"), retVal));
+                        retVal = ipSenServiceDispatcher->RemoveFromTransMap(&keyAt);
+                        }
+                    else
+                        {
+                        LOG_WRITEFORMAT((_L("- Closing the transaction due SendL has failed: %d"), iErrorNumber));
+                        }
+                    }
+                else
+                    {
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher is enabled]: Closing the transaction due SendL has failed: %d"), iErrorNumber));
+                    }
+                }
+            else // DISPATCHER IS DISABLED
+                {
+                TInt index = ChunkMapL().Find(iTxnId);
+                if ( index != KErrNotFound )
+                    {
+                    CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                    TPtrC8 response;
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher is disabled]: HandleMessageFromChildAOL - mapped RChunk's handle: %d"), pOperation->Chunk().Handle()));
+
+                    TInt retVal = pOperation->DescFromChunk(response);
+                    if ( retVal == KErrNone )
+                        {
+                        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- [dispatcher is disabled]: DescFromChunk ok");
+                        DeliverResponseL(iErrorNumber, pOperation);
+                        }
+                    else
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is disabled]: DescFromChunk failed: %d"), retVal));
+                        DeliverResponseL(retVal);
+                        }
+
+                    // Delete TxnId and CSenClientOp
+                    retVal = ChunkMapL().Remove(*pOperation);
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is disabled]: ChunkMap().Remove() returned: %d"), retVal));
+                    retVal = 0; // not used in release builds
+                    }
+                else
+                    {
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher is disabled]: Closing the transaction due SendL has failed: %d"), iErrorNumber));
+                    }
+                }
+            break;
+            }
+
+        case ESenInternalError:
+            {
+            delete ipInitChunk; // added, pre-emptive de-alloc in case of errors..
+            ipInitChunk = NULL; // added
+            delete ipInitPatternAsXml;
+            ipInitPatternAsXml = NULL;
+            delete ipInitConsumerPolicyAsXml;
+            ipInitConsumerPolicyAsXml = NULL;
+            
+            // we could have someting in iErrorNumber in some cases
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: ESenInternalError");
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Last received error from server: (%d)"),
+                    iErrorNumber));
+
+            DeliverResponseL(KErrSenInternal);
+            }
+            break;
+
+        case ESenServRequestCancelled:
+            {
+            DeliverResponseL( KErrSenCancelled);
+            }
+            break;
+
+        case ESenReAuthAndResendNeeded:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: ESenReAuthAndResendNeeded");
+            
+            TInt retVal(KErrNone);
+            if ( iAsyncOpsCount >= KAsyncMessageSlots)
+                {
+                retVal = KErrSenServiceConnectionBusy;
+                }
+                
+            if ( retVal == KErrNone )
+                {
+                if ( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+                    {
+                    TInt keyAt = ipSenServiceDispatcher->GetVirtualTransactionID(&iTxnId);
+                    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: Looking for virtual transaction ID");
+                    if(keyAt != KErrNotFound)
+                        {
+                        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: Found virtual transaction ID");
+                        TInt index = ChunkMapL().Find(keyAt);
+                        if ( index != KErrNotFound )
+                            {
+                            CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                            
+                            pOperation->ChunkHeader().SetDoInitBeforeSending(ETrue);
+                            
+                            iAsyncOpsCount++;
+                            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher enabled]: iAsyncOpsCount: %d"), iAsyncOpsCount));
+                            CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+                            iConnection.Transaction(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer, *pOperation);
+
+                            if ( pOperation->HasBinaryDataArray() )
+                                {
+                                retVal = MoveBinaryContainersToServer(*pOperation, pOperation->BinaryDataArrayL());
+                                }
+                            // Reauthentication
+                            if(ipAuthProvider)
+                            	{
+                            	pSenAO->iReauthTxnId = iTxnId;
+                            	if(iReauthenticationNeeded)
+                            		{
+                            		iReauthenticationNeeded = EFalse; // unmark reauthentication flag
+        	                    	TInt lerror(KErrNone);
+        	                    	TRAP(lerror, ReauthNeededL(KNullDesC8));
+        	                    	}
+                            	}
+                            // This is quick and returns the TxnId:
+                            retVal = iConnection.SendMsgAndReceiveTxnId(*pOperation);
+                            //iTxnId = retVal;
+                            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher enabled]: SendMsgAndReceiveTxnId returned: %d"), retVal));
+                        	TInt* pActlTxnId = new (ELeave) TInt(0);
+    			            *pActlTxnId = iTxnId /*retVal*/;
+    				        CleanupStack::PushL(pActlTxnId);
+    				
+                            retVal = ipSenServiceDispatcher->UpdateTransMap(&keyAt,pActlTxnId);
+                            if(retVal == KErrNone)
+                                {
+                                CleanupStack::Pop(pActlTxnId);
+                                }
+                            else
+                                {
+    			    	        CleanupStack::PopAndDestroy(pActlTxnId);
+                                }
+                            }
+                        else
+                            {
+                            retVal = KErrSenInternal;
+                            }
+                        }
+                    else
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher enabled]: ChunkMap().FindKey(%d) failed!"), iTxnId));
+                        retVal = KErrSenInternal;
+                        }
+                        
+                    }
+                else // DISPATCHER IS DISABLED
+                    {
+                    TInt index = ChunkMapL().Find(iTxnId);
+                    if ( index != KErrNotFound )
+                        {
+                        CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                        
+                        pOperation->ChunkHeader().SetDoInitBeforeSending(ETrue);
+                        
+                        iAsyncOpsCount++;
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher disabled]: iAsyncOpsCount: %d"), iAsyncOpsCount));
+                        CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+                        iConnection.Transaction(pSenAO->iStatus, pSenAO->iErrorNumberBuffer,
+                                                pSenAO->iTxnIdBuffer, *pOperation);
+
+                        if ( pOperation->HasBinaryDataArray() )
+                            {
+                            retVal = MoveBinaryContainersToServer(*pOperation,
+                                                                  pOperation->BinaryDataArrayL());
+                            }
+                        // Reauthentication
+                        if(ipAuthProvider)
+                        	{
+                        	pSenAO->iReauthTxnId = iTxnId;
+                        	if(iReauthenticationNeeded)
+                        		{
+                        		iReauthenticationNeeded = EFalse; //unmark reauthentication flag
+    	                    	TInt lerror(KErrNone);
+    	                    	TRAP(lerror, ReauthNeededL(KNullDesC8));
+    	                    	}
+                        	}
+                        // This is quick and returns the TxnId:
+                        retVal = iConnection.SendMsgAndReceiveTxnId(*pOperation);
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher disabled]: SendMsgAndReceiveTxnId returned: %d"), retVal));
+                        }
+                    else
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher disabled]: ChunkMap().FindKey(%d) failed!"), iTxnId));
+                        retVal = KErrSenInternal;
+                        }
+                    }
+                }
+                
+            if ( retVal < KErrNone )
+                {
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher disabled]:  Resend failed: %d"), retVal));
+                // Note: do NOT return anything to consumer here (never call DeliverResponseL(retVal) here!)
+                }
+            }
+            break;
+
+        case ESenResendNeeded:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: ESenResendNeeded");
+
+            TInt retVal(KErrNone);
+            if ( iAsyncOpsCount >= KAsyncMessageSlots )
+                {
+                retVal = KErrSenServiceConnectionBusy;
+                }
+                
+            if ( retVal == KErrNone )
+                {
+                if( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+                    {
+                    TInt keyAt = ipSenServiceDispatcher->GetVirtualTransactionID( &iTxnId );
+                    
+                    if(keyAt != KErrNotFound)
+                        {
+                        TInt index = ChunkMapL().Find(keyAt);
+                        if(index != KErrNotFound)
+                            {
+                            CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                            
+                            iAsyncOpsCount++;
+                            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is enabled]: iAsyncOpsCount: %d"), iAsyncOpsCount));
+                            CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL( this );
+                            iConnection.Transaction(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer, *pOperation);
+                                
+                            if ( pOperation->HasBinaryDataArray() )
+                                {
+                                retVal = MoveBinaryContainersToServer(*pOperation, pOperation->BinaryDataArrayL());
+                                }
+
+                            // This is EXPECTED TO BE "quick" SYNC IPC OPERATION THAT "just" returns the TxnId:
+                            
+                            // shouldn't this potentially "slow" IPC be performed 
+                            // by dispatcher(?) => resending is not handled by "dispatcher thread" now..
+                            retVal = iConnection.SendMsgAndReceiveTxnId(*pOperation); 
+                            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is enabled]: SendMsgAndReceiveTxnId returned: %d"), retVal));
+                            }
+                        else
+                            {
+                            retVal = KErrSenInternal;
+                            }
+                        }
+                    else
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher is enabled]: ChunkMap().FindKey(%d) failed!"), iTxnId));                    
+                        retVal = KErrSenInternal;
+                        }
+                    }
+                else // DISPATCHER IS DISABLED
+                    {
+                    TInt index = ChunkMapL().Find(iTxnId);
+                    if(index != KErrNotFound)
+                        {
+                        CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                        
+                        iAsyncOpsCount++;
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is disabled]: iAsyncOpsCount: %d"), iAsyncOpsCount));
+                        CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+                        iConnection.Transaction(pSenAO->iStatus, pSenAO->iErrorNumberBuffer,
+                                                pSenAO->iTxnIdBuffer, *pOperation);
+                            
+                        if ( pOperation->HasBinaryDataArray() )
+                            {
+                            retVal = MoveBinaryContainersToServer(*pOperation,
+                                                                  pOperation->BinaryDataArrayL());
+                            }
+
+                        // This is quick and returns the TxnId:
+                        retVal = iConnection.SendMsgAndReceiveTxnId(*pOperation);
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- [dispatcher is disabled]:  SendMsgAndReceiveTxnId returned: %d"), retVal));
+                        }
+                    else
+                        {
+                        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- [dispatcher is disabled]: ChunkMap().FindKey(%d) failed!"), iTxnId));                    
+                        retVal = KErrSenInternal;
+                        }
+                    }
+                
+                }
+                
+            if ( retVal < KErrNone )
+                {
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("=> Resend failed: %d"), retVal));
+                // Note: do NOT return anything to consumer here (never call DeliverResponseL(retVal) here!)
+                }
+            }
+            break;
+            
+        case ESenReAuthNeeded:
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: ESenReAuthNeeded");
+
+            TInt retVal(KErrNone);
+            if ( iAsyncOpsCount >= KAsyncMessageSlots )
+                {
+                retVal = KErrSenServiceConnectionBusy;
+                }
+                
+            if ( retVal == KErrNone )
+                {
+                iErrorNumber = 0;
+                iErrorNumberBuffer.Set(reinterpret_cast<TUint8*>(&iErrorNumber), sizeof(TInt), sizeof(TInt));
+                iAsyncOpsCount++;
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- iAsyncOpsCount: %d"), iAsyncOpsCount));
+                CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+                
+                TInt serviceDescriptionLength(0);
+                TInt consumerPolicyLength(0);
+                
+                TPtrC8 serviceDescPtr = ipInitPatternAsXml->Des();
+                serviceDescriptionLength = serviceDescPtr.Length();
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"- SD as XML:");
+                TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,( serviceDescPtr ));
+                
+                if( ipInitConsumerPolicyAsXml )
+                    {
+        	        TPtrC8 consumerPolicyPtr(ipInitConsumerPolicyAsXml->Des());
+        	        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"CSenServiceConnectionImpl::Reauthentication - ConsumerPolicy:");
+        	        TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,(*ipInitConsumerPolicyAsXml));
+                	retVal = ipInitChunk->DescsToChunk(serviceDescPtr, consumerPolicyPtr);
+                    consumerPolicyLength = consumerPolicyPtr.Length();
+                    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- DescsToChunk returned: %d"), retVal));
+                    }
+                else
+                	{
+                	// No consumer policy provided by the service consumer application
+                	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - No consumer policy is used.");
+                	retVal = ipInitChunk->DescToChunk(serviceDescPtr);
+                	TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- DescToChunk returned: %d"), retVal));
+                	}
+                	
+    	        if ( retVal == KErrNone )
+    	            {
+                    if ( ipAuthProvider )
+                        {
+                        CSenXmlServiceDescription* pServDesc =
+                      	CSenXmlServiceDescription::NewLC();
+	                    CSenXmlReader* pXmlReader =
+	                       	CSenXmlReader::NewLC(KXmlParserMimeType);
+	                    pXmlReader->SetContentHandler(*pServDesc);
+	                    pServDesc->SetReader(*pXmlReader);
+	                    TInt retVal = pServDesc->BuildFrom(serviceDescPtr);
+	                    CleanupStack::PopAndDestroy(pXmlReader);
+	                    
+	                    if(retVal == KErrNone)
+	                       	{
+	                        TPtrC8 providerId = pServDesc->ProviderId();
+	                        TInt lerror(KErrNone);
+	                        TRAP(lerror, retVal = ReauthNeededL(providerId));
+	                        if(lerror != KErrNone)
+	                        	{
+	                        	// Leave occured, most probably because of callback function
+	                        	retVal = lerror;
+	                        	}
+	                      	CleanupStack::PopAndDestroy(pServDesc);
+	                       	}
+	                    else
+	                    	{
+	                    	CleanupStack::PopAndDestroy(pServDesc);
+	                    	}
+
+                        // Call the asynchronous connection initilizer
+	                    if(retVal == KErrNone)
+	                    	{
+	                    if ( ipAuthProvider )
+	                        {
+	                        iConnection.Initialize( pSenAO->iStatus,
+	                                                pSenAO->iErrorNumberBuffer,
+	                                                iSessionIdBuffer,
+	                                                *ipInitChunk,
+	                                                serviceDescriptionLength,
+	                                                consumerPolicyLength,
+	                                                ETrue );
+	                        }
+	                    else
+	                        {
+	                        iConnection.Initialize( pSenAO->iStatus,
+	                                                pSenAO->iErrorNumberBuffer,
+	                                                iSessionIdBuffer,
+	                                                *ipInitChunk,
+	                                                serviceDescriptionLength,
+	                                                consumerPolicyLength,
+	                                                EFalse );
+	                         }
+                        }
+                        }
+                    else
+                        {
+                        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - authentication provider not found!");
+                        retVal = KErrGeneral;
+                        }
+    	            }
+                }
+                
+            if ( retVal < KErrNone )
+                {
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- ReAuth failed: %d"), retVal));
+                // Note: do NOT return anything to consumer here (never call DeliverResponseL(retVal) here!)
+                // Error occurred   
+                //TRAP( leaveCode, iObserver->SetStatus( KSenConnectionStatusCreateFailed ); )
+                DeliverStatus( KSenConnectionStatusCreateFailed );
+                
+                TPtrC8 errorDescription;
+                TInt retVal = ipInitChunk->DescFromChunk(errorDescription);
+
+                TInt error = KErrSenSoapFault;
+                if ( error == KErrSenSoapFault && !iInitialized ) // China DC
+                    {
+                    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Since the SC is NOT ready, pass KErrSenAuthenticationFault to HandleErrorL instead of KErrSenSoapFault");
+                    error = KErrSenAuthenticationFault;
+                    }
+
+                if ( retVal == KErrNone )
+                	{
+                     TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("HandleMessageFromChildAOL: ESenServInitialize failed: %d"), error ));
+                     TInt leaveCode(KErrNone);
+                     TRAP( leaveCode, iObserver->HandleErrorL(error, errorDescription); )
+                     if( leaveCode )
+                    	 {
+                         TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("MSenServiceConsumer::HandleMessageFromChildAOL - HandleErrorL leaves with %d"), leaveCode));
+                         }
+                     }
+                else
+                     {
+                     TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- DescFromChunk failed: %d - callback will provide err code (%d) only."), retVal, error));
+                     //DeliverResponseL(retVal);
+                     DeliverResponseL( error );
+                     }
+                
+                delete ipInitChunk;
+                ipInitChunk = NULL;
+                delete ipInitPatternAsXml;
+                ipInitPatternAsXml = NULL;
+                delete ipInitConsumerPolicyAsXml;
+                ipInitConsumerPolicyAsXml = NULL;
+                }
+            }
+            break;
+
+        default:
+            {
+            delete ipInitChunk; // added, pre-emptive de-alloc in case of errors..
+            ipInitChunk = NULL; // added
+            
+#ifdef _SENDEBUG                
+            if ( aStatus == KErrPermissionDenied )
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"HandleMessageFromChildAOL: default - KErrPermissionDenied");
+                }
+            else
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"RunL: default - unexpected error.");
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("Last received error from server: (%d)"), iErrorNumber));
+                }
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("RunL, iStatus.Int(): (%d)"), iStatus.Int()));
+            
+#endif // _SENDEBUG             
+            // WSF does not generalize errors:
+            if( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+                {
+                TInt index = ChunkMapL().Find(iVirtualTransactionCounter);
+                if ( index != KErrNotFound )
+                    {
+                    CSenConnectionChunk* pOperation = (CSenConnectionChunk*)ChunkMapL().ValueAt(index);
+                    DeliverResponseL(aStatus);
+                    ChunkMapL().Remove(*pOperation);
+                    }
+                }
+            else // DISPATCHER IS DISABLED
+                {
+                DeliverResponseL(aStatus);
+                }
+            break ;
+            }
+        }
+    }
+
+// Helper function, which delivers response to Service Consumer 
+void CSenServiceConnectionImpl::DeliverResponseL(const TInt aErrorCode, CSenChunk* apOperation)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::DeliverResponseL");
+    iTransactionIdKnown = ETrue;
+    
+    TInt statusCode(aErrorCode);
+    TPtrC8 response(KNullDesC8);
+    CSenMessageBase* pMessage = NULL;
+    if( apOperation )
+        {
+        pMessage = CSenMessageBase::NewLC(*apOperation);
+        iResponse = pMessage;
+
+        TInt retVal = apOperation->DescFromChunk(response);
+        if( retVal == KErrNone )
+            {
+            TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- DescFromChunk ok");
+            // If data was read ok from chunk, then the status code is in 
+            // the IPC arg that was written by Core over process boundary:
+            statusCode = iErrorNumber; 
+            }
+        else
+            {
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- DescFromChunk failed: %d"), retVal));
+            statusCode = retVal;
+            response.Set(KNullDesC8);
+            }
+        }
+
+
+    if( ipHostletConsumer )
+        {
+        ipHostletConsumer->SetConnectionId( iConnectionID );
+        }        
+
+        
+    if( statusCode == KErrNone )
+        {
+        // STANDARD, "OK" RESPONSE
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- response, (%d bytes):"), response.Length()));
+        TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,(response));
+        TRAPD( err, iObserver->HandleMessageL( response ); )
+        if(err)
+            {
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("DeliverResponseL: HandleMessageL() leaved: %d"), err));
+            }
+        }
+    else  // SOAP FAULT or ERROR
+        {
+        if( statusCode == KErrSenSoapFault)
+            {
+            TInt error = statusCode;   
+                
+            // SOAP FAULT
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KNormalLogLevel , _L8("- SOAP fault (%d bytes):"), response.Length()));
+            TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,(response));
+
+            if ( error == KErrSenSoapFault && !iInitialized ) // China DC
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::DeliverResponseL:");
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- Since the SC is NOT ready, pass KErrSenAuthenticationFault to HandleErrorL instead of KErrSenSoapFault");
+                error = KErrSenAuthenticationFault;
+                }
+            TRAPD(err, iObserver->HandleErrorL( error, response ));
+            if(err)
+                {
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("DeliverResponseL: HandleErrorL() leaved: %d"), err));
+                }
+            }
+        else // some other ERROR, not a SOAPFault
+            {
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- error code (%d), error data (%d bytes):"), statusCode, response.Length()));
+            TLSLOG_ALL(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,(response));
+
+            TRAPD(err, iObserver->HandleErrorL(statusCode, response));
+            if(err)
+                {
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("DeliverResponseL: HandleErrorL() leaved: %d"), err));
+                }
+            }
+        }
+    if( apOperation )
+        {
+        iResponse = NULL;
+        CleanupStack::PopAndDestroy( pMessage );
+        }
+    iTransactionIdKnown = EFalse;
+    }
+
+void CSenServiceConnectionImpl::DoCancel()
+    {
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::DoCancel")));
+	if (iCancelSession == EFalse)
+	{
+	    if( iDispatcherEnabled )
+	        {
+	        ipSenServiceDispatcher->ResetQueue();
+	        }
+
+	    TInt cancelLeaveCode(KErrNone);
+	    CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+	    TRAP(cancelLeaveCode, iConnection.CancelSession(pSenAO->iStatus));
+#ifdef _SENDEBUG
+	    if(cancelLeaveCode!=KErrNone)
+	        {
+	        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- CancelSession leaved: %d)"), 
+	            cancelLeaveCode));
+	        }
+#endif //_SENDEBUG  
+	    cancelLeaveCode=0;
+	    TRequestStatus* status = &iStatus;
+	    User::RequestComplete( status, KErrCancel );
+  		//iCancelSession = ETrue;
+	}
+    TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceConnectionImpl::DoCancel Completed")));
+    }
+
+RFileLogger* CSenServiceConnectionImpl::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+TInt CSenServiceConnectionImpl::SendL(CSenSoapEnvelope& aMessage )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP)");
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+        if( pOperation )
+        	{
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif // _SENDEBUG
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = AssignPropertiesToChunkL(*pOperation, aMessage);	//codescannerwarnings
+	            if (retVal == KErrNone)
+	                {
+	                pOperation->ChunkHeader().SetMessageType(MSenMessage::ESoapMessage);
+	                retVal = SendL(pOperation);
+	                }
+	            }
+        	}
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SendL(SOAP) - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP) Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SubmitL(CSenSoapEnvelope& aMessage, 
+                                        HBufC8*& aResponseTo)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL(SOAP)");
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+        if( pOperation )
+        	{
+	        CleanupStack::PushL( pOperation );
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif // _SENDEBUG
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = AssignPropertiesToChunkL(*pOperation, aMessage);	//codescannerwarnings
+	            if (retVal == KErrNone)
+	                {
+	                pOperation->ChunkHeader().SetMessageType(MSenMessage::ESoapMessage);
+	                retVal = SubmitL(*pOperation);
+	                if (retVal != KErrNone && retVal != KErrSenSoapFault)
+	                    {
+	                    aResponseTo = NULL;
+	                    }
+	                else
+	                    {
+	                    retVal = ResponseFromChunk(*pOperation, aResponseTo);
+	                    }
+	                }
+	            }
+	        CleanupStack::PopAndDestroy(pOperation);
+        	}
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL(SOAP) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SubmitL(SOAP) - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL(SOAP) Completed");
+    return retVal;
+    }
+    
+
+CSenElement& CSenServiceConnectionImpl::AsElement()
+    {
+    return iFragment->AsElement();
+    }
+
+    /**
+    *  @return the current object as element. May return NULL.
+    *          Caller takes ownership.
+*/
+CSenElement* CSenServiceConnectionImpl::ExtractElement()
+    {
+    return iFragment->ExtractElement();
+    }
+
+void CSenServiceConnectionImpl::SetReader(CSenXmlReader& aReader)
+    {
+    iFragment->SetReader(aReader);
+    }
+
+CSenXmlReader* CSenServiceConnectionImpl::Reader()
+    {
+    return iFragment->Reader();
+    }
+
+void CSenServiceConnectionImpl::ParseL(const TDesC8& aBuf)
+    {
+    iFragment->ParseL(aBuf);
+    }
+
+TInt CSenServiceConnectionImpl::BuildFrom(const TDesC8& aBuf)
+    {
+    return iFragment->BuildFrom(aBuf);
+    }
+
+void CSenServiceConnectionImpl::DelegateParsingL(MSenFragment& aDelegate)
+    {
+    iFragment->DelegateParsingL(aDelegate);
+    }
+
+void CSenServiceConnectionImpl::DelegateParsingL(
+                                         const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes)
+    {
+    iFragment->DelegateParsingL(aNsUri, aLocalName, aQName, aAttributes);
+    }
+
+void CSenServiceConnectionImpl::ParseWithL(CSenXmlReader& aReader)
+    {
+    iFragment->ParseWithL(aReader);
+    }
+
+void CSenServiceConnectionImpl::SetOwner(MSenFragment& aFragment)
+    {
+    iFragment->SetOwner(aFragment);
+    }
+
+void CSenServiceConnectionImpl::ResumeParsingFromL( const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aQName)
+    {
+    iFragment->ResumeParsingFromL(aNsUri, aLocalName, aQName);
+    }
+
+void CSenServiceConnectionImpl::SetAttributesL(
+                                            const RAttributeArray& aAttributes)
+    {
+    iFragment->SetAttributesL(aAttributes);
+    }
+
+
+void CSenServiceConnectionImpl::WriteStartElementL(
+                                const TDesC8& aNsUri,
+                                const TDesC8& aLocalName,
+                                const TDesC8& aQName,
+                                const RAttributeArray& aAttributes
+                                )
+    {
+    iFragment->WriteStartElementL(aNsUri, aLocalName, aQName, aAttributes);
+    }
+
+void CSenServiceConnectionImpl::WriteEndElementL(
+                              const TDesC8& aNsUri,
+                              const TDesC8& aLocalName,
+                              const TDesC8& aQName
+                              )
+    {
+    iFragment->WriteEndElementL(aNsUri, aLocalName, aQName);
+    }
+
+
+TInt CSenServiceConnectionImpl::ServiceDescriptionL(HBufC8*& aServiceDescription)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::ServiceDescriptionL");
+
+    TInt retVal(KErrSenNotInitialized);
+    
+    if(iInitialized)
+        {
+        iResponseLength = 0;
+        iInBuffer.Set(reinterpret_cast<TUint8*>(&iResponseLength),
+            sizeof(TInt),
+            sizeof(TInt));
+
+        retVal = iConnection.RequestServiceDescription(iInBuffer);
+        if(retVal==KErrNone)
+            {
+            if(iResponseLength<1)
+                {
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"- FATAL error in RequestServiceDescription:");
+                TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"  return code OK, response size <= 0 bytes!");
+                aServiceDescription = NULL;
+                return KErrUnderflow;
+                }
+
+            aServiceDescription = HBufC8::NewL(iResponseLength);
+            TPtr8 buf = aServiceDescription->Des();
+            retVal = iConnection.ReceiveServiceDescription(buf);
+            }
+        }
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::ServiceDescriptionL Completed");
+    return retVal;
+    }
+
+
+const TDesC8& CSenServiceConnectionImpl::LocalName() const
+    {
+    if(iFragment)
+        return iFragment->LocalName();
+    else
+        return KNullDesC8;
+    }
+
+const TDesC8& CSenServiceConnectionImpl::NsUri() const
+    {
+    if(iFragment)
+        return iFragment->NsUri();
+    else
+        return KNullDesC8;
+    }
+
+const TDesC8& CSenServiceConnectionImpl::NsPrefix() const
+    {
+    if(iFragment)
+        return iFragment->NsPrefix();
+    else
+        return KNullDesC8;
+    }
+
+void CSenServiceConnectionImpl::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    if(iFragment)
+        {
+        iFragment->WriteAsXMLToL(aWriteStream);
+        }
+    }
+
+HBufC* CSenServiceConnectionImpl::AsXmlUnicodeL()
+    {
+    if(iFragment)
+        {
+        return iFragment->AsXmlUnicodeL();
+        }
+    else
+        {
+        return KNullDesC().AllocL();
+        }
+    }
+
+HBufC8* CSenServiceConnectionImpl::AsXmlL()
+    {
+    if(iFragment)
+        {
+        return iFragment->AsXmlL();
+        }
+    else
+        {
+        return KNullDesC8().AllocL();
+        }
+    }
+
+TInt CSenServiceConnectionImpl::StartTransaction()
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::StartTransaction");
+    
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        	retVal = iConnection.StartTransaction();	
+        	
+        }    
+    else if(retVal == KErrSenNotInitialized)
+    	{  	
+    	 TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8(" CSenServiceConnectionImpl::StartTransaction - Error(%d)"), 
+            KErrSenNotInitialized ));
+    	}	 
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::StartTransaction Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::TransactionCompleted()
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::TransactionCompleted");
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        	retVal = iConnection.TransactionCompleted();	
+        }    
+    else if(retVal == KErrSenNotInitialized)
+    	{
+    	 TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8(" CSenServiceConnectionImpl::TransactionCompleted - Error(%d)"), 
+            KErrSenNotInitialized )); 		
+    	}
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::TransactionCompleted Completed");
+    return retVal;    
+    }
+
+TBool CSenServiceConnectionImpl::ConsistsOfL(MSenFragment& aCandidate)
+    {
+    if (iFragment)
+        {
+        return iFragment->ConsistsOfL(aCandidate);
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+TInt CSenServiceConnectionImpl::CancelAllRequests()
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::CancelAllRequests(sync)");
+    if ( iDispatcherEnabled )
+        {
+        ipSenServiceDispatcher->ResetQueue();
+        }
+    TInt cancelLeaveCode(KErrNone);
+    TInt retVal(KErrNone);
+    CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+    TRAP( cancelLeaveCode, iConnection.CancelSession(pSenAO->iStatus); )
+
+    if(cancelLeaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CancelSession() leaved with (code: %d)"), cancelLeaveCode));
+        if(retVal==KErrNone)
+            {
+            retVal = cancelLeaveCode;
+            }
+        }
+
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::CancelAllRequests(sync) Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::TxnId()
+    {
+    if( iTransactionIdKnown )
+        {
+        if( iTxnId>KErrNone )
+            {
+            if( iDispatcherEnabled )
+                {
+                TInt virtualTransactionId = ipSenServiceDispatcher->GetVirtualTransactionID( &iTxnId );
+                return virtualTransactionId;
+                }
+            else
+                {
+                return iTxnId;
+                }
+            }
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+    
+MSenMessage* CSenServiceConnectionImpl::Response()
+    {
+    return iResponse;
+    }
+    
+TInt CSenServiceConnectionImpl::SetTransportPropertiesL(const TDesC8& aProperties)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SetTransportProperties");
+
+    TInt retVal(KErrSenNotInitialized);
+    
+    if(iInitialized)
+        {
+        CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkName());
+        pSenChunk->SetLogger(Log());
+        retVal = pSenChunk->CreateChunk();
+        if (retVal == KErrNone)
+            {
+            retVal = pSenChunk->DescToChunk(aProperties);
+            if (retVal == KErrNone)
+                {
+                retVal = iConnection.SetTransportPropertiesL(*pSenChunk);
+                }
+            }
+        CleanupStack::PopAndDestroy(pSenChunk);
+        }
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SetTransportProperties Completed");
+    return retVal;
+    }
+    
+TInt CSenServiceConnectionImpl::CancelTransaction(TInt aTransactionID)
+    {
+    if ( iDispatcherEnabled ) // DISPATCHER IS ENABLED
+        {
+        TInt actualTransID = ipSenServiceDispatcher->GetActualTransactionID(&aTransactionID);
+        
+    	if( actualTransID != KErrNotFound )
+    		{
+        	iConnection.CancelRequest(actualTransID);
+    		}
+    	else
+        	{
+    	TMessage message = ipSenServiceDispatcher->GetMessageFromQueue(aTransactionID);
+    	CSenAsyncOperation* pAsyncOp = message.iSenAsyncOperation;
+    	if (pAsyncOp)
+    	    {
+            TInt idx = AsyncOpsArrayL().Find(pAsyncOp);    
+            if (idx >= 0)
+                {
+                AsyncOpsArrayL().Remove(idx);
+                }
+    	    pAsyncOp->iActive = NULL;
+    	    
+    	    pAsyncOp->Cancel();
+            delete pAsyncOp;
+            pAsyncOp = NULL;
+            }
+    	ipSenServiceDispatcher->RemoveFromQueue(aTransactionID);
+    	DeliverResponseL(KErrSenCancelled,NULL);
+    	}  
+        }
+    else // DISPATCHER IS DISABLED
+        {
+        iConnection.CancelRequest(aTransactionID);
+        }
+    return KErrNone;
+    }
+        
+TInt CSenServiceConnectionImpl::TransportPropertiesL(HBufC8*& aProperties)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::TransportPropertiesL");
+
+    TInt retVal(KErrSenNotInitialized);
+    
+    if(iInitialized)
+        {
+        CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkName());
+        pSenChunk->SetLogger(Log());
+        retVal = pSenChunk->CreateChunk();
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.TransportPropertiesL(*pSenChunk);
+            if(retVal == KErrNone)
+                {
+                TPtrC8 transportProperties;
+                retVal = pSenChunk->DescFromChunk(transportProperties);
+                if(retVal == KErrNone)
+                    {
+                    aProperties = transportProperties.AllocL();
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(pSenChunk);
+        }
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::TransportPropertiesL Completed");
+    return retVal;
+    }
+
+RChunkMap& CSenServiceConnectionImpl::ChunkMapL()
+    {
+    if(!iChunkMap)
+        {
+        iChunkMap = new (ELeave) RChunkMap(ETrue, ETrue);
+        }
+    return *iChunkMap;
+    }
+    
+RPointerArray<CSenAsyncOperation>& CSenServiceConnectionImpl::AsyncOpsArrayL() //codescannerwarnings
+    {
+    if(!iAsyncOpsArray)
+        {
+        iAsyncOpsArray = new (ELeave) RPointerArray<CSenAsyncOperation>;
+        }
+    return *iAsyncOpsArray;
+    }
+
+TInt CSenServiceConnectionImpl::SendL( const TDesC8& aRequest,
+                                       const TDesC8& aProperties )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL");
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+        if( pOperation )
+	        {
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif // _SENDEBUG
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = pOperation->DescsToChunk(aRequest, aProperties);
+	            if (retVal == KErrNone)
+	                {
+	                pOperation->ChunkHeader().SetPropertiesType(MSenProperties::ESenTransportProperties);
+	                retVal = SendL(pOperation);
+	                }
+	            }
+	        }
+		else
+			{
+#ifdef _SENDEBUG 
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(TDesC8& aRequest,TDesC8& aProrperties)- KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+            }
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SendL - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SubmitL( const TDesC8& aRequest,
+                                         const TDesC8& aProperties,
+                                         HBufC8*& aResponse )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL");
+    TInt retVal = CheckConnection();
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL(NextChunkName(), iIsInternalSC ); // this will return NULL in H/W targets if no chunks available (uses WSD)
+		if( pOperation )
+			{
+	        CleanupStack::PushL( pOperation );
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif // _SENDEBUG
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = pOperation->DescsToChunk(aRequest, aProperties);
+	            if (retVal == KErrNone)
+	                {
+	                pOperation->ChunkHeader().SetPropertiesType(MSenProperties::ESenTransportProperties);
+	                retVal = SubmitL(*pOperation);
+	                if (retVal != KErrNone && retVal != KErrSenSoapFault)
+	                    {
+	                    aResponse = NULL;
+	                    }
+	                else
+	                    {
+	                    retVal = ResponseFromChunk(*pOperation, aResponse);
+	                    }
+	                }
+	            }
+	        CleanupStack::PopAndDestroy(pOperation);
+			}
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SubmitL - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL Completed");
+    return retVal;
+    }
+
+ TInt CSenServiceConnectionImpl::HttpMethodFromPropertiesL( const TDesC8& aProperties,
+                                                            CSenHttpTransportProperties::TSenHttpMethod& aMethod )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::HttpMethodFromPropertiesL");
+    TInt retVal(KErrNotFound);
+    if ( aProperties.Length() > 0 && aProperties.Find(KHttpMethodLocalName)!= KErrNotFound && 
+        (aProperties.Find(KHttpGet)!= KErrNotFound || aProperties.Find(KHttpDelete)!= KErrNotFound) ) 
+        {
+        // Properties strings are found, now use CSenHttpProperties instance to validate that HTTP
+        // method really is either HTTP GET or HTTP DELETE:
+        CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC(); // push tp
+        
+        // Parse aProperties into HTTP transport properties object:
+        TInt leaveCode( KErrNone );
+        TRAP( leaveCode, pHttpProperties->ReadFromL( aProperties ); )
+        if ( leaveCode == KErrNone )
+            {
+            CSenHttpTransportProperties::TSenHttpMethod method;
+            retVal = pHttpProperties->HttpMethodL( method );
+            if ( retVal == KErrNone )
+                {
+                aMethod = method;
+                }
+#ifdef _SENDEBUG            
+            else 
+                {
+                // HttpMethodL failed:
+                TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- HttpMethodL call failed. Error code: (%d)"), retVal));
+                }
+#endif // _SENDEBUG            
+            }
+#ifdef _SENDEBUG            
+        else 
+            {
+            // ReadFromL leaved:
+            TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Reading (parsing) of HTTP properties failed. Leave code: (%d)"), leaveCode));
+            
+            }
+#endif // _SENDEBUG            
+        CleanupStack::PopAndDestroy( pHttpProperties ); // de-alloc tp
+        }
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::HttpMethodFromPropertiesL Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SendL( CSenSoapEnvelope& aMessage, const TDesC8& aProperties )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP)");
+
+    CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+    TInt readHttpMethodRetVal = HttpMethodFromPropertiesL( aProperties, httpMethod );
+
+    if ( readHttpMethodRetVal == KErrNone && 
+         (httpMethod == CSenHttpTransportProperties::ESenHttpGet ||
+         httpMethod == CSenHttpTransportProperties::ESenHttpDelete ))
+        {
+        // At the moment, Service Connection does not support sending 
+        // of SOAP-ENVs via HTTP headers for GET/DELETE requests:
+        return KErrNotSupported; // documented in public header(s)
+        }
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+		if( pOperation )
+			{
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif // _SENDEBUG
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = AssignPropertiesToChunkL( *pOperation, aMessage, aProperties );	//codescannerwarnings
+	            if (retVal == KErrNone)
+	                {
+	                pOperation->ChunkHeader().SetMessageType(MSenMessage::ESoapMessage);
+	                retVal = SendL(pOperation);
+	                }
+	            }
+			}
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+            }
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SendL(SOAP) - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP) Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SubmitL( CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo)
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL");
+
+    CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+    TInt readHttpMethodRetVal = HttpMethodFromPropertiesL( aProperties, httpMethod );
+
+    if ( readHttpMethodRetVal == KErrNone && 
+         (httpMethod == CSenHttpTransportProperties::ESenHttpGet ||
+         httpMethod == CSenHttpTransportProperties::ESenHttpDelete ))
+        {
+        // At the moment, Service Connection does not support sending 
+        // of SOAP-ENVs via HTTP headers for GET/DELETE requests:
+        return KErrNotSupported; // documented in public header(s)
+        }
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+    	if( pOperation )
+			{
+			CleanupStack::PushL( pOperation );
+#ifdef _SENDEBUG
+	        pOperation->SetLogger( &iLog );
+#endif // _SENDEBUG
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            retVal = AssignPropertiesToChunkL(*pOperation, aMessage, aProperties);	//codescannerwarnings
+	            if (retVal == KErrNone)
+	                {
+	                pOperation->ChunkHeader().SetMessageType(MSenMessage::ESoapMessage);
+	                retVal = SubmitL(*pOperation);
+	                if (retVal != KErrNone && retVal != KErrSenSoapFault)
+	                    {
+	                    aResponseTo = NULL;
+	                    }
+	                else
+	                    {
+	                    retVal = ResponseFromChunk(*pOperation, aResponseTo);
+	                    }
+	                }
+	            }
+	        CleanupStack::PopAndDestroy(pOperation);
+			}
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL( CSenSoapEnvelope&, const TDesC8&, HBufC8*&) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::AssignPropertiesToChunkL(CSenChunk& aChunk,
+                                                        CSenSoapEnvelope& aMessage,
+                                                        const TDesC8& aProperties)	//codescannerwarnings
+    {
+    TInt retVal(KErrNone);
+    
+    if ( aMessage.SoapAction2().Length() > 0 )
+        {
+        CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+        if ( aProperties.Length() > 0 )
+            {
+            pProps->ReadFromL(aProperties);
+            }
+        // This is performed to achieve two things:
+        // 1) define HTTP header for SOAP 1.1 binding
+        // 2) perform step (1) without using HTTP TP, so that each transport plug-in can still parse this value..
+        pProps->SetPropertyL(KSenSoapActionHeaderName, aMessage.SoapAction2(), KHttpHeaderType);
+
+        HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+        HBufC8* pSoapMsg = aMessage.AsXmlL();
+        retVal = aChunk.DescsToChunk(*pSoapMsg, *pPropsAsXml);
+        aChunk.ChunkHeader().SetPropertiesType(MSenProperties::ESenTransportProperties);
+        delete pSoapMsg;
+        CleanupStack::PopAndDestroy(pPropsAsXml);
+        CleanupStack::PopAndDestroy(pProps);
+        }
+    else
+        {
+        HBufC8* pSoapMsg = aMessage.AsXmlL();
+        if ( aProperties.Length() > 0 )
+            {
+            retVal = aChunk.DescsToChunk(*pSoapMsg, aProperties);
+            aChunk.ChunkHeader().SetPropertiesType(MSenProperties::ESenTransportProperties);
+            }
+        else
+            {
+            retVal = aChunk.DescToChunk(*pSoapMsg);
+            }
+        delete pSoapMsg;
+        }    
+    
+    return retVal;
+    }
+    
+TInt CSenServiceConnectionImpl::AssignMessageToChunkL( CSenChunk& aChunk,
+                                                      MSenMessage& aMessage ) //codescannerwarnings
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::AssignMessageToChunk");
+    TInt retVal(KErrNone);
+    
+    CSenTransportProperties* pTempTransportProperties = NULL;
+    
+    MSenProperties* pProperties = aMessage.Properties();
+    if( !pProperties )
+        {
+        // use transport properties in order to serialize SOAP action
+        pTempTransportProperties = CSenTransportProperties::NewLC();
+        pProperties = pTempTransportProperties;
+        }
+
+    if ( aMessage.IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+        {
+        CSenSoapEnvelope2& message = (CSenSoapEnvelope2&)aMessage;
+        if ( message.SoapAction().Length() > 0 )
+            {
+            if( pProperties->IsSafeToCast( MSenProperties::ESenXmlProperties ) )
+                {
+                CSenXmlProperties* pConcreteProps = (CSenXmlProperties*)pProperties;
+                pConcreteProps->SetPropertyL(KSenSoapActionHeaderName, message.SoapAction(), KHttpHeaderType);
+                }
+            }
+        }
+
+    HBufC8* pPropsAsXml = pProperties->AsUtf8L();
+    
+    if( pTempTransportProperties )
+        {
+        CleanupStack::PopAndDestroy( pTempTransportProperties );
+        }
+    CleanupStack::PushL(pPropsAsXml);
+
+    RBuf8 buffer;
+    CleanupClosePushL( buffer );        
+	CXmlEngSerializer* pSerializer(NULL);
+	if ( aMessage.IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+	    {
+	    pSerializer = CXmlEngSerializer::NewL(ESerializerXOPInfoset);
+	    }
+	else
+	    {
+	    pSerializer = CXmlEngSerializer::NewL(ESerializerDefault);
+	    }
+	CleanupStack::PushL( pSerializer );
+	
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+    
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+	pSerializer->SetOutput(buffer);
+	pSerializer->SetSerializationOptions(options);
+	
+    RSenDocument document;
+    if (aMessage.IsSafeToCast( MSenMessage::ESoapEnvelope2))
+        {
+        CSenSoapEnvelope2& message = (CSenSoapEnvelope2&)aMessage;
+        document = message.AsDocumentL();
+        }
+    else if(aMessage.IsSafeToCast( MSenMessage::EAtomMessage))
+        {
+        CSenAtomMessage& message = (CSenAtomMessage&)aMessage;
+        document = message.AsDocumentL();
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+	TInt leaveCode(KErrNone);
+	
+	TRAP( leaveCode, pSerializer->SerializeL(document); )
+
+    if( leaveCode != KErrNone )
+        {
+        retVal = leaveCode;
+        }
+            
+    if( retVal == KErrNone )
+        {
+
+#ifdef _SENDEBUG
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"-----------------------------------------------------------------------------------");
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"- OK. Message about to send:");
+        TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,( buffer.Right(100) ));
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"- Transport properties:");
+        if( pPropsAsXml )
+            {
+            TPtrC8 properties = pPropsAsXml->Des();
+            TLSLOG(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,( properties.Right(100) ));
+            //LOG_WRITEALL(( properties ));
+            }
+        TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMaxLogLevel ,"-----------------------------------------------------------------------------------");
+#endif // _SENDEBUG        
+
+        retVal = aChunk.DescsToChunk( buffer, *pPropsAsXml );
+        aChunk.ChunkHeader().SetPropertiesType(MSenProperties::ESenTransportProperties);
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Failed, error code: %d"), retVal ));
+        }
+#endif // _SENDEBUG        
+        
+
+    CleanupStack::PopAndDestroy(pSerializer);
+    CleanupStack::PopAndDestroy(&buffer);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    
+    return retVal;
+    }
+    
+// THIS IS THE SECOND, __MUCH IMPROVED__ VARIANT, WHICH SUPPORTS BOTH CHUNK AND FILE ATTACHEMENTS,
+// plus multiple BLOBs PER ONE MESSAGE AND multiple simultaneous transfers
+TInt CSenServiceConnectionImpl::MoveBinaryContainersToServer( CSenConnectionChunk& aOperation, RArray<TXmlEngDataContainer>& aList )
+    {
+    TInt retVal(KErrNone);
+    
+    TPtrC8 cid8;
+    TBuf8<100> cid(KNullDesC8);
+    TInt size;
+    TInt offset;
+
+    // First check if we are resending this operation (message). If so, operation has already "parsed" the blob
+    // Proper solution that allows sending of multiple BLOBS, of various types:
+    
+    TInt containerCount( aOperation.ContainerCount() );
+    if ( containerCount > 0 )
+		{
+		RBinaryMap& map = aOperation.ContainerMap();
+		TBool noError(ETrue);
+		for (TInt i = 0; i < containerCount && noError; i++)
+		    {
+		    TDesC8* pCid = map.KeyAt(i);
+		    const CSenBinaryContainer* pContainer = map.ValueAt(i);
+		    if( pCid && pContainer )
+		        {
+		        TPtrC8 cid = pContainer->Cid();
+		        CSenBinaryContainer::TDataType type = pContainer->Type();
+		        switch( type )
+		            {
+	                case CSenBinaryContainer::EFile:
+	                    {
+	                    RFile file = pContainer->File();
+                        retVal = iConnection.MoveFile( aOperation, cid, file );
+                        if ( retVal != KErrNone )
+                            {
+                            noError = EFalse;
+                            break;
+                            }                        
+	                    }
+	                break;
+	                
+	                case CSenBinaryContainer::EChunk:
+	                    {
+	                    RChunk chunk = pContainer->Chunk();
+	                    TInt size = pContainer->ChunkSize();
+	                    TInt offset = pContainer->ChunkOffset();
+                        retVal = iConnection.MoveChunk( aOperation, cid, chunk, size, offset );
+                        if ( retVal != KErrNone )
+                            {
+                            noError = EFalse;
+                            break;
+                            }                        
+	                    }
+	                break;
+	                default:
+	                // do nothing
+	                break;
+		            }
+		        }
+		    }
+		}
+    else
+        {
+        // this is the first time that we are movign binary containers to the server(!)
+    	TInt count = aList.Count();	
+    	for(TInt i = 0; i < count /* && retVal == KErrNone*/; i++)
+    		{
+    		if ( aList[i].NodeType() == TXmlEngNode::EChunkContainer )
+    			{
+    			cid = aList[i].Cid();
+    			size = aList[i].Size();
+    			offset = aList[i].AsChunkContainer().ChunkOffset();
+    			RChunk& chunk = aList[i].AsChunkContainer().Chunk();
+    			aOperation.AddChunkToContainerMap( cid, chunk, size, offset );
+    			cid8.Set(cid.Ptr(), cid.Length());
+                retVal = iConnection.MoveChunk( aOperation, cid8, chunk, offset, size );
+                
+                if ( retVal != KErrNone )
+                    {
+                    break;
+                    }
+    			}
+    		else if( aList[i].NodeType() == TXmlEngNode::EFileContainer )
+    			{
+    			cid = aList[i].Cid();
+    			RFile& file = aList[i].AsFileContainer().File();
+    			
+    			// Real solution that supports sending of multiple files / BLOBs
+    			aOperation.AddFileToContainerMap( cid, file );
+    			cid8.Set(cid.Ptr(), cid.Length());
+                retVal = iConnection.MoveFile( aOperation, cid8, file );
+
+                if ( retVal != KErrNone )
+                    {
+                    break;
+                    }
+    			}
+    		}
+        }
+    return retVal;
+    }
+    
+TInt CSenServiceConnectionImpl::MoveFileChunkHandleToServer(CSenConnectionChunk& aOperation)
+    {
+    TInt retVal(KErrNone);
+    retVal = iConnection.SendFileHandle(aOperation,iSharedFileHandle);
+    return retVal;
+    }
+    
+    //Sending  Large File Throught RFile handle 
+TInt CSenServiceConnectionImpl::SendL(RFile& aFile)
+    {
+  	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(RFile)");
+
+	TInt retVal(KErrNone);
+  	retVal = CheckConnection();
+  	 if(retVal == KErrNone)
+	    {
+         if (aFile.SubSessionHandle() )
+         {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL(NextChunkName()); 
+        
+        if( pOperation )
+        	{
+			#ifdef _SENDEBUG
+			        pOperation->SetLogger(&iLog);
+			#endif
+			        retVal = pOperation->CreateChunk();
+			        pOperation->HasSharedFileHandle(ETrue);
+			        iSharedFileHandle = aFile;
+			        if (retVal == KErrNone)	            
+			        	{
+						retVal = SendL(pOperation);	
+			            }
+        	}
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+			
+        }
+        else
+        {
+        	
+			TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("MSenServiceConsumer::HandleMessageFromChildAOL - HandleErrorL leaves with %d"), retVal));
+            retVal=KErrArgument;
+        	}
+         
+        }
+    
+    
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SendL(SOAP) - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+
+    return retVal;
+      
+    }
+    
+TInt CSenServiceConnectionImpl::SendL( MSenMessage& aMessage )
+    {
+    if ( aMessage.IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+        {
+        CSenSoapEnvelope2& message = (CSenSoapEnvelope2&)aMessage;
+        return SendL(message);
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    }
+
+    
+TInt CSenServiceConnectionImpl::SendL( CSenSoapEnvelope2& aMessage )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(CSenSoapEnvelope2)");
+
+    MSenProperties* pProperties = aMessage.Properties();
+    if( pProperties && pProperties->IsSafeToCast( MSenProperties::ESenHttpTransportProperties ) )
+        {
+        CSenHttpTransportProperties& properties = (CSenHttpTransportProperties&)*pProperties;
+        CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+        TInt readHttpMethodRetVal = properties.HttpMethodL( httpMethod );
+
+        if ( readHttpMethodRetVal == KErrNone && 
+             (httpMethod == CSenHttpTransportProperties::ESenHttpGet ||
+             httpMethod == CSenHttpTransportProperties::ESenHttpDelete ))
+            {
+            // At the moment, Service Connection does not support sending 
+            // of SOAP-ENVs via HTTP headers for GET/DELETE requests:
+            return KErrNotSupported; // documented in public header(s)
+            }
+        }
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+	    if( pOperation )
+	        {
+#ifdef _SENDEBUG
+        pOperation->SetLogger(&iLog);
+#endif
+
+        retVal = pOperation->CreateChunk();
+        if (retVal == KErrNone)
+            {
+            pOperation->ChunkHeader().SetMessageType(aMessage.Type());
+            
+            // we can cast, condition is checked at the begin of that method
+            RSenDocument document;
+            if (aMessage.IsSafeToCast( MSenMessage::ESoapEnvelope2))
+                {
+                CSenSoapEnvelope2& message = (CSenSoapEnvelope2&)aMessage;
+                document = message.AsDocumentL();
+                }
+            else if(aMessage.IsSafeToCast( MSenMessage::EAtomMessage))
+                {
+                CSenAtomMessage& message = (CSenAtomMessage&)aMessage;
+                document = message.AsDocumentL();
+                }
+	        document.GetDataContainerList(pOperation->BinaryDataArrayL());	//codescannerwarnings
+	        pOperation->RemoveBinaryDataArrayIfEmpty();
+            
+            retVal = AssignMessageToChunkL(*pOperation, aMessage);	//codescannerwarnings
+            if (retVal == KErrNone)
+                {
+                retVal = SendL(pOperation);
+                }
+            }
+#ifdef _SENDEBUG
+			else
+				{
+			        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("-pOperation->CreateChunk Failed, error code: %d"), retVal ));
+				}
+#endif // _SENDEBUG
+	        }
+		else
+			{
+#ifdef _SENDEBUG        
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(SOAP-MSG2) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SendL(SOAP-MSG2) - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SendL(CSenSoapEnvelope2) Completed");
+    return retVal;
+    }
+
+TInt CSenServiceConnectionImpl::SubmitL( MSenMessage& aMessage,
+                                         CSenSoapEnvelope2*& aResponseTo )
+    {
+    if ( aMessage.IsSafeToCast( MSenMessage::ESoapEnvelope2) )
+        {
+        CSenSoapEnvelope2& message = (CSenSoapEnvelope2&)aMessage;
+        
+        return SubmitL(message, aResponseTo);
+        }
+    else
+        {
+        return KErrNotSupported; 
+        }
+    }
+
+TInt CSenServiceConnectionImpl::SubmitL( CSenSoapEnvelope2& aMessage, CSenSoapEnvelope2*& aResponseTo )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL(CSenSoapEnvelope2)");
+
+    MSenProperties* pProperties = aMessage.Properties();
+    if( pProperties && pProperties->IsSafeToCast( MSenProperties::ESenHttpTransportProperties ) )
+        {
+        CSenHttpTransportProperties& properties = (CSenHttpTransportProperties&)*pProperties;
+        CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+        TInt getHttpMethodRetVal = properties.HttpMethodL( httpMethod );
+
+        if ( getHttpMethodRetVal == KErrNone && 
+             httpMethod == CSenHttpTransportProperties::ESenHttpGet || 
+             httpMethod == CSenHttpTransportProperties::ESenHttpDelete )
+            {
+            // At the moment, Service Connection does not support sending 
+            // of SOAP-ENVs via HTTP headers for GET/DELETE requests:
+            return KErrNotSupported; // documented in public header(s)
+            }
+        }
+
+    TInt retVal = CheckConnection();
+    
+    if(retVal == KErrNone)
+        {
+        CSenConnectionChunk* pOperation = CSenConnectionChunk::NewL( NextChunkName(), iIsInternalSC ); // returns NULL in hardware env (uses WSD in h/w, too), if no server chunk slot available
+        if( pOperation )
+        	{
+	        CleanupStack::PushL( pOperation );
+	        
+	#ifdef _SENDEBUG
+	        pOperation->SetLogger(&iLog);
+#endif // _SENDEBUG
+
+	        retVal = pOperation->CreateChunk();
+	        if (retVal == KErrNone)
+	            {
+	            pOperation->ChunkHeader().SetMessageType(aMessage.Type());
+	            
+	            RSenDocument document = aMessage.AsDocumentL();
+		        document.GetDataContainerList(pOperation->BinaryDataArrayL());	//codescannerwarnings
+		        pOperation->RemoveBinaryDataArrayIfEmpty();
+	            
+	            retVal = AssignMessageToChunkL(*pOperation, aMessage);	//codescannerwarnings
+	            if (retVal == KErrNone)
+	                {
+	                retVal = SubmitL(*pOperation);
+	                
+	                if (retVal != KErrNone && retVal != KErrSenSoapFault)
+	                    {
+	                    aResponseTo = NULL;
+	                    }
+	                else
+	                    {
+	                    HBufC8* pResponseBuf = NULL;
+	                    retVal = ResponseFromChunk(*pOperation, pResponseBuf);
+	                    if( retVal == KErrNone && pResponseBuf && pResponseBuf->Length()>0)
+	                        {
+	                        CleanupStack::PushL(pResponseBuf);
+	                        CSenSoapEnvelope2* pResponseSoapEnv2 = CSenSoapEnvelope2::NewL();
+	                        CleanupStack::PushL(pResponseSoapEnv2);
+	                        
+	                        CSenParser* pParser = CSenParser::NewLC();
+	                    	TRAP( retVal, pParser->ParseL(*pResponseBuf, *pResponseSoapEnv2); )
+	                    	CleanupStack::PopAndDestroy(pParser);
+
+	                        if( retVal == KErrNone )
+	                            {
+	                            aResponseTo = pResponseSoapEnv2;
+	                            // ownership was safely transferred to caller; remove pointer from cleanup stack:
+	                            CleanupStack::Pop(pResponseSoapEnv2);
+	                            }
+	                        else
+	                            {
+	                            CleanupStack::PopAndDestroy(pResponseSoapEnv2);
+	                            }
+	                        
+	                        CleanupStack::PopAndDestroy(pResponseBuf);
+	                        }
+	                    }
+	                
+	                }
+	            }
+	        CleanupStack::PopAndDestroy(pOperation);
+        	}
+		else
+			{
+#ifdef _SENDEBUG
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL(SOAP-MSG2) - KErrServerBusy");
+#endif // _SENDEBUG
+			return KErrServerBusy;    	
+			}
+        }
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::SubmitL(SOAP-MSG2) - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG    	
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::SubmitL(CSenSoapEnvelope2) Completed");
+    return retVal;
+    }
+    
+TInt CSenServiceConnectionImpl::Identifier()
+    {
+    return iConnectionID;
+    }
+    
+TInt CSenServiceConnectionImpl::RegisterFilesObserver()
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterFilesObserver");
+    TInt retVal(KErrNone);
+    if(!HasConnectionAgentCallbackInitialized())
+    	{
+	    const TDesC& name = CSenConnAgentServer::Open();
+	    if (name == KNullDesC)
+	        {
+	        return KErrGeneral;
+	        }
+	    retVal = iConnection.RegisterTransferObserver(&name, iFilesObserver);
+	    iConnectionAgentCallbackInitialized = ETrue;
+    	}
+    else
+    	{
+    	retVal = iConnection.RegisterTransferObserver(&KNullDesC(), iFilesObserver);
+    	}
+    iRegisterFileObserverDone = ETrue;
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterFilesObserver Completed");
+    return retVal; 
+    }
+#ifdef __ENABLE_ALR__
+
+TInt CSenServiceConnectionImpl::RegisterMobilityObserverL()
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterMobilityObserverL");
+    TInt retVal(KErrNone);
+    if(!HasConnectionAgentCallbackInitialized())
+    	{
+	    const TDesC& name = CSenConnAgentServer::Open();
+	    if (name == KNullDesC)
+	        {
+	        User::Leave(KErrGeneral);
+	        }
+	    iConnection.RegisterMobilityObserverL(&name, iMobiltyObserver);
+	    iConnectionAgentCallbackInitialized = ETrue;
+    	}
+    else
+    	{
+    	iConnection.RegisterMobilityObserverL(&KNullDesC(), iMobiltyObserver);
+    	}    	
+    iRegisterMobilityObserverDone = ETrue;
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterMobilityObserverL Completed");
+    return retVal; 
+    }
+
+
+void CSenServiceConnectionImpl::MigrateToPrefferedCarrierL(TBool &aUserChoice)
+    {
+    if (iMobiltyObserver)
+        {
+        User::LeaveIfError(iConnection.MigrateToPrefferedCarrierL(aUserChoice));    	
+        }
+	else
+	    {
+        User::Leave(KErrNotFound);
+	    }	 
+    }
+
+void CSenServiceConnectionImpl::NewCarrierAcceptedL(TBool &aUserChoice)
+    {
+    if (iMobiltyObserver)
+        {
+        User::LeaveIfError(iConnection.NewCarrierAcceptedL(aUserChoice));    	
+        }
+	else
+	    {
+        User::Leave(KErrNotFound);
+	    }	 
+    }
+#endif
+
+
+TInt CSenServiceConnectionImpl::SendProgressToHostlet(TInt aTxnId,
+        TBool aIncoming, const TDesC8& aMessage, const TDesC8& aCid,
+        TInt aProgress)
+    {
+    TBool isSoap = (aMessage != KNullDesC8);
+    TPtrC8 ptr;
+    if (isSoap)
+        {
+        ptr.Set(aMessage);
+        }
+    else
+        {
+        ptr.Set(aCid);
+        }
+    return iConnection.SendFileProgress(aTxnId, aIncoming, isSoap,ptr, aProgress);
+    }
+
+void CSenServiceConnectionImpl::DeliverStatus(TInt aStatus)
+    {
+    TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("Invoking SetStatus(%d) callback."), aStatus ));
+    TLSLOG_FORMAT(( iTlsLogStatusChannel, KSenServiceConnectionStatusLogLevel, _L8("CSenServiceConnectionImpl::DeliverStatus [legacy status update] - Invoking SetStatus(%d)"), aStatus ));
+    
+    TInt leaveCode(KErrNone);
+
+    if( ipHostletConsumer )
+        {
+        ipHostletConsumer->SetConnectionId( iConnectionID );
+        }
+    
+    TRAP( leaveCode, iObserver->SetStatus(aStatus); )
+    if( leaveCode )
+        {
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("Fatal(!) -- CSenServiceConnectionImpl::DeliverStatus(): MSenServiceConsumer::SetStatus - leaves with %d"), leaveCode));
+        TLSLOG_FORMAT(( iTlsLogStatusChannel, KSenServiceConnectionStatusLogLevel, _L("Fatal(!) -- CSenServiceConnectionImpl::DeliverStatus(): MSenServiceConsumer::SetStatus - leaves with %d"), leaveCode));
+        leaveCode = KErrNone;
+        }
+    }
+    
+    
+ TInt CSenServiceConnectionImpl::IdentityProviderL( CSenIdentityProvider*& apIdentityProvider )
+    {
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::IdentityProviderL");
+    
+    delete apIdentityProvider;
+    apIdentityProvider = NULL;
+
+    TInt retVal = CheckConnection();
+    if(retVal == KErrNone)
+        {
+        TInt retVal(KErrNone);
+        
+        CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkName());
+        pSenChunk->SetLogger(Log());
+        retVal = pSenChunk->CreateChunk();
+        
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.IdentityProviderL(*pSenChunk);
+            if(retVal == KErrNone)
+                {
+                TPtrC8 identityProvider;
+                retVal = pSenChunk->DescFromChunk(identityProvider);
+                if(retVal == KErrNone)
+                    {
+                    apIdentityProvider = CSenIdentityProvider::NewLC(KNullDesC8);
+                    CSenXmlReader* pXmlReader = CSenXmlReader::NewLC(KXmlParserMimeType); // use libxml2 sax parser
+                    pXmlReader->SetContentHandler( *apIdentityProvider );
+                    apIdentityProvider->SetReader(*pXmlReader);
+    
+                    TInt leaveCode(KErrNone);
+                    TRAP( leaveCode, apIdentityProvider->ParseL( identityProvider ); )
+                    
+                    CleanupStack::PopAndDestroy(pXmlReader);
+                    
+                    if ( leaveCode != KErrNone )
+                        {
+                        CleanupStack::PopAndDestroy( apIdentityProvider );
+                        apIdentityProvider = NULL;
+                        }
+                    else
+                        {
+                        CleanupStack::Pop( apIdentityProvider );
+                        }
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(pSenChunk);
+        }    
+#ifdef _SENDEBUG        
+    else
+    	{
+        // error occured in CheckConnection()  	
+        TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::IdentityProviderL - CheckConnection failed, error(%d)"), retVal ));
+    	}	 
+#endif // _SENDEBUG 
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::IdentityProviderL Completed");   	
+    return retVal;    
+    }
+
+TInt CSenServiceConnectionImpl::SearchIdentityProviderL( CSenIdentityProvider*& apIdentityProvider, const TDesC8& aProviderId )
+		{
+	    TInt retVal(KErrNone);
+	    
+	    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkName());
+	    pSenChunk->SetLogger(Log());
+	    retVal = pSenChunk->CreateChunk();
+	    
+	    if (retVal == KErrNone)
+	        {
+	        retVal = iConnection.SearchIdentityProviderL(*pSenChunk, aProviderId);
+	        if(retVal == KErrNone)
+	            {
+	            TPtrC8 identityProvider;
+	            retVal = pSenChunk->DescFromChunk(identityProvider);
+	            if(retVal == KErrNone)
+	                {
+	                apIdentityProvider = CSenIdentityProvider::NewLC(KNullDesC8);
+	                CSenXmlReader* pXmlReader = CSenXmlReader::NewLC(KXmlParserMimeType); // use libxml2 sax parser
+	                pXmlReader->SetContentHandler( *apIdentityProvider );
+	                apIdentityProvider->SetReader(*pXmlReader);
+
+	                TInt leaveCode(KErrNone);
+	                TRAP( leaveCode, apIdentityProvider->ParseL( identityProvider ); )
+	                
+	                CleanupStack::PopAndDestroy(pXmlReader);
+	                
+	                if ( leaveCode != KErrNone )
+	                    {
+	                    CleanupStack::PopAndDestroy( apIdentityProvider );
+	                    apIdentityProvider = NULL;
+	                    }
+	                else
+	                    {
+	                    CleanupStack::Pop( apIdentityProvider );
+	                    }
+	                }
+	            }
+	        }
+	    CleanupStack::PopAndDestroy(pSenChunk);
+
+	    return retVal; 
+		}
+ 
+TInt CSenServiceConnectionImpl::RegisterAuthenticationObserver()
+	{
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterAuthenticationObserver");
+	TInt retVal(KErrNone);
+    if(!HasConnectionAgentCallbackInitialized())
+      	{
+	    const TDesC& name = CSenConnAgentServer::Open();
+	    if (name == KNullDesC)
+	        {
+	        return KErrGeneral;
+	        }
+	    retVal = iConnection.RegisterAuthenticationObserver(&name, ipAuthProvider);
+	    iConnectionAgentCallbackInitialized = ETrue;
+       	}
+    else
+       	{
+       	retVal = iConnection.RegisterAuthenticationObserver(&KNullDesC(), ipAuthProvider);
+       	}
+       iRegisterAuthObserverDone = ETrue;
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterAuthenticationObserver Completed");
+    return retVal;
+	}
+TInt CSenServiceConnectionImpl::RegisterCoBrandingObserver()
+{
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterCoBrandingObserver");
+	TInt retVal(KErrNone);
+    if(!HasConnectionAgentCallbackInitialized())
+    	{
+	    const TDesC& name = CSenConnAgentServer::Open();
+	    if (name == KNullDesC)
+	        {
+	        return KErrGeneral;
+	        }
+	    retVal = iConnection.RegisterCoBrandingObserver(&name, ipCoBrandingObserver);
+	    iConnectionAgentCallbackInitialized = ETrue;
+    	}
+    else
+    	{
+    	retVal = iConnection.RegisterCoBrandingObserver(&KNullDesC(), ipCoBrandingObserver);
+    	}
+    iRegisterCoBrandingObserverDone = ETrue;
+    TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::RegisterCoBrandingObserver Completed");
+    return retVal;    
+}
+
+TBool CSenServiceConnectionImpl::HasConnectionAgentCallbackInitialized()
+	{
+#ifdef __ENABLE_ALR__
+	if((ipAuthProvider || iFilesObserver || iMobiltyObserver || ipCoBrandingObserver) && iConnectionAgentCallbackInitialized)
+#else
+	if((ipAuthProvider || iFilesObserver || ipCoBrandingObserver) && iConnectionAgentCallbackInitialized)
+#endif //__ENABLE_ALR__
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+TInt CSenServiceConnectionImpl::ReauthNeededL(const TDesC8& aProviderId)
+	{
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::ReauthNeededL");
+	TInt retVal(KErrNotFound);
+	if(ipAuthProvider)
+		{
+		TBool identityProviderCreated = EFalse;
+		// Get identity from authentication callback
+	    CSenIdentityProvider* pIdP =
+	            (CSenIdentityProvider*)ipAuthProvider->IdentityProviderL();
+	    
+	    if ( !pIdP )
+	        {
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - IdentityProviderL() from authentication provider returned NULL.");
+	        const TPtrC8 userName = ipAuthProvider->UsernameL();
+	        const TPtrC8 password = ipAuthProvider->PasswordL();
+	        if ( userName != KNullDesC8 &&
+	             password != KNullDesC8 )
+	        	{
+		        if ( &aProviderId != NULL && aProviderId.Length() > 0 )
+		        	{
+		        	TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::Reauthentication - trying to search identity provider with the given id: %S"), &aProviderId ));
+		            retVal = SearchIdentityProviderL(pIdP, aProviderId);
+		            if(retVal == KErrNone && pIdP)
+		               	{
+		               	CleanupStack::PushL(pIdP);
+		               	identityProviderCreated = ETrue;
+		               	pIdP->SetUserInfoL( userName ,
+		               						userName ,
+		               						password );
+		                }
+		        	}
+		        else
+		        	{
+					TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - provider id not found, trying to retrieve connection identity provider.");
+		        	// Try to retrieve IdentityProvider
+		        	IdentityProviderL(pIdP);
+		        	if(pIdP)
+		        		{
+		        		CleanupStack::PushL(pIdP);
+		        		identityProviderCreated = ETrue;
+		        		}
+		        	else
+		        		{
+						TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - identity provider not found, creating one with default parameters.");
+		        		// Create IdentityProvider with default parameters
+		        		pIdP = CSenIdentityProvider::NewLC(KIdentityProviderName);
+		        		identityProviderCreated = ETrue;
+		        		}
+		        	
+			        if(pIdP)
+			        	{
+			        	pIdP->SetUserInfoL( userName ,
+	   										userName ,
+	   										password );
+		        		}
+		        	}
+	            } // if(userName != KNull...)
+	        else
+	        	{
+				TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - UserNameL() and/or PasswordL() from authentiction provider returned NULL.");
+	        	retVal = KErrGeneral;
+	        	}
+	        } // if(!pIdP)
+	    
+	    if ( pIdP )
+	        {
+			TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::Reauthentication - CSenServiceConnectionImpl::Reauthentication - identity provider ready to register.");
+	        HBufC8* pIdPAsXml = pIdP->AsXmlL();
+	        CleanupStack::PushL(pIdPAsXml);
+	
+	        // Update IdentityProvider into DB
+	        TPtr8 ptr = pIdPAsXml->Des();
+	        retVal = iConnection.RegisterIdentityProvider(ptr);
+	        
+	        CleanupStack::PopAndDestroy(pIdPAsXml);
+	        if ( identityProviderCreated )
+	            {
+	            CleanupStack::PopAndDestroy(pIdP);
+	            }
+	        }
+		}
+	TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"CSenServiceConnectionImpl::ReauthNeededL Completed");
+	return retVal;
+	}
+	
+void CSenServiceConnectionImpl::DataTrafficDetails(TSenDataTrafficDetails& aDetails,
+												   TSenDataTrafficOperations& aOperations) 
+	{
+	iConnection.DataTrafficDetails(aDetails, aOperations);
+	}	
+	
+
+TAny* CSenServiceConnectionImpl::InterfaceByUid( TUid aUID )
+    {
+    if ( aUID == KSenInterfaceUidInternalServiceConnection )
+			{
+			TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::InterfaceByUid(%d) == KSenInterfaceUidInternalServiceConnection" ), aUID.iUid ));
+			// Must be cast to M-class  (as the same C-class implements multiple M-classes):
+			MSenInternalServiceConnection* connection = (MSenInternalServiceConnection*) this;
+			return connection; 
+			}
+	#ifdef __ENABLE_ALR__			
+    else if ( aUID == KSenInterfaceUidAlrServiceConnection )
+    	{
+			TLSLOG_FORMAT((KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::InterfaceByUid(%d) == KSenInterfaceUidInternalServiceConnection" ), aUID.iUid ));
+			MSenAlrServiceConnection* connection = NULL;
+			// Must be cast to M-class  (as the same C-class implements multiple M-classes):
+			connection = (MSenAlrServiceConnection*) this; // (mobility observer) is only available since S60 3.2 
+			return connection; 
+    	}
+	#endif // __ENABLE_ALR__		
+    return NULL;
+    }
+
+TInt CSenServiceConnectionImpl::PendingTrasanctionsCount()
+	{
+	return iAsyncOpsArray->Count();
+	}										
+
+CSenAsyncOperation* CSenAsyncOperation::NewL(CSenServiceConnectionImpl* aActive)
+    {
+    CSenAsyncOperation* pNew = NewLC(aActive);
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+CSenAsyncOperation* CSenAsyncOperation::NewLC(CSenServiceConnectionImpl* aActive)
+    {
+    CSenAsyncOperation* pNew = new (ELeave) CSenAsyncOperation(aActive);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+    
+CSenAsyncOperation::CSenAsyncOperation(CSenServiceConnectionImpl* aActive)
+:   CActive(EPriorityNormal),
+    iActive(aActive),
+    iErrorNumber(0),
+    iErrorNumberBuffer(NULL, 0),
+    iTxnId(0),
+    iTxnIdBuffer(NULL, 0),
+    iReauthTxnId(0)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+void CSenAsyncOperation::ConstructL()
+    {
+    iErrorNumberBuffer.Set(reinterpret_cast<TUint8*>(&iErrorNumber),
+                           sizeof(TInt),
+                           sizeof(TInt));
+                           
+    iTxnIdBuffer.Set(reinterpret_cast<TUint8*>(&iTxnId),
+                     sizeof(TInt),
+                     sizeof(TInt));
+                     
+    SetActive();
+	iStatus = KRequestPending;
+#ifdef EKA2
+    iActive->AsyncOpsArrayL().AppendL(this);	//codescannerwarnings
+#else
+    User::LeaveIfError(iActive->AsyncOpsArrayL().Append(this));	//codescannerwarnings
+#endif
+    }
+    
+CSenAsyncOperation::~CSenAsyncOperation()
+    {
+    if ( IsActive() )
+        {
+        Cancel(); // calls CSenAsyncOperation::DoCancel()
+        }
+    }
+
+void CSenAsyncOperation::RunL()
+    {
+    if ( iActive )
+        {
+        iActive->iErrorNumber = iErrorNumber;
+        if( iReauthTxnId != 0 && iTxnId == 0 )
+        	{
+        	iActive->iTxnId = iReauthTxnId;
+        	iActive->iReauthenticationNeeded = ETrue;
+        	}
+        else
+        	{
+        	iActive->iTxnId = iTxnId;
+        	}  
+        iActive->HandleMessageFromChildAOL(iStatus.Int());
+            
+        TInt idx = iActive->AsyncOpsArrayL().Find(this);	//codescannerwarnings
+        if (idx >= 0)
+            {
+            iActive->AsyncOpsArrayL().Remove(idx);	//codescannerwarnings
+            }
+        }
+    
+    delete this;
+    }
+        
+void CSenAsyncOperation::DoCancel()
+    {
+    }
+
+
+CSenConnectionStatusObserver* CSenConnectionStatusObserver::NewL(MSenServiceConsumer& aObserver,
+                                                                 TInt aConnectionID)
+    {
+    CSenConnectionStatusObserver* pNew = NewLC(aObserver, aConnectionID);
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+CSenConnectionStatusObserver* CSenConnectionStatusObserver::NewLC(MSenServiceConsumer& aObserver,
+                                                                  TInt aConnectionID)
+    {
+    CSenConnectionStatusObserver* pNew = new (ELeave) CSenConnectionStatusObserver(aObserver,
+                                                                                   aConnectionID);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+    
+CSenConnectionStatusObserver::CSenConnectionStatusObserver(MSenServiceConsumer& aObserver,
+                                                           TInt aConnectionID)
+:   CActive(EPriorityMore),
+    iObserver(&aObserver),
+    iConnectionID(aConnectionID)
+    {}
+
+void CSenConnectionStatusObserver::ConstructL()
+    {
+    RThread thread;
+    TSecureId secureID = thread.SecureId();
+    
+
+    _LIT_SECURITY_POLICY_PASS(KReadPropPassAll);
+    _LIT_SECURITY_POLICY_S0(KWritePropSenCoreSidOnlyPolicy, KServerUid3.iUid);
+    
+    // Default category value is the secure id of the loading process 
+    // Define the property
+    TInt err = RProperty::Define( // Secureid of the process will be used
+                                  iConnectionID,
+                                  RProperty::EInt,
+                                  KReadPropPassAll,
+//                                  KReadPropThisSidOnlyPolicy,
+                                  KWritePropSenCoreSidOnlyPolicy);
+
+	// Use secure id of the loading process instead of server process (ws client process secure id)
+	User::LeaveIfError(iConnectionStatusProperty.Attach(secureID, iConnectionID)); // secureid of the process will be category
+    CActiveScheduler::Add(this);
+    // Initial subscription
+    iConnectionStatusProperty.Subscribe(iStatus);
+    SetActive();
+	iStatus = KRequestPending;
+    }
+
+CSenConnectionStatusObserver::~CSenConnectionStatusObserver()
+    {
+    Cancel();
+    iConnectionStatusProperty.Close();
+    // Use secure id of the loading process instead of server process (ws client process secure id) 
+    RThread thread;
+    TSecureId secureID = thread.SecureId();    
+    TInt err = RProperty::Delete( secureID, iConnectionID );
+    }
+
+void CSenConnectionStatusObserver::DoCancel()
+    {
+    iConnectionStatusProperty.Cancel();
+    }
+
+void CSenConnectionStatusObserver::RunL()
+    {
+        
+    TLSLOG_L( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenConnectionStatusObserver::RunL" );
+    iConnectionStatusProperty.Subscribe(iStatus);
+    SetActive();
+	iStatus = KRequestPending;
+   
+    TInt propertyValue(KErrNotFound);
+    TInt getPropertyCode = iConnectionStatusProperty.Get(propertyValue);
+    if ( getPropertyCode == KErrNone)
+        {
+#if !defined ( RD_SEN_DISABLE_TRANSPORT_STATUS_CODE_CALLBACK )
+        TLSLOG_FORMAT(( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("CSenConnectionStatusObserver::RunL [new value published] - Calling SetStatus(%d)"), propertyValue ));
+        iObserver->SetStatus( propertyValue ); // Note: client drop 2007-01-12 cannot handle foreign status codes 
+#endif        
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT(( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("- MAJOR: iConnectionStatusProperty.Get(propertyValue) failed: %d"), getPropertyCode ));
+        }
+#endif // _SENDEBUG        
+    }
+   
+// ------------------------------------------------------------------------------------------------------------
+
+CSenFileProgressObserver* CSenFileProgressObserver::NewL( MSenFilesObserver& aObserver,
+                                                          TInt aConnectionID, 
+                                                          TBool aIsDispatcherEnabled,
+                                                          CSenServiceDispatcher* apSenServiceDispatcher, 
+                                                          RChunkMap& aChunkMap )
+    {
+    CSenFileProgressObserver* pNew = NewLC( aObserver, aConnectionID, aIsDispatcherEnabled, apSenServiceDispatcher,aChunkMap );
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+CSenFileProgressObserver* CSenFileProgressObserver::NewLC( MSenFilesObserver& aObserver,
+                                                           TInt aConnectionID,
+                                                           TBool aIsDispatcherEnabled,
+                                                           CSenServiceDispatcher* apSenServiceDispatcher, 
+                                                           RChunkMap& aChunkMap )
+    {
+    CSenFileProgressObserver* pNew = new (ELeave) CSenFileProgressObserver( aObserver, aConnectionID, aIsDispatcherEnabled, apSenServiceDispatcher, aChunkMap );
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+    
+    
+
+CSenFileProgressObserver::CSenFileProgressObserver( MSenFilesObserver& aObserver,
+                                                    TInt aConnectionID,
+                                                    TBool aIsDispatcherEnabled,
+                                                    CSenServiceDispatcher* apSenServiceDispatcher, 
+                                                    RChunkMap& aChunkMap )
+//:    CActive(EPriorityNormal),
+:   CActive(EPriorityMore),
+    iFileProgressObserver(&aObserver),
+    iConnectionID(aConnectionID),
+    iIsDispatcherEnabled(aIsDispatcherEnabled),
+    ipSenServiceDispatcher(apSenServiceDispatcher),
+    iChunkMap(aChunkMap)
+    {}
+
+void CSenFileProgressObserver::ConstructL()
+    {
+    _LIT_SECURITY_POLICY_PASS(KReadPropPassAll);
+    _LIT_SECURITY_POLICY_S0(KWritePropSenCoreSidOnlyPolicy, KServerUid3.iUid);
+    
+    // Define the property
+    TInt err = RProperty::Define( KSenInterfaceUidFilesObserver,
+                                  iConnectionID,
+                                  RProperty::ELargeByteArray, 
+                                  KReadPropPassAll,
+                                  KWritePropSenCoreSidOnlyPolicy,
+                                  512 );
+	// Use KSenInterfaceUidFilesObserver extended consumer interface UID
+	User::LeaveIfError(iFileProgressProperty.Attach(KSenInterfaceUidFilesObserver,  iConnectionID)); // KSenInterfaceUidFilesObserver UID will be category
+    CActiveScheduler::Add(this);
+    // Initial subscription
+    iFileProgressProperty.Subscribe(iStatus);
+    SetActive();
+    iStatus = KRequestPending;
+    }
+
+CSenFileProgressObserver::~CSenFileProgressObserver()
+    {
+    Cancel();
+    iFileProgressProperty.Close();
+    
+    TInt err = RProperty::Delete( KSenInterfaceUidFilesObserver, iConnectionID );
+    
+    }
+
+void CSenFileProgressObserver::DoCancel()
+    {
+    iFileProgressProperty.Cancel();
+    }
+
+void CSenFileProgressObserver::RunL()
+    {
+    // Resubscribe before processing new value to prevent missing updates(!):
+	iFileProgressProperty.Subscribe(iStatus);
+    SetActive();
+    iStatus = KRequestPending;
+
+    TLSLOG_L( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenFileProgressObserver::RunL" );
+       
+    TPckgBuf<TFileOutgoingTransferProgressBase> progress;
+    TInt getPropertyCode = iFileProgressProperty.Get( progress );
+    if ( getPropertyCode == KErrNone )
+        {
+        TLSLOG_L(KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenFileProgressObserver::RunL [new value published] - Calling TransferProgress");
+        TFileOutgoingTransferProgressBase data = progress();
+
+        TInt index(KErrNotFound);
+        if ( iIsDispatcherEnabled ) // DISPATCHER IS ENABLED
+            {
+            TLSLOG_L(KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenFileProgressObserver::RunL : SC's message dispatcher is +enabled+.");
+            TInt keyAt = ipSenServiceDispatcher->GetVirtualTransactionID( &data.iTxnId );
+            if( keyAt != KErrNotFound )
+                {
+                TInt index = iChunkMap.Find( keyAt );
+                }
+            }
+        else // DISPATCHER IS DISABLED
+            {
+            TLSLOG_L(KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenFileProgressObserver::RunL : SC's message dispatcher is -disabled-.");
+            index = iChunkMap.Find( data.iTxnId );
+            }
+
+        // Check from the chunk (allocated by the service connection implemenation in first place),
+        // WHETHER THIS TRANSACTION HAS ALREADY BEEN COMPLETED(!). There is no need to report on
+        // "file progress" if the the transaction is already completed / over.
+        if ( index != KErrNotFound )
+            {
+            CSenConnectionChunk* pOperation = (CSenConnectionChunk*)iChunkMap.ValueAt(index);
+            TLSLOG_FORMAT(( KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("- RChunk's handle: %d"), pOperation->Chunk().Handle() ));
+
+            if( !data.iIsIncoming && pOperation->ChunkHeader().MessageDirection() != MSenMessage::EOutbound )
+                {
+                TLSLOG_FORMAT(( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("CSenFileProgressObserver::RunL : the transaction (txnID: %d) is already completed, no need to signalize 'progress'"), data.iTxnId ));
+                return; 
+                }
+            }
+            
+        //TBuf8<128> cid;
+        HBufC8* pCid = HBufC8::NewLC( KMaxCidLength );
+        TPtr8 cid = pCid->Des();
+        //cid.Format( KSenNumericCidFmt, data.iCid );
+        cid.Num( data.iCid );
+        if( data.iCid2 != KErrNotFound )
+            {
+            cid.AppendNum( data.iCid2 );
+            }
+        if( data.iHasCidPostfix )
+            {
+            cid.Append( KSenCidPostfix );
+            }
+        TLSLOG_FORMAT(( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("CSenFileProgressObserver::RunL: txn '%d', progress '%d', isIncoming '%d', cid '%S',  '"), data.iTxnId, data.iProgress, data.iIsIncoming, &cid ));
+        TRAP_IGNORE( iFileProgressObserver->TransferProgress( data.iTxnId, data.iIsIncoming, KNullDesC8, cid, data.iProgress );	)
+        CleanupStack::PopAndDestroy( pCid );
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT(( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("- MAJOR: iFileProgressProperty.Get(propertyValue) failed: %d"), getPropertyCode ));
+        }
+#endif // _SENDEBUG 
+    }
+    
+TInt CSenFileProgressObserver::RunError(TInt aError)
+	{
+	TLSLOG_FORMAT(( KSenServiceConnectionStatusLogChannelBase+iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("CSenFileProgressObserver::RunError:[%d]"), aError ));
+	// return aError;
+	return KErrNone; // ignore the error, this is conscious decision.
+	}
+
+
+// ------------------------------------------------------------------------------------------------------------
+
+CSenConnectionChunk* CSenConnectionChunk::NewL(const TDesC& aChunkName, TBool aInternal )
+    {
+    CSenConnectionChunk* pChunk = CSenConnectionChunk::NewLC(aChunkName, aInternal);
+    CleanupStack::Pop();
+    return pChunk;
+    }
+
+CSenConnectionChunk* CSenConnectionChunk::NewLC(const TDesC& aChunkName, TBool aInternal)
+    {
+    CSenConnectionChunk* pChunk = new (ELeave) CSenConnectionChunk();
+
+    
+    if ( pChunk->ServOpenChunkCount() >= (aInternal?(KMaxServMessageSlots+2):KMaxServMessageSlots ) )
+        {
+        delete pChunk;
+        pChunk = NULL;
+        }
+    CleanupStack::PushL(pChunk); // push even NULL, since client expects an item in cleanupstack
+    if ( pChunk )
+        {
+        pChunk->ConstructL( aChunkName );
+        }
+    return pChunk;
+    }
+
+void CSenConnectionChunk::ConstructL(const TDesC& aChunkName)
+    {
+    if (aChunkName.Length() > 0)
+        {
+        ipChunkName = aChunkName.AllocL();
+        }
+    else
+        {
+        ipChunkName = NULL;
+        }
+    iServOpenChunkCount++;
+    }
+    
+CSenConnectionChunk::CSenConnectionChunk()
+:   ipDataContainerArray(NULL), 
+    iMap( EFalse, ETrue )
+    {
+    }
+    
+CSenConnectionChunk::~CSenConnectionChunk()
+    {
+    if ( ipDataContainerArray )
+        {
+        ipDataContainerArray->Close();
+        delete ipDataContainerArray;
+        }
+    iMap.Reset(); // will de-allocate the CSenBinaryContainers, if any
+
+    iServOpenChunkCount--;
+    }
+
+RArray<TXmlEngDataContainer>& CSenConnectionChunk::BinaryDataArrayL()	//codescannerwarnings
+    {
+    if ( !ipDataContainerArray )
+        {
+        ipDataContainerArray = new (ELeave) RArray<TXmlEngDataContainer>;
+        }
+        
+    return *ipDataContainerArray;
+    }
+
+TBool CSenConnectionChunk::HasBinaryDataArray()
+    {
+    if ( ipDataContainerArray )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+TBool CSenConnectionChunk::HasSharedFileHandle()
+{
+return iHasSharedFileHandle ;
+	
+
+}
+
+void CSenConnectionChunk::HasSharedFileHandle(TBool aHasSharedFileHandle)
+{
+	iHasSharedFileHandle = aHasSharedFileHandle;
+}
+
+void CSenConnectionChunk::RemoveBinaryDataArrayIfEmpty()
+    {
+    if ( ipDataContainerArray )
+        {
+        if ( ipDataContainerArray->Count() == 0 )
+            {
+            ipDataContainerArray->Close();
+            delete ipDataContainerArray;
+            ipDataContainerArray = NULL;
+            }
+        }
+    }
+TInt CSenConnectionChunk::ServOpenChunkCount()
+    {
+    TInt retCode( iServOpenChunkCount );
+#if defined( RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_HW_TARGET )
+    retCode = iServOpenChunkCount;
+#endif // WINS || RD_SEN_ENABLE_USE_OF_WSD_IN_SC_FOR_HW_TARGET
+    return retCode;
+    }
+    
+TInt CSenConnectionChunk::AddFileToContainerMap( const TDesC8& aCid, RFile aFile )
+    {
+    TInt retVal(0);
+    TInt error ( KErrSenInternal );
+    
+    // First, check for duplicates
+    TInt index = iMap.Find( aCid );
+    if ( index != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    // Otherwise, it is "safe" to add a binary container under this CID
+    TRAP( retVal, 
+    		CSenBinaryContainer* pContainer = CSenBinaryContainer::NewL( aCid, aFile );
+    		CleanupStack::PushL(pContainer);
+    		
+		    if( retVal == KErrNone)
+		    	{
+		    	const HBufC8* pCid = pContainer->CidPtr();
+					
+					if( pCid )
+					    {
+					    error = iMap.Append( pCid, pContainer );        
+					    }
+					
+					if( error )
+					    {
+					    CleanupStack::PopAndDestroy( pContainer );    
+					    }
+					else
+					    {
+					    CleanupStack::Pop( pContainer );
+					    }
+					}
+				);			    
+    return error;
+    }
+    
+TInt CSenConnectionChunk::AddChunkToContainerMap( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset )
+    {
+    TInt retVal(0);
+    TInt error ( KErrSenInternal );
+    // First, check for duplicates
+    TInt index = iMap.Find( aCid );
+    if ( index != KErrNotFound )
+			{
+      return KErrAlreadyExists;
+      }
+
+    // Otherwise, it is "safe" to add a binary container under this CID
+    TRAP( retVal, 
+    		CSenBinaryContainer* pContainer = CSenBinaryContainer::NewL( aCid, aChunk, aChunkSize, aChunkOffset );
+    		CleanupStack::PushL(pContainer);
+    		
+		    if( retVal == KErrNone)
+		  		{
+			    const HBufC8* pCid = pContainer->CidPtr();
+			    
+			    if( pCid )
+			        {
+			        error = iMap.Append( pCid, pContainer );        
+			        }
+			    
+			    if( error )
+			        {
+			        CleanupStack::PopAndDestroy( pContainer );    
+			        }
+			    else
+			        {
+			        CleanupStack::Pop( pContainer );
+			        }
+			    }
+	    	);
+	  return error;  
+  	}
+    
+RBinaryMap& CSenConnectionChunk::ContainerMap()
+    {
+    return iMap;
+    }
+
+TInt CSenConnectionChunk::ContainerCount()
+    {
+    return iMap.Count();
+    }
+    
+CSenBinaryContainer::CSenBinaryContainer( TDataType aType )
+: iType(aType)
+    {
+    }
+
+CSenBinaryContainer::~CSenBinaryContainer()
+    {
+    delete ipCid;
+    ipCid = NULL;
+    iFile.Close();  
+    iChunk.Close(); 
+    }
+    
+void CSenBinaryContainer::ConstructL( const TDesC8& aCid, RFile aFile )
+    {
+    ipCid = aCid.AllocL();
+    iFile.Duplicate( aFile );
+    }
+
+void CSenBinaryContainer::ConstructL( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset )
+    {
+    ipCid = aCid.AllocL();
+    iChunk = aChunk; // MOST LIKELY CODE SHOULD OPEN THE CHUNK IN HERE. 
+    iChunkSize = aChunkSize;
+    iChunkOffset = aChunkOffset;
+    }
+    
+
+CSenBinaryContainer* CSenBinaryContainer::NewL( const TDesC8& aCid, RFile aFile )
+    {
+    CSenBinaryContainer* pNew = CSenBinaryContainer::NewLC( aCid, aFile );
+    CleanupStack::Pop();
+    return pNew;        
+    }
+    
+CSenBinaryContainer* CSenBinaryContainer::NewLC( const TDesC8& aCid, RFile aFile )
+    {
+    CSenBinaryContainer* pNew = new (ELeave) CSenBinaryContainer( CSenBinaryContainer::EFile );  
+    CleanupStack::PushL( pNew );
+    pNew->ConstructL( aCid, aFile );
+    return pNew;
+    }
+
+CSenBinaryContainer* CSenBinaryContainer::NewL( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset )
+    {
+    CSenBinaryContainer* pNew = CSenBinaryContainer::NewLC( aCid, aChunk, aChunkSize, aChunkOffset );
+    CleanupStack::Pop();
+    return pNew;        
+    }
+    
+CSenBinaryContainer* CSenBinaryContainer::NewLC( const TDesC8& aCid, RChunk aChunk, TInt aChunkSize, TInt aChunkOffset )
+    {
+    CSenBinaryContainer* pNew = new (ELeave) CSenBinaryContainer( CSenBinaryContainer::EChunk );  
+    CleanupStack::PushL( pNew );
+    pNew->ConstructL( aCid, aChunk, aChunkSize, aChunkOffset );
+    return pNew;
+    }
+
+TBool CSenBinaryContainer::IsFile() const
+    {
+    // checks iType (TDataType)
+    TBool isFile( iType == CSenBinaryContainer::EFile );
+    return isFile;
+    }
+    
+    
+TBool CSenBinaryContainer::IsChunk() const
+    {
+    // checks iType (TDataType)
+    TBool isChunk( iType == CSenBinaryContainer::EChunk );
+    return isChunk;
+    }
+    
+CSenBinaryContainer::TDataType CSenBinaryContainer::Type() const
+    {
+    return iType;
+    }
+
+TPtrC8 CSenBinaryContainer::Cid() const
+    {
+    TPtrC8 cid(KNullDesC8);
+    if( ipCid )
+        {
+        cid.Set( *ipCid );
+        }
+    return cid;
+    }
+
+const HBufC8* CSenBinaryContainer::CidPtr() const
+    {
+    return ipCid;
+    }
+    
+RFile CSenBinaryContainer::File() const
+    {
+    return iFile;
+    }
+RChunk CSenBinaryContainer::Chunk() const
+    {
+    return iChunk;
+    }
+    
+TInt CSenBinaryContainer::ChunkSize() const
+    {
+    return iChunkSize;   
+    }
+    
+TInt CSenBinaryContainer::ChunkOffset() const
+    {
+    return iChunkSize;
+    }
+    
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnection/src/senservicedispatcher.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,543 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <s32strm.h>
+#include <f32file.h>
+
+#include "senserviceconnectionimpl.h"
+
+#include "sendebug.h"                 // internal Utils\inc - logging MACROs
+#include "senlogger.h"
+#include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations, plus 
+                                      // to include KServerUid3 for SEN.EXE SecureID 
+                                      // (UID3) that can be nicely used as Property 
+                                      // Category UID
+#include "senservicedispatcher.h"
+
+namespace
+    {
+    _LIT(KSenServiceDispatcherThreadName, "SenServiceDispatcher");
+    const TInt KTransactionResetValue = 1000;
+    }
+
+
+CSenServiceDispatcher* CSenServiceDispatcher::NewL( RSenServiceConnection&  aConnection,
+                                                                        TInt aConnectionID)
+    {
+    CSenServiceDispatcher* pNew = NewLC(aConnection,aConnectionID);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceDispatcher* CSenServiceDispatcher::NewLC(RSenServiceConnection&  aConnection,
+                                                                        TInt aConnectionID)
+    {
+    CSenServiceDispatcher* pNew = new (ELeave) CSenServiceDispatcher(aConnection);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aConnectionID);
+    return pNew;
+    }
+
+CSenServiceDispatcher::CSenServiceDispatcher(RSenServiceConnection&  aConnection)
+    :iConnection(aConnection)
+    {
+    }
+
+void CSenServiceDispatcher::ConstructL(TInt aConnectionID)
+    {
+    iConnectionID = aConnectionID;
+    
+    ipTransactionsMap = new (ELeave) RTransactionsMap(ETrue, ETrue);
+
+    User::LeaveIfError(iCsMessageQueue.CreateLocal());
+    User::LeaveIfError(iCsSynchronizer.CreateLocal());
+    User::LeaveIfError(iCsTransctnsMap.CreateLocal());
+       
+    
+    RProcess process;
+    TFileName threadName;
+    threadName.Append( KSenServiceDispatcherThreadName);
+    threadName.AppendNum( aConnectionID );
+    threadName.Append( KSenUnderline );
+    threadName.Append( process.Name().Left(32));
+    
+    RAllocator& heap = User::Allocator(); 
+    User::LeaveIfError(iDispatcherThread.Create(threadName,
+        TThreadFunction(DispatcherThreadL), KDefaultStackSize, &heap, this));
+    
+    //Resume the thread so that it should start waiting for any request.
+    iDispatcherThread.Resume();
+    
+    //set iDispatchMessages = TRUE so that it should start dispacthing the messages
+    //when thread gets signaled.
+    iDispatchMessages = ETrue;
+    }
+
+CSenServiceDispatcher::~CSenServiceDispatcher()
+    {
+    //Set iDispatchMessages = FALSE to stop dispacthing messages if it already 
+    //dispacthing and also to stop the thread which is waiting for any request.
+    iDispatchMessages = EFalse;
+    if(iCsSynchronizer.IsBlocked())
+        {
+        iCsSynchronizer.Wait();
+        }
+
+    TRequestStatus requestStatus;
+    iDispatcherThread.Logon(requestStatus);
+    iDispatcherThread.RequestSignal();
+    
+    //Wait until dispatcher thread exits
+    User::WaitForRequest(requestStatus);
+
+    if(ipTransactionsMap)
+        {
+        ipTransactionsMap->Reset();
+        delete ipTransactionsMap;
+         }
+
+    iCsMessageQueue.Close();
+    iCsSynchronizer.Close();
+    iCsTransctnsMap.Close();
+
+    iDispatcherThread.Close();
+    iMessageQueue.Close();
+    }
+
+
+TInt CSenServiceDispatcher::DispatcherThreadL(CSenServiceDispatcher* aThis)
+    {
+    CTrapCleanup* pCleanup = CTrapCleanup::New();
+    CActiveScheduler::Install(NULL); // remove one
+    CActiveScheduler* pScheduler = new (ELeave) CActiveScheduler();
+    CActiveScheduler::Install(pScheduler);
+
+    RSenDocument::ManualXmlEngineTlsAttachL();
+        
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, CSenServiceDispatcher::ExecuteL(aThis));
+
+    RSenDocument::ManualXmlEngineTlsCleanup();
+
+    CActiveScheduler::Install(NULL); // uninstall scheduler
+    delete pScheduler;
+    delete pCleanup;
+
+    return leaveCode;
+    }
+
+TInt CSenServiceDispatcher::ExecuteL(CSenServiceDispatcher* aThis)
+    {
+    
+    aThis->OpenDispatcherLogL();
+    
+    TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL - Resumed.");
+    
+    for(;;)
+        {
+        User::WaitForAnyRequest();
+
+        //If iDispatchMessages = FALSE then stop dispacthing messages.
+        //Is called from the destructor and thread will end in cleaner way
+        //by deleting the allocated objects on it's heap.
+        if(!aThis->iDispatchMessages)
+            {
+            TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL- Called from owner thread's destructor");
+            break;
+            }
+
+        //Wait on this critical section until all the messages gets dispacthed or 
+        //iDispatchMessages = FALSE is set from the destructor.
+        aThis->iCsSynchronizer.Wait();
+
+        TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL- Dispacthing messages..");
+
+        while(aThis->iMessageQueue.Count() && aThis->iDispatchMessages)
+            {
+            TThreadMessage thrMessage = aThis->iMessageQueue[0];
+
+            //Send message and get the actual transaction id.
+            TInt retVal = 
+            aThis->iConnection.SendMsgAndReceiveTxnId(*(thrMessage.iMessage.iSenConnectionChunk));
+
+            TLSLOG_FORMAT((KSenDispatcherLogChannel, KSenDispatcherLogLevel, 
+                            _L("- SendMsgAndReceiveTxnId Returned: (%d)"), retVal));
+
+
+            //Check if remove failed, possible in scenario where transaction has
+            //been cancled by client using CancleTransaction(aTransactionID) API,
+            //then cancel the request instaed of adding to the transaction map.
+            if(aThis->RemoveFromQueue(thrMessage.iVrtalTrnsnID))
+                {
+                
+                //If RemoveFromQueue is sucess and also SendMsgAndReceiveTxnId 
+                //returns actual transaction ID then add to the transaction MAP.    
+                TInt* pVrtlaTxnId = new (ELeave) TInt(0);
+                *pVrtlaTxnId = thrMessage.iVrtalTrnsnID;
+                CleanupStack::PushL(pVrtlaTxnId);
+
+                TInt* pActlTxnId = new (ELeave) TInt(0);
+                if (retVal>0)
+                    {
+                    *pActlTxnId = retVal;
+                    }
+                
+                CleanupStack::PushL(pActlTxnId);
+
+                //Add the to map as key=virtual transaction ID and 
+                //value = actual transaction ID.
+                TInt transRetVal = KErrNone;
+                transRetVal  = aThis->AddToTheTransMap(pVrtlaTxnId,pActlTxnId);
+
+                TLSLOG_FORMAT((KSenDispatcherLogChannel, KSenDispatcherLogLevel, 
+                                _L("- AddToTheTransMap Returned: (%d)"), transRetVal));
+
+                if (transRetVal == KErrNone)
+                    {
+                    TLSLOG_FORMAT((KSenDispatcherLogChannel, KSenDispatcherLogLevel, 
+                                    _L("- Virtual Transaction ID: (%d)"), pVrtlaTxnId));
+                    TLSLOG_FORMAT((KSenDispatcherLogChannel, KSenDispatcherLogLevel, 
+                                    _L("- Actual Transaction ID: (%d)"), pActlTxnId));
+
+                    CleanupStack::Pop(2);   //pVrtlaTxnId,pActlTxnId
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy(2); //pVrtlaTxnId,pActlTxnId
+                    }
+                }
+            else
+                {
+                    //Mean time if the transaction has been canceled by client
+                    //using CancelTransaction(aTranscationID) and then cancel the
+                    //same using CancelRequest(aVirtualTransactionID)
+                    aThis->iConnection.CancelRequest(thrMessage.iVrtalTrnsnID);
+                }
+            }   // End of while
+
+        TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL- All the message has been dispacthed");
+
+        //Signal the critical section that message dispacthing is over so that it
+        // can wait for the another request.
+        aThis->iCsSynchronizer.Signal();
+
+        }
+
+    TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL - Closing.");
+    
+    aThis->CloseDispatcherLogL();
+    
+    return KErrNone;
+    }
+    
+void CSenServiceDispatcher::OpenDispatcherLogL()
+    {
+#ifdef _SENDEBUG
+    RThread thread;
+    RProcess process;
+    TFileName logFile;
+    logFile.Append( KSenDispactherThreadLog().Left(KSenDispactherThreadLog().Length()-4) ); // exclude ".log" file extension
+    logFile.AppendNum( iConnectionID );
+    logFile.Append( KSenUnderline );
+    logFile.Append( process.Name().Left(32));
+    logFile.Append( KSenUnderline );
+    logFile.Append( thread.Name().Left(20));
+    logFile.Append( KSenDispactherThreadLog().Right(4) ); // postfix with ".log" file extension
+
+    // Open connection to the file logger server
+    TLSLOG_OPEN( KSenDispatcherLogChannel, KSenDispatcherLogLevel, KSenDispactherThread, logFile );
+    TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "CSenServiceDispatcher::ExecuteL - About to create new dispatcher thread..");
+    TLSLOG_FORMAT((KSenDispatcherLogChannel, KSenDispatcherLogLevel, 
+                                _L("- Connection ID: (%d)"), iConnectionID));
+#endif
+    }
+
+void CSenServiceDispatcher::CloseDispatcherLogL()
+    {
+    TLSLOG_L(KSenDispatcherLogChannel, KSenDispatcherLogLevel, "Log file closed.");
+    TLSLOG_CLOSE( KSenDispatcherLogChannel );
+    }
+    
+
+TInt CSenServiceDispatcher::GetDispactherThreadId()
+    {
+    return iDispatcherThread.Id();
+    }
+
+
+TInt CSenServiceDispatcher::AddToTheQueue(TThreadMessage aThreadMessage)
+    {
+    TInt appendRetVal(KErrNone);
+    //Wait on message queue critical section if it is locked, and then add to 
+    //the queue.
+    //Critical section is required as RemoveFromQueue(aTrasnactionID) is called
+    //from child thread(dispacther thread) also. To avoid crash as iMessageQueue
+    //is used by two threads to append as well as to delete from the queue.
+    iCsMessageQueue.Wait();
+    appendRetVal = iMessageQueue.Append(aThreadMessage);
+    iCsMessageQueue.Signal();
+
+    if (appendRetVal == KErrNone)
+        {
+        //If dispatcher thread already dispatching the messages then no need to signal the 
+        //thread as it is already working that is dispacthing the messages from queue.
+        if(!iCsSynchronizer.IsBlocked())
+            {
+            //Signal the thread as it free and waiting for the reqest.
+            iDispatcherThread.RequestSignal();
+            }
+        }  
+    return appendRetVal;
+    }
+TBool CSenServiceDispatcher::RemoveFromQueue(TInt aTransactionID)
+    {
+    //This method gets called from two places 1)main thread from
+    //CancelTransaction(aTransactionID) method and 2)child thread from
+    //ExecuteL method once message has been dispacthed.
+    TBool found = EFalse;
+    iCsMessageQueue.Wait();
+    for(TInt i=0;i<iMessageQueue.Count();i++)
+        {
+        TThreadMessage threadMessage = iMessageQueue[i];
+        if(threadMessage.iVrtalTrnsnID == aTransactionID)
+            {   
+            found = ETrue;
+            iMessageQueue.Remove(i);
+            if ((++iMessagesQueueCounter) >= KTransactionResetValue)
+                {
+                iMessageQueue.Compress();
+                iMessagesQueueCounter = 0;
+                }
+            }
+        }      
+    iCsMessageQueue.Signal();    
+    return found;
+    }    
+
+TMessage CSenServiceDispatcher::GetMessageFromQueue(TInt aTransactionID)
+    {
+    TMessage message;
+    message.iSenAsyncOperation = NULL;
+    message.iSenConnectionChunk = NULL;
+    iCsMessageQueue.Wait();
+    for(TInt i=0;i<iMessageQueue.Count();i++)
+        {
+        TThreadMessage threadMessage = iMessageQueue[i];
+        if(threadMessage.iVrtalTrnsnID == aTransactionID)
+            {
+            message.iSenAsyncOperation = threadMessage.iMessage.iSenAsyncOperation;
+            message.iSenConnectionChunk = threadMessage.iMessage.iSenConnectionChunk;
+            }
+        }      
+    iCsMessageQueue.Signal();    
+    return message;
+    }
+
+void CSenServiceDispatcher::ResetQueue()
+    {
+    iCsMessageQueue.Wait();
+    iMessageQueue.Reset();
+    iCsMessageQueue.Signal();     
+    }    
+    
+RTransactionsMap& CSenServiceDispatcher::TransactionMap()
+    {
+        return *ipTransactionsMap;
+    }
+
+TInt CSenServiceDispatcher::AddToTheTransMap(TInt* pVrtlaTxnId,TInt* pActlTxnId)
+    {
+    TInt returnValue = KErrNone;
+    //Wait on transaction map critical section if it is locked, and then add to 
+    //the map.
+    //Critical section is required as RemoveFromTransMap(aTrasnactionID) is called
+    //from main thread also. To avoid crash as ipTransactionsMap
+    //is used by two threads to append as well as to delete from the map.
+    iCsTransctnsMap.Wait();
+    returnValue = TransactionMap().Append(pVrtlaTxnId,pActlTxnId);
+    iCsTransctnsMap.Signal(); 
+    return returnValue;
+    }
+
+TInt CSenServiceDispatcher::RemoveFromTransMap(TInt* pVrtlaTxnId)
+    {
+    TInt returnValue = KErrNone;
+    //Is called from the main thread after we recieve the response.
+    returnValue = TransactionMap().Find(*pVrtlaTxnId);
+    if( returnValue != KErrNotFound )
+        {
+        iCsTransctnsMap.Wait();
+        returnValue = TransactionMap().RemoveByKey(*pVrtlaTxnId);
+        iCsTransctnsMap.Signal(); 
+        }
+    return returnValue;
+    }
+
+TInt CSenServiceDispatcher::UpdateTransMap(TInt* pVrtlaTxnId,TInt* pActlTxnId)
+    {
+    TInt returnValue = KErrNone;
+    //Is called from the main thread from HandleMessageChildAOL method.
+    //Typically gets called when ESenReAuthAndResendNeeded and ESenResendNeeded
+    //is required.
+    returnValue = TransactionMap().Find(*pVrtlaTxnId);
+    if( returnValue != KErrNotFound )
+        {
+        iCsTransctnsMap.Wait();
+        returnValue = TransactionMap().UpdateValue(pVrtlaTxnId,pActlTxnId);
+        iCsTransctnsMap.Signal(); 
+        }
+    return returnValue;
+    }
+
+TInt CSenServiceDispatcher::GetActualTransactionID(TInt* pVrtlaTxnId)
+    {
+    //Getter for getting actual transaction ID
+    TInt indexValue = TransactionMap().Find(*pVrtlaTxnId);
+
+    if( indexValue != KErrNotFound )
+        {
+            const TInt* pValueAt = TransactionMap().ValueAt(indexValue);
+            return *pValueAt;
+        }
+
+    return KErrNotFound;
+    }
+
+TInt CSenServiceDispatcher::GetVirtualTransactionID(TInt* pActlTxnId)
+    {
+    //Getter for getting virtual transaction ID
+    TInt indexValue = TransactionMap().FindValue(*pActlTxnId);
+
+    if( indexValue != KErrNotFound )
+        {
+        const TInt* pKeyAt = TransactionMap().KeyAt(indexValue);
+        return *pKeyAt;
+        }
+
+    return KErrNotFound;
+    }
+
+void CSenServiceDispatcher::SetOwnerThreadId(TInt aOwnerThreadID)
+    {
+    iOwnerThreadId = aOwnerThreadID;
+    }
+
+
+CSenUnderTakerWaiter* CSenUnderTakerWaiter::NewL(
+                            CSenServiceConnectionImpl* aSenServiceConnectionImpl,
+                            TInt aDispatcherThreadID )
+    {
+    CSenUnderTakerWaiter* pNew = NewLC(aSenServiceConnectionImpl,aDispatcherThreadID);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+    
+CSenUnderTakerWaiter* CSenUnderTakerWaiter::NewLC(
+                            CSenServiceConnectionImpl* aSenServiceConnectionImpl,
+                            TInt aDispatcherThreadID )
+    {
+    CSenUnderTakerWaiter* pNew = new (ELeave) CSenUnderTakerWaiter();
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aSenServiceConnectionImpl,aDispatcherThreadID);
+    return pNew;
+    }
+
+CSenUnderTakerWaiter::~CSenUnderTakerWaiter()
+    {
+    iSenServiceConnectionImpl = NULL;
+    Cancel();
+    iUnderTaker.Close();
+    }
+
+CSenUnderTakerWaiter::CSenUnderTakerWaiter()
+    :CActive(EPriorityNormal)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+void CSenUnderTakerWaiter::ConstructL(CSenServiceConnectionImpl* aSenServiceConnectionImpl,
+                                      TInt aDispatcherThreadID )
+    {
+    iSenServiceConnectionImpl = aSenServiceConnectionImpl;
+    iDispatcherThreadID = aDispatcherThreadID;
+    User::LeaveIfError(iUnderTaker.Create());
+    }
+
+void CSenUnderTakerWaiter::StartWaiter()
+    {
+    if(!IsActive())
+        {
+        iUnderTaker.Logon(iStatus,iDyingThreadNumber);
+        SetActive();
+        }
+    }
+
+void CSenUnderTakerWaiter::StopWaiter()
+    {
+    Cancel();
+    }
+
+void CSenUnderTakerWaiter::RunL()
+    {
+    if(iStatus == KErrDied)
+        {
+        RThread th;
+        th.SetHandle(iDyingThreadNumber);
+        TFullName name = th.FullName();
+        TExitType type = th.ExitType();
+
+        
+        if(iDispatcherThreadID == th.Id())
+            {
+            //Notifies client that thread is died. Client has to restart the 
+            //connection here.In this case client has to create new SC object.
+            if(type == EExitKill)
+                {
+                if(iSenServiceConnectionImpl)
+                    {
+                    iSenServiceConnectionImpl->iErrorNumber = EExitKill;
+                    iSenServiceConnectionImpl->iTxnId = -1;    
+                    iSenServiceConnectionImpl->HandleMessageFromChildAOL(iStatus.Int());
+                    }
+                }
+            else    // panic
+                {
+                TExitCategoryName categ = th.ExitCategory();
+                if(iSenServiceConnectionImpl)
+                    {
+                    iSenServiceConnectionImpl->iErrorNumber = EExitPanic;
+                    iSenServiceConnectionImpl->iTxnId = -1;
+                    iSenServiceConnectionImpl->HandleMessageFromChildAOL(iStatus.Int());
+                    }
+                }
+            }
+        th.Close();
+        StartWaiter();
+        }           
+    }
+
+void CSenUnderTakerWaiter::DoCancel()
+    {
+    iUnderTaker.LogonCancel();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/BWINSCW/senconnagentU.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?Close@CSenConnAgentServer@@SAXXZ @ 1 NONAME ; void CSenConnAgentServer::Close(void)
+	?Open@CSenConnAgentServer@@SAABVTDesC16@@XZ @ 2 NONAME ; class TDesC16 const & CSenConnAgentServer::Open(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/eabi/senconnagent32u.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,12 @@
+EXPORTS
+	_ZN19CSenConnAgentServer4OpenEv @ 1 NONAME
+	_ZN19CSenConnAgentServer5CloseEv @ 2 NONAME
+	_ZTIN4Meta11TMetaVarLenI5RBuf8EE @ 3 NONAME ; #<TI>#
+	_ZTIN4Meta11TMetaVarLenI6RBuf16EE @ 4 NONAME ; #<TI>#
+	_ZTIN4Meta12TMetaVarLen8I5RBuf8EE @ 5 NONAME ; #<TI>#
+	_ZTIN4Meta13TMetaVarLen16I6RBuf16EE @ 6 NONAME ; #<TI>#
+	_ZTVN4Meta11TMetaVarLenI5RBuf8EE @ 7 NONAME ; #<VT>#
+	_ZTVN4Meta11TMetaVarLenI6RBuf16EE @ 8 NONAME ; #<VT>#
+	_ZTVN4Meta12TMetaVarLen8I5RBuf8EE @ 9 NONAME ; #<VT>#
+	_ZTVN4Meta13TMetaVarLen16I6RBuf16EE @ 10 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/eabi/senconnagentu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	_ZN19CSenConnAgentServer4OpenEv @ 1 NONAME
+	_ZN19CSenConnAgentServer5CloseEv @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsconnectionagent    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsconnectionagent.iby			CORE_MW_LAYER_IBY_EXPORT_PATH(wsconnectionagent.iby)
+PRJ_MMPFILES
+senconnagent.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/group/senconnagent.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Project specification file for wsconnectionagent
+*
+*/
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+	TARGET      wsconnagent.dll
+	UID         0x1000008d 0x001F9707
+#else
+	TARGET      senconnagent.dll
+	UID         0x1000008d 0x2001951A
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_CLIENT_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_CLIENT_DLL
+    #endif
+#endif
+
+
+SOURCEPATH      ../src
+SOURCE          senconnagentserver.cpp
+SOURCE          senconnagentsession.cpp
+MW_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wscore/inc  // SenServiceManagerDefines.h  - IPC enumerations
+USERINCLUDE		../../wsframework/inc
+USERINCLUDE		../../wsutils/inc
+USERINCLUDE		../../wsxml/inc
+
+
+
+// System libs:
+LIBRARY         euser.lib
+#ifdef __ENABLE_ALR__
+LIBRARY         netmeta.lib
+#endif
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY			SenServDesc.lib
+LIBRARY			SenXml.lib
+LIBRARY			SenUtils.lib
+#else
+LIBRARY			wsServDesc.lib
+LIBRARY			wsXml.lib
+LIBRARY			wsUtils.lib
+#endif
+LANG        SC
+
+#if defined(ARMCC)
+#ifdef __ENABLE_ALR__
+	DEFFILE ../EABI/senconnagent32.def
+#else
+  DEFFILE ../eabi/senconnagent.def
+#endif
+#elif defined(WINSCW)
+  DEFFILE ../BWINSCW/senconnagent.def
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/inc/senconnagentserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#include <e32base.h>
+
+NONSHARABLE_CLASS(CSenConnAgentServer): public CServer2
+    {
+    public:
+    IMPORT_C static const TDesC& Open();
+    IMPORT_C static void Close();
+    inline void DestroyIfInactive();
+    
+    private:
+    CSenConnAgentServer();
+   ~CSenConnAgentServer();
+    CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+    
+    private:
+    TInt iCount;
+    TFullName iName;
+    };
+
+void CSenConnAgentServer::DestroyIfInactive()
+    {
+    iSessionIter.SetToFirst();
+    if (iSessionIter++ == NULL)
+        {
+        delete this;
+        Dll::SetTls(NULL);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/inc/senconnagentsession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include <e32base.h>
+
+
+class MSenFilesObserver;
+class MSenAuthenticationProvider;
+class CSenIdentityProvider;
+class MSenCoBrandingObserver;
+#ifdef __ENABLE_ALR__
+class MMobilityProtocolResp;
+#endif //__ENABLE_ALR__
+
+NONSHARABLE_CLASS(CSenConnAgentSession): public CSession2
+    {
+    private:
+    ~CSenConnAgentSession();
+    void ServiceL(const RMessage2& aMessage);
+    void Disconnect(const RMessage2& aMessage);
+    TInt ReauthenticationNeededL(const RMessage2& aMessage);
+    TInt CoBrandingGoNoGoL(const RMessage2& aMessage);
+    
+    private:
+    MSenFilesObserver* iObserver;
+    MSenAuthenticationProvider* iAuthObserver;
+    MSenCoBrandingObserver* ipCoBrandingObserver;
+#ifdef __ENABLE_ALR__
+    MMobilityProtocolResp* iMobiltyObserver;
+#endif //__ENABLE_ALR__
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/rom/wsconnectionagent.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSCONNAGENT_IBY__
+#define __WSCONNAGENT_IBY__
+
+// Fragment
+file=ABI_DIR\BUILD_DIR\wsconnagent.dll               PROGRAMS_DIR\wsconnagent.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/src/senconnagentserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include "senconnagentserver.h"
+#include "senconnagentsession.h"
+
+_LIT(KSenConnServerName, "_SenConnSrv");
+const TInt KMaxServerName = 80;
+
+
+CSenConnAgentServer::CSenConnAgentServer(): CServer2(EPriorityMore)
+    {
+    
+    }
+
+CSenConnAgentServer::~CSenConnAgentServer()
+    {
+    
+    }
+
+CSession2* CSenConnAgentServer::NewSessionL(const TVersion& /*aVersion*/,
+        const RMessage2& /*aMessage*/) const
+    {
+    return new (ELeave) CSenConnAgentSession;
+    }
+
+EXPORT_C const TDesC& CSenConnAgentServer::Open()
+    {
+    CSenConnAgentServer* server = reinterpret_cast<CSenConnAgentServer*>
+            (Dll::Tls());
+    if (server == NULL)
+        {
+        server = new CSenConnAgentServer;
+        if (server == NULL)
+            {
+            return KNullDesC;
+            }
+        server->iName = RThread().FullName().Right(KMaxServerName -
+                KSenConnServerName().Length());
+        for (TInt i = 0; i < server->iName.Length(); i++)
+            {
+            TUint16& chr = (server->iName)[i];
+            if (chr == ':')
+                {
+                chr = ';';
+                }
+            }
+        server->iName.Append(KSenConnServerName);
+        TInt err = server->Start(server->iName);
+        if (err != KErrNone)
+            {
+            delete server;
+            return KNullDesC;
+            }
+        Dll::SetTls(server);
+        }
+    server->iCount++;
+    return server->iName;
+    }
+
+EXPORT_C void CSenConnAgentServer::Close()
+    {
+    CSenConnAgentServer* server = reinterpret_cast<CSenConnAgentServer*>
+            (Dll::Tls());
+    if (server == NULL)
+        {
+        return;
+        }
+    --server->iCount;
+    if (!server->iCount)
+        {
+        delete server;
+        Dll::SetTls(NULL);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsconnectionagent/src/senconnagentsession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:         
+*
+*/
+
+
+
+
+#ifdef __ENABLE_ALR__
+#include <comms-infras/cs_mobility_apiext.h>
+#endif //__ENABLE_ALR__
+
+
+#include "senconnagentsession.h"
+#include "senconnagentserver.h"
+#include "senservicemanagerdefines.h"
+#include "MSenServiceConsumer.h"
+
+#include "MSenAuthenticationProvider.h"
+#include "SenIdentityProvider.h"
+#include "msenservicemanager.h"
+
+#include "msencobrandinginterface.h"
+#include "senchunk.h"
+#include "senxmldebug.h"
+
+CSenConnAgentSession::~CSenConnAgentSession()
+    {
+    
+    }
+
+void CSenConnAgentSession::ServiceL(const RMessage2& aMessage)
+    {
+    switch (aMessage.Function())
+        {
+        case ESenCliServInitialize:
+            {
+            iObserver = static_cast<MSenFilesObserver*>(
+					const_cast<TAny*>(aMessage.Ptr0()));
+            aMessage.Complete(KErrNone);
+            ((CActiveSchedulerWait*)aMessage.Ptr1())->AsyncStop();
+            }
+            break;
+        case ESenCliServTransferProgress:
+            {
+            TTransferProgress transfer;
+            TPckg<TTransferProgress> transferPckg(transfer);
+            aMessage.ReadL(0, transferPckg);
+            HBufC8* buf = HBufC8::NewLC(aMessage.GetDesLengthL(1));
+            TPtr8 bufPtr = buf->Des();
+            aMessage.ReadL(1, bufPtr);
+            aMessage.Complete(KErrNone);
+            if (transfer.iSoap)
+                {
+                iObserver->TransferProgress(transfer.iTxnId,
+                        transfer.iIncoming, *buf, KNullDesC8, 0);
+                }
+            else
+                {
+                iObserver->TransferProgress(transfer.iTxnId,
+                        transfer.iIncoming, KNullDesC8, *buf, transfer.iProgress);
+                }
+            CleanupStack::PopAndDestroy(buf);
+          }
+            break;
+        case ESenCliServAuthInitialize:
+            {
+	        iAuthObserver = static_cast<MSenAuthenticationProvider*>(
+					const_cast<TAny*>(aMessage.Ptr0()));
+	        ((CActiveSchedulerWait*)aMessage.Ptr1())->AsyncStop();
+	        aMessage.Complete(KErrNone);
+            }
+	        break;
+        case ESenCliServCoBrandingInitialize:
+            {
+	        ipCoBrandingObserver = static_cast<MSenCoBrandingObserver*>(
+					const_cast<TAny*>(aMessage.Ptr0()));
+	        ((CActiveSchedulerWait*)aMessage.Ptr1())->AsyncStop();
+	        aMessage.Complete(KErrNone);
+            }
+            break;
+	    case ESenCliServReAuthNeeded:
+	        {
+	    	TInt retVal(KErrNone);
+	    	TRAPD(error, retVal = ReauthenticationNeededL(aMessage));
+	    	if(error)
+	    		{
+	    		retVal = error;
+	    		}
+	    	aMessage.Complete(retVal);
+	    	CActiveSchedulerWait* wait = static_cast<CActiveSchedulerWait*>(
+					const_cast<TAny*>(aMessage.Ptr1()));
+	    	if(wait && wait->IsStarted())
+	    		{
+	    		wait->AsyncStop();
+	    		}
+	    		}
+        	break;
+        case ESenCliServGoNoGo:
+            {
+	    	TInt retValue(KErrNone);
+	    	TRAPD(CBerror, retValue = CoBrandingGoNoGoL(aMessage));
+	    	if(CBerror)
+	    		{
+	    		retValue = CBerror;
+	    		}
+	    	aMessage.Complete(retValue);
+            }
+        	break;
+
+#ifdef __ENABLE_ALR__
+        case ESenCliServMobilityInitialize:
+            {
+            iMobiltyObserver = static_cast<MMobilityProtocolResp*>(
+					const_cast<TAny*>(aMessage.Ptr0()));
+            aMessage.Complete(KErrNone);
+            ((CActiveSchedulerWait*)aMessage.Ptr1())->AsyncStop();                
+            }
+            break;
+        case ESenCliServPrefferedCarrierAvailable:
+            {
+            TInt oldap = aMessage.Int0();
+            TInt newap= aMessage.Int1();
+            
+            TAccessPointInfo oldAPInfo ;
+            oldAPInfo.SetAccessPoint( oldap );
+            TAccessPointInfo newAPInfo ;
+            newAPInfo.SetAccessPoint( newap );
+
+            HBufC8* upgradeBuf = HBufC8::NewLC(10);
+            TPtr8 upgradeBuffer = upgradeBuf->Des();
+            aMessage.ReadL(2, upgradeBuffer); 
+            TBool isUpgrade = (TBool)(*upgradeBuffer.Ptr()) ;
+            CleanupStack::PopAndDestroy(upgradeBuf); 
+            
+            HBufC8* seemlessBuf = HBufC8::NewLC(10);
+            TPtr8 seemlessBuffer = seemlessBuf->Des();
+            aMessage.ReadL(3, seemlessBuffer); 
+            TBool isSeamless = (TBool)(*seemlessBuffer.Ptr()) ;
+            CleanupStack::PopAndDestroy(seemlessBuf); 
+            
+            aMessage.Complete(KErrNone);
+            // check for mobility observer and forward the call to the observer (application)
+            if(iMobiltyObserver)
+                {
+                iMobiltyObserver->PreferredCarrierAvailable(oldAPInfo, newAPInfo, isUpgrade, isSeamless) ;
+                }
+            }
+            break;
+        case ESenCliServNewCarrierActive:
+            {
+            TInt newap = aMessage.Int0();
+            TAccessPointInfo newAPInfo ;
+            newAPInfo.SetAccessPoint( newap );
+            HBufC8* inBuf = HBufC8::NewLC(10);
+            TPtr8 inBuffer = inBuf->Des();
+            aMessage.ReadL(1, inBuffer); 
+            TBool isSeamless = (TBool)(*inBuffer.Ptr()) ;
+            CleanupStack::PopAndDestroy(inBuf); 
+            aMessage.Complete(KErrNone);
+            // check for mobility observer and forward the call to the observer (application)
+            if(iMobiltyObserver)
+                {
+                iMobiltyObserver->NewCarrierActive(newAPInfo, isSeamless) ;
+                }
+            }
+            break;
+        case ESenCliServMobilityError:
+            {
+        	TInt mobilityError = aMessage.Int0();
+            aMessage.Complete(KErrNone);
+            // check for mobility observer and forward the call to the observer (application)
+            if(iMobiltyObserver)
+                {
+                iMobiltyObserver->Error(mobilityError);
+                }
+            }
+            break;
+#endif //__ENABLE_ALR__
+        default:
+            {
+            aMessage.Complete(KErrNotSupported);
+            }
+            break;
+        }
+    }
+
+void CSenConnAgentSession::Disconnect(const RMessage2& aMessage)
+    {
+    CSession2::Disconnect(aMessage);
+    CSenConnAgentServer* server = reinterpret_cast<CSenConnAgentServer*>
+            (Dll::Tls());
+    ASSERT(server);
+    server->DestroyIfInactive();
+    }
+TInt CSenConnAgentSession::CoBrandingGoNoGoL(const RMessage2& aMessage)
+    {
+    TBool* goNoGo = static_cast<TBool*>(
+					const_cast<TAny*>(aMessage.Ptr0()));    
+
+	HBufC8* buf = HBufC8::NewLC(aMessage.GetDesLengthL(1));
+	TPtr8 bufPtr = buf->Des();
+	aMessage.ReadL(1, bufPtr);
+    
+    RBuf8* selectedbrandID = static_cast<RBuf8*>(
+					const_cast<TAny*>(aMessage.Ptr2()));
+
+    if (ipCoBrandingObserver)
+        {
+        *goNoGo = ipCoBrandingObserver->OnGetBrandIdL(*buf,*selectedbrandID);  
+				CleanupStack::PopAndDestroy(buf);        
+        return KErrNone;
+        }
+        
+		CleanupStack::PopAndDestroy(buf);        
+    return KErrGeneral;
+    }
+TInt CSenConnAgentSession::ReauthenticationNeededL(const RMessage2& aMessage)
+	{
+	TInt retVal = KErrNone;
+	TBool providerCreated = EFalse;
+	
+	if(iAuthObserver)
+		{
+		CSenChunk* pSenChunk = CSenChunk::NewLC(KNullDesC());
+		retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+		
+		if(retVal == KErrNone)
+			{
+	    	CSenIdentityProvider* pIdP = 
+	    		(CSenIdentityProvider*)iAuthObserver->IdentityProviderL();
+	    	
+	    	if(!pIdP)
+	    		{
+	    		TPtrC8 identityProvider;
+	    		retVal = pSenChunk->DescFromChunk(identityProvider);
+	    		
+	    		if(retVal == KErrNone)
+	    			{
+			    	pIdP = CSenIdentityProvider::NewLC(KNullDesC8());
+			    	providerCreated = ETrue;
+			    	CSenXmlReader* pXmlReader = CSenXmlReader::NewLC(KXmlParserMimeType);
+			    	pXmlReader->SetContentHandler( *pIdP );
+			    	pIdP->SetReader(*pXmlReader);
+			    	
+			    	pIdP->ParseL( identityProvider );
+			    	CleanupStack::PopAndDestroy(pXmlReader);
+			    		
+			    	TPtrC8 userName = iAuthObserver->UsernameL();
+			        TPtrC8 password = iAuthObserver->PasswordL();
+			        if(pIdP && userName != KNullDesC8 && password != KNullDesC8 )
+			        	{
+				        retVal = pIdP->SetUserInfoL( userName ,
+											   		 userName ,
+											   		 password );
+			        	}
+	    			}
+	    		}
+	    	
+	    	if(pIdP)
+	    		{
+	    		// Identity provider data retrieved from callback, return it
+	    		HBufC8* desIdP = pIdP->AsXmlL();
+	    		CleanupStack::PushL(desIdP);
+	    		pSenChunk->DescToChunk(*desIdP);
+	    		CleanupStack::PopAndDestroy(desIdP);
+	    		}
+	    	else
+	    		{
+	    		// Identity provider was not passed
+	    		retVal = KErrNotFound;
+	    		}
+	    	
+	    	if(providerCreated)
+	    		{
+	    		CleanupStack::PopAndDestroy(pIdP);
+	    		}
+			}
+		CleanupStack::PopAndDestroy(pSenChunk);
+		}
+	else
+		{
+		retVal = KErrNotReady;
+		}
+	return retVal;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wscore    
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wscore.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wscore.iby)
+../sis/S60SOA.sis   /epoc32/data/z/system/install/S60SOA.SIS
+PRJ_MMPFILES
+sencore.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/group/sencore.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       Project specification file for wscore    
+*
+*/
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+	TARGET      SEN.EXE
+	UID         0x1000008d 0x101F96F4
+#else
+	TARGET      wscore.EXE
+	UID         0x1000008d 0x101F972C
+#endif
+
+#ifdef EKA2
+TARGETTYPE EXE
+TARGETPATH /SYSTEM/PROGRAMS // Needs to be specified because currently (2004 wk48)
+                            // it's not putting it neither to sys/bin or 
+                            // /system/programs. Can be removed later.
+#else
+TARGETTYPE EPOCEXE
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_SERVER )
+        CAPABILITY ProtServ ReadDeviceData WriteDeviceData SwEvent Location \
+                   NetworkServices ReadUserData WriteUserData LocalServices UserEnvironment
+    #else
+        CAPABILITY CAP_SERVER
+    #endif
+#endif
+
+// Currently, WS-stack requires (and consumes MAX) 4 MBs of heap
+EPOCHEAPSIZE 0x060000 0x400000
+
+SOURCEPATH ../src
+SOURCE senclientsession.cpp
+SOURCE sencoreshutdowntimer.cpp
+SOURCE sencoreservicemanager.cpp
+SOURCE sencoreservicemanagermain.cpp
+SOURCE senxmldao.cpp
+#ifdef __ENABLE_ALR__
+SOURCE senmobilityobserver.cpp
+#endif
+
+USERINCLUDE   ../inc 
+USERINCLUDE   ../../wsframework/inc           // ECOM interfaces
+USERINCLUDE   ../../wsidentitymanager/inc     // MSenIdentityManager.h
+USERINCLUDE   ../../wsutils/inc               // SenDebug.h
+USERINCLUDE   ../../wslogger/inc              // for TLS based file logging
+USERINCLUDE   ../../wsnotifierplugins/inc     // notifier client
+USERINCLUDE   ../../wshostletconnection/inc
+USERINCLUDE   ../../wsmessages/inc
+USERINCLUDE   ../../wscredentialmanager/inc   // SenInternalCredential.h
+USERINCLUDE 	../../wsxml/inc								//senxmldebug.h
+
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE /epoc32/include/ecom
+SYSTEMINCLUDE /epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY ecom.lib
+LIBRARY euser.lib 
+LIBRARY efsrv.lib 
+LIBRARY estor.lib 
+LIBRARY flogger.lib
+LIBRARY bafl.lib
+LIBRARY imut.lib        // imcvcodc.h - base64 encode and decode
+LIBRARY sysutil.lib     // sysutil.h
+LIBRARY etel.lib etelmm.lib // IMSI retrieving
+#ifdef __ENABLE_ALR__
+LIBRARY esock.lib		//MOBILITY
+LIBRARY commdb.lib //MOBILITY
+LIBRARY  netmeta.lib
+#endif
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY senlogger.lib   // for TLS based logging
+LIBRARY senfragment.lib
+LIBRARY senmessages.lib
+LIBRARY senxml.lib
+LIBRARY senservDesc.lib
+LIBRARY senutils.lib
+LIBRARY senframework.lib // CSenHttpTransportProperties
+LIBRARY senidentityManager.lib
+LIBRARY sencredentialManager.lib
+LIBRARY sennotdlg.lib
+#else
+LIBRARY wslogger.lib   // for TLS based logging
+LIBRARY wsfragment.lib
+LIBRARY wsmessages.lib
+LIBRARY wsxml.lib
+LIBRARY wsservDesc.lib
+LIBRARY wsutils.lib
+LIBRARY wsframework.lib // CSenHttpTransportProperties
+LIBRARY wsidentityManager.lib
+LIBRARY wscredentialManager.lib
+LIBRARY wsnotdlg.lib
+#endif
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+#endif
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/msendao.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_DAO_H
+#define M_SEN_DAO_H
+
+//  INCLUDES
+#include <flogger.h>
+#include <e32std.h>
+
+#include "msenserviceinvocationframework.h"
+#include "msenservicemanager.h"
+#include "msenremoteserviceconsumer.h"
+#include "MSenServiceDescription.h"
+
+// FORWARD DECLARATIONS
+class CSIF;
+class CSenServiceSession;
+class CSenXMLDAO;
+class CSenCoreServiceManager;
+
+// CLASS DECLARATION
+class MSenDAO
+    {
+    friend class CSenXMLDAO;             // to provide visibility to critical section
+    friend class CSenCoreServiceManager; // to provide visibility to critical section
+
+    public:
+        virtual MSIF* Framework( const TDesC8& aFramework ) = 0;
+        virtual TInt Add( CSenWSDescription& aDescription ) = 0;
+        virtual TInt Add( CSIF& aFramework ) = 0;
+        virtual TBool Remove( CSenWSDescription& aDescription ) = 0;
+        virtual void Remove( CSIF& aFramework ) = 0;
+        
+        /**
+        * The ownership of the returned ServiceDescription is NOT transferred 
+        */
+        virtual CSenWSDescription* FindMatchingServiceDescriptionL( CSenWSDescription& aSd ) = 0; //codescannerwarnings
+                                           
+        virtual TInt AddServiceDescriptionToFrameworksL( CSenWSDescription& aPattern,
+                                                         MSenRemoteServiceConsumer& aRemoteConsumer,
+                                                         HBufC8*& aErrorMsg ) = 0;
+                     
+        virtual TInt FindAllMatchingServiceDescriptions( RWSDescriptionArray& aMatches,
+                                                         const TDesC8& aContract ) = 0;
+                                            
+        virtual TInt FindAllMatchingServiceDescriptions( RWSDescriptionArray& aMatches,
+                                                         MSenServiceDescription& aPattern ) = 0;
+                                        
+        virtual TInt SaveL( const CSenServiceSession& aServiceSession ) = 0;
+        virtual TInt SaveL( const CSIF& aServiceInvocationFramework ) = 0;
+        virtual CDesC8Array& SupportedFrameworksL() = 0;
+        virtual void Load() = 0;
+        virtual TInt NotifyFrameworksL( const TDesC8& aFrameworkID,
+                                        const TInt aEvent,
+                                        TAny* aArgument) = 0;
+
+        virtual TPtrC8 TransportPluginCueBySchemeL( const TPtrC8& aSchema ) = 0;
+
+        /** 
+        * Looks up CSenProvider ECOM plug-in. Sharable hostlets (providers)
+        * may be found from a "proxy", a cache allowing them to be reused.
+        */
+        virtual MSenProvider& LookupHostletForL( const TDesC8& aHostletEndpoint,
+                                                 const TDesC& aReqThreadId,
+                                                 const TDesC8& aReqConsumerId ) = 0;
+
+        /** 
+        * Unsharable providers should be released from server (main) threads
+        * memory by calling this method. 
+        */
+        virtual TInt ReleaseHostletL(const MSenProvider* aHostlet,
+                                      const TDesC& aReqThreadId,
+                                      const TDesC8& aReqConsumerId) = 0;
+
+    private:
+        virtual TInt Save() = 0;
+
+        RCriticalSection iCriticalSection;
+    };
+
+#endif // M_SEN_DAO_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/senclientsession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,590 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_CLIENTSESSION_H
+#define SEN_CLIENTSESSION_H
+
+// INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <flogger.h>
+
+#include "msenremoteserviceconsumer.h"
+#include "msenremotehostlet.h"
+#include "msenservicemanager.h"
+#include "msenremoteservicesession.h"
+#include "senpointermap.h"
+#include "senchunk.h"
+
+#include "sentransportbase.h"
+
+#include "msenmessagecontext.h" // application domain: Framework\inc
+#include "senmessagecontext.h"
+
+#include "sencontext.h"         // private: Framework\inc
+
+#include "RSenDocument.h"
+#include "senservicemanagerdefines.h"
+#include "senatomentry.h"
+#ifdef __ENABLE_ALR__
+#include "senmobilityobserver.h"
+#endif    //__ENABLE_ALR__
+
+// CONSTANTS
+const TInt KErrConsumerIdIsNull = 84;
+
+// FORWARD DECLARATIONS
+class CSenIdentifier;
+class CSenServiceSession;
+class CSenClientMessage;
+class CSenSoapEnvelope2;
+class TXmlEngElement;
+class TXmlEngDataContainer;
+class RSenDocument;
+class CSenMessageContext;
+class CSenServerContext;
+class RSenConnectionServerSession;
+class TFileTransferProgress;
+
+typedef RSenPointerMap<TInt, CSenClientMessage> RHostletRequestMap;
+
+//typedef RPointerArray<RMessage2> RTransactionArray;
+typedef RPointerArray<CSenClientMessage> RTransactionArray;
+typedef RPointerArray<TInt> RTransactionIdArray;
+
+
+NONSHARABLE_CLASS(CSenMessageResourceHandler): public CActive
+    {
+    friend class RSenConnectionServerSession;
+    private:
+    CSenMessageResourceHandler(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+            TInt aProgress, RSenConnectionServerSession* aOwner);
+    ~CSenMessageResourceHandler();
+    void DoCancel();
+    void RunL();
+    TInt SetBuffer(const TDesC8& aSoapOrCid);
+    
+    private:
+    TPckgBuf<TTransferProgress> iProgressData;
+    HBufC8* iSoapOrCid;
+    RSenConnectionServerSession* iOwner;
+    CSenMessageResourceHandler* iNext;
+    CSenMessageResourceHandler* iPrevious;
+    };
+    
+//class RSenConnectionServerSession: public RSessionBase
+NONSHARABLE_CLASS(RSenConnectionServerSession): public RSessionBase
+    {
+    public:
+    TInt CreateSession(const RMessage2& aMessage);
+    void SendFileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+            const TDesC8& aSoapOrCid, TInt aProgress);
+    void Remove(CSenMessageResourceHandler* aResourceHandler);
+    void Close();
+    
+    TInt InitProgressObserver(const RMessage2& aMessage);
+    TInt InitAuthObserver(const RMessage2& aMessage);
+    TInt ReauthenticationNeeded(CSenChunk& aSenChunk);
+        TInt InitCoBrandingObserver(const RMessage2& aMessage);
+        TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId);
+#ifdef __ENABLE_ALR__
+        TInt InitMobilityObserver(const RMessage2& aMessage) ;
+	
+        TInt PreferredCarrierAvailable( TAccessPointInfo& aOldAPInfo, TAccessPointInfo& aNewAPInfo, TBool& aIsUpgrade, TBool& aIsSeemLess) ;
+    	
+        TInt NewCarrierActive (TAccessPointInfo& aNewAPInfo, TBool& aIsSeamless ) ;
+        TInt MobilityError( TInt& aError ) ;	
+#endif    //__ENABLE_ALR__
+    private:
+    CSenMessageResourceHandler* iFirst;
+    };
+
+NONSHARABLE_CLASS(CSenConnAgentSync): public CActive
+    {
+    friend class RSenConnectionServerSession;
+private:
+    CSenConnAgentSync();
+    ~CSenConnAgentSync();
+    void DoCancel();
+    void RunL();
+    void Start();
+    };
+
+NONSHARABLE_CLASS(CSenBinaryData): public CBase
+    {
+    public:
+        enum TSenBinaryDataType
+            {
+            EFile   = 1,
+            EChunk  = 2
+            };
+
+        static CSenBinaryData* NewL(RChunk& aChunk, TDesC8& aCid, TInt aOffset, TInt aSize);
+        static CSenBinaryData* NewLC(RChunk& aChunk, TDesC8& aCid, TInt aOffset, TInt aSize);
+        static CSenBinaryData* NewL(RFs& aFs, RFile& aFile, TDesC8& aCid, TInt aOffset = 0, TInt aSize = 0);
+        static CSenBinaryData* NewLC(RFs& aFs, RFile& aFile, TDesC8& aCid, TInt aOffset = 0, TInt aSize = 0);
+            
+        ~CSenBinaryData();
+        
+        RChunk& Chunk();
+        RFile& File();
+        TDesC8& Cid();
+        TInt Offset();
+        TInt Size();
+        TSenBinaryDataType Type();
+
+    protected: 
+        CSenBinaryData(TInt aOffset, TInt aSize);
+        void BaseConstructL(RChunk& aChunk, TDesC8& aCid);
+        void BaseConstructL(RFs& aFs, RFile& aFile, TDesC8& aCid);
+    
+    private:
+        RChunk              iChunk;
+        
+        RFs                 iFs;
+        RFile               iFile;
+        
+        TSenBinaryDataType  iType;
+        HBufC8*             ipCid;
+        TInt                iOffset;
+        TInt                iSize;
+    };
+
+// CLASS DECLARATION
+#ifdef __ENABLE_ALR__
+class CSenClientSession : public CSession2, public MSenRemoteServiceConsumer, public MSenRemoteHostlet, public MMobilityProtocolResp
+#else
+class CSenClientSession : public CSession2, public MSenRemoteServiceConsumer, public MSenRemoteHostlet
+#endif
+    {
+    public: // Constructors and destructor
+        
+        static CSenClientSession* NewL( MSenServiceManager& aServer, CSenServerContext& aCtx );
+        static CSenClientSession* NewLC( MSenServiceManager& aServer, CSenServerContext& aCtx );
+
+        ~CSenClientSession();
+
+        // Function from base classes
+        
+        // from CSession2
+        void ServiceL(const RMessage2& aMessage);
+
+        // from MSenRemoteServiceConsumer
+        virtual const TDesC8& Id() const;
+        CSenIdentifier& Identifier() const;
+
+        TInt SetSessionL(MSenRemoteServiceSession& aServiceSession);
+        TInt HandleMessageL(HBufC8* apMessage,
+                            const TInt aTxnId,
+                            MSenProperties* aResponseTransportProperties);
+                            
+        TInt HandleErrorL(HBufC8* apError,
+                          const TInt aErrorCode,
+                          const TInt aTxnId,
+                          MSenProperties* aResponseTransportProperties);
+
+        void SetStatusL(const TInt status);
+        void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress);
+        void TransferProgressForHostlet( TInt aTxnId, TBool aIsIncoming, TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress);
+        void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails); 
+
+        MSenTransport& TransportL();
+
+        TInt ProcessRequestFromConsumerL(const TDesC8& aMessage,
+                                         const TInt aTxnId,
+                                         MSenRemoteServiceConsumer& aConsumer); 
+
+        TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
+        MSenMessageContext* MessageContextByTxnIdL(TInt aTxnId, TInt& aError);
+
+        TInt OnServiceCompleteL(const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc = KNullDesC8); 
+        
+        void StateChanged(TInt aState);
+        
+        TBool HasAuthenticationCallback();
+        TInt ReauthenticationNeededL(CSenIdentityProvider*& aIdp);
+        TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId);
+        TBool HasCoBrandingCallback();		
+#ifdef __ENABLE_ALR__
+		void ObserveMobiltyService(const RMessage2& aMessage) ;
+		void MigrateToPrefferedCarrierL(const RMessage2& aMessage) ;	
+		void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+	                                        TAccessPointInfo aNewAPInfo,
+	                                        TBool aIsUpgrade,
+	                                        TBool aIsSeamless ) ;
+	    void Error( TInt aError );
+	    void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ) ;
+		void NewCarrierAcceptedL(const RMessage2& aMessage) ;		
+#endif //__ENABLE_ALR__
+    protected: 
+        CSenClientSession(MSenServiceManager& aServer, CSenServerContext& aCtx);
+        void ConstructL();
+
+        // New functions
+        
+        void PanicClient(const RMessagePtr2& aMessage,TInt aPanic) const;
+        void InitializeL(const RMessage2& aMessage);
+        void TransactionL(const RMessage2& aMessage);
+        TInt SearchMsgChunk( const RMessage2& aMessage, CSenChunk*& aHit );
+        void SendMsg( const RMessage2& aMessage ); // async
+        void SendMsgL( const RMessage2& aMessage, CSenChunk& aSenChunk ); // async
+        RFileLogger* Log() const;
+        void InstallFrameworkL(const RMessage2& aMessage);
+        void DissociateServiceL(const RMessage2& aMessage);
+        void AssociateServiceL(const RMessage2& aMessage);
+        void RegisterIdentityProviderL(const RMessage2& aMessage);
+        void UnregisterIdentityProviderL(const RMessage2& aMessage);
+        void RegisterServiceDescriptionL(const RMessage2& aMessage);
+        void UnregisterServiceDescriptionL(const RMessage2& aMessage);
+
+        /**
+        * Searches and returns all service descriptions, which contain
+        * matching fields (elements) with spesified service pattern.
+        * Typical fields used in service pattern are Endpoint and 
+        * Contract.
+        */
+        void ServiceDescriptionsByPatternL(const RMessage2& aMessage);
+        /**
+        * Searches and returns all service descriptions, which match
+        * with specified Contract (typically some URI).
+        */
+        void ServiceDescriptionsByUriL(const RMessage2& aMessage);
+
+        void IsReadyL(const RMessage2& aMessage);
+        void HasFacetL(const RMessage2& aMessage);
+        void CompleteServerMessagesOnOffL(const RMessage2& aMessage);
+        void ReceiveServiceDescriptionL(const RMessage2& aMessage);
+        void RequestServiceDescriptionL(const RMessage2& aMessage);
+        void StartTransactionL(const RMessage2& aMessage);
+        void TransactionCompletedL(const RMessage2& aMessage);
+        void CancelSessionL(const RMessage2& aMessage);
+        void TransportPropertiesL(const RMessage2& aMessage);
+        void SetTransportPropertiesL(const RMessage2& aMessage);
+    
+        void EstablishHostletConnectionL(const RMessage2& aMessage);
+        void AwaitHostletRequestL(const RMessage2& aMessage);
+        void ProvideHostletResponseL(const RMessage2& aMessage);
+//        void AcquireHostletRequestHandleL(const RMessage2& aMessage);
+        void MoveChunkL(const RMessage2& aMessage);
+        void MoveFileL(const RMessage2& aMessage);
+        void SendFileHandleL(const RMessage2& aMessage);
+        TInt SendProgressToHostlet(const RMessage2& aMessage);
+        CSenClientMessage* ClientMessageByPendingTxnIdL( TInt aTxnId);
+
+    private:
+    
+        // Defines, whether this client session is a service connection (SC) or a hostlet connection (HC)
+        enum TSessionType
+            {
+            ENotInitialized = 0,
+            ERemoteConsumer_SC,
+            ERemoteHostlet_HC
+            };
+
+        // User permission check states
+        enum TestCase
+            {
+            ENotChecked = 0,
+            EAccepted,
+            ENotAccepted
+            };
+
+        // New functions
+
+        /**
+        * SessionValidity() method checks session validity 
+        * @return KErrNone if session is ready and 
+        *         its credentials (if any) are valid
+        *
+        *         KErrSenNotInitialized if session is not yet set 
+        *         (iSession is NULL)
+        *
+        *         KErrConnectionInitializing if session's state  is new 
+        *         (iStatus is KSenConnectionStatusNew)
+        *
+        *         KSenConnectionStatusExpired if session's state is initializing 
+        *         (iStatus is KSenConnectionStatusNew)
+        *
+        *         KSenConnectionStatusExpired if session's state is expired 
+        *         (iStatus is KSenConnectionStatusExpired)
+        */
+        TInt SessionValidity();
+
+        TBool CheckValidity(const RMessage2 &aMessage);
+        TBool CheckAllowRegisterL(TInt& aError, const RMessage2& aMessage, const TDesC8& aFrameworkId);
+        TBool CheckAllowUnRegisterL(TInt& aError, const RMessage2& aMessage, const TDesC8& aFrameworkId);
+        TBool CheckAllowUnRegisterL(TInt& aError, const RMessage2& aMessage);
+        /**
+        * ReleaseServiceSession is called in the destructor of this class to
+        * make sure that framework spesific garbage collection for consumed 
+        * service session will be executed. It is up to framework implementations
+        * whether they need to cleanup (destroy) this service session which is
+        * being here released.
+        */
+        TInt ReleaseServiceSession();
+
+        /**
+        * Method is called from destructor, to ensure that
+        * all pending async requests get completed.
+        *
+        * Messages will be completed using ESenServRequestCancelled
+        * operation code from TWsfServRqstOpCode enumeration defined
+        * in SenServiceManagerDefines.h
+        *
+        * Internally, this method calls and TRAPS CleanupPendingMessagesL()
+        * @return KErrNone or leave code, if CompletePendingMessagesL() fails.
+        */
+        TInt CompletePendingMessages(); 
+        /**
+        * Leaving variant of CleanupPendingMessages(), which includes
+        * actual cleanup code.
+        *
+        * This version may be called if *cancel operation* is received
+        * from client to cancel all pending -async- operations.
+        */
+        void CompletePendingMessagesL();
+
+		TInt TransactionIndex(TInt aTxnId);
+        TInt ContextIndex(TInt aCtxId);
+
+        RTransactionArray& Transactions();
+        RTransactionIdArray& TxnIds();
+        RHostletRequestMap& HostletRequestMap();
+        
+        TInt CompleteTransaction(TInt aErrorCode, CSenChunk& aChunk);
+        TInt CompleteTransactionByCtxId(TInt aErrorCode, TInt aCtxId);
+        TInt CompleteTransactionByIndex(TInt aErrorCode, TInt aTransactionIndex);
+
+        TInt ReadChunkNameLC( const RMessage2& aMessage, TInt aIpcArgIndex, HBufC*& apChunkName );
+
+        /**
+        * Helper called by SC::ReceiveInitialize and HC:EstablishConnection
+        * Instantiates a new XML service description object, which then will
+        * parse the provided XML (serialized XML service description)
+        * @param aSdAsXml is the input XML descriptor
+        * @param apInitializer provides ref-to-ptr where new initializer 
+        * (a XML service description) will be assigned, when method succeeds.
+        * @param apConsumerPolicy is optional argument, which can be utilized
+        * to provide consumer policy descriptor, when such is available.
+        * @return KErrNone if session was initialized or 
+        * otherwise some system-wide errorcode.
+        */
+        TInt ParseSessionInitializerL(CSenWSDescription*& apInitializer,
+                                      const TDesC8& aSdAsXml,
+                                      const TDesC8* apConsumerPolicy = NULL);
+
+        /**
+        * Helper called by SC::ReceiveInitialize and HC:EstablishConnection
+        * Initializes the service session or returns an error.
+        * @param aInitializer is the SD to be used in session initialization
+        * @param aErrorMsg will contain error description, typically SOAP fault,
+        * in case that (IDP / authentication) service spesific error occured
+        * @return KErrNone if session was initialized or 
+        * otherwise some system-wide errorcode.
+        */
+        TInt InitializeServiceSessionL(CSenWSDescription& aInitializer, HBufC8*& aErrorMsg);
+
+        /**
+        * Helper.
+        * Reads a Service Description (buffer) from certain 
+        * RMessage2 IPC ARGS indexes
+        * @return KErrNone if buffer was successfully read
+        * or otherwise some system-wide errorcode.
+        */
+        TInt ReadBufferFromRMessageL(const RMessage2& aMessage, 
+                                     TInt aSdLengthIdx, 
+                                     TInt aSdBufIdx,
+                                     HBufC8*& aSdBuf);
+
+        TInt ListBinaryElementsL(RArray<TXmlEngElement>& aElementArray,
+                                 TXmlEngElement& aElement);
+                                 
+        TInt ParseMessageL(TInt aTransactionId,
+                           const TDesC8& aRequest,
+                           CSenSoapEnvelope2& aSoapEnvelope);
+        TInt ParseMessageL(TInt aTransactionId,
+                           const TDesC8& aRequest,
+                           CSenAtomEntry& aAtomEntry);
+        void AddCredentialL(const RMessage2& aMessage);
+        void CredentialsL(const RMessage2& aMessage);
+        void RemoveCredentialsL(const RMessage2& aMessage);
+        
+        void CancelRequestL(const RMessage2& aMessage);
+        
+        void DataTrafficDetails(const RMessage2& aMessage); 
+        void ConnectionID(const RMessage2& aMessage);
+        
+        void ConnectionIdentityProviderL(const RMessage2& aMessage);
+//        CSenIdentityProvider* ConnectionIdentityProviderL();
+        // Constantantness on the TInt return type has no meaning so prototype is modified 
+        // Overrides TInt MSenRemoteServiceConsumer::ConnectionId()
+     	TInt ConnectionId();
+     	
+     	void SearchIdentityProviderL(const RMessage2& aMessage);
+     	void IdentityProviders(const RMessage2& aMessage);
+     	void ObserveTransfer(const RMessage2& aMessage);
+     	void ObserveAuthCallback(const RMessage2& aMessage);
+     	TInt CompleteReauthLoop(CSenChunk& aSenChunk);
+        TBool IsTrustedClient(const RMessage2& aMessage);
+    	TBool CleanPassword(const RMessage2& aMessage);
+    	virtual TSecureId SecureId();
+        virtual TVendorId VendorId();
+
+     	void ObserveCoBranding(const RMessage2& aMessage);
+
+        void DeliverProgressToClient( TInt aTxnId, TBool aIsIncoming, TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress );
+
+
+#ifdef __ENABLE_ALR__
+    	void MigrateToPrefferedCarrier(TBool aUserChoice) ;
+    	void NewCarrierAcceptedL(TBool aUserChoice) ;
+#endif //__ENABLE_ALR__
+
+    private: // Data
+        MSenServiceManager &iManager;
+        MSenRemoteServiceSession* iServiceSession;  // not owned
+        //CSenServiceSession *iServiceSession;      // not owned
+        TInt iStatus;
+    
+        // can be used for routing of messages :
+        // could use the latest UUID for this too..
+        HBufC8* iConsumerID;    
+        HBufC8* iPolicyBuf;     
+    
+        // data to be written to client
+        CBufFlat* iSendBuf; 
+
+        CSenWSDescription* iInitializer;
+        TInt iAllowWSDataReg;
+        TInt iAllowWSDataUnReg;
+
+        CSenTransportBase* ipTransport;
+        CSenIdentifier* ipIdentifier;
+        CSenClientMessage* ipHostletAwaitOp;
+
+        RTransactionArray   iPendingTransactions;   // owned pointers to heap
+        RTransactionIdArray iPendingTxnIds;       // owned pointers to heap
+        RHostletRequestMap  iHostletRequests;      // keys and values are owned
+
+        //RTransactionArray*      ipPendingTransactions;   // owned pointers to heap
+        //RTransactionIdArray*    ipPendingTxnIds;       // owned pointers to heap
+        //RHostletRequestMap*     ipHostletRequests;      // keys and values are owned
+
+        TSessionType iSessionType;
+
+        TInt iAllowShowDialogCount;
+        
+        TInt iConnectionID;
+        
+        TInt iAuthenticationRetries;
+        TBool iConnectionHasAuthenticationCallback;
+        
+        CSenServerContext& iServerContext;
+        TSecureId iSecureId; 
+        TVendorId iVendorId;
+        //session to client side server
+        RSenConnectionServerSession iConnectionSession;
+        TSenDataTrafficDetails iDetails;
+		
+		TBool iFwNotified;
+		
+		// Cache the client secure id to update clients about connection status
+        TSecureId iClientSecureID;
+        TBool iConnectionHasCoBrandingCallback;
+        TBool iReauthResendNeeded;
+#ifdef __ENABLE_ALR__        
+       	CALRObserver* iALRObserver;	// mobilty observer		
+		MMobilityProtocolResp* iMobiltyObserver ;
+		TBool				iMobilityCallBackForwarded ;
+		TBool				iMobilityChoice ;
+#endif //__ENABLE_ALR__
+        };
+
+// CLASS DECLARATION
+NONSHARABLE_CLASS(CSenClientMessage): public CSenChunk
+    {
+    public: 
+        // Constructors and destructor
+        static CSenClientMessage* NewL(const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer = NULL);
+        static CSenClientMessage* NewLC(const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer = NULL);
+        
+        static CSenClientMessage* NewL(const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer, MSenTransport& aTransport);
+        static CSenClientMessage* NewLC(const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer, MSenTransport& aTransport);
+        
+        ~CSenClientMessage();
+
+        // New methods:
+        RMessage2& RMessage();
+        MSenRemoteServiceConsumer* Consumer();
+        
+        TBool operator==(const CSenClientMessage& a);
+        
+        MSenMessageContext& MessageContext();
+        
+        RPointerArray<CSenBinaryData>& BinaryDataArray();
+        
+        TInt CtxId();
+
+    private:
+        void ConstructL(const RMessage2& aMessage, 
+                        MSenRemoteServiceConsumer* apConsumer = NULL);
+        
+        void ConstructL(const RMessage2& aMessage, 
+                        MSenRemoteServiceConsumer* apConsumer,
+                        MSenTransport& aTransport);
+        CSenClientMessage();
+
+        
+    private: // Data
+        CSenMessageContext*             ipMessageContext;
+        RMessage2                       iMessage;
+        MSenRemoteServiceConsumer*      ipConsumer; // not owned
+        RPointerArray<CSenBinaryData>   iBinaryDataArray;
+    };
+
+
+NONSHARABLE_CLASS(TFileOutgoingTransferProgress): public TFileOutgoingTransferProgressBase
+    {
+    public: 
+        //~TFileOutgoingTransferProgress();    
+        TFileOutgoingTransferProgress( TInt aTxnId, TBool aIsIncoming, TInt aProgress, TBool aHasCidPostfix, TInt aCid, TInt aCid2 = -1 );
+    };
+
+
+NONSHARABLE_CLASS( TFourInts )
+    {
+    public:
+    	TInt iInt1;
+    	TInt iInt2;
+    	TInt iInt3;
+    	TInt iInt4;
+	};
+
+#endif // SEN_CLIENTSESSION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/sencoreservicemanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,460 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_CORE_SERVICE_MANAGER_H
+#define SEN_CORE_SERVICE_MANAGER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <f32file.h>
+#include <imcvcodc.h> // for base64 codec
+#include <flogger.h>
+#include <etelmm.h>
+
+#include <SenXmlReader.h>
+
+#include "senservicemanagerdefines.h"
+#include "msencoreservicemanager.h"
+#include "senxmldao.h"
+#include "msentransport.h"
+
+// CONSTANTS
+#ifdef EKA2 
+
+// Server's policy here
+
+// Total number of ranges
+const TUint KCoreServiceManagerRangeCount = 11;	//CodeScannerWarnings
+
+// Definition of the ranges of IPC numbers
+// NOTE: ranges MUST start from request number 0  (!)
+const TInt coreServiceManagerRanges[KCoreServiceManagerRangeCount] = 
+        {
+        0,  // ESenServInitialize,
+        1,  // ESenServTransaction,
+        2,  // ESenServInstallFramework,
+        3,  // ESenServAssociateService,
+            // ESenServDissociateService, 
+            // ESenServRegisterIdentityProvider,
+            // ESenServUnregisterIdentityProvider,
+            // ESenServRegisterServiceDescription,
+            // ESenServUnregisterServiceDescription,
+        9,  // ESenServGetServiceDescriptionsByPattern, 
+            // ESenServGetServiceDescriptionsByUri,
+        11, // ESenServIsReady,
+            // ESenServHasFacet,
+            // ESenServServerMessagesOnOff,
+        14, // ESenServGetLengthOfServiceDescriptionByUri,
+            // ESenServGetLengthOfServiceDescriptionByPattern,
+        16, // ESenServRequestServiceDescription,
+            // ESenServReceiveServiceDescription,
+        18, // ESenServSendMsgAndGetTxnId,
+            // ESenServSendSoapMsgAndGetTxnId,
+        20, // ESenServStartTransaction,
+            // ESenServTransactionCompleted,
+            // ESenServCancelSession,
+            // ESenServSetTransportProperties,
+            // ESenServTransportProperties
+            // ESenServCreateHostletConnection, 
+            // ESenServWaitForHostletRequest    
+            // ESenServProvideHostletResponse   
+            // ESenServMoveChunk
+            // ESenServMoveFile
+            // ESenServSendFileHandle
+            // ESenServGetGredentials
+            // ESenServAddCredential
+            // ESenServRemoveCredential
+            // ESenServCancelRequest
+            // ESenServConnectionID
+            // ESenServConnectionIdentityProvider
+            // ESenObserveTransfer
+            // ESenObserveAuthCallback
+            // ESenTransferProgress
+        	// ESenServSearchIdentityProvider
+            // ESenServTrafficDetails
+	    // ESenObserveCoBranding	
+        	// ESenServGetIdentityProviders
+#ifdef __ENABLE_ALR__
+			// ESenServRegisterMobiltyObserver
+			//ESenServMigrateToPreffredCarrier
+			//ESenServNewCarrierAccepted
+        47
+#else
+		44
+#endif
+        }; 
+
+// Policy to implement for each of the above ranges        
+const TUint8 coreServiceManagerElementsIndex[KCoreServiceManagerRangeCount] = 
+        {
+        2,                           //applies to 1st range  <=>  0
+        CPolicyServer::EAlwaysPass,  //applies to 2nd range  <=>  1
+        1,                           //applies to 3rd range  <=>  2
+        3,                           //applies to 4th range  <=>  3 - 8
+        0,                           //applies to 5th range  <=>  9 - 10
+        CPolicyServer::EAlwaysPass,  //applies to 6th range  <=> 11 - 13
+        0,                           //applies to 7th range  <=> 14 - 15
+        CPolicyServer::EAlwaysPass,  //applies to 8th range  <=> 16 - 17
+        2,                           //applies to 9th range  <=> 18 - 19
+        CPolicyServer::EAlwaysPass,  //applies to 10th range <=> 20 - 35
+        CPolicyServer::ENotSupported //applies to 11th range (out of range IPC; >35)
+        };
+
+// Specific capability checks
+const CPolicyServer::TPolicyElement coreServiceManagerElements[] = 
+        {
+        //policy "0"; fail call if ReadUserData not present
+        {_INIT_SECURITY_POLICY_C1(ECapabilityReadUserData), CPolicyServer::EFailClient},  
+        //policy "1"; fail call if WriteUserData not present
+        {_INIT_SECURITY_POLICY_C1(ECapabilityWriteUserData), CPolicyServer::EFailClient}, 
+        //policy "2"; fail call if NetworkServices not present
+        {_INIT_SECURITY_POLICY_C1(ECapabilityNetworkServices), CPolicyServer::EFailClient}, 
+        //policy "3"; fail call if ReadUserData, WriteUserData not present
+        {_INIT_SECURITY_POLICY_C2(ECapabilityReadUserData, ECapabilityWriteUserData), CPolicyServer::EFailClient}
+        };
+
+// Package all the above together into a policy
+const CPolicyServer::TPolicy coreServiceManagerPolicy =
+        {
+        CPolicyServer::EAlwaysPass,         // specifies all connect attempts should pass 
+        KCoreServiceManagerRangeCount,       // number of ranges                                   
+        coreServiceManagerRanges,           // ranges array
+        coreServiceManagerElementsIndex,    // elements<->ranges index
+        coreServiceManagerElements,         // array of elements
+        };
+
+#endif //EKA2
+
+// FORWARD DECLARATIONS
+class CSenGuidGen;
+class CSenBaseIdentityManager;
+class CSenCredentialManager;
+class CSenServerContext;
+class CSenCoreShutdownTimer;
+
+// CLASS DECLARATION
+
+#ifdef EKA2  
+class CSenCoreServiceManager : public CPolicyServer,
+                               public MSenCoreServiceManager
+#else
+class CSenCoreServiceManager : public CServer2,
+                               public MSenCoreServiceManager
+#endif
+    {
+    public: 
+        
+        // Constructors
+        static CSenCoreServiceManager* NewL();
+        static CSenCoreServiceManager* NewLC();
+
+        // C++ destructor
+        virtual ~CSenCoreServiceManager();
+
+
+        // From MSenIdentityManager:
+
+        virtual MSenIdentity& IdentityL();
+        virtual TInt UserNameL(HBufC8*& aUserName);
+        virtual CSenIdentityProvider* IdentityProviderL();
+        virtual CSenIdentityProvider* IdentityProviderL(const TDesC8& aURI);
+        virtual CSenIdentityProvider* IdentityProviderL(const CDesC8Array& aIdpList,
+                                                        TBool aStrict);
+
+        virtual CSenIdentityProvider* IdentityProviderL(MSenServiceDescription& aSD);
+
+        virtual CSenIdentityProvider* IdentityProviderL(MSenServiceDescription& aSD,
+                                                        const CDesC8Array& aIdpList,
+                                                        TBool aStrict);
+        virtual const RPointerArray<CSenIdentityProvider>& IdentityProvidersL();
+
+        virtual TInt RegisterIdentityProviderL(CSenIdentityProvider* apIdp);
+        virtual TInt UnregisterIdentityProviderL(CSenIdentityProvider& aIdp);
+        virtual TBool AssociateServiceL(const TDesC8& aServiceID, const TDesC8& aProviderID);
+        virtual TBool DissociateServiceL(const TDesC8& aServiceID, const TDesC8& aProviderID);
+        virtual TInt IdentitiesL(CDesC8Array& aIdentitiesList);
+        virtual TInt AuthenticationForL(CSenIdentityProvider& aAccount, TPckgBuf<TSenAuthentication>& aResponse);
+        virtual TPtrC8 SenSecurityMechanismNames8L();
+        virtual void SetShowPasswordDialog(const TBool aState);
+        virtual CSenSecurityMechanism* MechanismNamedL(const TDesC8& aName);
+
+        // From MSenServiceManager
+        virtual TInt InitServiceConnectionL(MSenRemoteServiceConsumer& aServiceConsumer,
+                                            CSenWSDescription& aPattern,
+                                            HBufC8*& aErrorMsg);
+
+        virtual TInt ServiceDescriptionsL(RWSDescriptionArray& aMatches,
+                                          const TDesC8& aContract);
+
+        virtual TInt ServiceDescriptionsL(RWSDescriptionArray& aMatches,
+                                          MSenServiceDescription& aPattern);
+
+        virtual TInt RegisterServiceDescriptionL(CSenWSDescription* apSD);
+        virtual TInt UnregisterServiceDescriptionL(MSenServiceDescription& aSD);
+        virtual CSenBaseFragment* InstallFrameworkL(const TDesC8& aFrameworkId);
+        
+        virtual TPtrC8 IMSI();
+        
+        virtual TPtrC8 IMEI();
+
+        virtual CSenXmlReader* XMLReader();
+        virtual HBufC8* RandomGuidL(); 
+        virtual RFileLogger* Log() const;
+        virtual void IncrementConnections();
+        virtual void DecrementConnections();
+
+
+        virtual TInt ContainsServiceDescriptionL(TBool& aContains,
+                                                 CSenWSDescription& aPattern);
+
+        virtual TInt ContainsIdentityProviderL(TBool& aContains,
+                                               CSenIdentityProvider& aIDP);
+                                               
+        virtual TInt FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
+                                                   CSenIdentityProvider*& apMatch);
+                                                   
+        virtual TInt UpdateIdentityProviderL(CSenIdentityProvider& aIdp);
+
+        virtual TInt NextTransactionId();
+
+        /**
+        * Notifies *ALL* framework plug-ins about certain event
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL(const TInt aEvent);
+
+        /**
+        * Notifies *ALL* framework plug-ins about certain event,
+        * an additional object pointer may be passed
+        * NULL is also accepted
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL(const TInt aEvent, TAny* aArgument);
+
+        /**
+        * Notifies only those frameworks plug-ins, which match
+        * with given framework ID (aFrameworkID)
+        * If aFrameworkID == KNullDesC8 (zero-length),
+        * then *all* known framework plug-ins are notified about the event.
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL(const TDesC8& aFrameworkID, 
+                                       const TInt aEvent);
+
+        /**
+        * Notifies only those frameworks plug-ins, which match
+        * with given framework ID (aFrameworkID)
+        * If aFrameworkID == KNullDesC8 (zero-length),
+        * then *all* known framework plug-ins are notified about the event,
+        * an additional object pointer may be passed
+        * NULL is also accepted
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL(const TDesC8& aFrameworkID,
+                                       const TInt aEvent,
+                                       TAny* aArgument);
+
+
+        virtual TInt SizeOfServiceDescriptionsL(RWSDescriptionArray& aArray);
+        
+        virtual TInt SizeOfCredentialsL(RSenCredentialArray& aArray);
+        virtual TInt SizeOfIdentityProvidersL(const RPointerArray<CSenIdentityProvider>& aArray);
+
+        // From MSenCoreServiceManager
+    
+        /**
+        * Takes the ownership of apServiceDescription
+        * @return KErrNone on success
+        *         KErrArgument, if aServiceDescription is NULL
+        *         KErrSenNoContractNoEndPoint, if both endpoint and
+        *            contract are of zero-lenght, making SD invalid
+        *         KErrGeneral if duplicate (blocking), service description
+        *         with equal primary keys could not be removed.
+        */
+        virtual TInt AddServiceDescriptionL(CSenWSDescription* apServiceDescription);
+
+        virtual TInt RemoveServiceDescriptionL(CSenWSDescription& aServiceDescription);
+
+        virtual TInt SaveL(const CSenServiceSession& aServiceSession);
+        virtual TInt SaveL(const CSIF& aServiceInvocationFramework);
+
+        virtual CDesC8Array& SupportedFrameworksL();
+
+        virtual MSenProvider& LookupHostletForL(const TDesC8& aHostletEndpoint,
+                                                const TDesC& aReqThreadId,
+                                                const TDesC8& aReqConsumerId);
+
+        virtual TInt ReleaseHostletL(const MSenProvider* aHostlet,
+                                     const TDesC& aReqThreadId,
+                                     const TDesC8& aReqConsumerId);
+
+
+        // From MSenTransportFactory:
+        virtual CSenTransportBase* CreateL(CSenWSDescription& aInitializer,
+                                           CSenServiceSession* apSession);
+        
+        // from CServer
+        
+        CSession2* NewSessionL(const TVersion &aVersion,
+                               const RMessage2& aMessage) const; 
+
+        static TInt ThreadFunction(TAny* sStarted);
+
+        
+        virtual HBufC8* EncodeToBase64LC(const TDesC8& aSource);
+        virtual HBufC8* DecodeFromBase64LC(const TDesC8& aSource);
+
+        // New functions
+        virtual RStringPool& StringPool();
+
+/*
+        // New functions
+        virtual TInt AddActiveHostletConnectionEndpointL(const TDesC8& aEndpoint);
+        virtual TInt RemoveActiveHostletConnectionEndpoint(const TDesC8& aEndpoint);
+*/
+
+        // From MSenCredentialManager
+        
+        virtual TInt SaveCredentialDB();
+        
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+                                  RSenCredentialArray& aCredentials);
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+                                  const CSenIdentityProvider& aIdP,
+                                  RSenCredentialArray& aCredentials);
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+                                  RSenCredentialPtrArray& aCredentials);
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+                                  const CSenIdentityProvider& aIdP,
+                                  RSenCredentialPtrArray& aCredentials);
+
+		virtual RSenCredentialPtr AddCredentialL(CSenInternalCredential* apCredential,
+                                                 TInt& aErrorTo);
+
+		virtual RSenCredentialPtr AddCredentialL(CSenIdentityProvider* apIdP,
+                                                 CSenInternalCredential* apCredential,
+	                                             TInt& aErrorTo);
+
+		virtual RSenCredentialPtr AddCredentialL(const TDesC8& aCredential,
+                                                 TInt& aErrorTo);
+
+		virtual RSenCredentialPtr AddCredentialL(CSenIdentityProvider* apIdP,
+                                                 const TDesC8& aCredential,
+                                                 TInt& aErrorTo);
+
+		virtual TInt RemoveCredentialsL(const CSenWSDescription& aPattern);
+
+		virtual TInt RemoveCredentialsL(const CSenWSDescription& aPattern,
+										const CSenIdentityProvider& aIdP);
+										
+        virtual TInt RemoveCredentialsL(const TDesC8& aProviderId);
+
+        virtual TInt RemoveCredentialL(TInt aInternalCredentialId);	//codescannerwarnings
+        
+        virtual RSenCredentialPtr CredentialL(TInt aInternalCredentialId,
+                                              TInt& aErrorTo);
+
+        virtual RSenCredentialPtr UpdateCredentialL(TInt aInternalCredentialId,
+                                                    CSenInternalCredential* apCredential,
+                                                    TInt& aErrorTo);
+        
+        virtual RSenCredentialPtr UpdateCredentialL(TInt aInternalCredentialId,
+                                                    const TDesC8& aCredential,
+                                                    TInt& aErrorTo);
+
+        virtual TInt NextConnectionID();
+
+    protected:  
+        
+        // From CActive
+        TInt RunError(TInt aError);
+
+    private: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenCoreServiceManager(TInt aPriority);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+        
+        MSIF* Framework(const TDesC8& aFrameworkID);
+        TImCodecB64& Base64Codec();
+
+//        RPointerArray<HBufC8>& ActiveHostletEndpointsL();
+
+    private: 
+        
+        // CS framework:
+        static void PanicClient(const RMessage2& aMessage,
+                                TWsfServPanic aReason);
+
+        static void PanicServer(TWsfServPanic aPanic);
+        static void ThreadFunctionL();
+        void UpdateTouchL(CSenServiceSession* aSession);
+        
+        void GetImsiImeiL();
+
+
+    private: // Data
+        CSenXMLDAO*              iDAO;                      // owned
+        CSenBaseIdentityManager* iIdentityManager;          // owned
+        RFileLogger              iLog;                      // owned
+        TInt                     iConnectionCount;
+        CSenGuidGen*             iGuidGenerator;            // owned
+        CSenXmlReader*           iReader;                   // owned
+        TImCodecB64 iBase64Codec; 
+        RStringPool iStringPool;                            // owned
+//        RPointerArray<HBufC8>*   ipActiveHostletEndpoints;  // owned
+
+        TInt iNextTransactionId;
+
+        CSenCredentialManager*   iCredentialManager;        // owned
+        
+        CSenTransportBase* ipVtcpTransport; // not owned
+//        HBufC8*        ipVtcpEndpoint;  // owned
+
+        TInt                     iConnectionID;
+        
+        CSenServerContext* ipServerContext; // owned
+        CSenCoreShutdownTimer* iShutdownTimer;
+        TBuf8<15> iIMSI;
+        TBuf8<50> iIMEI;
+    };
+
+#endif // SEN_CORE_SERVICE_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/sencoreshutdowntimer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CORESHUTDOWNTIMER
+#define SEN_CORESHUTDOWNTIMER
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+
+// CONSTANTS
+const TInt KSenDefaultShutdownTime = 30;
+
+// CLASS DECLARATION
+class CSenCoreShutdownTimer : public CTimer
+    {
+    public:
+        static CSenCoreShutdownTimer* NewL( TInt aShutdownTimeInSecs = KSenDefaultShutdownTime );
+        static CSenCoreShutdownTimer* NewLC( TInt aShutdownTimeInSecs = KSenDefaultShutdownTime );
+            
+        ~CSenCoreShutdownTimer();
+
+        /**
+        * Calling this method will issue CActiveScheduler::Stop() [closing Ws-stack Core server thread],
+        * unless a call to Cancel() was performed (by new CSenClientSession == SC, SM or HC type client)
+        * Shuttime time is as defined in constuction of the timer
+        */
+        void ActivateShutdown();
+
+        virtual void RunL();
+        //virtual TInt RunError(TInt aError);
+//        virtual void DoCancel();
+    
+    private:
+        CSenCoreShutdownTimer( TInt aShutdownTimeInSecs );
+//        void ConstructL();
+        TInt iShutdownTimeInSecs;
+//        TBool iCancelled;
+    };
+
+#endif // SEN_CORESHUTDOWNTIMER
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/senmobilityobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#ifndef M_SEN_MOBILITY_OBSERVER_H
+#define M_SEN_MOBILITY_OBSERVER_H
+
+//  INCLUDES
+#include <flogger.h>
+#include <e32std.h>
+#include <in_sock.h>
+#include <es_enum.h>
+#include <CommDbConnPref.h>
+#include <comms-infras/cs_mobility_apiext.h>
+#include <connpref.h>
+#include "SenXmlReader.h"
+#include "MSenTransport.h"
+#include "SenWSDescription.h"
+
+class CALRObserver  : public CActive, public MMobilityProtocolResp
+	{
+	public:  // Constructors and destructor
+
+	/**
+	* NewL is first phase of two-phased constructor.
+	*/
+	static CALRObserver * NewL(MMobilityProtocolResp &aMobilityObserver, CSenXmlReader &aReader) ;
+	/**
+	* Destructor.
+	*/
+	~CALRObserver ();
+
+	public: // From MMobilityProtocolResp
+
+	void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+	                                TAccessPointInfo aNewAPInfo,
+	                                TBool aIsUpgrade,
+	                                TBool aIsSeamless );
+
+	void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless );
+
+	void Error( TInt aError );
+
+	//Wrapper for MMobilityProtocolResp methods
+
+	void MigrateToPreferredCarrier(); 
+
+	void IgnorePreferredCarrier(); 
+
+	void NewCarrierAccepted(); 
+
+	void NewCarrierRejected();
+	
+	// From CActive
+	void DoCancel() ;
+	void RunL() ;
+	TInt RunError( TInt aError );
+
+	//functions for Client session usage
+	TUint32 GetActiveIap() ;
+	HBufC8* GetNewIapAsTransportPropertyL() ;
+	TUint32 GetActiveSnap() ;
+	void SetDialogPref(TBool aDialogPref) ;
+	TInt OpenConnectionL(TDesC8& aAppTransportProperties,
+							 MSenTransport &aTransport,
+							 CSenWSDescription& aInitializer,
+							 HBufC8*& aNewTransportProperties) ;
+
+
+	private:
+
+	/** 
+	* C++ default constructor.
+	*/
+	CALRObserver(MMobilityProtocolResp &aMobilityObserver, CSenXmlReader &aReader)  ;
+	TInt StartConnection(TUint32& aId, TBool aIsSnapId) ;
+	TInt OpenSocketSever() ;
+	void RefreshAvailabilityL() ;
+
+	/**
+	* By default Symbian OS constructor is private.
+	*/
+	void ConstructL();
+	RConnection iConnection ;
+	RSocketServ iSocketServer;
+	MMobilityProtocolResp &iMobilityObserver ;
+	CActiveCommsMobilityApiExt*   iMobility;
+	TUint32 iIapId;
+	TUint32 iNewIapId;
+	TUint32 iSnapId;
+	TCommDbConnPref iPrefs;      
+	TConnSnapPref iSNAPPrefs;      
+	 CSenXmlReader &iReader ;
+	private:    // Data
+	};
+    
+#endif /*M_SEN_MOBILITY_OBSERVER_H    */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/senservicemanagerdefines.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_MANAGER_DEFS_H
+#define SEN_SERVICE_MANAGER_DEFS_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+_LIT(KSenUnderline, "_");
+_LIT8(KSenAttrInternalSC, "_internal_");
+_LIT8( KSenAttrDisableDispatcherSC, "_disable_dispatcher_");
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    //server name
+    #if defined (EKA2)
+    _LIT(KSenServiceManager,                "!Sen");
+    #else
+    _LIT(KSenServiceManager,                "Sen");
+    #endif
+    //server file name 
+    _LIT(KSenServiceManagerFileName,        "Sen");
+    _LIT(KSenServiceManagerPanic,           "Sen");
+    _LIT(KSenServiceManagerSemaphoreName,   "SenSemaphore");
+#else //RD_SEN_COMPILE_SIS_PACKAGE_FILES is defined:
+    //server name
+    #if defined (EKA2)
+    _LIT(KSenServiceManager,                "!wscore");
+    #else
+    _LIT(KSenServiceManager,                "wscore");
+    #endif
+    //server file name 
+    _LIT(KSenServiceManagerFileName,        "wscore");
+    _LIT(KSenServiceManagerPanic,           "wscore");
+    _LIT(KSenServiceManagerSemaphoreName,   "WsSemaphore");
+#endif //RD_SEN_COMPILE_SIS_PACKAGE_FILES
+
+// Maximum delta time after which any XML DB item is considered old, 
+//and will be discarded at parsing phase, instead of deserialization:
+const TUint32 KMaxTicks	= 86400*14*1000; // = 1209600000 ticks = 2 weeks
+                                         // 1 tick = 1 millisec
+                                         // 86400 sec = 1 day
+                                         // 86400*1000 millisec = 1 day
+                                         // 86400*14*1000 = 1209600000 millisec = 2 weeks
+
+
+
+
+// Maximum number of async message slots to reserve for client server session.
+const TUint KAsyncMessageSlots = 10;
+
+// Default number of message slots to reserve for client server session.
+const TUint KDefaultMessageSlots = KAsyncMessageSlots+1;
+
+// Maximum number of server message slots avilable 
+const TUint KMaxServMessageSlots = 10; 
+// SenServiceManager UID
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TUid KServerUid3 = {0x101F96F4};
+#else
+    const TUid KServerUid3 = {0x101F972C}; //SIS package UID
+#endif
+
+// The server version. A version must be specified when
+// creating a session with the server
+const TUint KWsfServMajorVersionNumber=0;
+const TUint KWsfServMinorVersionNumber=1;
+const TUint KWsfServBuildVersionNumber=1;
+
+// Max number of attempts that each client (SC, HC, SM) should 
+// perform prior giving up client-server connection initialization:
+const TInt KSenMaxClientConnectionOpeningAttempts = 5;
+
+//Introduced a PropertKeyBasenumber to avoid any key collisions with
+//the client applications further.
+const TInt KSenRPropertyKeyBaseNumber = 0x6A954E5;
+
+// DATA TYPES
+
+// SenServiceManager panic codes
+enum TWsfServPanic
+    {
+    EBadRequest = 1,
+    EBadDescriptor,
+    ESrvCreateServer,
+    EMainSchedulerError,
+    ECreateTrapCleanup,
+    ESrvSessCreateTimer,
+    EReqAlreadyPending
+    };
+
+// opcodes used in message passing between client and server
+enum TWsfServRqst
+    {
+    ESenServInitialize,
+    ESenServTransaction,
+    ESenServInstallFramework,
+    ESenServAssociateService,
+    ESenServDissociateService,
+    ESenServRegisterIdentityProvider,
+    ESenServUnregisterIdentityProvider,
+    ESenServRegisterServiceDescription,
+    ESenServUnregisterServiceDescription,
+    ESenServGetServiceDescriptionsByPattern,
+    ESenServGetServiceDescriptionsByUri,
+    ESenServIsReady,
+    ESenServHasFacet,
+    ESenServServerMessagesOnOff,
+    ESenServGetLengthOfServiceDescriptionByUri,
+    ESenServGetLengthOfServiceDescriptionByPattern,
+    ESenServRequestServiceDescription,
+    ESenServReceiveServiceDescription,
+    ESenServSendMsgAndGetTxnId,
+    ESenServSendSoapMsgAndGetTxnId,
+    ESenServStartTransaction,
+    ESenServTransactionCompleted,
+    ESenServCancelSession,
+    ESenServSetTransportProperties,
+    ESenServTransportProperties,
+    ESenServEstablishHostletConnection,
+    ESenServAwaitHostletRequest,
+    ESenServProvideHostletResponse,
+    ESenServMoveFile,
+    ESenServSendFileHandle,
+    ESenServMoveChunk,
+    ESenServGetGredentials,
+    ESenServAddCredential,
+    ESenServRemoveCredential,
+    ESenServCancelRequest,
+    ESenServConnectionID,
+    ESenServConnectionIdentityProvider,
+    ESenObserveTransfer,
+    ESenObserveAuthCallback,
+    ESenTransferProgress,
+    ESenServSearchIdentityProvider,
+    ESenTrafficDetails,
+    ESenObserveCoBranding,
+    ESenServGetIdentityProviders
+#ifdef __ENABLE_ALR__
+    ,ESenServRegisterMobiltyObserver,
+    ESenServMigrateToPreffredCarrier,
+    ESenServNewCarrierAccepted
+#endif
+    };
+
+enum TSenClServRqst
+    {
+    ESenCliServInitialize,
+    ESenCliServAuthInitialize,
+    ESenCliServTransferProgress,
+    ESenCliServReAuthNeeded,
+    ESenCliServCoBrandingInitialize,
+    ESenCliServGoNoGo
+#ifdef __ENABLE_ALR__
+    ,ESenCliServMobilityInitialize,
+    ESenCliServPrefferedCarrierAvailable,
+    ESenCliServNewCarrierActive,
+    ESenCliServMobilityError    
+#endif
+    };
+
+struct TTransferProgress
+    {
+    TInt    iTxnId;
+    TBool   iIncoming;
+    TInt    iProgress;
+    TBool   iSoap;
+    };
+
+
+NONSHARABLE_CLASS( TFileOutgoingTransferProgressBase )
+    {
+    public: // Data:
+        TInt    iTxnId;
+        TBool   iIsIncoming;
+        TInt    iProgress;
+        TInt    iCid;
+        TInt    iCid2;
+        TBool   iHasCidPostfix;
+    };
+
+// Operation codes used by server to indicate
+// which asynchronous service has completed
+enum TWsfServRqstOpCode
+    {
+    ESenServInitialized             = 1,
+    ESenServRequestResponsed        = 2,
+    ESenServRequestCancelled        = 4,
+    ESenReAuthAndResendNeeded       = 5,
+    ESenResendNeeded                = 6, 
+    ESenHostletRequestPending       = 7,
+    ESenOnServiceComplete           = 8,
+    ESenReAuthNeeded                = 9,
+    ESenInternalError               = 5005
+    };
+
+#endif //SEN_SERVICE_MANAGER_DEFS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/inc/senxmldao.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,359 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_XML_DAO_H
+#define SEN_XML_DAO_H
+
+//  INCLUDES
+#include <flogger.h>
+#include <e32std.h>
+
+#include <SenXmlReader.h>
+#include <SenBaseFragment.h>
+#include "senwsdescription.h"
+#include <MSenServiceDescription.h>
+#include "senpointermap.h"
+
+#include "msendao.h"
+
+// CONSTANTS
+const TInt KStateParsingFramework = 4;          // even ones ignore(0), odd ones save(1)
+const TInt KStateParsingServiceDescription = 6;
+const TInt KStateParsingTransport = 8;
+
+// DATA TYPES
+enum TFileOperationState
+    {
+    ESenIdle = 0,
+    ESenReading,
+    ESenSaveNeeded,
+    ESenSaving
+    };
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class RReadStream;
+class RSenServiceManager;
+class MSenCoreServiceManager;
+class CSIF;
+class CSenSecurityMechanism;
+class CSenProvider;
+class CSenHostletLookupInfo;
+
+// TYPEDEF
+typedef RSenPointerMap<TDesC8, HBufC8> RTransportMap;
+typedef RPointerArray<CSenProvider> RProviderArray;
+typedef RSenPointerMap<CSenHostletLookupInfo, CSenProvider> RProviderMap;
+
+// CLASS DECLARATION
+class CSenXMLDAO :  public CSenBaseFragment,
+                    public MSenDAO
+    {
+    public: // Constructors and destructor
+        static CSenXMLDAO* NewL(MSenCoreServiceManager& aManager);
+        static CSenXMLDAO* NewLC(MSenCoreServiceManager& aManager);
+    
+        virtual ~CSenXMLDAO();
+
+        // New functions
+        
+        virtual MSIF* Framework(const TDesC8& aFramework);
+        virtual TInt Add(CSenWSDescription& aDescription);
+        virtual TInt Add(CSIF& aFramework);
+        virtual TBool Remove(CSenWSDescription& aDescription);
+        virtual void Remove(CSIF& aFramework);
+
+        /**
+        * The ownership of the returned ServiceDescription is NOT transferred  
+        */
+        virtual CSenWSDescription* FindMatchingServiceDescriptionL( CSenWSDescription& aSd ); // codescannerwarnings
+
+        virtual CSenWSDescription* FindMatchingSDAndBestScoreL(
+                                            CSenWSDescription& aSd,
+                                            TInt &aBestScore);	//CodeScannerWarnings
+
+        virtual CSenWSDescription* FindScoreMatchingServiceDescriptionL(
+                                            CSenWSDescription& aSd,
+                                            TInt aBestScore);	//CodeScannerWarnings
+
+        virtual CSenWSDescription* FindExactServiceDescriptionL( CSenWSDescription& aSd );	//CodeScannerWarnings
+
+        virtual TInt AddServiceDescriptionToFrameworksL( CSenWSDescription& aPattern,
+                                                         MSenRemoteServiceConsumer& aRemoteConsumer,
+                                                         
+                                                         HBufC8*& aErrorMsg );
+
+        virtual TInt NotifyFrameworksL(const TDesC8& aFrameworkID,
+                                       const TInt aEvent,
+                                       TAny* aArgument);
+
+        virtual TInt FindAllMatchingServiceDescriptions(RWSDescriptionArray& aMatches,
+                                                        const TDesC8& aContract);
+
+        virtual TInt FindAllMatchingServiceDescriptions(RWSDescriptionArray& aMatches,
+                                                        MSenServiceDescription& aPattern);
+
+        virtual TInt ContainsServiceDescriptionL(TBool& aContains,
+                                                 CSenWSDescription& aPattern);
+
+        virtual TInt SaveL(const CSenServiceSession& aServiceSession);
+        virtual TInt SaveL(const CSIF& aServiceInvocationFramework);
+        virtual CSenXmlReader* XMLReader();
+        void Load();
+        TInt ProxyPort();
+        const TDesC8& ProxyHost();
+        CDesC8Array& SupportedFrameworksL();
+
+        MSIF* CSenXMLDAO::DefaultFrameworkL(const TDesC8& aFrameworkID, 
+                                            const TDesC8& aCue);
+
+        TBool Owns(CSenWSDescription* aSD);
+
+        TPtrC8 TransportPluginCueBySchemeL(const TPtrC8& aScheme);
+
+        virtual MSenProvider& LookupHostletForL(const TDesC8& aHostletEndpoint,
+                                                 const TDesC& aReqThreadId,
+                                                 const TDesC8& aReqConsumerId);
+
+        virtual TInt ReleaseHostletL(const MSenProvider* aHostlet,
+                                      const TDesC& aReqThreadId,
+                                      const TDesC8& aReqConsumerId);
+
+
+		/** Improved heuristics from Session DB removal / cleanups 
+		*
+		* It finds all matching ServiceDescription elements using the service description 
+		* passed argument and add the touch attribute to all matched ServiceDescription
+		* elements with current tick count value.
+		* If touch attribute already there it will be replaced with new current 
+		* tick count value.
+		*
+		* @param asd   is the new established session service description.
+		* Leave codes: Symbian system-wide error codes.  
+		*/
+		void UpdateTouchSessionDBL(MSenServiceDescription& asd);
+    protected:
+    
+        // New functions
+        
+        void StartElementL(const TDesC8& aURI,
+                           const TDesC8& aLocalName,
+                           const TDesC8& aName,
+                           const RAttributeArray& aAttributes);
+
+        void EndElementL(const TDesC8& aURI,
+                         const TDesC8& aLocalName,
+                         const TDesC8& aName);
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenXMLDAO(MSenCoreServiceManager& aManager);
+    
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+        TInt Save();
+        void WriteL();
+        void ReadL();
+        RFileLogger* Log() const;
+
+        TInt SizeOfSessionsXmlInBytesL();
+        TInt SizeOfFrameworksXmlInBytesL();
+
+        TInt CheckDefaultFrameworks();
+        TInt CheckDefaultTransports();
+        /** Improved heuristics from Session DB removal / cleanups
+	    *
+	    * Checks touch attribute value for all ServiceDescription elements.
+	    * If that exceeds the tick counts value for two weeks (Max tick count)
+	    *  or If it is greater than current tick count, it removes the corresponding 
+	    * ServiceDescription element from the SenConfiguration element child list.  
+	    * 
+	    * 1 millisec = 1 tick
+		* 86400 sec = 1 day
+		* 86400*1000 millisec = 1 day
+		* 86400*14*1000 = 1209600000 millisec = 2 weeks
+		* So if attr val >= 1209600000 or > current tick count.
+		* Note: always attr val should be <= current tick count.
+		*
+	    * eg;
+	    * Before call to CleanupUnusedSessionDBL()
+	    * <SenConfiguration xmlns="urn:com.nokia.Sen.config.1.0">
+	    * ........
+	    * ........
+  		* <ServiceDescription framework="ID-WSF" touch="2000000000">
+  		* ........
+  		*.........
+  		* </ServiceDescription>
+		* <ServiceDescription framework="ID-WSF" touch="20000">
+		* ..........
+		* .......
+  		* </ServiceDescription>
+  		* <ServiceDescription framework="ID-WSF">
+		* ..........
+		* .......
+  		* </ServiceDescription>
+  		* </SenConfiguration>
+		* 
+		* After call to CleanupUnusedSessionDBL()
+	    * <SenConfiguration xmlns="urn:com.nokia.Sen.config.1.0">
+	    * ........
+	    * ........
+  		* <ServiceDescription framework="ID-WSF" touch="20000">
+		* ..........
+		* .......
+  		* </ServiceDescription>
+  		* <ServiceDescription framework="ID-WSF">
+		* ..........
+		* .......
+  		* </ServiceDescription>
+  		* </SenConfiguration>
+  		* 
+		* Leave codes: Symbian system-wide error codes.
+	    */
+        void CleanupUnusedSessionDBL();
+
+    private: // Data
+        MSenCoreServiceManager& iManager;
+        TFileOperationState iReadingConfig;
+        TInt iErrorState;
+        TFileName iFileName;
+        RPointerArray<CSenWSDescription> iSessions;
+        RPointerArray<CSIF> iFrameworks;
+        CSenWSDescription* iServiceDescription;
+        CSenBaseFragment* iFrameworkConfigParser;
+        TBool iDefaultFrameworkCheckedToExist;
+        HBufC8* iProxyHost;     // owned
+        TInt    iProxyPort;
+        RTransportMap iTransportMap;
+        TBool iDefaultTransportMapChecked;
+        RProviderArray iSharableProviders;
+        RProviderMap iUnsharableProviders;
+        CSenDomFragment* ipTransportDelegate;
+    };
+
+
+/** 
+* THostletRequester class is used to identify the identity
+* requesting service (looking up) certain hostlet (a local
+* service provider provider).
+* Class instance constructs from full thread name (unique id #1)
+* and unique consumer id; typically some UNR (unique id # 2).
+* Equals operator is overloaded providing quick matching 
+* mechanism for hostlet-requester -type searches performed within
+* a pointer map.
+*/
+class CSenHostletLookupInfo : public CBase
+    {
+    public:
+        /** 
+        * @param aThreadIdAsFullName is unique identifier for some
+        *        thread, which is requesting service from certain
+        *        hostlet (local service provider).
+        * @param aConsumerIdUrn is unique identifier for some
+        *        service consumer, which is requesting certain
+        *        hostlet (local service provider).
+        */
+        static CSenHostletLookupInfo* NewL(const TDesC& aThreadIdFullName,
+                                          const TDesC8& aConsumerIdUrn);
+        /** 
+        * @param aThreadIdAsFullName is unique identifier for some
+        *        thread, which is requesting service from certain
+        *        hostlet (local service provider).
+        * @param aConsumerIdUrn is unique identifier for some
+        *        service consumer, which is requesting certain
+        *        hostlet (local service provider).
+        */
+        static CSenHostletLookupInfo* NewLC(const TDesC& aThreadIdFullName,
+                                           const TDesC8& aConsumerIdUrn);
+
+
+        /** 
+        * C++ destructor
+        */
+        ~CSenHostletLookupInfo();
+
+        /** 
+        * Getter for thread id (full thread name) of the first requester/invoker
+        */
+        TPtrC ThreadId() const;
+
+        /** 
+        * Getter for consumer id (typically some URN) of the first requester/invoker
+        */
+        TPtrC8 ConsumerId() const;
+
+        /** 
+        * Getter for current lookup count (active requesters)
+        */
+        TInt LookupCount() const;
+
+        /** 
+        * Increase method for lookup count (called once per lookup)
+        */
+        void IncrementLookupCount();
+
+        /** 
+        * Decrease method for lookup count (called once per release)
+        */
+        void DecrementLookupCount();
+        
+        /** 
+        * Implement equals operation, so that pointer map can be used.
+        */
+        TBool operator==(const CSenHostletLookupInfo& aHostletRequestor);
+
+    private:
+
+        /** 
+        * C++ constructor
+        */
+        CSenHostletLookupInfo();
+        
+        /** 
+        * @param aThreadIdAsFullName is unique identifier for some
+        *        thread, which is requesting service from certain
+        *        hostlet (local service provider).
+        * @param aConsumerIdUrn is unique identifier for some
+        *        service consumer, which is requesting certain
+        *        hostlet (local service provider).
+        */
+        void ConstructL(const TDesC& aThreadIdFullName,
+                        const TDesC8& aConsumerIdUrn);
+
+    private:
+        HBufC* ipFullThreadName;     // owned
+        HBufC8* ipUniqueConsumerId;  // owned
+        TInt* ipLookupCount;           // count of currently active requesters
+    };
+
+#endif // SEN_XML_DAO_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/rom/wscore.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSCORE_IBY__
+#define __WSCORE_IBY__
+
+// Core Service Manager Server 
+file=ABI_DIR\BUILD_DIR\Sen.EXE              	PROGRAMS_DIR\Sen.EXE
+data=ZSYSTEM\install\S60SOA.SIS    System\Install\S60SOA.SIS
+// exporting the backup regsitration file
+data=DATAZ_\private\101F96F4\backup_registration.xml \private\101F96F4\backup_registration.xml
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/sis/S60SOA.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+;
+; Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:         
+;
+&EN
+; Header
+#{"S60SOA"}, (0x101F96F4), 1,0,0, TYPE=SA
+
+;Supports Series 60 v 5.0
+;[0x101F7961], 0, 0, 0, {"Series60ProductID"} 
+
+; Localized Vendor name
+%{"Nokia"}
+
+; Unique Vendor Name
+:"Nokia"
+; The WSF server - do not rename(!)
+
+; The WSF server - do not rename(!)
+"" -"z:\sys\bin\sen.exe"
+
+"" -"z:\sys\bin\sennotdlg.dll"
+
+"" -"z:\sys\bin\senframework.dll"
+"" -"z:\sys\bin\senservconn.dll"
+"" -"z:\sys\bin\sencredentialmanager.dll"
+"" -"z:\sys\bin\senfragment.dll"
+"" -"z:\sys\bin\senhostconn.dll"
+"" -"z:\sys\bin\senhostlettransportplugin.dll"
+""-"z:\Resource\Plugins\senHostletTransportPlugin.RSC"
+"" -"z:\sys\bin\senhttpchanneltransport.dll"
+""-"z:\Resource\Plugins\senHttpChannelTransport.RSC"
+"" -"z:\sys\bin\senlocaltransportplugin.dll"
+""-"z:\Resource\Plugins\senLocalTransportPlugin.RSC"
+"" -"z:\sys\bin\senlogger.dll"
+"" -"z:\sys\bin\senmessages.dll"
+"" -"z:\sys\bin\senprovider.dll"
+"" -"z:\sys\bin\senrestplugin.dll"
+""-"z:\Resource\Plugins\senrestplugin.RSC"
+"" -"z:\sys\bin\senservmgr.dll"
+"" -"z:\sys\bin\senwsibasicplugin.dll"
+""-"z:\Resource\Plugins\senWsiBasicPlugin.RSC"
+"" -"z:\sys\bin\wsconnagent.dll"    
+""-"z:\sys\bin\senidentitymanager.dll"
+
+"" -"z:\sys\bin\wspolicy.dll"
+"" -"z:\sys\bin\wsstarmessagehandlers.dll"
+""-"z:\Resource\Plugins\WSStarMessageHandlers.RSC"
+"" -"z:\sys\bin\wsstarplugin.dll"
+""-"z:\Resource\Plugins\wsstarplugin.RSC"
+
+"" -"z:\sys\bin\senservdesc.dll"
+"" -"z:\sys\bin\senxml.dll"
+"" -"z:\sys\bin\senutils.dll"
+
+
+; ECOM plugins
+; IdWsfPlugin
+"" -"z:\sys\bin\senidwsfplugin.dll"
+"" -"z:\Resource\Plugins\SenIDWSFplugin.RSC"
+
+; IdWsfSecurityMechanism
+"" -"z:\sys\bin\senidwsfsecmech.dll" 
+"" -"z:\Resource\Plugins\SenIdWsfSecMech.RSC"
+
+; PasswordTransforms
+"" -"z:\sys\bin\senpasswordtransforms.dll"
+"" -"z:\Resource\Plugins\SenPasswordTransforms.RSC"
+
+; Notifier plugin
+"" -"z:\sys\bin\sennotifierplugin.dll"
+"" -"z:\Resource\Plugins\sennotifierplugin.RSC"
+;\epoc32\release\armv5\urel\sennotifierplugin_REG.RSC" -"z:\Resource\Plugins\sennotifierplugin_REG.RSC"
+"" -"z:\private\10003a4a\SenNotifierPluginDlgImpl.RSC"
+
+; NCIM dlls
+"" -"z:\sys\bin\wsovi.dll"
+"" -"z:\sys\bin\OviPlugin.dll"
+"" -"z:\sys\bin\wsaccountmanager.dll"
+
+""-"z:\Resource\Plugins\wsovi.RSC"
+""-"z:\Resource\Plugins\OviPlugin.RSC"
+""-"z:\Resource\apps\ncimoviavkonpluginrss.*"
+"" -"z:\sys\bin\oviuicontrols.dll"
+"" -"z:\sys\bin\wsatompub.dll"
+""-"z:\private\101F96F4\backup_registration.xml"  
+
+; VTCP dlls
+"" -"z:\sys\bin\vtcpclient.dll"
+"" -"z:\sys\bin\vtcpserver.exe"
+"" -"z:\sys\bin\vtcpnetworkmonitor.dll"
+"" -"z:\sys\bin\vtcpcmpfilter.dll"
+"" -"z:\sys\bin\senvtcptransport.dll"
+
+""-"z:\Resource\Plugins\vtcpnetworkmonitor.rsc"
+""-"z:\Resource\Plugins\vtcpcmpfilter.rsc"
+""-"z:\Resource\Plugins\senvtcptransport.rsc"
\ No newline at end of file
Binary file webservices/wscore/sis/S60SOA.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/src/senclientsession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,6289 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <s32mem.h>                         // RChunk
+#include <e32property.h>                    // RProperty
+
+#include <SenServiceConnection.h>           // error codes and framework ids
+#include <SenHostletConnection.h>           // error code(s)
+#include "senwsdescription.h"
+#include "senwspattern.h"
+#include <SenIdentityProvider.h>
+#include <SenXmlUtils.h>
+#include <SenXmlProperties.h>
+
+#include <xmlengnodelist.h> 
+#include <defaultcaps.hrh>
+
+#include "senclientsession.h"
+#include "senservicemanagerdefines.h"       // IPC enumerations
+#include "msencoreservicemanager.h"
+
+#include "sendebug.h"                       // internal Utils\inc
+#include "sennotplugindlg.h"                // internal NotifierPlugin\inc
+#include "senidentifier.h"
+
+#include "senserviceinvocationframework.h"  // internal Framework\inc
+#include "msenremoteservicesession.h"       // internal Framework\inc
+#include "sentransport.h"                   // internal Framework\inc
+#include "sentransportcontext.h"            // internal Framework\inc
+//#include "SenServiceSession.h"              // internal Framework\inc
+#include "senwebservicesession.h"                // internal Framework\inc
+#include "senlayeredtransportproperties.h"  // internal Framework\inc
+#include "senmessagecontext.h"              // internal Framework\inc
+
+#include "SenSoapEnvelope2.h"
+#include "sensoapmessagedom2.h"
+#include "xmlengchunkcontainer.h"
+#include "xmlengfilecontainer.h"
+#include "xmlengdeserializer.h"
+#include "SenParser.h"
+#include "seninternalcredential.h"
+#include "senservercontext.h"
+#include "senapplicationcontext.h"
+#include "senclientcontext.h"
+#include "senxmldebug.h"
+#include "senlogger.h"
+#include "SenServiceConnection.h"  
+#include <SenTransportProperties.h>
+
+#ifdef __TEST_RETRY_TTL
+#include <SenVtcpTransportProperties.h>//internal for lonlived test
+#endif //__TEST_RETRY_TTL
+namespace
+    {
+    const TInt KFlatBufSize = 128;
+	const TInt KMaxAuthenticationRetries = 3;
+    _LIT8(KTab, "\t");
+    _LIT8(KNewline, "\n");
+    _LIT8(KProviderPolicyLocalName,     "ProviderPolicy");
+    _LIT8(KServicePolicyLocalName,      "ServicePolicy");
+    _LIT8(KProviderIdLocalName,         "ProviderID");
+    
+    // _LIT8( KSenCidPostfix, "@example.org" );
+    #ifdef RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS
+    _LIT8( KSenCidPostfix, "@" );
+    const TInt KSenMaxCidLength = 10;
+    #endif //RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS
+    
+    }
+
+
+CSenMessageResourceHandler::CSenMessageResourceHandler(TInt aTxnId,
+        TBool aIncoming, TBool aIsSoap, TInt aProgress,
+        RSenConnectionServerSession* aOwner): CActive(EPriorityStandard),
+        iOwner(aOwner)
+    {
+    TTransferProgress& data = iProgressData();
+    data.iTxnId = aTxnId;
+    data.iIncoming = aIncoming;
+    data.iSoap = aIsSoap;
+    data.iProgress = aProgress;
+    }
+
+CSenMessageResourceHandler::~CSenMessageResourceHandler()
+    {
+    Cancel();
+    delete iSoapOrCid;
+    }
+
+void CSenMessageResourceHandler::DoCancel()
+    {
+    
+    }
+
+void CSenMessageResourceHandler::RunL()
+    {
+    iOwner->Remove(this);
+    delete this;
+    }
+
+TInt CSenMessageResourceHandler::SetBuffer(const TDesC8& aSoapOrCid)
+    {
+    iSoapOrCid = aSoapOrCid.Alloc();
+    if (iSoapOrCid)
+        {
+        return KErrNone;
+        }
+    return KErrNoMemory;
+    }
+
+TInt RSenConnectionServerSession::CreateSession(const RMessage2& aMessage)
+    {
+    TFullName name;
+    TInt err = aMessage.Read(0, name);
+    if (err != KErrNone)
+        {
+        return err;
+        }
+    err = RSessionBase::CreateSession(name, TVersion(), KAsyncMessageSlots);
+    return err;
+    }
+
+void RSenConnectionServerSession::SendFileProgress(TInt aTxnId, TBool aIncoming,
+        TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress)
+    {
+    CSenMessageResourceHandler* resHandler = new CSenMessageResourceHandler(
+            aTxnId, aIncoming, aIsSoap, aProgress, this);
+    if (!resHandler)
+        {
+        return;
+        }
+    if (resHandler->SetBuffer(aSoapOrCid) != KErrNone)
+        {
+        delete resHandler;
+        return;
+        }
+
+    if (iFirst)
+        {
+        iFirst->iPrevious = resHandler;
+        }
+    resHandler->iNext = iFirst;
+    iFirst = resHandler;
+
+    CActiveScheduler::Add(resHandler);
+    resHandler->SetActive();
+    resHandler->iStatus = KRequestPending;
+
+    TIpcArgs args(&resHandler->iProgressData, resHandler->iSoapOrCid);
+    SendReceive(ESenCliServTransferProgress, args, resHandler->iStatus);
+    }
+TBool RSenConnectionServerSession::OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId)
+    {
+    
+    HBufC8* cbXmlSnippet = aBrandIdListAsXmlSnippet.Alloc();
+    CleanupStack::PushL(cbXmlSnippet);    
+	TInt retVal(KErrNone);
+	TIpcArgs args;
+	TRequestStatus  status = KRequestPending; 	
+	TBool goNogo = EFalse;
+	args.Set(0, &goNogo);
+	args.Set(1, cbXmlSnippet);
+	args.Set(2, &aSelectedBrandId);
+	SendReceive(ESenCliServGoNoGo, args, status);
+   	User::WaitForRequest(status);
+   	retVal = status.Int();
+    CleanupStack::PopAndDestroy(cbXmlSnippet);    
+   
+    if(retVal == KErrNone)
+	    return goNogo;        
+	else
+	    return EFalse;
+	    
+    }
+void RSenConnectionServerSession::Remove(
+        CSenMessageResourceHandler* aResourceHandler)
+    {
+    if (aResourceHandler == iFirst)
+        {
+        iFirst = aResourceHandler->iNext;
+        if (iFirst)
+            {
+            iFirst->iPrevious = NULL;
+            }
+        }
+    else
+        {
+        aResourceHandler->iPrevious->iNext = aResourceHandler->iNext;
+        }
+    }
+
+
+void RSenConnectionServerSession::Close()
+    {
+    CSenMessageResourceHandler* resHandler = iFirst;
+    while (resHandler)
+        {
+        resHandler->Cancel();
+        CSenMessageResourceHandler* tmp = resHandler;
+        resHandler = resHandler->iNext;
+        delete tmp;
+        }
+    RSessionBase::Close();
+    }
+
+TInt RSenConnectionServerSession::InitProgressObserver(const RMessage2& aMessage)
+	{
+	TIpcArgs args(aMessage.Ptr1(), aMessage.Ptr2());
+    TInt err = Send(ESenCliServInitialize, args);
+    return err;
+	}
+#ifdef __ENABLE_ALR__
+TInt RSenConnectionServerSession::InitMobilityObserver(const RMessage2& aMessage)
+	{
+	TIpcArgs args(aMessage.Ptr1(), aMessage.Ptr2());
+    TInt err = Send(ESenCliServMobilityInitialize, args);
+    return err;
+	}
+
+TInt RSenConnectionServerSession::PreferredCarrierAvailable( TAccessPointInfo& aOldAPInfo,
+                                        TAccessPointInfo& aNewAPInfo, TBool& aIsUpgrade, TBool& aIsSeemLess)
+	{
+        // Note : Using TPtr8 since aIsSeamless is binary information
+	 TPtr8 upGradeDescriptor(reinterpret_cast<TUint8*>(&aIsUpgrade),sizeof(aIsUpgrade),
+        sizeof(aIsUpgrade));
+	 TPtr8 seemLessdescriptor(reinterpret_cast<TUint8*>(&aIsSeemLess),sizeof(aIsSeemLess),
+        sizeof(aIsSeemLess));
+        
+    TInt retVal(KErrNone);
+    TIpcArgs args(aOldAPInfo.AccessPoint(), aNewAPInfo.AccessPoint(), &upGradeDescriptor, &seemLessdescriptor);    
+	CSenConnAgentSync* caSync = new CSenConnAgentSync();
+	if(caSync)
+		{
+		caSync->Start();
+		SendReceive(ESenCliServPrefferedCarrierAvailable, args, caSync->iStatus);
+        retVal = caSync->iStatus.Int();
+		delete caSync;
+		}
+	return retVal;        
+	
+	}
+
+TInt RSenConnectionServerSession::NewCarrierActive( TAccessPointInfo& aNewAPInfo, TBool& aIsSeamless )
+    {
+    // Note : Using TPtr8 since aIsSeamless is binary information
+    TPtr8 descriptor(reinterpret_cast<TUint8*>(&aIsSeamless),sizeof(aIsSeamless),
+    sizeof(aIsSeamless));
+    TInt retVal(KErrNone);
+    TIpcArgs args(aNewAPInfo.AccessPoint(), &descriptor);    
+    CSenConnAgentSync* caSync = new CSenConnAgentSync();
+    if(caSync)
+        {
+        caSync->Start();		
+        SendReceive(ESenCliServNewCarrierActive, args, caSync->iStatus);
+        retVal = caSync->iStatus.Int();
+        delete caSync;
+        }
+    return retVal;
+    }
+
+TInt RSenConnectionServerSession::MobilityError( TInt& aError )
+    {
+    TInt retVal(KErrNone);
+    TIpcArgs args(aError);
+    CSenConnAgentSync* caSync = new CSenConnAgentSync();
+    if(caSync)
+        {
+        caSync->Start();		
+        SendReceive(ESenCliServMobilityError, args, caSync->iStatus);
+        retVal = caSync->iStatus.Int();
+        delete caSync;
+        }
+    return retVal;        
+    }
+#endif //__ENABLE_ALR__
+
+
+TInt RSenConnectionServerSession::InitAuthObserver(const RMessage2& aMessage)
+	{
+	TIpcArgs args(aMessage.Ptr1(), aMessage.Ptr2());
+    TInt err = Send(ESenCliServAuthInitialize, args);
+    return err;
+	}
+TInt RSenConnectionServerSession::InitCoBrandingObserver(const RMessage2& aMessage)
+	{
+	TIpcArgs args(aMessage.Ptr1(), aMessage.Ptr2());
+    TInt err = Send(ESenCliServCoBrandingInitialize, args);
+    return err;
+	}
+TInt RSenConnectionServerSession::ReauthenticationNeeded(CSenChunk& aSenChunk)
+	{
+	TInt retVal(KErrNoMemory);
+	TIpcArgs args;
+	CActiveSchedulerWait asWait;
+	aSenChunk.ChunkToArgs(args, 0);
+	args.Set(1, &asWait);
+	CSenConnAgentSync* caSync = new CSenConnAgentSync();
+	if(caSync)
+		{
+		SendReceive(ESenCliServReAuthNeeded, args, caSync->iStatus);
+		caSync->Start();
+		Mem::FillZ(&asWait, sizeof(asWait));
+		asWait.Start();
+		retVal = caSync->iStatus.Int();
+		delete caSync;
+		}
+	return retVal;
+	}
+
+CSenConnAgentSync::CSenConnAgentSync(): CActive(EPriorityStandard)
+	{
+	CActiveScheduler::Add(this);
+	iStatus = KRequestPending;
+	}
+
+CSenConnAgentSync::~CSenConnAgentSync()
+	{
+	if(IsActive())
+		{
+		Cancel();
+		}
+	}
+
+void CSenConnAgentSync::DoCancel()
+	{	
+	}
+
+void CSenConnAgentSync::RunL()
+	{
+	}
+
+void CSenConnAgentSync::Start()
+	{
+	SetActive();
+	}
+
+CSenClientSession* CSenClientSession::NewL(MSenServiceManager& aServer, CSenServerContext& aCtx)
+    {
+    CSenClientSession* self = CSenClientSession::NewLC(aServer, aCtx);
+    CleanupStack::Pop(self) ;
+    return self ;
+    }
+
+CSenClientSession* CSenClientSession::NewLC(MSenServiceManager& aServer, CSenServerContext& aCtx)
+    {
+    CSenClientSession* self = new (ELeave) CSenClientSession(aServer, aCtx);
+    CleanupStack::PushL(self) ;
+    self->ConstructL() ;
+    return self;
+    }
+
+
+CSenClientSession::CSenClientSession(MSenServiceManager& aServer, CSenServerContext& aCtx)
+    : CSession2(),
+    iManager(aServer),
+    iStatus(0),
+    iConsumerID(NULL),
+    iSendBuf(NULL),
+    iInitializer(NULL),
+    iAllowWSDataReg(ENotChecked),
+    iAllowWSDataUnReg(ENotChecked),
+    ipTransport(NULL),
+    ipIdentifier(NULL),
+    ipHostletAwaitOp(NULL),
+    iHostletRequests( ETrue, EFalse ),
+    iAllowShowDialogCount(0),
+    iConnectionID(KErrNotFound),
+    iAuthenticationRetries(0),
+    iServerContext( aCtx ),
+    iConnectionHasCoBrandingCallback(EFalse),
+    iReauthResendNeeded(EFalse)
+#ifdef __ENABLE_ALR__
+    ,iMobiltyObserver(NULL),
+    iALRObserver(NULL),
+    iMobilityCallBackForwarded(EFalse),
+    iMobilityChoice(EFalse)
+#endif
+    {
+    }
+
+void CSenClientSession::ConstructL()
+    {
+    iConnectionID = iManager.NextConnectionID();
+    #ifdef _SENDEBUG
+    
+    
+    TFileName logFile;
+    logFile.Append( KSenCoreServiceManagerLogFile().Left(KSenCoreServiceManagerLogFile().Length()-4) ); // exclude ".log" file extension
+    logFile.AppendNum( iConnectionID );
+    logFile.Append( KSenUnderline );
+    
+    logFile.Append( KSenCoreServiceManagerLogFile().Right(4) ); // postfix with ".log" file extension
+    TLSLOG_OPEN_TO_MODE(KSenClientSessionLogChannelBase+iConnectionID, KSenClientSessionLogLevel, KSenCoreServiceManagerLogDir, logFile, EFileLoggingModeAppend);
+#endif
+    
+    CSLOG_L(iConnectionID, KMinLogLevel ,"CSenClientSession::ConstructL");
+    // Generate unique id for this consumer
+    iConsumerID = iManager.RandomGuidL();
+    ipIdentifier = CSenIdentifier::NewL(SenIdentifier::ESession, *iConsumerID);
+    __ASSERT_ALWAYS(iConsumerID!=NULL, User::Leave(KErrConsumerIdIsNull));
+    CSLOG(iConnectionID, KNormalLogLevel ,(iConsumerID->Des()));
+    iInitializer = CSenWSDescription::NewL();
+    iManager.IncrementConnections();
+    }
+
+CSenClientSession::~CSenClientSession()
+    {
+    CSLOG_L(iConnectionID, KMinLogLevel ,"CSenClientSession::~CSenClientSession - START");
+#ifdef __ENABLE_ALR__    
+    iMobiltyObserver = NULL ;
+#endif
+    switch( iSessionType )
+        {
+        case ERemoteConsumer_SC:
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel ,"- session type: ERemoteConsumer_SC");
+            //TTL maangement
+            if( iServiceSession )
+                {
+                MSenTransport* pTransport = iServiceSession->Transport();
+                if ( pTransport )
+                    {
+                    TRAP_IGNORE( pTransport->UnsubscribeEventListenerL(*this); )
+                    }
+	                              
+                // Notify the framework plug-in about consumer being removed
+                if( iFwNotified )
+                    {
+                    TRAP_IGNORE( iManager.NotifyFrameworksL(
+                            iServiceSession->FrameworkId(),
+                            KSenEventConsumerRemoved,
+                            this); )        
+                    }
+                }
+            }
+        break;
+        case ERemoteHostlet_HC:
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel ,"- session type: ERemoteHostlet_HC");
+            // Remove this hostlet from the session
+            if( iServiceSession )
+                {
+                TRAP_IGNORE( iServiceSession->SetHostletL(NULL); )
+                }
+            }
+        break;
+        case ENotInitialized:
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel ,"- session type: ENotInitialized");
+            }
+        break;
+        default:
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel ,"- unknown session type.");
+            }
+        }
+    
+    //Loop and complete orphan RMessage2s
+    CSLOG_L(iConnectionID, KMinLogLevel ,"- Loop and complete orphan RMessage2s");
+
+    CSenClientSession::CompletePendingMessages();
+
+    TInt count(iHostletRequests.Count());
+    if( count > 0)
+        {
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d hostlet request(s) waiting. Completing due this host is freed."), count));
+        for ( TInt hr=(count-1); hr>=0; hr-- )
+            {
+            CSenClientMessage* pMessage = (CSenClientMessage*)iHostletRequests.ValueAt( hr ); 
+            TInt* pKey = iHostletRequests.KeyAt( hr );
+
+            if( pMessage && pKey )
+                {
+                MSenRemoteServiceConsumer* pConsumer = pMessage->Consumer();
+                if( pConsumer )
+                    {
+                    // Notifying consumer
+                    TPtrC8 id = pConsumer->Id();
+                    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Notifying consumer (ID: '%S') that it's host is gone."), &id));
+                    
+                    TRAP_IGNORE( pConsumer->HandleErrorL(NULL, KErrSenCancelled, *pKey, NULL); ) 
+                    }
+                }
+            }
+        iHostletRequests.Reset(); // de-allocates the keys (pKey -pointers)
+        }
+
+    iPendingTransactions.ResetAndDestroy();
+    iPendingTxnIds.ResetAndDestroy();
+
+    if(ipHostletAwaitOp)
+        {
+        RMessage2& await = ipHostletAwaitOp->RMessage();
+        await.Complete(ESenServRequestCancelled);
+        }
+
+    if(iServiceSession)
+        {
+        // Notify responsible framework, so that it 
+        // can do required cleanup for the session
+        CSenClientSession::ReleaseServiceSession();
+        }
+    delete iSendBuf;
+    delete iConsumerID;
+    delete ipIdentifier;
+    delete iInitializer;
+
+    delete ipTransport;
+    delete ipHostletAwaitOp;
+    ipHostletAwaitOp = NULL;
+    iConnectionSession.Close();
+
+    /*    
+    if( iSecureId > 0 )
+        {
+        CSenApplicationContext& appCtx = iServerContext.OpenApplicationContextL( iSecureId );
+        if( iConnectionID > KErrNotFound )
+            {
+            CSenClientContext& clientCtx = appCtx.OpenClientContextL( iConnectionID );
+            
+            
+            appCtx.CloseClientContext( clientCtx );
+            iServerContext.CloseApplicationContext( appCtx );
+            }
+        }
+    */
+#ifdef __ENABLE_ALR__    
+    if (iSessionType == ERemoteConsumer_SC && iALRObserver != NULL)
+        {
+        delete iALRObserver ;
+        CSLOG_L(iConnectionID, KMinLogLevel , "-iALRObserver deleted ");
+        }       
+#endif        //__ENABLE_ALR__
+
+    iManager.DecrementConnections();
+    CSLOG_L(iConnectionID, KMinLogLevel ,"CSenClientSession::~CSenClientSession - END");
+    #ifdef _SENDEBUG
+    TLSLOG_CLOSE(KSenClientSessionLogChannelBase+iConnectionID);
+    #endif
+    }
+
+
+RTransactionArray& CSenClientSession::Transactions()
+    {
+    return iPendingTransactions;
+    }
+
+RTransactionIdArray& CSenClientSession::TxnIds()
+    {
+    return iPendingTxnIds;
+    }
+    
+RHostletRequestMap& CSenClientSession::HostletRequestMap()
+    {
+    return iHostletRequests;
+    }
+        
+// All server side session objects have a ServiceL loop which
+// will be called from CS Framework
+void CSenClientSession::ServiceL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::ServiceL")));
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- RMessage2.Handle(): %d"), aMessage.Handle()));
+
+    switch (aMessage.Function())
+        {
+        case ESenServInitialize:
+            {
+           
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServInitialize")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            InitializeL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServInitialize Completed")));
+            break;
+            }
+        case ESenServTransaction:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServTransaction")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            TransactionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServTransaction Completed")));
+            break;
+            }
+        case ESenServSendMsgAndGetTxnId:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServSendMsgAndGetTxnId")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            SendMsg(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServSendMsgAndGetTxnId Completed")));
+            break;
+            }
+        case ESenServInstallFramework:
+            {
+           
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServInstallFramework")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            InstallFrameworkL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServInstallFramework Completed")));
+            break;
+            }
+        case ESenServAssociateService:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServAssociateService")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            AssociateServiceL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServAssociateService Completed")));
+            break;
+            }
+        case ESenServDissociateService:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServDissociateService")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            DissociateServiceL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServDissociateService Completed")));
+            break;
+            }
+        case ESenServRegisterIdentityProvider:
+            {
+           
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRegisterIdentityProvider")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            RegisterIdentityProviderL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRegisterIdentityProvider Completed")));
+            break;
+            }
+        case ESenServUnregisterIdentityProvider:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServUnregisterIdentityProvider")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            UnregisterIdentityProviderL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServUnregisterIdentityProvider Completed")));
+            break;
+            }
+        case ESenServRegisterServiceDescription:
+            {
+           
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRegisterServiceDescription")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            RegisterServiceDescriptionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRegisterServiceDescription Completed")));
+            break;
+            }
+        case ESenServUnregisterServiceDescription:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServUnregisterServiceDescription")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            UnregisterServiceDescriptionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServUnregisterServiceDescription Completed")));
+            break;
+            }
+        case ESenServGetServiceDescriptionsByPattern:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetServiceDescriptionsByPattern")));
+            ServiceDescriptionsByPatternL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetServiceDescriptionsByPattern Completed")));
+            break;
+            }
+        case ESenServGetLengthOfServiceDescriptionByPattern:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetLengthOfServiceDescriptionByPattern")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            ServiceDescriptionsByPatternL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetLengthOfServiceDescriptionByPattern Completed")));
+            break;
+            }
+        case ESenServGetServiceDescriptionsByUri:
+            {
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetServiceDescriptionsByUri")));
+            ServiceDescriptionsByUriL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetServiceDescriptionsByUri Completed")));
+            break;
+            }
+        case ESenServGetLengthOfServiceDescriptionByUri:
+            {
+           
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetLengthOfServiceDescriptionByUri")));
+            delete iSendBuf;
+            iSendBuf = NULL;
+            ServiceDescriptionsByUriL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetLengthOfServiceDescriptionByUri Completed")));
+            break;
+            }
+        case ESenServIsReady:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServIsReady")));
+            
+            delete iSendBuf;
+            iSendBuf = NULL;
+            IsReadyL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServIsReady Completed")));
+            break;
+            }
+        case ESenServHasFacet:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServHasFacet")));
+            
+            delete iSendBuf;
+            iSendBuf = NULL;
+            HasFacetL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServHasFacet Completed")));
+            break;
+            }
+        case ESenServServerMessagesOnOff:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServServerMessagesOnOff")));
+            
+            delete iSendBuf;
+            iSendBuf = NULL;
+            CompleteServerMessagesOnOffL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServServerMessagesOnOff Completed")));
+            break;
+            }
+        case ESenServRequestServiceDescription:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRequestServiceDescription")));
+            
+            delete iSendBuf;
+            iSendBuf = NULL;
+            RequestServiceDescriptionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRequestServiceDescription Completed")));
+            break;
+            }
+        case ESenServReceiveServiceDescription:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServReceiveServiceDescription")));
+            
+            ReceiveServiceDescriptionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServReceiveServiceDescription Completed")));
+            break;
+            }
+        case ESenServStartTransaction:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServStartTransaction")));
+            
+            delete iSendBuf;
+            iSendBuf = NULL;
+            StartTransactionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServStartTransaction Completed")));
+            break;
+            }
+        case ESenServTransactionCompleted:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServTransactionCompleted")));
+            
+            delete iSendBuf;
+            iSendBuf = NULL;
+            TransactionCompletedL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServTransactionCompleted Completed")));
+            break;
+            }
+        case ESenServCancelSession:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServCancelSession")));
+            
+            CancelSessionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServCancelSession Completed")));
+            break;
+            }
+        case ESenServSetTransportProperties:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServSetTransportProperties")));
+            
+            SetTransportPropertiesL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServSetTransportProperties Completed")));
+            break;
+            }
+        case ESenServTransportProperties:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServTransportProperties")));
+            
+            TransportPropertiesL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServTransportProperties Completed")));
+            break;
+            }
+
+        // HOSTLET OPERATIONS
+        case ESenServEstablishHostletConnection:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServEstablishHostletConnection")));
+            
+            EstablishHostletConnectionL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServEstablishHostletConnection Completed")));
+            break;
+            }
+        case ESenServAwaitHostletRequest:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServAwaitHostletRequest")));
+            
+            AwaitHostletRequestL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServAwaitHostletRequest Completed")));
+            break;
+            }
+/*
+        case ESenServAcquireRequestHandle:
+            {
+            LOG_WRITE_L("ESenServAcquireRequestHandle");
+            //AcquireHostletRequestHandleL();
+            break;
+            }
+*/
+        case ESenServProvideHostletResponse:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServHostletResponse")));
+            
+            ProvideHostletResponseL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServHostletResponse Completed")));
+            break;
+            }
+        case ESenServMoveChunk:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServMoveChunk")));
+            
+            MoveChunkL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServMoveChunk Completed")));
+            break;
+            }
+        case ESenServMoveFile:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServMoveFile")));
+            
+            MoveFileL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServMoveFile Completed")));
+            break;
+            }
+		case ESenServSendFileHandle:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServSendFileHandle")));
+            SendFileHandleL(aMessage);
+			CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServSendFileHandle Completed")));
+            break;
+            }            
+        case ESenServGetGredentials:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetGredentials")));
+            
+            CredentialsL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServGetGredentials Completed")));
+            break;
+            }
+        case ESenServAddCredential:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServAddCredential")));
+            
+            AddCredentialL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServAddCredential Completed")));
+            break;
+            }
+        case ESenServRemoveCredential:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRemoveCredential")));
+            
+            RemoveCredentialsL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServRemoveCredential Completed")));
+            break;
+            }
+        case ESenServCancelRequest:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServCancelRequest")));
+            
+            CancelRequestL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServCancelRequest Completed")));
+            break;
+            }
+        case ESenServConnectionID:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServConnectionID")));
+            
+            ConnectionID(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServConnectionID Completed")));
+            break;
+            }
+        case ESenServConnectionIdentityProvider:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServConnectionIdentityProvider")));
+            
+            ConnectionIdentityProviderL(aMessage);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenServConnectionIdentityProvider Completed")));
+            break;
+            }
+        case ESenObserveCoBranding:
+            {
+    		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenObserveCoBranding");
+    		ObserveCoBranding(aMessage);
+    		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenObserveCoBranding Completed");
+            break;
+            }
+        case ESenObserveTransfer:
+            {
+    		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenObserveTransfer");
+    		ObserveTransfer(aMessage);
+    		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenObserveTransfer Completed");
+            break;
+            }
+        case ESenObserveAuthCallback:
+		{
+		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenObserveAuthCallback");
+		ObserveAuthCallback(aMessage);
+		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenObserveAuthCallback Completed");
+		break;
+		}
+#ifdef __ENABLE_ALR__		
+		case ESenServRegisterMobiltyObserver:
+			{
+			CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServRegisterMobiltyObserver");
+			ObserveMobiltyService(aMessage);
+			CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServRegisterMobiltyObserver Completed");
+			break;
+			}
+		case ESenServMigrateToPreffredCarrier:
+			{
+			CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServMigrateToPreffredCarrier");
+			MigrateToPrefferedCarrierL(aMessage);
+			CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServMigrateToPreffredCarrier Completed");
+			break;
+			}		
+		case ESenServNewCarrierAccepted:
+    	    {
+    		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServNewCarrierAccepted");
+    		NewCarrierAcceptedL(aMessage);
+    		CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServNewCarrierAccepted Completed");
+    	    break;
+    	    }		
+#endif    	    
+        case ESenTransferProgress:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenTransferProgress")));
+            aMessage.Complete(SendProgressToHostlet(aMessage));
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("ESenTransferProgress Completed")));
+            break;
+            }
+        case ESenServSearchIdentityProvider:
+        	{
+        	CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServReauthenticationNeeded");
+        	SearchIdentityProviderL(aMessage);
+        	CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServReauthenticationNeeded Completed");
+        	break;
+        	}
+        case ESenTrafficDetails: 	 
+            {
+        	CSLOG_L(iConnectionID,KMinLogLevel ,"ESenTrafficDetails");
+            DataTrafficDetails(aMessage); 
+            CSLOG_L(iConnectionID,KMinLogLevel ,"ESenTrafficDetails Completed");
+            break;
+            }
+        case ESenServGetIdentityProviders:
+        	{
+        	CSLOG_L(iConnectionID,KMinLogLevel ,"ESenServGetIdentityProviders");
+        	IdentityProviders(aMessage);
+        	break;
+        	}
+        default:
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("default")));
+            
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("Calling PanicClient( EBadRequest )")));
+            
+            PanicClient(aMessage, EBadRequest);
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("default Completed")));
+            break;
+            }
+        }
+    }
+
+TInt CSenClientSession::ParseSessionInitializerL( CSenWSDescription*& apInitializer,
+                                                  const TDesC8& aSdAsXml,
+                                                  const TDesC8* apConsumerPolicy )
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ParseSessionInitializerL");
+    TInt retVal(KErrNone);
+    CSenWSDescription* pSD = NULL;
+    delete apInitializer;
+    apInitializer = NULL;
+    
+    if(apConsumerPolicy && apConsumerPolicy->Length()>0)
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel, "- Service Pattern received");
+        pSD = CSenWSPattern::NewLC();
+        pSD->SetReader(*iManager.XMLReader());
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, pSD->ParseL(aSdAsXml));
+        if(leaveCode!=KErrNone)
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ParseSessionInitializerL:");
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- ParseL( SD_AS_XML ) leaved: %d"), leaveCode));
+//            retVal = leaveCode; // known issue: leave code 991 from SAX framework
+            }
+        CSLOG_L(iConnectionID, KMinLogLevel ,"CSenClientSession::ParseSessionInitializerL - Consumer policy before parsing:");
+        CSLOG_ALL(iConnectionID, KMinLogLevel ,( *apConsumerPolicy ));
+
+        // add the content into internal ConsumerPolicy member variable of SD..
+        leaveCode = KErrNone;
+        TRAP(leaveCode, pSD->ParseL(*apConsumerPolicy));
+        if(retVal == KErrNone && leaveCode!=KErrNone)
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- ParseL(policy) leaved: %d"), leaveCode));
+//            retVal = leaveCode; // known issue: leave code 991 from SAX framework
+            }
+        }
+    else
+        {
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::ParseSessionInitializerL: parsing XML (%d bytes) into service description"), aSdAsXml.Length()));
+        pSD = CSenWSDescription::NewLC();
+        pSD->SetReader(*iManager.XMLReader());
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, pSD->ParseL(aSdAsXml));
+        if(leaveCode!=KErrNone)
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::ParseSessionInitializerL - ParseL(SD) leaved: %d"), leaveCode));
+            retVal = leaveCode;
+            }
+        }
+
+#ifdef _SENDEBUG
+    HBufC8* pAsXml = pSD->AsXmlL();
+    if(pAsXml)
+        {
+        CleanupStack::PushL(pAsXml);
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ParseSessionInitializerL");
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- Service description after parsing:");
+        CSLOG_ALL(iConnectionID,KMinLogLevel ,(*pAsXml));
+        CleanupStack::PopAndDestroy(); // pAsXml
+        }
+#endif // _SENDEBUG
+
+    apInitializer = pSD;
+    CleanupStack::Pop(); // pSD
+    return retVal;
+    }
+
+void CSenClientSession::InitializeL(const RMessage2& aMessage)
+    {
+    // To cache secure id of the client
+    // This secure id will be used to notify client in case RProperty updates
+    iClientSecureID = aMessage.SecureId();
+	
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::InitializeL");
+    iSessionType = ERemoteConsumer_SC;
+
+	CSenChunk* pChunk = CSenChunk::NewLC(KNullDesC);
+	TInt retVal = pChunk->OpenChunkFromRMsgL(aMessage, 2);
+	
+	TPckgBuf<TFourInts> fourInts;
+	aMessage.ReadL( 3, fourInts );
+	
+    TInt sdLength = fourInts().iInt1;
+    iConnectionHasAuthenticationCallback = fourInts().iInt2;
+	TPtrC8 serviceDescriptionAsXml;
+    TPtrC8 consumerPolicyAsXml;
+	if ( retVal == KErrNone )
+        {
+    	retVal = pChunk->DescFromChunk(serviceDescriptionAsXml, 0);
+    	
+    	if ( retVal == KErrNone )
+    	    {
+            TInt servDescFromChunkLength = serviceDescriptionAsXml.Length();
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- XML SD from chunk length: %d bytes"), servDescFromChunkLength));
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- XML SD from IPC args length: %d bytes"), sdLength));
+            if( sdLength != servDescFromChunkLength )
+                {
+                serviceDescriptionAsXml.Set( serviceDescriptionAsXml.Left( sdLength ) );
+                // serviceDescriptionAsXml.SetLength( sdLength );
+                }
+
+    	    // Check if consumer policy was provided
+        	TInt getPolicyRetCode = pChunk->DescFromChunk(consumerPolicyAsXml, 1);
+                	
+        	if( getPolicyRetCode != KErrNone )
+        	    {
+        	    CSLOG_L(iConnectionID,KMinLogLevel ,"- Consumer policy not used.");
+                consumerPolicyAsXml.Set(KNullDesC8);
+        	    }
+            getPolicyRetCode = 0; // not used in release builds      	    
+
+    	    }
+        }
+    if ( retVal == KErrNone )
+        {
+        // At least XML SD was read correctly from the chunk
+
+        // Parse the XML string into a XML service description object
+        delete iInitializer;
+        iInitializer = NULL;
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- Service description as XML:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,( serviceDescriptionAsXml ));
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- Consumer policy as XML as XML:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,( consumerPolicyAsXml ));
+        
+        retVal = ParseSessionInitializerL(iInitializer, serviceDescriptionAsXml, &consumerPolicyAsXml);
+        // Attempt to initialize service session
+        if ( retVal == KErrNone )
+            {
+            // Sanity check
+            if( !iInitializer )
+                {
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Fatal: initializer is NULL after succeeded parsing!");
+                aMessage.Complete(ESenInternalError);
+                return;
+                }
+                
+
+            // Notify the framework plug-in about consumer being added
+            TPtrC8 frameworkID = iInitializer->FrameworkId();
+            if( frameworkID.Length() > 0 )
+                {
+                iFwNotified = ETrue;
+                TRAP_IGNORE( iManager.NotifyFrameworksL(
+                        frameworkID,
+                        KSenEventConsumerAdded,
+                        this); )                 
+                }
+
+            // Initialize the service session
+            HBufC8* pErrorMsg = NULL;
+            retVal = InitializeServiceSessionL(*iInitializer, pErrorMsg);
+            CleanupStack::PushL( pErrorMsg );
+            if( pErrorMsg )
+                {
+                TPtrC8 error = pErrorMsg->Des();
+                CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- InitializeL: retVal: (%d), error msg from InitializeServiceSessionL:"), retVal));
+                CSLOG_ALL(iConnectionID,KMinLogLevel ,( error ));
+                pChunk->DescsToChunk( error, KNullDesC8 );
+                }
+            else
+                {
+                pChunk->DescsToChunk( KNullDesC8, KNullDesC8 );
+                }
+            CleanupStack::PopAndDestroy( pErrorMsg );
+
+            // Ensure that transport plug-in will be loaded:
+            if( retVal == KErrNone ) 
+                {
+                TRAP( retVal, TransportL(); ) 
+                
+                MSenTransport* pTransport = iServiceSession->Transport();
+                if ( pTransport )
+                    {
+                    TInt ret = pTransport->SubscribeEventListenerL(*this);
+                    }
+                }
+            }
+        }
+        
+    CleanupStack::PopAndDestroy( pChunk );
+
+    // Write return value to pre-reserved client descriptor
+    TPtr8 returnValue(reinterpret_cast<TUint8*>(&retVal),
+                      sizeof(retVal), sizeof(retVal));
+
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, aMessage.WriteL(0, returnValue)); //IPC V2
+    if ( leaveCode != KErrNone )
+        {
+        aMessage.Complete(ESenInternalError);
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::InitializeL:");
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- RMessage2.WriteL(0, retVal) failed, leaveCode: %d. Completing with ESenInternalError"), leaveCode));
+        return;
+        }
+
+    HBufC* pId16 = HBufC::NewLC(Id().Length());
+    TPtr16 id16 = pId16->Des();
+    id16.Copy(Id()); // Id does not containt UCS2 chars, so direct copying is ok!
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Writing id16: %S"), &id16));
+    TRAP(leaveCode, aMessage.WriteL(1, id16)); //IPC V2
+    CleanupStack::PopAndDestroy(); // pId16
+    if( leaveCode != KErrNone )
+        {
+        aMessage.Complete(ESenInternalError);
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::InitializeL:");
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- RMessage2.WriteL(1, sessionId) failed, leaveCode: %d. Completing with ESenInternalError"), leaveCode));
+        return;
+        }
+
+    if (retVal == KErrSenFailedAuthentication && iAuthenticationRetries < KMaxAuthenticationRetries && iConnectionHasAuthenticationCallback)
+        {
+        // Authentication failed.
+        iAuthenticationRetries++;
+        
+        if ( iConnectionHasAuthenticationCallback )
+            {
+            // Ask authentication information from client
+            aMessage.Complete(ESenReAuthNeeded);
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("Completed with ESenReAuthNeeded iAuthenticationRetries = [%d]"), iAuthenticationRetries));		
+            }
+        else
+            {
+            retVal = KErrSenSoapFault;
+            }
+        }
+    else
+        {
+        // Complete. Either init was ok, or some error occurred; client now knows the result
+        iAuthenticationRetries = 0;
+        aMessage.Complete(ESenServInitialized);
+        CSLOG_L(iConnectionID,KMinLogLevel ,"Completed with ESenServInitialized");
+        }
+    }
+
+TInt CSenClientSession::InitializeServiceSessionL(CSenWSDescription& aInitializer, HBufC8*& aErrorMsg)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::InitializeServiceSessionL");
+
+    // Parsing was successful, perform the actual service connection lookup
+    iManager.SetShowPasswordDialog(ETrue);
+    TInt retVal = iManager.InitServiceConnectionL(*this, aInitializer, aErrorMsg);
+    iManager.SetShowPasswordDialog(EFalse);
+
+    // Sanity check that connection is valid & ready
+    if(retVal == KErrNone && (!iServiceSession || iStatus != KSenConnectionStatusReady))
+        {
+        CSLOG_L(iConnectionID,KMinLogLevel ,"FATAL: InitServiceConnectionL() == KErrNone but ServiceSession is NOT ready!");
+        retVal = KErrSenInternal; 
+        }
+    return retVal;
+    }
+
+
+
+void CSenClientSession::TransactionL( const RMessage2& aMessage )
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::TransactionL");
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::TransactionL - RMessage2(%d)"), aMessage.Handle()));
+
+    MSenTransport& transport = TransportL();
+//    CSenClientMessage* pMessage = CSenClientMessage::NewLC( iManager.NextTransactionId(), aMessage, this, transport );
+    CSenClientMessage* pMessage = CSenClientMessage::NewLC( aMessage, this, transport );
+    pMessage->SetLogger( Log() );
+    MSenMessageContext& context = pMessage->MessageContext();
+    context.SetChunk(pMessage, EFalse);
+    
+    TInt retVal = pMessage->OpenChunkFromRMsgL( pMessage->RMessage(),2 );
+    if(retVal==KErrNone)
+        {
+//        pMessage->ChunkHeader().SetContextId( pMessage->CtxId() );
+        
+        // Start waiting for HandleMessageL, HandleErrorL, cancel
+        // or destruction of this session...
+        retVal = Transactions().Append(pMessage);
+        if(retVal!=KErrNone)
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Transactions().Append failed (OOM)!");
+            }
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- pMessage->OpenChunkL(2) failed: %d"), retVal));
+        }
+#endif
+
+    if(retVal!=KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // pMessage
+        aMessage.Complete(ESenInternalError);
+        }
+    else
+        {
+        CleanupStack::Pop(); // pMessage
+        }
+    }
+    
+TInt CSenClientSession::CompleteTransaction(TInt aErrorCode, CSenChunk& aChunk)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CompleteTransaction");
+    TInt retVal(KErrNone);
+	iReauthResendNeeded = EFalse ;
+
+    TInt previousTxnId = aChunk.ChunkHeader().TransactionId();
+    aChunk.ChunkHeader().SetTransactionId(KErrNotFound);
+    TInt transactionIndex = TransactionIndex(KErrNotFound);
+    aChunk.ChunkHeader().SetTransactionId(previousTxnId);
+    
+    if ( transactionIndex != KErrNotFound )
+        {
+        retVal = CompleteTransactionByIndex(aErrorCode, transactionIndex);
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+    
+    return retVal;
+    }
+
+TInt CSenClientSession::CompleteTransactionByCtxId(TInt aErrorCode, TInt aCtxId)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CompleteTransactionByCtxId");
+    TInt retVal(KErrNone);
+
+    TInt transactionIndex = ContextIndex(aCtxId);
+    
+    if ( transactionIndex != KErrNotFound )
+        {
+        retVal = CompleteTransactionByIndex(aErrorCode, transactionIndex);
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+    
+    return retVal;
+    }
+
+TInt CSenClientSession::CompleteTransactionByIndex(TInt aErrorCode, TInt aTransactionIndex)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CompleteTransactionByIndex");
+
+    TInt retVal(KErrNone);
+    if ( aTransactionIndex == KErrNotFound ) 
+        {
+        return KErrNotFound;
+        }
+
+    CSenClientMessage* pClientMessage = iPendingTransactions[aTransactionIndex];
+    RMessage2& message = pClientMessage->RMessage();
+    TPtr8 ptr(reinterpret_cast<TUint8*>(&aErrorCode), sizeof(aErrorCode), sizeof(aErrorCode));
+
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, message.WriteL(0, ptr)); //IPC V2
+    if ( leaveCode != KErrNone )
+        {
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Leave code: %d"), leaveCode));
+        message.Complete(ESenInternalError); 
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - ErrorCode");
+        retVal = leaveCode;
+        }
+    else
+        {
+        TInt txnId = pClientMessage->ChunkHeader().TransactionId();
+        
+        TPtr8 ptr(reinterpret_cast<TUint8*>(&txnId), 
+                  sizeof(txnId), 
+                  sizeof(txnId)); 
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, message.WriteL(1, ptr)); //IPC V2
+        if ( leaveCode != KErrNone )
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Leave code: %d"), leaveCode));
+            message.Complete(ESenInternalError);
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - TxnId");
+            retVal = leaveCode;
+            }
+        else
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- ErrCode: %d"), aErrorCode));
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- txnId  : %d"), txnId));
+            message.Complete(ESenServRequestResponsed);
+            CSLOG_L(iConnectionID,KMinLogLevel ,"Completed with ESenServRequestResponsed");
+            }
+        }
+
+    iPendingTransactions.Remove( aTransactionIndex );
+    delete pClientMessage;
+
+    return retVal;
+    }
+    
+TInt CSenClientSession::TransactionIndex(TInt aTxnId)
+    {
+    TInt count = iPendingTransactions.Count();
+    TInt index(0);
+    for (; index < count; index++)
+        {
+        CSenClientMessage* pMsg = iPendingTransactions[index];
+        if (pMsg && pMsg->ChunkHeader().TransactionId() == aTxnId)
+            {
+            return index;    
+            }
+        }
+    return KErrNotFound;
+    }
+
+TInt CSenClientSession::ContextIndex(TInt aCtxId)
+    {
+    TInt count = iPendingTransactions.Count();
+    TInt index(0);
+    for (; index < count; index++)
+        {
+        CSenClientMessage* pContext = iPendingTransactions[index];
+        if (pContext && pContext->CtxId() == aCtxId)
+            {
+            return index;    
+            }
+        }
+    return KErrNotFound;
+    }
+
+
+const TDesC8& CSenClientSession::Id() const
+    {
+    if(iConsumerID)
+        {
+        return *iConsumerID;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+
+CSenIdentifier& CSenClientSession::Identifier() const
+    {
+    return *ipIdentifier;
+    }
+TInt CSenClientSession::ListBinaryElementsL(RArray<TXmlEngElement>& aElementArray,
+                                            TXmlEngElement& aElement)
+    {
+    CSLOG_L(iConnectionID, KMinLogLevel ,"CSenClientSession::ListBinaryElementsL");
+	_LIT8(KInclude,         "Include");
+	_LIT8(KXopIncludeUri,   "http://www.w3.org/2004/08/xop/include");
+//	_LIT8(KHref,            "href");      // not in use atm
+//	_LIT8(KHrefUriEmpty,    "");  // not in use atm
+	
+	TInt count(0);
+	RXmlEngNodeList<TXmlEngElement> list;
+	CleanupClosePushL(list);
+	aElement.GetChildElements(list);
+	TInt c = list.Count();
+
+#ifdef _SENDEBUG
+    TPtrC8 root = aElement.Name();
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Processing element: '%S', num of child elements: %d"), &root, c));
+    TPtrC8 content = aElement.Text();
+    CSLOG_L(iConnectionID, KMaxLogLevel , "----  Content START ----");
+    CSLOG_ALL(iConnectionID, KMaxLogLevel , (content));
+    CSLOG_L(iConnectionID, KMaxLogLevel , "----  Content END ----");
+#endif // _SENDEBUG
+
+	
+
+    while ( list.HasNext() )
+        {
+        TXmlEngElement element = list.Next();
+        
+        TPtrC8 tag = element.Name();
+        CSLOG_FORMAT((iConnectionID, KMaxLogLevel , _L8("- child: '%S'"), &tag));
+        if ( tag == KInclude )
+            {
+            CSLOG_L(iConnectionID, KMaxLogLevel , "- <xop:Include> element found.");
+            if ( element.NamespaceUri() == KXopIncludeUri )
+                {
+                CSLOG_L(iConnectionID, KMaxLogLevel , "- namespace == http://www.w3.org/2004/08/xop/include");
+                aElementArray.AppendL(element);
+                count = count + 1;
+                }
+            }
+        count = count + ListBinaryElementsL(aElementArray, element);
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    return count;
+    }
+TInt CSenClientSession::ParseMessageL(TInt aTransactionId,
+                                      const TDesC8& aRequest,
+                                      CSenAtomEntry& aAtomEntry)
+    {
+	CSLOG_L(iConnectionID, KMinLogLevel ,"CSenClientSession::ParseMessageL");
+    CSenParser* pParser = CSenParser::NewLC();
+    pParser->EnableFeature(EReportNamespaceMapping);
+	pParser->ParseL(aRequest, aAtomEntry);
+	
+	// handle binary containers (BLOBs / attachments)
+    //TInt retVal = TransactionIndex(aTransactionId);
+    TInt retVal = ContextIndex(aTransactionId);
+    if ( retVal != KErrNotFound )
+        {
+        RTransactionArray& transactions = Transactions();   
+        CSenClientMessage* pClientMessage = transactions[retVal];
+    	
+		RPointerArray<CSenBinaryData>& binaryDataArray = pClientMessage->BinaryDataArray();
+
+        if ( binaryDataArray.Count() > 0 )
+            {
+        	TXmlEngElement messageRootElement = aAtomEntry.AsElementL();
+        	TInt count2 = binaryDataArray.Count();
+            RSenDocument document = aAtomEntry.AsDocumentL();
+        	
+        	TXmlEngElement element;
+        	CSenBinaryData* pBinaryData;
+			for ( TInt j = 0; j < count2; j++ )
+			    {
+			    pBinaryData = binaryDataArray[j];
+            	if ( pBinaryData->Type() == CSenBinaryData::EChunk )
+        			{
+            	    TXmlEngChunkContainer binData =
+            	            document.CreateChunkContainerL(
+            	                        pBinaryData->Cid(),
+            	                        pBinaryData->Chunk(),
+            	                        pBinaryData->Offset(),
+            	                        pBinaryData->Size() );
+                    document.AsElement().AppendChildL(binData);
+        			}
+        		else if ( pBinaryData->Type() == CSenBinaryData::EFile )
+        			{
+            	    TXmlEngFileContainer binData = 
+            	            document.CreateFileContainerL(
+            	                        pBinaryData->Cid(),
+	                                    pBinaryData->File() );
+        			
+                    document.AsElement().AppendChildL(binData);
+        			}
+
+                }
+            }
+        }
+	
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }    
+TInt CSenClientSession::ParseMessageL(TInt aTransactionId,
+                                      const TDesC8& aRequest,
+                                      CSenSoapEnvelope2& aSoapEnvelope)
+    {
+    CSLOG_L(iConnectionID, KMinLogLevel , "CSenClientSession::ParseMessageL");
+    CSenParser* pParser = CSenParser::NewLC();
+    pParser->EnableFeature(EReportNamespaceMapping);
+	pParser->ParseL(aRequest, aSoapEnvelope);
+
+
+    // handle binary containers (BLOBs / attachments)
+    //TInt retVal = TransactionIndex(aTransactionId);
+    TInt retVal = ContextIndex(aTransactionId);
+    if ( retVal != KErrNotFound )
+        {
+        RTransactionArray& transactions = Transactions();   
+        CSenClientMessage* pClientMessage = transactions[retVal];
+    	
+		RPointerArray<CSenBinaryData>& binaryDataArray = pClientMessage->BinaryDataArray();
+
+        if ( binaryDataArray.Count() > 0 )
+            {
+    	
+        	_LIT8(KCidPrefix, "cid:*");
+        	TXmlEngElement messageRootElement = aSoapEnvelope.AsElementL();
+        	
+        	RArray<TXmlEngElement> elementArray;
+        	RXmlEngNodeList<TXmlEngAttr> attrArray;
+        	CleanupClosePushL(elementArray);
+            TInt binElementCount = ListBinaryElementsL(elementArray,messageRootElement);
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Count of <xop:Include elements> in DOM tree: %d"), binElementCount));
+            
+            TXmlEngAttr attr;
+            TPtrC8 cid;
+        	TInt count = elementArray.Count();
+        	TInt count2 = binaryDataArray.Count();
+            RSenDocument document = aSoapEnvelope.AsDocumentL();
+        	
+        	TXmlEngElement element;
+        	CSenBinaryData* pBinaryData;
+        	if ( count > 0 && count2 > 0 )
+        	    {
+        		for ( TInt i = 0; i < count; i++ )
+        		    {
+        			element = elementArray[i];
+        			element.GetAttributes(attrArray);
+        			while ( attrArray.HasNext() )
+        				{
+        				attr = attrArray.Next();
+        				TPtrC8 value = attr.Value();
+                    	TInt position = value.Match(KCidPrefix);
+                    	if ( position < 0 )
+                    		{
+                    		position = 0;
+                    		}
+                    	cid.Set(value.Mid( position + KCidPrefix().Size() - 1)); // minus star character (*)
+                    	if ( cid.Length() > 0 )
+                    	    {
+                    	    break;
+                    	    }
+        				}
+        		    attrArray.Close();
+        			
+        			for ( TInt j = 0; j < count2; j++ )
+        			    {
+        			    pBinaryData = binaryDataArray[j];
+        			    
+                        if ( pBinaryData->Cid() == cid )
+                            {
+                    		if ( pBinaryData->Type() == CSenBinaryData::EChunk )
+                    			{
+                        	    TXmlEngChunkContainer binData =
+                        	            document.CreateChunkContainerL(
+                        	                        pBinaryData->Cid(),
+                        	                        pBinaryData->Chunk(),
+                        	                        pBinaryData->Offset(),
+                        	                        pBinaryData->Size() );
+                                element.ReplaceWith(binData);
+                    			}
+                    		else if ( pBinaryData->Type() == CSenBinaryData::EFile )
+                    			{
+                        	    TXmlEngFileContainer binData = 
+                        	            document.CreateFileContainerL(
+                        	                        pBinaryData->Cid(),
+            	                                    pBinaryData->File() );
+                    			
+                                element.ReplaceWith(binData);
+                    			}
+
+                            break;
+                            }
+        			    }
+        		    }
+        		}        
+            CleanupStack::PopAndDestroy(&elementArray);
+            }
+        }
+    CleanupStack::PopAndDestroy(pParser);
+    
+    return retVal;
+    }
+    
+TInt CSenClientSession::SearchMsgChunk( const RMessage2& aMessage, CSenChunk*& aHit )
+    {
+    TInt ctxId = aMessage.Int1();
+    TInt ctxIndex = ContextIndex( ctxId );
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("SearchMsgChunk - using Context ID: %d"), ctxId));
+    if ( ctxIndex == KErrNotFound ) 
+        {
+        return ctxIndex;
+        }
+    aHit = iPendingTransactions[ctxIndex];
+    return KErrNone;
+    }
+    
+void CSenClientSession::SendMsg( const RMessage2& aMessage )
+    {
+    CSLOG_L(iConnectionID, KMinLogLevel , "CSenClientSession::SendMsg");
+    CSenChunk* pSenChunk = NULL;
+    TInt err = SearchMsgChunk( aMessage, pSenChunk );
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- SearchMsgChunk returned: %d"), err));
+    
+    if ( err || !pSenChunk )
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel , "CSenClientSession::SendMsg - FATAL(!): transaction not found by msg ctx ID!");
+        aMessage.Complete( KErrSenInternal );
+        }
+    else
+        {
+        TRAP( err, SendMsgL( aMessage, *pSenChunk );  )
+        
+        if ( err != KErrNone )
+            {
+            aMessage.Complete( err );
+            // Complete pending transaction, too
+            CompleteTransaction( err, *pSenChunk );
+            }
+        }
+    }
+
+void CSenClientSession::SendMsgL(const RMessage2& aMessage, CSenChunk& aSenChunk)
+    {
+   CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SendMsgL");
+    
+    TPtrC8 request;
+    TInt errorCode(KErrNone);
+    TPtrC8 transportProperties(KNullDesC8);
+
+    HBufC8* pErrorMsg = NULL;
+	TBool initReqd = EFalse ;
+	TBool sessionValidityError = SessionValidity() ;	
+   if ( !aSenChunk.ChunkHeader().DoInitBeforeSending() )
+	{
+	if (KErrNone != sessionValidityError)
+		{
+		initReqd  = ETrue ;
+		CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SendMsgL - init required ??? ");
+		}
+   	}
+    if ( aSenChunk.ChunkHeader().DoInitBeforeSending() || initReqd)
+        {
+        iManager.SetShowPasswordDialog(ETrue);
+        errorCode = iManager.InitServiceConnectionL(*this, *iInitializer, pErrorMsg);
+        CleanupStack::PushL( pErrorMsg );
+        if ( errorCode )
+            {
+			// Write error message to chunk only if there will be no more reauthentication loops
+            // otherwise resend after successful reauthentication will fail
+            if( errorCode != KErrSenFailedAuthentication || !(iAuthenticationRetries < KMaxAuthenticationRetries) )
+            	{
+	            if( pErrorMsg )
+	                {
+	                TPtrC8 errorMsg = pErrorMsg->Des();
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- SendMsgL - re-auth error from InitializeL: retVal: (%d), error msg from InitializeServiceSessionL:"), errorCode));
+                    CSLOG_ALL(iConnectionID,KMinLogLevel ,( errorMsg ));
+	                aSenChunk.DescToChunk( errorMsg ); // 2007-02-03: no longer silenced..
+	                aSenChunk.ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+	                }
+	            else 
+	                {
+	                // Replace sent message (request) with error message
+	                // (in this case there is no error message => return KNullDesC8)
+	                // NOTE(!): do not zero-length the request if there was no error, 
+	                // otherwise re-send will fail(!)
+	                aSenChunk.DescToChunk( KNullDesC8 );
+	                aSenChunk.ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+	                }
+				}
+            }
+        CleanupStack::PopAndDestroy( pErrorMsg );
+        pErrorMsg = NULL; // pointer is re-used
+        iManager.SetShowPasswordDialog(EFalse);                
+        
+        // Sanity check that connection is valid & ready
+        if ( errorCode == KErrNone && (!iServiceSession || iStatus != KSenConnectionStatusReady) )
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"FATAL: InitServiceConnectionL() == KErrNone but ServiceSession is NOT ready!");
+            errorCode = KErrSenInternal;
+            }
+        }
+        
+    if ( errorCode == KErrNone )
+        {
+		if (!initReqd && !iReauthResendNeeded)
+	    {
+	    errorCode = sessionValidityError ;
+	    }
+        if ( errorCode == KErrNone )
+            {
+            //if (aSenChunk.ChunkHeader().HasTransactionProperties() )
+                            
+            if ( aSenChunk.ChunkHeader().PropertiesType() != MSenProperties::ENotInUse )
+                {
+                errorCode = aSenChunk.DescsFromChunk(request, transportProperties);
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Has transport properties (%d bytes."), transportProperties.Length()));
+                }
+            else
+                {
+                if (aSenChunk.RequestFileHandle().SubSessionHandle()) //request is null Now !!
+	                {
+	                errorCode = KErrNone ;	
+	                }
+                else
+		            {
+                	errorCode = aSenChunk.DescFromChunk(request);
+					}
+                }
+            }
+        }
+
+    if ( errorCode != KErrNone )
+        {
+	CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::SendMsgL() Fail with Error: = [%d], sessionValidityError = [%d]"), errorCode, sessionValidityError));
+        //when there is a soapfault and session is expired, it is auth-fault
+        if (KErrConnectionExpired == sessionValidityError && (KErrSenSoapFault == errorCode || KErrConnectionExpired == errorCode))
+			{
+			CSLOG_L(iConnectionID,KMaxLogLevel ,"-session is expired/soapfault, translating the error to  KErrSenAuthenticationFault");
+			errorCode = KErrSenAuthenticationFault ;
+			}
+			
+    	aMessage.Complete(errorCode);
+    	CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Completed with errorCode: %d"), errorCode));
+        
+	    if( (KErrSenAuthenticationFault == errorCode || KErrSenFailedAuthentication  == errorCode
+	     || KErrConnectionExpired == errorCode) && iAuthenticationRetries < KMaxAuthenticationRetries)
+        	{
+        	iAuthenticationRetries++;
+			CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::SendMsgL() iAuthenticationRetries = [%d]"), iAuthenticationRetries));
+        	CompleteReauthLoop(aSenChunk);
+        	return;
+        	}
+        else
+        	{
+        	iAuthenticationRetries = 0;
+	        CompleteTransaction(errorCode, aSenChunk);
+	        return;
+        	}
+        }
+
+    iAuthenticationRetries = 0; // reauthentication loop ends
+
+    delete pErrorMsg; // In all cases, pErrorMsg should always NULL in here..
+    pErrorMsg = NULL;
+
+
+#ifdef _SENDEBUG
+    CSLOG_FORMAT((iConnectionID, KMaxLogLevel , _L8("=================== SendL(%d bytes):"), request.Length()));
+    CSLOG_ALL(iConnectionID, KMaxLogLevel ,(request));
+    if( transportProperties.Length()>0 )    
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- Message layer transport properties:");
+        CSLOG_ALL(iConnectionID, KMaxLogLevel ,(transportProperties));
+        }
+    else
+        {
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- No message layer transport properties.");
+        }
+//    FILELOGALL(_L("WsLog"), _L("service_body_req.xml"), request);
+#endif
+
+    if(iAllowShowDialogCount<1)
+        {
+        // flag will stay up as long as count > 0
+
+        iManager.SetShowPasswordDialog(ETrue); 
+        }
+    iAllowShowDialogCount++;
+	//Proxy URL CR
+	CSenTransportProperties * pTransportProperties = CSenTransportProperties::NewL(transportProperties, *iManager.XMLReader());
+	
+	HBufC8* pTransportPropertiesProxyUrl = NULL ;	
+	TPtrC8 aProxyUrl;
+
+	MSenTransport& transport = TransportL() ;
+	MSenProperties& property = transport.PropertiesL() ;
+	switch (property.PropertiesClassType())
+    	{
+		case MSenProperties::ESenLayeredTransportProperties:
+		case MSenProperties::ESenLayeredHttpTransportProperties:
+		case MSenProperties::ESenLayeredVtcpTransportProperties:
+			{
+			CSenLayeredTransportProperties& layerdPropery = (CSenLayeredTransportProperties&)property ;
+			TInt error = layerdPropery.PropertyL(KSenConnectionProxyUrl,aProxyUrl) ;
+			if(!error) 
+    			{
+        		CSLOG_L(iConnectionID,KMinLogLevel ,"- Found New Proxy URL");
+            	CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- New proxy url('%S'."), &aProxyUrl));
+    			//pTransportProperties->SetProxyHostL(aProxyHost) ; 
+    			pTransportProperties->SetPropertyL(KSenConnectionProxyUrl,aProxyUrl);
+		    	pTransportPropertiesProxyUrl = pTransportProperties->AsUtf8LC() ;    			
+    			}
+			}    			
+    		break;
+    	}
+		
+		delete pTransportProperties;		    	
+		pTransportProperties = NULL;			
+		
+	    if ( pTransportPropertiesProxyUrl )
+	    	{
+        	CSLOG_L(iConnectionID,KMinLogLevel ,"- New Proxy URL has been set.");
+	    	transportProperties.Set( pTransportPropertiesProxyUrl->Des() ) ;
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Transport properties with new proxy url(%d bytes."), transportProperties.Length()));
+ 	    	
+	    	}
+
+//    TInt transactionId( KErrNotFound );
+    
+    // Use the Core generated transaction ID when talking to transports
+    // Using this ID, the transports can find message context associated
+    // to this request / transaction.
+    TInt transactionId( aSenChunk.ChunkHeader().ContextId() );
+#ifdef __ENABLE_ALR__	
+	HBufC8* pNewTransportProperties = NULL ;
+	if ( iSessionType != ERemoteHostlet_HC )
+		{
+		//Only real consumers will monitor Mobility service
+		if ( !iALRObserver )
+			{
+        	CSLOG_L(iConnectionID, KMinLogLevel , "SendMsgL - creating new ALR observer");
+		  	iALRObserver = CALRObserver::NewL ( *this, *iManager.XMLReader() ) ;
+		  	}	
+		MSenTransport& transport = TransportL() ;
+		//before opening connection we need to check the request is coming from Internal Consumers 
+		//or real service consumer
+        CSLOG_L(iConnectionID, KMinLogLevel , "SendMsgL - calling OpenConnectionL");
+	  	TInt error = iALRObserver->OpenConnectionL( transportProperties, transport, *iInitializer, pNewTransportProperties ) ;		
+	    if ( pNewTransportProperties )
+	    	{
+	        CSLOG_L(iConnectionID, KMinLogLevel , "SendMsgL - OpenConnectionL new transport properties set");
+	    	transportProperties.Set( pNewTransportProperties->Des() ) ;
+     	    CleanupStack::PushL( pNewTransportProperties );
+	    	}
+		if (error != KErrNone)
+			{
+			//ALR boot up failed , still iap can be collected in plugin 
+	        CSLOG_FORMAT( (iConnectionID, KMinLogLevel , _L8("SendMsgL - OpenConnectionL returned, error: %d ALR boot up failed"), error) );
+			}
+		//else
+		//	{	
+		}
+#endif	//__ENABLE_ALR__
+    TInt sendRetCode(KErrNone);
+    if ( aSenChunk.ChunkHeader().MessageType() == MSenMessage::ESoapMessage2 )
+        {
+        CSenSoapMessageDom2* pSoapMessage = CSenSoapMessageDom2::NewL(); 
+        CleanupStack::PushL(pSoapMessage);
+        ParseMessageL(transactionId, request, *pSoapMessage);
+        TInt ctxLookupErr(KErrNone);
+        MSenMessageContext* pCtx = MessageContextByTxnIdL( transactionId, ctxLookupErr );
+        if( ctxLookupErr == KErrNone && pCtx )
+            {
+            sendRetCode = pCtx->SetMessage( pSoapMessage, ETrue );
+            
+            if( sendRetCode == KErrNone )
+                {
+                // Ownerships successfully transferred to ctx:
+                CleanupStack::Pop(pSoapMessage);
+
+                // Send like a "legacy SOAP message"
+                sendRetCode = iServiceSession->SendSoapL( request,
+                                                          transportProperties,
+                                                          *this,
+                                                          transactionId,
+                                                          pErrorMsg );
+                if ( pErrorMsg )
+                    {
+                    CleanupStack::PushL( pErrorMsg );
+                    }
+                aSenChunk.ChunkHeader().SetContextId(transactionId); // temporary
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("SendMsgL - SetContextId: %d"), transactionId));
+                }
+            else 
+                {
+                // "Add to ctx" -setter method failed, delete orphan msg:
+                CleanupStack::PopAndDestroy(pSoapMessage);
+                CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("SendMsgL - Add msg to ctx failed, error: %d"), sendRetCode));
+                }
+            }
+        else 
+            {
+            // Message ctx not found, delete orphan msg:
+            CleanupStack::PopAndDestroy(pSoapMessage);
+
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("SendMsgL - MsgCtx lookup failed, error: %d"), ctxLookupErr));
+            if( ctxLookupErr == KErrNone && pCtx == NULL)
+                {
+                // lookup retCode == OK, but pCtx == NULL
+                ctxLookupErr = KErrSenInternal;
+                }
+            sendRetCode = ctxLookupErr; // here one could generalize to: KErrSenInternal; 
+            }
+        }
+    else if ( aSenChunk.ChunkHeader().MessageType() == MSenMessage::EAtomMessage )
+        {
+        CSenAtomEntry* pAtomEntry = CSenAtomEntry::NewL(); 
+        CleanupStack::PushL(pAtomEntry);
+        ParseMessageL(transactionId, request, *pAtomEntry);
+        TInt ctxLookupErr(KErrNone);
+        MSenMessageContext* pCtx = MessageContextByTxnIdL( transactionId, ctxLookupErr );
+        if( ctxLookupErr == KErrNone && pCtx )
+            {
+            sendRetCode = pCtx->SetMessage( pAtomEntry, ETrue );
+            if( sendRetCode == KErrNone )
+                {
+                // Ownerships successfully transferred to ctx:
+                CleanupStack::Pop(pAtomEntry);
+
+                // Send like a "legacy SOAP message"
+                sendRetCode = iServiceSession->SendL( request,
+                                                          transportProperties,
+                                                          *this,
+                                                          transactionId,
+                                                          pErrorMsg );
+                if ( pErrorMsg )
+                    {
+                    CleanupStack::PushL( pErrorMsg );
+                    }
+                aSenChunk.ChunkHeader().SetContextId(transactionId); // temporary
+				CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("SendMsgL - SetContextId: %d"), transactionId));
+                }
+            else 
+                {
+                // "Add to ctx" -setter method failed, delete orphan msg:
+                CleanupStack::PopAndDestroy(pAtomEntry);
+				CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("SendMsgL - Add msg to ctx failed, error: %d"), sendRetCode));
+                }
+            }
+        else 
+            {
+            // Message ctx not found, delete orphan msg:
+            CleanupStack::PopAndDestroy(pAtomEntry);
+			CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("SendMsgL - MsgCtx lookup failed, error: %d"), ctxLookupErr));
+            if( ctxLookupErr == KErrNone && pCtx == NULL)
+                {
+                // lookup retCode == OK, but pCtx == NULL
+                ctxLookupErr = KErrSenInternal;
+                }
+            sendRetCode = ctxLookupErr; // here one could generalize to: KErrSenInternal; 
+            }
+        }
+    else if ( aSenChunk.ChunkHeader().MessageType() == MSenMessage::ESoapMessage )
+        {
+        sendRetCode = iServiceSession->SendSoapL( request,
+                                                  transportProperties,
+                                                  *this,
+                                                  transactionId,
+                                                  pErrorMsg );
+                                                  
+        if ( pErrorMsg )
+            {
+            CleanupStack::PushL( pErrorMsg );
+            }
+        aSenChunk.ChunkHeader().SetContextId(transactionId); // temporary
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("SendMsgL - SetContextId: %d"), transactionId));
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("SendMsgL - TxnId: %d, sendRetCode: %d"), transactionId, sendRetCode));
+        }
+    else
+        {
+        sendRetCode = iServiceSession->SendL( request, 
+                                              transportProperties, 
+                                              *this, 
+                                              transactionId,
+                                              pErrorMsg );
+                                              
+        if ( pErrorMsg )
+            {
+            CleanupStack::PushL( pErrorMsg );
+            }
+        aSenChunk.ChunkHeader().SetContextId(transactionId); // temporary
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("SendMsgL - SetContextId: %d"), transactionId));
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- TxnId from SendL: %d, sendRetCode: %d"), transactionId, sendRetCode));
+        }
+
+    if ( sendRetCode == KErrNone )
+        {
+        if ( pErrorMsg )
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Minor (internal error): sendRetCode == KErrNone but pErrorMsg != NULL(!)");
+            CleanupStack::PopAndDestroy( pErrorMsg );
+            }
+        TInt* txnId = new (ELeave) TInt(transactionId);
+        CleanupStack::PushL(txnId);
+
+        TInt appendRetCode = TxnIds().Append(txnId);
+        if(appendRetCode==KErrNone)
+            {
+            CleanupStack::Pop(txnId); // now owned by pointer array
+
+            TInt previousTxnId = aSenChunk.ChunkHeader().TransactionId();
+            if (previousTxnId != 0)
+                {
+                TInt pendingTxnId = aSenChunk.ChunkHeader().PendingTransactionId();
+                if (pendingTxnId == 0)
+                    {
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("*** PendingTransactionId: %d"), previousTxnId));
+                    aSenChunk.ChunkHeader().SetPendingTransactionId(previousTxnId);
+                    }
+                }
+            aSenChunk.ChunkHeader().SetTransactionId( transactionId );
+            CSLOG_L(iConnectionID,KMinLogLevel ,"SendL() OK, attempt to complete with TxnID:");
+            
+            // OK! Complete with TxnID:
+            aMessage.Complete(transactionId); // OK!
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Completed with TxnId: %d"), transactionId));
+            // NOW TRANSACTION RMessage2 is pending and waiting for HandleMessageL
+            // or HandleErrorL callback, or Cancel() or destruction of this session!
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(txnId);
+            // OOM(?), Append failed
+            CSLOG_L(iConnectionID,KNormalLogLevel ," - TxnIds().Append(txnId)");
+            aMessage.Complete(appendRetCode);
+            // Complete on pending transaction, too
+            CompleteTransaction(appendRetCode, aSenChunk);
+            }
+        }
+    else // an error -- or signal about one-way message -- was received from transport
+        { 
+        if( pErrorMsg )
+            {
+            aSenChunk.DescToChunk( *pErrorMsg );
+            aSenChunk.ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+            CleanupStack::PopAndDestroy(pErrorMsg); // delete pErrorMsg;
+            }
+
+        // SendL() failed, complete with error
+        CSLOG_L(iConnectionID,KMinLogLevel ,"SendL() failed, complete this plus TXN (second RMessage2) immediately:");
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Error code: %d"), sendRetCode));
+
+        if ( sendRetCode == KErrSenTransactionComplete )
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Transport plug-in interprets sent request to be a ONE-WAY MESSAGE, completing with KErrNone & KNullDesC8");
+            aSenChunk.DescToChunk( KNullDesC8 );
+            aSenChunk.ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+            sendRetCode = KErrNone; // Consider: updating API documentation, 
+                                    // publishing KErrSenTransactionComplete,
+                                    //  returning it instead of KErrNone
+            }
+
+        aMessage.Complete(sendRetCode);
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Completed with errorCode: %d"), sendRetCode));
+        // Complete one pending transaction, too
+        CompleteTransaction(sendRetCode, aSenChunk);
+        } 
+        //Proxy URL CR
+        if (pTransportPropertiesProxyUrl != NULL)
+            {
+    	        CleanupStack::PopAndDestroy(pTransportPropertiesProxyUrl);  
+            }
+            
+#ifdef __ENABLE_ALR__	
+        if (pNewTransportProperties != NULL)
+            {
+    	        CleanupStack::PopAndDestroy(pNewTransportProperties);  
+            }
+#endif	//__ENABLE_ALR__
+    }
+
+void CSenClientSession::InstallFrameworkL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::InstallFrameworkL")));
+    TInt retVal(KErrNone);
+    TInt length = aMessage.Int1();
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::InstallFrameworkL framework length %d"), length));
+    if (length < 1)
+        {
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(length);
+    TPtr8 inBuffer = inBuf->Des();
+
+    //get message data into buf (via ptr)
+    aMessage.ReadL(0, inBuffer);
+    TRAPD(err, iManager.InstallFrameworkL(inBuffer));
+    if (err != KErrNone)
+        {
+        retVal = KErrNotFound;
+        }
+    CleanupStack::PopAndDestroy(); // inBuf;
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::AssociateServiceL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KNormalLogLevel ,(_L("CSenClientSession::AssociateServiceL")));
+
+    TInt servLength = aMessage.Int1();
+    TInt provLength = aMessage.Int3();
+
+    if (servLength < 1 || provLength < 1)
+        {
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    HBufC8* pServiceID = HBufC8::NewLC(servLength);
+    HBufC8* pProviderID = HBufC8::NewLC(provLength);
+    TPtr8 serviceID = pServiceID->Des();
+    TPtr8 providerID = pProviderID->Des();
+
+    // Read IPC arguments from RMessage2:
+    aMessage.ReadL(0, serviceID);
+    aMessage.ReadL(2, providerID);
+
+
+    CSenIdentityProvider* pIdp = CSenIdentityProvider::NewLC(KNullDesC8);
+    pIdp->SetProviderID(providerID); // id for this IDP
+    pIdp->SetServiceID(serviceID);   // associated web service
+
+    TInt error(KErrNone);
+    TBool idpAlreadyExists;
+    error = iManager.ContainsIdentityProviderL(idpAlreadyExists, *pIdp);
+    
+
+    if (error == KErrNone && idpAlreadyExists)
+        {
+        CSLOG(iConnectionID, KMaxLogLevel ,(_L("     IDP data already existed")));
+        CleanupStack::PopAndDestroy(3); // pIdp, pProviderID, pServiceID 
+        aMessage.Complete(error);
+        return;
+        }
+
+    if (!CheckAllowRegisterL(error, aMessage, pIdp->FrameworkId()))
+        {
+        CleanupStack::PopAndDestroy(3); // pIdp, pProviderID, pServiceID
+        aMessage.Complete(error);
+        return;
+        }
+    
+    TInt retVal(KErrNotFound);
+    if (iManager.AssociateServiceL(serviceID, providerID))
+        {
+        retVal = KErrNone;
+        }
+    CleanupStack::PopAndDestroy(3); // pIdp, pProviderID, pServiceID
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::DissociateServiceL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::DissociateServiceL")));
+    TInt servLength = aMessage.Int1();
+    TInt provLength = aMessage.Int3();
+
+    if (servLength < 1 || provLength < 1)
+        {
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    TInt error(KErrNone);
+    if (!CheckAllowUnRegisterL(error, aMessage))
+        {
+        aMessage.Complete(error);
+        return;
+        }
+
+    HBufC8* serviceID = HBufC8::NewLC(servLength);
+    HBufC8* providerID = HBufC8::NewLC(provLength);
+    TPtr8 ptrServiceID = serviceID->Des();
+    TPtr8 ptrProviderID = providerID->Des();
+
+    //get message data into buffers (via ptr)
+    aMessage.ReadL(0, ptrServiceID);
+    aMessage.ReadL(2, ptrProviderID);
+
+    TInt retVal(KErrNotFound);
+    if (iManager.DissociateServiceL(ptrServiceID, ptrProviderID))
+        {
+        retVal = KErrNone;
+        }
+    CleanupStack::PopAndDestroy(2); // providerID, serviceID
+    aMessage.Complete(retVal);
+    }
+
+TBool CSenClientSession::CheckAllowRegisterL(TInt& aError, const RMessage2& aMessage, const TDesC8& aFrameworkId)
+    {
+    if(aFrameworkId == KDefaultOviFrameworkID)
+    	{
+    	if (!IsTrustedClient(aMessage))
+    	    {
+    	    aError = KErrPermissionDenied;
+    	    return EFalse;
+    	    }
+    	}
+#if defined ( RD_SEN_DISABLE_USER_PERMISSION_DIALOGS )
+    iAllowWSDataReg = EAccepted;
+#endif
+        
+    if (iAllowWSDataReg == ENotChecked)
+        {
+        aError = KErrNone;
+        RNotifier notifier;
+        User::LeaveIfError(notifier.Connect());
+        CleanupClosePushL(notifier);
+
+        TRequestStatus reqStatus;
+        TPckgBuf<TAllowRegisterDlgRequest>* request = NULL;
+        TPckgBuf<TAllowRegisterDlgResponse>* response = NULL;
+
+        request = new(ELeave)TPckgBuf<TAllowRegisterDlgRequest>();
+        CleanupStack::PushL(request);
+        response = new(ELeave)TPckgBuf<TAllowRegisterDlgResponse>();
+        CleanupStack::PushL(response);
+
+        notifier.StartNotifierAndGetResponse(reqStatus, 
+            KSenNotifierPluginUID, *request, *response);
+
+        User::WaitForRequest(reqStatus);
+
+        
+        aError = reqStatus.Int();
+
+        if(reqStatus.Int() == KErrNone)
+            {
+            if((*response)().OkButtonPressed())
+                {
+                iAllowWSDataReg = EAccepted;
+                }
+            else
+                {
+                iAllowWSDataReg = ENotAccepted; 
+                // Overwrite KErrNone to indicate
+                // that end-user denies permission
+
+                aError = KErrSenNoEndUserPermission;
+                }
+            }
+        else if(reqStatus.Int() == KErrNotFound)
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("Plugin notifier impl. was not found.")));
+
+
+#ifdef _SENDEBUG
+            // To allow console tests (debugging) to complete,
+            // always DO grant permission if plug-in is not found.
+            // THIS MUST BE USED ONLY IN DEBUG BUILDS, NEVER
+            // for RELEASE (UREL) BUILDS == H/W!
+            CleanupStack::PopAndDestroy(2); // request, response;
+            CleanupStack::PopAndDestroy(); // close the notifier
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("** NOTE ** permission to manipulate WS data given!.")));
+
+            aError = KErrNone; // for test driver compatibility
+            return ETrue; // we can now allow WS data manipulation
+                          // in debugging builds.
+
+#else
+    #ifndef EKA2 // EKA1 / S60 2nd edition devices -> temporary solution, since notifier plugin does not install!
+            CleanupStack::PopAndDestroy(2); // request, response;
+            CleanupStack::PopAndDestroy(); // close the notifier
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("** NOTE ** permission to manipulate WS data given!.")));
+
+            aError = KErrNone; 
+            return ETrue; 
+    #endif
+#endif
+            }
+        else
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("NotifierPluginImpl error: (%d)"), reqStatus.Int()));
+            }
+
+        CleanupStack::PopAndDestroy(2); // request, response;
+        CleanupStack::PopAndDestroy(); // close the notifier
+        }
+
+    if (iAllowWSDataReg == EAccepted) 
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }
+    }
+
+TBool CSenClientSession::CheckAllowUnRegisterL(TInt& aError, const RMessage2& aMessage)
+	{
+	return CheckAllowUnRegisterL(aError, aMessage, KNullDesC8);
+	}
+TBool CSenClientSession::CheckAllowUnRegisterL(TInt& aError, const RMessage2& aMessage, const TDesC8& aFrameworkId)
+    {
+    if(aFrameworkId == KDefaultOviFrameworkID)
+    	{
+    	if (!IsTrustedClient(aMessage))
+    	    {
+    	    aError = KErrPermissionDenied;
+    	    return EFalse;
+    	    }
+    	}
+#if defined ( RD_SEN_DISABLE_USER_PERMISSION_DIALOGS )
+    iAllowWSDataUnReg = EAccepted;
+#endif
+
+    if (iAllowWSDataUnReg == ENotChecked)
+        {
+        aError = KErrNone;
+        RNotifier notifier;
+        User::LeaveIfError(notifier.Connect());
+        CleanupClosePushL(notifier);
+
+        TRequestStatus reqStatus;
+        TPckgBuf<TAllowUnRegisterDlgRequest>* request = NULL;
+        TPckgBuf<TAllowUnRegisterDlgResponse>* response = NULL; 
+
+        request = new(ELeave)TPckgBuf<TAllowUnRegisterDlgRequest>();
+        CleanupStack::PushL(request);
+        response = new(ELeave)TPckgBuf<TAllowUnRegisterDlgResponse>();
+        CleanupStack::PushL(response);
+
+        notifier.StartNotifierAndGetResponse(reqStatus, 
+            KSenNotifierPluginUID, *request, *response);
+
+        User::WaitForRequest(reqStatus);
+
+        aError = reqStatus.Int();
+
+        
+        if(reqStatus.Int() == KErrNone)
+            {
+            if((*response)().OkButtonPressed())
+                {
+                iAllowWSDataUnReg = EAccepted;
+                }
+            else
+                {
+                iAllowWSDataUnReg = ENotAccepted;
+                // Overwrite KErrNone to indicate
+                // that end-user denies permission
+
+                aError = KErrSenNoEndUserPermission;
+                }
+            }
+        else if(reqStatus.Int() == KErrNotFound)
+            {
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("Plugin notifier impl. was not found")));
+
+#ifdef _SENDEBUG
+            // To allow console tests (debugging) to complete,
+            // always DO grant permission if plugin is not found.
+            // THIS MUST BE USED ONLY IN DEBUG BUILDS, NEVER
+            // for RELEASE (UREL) BUILDS!
+            CleanupStack::PopAndDestroy(2); // request, response;
+            CleanupStack::PopAndDestroy(); // close the notifier
+            CSLOG(iConnectionID, KMinLogLevel ,(_L("** NOTE ** permission to manipulate WS data given!.")));
+
+            aError = KErrNone; // for test driver compatibility
+            return ETrue; // we can now allow WS data manipulation
+                          // in debugging builds.
+            
+#endif
+            }
+        else
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("Plugin notifier impl., Error: %d"), reqStatus.Int()));
+            }
+
+        CleanupStack::PopAndDestroy(2); // request, response;
+        CleanupStack::PopAndDestroy(); // close the notifier
+        }
+
+    if (iAllowWSDataUnReg == EAccepted) 
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }
+    }
+
+void CSenClientSession::RegisterIdentityProviderL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::RegisterIdentityProviderL")));
+
+    TInt length = aMessage.Int1();
+    if (length < 1)
+        {
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(length);
+    TPtr8 inBuffer = inBuf->Des();
+    aMessage.ReadL(0, inBuffer);
+
+#ifdef _SENDEBUG
+    if( inBuf )
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- IdentityProvider description (as XML):");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(inBuffer));
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        }
+#endif    
+
+
+    CSenIdentityProvider* pdp = CSenIdentityProvider::NewLC(KNullDesC8);
+
+    // parse into XML object.
+    pdp->SetReader(*iManager.XMLReader());
+    pdp->ParseL(inBuffer);
+
+    TInt error(KErrNone);
+    TBool idpAlreadyExists;
+    error = iManager.ContainsIdentityProviderL(idpAlreadyExists, *pdp);
+
+    if (error == KErrNone && idpAlreadyExists)
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"     IDP data already existed");
+        CleanupStack::PopAndDestroy(2); // pdp, inBuf
+        aMessage.Complete(error);
+        return;
+        }
+
+    if (!CheckAllowRegisterL(error, aMessage, pdp->FrameworkId()))
+        {
+        CleanupStack::PopAndDestroy(2); // pdp, inBuf (fix from wk44)
+        aMessage.Complete(error);
+        return;
+        }
+
+    // PLEASE NOTE(!): ownerships is always transferred to manager!
+    TInt retVal = iManager.RegisterIdentityProviderL(pdp);
+    CleanupStack::Pop(); //pdp -> ownership is now elsewhere...
+    CleanupStack::PopAndDestroy(); // inBuf
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::UnregisterIdentityProviderL(const RMessage2& aMessage)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::UnregisterIdentityProviderL");
+    TInt length = aMessage.Int1();
+    if (length < 1)
+        {
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    TInt error(KErrNone);
+    if (!CheckAllowUnRegisterL(error, aMessage))
+        {
+        aMessage.Complete(error);
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(length);
+    TPtr8 inBuffer = inBuf->Des();
+    aMessage.ReadL(0, inBuffer);
+
+#ifdef _SENDEBUG
+    if( inBuf )
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- IdentityProvider description (as XML):");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(inBuffer));
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        }
+#endif    
+    
+    CSenIdentityProvider* pdp = CSenIdentityProvider::NewLC(KNullDesC8);
+
+    pdp->SetReader(*iManager.XMLReader());
+    pdp->ParseL(inBuffer);
+    if (!CheckAllowUnRegisterL(error, aMessage, pdp->FrameworkId()))
+        {
+        CleanupStack::PopAndDestroy(); // pdp
+        aMessage.Complete(error);
+        return;
+        }
+    TInt retVal(KErrNotFound);
+    retVal = iManager.UnregisterIdentityProviderL(*pdp);
+
+
+// Note: after "protected credentials" -change => no need to remove credential(s) anymore, since they are protected by account details (userinfo from IDP)
+//   if ( retVal == KErrNone )
+//        {
+//        iManager.RemoveCredentialsL(idp->ProviderID());
+//        }
+
+    CleanupStack::PopAndDestroy(); // pdp // in the future ownership will be
+                                          // transferred -> Pop is enough
+
+    CleanupStack::PopAndDestroy(); // inBuf
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::RegisterServiceDescriptionL(const RMessage2& aMessage)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::RegisterServiceDescriptionL");
+
+    TInt length = aMessage.Int1();
+    if(length < 1)
+        {
+        CSLOG_L(iConnectionID,KMinLogLevel ,"Tried to register ZERO length SD.");
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(length);
+    TPtr8 inBuffer = inBuf->Des();
+    aMessage.ReadL(0, inBuffer);
+
+#ifdef _SENDEBUG
+    if( inBuf )
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- XML SD description (as XML) before parsing:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*inBuf));
+        
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        }
+#endif 
+
+    CSenWSDescription* pSd = CSenWSDescription::NewLC();
+    pSd->SetReader(*iManager.XMLReader());
+    pSd->ParseL(inBuffer);
+
+#ifdef _SENDEBUG
+    HBufC8* pAsXml = NULL;
+    pAsXml = pSd->AsXmlL();
+    if(pAsXml)
+        {
+        CleanupStack::PushL(pAsXml);
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"  SD after parsing:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*pAsXml));
+        CleanupStack::PopAndDestroy(); // pAsXml
+        }
+    else
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- SD as XML was NULL after parsing(!)");
+        }
+#endif // _SENDEBUG
+
+    TInt error(KErrNone);
+    TBool dataAlreadyExists;
+    error = iManager.ContainsServiceDescriptionL(dataAlreadyExists, *pSd);
+
+    if (error == KErrNone && dataAlreadyExists)
+        {
+        CleanupStack::PopAndDestroy(2); // pSd, inBuf
+        aMessage.Complete(error);
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"  SD was already found, no need to register.");
+        return;
+        }
+
+    if (!CheckAllowRegisterL(error, aMessage, pSd->FrameworkId()))
+        {
+        CleanupStack::PopAndDestroy(2); // pSd, inBuf
+        aMessage.Complete(error);
+        return;
+        }
+
+    // NOTE(!): RegisterServiceDescriptionL() always takes the ownership!
+    TInt retVal(iManager.RegisterServiceDescriptionL(pSd));
+    CleanupStack::Pop(); // pSd, ownership was transferred
+    CleanupStack::PopAndDestroy(); // inBuf
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::UnregisterServiceDescriptionL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::UnregisterServiceDescriptionL")));
+    TInt length = aMessage.Int1();
+    if(length < 1)
+        {
+        CSLOG(iConnectionID, KMaxLogLevel ,(_L("Tried to unregister ZERO length SD.")));
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    TInt error(KErrNone);
+    if (!CheckAllowUnRegisterL(error, aMessage))
+        {
+        aMessage.Complete(error);
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(length);
+    TPtr8 inBuffer = inBuf->Des();
+    aMessage.ReadL(0, inBuffer);
+
+#ifdef _SENDEBUG
+    if( inBuf )
+        {
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- XML SD description (as XML) before parsing:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(inBuffer));
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+        }
+#endif 
+
+    CSenWSDescription* sd = CSenWSDescription::NewLC();
+    sd->SetReader(*iManager.XMLReader());
+    sd->ParseL(inBuffer);
+    if (!CheckAllowUnRegisterL(error, aMessage, sd->FrameworkId()))
+        {
+        CleanupStack::PopAndDestroy(2); // sd, inBuf
+        aMessage.Complete(error);
+        return;
+        }
+#ifdef _SENDEBUG
+        HBufC8* pAsXml = NULL;
+        pAsXml = sd->AsXmlL();
+        if(pAsXml)
+            {
+            CleanupStack::PushL(pAsXml);
+            CSLOG_L(iConnectionID,KMaxLogLevel ,"  SD after parsing:");
+            CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*pAsXml));
+            CleanupStack::PopAndDestroy(); // 1
+            }
+        else
+            {
+            CSLOG_L(iConnectionID,KMaxLogLevel ,"  SD as XML was NULL after parsing(!)");
+            }
+#endif // _SENDEBUG
+
+
+    TInt retVal(iManager.UnregisterServiceDescriptionL(*sd));
+    CleanupStack::PopAndDestroy(2); // sd, inBuf
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::ServiceDescriptionsByPatternL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::ServiceDescriptionsByPatternL")));
+    
+    CSenChunk* pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+    
+    TPtrC8 pattern;
+    retVal = pSenChunk->DescFromChunk(pattern);
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    RWSDescriptionArray arr; // the elements will NOT be owned..
+
+    CSenWSDescription* pSD = CSenWSDescription::NewLC();
+    pSD->SetReader(*iManager.XMLReader());
+    pSD->ParseL(pattern);
+
+    retVal = iManager.ServiceDescriptionsL(arr, *pSD);
+    CleanupStack::PopAndDestroy(pSD); // pSD
+    CleanupClosePushL(arr);
+
+    if (retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // arr.Close() is enough
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(retVal);  
+        }
+
+    TInt count = arr.Count();
+    
+    // Calculate required heap allocation size:
+    TInt size(0);
+    if(count>0)
+        {
+        size += (count-1) * KTab().Length();
+        }
+
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, size += iManager.SizeOfServiceDescriptionsL(arr); )
+    if(leaveCode!=KErrNone)
+        {
+        // the elements of array are not owned
+        CleanupStack::PopAndDestroy(); // arr.Close() is enough
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(leaveCode); 
+        }
+        
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ServiceDescriptionsByPatternL");
+
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Size of SD(s) + delimiter(s): %d bytes"), size));
+
+    // Adjust RChunk to accomodate found SDs using known hnalde
+    TPtr8* pDescriptions = NULL;
+    retVal = pSenChunk->AllocDescToChunk(size, pDescriptions); 
+
+    if(retVal==KErrNone && pDescriptions)
+        {
+        CBufFlat* pBuf = NULL;
+        if(count>0)
+            {
+            pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream bufWs(*pBuf);
+            CleanupClosePushL(bufWs);
+            arr[0]->WriteAsXMLToL(bufWs);
+            // Add this SD as XML into the "big heap buffer":
+            TPtr8 p8 = pBuf->Ptr(0);
+            pDescriptions->Append(p8); 
+            // Destroy the temporary, flat stream buffer
+            CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+            pBuf = NULL;
+            }
+        for(TInt x=1; x<count; x++)
+            {
+            // Add delimiter
+            pDescriptions->Append(KTab); 
+
+            pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream bufWs(*pBuf);
+            CleanupClosePushL(bufWs);
+            arr[x]->WriteAsXMLToL(bufWs);
+            // Add this SD as XML into the "big heap buffer":
+            TPtr8 p8 = pBuf->Ptr(0);
+            pDescriptions->Append(p8); 
+            CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+            pBuf = NULL;
+            }
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- Requested descriptions:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*pDescriptions));
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- AllocDescToRMsgL failed: %d"), retVal));
+        }
+#endif // _SENDEBUG
+
+    CleanupStack::PopAndDestroy(); // arr.Close() is enough
+    CleanupStack::PopAndDestroy(pSenChunk); // Close SenChunk
+
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::ServiceDescriptionsByUriL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ServiceDescriptionsByUriL (contract)");
+    
+    CSenChunk* pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+    
+    TPtrC8 pattern;
+    retVal = pSenChunk->DescFromChunk(pattern);
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    RWSDescriptionArray arr;
+    retVal = iManager.ServiceDescriptionsL(arr, pattern);
+    CleanupClosePushL(arr);
+
+    if (retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // arr.Close() is enough
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(retVal);
+        return;
+        }
+
+
+    TInt count = arr.Count();
+    
+    // Calculate required heap allocation size:
+    TInt size(0);
+    if(count>0)
+        {
+        size += (count-1) * KTab().Length();
+        }
+
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, size += iManager.SizeOfServiceDescriptionsL(arr); )
+    if(leaveCode!=KErrNone)
+        {
+        // the elements of array are not owned, reset is enough
+        //arr.Reset();
+        CleanupStack::PopAndDestroy(); // arr.Close() is enough
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(leaveCode); 
+        }
+        
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ServiceDescriptionsByPatternL");
+
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Size of SD(s) + delimiter(s): %d bytes"), size));
+
+    TPtr8* pDescriptions = NULL;
+    retVal = pSenChunk->AllocDescToChunk(size, pDescriptions); 
+
+    if(retVal==KErrNone && pDescriptions)
+        {
+
+        CBufFlat* pBuf = NULL;
+        if(count>0)
+            {
+            pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream bufWs(*pBuf);
+            CleanupClosePushL(bufWs);
+            arr[0]->WriteAsXMLToL(bufWs);
+            // Add this SD as XML into the "big heap buffer":
+            TPtr8 p8 = pBuf->Ptr(0);
+            pDescriptions->Append(p8); 
+            // Destroy the temporary, flat stream buffer
+            CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+            pBuf = NULL;
+            }
+
+        for(TInt x=1; x<count; x++)
+            {
+            // Add delimiter
+            pDescriptions->Append(KTab); 
+
+            pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream bufWs(*pBuf);
+            CleanupClosePushL(bufWs);
+            arr[x]->WriteAsXMLToL(bufWs);
+            // Add this SD as XML into the "big heap buffer":
+            TPtr8 p8 = pBuf->Ptr(0);
+            pDescriptions->Append(p8); 
+            CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+            pBuf = NULL;
+            }
+            
+        CSLOG_L(iConnectionID,KMaxLogLevel ,"- Requested descriptions:");
+        CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*pDescriptions));
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- AllocDescToRMsgL failed: %d"), retVal));
+        }
+#endif // _SENDEBUG
+    CleanupStack::PopAndDestroy(); // arr.Close() is enough
+    CleanupStack::PopAndDestroy(pSenChunk); // Close SenChunk
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::IsReadyL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::IsReadyL")));
+
+    TBool isReady(EFalse);
+
+    if (iStatus == KSenConnectionStatusReady)
+        isReady = ETrue;
+
+    TPtr8 ptr(reinterpret_cast<TUint8*>(&isReady), sizeof(isReady),
+                sizeof(isReady));
+    aMessage.WriteL(0, ptr); //IPC V2
+    aMessage.Complete(KErrNone);
+    }
+
+// note: currently this function does not leave
+void CSenClientSession::StartTransactionL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::StartTransactionL")));
+
+    if (!CheckValidity(aMessage))
+        {
+        return;
+        }
+    TInt retVal(KErrNone);
+    iServiceSession->StartTransaction();
+    aMessage.Complete(retVal);
+    }
+
+// note: currently this function does not leave
+void CSenClientSession::TransactionCompletedL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::TransactionCompletedL")));
+
+    if (!CheckValidity(aMessage))
+        {
+        return;
+        }
+    TInt retVal(KErrNone);
+    iServiceSession->TransactionCompleted();
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::CancelSessionL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::CancelSessionL")));
+    // Complete pending msgs via this call - or one could call non-leaving 
+    // version and complete with (possible) leavecode it returns..
+    CompletePendingMessagesL(); 
+    
+    // Check if this session is remote hostlet
+    if ( iSessionType == ERemoteHostlet_HC && ipHostletAwaitOp)
+        {
+        ipHostletAwaitOp->RMessage().Complete(KErrSenCancelled);
+        delete ipHostletAwaitOp;
+        ipHostletAwaitOp = NULL; 
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CancelSessionL - await op completed with KErrSenCancelled");
+        
+        }
+    
+    iManager.SetShowPasswordDialog(EFalse); // not mandatory
+    aMessage.Complete(KErrNone);
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CancelSessionL - operation complete.");
+    }
+
+void CSenClientSession::HasFacetL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::HasFacetL")));
+
+    if (!CheckValidity(aMessage))
+        {
+        return;
+        }
+
+    TInt length = aMessage.Int2();
+    if (length < 1)
+        {
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(length);
+    TPtr8 inBuffer = inBuf->Des();
+    //inBuffer.Zero();
+
+    TBool hasFacet;
+
+    aMessage.ReadL(0, inBuffer); // URI
+
+    TInt retVal = iServiceSession->HasFacetL(inBuffer, hasFacet);
+
+    TPtr8 ptr(reinterpret_cast<TUint8*>(&hasFacet), sizeof(hasFacet),
+        sizeof(hasFacet));
+    aMessage.WriteL(1, ptr); //IPC V2
+    CleanupStack::PopAndDestroy(); // inBuf
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::CompleteServerMessagesOnOffL(const RMessage2& aMessage)
+    {
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::CompleteServerMessagesOnOffL")));
+
+    if (!CheckValidity(aMessage))
+        {
+        return;
+        }
+
+    HBufC8* inBuf = HBufC8::NewLC(10);
+    TPtr8 inBuffer = inBuf->Des();
+    aMessage.ReadL(0, inBuffer); // boolean
+    TBool onOrOff = (TBool)(*inBuffer.Ptr()) ;
+
+    TInt retVal = iServiceSession->CompleteServerMessagesOnOffL(onOrOff);
+    CleanupStack::PopAndDestroy(); // inBuf
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::RequestServiceDescriptionL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::RequestServiceDescriptionL")));
+    if (!CheckValidity(aMessage))
+        {
+        return;
+        }
+
+    iSendBuf = CBufFlat::NewL(KFlatBufSize);
+
+    RBufWriteStream bufWs(*iSendBuf);
+    CleanupClosePushL(bufWs); // push
+    iServiceSession->AsServiceDescription().WriteAsXMLToL(bufWs);
+    //iServiceSession->WriteAsXMLToL(bufWs); 
+
+
+    // write the data length to client process descriptor..
+    TInt neededLength = iSendBuf->Ptr(0).Length();
+    TPtr8 ptr(reinterpret_cast<TUint8*>(&neededLength), sizeof(neededLength), sizeof(neededLength));
+    TRAP( retVal, aMessage.WriteL(0, ptr); ) //IPC V2
+
+    CleanupStack::PopAndDestroy(); // close bufWs
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::ReceiveServiceDescriptionL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::ReceiveServiceDescriptionL")));
+    if (!CheckValidity(aMessage))
+        {
+        return;
+        }
+    if(iSendBuf)
+        {
+        TRAP( retVal, aMessage.WriteL(0, iSendBuf->Ptr(0)); )  //IPC V2
+        }
+    else 
+        {
+        retVal = KErrSenInternal; 
+        }
+
+    aMessage.Complete(retVal);
+    }
+    
+void CSenClientSession::SetTransportPropertiesL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::SetTransportPropertiesL")));
+
+    if ( !CheckValidity(aMessage) )
+        {
+        return;
+        }
+    
+    CSenChunk* pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+    
+    TPtrC8 transportProperties;
+    retVal = pSenChunk->DescFromChunk(transportProperties);
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Transport Properties (%d bytes):"), transportProperties.Length()));
+    CSLOG_ALL(iConnectionID, KMaxLogLevel ,(transportProperties));
+    if ( iServiceSession )
+        {
+#ifdef __ENABLE_ALR__
+#if  defined ( RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES )
+	HBufC8* pNewTransportProperties = NULL ;
+	    if (iSessionType != ERemoteHostlet_HC)
+            {
+            
+            //Only Real Consumer will monitor Mobility service
+            if (!iALRObserver)
+                {
+	            CSLOG_L(iConnectionID, KMinLogLevel , "SetTransportPropertiesL - creating new ALR observer");
+                iALRObserver = CALRObserver::NewL (*this, *iManager.XMLReader()) ;
+                }
+            MSenTransport& transport = TransportL() ;
+            MSenProperties& property = transport.PropertiesL() ;
+            //TPtrC8 transportCue = (*iInitializer).TransportCue();
+            if (property.PropertiesClassType() == MSenProperties::ESenLayeredVtcpTransportProperties)
+              	{
+            	if (iALRObserver->GetActiveIap() >= 0 )//&& (transportCue == KSenTransportCueVirtualTCP)
+            		{
+            		//VTCP start a connection while setting transport itself so lets start ALR mobility observer
+            		//collect the iap id and propagate it to VTCP
+      		        CSLOG_L(iConnectionID, KMinLogLevel , "-SetTransportPropertiesL calling OpenConnectionL ");
+            		TInt error = iALRObserver->OpenConnectionL(transportProperties, transport, *iInitializer, pNewTransportProperties) ;
+        		if (error != KErrNone)
+            			{
+            			//ALR boot up failed , still iap can be collected in plugin 
+            		    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("SetTransportPropertiesL - OpenConnectionL returned, error: %d"), error));
+            		  	}
+            		if (pNewTransportProperties)
+            			{
+             		    CSLOG_L(iConnectionID, KMinLogLevel , "-SetTransportPropertiesL setting new transport properties from ALR observer");
+            			transportProperties.Set(pNewTransportProperties->Des()) ;
+                		CleanupStack::PushL(pNewTransportProperties);                        
+            			}
+            		}
+              	}
+            }
+#endif //RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES
+#endif //__ENABLE_ALR__
+#ifdef __TEST_RETRY_TTL
+			HBufC8* pNewTranProp = NULL;
+			CSenVtcpTransportProperties* pVtcpProperties=CSenVtcpTransportProperties::NewL(transportProperties, *iManager.XMLReader());
+			pVtcpProperties->SetMaxRetryTTLL(240);
+			pVtcpProperties->SetMinRetryTTLL(30);
+			pVtcpProperties->SetRetryDeltaTimeoutL(30);
+			pNewTranProp=pVtcpProperties->AsUtf8LC();
+			transportProperties.Set(pNewTranProp->Des()) ;
+			delete pVtcpProperties;
+			pVtcpProperties = NULL;	
+			
+#endif //__TEST_RETRY_TTL
+	        retVal = iServiceSession->SetTransportPropertiesL(transportProperties, *this);
+#ifdef __TEST_RETRY_TTL	        
+	       CleanupStack::PopAndDestroy(pNewTranProp);
+#endif //__TEST_RETRY_TTL	       
+#ifdef __ENABLE_ALR__
+#if  defined ( RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES )
+                if (pNewTransportProperties != NULL)
+                    {
+            	        CleanupStack::PopAndDestroy(pNewTransportProperties);  
+                    }
+#endif //RD_SEN_ENABLE_VTCP_BY_TRANSPORTPROPERTIES	     	        
+#endif //__ENABLE_ALR__
+        }
+    else
+        {
+        retVal = KErrSenNotInitialized;
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::TransportPropertiesL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSLOG(iConnectionID, KMinLogLevel ,(_L("CSenClientSession::TransportPropertiesL")));
+    
+    if ( !CheckValidity(aMessage) )
+        {
+        return;
+        }
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+
+    if ( retVal != KErrNone )
+        {
+        CleanupStack::PopAndDestroy(pSenChunk);
+        aMessage.Complete(KErrBadDescriptor);
+        return;
+        }
+
+    HBufC8* pTransportProperties = NULL;
+    iServiceSession->TransportPropertiesL(pTransportProperties, *this);
+    
+    retVal = pSenChunk->DescToChunk(*pTransportProperties);
+    delete pTransportProperties;
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- DescToRChunkL returned: %d"), retVal));
+    
+    if ( retVal != KErrNone )
+        {
+        aMessage.Complete(ESenInternalError);
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - HandleBase");
+        }
+        
+    CleanupStack::PopAndDestroy(pSenChunk);
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::EstablishHostletConnectionL(const RMessage2& aMessage)
+    {
+    // To cache secure id of the client
+    // This secure id will be used to notify client in case RProperty updates
+    iClientSecureID = aMessage.SecureId();
+
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::EstablishHostletConnectionL( %d )"), aMessage.Handle()));
+
+    iSessionType = ERemoteHostlet_HC;
+    TInt retVal(KErrNone);
+    // Read hostlet connection properties from the rmessage
+
+
+    // Read service description buffer length
+    HBufC8* pServiceDescriptionBuf = NULL;
+    retVal = ReadBufferFromRMessageL(aMessage, 1, 0, pServiceDescriptionBuf);
+    CleanupStack::PushL( pServiceDescriptionBuf );
+
+    if( retVal == KErrNone )
+        {
+        // Parse the XML string into a XML service description object
+        TPtr8 sdAsXml = pServiceDescriptionBuf->Des();
+        delete iInitializer;
+        iInitializer = NULL;
+        retVal = ParseSessionInitializerL(iInitializer, sdAsXml);
+
+        // Attempt to initialize service session
+        if ( retVal == KErrNone )
+            {
+            // Sanity check
+            if( !iInitializer )
+                {
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Fatal: initializer is NULL after succeeded parsing!");
+                retVal = KErrSenInternal;
+                }
+            else
+                {
+                // Initialize the service session
+                HBufC8* pErrorMsg = NULL;
+                retVal = InitializeServiceSessionL(*iInitializer, pErrorMsg);
+                CleanupStack::PushL( pErrorMsg );
+                if( pErrorMsg )
+                    {
+                    TPtrC8 error = pErrorMsg->Des();
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- EstablishHostletConnectionL: retVal: (%d), error msg from InitializeServiceSessionL:"), retVal));
+                    CSLOG_ALL(iConnectionID, KMinLogLevel ,( error ));
+                    }
+                CleanupStack::PopAndDestroy( pErrorMsg );
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Hostlet session INIT returned: %d"), retVal));
+
+
+                if( retVal == KErrNone && iServiceSession )
+                    {
+                    if( iServiceSession->Hostlet() )
+                        {
+                        // Some other HC is already serving this endpoint,
+                        // => return "endpoint reserved" code:
+                        retVal = KErrSenEndpointReserved;
+                        }
+                    else
+                        {
+                        RFacetArray hostFacets;
+                        iInitializer->FacetsL( hostFacets );
+                        CleanupClosePushL( hostFacets );
+                        TInt count(hostFacets.Count());
+                        for (TInt i=0; i<count; i++)
+                            {
+                            ((CSenServiceSession*)iServiceSession)->SetFacetL(*hostFacets[i]);
+                            }
+
+                        hostFacets.ResetAndDestroy();
+                        CleanupStack::Pop();
+                        // Set this Remote Hostlet for the acquired session.
+                        iServiceSession->SetHostletL(this);
+
+                        // Remove this client session from the list of session consumers:
+                        iServiceSession->RemoveConsumerL(*this);
+
+                        // Create new hostlet connection transport plug-in instance:
+                        TransportL(); 
+                        
+                        }
+
+                    }
+                }
+            }
+        }
+        
+    CleanupStack::PopAndDestroy( pServiceDescriptionBuf );
+    // Complete with: KErrNone or KErrAlreadyExists, KErrSenNoEndpoint or KErrSenNoContract 
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- EstablishHostletConnectionL completes with: %d"), retVal));
+    aMessage.Complete(retVal); 
+    }
+
+// Helper
+TInt CSenClientSession::ReadBufferFromRMessageL(const RMessage2& aMessage, 
+                                                TInt aSdLengthIdx, 
+                                                TInt aSdBufIdx,
+                                                HBufC8*& aSdBuf)
+    {
+
+    if(aSdBufIdx<0 || aSdBufIdx>3 || aSdLengthIdx<0 || aSdLengthIdx>3)
+        {
+        return KErrArgument;
+        }
+
+    TInt retVal(KErrNone);
+
+    // Read service description buffer length
+    TInt sdLength(KErrNotFound);
+
+    switch(aSdLengthIdx)
+        {
+        case 0:
+            {
+            sdLength = aMessage.Int0(); // 1st argument
+            break;
+            }
+        case 1:
+            {
+            sdLength = aMessage.Int1(); // 2nd argument
+            break;
+            }
+        case 2:
+            {
+            sdLength = aMessage.Int2(); // 3rd argument
+            break;
+            }
+        case 3:
+            {
+            sdLength = aMessage.Int3(); // 4th argument
+            break;
+            }
+        default:
+            {
+            return KErrArgument;
+            }
+        }
+
+    // Free and allocate buffer for service description    
+    delete aSdBuf;
+    aSdBuf = NULL;
+
+    if(sdLength>0)
+        {
+        aSdBuf = HBufC8::NewL(sdLength);
+        TPtr8 sdBuffer = aSdBuf->Des();
+        // Read sd data into buf 
+        switch(aSdBufIdx)
+            {
+            case 0:
+                {
+                aMessage.ReadL(0, sdBuffer);
+                break;
+                }
+            case 1:
+                {
+                aMessage.ReadL(1, sdBuffer);
+                break;
+                }
+            case 2:
+                {
+                aMessage.ReadL(2, sdBuffer);
+                break;
+                }
+            case 3:
+                {
+                aMessage.ReadL(3, sdBuffer);
+                break;
+                }
+            default:
+                {
+                return KErrArgument;
+                }
+            }
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8(" - ServiceDescription (%d bytes):"), sdBuffer.Length()));
+        CSLOG_ALL(iConnectionID, KMaxLogLevel ,(sdBuffer));
+        }
+    else
+        {
+        CSLOG_L(iConnectionID,KNormalLogLevel ," - error: SD length is zero!");
+        retVal = KErrArgument;
+        }
+    return retVal;
+    }
+
+void CSenClientSession::AwaitHostletRequestL(const RMessage2& aMessage)
+    {
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::AwaitHostletRequestL( %d )"), aMessage.Handle()));
+
+    // ALWAYS first check, if there already is some pending request, in which 
+    // case aMessage can be completed immediately with request's chunk handle.
+    RHostletRequestMap& requests = HostletRequestMap();
+    TInt count(requests.Count());
+    if( count > 0 )
+        {
+        CSenClientMessage* pMessage = (CSenClientMessage*)requests.ValueAt( 0 );
+        const TInt* pKey = requests.KeyAt( 0 );
+        if( pMessage && pKey )
+            {
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d request(s) already waiting. Completing (serving) first in queue immediately."), count));
+            delete ipHostletAwaitOp;
+            ipHostletAwaitOp = NULL; // busy
+            RHandleBase& handle = pMessage->Chunk();
+#ifdef EKA2
+            aMessage.Complete( handle );
+#else // EKA1
+            aMessage.Complete( handle.Handle() );
+#endif // EKA2:EKA1
+            // Queue is processed in simple, FIFO manner:
+            requests.RemoveByKey( *pKey ); // de-allocates the txn ID
+            }
+        }
+    else // start waiting for request..
+        {
+        // De-allocate last await op (wrapper)
+        delete ipHostletAwaitOp;
+        ipHostletAwaitOp = NULL;
+        // Create wrapper for wait operation (RMessage2)
+        ipHostletAwaitOp = CSenClientMessage::NewL( aMessage );
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- Waiting for Hostlet request from consumer(s).");
+        }
+    }
+
+
+
+
+void CSenClientSession::ProvideHostletResponseL( const RMessage2& aMessage )
+    {
+    TInt responseCode = aMessage.Int3();
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::ProvideHostletResponseL( handle: %d, responseCode: %d )"), aMessage.Handle(), responseCode));
+    TInt retVal(KErrNone);
+    
+    TInt txnId(KErrNotFound);
+    CSenChunk* pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage, 2);
+    if ( retVal == KErrNone )
+        {
+        txnId = pSenChunk->ChunkHeader().TransactionId();
+        retVal = iServiceSession->ProvideHostletResponseL(*this, txnId, responseCode, KNullDesC8, *pSenChunk);
+        }
+    CleanupStack::PopAndDestroy( pSenChunk );
+        
+    if( retVal != KErrNone )  
+        {
+        // Some error occured, complete ASYNC "provide" -operation immediately
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::ProvideHostletResponseL - ERROR: Complete(%d)"), retVal));    
+        aMessage.Complete(retVal);
+        }
+    else
+        {
+        // OK, append this ASYNC op to array of pending REMOTE HOSTLET transactions         
+        // NOTE: TransactionL() method is quite similart to below code (re-factor later on)
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ProvideHostletResponseL - transport's CompleteTransaction() returned OK");
+            
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::ProvideHostletResponseL - RMessage2(%d)"), aMessage.Handle()));
+
+        CSenClientMessage* pMessage = CSenClientMessage::NewLC( aMessage );
+        pMessage->SetLogger(Log());
+        TInt retVal = pMessage->OpenChunkFromRMsgL(pMessage->RMessage(),2);
+        
+        if ( retVal == KErrNone )
+            {
+            TInt* pTxnId = new (ELeave) TInt(txnId);
+            CleanupStack::PushL(pTxnId);
+
+            retVal = TxnIds().Append(pTxnId);
+            if ( retVal == KErrNone )
+                {
+                CleanupStack::Pop(pTxnId); // now owned by pointer array
+            
+                retVal = Transactions().Append(pMessage);
+                if(retVal==KErrNone)
+                    {
+                    CleanupStack::Pop(pMessage); // now owned by transaction array of this Remote Hostlet
+                    // Respond operation (ASYNC) is now safely pending
+                    // Start waiting for MSenRemoteHostlet::OnServiceCompleteL OR cancel OR destruction 
+                    // of this client session (remote hostlet)...
+                    CSLOG_L(iConnectionID,KMinLogLevel ,"- ProvideResponse IPC operation now pending: OK.");
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy(pMessage);
+                    }
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(pTxnId);
+                CleanupStack::PopAndDestroy(pMessage);
+                }
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(pMessage);
+            }
+            
+        if ( retVal != KErrNone )
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Append failed (OOM): de-allocate client message:");
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Completeting this asynchronous IPC operation with ESenInternalError");
+            aMessage.Complete(retVal);
+            }
+        }
+    }
+// Constantness on the TInt return type has no meaning since you are returning by value
+TInt CSenClientSession::ConnectionId()
+    {
+    	return (iConnectionID);
+    }
+
+void CSenClientSession::MoveChunkL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        retVal = TransactionIndex(pSenChunk->ChunkHeader().TransactionId());
+        if ( retVal != KErrNotFound )
+            {
+            RTransactionArray& transactions = Transactions();   
+            CSenClientMessage* pClientMessage = transactions[retVal];
+    
+            TPtrC8 cid;
+            retVal = pSenChunk->DescFromChunk(cid,2);
+            if ( retVal == KErrNone )
+                {
+                RChunk chunk;
+                CleanupClosePushL(chunk);
+                retVal = chunk.Open(aMessage, 1, EOwnerProcess);
+                if ( retVal == KErrNone )
+                    {
+                    CSenBinaryData* pBinaryData = CSenBinaryData::NewLC( chunk, cid, aMessage.Int2(), aMessage.Int3() );
+            		RPointerArray<CSenBinaryData>& bArray = pClientMessage->BinaryDataArray();
+            		bArray.AppendL(pBinaryData);
+            		CleanupStack::Pop(pBinaryData);
+                    }
+                CleanupStack::Pop(&chunk);
+                }
+            }
+        }
+        
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::MoveFileL( const RMessage2& aMessage )
+    {
+    TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        retVal = TransactionIndex(pSenChunk->ChunkHeader().TransactionId());
+        if ( retVal != KErrNotFound )
+            {
+            RTransactionArray& transactions = Transactions();   
+            CSenClientMessage* pClientMessage = transactions[retVal];
+
+            TPtrC8 cid;
+            retVal = pSenChunk->DescFromChunk(cid,2);
+            if (retVal == KErrNone)
+                {
+                RFile binaryDataFile;
+                CleanupClosePushL(binaryDataFile);
+                retVal = binaryDataFile.AdoptFromClient(aMessage, 1, 2);
+                if ( retVal == KErrNone )
+                    {
+                    RFs fs;
+            		// Get the Session handle
+            		User::LeaveIfError(fs.Open(aMessage, 1));
+            		CleanupClosePushL(fs);
+                    
+                    RFile file;
+            		// Adopt the File handle;
+            		User::LeaveIfError(file.Adopt(fs, binaryDataFile.SubSessionHandle()));
+            		CleanupClosePushL(file);
+            		
+            		CSenBinaryData* pBinaryData = CSenBinaryData::NewLC(fs, file, cid);
+            		RPointerArray<CSenBinaryData>& bArray = pClientMessage->BinaryDataArray();
+            		bArray.AppendL(pBinaryData);
+            		CleanupStack::Pop(pBinaryData);
+            		
+            		CleanupStack::Pop(&file);
+            		CleanupStack::Pop(&fs);
+                    }
+          	    CleanupStack::PopAndDestroy(&binaryDataFile);
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+        
+    aMessage.Complete(retVal);
+    }
+    
+    
+void CSenClientSession::SendFileHandleL( const RMessage2& aMessage )
+    {
+    TInt retVal(KErrNone);
+    TInt txnId(KErrNotFound);
+    CSenChunk* pSenChunk = NULL;
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+
+    if ( retVal == KErrNone )
+        {
+        txnId = pSenChunk->ChunkHeader().TransactionId();
+        if ( txnId != KErrNotFound )
+            { 
+            RFile fileHandle;
+            CleanupClosePushL(fileHandle);
+            retVal = fileHandle.AdoptFromClient(aMessage, 1, 2);
+            if ( retVal == KErrNone )
+                {
+		         if (fileHandle.SubSessionHandle())
+			         { 
+	                
+		                TInt fileSize(0);
+		                fileHandle.Size(fileSize);
+		                
+		                if (fileSize > 0)
+		                {
+			               CSenClientMessage* pContext = iPendingTransactions[txnId];
+			                if (pContext)
+			                {
+			                	pContext->RequestFileHandle(fileHandle);		                
+			                }			                
+						    
+		                }
+		                else
+		                {
+		                	retVal = KErrArgument;		                	
+		                }
+		                
+	                }
+	                else
+	                {
+	                	retVal=KErrArgument; // NULL file handle;
+	         
+	                }
+               }
+            CleanupStack::Pop(&fileHandle);
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+
+    aMessage.Complete(retVal);
+    }
+TInt CSenClientSession::SendProgressToHostlet(const RMessage2& aMessage)
+    {
+    MSenRemoteHostlet* hostlet = iServiceSession->Hostlet();
+    if (!hostlet)
+        {
+        return KErrNotSupported;
+        }
+    TTransferProgress progressData;
+    TPckg<TTransferProgress> dataPtr = progressData;
+    TInt err = aMessage.Read(0, dataPtr);
+    if (err != KErrNone)
+        {
+        return err;
+        }
+    err = aMessage.GetDesLength(1);
+    if (err < 0)
+        {
+        return err;
+        }
+    HBufC8* msg = HBufC8::New(err);
+    if (!msg)
+        {
+        return KErrNoMemory;
+        }
+    TPtr8 msgPtr = msg->Des();
+    err = aMessage.Read(1, msgPtr);
+    if (err == KErrNone)
+        {
+        hostlet->TransferProgressForHostlet(progressData.iTxnId,
+                progressData.iIncoming, progressData.iSoap, *msg,
+                progressData.iProgress);
+        }
+    delete msg;
+    return err;
+    }
+void CSenClientSession::AddCredentialL( const RMessage2& aMessage )
+    {
+    TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        TPtrC8 patternAsXml;
+        TPtrC8 idpAsXml;
+        TPtrC8 credentialAsXml;
+        
+        retVal = pSenChunk->DescFromChunk(patternAsXml, 0);
+        if ( retVal == KErrNone )
+            {
+            retVal = pSenChunk->DescFromChunk(idpAsXml, 1);
+            if ( retVal == KErrNone )
+                {
+                retVal = pSenChunk->DescFromChunk(credentialAsXml, 2);
+                if ( retVal == KErrNone )
+                    {
+                    CSenWSDescription* pSD = CSenWSDescription::NewLC();
+                    pSD->SetReader(*iManager.XMLReader());
+                    pSD->ParseL(patternAsXml);
+
+                    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KNullDesC8);
+                    pIdP->SetReader(*iManager.XMLReader());
+                    pIdP->ParseL(idpAsXml);
+                    
+                    CSenInternalCredential* pCredential = CSenInternalCredential::NewLC();
+                    CSenParser* pParser = CSenParser::NewLC();
+                	pParser->ParseL(credentialAsXml, *pCredential);
+                	
+                	CSenElement& element = pSD->AsElement();
+                	RPointerArray<CSenElement>& elements = element.ElementsL();
+                	if ( elements.Count() > 0)
+                	    {
+                	    CSenCredentialIdentifier& identifier = pCredential->IdentifierL();	//codescannerwarnings
+                	    
+                        TInt elementCount(elements.Count());
+                        for (TInt i=0; i<elementCount; i++)
+                            {
+                            if ( ( elements[i]->LocalName() != KProviderPolicyLocalName ) &&
+                                 ( elements[i]->LocalName() != KServicePolicyLocalName ) )
+                                {
+                                if ( elements[i]->LocalName() != KSenFacet )
+                                    {
+                                    identifier.SetPropertyL(elements[i]->LocalName(),
+                                                            elements[i]->Content());
+                                    }
+                                }
+                            }
+                        RFacetArray facets;
+                        CleanupClosePushL(facets);
+                        pSD->FacetsL(facets);
+                            {
+                            TInt count(facets.Count());
+                            for (TInt i=0; i<count; i++)
+                                {
+                                identifier.SetFacetL(*facets[i]);
+                                }
+                            }
+                        facets.ResetAndDestroy();
+                        CleanupStack::PopAndDestroy(&facets);
+                	    }
+
+                	CSenCredentialIdentifier& identifier = pCredential->IdentifierL();
+                	TPtrC8 username;
+                	identifier.PropertyL(KSenIdpAuthzIDLocalname,username);
+                	TPtrC8 password;
+                    identifier.PropertyL(KSenIdpPasswordLocalname,password);
+                    TPtrC8 usernameIdp = pIdP->UserName();
+                    TPtrC8 passwordIdp = pIdP->Password();
+                    if (!username.Length())
+                        {
+                        if (usernameIdp.Length())
+                            {
+                            identifier.SetPropertyL(KSenIdpAuthzIDLocalname,usernameIdp);
+                            }
+                        if (!password.Length() && passwordIdp.Length())
+                            {
+                            identifier.SetPropertyL(KSenIdpPasswordLocalname, passwordIdp);
+                            }
+                        }
+                    else
+                        {
+                        if (usernameIdp.Length() && username.Compare(usernameIdp) == 0)
+                            {
+                            if (!password.Length() && passwordIdp.Length())
+                                {
+                                identifier.SetPropertyL(KSenIdpPasswordLocalname, passwordIdp);
+                                }
+                            }
+                        }
+                	
+                    if ( pSenChunk->ChunkHeader().DescriptorCount() == 4 )
+                        {
+                        TPtrC8 credentialPropertiesAsXml;
+                        retVal = pSenChunk->DescFromChunk(credentialPropertiesAsXml, 3);
+                        if ( retVal == KErrNone )
+                            {
+                            CSenCredentialProperties& properties = pCredential->PropertiesL();	//codescannerwarnings
+                            pParser->ParseL(credentialPropertiesAsXml, properties);
+                            }
+                        }
+                	CleanupStack::PopAndDestroy(pParser);
+                	
+                	// Following takes the ownership of pIdp and pCredential
+                    iManager.AddCredentialL(pIdP, pCredential, retVal);
+                    
+                  	RWSDescriptionArray aMatches;
+                    	iManager.ServiceDescriptionsL(aMatches,*pSD);
+               	CleanupClosePushL(aMatches);
+
+                    	for(TInt i = 0; i < aMatches.Count(); i++)
+                    	{
+                    		((CSenWebServiceSession*)aMatches[i])->AddCredentialObserverL(*pCredential);
+                    	}
+
+                     CleanupStack::PopAndDestroy(&aMatches);
+                    
+                    CleanupStack::Pop(pCredential);
+                    CleanupStack::Pop(pIdP);
+                                        
+                    CleanupStack::PopAndDestroy(pSD);
+                    }
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+        
+    aMessage.Complete(retVal);
+    }
+
+void CSenClientSession::CredentialsL( const RMessage2& aMessage )
+    {
+    _LIT8(KNoProperties, "-");
+    
+    TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        TPtrC8 patternAsXml;
+        TPtrC8 idpAsXml;
+        TPtrC8 credentialAsXml;
+        retVal = pSenChunk->DescFromChunk(patternAsXml, 0);
+        if ( retVal == KErrNone )
+            {
+            retVal = pSenChunk->DescFromChunk(idpAsXml, 1);
+            if ( retVal == KErrNone )
+                {
+                CSenWSDescription* pSD = CSenWSDescription::NewLC();
+                pSD->SetReader(*iManager.XMLReader());
+                pSD->ParseL(patternAsXml);
+
+                CSenIdentityProvider* pIdP = NULL;
+                if ( idpAsXml != KNullDesC8 )
+                    {
+                    pIdP = CSenIdentityProvider::NewLC(KNullDesC8);
+                    pIdP->SetReader(*iManager.XMLReader());
+                    pIdP->ParseL(idpAsXml);
+                    }
+                
+                RSenCredentialArray credentialsArray;
+                CleanupClosePushL(credentialsArray);
+                if ( pIdP )
+                    {
+                    retVal = iManager.CredentialsL(*pSD, *pIdP, credentialsArray);
+                    }
+                else
+                    {
+                    retVal = iManager.CredentialsL(*pSD, credentialsArray);
+                    }
+                    
+                if ( retVal == KErrNone )
+                    {
+                    TInt count = credentialsArray.Count();
+                    
+                    // Calculate required heap allocation size:
+                    TInt size(0);
+                    if ( count > 0 )
+                        {
+                        size += (count-1) * KNewline().Length();
+                        }
+                    size += count * KTab().Length();
+
+                    TInt leaveCode(KErrNone);
+                    TRAP( leaveCode, size += iManager.SizeOfCredentialsL(credentialsArray); )
+                    if ( leaveCode == KErrNone )
+                        {
+                        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Size of Credential(s) + delimiter(s): %d bytes"), size));
+
+                        // Adjust RChunk to accomodate found Credentials using known handle
+                        TPtr8* pCredentials = NULL;
+                        retVal = pSenChunk->AllocDescToChunk(size, pCredentials); 
+
+                        if(retVal==KErrNone && pCredentials)
+                            {
+                            CBufFlat* pBuf = NULL;
+                            if(count>0)
+                                {
+                                pBuf = CBufFlat::NewL(KFlatBufSize);
+                                CleanupStack::PushL(pBuf);
+                                RBufWriteStream bufWs(*pBuf);
+                                CleanupClosePushL(bufWs);
+                                credentialsArray[0]->WriteAsXMLToL(bufWs);
+                                bufWs.WriteL(KTab);
+                                if ( credentialsArray[0]->HasProperties() )
+                                    {
+                                    credentialsArray[0]->PropertiesL().WriteAsXMLToL(bufWs);	//codescannerwarnings
+                                    }
+                                else
+                                    {
+                                    bufWs.WriteL(KNoProperties);
+                                    }
+                                
+                                // Add this Credential as XML into the "big heap buffer":
+                                TPtr8 p8 = pBuf->Ptr(0);
+                                
+                                TInt p8size = p8.Length();
+                                
+                                pCredentials->Append(p8); 
+                                // Destroy the temporary, flat stream buffer
+                                CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+                                pBuf = NULL;
+                                }
+                            for(TInt x=1; x<count; x++)
+                                {
+                                // Add delimiter
+                                pCredentials->Append(KNewline); 
+
+                                pBuf = CBufFlat::NewL(KFlatBufSize);
+                                CleanupStack::PushL(pBuf);
+                                RBufWriteStream bufWs(*pBuf);
+                                CleanupClosePushL(bufWs);
+                                credentialsArray[x]->WriteAsXMLToL(bufWs);
+                                bufWs.WriteL(KTab);
+                                if ( credentialsArray[x]->HasProperties() )
+                                    {
+                                    credentialsArray[x]->PropertiesL().WriteAsXMLToL(bufWs);	//codescannerwarnings
+                                    }
+                                else
+                                    {
+                                    bufWs.WriteL(KNoProperties);
+                                    }
+                                // Add this Credential as XML into the "big heap buffer":
+                                TPtr8 p8 = pBuf->Ptr(0);
+                                pCredentials->Append(p8); 
+                                CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+                                pBuf = NULL;
+                                }
+                            CSLOG_L(iConnectionID,KMaxLogLevel ,"- Requested Credentials:");
+                            CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*pCredentials));
+                            }
+#ifdef _SENDEBUG
+                        else
+                            {
+                            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- AllocDescToRMsgL failed: %d"), retVal));
+                            }
+#endif // _SENDEBUG
+                        }
+                    }
+                    
+                CleanupStack::PopAndDestroy(&credentialsArray); // Close() is enough
+                if ( idpAsXml != KNullDesC8 )
+                    {
+                    CleanupStack::PopAndDestroy(pIdP);
+                    }
+                CleanupStack::PopAndDestroy(pSD);
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+        
+    aMessage.Complete(retVal);    
+    }
+
+void CSenClientSession::RemoveCredentialsL( const RMessage2& aMessage )
+    {
+    TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        TPtrC8 patternAsXml;
+        TPtrC8 idpAsXml;
+        TPtrC8 credentialAsXml;
+        retVal = pSenChunk->DescFromChunk(patternAsXml, 0);
+        if ( retVal == KErrNone )
+            {
+            retVal = pSenChunk->DescFromChunk(idpAsXml, 1);
+            if ( retVal == KErrNone )
+                {
+                CSenWSDescription* pSD(NULL);
+                if (patternAsXml.Length())
+                    {
+                    pSD = CSenWSDescription::NewLC();
+                    pSD->SetReader(*iManager.XMLReader());
+                    pSD->ParseL(patternAsXml);
+                    }
+                
+                CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KNullDesC8);
+                pIdP->SetReader(*iManager.XMLReader());
+                pIdP->ParseL(idpAsXml);
+                
+                if(pIdP->FrameworkId() == KDefaultOviFrameworkID && !IsTrustedClient(aMessage))
+                    {
+                    retVal = KErrPermissionDenied;
+                    }
+                else
+                    {
+                    if (pSD)
+                        {
+                        retVal = iManager.RemoveCredentialsL(*pSD, *pIdP);
+                        }
+                    else
+                        {
+                        retVal = iManager.RemoveCredentialsL(pIdP->ProviderID());
+                        }
+                    }
+                
+                CleanupStack::PopAndDestroy(pIdP);
+                if (pSD)
+                    {
+                    CleanupStack::PopAndDestroy(pSD);
+                    }
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+        
+    aMessage.Complete(retVal);    
+    }
+
+void CSenClientSession::ConnectionID(const RMessage2& aMessage)
+    {
+    if ( iConnectionID == KErrNotFound )
+        {
+        iConnectionID = iManager.NextConnectionID();
+       // iSecureId = aMessage.SecureId();
+
+        /*
+        iServerContext.OpenApplicationContextL(iSecureId);
+        CSenApplicationContext& appCtx = iServerContext.OpenApplicationContextL( aMessage.SecureId() );
+        appCtx.OpenClientContextL( iConnectionID );
+        */
+        }
+        iSecureId = aMessage.SecureId();
+        iVendorId = aMessage.VendorId();
+    aMessage.Complete(iConnectionID);
+    }
+    
+void CSenClientSession::ConnectionIdentityProviderL(const RMessage2& aMessage)
+    {
+    TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        CSenWSDescription* pDesc = CSenWSDescription::NewLC();
+        CBufFlat* pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs); // push
+        iServiceSession->AsServiceDescription().WriteAsXMLToL(bufWs);
+        
+        pDesc->SetReader(*iManager.XMLReader());
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, pDesc->ParseL(pBuf->Ptr(0)));
+        if ( leaveCode == KErrNone )
+            {
+            CleanupStack::PopAndDestroy(&bufWs);
+            CleanupStack::PopAndDestroy(pBuf);
+            MSenElement& xmlSdAsElement = pDesc->AsElement();
+            MSenElement* pElement = xmlSdAsElement.Element(KProviderIdLocalName);
+            if ( pElement )
+                {
+                TPtrC8 providerId = pElement->Content();
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pIdp = ((MSenCoreServiceManager&)iManager).IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                if ( pIdp )
+                    {
+                    HBufC8* pIdpAsXml = pIdp->AsXmlL();
+                    CleanupStack::PushL(pIdpAsXml);
+                    retVal = pSenChunk->DescToChunk(*pIdpAsXml);
+                    CleanupStack::PopAndDestroy(pIdpAsXml);
+                    }
+                else
+                    {
+                    retVal = KErrNotFound;
+                    }
+                }
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(&bufWs);
+            CleanupStack::PopAndDestroy(pBuf);
+            }
+        CleanupStack::PopAndDestroy(pDesc);
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    aMessage.Complete(retVal);
+    }
+/*    
+CSenIdentityProvider* CSenClientSession::ConnectionIdentityProviderL()
+    {
+    CSenIdentityProvider* pIdp = NULL;
+    
+    if ( iServiceSession )
+        {
+        CSenWSDescription* pDesc = CSenWSDescription::NewLC();
+        CBufFlat* pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs); // push
+        iServiceSession->AsServiceDescription().WriteAsXMLToL(bufWs);
+        
+        pDesc->SetReader(*iManager.XMLReader());
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, pDesc->ParseL(pBuf->Ptr(0)));
+        if ( leaveCode == KErrNone )
+            {
+            CleanupStack::PopAndDestroy(&bufWs);
+            CleanupStack::PopAndDestroy(pBuf);
+            MSenElement& xmlSdAsElement = pDesc->AsElement();
+            MSenElement* pElement = xmlSdAsElement.Element(KProviderIdLocalName);
+            if ( pElement )
+                {
+                TPtrC8 providerId = pElement->Content();
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pIdp = ((MSenCoreServiceManager&)iManager).IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                }
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(&bufWs);
+            CleanupStack::PopAndDestroy(pBuf);
+            }
+        CleanupStack::PopAndDestroy(pDesc);
+        }
+    
+    return pIdp;
+    }
+*/
+void CSenClientSession::DataTrafficDetails(const RMessage2& aMessage) 
+	{
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::DataTrafficDetails");
+	TSenDataTrafficDetails trafficDetails; 
+	TBool reset = aMessage.Int1();
+ 	if(reset == 1)
+		{
+		iDetails.iTotalBytesSent = 0;
+		iDetails.iTotalBytesRecieved = 0; 
+		}
+	trafficDetails = iDetails;
+	TPtr8 trafficDetailsDesc(reinterpret_cast<TUint8*>(&trafficDetails),sizeof(trafficDetails),
+        					 sizeof(trafficDetails));
+	TInt retVal(-1);     				
+	TRAP(retVal,aMessage.WriteL(0,trafficDetailsDesc));
+	CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Bytes send  : '%d')."), trafficDetails.iTotalBytesSent ));
+	CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Bytes Received : '%d' ."), trafficDetails.iTotalBytesRecieved ));
+    aMessage.Complete(retVal);
+	}
+void CSenClientSession::CancelRequestL(const RMessage2& aMessage)
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CancelRequestL");
+    
+    TInt transactionIDtoCancel = aMessage.Int0();
+
+    RTransactionIdArray& txnIds = TxnIds();
+
+    TInt pendingCount(txnIds.Count());
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d txnIds(s) pending."), pendingCount));
+    for(TInt i=pendingCount-1; i>=0; i--)
+        {
+        if ( *txnIds[i] == transactionIDtoCancel )
+            {
+            TInt* pTxnId = txnIds[i];
+            TInt cancelledTxnId(*pTxnId);
+            txnIds.Remove(i);
+            delete pTxnId;
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Now processing txn with id %d"), cancelledTxnId));
+
+
+            // Attempt to cancel the actual activity on the transport layer.
+            // Note that even if transport will not cancel this transaction,
+            // the response from the transport (later on) won't anymore be 
+            // delivered to consumer, since this RMessage2 is removed from 
+            // iMessageMap few lines below. This means, that from the WS-stack
+            // client point-of-view, cancel works and no "stray" responses
+            // will follow (eventhough some data is received from transport 
+            // stack).
+            MSenTransport* pTransport = ipTransport;
+            if(iServiceSession)
+                {
+                CSLOG_L(iConnectionID,KNormalLogLevel ,"-- has session.");
+                MSenTransport* pSessionTransport = iServiceSession->Transport();
+                if(pSessionTransport)
+                    {
+                    CSLOG_L(iConnectionID,KNormalLogLevel ,"--- session has transport.");
+                    // If session owns a transport, always utilize that one
+                    pTransport = pSessionTransport;
+                    }
+                }
+            // If session does not own a transport, check if this remote consumer does..
+
+            if(pTransport)
+                {
+                CSLOG_L(iConnectionID,KMinLogLevel ,"---- About to call CancelTransaction");
+                TInt retCode = pTransport->CancelTransaction(cancelledTxnId);
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Transport's  CancelTransaction(%d) returned: %d"), cancelledTxnId, retCode));
+                retCode = 0; // not used in release builds atm. 
+                }
+                
+            break;
+            }
+        }
+        
+    RTransactionArray& txnMsgs = Transactions();
+    pendingCount = txnMsgs.Count();
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d RMessage2(s) pending."), pendingCount));
+    TInt transactionID;
+    TInt pendingTxnId;
+    for(TInt t=pendingCount-1; t>=0; t--)
+        {
+        if(txnMsgs[t])
+            {
+            CSenClientMessage* pClientMessage = Transactions()[t];
+            pendingTxnId = pClientMessage->ChunkHeader().PendingTransactionId();
+            transactionID = pClientMessage->ChunkHeader().TransactionId();
+
+            if ( ( pendingTxnId && ( pendingTxnId == transactionIDtoCancel ) ) ||
+                 ( !pendingTxnId && ( transactionID == transactionIDtoCancel ) ) )
+                {
+                RMessage2& message = pClientMessage->RMessage();
+                
+                pendingTxnId = pClientMessage->ChunkHeader().PendingTransactionId();
+                if (pendingTxnId)
+                    {
+                    transactionID = pendingTxnId;
+                    pClientMessage->ChunkHeader().SetPendingTransactionId(0);
+                    pClientMessage->ChunkHeader().SetTransactionId(pendingTxnId);
+                    }
+                else
+                    {
+                    transactionID = pClientMessage->ChunkHeader().TransactionId();
+                    }
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Completing Txn ID: %d"),transactionID)); 
+                
+                TPtr8 ptr(reinterpret_cast<TUint8*>(&transactionID), 
+                          sizeof(transactionID), 
+                          sizeof(transactionID)); 
+
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, message.WriteL(1, ptr)); //IPC V2
+                if(leaveCode!=KErrNone)
+                    {
+                    message.Complete(ESenInternalError);
+                    CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - TxnId");
+                    }
+                else
+                    {
+                    message.Complete(ESenServRequestCancelled);
+                    CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenServRequestCancelled - TxnId");
+                    }
+
+                delete pClientMessage;
+                txnMsgs.Remove(t);
+                
+                break;
+                }
+            }
+        }
+        
+    aMessage.Complete(KErrNone);
+    }
+
+void CSenClientSession::PanicClient( const RMessagePtr2& aMessage, TInt aPanic ) const
+    {
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::PanicClient( %d )"), aPanic));
+    // Note: this panics the client thread, not server
+    aMessage.Panic(KSenServiceManagerPanic, aPanic) ; //IPC V2 
+    }
+
+RFileLogger* CSenClientSession::Log() const
+    {
+    return iManager.Log();
+    }
+
+TInt CSenClientSession::SetSessionL(MSenRemoteServiceSession& aServiceSession)
+    {
+    iServiceSession = &aServiceSession; // not owned
+    SetStatusL(iServiceSession->StatusL());
+    return KErrNone;
+    }
+
+
+TInt CSenClientSession::HandleMessageL( HBufC8* apMessage,
+                                        const TInt aTxnId,
+                                        MSenProperties* aResponseTransportProperties )
+    {
+    iReauthResendNeeded = EFalse ; //resetting the flag if already true
+    if ( !apMessage )
+        {
+        apMessage = KNullDesC8().AllocL();
+        }
+    CleanupStack::PushL(apMessage);        
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::HandleMessageL");
+    
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Txn ID: %d, message length: %d bytes"),  aTxnId, apMessage->Length() ));
+    CSLOG_ALL(iConnectionID, KMaxLogLevel ,( *apMessage ));
+
+    if( iAllowShowDialogCount>0 )
+        {
+        iAllowShowDialogCount--;
+        }
+
+    if( iAllowShowDialogCount==0 )
+        {
+        iManager.SetShowPasswordDialog(EFalse); // turn the flag down
+        }
+
+    TInt retCode(KErrNone);
+    TInt index = TransactionIndex(aTxnId);
+    if(index != KErrNotFound)
+        {
+        RTransactionArray& transactions = Transactions();   
+        CSenClientMessage* pClientMessage = transactions[index];
+        RMessage2& message = pClientMessage->RMessage();
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::HandleMessageL - RMessage2(%d)"),  message.Handle() ));
+
+        // Remove the txnId from the list of pending ones:
+        TInt transactionIdCount(TxnIds().Count());
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Number of pending TxnIds: %d"), transactionIdCount));
+        
+        for(TInt tx=0; tx<transactionIdCount; tx++)
+            {
+            TInt* pTxnId = TxnIds()[tx];
+            if(*pTxnId == aTxnId)
+                {
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Pending txnID(%d) found from index %d. Removing & deleting it."), *pTxnId,tx ));
+                TxnIds().Remove(tx);
+                delete pTxnId;
+                break;
+                }
+            }
+
+        TInt transactionID(aTxnId);
+        TInt pendingTxnId = pClientMessage->ChunkHeader().PendingTransactionId();
+        if(pendingTxnId)
+            {
+            transactionID = pendingTxnId;
+            pClientMessage->ChunkHeader().SetPendingTransactionId(0);
+            pClientMessage->ChunkHeader().SetTransactionId(pendingTxnId);
+            }
+        
+        TPtr8 ptr(reinterpret_cast<TUint8*>(&transactionID), 
+                  sizeof(transactionID), 
+                  sizeof(transactionID)); 
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, message.WriteL(1, ptr)); //IPC V2
+        if(leaveCode!=KErrNone)
+            {
+            message.Complete(ESenInternalError);
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - TxnId");
+            retCode = leaveCode;
+            }
+        else
+            {
+            // OK!
+            if( pClientMessage->ChunkHeader().MessageDirection() == MSenMessage::EOutbound )
+                {
+                // SetResponseL and SetRequestL to CSenChunk (or it's subclass)
+                // Methods should always check that TP is set to correct when MSG
+                // direction changes; for e.g. when copying response, the TP type
+                // MUST be set to ENotInUse, or SC will fail(!). Furthermore, the
+                // SetResponseL method could ignore message data (and not copy it),
+                // if direction is already inbound, etc. And, methods should check
+                // the PTR so that copy-to-self is ignored/skipped/avoided. Finally,
+                // the methods SHOULD support DOUBLE ENDED chunks, so that descs 
+                // could be nicely re-allocated separately (MSG first, TP by some
+                // other component etc...)
+                pClientMessage->ChunkHeader().SetMessageDirection( MSenMessage::EInbound ); 
+                HBufC8* pSerializedProperties = NULL;
+                if( aResponseTransportProperties )
+                    {
+                    pClientMessage->ChunkHeader().SetPropertiesType(aResponseTransportProperties->PropertiesClassType());
+                    pSerializedProperties = aResponseTransportProperties->AsUtf8LC();
+                    retCode = pClientMessage->DescsToChunk(*apMessage, *pSerializedProperties);
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- DescsToChunk return code: %d"), retCode));
+                    CleanupStack::PopAndDestroy(pSerializedProperties);
+                    }
+                else
+                    {
+                    pClientMessage->ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+                    retCode = pClientMessage->DescToChunk(*apMessage);
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- DescToChunk return code: %d"), retCode));
+                    }
+                }
+            else
+                {
+                CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Reply message (%d) direction is already MSenMessage::EInbound, and data is already copied to chunk."), aTxnId));
+                apMessage = NULL; 
+                }
+
+            if ( retCode == KErrNone && leaveCode != KErrNone )
+                {
+                retCode = leaveCode;
+                }
+            if( retCode != KErrNone)
+                {
+                message.Complete(ESenInternalError);
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - HandleBase");
+                retCode = leaveCode;
+                }
+            else // OK!
+                {   
+                message.Complete(ESenServRequestResponsed);
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenServRequestResponsed");
+                }
+            }
+        transactions.Remove(index);
+        delete pClientMessage;
+        }
+    else // pending RMessage2 was not found
+        {   
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- No pending RMessage2 found - cancelled?");
+        retCode = KErrNotFound; 
+        }
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::HandleMessageL returns: %d"), retCode));
+
+    if( apMessage )
+        {
+        CleanupStack::PopAndDestroy(apMessage);        
+        }
+    else
+        {
+        CleanupStack::Pop(); // apMessage
+        }
+
+    return retCode;
+    }
+
+TInt CSenClientSession::HandleErrorL( HBufC8* apError,
+                                      const TInt aErrorCode,
+                                      const TInt aTxnId,
+                                      MSenProperties* aResponseTransportProperties )
+    {
+    if ( !apError )
+        {
+        apError = KNullDesC8().AllocL();
+        }
+    CleanupStack::PushL(apError);        
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::HandleErrorL");
+    
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Txn ID: %d, error (%d) length: %d bytes"),  aTxnId, aErrorCode, apError->Length() ));
+
+    if(iAllowShowDialogCount>0)
+        {
+        iAllowShowDialogCount--;
+        }
+
+    if(iAllowShowDialogCount==0)
+        {
+        iManager.SetShowPasswordDialog(EFalse); // turn the flag down
+        }
+
+    TInt retCode(KErrNone);
+    TInt index = TransactionIndex(aTxnId);
+    if(index != KErrNotFound)
+        {
+        RTransactionArray& transactions = Transactions();   
+        CSenClientMessage* pClientMessage = transactions[index];
+        RMessage2& message = pClientMessage->RMessage();
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::HandleErrorL - RMessage2(%d)"),  message.Handle() ));
+
+        // Remove the txnId from the list of pending ones:
+        TInt transactionIdCount(TxnIds().Count());
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Number of pending TxnIds: %d"), transactionIdCount));
+        for(TInt tx=0; tx<transactionIdCount; tx++)
+            {
+            TInt* pTxnId = TxnIds()[tx];
+            if(*pTxnId == aTxnId)
+                {
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Pending txnID(%d) found from index %d. Removing & deleting it."), *pTxnId, tx));
+                TxnIds().Remove(tx);
+                delete pTxnId;
+                break;
+                }
+            }
+
+        TInt errorCode(aErrorCode);
+        TPtr8 ptrErr(reinterpret_cast<TUint8*>(&errorCode), 
+                     sizeof(errorCode), 
+                     sizeof(errorCode)); 
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, message.WriteL(0, ptrErr)); //IPC V2
+        if(leaveCode!=KErrNone)
+            {
+            message.Complete(ESenInternalError);
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError");
+            retCode = leaveCode;
+            }
+        else // no internal error in writing error code
+            {
+            // Write back the transaction ID, so that client knows which
+            // request was responded (use slot 1, slot 0 is reserved for 
+            // errorcodes of handle error atm..)
+            TInt transactionID(aTxnId);
+            TInt pendingTxnId = pClientMessage->ChunkHeader().PendingTransactionId();
+            if (pendingTxnId)
+                {
+                transactionID = pendingTxnId;
+                pClientMessage->ChunkHeader().SetPendingTransactionId(0);
+                pClientMessage->ChunkHeader().SetTransactionId(pendingTxnId);
+                }
+                
+            TPtr8 ptr(reinterpret_cast<TUint8*>(&transactionID), 
+                      sizeof(transactionID), 
+                      sizeof(transactionID)); 
+
+            TRAP(leaveCode, message.WriteL(1, ptr)); //IPC V2
+            if(leaveCode!=KErrNone)
+                {
+                message.Complete(ESenInternalError);
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError");
+                retCode = leaveCode;
+                }
+            else // no internal error in writing error message
+                {
+                switch(aErrorCode)
+                    {
+                    case KErrSenReinitRequired: // ESenReAuthAndResendNeeded
+                        {
+                        pClientMessage->ChunkHeader().SetMessageDirection( MSenMessage::EOutbound );
+                        iReauthResendNeeded = ETrue ;
+                        message.Complete(ESenReAuthAndResendNeeded);
+                        CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenReAuthAndResendNeeded");
+                        }
+                    break;
+                    case KErrSenResendRequired: // ESenResendNeeded
+                        {
+                        pClientMessage->ChunkHeader().SetMessageDirection( MSenMessage::EOutbound );
+                        iReauthResendNeeded = EFalse ;
+                        message.Complete(ESenResendNeeded);
+                        CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenResendNeeded");
+                        }
+                    break;
+                    default: // almost always: ESenServRequestResponsed 
+                        {
+                        iReauthResendNeeded = EFalse ;
+                        // Some other error, which can freely be propagated back to service consumer
+                        
+                        if( pClientMessage->ChunkHeader().MessageDirection() == MSenMessage::EOutbound )
+                            {
+                            // SetResponseL and SetRequestL to CSenChunk (or it's subclass)
+                            // Methods should always check that TP is set to correct when MSG
+                            // direction changes; for e.g. when copying response, the TP type
+                            // MUST be set to ENotInUse, or SC will fail(!). Furthermore, the
+                            // SetResponseL method could ignore message data (and not copy it),
+                            // if direction is already inbound, etc. And, methods should check
+                            // the PTR so that copy-to-self is ignored/skipped/avoided. Finally,
+                            // the methods SHOULD support DOUBLE ENDED chunks, so that descs 
+                            // could be nicely re-allocated separately (MSG first, TP by some
+                            // other component etc...)
+                            pClientMessage->ChunkHeader().SetMessageDirection( MSenMessage::EInbound ); 
+                            HBufC8* pSerializedProperties = NULL;
+                            if( aResponseTransportProperties )
+                                {
+                                pClientMessage->ChunkHeader().SetPropertiesType(aResponseTransportProperties->PropertiesClassType());
+                                pSerializedProperties = aResponseTransportProperties->AsUtf8LC();
+                                retCode = pClientMessage->DescsToChunk(*apError, *pSerializedProperties);
+                                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- DescsToChunk returned: %d"), retCode));
+                                CleanupStack::PopAndDestroy(pSerializedProperties);
+                                }
+                            else
+                                {
+                                pClientMessage->ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+                                retCode = pClientMessage->DescToChunk(*apError);
+                                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- DescToChunk returned: %d"), retCode));
+                                }
+                            }
+                        else
+                            {
+                            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Error message (%d) direction is already MSenMessage::EInbound, and data is already copied to chunk."), aTxnId));
+                            apError = NULL; // will NOT leak, since the pointer was pointing to global chunk!
+                            }
+                            
+                        if ( retCode == KErrNone && leaveCode != KErrNone )
+                            {
+                            retCode = leaveCode;
+                            }
+    
+                        if( retCode!=KErrNone )
+                            {
+                            message.Complete(ESenInternalError);
+                            CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - HandleBase");
+                            retCode = leaveCode;
+                            }
+                        else // OK!
+                            {   
+                            message.Complete(ESenServRequestResponsed);
+                            CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenServRequestResponsed");
+                            }
+                        }
+                    } // switch
+                } // no internal error in writing error message
+            } // no internal error in writing error code
+            
+        transactions.Remove(index);
+        delete pClientMessage;
+        }
+    else // pending RMessage2 was not found
+        {   
+        CSLOG_L(iConnectionID,KMinLogLevel ,"- No pending RMessage2 found - cancelled?");
+        retCode = KErrNotFound; 
+        }
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("CSenClientSession::HandleErrorL returns: %d"), retCode));
+
+    
+    if( apError )
+        {
+        CleanupStack::PopAndDestroy(apError);    
+        }
+    else
+        {
+        CleanupStack::Pop(); // apError
+        }
+    
+    return retCode;
+    }
+
+void CSenClientSession::SetStatusL(const TInt aStatus)
+    {
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::SetStatusL(%d)"), aStatus));
+    iStatus = aStatus;
+
+    // Currently: publish ONLY "credentials expired" status.
+    // One MUST NOT publish "credentials ready" status,
+    // since publish&subscibe has higher priority
+    // than "Initialize" IPC op that is fied by SC constructor
+    // and this causes pre-mature SendL (internal boolean of SC
+    // impl about "readyness" is still false (=> this could be
+    // fixed, but it is better to wait for Async IPC "Initialize"
+    // to complete.
+    if( aStatus != KSenConnectionStatusReady )
+        {
+        // It is ok to "push" (==publish) "credentials expired" status
+        RProperty::Set(iClientSecureID,(KSenRPropertyKeyBaseNumber+iConnectionID), aStatus);
+        }
+    }
+
+void CSenClientSession::FileProgress( TInt aTxnId, TBool aIsIncoming, TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress ) 
+    {
+    CSenClientMessage* pTransaction = NULL;
+    
+    TInt index = TransactionIndex(aTxnId);
+    if( index > KErrNotFound )
+        {
+        RTransactionArray& transactions = Transactions();
+        if( index < transactions.Count() )
+            {
+            pTransaction = transactions[index];
+            }
+        }
+    
+    if( pTransaction ) ////// NOT needed  ( note about this code & TransferProgressForHostlet(): -> hostlet connection's client sessions does not have transaction in here..
+        {
+        if( !aIsIncoming && pTransaction->ChunkHeader().MessageDirection() != MSenMessage::EOutbound )
+            {
+            // the transaction has ALREADY been completed, so there is no need to inform about "file progress"
+            return;
+            }
+        } // end of 'if( pTransaction )'
+#ifdef _SENDEBUG        
+        else
+            {
+        	CSLOG_FORMAT(( iConnectionID, KMinLogLevel, _L8("CSenClientSession::FileProgress() - ChunkByTxnIdL(%d) returned NULL"), aTxnId ));
+            }
+#endif // _SENDEBUG
+
+    TRAP_IGNORE ( DeliverProgressToClient( aTxnId, aIsIncoming, aIsSoap, aSoapOrCid, aProgress ); ) // should NOT leave!
+    }
+void CSenClientSession::DeliverProgressToClient( TInt aTxnId, TBool aIsIncoming, TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress ) 
+    {
+    // NOTE: for OUTGOING messages with BLOBs (file attachements etc), aIncoming is EFalse, and aSoapOrCid is ALWAYS A CID(!)
+	CSLOG_L( iConnectionID,KMinLogLevel,"" );
+	CSLOG_FORMAT(( iConnectionID, KMinLogLevel, _L8("CSenClientSession::DeliverProgressToClient(txn: %d, progress: %d, incoming: %d, soap: %d) - begin"), aTxnId, aProgress, aIsIncoming, aIsSoap ));
+	CSLOG_L( iConnectionID,KMinLogLevel, "- SOAP/CID:" );
+    CSLOG_ALL( iConnectionID, KMinLogLevel, (aSoapOrCid ));    
+	
+#ifndef RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS
+
+    // THE "LEGACY CODE": START =>
+	CSLOG_L( iConnectionID, KMinLogLevel,"CSenClientSession::DeliverProgressToClient() - RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == FALSE" );
+    if (iConnectionSession.Handle())
+        {
+        iConnectionSession.SendFileProgress( aTxnId, aIsIncoming, aIsSoap, aSoapOrCid, aProgress );
+        }
+        return;
+    // <= THE "LEGACY CODE": END
+    
+#else // == RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE 
+
+	CSLOG_L( iConnectionID, KMinLogLevel, "CSenClientSession::DeliverProgressToClient() - RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE" );
+	
+	// CHECK IF CODE WAS COMPILED WITH "MIXED" MODE (conn agent for SOAP progress, pub&sub for outgoing BLOB progress):
+	 
+  #ifdef RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+    // Use connection agent for any SOAP progress signalizing:
+	CSLOG_L( iConnectionID, KMinLogLevel, "CSenClientSession::DeliverProgressToClient() - RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == TRUE" );
+	if( aIsSoap )
+	    {
+    	CSLOG_L( iConnectionID, KMinLogLevel,"- aIsSoap == TRUE => try to use connection agent for SOAP progress.." );
+        if ( iConnectionSession.Handle() )
+            {
+        	CSLOG_L( iConnectionID, KMinLogLevel,"- iConnectionSession.Handle() is valid [OK]" );
+            iConnectionSession.SendFileProgress( aTxnId, aIsIncoming, aIsSoap, aSoapOrCid, aProgress );
+            return;
+            }
+  #ifdef _SENDEBUG            
+        else
+            {
+        	CSLOG_L( iConnectionID, KMinLogLevel,"DeliverProgressToClient(): - iConnectionSession.Handle() is _invalid_ [NOT OK]: cannot deliver SOAP progress" );
+            }
+  #endif // _SENDEBUG            
+	    } // end of: if ( aIsSoap )
+
+  #ifdef _SENDEBUG            
+    else
+        {
+        // the progress is not about SOAP
+    	CSLOG_L( iConnectionID, KMinLogLevel,"DeliverProgressToClient(): - aIsSoap == FALSE => Use pub&sub for BLOB related progress signalizing." );
+        }
+  #endif // _SENDEBUG            
+        
+  #endif // RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS END
+	
+    // publish the new value from Serene Core server to the client (SC impl) 
+    
+    TInt cid(0);
+    TInt cid2( KErrNotFound );
+    
+    TBool hasCidPostfix( EFalse );
+    TInt lexingError(KErrNone);
+    if ( !aIsSoap ) // NOTE: WHEN RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == TRUE, aIsSoap is ALWAYS FALSE when execution gets to this point(!)
+        {
+        // Current implementation "trusts" that CID is a numeric value!
+        TPtrC8 numericCid( aSoapOrCid );
+        
+        // Look for "@example.org" and rip if off, if found
+        TInt length = aSoapOrCid.Length();
+        if( length )
+            {
+            TInt index = aSoapOrCid.Find( KSenCidPostfix );
+            if( index != KErrNotFound )
+                {
+                hasCidPostfix = ETrue;
+                numericCid.Set( aSoapOrCid.Left( index ) ); // take all the data prior the @ -char..
+                CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("CSenClientSession::DeliverProgressToClient() - numeric cid: '%S', hasCidPostfix = ETrue"), &numericCid ));
+                }
+                
+            }
+        TPtrC8 numericCid2(KNullDesC8);
+        if ( numericCid.Length() > KSenMaxCidLength )
+            {
+            numericCid2.Set(numericCid.Right(KSenMaxCidLength));
+            numericCid.Set(numericCid.Left(KSenMaxCidLength-1));
+            }
+        TLex8 lex( numericCid );
+        lexingError = lex.Val( cid );
+        if( !lexingError && numericCid2.Length() )
+            {
+            TLex8 lex2( numericCid2 );
+            lexingError = lex2.Val( cid2 );
+            }
+            
+        if( !lexingError )
+            {
+            CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8(" - cid: '%S', cid2: '%S'"), &numericCid, &numericCid2 ));
+            TFileOutgoingTransferProgress progress( aTxnId, aIsIncoming, aProgress, hasCidPostfix, cid, cid2 ); // note(!): ELeave is NOT used here, instead KErrNoMemory is returned if this method fails!
+            TPckgBuf<TFileOutgoingTransferProgressBase> buffer( progress );
+            RProperty::Set( KSenInterfaceUidFilesObserver, iConnectionID, buffer ); // this is serializing the property, so it is ok to let the T-classes to go out of scope
+            }
+        else
+            {
+            CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("CSenClientSession::DeliverProgressToClient() - TLex:Val('cid') returned error: %d, cid: '%S', cid2: '%S'"), lexingError, &numericCid, &numericCid2 ));
+#ifdef RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+        	CSLOG_L( iConnectionID, KMinLogLevel, "=> Going to UTILIZE Connection Agent for non-numeric CIDs!" );
+            if (iConnectionSession.Handle())
+                {
+                iConnectionSession.SendFileProgress( aTxnId, aIsIncoming, aIsSoap, aSoapOrCid, aProgress );
+                }
+    
+#endif // RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+            }
+        } // end of if ( !aIsSoap )
+#ifdef _SENDEBUG        
+    else
+        {
+        // this callback is carrying a SOAP (should not, that happens only with "incoming" file progress callbacks, actually, not when sending a msg OUT
+        CSLOG_L( iConnectionID, KMinLogLevel, "CSenClientSession::DeliverProgressToClient() - SOAP of this 'progress' discarded (no ConnAgent session available)" );
+        }
+#endif // _SENDEBUG
+
+
+#endif // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS  
+
+    // The end of the method
+	//CSLOG_L( iConnectionID,KMinLogLevel,"CSenClientSession::DeliverProgressToClient() - end" );
+    }
+
+TBool CSenClientSession::OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId)
+    {
+    if ( iConnectionSession.Handle() )
+        {
+        return iConnectionSession.OnGetBrandIdL( aBrandIdListAsXmlSnippet, aSelectedBrandId );
+        }
+    else
+        {
+        return EFalse;
+        }
+		}       
+   
+void CSenClientSession::TransferProgressForHostlet( TInt aTxnId, TBool aIsIncoming, TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress)
+    {
+#ifndef RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC    
+    TRAP_IGNORE ( DeliverProgressToClient( aTxnId, aIsIncoming, aIsSoap, aSoapOrCid, aProgress ); ) // should NOT leave!
+#else // RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC == TRUE
+    CSLOG_L( iConnectionID, KMinLogLevel, "CSenClientSession::TransferProgressForHostlet: RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC == ETrue" );
+#endif // end of RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC    
+    }
+    
+void CSenClientSession::SetDataTrafficDetails( TSenDataTrafficDetails& aDetails ) 	
+	{
+	CSLOG_L( iConnectionID, KSenCoreServiceManagerLogLevel, "CSenClientSession::SetDataTrafficDetails");
+	iDetails += aDetails;
+	}
+
+/**
+* SessionValidity method checks the validity of this session
+* @return KErrNone if session is ready and its credentials (if any) are valid
+*         KErrSenNotInitialized if session is not yet set (iServiceSession is NULL)
+*         KErrConnectionInitializing if session's state  is new 
+*                                    (iStatus is KSenConnectionStatusNew)
+*         KSenConnectionStatusExpired if session's state is initializing 
+*                                    (iStatus is KSenConnectionStatusNew)
+*         KSenConnectionStatusExpired if session's state is expired 
+*                                    (iStatus is KSenConnectionStatusExpired)
+*/
+TInt CSenClientSession::SessionValidity()
+    {
+    TInt errorCode(KErrNone);
+
+    if( !iServiceSession )
+        {
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SessionValidity:");
+        CSLOG_L(iConnectionID,KMinLogLevel ," - KErrSenNotInitialized");
+        errorCode = KErrSenNotInitialized;
+        }
+    else if (iStatus == KSenConnectionStatusNew )
+        {
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SessionValidity:");
+        CSLOG_L(iConnectionID,KMinLogLevel ," - KErrConnectionInitializing");
+        errorCode = KErrConnectionInitializing;
+        }
+    else if(iStatus == KSenConnectionStatusExpired)
+        {
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SessionValidity:");
+        CSLOG_L(iConnectionID,KMinLogLevel ," - KErrConnectionExpired");
+        errorCode = KErrConnectionExpired;
+        }
+    else 
+        {
+        TBool sessionReady(EFalse);
+        TInt leaveCode(KErrNone);
+        TRAP( leaveCode, sessionReady = iServiceSession->IsReadyL(); )
+
+        if(leaveCode!=KErrNone)
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SessionValidity - FATAL:");
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8(" - IsReadyL() leaved: %d"), leaveCode));
+            // Specific error *could* be defined and passed to actual WSC, 
+            // but what it could possibly do with this info(?). Therefore,
+            // currently this method will just signal that "session has
+            // expired" by completing with KErrConnectionExpired.
+            
+            // Invalidate the session, since validity could not be determined
+            sessionReady = EFalse;
+            }
+
+        if(!sessionReady)
+            {
+            // This session is not ready - its credentials are now invalid:
+            CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::SessionValidity session is not ready");
+            CSLOG_L(iConnectionID,KMinLogLevel ," - KErrConnectionExpired");
+            errorCode = KErrConnectionExpired;
+            }
+        }
+    return errorCode; // KErrNone if session (iServiceSession) is valid 
+    }
+
+// If this function returns EFalse, the caller should return
+// because message has already been completed
+TBool CSenClientSession::CheckValidity(const RMessage2& aMessage)
+    {
+    TInt errorCode(SessionValidity());
+    if(errorCode!=KErrNone)
+        {
+        // Signal the client by competing this RMessage2:
+        aMessage.Complete(errorCode);
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CheckValidity returns EFalse");
+        // Caller should return, since message was already completed
+        return EFalse;  
+        }
+    else
+        {
+        // Session is ready and credentials (if any) are valid.
+		CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CheckValidity returns ETrue");        
+        return ETrue;
+        }
+    }
+
+
+MSenTransport& CSenClientSession::TransportL()
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::TransportL()");
+
+    // Check if session exists:
+    if(iServiceSession)
+        {
+        // Check if consumed session already owns a transport:
+        MSenTransport* pSessionTransport = iServiceSession->Transport();
+        if(pSessionTransport)
+            {
+            // Return the transport that is owned by the consumed session!
+            return *pSessionTransport;
+            }
+        }
+    // else, if NO session: utilize the transport owned by this consumer
+    //       OR: create new transport for the session
+
+
+
+    // Core is capable of working as transport factory, too.
+    // The returned transport instancies may or may not be
+    // ECOM plugins:
+    MSenTransportFactory& transportFactory = iManager;
+    CSenTransportBase* pTransport = NULL;
+    
+    // Check if service session has been initilized
+    if(iServiceSession) // && iServiceSession.Transport() == NULL
+        {
+        // Session does not yet own any transport
+        // Check if this consumer owns some transport:
+        if(ipTransport)
+            {
+            // Transfer the ownership of current transport to the session
+            // (internal service consumers have initiated this transport)
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Transport's ownership transferred from consumer to session.");
+            pTransport = ipTransport;
+            ipTransport = NULL;
+            }
+        else // there is no transport
+            {
+            /*
+            // Figure out the XML SD to utilize FOR transport FACTORY:
+            CSenWSDescription* pDesc = NULL;
+            MSenServiceDescription& desc = iServiceSession->AsServiceDescription();
+            pDesc = (CSenWSDescription*)&desc;
+
+            if(pDesc->Endpoint().Length()==0 && iInitializer && iInitializer->Endpoint().Length()>0)
+                {
+                LOG_WRITE_L("- Due session does not specify endpoint, initilizer is utilized instead.");
+                // Only, and only if session does NOT know it's endpoint AND
+                // initializer (SD) does specify endpoint, rely on initilizer SD
+                pDesc = iInitializer;
+                }
+            LOG_WRITE_L("- Instantiating new transport for the consumed service session.");
+            pTransport = transportFactory.CreateL(*pDesc);
+            */
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Instantiating new transport for the service session");
+            CSenWSDescription& description =  (CSenWSDescription&)iServiceSession->AsServiceDescription();
+
+            if( description.HasSuperClass( MSenServiceDescription::EServiceSession ) )
+                {
+                CSenServiceSession& session = (CSenServiceSession&)description;
+                pTransport = transportFactory.CreateL(*iInitializer, &session);
+                }
+            else
+                {
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Fatal: session does not derive from CSenServiceSession(!)");
+                pTransport = transportFactory.CreateL(*iInitializer, NULL);
+                }
+
+            }
+        // Transfer the ownership of transport to the session
+        iServiceSession->SetTransportL(pTransport);
+        }
+    else // no service session
+        {
+        // Check if this consumer already owns a transport or not:
+        if(!ipTransport)
+            {
+            // Check if ther is initilizer 
+            if(!iInitializer)
+                {
+                // This should never happen:
+                CSLOG_L(iConnectionID,KMinLogLevel ,"FATAL - CSenClientSession::TransportL():");
+                CSLOG_L(iConnectionID,KMinLogLevel ," - iInitializer == NULL!");
+                User::Leave(KErrNotFound);
+                }
+            CSLOG_L(iConnectionID,KMinLogLevel ,"- Instantiating new transport for the service consumer (no session yet)");
+            pTransport = transportFactory.CreateL(*iInitializer, NULL);
+            ipTransport = pTransport;
+            }
+        else
+            {
+            // Utilize the transport owned by this consumer as long as session does not own one:
+            pTransport = ipTransport;
+            }
+        }
+    return *pTransport;
+    }
+
+
+
+TInt CSenClientSession::ReleaseServiceSession()
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ReleaseServiceSession");
+
+    // Notify responsible framework, so that it 
+    // can do required cleanup for the session
+    TInt leaveCode(KErrNone);
+    if(iServiceSession)
+        {
+        // Cease to consumer this session:
+        TInt removeRetVal(KErrNone);
+        TRAP( leaveCode, removeRetVal = iServiceSession->RemoveConsumerL(*this); )
+#ifdef _SENDEBUG
+        if(leaveCode!=KErrNone)
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- RemoveConsumerL leaved: %d"), leaveCode));
+            removeRetVal = leaveCode;
+            leaveCode=KErrNone;
+            }
+        else
+            {
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- RemoveConsumerL returned: %d"), removeRetVal));
+            }
+#endif
+
+        // Ask framework(s) to release this session: de-allocation is framework specific
+        TRAP( leaveCode, iManager.NotifyFrameworksL(
+                iServiceSession->FrameworkId(),
+                KSenEventConsumerReleasesSession,
+                iServiceSession); )
+#ifdef _SENDEBUG
+        if(leaveCode!=KErrNone)
+            {
+            CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- NotifyFrameworksL leaved %d"), leaveCode));
+            }
+        else
+            {
+            CSLOG_L(iConnectionID,KMinLogLevel ," - NotifyFrameworksL OK.");
+            }
+#endif // _SENDEBUG
+
+        if(leaveCode==KErrNone)
+            {
+            leaveCode=removeRetVal;
+            }
+        }
+
+
+    return leaveCode;
+    }
+
+TInt CSenClientSession::CompletePendingMessages()
+    {
+    TInt leaveCode(KErrNone);
+    TRAP( leaveCode, CompletePendingMessagesL(); )
+    return leaveCode;
+    }
+
+void CSenClientSession::CompletePendingMessagesL()
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::CompletePendingMessagesL");
+
+    // New: first call cancel from transport using pending txnIds 
+
+    RTransactionIdArray& txnIds = TxnIds();
+
+    TInt pendingCount(txnIds.Count());
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d txnIds(s) pending."), pendingCount));
+    for(TInt i=pendingCount-1; i>=0; i--)
+        {
+        if(txnIds[i])
+            {
+            TInt* pTxnId = txnIds[i];
+            TInt cancelledTxnId(*pTxnId);
+            txnIds.Remove(i);
+            delete pTxnId;
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Now processing txn with id %d, after which %d are left.."), cancelledTxnId, i));
+
+
+            // Attempt to cancel the actual activity on the transport layer.
+            // Note that even if transport will not cancel this transaction,
+            // the response from the transport (later on) won't anymore be 
+            // delivered to consumer, since this RMessage2 is removed from 
+            // iMessageMap few lines below. This means, that from the WS-stack
+            // client point-of-view, cancel works and no "stray" responses
+            // will follow (eventhough some data is received from transport 
+            // stack).
+            MSenTransport* pTransport = ipTransport;
+            if(iServiceSession)
+                {
+                CSLOG_L(iConnectionID,KMaxLogLevel ,"-- has session.");
+                MSenTransport* pSessionTransport = iServiceSession->Transport();
+                if(pSessionTransport)
+                    {
+                    CSLOG_L(iConnectionID,KMaxLogLevel ,"--- session has transport.");
+                    // If session owns a transport, always utilize that one
+                    pTransport = pSessionTransport;
+                    }
+                }
+            // If session does not own a transport, check if this remote consumer does..
+
+            if(pTransport)
+                {
+                CSLOG_L(iConnectionID,KMinLogLevel ,"---- About to call CancelTransaction");
+                TInt retCode = pTransport->CancelTransaction(cancelledTxnId);
+                CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Transport's  CancelTransaction(%d) returned: %d"), cancelledTxnId, retCode));
+                retCode = 0; // not used in release builds atm. 
+                }
+            }
+        }
+    txnIds.ResetAndDestroy(); // deallocate TInt heap allocations
+
+
+    // New: complete pending transaction RMessage2 objects:
+    RTransactionArray& txnMsgs = Transactions();
+    pendingCount = txnMsgs.Count();
+    CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d RMessage2(s) pending."), pendingCount));
+    TInt transactionID;
+    TInt pendingTxnId;
+    for(TInt t=pendingCount-1; t>=0; t--)
+        {
+        if(txnMsgs[t])
+            {
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- %d left to complete."), t+1));
+            CSenClientMessage* pClientMessage = Transactions()[t];
+            RMessage2& message = pClientMessage->RMessage();
+            
+            pendingTxnId = pClientMessage->ChunkHeader().PendingTransactionId();
+            if (pendingTxnId)
+                {
+                transactionID = pendingTxnId;
+                pClientMessage->ChunkHeader().SetPendingTransactionId(0);
+                pClientMessage->ChunkHeader().SetTransactionId(pendingTxnId);
+                }
+            else
+                {
+                transactionID = pClientMessage->ChunkHeader().TransactionId();
+                }
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Completing Txn ID: %d"),transactionID)); 
+            
+            TPtr8 ptr(reinterpret_cast<TUint8*>(&transactionID), 
+                      sizeof(transactionID), 
+                      sizeof(transactionID)); 
+
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, message.WriteL(1, ptr)); //IPC V2
+            if(leaveCode!=KErrNone)
+                {
+                message.Complete(ESenInternalError);
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError - TxnId");
+                }
+            else
+                {
+                message.Complete(ESenServRequestCancelled);
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenServRequestCancelled - TxnId");
+                }
+
+            delete pClientMessage;
+            txnMsgs.Remove(t);
+            }
+        }
+    txnMsgs.ResetAndDestroy(); // deallocate RMessage2 heap alloacations
+    }
+    
+
+TInt CSenClientSession::ProcessRequestFromConsumerL( const TDesC8& aMessage,
+                                                     const TInt aTxnId,
+                                                     MSenRemoteServiceConsumer& aConsumer )
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::ProcessRequestFromConsumerL");
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Consumer id: (%S)"), &aConsumer.Id() ));
+    CSLOG_L(iConnectionID,KMaxLogLevel ,"##############################################");
+    CSLOG_ALL(iConnectionID, KMaxLogLevel, ( aMessage ));
+    CSLOG_L(iConnectionID,KMaxLogLevel ,"##############################################");
+    CSenChunk* pChunk = NULL;
+    TInt retVal = aConsumer.ChunkByTxnIdL( aTxnId, pChunk );
+
+    if( retVal == KErrNone ) 
+        {
+        CSenClientMessage* pMessage = (CSenClientMessage*) pChunk; // this holds all the data written by SC
+    
+        if( ipHostletAwaitOp )
+            {
+            RHandleBase& handle = pMessage->Chunk();
+#ifdef EKA2
+            ipHostletAwaitOp->RMessage().Complete( handle );
+#else // EKA1
+            ipHostletAwaitOp->RMessage().Complete( handle.Handle() );
+#endif // EKA2:EKA1
+            delete ipHostletAwaitOp;
+            ipHostletAwaitOp = NULL;
+            }
+        else // await op is in-progress / model is "busy"
+            {
+            CSLOG_L(iConnectionID,KMaxLogLevel ,"- Request has to be queued, await operation is already in progress (busy)");
+            // 
+            TInt* pTxnId = new (ELeave) TInt(aTxnId); //CodeScannerWarnings
+            CleanupStack::PushL(pTxnId);
+            RHostletRequestMap& map = HostletRequestMap();
+            // Put this consumer request in queue and start waiting 
+            // for next "await hostlet request" -operation to come.
+            retVal = map.Append(pTxnId, pMessage);
+            if( retVal == KErrNone )
+                {
+                CleanupStack::Pop( pTxnId );
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy( pTxnId ); 
+                }
+            }
+        }
+    return retVal;
+    }
+
+
+// NOTE: closely similar to transactioncompletel(!) 
+TInt CSenClientSession::OnServiceCompleteL( const TInt aTxnId, TInt aCompletionCode, const TDesC8& /* aDesc */ )
+    {
+    CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::OnServiceCompleteL (part of remote hostlet interface)");
+    TInt retVal(KErrNotFound);
+    RTransactionIdArray& ids = TxnIds();
+    TInt index(0);
+    TInt count(ids.Count());
+    TInt* pTxnId = NULL;
+    for(; index < count; index++)
+        {
+        pTxnId = ids[index];
+        if(pTxnId && *pTxnId == aTxnId)
+            {
+            break;
+            }
+        }
+        
+    if(index < count)
+        {
+        RTransactionArray& transactions = Transactions();
+        TInt count(transactions.Count());
+        if( index < count)
+            {
+            CSenClientMessage* pClientMessage = transactions[index];
+            RMessage2& message = pClientMessage->RMessage();
+
+            TPtr8 ptr(reinterpret_cast<TUint8*>(&aCompletionCode),
+                        sizeof(aCompletionCode), sizeof(aCompletionCode));
+
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, message.WriteL(0, ptr)); //IPC V2
+            if(leaveCode!=KErrNone)
+                {
+                // LEAVE
+                CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Leave code from RMessage2::WriteL(completionCode): %d"), leaveCode));
+                message.Complete(ESenInternalError);
+                retVal = leaveCode;
+                CSLOG_L(iConnectionID,KMinLogLevel ,"Completed with ESenInternalError");
+                }
+            else
+                {
+                // OK
+                TInt transactionId(aTxnId);
+                TPtr8 txnId(reinterpret_cast<TUint8*>(&transactionId),
+                            sizeof(transactionId), sizeof(transactionId));
+                TRAP(leaveCode, message.WriteL(1, txnId)); //IPC V2
+                if(leaveCode!=KErrNone)
+                    {
+                    // LEAVE
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Leave code from RMessage2::WriteL(txnID): %d"), leaveCode));
+                    message.Complete(ESenInternalError);
+                    retVal = leaveCode;
+                    CSLOG_L(iConnectionID,KMinLogLevel ,"Completed with ESenInternalError");
+                    }
+                else
+                    {
+                    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- Completion code: %d"), aCompletionCode));
+                    message.Complete(ESenOnServiceComplete);
+                    CSLOG_L(iConnectionID,KMinLogLevel ,"Completed with ESenOnServiceComplete");
+                    }
+                }
+            transactions.Remove(index);
+            delete pClientMessage;
+            retVal = KErrNone; // all went ok
+            }
+        else
+            {
+            retVal = KErrNotFound;
+            }
+        ids.Remove(index); // de-allocate TInt which was allocated from heap
+        delete pTxnId;
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+        
+    return retVal;    
+    }
+
+
+TInt CSenClientSession::ChunkByTxnIdL( TInt aTxnId, CSenChunk*& aChunk )
+    {
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::ChunkByTxnIdL(%d)"), aTxnId));
+    aChunk = NULL;
+
+    TInt retVal = TransactionIndex(aTxnId);
+    if(retVal > KErrNotFound)
+        {
+        RTransactionArray& transactions = Transactions();
+        if( retVal < transactions.Count() )
+            {
+            CSenClientMessage* pClientMessage = transactions[retVal];
+            aChunk = pClientMessage;
+            retVal = KErrNone;
+            }
+        else           
+            {
+            return KErrNotFound; // "KErrIndexOutOfBounds"
+            }
+        }
+     return retVal; // always KErrNone or KErrNotFound
+     }
+     
+MSenMessageContext* CSenClientSession::MessageContextByTxnIdL( TInt aCtxId, TInt& aError )
+    {
+    CSenClientMessage* pClientMessage = NULL;
+    TInt retVal = ContextIndex(aCtxId); // retVal == "context index" or ERROR
+    if(retVal > KErrNotFound) 
+        {
+        RTransactionArray& transactions = Transactions();        
+        if( retVal < transactions.Count() )
+            {
+            pClientMessage = transactions[retVal];
+            if( pClientMessage )
+                {
+                aError = KErrNone;
+                return &pClientMessage->MessageContext(); 
+                }
+            }
+        else  
+            {
+            // "KErrIndexOutOfBounds"          
+            aError = KErrNotFound;
+            }
+        }
+    else        
+        {
+        aError = retVal;
+        }
+    return NULL;
+    }
+    
+void CSenClientSession::StateChanged(TInt aState)
+    {
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("CSenClientSession::StateChanged(%d)"), aState));
+    RProperty::Set(iClientSecureID,(KSenRPropertyKeyBaseNumber+iConnectionID), aState);
+    }
+    
+TBool CSenClientSession::HasAuthenticationCallback()
+    {
+    return iConnectionHasAuthenticationCallback;
+    }
+TBool CSenClientSession::HasCoBrandingCallback()
+    {
+    return iConnectionHasCoBrandingCallback;
+    }
+
+void CSenClientSession::SearchIdentityProviderL(const RMessage2& aMessage)
+	{
+	TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        TInt length = aMessage.Int2();
+        if(length < 1)
+            {
+            CSLOG_L(iConnectionID,KMaxLogLevel ,"- Tried search Identity Provide with null provider Id descriptor.");
+            aMessage.Complete(KErrBadDescriptor);
+            return;
+            }
+        
+        HBufC8* inBuf = HBufC8::NewLC(length);
+        TPtr8 providerId = inBuf->Des();
+        aMessage.ReadL(1, providerId);
+        
+	    CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+	    pPattern->SetEndPointL(providerId);
+	    CSenIdentityProvider* pIdp = ((MSenCoreServiceManager&)iManager).IdentityProviderL(*pPattern);
+	    CleanupStack::PopAndDestroy(pPattern);
+	    CleanupStack::PopAndDestroy(inBuf);
+	    if ( pIdp )
+	        {
+	        HBufC8* pIdpAsXml = pIdp->AsXmlL();
+	        CleanupStack::PushL(pIdpAsXml);
+	        retVal = pSenChunk->DescToChunk(*pIdpAsXml);
+	        CleanupStack::PopAndDestroy(pIdpAsXml);
+	        }
+	    else
+	    	{
+	        retVal = KErrNotFound;
+	        }
+        }
+
+    CleanupStack::PopAndDestroy(pSenChunk);
+    aMessage.Complete(retVal);
+	
+	}
+TBool CSenClientSession::IsTrustedClient(const RMessage2& aMessage)
+    {
+    TVendorId vendor = aMessage.VendorId();
+	_LIT_VENDOR_ID(trustedVendor,VID_DEFAULT);
+    
+    if (vendor.iId == trustedVendor.iId )
+        return ETrue;
+    else
+        return EFalse;
+
+    }
+TBool CSenClientSession::CleanPassword(const RMessage2& aMessage)
+	{
+    TSecureId sid = aMessage.SecureId();
+    _LIT_SECURE_ID(nokia_chateventmonitorserver, 0x2001B2C5 );
+    _LIT_SECURE_ID(nokia_xmppnaui, 0x2001A95B);
+    if ((sid.iId == nokia_chateventmonitorserver.iId) || (sid.iId == nokia_xmppnaui.iId))
+        return EFalse;
+    else
+        return ETrue;
+    }
+TSecureId CSenClientSession::SecureId()
+	{
+	return iSecureId;
+	}
+
+TVendorId CSenClientSession::VendorId()
+	{
+	return iVendorId;
+	}
+void CSenClientSession::IdentityProviders(const RMessage2& aMessage)
+	{
+	
+	TInt retVal(KErrNone);
+    CSenChunk* pSenChunk = NULL;
+    pSenChunk = CSenChunk::NewLC(KNullDesC);
+    retVal = pSenChunk->OpenChunkFromRMsgL(aMessage,0);
+    
+    if ( retVal == KErrNone )
+        {
+        const RPointerArray<CSenIdentityProvider> pIdps = ((MSenCoreServiceManager&)iManager).IdentityProvidersL();
+        
+        const TInt count = pIdps.Count();
+  
+        // Calculate required heap allocation size:
+        TInt size(0);
+        if(count>0)
+            {
+            size += (count-1) * KTab().Length();
+            }
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, size += iManager.SizeOfIdentityProvidersL(pIdps); )
+        if(leaveCode!=KErrNone)
+            {
+            CleanupStack::PopAndDestroy(pSenChunk);
+            aMessage.Complete(leaveCode);
+            }
+        CSLOG_L(iConnectionID,KMinLogLevel ,"CSenClientSession::IdentityProviders");
+        CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- Size of SD(s) + delimiter(s): %d bytes"), size));
+
+        // Adjust RChunk to accomodate found IdP using known hnalde
+        TPtr8* pIdPrs = NULL;
+        retVal = pSenChunk->AllocDescToChunk(size, pIdPrs); 
+        const TBool trusted = IsTrustedClient( aMessage );
+        const TBool cleanPass = CleanPassword( aMessage );
+        if(retVal==KErrNone && pIdPrs)
+            {
+            for ( TInt i = 0; i < count; ++i )
+                {
+                if ( i >= 1 )
+                	{
+                    pIdPrs->Append( KTab );
+                	}
+                
+                CBufFlat* pBuf= CBufFlat::NewL( KFlatBufSize );
+                CleanupStack::PushL( pBuf );
+                
+                RBufWriteStream bufWs( *pBuf );
+                CleanupClosePushL( bufWs );
+                
+                HBufC8* passDec = SenXmlUtils::DecodeHttpCharactersLC( pIdps[i]->Password() );
+                RBuf8 password;
+                password.Create( *passDec );
+                CleanupStack::PopAndDestroy( passDec );                
+                
+                if ( !trusted )
+                    {
+                    // Clean AutoSignIn
+                    TBool rollbackAutoMode = EFalse;
+                    CSenElement* autoSignInEl( NULL );
+                    
+                    if ( pIdps[i]->FrameworkId() == KDefaultOviFrameworkID )
+                        {
+                        CSenElement* el( NULL );
+                        pIdps[i]->AccountExtensions( el );
+                
+                        if ( el )
+                            {
+                            autoSignInEl = el->Element( KSenAccAutoSignIn );
+                    
+                            if ( autoSignInEl && autoSignInEl->Content() == KSenPropertyTrue )
+                                {
+                                autoSignInEl->SetContentL( KSenPropertyFalse );
+                                rollbackAutoMode = ETrue;
+                                }
+                            }         
+                        }
+                    
+                    pIdps[i]->SetUserInfoL( pIdps[i]->AuthzID(),
+                                            pIdps[i]->AdvisoryAuthnID(),
+                                            KNullDesC8() );
+                    
+                    pIdps[i]->WriteAsXMLToL( bufWs );
+                    
+                    if ( rollbackAutoMode ) //autoSignInEl has to exists, otherwise rollbackAutoMode is false
+                    	{
+                    	autoSignInEl->SetContentL( KSenPropertyTrue );
+                    	}
+                    TRAPD(retVal,
+			            	    HBufC8* encPassword = SenXmlUtils::EncodeHttpCharactersLC(password);
+		                    pIdps[i]->SetUserInfoL( pIdps[i]->AuthzID(),
+		                                            pIdps[i]->AdvisoryAuthnID(),
+		                                            *encPassword );
+		  	          	    CleanupStack::PopAndDestroy(encPassword);
+  	          	    		);
+                    }
+                else//trusted application
+                    {
+                    if (cleanPass)//special case for Yukon
+                    	{
+                    	pIdps[i]->SetUserInfoL( pIdps[i]->AuthzID(),
+	                                            pIdps[i]->AdvisoryAuthnID(),
+	                                            KNullDesC8() );
+	                    pIdps[i]->WriteAsXMLToL( bufWs );
+	                    HBufC8* encPassword = SenXmlUtils::EncodeHttpCharactersLC(password);
+	                    pIdps[i]->SetUserInfoL( pIdps[i]->AuthzID(),
+	                                            pIdps[i]->AdvisoryAuthnID(),
+	                                            *encPassword );
+	            	    CleanupStack::PopAndDestroy(encPassword);
+                    	}
+                    else
+                    	{
+                    	pIdps[i]->WriteAsXMLToL( bufWs );
+                    	}
+                    }
+                password.Close();
+                // Add this SD as XML into the "big heap buffer":
+                TPtr8 p8 = pBuf->Ptr(0);
+                pIdPrs->Append(p8); 
+                // Destroy the temporary, flat stream buffer
+                CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+                
+                pBuf = NULL;
+                }
+            CSLOG_L(iConnectionID,KMaxLogLevel ,"- Requested descriptions:");
+            CSLOG_ALL(iConnectionID,KMaxLogLevel ,(*pIdPrs));
+            }
+    #ifdef _SENDEBUG
+        else
+            {
+            CSLOG_FORMAT((iConnectionID, KNormalLogLevel , _L8("- AllocDescToRMsgL failed: %d"), retVal));
+            }
+    #endif // _SENDEBUG
+
+        }
+    CleanupStack::PopAndDestroy(pSenChunk); // Close SenChunk
+
+    aMessage.Complete(retVal);
+	
+	}
+
+void CSenClientSession::ObserveTransfer(const RMessage2& aMessage)
+	{
+    CSLOG_L( iConnectionID,KMinLogLevel, "CSenClientSession::ObserveTransfer" );	
+	TInt retVal(KErrNone);
+	if(!iConnectionSession.Handle())
+		{
+		CSLOG_L( iConnectionID,KMinLogLevel, " iConnectionSession is not open. Creating it now." );	
+		retVal = iConnectionSession.CreateSession(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- CreateSession returned: %d" ), retVal ));	
+		}
+	if(retVal == KErrNone)
+		{
+		CSLOG_L( iConnectionID,KMinLogLevel, " - Calling InitProgressObserver()." );	
+		retVal = iConnectionSession.InitProgressObserver(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- InitProgressObserver() returned: %d" ), retVal ));	
+		if(retVal != KErrNone)
+			{
+    		CSLOG_L( iConnectionID,KMinLogLevel, " => Forced to close iConnectionSession." );	
+			iConnectionSession.Close();
+			}
+		}
+	aMessage.Complete(retVal);
+	}
+void CSenClientSession::ObserveCoBranding(const RMessage2& aMessage)
+	{
+	TInt retVal(KErrNone);
+	if(!iConnectionSession.Handle())
+		{
+		CSLOG_L( iConnectionID,KMinLogLevel, " iConnectionSession is not open. Creating it now." );	
+		retVal = iConnectionSession.CreateSession(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- CreateSession returned: %d" ), retVal ));	
+		}
+	if(retVal == KErrNone)
+		{
+		CSLOG_L( iConnectionID,KMinLogLevel, " - Calling InitCoBrandingObserver()." );	
+		retVal = iConnectionSession.InitCoBrandingObserver(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- InitCoBrandingObserver() returned: %d" ), retVal ));	
+		if(retVal != KErrNone)
+			{
+    		CSLOG_L( iConnectionID,KMinLogLevel, " => Forced to close iConnectionSession." );	
+			iConnectionSession.Close();
+			}
+		else
+    		{
+    		iConnectionHasCoBrandingCallback = ETrue;
+    		}
+		}
+	aMessage.Complete(retVal);
+	}
+void CSenClientSession::ObserveAuthCallback(const RMessage2& aMessage)
+	{
+	TInt retVal(KErrNone);
+	if(!iConnectionSession.Handle())
+		{
+		CSLOG_L( iConnectionID,KMinLogLevel, " iConnectionSession is not open. Creating it now." );	
+		retVal = iConnectionSession.CreateSession(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- CreateSession returned: %d" ), retVal ));	
+		}
+	if(retVal == KErrNone)
+		{
+		CSLOG_L( iConnectionID,KMinLogLevel, " - Calling InitAuthObserver()." );	
+		retVal = iConnectionSession.InitAuthObserver(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- InitAuthObserver() returned: %d" ), retVal ));	
+		if(retVal != KErrNone)
+			{
+    		CSLOG_L( iConnectionID,KMinLogLevel, " => Forced to close iConnectionSession." );	
+			iConnectionSession.Close();
+			}
+		}
+	aMessage.Complete(retVal);
+	}
+
+#ifdef __ENABLE_ALR__    
+void CSenClientSession::ObserveMobiltyService(const RMessage2& aMessage)
+   {
+   CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::ObserveMobiltyService registered ");
+   TInt retVal(KErrNone);
+   if(!iConnectionSession.Handle())
+        {
+        CSLOG_L( iConnectionID,KMinLogLevel, " iConnectionSession is not open. Creating it now." );	
+        retVal = iConnectionSession.CreateSession(aMessage);
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- CreateSession returned: %d" ), retVal ));	
+        }
+   if(retVal == KErrNone)
+        {
+		CSLOG_L( iConnectionID,KMinLogLevel, " - Calling InitMobilityObserver()." );	
+        retVal = iConnectionSession.InitMobilityObserver(aMessage);        
+		CSLOG_FORMAT(( iConnectionID,KMinLogLevel, _L8("- InitMobilityObserver() returned: %d" ), retVal ));	
+        if(retVal != KErrNone)
+            {
+    		CSLOG_L( iConnectionID,KMinLogLevel, " => Forced to close iConnectionSession." );	
+            iConnectionSession.Close();
+            }
+        }
+   aMessage.Complete(retVal);
+   }
+
+void CSenClientSession::MigrateToPrefferedCarrierL(const RMessage2& aMessage)
+   {
+   CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::MigrateToPrefferedCarrier ");			
+   HBufC8* inBuf = HBufC8::NewLC(10);
+   TPtr8 inBuffer = inBuf->Des();
+   aMessage.ReadL(0, inBuffer); // boolean
+   TBool userChoice = (TBool)(*inBuffer.Ptr()) ;
+   CleanupStack::PopAndDestroy(); // inBuf			
+   aMessage.Complete(KErrNone);
+   iMobilityChoice = userChoice ;   
+   MigrateToPrefferedCarrier(userChoice) ;
+   }
+
+void CSenClientSession::MigrateToPrefferedCarrier(TBool aUserChoice)
+   {
+   CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::MigrateToPrefferedCarrier() ");
+    //if pending transaction are there we need to wait or cancel all transaction and then migrate //CompletePendingMessages()
+    RTransactionIdArray& txnIds = TxnIds();
+    TInt pendingCount(txnIds.Count());
+    if (pendingCount == 0)
+        {
+        if (aUserChoice != EFalse)
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel , "-calling iALRObserver->MigrateToPreferredCarrier ");		
+            iALRObserver->MigrateToPreferredCarrier() ;
+            }
+        else
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel , "-calling iALRObserver->IgnorePreferredCarrier ");		
+            iALRObserver->IgnorePreferredCarrier() ;				
+            }
+        }
+    else
+        {
+        CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("-call to iALRObserver->MigrateToPrefferedCarrier cant be performed as %d txnIds(s) pending."), pendingCount));
+        }    
+    }
+
+void CSenClientSession::NewCarrierAcceptedL(const RMessage2& aMessage)
+    {
+    CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::NewCarrierAccepted ");				
+    HBufC8* inBuf = HBufC8::NewLC(10);
+    TPtr8 inBuffer = inBuf->Des();
+    aMessage.ReadL(0, inBuffer); // boolean
+    TBool userChoice = (TBool)(*inBuffer.Ptr()) ;
+    CleanupStack::PopAndDestroy(); // inBuf	
+    aMessage.Complete(KErrNone);
+
+    NewCarrierAcceptedL(userChoice) ;        
+    }
+
+void CSenClientSession::NewCarrierAcceptedL(TBool aUserChoice)
+   {
+   CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::NewCarrierAccepted() ");
+    if (aUserChoice != EFalse)
+        {
+        TInt retVal(KErrNone);
+        CSLOG_L(iConnectionID, KMinLogLevel , "-calling iALRObserver->NewCarrierAccepted ");
+        iALRObserver->NewCarrierAccepted() ;
+        //now we have new iap id and we can even propagate to transport plugin
+        //set transport properties
+        CSLOG_L(iConnectionID, KMinLogLevel , "-calling iALRObserver->GetNewIapAsTransportPropertyL ");
+        HBufC8* transportProperties = iALRObserver->GetNewIapAsTransportPropertyL() ;
+        if(transportProperties != NULL)
+            {
+            CleanupStack::PushL (transportProperties) ;
+            }
+        if ( iServiceSession && transportProperties )
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel , "-setting up new transport properties with new iap id received from iALRObserver ");
+            retVal = iServiceSession->SetTransportPropertiesL(*transportProperties, *this);
+            }
+        else
+            {
+            retVal = KErrSenNotInitialized;
+                 CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("-CSenClientSession::NewCarrierActive SetTransportPropertiesL failed with %d "), retVal)) ;
+            //HandleErrorL(KErrSenNotInitialized, KNullDesC8) ;
+            }
+        if(transportProperties != NULL)
+            {
+             	CleanupStack::PopAndDestroy(transportProperties); // transportProperties	        
+            }
+        }
+    else
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel , "-calling iALRObserver->NewCarrierRejected ");		
+        iALRObserver->NewCarrierRejected() ;			
+        }
+   }
+
+void CSenClientSession::PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+                                        TAccessPointInfo aNewAPInfo,
+                                        TBool aIsUpgrade,
+                                        TBool aIsSeamless )
+	{
+    CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::PreferredCarrierAvailable ");
+    
+    RTransactionIdArray& txnIds = TxnIds();
+    TInt pendingCount(txnIds.Count());
+      
+    if (iConnectionSession.Handle() && pendingCount == 0)
+        {
+        if (aIsSeamless)
+            {
+              // in S60 3.2, this situation cannot occur.
+            CSLOG_L(iConnectionID, KMinLogLevel , "-it is seemless in S60 3.2, this situation cannot occur. ");
+            }
+        else if (iMobilityCallBackForwarded == EFalse)
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel , "-Calling iConnectionagentSession PreferredCarrierAvailable() ");
+    		iConnectionSession.PreferredCarrierAvailable(aOldAPInfo, aNewAPInfo, aIsUpgrade, aIsSeamless) ;
+            iMobilityCallBackForwarded = ETrue ;
+            }
+        else if(iMobilityCallBackForwarded != EFalse)
+            {
+            CSLOG_L(iConnectionID, KMinLogLevel , "-PreferredCarrierAvailable callback is already forwared to client ");
+            CSLOG_L(iConnectionID, KMinLogLevel , "-Client session has user choice by now and we can reuse it");
+            MigrateToPrefferedCarrier (iMobilityChoice) ;
+            }
+        }	
+	else
+		{
+        CSLOG_L(iConnectionID, KMinLogLevel , "MobiltyObserver is not registered ");
+        CSLOG_L(iConnectionID, KMinLogLevel , "switching to new carrier automaticaly");
+        MigrateToPrefferedCarrier (ETrue) ;
+	    }
+    }
+
+void CSenClientSession::Error( TInt aError )
+	{
+    CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("-CSenClientSession::Error aError = %d"), aError));
+    iMobilityCallBackForwarded = EFalse ; //reset the flag
+    iMobilityChoice = EFalse ;       
+    if (iConnectionSession.Handle())
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel , "-Calling iConnectionagentSession MobilityError() ");
+        iConnectionSession.MobilityError(aError) ;        
+        }		
+    else
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel , "MobiltyObserver is not registered ");
+        CSLOG_L(iConnectionID, KMinLogLevel , "-iMobiltyObserver->Error not called ");
+        }
+	}
+
+void CSenClientSession::NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless )
+    {
+    CSLOG_L(iConnectionID, KMinLogLevel , "-CSenClientSession::NewCarrierActive ");
+    if (iConnectionSession.Handle())
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel , "-Calling iConnectionagentSession NewCarrierActive() ");
+        iConnectionSession.NewCarrierActive(aNewAPInfo, aIsSeamless) ;
+        iMobilityCallBackForwarded = EFalse ; //reset the flag
+        iMobilityChoice = EFalse ;        
+        }	
+    else
+        {
+        CSLOG_L(iConnectionID, KMinLogLevel , "MobiltyObserver is not registered ");
+        CSLOG_L(iConnectionID, KMinLogLevel , "activating new carrier automaticaly");
+        TRAPD(retVal, NewCarrierAcceptedL(ETrue));
+        }
+    }
+#endif // __ENABLE_ALR__    
+
+
+
+TInt CSenClientSession::CompleteReauthLoop(CSenChunk& aSenChunk) //also completes transaction
+	{
+	CSLOG_L(iConnectionID,KMinLogLevel ,"- CompleteReauthLoop");
+	TInt retVal(KErrNone);
+
+	TInt previousTxnId = aSenChunk.ChunkHeader().TransactionId();
+	aSenChunk.ChunkHeader().SetTransactionId(KErrNotFound);
+	TInt transactionIndex = TransactionIndex(KErrNotFound);
+	aSenChunk.ChunkHeader().SetTransactionId(previousTxnId);
+	
+	if ( transactionIndex != KErrNotFound )
+		{
+		CSenClientMessage* pClientMessage = iPendingTransactions[transactionIndex];
+		RMessage2& message = pClientMessage->RMessage();
+		
+
+            TPtr8 ptr(reinterpret_cast<TUint8*>(&previousTxnId), 
+                      sizeof(previousTxnId), 
+                      sizeof(previousTxnId)); 
+
+            TRAPD(leaveCode, message.WriteL(1, ptr)); //IPC V2
+            if(leaveCode!=KErrNone)
+                {
+                message.Complete(ESenInternalError);
+                CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenInternalError");
+                }
+            else // no internal error in writing error message
+                {
+		      	pClientMessage->ChunkHeader().SetPendingTransactionId(0);
+		      	pClientMessage->ChunkHeader().SetTransactionId(previousTxnId);
+			pClientMessage->ChunkHeader().SetMessageDirection( MSenMessage::EOutbound );
+            
+			//CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- ErrCode: %d"), KErrSenFailedAuthentication));
+			CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- ErrCode: %d"), KErrSenAuthenticationFault));
+			CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- transactionIndex  : %d"), transactionIndex));
+			CSLOG_FORMAT((iConnectionID, KMinLogLevel , _L8("- previousTxnId  : %d"), previousTxnId));
+			iReauthResendNeeded = ETrue ;
+			message.Complete(ESenReAuthAndResendNeeded);
+			CSLOG_L(iConnectionID,KMinLogLevel ,"- Completed with ESenReAuthAndResendNeeded");
+				
+				iPendingTransactions.Remove( transactionIndex );
+				delete pClientMessage;
+                }
+		}
+	else
+	    {
+	    retVal = KErrNotFound;
+	    }
+	
+	return retVal;
+	}
+
+TInt CSenClientSession::ReauthenticationNeededL(CSenIdentityProvider*& aIdp)
+	{
+	_LIT(chunkNameLit, "caChunk"); // lenght = 7
+	const TInt KMaxChunkNumDecimals = 64;
+	const TInt maxChunkNameLen = KMaxChunkNumDecimals + 7;
+	
+	TInt retVal(KErrNotFound);
+	if(aIdp)
+		{
+		HBufC* chunkNameDes = HBufC::NewLC(maxChunkNameLen);
+		TPtr chunkName = chunkNameDes->Des();
+		chunkName.Copy(chunkNameLit);
+		chunkName.AppendNum(iConnectionID);
+
+		CSenChunk* pSenChunk = CSenChunk::NewLC(chunkName.Left(KMaxName));
+		pSenChunk->SetLogger(Log());
+		retVal = pSenChunk->CreateChunk();
+		if(retVal == KErrNone)
+			{
+			// Write identity provider to chunk
+			HBufC8* desIdp = aIdp->AsXmlL();
+			CleanupStack::PushL(desIdp);
+			retVal = pSenChunk->DescToChunk(*desIdp);
+			CleanupStack::PopAndDestroy(desIdp);
+			if(retVal == KErrNone)
+				{
+				if(iConnectionSession.Handle())
+			    	{
+			    	retVal = iConnectionSession.ReauthenticationNeeded(*pSenChunk);
+			    	}
+				else
+					{
+					retVal = KErrSenInternal;
+					}
+				
+				if(retVal == KErrNone)
+					{
+					TPtrC8 identityProvider;
+					retVal = pSenChunk->DescFromChunk(identityProvider);
+					if(retVal == KErrNone)
+						{
+						CSenIdentityProvider* pIdentityProvider =
+							CSenIdentityProvider::NewLC(KNullDesC8);
+						CSenXmlReader* pXmlReader = CSenXmlReader::NewLC(KXmlParserMimeType);
+						pXmlReader->SetContentHandler( *pIdentityProvider );
+						pIdentityProvider->SetReader(*pXmlReader);
+	
+						TInt leaveCode(KErrNone);
+						TRAP( leaveCode, pIdentityProvider->ParseL( identityProvider ); )
+						                    
+						CleanupStack::PopAndDestroy(pXmlReader);
+						if ( leaveCode != KErrNone )
+							{
+							retVal = KErrSenInternal;
+							CleanupStack::PopAndDestroy(pIdentityProvider);
+							}
+						else
+							{
+							// Store provider Id before registering new IDP (in case it gets deleted by manager)
+							TPtrC8 providerId = pIdentityProvider->ProviderID();
+							HBufC8* pProviderIdBuf = providerId.AllocLC();
+							retVal = iManager.RegisterIdentityProviderL(pIdentityProvider);
+							// Ownership transfered to manager
+							CleanupStack::Pop(2); //pProviderIdBuf, pIdentityProvider
+							CleanupStack::PushL(pProviderIdBuf);
+							if(retVal == KErrNone)
+								{
+								// Retrieve new IDP and update reference
+								CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+								pPattern->SetEndPointL(*pProviderIdBuf);
+								CSenIdentityProvider* connIdp = ((MSenCoreServiceManager&)iManager).IdentityProviderL(*pPattern);
+								CleanupStack::PopAndDestroy(pPattern);
+								if(connIdp)
+									{
+									aIdp = connIdp;
+									}
+								}
+							CleanupStack::PopAndDestroy(pProviderIdBuf);
+							}
+						}
+					}
+				}
+			}
+			CleanupStack::PopAndDestroy(pSenChunk);
+			CleanupStack::PopAndDestroy(chunkNameDes);
+		}
+	return retVal;
+	}
+
+CSenClientMessage* CSenClientMessage::NewL( const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer )
+    {
+    CSenClientMessage* pOperation = NewLC(aMessage, apConsumer);
+    CleanupStack::Pop();
+    return pOperation;
+    }
+
+CSenClientMessage* CSenClientMessage::NewLC( const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer )
+    {
+    CSenClientMessage* pOperation = new (ELeave) CSenClientMessage();
+    CleanupStack::PushL(pOperation);
+    pOperation->ConstructL(aMessage, apConsumer);
+    return pOperation;
+    }
+
+CSenClientMessage* CSenClientMessage::NewL( const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer, MSenTransport& aTransport )
+    {
+    CSenClientMessage* pOperation = NewLC(aMessage, apConsumer, aTransport);
+    CleanupStack::Pop();
+    return pOperation;
+    }
+
+CSenClientMessage* CSenClientMessage::NewLC( const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer, MSenTransport& aTransport )
+    {
+    CSenClientMessage* pOperation = new (ELeave) CSenClientMessage();
+    CleanupStack::PushL(pOperation);
+    pOperation->ConstructL(aMessage, apConsumer, aTransport);
+    return pOperation;
+    }
+
+
+void CSenClientMessage::ConstructL(const RMessage2& aMessage, MSenRemoteServiceConsumer* apConsumer)
+    {
+    iMessage = aMessage;
+    ipConsumer = apConsumer;
+    ipChunkName = NULL;
+    }
+
+void CSenClientMessage::ConstructL(const RMessage2& aMessage, 
+                                   MSenRemoteServiceConsumer* apConsumer,
+                                   MSenTransport& aTransport)
+    {
+    ConstructL(aMessage, apConsumer);
+    MSenProperties& p = aTransport.PropertiesL();
+    /*
+    CSenLayeredTransportProperties* ctxProperties = NULL;
+    if( p.PropertiesClassType() == MSenProperties::ESenLayeredTransportProperties ||
+        p.PropertiesClassType() == MSenProperties::ESenLayeredHttpTransportProperties ||
+        p.PropertiesClassType() == MSenProperties::ESenLayeredVtcpTransportProperties)
+        {
+        CSenLayeredXmlProperties* properties = (CSenLayeredTransportProperties*)&p;
+        ctxProperties = (CSenLayeredTransportProperties*)properties->CloneL();
+        }
+    else
+        {        
+        ctxProperties = CSenLayeredTransportProperties::NewL();    
+        }
+    ipMessageContext = CSenMessageContext::NewL( SenContext::EOutgoing, ctxProperties );
+    */
+    TInt error(KErrNone);
+    ipMessageContext = CSenMessageContext::NewL( SenContext::EOutgoing, p.Clone(error) );
+    User::LeaveIfError(error);
+    }
+    
+CSenClientMessage::CSenClientMessage()
+    {
+    }
+    
+TInt CSenClientMessage::CtxId()
+    {
+    TInt ctxId = KErrNotFound;
+    if( ipMessageContext )  
+        {      
+        TInt leaveCode( KErrNone );   
+        CSenChunk* pChunk = NULL;
+        TRAP( leaveCode, pChunk = ipMessageContext->ChunkL(); )
+        if( !leaveCode && pChunk )
+            {
+            ctxId = pChunk->ChunkHeader().ContextId();                
+            }
+        }
+    return ctxId;        
+    }
+    
+CSenClientMessage::~CSenClientMessage()
+    {
+    delete ipMessageContext;
+    ipMessageContext = NULL;
+    iBinaryDataArray.ResetAndDestroy();
+    }
+
+RMessage2& CSenClientMessage::RMessage()
+    {
+    return iMessage;
+    }
+    
+MSenRemoteServiceConsumer* CSenClientMessage::Consumer()
+    {
+    return ipConsumer;
+    }
+    
+MSenMessageContext& CSenClientMessage::MessageContext()
+    {
+    return *ipMessageContext;
+    }
+
+RPointerArray<CSenBinaryData>& CSenClientMessage::BinaryDataArray()
+    {
+    return iBinaryDataArray;
+    }
+
+CSenBinaryData* CSenBinaryData::NewL(RChunk& aChunk, TDesC8& aCid, TInt aOffset, TInt aSize)
+    {
+    CSenBinaryData* pSelf = CSenBinaryData::NewLC(aChunk, aCid, aOffset, aSize);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+    
+CSenBinaryData* CSenBinaryData::NewLC(RChunk& aChunk, TDesC8& aCid, TInt aOffset, TInt aSize)
+    {
+    CSenBinaryData* pSelf = new (ELeave) CSenBinaryData(aOffset, aSize);
+    CleanupStack::PushL(pSelf);
+    pSelf->BaseConstructL(aChunk, aCid);
+    return pSelf;
+    }
+    
+CSenBinaryData* CSenBinaryData::NewL(RFs& aFs, RFile& aFile, TDesC8& aCid, TInt aOffset, TInt aSize)
+    {
+    CSenBinaryData* pSelf = CSenBinaryData::NewLC(aFs, aFile, aCid, aOffset, aSize);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+    
+CSenBinaryData* CSenBinaryData::NewLC(RFs& aFs, RFile& aFile, TDesC8& aCid, TInt aOffset, TInt aSize)
+    {
+    CSenBinaryData* pSelf = new (ELeave) CSenBinaryData(aOffset, aSize);
+    CleanupStack::PushL(pSelf);
+    pSelf->BaseConstructL(aFs, aFile, aCid);
+    return pSelf;
+    }
+    
+CSenBinaryData::~CSenBinaryData()
+    {
+    iFs.Close();
+    iFile.Close();
+    iChunk.Close();
+    delete ipCid;
+    }
+        
+RChunk& CSenBinaryData::Chunk()
+    {
+    return iChunk;
+    }
+    
+RFile& CSenBinaryData::File()
+    {
+    return iFile;
+    }
+    
+TDesC8& CSenBinaryData::Cid()
+    {
+    return *ipCid;
+    }
+    
+TInt CSenBinaryData::Offset()
+    {
+    return iOffset;
+    }
+    
+TInt CSenBinaryData::Size()
+    {
+    return iSize;
+    }
+
+CSenBinaryData::TSenBinaryDataType CSenBinaryData::Type()
+    {
+    return iType;
+    }
+
+CSenBinaryData::CSenBinaryData(TInt aOffset, TInt aSize)
+:   iOffset(aOffset),
+    iSize(aSize)
+    {
+    }
+        
+void CSenBinaryData::BaseConstructL(RChunk& aChunk, TDesC8& aCid)
+    {
+    iChunk  = aChunk;
+    ipCid    = aCid.AllocL();
+    iType = EChunk;
+    }
+
+void CSenBinaryData::BaseConstructL(RFs& aFs, RFile& aFile, TDesC8& aCid)
+    {
+    iFs     = aFs;
+    iFile   = aFile;
+    ipCid    = aCid.AllocL();
+    iType = EFile;
+    }
+
+TFileOutgoingTransferProgress::TFileOutgoingTransferProgress( TInt aTxnId, TBool aIsIncoming, TInt aProgress, TBool aHasCidPostfix, TInt aCid, TInt aCid2 )
+    {
+    iTxnId = aTxnId;
+    iIsIncoming = aIsIncoming;
+    iProgress = aProgress;
+    iCid = aCid;
+    iCid2 = aCid2;
+    iHasCidPostfix = aHasCidPostfix;
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/src/sencoreservicemanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1634 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <mmtsy_names.h>
+#include <SenServiceConnection.h>   // error codes and framework ids
+#include <SenHostletConnection.h>   // error codes for hostlet connections
+#include <MSenServiceDescription.h>
+#include <MSenConsumerPolicy.h>
+#include <SenXmlUtils.h>
+#include "senwsdescription.h"
+#include "senwspattern.h"
+#include <MSenServicePolicy.h>
+
+#include "sencoreservicemanager.h"
+#include "senservicemanagerdefines.h"
+#include "senclientsession.h"
+#include "senxmldao.h"
+
+#include "sencoreshutdowntimer.h"
+
+#include "senserviceinvocationframework.h"  // internal Framework\inc
+#include "senservicesession.h"              // internal Framework\inc
+#include "sendebug.h"                       // internal Utils\inc
+#include "senlogger.h"                      // internal Utils\inc
+#include "senguidgen.h"                     // internal Utils\inc
+#include "senmultiuseridentitymanager.h"         // internal IdentityManager\inc
+#include "sencredentialmanager.h"           // internal CredentialManager\inc
+#include "seninternalcredential.h"
+
+// To be kept ONLY UNTIL there are real ECOM transport plug-ins available:
+#include "SenHttpTransportProperties.h"
+
+#include "sentransportcontext.h"
+
+#include "sentransport.h"
+
+#include "senservercontext.h"
+
+#include <RSenDocument.h>
+
+#include "senxmldebug.h"
+
+
+namespace
+    {
+    const TInt KBase64DecodeMultiplier  = 1;
+    const TInt KBase64EncodeMultiplier  = 2;
+// Deleted to fix for compiler warning  #177-D
+    _LIT(KSOAServerName,"SOAServer");
+    const TInt KFlatBufSize            = 64;
+    }
+
+
+
+CSenCoreServiceManager* CSenCoreServiceManager::NewL()
+    {
+    CSenCoreServiceManager* pNew = CSenCoreServiceManager::NewLC();
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenCoreServiceManager* CSenCoreServiceManager::NewLC()
+    {
+    CSenCoreServiceManager* pNew =
+        new (ELeave) CSenCoreServiceManager(EPriorityNormal);
+    CleanupStack::PushL(pNew);
+
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenCoreServiceManager::CSenCoreServiceManager(TInt aPriority)
+
+#ifndef RD_SEN_SC_MSG_DISPATCHER_ENABLED // == FALSE, DISPATCHER IS DISABLED   
+#ifdef EKA2
+:   CPolicyServer(aPriority, coreServiceManagerPolicy, EUnsharableSessions),
+  #else
+:   CServer2(aPriority, EUnsharableSessions), //IPC V2
+  #endif //EKA2
+
+#else // RD_SEN_SC_MSG_DISPATCHER_ENABLED == TRUE, DISPATCHER IS ENABLED
+  #ifdef EKA2
+:   CPolicyServer(aPriority, coreServiceManagerPolicy, ESharableSessions),
+  #else
+:   CServer2(aPriority, ESharableSessions), //IPC V2
+  #endif //EKA2
+#endif //RD_SEN_SC_MSG_DISPATCHER_ENABLED
+    iDAO(NULL),
+    iIdentityManager(NULL),
+    //iTransport(NULL),
+    iGuidGenerator(NULL),
+    iReader(NULL),
+    iNextTransactionId(0)
+//    ipActiveHostletEndpoints(NULL)
+    {
+    }
+
+void CSenCoreServiceManager::ConstructL()
+    {
+    iShutdownTimer = CSenCoreShutdownTimer::NewL();
+    
+    // Start by creating a GUID generator
+    iGuidGenerator = CSenGuidGen::NewL();
+
+
+#ifdef _SENDEBUG
+
+    // Open connection to the file logger server
+    // Create a logger
+    TLSLOG_OPEN_TO_MODE( KSenCoreServiceManagerLogChannelBase, KSenCoreServiceManagerLogLevel, KSenCoreServiceManagerLogDir, KSenCoreServiceManagerLogFile, EFileLoggingModeAppend );
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::ConstructL - Log file opened [2008-11-12], WSF version 1.9 - build 48");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Core instance (memory address): 0x%X"), this));
+
+//    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"Zapping filelogged messages (.xml)");
+
+    TLSLOG_OPEN(KSenFaultsLogChannel, KSenFaultsLogLevel, KSenFaults, KSenFaultsLog);
+    TLSLOG_OPEN(KSenUtilsLogChannel, KSenUtilsLogLevel, KSenUtils, KSenUtilsLog);
+
+    // zap logged messages (.xml)
+//    RFs fss;
+//    User::LeaveIfError(fss.Connect() == NULL);
+//    CleanupClosePushL(fss);
+//
+//    fss.Delete(_L("c:\\logs\\WsLog\\AS_init_req.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\AS_init_rsp.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\AS_req.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\AS_rsp.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\DS_lookup_req.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\DS_lookup_rsp.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\service_body_req.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\service_body_rsp.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\service_env_req.xml"));
+//    fss.Delete(_L("c:\\logs\\WsLog\\service_env_rsp.xml"));
+//    CleanupStack::PopAndDestroy(); // fss.Close()
+#endif // _SENDEBUG
+#ifdef _RD_SEN_ENABLE_CREDLOG    
+    CREDLOG_OPEN();
+    
+    CREDLOG_L(KSenCredsLogLevelMin,    "Creds.log level 1: MIN enabled.");
+    CREDLOG_L(KSenCredsLogLevelNormal, "Creds.log level 2: NORMAL enabled.");
+    CREDLOG_L(KSenCredsLogLevelMax,    "Creds.log level 3: MAX enabled.");
+    
+
+    _LIT8(KTestingCredsLogLine, "[min]: Logging level verification complete.");
+    CREDLOG(KSenCredsLogLevelMin, KTestingCredsLogLine);
+
+    _LIT8(KTestingCredsLongLogLine, "[normal] ------------------------------------------------------------------------------"); // could be more that 120 chars or so..
+    CREDLOG_ALL(KSenCredsLogLevelNormal, KTestingCredsLongLogLine);
+
+    _LIT8(KTestingCredsLogLineFormat, "[max] - Logging channel is: %d");
+    CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelMax, KTestingCredsLogLineFormat, KSenCredsLogChannel)); // on format lines you need to give channel (at the moment)
+#endif // _RD_SEN_ENABLE_CREDLOG    
+
+    // Create THE common XML reader inside Serene
+    iReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+
+    iIdentityManager = CSenMultiUserIdentityManager::NewL(*this);
+
+    iCredentialManager = CSenCredentialManager::NewL(*this);
+
+    iDAO = CSenXMLDAO::NewL(*(MSenCoreServiceManager*)this);
+    	
+	CREDLOG_L(KSenCredsLogLevelMin,    "GetImsiImeiL Started");    	
+    // Load the sessions from XML-file
+    GetImsiImeiL();
+	CREDLOG_L(KSenCredsLogLevelMin,    "GetImsiImeiL Completed");    
+    
+    iDAO->Load();
+
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"SenCoreServiceManager starting!");
+
+    // Create server context for SEN.EXE (could be done in thread function as well)
+    ipServerContext = CSenServerContext::NewL(*this);
+   
+    StartL(KSenServiceManager);
+    NotifyFrameworksL(KSenEventWsfReady);
+    }
+
+CSenCoreServiceManager::~CSenCoreServiceManager()
+    {
+
+    // Delete member variables
+    CSenCoreServiceManager::SetShowPasswordDialog(EFalse);
+    delete ipServerContext;
+    delete iDAO;
+    delete iCredentialManager;
+    if(iIdentityManager != NULL) // Fix for codescanner warning
+    {
+    iIdentityManager->WriteDatabase();
+    }
+    delete iIdentityManager;
+    delete iGuidGenerator;
+    delete iShutdownTimer;
+    delete iReader;
+    delete ipVtcpTransport;
+//    delete ipVtcpEndpoint;
+//    if(ipActiveHostletEndpoints)
+//        {
+//        ipActiveHostletEndpoints->ResetAndDestroy();
+//        delete ipActiveHostletEndpoints;
+//        }
+
+#ifdef _SENDEBUG
+    TLSLOG_CLOSE(KSenFaultsLogChannel);
+    TLSLOG_CLOSE(KSenUtilsLogChannel);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Log file closed.");
+
+    TLSLOG_CLOSE(KSenCoreServiceManagerLogChannelBase);
+#endif // _SENDEBUG
+
+    CREDLOG_CLOSE();
+
+    iStringPool.Close();
+//    iLog.Close();
+    }
+
+//////////////////////////////////////////////////////////////////////////
+// from MSenIdentityManager
+
+MSenIdentity& CSenCoreServiceManager::IdentityL()
+    {
+    return iIdentityManager->IdentityL();
+    }
+
+TInt CSenCoreServiceManager::UserNameL(HBufC8*& aUserName)
+    {
+    return iIdentityManager->UserNameL(aUserName);
+    }
+
+CSenIdentityProvider* CSenCoreServiceManager::IdentityProviderL(
+                                                        const TDesC8& aURI )
+    {
+    if(iIdentityManager)
+        return iIdentityManager->IdentityProviderL(aURI);
+    else
+        return NULL;
+    }
+
+CSenIdentityProvider* CSenCoreServiceManager::IdentityProviderL(
+                                                const CDesC8Array& aIdpList,
+                                                TBool aStrict)
+    {
+    if(iIdentityManager)
+        return iIdentityManager->IdentityProviderL(aIdpList,aStrict);
+    else
+        return NULL;
+    }
+
+
+CSenIdentityProvider* CSenCoreServiceManager::IdentityProviderL(
+                                MSenServiceDescription& aServiceDescription )
+    {
+    if(iIdentityManager)
+        return iIdentityManager->IdentityProviderL(aServiceDescription);
+    else
+        return NULL;
+    }
+
+CSenIdentityProvider* CSenCoreServiceManager::IdentityProviderL(
+                                            MSenServiceDescription& aService,
+                                            const CDesC8Array& aIdpList,
+                                            TBool aStrict)
+    {
+    if(iIdentityManager)
+        return iIdentityManager->IdentityProviderL(aService, aIdpList, aStrict);
+    else
+        return NULL;
+    }
+
+const RPointerArray<CSenIdentityProvider>& CSenCoreServiceManager::IdentityProvidersL()
+    {
+    if(!iIdentityManager) User::Leave(KErrNotFound);
+    return iIdentityManager->IdentityProvidersL();
+    }
+
+CSenIdentityProvider* CSenCoreServiceManager::IdentityProviderL()
+    {
+    if(iIdentityManager)
+        return iIdentityManager->IdentityProviderL();
+    else
+        return NULL;
+    }
+
+TInt CSenCoreServiceManager::RegisterIdentityProviderL(
+                                                CSenIdentityProvider* aIdp)
+    {
+    return iIdentityManager->RegisterIdentityProviderL(aIdp);
+    }
+
+TInt CSenCoreServiceManager::UnregisterIdentityProviderL(
+                                                CSenIdentityProvider& aIdp)
+    {
+    return iIdentityManager->UnregisterIdentityProviderL(aIdp);
+    }
+
+TBool CSenCoreServiceManager::AssociateServiceL(const TDesC8& aServiceID,
+                                                const TDesC8& aProviderID )
+    {
+    return iIdentityManager->AssociateServiceL(aServiceID, aProviderID);
+    }
+
+TBool CSenCoreServiceManager::DissociateServiceL(const TDesC8& aServiceID,
+                                                 const TDesC8& aProviderID )
+    {
+    return iIdentityManager->DissociateServiceL(aServiceID, aProviderID);
+    }
+
+TInt CSenCoreServiceManager::IdentitiesL( CDesC8Array& aIdentitiesList )
+    {
+    return iIdentityManager->IdentitiesL( aIdentitiesList );
+    }
+
+TInt CSenCoreServiceManager::AuthenticationForL(CSenIdentityProvider& aAccount, TPckgBuf<TSenAuthentication>& aResponse)
+    {
+    return iIdentityManager->AuthenticationForL( aAccount, aResponse );
+    }
+
+//////////////////////////////////////////////////////////////////////////
+
+
+// getter
+MSIF* CSenCoreServiceManager::Framework(const TDesC8& aFrameworkID)
+    {
+    return(iDAO->Framework(aFrameworkID));
+    }
+
+
+TInt CSenCoreServiceManager::InitServiceConnectionL(MSenRemoteServiceConsumer& aConsumer,
+                                                    CSenWSDescription& aPattern,
+                                                    HBufC8*& aErrorMsg)
+    {
+    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL");
+    TInt retVal(KErrNotFound);
+
+//    CSenWSDescription* pSD = iDAO->FindMatchingServiceDescription(aPattern);
+        
+    TInt bestScore;
+    CSenWSDescription* pSD = 
+        iDAO->FindMatchingSDAndBestScoreL(aPattern, bestScore);	//CodeScannerWarnings
+
+    if(!pSD) // service NOT found
+        {
+         CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+         CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ," - No matching service description in XML database.");
+
+        // request frameworks to search for a matching service
+        // as soon as a matching service is found retry the primary search
+
+        TInt additions = iDAO->AddServiceDescriptionToFrameworksL( aPattern, aConsumer, aErrorMsg );
+        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+        TInt error(KErrNone);
+        if( additions < 0 )
+            {
+            error = additions;
+            additions = 0;
+            }
+        CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8(" - Just added %d service description(s)."), additions));
+        if ( error )
+            {
+            retVal = error;
+            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"/ / / / / / / / / / / / / / /");
+            CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8(" - Error occurred: (%d)."), error));
+            if( aErrorMsg )
+                {
+                CSLOG_ALL(aConsumer.ConnectionId(),KMinLogLevel ,*aErrorMsg);
+                }
+             CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"/ / / / / / / / / / / / / / /");
+            }
+
+        if( additions > 0 ) // at least one SD was added, and no error occurred
+            {
+			/* We should now try the primary search again.
+			 * Note that we try to pick a service that matches 
+			 * at least as well as the best we had earlier
+			 * but at least the contract or endpoint should
+			 * match.
+			 */ 
+            pSD = iDAO->FindScoreMatchingServiceDescriptionL(aPattern, bestScore+1);	//CodeScannerWarnings
+//            pSD = iDAO->FindMatchingServiceDescription(aPattern);
+            }
+        }
+
+    if(pSD) // Service was found
+        {
+        // Update ProviderPolicy information
+        pSD->RebuildFrom(aPattern);
+        // Update ServicePolicy information
+        MSenServicePolicy* servicePolicy = pSD->ServicePolicy();
+        if(servicePolicy)
+            {
+            MSenServicePolicy* givenServicePolicy = aPattern.ServicePolicy();
+            if(givenServicePolicy)
+                servicePolicy->RebuildServicePolicyFrom(*givenServicePolicy);
+            }
+
+#ifdef _SENDEBUG
+        TPtrC8 endpoint = pSD->Endpoint();
+        if(endpoint.Length()>0)
+            {
+            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+           CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- Matching service found, endpoint: %S"), &endpoint));
+            }
+        else
+            {
+            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+            CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Matching service found; it has no endpoint.");
+            }
+#endif // _SENDEBUG
+
+        TPtrC8 patternFrameworkID = pSD->FrameworkId();
+        if(patternFrameworkID != KNullDesC8)
+            {
+            MSIF* pFramework = NULL;
+            pFramework = iDAO->Framework( patternFrameworkID );
+
+            if(pFramework)
+                {
+                CSenServiceSession* pSession = NULL;
+
+                TInt err = pFramework->CreateServiceSessionL(*pSD,
+                                                            aPattern,
+                                                            pSession,
+                                                            aConsumer,
+                                                            aErrorMsg);
+                CleanupStack::PushL(pSession);
+                if( err != KErrNone )
+                    {
+                    CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+                    CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8(" - CreateServiceSessionL failed, error: %d"), err));
+
+                    if ( pSession && pSession != pSD )
+                        {
+                        // Since session creation failed, delete the returned orphan
+                        // object. This should never occur; it is badly against the
+                        // "framework design paradigms"):
+                        CleanupStack::PopAndDestroy( pSession );
+                        }
+                    else
+                        {
+                        // NULL was returned
+                        CleanupStack::Pop( pSession );
+                        }
+                    return err;
+                    }
+                else
+                    {
+                    // Create service session OK
+                    // Note: isReady in Symbian c == isValid in Java
+                    if( pSession && pSession->IsReadyL() )
+                        {
+                        // bind consumer to the new session:
+                        pSession->AddConsumerL(aConsumer);
+                        aConsumer.SetSessionL(*pSession);
+                        UpdateTouchL(pSession);
+                        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+                        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ," - CreateServiceSessionL OK!");
+                        CleanupStack::Pop(); // pSession
+                        return KErrNone;
+                        }
+                    else
+                        {
+                        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CSenCoreServiceManager::InitServiceConnectionL:");
+                        CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Removing service description");
+
+                        if(pSession)
+                            {
+                            iDAO->Remove(*pSession);
+                            }
+                        else
+                            {
+                            iDAO->Remove(*pSD);
+                            }
+                        CleanupStack::Pop(pSession);
+                        return KErrNotReady;
+                        }
+                    }
+                }
+            }
+
+        }
+    // else { // service was not found }
+    return retVal;
+    }
+
+TInt CSenCoreServiceManager::ServiceDescriptionsL( RWSDescriptionArray& aMatches, const TDesC8& aContract )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::ServiceDescriptionsL(<contract>)");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - Collecting existing service descriptions with contract: %S"), &aContract));
+    return iDAO->FindAllMatchingServiceDescriptions(aMatches, aContract);
+    }
+
+TInt CSenCoreServiceManager::ServiceDescriptionsL(RWSDescriptionArray& aMatches, MSenServiceDescription& aPattern)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::ServiceDescriptionsL(<pattern>)");
+    return iDAO->FindAllMatchingServiceDescriptions(aMatches, aPattern);
+    }
+
+// Note that this method *always* takes the ownership of the SD
+TInt CSenCoreServiceManager::RegisterServiceDescriptionL( CSenWSDescription* apServiceDescription )
+    {
+    if(!apServiceDescription)
+        {
+        return KErrArgument;
+        }
+
+    TInt retVal(KErrNotFound);
+    MSIF* framework = Framework(apServiceDescription->FrameworkId());
+    if(framework)
+        {
+        retVal = framework->RegisterServiceDescriptionL(*apServiceDescription);
+
+        if(!iDAO->Owns(apServiceDescription))
+            {
+            delete apServiceDescription;
+            apServiceDescription = NULL;
+            }
+        }
+    else
+        {
+        delete apServiceDescription;
+        apServiceDescription = NULL;
+        }
+    return retVal;
+    }
+
+
+TInt CSenCoreServiceManager::UnregisterServiceDescriptionL( MSenServiceDescription& aServiceDescription )
+    {
+    TInt retVal(KErrNotFound);
+    MSIF* framework = Framework(aServiceDescription.FrameworkId());
+    if(framework)
+        {
+        retVal = framework->UnregisterServiceDescriptionL(aServiceDescription);
+        }
+    return retVal;
+    }
+
+
+CDesC8Array& CSenCoreServiceManager::SupportedFrameworksL()
+    {
+    return iDAO->SupportedFrameworksL();
+    }
+
+RFileLogger* CSenCoreServiceManager::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+void CSenCoreServiceManager::IncrementConnections()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::IncrementConnections");
+    if( iShutdownTimer && iShutdownTimer->IsActive() ) // iConnectionCount <= 0
+        {
+        iShutdownTimer->Deque(); // will prevent the active scheduler (of this server) from being stopped
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Shutdown timer cancelled, serving emerged new client.");
+        }
+    iConnectionCount++;
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Client count increased to: %d"),iConnectionCount));
+    }
+
+void CSenCoreServiceManager::DecrementConnections()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CSenCoreServiceManager::DecrementConnections");
+    iConnectionCount--;
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Client count decreased to: %d"),iConnectionCount));
+    if (iConnectionCount <= 0)
+        {
+        if( iShutdownTimer )
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Shutdown timer activated.");
+            iShutdownTimer->ActivateShutdown(); // will stop the active scheduler (of this server) after N secs, unless cancelled
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Stopping active scheduler.");
+            CActiveScheduler::Stop(); // in practice, not utilized anymore (with shutdown timer functionality)
+            }
+       }
+    }
+
+// from MSenCoreServiceManager
+HBufC8* CSenCoreServiceManager::RandomGuidL()
+    {
+    HBufC8* pRandomGuid =  iGuidGenerator->GetRandomGuid8LC();
+    CleanupStack::Pop();
+    return pRandomGuid;
+    }
+
+// NOTE(!): AddServiceDescriptionL() always takes the ownership of aServiceDescription
+TInt CSenCoreServiceManager::AddServiceDescriptionL( CSenWSDescription* apServiceDescription )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+
+    if(!apServiceDescription)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel," - Illegal argument: Cannot add NULL as ServiceDescription!");
+        return KErrArgument; 
+        }
+
+    TPtrC8 contract     = apServiceDescription->Contract();
+    TPtrC8 endpoint     = apServiceDescription->Endpoint();
+
+#ifdef _SENDEBUG
+    TPtrC8 frameworkID  = apServiceDescription->FrameworkId();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8(" - Framework ID: '%S'"),&frameworkID));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8(" - Endpoint: '%S'"),&endpoint));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8(" - Contract: '%S'"),&contract));
+#endif
+
+    if ( contract.Length() == 0 && endpoint.Length() == 0 )
+        {
+        delete apServiceDescription;
+        apServiceDescription = NULL;
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - No endpoint & no contract: invalid SD NOT added!");
+        return KErrSenNoContractNoEndPoint;
+        }
+
+    CSenWSDescription* pDuplicate =
+        iDAO->FindExactServiceDescriptionL(*apServiceDescription);	//CodeScannerWarnings
+
+    if(pDuplicate)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Duplicate found, going to unregister -> register!");
+
+        // Signal the frameworks: the duplicate ownership is
+        // theirs (it can be deleted, etc)
+        if( iDAO->Remove( *pDuplicate ) ) // true if matching SD already exists
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Removed duplicate, adding new SD.");
+
+            TInt retVal = iDAO->Add(*apServiceDescription);
+            if(retVal!=KErrNone)
+                {
+                // Failed to add new SD to XML DAO, must free the orphan
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Could NOT add as new SD. Deleting this orphan.");
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - error code: %d"),retVal));
+
+                // delete the new instance and return error (to framework)
+                delete apServiceDescription;
+                apServiceDescription = NULL;
+                return retVal; 
+                }
+#ifdef _SENDEBUG
+            else
+                {
+                // Successfully added new SD, XMLDAO now owns it
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Successfully added as new SD instance.");
+                }
+#endif
+            }
+        else
+            {
+            // Failed to remove duplicate SD from database
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Remove duplicate SD failed. Returning error.");
+
+            // delete the new instance and return error (to framework)
+            delete apServiceDescription;
+            apServiceDescription = NULL;
+            return KErrGeneral; 
+            }
+
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::AddServiceDescriptionL()");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Adding new service description.");
+        iDAO->Add(*apServiceDescription);
+        }
+
+    return KErrNone;
+    }
+
+TInt CSenCoreServiceManager::RemoveServiceDescriptionL( CSenWSDescription& aServiceDescription )
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenCoreServiceManager::RemoveServiceDescriptionL:")));
+
+#ifdef _SENDEBUG
+    CBufFlat* pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream writeStream;
+    writeStream.Open(*pBuf);
+    CleanupClosePushL(writeStream);
+    aServiceDescription.WriteAsXMLToL(writeStream);
+    TPtr8 asXml = pBuf->Ptr(0);
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(asXml));
+    CleanupStack::PopAndDestroy(2); // writeStream.Close(), pBuf
+#endif // _SENDEBUG
+
+    if( iDAO->Remove( aServiceDescription ) )
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(_L("Removed matching SD!")));
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(_L("No matching SD found!")));
+        return KErrNotFound;
+        }
+
+    return KErrNone;
+    }
+
+// 2005-09-11: note that function leaves(!), if framework was
+// not successfully added to XML DAO
+CSenBaseFragment* CSenCoreServiceManager::InstallFrameworkL(const TDesC8& aCue)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase, KMinLogLevel,(_L("CSenCoreServiceManager::InstallFrameworkL, cue:")));
+    TLSLOG(KSenCoreServiceManagerLogChannelBase, KMinLogLevel,(aCue));
+    CSIF* pFramework = CSIF::NewL(aCue, *this);
+    CleanupStack::PushL(pFramework);
+
+#ifdef _SENDEBUG
+        HBufC8* ptrBuf = pFramework->AsXmlL();
+        if(ptrBuf)
+            {
+            CleanupStack::PushL(ptrBuf);
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*ptrBuf));
+            CleanupStack::PopAndDestroy();
+            }
+#endif // _SENDEBUG
+
+
+    CSenBaseFragment* frameworkConfigParser = & pFramework->ConfigParser();
+    TInt retCode(iDAO->Add(*pFramework));
+    if(retCode==KErrNone)
+        {
+        CleanupStack::Pop(); //
+        }
+    else
+        {
+        // delete orpan SIF plug-in instance now
+        CleanupStack::PopAndDestroy();
+        }
+
+    // leave, if add plug-in to DAO failed
+    User::LeaveIfError(retCode);
+
+
+    return frameworkConfigParser;
+    }
+
+TInt CSenCoreServiceManager::SaveL(const CSenServiceSession& aServiceSession)
+    {
+    return iDAO->SaveL(aServiceSession);
+    }
+
+TInt CSenCoreServiceManager::SaveL(const CSIF& aServiceInvocationFramework)
+    {
+    return iDAO->SaveL(aServiceInvocationFramework);
+    }
+
+CSenXmlReader* CSenCoreServiceManager::XMLReader()
+    {
+    return iReader;
+    }
+
+// notifies *ALL* framework plug-ins about certain event
+TInt CSenCoreServiceManager::NotifyFrameworksL(const TInt aEvent)
+    {
+    return NotifyFrameworksL(KNullDesC8, aEvent, NULL);
+    }
+
+// same as above, with an additional pointer argument
+TInt CSenCoreServiceManager::NotifyFrameworksL(const TInt aEvent,
+                                               TAny* aArgument)
+    {
+    return NotifyFrameworksL(KNullDesC8, aEvent, aArgument);
+    }
+
+
+// notifies only those frameworks plug-ins, which match
+// with given framework ID (aFrameworkID)
+//
+// Note(!): if aFrameworkID == KNullDesC8 (zero-length),
+// then *all* known framework plug-ins are notified
+// about the event.
+TInt CSenCoreServiceManager::NotifyFrameworksL(const TDesC8& aFrameworkID,
+                                             const TInt aEvent)
+    {
+    return NotifyFrameworksL(aFrameworkID, aEvent, NULL);
+    }
+
+
+TInt CSenCoreServiceManager::NotifyFrameworksL(const TDesC8& aFrameworkID,
+                                             const TInt aEvent,
+                                             TAny* aArgument)
+    {
+    return iDAO->NotifyFrameworksL(aFrameworkID, aEvent, aArgument);
+    }
+
+
+
+//MSenIdentityManager& CSenCoreServiceManager::IdentityManager()
+//    {
+//    return *(MSenIdentityManager*)this;
+//    }
+
+
+// CServer implementation:
+CSession2* CSenCoreServiceManager::NewSessionL( const TVersion &aVersion, const RMessage2& /*aMessage*/) const //IPC V2
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenCoreServiceManager::NewSessionL() start")));
+
+    // Check we're the right version
+    if ( !User::QueryVersionSupported(TVersion(KWsfServMajorVersionNumber,
+         KWsfServMinorVersionNumber,
+         KWsfServBuildVersionNumber),
+         aVersion))
+        {
+        User::Leave(KErrNotSupported);
+        }
+    return CSenClientSession::NewL( *const_cast<CSenCoreServiceManager*> (this), *ipServerContext );
+    }
+
+
+void CSenCoreServiceManager::ThreadFunctionL()
+    {
+    // Construct active scheduler
+    CActiveScheduler* pActiveScheduler = new (ELeave) CActiveScheduler;
+    CleanupStack::PushL(pActiveScheduler) ;
+
+
+    // Install active scheduler
+    // We don't need to check whether an active scheduler is already installed
+    // as this is a new thread, so there won't be one
+    CActiveScheduler::Install(pActiveScheduler);
+
+    // Give a name to this thread
+    User::LeaveIfError(User::RenameThread(KSOAServerName));
+
+    RSenDocument::ManualXmlEngineTlsAttachL();
+
+    // Construct our server
+    CSenCoreServiceManager::NewLC(); 
+
+    RSemaphore semaphore;
+    CleanupClosePushL(semaphore);
+    User::LeaveIfError(semaphore.OpenGlobal(KSenServiceManagerSemaphoreName));
+
+    // Semaphore opened ok
+    semaphore.Signal();
+    CleanupStack::PopAndDestroy(); // close semaphore
+
+    // Start handling requests
+    CActiveScheduler::Start();
+
+    CleanupStack::PopAndDestroy(); // CSenCoreServiceManager
+    
+    RSenDocument::ManualXmlEngineTlsCleanup();
+
+    CleanupStack::PopAndDestroy(); // pActiveScheduler
+    }
+
+void CSenCoreServiceManager::PanicClient(const RMessage2& aMessage,
+                                         TWsfServPanic aPanic)
+    {
+    aMessage.Panic(KSenServiceManagerPanic, aPanic);
+    }
+
+void CSenCoreServiceManager::PanicServer(TWsfServPanic aPanic)
+    {
+    User::Panic(KSenServiceManagerPanic, aPanic);
+    }
+
+// @param aCommand is the 2nd argument given to RProcess::Create() method by the invoking client
+TInt CSenCoreServiceManager::ThreadFunction(TAny* /* aCommand */)
+    {
+#ifdef _SENDEBUG
+#ifdef _DEBUG
+#ifndef _RD_SEN_DO_NOT_USE_UHEAP_MARKING
+    __UHEAP_MARK;
+#endif // _RD_SEN_DO_NOT_USE_UHEAP_MARKING   
+#endif // _DEBUG
+#endif // _SENDEBUG
+
+    CTrapCleanup* pCleanupStack = CTrapCleanup::New();
+    if ( pCleanupStack == NULL )
+        {
+        PanicServer(ECreateTrapCleanup);
+        }
+
+    TRAPD( err, ThreadFunctionL(); )
+    if (err != KErrNone)
+        {
+        PanicServer( ESrvCreateServer );
+        }
+
+    delete pCleanupStack;
+    pCleanupStack = NULL;
+    REComSession::FinalClose();
+#ifdef _SENDEBUG
+#ifdef _DEBUG
+#ifndef _RD_SEN_DO_NOT_USE_UHEAP_MARKING
+    __UHEAP_MARKEND; // check memory leaks
+#endif // _RD_SEN_DO_NOT_USE_UHEAP_MARKING   
+#endif // _DEBUG
+#endif // _SENDEBUG
+
+    return KErrNone;
+    }
+
+
+// We come here, if CSenClientSessions's ServiceL has leaved:
+TInt CSenCoreServiceManager::RunError(TInt aError)
+    {
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenCoreServiceManager::RunError( %d )"),aError));
+    if (aError == KErrBadDescriptor)
+        {
+        // A bad descriptor error implies a badly programmed client,
+        // so panic it..
+        PanicClient(Message(), EBadDescriptor);
+        }
+    else
+        {
+        // .. otherwise report the error to the client
+        Message().Complete(aError);
+        }
+
+    // The leave will result in an early return from CServer::RunL(), skipping
+    // the call to request another message. So do that now in order to keep the
+    // server running.
+    ReStart();
+
+    return KErrNone;    // handled the error fully
+    }
+
+
+
+// Base64 encode/decode
+HBufC8* CSenCoreServiceManager::EncodeToBase64LC(const TDesC8& aSource)
+    {
+    HBufC8* pResult8 =
+            HBufC8::NewLC(aSource.Length() * KBase64EncodeMultiplier);
+    TPtr8 result8 = pResult8->Des();
+    Base64Codec().Encode(aSource, result8);
+    return pResult8;
+    }
+
+HBufC8* CSenCoreServiceManager::DecodeFromBase64LC(const TDesC8& aSource)
+    {
+    HBufC8* pResult8 =
+            HBufC8::NewLC(aSource.Length() * KBase64DecodeMultiplier);
+    TPtr8 result8 = pResult8->Des();
+    Base64Codec().Decode(aSource, result8);
+    return pResult8;
+    }
+
+// private getter, which always initializes the base64codec
+TImCodecB64& CSenCoreServiceManager::Base64Codec()
+    {
+    iBase64Codec.Initialise();
+    return iBase64Codec;
+    }
+
+TPtrC8 CSenCoreServiceManager::SenSecurityMechanismNames8L()
+    {
+    return iIdentityManager->SenSecurityMechanismNames8L();
+    }
+
+CSenSecurityMechanism* CSenCoreServiceManager::MechanismNamedL(
+                                                        const TDesC8& aName)
+    {
+    return iIdentityManager->MechanismNamedL(aName);
+    }
+
+void CSenCoreServiceManager::SetShowPasswordDialog(const TBool aState)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::SetShowPasswordDialog");
+    iIdentityManager->SetShowPasswordDialog(aState);
+    }
+
+TInt CSenCoreServiceManager::ContainsServiceDescriptionL(TBool& aContains,
+                                                         CSenWSDescription& aPattern)
+    {
+    return iDAO->ContainsServiceDescriptionL(aContains, aPattern);
+    }
+
+TInt CSenCoreServiceManager::ContainsIdentityProviderL(TBool& aContains,
+                                                    CSenIdentityProvider& aIDP)
+    {
+    return iIdentityManager->ContainsIdentityProviderL(aContains, aIDP);
+    }
+
+
+TInt CSenCoreServiceManager::SizeOfServiceDescriptionsL(RWSDescriptionArray& aArray)
+    {
+    TInt size(0);
+
+    TInt count = aArray.Count();
+    CBufFlat* pBuf = NULL;
+    for(TInt i = 0; i < count; i++)
+        {
+        pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+
+        aArray[i]->WriteAsXMLToL(bufWs);
+        TPtr8 p8 = pBuf->Ptr(0);
+        size += p8.Length();
+        CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+        pBuf = NULL;
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenCoreServiceManager::SizeOfServiceDescriptionsL: %d"),size));
+
+
+    return size;
+    }
+TInt CSenCoreServiceManager::SizeOfIdentityProvidersL(const RPointerArray<CSenIdentityProvider>& aArray)
+    {
+    TInt size(0);
+
+    TInt count = aArray.Count();
+    CBufFlat* pBuf = NULL;
+    for(TInt i = 0; i < count; i++)
+        {
+        pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+
+        aArray[i]->WriteAsXMLToL(bufWs);
+        TPtr8 p8 = pBuf->Ptr(0);
+        size += p8.Length();
+        CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+        pBuf = NULL;
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenCoreServiceManager::SizeOfIdentityProvidersL: %d"),size));
+
+    return size;
+    }
+
+TInt CSenCoreServiceManager::SizeOfCredentialsL(RSenCredentialArray& aArray)
+    {
+    _LIT8(KNoProperties, "-");
+    TInt size(0);
+
+    TInt count = aArray.Count();
+    CBufFlat* pBuf = NULL;
+    for(TInt i = 0; i < count; i++)
+        {
+        pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+
+        aArray[i]->WriteAsXMLToL(bufWs);
+        if ( aArray[i]->HasProperties() )
+            {
+            aArray[i]->PropertiesL().WriteAsXMLToL(bufWs);	//codescannerwarnings            
+            }
+        else
+            {
+            bufWs.WriteL(KNoProperties);
+            }
+
+        TPtr8 p8 = pBuf->Ptr(0);
+        size += p8.Length();
+        
+        CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+        pBuf = NULL;
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenCoreServiceManager::SizeOfCredentialsL: %d"),size));
+
+
+    return size;
+    }
+
+CSenTransportBase* CSenCoreServiceManager::CreateL( CSenWSDescription& aInitializer,
+                                                    CSenServiceSession* apSession)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::CreateL:");
+    TInt leaveCode(KErrNone);
+
+    CSenTransportBase* pTransport = NULL;
+
+    TPtrC8 transportCue = aInitializer.TransportCue();
+    if( apSession && (apSession->TransportCue().Length()>0) )
+        {
+        transportCue.Set( apSession->TransportCue() );
+        } 
+
+    TPtrC8 uriScheme;
+    if( transportCue.Length() == 0 )
+        {
+        // Next, attempt resolve the <scheme> from the endpoint
+
+        TPtrC8 uri = aInitializer.Endpoint();
+        if(uri.Length()>0)
+            {
+            TInt index = uri.Locate(':');
+            if(index!=KErrNotFound)
+                {
+                uriScheme.Set( uri.Left(index) );
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- URI scheme is: '%S'"),&uriScheme));
+                transportCue.Set(iDAO->TransportPluginCueBySchemeL(uriScheme));
+                }
+            }
+        }
+        
+/*
+    TBool isVtcp(EFalse);
+    if ( transportCue == KSenTransportCueVirtualTCP || uriScheme == KSenTransportSchemeTCP )
+        {
+        isVtcp = ETrue;
+        if ( ipVtcpTransport )
+            {
+            if( ipVtcpEndpoint && *ipVtcpEndpoint == aInitializer.Endpoint() )
+                {
+                return ipVtcpTransport;
+                }
+            else
+                {
+//                delete ipVtcpTransport; // not owned!
+                ipVtcpTransport = NULL;
+                delete ipVtcpEndpoint;
+                ipVtcpEndpoint = NULL;
+                //ipVtcpEndpoint = aInitializer.Endpoint().AllocL();
+                }
+            }
+//        else { // we are creating a new transport instance }        
+        }
+*/    
+    
+    // TEST
+    CSenTransportContext* pCtx = NULL;
+    if(apSession)
+        {
+        pCtx = CSenTransportContext::NewLC( *this, aInitializer, *apSession );
+        }
+    else
+        {
+        pCtx = CSenTransportContext::NewLC( *this, aInitializer );
+        }
+        
+    if( transportCue.Length() > 0 )
+        {
+        // Utilize the cue:
+       if ( transportCue == KSenTransportCueVirtualTCP || uriScheme == KSenTransportSchemeTCP )       
+            {
+            if ( !ipVtcpTransport )
+                {
+                TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, _L8("- About to instantiate new vTCP transport (args: cue: '%S', ctx)"), &transportCue ));
+                TRAP( leaveCode, ipVtcpTransport = CSenTransport::NewL( transportCue, pCtx ); )
+                if( leaveCode )
+                    {
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Could not load vTCP transport plugin, leave: %d"),leaveCode));
+				     CleanupStack::Pop(pCtx);					
+                    User::Leave( leaveCode ); // throw forward
+                    }
+                CleanupStack::Pop(pCtx); // ownership is NOW safely transferred to newly created transport plug-in
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(pCtx); 
+                }
+            pTransport = ipVtcpTransport;
+            }
+        else
+            {
+            TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, _L8("- About to instantiate new transport (args: cue: '%S', ctx)"), &transportCue ));
+            TRAP( leaveCode, pTransport = CSenTransport::NewL(transportCue, pCtx); )
+            if( leaveCode )
+                {
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Could not load new transport plugin, leave: %d"),leaveCode));
+				CleanupStack::Pop(pCtx);				
+                User::Leave( leaveCode ); // throw forward
+                }
+            CleanupStack::Pop(pCtx); // ownership is NOW safely transferred to newly created transport plug-in
+            
+            }
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- About to instantiate new transport (arg: ctx)");
+        // default to HTTP Channel transport plug-in:
+        TRAP( leaveCode, pTransport = CSenTransport::NewL(pCtx); )
+        if( leaveCode )
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Could not load new transport plugin, leave: %d"),leaveCode));
+			CleanupStack::Pop(pCtx);
+            User::Leave( leaveCode ); // throw forward
+            }
+        CleanupStack::Pop(pCtx); // ownership is NOW safely transferred to newly created transport plug-in
+        }
+
+    CleanupStack::PushL(pTransport);
+
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" aInitializer.DescriptionClassType() == %d "),aInitializer.DescriptionClassType() )); 
+
+    if( aInitializer.DescriptionClassType() == MSenServiceDescription::EWSDescription )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"Class type is: MSenServiceDescription::EWSDescription.");
+        TUint32 desiredIapId(0);
+        TInt retVal = aInitializer.IapId(desiredIapId);
+        if(retVal==KErrNone)
+            {
+            CSenTransportProperties* pProperties = CSenTransportProperties::NewLC();
+            pProperties->SetIapIdL(desiredIapId);
+            HBufC8* pPropertiesAsXml = pProperties->AsUtf8LC();
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Consumer Policy -layer's Transport Properties as XML:");
+            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*pPropertiesAsXml));
+            pTransport->SetPropertiesL(*pPropertiesAsXml, MSenLayeredProperties::ESenProviderSessionLayer, NULL);
+            CleanupStack::PopAndDestroy(pPropertiesAsXml);
+            CleanupStack::PopAndDestroy(pProperties);
+            }
+        }
+    else if( aInitializer.DescriptionClassType() == MSenServiceDescription::EWSPattern )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"Class type is: MSenServiceDescription::EWSPattern.");
+        CSenWSPattern* pConsumerPolicy = (CSenWSPattern*)&aInitializer;
+
+        TUint32 desiredIapId(0);
+        TInt retVal = pConsumerPolicy->ConsumerIapId(desiredIapId);
+        if(retVal==KErrNone)
+            {
+            CSenTransportProperties* pProperties = CSenTransportProperties::NewLC();
+            pProperties->SetIapIdL(desiredIapId);
+            HBufC8* pPropertiesAsXml = pProperties->AsUtf8LC();
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Consumer Policy -layer's Transport Properties as XML:");
+            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(*pPropertiesAsXml));
+            pTransport->SetPropertiesL(*pPropertiesAsXml, MSenLayeredProperties::ESenConsumerSessionLayer, NULL);
+            CleanupStack::PopAndDestroy(pPropertiesAsXml);
+            CleanupStack::PopAndDestroy(pProperties);
+            }
+        retVal = aInitializer.IapId(desiredIapId);
+        if(retVal==KErrNone)
+            {
+            CSenTransportProperties* pProperties = CSenTransportProperties::NewLC();
+            pProperties->SetIapIdL(desiredIapId);
+            HBufC8* pPropertiesAsXml = pProperties->AsUtf8LC();
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Provider Policy -layer's Transport Properties as XML:");
+            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(*pPropertiesAsXml));
+            pTransport->SetPropertiesL(*pPropertiesAsXml, MSenLayeredProperties::ESenProviderSessionLayer, NULL);
+            CleanupStack::PopAndDestroy(pPropertiesAsXml);
+            CleanupStack::PopAndDestroy(pProperties);
+            }
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Initializer SD's type is unknown!");
+        }
+#endif // _SENDEBUG     
+
+    // Check if Serene-wide proxy settings have been defined:
+    const TDesC8& proxyHost = iDAO->ProxyHost();
+    const TInt proxyPort = iDAO->ProxyPort();
+
+    if ( proxyHost.Length() > 0 || proxyPort > 0 )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Using proxy settings to get HTTP transport, but without policy info.");
+
+        CSenTransportProperties* pProperties = CSenTransportProperties::NewLC();
+        pProperties->SetProxyHostL(proxyHost);
+        pProperties->SetProxyPortL(proxyPort);
+        HBufC8* pPropertiesAsXml = pProperties->AsUtf8LC();
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Serene-wide -layer's Transport Properties as XML:");
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*pPropertiesAsXml));
+        pTransport->SetPropertiesL(*pPropertiesAsXml, MSenLayeredProperties::ESenConsumerSessionLayer, NULL);
+        CleanupStack::PopAndDestroy(pPropertiesAsXml);
+        CleanupStack::PopAndDestroy(pProperties);
+        }
+
+    // Set framework specific transport properties
+
+    TPtrC8 frameworkID(aInitializer.FrameworkId());
+    if ( frameworkID.Length()== 0 && apSession)
+        {
+        frameworkID.Set(apSession->FrameworkId());
+        }
+    if ( frameworkID.Length() > 0 )
+        {
+        MSIF* pFramework = Framework(frameworkID);
+        if ( pFramework )
+            {
+            TInt setRetVal = pFramework->SetTransportPropertiesL(*pTransport);
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- pFramework->SetTransportPropertiesL returned: %d"), setRetVal )); 
+            }
+        }
+#ifdef _SENDEBUG   
+    else
+        {     
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel," - Initializer SD's Framework ID is zero-length!");    
+        }
+#endif // _SENDEBUG
+#ifdef _SENDEBUG
+    HBufC8* pEffectiveProperties = NULL;
+    TInt effRetVal = pTransport->PropertiesL(pEffectiveProperties);
+    CleanupStack::PushL(pEffectiveProperties);
+    if( effRetVal == KErrNone && pEffectiveProperties )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Effective Transport Properties (flattened) as XML:");    
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*pEffectiveProperties));
+        }
+    CleanupStack::PopAndDestroy(pEffectiveProperties);
+#endif // _SENDEBUG
+
+    CleanupStack::Pop(pTransport);
+/*    
+    if( isVtcp )
+        {
+        ipVtcpTransport = pTransport;
+        ipVtcpEndpoint = aInitializer.Endpoint().AllocL();
+        }
+*/
+    return pTransport;
+    }
+
+MSenProvider& CSenCoreServiceManager::LookupHostletForL(const TDesC8& aHostletEndpoint,
+                                                         const TDesC& aReqThreadId,
+                                                         const TDesC8& aReqConsumerId)
+    {
+    // LookupHostletForL() method needs to be wrapped inside critical section
+    // NOTE: do *NOT* file log before this line(!):
+    iDAO->iCriticalSection.Wait(); // will pass through only one thread at the time
+    MSenProvider& provider = iDAO->LookupHostletForL(aHostletEndpoint, aReqThreadId, aReqConsumerId);
+    iDAO->iCriticalSection.Signal(); // allow next, pending thread to proceed, if such exists
+    return provider;
+    }
+
+TInt CSenCoreServiceManager::ReleaseHostletL(const MSenProvider* aHostlet,
+                                             const TDesC& aReqThreadId,
+                                             const TDesC8& aReqConsumerId)
+    {
+    // LookupHostletForL() method needs to be wrapped inside critical section
+    // NOTE: do *NOT* file log before this line(!):
+    iDAO->iCriticalSection.Wait(); // will pass through only one thread at the time
+    TInt retVal = iDAO->ReleaseHostletL(aHostlet, aReqThreadId, aReqConsumerId);
+    iDAO->iCriticalSection.Signal(); // allow next, pending thread to proceed, if such exists
+    return retVal;
+    }
+
+RStringPool& CSenCoreServiceManager::StringPool()
+    {
+    return iStringPool;
+    }
+
+// Helper
+/*
+RPointerArray<HBufC8>& CSenCoreServiceManager::ActiveHostletEndpointsL()
+    {
+    if(!ipActiveHostletEndpoints)
+        {
+        ipActiveHostletEndpoints = new (ELeave) RPointerArray<HBufC8>;
+        }
+    return *ipActiveHostletEndpoints;
+    }
+
+
+TInt CSenCoreServiceManager::AddActiveHostletConnectionEndpointL(const TDesC8& aEndpoint)
+    {
+    LOG_WRITEFORMAT((_L8("CSenCoreServiceManager::AddActiveHostletConnectionEndpointL(%S)"), &aEndpoint));
+    RPointerArray<HBufC8>& active = ActiveHostletEndpointsL();
+    TInt count(active.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        HBufC8* pEndpoint = active[i];
+        if(pEndpoint && *pEndpoint == aEndpoint)
+            {
+            LOG_WRITE_L("- Endpoint already reserved.");
+            return KErrSenEndpointReserved; // from SenHostletConnection.h
+            }
+        }
+
+    User::LeaveIfError(active.Append(aEndpoint.AllocL()));
+    return KErrNone;
+    }
+
+TInt CSenCoreServiceManager::RemoveActiveHostletConnectionEndpoint(const TDesC8& aEndpoint)
+    {
+    LOG_WRITEFORMAT((_L8("CSenCoreServiceManager::RemoveActiveHostletConnectionEndpoint(%S):"), &aEndpoint));
+    TInt retVal(KErrNotFound);
+    RPointerArray<HBufC8>& active = ActiveHostletEndpointsL();
+    TInt count(active.Count());
+    TInt i = 0;
+    for(; i<count; i++)
+        {
+        HBufC8* pEndpoint = active[i];
+        if(pEndpoint && *pEndpoint == aEndpoint)
+            {
+            LOG_WRITEFORMAT((_L8("- Match (%d) in the list of active endpoints found!"), i));
+            break; // match
+            }
+        }
+    if(i<count)
+        {
+        // match occured, remove the endpoint
+        LOG_WRITEFORMAT((_L8("- Removing (%d) the endpoint now."), i));
+        active.Remove(i);
+        retVal = KErrNone;
+        }
+    return retVal;
+    }
+*/
+
+TInt CSenCoreServiceManager::NextTransactionId()
+    {
+    iNextTransactionId++;
+    return iNextTransactionId;
+    }
+
+TInt CSenCoreServiceManager::SaveCredentialDB()
+    {
+    return iCredentialManager->SaveCredentialDB();
+    }
+
+TInt CSenCoreServiceManager::CredentialsL(const CSenWSDescription& aPattern,
+								          RSenCredentialArray& aCredentials)
+    {
+    return iCredentialManager->CredentialsL(aPattern, aCredentials);
+    }
+
+TInt CSenCoreServiceManager::CredentialsL(const CSenWSDescription& aPattern,
+					                      const CSenIdentityProvider& aIdP,
+								          RSenCredentialArray& aCredentials)
+    {
+    return iCredentialManager->CredentialsL(aPattern, aIdP, aCredentials);
+    }
+
+TInt CSenCoreServiceManager::CredentialsL(const CSenWSDescription& aPattern,
+								          RSenCredentialPtrArray& aCredentials)
+    {
+    return iCredentialManager->CredentialsL(aPattern, aCredentials);
+    }
+
+TInt CSenCoreServiceManager::CredentialsL(const CSenWSDescription& aPattern,
+					                      const CSenIdentityProvider& aIdP,
+								          RSenCredentialPtrArray& aCredentials)
+    {
+    return iCredentialManager->CredentialsL(aPattern, aIdP, aCredentials);
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::AddCredentialL(CSenInternalCredential* apCredential,
+                                                          TInt& aErrorTo)
+    {
+    return iCredentialManager->AddCredentialL(apCredential, aErrorTo);
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::AddCredentialL(CSenIdentityProvider* apIdP,
+                                                         CSenInternalCredential* apCredential,
+                                                         TInt& aErrorTo)
+    {
+    return iCredentialManager->AddCredentialL(apIdP, apCredential, aErrorTo);
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::AddCredentialL(const TDesC8& aCredential,
+                                                         TInt& aErrorTo)
+    {
+    return iCredentialManager->AddCredentialL(aCredential, aErrorTo);
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::AddCredentialL(CSenIdentityProvider* apIdP,
+	        								              const TDesC8& aCredential,
+			        						              TInt& aErrorTo)
+    {
+    return iCredentialManager->AddCredentialL(apIdP, aCredential, aErrorTo);
+    }
+
+TInt CSenCoreServiceManager::RemoveCredentialsL(const CSenWSDescription& aPattern)
+    {
+    return iCredentialManager->RemoveCredentialsL(aPattern);
+    }
+
+TInt CSenCoreServiceManager::RemoveCredentialsL(const CSenWSDescription& aPattern,
+						                        const CSenIdentityProvider& aIdP)
+    {
+    return iCredentialManager->RemoveCredentialsL(aPattern, aIdP);
+    }
+
+TInt CSenCoreServiceManager::RemoveCredentialsL(const TDesC8& aProviderId)
+    {
+    return iCredentialManager->RemoveCredentialsL(aProviderId);
+    }
+
+TInt CSenCoreServiceManager::RemoveCredentialL(TInt aInternalCredentialId)	//codescannerwarnings
+    {
+    return iCredentialManager->RemoveCredentialL(aInternalCredentialId);	//codescannerwarnings
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::CredentialL(TInt aInternalCredentialId,
+                                                      TInt& aErrorTo)
+    {
+    return iCredentialManager->CredentialL(aInternalCredentialId, aErrorTo);
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::UpdateCredentialL(TInt aInternalCredentialId,
+                                                     CSenInternalCredential* apCredential,
+                                                     TInt& aErrorTo)
+    {
+    return iCredentialManager->UpdateCredentialL(aInternalCredentialId,
+                                                 apCredential,
+                                                 aErrorTo);
+    }
+
+RSenCredentialPtr CSenCoreServiceManager::UpdateCredentialL(TInt aInternalCredentialId,
+                                                            const TDesC8& aCredential,
+                                                            TInt& aErrorTo)
+    {
+    return iCredentialManager->UpdateCredentialL(aInternalCredentialId,
+                                                 aCredential,
+                                                 aErrorTo);
+    }
+
+TInt CSenCoreServiceManager::FindMatchingIdentityProviderL(CSenIdentityProvider &aIdP,
+                                                           CSenIdentityProvider*& apMatch)
+    {
+    return iIdentityManager->FindMatchingIdentityProviderL(aIdP, apMatch);
+    }
+
+TInt CSenCoreServiceManager::UpdateIdentityProviderL(CSenIdentityProvider& aIdp)
+    {
+    return iIdentityManager->UpdateIdentityProviderL(aIdp);
+    }
+
+TInt CSenCoreServiceManager::NextConnectionID()
+    {
+    return iConnectionID++;
+    }
+void CSenCoreServiceManager::UpdateTouchL(CSenServiceSession* aSession)
+	{
+	MSenServiceDescription& sd = aSession->AsServiceDescription();
+	
+	iIdentityManager->UpdateTouchIdentityDBL(sd);
+	iCredentialManager->UpdateTouchCredDBL(sd);
+	iDAO->UpdateTouchSessionDBL(sd);
+
+	}
+TPtrC8 CSenCoreServiceManager::IMSI()
+    {
+    return iIMSI;    
+    }
+/*
+void CSenCoreServiceManager::GetIMSIL()
+    {
+    TBuf<15> phoneImsi;
+    
+    RTelServer server;
+    User::LeaveIfError( server.Connect() );
+    CleanupClosePushL( server );
+
+    RMobilePhone phone;
+    User::LeaveIfError( server.LoadPhoneModule( KMmTsyModuleName ) );
+    User::LeaveIfError( phone.Open( server, KMmTsyPhoneName ) );
+    CleanupClosePushL( phone );
+    User::LeaveIfError( phone.Initialise() );
+
+    TRequestStatus status;    
+    phone.GetSubscriberId( status, phoneImsi );
+    User::WaitForRequest( status );
+    //User::LeaveIfError( status.Int() );
+    
+    iIMSI.Copy(phoneImsi);
+    
+    status = KErrNone;
+
+    CleanupStack::PopAndDestroy( 2 ); // phone, server
+    }
+*/    
+TPtrC8 CSenCoreServiceManager::IMEI()
+	{
+    return iIMEI;		
+	}
+		
+void CSenCoreServiceManager::GetImsiImeiL()
+    {
+	CREDLOG_L(KSenCredsLogLevelMin,    "GetImsiImeiL Entered");    	
+    TBuf<15> phoneImsi;
+    TBuf<RMobilePhone::KPhoneSerialNumberSize> phoneImei;
+    RMobilePhone::TMobilePhoneIdentityV1 phoneIdV1;
+        
+    RTelServer server;
+    User::LeaveIfError( server.Connect() );
+    CleanupClosePushL( server );
+
+    RMobilePhone phone;
+    User::LeaveIfError( server.LoadPhoneModule( KMmTsyModuleName ) );
+    User::LeaveIfError( phone.Open( server, KMmTsyPhoneName ) );
+    CleanupClosePushL( phone );
+    User::LeaveIfError( phone.Initialise() );
+
+	CREDLOG_L(KSenCredsLogLevelMin,    "GetImsiImeiL RMobilePhone Initialized");
+
+    TRequestStatus status;
+    phone.GetSubscriberId( status, phoneImsi );    
+    User::WaitForRequest( status );
+	status = KErrNone;
+	CREDLOG_L(KSenCredsLogLevelMin,    "GetImsiImeiL GetSubscriberId Completed");		
+		
+    phone.GetPhoneId( status, phoneIdV1 );
+    phoneImei = phoneIdV1.iSerialNumber;
+    User::WaitForRequest( status ); 
+	status = KErrNone;          
+    //User::LeaveIfError( status.Int() );
+	CREDLOG_L(KSenCredsLogLevelMin,    "GetImsiImeiL phoneIdV1 Completed");    
+    
+    iIMSI.Copy(phoneImsi);    
+    iIMEI.Copy(phoneImei);
+    
+    status = KErrNone;
+
+    CleanupStack::PopAndDestroy( 2 ); // phone, server
+    }
+//END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/src/sencoreservicemanagermain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "sencoreservicemanager.h"
+
+#if defined (__WINS__) && !defined(EKA2)
+IMPORT_C TInt WinsMain();
+EXPORT_C TInt WinsMain()
+    {
+    return reinterpret_cast<TInt>(&CSenCoreServiceManager::ThreadFunction);
+    }
+
+GLDEF_C TInt E32Dll(TDllReason)
+    {
+    return KErrNone;
+    }
+#else  // __ARMI__ && EKA2
+GLDEF_C TInt E32Main()
+    {
+    return CSenCoreServiceManager::ThreadFunction(NULL);
+    }
+#endif
+
+//END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/src/sencoreshutdowntimer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+/**
+* Note: please us ActivateShutdown() + Deque() -pair, instead of After() + Cancel() -pair
+*/
+
+// INCLUDES
+#include "sencoreshutdowntimer.h"
+#include <flogger.h>
+
+
+// CLASS DECLARATION
+CSenCoreShutdownTimer* CSenCoreShutdownTimer::NewL( TInt aShutdownTimeInSecs )
+    {
+    CSenCoreShutdownTimer* pNew = CSenCoreShutdownTimer::NewLC( aShutdownTimeInSecs );
+    CleanupStack::Pop( pNew );
+    return pNew;
+    }
+
+CSenCoreShutdownTimer* CSenCoreShutdownTimer::NewLC( TInt aShutdownTimeInSecs )
+    {
+    CSenCoreShutdownTimer* pNew = new (ELeave)CSenCoreShutdownTimer( aShutdownTimeInSecs );
+    CleanupStack::PushL( pNew );
+    pNew->ConstructL();
+    return pNew;
+    }
+     
+CSenCoreShutdownTimer::CSenCoreShutdownTimer( TInt aShutdownTimeInSecs )
+:
+CTimer( EPriorityNormal ),
+iShutdownTimeInSecs( aShutdownTimeInSecs ) //, iCancelled( EFalse )
+    {
+    }     
+            
+CSenCoreShutdownTimer::~CSenCoreShutdownTimer()
+    {
+    }
+
+void CSenCoreShutdownTimer::ActivateShutdown()
+    {
+    CActiveScheduler::Add(this);
+    if( iShutdownTimeInSecs > 0 )
+        {
+        TTimeIntervalMicroSeconds32 interval = iShutdownTimeInSecs * 1000 * 1000;
+        After( interval );
+        }
+    else // use 30 secs (default)
+        {
+        TTimeIntervalMicroSeconds32 interval = KSenDefaultShutdownTime * 1000 * 1000;
+        After( interval );
+        }
+    }
+
+void CSenCoreShutdownTimer::RunL()
+    {
+    CActiveScheduler::Stop(); // shuts WS-stack Core (server)
+    }
+
+//virtual TInt CSenCoreShutdownTimer::RunError(TInt aError) { ; }
+//void CSenCoreShutdownTimer::DoCancel() 
+//    {
+//    iCancelled = ETrue;    
+//    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/src/senmobilityobserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,619 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "senmobilityobserver.h"
+#include <SenTransportProperties.h>
+#include "SenWSPattern.h"
+#include "MSenProperties.h"
+#include "SenLayeredTransportProperties.h"
+#include "SenLogger.h"
+#include "SenServiceManagerDefines.h"
+
+// -----------------------------------------------------------------------------
+// CALRObserver::NewL
+// -----------------------------------------------------------------------------
+//
+CALRObserver* CALRObserver::NewL(MMobilityProtocolResp& aMobilityObserver, CSenXmlReader &aReader)
+    {
+    CALRObserver* self = new ( ELeave ) CALRObserver(aMobilityObserver, aReader);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CALRObserver::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::ConstructL()
+    {
+#ifdef _SENDEBUG       
+    TFileName logFile;
+    logFile.Append( KSenMobilityLog().Left(KSenMobilityLog().Length()-4) ); // exclude ".log" file extension
+    TDateTime time;
+    TTime start;
+    start.HomeTime();
+    time=start.DateTime();
+    
+    logFile.AppendNum( time.Hour() );
+    logFile.Append( KSenUnderline );
+    logFile.AppendNum( time.Minute() );
+    logFile.Append( KSenUnderline );
+    logFile.AppendNum( time.Second() );
+    logFile.Append( KSenMobilityLog().Right(4) ); // postfix with ".log" file extension
+    TLSLOG_OPEN(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel, KSenMobilityDir, logFile);
+#endif    
+    User::LeaveIfError( iSocketServer.Connect());
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "CALRObserver::ConstructL()");
+    }
+
+// -----------------------------------------------------------------------------
+// CALRObserver::CALRObserver
+// -----------------------------------------------------------------------------
+CALRObserver::CALRObserver(MMobilityProtocolResp &aMobilityObserver, CSenXmlReader &aReader) 
+    : CActive( CActive::EPriorityStandard ),
+     iMobilityObserver( aMobilityObserver ),
+     iMobility(NULL),
+     iIapId(0),
+     iNewIapId(0),
+     iSnapId(0),
+     iReader(aReader)
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CALRObserver::~CALRObserver
+// -----------------------------------------------------------------------------
+//
+CALRObserver::~CALRObserver()
+    {
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "CALRObserver::~CALRObserver() started");
+    if (iMobility != NULL)
+        {
+        delete iMobility;
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "-iMobility deleted ");
+        }
+    Cancel();
+    TUint openCount(0);
+    TInt retVal = iConnection.EnumerateConnections(openCount);
+    if(retVal == KErrNone)
+    	{
+    	TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- connections count : [%d] "), openCount));	
+    	}
+    iConnection.Close();
+    iSocketServer.Close();    
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "CALRObserver::~CALRObserver() completed");
+#ifdef _SENDEBUG
+    TLSLOG_CLOSE(KSenSenMobilityLogChannelBase);
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CApplicationUsingSNAP::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::DoCancel()
+    {
+    iConnection.Close();
+    // iConnection.Stop() should be avoided:
+    // other client applications' connection should not be terminated.
+    }
+
+// -----------------------------------------------------------------------------
+// CApplicationUsingSNAP::RunL
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::RunL()
+    {
+    if ( iStatus.Int() == KErrNone )
+        {
+        TUint32 iap( 0 );
+        iConnection.GetIntSetting( _L( "IAP\\Id" ), iap );
+        iIapId = iap ;
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("-RunL registering mobility using IAPID: %d "), iIapId));
+        TRAPD(err, iMobility = CActiveCommsMobilityApiExt::NewL( iConnection, *this )) ;
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- registered for mobility service returned : %d "), err));
+        }
+    else
+        {
+        //RunL status error: " ) );
+        User::Leave(iStatus.Int()) ;
+        }
+    }    
+
+// -----------------------------------------------------------------------------
+// CALRObserver::RunError
+// -----------------------------------------------------------------------------
+//
+TInt CALRObserver::RunError( TInt aError )
+    {
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("-CALRObserver::RunError received with error = %d"), aError));
+    return KErrNone;
+    }
+    
+// -----------------------------------------------------------------------------
+// CApplicationUsingSNAP::GetActiveIap
+// -----------------------------------------------------------------------------
+//
+TUint32 CALRObserver::GetActiveIap()
+    {
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- GetActiveIap (ID: %d) "), iIapId));
+    return iIapId ;
+    }    
+    
+TUint32 CALRObserver::GetActiveSnap()
+    {
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- GetActiveSnap (ID: %d) "), iSnapId));
+    return iSnapId ;
+    }    
+    
+// -----------------------------------------------------------------------------
+// CALRObserver::PreferredCarrierAvailable
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+                                                 TAccessPointInfo aNewAPInfo,
+                                                 TBool aIsUpgrade,
+                                                 TBool aIsSeamless )
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- PreferredCarrierAvailable callback received ");
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- PreferredCarrierAvailable with old iapid = %d"), aOldAPInfo.AccessPoint()));
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- PreferredCarrierAvailable with new iapid = %d"), aNewAPInfo.AccessPoint()));
+    if ( aIsUpgrade )
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- PreferredCarrierAvailable it is upgrade ");
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- PreferredCarrierAvailable it is not upgrade ");
+        }
+    if (aIsSeamless)
+        {
+          // in S60 3.2, this situation cannot occur.
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "-it is seemless in S60 3.2, this situation cannot occur. ");
+        }        
+	if (iIapId != aOldAPInfo.AccessPoint())
+		{
+		//we received callback for unwanted iap ids
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- ASSERT ERROR PreferredCarrierAvailable callback received ");
+		}
+	else
+		{
+        if (iIapId != aNewAPInfo.AccessPoint())
+            {
+            TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- forwarding call PreferredCarrierAvailable callback to observer with iapID %d"), aNewAPInfo.AccessPoint()));
+            iMobilityObserver.PreferredCarrierAvailable( aOldAPInfo,
+                                             aNewAPInfo,
+                                             aIsUpgrade,
+                                             aIsSeamless ) ;
+           }
+        else
+            {
+            TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- ASSERT ERROR iIapId cant be same with newIap as iIapId = %d, newIap = %d"), iIapId, aNewAPInfo.AccessPoint()));
+            }
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CALRObserver::NewCarrierActive
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless )
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- NewCarrierActive callback received ");
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- NewCarrierActive with new iapid = %d"), aNewAPInfo.AccessPoint()));     
+    if ( aIsSeamless )
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- NewCarrierActive it is seemless ");
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- NewCarrierActive it is not seemless ");
+        }        
+	if (iIapId != aNewAPInfo.AccessPoint())
+		{
+        iNewIapId = aNewAPInfo.AccessPoint() ;
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- frowarding NewCarrierActive callback to observer with new IAPID = %d"), iNewIapId));
+        iMobilityObserver.NewCarrierActive( aNewAPInfo, aIsSeamless ) ;
+		}
+	else
+		{
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- ASSERT ERROR NewCarrierActive callback received with oldIapId = %d, newIapInfo = %d "), iIapId, aNewAPInfo.AccessPoint() ));
+    	//we received callback for wrong PreferredCarrierAvailable call
+		}
+    }
+    
+// -----------------------------------------------------------------------------
+// CApplicationUsingSNAP::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::Error(TInt aError)
+    {
+    //iConnection.Stop();
+    if (aError != KErrCancel)
+        {
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("-CALRObserver::Error callback received with error = %d"), aError));        
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "-forwarding mobility Error callback to consumer");
+        iMobilityObserver.Error(aError) ;            
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "-User Canceled mobility Service");
+        }
+    }    
+
+void CALRObserver::MigrateToPreferredCarrier()
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::MigrateToPreferredCarrier ");
+    if (iMobility)    
+        {
+	    iMobility->MigrateToPreferredCarrier();            
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- iMobility object is NULL");
+        }
+	}
+
+void CALRObserver::IgnorePreferredCarrier()
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::IgnorePreferredCarrier ");
+    if (iMobility)    
+        {
+	    iMobility->IgnorePreferredCarrier();
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- iMobility object is NULL");
+        }	
+	}
+
+void CALRObserver::NewCarrierAccepted() 
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::NewCarrierAccepted ");
+    if (iMobility)    
+        {
+	    iMobility->NewCarrierAccepted();
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- iMobility object is NULL");
+        }	
+	}
+
+void CALRObserver::NewCarrierRejected()
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::NewCarrierRejected ");	    	
+    if (iMobility)    
+        {
+	    iMobility->NewCarrierRejected();
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- iMobility object is NULL");
+        }
+	}
+
+// -----------------------------------------------------------------------------
+// CALRObserver::OpenSocketSever
+// -----------------------------------------------------------------------------
+//
+TInt CALRObserver::OpenSocketSever()
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- OpenSocketSever ");
+    TInt err( KErrNone );
+    // If iConnection is already open don't reopen it.
+	if( !iConnection.SubSessionHandle() )
+        {     
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- calling iConnection.Open ");
+        err = iConnection.Open(iSocketServer);
+        }     
+    return err;
+	}
+
+HBufC8* CALRObserver::GetNewIapAsTransportPropertyL()
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- GetNewIapAsTransportPropertyL ");
+	CSenTransportProperties * pTransportProperties = CSenTransportProperties::NewL();
+	if (iIapId != iNewIapId)
+		{
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("-GetNewIapAsTransportPropertyL filling up transport properties with iNewIapId = %d"), iNewIapId));
+        pTransportProperties->SetIapIdL(iNewIapId) ;
+        iIapId = iNewIapId ;    //reseting current iapid as the new iapid for internal purpose
+        return pTransportProperties->AsUtf8L() ;
+		}
+	else
+		{
+		delete pTransportProperties ;
+		return NULL ;		
+		}
+	}
+
+TInt CALRObserver::OpenConnectionL(TDesC8& aAppTransportProperties,
+								 MSenTransport &aTransport,
+								 CSenWSDescription& aInitializer,
+								 HBufC8*& apNewTransportProperties)
+	{
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::OpenConnectionL ");	
+	CSenTransportProperties * pTransportProperties = CSenTransportProperties::NewL(aAppTransportProperties, iReader);
+	TUint32 id(0);
+	TBool isSnap(EFalse) ;
+    TBool isStartConnectionRequired(EFalse) ;
+
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get SNAPID from pTransportProperties ");
+	TInt error = pTransportProperties->SnapIdL(id) ;
+	if(error || id >= (TUint)KErrNotFound) //
+		{
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get IAPID from pTransportProperties ");
+	    error = pTransportProperties->IapIdL(id);		
+		}
+	else
+		{
+		isSnap = ETrue ;
+		}  
+		
+    if(error || id >= (TUint)KErrNotFound) 
+	    {
+    	//Application Did not provide IAP ID through transport properties
+    	//Now we need to check consumer and provider policy of service description
+    	
+    	if( aInitializer.DescriptionClassType() == MSenServiceDescription::EWSPattern )
+            {
+            // Check if <ConsumerPolicy/> was defined in SC aInitializer (constructor argument)
+            // and if IAP was predefined
+            CSenWSPattern* pConsumerPolicy = (CSenWSPattern*)&aInitializer;
+		    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get SNAPID from pConsumerPolicy ");
+			error = pConsumerPolicy->ConsumerSnapId( id );
+			if(error || id >= (TUint)KErrNotFound) 
+			    {
+        		TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get IAPID from pConsumerPolicy ");
+				error = pConsumerPolicy->ConsumerIapId( id );			 	
+			    }
+			else
+    			{
+    			isSnap = ETrue ;
+    			}			    
+           }
+        if( error || id >= (TUint)KErrNotFound) // IAP ID must be 0...INT_MAX, since (TUInt)KErrNotFound == INT_MAX+1
+            {
+    		// Check if <ProviderPolicy/> was defined in SC aInitializer (constructor argument)
+            // and if IAP was predefined
+            TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get SNAPID from aInitializer ");
+            error = aInitializer.SnapId( id );
+			if(error || id >= (TUint)KErrNotFound) 
+			    {
+                TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get IAPID from aInitializer ");
+				error = aInitializer.IapId( id );		 	
+			    }            
+			else
+    			{
+    			isSnap = ETrue ;
+    			}			    
+            }            
+        if( error || id >= (TUint)KErrNotFound) // IAP ID must be 0...INT_MAX, since (TUInt)KErrNotFound == INT_MAX+1
+	    	{
+	    	//initialiser didnot provide iap/snap id
+	    	//if another SC has already set up a transport we dont want to prompt
+	        MSenProperties& property = aTransport.PropertiesL() ;
+	    	switch (property.PropertiesClassType())
+		    	{    		
+	    		case MSenProperties::ESenLayeredTransportProperties:
+	    		case MSenProperties::ESenLayeredHttpTransportProperties:
+	    		case MSenProperties::ESenLayeredVtcpTransportProperties:
+	    			{
+	    			CSenLayeredTransportProperties& layerdPropery = (CSenLayeredTransportProperties&)property ;
+                    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get SNAPID from layerdPropery ");
+	    			error = layerdPropery.SnapIdL(id) ;
+	    			if(error || id >= (TUint)KErrNotFound) 
+		    			{
+                        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- trying to get IAPID from layerdPropery ");
+		    			error = layerdPropery.IapIdL(id) ;    				
+		    			}
+	    			else
+		    			{
+		    			isSnap = ETrue ;
+		    			}
+	    			}    			
+		    		break;
+		    	}
+		    }	        	
+	    }
+        
+    TUint32 openId(id);
+    if (iIapId == 0 && iSnapId == 0)
+        {
+        //check with first Snapid
+        isStartConnectionRequired = ETrue ;
+     	TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- StartConnection required as (iIapId == 0 && iSnapId == 0) openId = %d, isSnap = %d, iIapId = %d and iSnapId = %d "), openId, isSnap, iIapId, iSnapId));
+        }
+    else if(isSnap != EFalse && openId != iSnapId)
+        {
+        isStartConnectionRequired = ETrue ;
+     	TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- StartConnection required as (isSnap == EFalse && openId != iIapId) openId = %d, isSnap = %d and iSnapId = %d "), openId, isSnap, iSnapId));        
+        }
+    else if(isSnap == EFalse && openId != iIapId)
+        {
+        isStartConnectionRequired = ETrue ;
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("-StartConnection required aws (isSnap == EFalse && openId != iIapId) openId = %d, isSnap = %d and iIapId = %d"), openId, isSnap, iIapId));
+        }
+    else
+        {
+        isStartConnectionRequired = EFalse ;
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- call StartConnection not required ");
+        }
+   if (isStartConnectionRequired != EFalse)
+		{
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- calling StartConnection ");		
+    	error = StartConnection(openId, isSnap) ;
+	    if (openId != id)
+		    {
+        	TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- OpenConnectionL setting up transport properties with iapid %d "), openId));
+		    pTransportProperties->SetIapIdL(openId) ;
+		    apNewTransportProperties = pTransportProperties->AsUtf8LC() ;
+		    //CleanupStack::PopAndDestroy(pTransportProperties);
+		    delete pTransportProperties;
+		    pTransportProperties = NULL;	
+		    CleanupStack::Pop();
+		    }
+		else
+		    {
+		    apNewTransportProperties = NULL ;
+		    }
+    	}
+	else
+    	{
+    	TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- OpenConnectionL returning apNewTransportProperties = NULL ");	
+		apNewTransportProperties = NULL ;
+		if (iMobility)
+    		{
+    		//Already Registered for mobility service for the iap
+    	    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- OpenConnectionL Already Registered for mobility service for the iap");	
+    		error = KErrNone ;
+    		}
+    	}		    
+     	TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- CALRObserver::OpenConnectionL returnd %d "), error));
+        return error ;
+	}
+// -----------------------------------------------------------------------------
+// CALRObserver::StartConnection
+// -----------------------------------------------------------------------------
+//
+TInt CALRObserver::StartConnection(TUint32& aId, TBool aIsSnapId)
+    {
+    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::StartConnection ");
+    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- CALRObserver::StartConnection aId(%d) aIsSnapId(%d) "),  aId, aIsSnapId));
+	TInt errRet = KErrNone;
+	if( !IsActive() )
+	    {
+	    if (aIsSnapId == EFalse)
+			{
+			if (aId !=0 && aId != iIapId)
+				{
+		        // IAP ID is provided and the new IAPID is not equal to the old IAP ID 
+		        //we need to close old Connection and start the Connection with new
+		        //IAPID as application is interested to change it on fly        
+				//but openId must not be Zero (0)
+				iConnection.Close();  
+				TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::StartConnection iConnection closed as new IAPID for the same connection");
+				}
+			}
+		else
+			{
+			if (aId !=0 && aId != iSnapId)
+				{
+				// SNAP ID is provided and the new SNAPID is not equal to the old SNAP ID 
+				//we need to close old Connection and start the Connection with new
+				//SNAPID as application is interested to change it on fly
+				//but openId must not be Zero (0)
+				iConnection.Close();  
+				TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::StartConnection iConnection closed as new SNAPID for the same connection");				      
+				}
+			}
+		errRet = OpenSocketSever();		
+		if (!errRet)
+		    {
+			if(aIsSnapId != EFalse && aId)
+                {
+                iSnapId = aId ;
+                iSNAPPrefs.SetSnap( aId ); 
+                // Start connecting with Snap
+                errRet = iConnection.Start(iSNAPPrefs);						
+                TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::StartConnection iConnection Started with SNAP");
+                }
+			else //default is iap
+				{
+	    	    if( aId )
+                    {
+                    iPrefs.SetIapId( aId );
+                    SetDialogPref(EFalse) ;
+                    // Start connecting with IAP
+                    errRet = iConnection.Start(iPrefs);
+                    TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- CALRObserver::StartConnection connection started with iapid %d and preference"), aId));
+                    }
+	            else
+	            	{
+	            	if (iIapId != 0)
+		            	{
+		            	//OpenSocketSever is already called for this iIapId When multiple
+		            	//sendL are calld for the same IAPId StartConnection may be called
+		            	//unintentionaly and may create crash
+		            	//strange case StartConnection must not be called in this case
+		            	TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::StartConnection connection StartConnection must not be called as aId == 0 and iIapId != 0");
+		            	}
+	            	else
+		            	{
+		            	//Using Default Connection
+	                    TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::StartConnection connection started Using Default Connection");
+		            	errRet = iConnection.Start();	            	
+		            	}
+	            	}
+				}
+			if (errRet == KErrNone)
+    			{	
+     			//iConnection.GetIntSetting( _L( "IAP\\Id" ), aId );
+     			_LIT( KIapId, "IAP\\Id");
+                iConnection.GetIntSetting( KIapId, aId );
+                TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- CALRObserver::StartConnection iConnection.GetIntSetting returned iapid = %d"), aId));                
+     			TRAPD(err, RefreshAvailabilityL()) ;
+                if(err == KErrNone)
+                    {
+     			    iIapId = aId ;
+                    }
+    			}
+	    	//SetActive();
+		    }
+	    }
+	return errRet;
+    }	
+
+void CALRObserver::SetDialogPref(TBool aDialogPref)
+    {
+    if (aDialogPref == EFalse)
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::SetDialogPref is FALSE");
+        iPrefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );		
+        }
+    else
+        {
+        TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel ,"- CALRObserver::SetDialogPref is TRUE");
+        iPrefs.SetDialogPreference( ECommDbDialogPrefPrompt );		
+        }	
+    }
+
+// -----------------------------------------------------------------------------
+// CALRObserver::RefreshAvailability
+// -----------------------------------------------------------------------------
+//
+void CALRObserver::RefreshAvailabilityL()
+    {
+   TLSLOG_L(KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , "- CALRObserver::RefreshAvailabilityL");
+    if ( iMobility )
+        {
+        delete iMobility;
+        iMobility = NULL;
+        }
+        TRAPD(err, iMobility = CActiveCommsMobilityApiExt::NewL( iConnection, *this )) ;
+        TLSLOG_FORMAT((KSenSenMobilityLogChannelBase, KSenSenMobilityLogLevel , _L8("- registered for mobility service returned : %d "), err));
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscore/src/senxmldao.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1971 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <f32file.h>
+#include <s32file.h>
+#include <s32strm.h>
+#include <e32std.h>
+#include <sysutil.h>
+#include <eikenv.h>
+#include <s32mem.h>
+
+#include <SenServiceConnection.h> // error codes and framework ids
+#include <MSenServiceDescription.h>
+#include "senwsdescription.h"
+#include <SenXmlUtils.h>          // static attribute value getter
+#include <SenXmlReader.h>
+
+#include "senprovider.h"
+#include "senxmldao.h"
+#include "msencoreservicemanager.h"
+
+#include "senservicemanagerdefines.h" // KMaxTicks (1209600000)
+                                      // 1 tick = 1 millisec
+                                      // 86400 sec = 1 day
+                                      // 86400*1000 millisec = 1 day
+                                      // 86400*14*1000 = 1209600000 millisec = 2 weeks
+
+#include "senlogger.h"
+#include "sendebug.h"                       // internal Utils\inc
+#include "msenserviceinvocationframework.h" // internal Framework\inc
+#include "senserviceinvocationframework.h"  // internal Framework\inc
+#include "sensecuritymechanism.h"           // internal Framework\inc
+#include "senservicesession.h"              // internal Framework\inc
+
+#include "senprovider.h"
+
+#include "senlogger.h" 
+
+
+// CONSTANTS
+namespace
+    {
+    const TInt KFlatBufSize = 128;
+
+#if !defined( EKA2 ) && !defined( RD_SECURE_PRIV_DATA )
+     _LIT(KSenXMLDAOFile,        "C:\\system\\data\\sensessions.xml");
+     // since CoreSM & XMLDAO are singleton, single temp file is ok:
+     _LIT(KSenXMLDAOTempFile,    "C:\\system\\data\\sensessions.temp.xml");
+#else
+    _LIT(KSenXMLDAOFile,        "sensessions.xml");
+    // since CoreSM & XMLDAO are singleton, single temp file is ok:
+    _LIT(KSenXMLDAOTempFile,    "sensessions.temp.xml");
+#endif   
+
+    //_LIT(KSenXmlDaoPanic, "SenXmlDao");
+
+    _LIT8(KDefaultFrameworkCue1,
+                "com.nokia.Sen.idwsf.IdentityBasedWebServicesFramework");
+    _LIT8(KDefaultFrameworkCue2,
+                "com.nokia.Sen.wsi.WSIBasicFramework");
+    _LIT8(KDefaultFrameworkCue3,
+                "com.nokia.Sen.rest.RestServiceFramework");
+    _LIT8(KDefaultFrameworkCue4,
+                "com.nokia.ws.wsstar.WSStarFramework");
+    _LIT8(KDefaultFrameworkCue5,
+                "com.nokia.ws.atompub.AtomPubFramework");
+    _LIT8(KDefaultFrameworkCue6,
+                "com.nokia.ws.ovi.OviFramework");
+
+    _LIT8(KEqual, "=");
+    _LIT8(KQuote, "\"");
+    _LIT8(KCloseTag, ">");
+    _LIT8(KEmptySpace, " ");
+
+    _LIT8(KServiceDescription, "ServiceDescription");
+    _LIT8(KFramework, "Framework");
+    _LIT8(KClass, "class");
+    _LIT8(KProxyHost, "proxyHost");
+    _LIT8(KProxyPort, "proxyPort");
+
+
+    _LIT8(KLocalName, "SenConfiguration");
+    _LIT8(KTransport,   "Transport");
+    _LIT8(KEndTag, "</SenConfiguration>");
+    _LIT8(KStartTag,
+            "<SenConfiguration xmlns=\"urn:com.nokia.Sen.config.1.0\">");
+    _LIT8(KStartTagEndless,
+            "<SenConfiguration xmlns=\"urn:com.nokia.Sen.config.1.0\"");
+    _LIT8(KNamespaceName, "urn:com.nokia.Sen.config.1.0");
+
+    _LIT8(KSpace, " ");
+    _LIT8(KTouch, "touch");
+
+    // Transport plug-in spesific constants:
+    _LIT8(KLocalTransportScheme,                "local");
+    _LIT8(KDefaultLocalTransportPluginCue,      "com.nokia.wsf.transport.plugin.local");
+
+    _LIT8(KTcpTransportScheme,                   "tcp");
+    _LIT8(KDefaultVirtualTcpTransportPluginCue,  "com.nokia.wsf.transport.plugin.virtualtcp");
+    }
+
+CSenXMLDAO* CSenXMLDAO::NewL(MSenCoreServiceManager& aManager)
+    {
+    CSenXMLDAO* pNew = CSenXMLDAO::NewLC(aManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenXMLDAO* CSenXMLDAO::NewLC(MSenCoreServiceManager& aManager)
+    {
+    CSenXMLDAO* pNew = new (ELeave) CSenXMLDAO(aManager);
+    CleanupStack::PushL(pNew);
+
+    // SenConfiguration xmlns="urn:com.nokia.Sen.config.1.0">
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenXMLDAO::CSenXMLDAO(MSenCoreServiceManager& aManager)
+    :iManager(aManager),
+    iReadingConfig(ESenIdle),
+    iErrorState(KErrNone),
+    iFileName(KSenXMLDAOFile),
+    iSessions(2),
+    iFrameworks(2),                     
+    iServiceDescription(NULL),
+    iFrameworkConfigParser(NULL),
+    iDefaultFrameworkCheckedToExist(EFalse),
+    iProxyHost(NULL),
+    iProxyPort(0),
+    iTransportMap(ETrue, ETrue),
+    iDefaultTransportMapChecked(EFalse),
+    iSharableProviders(2),              
+    iUnsharableProviders(ETrue, ETrue) 
+    {
+    }
+
+void CSenXMLDAO::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO ConstructL()")));
+    BaseConstructL(KNamespaceName(), KLocalName());
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO Base done")));
+
+
+    SetReader(*iManager.XMLReader());
+
+    //Data caging 2 implementation
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+    TBuf<KMaxPath> privatePath;
+    RFs fss;
+        User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+    fss.CreatePrivatePath(EDriveC);
+    fss.PrivatePath(privatePath);
+    iFileName.Insert(0,privatePath);
+    CleanupStack::PopAndDestroy(1);
+#endif
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO ConstructL() done")));
+    iCriticalSection.CreateLocal();
+    }
+
+CSenXMLDAO::~CSenXMLDAO()
+    {
+    // Save the XML
+    CSenXMLDAO::Save();
+
+    if(iServiceDescription)
+        {
+        TInt index = iSessions.Find(iServiceDescription);
+        if(index==KErrNotFound)
+            {
+            // would otherwise NOT be taken care by:
+            //             iSessions.ResetAndDestroy()
+            delete iServiceDescription;
+            }
+        }
+
+    iSessions.ResetAndDestroy();
+
+
+    if(iFrameworkConfigParser)
+        {
+        CSIF* pSIF = (CSIF*) iFrameworkConfigParser;
+
+        TInt index = iFrameworks.Find(pSIF);
+        if(index==KErrNotFound)
+            {
+            // otherwise deleted in ResetAndDestroy() below
+            delete iFrameworkConfigParser;
+            }
+        }
+    iFrameworks.ResetAndDestroy();
+
+    if ( iProxyHost )
+        {
+        delete iProxyHost;
+        iProxyHost = NULL;
+        }
+
+    iTransportMap.Reset();
+
+    iSharableProviders.ResetAndDestroy();
+    iUnsharableProviders.Reset(); // destroys any unloaded / unreleased providers..
+    iCriticalSection.Close();
+
+    if( ipTransportDelegate )
+        {
+        ipTransportDelegate->ExtractElement();
+        }
+    delete ipTransportDelegate;    
+    }
+
+CSenXmlReader* CSenXMLDAO::XMLReader()
+    {
+    return iManager.XMLReader();
+    }
+
+void CSenXMLDAO::Load()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::Load()")));
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, ReadL());
+
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Load() - ReadL() leaved: %d"), leaveCode));
+        }
+#else
+    leaveCode = 0; 
+#endif
+
+
+    // Default frameworks are checked (and loaded)after all the frameworks have
+    // been parsed in the MIDDLE of PARSING, to PREVENT possibility of orphan
+    // SD, if no ID-WSF plug-in was found, for example because ECOM cue
+    // (default_data) was wrong. MOVED the installation of default
+    // frameworks to be in StartElementL() instead(!)
+
+    // Handle the case where no frameworks or service descriptions were found 
+    // from sensessions.xml
+    if(!iDefaultFrameworkCheckedToExist)
+        {
+        TInt retVal = CheckDefaultFrameworks();
+        retVal = 0; // not used currently
+        iDefaultFrameworkCheckedToExist=ETrue;
+        }
+
+    if(!iDefaultTransportMapChecked)
+        {
+        TInt retCode = CheckDefaultTransports();
+        iDefaultTransportMapChecked=ETrue;
+        retCode=0; // not used currently
+        }
+
+    iReadingConfig = ESenIdle;
+
+    // This way the sensessions.xml -file is validated,
+    // and expired sessions will be deleted, etc..
+    TInt saveRetVal = Save();
+    saveRetVal = 0; // not used currently
+    }
+
+TInt CSenXMLDAO::Save()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::SaveSessions()")));
+    TInt notifyLeaveCode(KErrNone);
+    TRAP(notifyLeaveCode, NotifyFrameworksL(KNullDesC8, KSenEventSessionsDbWriteBegin, NULL));
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, WriteL());
+    TRAP(notifyLeaveCode, NotifyFrameworksL(KNullDesC8, KSenEventSessionsDbWriteComplete, NULL));
+    
+    iManager.SaveCredentialDB();
+    
+    notifyLeaveCode = 0; // not used
+    return leaveCode;
+    }
+
+MSIF* CSenXMLDAO::Framework(const TDesC8& aFrameworkId)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::Framework");
+    CSIF* pFramework = NULL;
+
+    TInt count(iFrameworks.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        if(iFrameworks[i])
+            {
+            const TDesC8& frameworkId = iFrameworks[i]->Id();
+
+            if(frameworkId == aFrameworkId)
+                {
+                pFramework = iFrameworks[i];
+                break;
+                }
+            }
+        }
+    if(pFramework)  TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"  framework found:");//LOG_WRITE_L("  framework found:");
+    else TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"  could not find:");        //   LOG_WRITE_L("  could not find:");
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aFrameworkId));
+
+    return pFramework;
+    }
+
+MSIF* CSenXMLDAO::DefaultFrameworkL(const TDesC8& aFrameworkID, 
+                                    const TDesC8& aCue)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::DefaultFramework()")));
+
+    MSIF* pFramework = Framework(aFrameworkID);
+
+    if(!pFramework)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::DefaultFramework() is not installed:")));
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aFrameworkID));
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aCue));
+
+        TRAPD(leaveCode, iManager.InstallFrameworkL(aCue));
+        if(leaveCode==KErrNone)
+            {
+            pFramework = Framework(aFrameworkID);
+            if(pFramework)
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(_L("CSenXMLDAO::DefaultFramework() - now installed.")));
+                }
+            }
+#ifdef _SENDEBUG
+        else
+            {
+            // install framework failed!
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::DefaultFramework() - install failed:")));
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"FATAL!");
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(aCue));
+            }
+#endif //_SENDEBUG
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(_L("CSenXMLDAO::DefaultFramework() - was already installed:")));
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aFrameworkID));
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aCue));
+                   
+        }
+#endif //_SENDEBUG
+
+    return pFramework;
+    }
+
+RFileLogger* CSenXMLDAO::Log() const
+    {
+    return iManager.Log();
+    }
+
+TInt CSenXMLDAO::SizeOfSessionsXmlInBytesL()
+    {
+    TInt size(0);
+
+    TInt count = iSessions.Count();
+    CBufFlat* pBuf = NULL;
+    for(TInt i = 0; i < count; i++)
+        {
+        pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+#ifdef _SENDEBUG
+        TPtrC8 e = iSessions[i]->Endpoint();
+        TPtrC8 c = iSessions[i]->Contract();
+        TPtrC8 fid = iSessions[i]->FrameworkId();
+        TInt leaveCode(KErrNone);
+        TRAP( leaveCode, iSessions[i]->WriteAsXMLToL(bufWs); )
+        if( leaveCode )
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("FATAL: CSenXMLDAO::SizeOfSessionsXmlInBytesL leaved:   %d"), leaveCode));
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("     : endpoint: '%S', contract: '%S', frameworkID: '%S'"), &e, &c, &fid));
+            
+            }
+        User::LeaveIfError(leaveCode);
+        
+#else // release builds
+        iSessions[i]->WriteAsXMLToL(bufWs);
+#endif // _SENDEBUG        
+        TPtr8 p8 = pBuf->Ptr(0);
+        size += p8.Length();
+        CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+        pBuf = NULL;
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::SizeOfSessionsXmlInBytesL:   %d"), size));
+
+    return size;
+    }
+
+TInt CSenXMLDAO::SizeOfFrameworksXmlInBytesL()
+    {
+    TInt size(0);
+
+    HBufC8* pTemp = NULL;
+
+    TInt frameworks = iFrameworks.Count();
+
+    for (TInt j = 0; j < frameworks; j++)
+        {
+        pTemp = iFrameworks[j]->AsXmlL();
+        if(pTemp)
+            {
+            CleanupStack::PushL(pTemp);
+            size += pTemp->Length();
+            
+            CleanupStack::PopAndDestroy(); // pTemp
+            pTemp = NULL;
+            }
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::SizeOfFrameworksXmlInBytesL: %d"), size));
+    return size;
+    }
+
+
+void CSenXMLDAO::WriteL()
+    {
+    if (iReadingConfig != ESenIdle)
+        {
+        iReadingConfig = ESenSaveNeeded;
+        return;
+        }
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::WriteL()")));
+
+
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+
+
+    if ( !iProxyHost )
+        {
+        bufWs.WriteL(KStartTag);
+        }
+    else
+        {
+        bufWs.WriteL( KStartTagEndless );
+
+        bufWs.WriteL( KEmptySpace );
+        bufWs.WriteL( KProxyHost );
+        bufWs.WriteL( KEqual );
+        bufWs.WriteL( KQuote );
+
+        bufWs.WriteL(*iProxyHost);
+        bufWs.WriteL( KQuote );
+
+        bufWs.WriteL( KEmptySpace );
+        bufWs.WriteL( KProxyPort );
+        bufWs.WriteL( KEqual );
+        bufWs.WriteL( KQuote );
+
+        HBufC8* pPort = HBufC8::NewLC(5);
+        TPtr8 pPtrPort = pPort->Des();
+        pPtrPort.AppendNum( iProxyPort );
+        bufWs.WriteL( *pPort );
+
+        CleanupStack::PopAndDestroy( pPort );
+
+        bufWs.WriteL( KQuote );
+        bufWs.WriteL( KCloseTag );
+
+        }
+
+    // Now ensure that we have enough disk space for
+    // new configuration file!
+
+    TInt configFileSize(0);
+
+    TPtr8 p8 = pBuf->Ptr(0);
+
+    // calculate and add required space for sessions as XML (in bytes)
+    configFileSize += SizeOfSessionsXmlInBytesL(); 
+
+    // calculate and add required space for frameworks as XML (in bytes)
+    configFileSize += SizeOfFrameworksXmlInBytesL(); 
+
+    // add size of root element start tag (in bytes)
+    configFileSize += p8.Length();
+    // add size of root element close tag (in bytes)
+    configFileSize += KEndTag().Length();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::WriteL() - Base config size: %d bytes"), p8.Length()));
+
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::WriteL() - Config file size: %d bytes"),  configFileSize));
+
+
+    // Now use SysUtils to ensure that we have room for temp file(!)
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    // Create and open write stream to temp file
+    TFileName tempFile(KSenXMLDAOTempFile);
+
+    // this will create the file or replace and zero-length any existing file
+    // and might free some space, if write failed last time..
+    RFileWriteStream tempFileWriteStream;
+    CleanupClosePushL(tempFileWriteStream);
+    tempFileWriteStream.Replace(fss, tempFile, EFileWrite);
+
+    
+    TInt retVal(SysUtil::FFSSpaceBelowCriticalLevelL(&fss, configFileSize));
+    if(retVal == KErrNone)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, "File system check: OK, there is enough space available.");
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"File system check: FAILED, NOT enough space available.");
+        // release the root configuration XML buffer:
+        // tempFileWriteStream.Close(), fss.Close(), bufWs.Close(), delete pBuf
+        CleanupStack::PopAndDestroy(4); 
+        User::Leave(retVal);
+        }
+
+
+    HBufC8* pTemp = NULL;
+
+    // Write root level configuration XML into temp file
+    tempFileWriteStream.WriteL(p8);
+
+    // Write frameworks directly into temp file
+    TInt frameworks = iFrameworks.Count();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8(" - Framework count: (%d)"),  frameworks));
+
+    for (TInt j = 0; j < frameworks; j++)
+        {
+        pTemp = iFrameworks[j]->AsXmlL();
+        if(pTemp)
+            {
+            CleanupStack::PushL(pTemp);
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*pTemp));
+            tempFileWriteStream.WriteL(*pTemp);
+            CleanupStack::PopAndDestroy(); // pTemp
+            pTemp = NULL;
+            }
+        }
+
+    // Write sessions directly into temp file
+    TInt count = iSessions.Count();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8(" - Description/Session count: (%d)"), count));
+    for(TInt i = 0; i < count; i++)
+        {
+        iSessions[i]->WriteAsXMLToL(tempFileWriteStream);
+        }
+
+    // Write root level configuration element's end tag into temp file
+    tempFileWriteStream.WriteL(KEndTag);
+
+    // close the temp file write stream:
+    CleanupStack::PopAndDestroy(); // tempFileWriteStream.Close()
+
+    // create file manager to replace original database file
+    CFileMan* pFileMan = CFileMan::NewL(fss);
+    CleanupStack::PushL(pFileMan);
+
+    // Now copy temp file over the real database. EOverWrite is default
+    User::LeaveIfError(pFileMan->Move(KSenXMLDAOTempFile, KSenXMLDAOFile));
+
+    // destroy file manager instance and close the fss
+    CleanupStack::PopAndDestroy(2); // delete pFileMan, fss.Close()
+
+    // release the root configuration XML buffer
+    CleanupStack::PopAndDestroy(2); // bufWs.Close(), delete pBuf
+    }
+
+
+    /*
+    Snippet from deprecated WriteL() version:
+
+    TPtr8 p8 = pBuf->Ptr(0);
+
+    HBufC8* pFileContentAsUtf8 = p8.AllocL();
+
+    CleanupStack::PushL(pFileContentAsUtf8);
+
+    // Everything in MEMORY ok, prepare to write into file
+
+
+    RFileWriteStream fileOutStream;
+    CleanupClosePushL(fileOutStream);
+
+
+    if(!SysUtil::FFSSpaceBelowCriticalLevelL(&fss,
+                            pFileContentAsUtf8->Length()) )
+        {
+        // note, this will zero-length the file(!) 
+        fileOutStream.Replace(fss, iFileName, EFileWrite);
+
+        // finally write the UTF-8 into the file.
+        fileOutStream.WriteL(*pFileContentAsUtf8);
+        }
+    // else { User::Leave("KFSSpaceBelowCriticalLevel"); }
+
+    */
+void CSenXMLDAO::ReadL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::ReadL()")));
+
+    NotifyFrameworksL(KNullDesC8, KSenEventSessionsDbReadBegin, NULL);
+
+
+    RFs fss;
+        User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+
+    iReadingConfig = ESenReading;
+
+    XMLReader()->SetContentHandler(*this);
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, XMLReader()->ParseL(fss, iFileName));
+    iReadingConfig = ESenIdle;
+
+    CleanupStack::PopAndDestroy(1); // fss
+    NotifyFrameworksL(KNullDesC8, KSenEventSessionsDbReadComplete, NULL);
+    leaveCode = 0; // not used currently
+    }
+
+TInt CSenXMLDAO::Add(CSenWSDescription& aSD)
+    {
+    // Try to take ownership:
+    TInt retVal(iSessions.Append(&aSD));
+    if(retVal==KErrNone)
+        {
+        // Must be set so that it can be saved as XML fragment which 
+        // has an owner. This prevents empty namespace to be written.
+        aSD.SetOwner(*(MSenFragment*)this);
+    TInt retValSave = Save();
+    TInt notifyLeaveCode(KErrNone);
+    TRAP(notifyLeaveCode, NotifyFrameworksL(KNullDesC8,
+    		KSenEventRegisterNewServiceDescription, NULL));
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::Add(SD), Save() returned: %d"), retValSave));
+        retValSave = 0; // not in use in release builds
+        }
+    return retVal;
+    }
+
+// return an error code (Append might leave!)
+TInt CSenXMLDAO::Add(CSIF& aFramework)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::Add(SIF)");
+    TBool alreadyExists(EFalse);
+    TInt sifCount = iFrameworks.Count();
+    for (TInt i=0; i<sifCount; i++)
+        {
+        if (iFrameworks[i]->Id() == aFramework.Id())
+            {
+            alreadyExists = ETrue;
+            break;
+            }
+        }
+    TInt retCode(KErrNone);
+    if (!alreadyExists)
+        {
+        retCode = iFrameworks.Append(&aFramework);
+        if(retCode==KErrNone)
+            {
+            TInt saveRetVal = Save();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::Add(SIF), Save() returned: %d"), saveRetVal));
+            saveRetVal = 0; // not used in release builds
+            }
+        }
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::Add(CSIF&) - complete.");
+    return retCode;
+    }
+
+TBool CSenXMLDAO::Remove(CSenWSDescription& aSD)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::Remove(SD)")));
+    TInt index(KErrNotFound);
+    TInt count(iSessions.Count());
+
+    // Due architectural change
+    // REMOVE COMMENTED 3.0 CODE BELOW in 5.0:
+    //TPtrC8 contract = aSD.Contract();
+    //TPtrC8 endpoint = aSD.Endpoint();
+
+    //if(contract.Length()>0)
+    //    {
+
+    TInt leaveCode(KErrNone);
+    for(TInt i=0; i<count; i++)
+        {
+        // Due architectural change
+        // REMOVE COMMENTED 3.0 CODE BELOW in 5.0:
+        //TPtrC8 sessContract = iSessions[i]->Contract();
+        //TPtrC8 sessEndpoint = iSessions[i]->Endpoint();
+
+        //if ( sessContract == contract && sessEndpoint == endpoint )
+        CSenWSDescription* pSD = iSessions[i];
+        TBool equals(EFalse);
+        TRAP(leaveCode, equals = pSD->HasEqualPrimaryKeysL(aSD));
+#ifdef _SENDEBUG
+        if(leaveCode!=KErrNone)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Remove - HasEqualPrimaryKeysL leaved: %d"), leaveCode));
+            }
+#endif
+        if(leaveCode==KErrNone && equals)
+            {
+                index = i;
+                break;
+            }
+        leaveCode = KErrNone;
+        }
+    //    }
+
+    if(index != KErrNotFound)
+        {
+
+#ifdef _SENDEBUG
+        TRAP_IGNORE
+            (
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"Removing service description from DAO: ");
+            CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream bufWs(*pBuf);
+            CleanupClosePushL(bufWs);
+            iSessions[index]->WriteAsXMLToL(bufWs);
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(pBuf->Ptr(0)));
+            CleanupStack::PopAndDestroy(2); // bufWs, pBuf
+            )
+#endif // _SENDEBUG
+
+        delete iSessions[index];
+        iSessions.Remove(index);
+        TInt saveRetVal = Save();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::Remove(SD), Save() returned: %d"), saveRetVal));
+        saveRetVal = 0; // not used in release builds
+        return ETrue;
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::Remove(SD): description not found.");
+        }
+#endif
+    return EFalse;
+    }
+
+
+void CSenXMLDAO::Remove(CSIF& aFramework)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::Remove(SIF)")));
+    TInt index(-1);
+    TInt count(iFrameworks.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        if((iFrameworks[i])->Id() == aFramework.Id())
+            {
+            index = i;
+            break;
+            }
+        }
+
+    if(index != KErrNotFound)
+        {
+        delete iFrameworks[index];
+        iFrameworks.Remove(index);
+        TInt retValSave = Save();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::Remove(SIF), Save() returned: %d"), retValSave));
+        retValSave = 0; // not in use in release builds
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::Remove(SIF): plugin not found.");
+        }
+#endif
+    }
+
+
+
+void CSenXMLDAO::StartElementL(const TDesC8& /* aNsURI */,
+                              const TDesC8& aLocalName,
+                              const TDesC8& /* aQName */,
+                              const RAttributeArray& aAttributes)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Entering CSenXMLDAO::StartElementL")));
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aLocalName));
+    //LOG_WRITEFORMAT((_L8("Namespace: %S"), &aNsURI));
+
+    if(aLocalName == KServiceDescription)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Found a ServiceDescription")));
+
+        // Default framework is checked after all the frameworks have been
+        // parsed in the MIDDLE of PARSING, to PREVENT orphanizing the SD(s),
+        // if no ID-WSF plugin was found; for example because ECOM cue
+        // (default_data) was wrong. MOVED the installation of default
+        // frameworks to be in here instead of LoadL()
+
+        // NOTE: expect, that when first SD is encountered, all of
+        // the frameworks have been parsed and installed properly
+        // if such (plugins) exist.
+
+        // No need to store the SIF* anywhere, just doing this to ensure the
+        // installation of the ID-WSF framework
+        if(!iDefaultFrameworkCheckedToExist)
+            {
+            // do only once per read configuration
+
+            TInt retCode = CheckDefaultFrameworks();
+            iDefaultFrameworkCheckedToExist=ETrue;
+            retCode = 0; // not used currently
+            }
+
+        // Alike frameworks, default transport (scheme-to-cue) mapping
+        // is ensured when first service description is recognized.
+        // The list for scheme-cue mappings is expected to be found
+        // before service descriptions (in the beginning of sensessions.xml)
+        if(!iDefaultTransportMapChecked)
+            {
+            TInt retCode = CheckDefaultTransports();
+            iDefaultTransportMapChecked=ETrue;
+            retCode=0; // not used currently
+            }
+
+
+        // check, if for some reason the iServiceDescription
+        // was NOT added to iSessions. If so, delete the
+        // orphan SD
+        if(iServiceDescription)
+            {
+            TInt index = iSessions.Find(iServiceDescription);
+            if(index==KErrNotFound)
+                {
+                // would otherwise NOT be taken care by:
+                //             iSessions.ResetAndDestroy()
+                delete iServiceDescription;
+                }
+            iServiceDescription=NULL;
+            }
+        
+        
+        iServiceDescription = CSenWSDescription::NewL(
+                            AsElement().NamespaceURI() );
+        iServiceDescription->SetAttributesL(aAttributes);
+        iServiceDescription->SetReader(*Reader());
+
+#ifdef _SENDEBUG
+        TPtrC8 frameworkID = iServiceDescription->FrameworkId();
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::StartElementL");
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - %S service description now parsed by delegate."), &frameworkID));
+#endif
+
+        iState = KStateParsingServiceDescription;
+
+        DelegateParsingL(*iServiceDescription);
+        }
+    else if(aLocalName == KFramework)
+        {
+        iFrameworkConfigParser = NULL;
+        // we can take the framework id from attribute list,
+        // no need to wait for end element...
+        TPtrC8 fwId = SenXmlUtils::AttrValue(aAttributes, KClass);
+        iFrameworkConfigParser = iManager.InstallFrameworkL(fwId);
+        if(iFrameworkConfigParser)
+            {
+            iFrameworkConfigParser->SetOwner((MSenFragment&)*this);
+            iFrameworkConfigParser->SetAttributesL(aAttributes);
+            iFrameworkConfigParser->SetReader(*Reader());
+
+            iState = KStateParsingFramework;
+
+            DelegateParsingL(*iFrameworkConfigParser);
+            }
+        // Expect, that frameworks are first in the XML. Set boolean
+        // "check-done" flag to EFalse, so that check will be issued
+        // when first SD is encountered.
+        iDefaultFrameworkCheckedToExist=EFalse;
+        }
+    else if (aLocalName == KLocalName)  // SenConfiguration starting tag
+        {
+        // check if HTTP proxy HOST -param was set:
+        TPtrC8 host = SenXmlUtils::AttrValue(aAttributes, KProxyHost);
+        if ( host.Length() > 0 &&  host != KSpace)
+            {
+            delete iProxyHost;
+            iProxyHost = NULL; 
+            iProxyHost = host.AllocL();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("HTTP proxy HOST read: '%S'"), iProxyHost));
+            }
+
+        // check if HTTP proxy PORT -param was set:
+        TPtrC8 port = SenXmlUtils::AttrValue(aAttributes, KProxyPort);
+        if (port.Length() > 0 && port != KSpace)
+            {
+            TLex8 lex;
+            lex.Assign(port);
+            lex.Val( iProxyPort );
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("HTTP proxy PORT read: '%d'"), iProxyPort));
+            }
+        }
+        /*
+    else if ( aLocalName == KTransport && aNsURI == KNamespaceName )  // Transport starting tag
+        {
+        if ( ipTransportDelegate )
+            {
+            ipTransportDelegate->ExtractElement();
+            delete ipTransportDelegate;
+            ipTransportDelegate = NULL;
+            }
+        ipTransportDelegate = CSenDomFragment::NewL(KTransport);
+        CSenElement& element = ipTransportDelegate->AsElement();
+        this->AsElement().AddElementL(element);        
+        iState = KStateParsingTransport;
+        DelegateParsingL(*ipTransportDelegate); 
+        }
+        */
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Leaving CSenXMLDAO::StartElementL")));
+
+    }
+
+void CSenXMLDAO::EndElementL(const TDesC8& aUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aName)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::EndElementL()")));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Namespace URI: %S"), &aUri));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Local name URI: %S"), &aLocalName));
+
+
+    switch(iState)
+        {
+        case KStateParsingServiceDescription:
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::EndElementL() - EParsingServiceDescription")));
+            if(aLocalName == KServiceDescription)
+                {
+#ifdef _SENDEBUG
+                HBufC8* pAsXmlUtf8 = iServiceDescription->AsXmlL();
+                if(pAsXmlUtf8)
+                    {
+                    CleanupStack::PushL(pAsXmlUtf8);
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("SD as XML:")));
+                    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*pAsXmlUtf8));
+                    CleanupStack::PopAndDestroy(1); // pAsXmlUtf8
+                    }
+#endif
+
+                // transfer ownership
+                iManager.RegisterServiceDescriptionL(iServiceDescription);
+                iServiceDescription = NULL; // now owned elsewhere
+                }
+            break;
+            }
+        case KStateParsingFramework:
+            {
+            if (aLocalName == KFramework)
+                {
+                iState = KStateIgnore;
+                }
+            break;
+            }
+        case KStateParsingTransport:
+            {
+            if ( aLocalName == KTransport && aUri == KNamespaceName ) 
+                {
+                 // Transport ending tag
+                iState = KStateIgnore;
+                }
+            break;
+            }
+        default:
+            {
+            CSenBaseFragment::EndElementL(aUri,aLocalName,aName);
+            break;
+            }
+        }
+    }
+
+
+TBool CSenXMLDAO::Owns(CSenWSDescription* aSD)
+    {
+    TInt count(iSessions.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        if(iSessions[i]==aSD)
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+TInt CSenXMLDAO::ProxyPort()
+    {
+    return iProxyPort;
+    }
+
+const TDesC8& CSenXMLDAO::ProxyHost()
+    {
+    if ( iProxyHost )
+        {
+        return *iProxyHost;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+CSenWSDescription* CSenXMLDAO::FindExactServiceDescriptionL(
+                                                CSenWSDescription& aSd)
+    {
+    TInt sessCount = iSessions.Count();
+    for (TInt i=0; i<sessCount; i++)
+        {
+        CSenWSDescription* pCandidate = iSessions[i];
+
+        // The concrete session implementation of framework "X" decides
+        // what are the primary keys (unique) in a service description
+        if(pCandidate && pCandidate->HasEqualPrimaryKeysL(aSd))
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::FindExactServiceDescriptionL:");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - exact match found.");
+            return pCandidate;
+            }
+
+        // It is better to let framework sessions classes to define the
+        // "primary keys" of this comparison(!). That is more extensible.
+        // SO: REMOVE BELOW COMMENTED CODE in 5.0:
+        //if(pCandidate)
+        //    {
+        //    if (pCandidate->Endpoint() == aSd.Endpoint() &&
+        //            pCandidate->Contract() == aSd.Contract() )
+        //        {
+        //
+        //
+        //        LOG_WRITE_L("CSenXMLDAO::FindExactServiceDescriptionL:");
+        //        LOG_WRITE_L(" - exact match found.");
+        //        return pCandidate;
+        //        }
+        //    }
+
+        }
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::FindMatchingServiceDescription: no match found.");
+    return NULL;
+    }
+
+CSenWSDescription* CSenXMLDAO::FindMatchingServiceDescriptionL(
+                                                CSenWSDescription& aSd)
+    {
+    TInt sessCount = iSessions.Count();
+    for (TInt i=0; i<sessCount; i++)
+        {
+        CSenWSDescription* pCandidate = iSessions[i];
+        if(pCandidate)
+            {
+            if(pCandidate->Matches(aSd))
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::FindMatchingServiceDescription:");
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - matching SD found.");
+                return pCandidate;
+                }
+            }
+        }
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::FindMatchingServiceDescription: no match found.");
+    return NULL;
+    }
+    
+CSenWSDescription* CSenXMLDAO::FindMatchingSDAndBestScoreL(
+                                            CSenWSDescription& aSd,
+                                            TInt &aBestScore)	//CodeScannerWarnings
+    {
+    CSenWSDescription* pMatchingSD = NULL;
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"***************************************************************");
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::FindMatchingSDAndBestScore");
+    TPtrC8 sdendpoint = aSd.Endpoint();
+    TPtrC8 sdcontract = aSd.Contract();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Endpoint URI: %S"), &sdendpoint ));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Contract: %S"), &sdcontract ));
+    
+    TInt score( 0 );
+    // Make sure that at least endpoint or contract should match
+    aBestScore = 1;
+    TInt sessCount = iSessions.Count();
+    for (TInt i=0; i<sessCount; i++)
+        {
+        CSenWSDescription* pCandidate = iSessions[i];
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"----------------------------------------------");
+        TPtrC8 endpoint = pCandidate->Endpoint();
+        TPtrC8 contract = pCandidate->Contract();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Endpoint URI: %S"), &endpoint ));
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Contract: %S"), &contract ));
+        if(pCandidate)
+            {
+			score = pCandidate->ScoreMatchL(aSd);
+			if (score > aBestScore) 
+			    {
+			    if ( pCandidate->Matches(aSd) )
+			        {
+			        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"-> Selected");
+    				TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("[score: %d]"), score ));
+			        pMatchingSD = pCandidate;
+			        }
+    			aBestScore = score;
+			    }
+
+            if ( !pMatchingSD && pCandidate->Matches(aSd) )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"-> Selected");
+                pMatchingSD = pCandidate;
+                }
+            }
+        }
+        
+#ifdef _SENDEBUG
+    if ( !pMatchingSD )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::FindMatchingSDAndBestScore: no match found.");
+        }
+#endif
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Best score: %d"), aBestScore ));
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"***************************************************************");
+    
+    return pMatchingSD;
+    }
+
+CSenWSDescription* CSenXMLDAO::FindScoreMatchingServiceDescriptionL(
+                                            CSenWSDescription& aSd,
+                                            TInt aBestScore)
+    {
+	/* We should now try the primary search again.
+	 * Note that we try to pick a service that matches 
+	 * at least as good as the given aBestScore
+	 * but at least the contract or endpoint should
+	 * match.
+	 */ 
+	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::FindScoreMatchingServiceDescription");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Best score: %d"), aBestScore ));
+    TPtrC8 sdendpoint = aSd.Endpoint();
+    TPtrC8 sdcontract = aSd.Contract();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Endpoint URI: %S"), &sdendpoint ));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Contract: %S"), &sdcontract ));
+	 
+	TInt score( 0 );
+	// Make sure that at least endpoint or contract should match
+	if (aBestScore < 1) aBestScore = 1; 
+	
+    TInt sessCount = iSessions.Count();
+    for (TInt i=sessCount-1 ; i>=0 ; i--)
+        {
+        CSenWSDescription* pCandidate = iSessions[i];
+        if(pCandidate)
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"----------------------------------------------");
+            TPtrC8 endpoint = pCandidate->Endpoint();
+            TPtrC8 contract = pCandidate->Contract();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Endpoint URI: %S"), &endpoint ));
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("Contract: %S"), &contract ));
+			score = pCandidate->ScoreMatchL(aSd);
+			TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("score: %d"), score ));
+			if (score >= aBestScore)
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::FindScoreMatchingServiceDescription:");
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8(" - Scorematching SD found. Score : %d"),
+                                score));
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+                return pCandidate;
+                }
+            }
+        }
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::FindScoreMatchingServiceDescription: no scorematch found.");
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+    
+    return NULL;
+    }
+
+TInt CSenXMLDAO::FindAllMatchingServiceDescriptions(RWSDescriptionArray& aMatches,
+                                                    const TDesC8& aContract)
+    {
+    TInt retVal(KErrNone);
+    TInt sessCount(iSessions.Count());
+
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::FindAllMatchingServiceDescriptions(contract)");
+
+    for(TInt i=0; i<sessCount; i++)
+        {
+        TPtrC8 sessContract = iSessions[i]->Contract();
+
+        if ( sessContract.Length()>0 && aContract == sessContract
+            ||
+            aContract == KNullDesC8 // if no contract given, all match
+            )
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel," - match found, appending to array.");
+            TInt appendRetVal(aMatches.Append(iSessions[i]));
+            if(appendRetVal!=KErrNone)
+                {
+                retVal = appendRetVal; // note: last error is retuned
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - FATAL: due OOM Append(SD) failed!");
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - error code: %d"), appendRetVal));
+
+                // Attempt to append other hits/matching SDs
+                }
+            }
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8(" - total of %d matches found."), 
+                        aMatches.Count()));
+
+    return retVal; // last error from Append() is returned atm
+    }
+
+TInt CSenXMLDAO::FindAllMatchingServiceDescriptions(RWSDescriptionArray& aMatches,
+                                                    MSenServiceDescription& aPattern)
+    {
+    TInt sessCount(iSessions.Count());
+    TInt retVal(KErrNone);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::FindAllMatchingServiceDescriptions(pattern)");
+    for (TInt i=0; i<sessCount; i++)
+        {
+        if (iSessions[i]->Matches(aPattern))
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," -> matching service description found");
+
+            TInt appendRetVal(aMatches.Append(iSessions[i]));
+            if(appendRetVal!=KErrNone)
+                {
+                retVal = appendRetVal; // note: last error is retuned
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - FATAL: due OOM Append(SD) failed!");
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - error code: %d"), appendRetVal));
+
+                // Attempt to append other hits/matching SDs
+                }
+            }
+        }
+     TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8(" - total of %d matches found."), 
+                        aMatches.Count()));
+
+    return retVal; // last error from Append() is returned atm
+    }
+
+
+TInt CSenXMLDAO::AddServiceDescriptionToFrameworksL( CSenWSDescription& aPattern,
+                                                     MSenRemoteServiceConsumer& aRemoteConsumer,
+                                                     HBufC8*& aErrorMsg )
+    {
+    CSLOG_L(aRemoteConsumer.ConnectionId()  , KMinLogLevel,"CSenXMLDAO::AddServiceDescriptionToFrameworksL");
+
+    TInt fwCount = iFrameworks.Count();
+    CSLOG_FORMAT((aRemoteConsumer.ConnectionId() , KNormalLogLevel, _L8("Adding SD to (%d) SIF plug-ins."), fwCount));
+    TInt retVal;
+    TInt error(KErrNone);
+    TInt sdCount(0);
+    TPtrC8 patternFwId = aPattern.FrameworkId();
+    HBufC8* pLastErrorMsg = NULL;
+    for (TInt i=0; i<fwCount; i++ )
+        {
+        // altered the SIF inteface to return the count or leave
+        // (no ref to int as argument)
+        retVal = iFrameworks[i]->AddServiceDescriptionL( aPattern, aRemoteConsumer, pLastErrorMsg);
+        if ( retVal > 0 )
+            {
+            sdCount += retVal;
+            }
+        
+        TPtrC8 frameworkID = iFrameworks[i]->Id();
+        
+        // Store the latest error, in case that no match has yet been found(!)
+        if ( (sdCount == 0) && 
+             (retVal < 0 || (pLastErrorMsg && pLastErrorMsg->Length() > 0) )
+           )
+            {
+            if( patternFwId.Length() == 0 || frameworkID == patternFwId )
+                {
+                // if pattern provides NO framework ID, or if it provides
+                // mathing framework ID, then collect error message from
+                // last SIF plugin in the array:
+                if ( pLastErrorMsg )
+                    {
+                    delete aErrorMsg;
+                    aErrorMsg = pLastErrorMsg;
+                    pLastErrorMsg = NULL;
+                    }
+                if ( retVal < 0 )
+                    {
+                    error = retVal;
+                    }
+                }
+            }
+        CSLOG_L(aRemoteConsumer.ConnectionId()  , KNormalLogLevel,"CSenXMLDAO::AddServiceDescriptionToFrameworksL:");
+        CSLOG_FORMAT((aRemoteConsumer.ConnectionId()  , KNormalLogLevel, _L8("- After %S SIF, the add count is [%d]"), &frameworkID, sdCount));
+        }
+    
+    if ( pLastErrorMsg )
+        {
+        delete pLastErrorMsg;
+        }
+        
+    if ( sdCount > 0 )
+        {
+        retVal = sdCount;
+        delete aErrorMsg;
+        aErrorMsg = NULL;
+        }
+    else
+        {
+        retVal = error;
+        }
+        
+    return retVal;
+    }
+
+
+TInt CSenXMLDAO::NotifyFrameworksL(const TDesC8& aFrameworkID,
+                                   const TInt aEvent,
+                                    TAny* aArgument)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenXMLDAO::NotifyFrameworksL");
+    TInt fwCount = iFrameworks.Count();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("There are %d loaded SIF plug-in(s)."), fwCount));
+    TInt retVal(KErrNone);
+    for (TInt i=0; i<fwCount; i++ )
+        {
+        TPtrC8 fwID = iFrameworks[i]->Id();
+        if(aFrameworkID.Length()==0 || aFrameworkID == fwID)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("+ Notified '%S' SIF. Event (%d)"),
+                            &fwID,
+                            aEvent));
+            
+            TInt pluginRetVal = iFrameworks[i]->OnEvent(aEvent, aArgument);
+            if(retVal==KErrNone && pluginRetVal!=KErrNone)
+                {
+                retVal = pluginRetVal;
+                }
+            }   
+#ifdef _SENDEBUG
+        else
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("-Not notifying '%S' SIF [framework ID does not match]"),
+                &fwID));
+            }
+#endif // _SENDEBUG
+        }
+    return retVal;
+    }
+
+
+TInt CSenXMLDAO::SaveL(const CSenServiceSession& /* aServiceSession */ )
+    {
+    Save(); //This implementation does not save single objects (yet).
+    return KErrNone;
+    }
+
+TInt CSenXMLDAO::SaveL(const CSIF& /* aServiceInvocationFramework */)
+    {
+    Save(); //This implementation does not save single objects (yet).
+    return KErrNone;
+    }
+
+CDesC8Array& CSenXMLDAO::SupportedFrameworksL()
+    {
+    TInt fwCount(iFrameworks.Count());
+    CDesC8Array* retVal = new (ELeave) CDesC8ArraySeg(fwCount);
+    for (TInt i=0; i<fwCount; i++)
+        {
+        retVal->AppendL(*iFrameworks[i]->Id().AllocL());
+        }
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::SupportedFrameworksL(): Count: (%d)"),
+                        retVal->Count()));
+    return *retVal;
+    }
+
+TInt CSenXMLDAO::ContainsServiceDescriptionL(TBool& aContains,
+                                             CSenWSDescription& aPattern)
+    {
+    aContains = EFalse;
+    TInt sessCount = iSessions.Count();
+    for (TInt i=0; i<sessCount && !aContains; i++)
+        {
+        CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+        iSessions[i]->WriteAsXMLToL(bufWs);
+        CSenWSDescription* pSd = CSenWSDescription::NewLC();
+        pSd->SetReader(*Reader());
+        pSd->ParseL(pBuf->Ptr(0));
+
+        if (pSd->ConsistsOfL(aPattern))
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenXMLDAO::ContainsServiceDescriptionL(): matches given pattern:")));
+            aContains = ETrue;
+            }
+        CleanupStack::PopAndDestroy(3); // pSd, bufWs, pBuf
+        }
+    
+    return KErrNone;
+    }
+
+
+TInt CSenXMLDAO::CheckDefaultFrameworks()
+    {
+    // Do only once per read-text being parsed..
+    TInt retCode(KErrNone);
+    TInt leaveCode(KErrNone);
+
+    TRAP(leaveCode, DefaultFrameworkL(KDefaultIdWsfFrameworkID, 
+                                      KDefaultFrameworkCue1));
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Load() - DefaultFrameworkL() leaved: %d"),
+            leaveCode));
+        }
+#else
+    if(leaveCode!=KErrNone)
+        {
+        retCode = leaveCode;
+        }
+#endif
+
+    leaveCode = KErrNone;
+    TRAP(leaveCode, DefaultFrameworkL(KDefaultBasicWebServicesFrameworkID, 
+                                      KDefaultFrameworkCue2));
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Load() - DefaultFrameworkL() leaved: %d"),
+            leaveCode));
+        }
+#else
+    if(leaveCode!=KErrNone)
+        {
+        retCode = leaveCode; // overrides possible leave from ID-WSF ECOM loading..
+        }
+#endif
+
+    leaveCode = KErrNone;
+    TRAP(leaveCode, DefaultFrameworkL(KDefaultRestServicesFrameworkID, 
+                                      KDefaultFrameworkCue3));
+
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Load() - DefaultFrameworkL() leaved: %d"),
+            leaveCode));
+        }
+#else
+    if(leaveCode!=KErrNone)
+        {
+        retCode = leaveCode; // overrides possible leave from ID-WSF & WS-I ECOMs loading..
+        }
+#endif
+
+    leaveCode = KErrNone;
+    TRAP(leaveCode, DefaultFrameworkL(KDefaultWSStarFrameworkID, 
+                                      KDefaultFrameworkCue4));
+
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Load() - DefaultFrameworkL() leaved: %d"),
+            leaveCode));
+        }
+#else
+    if(leaveCode!=KErrNone)
+        {
+        retCode = leaveCode; // overrides possible leave from ID-WSF & WS-I & REST ECOMs loading..
+        }
+#endif
+
+    leaveCode = KErrNone;
+    TRAP(leaveCode, DefaultFrameworkL(KDefaultAtomPubFrameworkID, 
+                                      KDefaultFrameworkCue5));
+
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+		TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenXMLDAO::Load() - DefaultFrameworkL() leaved: %d"),
+            leaveCode));
+        }
+#else
+    if(leaveCode!=KErrNone)
+        {
+        retCode = leaveCode; // overrides possible leave from ID-WSF & WS-I & REST ECOMs loading..
+        }
+#endif
+
+//################OVI PLUGIN
+    leaveCode = KErrNone;
+    TRAP(leaveCode, DefaultFrameworkL(KDefaultOviFrameworkID, 
+                                      KDefaultFrameworkCue6));
+
+#ifdef _SENDEBUG
+    if(leaveCode!=KErrNone)
+        {
+        LOG_WRITEFORMAT((_L8("CSenXMLDAO::Load() - DefaultFrameworkL() leaved: %d"),
+            leaveCode));
+        }
+#else
+    if(leaveCode!=KErrNone)
+        {
+        retCode = leaveCode; // overrides possible leave from ID-WSF & WS-I & REST ECOMs loading..
+        }
+#endif
+    return retCode;
+    }
+
+
+
+TPtrC8 CSenXMLDAO::TransportPluginCueBySchemeL(const TPtrC8& aScheme)
+    {
+    TPtrC8 cue = KNullDesC8();
+
+    TInt index = iTransportMap.Find(aScheme);
+    if(index!=KErrNotFound)
+        {
+        const HBufC8* pCue = iTransportMap.ValueAt(index);
+        if(pCue)
+            {
+            cue.Set(*pCue);
+            }
+        }
+    return cue;
+    }
+
+TInt CSenXMLDAO::CheckDefaultTransports()
+    {
+    // Note: HTTP Channel is the highest priority default, also in case
+    // that scheme is not provided, so it does not need to be
+    // added as default (CSenTransport::NewL() without cue returns the
+    // default version HTTP Channel Transport plug-in).
+
+    // Check whether local scheme default has been overridden by 
+    // configuration file (sensessions.xml). The configuration file
+    // has now been loaded, so one should not discard any changes to
+    // default scheme-cue mappings that were read from that file.
+
+    TInt retVal(KErrNone);
+    TInt index = iTransportMap.Find(KLocalTransportScheme);
+    if(index==KErrNotFound)
+        {
+        // apply & map the default local transport ECOM cue with its scheme
+        HBufC8* pScheme = KLocalTransportScheme().Alloc();
+        HBufC8* pCue = KDefaultLocalTransportPluginCue().Alloc();
+
+        if(pScheme && pCue)
+            {
+            TInt retCode = iTransportMap.Append(pScheme, pCue);
+            if(retCode!=KErrNone)
+                {
+                retVal = retCode;
+                }
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::CheckDefaultTransportsL - Append(local) returned: %d"), 
+                retVal));
+            }
+        }
+
+    index = iTransportMap.Find(KTcpTransportScheme);
+    if(index==KErrNotFound)
+        {
+        // apply & map the default local transport ECOM cue with its scheme
+        HBufC8* pScheme = KTcpTransportScheme().Alloc();
+        HBufC8* pCue = KDefaultVirtualTcpTransportPluginCue().Alloc();
+        if(pScheme && pCue)
+            {
+            TInt retCode = iTransportMap.Append(pScheme, pCue);
+            if(retCode!=KErrNone)
+                {
+                retVal = retCode;
+                }
+              TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CSenXMLDAO::CheckDefaultTransportsL - Append(tcp) returned: %d"), 
+                retVal));
+            }
+        }
+    return retVal; // returns the last error code
+    }
+
+MSenProvider& CSenXMLDAO::LookupHostletForL(const TDesC8& aHostletEndpoint,
+                                            const TDesC& aReqThreadId,
+                                            const TDesC8& aReqConsumerId)
+    {
+    // This method needs to be wrapped inside critical section 
+    // NOTE: do *NOT* file log before this line(!):
+
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::LookupHostletForL:");
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aReqThreadId));
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aReqConsumerId));
+
+    
+    // LIST OF SHARABLE PROVIDERS IS USED TO LOOKUP A MATCHING,
+    // SHARABLE PROVIDER, which is accessed by multiple requests,
+    // possibly even by multiple threads at the same time (if
+    // provider's type is non-threadsafe, meaning that it 
+    // itself implements mutex for incoming ServiceL calls etc.
+    TInt sharableCount(iSharableProviders.Count());
+    CSenProvider* pHostlet = NULL;
+
+    for(TInt s=0; s<sharableCount; s++)
+        {
+        pHostlet = iSharableProviders[s];
+        if(pHostlet)
+            {
+            if(pHostlet->Endpoint()==aHostletEndpoint)
+                {
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Matching sharable hostlet found from cache: 0x%X"), &pHostlet));
+                return *pHostlet;
+                }
+            }
+        }
+
+    
+    // Lookup unsharable providers, which EITHER are non-threadsafe
+    // (shared between several simultaneous requests from same consumer)
+    // OR which wish to stay on background and support reinitialization.
+    CSenHostletLookupInfo* pLookupInfo = 
+        CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId);
+
+    // It is not actually possible to get match with any threadsafe, 
+    // cached provider from this find:
+    TInt index = iUnsharableProviders.Find(*pLookupInfo);
+    CleanupStack::PopAndDestroy(); // pLookupInfo
+    pLookupInfo = NULL;
+
+    if(index!=KErrNotFound)
+        {
+        pHostlet = (CSenProvider*) iUnsharableProviders.ValueAt(index);
+        pLookupInfo = iUnsharableProviders.KeyAt(index);
+        if(pHostlet && pLookupInfo && !pHostlet->Threadsafe()) // sanity check
+            {
+            // Next line is critical; when count goes to zero,
+            // provider can be de-allocated from memory!
+            pLookupInfo->IncrementLookupCount();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- A non-threadsafe, unsharable local provider (hostlet) was found: 0x%X - lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount()));
+            if(pHostlet->Reinitializable())
+                {
+                pHostlet->ReinitL();
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Provider was also reinitialized.");
+                }
+            return *pHostlet;
+            }
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Matching unsharable provider was NOT found from the cache.");
+        }
+#endif
+
+    
+    // The provider has not yet been cached into memory, so load it:
+    // This method call *can leave*, if ECOM lookup fails!
+    // In case of leave Propagate meaningful error code to Remote Service Consumer 
+    TInt leaveCode(KErrNone); 
+    TRAP( leaveCode, pHostlet = CSenProvider::NewL(aHostletEndpoint) );
+    if( !pHostlet )
+    	{
+    	if( leaveCode )
+    		{
+    		TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Could not load Local Provider plugin, leave: %d"), leaveCode));	
+    		User::Leave( KErrSenHostNotAvailable ); // throw forward : meaningful errcode to consumer
+    		}
+    	}
+    	
+    CleanupStack::PushL(pHostlet);
+
+    TInt append(KErrNone);
+	if (pHostlet)
+	{
+    if(pHostlet->Sharable())
+        {
+        append = iSharableProviders.Append(pHostlet);
+        if(append==KErrNone)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Loaded new sharable hostlet instance: 0x%X"), &pHostlet));
+            CleanupStack::Pop(); // pHostlet
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- iSharableProviders.Append failed."); // OOM case
+            CleanupStack::PopAndDestroy(); // pHostlet
+            }
+        }
+    else // unsharable provider
+        {
+        // LIST OF UNSHARABLE PROVIDERS IS USED MAINLY TO MAKE IT
+        // POSSIBLE TO DE-ALLOCATE LOADED ECOM PLUG-IN INSTANCIES.
+        // In MCoreServiceManager there ReleaseHostletL() method gets
+        // called, which means that such provider may be removed from
+        // the map and destroyed. Otherwise, such hostlets are destroyed,
+        // when server (main thread) goes down.
+        
+        pLookupInfo = NULL;
+        if(pHostlet->Threadsafe())
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Adding new threadsafe, unsharable provider into cache.");
+            pLookupInfo = CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId);
+            }
+        else
+            {
+            // Any non-threadsafe provider should compare whether consumer ID
+            // is equal. The thread ID is irrelevant in the matching.
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Adding new non-threadsafe, unsharable provider into cache.");
+            pLookupInfo = CSenHostletLookupInfo::NewLC(KNullDesC, aReqConsumerId);
+            }
+
+        pLookupInfo->IncrementLookupCount();
+        append = iUnsharableProviders.Append(pLookupInfo, pHostlet);
+        if(append==KErrNone)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount()));
+            CleanupStack::Pop(2); // pLookupInfo, pHostlet
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- iUnsharableProviders.Append failed."); // OOM case
+            CleanupStack::PopAndDestroy(2); // pLookupInfo, pHostlet
+            }
+        }
+	}
+    User::LeaveIfError(append); // KErrNoMemory
+    return *pHostlet;
+    }
+
+TInt CSenXMLDAO::ReleaseHostletL(const MSenProvider* aHostlet,
+                                 const TDesC& aReqThreadId,
+                                 const TDesC8& aReqConsumerId)
+    {
+    // This method needs to be wrapped inside critical section 
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"CSenXMLDAO::ReleaseHostletL:");
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aHostlet->Endpoint()));
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aHostlet->Contract()));
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aReqThreadId));
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aReqConsumerId));
+
+
+    // Currently, sharable hostlets cannot be released
+    if(aHostlet->Sharable())
+        {
+        return KErrNotSupported;
+        }
+
+    // This method simple looks for any unsharable providers, which
+    TInt unsharableCount(iUnsharableProviders.Count());
+    TInt retVal(KErrNotFound);
+    for(TInt u=0; u<unsharableCount; u++)
+        {
+        CSenHostletLookupInfo* pLookupInfo = iUnsharableProviders.KeyAt(u);
+        MSenProvider* pHostlet = (MSenProvider*)iUnsharableProviders.ValueAt(u);
+        // Check whether the hostlet instances match
+        if(pHostlet && aHostlet != pHostlet)
+            {
+            continue; // no match
+            }
+        else if(aHostlet->Threadsafe())
+            {
+            if(!(pLookupInfo && pLookupInfo->ThreadId() == aReqThreadId
+                           && pLookupInfo->ConsumerId() == aReqConsumerId))
+                {
+                // mismatch either in thread or consumer id, or both; so
+                // check next one from the cache (map)
+                continue; // no match
+                }
+            }
+        else if(!(pLookupInfo && pLookupInfo->ConsumerId() == aReqConsumerId))
+            {
+            // even though thread (requester) is allowed to be change, the 
+            // hostlet still needs to be invoked using same consumer id,
+            // Since this is *not* the case, check next one from the cache (map)
+            continue; // no match
+            }
+            
+        // match: decrement lookup count
+        pLookupInfo->DecrementLookupCount();
+        TInt lookupCount = pLookupInfo->LookupCount();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- LookupInfo: 0x%X, lookup count after decrement: %d"), pLookupInfo, lookupCount));
+        if(pHostlet && pHostlet->StayOnBackground())
+            {
+            if(pHostlet->Reinitializable() && lookupCount==0)
+                {
+                // no-one is consuming the service, 
+                // so re-init this hostlet instance:
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Reinitializing unsharable hostlet instance: 0x%x"), pHostlet));
+                retVal = pHostlet->ReinitL();
+                }
+            }
+        else if(lookupCount==0) // this is the last consumer
+            {
+            // no need to keep this instance on background
+            // and no-one is consuming it's service
+            // destroy the ECOM plug-in instance:
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Deleting unsharable hostlet instance: 0x%x"), pHostlet));
+            retVal = iUnsharableProviders.RemoveByKey(*pLookupInfo); 
+            }
+        break; // release complete
+        } // for each map item..
+    return retVal; // KErrNone or KErrNotFound, or some error from ReinitL()
+  }
+void CSenXMLDAO::UpdateTouchSessionDBL(MSenServiceDescription& asd)
+	{
+	TInt count(0);
+	
+	RWSDescriptionArray matches;
+	CleanupClosePushL(matches);
+	
+	FindAllMatchingServiceDescriptions(matches, asd);
+	count = matches.Count();
+	
+	for(TInt i=0; i < count; i++)
+		{
+		TUint current_tick(0);
+		TBuf8<32> tickBuf;
+		
+		CSenWSDescription* sd = matches[i];
+		CSenElement& sdElem = sd->AsElement();
+		
+		current_tick = User::NTickCount();
+		tickBuf.Num(current_tick);
+		sdElem.AddAttrL(KTouch(), tickBuf);
+		}
+	
+	CleanupStack::PopAndDestroy(&matches);
+	// CleanupUnusedSessionDBL(); 
+                                  // (don't de-serialize old items). Serialized 
+	                              // objects cannot be de-allocated on the fly.
+	}
+	
+void CSenXMLDAO::CleanupUnusedSessionDBL()
+	{
+	TInt count(0);
+	
+	RPointerArray<CSenElement> sdElemList;
+	CleanupClosePushL(sdElemList);
+	
+	count = iSessions.Count();
+	
+	TUint32 current_tick(0);
+	TUint32 db_ticks(0);
+	TUint32 diff_ticks(0);
+	
+	for(TInt i=0; i < count; i++)
+		{
+				
+		CSenXmlServiceDescription* sd = iSessions[i];
+		CSenElement& sdElem = sd->AsElement();
+		TPtrC8 localName = sdElem.LocalName();
+		const TDesC8* val = sdElem.AttrValue(KTouch());
+		if(val != NULL)
+			{
+			TLex8 lex;
+            lex.Assign(*val);
+            lex.Val(db_ticks, EDecimal);
+            
+            current_tick = User::NTickCount();
+            diff_ticks = current_tick - db_ticks;
+                        	
+			if(KMaxTicks <= diff_ticks || current_tick < db_ticks)
+				{
+				delete iSessions[i];
+        		iSessions.Remove(i);
+        		
+        		i--;
+        		count--;
+				}
+			}
+		}
+	
+	CleanupStack::PopAndDestroy(&sdElemList);	
+	}	
+
+CSenHostletLookupInfo* CSenHostletLookupInfo::NewL(const TDesC& aThreadIdFullName,
+                                                   const TDesC8& aConsumerIdUrn)
+    {
+    CSenHostletLookupInfo* pNew = CSenHostletLookupInfo::NewLC(aThreadIdFullName,
+                                                               aConsumerIdUrn);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenHostletLookupInfo* CSenHostletLookupInfo::NewLC(const TDesC& aThreadIdFullName,
+                                                  const TDesC8& aConsumerIdUrn)
+    {
+    CSenHostletLookupInfo* pNew = new (ELeave) CSenHostletLookupInfo;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aThreadIdFullName, aConsumerIdUrn);
+    return pNew;
+    }
+
+void CSenHostletLookupInfo::ConstructL(const TDesC& aThreadIdFullName,
+                                      const TDesC8& aConsumerIdUrn)
+    {
+    ipFullThreadName = aThreadIdFullName.AllocL();
+    ipUniqueConsumerId = aConsumerIdUrn.AllocL();
+    ipLookupCount = new (ELeave) TInt(0);
+    }
+
+
+CSenHostletLookupInfo::CSenHostletLookupInfo()
+: ipFullThreadName(NULL),
+  ipUniqueConsumerId(NULL),
+  ipLookupCount(NULL)
+    {
+    }
+
+CSenHostletLookupInfo::~CSenHostletLookupInfo()
+    {
+    delete ipFullThreadName;
+    delete ipUniqueConsumerId;
+    delete ipLookupCount;
+    }
+
+TPtrC CSenHostletLookupInfo::ThreadId() const
+    {
+    return *ipFullThreadName;
+    }
+
+TPtrC8 CSenHostletLookupInfo::ConsumerId() const
+    {
+    return *ipUniqueConsumerId;
+    }
+
+
+TInt CSenHostletLookupInfo::LookupCount() const
+    {
+    return *ipLookupCount;
+    }
+
+void CSenHostletLookupInfo::IncrementLookupCount()
+    {
+    (*ipLookupCount)++;
+    }
+
+void CSenHostletLookupInfo::DecrementLookupCount()
+    {
+    (*ipLookupCount)--;
+    }
+
+
+TBool CSenHostletLookupInfo::operator==(const CSenHostletLookupInfo& aHostletRequestor)
+    {
+    return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName)
+            && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
+    
+    //    return (aHostletRequestor.ThreadId() == *ipFullThreadName
+//            && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
+    }
+
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/BWINSCW/SENCREDENTIALMANAGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,71 @@
+EXPORTS
+	??0CSenInternalCredential@@AAE@XZ @ 1 NONAME ; CSenInternalCredential::CSenInternalCredential(void)
+	??0RSenCredentialPtr@@QAE@XZ @ 2 NONAME ; RSenCredentialPtr::RSenCredentialPtr(void)
+	??1CSenCredentialIdentifier@@UAE@XZ @ 3 NONAME ; CSenCredentialIdentifier::~CSenCredentialIdentifier(void)
+	??1CSenCredentialManager@@UAE@XZ @ 4 NONAME ; CSenCredentialManager::~CSenCredentialManager(void)
+	??1CSenCredentialProperties@@UAE@XZ @ 5 NONAME ; CSenCredentialProperties::~CSenCredentialProperties(void)
+	??1CSenInternalCredential@@UAE@XZ @ 6 NONAME ; CSenInternalCredential::~CSenInternalCredential(void)
+	?AddCredentialObserverL@RSenCredentialPtr@@QAEXAAVMSenCredentialObserver@@@Z @ 7 NONAME ; void RSenCredentialPtr::AddCredentialObserverL(class MSenCredentialObserver &)
+	?AddFacetL@CSenCredentialProperties@@UAEHABVCSenFacet@@@Z @ 8 NONAME ; int CSenCredentialProperties::AddFacetL(class CSenFacet const &)
+	?Clone@RSenCredentialPtr@@QAE?AV1@XZ @ 9 NONAME ; class RSenCredentialPtr RSenCredentialPtr::Clone(void)
+	?Close@RSenCredentialPtr@@QAEXXZ @ 10 NONAME ; void RSenCredentialPtr::Close(void)
+	?CloseAndDestroyCredential@RSenCredentialPtr@@QAEXXZ @ 11 NONAME ; void RSenCredentialPtr::CloseAndDestroyCredential(void)
+	?ConstructL@CSenInternalCredential@@AAEXAAV1@@Z @ 12 NONAME ; void CSenInternalCredential::ConstructL(class CSenInternalCredential &)
+	?ConstructL@CSenInternalCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 13 NONAME ; void CSenInternalCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ConstructL@CSenInternalCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 14 NONAME ; void CSenInternalCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?ConstructL@CSenInternalCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 15 NONAME ; void CSenInternalCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?ConstructL@CSenInternalCredential@@AAEXABVTDesC8@@@Z @ 16 NONAME ; void CSenInternalCredential::ConstructL(class TDesC8 const &)
+	?Credential@RSenCredentialPtr@@QAEPAVCSenInternalCredential@@XZ @ 17 NONAME ; class CSenInternalCredential * RSenCredentialPtr::Credential(void)
+	?FacetValueL@CSenCredentialProperties@@UAEHAAVTDesC8@@AAPAVHBufC8@@@Z @ 18 NONAME ; int CSenCredentialProperties::FacetValueL(class TDesC8 &, class HBufC8 * &)
+	?HasProperties@CSenInternalCredential@@QAEHXZ @ 19 NONAME ; int CSenInternalCredential::HasProperties(void)
+	?IdL@CSenCredentialIdentifier@@UAEHXZ @ 20 NONAME ; int CSenCredentialIdentifier::IdL(void)
+	?IdentifierL@CSenInternalCredential@@UAEAAVCSenCredentialIdentifier@@XZ @ 21 NONAME ; class CSenCredentialIdentifier & CSenInternalCredential::IdentifierL(void)
+	?IdentityProviderIdL@CSenInternalCredential@@UAEHAAVTPtrC8@@@Z @ 22 NONAME ; int CSenInternalCredential::IdentityProviderIdL(class TPtrC8 &)
+	?IsApplicableL@CSenInternalCredential@@UAEHABVCSenWSDescription@@@Z @ 23 NONAME ; int CSenInternalCredential::IsApplicableL(class CSenWSDescription const &)
+	?NewL@CSenCredentialIdentifier@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 24 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenCredentialIdentifier@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 25 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenCredentialIdentifier@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 26 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenCredentialIdentifier@@SAPAV1@XZ @ 27 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewL(void)
+	?NewL@CSenCredentialManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 28 NONAME ; class CSenCredentialManager * CSenCredentialManager::NewL(class MSenCoreServiceManager &)
+	?NewL@CSenCredentialProperties@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 29 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenCredentialProperties@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 30 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenCredentialProperties@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 31 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenCredentialProperties@@SAPAV1@XZ @ 32 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewL(void)
+	?NewL@CSenInternalCredential@@SAPAV1@ABV1@@Z @ 33 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewL(class CSenInternalCredential const &)
+	?NewL@CSenInternalCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 34 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenInternalCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 35 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenInternalCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 36 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenInternalCredential@@SAPAV1@XZ @ 37 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewL(void)
+	?NewLC@CSenCredentialIdentifier@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 38 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenCredentialIdentifier@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 39 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewLC@CSenCredentialIdentifier@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 40 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewLC@CSenCredentialIdentifier@@SAPAV1@XZ @ 41 NONAME ; class CSenCredentialIdentifier * CSenCredentialIdentifier::NewLC(void)
+	?NewLC@CSenCredentialManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 42 NONAME ; class CSenCredentialManager * CSenCredentialManager::NewLC(class MSenCoreServiceManager &)
+	?NewLC@CSenCredentialProperties@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 43 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenCredentialProperties@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 44 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewLC@CSenCredentialProperties@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 45 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewLC@CSenCredentialProperties@@SAPAV1@XZ @ 46 NONAME ; class CSenCredentialProperties * CSenCredentialProperties::NewLC(void)
+	?NewLC@CSenInternalCredential@@SAPAV1@ABV1@@Z @ 47 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewLC(class CSenInternalCredential const &)
+	?NewLC@CSenInternalCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 48 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenInternalCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 49 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewLC@CSenInternalCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 50 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewLC@CSenInternalCredential@@SAPAV1@XZ @ 51 NONAME ; class CSenInternalCredential * CSenInternalCredential::NewLC(void)
+	?OpenL@RSenCredentialPtr@@QAEXPAVCSenInternalCredential@@@Z @ 52 NONAME ; void RSenCredentialPtr::OpenL(class CSenInternalCredential *)
+	?PropertiesL@CSenInternalCredential@@UAEAAVCSenCredentialProperties@@XZ @ 53 NONAME ; class CSenCredentialProperties & CSenInternalCredential::PropertiesL(void)
+	?PropertyL@CSenCredentialProperties@@UAEHABVTDesC8@@AAVTPtrC8@@@Z @ 54 NONAME ; int CSenCredentialProperties::PropertyL(class TDesC8 const &, class TPtrC8 &)
+	?RemoveCredentialObserver@RSenCredentialPtr@@QAEHAAVMSenCredentialObserver@@@Z @ 55 NONAME ; int RSenCredentialPtr::RemoveCredentialObserver(class MSenCredentialObserver &)
+	?RemoveFacetL@CSenCredentialProperties@@UAEHABVTDesC8@@@Z @ 56 NONAME ; int CSenCredentialProperties::RemoveFacetL(class TDesC8 const &)
+	?Session@CSenInternalCredential@@UAEPAVCSenServiceSession@@XZ @ 57 NONAME ; class CSenServiceSession * CSenInternalCredential::Session(void)
+	?SetCredential@RSenCredentialPtr@@QAEXPAVCSenInternalCredential@@@Z @ 58 NONAME ; void RSenCredentialPtr::SetCredential(class CSenInternalCredential *)
+	?SetFacetL@CSenCredentialProperties@@UAEHABVCSenFacet@@@Z @ 59 NONAME ; int CSenCredentialProperties::SetFacetL(class CSenFacet const &)
+	?SetIdL@CSenCredentialIdentifier@@UAEXH@Z @ 60 NONAME ; void CSenCredentialIdentifier::SetIdL(int)
+	?SetIdentifier@CSenInternalCredential@@UAEXPAVCSenCredentialIdentifier@@@Z @ 61 NONAME ; void CSenInternalCredential::SetIdentifier(class CSenCredentialIdentifier *)
+	?SetIdentityProviderIdL@CSenInternalCredential@@UAEXAAVTDesC8@@@Z @ 62 NONAME ; void CSenInternalCredential::SetIdentityProviderIdL(class TDesC8 &)
+	?SetProperties@CSenInternalCredential@@UAEXPAVCSenCredentialProperties@@@Z @ 63 NONAME ; void CSenInternalCredential::SetProperties(class CSenCredentialProperties *)
+	?SetPropertyL@CSenCredentialProperties@@UAEHABVTDesC8@@0@Z @ 64 NONAME ; int CSenCredentialProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &)
+	?SetSession@CSenInternalCredential@@UAEXAAVCSenServiceSession@@@Z @ 65 NONAME ; void CSenInternalCredential::SetSession(class CSenServiceSession &)
+	?SetValidUntilL@CSenCredentialProperties@@UAEXVTTime@@@Z @ 66 NONAME ; void CSenCredentialProperties::SetValidUntilL(class TTime)
+	?ValidUntilL@CSenCredentialProperties@@UAE?AVTTime@@XZ @ 67 NONAME ; class TTime CSenCredentialProperties::ValidUntilL(void)
+	?UpdateTouchCredDBL@CSenCredentialManager@@UAEXAAVMSenServiceDescription@@@Z @ 68 NONAME ; void CSenCredentialManager::UpdateTouchCredDBL(class MSenServiceDescription &)
+	?SetAuthInfo@CSenInternalCredential@@QAEXAAVTDesC8@@0@Z @ 69 NONAME ; void CSenInternalCredential::SetAuthInfo(class TDesC8 &, class TDesC8 &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/eabi/SENCREDENTIALMANAGERu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,91 @@
+EXPORTS
+	_ZN17RSenCredentialPtr10CredentialEv @ 1 NONAME
+	_ZN17RSenCredentialPtr13SetCredentialEP22CSenInternalCredential @ 2 NONAME
+	_ZN17RSenCredentialPtr22AddCredentialObserverLER22MSenCredentialObserver @ 3 NONAME
+	_ZN17RSenCredentialPtr24RemoveCredentialObserverER22MSenCredentialObserver @ 4 NONAME
+	_ZN17RSenCredentialPtr25CloseAndDestroyCredentialEv @ 5 NONAME
+	_ZN17RSenCredentialPtr5CloneEv @ 6 NONAME
+	_ZN17RSenCredentialPtr5CloseEv @ 7 NONAME
+	_ZN17RSenCredentialPtr5OpenLEP22CSenInternalCredential @ 8 NONAME
+	_ZN17RSenCredentialPtrC1Ev @ 9 NONAME
+	_ZN17RSenCredentialPtrC2Ev @ 10 NONAME
+	_ZN21CSenCredentialManager4NewLER22MSenCoreServiceManager @ 11 NONAME
+	_ZN21CSenCredentialManager5NewLCER22MSenCoreServiceManager @ 12 NONAME
+	_ZN21CSenCredentialManagerD0Ev @ 13 NONAME
+	_ZN21CSenCredentialManagerD1Ev @ 14 NONAME
+	_ZN21CSenCredentialManagerD2Ev @ 15 NONAME
+	_ZN22CSenInternalCredential10ConstructLERK6TDesC8 @ 16 NONAME
+	_ZN22CSenInternalCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 17 NONAME
+	_ZN22CSenInternalCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 18 NONAME
+	_ZN22CSenInternalCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 19 NONAME
+	_ZN22CSenInternalCredential10ConstructLERS_ @ 20 NONAME
+	_ZN22CSenInternalCredential10SetSessionER18CSenServiceSession @ 21 NONAME
+	_ZN22CSenInternalCredential11IdentifierLEv @ 22 NONAME
+	_ZN22CSenInternalCredential11PropertiesLEv @ 23 NONAME
+	_ZN22CSenInternalCredential13HasPropertiesEv @ 24 NONAME
+	_ZN22CSenInternalCredential13IsApplicableLERK17CSenWSDescription @ 25 NONAME
+	_ZN22CSenInternalCredential13SetIdentifierEP24CSenCredentialIdentifier @ 26 NONAME
+	_ZN22CSenInternalCredential13SetPropertiesEP24CSenCredentialProperties @ 27 NONAME
+	_ZN22CSenInternalCredential19IdentityProviderIdLER6TPtrC8 @ 28 NONAME
+	_ZN22CSenInternalCredential22SetIdentityProviderIdLER6TDesC8 @ 29 NONAME
+	_ZN22CSenInternalCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 30 NONAME
+	_ZN22CSenInternalCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 31 NONAME
+	_ZN22CSenInternalCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 32 NONAME
+	_ZN22CSenInternalCredential4NewLERKS_ @ 33 NONAME
+	_ZN22CSenInternalCredential4NewLEv @ 34 NONAME
+	_ZN22CSenInternalCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 35 NONAME
+	_ZN22CSenInternalCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 36 NONAME
+	_ZN22CSenInternalCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 37 NONAME
+	_ZN22CSenInternalCredential5NewLCERKS_ @ 38 NONAME
+	_ZN22CSenInternalCredential5NewLCEv @ 39 NONAME
+	_ZN22CSenInternalCredential7SessionEv @ 40 NONAME
+	_ZN22CSenInternalCredentialC1Ev @ 41 NONAME
+	_ZN22CSenInternalCredentialC2Ev @ 42 NONAME
+	_ZN22CSenInternalCredentialD0Ev @ 43 NONAME
+	_ZN22CSenInternalCredentialD1Ev @ 44 NONAME
+	_ZN22CSenInternalCredentialD2Ev @ 45 NONAME
+	_ZN24CSenCredentialIdentifier3IdLEv @ 46 NONAME
+	_ZN24CSenCredentialIdentifier4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 47 NONAME
+	_ZN24CSenCredentialIdentifier4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 48 NONAME
+	_ZN24CSenCredentialIdentifier4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 49 NONAME
+	_ZN24CSenCredentialIdentifier4NewLEv @ 50 NONAME
+	_ZN24CSenCredentialIdentifier5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 51 NONAME
+	_ZN24CSenCredentialIdentifier5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 52 NONAME
+	_ZN24CSenCredentialIdentifier5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 53 NONAME
+	_ZN24CSenCredentialIdentifier5NewLCEv @ 54 NONAME
+	_ZN24CSenCredentialIdentifier6SetIdLEi @ 55 NONAME
+	_ZN24CSenCredentialIdentifierD0Ev @ 56 NONAME
+	_ZN24CSenCredentialIdentifierD1Ev @ 57 NONAME
+	_ZN24CSenCredentialIdentifierD2Ev @ 58 NONAME
+	_ZN24CSenCredentialProperties11FacetValueLER6TDesC8RP6HBufC8 @ 59 NONAME
+	_ZN24CSenCredentialProperties11ValidUntilLEv @ 60 NONAME
+	_ZN24CSenCredentialProperties12RemoveFacetLERK6TDesC8 @ 61 NONAME
+	_ZN24CSenCredentialProperties12SetPropertyLERK6TDesC8S2_ @ 62 NONAME
+	_ZN24CSenCredentialProperties14SetValidUntilLE5TTime @ 63 NONAME
+	_ZN24CSenCredentialProperties4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 64 NONAME
+	_ZN24CSenCredentialProperties4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 65 NONAME
+	_ZN24CSenCredentialProperties4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 66 NONAME
+	_ZN24CSenCredentialProperties4NewLEv @ 67 NONAME
+	_ZN24CSenCredentialProperties5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 68 NONAME
+	_ZN24CSenCredentialProperties5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 69 NONAME
+	_ZN24CSenCredentialProperties5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 70 NONAME
+	_ZN24CSenCredentialProperties5NewLCEv @ 71 NONAME
+	_ZN24CSenCredentialProperties9AddFacetLERK9CSenFacet @ 72 NONAME
+	_ZN24CSenCredentialProperties9PropertyLERK6TDesC8R6TPtrC8 @ 73 NONAME
+	_ZN24CSenCredentialProperties9SetFacetLERK9CSenFacet @ 74 NONAME
+	_ZN24CSenCredentialPropertiesD0Ev @ 75 NONAME
+	_ZN24CSenCredentialPropertiesD1Ev @ 76 NONAME
+	_ZN24CSenCredentialPropertiesD2Ev @ 77 NONAME
+	_ZTI18CSenCredentialData @ 78 NONAME ; #<TI>#
+	_ZTI21CSenCredentialManager @ 79 NONAME ; #<TI>#
+	_ZTI22CSenInternalCredential @ 80 NONAME ; #<TI>#
+	_ZTI24CSenCredentialIdentifier @ 81 NONAME ; #<TI>#
+	_ZTI24CSenCredentialProperties @ 82 NONAME ; #<TI>#
+	_ZTV18CSenCredentialData @ 83 NONAME ; #<VT>#
+	_ZTV21CSenCredentialManager @ 84 NONAME ; #<VT>#
+	_ZTV22CSenInternalCredential @ 85 NONAME ; #<VT>#
+	_ZTV24CSenCredentialIdentifier @ 86 NONAME ; #<VT>#
+	_ZTV24CSenCredentialProperties @ 87 NONAME ; #<VT>#
+	_ZN21CSenCredentialManager18UpdateTouchCredDBLER22MSenServiceDescription @ 88 NONAME
+	_ZN22CSenInternalCredential11SetAuthInfoER6TDesC8S1_ @ 89 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wscredentialmanager    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wscredentialmanager.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wscredentialmanager.iby)
+PRJ_MMPFILES
+sencredentialmanager.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/group/sencredentialmanager.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for sencredentialmanger    
+*
+*/
+
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenCredentialManager.dll
+UID             0x1000008d 0x10274C71
+#else
+TARGET          wscredentialmanager.dll
+UID             0x1000008d 0x101F9747
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          sencredentialmanagerdll.cpp
+SOURCE          sencredentialmanager.cpp
+SOURCE          seninternalcredential.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc             // SenDebug.h - file logging MACROs
+USERINCLUDE     ../../wsframework/inc         // MSenCoreServiceManager.h
+USERINCLUDE     ../../wsidentitymanager/inc   // MSenIdentityManager.h <= needed by MSenCoreServiceManager.h
+USERINCLUDE     ../../wscore/inc              // MSenDAO.h (friend class)
+USERINCLUDE     ../../wslogger/inc 
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+
+#ifdef __CRYPTO_HW__
+SYSTEMINCLUDE   /epoc32/include/internal
+#endif // __CRYPTO_HW__
+
+// System libs
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib   // for RFs
+LIBRARY         estor.lib   // for RFileWriteStream
+LIBRARY         sysutil.lib // sysutil.h
+LIBRARY         flogger.lib
+LIBRARY         bafl.lib    // RStringbase
+
+#ifdef __CRYPTO_HW__
+#ifndef WINSCW 
+LIBRARY         SecEnv.lib
+#endif //WINSCW
+#endif // __CRYPTO_HW__
+
+// Symbian XML framework is used since S60 3rd edition (3.0)
+LIBRARY         xmlframework.lib
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+#endif
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libs
+LIBRARY         SenFragment.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenFramework.lib
+LIBRARY         SenLogger.lib
+LIBRARY         senxml.lib
+#else
+// SOA for S60 libs
+LIBRARY         wsFragment.lib
+LIBRARY         wsServDesc.lib
+LIBRARY         wsUtils.lib
+LIBRARY         wsFramework.lib
+LIBRARY         wsLogger.lib
+LIBRARY wsxml.lib
+#endif
+
+#if defined(ARMCC)
+DEFFILE ../eabi/SENCREDENTIALMANAGER.DEF
+#elif defined(WINSCW)
+DEFFILE ../BWINSCW/SENCREDENTIALMANAGER.DEF
+#elif defined(WINS)
+  DEFFILE    ../BWINS/SENCREDENTIALMANAGER.DEF
+#else 
+  DEFFILE     ../BMARM/SENCREDENTIALMANAGER.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/inc/sencredentialmanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CREDENTIAL_MANAGER_H
+#define SEN_CREDENTIAL_MANAGER_H
+
+// INCLUDES
+#include "msencredentialmanager.h"
+
+#include <e32std.h>
+#include <flogger.h>    // RFileLogger
+
+#include <SenFragmentBase.h>
+#include <MSenServiceDescription.h>
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+class CSenCredentialIdentifier;
+class CSenCredentialProperties;
+class CSenParser;
+
+// CLASS DECLARATION
+class CSenCredentialManager : public CSenFragmentBase , public MSenCredentialManager
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenCredentialManager* NewL(MSenCoreServiceManager& aManager);
+
+        IMPORT_C static CSenCredentialManager* NewLC(MSenCoreServiceManager& aManager);
+
+        IMPORT_C virtual ~CSenCredentialManager();
+
+        /**
+        * Load and parse SenCredentialManager from the file.
+        * Statuscodes:
+        *   KErrNone                Ok
+        *  Other codes are system error codes.
+        * @return status code.
+        */
+        TInt LoadDB();
+
+        /**
+        * Save SenCredentialManager as an XML document into
+        * the file.
+        * Statuscodes:
+        *   KErrNone                Ok
+        *  Other codes are system error codes.
+        * @return status code.
+        */
+        TInt SaveCredentialDB();
+
+        // From CSenBaseFragment
+        virtual void OnStartElementL(const RTagInfo& aElement,
+        							 const RAttributeArray& aAttributes,
+        						 	 TInt aErrorCode);
+
+        virtual void OnEndElementL(const RTagInfo& aElement,
+        						   TInt aErrorCode);
+
+        // from MSenCredentialManager
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  RSenCredentialArray& aCredentials);
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  const CSenIdentityProvider& aIdP,
+								  RSenCredentialArray& aCredentials);
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  RSenCredentialPtrArray& aCredentials);
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  const CSenIdentityProvider& aIdP,
+								  RSenCredentialPtrArray& aCredentials);
+
+		virtual RSenCredentialPtr AddCredentialL(CSenInternalCredential* apCredential,
+		                                         TInt& aErrorTo);
+
+		virtual RSenCredentialPtr AddCredentialL(CSenIdentityProvider* apIdP,
+									             CSenInternalCredential* apCredential,
+									             TInt& aErrorTo);
+									              
+		virtual RSenCredentialPtr AddCredentialL(const TDesC8& aCredential,
+		                                         TInt& aErrorTo);
+
+		virtual RSenCredentialPtr AddCredentialL(CSenIdentityProvider* apIdP,
+									             const TDesC8& aCredential,
+									             TInt& aErrorTo);
+
+		virtual TInt RemoveCredentialsL(const CSenWSDescription& aPattern);
+
+		virtual TInt RemoveCredentialsL(const CSenWSDescription& aPattern,
+										const CSenIdentityProvider& aIdP);
+        
+		virtual TInt RemoveCredentialsL(const TDesC8& aProviderId);
+        
+        virtual TInt RemoveCredentialL(TInt aInternalCredentialId);	//codescannerwarnings
+        
+        virtual RSenCredentialPtr CredentialL(TInt aInternalCredentialId,
+                                              TInt& aErrorTo);
+        
+        virtual RSenCredentialPtr UpdateCredentialL(TInt aInternalCredentialId,
+                                                    CSenInternalCredential* apCredential,
+                                                    TInt& aErrorTo);
+        
+        virtual RSenCredentialPtr UpdateCredentialL(TInt aInternalCredentialId,
+                                                    const TDesC8& aCredential,
+                                                    TInt& aErrorTo);
+		/** Improved heuristics from credential DB removal / cleanups
+		*
+		* It finds the matching CredentialContainer child elements of Credentials 
+		* element using the service description and add the touch attribute to all 
+		* matched credential container elements with current tick count value.
+		* If touch attribute already there it will be replaced with new current 
+		* tick count value.
+		*
+		* @param asd     is the new established session service description.
+		* Leave codes: Symbian system-wide error codes.  
+		*/                                                    
+		IMPORT_C virtual void UpdateTouchCredDBL(MSenServiceDescription& asd);
+        
+	protected:
+	    RFileLogger* Log();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenCredentialManager(MSenCoreServiceManager& aManager);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+
+        /**
+        * Initialize this SenCredentialManager by parsing
+        * the given file with the given XMLReader.
+        * The file is expected to contain valid XML that
+        * follows the example given above.
+        * @param file
+        * @param reader
+        */
+        void LoadFromL(const TDesC& aFile);
+
+        /**
+        * Save the current state of the SenCredentialManager as an XML
+        * document into a file.
+        * Status codes:
+        *   KErrNone                Ok
+        *   Other codes are system error codes.
+        * @return status code.
+        */
+        TInt SaveToL( const TDesC& aFile );
+
+	    virtual TInt NextCredentialIdL();	//codescannerwarnings
+	    
+	    virtual void UpdateMaxCredentialIdL();	//codescannerwarnings
+	    TBool IsApplicableOrShareableL(const CSenWSDescription& aPattern,CSenInternalCredential* aCredential);
+	    TInt RefreshMTL(const CSenWSDescription& aPattern);
+	    /** Improved heuristics from credential DB removal / cleanups
+	    *
+	    * Checks touch attribute value for all CredentialContainer child elements of 
+	    * Credentials element if that exceeds the the tick counts for two weeks 
+	    * (Max tick count) or if it is greater than current tick count it removes the 
+	    * corresponding CredentialContainer child element from the Credentials
+	    * element child list.
+	    * 
+	    * 1 millisec = 1 tick
+		* 86400 sec = 1 day
+		* 86400*1000 millisec = 1 day
+		* 86400*14*1000 = 1209600000 millisec = 2 weeks
+		* So if attr val >= 1209600000 or > current tick count.
+		* Note: always attr val should be <= current tick count.
+		*
+	    * eg;
+	    * Before call to CleanupUnusedCredDBL()
+	    * <Credentials CredentialsMaxID="3">
+		* <CredentialContainer>
+		* <Identifier>
+  		* <CredentialId>1</CredentialId>
+		* ..........
+		* ..........
+		* </CredentialContainer>
+		* <CredentialContainer touch="1000">
+		* <Identifier>
+  		* <CredentialId>2</CredentialId>
+		* ..........
+		* .........
+		* </CredentialContainer touch="1309600000">
+		* <CredentialContainer>
+		* <Identifier>
+  		* <CredentialId>3</CredentialId>
+		* ...........
+		* ...........
+		* </CredentialContainer>
+		* </Credentials>
+		*
+		* After call to CleanupUnusedCredDBL()
+	    * <Credentials CredentialsMaxID="3">
+		* <CredentialContainer>
+		* <Identifier>
+  		* <CredentialId>1</CredentialId>
+		* .........
+		*..........
+		* </CredentialContainer>
+		* <CredentialContainer touch="1000">
+		* <Identifier>
+  		* <CredentialId>2</CredentialId>
+		* ..........
+		* ..........
+		* </CredentialContainer>
+		* </Credentials>
+		* 
+		* Leave codes: Symbian system-wide error codes.
+	    */
+	    void CleanupUnusedCredDBL();
+	    TBool IsAuto(CSenIdentityProvider& aIdp);
+#ifdef __CRYPTO_HW__									
+        void EncryptPasswordL(const TDesC8& aData, TDes8& aCipherText);
+		
+		void DecryptPasswordL(const TDesC8& aData, TDes8& aCipherText);
+
+#endif // __CRYPTO_HW__
+	    
+    private: // Data
+        MSenCoreServiceManager&     iManager;
+        RFileLogger*                iLog;                   // not owned (no create/close)    
+		CSenParser*                 ipParser;               // owned 
+		RSenCredentialPtrArray      iCredentialArray;       // owned
+		
+		CSenFragmentBase*           ipCredentialContainer;  // owned
+		CSenCredentialIdentifier*   ipCredentialIdentifier; // owned
+		CSenCredentialProperties*   ipCredentialProperties; // owned
+		CSenInternalCredential*     ipCredential;           // owned
+		
+		TInt                        iMaxCredentialID;
+    };
+
+#endif // SEN_BASE_CREDENTIAL_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/inc/seninternalcredential.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,813 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           This internal class implements (web) service credential functionality
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_INTERNAL_CREDENTIAL_H
+#define SEN_INTERNAL_CREDENTIAL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <SenCredential2.h>
+
+// FORWARD DECLARATIONS
+class CSenCredentialProperties;
+class CSenCredentialIdentifier;
+class CSenWSDescription;
+
+
+// CLASS DECLARATION
+
+/**
+* Class implements (web) service credential functionality
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenInternalCredential : public CSenCredential2
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static CSenInternalCredential* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static CSenInternalCredential* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenInternalCredential* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenInternalCredential* NewLC(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenInternalCredential* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenInternalCredential* NewLC(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes,
+                                             TXmlEngElement& aParent);
+
+         /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenInternalCredential* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttrs,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenInternalCredential* NewLC(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttrs,
+                                             TXmlEngElement& aParent,
+                                             RSenDocument& aOwnerDocument);
+
+        /**
+        * Constructor which copies itself from another credential.
+        *
+        * @since Series60 3.2.3
+        * @param    aCredential     credential to copy from.
+        * @return new CSenCredential instance pointer
+        */
+        IMPORT_C static CSenInternalCredential* NewL(const CSenInternalCredential& aCredential);
+
+        /**
+        * Constructor which copies itself from another credential.
+        *
+        * @since Series60 3.2.3
+        * @param    aCredential     credential to copy from.
+        * @return new CSenCredential instance pointer, which is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenInternalCredential* NewLC(const CSenInternalCredential& aCredential);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenInternalCredential();
+
+        // New functions
+
+        /**
+        * Method for checking if this credential is applicable for
+        * given pattern.
+        *
+        * @since Series60 3.2.3
+        * @param    aPattern    pattern to check.
+        * @return   ETrue       if Credential is applicable
+        *           EFalse      if Credential is not applicable
+        */
+        IMPORT_C virtual TBool IsApplicableL(const CSenWSDescription& aPattern);	//codescannerwarings
+
+        /**
+        * Method for setting CredentialIdentifier.
+        *
+        * @since Series60 3.2.3
+        * @param    aIdentifier identifier to set.
+        */
+        IMPORT_C virtual void SetIdentifier(CSenCredentialIdentifier* aIdentifier);
+
+        /**
+        * Method for getting CredentialIdentifier.
+        *
+        * @since Series60 3.2.3
+        * @return   Identifier for this Credentiel
+        */
+        IMPORT_C virtual CSenCredentialIdentifier& IdentifierL();		//codescannerwarings
+
+        /**
+        * Method for setting CredentialProperties.
+        *
+        * @since Series60 3.2.3
+        * @param    aProperties properties to set.
+        */
+        IMPORT_C virtual void SetProperties(CSenCredentialProperties* aProperties);
+
+        /**
+        * Method for getting CredentialProperties.
+        *
+        * @since Series60 3.2.3
+        * @return   Properties for this Credentiel
+        */
+        IMPORT_C virtual CSenCredentialProperties& PropertiesL();	//codescannerwarings
+        
+        /**
+        * Method for checking if Credential has  properties.
+        *
+        * @since Series60 3.2.3
+        * @return   ETrue, if Credential has properties or
+        *           EFalse, if Credential does not have properties
+        */
+        IMPORT_C TBool CSenInternalCredential::HasProperties();
+
+        /**
+        * Method for setting IdentityProviderId for this Credential.
+        * Setting IdentityProviderId does build relation between this
+        * Credential and IdentityProvider for which IdentityProviderId
+        * refers to.
+        *
+        * @param   aIdentityProviderId    IdentityProviderId for IdentityProvider
+        *                                 which is related to this Credentiel.
+        */
+        IMPORT_C virtual void SetIdentityProviderIdL(TDesC8& aIdentityProviderId);
+
+        /**
+        * Method for setting Authentiaction information for this Credential.
+        * Setting Authentiaction does build relation between this
+        * Credential and IdentityProvider for which Authentiaction
+        * refers to.
+        *
+        * @param   aUserId    UserId for IdentityProvider
+        * @param   aPassword  Password for IdentityProvider
+        *                                 which is related to this Credentiel.
+        */
+        IMPORT_C void SetAuthInfo(TDesC8& aUserId, TDesC8& aPassword) ;
+
+        /**
+        * Method for getting IdentityProviderId of IdentityProvider which
+        * is related to this Credential.
+        *
+        * @since Series60 3.2.3
+        * @param aIdTo              a reference to TPtrC8 for which
+        *                           IdentityProviderId will be placed.
+        * @return   KErrNotFound    if IdentityProviderId is not stored
+        *                           into this Credential
+        *           KErrNone        If IdentityProviderId was found
+        *                           from this Credential.
+        */
+        IMPORT_C virtual TInt IdentityProviderIdL(TPtrC8& aIdTo);
+
+        /**
+        * Method for setting ServiceSession for this Credential.
+        * Setting ServiceSession does build relation between this
+        * Credential and given ServiceSession.
+        *
+        * @since Series60 3.2.3
+        * @param   aSession             ServiceSession for this Credentiel
+        */
+        IMPORT_C virtual void SetSession(CSenServiceSession& aSession);
+
+        /**
+        * Method for getting ServiceSession which is related to this
+        * Credential.
+        *
+        * @since Series60 3.2.3
+        * @return   ServiceSession for this Credentiel or NULL
+        *           if related ServiceSession is not set
+        */
+        IMPORT_C virtual CSenServiceSession* Session();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenInternalCredential();
+
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        * @param aParent is the parent element, which may declare other
+        *        namespaces.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8&  aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes,
+                                 TXmlEngElement& aParent);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        * @param aParent is the parent element, which may declare other
+        *        namespaces.
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this credential
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8&  aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes,
+                                 TXmlEngElement& aParent,
+                                 RSenDocument& aOwnerDocument);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 3.2.3
+        * @param aCredential is the source credential to be copied.
+        */
+        IMPORT_C void ConstructL(CSenInternalCredential& aCredential);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * BaseConstructL for setting XML localname for this Credential.
+        * @since Series60 3.2.3
+        * @param aLocalName XML localname for this Credential
+        */
+        IMPORT_C void ConstructL(const TDesC8& aLocalName);
+
+        // New functions
+
+        /**
+        * Setter for Credential ID
+        *
+        * @since Series60 3.2.3
+        * @param aId is the unique ID for this Credential
+        */
+        void SetIdL(const TDesC8& aId);
+
+    private: // Data
+        CSenCredentialIdentifier*   ipIdentifier;
+        CSenCredentialProperties*   ipProperties;
+        CSenIdentityProvider*       ipIdentityProvider;
+        CSenServiceSession*         ipSession;
+    };
+
+class CSenCredentialProperties : public CSenDomFragmentBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static CSenCredentialProperties* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static CSenCredentialProperties* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenCredentialProperties* NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenCredentialProperties* NewLC(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenCredentialProperties* NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes,
+                                                           TXmlEngElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenCredentialProperties* NewLC(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& aAttributes,
+                                                            TXmlEngElement& aParent);
+
+         /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenCredentialProperties* NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttrs,
+                                                           TXmlEngElement& aParent,
+                                                           RSenDocument& aOwnerDocument);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenCredentialProperties* NewLC(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& aAttrs,
+                                                            TXmlEngElement& aParent,
+                                                            RSenDocument& aOwnerDocument);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenCredentialProperties();
+
+        /**
+        * Sets new property.
+        *
+        * If property with given name does not exist,
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60 3.2.3
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        Is the value of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        */
+        IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+
+        /**
+        * Gets the value of the property behind certain name.
+        *
+        * @since Series60 3.2.3
+        * @param aName    The name identifying this property.
+        * @param aValue   A TPtrC8 reference to be filled in with the value of
+        *                 the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+
+        /**
+        * Method for checking if CredentialIdentifier has a certain facet.
+        *
+        * @since Series60 3.2.3
+        * @param aURI           the facet to get, typically some URI.
+        * @param aValueTo       a ref-to-pointer into which the value will
+        *                       be allocated, which ownership is transferred
+        *                       to the caller.
+        * @return               KErrNone or other system-wide Symbian error
+        *                       codes.
+        */
+        IMPORT_C virtual TInt FacetValueL(TDesC8& aURI, HBufC8*& aValueTo);
+
+        /**
+        * Method for adding a facet. Will NOT override an already
+        * existing facet with a same name.
+        *
+        * @since Series60 3.2.3
+        * @param        aFacet is the one to be added. A copy of the
+        *               the original facet instance will be added.
+        * @return       KErrNone or other system-wide Symbian error codes.
+        *               KErrAlreadyExists if a facet with same name exists
+        */
+        IMPORT_C virtual TInt AddFacetL(const CSenFacet& aFacet);
+
+        /**
+        * Method for setting a facet. Adds a new facet, if non-existent.
+        * But, if a facet with same name exists, it will be overridden.
+        *
+        * @since Series60 3.2.3
+        * @param        aFacet to be set. A copy of the original will be
+        *               created.
+        * @return       KErrNotFound if facet can not be found
+        *               KErrNone     if facet was found
+        *               KErrNoMemory if no memory could be allocated for the value
+        *               Other system-wide Symbian error codes.
+        */
+        IMPORT_C virtual TInt SetFacetL(const CSenFacet& aFacet);
+        /**
+        * Removes a characteristic (Facet) from the description
+        *
+        * @since Series60 3.2.3
+        * @param        aURI of the facet to be removed.
+        * @return       KErrNone     if a Facet was successfully removed
+        *               KErrNotFound if a Facet could not be found
+        *               Other system-wide Symbian error codes.
+        */
+        IMPORT_C virtual TInt RemoveFacetL(const TDesC8& aURI);
+
+        IMPORT_C virtual void SetValidUntilL(TTime aValidUntil);
+        
+        IMPORT_C virtual TTime ValidUntilL();
+        
+     protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenCredentialProperties();
+
+   };
+
+class CSenCredentialIdentifier : public CSenCredentialProperties
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                          const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewLC(const TDesC8& aNsUri,
+                                                        const TDesC8& aLocalName,
+                                                        const TDesC8& aQName,
+                                                        const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttributes,
+                                                       TXmlEngElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewLC(const TDesC8& aNsUri,
+                                                        const TDesC8& aLocalName,
+                                                        const TDesC8& aQName,
+                                                        const RAttributeArray& aAttributes,
+                                                        TXmlEngElement& aParent);
+
+         /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttrs,
+                                                       TXmlEngElement& aParent,
+                                                       RSenDocument& aOwnerDocument);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenCredentialIdentifier* NewLC(const TDesC8& aNsUri,
+                                                        const TDesC8& aLocalName,
+                                                        const TDesC8& aQName,
+                                                        const RAttributeArray& aAttrs,
+                                                        TXmlEngElement& aParent,
+                                                        RSenDocument& aOwnerDocument);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenCredentialIdentifier();
+
+        IMPORT_C virtual void SetIdL(TInt aId);
+
+        IMPORT_C virtual TInt IdL();
+        
+     private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenCredentialIdentifier();
+
+   };
+   
+class MSenCredentialObserver
+    {
+    public:
+        enum TSenCredentialChange
+            {
+            EDestroyed  = 1,
+            EReplaced   = 2,
+            EAdded
+            };
+
+		virtual void CredentialChanged(TSenCredentialChange aChange,
+		                               TAny* aPointer = NULL) = 0;
+    };
+    
+typedef RPointerArray<MSenCredentialObserver> RSenCredentialObserverArray;
+   
+class CSenCredentialData : public CBase
+    {
+    public:
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        static CSenCredentialData* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 3.2.3
+        */
+        static CSenCredentialData* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenCredentialData();
+        
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CSenCredentialData();
+    
+    public:
+        CSenInternalCredential*     ipCredential;
+        TInt                        iCounter;
+        RSenCredentialObserverArray iObserverArray;
+    };
+
+class RSenCredentialPtr
+	{
+    public:
+	    IMPORT_C void OpenL(CSenInternalCredential* apCredential);
+	    IMPORT_C CSenInternalCredential* Credential();
+	    IMPORT_C void SetCredential(CSenInternalCredential* apCredential);
+	    IMPORT_C RSenCredentialPtr Clone();
+	    IMPORT_C void Close();
+	    IMPORT_C void CloseAndDestroyCredential();
+	    IMPORT_C void AddCredentialObserverL(MSenCredentialObserver &aObserver);	//codescannerwarnings
+	    IMPORT_C TInt RemoveCredentialObserver(MSenCredentialObserver &aObserver);
+
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C RSenCredentialPtr();
+
+    private: // Data
+        CSenCredentialData* ipCredentialData;
+	};
+
+#endif // SEN_INTERNAL_CREDENTIAL2_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/rom/wscredentialmanager.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSCREDENTIALMANAGER_IBY__
+#define __WSCREDENTIALMANAGER_IBY__
+
+// SenCredential
+file=ABI_DIR\BUILD_DIR\SenCredentialManager.dll          PROGRAMS_DIR\SenCredentialManager.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/src/sencredentialmanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1758 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+#include "sencredentialmanager.h"
+#include "seninternalcredential.h"
+
+#include <s32mem.h>
+#include <s32file.h>
+#include <sysutil.h>
+#include <SenXmlProperties.h>
+#include <SenXmlConstants.h>
+
+#include "sendebug.h"               // internal \Utils\inc - filelogging MACROs
+#include "senlogger.h"
+#include "msencoreservicemanager.h" // internal \Framework\inc
+
+#include "senservicemanagerdefines.h" // KMaxTicks (1209600000)
+                                      // 1 tick = 1 millisec
+                                      // 86400 sec = 1 day
+                                      // 86400*1000 millisec = 1 day
+                                      // 86400*14*1000 = 1209600000 millisec = 2 weeks
+
+#include "SenParser.h"
+#include "SenDateUtils.h"
+#include "senwsdescription.h"
+#include "senwebservicesession.h"
+
+#include <SenServiceConnection.h> // KErrSenNoPermission ( -30315 )
+#include <xmlengnodelist.h> 
+#include <SenCredential.h>
+
+#include <SenXmlUtils.h>
+#ifdef __CRYPTO_HW__
+#include "sencryptoutils.h"
+#include <SecEnv.h>
+#include <SecEnvDevice.h>
+#include <SecEnvType.h>
+#include <SecEnvMgr.h>
+const TInt KCryptoPADataLen     = 16;
+const TInt KCryptoPACipherLen   = 48;
+const TInt KPaCryptAuthLen     = 32;
+const TInt KEncryptNoSalt = 3;
+const TInt KDecrypt       = 2;
+const TUint KPadding = 0;
+const TUint KEncrypedLen = 128;
+_LIT8(KCryptoPA, "PA_CRYPT");
+#endif // __CRYPTO_HW__
+
+namespace
+    {
+#if !defined( EKA2 ) && !defined( RD_SECURE_PRIV_DATA )
+    _LIT(KCredentialFile,           "C:\\system\\data\\sencredentials.xml");
+#else
+    _LIT(KCredentialFile,           "sencredentials.xml");
+#endif
+
+    _LIT8(KCredentials,             "Credentials");
+    _LIT8(KCredentialsMaxID,        "CredentialsMaxID");
+    _LIT8(KCredentialContainer,     "CredentialContainer");
+    _LIT8(KCredentialIdentifier,    "Identifier");
+    _LIT8(KCredentialProperties,    "Properties");
+    _LIT8(KTouch,    "touch");
+    _LIT8(KCredentialId, "CredentialId");
+    
+    const TInt KStateParsingCredentialContainer   = 99;
+    const TInt KStateParsingCredentialIdentifier  = 100;
+    const TInt KStateParsingCredentialProperties  = 102;
+    const TInt KStateParsingCredential            = 104;
+    const TInt KFlatBufSize                       = 128;
+    
+    /* microseconds before actual notOnOrAfter (or validUntil) time
+     * when credentials are treated as expired.
+     */
+    const TInt KClockSlipMicroSeconds = 3*60*1000*1000;
+    }
+
+EXPORT_C CSenCredentialManager* CSenCredentialManager::NewL(MSenCoreServiceManager& aManager)
+    {
+    CSenCredentialManager* pNew = NewLC(aManager);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+    }
+
+EXPORT_C CSenCredentialManager* CSenCredentialManager::NewLC(MSenCoreServiceManager& aManager)
+    {
+    CSenCredentialManager* pNew = new (ELeave) CSenCredentialManager(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenCredentialManager::CSenCredentialManager(MSenCoreServiceManager& aManager)
+: iManager(aManager),
+  iLog((RFileLogger*)aManager.Log()),
+  iMaxCredentialID(0)
+    {
+    }
+
+EXPORT_C CSenCredentialManager::~CSenCredentialManager()
+    {
+    SaveCredentialDB();
+    
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i < count; i++)
+        {
+        iCredentialArray[i].Close();
+        }
+    iCredentialArray.Close();
+    
+    delete ipParser;
+    
+    // Sanity check for Delegates (which are not handled correctly
+    //                             during parsing)
+    delete ipCredentialContainer;
+    delete ipCredentialIdentifier;
+    delete ipCredentialProperties;
+    delete ipCredential;
+    }
+
+void CSenCredentialManager::ConstructL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCredentialManager::ConstructL");
+    BaseConstructL(KCredentials);
+    LoadDB();
+    }
+
+RFileLogger* CSenCredentialManager::Log()
+    {
+    return iLog;
+    }
+    
+void CSenCredentialManager::OnStartElementL(const RTagInfo& aElement,
+                                            const RAttributeArray& aAttributes,
+                                            TInt aErrorCode)
+    {
+    const TPtrC8 localName   = aElement.LocalName().DesC();
+    
+    switch (iState)
+        {
+        case KSenStateSave:
+            {
+            const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+            
+            if (saxLocalName == KCredentialContainer)
+                {
+                if ( ipCredentialContainer )
+                    {
+                    TXmlEngElement element  = ipCredentialContainer->AsElementL();
+                    element.Remove(); // Deletes Container from Dom tree
+                    delete ipCredentialContainer;
+                    ipCredentialContainer = NULL;
+                    }
+                    
+                const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+                const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+                TXmlEngElement element = AsElementL();
+                RSenDocument   document = AsDocumentL();
+
+				ipCredentialContainer = CSenFragmentBase::NewL(
+					                         saxNsUri, saxLocalName,
+					                         saxPrefix, aAttributes,
+					                         element, document 
+					                         );
+					                         
+                iState = KStateParsingCredentialContainer;
+                }
+
+            break;
+            }
+        case KStateParsingCredentialContainer: // KStateParsingCredentialContainer 
+                                               // is also Save state
+            {
+            const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+
+            if (saxLocalName == KCredentialIdentifier)
+                {
+                if ( ipCredentialIdentifier )
+                    {
+                    TXmlEngElement element  = ipCredentialIdentifier->AsElementL();
+                    element.Remove(); // Deletes Identifier from Dom tree
+                    delete ipCredentialIdentifier;
+                    ipCredentialIdentifier = NULL;
+                    }
+                
+                const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+                const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+                TXmlEngElement element  = ipCredentialContainer->AsElementL();
+                RSenDocument   document = AsDocumentL();
+
+				ipCredentialIdentifier = CSenCredentialIdentifier::NewL(
+					                         saxNsUri, saxLocalName,
+					                         saxPrefix, aAttributes,
+					                         element, document 
+					                         );
+
+                iState = KStateParsingCredentialIdentifier;
+
+                OnDelegateParsingL(*ipCredentialIdentifier);
+                }
+            else if (saxLocalName == KCredentialProperties)
+                {
+                if ( ipCredentialProperties )
+                    {
+                    TXmlEngElement element  = ipCredentialProperties->AsElementL();
+                    element.Remove(); // Deletes Properties from Dom tree
+                    delete ipCredentialProperties;
+                    ipCredentialProperties = NULL;
+                    }
+                
+                const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+                const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+                TXmlEngElement element  = ipCredentialContainer->AsElementL();
+                RSenDocument   document = AsDocumentL();
+
+				ipCredentialProperties = CSenCredentialProperties::NewL(
+					                         saxNsUri, saxLocalName,
+					                         saxPrefix, aAttributes,
+					                         element, document 
+					                         );
+
+                iState = KStateParsingCredentialProperties;
+
+                OnDelegateParsingL(*ipCredentialProperties);
+                }
+            else 
+                {
+                // Parsing Credential
+                // 
+                // <=> Container can have only three elements:
+                //     1) CredentialIdentifier,
+                //     2) CredentialProperties and
+                //     3) Credential (which LocalName we do not know)
+                //
+                //     If we see that LocalName was not CredentialIdentifier
+                //                                      or CredentialProperties
+                //     we know that we are handling Credential.
+                
+                if ( ipCredential )
+                    {
+                    TXmlEngElement element  = ipCredential->AsElementL();
+                    element.Remove(); // Deletes Credential from Dom tree
+                    delete ipCredential;
+                    ipCredential = NULL;
+                    }
+                
+                const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+                const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+                TXmlEngElement element  = ipCredentialContainer->AsElementL();
+                RSenDocument   document = AsDocumentL();
+
+				ipCredential = CSenInternalCredential::NewL(
+					                         saxNsUri, saxLocalName,
+					                         saxPrefix, aAttributes,
+					                         element, document 
+					                         );
+		        ipCredential->SetIdentifier(ipCredentialIdentifier);
+		        ipCredentialIdentifier = NULL;
+
+		        ipCredential->SetProperties(ipCredentialProperties);
+		        ipCredentialProperties = NULL;
+
+                iState = KStateParsingCredential;
+
+                OnDelegateParsingL(*ipCredential);
+                }
+            break;
+            }
+        default:
+            {
+            const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+
+            if (saxLocalName == KCredentials)
+                {
+                TInt count(aAttributes.Count());
+
+                for (TInt i=0; i<count; i++)
+                    {
+                    TPtrC8 localName = aAttributes[i].Attribute().LocalName().DesC();
+                    TPtrC8 value = aAttributes[i].Value().DesC();
+                    
+                    if ( localName == KCredentialsMaxID )
+                        {
+                        TLex8 lex;
+                        lex.Assign(value);
+                        lex.Val( iMaxCredentialID );                        
+                        break;
+                        }
+                    }
+                }
+                
+            CSenFragmentBase::OnStartElementL( aElement, aAttributes, aErrorCode );
+            break;
+            }
+        }
+    }
+    
+void CSenCredentialManager::OnEndElementL( const RTagInfo& aElement, TInt aErrorCode )
+
+    {
+    const TPtrC8 localName   = aElement.LocalName().DesC();
+
+    switch(iState)
+        {
+        case KStateParsingCredentialIdentifier:
+            {
+#ifdef __CRYPTO_HW__
+
+            TInt leaveCode(KErrNone);  
+ 			TPtrC8 pass;
+            TBuf8<KEncrypedLen> decPwd;
+            ipCredentialIdentifier->PropertyL(KSenIdpPasswordLocalname, pass);
+            TRAP(leaveCode, DecryptPasswordL(pass, decPwd));
+            if (leaveCode == KErrNone)
+                {
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("SenCredentialManager::DecryptPasswordL success")));
+                }
+            else
+                {
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("SenCredentialManager::DecryptPasswordL Failed"))); 
+                }
+			ipCredentialIdentifier->SetPropertyL(KSenIdpPasswordLocalname, decPwd);       			
+			
+#endif // __CRYPTO_HW__			
+            iState = KStateParsingCredentialContainer;
+            break;
+            }
+        case KStateParsingCredentialProperties:
+            {
+            iState = KStateParsingCredentialContainer;
+            break;
+            }
+        case KStateParsingCredential:
+            {
+            TTime now;
+            now.UniversalTime();
+            
+            TPtrC8 value;
+            TTimeIntervalMicroSeconds clientServerInterval = 0;
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Checking 'ServiceInterval' property.");
+            _LIT8(KServiceInterval,"ServiceInterval");	//CodeScannerWarnings
+            TInt ret = ipCredential->PropertiesL().PropertyL(KServiceInterval, value);
+            
+            TBool propertiesExist(ETrue);
+            
+            if ( ret == KErrNone )
+                {
+                TLex8 lex(value);
+                TInt64 val;
+                ret = lex.Val(val);
+                TTimeIntervalMicroSeconds clientServerInterval = val;
+                if ( ret == KErrNone )
+                    {
+#ifdef _SENDEBUG
+                    TInt leaveCode(KErrNone);
+                    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+                    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(ts, now);)
+                    if (leaveCode == KErrNone)
+                        {
+                        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("Client time : %S"), &ts));
+                        }
+#endif // _SENDEBUG
+                    now += clientServerInterval;
+#ifdef _SENDEBUG
+                    TBuf8<64> buf;
+                    buf.AppendNum(clientServerInterval.Int64());
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("Client-Server Interval in microseconds: %S"),&buf));
+                    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(ts, now);)
+                    if (leaveCode == KErrNone)
+                        {
+                        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("Fixed client time : %S"), &ts));
+                        }
+                    leaveCode = 0; // not used
+#endif // _SENDEBUG
+                    }
+                }
+            else if ( ret == KErrNotFound )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- 'ServiceInterval' not found.");
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Checking 'ValidUntil' property.");
+                TInt ret2 = ipCredential->PropertiesL().PropertyL(_L8("ValidUntil"), value);
+                if ( ret2 == KErrNotFound )
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- 'ValidUntil' not found.");
+                    propertiesExist = EFalse;
+                    }
+                }                
+            
+            if ( !propertiesExist ||
+                ( ( ipCredential->PropertiesL().ValidUntilL() != Time::NullTTime() ) &&
+                 ( now > (ipCredential->PropertiesL().ValidUntilL()-TTimeIntervalMicroSeconds(KClockSlipMicroSeconds)) ) )
+               )
+                {
+                
+#ifdef _SENDEBUG
+                if ( propertiesExist )
+                    {
+                    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("- Loaded credential is expired:")));
+                    TInt leaveCode(KErrNone);
+                    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts2;
+                    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(ts2, ipCredential->PropertiesL().ValidUntilL());)//codescannerwarnings
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Credential time : %S, clockslip: %d micros"), &ts2, KClockSlipMicroSeconds));
+                    leaveCode = 0; // not used
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Neither 'ValidUntil' or 'ServiceInterval' exist: credential should be discarded(!)");
+                    }
+#endif // _SENDEBUG
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("-- Invalid credential will be removed from CredentialManager.")));
+
+                
+                delete ipCredential;            
+                ipCredential = NULL;         
+                }
+            else
+                {
+                if ( ipCredential->PropertiesL().ValidUntilL() != Time::NullTTime() )
+                    {
+                    TTime validUntil = ipCredential->PropertiesL().ValidUntilL();
+                    ipCredential->SetValidUntil(validUntil);
+                    }
+                
+                RSenCredentialPtr credentialPtr;
+                credentialPtr.OpenL(ipCredential);
+                CleanupClosePushL(credentialPtr);
+                iCredentialArray.Append(credentialPtr);
+                CleanupStack::Pop(&credentialPtr);
+                }
+                
+            ipCredential = NULL;
+
+            iState = KStateParsingCredentialContainer;
+            break;
+            }
+        case KStateParsingCredentialContainer:
+            {
+            if(localName == KCredentialContainer)
+            	{
+            if ( ipCredentialContainer )
+                {
+                TXmlEngElement element  = ipCredentialContainer->AsElementL();
+                RXmlEngNodeList<TXmlEngElement> children;
+                
+                CleanupClosePushL(children);
+                element.GetChildElements(children);
+    
+                // Element should always have 3 child elements:
+                //         1) CredentialIdentifier and
+                //         2) Credential
+                //         3) CredentialProperties
+                if ( children.Count() < 2 )
+                    {
+                    if ( ipCredentialIdentifier )
+                        {
+                        TXmlEngElement element  = ipCredentialIdentifier->AsElementL();
+                        element.Remove(); // Deletes Identifier from Dom tree
+                        delete ipCredentialIdentifier;
+                        ipCredentialIdentifier = NULL;
+                        }
+                    if ( ipCredentialProperties )
+                        {
+                        TXmlEngElement element  = ipCredentialProperties->AsElementL();
+                        element.Remove(); // Deletes Identifier from Dom tree
+                        delete ipCredentialProperties;
+                        ipCredentialProperties = NULL;
+                        }
+                    if ( ipCredential )
+                        {
+                        TXmlEngElement element  = ipCredential->AsElementL();
+                        element.Remove(); // Deletes Credential from Dom tree
+                        delete ipCredential;
+                        ipCredential = NULL;
+                        }
+                    element.Remove();
+                    }
+                CleanupStack::PopAndDestroy(&children);
+
+                delete ipCredentialContainer;
+                ipCredentialContainer = NULL;
+                if ( ipContentBuf )
+    				{
+	                
+    		    	delete ipContentBuf;
+        			ipContentBuf = NULL;
+        
+        			delete ipContentWriteStream;
+        			ipContentWriteStream = NULL;
+        			}
+                }
+                
+            iState = KSenStateSave;
+            break;
+            	}
+            	else
+            	{
+            		return;
+            	}
+            }
+        default:
+            {
+            CSenFragmentBase::OnEndElementL(aElement, aErrorCode);
+            
+            break;
+            }
+        }
+    }    
+    
+TInt CSenCredentialManager::LoadDB()
+    {
+    TInt retVal(KErrNone);
+	if ( !ipParser )
+        {
+        TRAP( retVal, ipParser = CSenParser::NewL(); )
+        if( retVal == KErrNone )
+            {
+            ipParser->EnableFeature(EReportNamespaceMapping);
+            }
+        }
+    if( retVal == KErrNone )
+        {
+        TRAP(retVal, LoadFromL(KCredentialFile));
+        }
+    return retVal;
+    }
+
+void CSenCredentialManager::LoadFromL(const TDesC& aFile)
+    {
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    TInt leaveCode(KErrNone);
+
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+    TBuf<KMaxPath> file;
+    fss.CreatePrivatePath(EDriveC);
+    fss.PrivatePath(file);
+    file.Append(aFile);
+    TRAP(leaveCode, ipParser->ParseL(fss, file, *this));
+#else
+    TRAP(leaveCode, aReader.ParseL(fss, aFile, *this));
+#endif
+
+    iState = KSenStateSave;
+    
+#ifdef _SENDEBUG
+    if(leaveCode == KErrNotFound)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- The sencredentials.xml does not exist!");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- New file will be generated.");
+        }
+    else if(leaveCode != KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Parsing of sencredentials.xml leaved: %d"), leaveCode));
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Credential database (sencredentials.xml) successfully read.");
+        }
+#else
+    leaveCode=0; // this is a decision: we are not interested
+                 // of invalid input in read/parse phase
+#endif
+
+    SaveCredentialDB(); // Always validate by saving
+
+    CleanupStack::PopAndDestroy(); // fss
+    }
+
+TInt CSenCredentialManager::SaveCredentialDB()
+    {
+    TInt retVal(KErrNone);
+    TRAP(retVal, SaveToL(KCredentialFile));
+    return retVal;
+    }
+
+TInt CSenCredentialManager::SaveToL(const TDesC& aFile)
+    {
+    TInt count = iCredentialArray.Count();
+    TInt maxId = 0;
+#ifdef __CRYPTO_HW__
+
+	RArray<RBuf8 *> password;
+	TPtrC8 tempPass;
+	TInt leaveCode(KErrNone);
+
+#endif // __CRYPTO_HW__
+    for (TInt i=0; i<count; i++)
+        {
+#ifdef __CRYPTO_HW__		
+        iCredentialArray[i].Credential()->IdentifierL().PropertyL(KSenIdpPasswordLocalname, tempPass);
+        RBuf8 *pTempBuf = new RBuf8;
+        pTempBuf->Create(tempPass);
+        password.Append(pTempBuf);
+                
+        leaveCode = KErrNone;
+        TBuf8<KEncrypedLen> encPwd;
+        TRAP(leaveCode, EncryptPasswordL(tempPass, encPwd));
+        if (leaveCode == KErrNone)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("SenCredentialManager::EncryptPasswordL success")));
+            }
+        else
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("SenCredentialManager::EncryptPasswordL Failed")));
+            }
+       // EncryptPasswordL(tempPass, encPwd);
+        iCredentialArray[i].Credential()->IdentifierL().SetPropertyL(KSenIdpPasswordLocalname, encPwd);
+#endif // __CRYPTO_HW__		
+        if ( iCredentialArray[i].Credential()->IdentifierL().IdL() > maxId )
+            {
+            maxId = iCredentialArray[i].Credential()->IdentifierL().IdL();
+            }
+        }
+    iMaxCredentialID = maxId;
+    UpdateMaxCredentialIdL();
+
+    // First, collect everything into MEMORY
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+
+    WriteAsXMLToL(bufWs);
+
+    TPtrC8 p8 = pBuf->Ptr(0);
+
+    CleanupStack::PopAndDestroy(1); // bufWs
+
+    // Everything in MEMORY ok, prepare to write into file
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    RFileWriteStream fileOutStream;
+    CleanupClosePushL(fileOutStream);
+
+    if(!SysUtil::FFSSpaceBelowCriticalLevelL(&fss, p8.Length()) )
+        {
+        //Data caging 2 implementation
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+        TBuf<KMaxPath> file;
+        fss.CreatePrivatePath(EDriveC);
+        fss.PrivatePath(file);
+        file.Append(aFile);
+        fileOutStream.Replace(fss, file, EFileWrite);
+#else
+        fileOutStream.Replace(fss, aFile, EFileWrite);
+#endif
+        // finally write the UTF-8 into the file. 
+        fileOutStream.WriteL(p8);
+        }
+
+    CleanupStack::PopAndDestroy(3); // fileOutStream, fss, pBuf
+#ifdef __CRYPTO_HW__
+    for (TInt i=0; i<count; i++)
+        {
+        iCredentialArray[i].Credential()->IdentifierL().SetPropertyL(KSenIdpPasswordLocalname, *password[i]);
+        password[i]->Close();
+        delete password[i];
+        }
+#endif // __CRYPTO_HW__	
+    return KErrNone;
+    }
+    
+TInt CSenCredentialManager::CredentialsL(const CSenWSDescription& aPattern,
+								         RSenCredentialArray& aCredentials)
+    {
+    TInt retVal(KErrNotFound);
+ //   RefreshMTL(aPattern);
+    
+    TInt count = iCredentialArray.Count();
+    
+    for (TInt i=0; i<count; i++)
+        {
+        if(IsApplicableOrShareableL(aPattern, iCredentialArray[i].Credential()))
+//        if ( iCredentialArray[i].Credential()->IsApplicable(aPattern) )
+            {
+            TPtrC8 providerId;
+            retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerId);
+            if ( retVal == KErrNone )
+                {
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                if ( pProvider )
+                    {
+                    if ( ( pProvider->UserName() == KNullDesC8 ) &&
+                         ( pProvider->Password() == KNullDesC8 ) )
+                        {
+                        aCredentials.AppendL(iCredentialArray[i].Credential());
+                        }
+                    else
+                        {
+                        retVal = KErrSenNoPermission;
+                        }
+                    }
+                else
+                    {
+                    // Note: Serene DB should not contain Credential
+                    //       which has IdentityProviderId which points
+                    //       to non-existent IdentityProvider.
+                    // After all we cannot give access to Credential
+                    // which has IdentityProviderId, even though actual
+                    // IdentityProvider can not be found anymore.
+                    retVal = KErrSenNoPermission;
+                    }
+                }
+            else
+                {
+                aCredentials.AppendL(iCredentialArray[i].Credential());                
+                }
+            }
+        }
+
+    if ( aCredentials.Count() == 0 )
+        {
+        return retVal;
+        }
+        
+    return KErrNone;
+    }
+
+TBool CSenCredentialManager::IsAuto(CSenIdentityProvider& aIdp)
+    {
+    CSenElement* el(NULL);
+    TPtrC8 ext = aIdp.AccountExtensions(el);
+    if (ext == KNullDesC8)
+        {
+        if (el)
+            {
+            el = el->Element(KSenAccAutoSignIn);
+            if (el && el->Content() == KSenPropertyTrue)
+                {
+                return ETrue;
+                }
+            }
+        }
+    else
+        {
+        RBuf8 mask;
+        mask.Create(KSenAccAutoSignIn().Length() +
+                    KSenGreaterThan().Length() +
+                    KSenPropertyTrue().Length());
+        mask.CleanupClosePushL();
+        mask.Append(KSenAccAutoSignIn);
+        mask.Append(KSenGreaterThan);
+        mask.Append(KSenPropertyTrue);
+        if (ext.FindF(mask) != KErrNotFound)
+            {                                    
+            return ETrue;
+            }
+        CleanupStack::PopAndDestroy(&mask);
+        }          
+    return EFalse;
+    }
+TInt CSenCredentialManager::CredentialsL(const CSenWSDescription& aPattern,
+								         const CSenIdentityProvider& aIdP,
+								         RSenCredentialArray& aCredentials)
+    {
+ //   RefreshMTL(aPattern);
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        if(IsApplicableOrShareableL(aPattern, iCredentialArray[i].Credential()))
+//        if ( iCredentialArray[i].Credential()->IsApplicable(aPattern) )
+            {
+            TPtrC8 providerId;
+            TInt retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerId);
+            
+            if ( retVal == KErrNone )
+                {
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                CSenCredentialIdentifier& identifier = iCredentialArray[i].Credential()->IdentifierL();
+                
+                TPtrC8 usernameIdent;
+                TInt retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, usernameIdent);
+                TPtrC8 passwordIdent;
+                retVal = identifier.PropertyL(KSenIdpPasswordLocalname, passwordIdent);
+                
+                TPtrC8 usernameProv  =  ((CSenIdentityProvider&)aIdP).UserName();
+                TPtrC8 passwordProv  = ((CSenIdentityProvider&)aIdP).Password();
+
+                HBufC8* decPasswordIden = SenXmlUtils::DecodeHttpCharactersLC(passwordIdent);
+                HBufC8* decPasswordProv = SenXmlUtils::DecodeHttpCharactersLC(passwordProv);          
+                
+                if( ( usernameIdent.Length() == 0 || usernameIdent == usernameProv ) &&
+                        (
+                        ( decPasswordIden->Length() == 0 || *decPasswordIden == *decPasswordProv ) 
+                        ||
+                        (IsAuto(*pProvider) && *decPasswordProv == KNullDesC8)
+                        )
+                    )
+                    {
+                    aCredentials.AppendL(iCredentialArray[i].Credential());
+                    }
+                CleanupStack::PopAndDestroy(2); // decode x2
+                }
+            }
+        }
+        
+    if ( aCredentials.Count() == 0 )
+        {
+        return KErrNotFound;
+        }
+        
+    return KErrNone;
+    }
+
+TInt CSenCredentialManager::CredentialsL(const CSenWSDescription& aPattern,
+								         RSenCredentialPtrArray& aCredentials)
+    {
+    TInt retVal(KErrNotFound);
+    
+    TInt count = iCredentialArray.Count();
+    
+    for (TInt i=0; i<count; i++)
+        {
+        if(IsApplicableOrShareableL(aPattern, iCredentialArray[i].Credential()))
+//        if ( iCredentialArray[i].Credential()->IsApplicable(aPattern) )
+            {
+            TPtrC8 providerId;
+            retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerId);
+            if ( retVal == KErrNone )
+                {
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                if ( pProvider )
+                    {
+                    if ( ( pProvider->UserName() == KNullDesC8 ) &&
+                         ( pProvider->Password() == KNullDesC8 ) )
+                        {
+                        aCredentials.AppendL(iCredentialArray[i]);
+                        }
+                    else
+                        {
+                        retVal = KErrSenNoPermission;
+                        }
+                    }
+                else
+                    {
+                    // Note: Serene DB should not contain Credential
+                    //       which has IdentityProviderId which points
+                    //       to non-existent IdentityProvider.
+                    // After all we cannot give access to Credential
+                    // which has IdentityProviderId, even though actual
+                    // IdentityProvider can not be found anymore.
+                    retVal = KErrSenNoPermission;
+                    }
+                }
+            else
+                {
+                aCredentials.AppendL(iCredentialArray[i]);                
+                }
+            }
+        }
+
+    if ( aCredentials.Count() == 0 )
+        {
+        return retVal;
+        }
+        
+    return KErrNone;
+    }
+
+TInt CSenCredentialManager::CredentialsL(const CSenWSDescription& aPattern,
+								         const CSenIdentityProvider& aIdP,
+								         RSenCredentialPtrArray& aCredentials)
+    {
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        if(IsApplicableOrShareableL(aPattern, iCredentialArray[i].Credential()))
+//        if ( iCredentialArray[i].Credential()->IsApplicable(aPattern) )
+            {
+            TPtrC8 providerId;
+            TInt retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerId);
+            if ( retVal == KErrNone )
+                {
+                /*CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                if ( pProvider )
+                    {
+                    if ( ( ((CSenIdentityProvider&)aIdP).UserName() == pProvider->UserName() ) &&
+                         ( ((CSenIdentityProvider&)aIdP).Password() == pProvider->Password() ) )
+                        {
+                        aCredentials.AppendL(iCredentialArray[i]);
+                        }
+                    }*/
+                CSenCredentialIdentifier& identifier = iCredentialArray[i].Credential()->IdentifierL();
+
+                TPtrC8 username;
+                TInt retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, username);
+                TPtrC8 passwordId;
+                retVal = identifier.PropertyL(KSenIdpPasswordLocalname, passwordId);
+                HBufC8* decPasswordId = SenXmlUtils::DecodeHttpCharactersLC(passwordId);
+                
+                TPtrC8 passwordProv  = ((CSenIdentityProvider&)aIdP).Password();
+                HBufC8* decPasswordProv = SenXmlUtils::DecodeHttpCharactersLC(passwordProv);
+                                
+                if( ( username.Length() == 0 || username == ((CSenIdentityProvider&)aIdP).UserName() ) &&
+                    ( decPasswordId->Length() == 0 || *decPasswordId ==  *decPasswordProv) )
+                    {
+                    aCredentials.AppendL(iCredentialArray[i]);
+                    }
+                CleanupStack::PopAndDestroy(2); // encodehttp
+                }
+            }
+        }
+        
+    if ( aCredentials.Count() == 0 )
+        {
+        return KErrNotFound;
+        }
+        
+    return KErrNone;
+    }
+
+RSenCredentialPtr CSenCredentialManager::AddCredentialL(CSenInternalCredential* apCredential,
+                                                        TInt& aErrorTo)
+    {
+    if ( !apCredential )
+        {
+        SENDEBUG_L("AddCredentialL(*) - Illegal argument: NULL");
+        aErrorTo = KErrArgument;
+        return RSenCredentialPtr();
+        }
+        
+    CleanupStack::PushL(apCredential);
+    RSenCredentialPtr credentialPtr;
+    credentialPtr.OpenL(apCredential);
+    CleanupStack::Pop(apCredential);
+    CleanupClosePushL(credentialPtr);
+    iCredentialArray.AppendL(credentialPtr);
+    CleanupStack::Pop(&credentialPtr);
+    
+    TXmlEngElement element = this->AsElementL().AddNewElementL(KCredentialContainer);
+    apCredential->IdentifierL().AsElementL().MoveTo(element);
+    apCredential->IdentifierL().SetDocument(AsDocumentL());
+    apCredential->IdentifierL().SetIdL(NextCredentialIdL());
+    apCredential->PropertiesL().AsElementL().MoveTo(element);
+    apCredential->PropertiesL().SetDocument(AsDocumentL());
+    apCredential->AsElementL().MoveTo(element);
+    apCredential->SetDocument(AsDocumentL());
+    
+    SaveCredentialDB();
+    
+    aErrorTo = KErrNone;
+    return credentialPtr;
+    }
+
+RSenCredentialPtr CSenCredentialManager::AddCredentialL( CSenIdentityProvider* apIdP,
+									                     CSenInternalCredential* apCredential,
+									                     TInt& aErrorTo )
+    {
+    CleanupStack::PushL(apCredential);
+    CleanupStack::PushL(apIdP);
+    
+    if ( !apCredential )
+        {
+        SENDEBUG_L("AddCredentialL(*) - Illegal argument: NULL");
+        CleanupStack::PopAndDestroy(apIdP);
+        CleanupStack::PopAndDestroy(apCredential);
+        return RSenCredentialPtr();
+        }
+        
+    CSenIdentityProvider* pIdP = NULL;
+    // Note: Following function returns either KErrNotFound or the index of found
+    //       IdentityProvider (index >= 0).
+    TInt retVal = ((MSenIdentityManager&)iManager).FindMatchingIdentityProviderL(*apIdP, pIdP);
+    if ( retVal > KErrNone )
+        {
+        retVal = KErrNone;
+        }
+
+    if ( retVal == KErrNotFound )
+        {
+        CleanupStack::PopAndDestroy(apIdP);
+        CleanupStack::PopAndDestroy(apCredential);
+        aErrorTo = retVal;
+        return RSenCredentialPtr();
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(apIdP);
+        TPtrC8 providerId = pIdP->ProviderID();
+        apCredential->SetIdentityProviderIdL(providerId);        
+        TPtrC8 userName = pIdP->UserName();
+        if(userName.Length() > 0)
+	        {
+			TPtrC8 password = pIdP->Password();	        	
+			apCredential->SetAuthInfo(userName, password);        			
+	        }        	
+        }
+        
+    RSenCredentialPtr credentialPtr;
+    credentialPtr.OpenL(apCredential);
+    CleanupStack::Pop(apCredential);
+    CleanupClosePushL(credentialPtr);
+    iCredentialArray.AppendL(credentialPtr);
+    CleanupStack::Pop(&credentialPtr);
+
+
+    TXmlEngElement element = this->AsElementL().AddNewElementL(KCredentialContainer);
+    apCredential->IdentifierL().AsElementL().MoveTo(element);
+    apCredential->IdentifierL().SetDocument(AsDocumentL());
+    apCredential->IdentifierL().SetIdL(NextCredentialIdL());
+    apCredential->PropertiesL().AsElementL().MoveTo(element);
+    apCredential->PropertiesL().SetDocument(AsDocumentL());
+    apCredential->AsElementL().MoveTo(element);
+    apCredential->SetDocument(AsDocumentL());
+    
+    SaveCredentialDB();
+    
+    aErrorTo = retVal;
+    return credentialPtr;
+    }
+
+RSenCredentialPtr CSenCredentialManager::AddCredentialL(const TDesC8& aCredential,
+                                                         TInt& aErrorTo)
+    {
+    CSenInternalCredential* pCredential = CSenInternalCredential::NewLC();
+    ipParser->ParseL(aCredential, *pCredential);
+    CleanupStack::Pop(pCredential);
+
+    // Following takes the ownership of pCredential    
+    RSenCredentialPtr credPtr = AddCredentialL(pCredential, aErrorTo);
+    
+    return credPtr;
+    }
+
+RSenCredentialPtr CSenCredentialManager::AddCredentialL(CSenIdentityProvider* apIdP,
+									                     const TDesC8& aCredential,
+									                     TInt& aErrorTo)
+    {
+    CSenInternalCredential* pCredential = CSenInternalCredential::NewLC();
+    ipParser->ParseL(aCredential, *pCredential);
+    CleanupStack::Pop(pCredential);
+
+    // Following takes the ownership of pCredential    
+    RSenCredentialPtr credPtr = AddCredentialL(apIdP, pCredential, aErrorTo);
+    
+    return credPtr;
+    }
+
+// Very efficient method that removes all the credentials of certain *service*,
+// independent of provider ID and/or user account
+TInt CSenCredentialManager::RemoveCredentialsL(const CSenWSDescription& aPattern)
+    {
+    TInt retVal(KErrNotFound);
+    
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        if ( iCredentialArray[i].Credential() && 
+             iCredentialArray[i].Credential()->IsApplicableL(aPattern) )
+            {
+            // Get CredentialContainer element
+            TXmlEngNode element = iCredentialArray[i].Credential()->AsElementL().ParentNode();
+            // Delete and destroy both CredentialIdentifier and Credential
+            iCredentialArray[i].CloseAndDestroyCredential();
+            // Delete and destroy CredentialContainer element
+            iCredentialArray.Remove(i);
+            element.Remove();
+            i--;
+            count--;
+            
+            retVal = KErrNone;
+            }
+        }
+
+    SaveCredentialDB();
+        
+    return retVal;
+    }
+
+TInt CSenCredentialManager::RemoveCredentialsL( const CSenWSDescription& aPattern,
+										        const CSenIdentityProvider& aIdP )
+    {
+    TInt retVal(KErrNotFound);
+    
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        if ( iCredentialArray[i].Credential() && 
+             iCredentialArray[i].Credential()->IsApplicableL(aPattern) )
+            {
+            TPtrC8 providerId;
+            retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerId);
+            if ( retVal == KErrNone )
+                {
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerId);
+                CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                /*if ( pProvider )                
+                    {
+                    if ( ( ((CSenIdentityProvider&)aIdP).UserName() == pProvider->UserName() ) &&
+                         ( ((CSenIdentityProvider&)aIdP).Password() == pProvider->Password() ) )
+                        {
+                        // Get CredentialContainer element
+                        TXmlEngNode element = iCredentialArray[i].Credential()->AsElementL().ParentNode();
+                        // Delete and destroy both CredentialIdentifier and Credential
+                        
+                        iCredentialArray[i].CloseAndDestroyCredential();
+                        // Delete and destroy CredentialContainer element
+                        iCredentialArray.Remove(i);
+                        element.Remove();
+                        i--;
+                        count--;
+                        
+                        retVal = KErrNone;
+                        }
+                    }*/
+                CSenCredentialIdentifier& identifier = iCredentialArray[i].Credential()->IdentifierL();                
+                TPtrC8 username;
+                TInt retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, username);
+                TPtrC8 password;
+                retVal = identifier.PropertyL(KSenIdpPasswordLocalname, password);
+                
+                HBufC8* decPasswordIden = SenXmlUtils::DecodeHttpCharactersLC(password);
+                HBufC8* decPasswordProv = SenXmlUtils::DecodeHttpCharactersLC(((CSenIdentityProvider&)aIdP).Password());
+                
+                if( ( username.Length() == 0 || username == ((CSenIdentityProvider&)aIdP).UserName() ) &&
+                        (( decPasswordIden->Length() == 0 || *decPasswordIden == *decPasswordProv ) 
+                           ||
+                        (IsAuto(*pProvider) && ((CSenIdentityProvider&)aIdP).Password() == KNullDesC8)))
+                    {    
+                    // Get CredentialContainer element
+                    TXmlEngNode element = iCredentialArray[i].Credential()->AsElementL().ParentNode();
+                    // Delete and destroy both CredentialIdentifier and Credential
+                    
+                    iCredentialArray[i].CloseAndDestroyCredential();
+                    // Delete and destroy CredentialContainer element
+                    iCredentialArray.Remove(i);
+                    element.Remove();
+                    i--;
+                    count--;
+                    
+                    retVal = KErrNone;
+                    }
+                CleanupStack::PopAndDestroy(2); // decode http x2
+                }
+            }
+        }
+        
+    if( retVal == KErrNone )    
+        {
+        // At least one credential was removed, serialize the db
+        SaveCredentialDB();
+        }
+    return retVal;
+    }
+    
+TInt CSenCredentialManager::RemoveCredentialsL(const TDesC8& aProviderId)
+    {
+    TInt retVal(KErrNotFound);
+    
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        TPtrC8 providerId;
+        if (iCredentialArray[i].Credential())
+            {
+            retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerId);
+            }
+        if ( ( retVal == KErrNone ) && ( aProviderId == providerId ) )
+            {
+            CSenCredentialIdentifier& identifier = iCredentialArray[i].Credential()->IdentifierL();                
+            
+            TPtrC8 username;
+            TInt retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, username);
+            TPtrC8 password;
+            retVal = identifier.PropertyL(KSenIdpPasswordLocalname, password);
+            
+            CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+            pPattern->SetEndPointL(providerId);
+            CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+            CleanupStack::PopAndDestroy(pPattern);
+        
+            if ( pProvider )
+                {
+                HBufC8* decPasswordIden = SenXmlUtils::DecodeHttpCharactersLC(password);
+                HBufC8* decPasswordProv = SenXmlUtils::DecodeHttpCharactersLC(pProvider->Password());
+                
+                if( ( username.Length() == 0 || username == pProvider->UserName() ) &&
+                    ( decPasswordIden->Length() == 0 || *decPasswordIden == *decPasswordProv ) )
+                    {
+                    // Permission to remove this credential is granted(!)
+                    
+                    // Get CredentialContainer element
+                    TXmlEngNode element;
+                    if (iCredentialArray[i].Credential())
+                        {
+                        element = iCredentialArray[i].Credential()->AsElementL().ParentNode();
+                        }
+                    // Delete and destroy both CredentialIdentifier and Credential
+                    iCredentialArray[i].CloseAndDestroyCredential();
+                    // Delete and destroy CredentialContainer element
+                    iCredentialArray.Remove(i);
+                    element.Remove();
+                    i--;
+                    count--;
+                    
+                    retVal = KErrNone;
+                    }
+                CleanupStack::PopAndDestroy(2); // decode http chars x2
+                }
+/*                
+            else
+                {
+                // no IDP (account) exists, credential will be removed at some later time
+                continue;
+                }        
+*/                    
+            }
+        }
+    
+    if( retVal == KErrNone )    
+        {
+        // At least one credential was removed, serialize the db
+        SaveCredentialDB();
+        }
+    
+    return retVal;
+    }
+    
+TInt CSenCredentialManager::NextCredentialIdL()
+    {
+    iMaxCredentialID++;
+
+    UpdateMaxCredentialIdL();    
+    
+    return iMaxCredentialID;
+    }
+    
+void CSenCredentialManager::UpdateMaxCredentialIdL()
+    {
+    TBool found = EFalse;
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngAttr> attrList;
+    element.GetAttributes(attrList);
+    CleanupClosePushL(attrList);
+    while ( attrList.HasNext() && !found )
+        {
+        TXmlEngAttr attr = attrList.Next();
+        if ( attr.Name() ==  KCredentialsMaxID )
+            {
+            TBuf8<KFlatBufSize> buffer;
+            buffer.Num( iMaxCredentialID );
+            attr.SetValueL(buffer);
+            found = ETrue;
+            }
+        }
+    CleanupStack::PopAndDestroy(&attrList); // Close()
+    
+    if ( !found )
+        {
+        TBuf8<KFlatBufSize> buffer;
+        buffer.Num(iMaxCredentialID);
+        element.AddNewAttributeL(KCredentialsMaxID, buffer);
+        }
+    }
+    
+// Very powerful method, that removes the credential without checking 
+// account details (username & password), and/or provider ID 
+// (low level, private method)
+TInt CSenCredentialManager::RemoveCredentialL(TInt aInternalCredentialId)
+    {
+    TInt retVal(KErrNotFound);
+    
+    TInt credId( KErrNotFound );
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        CSenInternalCredential* pCred = iCredentialArray[i].Credential();
+        if( pCred )
+            {
+                        
+                
+            //TRAP( leaveCode, credId = pCred->IdentifierL().IdL(); )
+            //if( !leaveCode && (credId == aInternalCredentialId) )
+            
+            credId = pCred->IdentifierL().IdL();
+            if( credId == aInternalCredentialId )
+                {
+                // Get CredentialContainer element
+                TXmlEngNode element = iCredentialArray[i].Credential()->AsElementL().ParentNode();
+                // Delete and destroy both CredentialIdentifier and Credential
+                iCredentialArray[i].CloseAndDestroyCredential();
+                // Delete and destroy CredentialContainer element
+                iCredentialArray.Remove(i);
+                element.Remove();
+                retVal = KErrNone;
+                break;
+                }
+            }
+        }
+    return retVal;
+    }
+        
+RSenCredentialPtr CSenCredentialManager::CredentialL( TInt aInternalCredentialId,
+                                                      TInt& aErrorTo )
+    {
+    TInt count = iCredentialArray.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        if ( iCredentialArray[i].Credential() && iCredentialArray[i].Credential()->IdentifierL().IdL() == aInternalCredentialId )
+            {
+            
+            // Check if current account has permission to use this credential
+            CSenCredentialIdentifier& identifier = iCredentialArray[i].Credential()->IdentifierL();
+            
+            // Collect significant properties that are checked in order to
+            // grant (or not gran)t permission to consume this credential:
+            TPtrC8 providerID;
+            TInt retVal = iCredentialArray[i].Credential()->IdentityProviderIdL(providerID);
+            //TInt retVal = identifier.PropertyL(KSenIdpProviderIdLocalname, providerID);
+
+            TPtrC8 username;
+            retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, username);
+            
+            TPtrC8 password;
+            retVal = identifier.PropertyL(KSenIdpPasswordLocalname, password);
+
+            if( username.Length() > 0 && password.Length() > 0 )
+                {
+                CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+                pPattern->SetEndPointL(providerID);
+                CSenIdentityProvider* pProvider = iManager.IdentityProviderL(*pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                if ( pProvider )
+                    {
+                    HBufC8* passProvDec = SenXmlUtils::DecodeHttpCharactersLC(pProvider->Password());
+                    HBufC8* passIdDec = SenXmlUtils::DecodeHttpCharactersLC(password);
+                    if ( ( pProvider->UserName() != username ) ||
+                         ( *passProvDec != *passIdDec ) )
+                        {
+                        CleanupStack::PopAndDestroy(2); //decode x2
+                        // userinfo does not match with stored credential's username & password
+                        continue;
+                        }
+                    else
+                       	{
+                       	CleanupStack::PopAndDestroy(2); //decode x2
+                       	}
+                    }
+                else
+                    {
+                    // No IDP exists, but credential was protected
+                    continue; // no permission to use this credential
+                    }
+                }
+            // either credential is not protected in fist place, or both password and username match
+            // (permission was granted)
+            aErrorTo = KErrNone;
+            return iCredentialArray[i];
+            }
+        }
+    aErrorTo = KErrNotFound;     
+    return RSenCredentialPtr();
+    }
+
+RSenCredentialPtr CSenCredentialManager::UpdateCredentialL( TInt aInternalCredentialId,
+                                                            CSenInternalCredential* apCredential,
+                                                            TInt& aErrorTo )
+    {
+    // Call to CredentialL (search method) will check the userinfo (account) /
+    // permission to manipulate the credential
+    RSenCredentialPtr credPtr = CredentialL( aInternalCredentialId, aErrorTo );
+    if ( aErrorTo == KErrNone )
+        {
+        // Get CredentialContainer element
+        if (credPtr.Credential())
+            {
+            TXmlEngNode containerElement =
+                credPtr.Credential()->AsElementL().ParentNode();
+            // Get Credential element
+            TXmlEngNode element = 
+                credPtr.Credential()->AsElementL();
+            element.Remove();
+            credPtr.SetCredential(apCredential);
+            apCredential->AsElementL().MoveTo(containerElement);
+            apCredential->SetDocument(AsDocumentL());
+            aErrorTo = KErrNone;
+            }
+        }
+    return credPtr;
+    }
+        
+RSenCredentialPtr CSenCredentialManager::UpdateCredentialL( TInt aInternalCredentialId,
+                                                            const TDesC8& aCredential,
+                                                            TInt& aErrorTo )
+    {
+    CSenInternalCredential* pCredential = CSenInternalCredential::NewLC();
+    ipParser->ParseL(aCredential, *pCredential);
+
+    // Following takes the ownership of pCredential    
+    RSenCredentialPtr credPtr = UpdateCredentialL( aInternalCredentialId,
+                                                   pCredential, 
+                                                   aErrorTo );
+    CleanupStack::Pop(pCredential);
+    
+    return credPtr;
+    }
+
+TBool CSenCredentialManager::IsApplicableOrShareableL(const CSenWSDescription& aPattern,CSenInternalCredential* aCredential)
+    {
+    TBool retVal = ETrue;
+    if (aCredential && !aCredential->IsApplicableL(aPattern))	//codescannerwarings
+        {
+        retVal = EFalse;
+        RWSDescriptionArray arr;
+        CleanupClosePushL(arr);
+
+        CSenWSDescription* pSD = CSenWSDescription::NewLC();
+        pSD->SetEndPointL(((CSenWSDescription&)aPattern).Endpoint());
+
+        iManager.ServiceDescriptionsL(arr, *pSD);
+        CleanupStack::PopAndDestroy(pSD);
+        for (TInt i=0;i<arr.Count();i++)
+            {
+            MSenServiceDescription::TDescriptionClassType dt = arr[i]->DescriptionClassType();
+            if (dt == MSenServiceDescription::EWSStarServiceSession ||
+                dt == MSenServiceDescription::EOviServiceSession    )
+                {
+                //CWSStarServiceSession* session = (CWSStarServiceSession*)arr[i];
+                CSenWebServiceSession* session = (CSenWebServiceSession*)arr[i];
+                TInt credId = session->GetCredentialIdL();
+                TInt id = aCredential->IdentifierL().IdL();	//codescannerwarings
+                if (credId==id)
+                    {
+                    retVal = ETrue;
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(&arr);
+        }
+
+    return retVal;
+    }
+
+TInt CSenCredentialManager::RefreshMTL(const CSenWSDescription& aPattern)
+    {
+    TInt retVal(KErrNone);
+    
+    RWSDescriptionArray arr;
+    CSenWSDescription* pSD = CSenWSDescription::NewLC();
+    pSD->SetEndPointL(((CSenWSDescription&)aPattern).Endpoint());
+
+    iManager.ServiceDescriptionsL(arr, *pSD);
+    CleanupStack::PopAndDestroy(pSD);
+    CleanupClosePushL(arr);
+    for (TInt i=0;i<arr.Count();i++)
+        {
+        MSenServiceDescription::TDescriptionClassType dt = arr[i]->DescriptionClassType();
+        if (dt == MSenServiceDescription::EWSStarServiceSession)
+            {
+            CSenWebServiceSession* session = (CSenWebServiceSession*)arr[i];
+            HBufC8* revalidationError = NULL;
+            retVal = session->RefreshMTL(revalidationError);
+            delete revalidationError;
+            }
+        }
+    CleanupStack::PopAndDestroy(); //arr.Close() is enough   
+    return retVal;
+    }
+
+EXPORT_C void CSenCredentialManager::UpdateTouchCredDBL(MSenServiceDescription& asd)
+	{
+	RXmlEngNodeList<TXmlEngElement> credContElemList;
+	CleanupClosePushL(credContElemList);
+    RWSDescriptionArray arr;
+    CleanupClosePushL(arr);
+	
+	iManager.ServiceDescriptionsL(arr, asd);
+    AsElementL().GetElementsByTagNameL(credContElemList, KCredentialContainer());
+    
+	for (TInt i=0;i<arr.Count();i++)
+    	{
+        CSenWebServiceSession* session = (CSenWebServiceSession*)arr[i];
+        TInt credId = session->GetCredentialIdL();
+                
+        while(credContElemList.HasNext())
+			{
+			RXmlEngNodeList<TXmlEngElement> credIdentElemList; // credential identifier element
+			CleanupClosePushL(credIdentElemList);
+			
+					
+			TXmlEngElement credContElem = credContElemList.Next();
+			credContElem.GetElementsByTagNameL(credIdentElemList, KCredentialIdentifier());
+			
+			if(credIdentElemList.HasNext())
+				{
+				RXmlEngNodeList<TXmlEngElement> credIdElemList;
+				CleanupClosePushL(credIdElemList);
+				
+				TXmlEngElement credIdentElem = credIdentElemList.Next();
+				credIdentElem.GetElementsByTagNameL(credIdElemList, KCredentialId());
+				
+				if(credIdElemList.HasNext())
+					{
+					TInt res(0);
+					TInt credIdDb(0);
+					
+					TXmlEngElement credIdElem = credIdElemList.Next();
+					
+					TLex8 lex;
+					lex.Assign(credIdElem.Text());
+					lex.Val(credIdDb);
+					res = credId - credIdDb;
+					if(res == 0)
+						{
+						TUint32 current_tick(0);
+						TBuf8<32> tickBuf;
+						
+						current_tick = User::NTickCount();
+						tickBuf.Num(current_tick);	
+						credContElem.SetAttributeL(KTouch(), tickBuf);	
+						}
+					}
+				
+				CleanupStack::PopAndDestroy(&credIdElemList);
+				}
+			CleanupStack::PopAndDestroy(&credIdentElemList);	
+			}
+       }
+                 
+	CleanupStack::PopAndDestroy(&arr);       
+    CleanupStack::PopAndDestroy(&credContElemList);    
+//    CleanupUnusedCredDBL();     
+                                  
+	                          
+	}        
+	
+void CSenCredentialManager::CleanupUnusedCredDBL()
+	{
+	TInt result(1);
+	TInt loc(KErrNotFound); // Not found
+	TInt res(0);
+	TUint32 current_tick(0);
+	TUint32 db_ticks(0);
+	TUint32 diff_ticks(0);
+		
+	RXmlEngNodeList<TXmlEngElement> credContElemList;
+	CleanupClosePushL(credContElemList);
+	
+	AsElementL().GetElementsByTagNameL(credContElemList, KCredentialContainer());
+
+	while(credContElemList.HasNext()) // Can be many credential containers
+		{
+		RXmlEngNodeList<TXmlEngAttr> attrList;
+		CleanupClosePushL(attrList);
+		
+		TXmlEngElement credContElem = credContElemList.Next();
+		credContElem.GetAttributes(attrList);
+		while(attrList.HasNext()) // Only one attribute now i.e touch attribute
+			{
+			TXmlEngAttr attrElem = attrList.Next();
+			res = attrElem.Name().Compare(KTouch);
+			if(res == 0)
+				{
+				TPtrC8 val = attrElem.Value();
+				
+				TLex8 lex;
+            	lex.Assign(val);
+            	lex.Val(db_ticks, EDecimal);
+            	
+            	current_tick = User::NTickCount();
+            	diff_ticks = current_tick - db_ticks;
+            	if(KMaxTicks <= diff_ticks || current_tick < db_ticks)
+					{
+					RXmlEngNodeList<TXmlEngElement> credIdentElemList; //credential Identifier element
+					CleanupClosePushL(credIdentElemList);
+					RXmlEngNodeList<TXmlEngElement> credIdElemList; //credentialId element
+					CleanupClosePushL(credIdElemList);
+					
+					credContElem.GetElementsByTagNameL(credIdentElemList, KCredentialIdentifier());
+					// There will be only one Credential Identifier within a Credential Container
+					if(credIdentElemList.HasNext()) 
+						{
+						TXmlEngElement credIdentElem = credIdentElemList.Next();
+						credIdentElem.GetElementsByTagNameL(credIdElemList, KCredentialId());
+						
+						// There will be only one Credential Id element within a Credential Identifier
+						if(credIdElemList.HasNext())
+							{
+							TInt credId(0);
+							TInt credCount(0);
+							TInt credIdDb(0);
+							
+							credCount = iCredentialArray.Count();
+							for(TInt i=0; i < credCount; i++)
+								{
+								credId = iCredentialArray[i].Credential()->IdentifierL().IdL();
+								TXmlEngElement credIdElem = credIdElemList.Next();
+								lex.Assign(credIdElem.Text());
+								lex.Val(credIdDb);
+								result = credId - credIdDb;
+								if(result == 0)
+									{
+									loc = i;
+									break;	
+									}
+								}
+							}
+						}
+					if(result == 0 && loc != KErrNotFound)
+						{
+						// Get CredentialContainer element
+	            		TXmlEngNode element = iCredentialArray[loc].Credential()->AsElementL().ParentNode();
+	            		// Delete and destroy both CredentialIdentifier and Credential
+	            		iCredentialArray[loc].CloseAndDestroyCredential();
+	            		// Delete and destroy CredentialContainer element
+	            		iCredentialArray.Remove(loc);
+	            		element.Remove();
+						}
+				
+					CleanupStack::PopAndDestroy(&credIdElemList);
+					CleanupStack::PopAndDestroy(&credIdentElemList);
+					
+					break;
+					}
+				}
+			}
+		CleanupStack::PopAndDestroy(&attrList);
+		}
+    CleanupStack::PopAndDestroy(&credContElemList);
+	}
+// End of file
+#ifdef __CRYPTO_HW__
+void CSenCredentialManager::EncryptPasswordL(const TDesC8& aData, TDes8& aCipherText)
+    {
+#ifndef __WINSCW__
+		  TUint cipherLen;
+		  TBuf8<KEncrypedLen> temp;
+		  
+		  // add padding if length is  less than 16
+		if (aData.Length() < KCryptoPADataLen) 
+			  {
+			  const TInt remainder = aData.Length() % KCryptoPADataLen;
+			  temp.Copy(aData);
+			  temp.AppendFill( KPadding, KCryptoPADataLen - remainder );
+			  cipherLen = temp.Length() + KPaCryptAuthLen ;
+			  aCipherText.SetLength(cipherLen);
+			  }
+		else
+			  {
+			  temp.Copy(aData);
+			  cipherLen = aData.Length() + KPaCryptAuthLen ;
+			  aCipherText.SetLength(cipherLen);
+			  }
+		    
+	    	TBuf8<20> paId;
+		    paId.Copy(KCryptoPA);
+		   
+		    CSecEnv* secEnv = CSecEnv::NewL();
+		    TInt err = secEnv->ProtectedApplicationExecute(paId, (TAny*)temp.Ptr(), temp.Length(), 
+		                                                     (TAny*)aCipherText.Ptr(), cipherLen, KEncryptNoSalt); 
+		    delete secEnv;
+	    
+	    // Encode data into Base64 format
+	    	HBufC8 *b64encPwd = SenCryptoUtils::EncodeBase64L(aCipherText);
+    	if(b64encPwd)
+	      {
+	      aCipherText = (*b64encPwd);
+	      delete b64encPwd;
+	      }
+	    	
+	          
+#else
+
+aCipherText = aData;
+//return KErrNotSupported;
+#endif
+    
+    }
+
+void CSenCredentialManager::DecryptPasswordL(const TDesC8& aCipherText, TDes8& aData)
+    {
+#ifndef __WINSCW__    	
+    TUint dataLen = aCipherText.Length() - KPaCryptAuthLen ;
+    aData.SetLength(dataLen);
+    TBuf8<20> paId;
+    paId.Copy(KCryptoPA);
+   // Decode data from Base64 format
+    HBufC8 *b64decPwd = SenCryptoUtils::DecodeBase64L(aCipherText);
+    	TDesC8 aTmpTxt= (*b64decPwd);
+    // Decrypt using PA	
+    CSecEnv* secEnv = CSecEnv::NewL();
+    TInt err = secEnv->ProtectedApplicationExecute(paId, (TAny*)aTmpTxt.Ptr(), aTmpTxt.Length(), 
+                                                     (TAny*)aData.Ptr(), dataLen, KDecrypt);
+    // remove padding
+    if (aData.Length() == KCryptoPADataLen)
+        {
+        RBuf8 decPwd;
+        decPwd.Create(KCryptoPADataLen);
+        decPwd.Copy(aData);
+        TInt pos = decPwd.Locate(KPadding);
+        if(pos != KErrNotFound)
+          {
+          decPwd.SetLength(pos);
+          aData.SetLength(decPwd.Length());
+          aData = decPwd;
+          }
+        decPwd.Close();
+        }
+    delete secEnv;                                                  
+		if(b64decPwd)
+				{
+				delete b64decPwd;
+				}
+				
+#else
+
+aData = aCipherText ;
+//return KErrNotSupported;
+#endif    
+}  
+#endif // __CRYPTO_HW__
+// End of file 
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/src/sencredentialmanagerdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return( KErrNone );
+    }
+#endif
+
+// End of Files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wscredentialmanager/src/seninternalcredential.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1084 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "seninternalcredential.h"
+#include "SenFacet.h"
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include "senwsdescription.h"
+#include "SenDateUtils.h"
+#include <SenIdentityProvider.h>
+#include "senlogger.h"
+
+
+#ifdef SYMBIAN_SECURE_ECOM
+    // for S60 FP3 (2.8) platform or newer (3.0 and above)
+    #include <xml/attribute.h> // needed for RAttributeArray
+//#else  // for S60 FP2 platform (2.6) or older
+    //#include "Attribute.h"
+#endif
+
+#include <xmlengnodelist.h> 
+using namespace Xml;
+
+namespace
+    {
+    _LIT8(KProviderIdLocalName,  "ProviderID");
+    _LIT8(KUserName,             "AuthzID");
+    _LIT8(KPassword,             "Password");
+    const TInt KCredIdBufSize    = 128;    
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewL()
+    {
+    CSenInternalCredential* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewLC()
+    {
+    CSenInternalCredential* pNew = new (ELeave) CSenInternalCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(KNullDesC8);
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewL(
+                                           	const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenInternalCredential* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenInternalCredential* pNew = new (ELeave) CSenInternalCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenInternalCredential* pNew = NewLC(aNsUri, aLocalName,
+                                         aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenInternalCredential* pNew = new (ELeave) CSenInternalCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenInternalCredential* pNew = NewLC(aNsUri, aLocalName,
+                                         aQName, aAttributes,
+                                         aParent, aOwnerDocument);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenInternalCredential* pNew = new (ELeave) CSenInternalCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent,
+                     aOwnerDocument);
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewL(
+                                             const CSenInternalCredential& aCredential)
+    {
+    CSenInternalCredential* pNew = NewLC(aCredential);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenInternalCredential* CSenInternalCredential::NewLC(
+                                             const CSenInternalCredential& aCredential)
+    {
+    CSenInternalCredential* pNew = new (ELeave) CSenInternalCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL((CSenInternalCredential&)aCredential);
+    return pNew;
+    }
+
+
+EXPORT_C void CSenInternalCredential::ConstructL(CSenInternalCredential& aCredential)
+    {
+    CSenCredential2::BaseConstructL(aCredential);
+    }
+
+EXPORT_C void CSenInternalCredential::ConstructL(const TDesC8&  aNsUri,
+                                          const TDesC8&  aLocalName,
+                                          const TDesC8&  aQName,
+                                          const RAttributeArray& aAttributes,
+                                          TXmlEngElement& aParent)
+    {
+    CSenCredential2::BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    }
+
+EXPORT_C void CSenInternalCredential::ConstructL(const TDesC8&  aNsUri,
+                                          const TDesC8&  aLocalName,
+                                          const TDesC8&  aQName,
+                                          const RAttributeArray& aAttributes,
+                                          TXmlEngElement& aParent,
+                                          RSenDocument& aOwnerDocument)
+    {
+    CSenCredential2::BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent, aOwnerDocument);
+
+    }
+
+EXPORT_C void CSenInternalCredential::ConstructL(const TDesC8&  aNsUri,
+                                          const TDesC8&  aLocalName,
+                                          const TDesC8&  aQName,
+                                          const RAttributeArray& aAttributes)
+    {
+    CSenCredential2::BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    }
+    
+EXPORT_C void CSenInternalCredential::ConstructL(const TDesC8& aLocalName)
+    {
+    CSenFragmentBase::BaseConstructL(aLocalName);
+    }
+
+EXPORT_C CSenInternalCredential::CSenInternalCredential()
+    {
+    }
+
+EXPORT_C CSenInternalCredential::~CSenInternalCredential()
+    {
+    delete ipIdentifier;
+    delete ipProperties;
+    }
+
+EXPORT_C TBool CSenInternalCredential::IsApplicableL(const CSenWSDescription& aPattern)	//codescannerwarings
+    {
+    TPtrC8 value;
+    CSenElement* valueElement;
+    CSenElement& patternElement = ((CSenWSDescription&)aPattern).AsElement();
+    CSenCredentialIdentifier& identifier = IdentifierL();	//codescannerwarings
+
+    RXmlEngNodeList<TXmlEngAttr> attrList;
+
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    TXmlEngElement element = identifier.AsElementL();
+    element.GetChildElements(list);
+    while ( list.HasNext() )
+        {
+        TXmlEngElement element = list.Next();
+        if ( (element.Name() != KSenCredentialId) &&
+             (element.Name() != KProviderIdLocalName)  &&
+             (element.Name() != KSenIdpAuthzIDLocalname) &&
+             (element.Name() != KSenIdpPasswordLocalname) )
+            {
+            HBufC8* pTag = element.Name().AllocLC();
+            CleanupStack::PopAndDestroy(pTag);
+                        
+            valueElement = patternElement.Element(element.Name());
+            if ( valueElement )
+                {
+                HBufC8* pElement1 = valueElement->Content().AllocLC();
+                HBufC8* pElement2 = element.Text().AllocLC();
+                CleanupStack::PopAndDestroy(pElement2);
+                CleanupStack::PopAndDestroy(pElement1);
+
+                if ( valueElement->Content() != element.Text() )
+                    {
+                    CleanupStack::PopAndDestroy(&list); // Close()
+                    return EFalse;
+                    }
+                else
+                    {
+                    element.GetAttributes(attrList);
+                    CleanupClosePushL(attrList);
+                    while ( attrList.HasNext() )
+                        {
+                        TXmlEngAttr attr = attrList.Next();
+                        if ( *valueElement->AttrValue(attr.Name()) != attr.Value() )
+                            {
+                            CleanupStack::PopAndDestroy(&attrList); // Close()
+                            CleanupStack::PopAndDestroy(&list); // Close()
+                            return EFalse;
+                            }
+                        }
+                    CleanupStack::PopAndDestroy(&attrList); // Close()
+                    }
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(&list); // Close()
+                return EFalse;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+    return ETrue;
+    }
+
+EXPORT_C void CSenInternalCredential::SetIdentifier(CSenCredentialIdentifier* aIdentifier)
+    {
+    if ( ipIdentifier )
+        {
+        delete ipIdentifier;
+        }
+
+    ipIdentifier = aIdentifier;
+    }
+
+EXPORT_C CSenCredentialIdentifier& CSenInternalCredential::IdentifierL()	//codescannerwarings
+    {
+    if ( !ipIdentifier )
+        {
+        ipIdentifier = CSenCredentialIdentifier::NewL();
+        }
+
+    return *ipIdentifier;
+    }
+
+EXPORT_C void CSenInternalCredential::SetProperties(CSenCredentialProperties* aProperties)
+    {
+    if ( ipProperties )
+        {
+        delete ipProperties;
+        }
+
+    ipProperties = aProperties;
+    }
+
+EXPORT_C CSenCredentialProperties& CSenInternalCredential::PropertiesL()	//codescannerwarings
+    {
+    if ( !ipProperties )
+        {
+        ipProperties = CSenCredentialProperties::NewL();
+        }
+
+    return *ipProperties;
+    }
+
+EXPORT_C TBool CSenInternalCredential::HasProperties()
+    {
+    if ( !ipProperties )
+        {
+        return EFalse;
+        }
+    else 
+        {
+        return ETrue;
+        }
+    }
+
+EXPORT_C void CSenInternalCredential::SetIdentityProviderIdL(TDesC8& aIdentityProviderId)
+    {
+    IdentifierL().SetPropertyL(KProviderIdLocalName, aIdentityProviderId);	//codescannerwarings
+    }
+EXPORT_C void CSenInternalCredential::SetAuthInfo(TDesC8& aUserId, TDesC8& aPassword)
+    {
+    TRAPD(retVal,
+    		IdentifierL().SetPropertyL(KUserName, aUserId);
+    		IdentifierL().SetPropertyL(KPassword, aPassword);
+    		);
+    }
+
+EXPORT_C TInt CSenInternalCredential::IdentityProviderIdL(TPtrC8& aIdTo)
+    {
+    return IdentifierL().PropertyL(KProviderIdLocalName, aIdTo);	//codescannerwarings
+    }
+
+EXPORT_C void CSenInternalCredential::SetSession(CSenServiceSession& aSession)
+    {
+    ipSession = &aSession;
+    }
+
+EXPORT_C CSenServiceSession* CSenInternalCredential::Session()
+    {
+    return ipSession;
+    }
+
+
+
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewL()
+    {
+    CSenCredentialProperties* pNew = NewLC();
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewLC()
+    {
+    CSenCredentialProperties* pNew = new (ELeave) CSenCredentialProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KSenCredentialProperteisLocalname);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenCredentialProperties* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenCredentialProperties* pNew = new (ELeave) CSenCredentialProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenCredentialProperties* pNew = NewLC(aNsUri, aLocalName,
+                                           aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenCredentialProperties* pNew = new (ELeave) CSenCredentialProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenCredentialProperties* pNew = NewLC(aNsUri, aLocalName,
+                                           aQName, aAttributes,
+                                           aParent, aOwnerDocument);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties* CSenCredentialProperties::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenCredentialProperties* pNew = new (ELeave) CSenCredentialProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent,
+                         aOwnerDocument);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialProperties::~CSenCredentialProperties()
+    {
+    }
+
+CSenCredentialProperties::CSenCredentialProperties()
+    {
+    }
+
+EXPORT_C TInt CSenCredentialProperties::SetPropertyL(const TDesC8& aName,
+                                                         const TDesC8& aValue)
+    {
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, aName);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement firstElement = list.Next();
+        firstElement.SetTextNoEncL(aValue);
+        CleanupStack::PopAndDestroy(&list); // Close();
+        
+        return KErrNone;
+        }
+    CleanupStack::PopAndDestroy(&list);
+
+    TXmlEngElement newElement = element.AddNewElementL(aName);
+    newElement.SetTextNoEncL(aValue);
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenCredentialProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+    {
+    TInt retVal(KErrNone);
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, aName);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement firstElement = list.Next();
+        aValue.Set(firstElement.Text());
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    return retVal;
+    }
+
+EXPORT_C TInt CSenCredentialProperties::FacetValueL(TDesC8& aURI,
+                                                        HBufC8*& aValueTo)
+    {
+    TInt retVal(KErrNotFound);
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenFacet);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement element;
+        TPtrC8 value;
+
+        while ( list.HasNext() )
+            {
+            element = list.Next();
+            value.Set(element.AttributeValueL(KFacetAttrName));
+            if ( value == aURI )
+                {
+                if ( element.Text().Length() < 1 )
+                    {
+                    aValueTo = KSenFacetValTrue().Alloc();
+                    }
+                else
+                    {
+                    aValueTo = element.Text().Alloc();
+                    }
+
+                if(!aValueTo) // OOM
+                    {
+                    retVal = KErrNoMemory;
+                    }
+                else
+                    {
+                    retVal = KErrNone;
+                    }
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+
+    return retVal;
+    }
+
+EXPORT_C TInt CSenCredentialProperties::RemoveFacetL(const TDesC8& aURI)
+    {
+    TInt retVal(KErrNotFound);
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenFacet);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement element;
+        TPtrC8 value;
+
+        while ( list.HasNext() )
+            {
+            element = list.Next();
+            value.Set(element.AttributeValueL(KFacetAttrName));
+            if ( value == aURI )
+                {
+                element.Remove();
+                retVal = KErrNone;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    return retVal;
+    }
+
+
+EXPORT_C TInt CSenCredentialProperties::AddFacetL(const CSenFacet& aFacet)
+    {
+    TInt retVal(KErrNotFound);
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenFacet);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement element;
+        TPtrC8 value;
+
+        while ( list.HasNext() )
+            {
+            element = list.Next();
+            value.Set(element.AttributeValueL(KFacetAttrName));
+            if ( value == ((CSenFacet&)aFacet).Name() )
+                {
+                retVal = KErrAlreadyExists;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+
+    if ( retVal != KErrAlreadyExists)
+        {
+        TXmlEngElement newElement = element.AddNewElementL(KSenFacet);
+        newElement.SetAttributeL(KFacetAttrName, ((CSenFacet&)aFacet).Name());
+        if(((CSenFacet&)aFacet).Type() != KNullDesC8)
+            {
+            newElement.SetAttributeL(KFacetAttrType,((CSenFacet&)aFacet).Type());
+            }
+        newElement.SetTextNoEncL(((CSenFacet&)aFacet).Value());
+        retVal = KErrNone;
+        }
+
+    return retVal;
+    }
+
+EXPORT_C TInt CSenCredentialProperties::SetFacetL(const CSenFacet& aFacet)
+    {
+    TInt retVal(KErrNotFound);
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenFacet);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement element;
+        TPtrC8 value;
+
+        while ( list.HasNext() && retVal == KErrNotFound )
+            {
+            element = list.Next();
+            value.Set(element.AttributeValueL(KFacetAttrName));
+            if ( value == ((CSenFacet&)aFacet).Name() )
+                {
+                if(((CSenFacet&)aFacet).Type() != KNullDesC8)
+                    {
+                    element.SetAttributeL(KFacetAttrType,((CSenFacet&)aFacet).Type());
+                    }
+                element.SetTextNoEncL(((CSenFacet&)aFacet).Value());
+                retVal = KErrNone;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+
+    if ( retVal == KErrNotFound )
+        {
+        TXmlEngElement newElement = element.AddNewElementL(KSenFacet);
+        newElement.SetAttributeL(KFacetAttrName, ((CSenFacet&)aFacet).Name());
+        if(((CSenFacet&)aFacet).Type() != KNullDesC8)
+            {
+            newElement.SetAttributeL(KFacetAttrType,((CSenFacet&)aFacet).Type());
+            }
+        newElement.SetTextNoEncL(((CSenFacet&)aFacet).Value());
+        retVal = KErrNone;
+        }
+
+    return retVal;
+    }
+
+EXPORT_C void CSenCredentialProperties::SetValidUntilL(TTime aValidUntil)
+    {
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenCredentialValidUntil);
+
+    TXmlEngElement validUntilElement;
+    if ( list.Count() > 0 )
+        {
+        validUntilElement = list.Next();
+        }
+    else
+        {
+        validUntilElement = element.AddNewElementL(KSenCredentialValidUntil);
+        }
+
+    HBufC8* pDateDes = HBufC8::NewLC(KCredIdBufSize);
+    TPtr8 datePtr = pDateDes->Des();
+    SenDateUtils::ToXmlDateTimeUtf82L(datePtr, aValidUntil);
+    validUntilElement.SetTextL(*pDateDes);
+    CleanupStack::PopAndDestroy(pDateDes);
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+    }
+        
+EXPORT_C TTime CSenCredentialProperties::ValidUntilL()
+    {
+    TTime retTime = Time::NullTTime();
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenCredentialValidUntil);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement validUntilElement = list.Next();
+        retTime = SenDateUtils::FromXmlDateTimeL(validUntilElement.Text());
+        }
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+
+    return retTime;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewL()
+    {
+    CSenCredentialIdentifier* pNew = NewLC();
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewLC()
+    {
+    CSenCredentialIdentifier* pNew = new (ELeave) CSenCredentialIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KSenCredentialIdentifierLocalname);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenCredentialIdentifier* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenCredentialIdentifier* pNew = new (ELeave) CSenCredentialIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenCredentialIdentifier* pNew = NewLC(aNsUri, aLocalName,
+                                           aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenCredentialIdentifier* pNew = new (ELeave) CSenCredentialIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenCredentialIdentifier* pNew = NewLC(aNsUri, aLocalName,
+                                           aQName, aAttributes,
+                                           aParent, aOwnerDocument);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier* CSenCredentialIdentifier::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenCredentialIdentifier* pNew = new (ELeave) CSenCredentialIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent,
+                         aOwnerDocument);
+    return pNew;
+    }
+
+EXPORT_C CSenCredentialIdentifier::~CSenCredentialIdentifier()
+    {
+    }
+
+CSenCredentialIdentifier::CSenCredentialIdentifier()
+    {
+    }
+
+EXPORT_C void CSenCredentialIdentifier::SetIdL(TInt aId)
+    {
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenCredentialId);
+
+    TXmlEngElement idElement;
+    if ( list.Count() > 0 )
+        {
+        idElement = list.Next();
+        }
+    else
+        {
+        idElement = element.AddNewElementL(KSenCredentialId);
+        }
+
+    TBuf8<KCredIdBufSize> buffer;
+    buffer.Num(aId);
+    idElement.SetTextL(buffer);
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+    }
+
+EXPORT_C TInt CSenCredentialIdentifier::IdL()
+    {
+    TInt retVal(KErrNotFound);
+
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+
+    element.GetElementsByTagNameL(list, KSenCredentialId);
+
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement idElement = list.Next();
+        TLex8 lex;
+        lex.Assign(idElement.Text());
+        lex.Val( retVal );
+        }
+
+    CleanupStack::PopAndDestroy(&list); // Close()
+
+    return retVal;
+    }
+    
+CSenCredentialData* CSenCredentialData::NewL()
+    {
+    CSenCredentialData* pNew = CSenCredentialData::NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenCredentialData* CSenCredentialData::NewLC()
+    {
+    CSenCredentialData* pNew = new (ELeave) CSenCredentialData;
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenCredentialData::~CSenCredentialData()
+    {
+    iObserverArray.Close();
+    }
+    
+CSenCredentialData::CSenCredentialData()
+    {
+    }
+    
+EXPORT_C void RSenCredentialPtr::OpenL(CSenInternalCredential* apCredential)
+    {
+    CREDLOG_L(KSenCredsLogLevelMax,"CredentialPtr OPEN");
+
+    ipCredentialData = CSenCredentialData::NewL();
+    ipCredentialData->iCounter = 1;
+    ipCredentialData->ipCredential = apCredential;
+    CREDLOG_L(KSenCredsLogLevelMax,".....END");
+    }
+    
+EXPORT_C CSenInternalCredential* RSenCredentialPtr::Credential()
+    {
+    if ( ipCredentialData )
+        {
+        return ipCredentialData->ipCredential;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+    
+EXPORT_C void RSenCredentialPtr::SetCredential(CSenInternalCredential* apCredential)
+    {
+    CREDLOG_L(KSenCredsLogLevelMax,"CredentialPtr SET");
+    if ( ipCredentialData )
+        {
+        delete ipCredentialData->ipCredential;
+        ipCredentialData->ipCredential = apCredential;
+
+        TInt count = ipCredentialData->iObserverArray.Count();
+        for (TInt i=0; i < count; i++)
+            {
+            ipCredentialData->iObserverArray[i]->CredentialChanged(MSenCredentialObserver::EReplaced);
+            }
+        }
+    CREDLOG_L(KSenCredsLogLevelMax,".....END");
+    }
+    
+EXPORT_C RSenCredentialPtr RSenCredentialPtr::Clone()
+    {
+    if ( ipCredentialData )
+        {
+        CREDLOG_L(KSenCredsLogLevelMax,"CredentialPtr CLONE");
+        (ipCredentialData->iCounter)++;
+#ifdef _SENDEBUG
+TRAP_IGNORE
+    (
+            _LIT8(KCredsLogLine, "....counter = %d");
+            CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelMax, KCredsLogLine,  ipCredentialData->iCounter));
+            CREDLOG_L(KSenCredsLogLevelMax,"....ticket ");
+            if (ipCredentialData->ipCredential)
+                {
+                HBufC8* ptr = ipCredentialData->ipCredential->AsXmlL();
+                CleanupStack::PushL(ptr);
+                CREDLOG_ALL(KSenCredsLogLevelMax, *ptr);
+                CleanupStack::PopAndDestroy(ptr);    
+                }
+            else
+                {
+                CREDLOG_L(KSenCredsLogLevelMax,"....NULL");
+                }
+        CREDLOG_L(KSenCredsLogLevelMax,"....END");
+    )        
+#endif // _SENDEBUG
+        }
+    return *this;
+    }
+    
+EXPORT_C void RSenCredentialPtr::Close()
+    {
+    if ( ipCredentialData )
+        {
+        CREDLOG_L(KSenCredsLogLevelMax,"CredentialPtr CLOSE");
+        (ipCredentialData->iCounter)--;
+#ifdef _SENDEBUG
+TRAP_IGNORE
+    (
+            _LIT8(KCredsLogLine, "....counter = %d");
+            CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelMax, KCredsLogLine, ipCredentialData->iCounter));
+            CREDLOG_L(KSenCredsLogLevelMax,"....ticket ");
+            if (ipCredentialData->ipCredential)
+                {
+                HBufC8* ptr = ipCredentialData->ipCredential->AsXmlL();
+                CleanupStack::PushL(ptr);
+                CREDLOG_ALL(KSenCredsLogLevelMax, *ptr);
+                CleanupStack::PopAndDestroy(ptr);    
+                }
+            else
+                {
+                CREDLOG_L(KSenCredsLogLevelMax,"....NULL");
+                }
+    )                
+#endif // _SENDEBUG
+        if ( ipCredentialData->iCounter == 0 )
+            {
+            CREDLOG_L(KSenCredsLogLevelMax,"....deleting Credential");
+            delete ipCredentialData->ipCredential;
+            ipCredentialData->ipCredential = NULL;
+            TInt count = ipCredentialData->iObserverArray.Count();
+            for (TInt i=0; i < count; i++)
+                {
+                ipCredentialData->iObserverArray[i]->CredentialChanged(MSenCredentialObserver::EDestroyed);
+                }
+
+            delete ipCredentialData;
+            }
+        ipCredentialData = NULL;
+        CREDLOG_L(KSenCredsLogLevelMax,"....END");
+        }
+    }
+
+EXPORT_C void RSenCredentialPtr::CloseAndDestroyCredential()
+    {
+    if ( ipCredentialData )
+        {
+        delete ipCredentialData->ipCredential;
+        ipCredentialData->ipCredential = NULL;
+        
+        TInt count = ipCredentialData->iObserverArray.Count();
+        for (TInt i=0; i < count; i++)
+            {
+            ipCredentialData->iObserverArray[i]->CredentialChanged(MSenCredentialObserver::EDestroyed);
+            }
+CREDLOG_L(KSenCredsLogLevelMax,"CredentialPtr CLOSEANDDESTROY");
+        
+        (ipCredentialData->iCounter)--;
+        if ( ipCredentialData->iCounter == 0 )
+            {
+            CREDLOG_L(KSenCredsLogLevelMax,".....deleting");
+            delete ipCredentialData;
+            ipCredentialData = NULL;
+            }
+CREDLOG_L(KSenCredsLogLevelMax,".....END");
+        }
+    }
+
+EXPORT_C void RSenCredentialPtr::AddCredentialObserverL(MSenCredentialObserver& aObserver)	//codescannerwarnings
+    {
+    if ( ipCredentialData )
+        {
+        TInt leaveCode( KErrNone );
+        TRAP( leaveCode, ipCredentialData->iObserverArray.AppendL(&aObserver); )
+#ifdef _SENDEBUG        
+        if( leaveCode )
+            {
+            CREDLOG_L(KSenCredsLogLevelMin, "RSenCredentialPtr::AddCredentialObserverL:");
+            _LIT8(KCredsLogLine, "- ipCredentialData->iObserverArray.AppendL leaved (%d)!");
+            CREDLOG_FORMAT(( KSenCredsLogChannel, KSenCredsLogLevelMax, KCredsLogLine, leaveCode ));
+            }
+#endif // _SENDEBUG
+        leaveCode = 0; // ignored in release builds
+        }
+    }
+
+EXPORT_C TInt RSenCredentialPtr::RemoveCredentialObserver(MSenCredentialObserver& aObserver)
+    {
+    if ( ipCredentialData )
+        {
+        TInt pos = ipCredentialData->iObserverArray.Find(&aObserver);
+        if ( pos != KErrNotFound )
+            {
+            ipCredentialData->iObserverArray.Remove(pos);
+            }
+        else
+            {
+            return pos;
+            }
+        }
+        
+    return KErrNone;
+    }
+
+EXPORT_C RSenCredentialPtr::RSenCredentialPtr()
+: ipCredentialData(NULL)
+    {
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/BMARM/SENSERVDESCU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+EXPORTS
+	__9CSenFacet @ 1 NONAME R3UNUSED ; CSenFacet::CSenFacet(void)
+	Accepts__10CSenPolicyR10MSenPolicy @ 2 NONAME R3UNUSED ; CSenPolicy::Accepts(MSenPolicy &)
+	Accepts__18CSenConsumerPolicyR18MSenConsumerPolicy @ 3 NONAME R3UNUSED ; CSenConsumerPolicy::Accepts(MSenConsumerPolicy &)
+	Accepts__18CSenProviderPolicyR18MSenProviderPolicy @ 4 NONAME R3UNUSED ; CSenProviderPolicy::Accepts(MSenProviderPolicy &)
+	Accepts__25CSenXmlServiceDescriptionR18MSenProviderPolicy @ 5 NONAME R3UNUSED ; CSenXmlServiceDescription::Accepts(MSenProviderPolicy &)
+	AddConsumerIdentityProviderIdL__18CSenServicePatternRC6TDesC8 @ 6 NONAME R3UNUSED ; CSenServicePattern::AddConsumerIdentityProviderIdL(TDesC8 const &)
+	AddFacetL__25CSenXmlServiceDescriptionRC9CSenFacet @ 7 NONAME R3UNUSED ; CSenXmlServiceDescription::AddFacetL(CSenFacet const &)
+	AddIdentityProviderIdL__10CSenPolicyRC6TDesC8 @ 8 NONAME R3UNUSED ; CSenPolicy::AddIdentityProviderIdL(TDesC8 const &)
+	AddIdentityProviderIdL__25CSenXmlServiceDescriptionR6TDesC8 @ 9 NONAME R3UNUSED ; CSenXmlServiceDescription::AddIdentityProviderIdL(TDesC8 &)
+	AdvisoryAuthnID__20CSenIdentityProvider @ 10 NONAME R3UNUSED ; CSenIdentityProvider::AdvisoryAuthnID(void)
+	AsXmlL__25CSenXmlServiceDescription @ 11 NONAME R3UNUSED ; CSenXmlServiceDescription::AsXmlL(void)
+	AsXmlUnicodeL__25CSenXmlServiceDescription @ 12 NONAME R3UNUSED ; CSenXmlServiceDescription::AsXmlUnicodeL(void)
+	AuthzID__20CSenIdentityProvider @ 13 NONAME R3UNUSED ; CSenIdentityProvider::AuthzID(void)
+	BaseConstructL__10CSenPolicyRC6TDesC8 @ 14 NONAME R3UNUSED ; CSenPolicy::BaseConstructL(TDesC8 const &)
+	BaseConstructL__10CSenPolicyRC6TDesC8Ul @ 15 NONAME R3UNUSED ; CSenPolicy::BaseConstructL(TDesC8 const &, unsigned long)
+	BaseConstructL__18CSenConsumerPolicy @ 16 NONAME R3UNUSED ; CSenConsumerPolicy::BaseConstructL(void)
+	BaseConstructL__18CSenConsumerPolicyUl @ 17 NONAME R3UNUSED ; CSenConsumerPolicy::BaseConstructL(unsigned long)
+	BaseConstructL__18CSenProviderPolicy @ 18 NONAME R3UNUSED ; CSenProviderPolicy::BaseConstructL(void)
+	BaseConstructL__18CSenProviderPolicyUl @ 19 NONAME R3UNUSED ; CSenProviderPolicy::BaseConstructL(unsigned long)
+	BaseConstructL__18CSenServicePattern @ 20 NONAME R3UNUSED ; CSenServicePattern::BaseConstructL(void)
+	BaseConstructL__18CSenServicePatternRC6TDesC8 @ 21 NONAME R3UNUSED ; CSenServicePattern::BaseConstructL(TDesC8 const &)
+	BaseConstructL__18CSenServicePatternRC6TDesC8T1 @ 22 NONAME R3UNUSED ; CSenServicePattern::BaseConstructL(TDesC8 const &, TDesC8 const &)
+	ConstructL__14CSenCredentialR14CSenCredential @ 23 NONAME R3UNUSED ; CSenCredential::ConstructL(CSenCredential &)
+	ConstructL__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 24 NONAME ; CSenCredential::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	ConstructL__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 25 NONAME ; CSenCredential::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	ConstructL__20CSenIdentityProviderRC6TDesC8 @ 26 NONAME R3UNUSED ; CSenIdentityProvider::ConstructL(TDesC8 const &)
+	ConstructL__20CSenIdentityProviderRC6TDesC8N21 @ 27 NONAME ; CSenIdentityProvider::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	ConstructL__20CSenIdentityProviderRC6TDesC8N31 @ 28 NONAME ; CSenIdentityProvider::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	ConstructL__20CSenIdentityProviderRC6TDesC8T1 @ 29 NONAME R3UNUSED ; CSenIdentityProvider::ConstructL(TDesC8 const &, TDesC8 const &)
+	ConstructL__25CSenXmlServiceDescription @ 30 NONAME R3UNUSED ; CSenXmlServiceDescription::ConstructL(void)
+	ConstructL__25CSenXmlServiceDescriptionRC6TDesC8T1 @ 31 NONAME R3UNUSED ; CSenXmlServiceDescription::ConstructL(TDesC8 const &, TDesC8 const &)
+	ConstructL__9CSenFacetR11CSenElement @ 32 NONAME R3UNUSED ; CSenFacet::ConstructL(CSenElement &)
+	ConstructL__9CSenFacetRC6TDesC8 @ 33 NONAME R3UNUSED ; CSenFacet::ConstructL(TDesC8 const &)
+	ConstructL__9CSenFacetRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 34 NONAME ; CSenFacet::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	ConsumerIapId__18CSenServicePatternRUl @ 35 NONAME R3UNUSED ; CSenServicePattern::ConsumerIapId(unsigned long &)
+	ConsumerIdentityProviderIds8L__18CSenServicePattern @ 36 NONAME R3UNUSED ; CSenServicePattern::ConsumerIdentityProviderIds8L(void)
+	ConsumerPolicyAsXmlL__18CSenServicePattern @ 37 NONAME R3UNUSED ; CSenServicePattern::ConsumerPolicyAsXmlL(void)
+	Contract__25CSenXmlServiceDescription @ 38 NONAME R3UNUSED ; CSenXmlServiceDescription::Contract(void)
+	Credentials__25CSenXmlServiceDescription @ 39 NONAME R3UNUSED ; CSenXmlServiceDescription::Credentials(void)
+	DescriptionClassType__25CSenXmlServiceDescription @ 40 NONAME R3UNUSED ; CSenXmlServiceDescription::DescriptionClassType(void)
+	EndElementL__25CSenXmlServiceDescriptionRC6TDesC8N21 @ 41 NONAME ; CSenXmlServiceDescription::EndElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	Endpoint__25CSenXmlServiceDescription @ 42 NONAME R3UNUSED ; CSenXmlServiceDescription::Endpoint(void)
+	FacetValue__25CSenXmlServiceDescriptionR6TDesC8RP6HBufC8 @ 43 NONAME R3UNUSED ; CSenXmlServiceDescription::FacetValue(TDesC8 &, HBufC8 *&)
+	FacetsL__25CSenXmlServiceDescriptionRt13RPointerArray1Z9CSenFacet @ 44 NONAME R3UNUSED ; CSenXmlServiceDescription::FacetsL(RPointerArray<CSenFacet> &)
+	FrameworkId__25CSenXmlServiceDescription @ 45 NONAME R3UNUSED ; CSenXmlServiceDescription::FrameworkId(void)
+	FrameworkVersion__25CSenXmlServiceDescription @ 46 NONAME R3UNUSED ; CSenXmlServiceDescription::FrameworkVersion(void)
+	HasFacetL__25CSenXmlServiceDescriptionRC6TDesC8Ri @ 47 NONAME R3UNUSED ; CSenXmlServiceDescription::HasFacetL(TDesC8 const &, int &)
+	HttpCredentialsL__20CSenIdentityProviderR19MSenIdentityManager @ 48 NONAME R3UNUSED ; CSenIdentityProvider::HttpCredentialsL(MSenIdentityManager &)
+	IMEI__20CSenIdentityProvider @ 49 NONAME R3UNUSED ; CSenIdentityProvider::IMEI(void)
+	IapId__10CSenPolicyRUl @ 50 NONAME R3UNUSED ; CSenPolicy::IapId(unsigned long &)
+	IapId__25CSenXmlServiceDescriptionRUl @ 51 NONAME R3UNUSED ; CSenXmlServiceDescription::IapId(unsigned long &)
+	Id__14CSenCredential @ 52 NONAME R3UNUSED ; CSenCredential::Id(void)
+	IdentityProviderIds8L__10CSenPolicy @ 53 NONAME R3UNUSED ; CSenPolicy::IdentityProviderIds8L(void)
+	IdentityProviderIds8L__25CSenXmlServiceDescription @ 54 NONAME R3UNUSED ; CSenXmlServiceDescription::IdentityProviderIds8L(void)
+	IsDefault__20CSenIdentityProvider @ 55 NONAME R3UNUSED ; CSenIdentityProvider::IsDefault(void)
+	IsStrict__C28CSenIdentityProviderIdArray8 @ 56 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::IsStrict(void) const
+	IsTrustedByL__20CSenIdentityProviderR22MSenServiceDescription @ 57 NONAME R3UNUSED ; CSenIdentityProvider::IsTrustedByL(MSenServiceDescription &)
+	IsTrustedByL__20CSenIdentityProviderRC6TDesC8 @ 58 NONAME R3UNUSED ; CSenIdentityProvider::IsTrustedByL(TDesC8 const &)
+	Matches__18CSenServicePatternR22MSenServiceDescription @ 59 NONAME R3UNUSED ; CSenServicePattern::Matches(MSenServiceDescription &)
+	Matches__25CSenXmlServiceDescriptionR22MSenServiceDescription @ 60 NONAME R3UNUSED ; CSenXmlServiceDescription::Matches(MSenServiceDescription &)
+	Name__9CSenFacet @ 61 NONAME R3UNUSED ; CSenFacet::Name(void)
+	NewElementName__20CSenIdentityProvider @ 62 NONAME R3UNUSED ; CSenIdentityProvider::NewElementName(void)
+	NewElementName__25CSenXmlServiceDescription @ 63 NONAME R3UNUSED ; CSenXmlServiceDescription::NewElementName(void)
+	NewLC__10CSenPolicy @ 64 NONAME R3UNUSED ; CSenPolicy::NewLC(void)
+	NewLC__10CSenPolicyUl @ 65 NONAME R3UNUSED ; CSenPolicy::NewLC(unsigned long)
+	NewLC__14CSenCredentialRC14CSenCredential @ 66 NONAME R3UNUSED ; CSenCredential::NewLC(CSenCredential const &)
+	NewLC__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 67 NONAME ; CSenCredential::NewLC(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	NewLC__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 68 NONAME ; CSenCredential::NewLC(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	NewLC__18CSenConsumerPolicy @ 69 NONAME R3UNUSED ; CSenConsumerPolicy::NewLC(void)
+	NewLC__18CSenConsumerPolicyUl @ 70 NONAME R3UNUSED ; CSenConsumerPolicy::NewLC(unsigned long)
+	NewLC__18CSenProviderPolicy @ 71 NONAME R3UNUSED ; CSenProviderPolicy::NewLC(void)
+	NewLC__18CSenProviderPolicyUl @ 72 NONAME R3UNUSED ; CSenProviderPolicy::NewLC(unsigned long)
+	NewLC__18CSenServicePattern @ 73 NONAME R3UNUSED ; CSenServicePattern::NewLC(void)
+	NewLC__18CSenServicePatternRC6TDesC8 @ 74 NONAME R3UNUSED ; CSenServicePattern::NewLC(TDesC8 const &)
+	NewLC__18CSenServicePatternRC6TDesC8T1 @ 75 NONAME R3UNUSED ; CSenServicePattern::NewLC(TDesC8 const &, TDesC8 const &)
+	NewLC__20CSenIdentityProviderRC6TDesC8 @ 76 NONAME R3UNUSED ; CSenIdentityProvider::NewLC(TDesC8 const &)
+	NewLC__20CSenIdentityProviderRC6TDesC8N21 @ 77 NONAME R3UNUSED ; CSenIdentityProvider::NewLC(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewLC__20CSenIdentityProviderRC6TDesC8N31 @ 78 NONAME ; CSenIdentityProvider::NewLC(TDesC8 const &, TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewLC__20CSenIdentityProviderRC6TDesC8T1 @ 79 NONAME R3UNUSED ; CSenIdentityProvider::NewLC(TDesC8 const &, TDesC8 const &)
+	NewLC__25CSenXmlServiceDescription @ 80 NONAME R3UNUSED ; CSenXmlServiceDescription::NewLC(void)
+	NewLC__25CSenXmlServiceDescriptionRC6TDesC8 @ 81 NONAME R3UNUSED ; CSenXmlServiceDescription::NewLC(TDesC8 const &)
+	NewLC__25CSenXmlServiceDescriptionRC6TDesC8T1 @ 82 NONAME R3UNUSED ; CSenXmlServiceDescription::NewLC(TDesC8 const &, TDesC8 const &)
+	NewLC__28CSenIdentityProviderIdArray8 @ 83 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::NewLC(void)
+	NewLC__28CSenIdentityProviderIdArray8i @ 84 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::NewLC(int)
+	NewL__10CSenPolicy @ 85 NONAME R3UNUSED ; CSenPolicy::NewL(void)
+	NewL__10CSenPolicyUl @ 86 NONAME R3UNUSED ; CSenPolicy::NewL(unsigned long)
+	NewL__14CSenCredentialRC14CSenCredential @ 87 NONAME R3UNUSED ; CSenCredential::NewL(CSenCredential const &)
+	NewL__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 88 NONAME ; CSenCredential::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	NewL__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 89 NONAME ; CSenCredential::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	NewL__18CSenConsumerPolicy @ 90 NONAME R3UNUSED ; CSenConsumerPolicy::NewL(void)
+	NewL__18CSenConsumerPolicyUl @ 91 NONAME R3UNUSED ; CSenConsumerPolicy::NewL(unsigned long)
+	NewL__18CSenProviderPolicy @ 92 NONAME R3UNUSED ; CSenProviderPolicy::NewL(void)
+	NewL__18CSenProviderPolicyUl @ 93 NONAME R3UNUSED ; CSenProviderPolicy::NewL(unsigned long)
+	NewL__18CSenServicePattern @ 94 NONAME R3UNUSED ; CSenServicePattern::NewL(void)
+	NewL__18CSenServicePatternRC6TDesC8 @ 95 NONAME R3UNUSED ; CSenServicePattern::NewL(TDesC8 const &)
+	NewL__18CSenServicePatternRC6TDesC8T1 @ 96 NONAME R3UNUSED ; CSenServicePattern::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__20CSenIdentityProviderRC6TDesC8 @ 97 NONAME R3UNUSED ; CSenIdentityProvider::NewL(TDesC8 const &)
+	NewL__20CSenIdentityProviderRC6TDesC8N21 @ 98 NONAME R3UNUSED ; CSenIdentityProvider::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__20CSenIdentityProviderRC6TDesC8N31 @ 99 NONAME ; CSenIdentityProvider::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__20CSenIdentityProviderRC6TDesC8T1 @ 100 NONAME R3UNUSED ; CSenIdentityProvider::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__25CSenXmlServiceDescription @ 101 NONAME R3UNUSED ; CSenXmlServiceDescription::NewL(void)
+	NewL__25CSenXmlServiceDescriptionRC6TDesC8 @ 102 NONAME R3UNUSED ; CSenXmlServiceDescription::NewL(TDesC8 const &)
+	NewL__25CSenXmlServiceDescriptionRC6TDesC8T1 @ 103 NONAME R3UNUSED ; CSenXmlServiceDescription::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__28CSenIdentityProviderIdArray8 @ 104 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::NewL(void)
+	NewL__28CSenIdentityProviderIdArray8i @ 105 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::NewL(int)
+	NewL__9CSenFacet @ 106 NONAME R3UNUSED ; CSenFacet::NewL(void)
+	NewL__9CSenFacetR11CSenElement @ 107 NONAME R3UNUSED ; CSenFacet::NewL(CSenElement &)
+	NewL__9CSenFacetRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 108 NONAME ; CSenFacet::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	Password__20CSenIdentityProvider @ 109 NONAME R3UNUSED ; CSenIdentityProvider::Password(void)
+	ProviderID__20CSenIdentityProvider @ 110 NONAME R3UNUSED ; CSenIdentityProvider::ProviderID(void)
+	RebuildFromConsumerPolicy__18CSenServicePatternR18MSenConsumerPolicy @ 111 NONAME R3UNUSED ; CSenServicePattern::RebuildFromConsumerPolicy(MSenConsumerPolicy &)
+	RebuildFrom__10CSenPolicyR10MSenPolicy @ 112 NONAME R3UNUSED ; CSenPolicy::RebuildFrom(MSenPolicy &)
+	RebuildFrom__18CSenConsumerPolicyR18MSenConsumerPolicy @ 113 NONAME R3UNUSED ; CSenConsumerPolicy::RebuildFrom(MSenConsumerPolicy &)
+	RebuildFrom__18CSenProviderPolicyR18MSenProviderPolicy @ 114 NONAME R3UNUSED ; CSenProviderPolicy::RebuildFrom(MSenProviderPolicy &)
+	RebuildFrom__25CSenXmlServiceDescriptionR18MSenProviderPolicy @ 115 NONAME R3UNUSED ; CSenXmlServiceDescription::RebuildFrom(MSenProviderPolicy &)
+	RemoveFacet__25CSenXmlServiceDescriptionRC6TDesC8 @ 116 NONAME R3UNUSED ; CSenXmlServiceDescription::RemoveFacet(TDesC8 const &)
+	ResumeParsingFromL__25CSenXmlServiceDescriptionRC6TDesC8N21 @ 117 NONAME ; CSenXmlServiceDescription::ResumeParsingFromL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	ScoreMatchL__25CSenXmlServiceDescriptionR22MSenServiceDescription @ 118 NONAME R3UNUSED ; CSenXmlServiceDescription::ScoreMatchL(MSenServiceDescription &)
+	SetAttributesL__25CSenXmlServiceDescriptionRCt6RArray1ZQ23Xml10RAttribute @ 119 NONAME R3UNUSED ; CSenXmlServiceDescription::SetAttributesL(RArray<Xml::RAttribute> const &)
+	SetConsumerIapIdL__18CSenServicePatternUl @ 120 NONAME R3UNUSED ; CSenServicePattern::SetConsumerIapIdL(unsigned long)
+	SetConsumerIdentityProviderIdsL__18CSenServicePatternR28CSenIdentityProviderIdArray8 @ 121 NONAME R3UNUSED ; CSenServicePattern::SetConsumerIdentityProviderIdsL(CSenIdentityProviderIdArray8 &)
+	SetContractL__25CSenXmlServiceDescriptionRC6TDesC8 @ 122 NONAME R3UNUSED ; CSenXmlServiceDescription::SetContractL(TDesC8 const &)
+	SetEndPointL__25CSenXmlServiceDescriptionRC6TDesC8 @ 123 NONAME R3UNUSED ; CSenXmlServiceDescription::SetEndPointL(TDesC8 const &)
+	SetFacetL__25CSenXmlServiceDescriptionRC9CSenFacet @ 124 NONAME R3UNUSED ; CSenXmlServiceDescription::SetFacetL(CSenFacet const &)
+	SetFrameworkIdL__25CSenXmlServiceDescriptionRC6TDesC8 @ 125 NONAME R3UNUSED ; CSenXmlServiceDescription::SetFrameworkIdL(TDesC8 const &)
+	SetIapIdL__10CSenPolicyUl @ 126 NONAME R3UNUSED ; CSenPolicy::SetIapIdL(unsigned long)
+	SetIapIdL__25CSenXmlServiceDescriptionUl @ 127 NONAME R3UNUSED ; CSenXmlServiceDescription::SetIapIdL(unsigned long)
+	SetIdentityProviderIdsL__10CSenPolicyR28CSenIdentityProviderIdArray8 @ 128 NONAME R3UNUSED ; CSenPolicy::SetIdentityProviderIdsL(CSenIdentityProviderIdArray8 &)
+	SetIdentityProviderIdsL__25CSenXmlServiceDescriptionR28CSenIdentityProviderIdArray8 @ 129 NONAME R3UNUSED ; CSenXmlServiceDescription::SetIdentityProviderIdsL(CSenIdentityProviderIdArray8 &)
+	SetNameL__9CSenFacetRC6TDesC8 @ 130 NONAME R3UNUSED ; CSenFacet::SetNameL(TDesC8 const &)
+	SetProviderID__20CSenIdentityProviderRC6TDesC8 @ 131 NONAME R3UNUSED ; CSenIdentityProvider::SetProviderID(TDesC8 const &)
+	SetServiceID__20CSenIdentityProviderRC6TDesC8 @ 132 NONAME R3UNUSED ; CSenIdentityProvider::SetServiceID(TDesC8 const &)
+	SetStrict__28CSenIdentityProviderIdArray8i @ 133 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::SetStrict(int)
+	SetTypeL__9CSenFacetRC6TDesC8 @ 134 NONAME R3UNUSED ; CSenFacet::SetTypeL(TDesC8 const &)
+	SetUserInfoL__20CSenIdentityProviderRC6TDesC8N21 @ 135 NONAME ; CSenIdentityProvider::SetUserInfoL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	SetValidUntil__14CSenCredentialR5TTime @ 136 NONAME R3UNUSED ; CSenCredential::SetValidUntil(TTime &)
+	SetValueL__9CSenFacetRC6TDesC8 @ 137 NONAME R3UNUSED ; CSenFacet::SetValueL(TDesC8 const &)
+	StartElementL__14CSenCredentialRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 138 NONAME ; CSenCredential::StartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	StartElementL__18CSenServicePatternRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 139 NONAME ; CSenServicePattern::StartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	StartElementL__25CSenXmlServiceDescriptionRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 140 NONAME ; CSenXmlServiceDescription::StartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	Type__9CSenFacet @ 141 NONAME R3UNUSED ; CSenFacet::Type(void)
+	UserName__20CSenIdentityProvider @ 142 NONAME R3UNUSED ; CSenIdentityProvider::UserName(void)
+	ValidUntil__14CSenCredential @ 143 NONAME R3UNUSED ; CSenCredential::ValidUntil(void)
+	Value__9CSenFacet @ 144 NONAME R3UNUSED ; CSenFacet::Value(void)
+	WriteAsXMLToL__25CSenXmlServiceDescriptionR12RWriteStream @ 145 NONAME R3UNUSED ; CSenXmlServiceDescription::WriteAsXMLToL(RWriteStream &)
+	"_._14CSenCredential" @ 146 NONAME R3UNUSED ; CSenCredential::~CSenCredential(void)
+	"_._18CSenServicePattern" @ 147 NONAME R3UNUSED ; CSenServicePattern::~CSenServicePattern(void)
+	"_._20CSenIdentityProvider" @ 148 NONAME R3UNUSED ; CSenIdentityProvider::~CSenIdentityProvider(void)
+	"_._25CSenXmlServiceDescription" @ 149 NONAME R3UNUSED ; CSenXmlServiceDescription::~CSenXmlServiceDescription(void)
+	"_._28CSenIdentityProviderIdArray8" @ 150 NONAME R3UNUSED ; CSenIdentityProviderIdArray8::~CSenIdentityProviderIdArray8(void)
+	"_._9CSenFacet" @ 151 NONAME R3UNUSED ; CSenFacet::~CSenFacet(void)
+	__14CSenCredential @ 152 NONAME R3UNUSED ; CSenCredential::CSenCredential(void)
+	__18CSenServicePatternQ222MSenServiceDescription21TDescriptionClassType @ 153 NONAME R3UNUSED ; CSenServicePattern::CSenServicePattern(MSenServiceDescription::TDescriptionClassType)
+	__20CSenIdentityProviderQ222MSenServiceDescription21TDescriptionClassType @ 154 NONAME R3UNUSED ; CSenIdentityProvider::CSenIdentityProvider(MSenServiceDescription::TDescriptionClassType)
+	__25CSenXmlServiceDescriptionQ222MSenServiceDescription21TDescriptionClassType @ 155 NONAME R3UNUSED ; CSenXmlServiceDescription::CSenXmlServiceDescription(MSenServiceDescription::TDescriptionClassType)
+	AcceptsConsumerPolicy__18CSenServicePatternR18MSenConsumerPolicy @ 156 NONAME R3UNUSED ; CSenServicePattern::AcceptsConsumerPolicy(MSenConsumerPolicy &)
+	HasEqualPrimaryKeysL__25CSenXmlServiceDescriptionR22MSenServiceDescription @ 157 NONAME R3UNUSED ; CSenXmlServiceDescription::HasEqualPrimaryKeysL(MSenServiceDescription &)
+	IsLocalL__25CSenXmlServiceDescription @ 158 NONAME R3UNUSED ; CSenXmlServiceDescription::IsLocalL(void)
+	SetTransportCueL__25CSenXmlServiceDescriptionRC6TDesC8 @ 159 NONAME R3UNUSED ; CSenXmlServiceDescription::SetTransportCueL(TDesC8 const &)
+	TransportCue__25CSenXmlServiceDescription @ 160 NONAME R3UNUSED ; CSenXmlServiceDescription::TransportCue(void)
+	HasSuperClass__18CSenServicePatternQ222MSenServiceDescription21TDescriptionClassType @ 161 NONAME R3UNUSED ; CSenServicePattern::HasSuperClass(MSenServiceDescription::TDescriptionClassType)
+	HasSuperClass__20CSenIdentityProviderQ222MSenServiceDescription21TDescriptionClassType @ 162 NONAME R3UNUSED ; CSenIdentityProvider::HasSuperClass(MSenServiceDescription::TDescriptionClassType)
+	HasSuperClass__25CSenXmlServiceDescriptionQ222MSenServiceDescription21TDescriptionClassType @ 163 NONAME R3UNUSED ; CSenXmlServiceDescription::HasSuperClass(MSenServiceDescription::TDescriptionClassType)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/BWINS/SenServDescU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,166 @@
+EXPORTS
+	??0CSenCredential@@AAE@XZ @ 1 NONAME ; private: __thiscall CSenCredential::CSenCredential(void)
+	??0CSenFacet@@IAE@XZ @ 2 NONAME ; protected: __thiscall CSenFacet::CSenFacet(void)
+	??0CSenIdentityProvider@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 3 NONAME ; protected: __thiscall CSenIdentityProvider::CSenIdentityProvider(enum MSenServiceDescription::TDescriptionClassType)
+	??0CSenServicePattern@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 4 NONAME ; protected: __thiscall CSenServicePattern::CSenServicePattern(enum MSenServiceDescription::TDescriptionClassType)
+	??0CSenXmlServiceDescription@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 5 NONAME ; protected: __thiscall CSenXmlServiceDescription::CSenXmlServiceDescription(enum MSenServiceDescription::TDescriptionClassType)
+	??1CSenCredential@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CSenCredential::~CSenCredential(void)
+	??1CSenFacet@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CSenFacet::~CSenFacet(void)
+	??1CSenIdentityProvider@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CSenIdentityProvider::~CSenIdentityProvider(void)
+	??1CSenIdentityProviderIdArray8@@UAE@XZ @ 9 NONAME ; public: virtual __thiscall CSenIdentityProviderIdArray8::~CSenIdentityProviderIdArray8(void)
+	??1CSenServicePattern@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall CSenServicePattern::~CSenServicePattern(void)
+	??1CSenXmlServiceDescription@@UAE@XZ @ 11 NONAME ; public: virtual __thiscall CSenXmlServiceDescription::~CSenXmlServiceDescription(void)
+	?Accepts@CSenConsumerPolicy@@UAEHAAVMSenConsumerPolicy@@@Z @ 12 NONAME ; public: virtual int __thiscall CSenConsumerPolicy::Accepts(class MSenConsumerPolicy &)
+	?Accepts@CSenPolicy@@UAEHAAVMSenPolicy@@@Z @ 13 NONAME ; public: virtual int __thiscall CSenPolicy::Accepts(class MSenPolicy &)
+	?Accepts@CSenProviderPolicy@@UAEHAAVMSenProviderPolicy@@@Z @ 14 NONAME ; public: virtual int __thiscall CSenProviderPolicy::Accepts(class MSenProviderPolicy &)
+	?Accepts@CSenXmlServiceDescription@@UAEHAAVMSenProviderPolicy@@@Z @ 15 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::Accepts(class MSenProviderPolicy &)
+	?AcceptsConsumerPolicy@CSenServicePattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 16 NONAME ; public: virtual int __thiscall CSenServicePattern::AcceptsConsumerPolicy(class MSenConsumerPolicy &)
+	?AddConsumerIdentityProviderIdL@CSenServicePattern@@UAEHABVTDesC8@@@Z @ 17 NONAME ; public: virtual int __thiscall CSenServicePattern::AddConsumerIdentityProviderIdL(class TDesC8 const &)
+	?AddFacetL@CSenXmlServiceDescription@@UAEHABVCSenFacet@@@Z @ 18 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::AddFacetL(class CSenFacet const &)
+	?AddIdentityProviderIdL@CSenPolicy@@UAEHABVTDesC8@@@Z @ 19 NONAME ; public: virtual int __thiscall CSenPolicy::AddIdentityProviderIdL(class TDesC8 const &)
+	?AddIdentityProviderIdL@CSenXmlServiceDescription@@UAEHAAVTDesC8@@@Z @ 20 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::AddIdentityProviderIdL(class TDesC8 &)
+	?AdvisoryAuthnID@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 21 NONAME ; public: virtual class TPtrC8 __thiscall CSenIdentityProvider::AdvisoryAuthnID(void)
+	?AsXmlL@CSenXmlServiceDescription@@UAEPAVHBufC8@@XZ @ 22 NONAME ; public: virtual class HBufC8 * __thiscall CSenXmlServiceDescription::AsXmlL(void)
+	?AsXmlUnicodeL@CSenXmlServiceDescription@@UAEPAVHBufC16@@XZ @ 23 NONAME ; public: virtual class HBufC16 * __thiscall CSenXmlServiceDescription::AsXmlUnicodeL(void)
+	?AuthzID@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 24 NONAME ; public: virtual class TPtrC8 __thiscall CSenIdentityProvider::AuthzID(void)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXK@Z @ 25 NONAME ; private: void __thiscall CSenConsumerPolicy::BaseConstructL(unsigned long)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXXZ @ 26 NONAME ; private: void __thiscall CSenConsumerPolicy::BaseConstructL(void)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@@Z @ 27 NONAME ; protected: void __thiscall CSenPolicy::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@K@Z @ 28 NONAME ; protected: void __thiscall CSenPolicy::BaseConstructL(class TDesC8 const &,unsigned long)
+	?BaseConstructL@CSenProviderPolicy@@AAEXK@Z @ 29 NONAME ; private: void __thiscall CSenProviderPolicy::BaseConstructL(unsigned long)
+	?BaseConstructL@CSenProviderPolicy@@AAEXXZ @ 30 NONAME ; private: void __thiscall CSenProviderPolicy::BaseConstructL(void)
+	?BaseConstructL@CSenServicePattern@@IAEXABVTDesC8@@0@Z @ 31 NONAME ; protected: void __thiscall CSenServicePattern::BaseConstructL(class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenServicePattern@@IAEXABVTDesC8@@@Z @ 32 NONAME ; protected: void __thiscall CSenServicePattern::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenServicePattern@@IAEXXZ @ 33 NONAME ; protected: void __thiscall CSenServicePattern::BaseConstructL(void)
+	?ConstructL@CSenCredential@@AAEXAAV1@@Z @ 34 NONAME ; private: void __thiscall CSenCredential::ConstructL(class CSenCredential &)
+	?ConstructL@CSenCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 35 NONAME ; private: void __thiscall CSenCredential::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?ConstructL@CSenCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 36 NONAME ; private: void __thiscall CSenCredential::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?ConstructL@CSenFacet@@IAEXAAVCSenElement@@@Z @ 37 NONAME ; protected: void __thiscall CSenFacet::ConstructL(class CSenElement &)
+	?ConstructL@CSenFacet@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 38 NONAME ; protected: void __thiscall CSenFacet::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?ConstructL@CSenFacet@@IAEXABVTDesC8@@@Z @ 39 NONAME ; protected: void __thiscall CSenFacet::ConstructL(class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@000@Z @ 40 NONAME ; protected: void __thiscall CSenIdentityProvider::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@00@Z @ 41 NONAME ; protected: void __thiscall CSenIdentityProvider::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@0@Z @ 42 NONAME ; protected: void __thiscall CSenIdentityProvider::ConstructL(class TDesC8 const &,class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@@Z @ 43 NONAME ; protected: void __thiscall CSenIdentityProvider::ConstructL(class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXABVTDesC8@@0@Z @ 44 NONAME ; protected: void __thiscall CSenXmlServiceDescription::ConstructL(class TDesC8 const &,class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXABVTDesC8@@@Z @ 45 NONAME ; protected: void __thiscall CSenXmlServiceDescription::ConstructL(class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXXZ @ 46 NONAME ; protected: void __thiscall CSenXmlServiceDescription::ConstructL(void)
+	?ConsumerIapId@CSenServicePattern@@UAEHAAK@Z @ 47 NONAME ; public: virtual int __thiscall CSenServicePattern::ConsumerIapId(unsigned long &)
+	?ConsumerIdentityProviderIds8L@CSenServicePattern@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 48 NONAME ; public: virtual class CSenIdentityProviderIdArray8 const & __thiscall CSenServicePattern::ConsumerIdentityProviderIds8L(void)
+	?ConsumerPolicyAsXmlL@CSenServicePattern@@QAEPAVHBufC8@@XZ @ 49 NONAME ; public: class HBufC8 * __thiscall CSenServicePattern::ConsumerPolicyAsXmlL(void)
+	?Contract@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 50 NONAME ; public: virtual class TPtrC8 __thiscall CSenXmlServiceDescription::Contract(void)
+	?Credentials@CSenXmlServiceDescription@@QAEAAV?$RPointerArray@VCSenCredential@@@@XZ @ 51 NONAME ; public: class RPointerArray<class CSenCredential> & __thiscall CSenXmlServiceDescription::Credentials(void)
+	?DescriptionClassType@CSenXmlServiceDescription@@UAE?AW4TDescriptionClassType@MSenServiceDescription@@XZ @ 52 NONAME ; public: virtual enum MSenServiceDescription::TDescriptionClassType __thiscall CSenXmlServiceDescription::DescriptionClassType(void)
+	?EndElementL@CSenXmlServiceDescription@@MAEXABVTDesC8@@00@Z @ 53 NONAME ; protected: virtual void __thiscall CSenXmlServiceDescription::EndElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?Endpoint@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 54 NONAME ; public: virtual class TPtrC8 __thiscall CSenXmlServiceDescription::Endpoint(void)
+	?FacetValue@CSenXmlServiceDescription@@UAEHAAVTDesC8@@AAPAVHBufC8@@@Z @ 55 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::FacetValue(class TDesC8 &,class HBufC8 * &)
+	?FacetsL@CSenXmlServiceDescription@@UAEHAAV?$RPointerArray@VCSenFacet@@@@@Z @ 56 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::FacetsL(class RPointerArray<class CSenFacet> &)
+	?FrameworkId@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 57 NONAME ; public: virtual class TPtrC8 __thiscall CSenXmlServiceDescription::FrameworkId(void)
+	?FrameworkVersion@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 58 NONAME ; public: virtual class TPtrC8 __thiscall CSenXmlServiceDescription::FrameworkVersion(void)
+	?HasFacetL@CSenXmlServiceDescription@@UAEHABVTDesC8@@AAH@Z @ 59 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::HasFacetL(class TDesC8 const &,int &)
+	?HttpCredentialsL@CSenIdentityProvider@@QAEPAVHBufC8@@AAVMSenIdentityManager@@@Z @ 60 NONAME ; public: class HBufC8 * __thiscall CSenIdentityProvider::HttpCredentialsL(class MSenIdentityManager &)
+	?IMEI@CSenIdentityProvider@@QAEABVTDesC8@@XZ @ 61 NONAME ; public: class TDesC8 const & __thiscall CSenIdentityProvider::IMEI(void)
+	?IapId@CSenPolicy@@UAEHAAK@Z @ 62 NONAME ; public: virtual int __thiscall CSenPolicy::IapId(unsigned long &)
+	?IapId@CSenXmlServiceDescription@@UAEHAAK@Z @ 63 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::IapId(unsigned long &)
+	?Id@CSenCredential@@QAEABVTDesC8@@XZ @ 64 NONAME ; public: class TDesC8 const & __thiscall CSenCredential::Id(void)
+	?IdentityProviderIds8L@CSenPolicy@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 65 NONAME ; public: virtual class CSenIdentityProviderIdArray8 const & __thiscall CSenPolicy::IdentityProviderIds8L(void)
+	?IdentityProviderIds8L@CSenXmlServiceDescription@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 66 NONAME ; public: virtual class CSenIdentityProviderIdArray8 const & __thiscall CSenXmlServiceDescription::IdentityProviderIds8L(void)
+	?IsDefault@CSenIdentityProvider@@QAEHXZ @ 67 NONAME ; public: int __thiscall CSenIdentityProvider::IsDefault(void)
+	?IsStrict@CSenIdentityProviderIdArray8@@UBEHXZ @ 68 NONAME ; public: virtual int __thiscall CSenIdentityProviderIdArray8::IsStrict(void)const 
+	?IsTrustedByL@CSenIdentityProvider@@QAEHAAVMSenServiceDescription@@@Z @ 69 NONAME ; public: int __thiscall CSenIdentityProvider::IsTrustedByL(class MSenServiceDescription &)
+	?IsTrustedByL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 70 NONAME ; public: int __thiscall CSenIdentityProvider::IsTrustedByL(class TDesC8 const &)
+	?Matches@CSenServicePattern@@UAEHAAVMSenServiceDescription@@@Z @ 71 NONAME ; public: virtual int __thiscall CSenServicePattern::Matches(class MSenServiceDescription &)
+	?Matches@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 72 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::Matches(class MSenServiceDescription &)
+	?Name@CSenFacet@@UAE?AVTPtrC8@@XZ @ 73 NONAME ; public: virtual class TPtrC8 __thiscall CSenFacet::Name(void)
+	?NewElementName@CSenIdentityProvider@@UAEABVTDesC8@@XZ @ 74 NONAME ; public: virtual class TDesC8 const & __thiscall CSenIdentityProvider::NewElementName(void)
+	?NewElementName@CSenXmlServiceDescription@@UAEABVTDesC8@@XZ @ 75 NONAME ; public: virtual class TDesC8 const & __thiscall CSenXmlServiceDescription::NewElementName(void)
+	?NewL@CSenConsumerPolicy@@SAPAV1@K@Z @ 76 NONAME ; public: static class CSenConsumerPolicy * __cdecl CSenConsumerPolicy::NewL(unsigned long)
+	?NewL@CSenConsumerPolicy@@SAPAV1@XZ @ 77 NONAME ; public: static class CSenConsumerPolicy * __cdecl CSenConsumerPolicy::NewL(void)
+	?NewL@CSenCredential@@SAPAV1@ABV1@@Z @ 78 NONAME ; public: static class CSenCredential * __cdecl CSenCredential::NewL(class CSenCredential const &)
+	?NewL@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 79 NONAME ; public: static class CSenCredential * __cdecl CSenCredential::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 80 NONAME ; public: static class CSenCredential * __cdecl CSenCredential::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?NewL@CSenFacet@@SAPAV1@AAVCSenElement@@@Z @ 81 NONAME ; public: static class CSenFacet * __cdecl CSenFacet::NewL(class CSenElement &)
+	?NewL@CSenFacet@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 82 NONAME ; public: static class CSenFacet * __cdecl CSenFacet::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenFacet@@SAPAV1@XZ @ 83 NONAME ; public: static class CSenFacet * __cdecl CSenFacet::NewL(void)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@000@Z @ 84 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@00@Z @ 85 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@0@Z @ 86 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@@Z @ 87 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewL(class TDesC8 const &)
+	?NewL@CSenIdentityProviderIdArray8@@SAPAV1@H@Z @ 88 NONAME ; public: static class CSenIdentityProviderIdArray8 * __cdecl CSenIdentityProviderIdArray8::NewL(int)
+	?NewL@CSenIdentityProviderIdArray8@@SAPAV1@XZ @ 89 NONAME ; public: static class CSenIdentityProviderIdArray8 * __cdecl CSenIdentityProviderIdArray8::NewL(void)
+	?NewL@CSenPolicy@@SAPAV1@K@Z @ 90 NONAME ; public: static class CSenPolicy * __cdecl CSenPolicy::NewL(unsigned long)
+	?NewL@CSenPolicy@@SAPAV1@XZ @ 91 NONAME ; public: static class CSenPolicy * __cdecl CSenPolicy::NewL(void)
+	?NewL@CSenProviderPolicy@@SAPAV1@K@Z @ 92 NONAME ; public: static class CSenProviderPolicy * __cdecl CSenProviderPolicy::NewL(unsigned long)
+	?NewL@CSenProviderPolicy@@SAPAV1@XZ @ 93 NONAME ; public: static class CSenProviderPolicy * __cdecl CSenProviderPolicy::NewL(void)
+	?NewL@CSenServicePattern@@SAPAV1@ABVTDesC8@@0@Z @ 94 NONAME ; public: static class CSenServicePattern * __cdecl CSenServicePattern::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenServicePattern@@SAPAV1@ABVTDesC8@@@Z @ 95 NONAME ; public: static class CSenServicePattern * __cdecl CSenServicePattern::NewL(class TDesC8 const &)
+	?NewL@CSenServicePattern@@SAPAV1@XZ @ 96 NONAME ; public: static class CSenServicePattern * __cdecl CSenServicePattern::NewL(void)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@0@Z @ 97 NONAME ; public: static class CSenXmlServiceDescription * __cdecl CSenXmlServiceDescription::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@@Z @ 98 NONAME ; public: static class CSenXmlServiceDescription * __cdecl CSenXmlServiceDescription::NewL(class TDesC8 const &)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@XZ @ 99 NONAME ; public: static class CSenXmlServiceDescription * __cdecl CSenXmlServiceDescription::NewL(void)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@K@Z @ 100 NONAME ; public: static class CSenConsumerPolicy * __cdecl CSenConsumerPolicy::NewLC(unsigned long)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@XZ @ 101 NONAME ; public: static class CSenConsumerPolicy * __cdecl CSenConsumerPolicy::NewLC(void)
+	?NewLC@CSenCredential@@SAPAV1@ABV1@@Z @ 102 NONAME ; public: static class CSenCredential * __cdecl CSenCredential::NewLC(class CSenCredential const &)
+	?NewLC@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 103 NONAME ; public: static class CSenCredential * __cdecl CSenCredential::NewLC(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 104 NONAME ; public: static class CSenCredential * __cdecl CSenCredential::NewLC(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@000@Z @ 105 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewLC(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@00@Z @ 106 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewLC(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@0@Z @ 107 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewLC(class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@@Z @ 108 NONAME ; public: static class CSenIdentityProvider * __cdecl CSenIdentityProvider::NewLC(class TDesC8 const &)
+	?NewLC@CSenIdentityProviderIdArray8@@SAPAV1@H@Z @ 109 NONAME ; public: static class CSenIdentityProviderIdArray8 * __cdecl CSenIdentityProviderIdArray8::NewLC(int)
+	?NewLC@CSenIdentityProviderIdArray8@@SAPAV1@XZ @ 110 NONAME ; public: static class CSenIdentityProviderIdArray8 * __cdecl CSenIdentityProviderIdArray8::NewLC(void)
+	?NewLC@CSenPolicy@@SAPAV1@K@Z @ 111 NONAME ; public: static class CSenPolicy * __cdecl CSenPolicy::NewLC(unsigned long)
+	?NewLC@CSenPolicy@@SAPAV1@XZ @ 112 NONAME ; public: static class CSenPolicy * __cdecl CSenPolicy::NewLC(void)
+	?NewLC@CSenProviderPolicy@@SAPAV1@K@Z @ 113 NONAME ; public: static class CSenProviderPolicy * __cdecl CSenProviderPolicy::NewLC(unsigned long)
+	?NewLC@CSenProviderPolicy@@SAPAV1@XZ @ 114 NONAME ; public: static class CSenProviderPolicy * __cdecl CSenProviderPolicy::NewLC(void)
+	?NewLC@CSenServicePattern@@SAPAV1@ABVTDesC8@@0@Z @ 115 NONAME ; public: static class CSenServicePattern * __cdecl CSenServicePattern::NewLC(class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenServicePattern@@SAPAV1@ABVTDesC8@@@Z @ 116 NONAME ; public: static class CSenServicePattern * __cdecl CSenServicePattern::NewLC(class TDesC8 const &)
+	?NewLC@CSenServicePattern@@SAPAV1@XZ @ 117 NONAME ; public: static class CSenServicePattern * __cdecl CSenServicePattern::NewLC(void)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@0@Z @ 118 NONAME ; public: static class CSenXmlServiceDescription * __cdecl CSenXmlServiceDescription::NewLC(class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@@Z @ 119 NONAME ; public: static class CSenXmlServiceDescription * __cdecl CSenXmlServiceDescription::NewLC(class TDesC8 const &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@XZ @ 120 NONAME ; public: static class CSenXmlServiceDescription * __cdecl CSenXmlServiceDescription::NewLC(void)
+	?Password@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 121 NONAME ; public: virtual class TPtrC8 __thiscall CSenIdentityProvider::Password(void)
+	?ProviderID@CSenIdentityProvider@@QAE?AVTPtrC8@@XZ @ 122 NONAME ; public: class TPtrC8 __thiscall CSenIdentityProvider::ProviderID(void)
+	?RebuildFrom@CSenConsumerPolicy@@UAEHAAVMSenConsumerPolicy@@@Z @ 123 NONAME ; public: virtual int __thiscall CSenConsumerPolicy::RebuildFrom(class MSenConsumerPolicy &)
+	?RebuildFrom@CSenPolicy@@UAEHAAVMSenPolicy@@@Z @ 124 NONAME ; public: virtual int __thiscall CSenPolicy::RebuildFrom(class MSenPolicy &)
+	?RebuildFrom@CSenProviderPolicy@@UAEHAAVMSenProviderPolicy@@@Z @ 125 NONAME ; public: virtual int __thiscall CSenProviderPolicy::RebuildFrom(class MSenProviderPolicy &)
+	?RebuildFrom@CSenXmlServiceDescription@@UAEHAAVMSenProviderPolicy@@@Z @ 126 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::RebuildFrom(class MSenProviderPolicy &)
+	?RebuildFromConsumerPolicy@CSenServicePattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 127 NONAME ; public: virtual int __thiscall CSenServicePattern::RebuildFromConsumerPolicy(class MSenConsumerPolicy &)
+	?RemoveFacet@CSenXmlServiceDescription@@UAEHABVTDesC8@@@Z @ 128 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::RemoveFacet(class TDesC8 const &)
+	?ResumeParsingFromL@CSenXmlServiceDescription@@UAEXABVTDesC8@@00@Z @ 129 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::ResumeParsingFromL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?ScoreMatchL@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 130 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::ScoreMatchL(class MSenServiceDescription &)
+	?SetAttributesL@CSenXmlServiceDescription@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 131 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetConsumerIapIdL@CSenServicePattern@@UAEXK@Z @ 132 NONAME ; public: virtual void __thiscall CSenServicePattern::SetConsumerIapIdL(unsigned long)
+	?SetConsumerIdentityProviderIdsL@CSenServicePattern@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 133 NONAME ; public: virtual void __thiscall CSenServicePattern::SetConsumerIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetContractL@CSenXmlServiceDescription@@UAEXABVTDesC8@@@Z @ 134 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::SetContractL(class TDesC8 const &)
+	?SetEndPointL@CSenXmlServiceDescription@@UAEXABVTDesC8@@@Z @ 135 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::SetEndPointL(class TDesC8 const &)
+	?SetFacetL@CSenXmlServiceDescription@@UAEHABVCSenFacet@@@Z @ 136 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::SetFacetL(class CSenFacet const &)
+	?SetFrameworkIdL@CSenXmlServiceDescription@@QAEXABVTDesC8@@@Z @ 137 NONAME ; public: void __thiscall CSenXmlServiceDescription::SetFrameworkIdL(class TDesC8 const &)
+	?SetIapIdL@CSenPolicy@@UAEXK@Z @ 138 NONAME ; public: virtual void __thiscall CSenPolicy::SetIapIdL(unsigned long)
+	?SetIapIdL@CSenXmlServiceDescription@@UAEXK@Z @ 139 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::SetIapIdL(unsigned long)
+	?SetIdentityProviderIdsL@CSenPolicy@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 140 NONAME ; public: virtual void __thiscall CSenPolicy::SetIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetIdentityProviderIdsL@CSenXmlServiceDescription@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 141 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::SetIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetNameL@CSenFacet@@UAEXABVTDesC8@@@Z @ 142 NONAME ; public: virtual void __thiscall CSenFacet::SetNameL(class TDesC8 const &)
+	?SetProviderID@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 143 NONAME ; public: int __thiscall CSenIdentityProvider::SetProviderID(class TDesC8 const &)
+	?SetServiceID@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 144 NONAME ; public: int __thiscall CSenIdentityProvider::SetServiceID(class TDesC8 const &)
+	?SetStrict@CSenIdentityProviderIdArray8@@UAEXH@Z @ 145 NONAME ; public: virtual void __thiscall CSenIdentityProviderIdArray8::SetStrict(int)
+	?SetTypeL@CSenFacet@@UAEXABVTDesC8@@@Z @ 146 NONAME ; public: virtual void __thiscall CSenFacet::SetTypeL(class TDesC8 const &)
+	?SetUserInfoL@CSenIdentityProvider@@QAEHABVTDesC8@@00@Z @ 147 NONAME ; public: int __thiscall CSenIdentityProvider::SetUserInfoL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?SetValidUntil@CSenCredential@@QAEXAAVTTime@@@Z @ 148 NONAME ; public: void __thiscall CSenCredential::SetValidUntil(class TTime &)
+	?SetValueL@CSenFacet@@UAEXABVTDesC8@@@Z @ 149 NONAME ; public: virtual void __thiscall CSenFacet::SetValueL(class TDesC8 const &)
+	?StartElementL@CSenCredential@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 150 NONAME ; protected: virtual void __thiscall CSenCredential::StartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenServicePattern@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 151 NONAME ; public: virtual void __thiscall CSenServicePattern::StartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenXmlServiceDescription@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 152 NONAME ; protected: virtual void __thiscall CSenXmlServiceDescription::StartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?Type@CSenFacet@@UAE?AVTPtrC8@@XZ @ 153 NONAME ; public: virtual class TPtrC8 __thiscall CSenFacet::Type(void)
+	?UserName@CSenIdentityProvider@@QAE?AVTPtrC8@@XZ @ 154 NONAME ; public: class TPtrC8 __thiscall CSenIdentityProvider::UserName(void)
+	?ValidUntil@CSenCredential@@QAEAAVTTime@@XZ @ 155 NONAME ; public: class TTime & __thiscall CSenCredential::ValidUntil(void)
+	?Value@CSenFacet@@UAE?AVTPtrC8@@XZ @ 156 NONAME ; public: virtual class TPtrC8 __thiscall CSenFacet::Value(void)
+	?WriteAsXMLToL@CSenXmlServiceDescription@@UAEXAAVRWriteStream@@@Z @ 157 NONAME ; public: virtual void __thiscall CSenXmlServiceDescription::WriteAsXMLToL(class RWriteStream &)
+	?HasEqualPrimaryKeysL@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 158 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::HasEqualPrimaryKeysL(class MSenServiceDescription &)
+	?IsLocalL@CSenXmlServiceDescription@@UAEHXZ @ 159 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::IsLocalL(void)
+	?SetTransportCueL@CSenXmlServiceDescription@@UAEHABVTDesC8@@@Z @ 160 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::SetTransportCueL(class TDesC8 const &)
+	?TransportCue@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 161 NONAME ; public: virtual class TPtrC8 __thiscall CSenXmlServiceDescription::TransportCue(void)
+	?HasSuperClass@CSenIdentityProvider@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 162 NONAME ; public: virtual int __thiscall CSenIdentityProvider::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenServicePattern@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 163 NONAME ; public: virtual int __thiscall CSenServicePattern::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenXmlServiceDescription@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 164 NONAME ; public: virtual int __thiscall CSenXmlServiceDescription::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/BWINSCW/SenServDescU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,215 @@
+EXPORTS
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@0@Z @ 1 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?AdvisoryAuthnID@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 2 NONAME ; class TPtrC8 CSenIdentityProvider::AdvisoryAuthnID(void)
+	?SetProviderIdL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 3 NONAME ; int CSenXmlServiceDescription::SetProviderIdL(class TDesC8 const &)
+	?Id@CSenCredential@@QAEABVTDesC8@@XZ @ 4 NONAME ; class TDesC8 const & CSenCredential::Id(void)
+	?FacetsL@CSenXmlServiceDescription@@UAEHAAV?$RPointerArray@VCSenFacet@@@@@Z @ 5 NONAME ; int CSenXmlServiceDescription::FacetsL(class RPointerArray<class CSenFacet> &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@000@Z @ 6 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	??1CSenXmlServiceDescription@@UAE@XZ @ 7 NONAME ; CSenXmlServiceDescription::~CSenXmlServiceDescription(void)
+	?SetPromptUserInfoL@CSenXmlServiceDescription@@QAEXH@Z @ 8 NONAME ; void CSenXmlServiceDescription::SetPromptUserInfoL(int)
+	?IdentityProviderIds8L@CSenXmlServiceDescription@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 9 NONAME ; class CSenIdentityProviderIdArray8 const & CSenXmlServiceDescription::IdentityProviderIds8L(void)
+	??1CSenCredential2@@UAE@XZ @ 10 NONAME ; CSenCredential2::~CSenCredential2(void)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@@Z @ 11 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &)
+	?StartElementL@CSenXmlServiceDescription@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 12 NONAME ; void CSenXmlServiceDescription::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenProviderPolicy@@AAEXXZ @ 13 NONAME ; void CSenProviderPolicy::BaseConstructL(void)
+	?RebuildFrom@CSenProviderPolicy@@UAEHAAVMSenProviderPolicy@@@Z @ 14 NONAME ; int CSenProviderPolicy::RebuildFrom(class MSenProviderPolicy &)
+	?BaseConstructL@CSenCredential2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 15 NONAME ; void CSenCredential2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?FacetValue@CSenXmlServiceDescription@@UAEHAAVTDesC8@@AAPAVHBufC8@@@Z @ 16 NONAME ; int CSenXmlServiceDescription::FacetValue(class TDesC8 &, class HBufC8 * &)
+	?BaseConstructL@CSenServicePattern@@IAEXXZ @ 17 NONAME ; void CSenServicePattern::BaseConstructL(void)
+	?AuthzID@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 18 NONAME ; class TPtrC8 CSenIdentityProvider::AuthzID(void)
+	?NewLC@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 19 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenPolicy@@SAPAV1@XZ @ 20 NONAME ; class CSenPolicy * CSenPolicy::NewL(void)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@XZ @ 21 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewL(void)
+	?NewL@CSenFacet@@SAPAV1@XZ @ 22 NONAME ; class CSenFacet * CSenFacet::NewL(void)
+	?IapId@CSenXmlServiceDescription@@UAEHAAK@Z @ 23 NONAME ; int CSenXmlServiceDescription::IapId(unsigned long &)
+	?UserName@CSenIdentityProvider@@QAE?AVTPtrC8@@XZ @ 24 NONAME ; class TPtrC8 CSenIdentityProvider::UserName(void)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@@Z @ 25 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@0@Z @ 26 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenProviderPolicy@@SAPAV1@XZ @ 27 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewLC(void)
+	?NewLC@CSenIdentityProviderIdArray8@@SAPAV1@XZ @ 28 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewLC(void)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@000@Z @ 29 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenPolicy@@SAPAV1@K@Z @ 30 NONAME ; class CSenPolicy * CSenPolicy::NewL(unsigned long)
+	?Matches@CSenServicePattern@@UAEHAAVMSenServiceDescription@@@Z @ 31 NONAME ; int CSenServicePattern::Matches(class MSenServiceDescription &)
+	?SetIapIdL@CSenPolicy@@UAEXK@Z @ 32 NONAME ; void CSenPolicy::SetIapIdL(unsigned long)
+	?NewLC@CSenPolicy@@SAPAV1@KH@Z @ 33 NONAME ; class CSenPolicy * CSenPolicy::NewLC(unsigned long, int)
+	?ConstructL@CSenFacet@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 34 NONAME ; void CSenFacet::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?SetContractL@CSenXmlServiceDescription@@UAEXABVTDesC8@@@Z @ 35 NONAME ; void CSenXmlServiceDescription::SetContractL(class TDesC8 const &)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@K@Z @ 36 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewLC(unsigned long)
+	?Contract@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 37 NONAME ; class TPtrC8 CSenXmlServiceDescription::Contract(void)
+	?ConstructL@CSenXmlServiceDescription@@IAEXABVTDesC8@@@Z @ 38 NONAME ; void CSenXmlServiceDescription::ConstructL(class TDesC8 const &)
+	??0CSenXmlServiceDescription@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 39 NONAME ; CSenXmlServiceDescription::CSenXmlServiceDescription(enum MSenServiceDescription::TDescriptionClassType)
+	?SetValidUntil@CSenCredential@@QAEXAAVTTime@@@Z @ 40 NONAME ; void CSenCredential::SetValidUntil(class TTime &)
+	?NewLC@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 41 NONAME ; class CSenCredential * CSenCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXKH@Z @ 42 NONAME ; void CSenConsumerPolicy::BaseConstructL(unsigned long, int)
+	?NewLC@CSenCredential@@SAPAV1@ABV1@@Z @ 43 NONAME ; class CSenCredential * CSenCredential::NewLC(class CSenCredential const &)
+	?NewL@CSenConsumerPolicy@@SAPAV1@K@Z @ 44 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewL(unsigned long)
+	?RebuildFrom@CSenConsumerPolicy@@UAEHAAVMSenConsumerPolicy@@@Z @ 45 NONAME ; int CSenConsumerPolicy::RebuildFrom(class MSenConsumerPolicy &)
+	?Id@CSenCredential2@@UAEABVTDesC8@@XZ @ 46 NONAME ; class TDesC8 const & CSenCredential2::Id(void)
+	?IsLocalL@CSenXmlServiceDescription@@QAEHXZ @ 47 NONAME ; int CSenXmlServiceDescription::IsLocalL(void)
+	?EndElementL@CSenXmlServiceDescription@@MAEXABVTDesC8@@00@Z @ 48 NONAME ; void CSenXmlServiceDescription::EndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenCredential@@SAPAV1@ABV1@@Z @ 49 NONAME ; class CSenCredential * CSenCredential::NewL(class CSenCredential const &)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@@Z @ 50 NONAME ; void CSenPolicy::BaseConstructL(class TDesC8 const &)
+	?SetPolicyL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 51 NONAME ; int CSenXmlServiceDescription::SetPolicyL(class TDesC8 const &)
+	?HasFacetL@CSenXmlServiceDescription@@UAEHABVTDesC8@@AAH@Z @ 52 NONAME ; int CSenXmlServiceDescription::HasFacetL(class TDesC8 const &, int &)
+	?BaseConstructL@CSenCredential2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 53 NONAME ; void CSenCredential2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?SetUserInfoL@CSenIdentityProvider@@QAEHABVTDesC8@@00@Z @ 54 NONAME ; int CSenIdentityProvider::SetUserInfoL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@KH@Z @ 55 NONAME ; void CSenPolicy::BaseConstructL(class TDesC8 const &, unsigned long, int)
+	?NewL@CSenServicePattern@@SAPAV1@ABVTDesC8@@0@Z @ 56 NONAME ; class CSenServicePattern * CSenServicePattern::NewL(class TDesC8 const &, class TDesC8 const &)
+	?HttpCredentialsL@CSenIdentityProvider@@QAEPAVHBufC8@@AAVMSenIdentityManager@@@Z @ 57 NONAME ; class HBufC8 * CSenIdentityProvider::HttpCredentialsL(class MSenIdentityManager &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXABVTDesC8@@0@Z @ 58 NONAME ; void CSenXmlServiceDescription::ConstructL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@0@Z @ 59 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &, class TDesC8 const &)
+	?SetEndPointL@CSenXmlServiceDescription@@UAEXABVTDesC8@@@Z @ 60 NONAME ; void CSenXmlServiceDescription::SetEndPointL(class TDesC8 const &)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@@Z @ 61 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewL(class TDesC8 const &)
+	?SetProviderID@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 62 NONAME ; int CSenIdentityProvider::SetProviderID(class TDesC8 const &)
+	?SetConsumerIdentityProviderIdsL@CSenServicePattern@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 63 NONAME ; void CSenServicePattern::SetConsumerIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@@Z @ 64 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewLC(class TDesC8 const &)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXXZ @ 65 NONAME ; void CSenConsumerPolicy::BaseConstructL(void)
+	?NewLC@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 66 NONAME ; class CSenCredential * CSenCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?StartElementL@CSenCredential@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 67 NONAME ; void CSenCredential::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?HasEqualPrimaryKeysL@CSenXmlServiceDescription@@QAEHAAVMSenServiceDescription@@@Z @ 68 NONAME ; int CSenXmlServiceDescription::HasEqualPrimaryKeysL(class MSenServiceDescription &)
+	?Credentials@CSenXmlServiceDescription@@QAEAAV?$RPointerArray@VCSenCredential@@@@XZ @ 69 NONAME ; class RPointerArray<class CSenCredential> & CSenXmlServiceDescription::Credentials(void)
+	?NewL@CSenServicePattern@@SAPAV1@XZ @ 70 NONAME ; class CSenServicePattern * CSenServicePattern::NewL(void)
+	?SetIdL@CSenCredential2@@AAEXABVTDesC8@@@Z @ 71 NONAME ; void CSenCredential2::SetIdL(class TDesC8 const &)
+	?AccountExtensions@CSenIdentityProvider@@QAE?AVTPtrC8@@AAPAVCSenElement@@@Z @ 72 NONAME ; class TPtrC8 CSenIdentityProvider::AccountExtensions(class CSenElement * &)
+	?SetPolicyL@CSenXmlServiceDescription@@QAEHABVTDesC8@@0@Z @ 73 NONAME ; int CSenXmlServiceDescription::SetPolicyL(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenServicePattern@@SAPAV1@ABVTDesC8@@@Z @ 74 NONAME ; class CSenServicePattern * CSenServicePattern::NewLC(class TDesC8 const &)
+	?SetConsumerSnapIdL@CSenServicePattern@@QAEXK@Z @ 75 NONAME ; void CSenServicePattern::SetConsumerSnapIdL(unsigned long)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@XZ @ 76 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewLC(void)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@00@Z @ 77 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenIdentityProviderIdArray8@@SAPAV1@H@Z @ 78 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewLC(int)
+	?BaseConstructL@CSenProviderPolicy@@AAEXK@Z @ 79 NONAME ; void CSenProviderPolicy::BaseConstructL(unsigned long)
+	?NewL@CSenCredential2@@SAPAV1@XZ @ 80 NONAME ; class CSenCredential2 * CSenCredential2::NewL(void)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@KH@Z @ 81 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewLC(unsigned long, int)
+	??1CSenCredential@@UAE@XZ @ 82 NONAME ; CSenCredential::~CSenCredential(void)
+	?SnapId@CSenPolicy@@UAEHAAK@Z @ 83 NONAME ; int CSenPolicy::SnapId(unsigned long &)
+	?FrameworkVersion@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 84 NONAME ; class TPtrC8 CSenXmlServiceDescription::FrameworkVersion(void)
+	?SetTransportPropertiesL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 85 NONAME ; int CSenXmlServiceDescription::SetTransportPropertiesL(class TDesC8 const &)
+	?Name@CSenFacet@@UAE?AVTPtrC8@@XZ @ 86 NONAME ; class TPtrC8 CSenFacet::Name(void)
+	?SetSnapIdL@CSenXmlServiceDescription@@QAEXK@Z @ 87 NONAME ; void CSenXmlServiceDescription::SetSnapIdL(unsigned long)
+	??1CSenIdentityProvider@@UAE@XZ @ 88 NONAME ; CSenIdentityProvider::~CSenIdentityProvider(void)
+	?TransportPropertiesL@CSenProviderPolicy@@QAEHAAPAVHBufC8@@@Z @ 89 NONAME ; int CSenProviderPolicy::TransportPropertiesL(class HBufC8 * &)
+	?NewLC@CSenPolicy@@SAPAV1@K@Z @ 90 NONAME ; class CSenPolicy * CSenPolicy::NewLC(unsigned long)
+	?ServicePolicy@CSenXmlServiceDescription@@QAEPAVMSenServicePolicy@@XZ @ 91 NONAME ; class MSenServicePolicy * CSenXmlServiceDescription::ServicePolicy(void)
+	?ResumeParsingFromL@CSenXmlServiceDescription@@UAEXABVTDesC8@@00@Z @ 92 NONAME ; void CSenXmlServiceDescription::ResumeParsingFromL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenServicePattern@@IAEXABVTDesC8@@0@Z @ 93 NONAME ; void CSenServicePattern::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?AcceptsConsumerPolicy@CSenServicePattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 94 NONAME ; int CSenServicePattern::AcceptsConsumerPolicy(class MSenConsumerPolicy &)
+	?NewL@CSenFacet@@SAPAV1@AAVCSenElement@@@Z @ 95 NONAME ; class CSenFacet * CSenFacet::NewL(class CSenElement &)
+	?SetTransportCueL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 96 NONAME ; int CSenXmlServiceDescription::SetTransportCueL(class TDesC8 const &)
+	?Endpoint@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 97 NONAME ; class TPtrC8 CSenXmlServiceDescription::Endpoint(void)
+	?NewLC@CSenProviderPolicy@@SAPAV1@KH@Z @ 98 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewLC(unsigned long, int)
+	?ConstructL@CSenCredential@@AAEXAAV1@@Z @ 99 NONAME ; void CSenCredential::ConstructL(class CSenCredential &)
+	?ConstructL@CSenFacet@@IAEXAAVCSenElement@@@Z @ 100 NONAME ; void CSenFacet::ConstructL(class CSenElement &)
+	?ValidUntil@CSenCredential@@QAEAAVTTime@@XZ @ 101 NONAME ; class TTime & CSenCredential::ValidUntil(void)
+	?SetAccountExtensionsL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 102 NONAME ; int CSenIdentityProvider::SetAccountExtensionsL(class TDesC8 const &)
+	?SetValueL@CSenFacet@@UAEXABVTDesC8@@@Z @ 103 NONAME ; void CSenFacet::SetValueL(class TDesC8 const &)
+	?RebuildFromConsumerPolicy@CSenServicePattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 104 NONAME ; int CSenServicePattern::RebuildFromConsumerPolicy(class MSenConsumerPolicy &)
+	?Matches@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 105 NONAME ; int CSenXmlServiceDescription::Matches(class MSenServiceDescription &)
+	?ConsumerSnapId@CSenServicePattern@@QAEHAAK@Z @ 106 NONAME ; int CSenServicePattern::ConsumerSnapId(unsigned long &)
+	?IMEI@CSenIdentityProvider@@QAEABVTDesC8@@XZ @ 107 NONAME ; class TDesC8 const & CSenIdentityProvider::IMEI(void)
+	?WriteAsXMLToL@CSenXmlServiceDescription@@UAEXAAVRWriteStream@@@Z @ 108 NONAME ; void CSenXmlServiceDescription::WriteAsXMLToL(class RWriteStream &)
+	?DescriptionClassType@CSenXmlServiceDescription@@UAE?AW4TDescriptionClassType@MSenServiceDescription@@XZ @ 109 NONAME ; enum MSenServiceDescription::TDescriptionClassType CSenXmlServiceDescription::DescriptionClassType(void)
+	?NewLC@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 110 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXK@Z @ 111 NONAME ; void CSenConsumerPolicy::BaseConstructL(unsigned long)
+	?NewLC@CSenServicePattern@@SAPAV1@ABVTDesC8@@0@Z @ 112 NONAME ; class CSenServicePattern * CSenServicePattern::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?Accepts@CSenProviderPolicy@@UAEHAAVMSenProviderPolicy@@@Z @ 113 NONAME ; int CSenProviderPolicy::Accepts(class MSenProviderPolicy &)
+	?AddFacetL@CSenXmlServiceDescription@@UAEHABVCSenFacet@@@Z @ 114 NONAME ; int CSenXmlServiceDescription::AddFacetL(class CSenFacet const &)
+	?AddIdentityProviderIdL@CSenPolicy@@UAEHABVTDesC8@@@Z @ 115 NONAME ; int CSenPolicy::AddIdentityProviderIdL(class TDesC8 const &)
+	?IapId@CSenPolicy@@UAEHAAK@Z @ 116 NONAME ; int CSenPolicy::IapId(unsigned long &)
+	?NewL@CSenConsumerPolicy@@SAPAV1@KH@Z @ 117 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewL(unsigned long, int)
+	?SnapId@CSenXmlServiceDescription@@QAEHAAK@Z @ 118 NONAME ; int CSenXmlServiceDescription::SnapId(unsigned long &)
+	?NewLC@CSenProviderPolicy@@SAPAV1@K@Z @ 119 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewLC(unsigned long)
+	?Type@CSenFacet@@UAE?AVTPtrC8@@XZ @ 120 NONAME ; class TPtrC8 CSenFacet::Type(void)
+	?NewLC@CSenCredential2@@SAPAV1@XZ @ 121 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(void)
+	?NewLC@CSenCredential2@@SAPAV1@ABV1@@Z @ 122 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class CSenCredential2 const &)
+	??1CSenServicePattern@@UAE@XZ @ 123 NONAME ; CSenServicePattern::~CSenServicePattern(void)
+	?IdentityProviderIds8L@CSenPolicy@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 124 NONAME ; class CSenIdentityProviderIdArray8 const & CSenPolicy::IdentityProviderIds8L(void)
+	?SetAttributesL@CSenXmlServiceDescription@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 125 NONAME ; void CSenXmlServiceDescription::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?ProviderID@CSenIdentityProvider@@QAE?AVTPtrC8@@XZ @ 126 NONAME ; class TPtrC8 CSenIdentityProvider::ProviderID(void)
+	?NewL@CSenProviderPolicy@@SAPAV1@K@Z @ 127 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewL(unsigned long)
+	?BaseConstructL@CSenServicePattern@@IAEXABVTDesC8@@@Z @ 128 NONAME ; void CSenServicePattern::BaseConstructL(class TDesC8 const &)
+	?SetPolicyL@CSenXmlServiceDescription@@QAEHABVTDesC8@@000@Z @ 129 NONAME ; int CSenXmlServiceDescription::SetPolicyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@K@Z @ 130 NONAME ; void CSenPolicy::BaseConstructL(class TDesC8 const &, unsigned long)
+	?FrameworkId@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 131 NONAME ; class TPtrC8 CSenXmlServiceDescription::FrameworkId(void)
+	?SetNameL@CSenFacet@@UAEXABVTDesC8@@@Z @ 132 NONAME ; void CSenFacet::SetNameL(class TDesC8 const &)
+	?Password@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 133 NONAME ; class TPtrC8 CSenIdentityProvider::Password(void)
+	?IsTrustedByL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 134 NONAME ; int CSenIdentityProvider::IsTrustedByL(class TDesC8 const &)
+	??0CSenCredential2@@IAE@XZ @ 135 NONAME ; CSenCredential2::CSenCredential2(void)
+	?NewL@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 136 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenProviderPolicy@@SAPAV1@XZ @ 137 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewL(void)
+	?NewL@CSenIdentityProviderIdArray8@@SAPAV1@XZ @ 138 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewL(void)
+	?NewL@CSenProviderPolicy@@SAPAV1@KH@Z @ 139 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewL(unsigned long, int)
+	?SetTypeL@CSenFacet@@UAEXABVTDesC8@@@Z @ 140 NONAME ; void CSenFacet::SetTypeL(class TDesC8 const &)
+	?ScoreMatchL@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 141 NONAME ; int CSenXmlServiceDescription::ScoreMatchL(class MSenServiceDescription &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@@Z @ 142 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &)
+	?NewL@CSenServicePattern@@SAPAV1@ABVTDesC8@@@Z @ 143 NONAME ; class CSenServicePattern * CSenServicePattern::NewL(class TDesC8 const &)
+	?ConsumerPolicyAsXmlL@CSenServicePattern@@QAEPAVHBufC8@@XZ @ 144 NONAME ; class HBufC8 * CSenServicePattern::ConsumerPolicyAsXmlL(void)
+	??0CSenServicePattern@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 145 NONAME ; CSenServicePattern::CSenServicePattern(enum MSenServiceDescription::TDescriptionClassType)
+	?Value@CSenFacet@@UAE?AVTPtrC8@@XZ @ 146 NONAME ; class TPtrC8 CSenFacet::Value(void)
+	?ConstructL@CSenCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 147 NONAME ; void CSenCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenFacet@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 148 NONAME ; class CSenFacet * CSenFacet::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 149 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?Accepts@CSenXmlServiceDescription@@UAEHAAVMSenProviderPolicy@@@Z @ 150 NONAME ; int CSenXmlServiceDescription::Accepts(class MSenProviderPolicy &)
+	?Accepts@CSenConsumerPolicy@@UAEHAAVMSenConsumerPolicy@@@Z @ 151 NONAME ; int CSenConsumerPolicy::Accepts(class MSenConsumerPolicy &)
+	?NewL@CSenIdentityProviderIdArray8@@SAPAV1@H@Z @ 152 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewL(int)
+	?NewL@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 153 NONAME ; class CSenCredential * CSenCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 154 NONAME ; class CSenCredential * CSenCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ConsumerIdentityProviderIds8L@CSenServicePattern@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 155 NONAME ; class CSenIdentityProviderIdArray8 const & CSenServicePattern::ConsumerIdentityProviderIds8L(void)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@00@Z @ 156 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?IsStrict@CSenIdentityProviderIdArray8@@UBEHXZ @ 157 NONAME ; int CSenIdentityProviderIdArray8::IsStrict(void) const
+	?SetIdentityProviderIdsL@CSenXmlServiceDescription@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 158 NONAME ; void CSenXmlServiceDescription::SetIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?NewL@CSenCredential2@@SAPAV1@ABV1@@Z @ 159 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class CSenCredential2 const &)
+	?NewElementName@CSenXmlServiceDescription@@UAEABVTDesC8@@XZ @ 160 NONAME ; class TDesC8 const & CSenXmlServiceDescription::NewElementName(void)
+	?SetFacetL@CSenXmlServiceDescription@@UAEHABVCSenFacet@@@Z @ 161 NONAME ; int CSenXmlServiceDescription::SetFacetL(class CSenFacet const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@000@Z @ 162 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@0@Z @ 163 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &, class TDesC8 const &)
+	?AsXmlUnicodeL@CSenXmlServiceDescription@@UAEPAVHBufC16@@XZ @ 164 NONAME ; class HBufC16 * CSenXmlServiceDescription::AsXmlUnicodeL(void)
+	??0CSenCredential@@AAE@XZ @ 165 NONAME ; CSenCredential::CSenCredential(void)
+	?SetConsumerIapIdL@CSenServicePattern@@UAEXK@Z @ 166 NONAME ; void CSenServicePattern::SetConsumerIapIdL(unsigned long)
+	?NewL@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 167 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?SetValidUntil@CSenCredential2@@UAEXAAVTTime@@@Z @ 168 NONAME ; void CSenCredential2::SetValidUntil(class TTime &)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@0@Z @ 169 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenServicePattern@@SAPAV1@XZ @ 170 NONAME ; class CSenServicePattern * CSenServicePattern::NewLC(void)
+	?SetTransportPropertiesL@CSenProviderPolicy@@QAEHABVTDesC8@@@Z @ 171 NONAME ; int CSenProviderPolicy::SetTransportPropertiesL(class TDesC8 const &)
+	?SetStrict@CSenIdentityProviderIdArray8@@UAEXH@Z @ 172 NONAME ; void CSenIdentityProviderIdArray8::SetStrict(int)
+	?OnStartElementL@CSenCredential2@@MAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 173 NONAME ; void CSenCredential2::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	??0CSenIdentityProvider@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 174 NONAME ; CSenIdentityProvider::CSenIdentityProvider(enum MSenServiceDescription::TDescriptionClassType)
+	?StartElementL@CSenServicePattern@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 175 NONAME ; void CSenServicePattern::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?PromptUserInfo@CSenXmlServiceDescription@@QAEHXZ @ 176 NONAME ; int CSenXmlServiceDescription::PromptUserInfo(void)
+	??1CSenFacet@@UAE@XZ @ 177 NONAME ; CSenFacet::~CSenFacet(void)
+	??1CSenIdentityProviderIdArray8@@UAE@XZ @ 178 NONAME ; CSenIdentityProviderIdArray8::~CSenIdentityProviderIdArray8(void)
+	?ConstructL@CSenCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 179 NONAME ; void CSenCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	??0CSenFacet@@IAE@XZ @ 180 NONAME ; CSenFacet::CSenFacet(void)
+	?ConstructL@CSenFacet@@IAEXABVTDesC8@@@Z @ 181 NONAME ; void CSenFacet::ConstructL(class TDesC8 const &)
+	?NewL@CSenPolicy@@SAPAV1@KH@Z @ 182 NONAME ; class CSenPolicy * CSenPolicy::NewL(unsigned long, int)
+	?SetProviderIdL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 183 NONAME ; int CSenIdentityProvider::SetProviderIdL(class TDesC8 const &)
+	?ProviderId@CSenXmlServiceDescription@@QAE?AVTPtrC8@@XZ @ 184 NONAME ; class TPtrC8 CSenXmlServiceDescription::ProviderId(void)
+	?TransportCue@CSenXmlServiceDescription@@QAE?AVTPtrC8@@XZ @ 185 NONAME ; class TPtrC8 CSenXmlServiceDescription::TransportCue(void)
+	?BaseConstructL@CSenCredential2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 186 NONAME ; void CSenCredential2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?SetServiceID@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 187 NONAME ; int CSenIdentityProvider::SetServiceID(class TDesC8 const &)
+	?TransportPropertiesL@CSenXmlServiceDescription@@QAEHAAPAVHBufC8@@@Z @ 188 NONAME ; int CSenXmlServiceDescription::TransportPropertiesL(class HBufC8 * &)
+	?ConsumerIapId@CSenServicePattern@@UAEHAAK@Z @ 189 NONAME ; int CSenServicePattern::ConsumerIapId(unsigned long &)
+	?ValidUntil@CSenCredential2@@UAEAAVTTime@@XZ @ 190 NONAME ; class TTime & CSenCredential2::ValidUntil(void)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@00@Z @ 191 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenCredential2@@IAEXAAV1@@Z @ 192 NONAME ; void CSenCredential2::BaseConstructL(class CSenCredential2 &)
+	?AddIdentityProviderIdL@CSenXmlServiceDescription@@UAEHAAVTDesC8@@@Z @ 193 NONAME ; int CSenXmlServiceDescription::AddIdentityProviderIdL(class TDesC8 &)
+	?IsDefault@CSenIdentityProvider@@QAEHXZ @ 194 NONAME ; int CSenIdentityProvider::IsDefault(void)
+	?NewLC@CSenPolicy@@SAPAV1@XZ @ 195 NONAME ; class CSenPolicy * CSenPolicy::NewLC(void)
+	?AddConsumerIdentityProviderIdL@CSenServicePattern@@UAEHABVTDesC8@@@Z @ 196 NONAME ; int CSenServicePattern::AddConsumerIdentityProviderIdL(class TDesC8 const &)
+	?AsXmlL@CSenXmlServiceDescription@@UAEPAVHBufC8@@XZ @ 197 NONAME ; class HBufC8 * CSenXmlServiceDescription::AsXmlL(void)
+	?SetIdentityProviderIdsL@CSenPolicy@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 198 NONAME ; void CSenPolicy::SetIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?RebuildFrom@CSenPolicy@@UAEHAAVMSenPolicy@@@Z @ 199 NONAME ; int CSenPolicy::RebuildFrom(class MSenPolicy &)
+	?SetSnapIdL@CSenPolicy@@UAEXK@Z @ 200 NONAME ; void CSenPolicy::SetSnapIdL(unsigned long)
+	?NewElementName@CSenIdentityProvider@@UAEABVTDesC8@@XZ @ 201 NONAME ; class TDesC8 const & CSenIdentityProvider::NewElementName(void)
+	?NewL@CSenConsumerPolicy@@SAPAV1@XZ @ 202 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewL(void)
+	?NewL@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 203 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?RebuildFrom@CSenXmlServiceDescription@@UAEHAAVMSenProviderPolicy@@@Z @ 204 NONAME ; int CSenXmlServiceDescription::RebuildFrom(class MSenProviderPolicy &)
+	?Accepts@CSenPolicy@@UAEHAAVMSenPolicy@@@Z @ 205 NONAME ; int CSenPolicy::Accepts(class MSenPolicy &)
+	?RemoveFacet@CSenXmlServiceDescription@@UAEHABVTDesC8@@@Z @ 206 NONAME ; int CSenXmlServiceDescription::RemoveFacet(class TDesC8 const &)
+	?SetIapIdL@CSenXmlServiceDescription@@UAEXK@Z @ 207 NONAME ; void CSenXmlServiceDescription::SetIapIdL(unsigned long)
+	?IsTrustedByL@CSenIdentityProvider@@QAEHAAVMSenServiceDescription@@@Z @ 208 NONAME ; int CSenIdentityProvider::IsTrustedByL(class MSenServiceDescription &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@XZ @ 209 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewLC(void)
+	?SetFrameworkIdL@CSenXmlServiceDescription@@QAEXABVTDesC8@@@Z @ 210 NONAME ; void CSenXmlServiceDescription::SetFrameworkIdL(class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXXZ @ 211 NONAME ; void CSenXmlServiceDescription::ConstructL(void)
+	?ConstructL@CSenCredential2@@AAEXABVTDesC8@@@Z @ 212 NONAME ; void CSenCredential2::ConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenProviderPolicy@@AAEXKH@Z @ 213 NONAME ; void CSenProviderPolicy::BaseConstructL(unsigned long, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/BWINSCW/SenServDesc_V2U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,215 @@
+EXPORTS
+	??0CSenCredential@@AAE@XZ @ 1 NONAME ; CSenCredential::CSenCredential(void)
+	??0CSenFacet@@IAE@XZ @ 2 NONAME ; CSenFacet::CSenFacet(void)
+	??0CSenIdentityProvider@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 3 NONAME ; CSenIdentityProvider::CSenIdentityProvider(enum MSenServiceDescription::TDescriptionClassType)
+	??0CSenServicePattern@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 4 NONAME ; CSenServicePattern::CSenServicePattern(enum MSenServiceDescription::TDescriptionClassType)
+	??0CSenXmlServiceDescription@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 5 NONAME ; CSenXmlServiceDescription::CSenXmlServiceDescription(enum MSenServiceDescription::TDescriptionClassType)
+	??1CSenCredential@@UAE@XZ @ 6 NONAME ; CSenCredential::~CSenCredential(void)
+	??1CSenFacet@@UAE@XZ @ 7 NONAME ; CSenFacet::~CSenFacet(void)
+	??1CSenIdentityProvider@@UAE@XZ @ 8 NONAME ; CSenIdentityProvider::~CSenIdentityProvider(void)
+	??1CSenIdentityProviderIdArray8@@UAE@XZ @ 9 NONAME ; CSenIdentityProviderIdArray8::~CSenIdentityProviderIdArray8(void)
+	??1CSenServicePattern@@UAE@XZ @ 10 NONAME ; CSenServicePattern::~CSenServicePattern(void)
+	??1CSenXmlServiceDescription@@UAE@XZ @ 11 NONAME ; CSenXmlServiceDescription::~CSenXmlServiceDescription(void)
+	?Accepts@CSenConsumerPolicy@@UAEHAAVMSenConsumerPolicy@@@Z @ 12 NONAME ; int CSenConsumerPolicy::Accepts(class MSenConsumerPolicy &)
+	?Accepts@CSenPolicy@@UAEHAAVMSenPolicy@@@Z @ 13 NONAME ; int CSenPolicy::Accepts(class MSenPolicy &)
+	?Accepts@CSenProviderPolicy@@UAEHAAVMSenProviderPolicy@@@Z @ 14 NONAME ; int CSenProviderPolicy::Accepts(class MSenProviderPolicy &)
+	?Accepts@CSenXmlServiceDescription@@UAEHAAVMSenProviderPolicy@@@Z @ 15 NONAME ; int CSenXmlServiceDescription::Accepts(class MSenProviderPolicy &)
+	?AcceptsConsumerPolicy@CSenServicePattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 16 NONAME ; int CSenServicePattern::AcceptsConsumerPolicy(class MSenConsumerPolicy &)
+	?AddConsumerIdentityProviderIdL@CSenServicePattern@@UAEHABVTDesC8@@@Z @ 17 NONAME ; int CSenServicePattern::AddConsumerIdentityProviderIdL(class TDesC8 const &)
+	?AddFacetL@CSenXmlServiceDescription@@UAEHABVCSenFacet@@@Z @ 18 NONAME ; int CSenXmlServiceDescription::AddFacetL(class CSenFacet const &)
+	?AddIdentityProviderIdL@CSenPolicy@@UAEHABVTDesC8@@@Z @ 19 NONAME ; int CSenPolicy::AddIdentityProviderIdL(class TDesC8 const &)
+	?AddIdentityProviderIdL@CSenXmlServiceDescription@@UAEHAAVTDesC8@@@Z @ 20 NONAME ; int CSenXmlServiceDescription::AddIdentityProviderIdL(class TDesC8 &)
+	?AdvisoryAuthnID@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 21 NONAME ; class TPtrC8 CSenIdentityProvider::AdvisoryAuthnID(void)
+	?AsXmlL@CSenXmlServiceDescription@@UAEPAVHBufC8@@XZ @ 22 NONAME ; class HBufC8 * CSenXmlServiceDescription::AsXmlL(void)
+	?AsXmlUnicodeL@CSenXmlServiceDescription@@UAEPAVHBufC16@@XZ @ 23 NONAME ; class HBufC16 * CSenXmlServiceDescription::AsXmlUnicodeL(void)
+	?AuthzID@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 24 NONAME ; class TPtrC8 CSenIdentityProvider::AuthzID(void)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXK@Z @ 25 NONAME ; void CSenConsumerPolicy::BaseConstructL(unsigned long)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXXZ @ 26 NONAME ; void CSenConsumerPolicy::BaseConstructL(void)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@@Z @ 27 NONAME ; void CSenPolicy::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@K@Z @ 28 NONAME ; void CSenPolicy::BaseConstructL(class TDesC8 const &, unsigned long)
+	?BaseConstructL@CSenProviderPolicy@@AAEXK@Z @ 29 NONAME ; void CSenProviderPolicy::BaseConstructL(unsigned long)
+	?BaseConstructL@CSenProviderPolicy@@AAEXXZ @ 30 NONAME ; void CSenProviderPolicy::BaseConstructL(void)
+	?BaseConstructL@CSenServicePattern@@IAEXABVTDesC8@@0@Z @ 31 NONAME ; void CSenServicePattern::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenServicePattern@@IAEXABVTDesC8@@@Z @ 32 NONAME ; void CSenServicePattern::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenServicePattern@@IAEXXZ @ 33 NONAME ; void CSenServicePattern::BaseConstructL(void)
+	?ConstructL@CSenCredential@@AAEXAAV1@@Z @ 34 NONAME ; void CSenCredential::ConstructL(class CSenCredential &)
+	?ConstructL@CSenCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 35 NONAME ; void CSenCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ConstructL@CSenCredential@@AAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 36 NONAME ; void CSenCredential::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?ConstructL@CSenFacet@@IAEXAAVCSenElement@@@Z @ 37 NONAME ; void CSenFacet::ConstructL(class CSenElement &)
+	?ConstructL@CSenFacet@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 38 NONAME ; void CSenFacet::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ConstructL@CSenFacet@@IAEXABVTDesC8@@@Z @ 39 NONAME ; void CSenFacet::ConstructL(class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@000@Z @ 40 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@00@Z @ 41 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@0@Z @ 42 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &, class TDesC8 const &)
+	?ConstructL@CSenIdentityProvider@@IAEXABVTDesC8@@@Z @ 43 NONAME ; void CSenIdentityProvider::ConstructL(class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXABVTDesC8@@0@Z @ 44 NONAME ; void CSenXmlServiceDescription::ConstructL(class TDesC8 const &, class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXABVTDesC8@@@Z @ 45 NONAME ; void CSenXmlServiceDescription::ConstructL(class TDesC8 const &)
+	?ConstructL@CSenXmlServiceDescription@@IAEXXZ @ 46 NONAME ; void CSenXmlServiceDescription::ConstructL(void)
+	?ConsumerIapId@CSenServicePattern@@UAEHAAK@Z @ 47 NONAME ; int CSenServicePattern::ConsumerIapId(unsigned long &)
+	?ConsumerIdentityProviderIds8L@CSenServicePattern@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 48 NONAME ; class CSenIdentityProviderIdArray8 const & CSenServicePattern::ConsumerIdentityProviderIds8L(void)
+	?ConsumerPolicyAsXmlL@CSenServicePattern@@QAEPAVHBufC8@@XZ @ 49 NONAME ; class HBufC8 * CSenServicePattern::ConsumerPolicyAsXmlL(void)
+	?Contract@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 50 NONAME ; class TPtrC8 CSenXmlServiceDescription::Contract(void)
+	?Credentials@CSenXmlServiceDescription@@QAEAAV?$RPointerArray@VCSenCredential@@@@XZ @ 51 NONAME ; class RPointerArray<class CSenCredential> & CSenXmlServiceDescription::Credentials(void)
+	?DescriptionClassType@CSenXmlServiceDescription@@UAE?AW4TDescriptionClassType@MSenServiceDescription@@XZ @ 52 NONAME ; enum MSenServiceDescription::TDescriptionClassType CSenXmlServiceDescription::DescriptionClassType(void)
+	?EndElementL@CSenXmlServiceDescription@@MAEXABVTDesC8@@00@Z @ 53 NONAME ; void CSenXmlServiceDescription::EndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?Endpoint@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 54 NONAME ; class TPtrC8 CSenXmlServiceDescription::Endpoint(void)
+	?FacetValue@CSenXmlServiceDescription@@UAEHAAVTDesC8@@AAPAVHBufC8@@@Z @ 55 NONAME ; int CSenXmlServiceDescription::FacetValue(class TDesC8 &, class HBufC8 * &)
+	?FacetsL@CSenXmlServiceDescription@@UAEHAAV?$RPointerArray@VCSenFacet@@@@@Z @ 56 NONAME ; int CSenXmlServiceDescription::FacetsL(class RPointerArray<class CSenFacet> &)
+	?FrameworkId@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 57 NONAME ; class TPtrC8 CSenXmlServiceDescription::FrameworkId(void)
+	?FrameworkVersion@CSenXmlServiceDescription@@UAE?AVTPtrC8@@XZ @ 58 NONAME ; class TPtrC8 CSenXmlServiceDescription::FrameworkVersion(void)
+	?HasFacetL@CSenXmlServiceDescription@@UAEHABVTDesC8@@AAH@Z @ 59 NONAME ; int CSenXmlServiceDescription::HasFacetL(class TDesC8 const &, int &)
+	?HttpCredentialsL@CSenIdentityProvider@@QAEPAVHBufC8@@AAVMSenIdentityManager@@@Z @ 60 NONAME ; class HBufC8 * CSenIdentityProvider::HttpCredentialsL(class MSenIdentityManager &)
+	?IMEI@CSenIdentityProvider@@QAEABVTDesC8@@XZ @ 61 NONAME ; class TDesC8 const & CSenIdentityProvider::IMEI(void)
+	?IapId@CSenPolicy@@UAEHAAK@Z @ 62 NONAME ; int CSenPolicy::IapId(unsigned long &)
+	?IapId@CSenXmlServiceDescription@@UAEHAAK@Z @ 63 NONAME ; int CSenXmlServiceDescription::IapId(unsigned long &)
+	?Id@CSenCredential@@QAEABVTDesC8@@XZ @ 64 NONAME ; class TDesC8 const & CSenCredential::Id(void)
+	?IdentityProviderIds8L@CSenPolicy@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 65 NONAME ; class CSenIdentityProviderIdArray8 const & CSenPolicy::IdentityProviderIds8L(void)
+	?IdentityProviderIds8L@CSenXmlServiceDescription@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 66 NONAME ; class CSenIdentityProviderIdArray8 const & CSenXmlServiceDescription::IdentityProviderIds8L(void)
+	?IsDefault@CSenIdentityProvider@@QAEHXZ @ 67 NONAME ; int CSenIdentityProvider::IsDefault(void)
+	?IsStrict@CSenIdentityProviderIdArray8@@UBEHXZ @ 68 NONAME ; int CSenIdentityProviderIdArray8::IsStrict(void) const
+	?IsTrustedByL@CSenIdentityProvider@@QAEHAAVMSenServiceDescription@@@Z @ 69 NONAME ; int CSenIdentityProvider::IsTrustedByL(class MSenServiceDescription &)
+	?IsTrustedByL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 70 NONAME ; int CSenIdentityProvider::IsTrustedByL(class TDesC8 const &)
+	?Matches@CSenServicePattern@@UAEHAAVMSenServiceDescription@@@Z @ 71 NONAME ; int CSenServicePattern::Matches(class MSenServiceDescription &)
+	?Matches@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 72 NONAME ; int CSenXmlServiceDescription::Matches(class MSenServiceDescription &)
+	?Name@CSenFacet@@UAE?AVTPtrC8@@XZ @ 73 NONAME ; class TPtrC8 CSenFacet::Name(void)
+	?NewElementName@CSenIdentityProvider@@UAEABVTDesC8@@XZ @ 74 NONAME ; class TDesC8 const & CSenIdentityProvider::NewElementName(void)
+	?NewElementName@CSenXmlServiceDescription@@UAEABVTDesC8@@XZ @ 75 NONAME ; class TDesC8 const & CSenXmlServiceDescription::NewElementName(void)
+	?NewL@CSenConsumerPolicy@@SAPAV1@K@Z @ 76 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewL(unsigned long)
+	?NewL@CSenConsumerPolicy@@SAPAV1@XZ @ 77 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewL(void)
+	?NewL@CSenCredential@@SAPAV1@ABV1@@Z @ 78 NONAME ; class CSenCredential * CSenCredential::NewL(class CSenCredential const &)
+	?NewL@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 79 NONAME ; class CSenCredential * CSenCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 80 NONAME ; class CSenCredential * CSenCredential::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenFacet@@SAPAV1@AAVCSenElement@@@Z @ 81 NONAME ; class CSenFacet * CSenFacet::NewL(class CSenElement &)
+	?NewL@CSenFacet@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 82 NONAME ; class CSenFacet * CSenFacet::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenFacet@@SAPAV1@XZ @ 83 NONAME ; class CSenFacet * CSenFacet::NewL(void)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@000@Z @ 84 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@00@Z @ 85 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@0@Z @ 86 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@@Z @ 87 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewL(class TDesC8 const &)
+	?NewL@CSenIdentityProviderIdArray8@@SAPAV1@H@Z @ 88 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewL(int)
+	?NewL@CSenIdentityProviderIdArray8@@SAPAV1@XZ @ 89 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewL(void)
+	?NewL@CSenPolicy@@SAPAV1@K@Z @ 90 NONAME ; class CSenPolicy * CSenPolicy::NewL(unsigned long)
+	?NewL@CSenPolicy@@SAPAV1@XZ @ 91 NONAME ; class CSenPolicy * CSenPolicy::NewL(void)
+	?NewL@CSenProviderPolicy@@SAPAV1@K@Z @ 92 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewL(unsigned long)
+	?NewL@CSenProviderPolicy@@SAPAV1@XZ @ 93 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewL(void)
+	?NewL@CSenServicePattern@@SAPAV1@ABVTDesC8@@0@Z @ 94 NONAME ; class CSenServicePattern * CSenServicePattern::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenServicePattern@@SAPAV1@ABVTDesC8@@@Z @ 95 NONAME ; class CSenServicePattern * CSenServicePattern::NewL(class TDesC8 const &)
+	?NewL@CSenServicePattern@@SAPAV1@XZ @ 96 NONAME ; class CSenServicePattern * CSenServicePattern::NewL(void)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@0@Z @ 97 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@@Z @ 98 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewL(class TDesC8 const &)
+	?NewL@CSenXmlServiceDescription@@SAPAV1@XZ @ 99 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewL(void)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@K@Z @ 100 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewLC(unsigned long)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@XZ @ 101 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewLC(void)
+	?NewLC@CSenCredential@@SAPAV1@ABV1@@Z @ 102 NONAME ; class CSenCredential * CSenCredential::NewLC(class CSenCredential const &)
+	?NewLC@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 103 NONAME ; class CSenCredential * CSenCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenCredential@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 104 NONAME ; class CSenCredential * CSenCredential::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@000@Z @ 105 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@00@Z @ 106 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@0@Z @ 107 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenIdentityProvider@@SAPAV1@ABVTDesC8@@@Z @ 108 NONAME ; class CSenIdentityProvider * CSenIdentityProvider::NewLC(class TDesC8 const &)
+	?NewLC@CSenIdentityProviderIdArray8@@SAPAV1@H@Z @ 109 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewLC(int)
+	?NewLC@CSenIdentityProviderIdArray8@@SAPAV1@XZ @ 110 NONAME ; class CSenIdentityProviderIdArray8 * CSenIdentityProviderIdArray8::NewLC(void)
+	?NewLC@CSenPolicy@@SAPAV1@K@Z @ 111 NONAME ; class CSenPolicy * CSenPolicy::NewLC(unsigned long)
+	?NewLC@CSenPolicy@@SAPAV1@XZ @ 112 NONAME ; class CSenPolicy * CSenPolicy::NewLC(void)
+	?NewLC@CSenProviderPolicy@@SAPAV1@K@Z @ 113 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewLC(unsigned long)
+	?NewLC@CSenProviderPolicy@@SAPAV1@XZ @ 114 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewLC(void)
+	?NewLC@CSenServicePattern@@SAPAV1@ABVTDesC8@@0@Z @ 115 NONAME ; class CSenServicePattern * CSenServicePattern::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenServicePattern@@SAPAV1@ABVTDesC8@@@Z @ 116 NONAME ; class CSenServicePattern * CSenServicePattern::NewLC(class TDesC8 const &)
+	?NewLC@CSenServicePattern@@SAPAV1@XZ @ 117 NONAME ; class CSenServicePattern * CSenServicePattern::NewLC(void)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@0@Z @ 118 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@ABVTDesC8@@@Z @ 119 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewLC(class TDesC8 const &)
+	?NewLC@CSenXmlServiceDescription@@SAPAV1@XZ @ 120 NONAME ; class CSenXmlServiceDescription * CSenXmlServiceDescription::NewLC(void)
+	?Password@CSenIdentityProvider@@UAE?AVTPtrC8@@XZ @ 121 NONAME ; class TPtrC8 CSenIdentityProvider::Password(void)
+	?ProviderID@CSenIdentityProvider@@QAE?AVTPtrC8@@XZ @ 122 NONAME ; class TPtrC8 CSenIdentityProvider::ProviderID(void)
+	?RebuildFrom@CSenConsumerPolicy@@UAEHAAVMSenConsumerPolicy@@@Z @ 123 NONAME ; int CSenConsumerPolicy::RebuildFrom(class MSenConsumerPolicy &)
+	?RebuildFrom@CSenPolicy@@UAEHAAVMSenPolicy@@@Z @ 124 NONAME ; int CSenPolicy::RebuildFrom(class MSenPolicy &)
+	?RebuildFrom@CSenProviderPolicy@@UAEHAAVMSenProviderPolicy@@@Z @ 125 NONAME ; int CSenProviderPolicy::RebuildFrom(class MSenProviderPolicy &)
+	?RebuildFrom@CSenXmlServiceDescription@@UAEHAAVMSenProviderPolicy@@@Z @ 126 NONAME ; int CSenXmlServiceDescription::RebuildFrom(class MSenProviderPolicy &)
+	?RebuildFromConsumerPolicy@CSenServicePattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 127 NONAME ; int CSenServicePattern::RebuildFromConsumerPolicy(class MSenConsumerPolicy &)
+	?RemoveFacet@CSenXmlServiceDescription@@UAEHABVTDesC8@@@Z @ 128 NONAME ; int CSenXmlServiceDescription::RemoveFacet(class TDesC8 const &)
+	?ResumeParsingFromL@CSenXmlServiceDescription@@UAEXABVTDesC8@@00@Z @ 129 NONAME ; void CSenXmlServiceDescription::ResumeParsingFromL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?ScoreMatchL@CSenXmlServiceDescription@@UAEHAAVMSenServiceDescription@@@Z @ 130 NONAME ; int CSenXmlServiceDescription::ScoreMatchL(class MSenServiceDescription &)
+	?SetAttributesL@CSenXmlServiceDescription@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 131 NONAME ; void CSenXmlServiceDescription::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetConsumerIapIdL@CSenServicePattern@@UAEXK@Z @ 132 NONAME ; void CSenServicePattern::SetConsumerIapIdL(unsigned long)
+	?SetConsumerIdentityProviderIdsL@CSenServicePattern@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 133 NONAME ; void CSenServicePattern::SetConsumerIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetContractL@CSenXmlServiceDescription@@UAEXABVTDesC8@@@Z @ 134 NONAME ; void CSenXmlServiceDescription::SetContractL(class TDesC8 const &)
+	?SetEndPointL@CSenXmlServiceDescription@@UAEXABVTDesC8@@@Z @ 135 NONAME ; void CSenXmlServiceDescription::SetEndPointL(class TDesC8 const &)
+	?SetFacetL@CSenXmlServiceDescription@@UAEHABVCSenFacet@@@Z @ 136 NONAME ; int CSenXmlServiceDescription::SetFacetL(class CSenFacet const &)
+	?SetFrameworkIdL@CSenXmlServiceDescription@@QAEXABVTDesC8@@@Z @ 137 NONAME ; void CSenXmlServiceDescription::SetFrameworkIdL(class TDesC8 const &)
+	?SetIapIdL@CSenPolicy@@UAEXK@Z @ 138 NONAME ; void CSenPolicy::SetIapIdL(unsigned long)
+	?SetIapIdL@CSenXmlServiceDescription@@UAEXK@Z @ 139 NONAME ; void CSenXmlServiceDescription::SetIapIdL(unsigned long)
+	?SetIdentityProviderIdsL@CSenPolicy@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 140 NONAME ; void CSenPolicy::SetIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetIdentityProviderIdsL@CSenXmlServiceDescription@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 141 NONAME ; void CSenXmlServiceDescription::SetIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetNameL@CSenFacet@@UAEXABVTDesC8@@@Z @ 142 NONAME ; void CSenFacet::SetNameL(class TDesC8 const &)
+	?SetProviderID@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 143 NONAME ; int CSenIdentityProvider::SetProviderID(class TDesC8 const &)
+	?SetServiceID@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 144 NONAME ; int CSenIdentityProvider::SetServiceID(class TDesC8 const &)
+	?SetStrict@CSenIdentityProviderIdArray8@@UAEXH@Z @ 145 NONAME ; void CSenIdentityProviderIdArray8::SetStrict(int)
+	?SetTypeL@CSenFacet@@UAEXABVTDesC8@@@Z @ 146 NONAME ; void CSenFacet::SetTypeL(class TDesC8 const &)
+	?SetUserInfoL@CSenIdentityProvider@@QAEHABVTDesC8@@00@Z @ 147 NONAME ; int CSenIdentityProvider::SetUserInfoL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetValidUntil@CSenCredential@@QAEXAAVTTime@@@Z @ 148 NONAME ; void CSenCredential::SetValidUntil(class TTime &)
+	?SetValueL@CSenFacet@@UAEXABVTDesC8@@@Z @ 149 NONAME ; void CSenFacet::SetValueL(class TDesC8 const &)
+	?StartElementL@CSenCredential@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 150 NONAME ; void CSenCredential::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenServicePattern@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 151 NONAME ; void CSenServicePattern::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenXmlServiceDescription@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 152 NONAME ; void CSenXmlServiceDescription::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?Type@CSenFacet@@UAE?AVTPtrC8@@XZ @ 153 NONAME ; class TPtrC8 CSenFacet::Type(void)
+	?UserName@CSenIdentityProvider@@QAE?AVTPtrC8@@XZ @ 154 NONAME ; class TPtrC8 CSenIdentityProvider::UserName(void)
+	?ValidUntil@CSenCredential@@QAEAAVTTime@@XZ @ 155 NONAME ; class TTime & CSenCredential::ValidUntil(void)
+	?Value@CSenFacet@@UAE?AVTPtrC8@@XZ @ 156 NONAME ; class TPtrC8 CSenFacet::Value(void)
+	?WriteAsXMLToL@CSenXmlServiceDescription@@UAEXAAVRWriteStream@@@Z @ 157 NONAME ; void CSenXmlServiceDescription::WriteAsXMLToL(class RWriteStream &)
+	??0CSenCredential2@@IAE@XZ @ 158 NONAME ; CSenCredential2::CSenCredential2(void)
+	??1CSenCredential2@@UAE@XZ @ 159 NONAME ; CSenCredential2::~CSenCredential2(void)
+	?BaseConstructL@CSenCredential2@@IAEXAAV1@@Z @ 160 NONAME ; void CSenCredential2::BaseConstructL(class CSenCredential2 &)
+	?BaseConstructL@CSenCredential2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 161 NONAME ; void CSenCredential2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenCredential2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 162 NONAME ; void CSenCredential2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?BaseConstructL@CSenCredential2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 163 NONAME ; void CSenCredential2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?ConstructL@CSenCredential2@@AAEXABVTDesC8@@@Z @ 164 NONAME ; void CSenCredential2::ConstructL(class TDesC8 const &)
+	?HasEqualPrimaryKeysL@CSenXmlServiceDescription@@QAEHAAVMSenServiceDescription@@@Z @ 165 NONAME ; int CSenXmlServiceDescription::HasEqualPrimaryKeysL(class MSenServiceDescription &)
+	?Id@CSenCredential2@@UAEABVTDesC8@@XZ @ 166 NONAME ; class TDesC8 const & CSenCredential2::Id(void)
+	?IsLocalL@CSenXmlServiceDescription@@QAEHXZ @ 167 NONAME ; int CSenXmlServiceDescription::IsLocalL(void)
+	?NewL@CSenCredential2@@SAPAV1@ABV1@@Z @ 168 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class CSenCredential2 const &)
+	?NewL@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 169 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 170 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 171 NONAME ; class CSenCredential2 * CSenCredential2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenCredential2@@SAPAV1@XZ @ 172 NONAME ; class CSenCredential2 * CSenCredential2::NewL(void)
+	?NewLC@CSenCredential2@@SAPAV1@ABV1@@Z @ 173 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class CSenCredential2 const &)
+	?NewLC@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 174 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewLC@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 175 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewLC@CSenCredential2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 176 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewLC@CSenCredential2@@SAPAV1@XZ @ 177 NONAME ; class CSenCredential2 * CSenCredential2::NewLC(void)
+	?OnStartElementL@CSenCredential2@@MAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 178 NONAME ; void CSenCredential2::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?PromptUserInfo@CSenXmlServiceDescription@@QAEHXZ @ 179 NONAME ; int CSenXmlServiceDescription::PromptUserInfo(void)
+	?ProviderId@CSenXmlServiceDescription@@QAE?AVTPtrC8@@XZ @ 180 NONAME ; class TPtrC8 CSenXmlServiceDescription::ProviderId(void)
+	?ServicePolicy@CSenXmlServiceDescription@@QAEPAVMSenServicePolicy@@XZ @ 181 NONAME ; class MSenServicePolicy * CSenXmlServiceDescription::ServicePolicy(void)
+	?SetIdL@CSenCredential2@@AAEXABVTDesC8@@@Z @ 182 NONAME ; void CSenCredential2::SetIdL(class TDesC8 const &)
+	?SetPolicyL@CSenXmlServiceDescription@@QAEHABVTDesC8@@000@Z @ 183 NONAME ; int CSenXmlServiceDescription::SetPolicyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetPolicyL@CSenXmlServiceDescription@@QAEHABVTDesC8@@0@Z @ 184 NONAME ; int CSenXmlServiceDescription::SetPolicyL(class TDesC8 const &, class TDesC8 const &)
+	?SetPolicyL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 185 NONAME ; int CSenXmlServiceDescription::SetPolicyL(class TDesC8 const &)
+	?SetPromptUserInfoL@CSenXmlServiceDescription@@QAEXH@Z @ 186 NONAME ; void CSenXmlServiceDescription::SetPromptUserInfoL(int)
+	?SetProviderIdL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 187 NONAME ; int CSenIdentityProvider::SetProviderIdL(class TDesC8 const &)
+	?SetProviderIdL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 188 NONAME ; int CSenXmlServiceDescription::SetProviderIdL(class TDesC8 const &)
+	?SetTransportCueL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 189 NONAME ; int CSenXmlServiceDescription::SetTransportCueL(class TDesC8 const &)
+	?SetValidUntil@CSenCredential2@@UAEXAAVTTime@@@Z @ 190 NONAME ; void CSenCredential2::SetValidUntil(class TTime &)
+	?TransportCue@CSenXmlServiceDescription@@QAE?AVTPtrC8@@XZ @ 191 NONAME ; class TPtrC8 CSenXmlServiceDescription::TransportCue(void)
+	?ValidUntil@CSenCredential2@@UAEAAVTTime@@XZ @ 192 NONAME ; class TTime & CSenCredential2::ValidUntil(void)
+	?BaseConstructL@CSenConsumerPolicy@@AAEXKH@Z @ 193 NONAME ; void CSenConsumerPolicy::BaseConstructL(unsigned long, int)
+	?BaseConstructL@CSenPolicy@@IAEXABVTDesC8@@KH@Z @ 194 NONAME ; void CSenPolicy::BaseConstructL(class TDesC8 const &, unsigned long, int)
+	?BaseConstructL@CSenProviderPolicy@@AAEXKH@Z @ 195 NONAME ; void CSenProviderPolicy::BaseConstructL(unsigned long, int)
+	?ConsumerSnapId@CSenServicePattern@@QAEHAAK@Z @ 196 NONAME ; int CSenServicePattern::ConsumerSnapId(unsigned long &)
+	?NewL@CSenConsumerPolicy@@SAPAV1@KH@Z @ 197 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewL(unsigned long, int)
+	?NewL@CSenPolicy@@SAPAV1@KH@Z @ 198 NONAME ; class CSenPolicy * CSenPolicy::NewL(unsigned long, int)
+	?NewL@CSenProviderPolicy@@SAPAV1@KH@Z @ 199 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewL(unsigned long, int)
+	?NewLC@CSenConsumerPolicy@@SAPAV1@KH@Z @ 200 NONAME ; class CSenConsumerPolicy * CSenConsumerPolicy::NewLC(unsigned long, int)
+	?NewLC@CSenPolicy@@SAPAV1@KH@Z @ 201 NONAME ; class CSenPolicy * CSenPolicy::NewLC(unsigned long, int)
+	?NewLC@CSenProviderPolicy@@SAPAV1@KH@Z @ 202 NONAME ; class CSenProviderPolicy * CSenProviderPolicy::NewLC(unsigned long, int)
+	?SetConsumerSnapIdL@CSenServicePattern@@QAEXK@Z @ 203 NONAME ; void CSenServicePattern::SetConsumerSnapIdL(unsigned long)
+	?SetSnapIdL@CSenPolicy@@UAEXK@Z @ 204 NONAME ; void CSenPolicy::SetSnapIdL(unsigned long)
+	?SetSnapIdL@CSenXmlServiceDescription@@QAEXK@Z @ 205 NONAME ; void CSenXmlServiceDescription::SetSnapIdL(unsigned long)
+	?SnapId@CSenPolicy@@UAEHAAK@Z @ 206 NONAME ; int CSenPolicy::SnapId(unsigned long &)
+	?SnapId@CSenXmlServiceDescription@@QAEHAAK@Z @ 207 NONAME ; int CSenXmlServiceDescription::SnapId(unsigned long &)
+	?AccountExtensions@CSenIdentityProvider@@QAE?AVTPtrC8@@AAPAVCSenElement@@@Z @ 208 NONAME ; class TPtrC8 CSenIdentityProvider::AccountExtensions(class CSenElement * &)
+	?SetAccountExtensionsL@CSenIdentityProvider@@QAEHABVTDesC8@@@Z @ 209 NONAME ; int CSenIdentityProvider::SetAccountExtensionsL(class TDesC8 const &)
+	?SetTransportPropertiesL@CSenProviderPolicy@@QAEHABVTDesC8@@@Z @ 210 NONAME ; int CSenProviderPolicy::SetTransportPropertiesL(class TDesC8 const &)
+	?SetTransportPropertiesL@CSenXmlServiceDescription@@QAEHABVTDesC8@@@Z @ 211 NONAME ; int CSenXmlServiceDescription::SetTransportPropertiesL(class TDesC8 const &)
+	?TransportPropertiesL@CSenProviderPolicy@@QAEHAAPAVHBufC8@@@Z @ 212 NONAME ; int CSenProviderPolicy::TransportPropertiesL(class HBufC8 * &)
+	?TransportPropertiesL@CSenXmlServiceDescription@@QAEHAAPAVHBufC8@@@Z @ 213 NONAME ; int CSenXmlServiceDescription::TransportPropertiesL(class HBufC8 * &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/eabi/SenServDesc_V2U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,311 @@
+EXPORTS
+	_ZN10CSenPolicy11RebuildFromER10MSenPolicy @ 1 NONAME
+	_ZN10CSenPolicy14BaseConstructLERK6TDesC8 @ 2 NONAME
+	_ZN10CSenPolicy14BaseConstructLERK6TDesC8m @ 3 NONAME
+	_ZN10CSenPolicy21IdentityProviderIds8LEv @ 4 NONAME
+	_ZN10CSenPolicy22AddIdentityProviderIdLERK6TDesC8 @ 5 NONAME
+	_ZN10CSenPolicy23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 6 NONAME
+	_ZN10CSenPolicy4NewLEm @ 7 NONAME
+	_ZN10CSenPolicy4NewLEv @ 8 NONAME
+	_ZN10CSenPolicy5IapIdERm @ 9 NONAME
+	_ZN10CSenPolicy5NewLCEm @ 10 NONAME
+	_ZN10CSenPolicy5NewLCEv @ 11 NONAME
+	_ZN10CSenPolicy7AcceptsER10MSenPolicy @ 12 NONAME
+	_ZN10CSenPolicy9SetIapIdLEm @ 13 NONAME
+	_ZN14CSenCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 14 NONAME
+	_ZN14CSenCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 15 NONAME
+	_ZN14CSenCredential10ConstructLERS_ @ 16 NONAME
+	_ZN14CSenCredential10ValidUntilEv @ 17 NONAME
+	_ZN14CSenCredential13SetValidUntilER5TTime @ 18 NONAME
+	_ZN14CSenCredential13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 19 NONAME
+	_ZN14CSenCredential2IdEv @ 20 NONAME
+	_ZN14CSenCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 21 NONAME
+	_ZN14CSenCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 22 NONAME
+	_ZN14CSenCredential4NewLERKS_ @ 23 NONAME
+	_ZN14CSenCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 24 NONAME
+	_ZN14CSenCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 25 NONAME
+	_ZN14CSenCredential5NewLCERKS_ @ 26 NONAME
+	_ZN14CSenCredentialC1Ev @ 27 NONAME
+	_ZN14CSenCredentialC2Ev @ 28 NONAME
+	_ZN14CSenCredentialD0Ev @ 29 NONAME
+	_ZN14CSenCredentialD1Ev @ 30 NONAME
+	_ZN14CSenCredentialD2Ev @ 31 NONAME
+	_ZN18CSenConsumerPolicy11RebuildFromER18MSenConsumerPolicy @ 32 NONAME
+	_ZN18CSenConsumerPolicy14BaseConstructLEm @ 33 NONAME
+	_ZN18CSenConsumerPolicy14BaseConstructLEv @ 34 NONAME
+	_ZN18CSenConsumerPolicy4NewLEm @ 35 NONAME
+	_ZN18CSenConsumerPolicy4NewLEv @ 36 NONAME
+	_ZN18CSenConsumerPolicy5NewLCEm @ 37 NONAME
+	_ZN18CSenConsumerPolicy5NewLCEv @ 38 NONAME
+	_ZN18CSenConsumerPolicy7AcceptsER18MSenConsumerPolicy @ 39 NONAME
+	_ZN18CSenProviderPolicy11RebuildFromER18MSenProviderPolicy @ 40 NONAME
+	_ZN18CSenProviderPolicy14BaseConstructLEm @ 41 NONAME
+	_ZN18CSenProviderPolicy14BaseConstructLEv @ 42 NONAME
+	_ZN18CSenProviderPolicy4NewLEm @ 43 NONAME
+	_ZN18CSenProviderPolicy4NewLEv @ 44 NONAME
+	_ZN18CSenProviderPolicy5NewLCEm @ 45 NONAME
+	_ZN18CSenProviderPolicy5NewLCEv @ 46 NONAME
+	_ZN18CSenProviderPolicy7AcceptsER18MSenProviderPolicy @ 47 NONAME
+	_ZN18CSenServicePattern13ConsumerIapIdERm @ 48 NONAME
+	_ZN18CSenServicePattern13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 49 NONAME
+	_ZN18CSenServicePattern14BaseConstructLERK6TDesC8 @ 50 NONAME
+	_ZN18CSenServicePattern14BaseConstructLERK6TDesC8S2_ @ 51 NONAME
+	_ZN18CSenServicePattern14BaseConstructLEv @ 52 NONAME
+	_ZN18CSenServicePattern17SetConsumerIapIdLEm @ 53 NONAME
+	_ZN18CSenServicePattern20ConsumerPolicyAsXmlLEv @ 54 NONAME
+	_ZN18CSenServicePattern21AcceptsConsumerPolicyER18MSenConsumerPolicy @ 55 NONAME
+	_ZN18CSenServicePattern25RebuildFromConsumerPolicyER18MSenConsumerPolicy @ 56 NONAME
+	_ZN18CSenServicePattern29ConsumerIdentityProviderIds8LEv @ 57 NONAME
+	_ZN18CSenServicePattern30AddConsumerIdentityProviderIdLERK6TDesC8 @ 58 NONAME
+	_ZN18CSenServicePattern31SetConsumerIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 59 NONAME
+	_ZN18CSenServicePattern4NewLERK6TDesC8 @ 60 NONAME
+	_ZN18CSenServicePattern4NewLERK6TDesC8S2_ @ 61 NONAME
+	_ZN18CSenServicePattern4NewLEv @ 62 NONAME
+	_ZN18CSenServicePattern5NewLCERK6TDesC8 @ 63 NONAME
+	_ZN18CSenServicePattern5NewLCERK6TDesC8S2_ @ 64 NONAME
+	_ZN18CSenServicePattern5NewLCEv @ 65 NONAME
+	_ZN18CSenServicePattern7MatchesER22MSenServiceDescription @ 66 NONAME
+	_ZN18CSenServicePatternC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 67 NONAME
+	_ZN18CSenServicePatternC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 68 NONAME
+	_ZN18CSenServicePatternD0Ev @ 69 NONAME
+	_ZN18CSenServicePatternD1Ev @ 70 NONAME
+	_ZN18CSenServicePatternD2Ev @ 71 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8 @ 72 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8S2_ @ 73 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8S2_S2_ @ 74 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8S2_S2_S2_ @ 75 NONAME
+	_ZN20CSenIdentityProvider10ProviderIDEv @ 76 NONAME
+	_ZN20CSenIdentityProvider12SetUserInfoLERK6TDesC8S2_S2_ @ 77 NONAME
+	_ZN20CSenIdentityProvider12IsTrustedByLER22MSenServiceDescription @ 78 NONAME
+	_ZN20CSenIdentityProvider12IsTrustedByLERK6TDesC8 @ 79 NONAME
+	_ZN20CSenIdentityProvider12SetServiceIDERK6TDesC8 @ 80 NONAME
+	_ZN20CSenIdentityProvider13SetProviderIDERK6TDesC8 @ 81 NONAME
+	_ZN20CSenIdentityProvider14NewElementNameEv @ 82 NONAME
+	_ZN20CSenIdentityProvider15AdvisoryAuthnIDEv @ 83 NONAME
+	_ZN20CSenIdentityProvider16HttpCredentialsLER19MSenIdentityManager @ 84 NONAME
+	_ZN20CSenIdentityProvider4IMEIEv @ 85 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8 @ 86 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8S2_ @ 87 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8S2_S2_ @ 88 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8S2_S2_S2_ @ 89 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8 @ 90 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8S2_ @ 91 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8S2_S2_ @ 92 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8S2_S2_S2_ @ 93 NONAME
+	_ZN20CSenIdentityProvider7AuthzIDEv @ 94 NONAME
+	_ZN20CSenIdentityProvider8PasswordEv @ 95 NONAME
+	_ZN20CSenIdentityProvider8UserNameEv @ 96 NONAME
+	_ZN20CSenIdentityProvider9IsDefaultEv @ 97 NONAME
+	_ZN20CSenIdentityProviderC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 98 NONAME
+	_ZN20CSenIdentityProviderC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 99 NONAME
+	_ZN20CSenIdentityProviderD0Ev @ 100 NONAME
+	_ZN20CSenIdentityProviderD1Ev @ 101 NONAME
+	_ZN20CSenIdentityProviderD2Ev @ 102 NONAME
+	_ZN25CSenXmlServiceDescription10ConstructLERK6TDesC8S2_ @ 103 NONAME
+	_ZN25CSenXmlServiceDescription10ConstructLEv @ 104 NONAME
+	_ZN25CSenXmlServiceDescription10FacetValueER6TDesC8RP6HBufC8 @ 105 NONAME
+	_ZN25CSenXmlServiceDescription11ScoreMatchLER22MSenServiceDescription @ 106 NONAME
+	_ZN25CSenXmlServiceDescription11CredentialsEv @ 107 NONAME
+	_ZN25CSenXmlServiceDescription11EndElementLERK6TDesC8S2_S2_ @ 108 NONAME
+	_ZN25CSenXmlServiceDescription11FrameworkIdEv @ 109 NONAME
+	_ZN25CSenXmlServiceDescription11RebuildFromER18MSenProviderPolicy @ 110 NONAME
+	_ZN25CSenXmlServiceDescription11RemoveFacetERK6TDesC8 @ 111 NONAME
+	_ZN25CSenXmlServiceDescription12SetContractLERK6TDesC8 @ 112 NONAME
+	_ZN25CSenXmlServiceDescription12SetEndPointLERK6TDesC8 @ 113 NONAME
+	_ZN25CSenXmlServiceDescription13AsXmlUnicodeLEv @ 114 NONAME
+	_ZN25CSenXmlServiceDescription13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 115 NONAME
+	_ZN25CSenXmlServiceDescription13WriteAsXMLToLER12RWriteStream @ 116 NONAME
+	_ZN25CSenXmlServiceDescription14NewElementNameEv @ 117 NONAME
+	_ZN25CSenXmlServiceDescription14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 118 NONAME
+	_ZN25CSenXmlServiceDescription15SetFrameworkIdLERK6TDesC8 @ 119 NONAME
+	_ZN25CSenXmlServiceDescription16FrameworkVersionEv @ 120 NONAME
+	_ZN25CSenXmlServiceDescription18ResumeParsingFromLERK6TDesC8S2_S2_ @ 121 NONAME
+	_ZN25CSenXmlServiceDescription20DescriptionClassTypeEv @ 122 NONAME
+	_ZN25CSenXmlServiceDescription21IdentityProviderIds8LEv @ 123 NONAME
+	_ZN25CSenXmlServiceDescription22AddIdentityProviderIdLER6TDesC8 @ 124 NONAME
+	_ZN25CSenXmlServiceDescription23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 125 NONAME
+	_ZN25CSenXmlServiceDescription4NewLERK6TDesC8 @ 126 NONAME
+	_ZN25CSenXmlServiceDescription4NewLERK6TDesC8S2_ @ 127 NONAME
+	_ZN25CSenXmlServiceDescription4NewLEv @ 128 NONAME
+	_ZN25CSenXmlServiceDescription5IapIdERm @ 129 NONAME
+	_ZN25CSenXmlServiceDescription5NewLCERK6TDesC8 @ 130 NONAME
+	_ZN25CSenXmlServiceDescription5NewLCERK6TDesC8S2_ @ 131 NONAME
+	_ZN25CSenXmlServiceDescription5NewLCEv @ 132 NONAME
+	_ZN25CSenXmlServiceDescription6AsXmlLEv @ 133 NONAME
+	_ZN25CSenXmlServiceDescription7AcceptsER18MSenProviderPolicy @ 134 NONAME
+	_ZN25CSenXmlServiceDescription7FacetsLER13RPointerArrayI9CSenFacetE @ 135 NONAME
+	_ZN25CSenXmlServiceDescription7MatchesER22MSenServiceDescription @ 136 NONAME
+	_ZN25CSenXmlServiceDescription8ContractEv @ 137 NONAME
+	_ZN25CSenXmlServiceDescription8EndpointEv @ 138 NONAME
+	_ZN25CSenXmlServiceDescription9HasFacetLERK6TDesC8Ri @ 139 NONAME
+	_ZN25CSenXmlServiceDescription9AddFacetLERK9CSenFacet @ 140 NONAME
+	_ZN25CSenXmlServiceDescription9SetFacetLERK9CSenFacet @ 141 NONAME
+	_ZN25CSenXmlServiceDescription9SetIapIdLEm @ 142 NONAME
+	_ZN25CSenXmlServiceDescriptionC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 143 NONAME
+	_ZN25CSenXmlServiceDescriptionC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 144 NONAME
+	_ZN25CSenXmlServiceDescriptionD0Ev @ 145 NONAME
+	_ZN25CSenXmlServiceDescriptionD1Ev @ 146 NONAME
+	_ZN25CSenXmlServiceDescriptionD2Ev @ 147 NONAME
+	_ZN28CSenIdentityProviderIdArray84NewLEi @ 148 NONAME
+	_ZN28CSenIdentityProviderIdArray84NewLEv @ 149 NONAME
+	_ZN28CSenIdentityProviderIdArray85NewLCEi @ 150 NONAME
+	_ZN28CSenIdentityProviderIdArray85NewLCEv @ 151 NONAME
+	_ZN28CSenIdentityProviderIdArray89SetStrictEi @ 152 NONAME
+	_ZN28CSenIdentityProviderIdArray8D0Ev @ 153 NONAME
+	_ZN28CSenIdentityProviderIdArray8D1Ev @ 154 NONAME
+	_ZN28CSenIdentityProviderIdArray8D2Ev @ 155 NONAME
+	_ZN9CSenFacet10ConstructLER11CSenElement @ 156 NONAME
+	_ZN9CSenFacet10ConstructLERK6TDesC8 @ 157 NONAME
+	_ZN9CSenFacet10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 158 NONAME
+	_ZN9CSenFacet4NameEv @ 159 NONAME
+	_ZN9CSenFacet4NewLER11CSenElement @ 160 NONAME
+	_ZN9CSenFacet4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 161 NONAME
+	_ZN9CSenFacet4NewLEv @ 162 NONAME
+	_ZN9CSenFacet4TypeEv @ 163 NONAME
+	_ZN9CSenFacet5ValueEv @ 164 NONAME
+	_ZN9CSenFacet8SetNameLERK6TDesC8 @ 165 NONAME
+	_ZN9CSenFacet8SetTypeLERK6TDesC8 @ 166 NONAME
+	_ZN9CSenFacet9SetValueLERK6TDesC8 @ 167 NONAME
+	_ZN9CSenFacetC1Ev @ 168 NONAME
+	_ZN9CSenFacetC2Ev @ 169 NONAME
+	_ZN9CSenFacetD0Ev @ 170 NONAME
+	_ZN9CSenFacetD1Ev @ 171 NONAME
+	_ZN9CSenFacetD2Ev @ 172 NONAME
+	_ZNK28CSenIdentityProviderIdArray88IsStrictEv @ 173 NONAME
+	_ZTI10CSenPolicy @ 174 NONAME ; #<TI>#
+	_ZTI14CSenCredential @ 175 NONAME ; #<TI>#
+	_ZTI18CSenConsumerPolicy @ 176 NONAME ; #<TI>#
+	_ZTI18CSenProviderPolicy @ 177 NONAME ; #<TI>#
+	_ZTI18CSenServicePattern @ 178 NONAME ; #<TI>#
+	_ZTI20CSenIdentityProvider @ 179 NONAME ; #<TI>#
+	_ZTI25CSenXmlServiceDescription @ 180 NONAME ; #<TI>#
+	_ZTI28CSenIdentityProviderIdArray8 @ 181 NONAME ; #<TI>#
+	_ZTI9CSenFacet @ 182 NONAME ; #<TI>#
+	_ZTV10CSenPolicy @ 183 NONAME ; #<VT>#
+	_ZTV14CSenCredential @ 184 NONAME ; #<VT>#
+	_ZTV18CSenConsumerPolicy @ 185 NONAME ; #<VT>#
+	_ZTV18CSenProviderPolicy @ 186 NONAME ; #<VT>#
+	_ZTV18CSenServicePattern @ 187 NONAME ; #<VT>#
+	_ZTV20CSenIdentityProvider @ 188 NONAME ; #<VT>#
+	_ZTV25CSenXmlServiceDescription @ 189 NONAME ; #<VT>#
+	_ZTV28CSenIdentityProviderIdArray8 @ 190 NONAME ; #<VT>#
+	_ZTV9CSenFacet @ 191 NONAME ; #<VT>#
+	_ZThn104_N10CSenPolicy11RebuildFromER10MSenPolicy @ 192 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy21IdentityProviderIds8LEv @ 193 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy22AddIdentityProviderIdLERK6TDesC8 @ 194 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 195 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy5IapIdERm @ 196 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy7AcceptsER10MSenPolicy @ 197 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy9SetIapIdLEm @ 198 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServicePattern7MatchesER22MSenServiceDescription @ 199 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription10FacetValueER6TDesC8RP6HBufC8 @ 200 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription11ScoreMatchLER22MSenServiceDescription @ 201 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription11FrameworkIdEv @ 202 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription11RemoveFacetERK6TDesC8 @ 203 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription12SetContractLERK6TDesC8 @ 204 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription12SetEndPointLERK6TDesC8 @ 205 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription13AsXmlUnicodeLEv @ 206 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription13WriteAsXMLToLER12RWriteStream @ 207 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription16FrameworkVersionEv @ 208 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription20DescriptionClassTypeEv @ 209 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription6AsXmlLEv @ 210 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription7FacetsLER13RPointerArrayI9CSenFacetE @ 211 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription7MatchesER22MSenServiceDescription @ 212 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription8ContractEv @ 213 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription8EndpointEv @ 214 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription9HasFacetLERK6TDesC8Ri @ 215 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription9AddFacetLERK9CSenFacet @ 216 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription9SetFacetLERK9CSenFacet @ 217 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription11RebuildFromER18MSenProviderPolicy @ 218 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription21IdentityProviderIds8LEv @ 219 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription22AddIdentityProviderIdLER6TDesC8 @ 220 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 221 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription5IapIdERm @ 222 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription7AcceptsER18MSenProviderPolicy @ 223 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription9SetIapIdLEm @ 224 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern13ConsumerIapIdERm @ 225 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern17SetConsumerIapIdLEm @ 226 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern21AcceptsConsumerPolicyER18MSenConsumerPolicy @ 227 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern25RebuildFromConsumerPolicyER18MSenConsumerPolicy @ 228 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern29ConsumerIdentityProviderIds8LEv @ 229 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern30AddConsumerIdentityProviderIdLERK6TDesC8 @ 230 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern31SetConsumerIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 231 NONAME ; #<thunk>#
+	_ZThn24_N28CSenIdentityProviderIdArray8D0Ev @ 232 NONAME ; #<thunk>#
+	_ZThn24_N28CSenIdentityProviderIdArray8D1Ev @ 233 NONAME ; #<thunk>#
+	_ZThn28_N28CSenIdentityProviderIdArray89SetStrictEi @ 234 NONAME ; #<thunk>#
+	_ZThn28_NK28CSenIdentityProviderIdArray88IsStrictEv @ 235 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription13AsXmlUnicodeLEv @ 236 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription13WriteAsXMLToLER12RWriteStream @ 237 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 238 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription18ResumeParsingFromLERK6TDesC8S2_S2_ @ 239 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription6AsXmlLEv @ 240 NONAME ; #<thunk>#
+	_ZN15CSenCredential210ConstructLERK6TDesC8 @ 241 NONAME
+	_ZN15CSenCredential210ValidUntilEv @ 242 NONAME
+	_ZN15CSenCredential213SetValidUntilER5TTime @ 243 NONAME
+	_ZN15CSenCredential214BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 244 NONAME
+	_ZN15CSenCredential214BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 245 NONAME
+	_ZN15CSenCredential214BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 246 NONAME
+	_ZN15CSenCredential214BaseConstructLERS_ @ 247 NONAME
+	_ZN15CSenCredential215OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 248 NONAME
+	_ZN15CSenCredential22IdEv @ 249 NONAME
+	_ZN15CSenCredential24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 250 NONAME
+	_ZN15CSenCredential24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 251 NONAME
+	_ZN15CSenCredential24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 252 NONAME
+	_ZN15CSenCredential24NewLERKS_ @ 253 NONAME
+	_ZN15CSenCredential24NewLEv @ 254 NONAME
+	_ZN15CSenCredential25NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 255 NONAME
+	_ZN15CSenCredential25NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 256 NONAME
+	_ZN15CSenCredential25NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 257 NONAME
+	_ZN15CSenCredential25NewLCERKS_ @ 258 NONAME
+	_ZN15CSenCredential25NewLCEv @ 259 NONAME
+	_ZN15CSenCredential26SetIdLERK6TDesC8 @ 260 NONAME
+	_ZN15CSenCredential2C1Ev @ 261 NONAME
+	_ZN15CSenCredential2C2Ev @ 262 NONAME
+	_ZN15CSenCredential2D0Ev @ 263 NONAME
+	_ZN15CSenCredential2D1Ev @ 264 NONAME
+	_ZN15CSenCredential2D2Ev @ 265 NONAME
+	_ZN20CSenIdentityProvider14SetProviderIdLERK6TDesC8 @ 266 NONAME
+	_ZN25CSenXmlServiceDescription10ProviderIdEv @ 267 NONAME
+	_ZN25CSenXmlServiceDescription10SetPolicyLERK6TDesC8 @ 268 NONAME
+	_ZN25CSenXmlServiceDescription10SetPolicyLERK6TDesC8S2_ @ 269 NONAME
+	_ZN25CSenXmlServiceDescription10SetPolicyLERK6TDesC8S2_S2_S2_ @ 270 NONAME
+	_ZN25CSenXmlServiceDescription12TransportCueEv @ 271 NONAME
+	_ZN25CSenXmlServiceDescription13ServicePolicyEv @ 272 NONAME
+	_ZN25CSenXmlServiceDescription14PromptUserInfoEv @ 273 NONAME
+	_ZN25CSenXmlServiceDescription14SetProviderIdLERK6TDesC8 @ 274 NONAME
+	_ZN25CSenXmlServiceDescription16SetTransportCueLERK6TDesC8 @ 275 NONAME
+	_ZN25CSenXmlServiceDescription18SetPromptUserInfoLEi @ 276 NONAME
+	_ZN25CSenXmlServiceDescription20HasEqualPrimaryKeysLER22MSenServiceDescription @ 277 NONAME
+	_ZN25CSenXmlServiceDescription8IsLocalLEv @ 278 NONAME
+	_ZTI14CServicePolicy @ 279 NONAME ; #<TI>#
+	_ZTI15CSenCredential2 @ 280 NONAME ; #<TI>#
+	_ZTI17CSenServicePolicy @ 281 NONAME ; #<TI>#
+	_ZTV14CServicePolicy @ 282 NONAME ; #<VT>#
+	_ZTV15CSenCredential2 @ 283 NONAME ; #<VT>#
+	_ZTV17CSenServicePolicy @ 284 NONAME ; #<VT>#
+	_ZThn4_N15CSenCredential215OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 285 NONAME ; #<thunk>#
+	_ZN25CSenXmlServiceDescription10ConstructLERK6TDesC8 @ 286 NONAME
+	_ZN10CSenPolicy10SetSnapIdLEm @ 287 NONAME
+	_ZN10CSenPolicy14BaseConstructLERK6TDesC8mi @ 288 NONAME
+	_ZN10CSenPolicy4NewLEmi @ 289 NONAME
+	_ZN10CSenPolicy5NewLCEmi @ 290 NONAME
+	_ZN10CSenPolicy6SnapIdERm @ 291 NONAME
+	_ZN18CSenConsumerPolicy14BaseConstructLEmi @ 292 NONAME
+	_ZN18CSenConsumerPolicy4NewLEmi @ 293 NONAME
+	_ZN18CSenConsumerPolicy5NewLCEmi @ 294 NONAME
+	_ZN18CSenProviderPolicy14BaseConstructLEmi @ 295 NONAME
+	_ZN18CSenProviderPolicy4NewLEmi @ 296 NONAME
+	_ZN18CSenProviderPolicy5NewLCEmi @ 297 NONAME
+	_ZN18CSenServicePattern14ConsumerSnapIdERm @ 298 NONAME
+	_ZN18CSenServicePattern18SetConsumerSnapIdLEm @ 299 NONAME
+	_ZN25CSenXmlServiceDescription10SetSnapIdLEm @ 300 NONAME
+	_ZN25CSenXmlServiceDescription6SnapIdERm @ 301 NONAME
+	_ZThn104_N10CSenPolicy10SetSnapIdLEm @ 302 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy6SnapIdERm @ 303 NONAME ; #<thunk>#
+	_ZN18CSenProviderPolicy20TransportPropertiesLERP6HBufC8 @ 304 NONAME
+	_ZN18CSenProviderPolicy23SetTransportPropertiesLERK6TDesC8 @ 305 NONAME
+	_ZN20CSenIdentityProvider17AccountExtensionsERP11CSenElement @ 306 NONAME
+	_ZN20CSenIdentityProvider21SetAccountExtensionsLERK6TDesC8 @ 307 NONAME
+	_ZN25CSenXmlServiceDescription20TransportPropertiesLERP6HBufC8 @ 308 NONAME
+	_ZN25CSenXmlServiceDescription23SetTransportPropertiesLERK6TDesC8 @ 309 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/eabi/SenServDescu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,311 @@
+EXPORTS
+	_ZN10CSenPolicy11RebuildFromER10MSenPolicy @ 1 NONAME
+	_ZN10CSenPolicy14BaseConstructLERK6TDesC8 @ 2 NONAME
+	_ZN10CSenPolicy14BaseConstructLERK6TDesC8m @ 3 NONAME
+	_ZN10CSenPolicy21IdentityProviderIds8LEv @ 4 NONAME
+	_ZN10CSenPolicy22AddIdentityProviderIdLERK6TDesC8 @ 5 NONAME
+	_ZN10CSenPolicy23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 6 NONAME
+	_ZN10CSenPolicy4NewLEm @ 7 NONAME
+	_ZN10CSenPolicy4NewLEv @ 8 NONAME
+	_ZN10CSenPolicy5IapIdERm @ 9 NONAME
+	_ZN10CSenPolicy5NewLCEm @ 10 NONAME
+	_ZN10CSenPolicy5NewLCEv @ 11 NONAME
+	_ZN10CSenPolicy7AcceptsER10MSenPolicy @ 12 NONAME
+	_ZN10CSenPolicy9SetIapIdLEm @ 13 NONAME
+	_ZN14CSenCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 14 NONAME
+	_ZN14CSenCredential10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 15 NONAME
+	_ZN14CSenCredential10ConstructLERS_ @ 16 NONAME
+	_ZN14CSenCredential10ValidUntilEv @ 17 NONAME
+	_ZN14CSenCredential13SetValidUntilER5TTime @ 18 NONAME
+	_ZN14CSenCredential13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 19 NONAME
+	_ZN14CSenCredential2IdEv @ 20 NONAME
+	_ZN14CSenCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 21 NONAME
+	_ZN14CSenCredential4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 22 NONAME
+	_ZN14CSenCredential4NewLERKS_ @ 23 NONAME
+	_ZN14CSenCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 24 NONAME
+	_ZN14CSenCredential5NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 25 NONAME
+	_ZN14CSenCredential5NewLCERKS_ @ 26 NONAME
+	_ZN14CSenCredentialC1Ev @ 27 NONAME
+	_ZN14CSenCredentialC2Ev @ 28 NONAME
+	_ZN14CSenCredentialD0Ev @ 29 NONAME
+	_ZN14CSenCredentialD1Ev @ 30 NONAME
+	_ZN14CSenCredentialD2Ev @ 31 NONAME
+	_ZN18CSenConsumerPolicy11RebuildFromER18MSenConsumerPolicy @ 32 NONAME
+	_ZN18CSenConsumerPolicy14BaseConstructLEm @ 33 NONAME
+	_ZN18CSenConsumerPolicy14BaseConstructLEv @ 34 NONAME
+	_ZN18CSenConsumerPolicy4NewLEm @ 35 NONAME
+	_ZN18CSenConsumerPolicy4NewLEv @ 36 NONAME
+	_ZN18CSenConsumerPolicy5NewLCEm @ 37 NONAME
+	_ZN18CSenConsumerPolicy5NewLCEv @ 38 NONAME
+	_ZN18CSenConsumerPolicy7AcceptsER18MSenConsumerPolicy @ 39 NONAME
+	_ZN18CSenProviderPolicy11RebuildFromER18MSenProviderPolicy @ 40 NONAME
+	_ZN18CSenProviderPolicy14BaseConstructLEm @ 41 NONAME
+	_ZN18CSenProviderPolicy14BaseConstructLEv @ 42 NONAME
+	_ZN18CSenProviderPolicy4NewLEm @ 43 NONAME
+	_ZN18CSenProviderPolicy4NewLEv @ 44 NONAME
+	_ZN18CSenProviderPolicy5NewLCEm @ 45 NONAME
+	_ZN18CSenProviderPolicy5NewLCEv @ 46 NONAME
+	_ZN18CSenProviderPolicy7AcceptsER18MSenProviderPolicy @ 47 NONAME
+	_ZN18CSenServicePattern13ConsumerIapIdERm @ 48 NONAME
+	_ZN18CSenServicePattern13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 49 NONAME
+	_ZN18CSenServicePattern14BaseConstructLERK6TDesC8 @ 50 NONAME
+	_ZN18CSenServicePattern14BaseConstructLERK6TDesC8S2_ @ 51 NONAME
+	_ZN18CSenServicePattern14BaseConstructLEv @ 52 NONAME
+	_ZN18CSenServicePattern17SetConsumerIapIdLEm @ 53 NONAME
+	_ZN18CSenServicePattern20ConsumerPolicyAsXmlLEv @ 54 NONAME
+	_ZN18CSenServicePattern21AcceptsConsumerPolicyER18MSenConsumerPolicy @ 55 NONAME
+	_ZN18CSenServicePattern25RebuildFromConsumerPolicyER18MSenConsumerPolicy @ 56 NONAME
+	_ZN18CSenServicePattern29ConsumerIdentityProviderIds8LEv @ 57 NONAME
+	_ZN18CSenServicePattern30AddConsumerIdentityProviderIdLERK6TDesC8 @ 58 NONAME
+	_ZN18CSenServicePattern31SetConsumerIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 59 NONAME
+	_ZN18CSenServicePattern4NewLERK6TDesC8 @ 60 NONAME
+	_ZN18CSenServicePattern4NewLERK6TDesC8S2_ @ 61 NONAME
+	_ZN18CSenServicePattern4NewLEv @ 62 NONAME
+	_ZN18CSenServicePattern5NewLCERK6TDesC8 @ 63 NONAME
+	_ZN18CSenServicePattern5NewLCERK6TDesC8S2_ @ 64 NONAME
+	_ZN18CSenServicePattern5NewLCEv @ 65 NONAME
+	_ZN18CSenServicePattern7MatchesER22MSenServiceDescription @ 66 NONAME
+	_ZN18CSenServicePatternC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 67 NONAME
+	_ZN18CSenServicePatternC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 68 NONAME
+	_ZN18CSenServicePatternD0Ev @ 69 NONAME
+	_ZN18CSenServicePatternD1Ev @ 70 NONAME
+	_ZN18CSenServicePatternD2Ev @ 71 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8 @ 72 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8S2_ @ 73 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8S2_S2_ @ 74 NONAME
+	_ZN20CSenIdentityProvider10ConstructLERK6TDesC8S2_S2_S2_ @ 75 NONAME
+	_ZN20CSenIdentityProvider10ProviderIDEv @ 76 NONAME
+	_ZN20CSenIdentityProvider12SetUserInfoLERK6TDesC8S2_S2_ @ 77 NONAME
+	_ZN20CSenIdentityProvider12IsTrustedByLER22MSenServiceDescription @ 78 NONAME
+	_ZN20CSenIdentityProvider12IsTrustedByLERK6TDesC8 @ 79 NONAME
+	_ZN20CSenIdentityProvider12SetServiceIDERK6TDesC8 @ 80 NONAME
+	_ZN20CSenIdentityProvider13SetProviderIDERK6TDesC8 @ 81 NONAME
+	_ZN20CSenIdentityProvider14NewElementNameEv @ 82 NONAME
+	_ZN20CSenIdentityProvider15AdvisoryAuthnIDEv @ 83 NONAME
+	_ZN20CSenIdentityProvider16HttpCredentialsLER19MSenIdentityManager @ 84 NONAME
+	_ZN20CSenIdentityProvider4IMEIEv @ 85 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8 @ 86 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8S2_ @ 87 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8S2_S2_ @ 88 NONAME
+	_ZN20CSenIdentityProvider4NewLERK6TDesC8S2_S2_S2_ @ 89 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8 @ 90 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8S2_ @ 91 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8S2_S2_ @ 92 NONAME
+	_ZN20CSenIdentityProvider5NewLCERK6TDesC8S2_S2_S2_ @ 93 NONAME
+	_ZN20CSenIdentityProvider7AuthzIDEv @ 94 NONAME
+	_ZN20CSenIdentityProvider8PasswordEv @ 95 NONAME
+	_ZN20CSenIdentityProvider8UserNameEv @ 96 NONAME
+	_ZN20CSenIdentityProvider9IsDefaultEv @ 97 NONAME
+	_ZN20CSenIdentityProviderC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 98 NONAME
+	_ZN20CSenIdentityProviderC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 99 NONAME
+	_ZN20CSenIdentityProviderD0Ev @ 100 NONAME
+	_ZN20CSenIdentityProviderD1Ev @ 101 NONAME
+	_ZN20CSenIdentityProviderD2Ev @ 102 NONAME
+	_ZN25CSenXmlServiceDescription10ConstructLERK6TDesC8S2_ @ 103 NONAME
+	_ZN25CSenXmlServiceDescription10ConstructLEv @ 104 NONAME
+	_ZN25CSenXmlServiceDescription10FacetValueER6TDesC8RP6HBufC8 @ 105 NONAME
+	_ZN25CSenXmlServiceDescription11ScoreMatchLER22MSenServiceDescription @ 106 NONAME
+	_ZN25CSenXmlServiceDescription11CredentialsEv @ 107 NONAME
+	_ZN25CSenXmlServiceDescription11EndElementLERK6TDesC8S2_S2_ @ 108 NONAME
+	_ZN25CSenXmlServiceDescription11FrameworkIdEv @ 109 NONAME
+	_ZN25CSenXmlServiceDescription11RebuildFromER18MSenProviderPolicy @ 110 NONAME
+	_ZN25CSenXmlServiceDescription11RemoveFacetERK6TDesC8 @ 111 NONAME
+	_ZN25CSenXmlServiceDescription12SetContractLERK6TDesC8 @ 112 NONAME
+	_ZN25CSenXmlServiceDescription12SetEndPointLERK6TDesC8 @ 113 NONAME
+	_ZN25CSenXmlServiceDescription13AsXmlUnicodeLEv @ 114 NONAME
+	_ZN25CSenXmlServiceDescription13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 115 NONAME
+	_ZN25CSenXmlServiceDescription13WriteAsXMLToLER12RWriteStream @ 116 NONAME
+	_ZN25CSenXmlServiceDescription14NewElementNameEv @ 117 NONAME
+	_ZN25CSenXmlServiceDescription14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 118 NONAME
+	_ZN25CSenXmlServiceDescription15SetFrameworkIdLERK6TDesC8 @ 119 NONAME
+	_ZN25CSenXmlServiceDescription16FrameworkVersionEv @ 120 NONAME
+	_ZN25CSenXmlServiceDescription18ResumeParsingFromLERK6TDesC8S2_S2_ @ 121 NONAME
+	_ZN25CSenXmlServiceDescription20DescriptionClassTypeEv @ 122 NONAME
+	_ZN25CSenXmlServiceDescription21IdentityProviderIds8LEv @ 123 NONAME
+	_ZN25CSenXmlServiceDescription22AddIdentityProviderIdLER6TDesC8 @ 124 NONAME
+	_ZN25CSenXmlServiceDescription23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 125 NONAME
+	_ZN25CSenXmlServiceDescription4NewLERK6TDesC8 @ 126 NONAME
+	_ZN25CSenXmlServiceDescription4NewLERK6TDesC8S2_ @ 127 NONAME
+	_ZN25CSenXmlServiceDescription4NewLEv @ 128 NONAME
+	_ZN25CSenXmlServiceDescription5IapIdERm @ 129 NONAME
+	_ZN25CSenXmlServiceDescription5NewLCERK6TDesC8 @ 130 NONAME
+	_ZN25CSenXmlServiceDescription5NewLCERK6TDesC8S2_ @ 131 NONAME
+	_ZN25CSenXmlServiceDescription5NewLCEv @ 132 NONAME
+	_ZN25CSenXmlServiceDescription6AsXmlLEv @ 133 NONAME
+	_ZN25CSenXmlServiceDescription7AcceptsER18MSenProviderPolicy @ 134 NONAME
+	_ZN25CSenXmlServiceDescription7FacetsLER13RPointerArrayI9CSenFacetE @ 135 NONAME
+	_ZN25CSenXmlServiceDescription7MatchesER22MSenServiceDescription @ 136 NONAME
+	_ZN25CSenXmlServiceDescription8ContractEv @ 137 NONAME
+	_ZN25CSenXmlServiceDescription8EndpointEv @ 138 NONAME
+	_ZN25CSenXmlServiceDescription9HasFacetLERK6TDesC8Ri @ 139 NONAME
+	_ZN25CSenXmlServiceDescription9AddFacetLERK9CSenFacet @ 140 NONAME
+	_ZN25CSenXmlServiceDescription9SetFacetLERK9CSenFacet @ 141 NONAME
+	_ZN25CSenXmlServiceDescription9SetIapIdLEm @ 142 NONAME
+	_ZN25CSenXmlServiceDescriptionC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 143 NONAME
+	_ZN25CSenXmlServiceDescriptionC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 144 NONAME
+	_ZN25CSenXmlServiceDescriptionD0Ev @ 145 NONAME
+	_ZN25CSenXmlServiceDescriptionD1Ev @ 146 NONAME
+	_ZN25CSenXmlServiceDescriptionD2Ev @ 147 NONAME
+	_ZN28CSenIdentityProviderIdArray84NewLEi @ 148 NONAME
+	_ZN28CSenIdentityProviderIdArray84NewLEv @ 149 NONAME
+	_ZN28CSenIdentityProviderIdArray85NewLCEi @ 150 NONAME
+	_ZN28CSenIdentityProviderIdArray85NewLCEv @ 151 NONAME
+	_ZN28CSenIdentityProviderIdArray89SetStrictEi @ 152 NONAME
+	_ZN28CSenIdentityProviderIdArray8D0Ev @ 153 NONAME
+	_ZN28CSenIdentityProviderIdArray8D1Ev @ 154 NONAME
+	_ZN28CSenIdentityProviderIdArray8D2Ev @ 155 NONAME
+	_ZN9CSenFacet10ConstructLER11CSenElement @ 156 NONAME
+	_ZN9CSenFacet10ConstructLERK6TDesC8 @ 157 NONAME
+	_ZN9CSenFacet10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 158 NONAME
+	_ZN9CSenFacet4NameEv @ 159 NONAME
+	_ZN9CSenFacet4NewLER11CSenElement @ 160 NONAME
+	_ZN9CSenFacet4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 161 NONAME
+	_ZN9CSenFacet4NewLEv @ 162 NONAME
+	_ZN9CSenFacet4TypeEv @ 163 NONAME
+	_ZN9CSenFacet5ValueEv @ 164 NONAME
+	_ZN9CSenFacet8SetNameLERK6TDesC8 @ 165 NONAME
+	_ZN9CSenFacet8SetTypeLERK6TDesC8 @ 166 NONAME
+	_ZN9CSenFacet9SetValueLERK6TDesC8 @ 167 NONAME
+	_ZN9CSenFacetC1Ev @ 168 NONAME
+	_ZN9CSenFacetC2Ev @ 169 NONAME
+	_ZN9CSenFacetD0Ev @ 170 NONAME
+	_ZN9CSenFacetD1Ev @ 171 NONAME
+	_ZN9CSenFacetD2Ev @ 172 NONAME
+	_ZNK28CSenIdentityProviderIdArray88IsStrictEv @ 173 NONAME
+	_ZTI10CSenPolicy @ 174 NONAME ; #<TI>#
+	_ZTI14CSenCredential @ 175 NONAME ; #<TI>#
+	_ZTI18CSenConsumerPolicy @ 176 NONAME ; #<TI>#
+	_ZTI18CSenProviderPolicy @ 177 NONAME ; #<TI>#
+	_ZTI18CSenServicePattern @ 178 NONAME ; #<TI>#
+	_ZTI20CSenIdentityProvider @ 179 NONAME ; #<TI>#
+	_ZTI25CSenXmlServiceDescription @ 180 NONAME ; #<TI>#
+	_ZTI28CSenIdentityProviderIdArray8 @ 181 NONAME ; #<TI>#
+	_ZTI9CSenFacet @ 182 NONAME ; #<TI>#
+	_ZTV10CSenPolicy @ 183 NONAME ; #<VT>#
+	_ZTV14CSenCredential @ 184 NONAME ; #<VT>#
+	_ZTV18CSenConsumerPolicy @ 185 NONAME ; #<VT>#
+	_ZTV18CSenProviderPolicy @ 186 NONAME ; #<VT>#
+	_ZTV18CSenServicePattern @ 187 NONAME ; #<VT>#
+	_ZTV20CSenIdentityProvider @ 188 NONAME ; #<VT>#
+	_ZTV25CSenXmlServiceDescription @ 189 NONAME ; #<VT>#
+	_ZTV28CSenIdentityProviderIdArray8 @ 190 NONAME ; #<VT>#
+	_ZTV9CSenFacet @ 191 NONAME ; #<VT>#
+	_ZThn104_N10CSenPolicy11RebuildFromER10MSenPolicy @ 192 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy21IdentityProviderIds8LEv @ 193 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy22AddIdentityProviderIdLERK6TDesC8 @ 194 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 195 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy5IapIdERm @ 196 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy7AcceptsER10MSenPolicy @ 197 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy9SetIapIdLEm @ 198 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServicePattern7MatchesER22MSenServiceDescription @ 199 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription10FacetValueER6TDesC8RP6HBufC8 @ 200 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription11ScoreMatchLER22MSenServiceDescription @ 201 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription11FrameworkIdEv @ 202 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription11RemoveFacetERK6TDesC8 @ 203 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription12SetContractLERK6TDesC8 @ 204 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription12SetEndPointLERK6TDesC8 @ 205 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription13AsXmlUnicodeLEv @ 206 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription13WriteAsXMLToLER12RWriteStream @ 207 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription16FrameworkVersionEv @ 208 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription20DescriptionClassTypeEv @ 209 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription6AsXmlLEv @ 210 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription7FacetsLER13RPointerArrayI9CSenFacetE @ 211 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription7MatchesER22MSenServiceDescription @ 212 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription8ContractEv @ 213 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription8EndpointEv @ 214 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription9HasFacetLERK6TDesC8Ri @ 215 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription9AddFacetLERK9CSenFacet @ 216 NONAME ; #<thunk>#
+	_ZThn104_N25CSenXmlServiceDescription9SetFacetLERK9CSenFacet @ 217 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription11RebuildFromER18MSenProviderPolicy @ 218 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription21IdentityProviderIds8LEv @ 219 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription22AddIdentityProviderIdLER6TDesC8 @ 220 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription23SetIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 221 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription5IapIdERm @ 222 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription7AcceptsER18MSenProviderPolicy @ 223 NONAME ; #<thunk>#
+	_ZThn108_N25CSenXmlServiceDescription9SetIapIdLEm @ 224 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern13ConsumerIapIdERm @ 225 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern17SetConsumerIapIdLEm @ 226 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern21AcceptsConsumerPolicyER18MSenConsumerPolicy @ 227 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern25RebuildFromConsumerPolicyER18MSenConsumerPolicy @ 228 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern29ConsumerIdentityProviderIds8LEv @ 229 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern30AddConsumerIdentityProviderIdLERK6TDesC8 @ 230 NONAME ; #<thunk>#
+	_ZThn164_N18CSenServicePattern31SetConsumerIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 231 NONAME ; #<thunk>#
+	_ZThn24_N28CSenIdentityProviderIdArray8D0Ev @ 232 NONAME ; #<thunk>#
+	_ZThn24_N28CSenIdentityProviderIdArray8D1Ev @ 233 NONAME ; #<thunk>#
+	_ZThn28_N28CSenIdentityProviderIdArray89SetStrictEi @ 234 NONAME ; #<thunk>#
+	_ZThn28_NK28CSenIdentityProviderIdArray88IsStrictEv @ 235 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription13AsXmlUnicodeLEv @ 236 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription13WriteAsXMLToLER12RWriteStream @ 237 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 238 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription18ResumeParsingFromLERK6TDesC8S2_S2_ @ 239 NONAME ; #<thunk>#
+	_ZThn4_N25CSenXmlServiceDescription6AsXmlLEv @ 240 NONAME ; #<thunk>#
+	_ZN15CSenCredential210ConstructLERK6TDesC8 @ 241 NONAME
+	_ZN15CSenCredential210ValidUntilEv @ 242 NONAME
+	_ZN15CSenCredential213SetValidUntilER5TTime @ 243 NONAME
+	_ZN15CSenCredential214BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 244 NONAME
+	_ZN15CSenCredential214BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 245 NONAME
+	_ZN15CSenCredential214BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 246 NONAME
+	_ZN15CSenCredential214BaseConstructLERS_ @ 247 NONAME
+	_ZN15CSenCredential215OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 248 NONAME
+	_ZN15CSenCredential22IdEv @ 249 NONAME
+	_ZN15CSenCredential24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 250 NONAME
+	_ZN15CSenCredential24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 251 NONAME
+	_ZN15CSenCredential24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 252 NONAME
+	_ZN15CSenCredential24NewLERKS_ @ 253 NONAME
+	_ZN15CSenCredential24NewLEv @ 254 NONAME
+	_ZN15CSenCredential25NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 255 NONAME
+	_ZN15CSenCredential25NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 256 NONAME
+	_ZN15CSenCredential25NewLCERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 257 NONAME
+	_ZN15CSenCredential25NewLCERKS_ @ 258 NONAME
+	_ZN15CSenCredential25NewLCEv @ 259 NONAME
+	_ZN15CSenCredential26SetIdLERK6TDesC8 @ 260 NONAME
+	_ZN15CSenCredential2C1Ev @ 261 NONAME
+	_ZN15CSenCredential2C2Ev @ 262 NONAME
+	_ZN15CSenCredential2D0Ev @ 263 NONAME
+	_ZN15CSenCredential2D1Ev @ 264 NONAME
+	_ZN15CSenCredential2D2Ev @ 265 NONAME
+	_ZN20CSenIdentityProvider14SetProviderIdLERK6TDesC8 @ 266 NONAME
+	_ZN25CSenXmlServiceDescription10ProviderIdEv @ 267 NONAME
+	_ZN25CSenXmlServiceDescription10SetPolicyLERK6TDesC8 @ 268 NONAME
+	_ZN25CSenXmlServiceDescription10SetPolicyLERK6TDesC8S2_ @ 269 NONAME
+	_ZN25CSenXmlServiceDescription10SetPolicyLERK6TDesC8S2_S2_S2_ @ 270 NONAME
+	_ZN25CSenXmlServiceDescription12TransportCueEv @ 271 NONAME
+	_ZN25CSenXmlServiceDescription13ServicePolicyEv @ 272 NONAME
+	_ZN25CSenXmlServiceDescription14PromptUserInfoEv @ 273 NONAME
+	_ZN25CSenXmlServiceDescription14SetProviderIdLERK6TDesC8 @ 274 NONAME
+	_ZN25CSenXmlServiceDescription16SetTransportCueLERK6TDesC8 @ 275 NONAME
+	_ZN25CSenXmlServiceDescription18SetPromptUserInfoLEi @ 276 NONAME
+	_ZN25CSenXmlServiceDescription20HasEqualPrimaryKeysLER22MSenServiceDescription @ 277 NONAME
+	_ZN25CSenXmlServiceDescription8IsLocalLEv @ 278 NONAME
+	_ZTI14CServicePolicy @ 279 NONAME ; #<TI>#
+	_ZTI15CSenCredential2 @ 280 NONAME ; #<TI>#
+	_ZTI17CSenServicePolicy @ 281 NONAME ; #<TI>#
+	_ZTV14CServicePolicy @ 282 NONAME ; #<VT>#
+	_ZTV15CSenCredential2 @ 283 NONAME ; #<VT>#
+	_ZTV17CSenServicePolicy @ 284 NONAME ; #<VT>#
+	_ZThn4_N15CSenCredential215OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 285 NONAME ; #<thunk>#
+	_ZN25CSenXmlServiceDescription10ConstructLERK6TDesC8 @ 286 NONAME
+	_ZN20CSenIdentityProvider17AccountExtensionsERP11CSenElement @ 287 NONAME
+	_ZN20CSenIdentityProvider21SetAccountExtensionsLERK6TDesC8 @ 288 NONAME
+	_ZN18CSenProviderPolicy20TransportPropertiesLERP6HBufC8 @ 289 NONAME
+	_ZN18CSenProviderPolicy23SetTransportPropertiesLERK6TDesC8 @ 290 NONAME
+	_ZN25CSenXmlServiceDescription20TransportPropertiesLERP6HBufC8 @ 291 NONAME
+	_ZN25CSenXmlServiceDescription23SetTransportPropertiesLERK6TDesC8 @ 292 NONAME
+	_ZN10CSenPolicy10SetSnapIdLEm @ 293 NONAME
+	_ZN10CSenPolicy14BaseConstructLERK6TDesC8mi @ 294 NONAME
+	_ZN10CSenPolicy4NewLEmi @ 295 NONAME
+	_ZN10CSenPolicy5NewLCEmi @ 296 NONAME
+	_ZN10CSenPolicy6SnapIdERm @ 297 NONAME
+	_ZN18CSenConsumerPolicy14BaseConstructLEmi @ 298 NONAME
+	_ZN18CSenConsumerPolicy4NewLEmi @ 299 NONAME
+	_ZN18CSenConsumerPolicy5NewLCEmi @ 300 NONAME
+	_ZN18CSenProviderPolicy14BaseConstructLEmi @ 301 NONAME
+	_ZN18CSenProviderPolicy4NewLEmi @ 302 NONAME
+	_ZN18CSenProviderPolicy5NewLCEmi @ 303 NONAME
+	_ZN18CSenServicePattern14ConsumerSnapIdERm @ 304 NONAME
+	_ZN18CSenServicePattern18SetConsumerSnapIdLEm @ 305 NONAME
+	_ZN25CSenXmlServiceDescription10SetSnapIdLEm @ 306 NONAME
+	_ZN25CSenXmlServiceDescription6SnapIdERm @ 307 NONAME
+	_ZThn104_N10CSenPolicy10SetSnapIdLEm @ 308 NONAME ; #<thunk>#
+	_ZThn104_N10CSenPolicy6SnapIdERm @ 309 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsdescription    
+*
+*/
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+ 
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsdescription.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsdescription.iby)
+PRJ_MMPFILES
+senservicedescription.mmp
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/group/senservicedescription.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       Project specification file for senservicedescription    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenServDesc.DLL
+UID             0x1000008d 0x101F9701
+#else
+TARGET          wsservdesc.DLL
+UID             0x1000008d 0x101F9738
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senservdescdll.cpp
+SOURCE          senxmlservicedescription.cpp
+SOURCE          sencredential.cpp
+SOURCE          senfacet.cpp
+SOURCE          senidentityprovider.cpp
+SOURCE          senidentityprovideridarray8.cpp
+SOURCE          senpolicy.cpp
+SOURCE          senproviderpolicy.cpp
+SOURCE          senconsumerpolicy.cpp
+SOURCE          senservicepattern.cpp
+SOURCE          senservicepolicy.cpp
+SOURCE          servicepolicy.cpp
+SOURCE          sencredential2.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wslogger/inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LANG            SC
+
+LIBRARY         bafl.lib
+LIBRARY         estor.lib 
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+
+// SOA for S60 libraries
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenXml.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenFragment.lib
+LIBRARY         SenLogger.lib
+#else
+LIBRARY         wsxml.lib
+LIBRARY         wsutils.lib
+LIBRARY         wsfragment.lib
+LIBRARY         wsLogger.lib
+#endif
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+#endif
+
+#ifdef SYMBIAN_SECURE_ECOM // for 2.8, 3.0 or newer:
+    LIBRARY         xmlframework.lib
+#endif // otherwise cXMLreader is used
+
+#if defined(ARMCC)
+	#if defined (RD_SEN_COMPILE_SIS_PACKAGE_FILES)
+		DEFFILE ../EABI/SENSERVDESC_V2.DEF
+	#else
+  	DEFFILE ../eabi/SenServDesc.DEF
+	#endif//RD_SEN_COMPILE_SIS_PACKAGE_FILES
+#elif defined(WINSCW)
+	#if defined (RD_SEN_COMPILE_SIS_PACKAGE_FILES)
+		DEFFILE ../BWINSCW/SENSERVDESC_V2.DEF
+	#else
+  	DEFFILE ../BWINSCW/SenServDesc.DEF
+	#endif//RD_SEN_COMPILE_SIS_PACKAGE_FILES
+#elif defined(WINS)
+    DEFFILE ../BWINS/SENSERVDESC.DEF
+#else 
+    DEFFILE ../BMARM/SENSERVDESC.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/msenpolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_POLICY_H
+#define M_SEN_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+
+// FORWARD DECLARATION
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+* Example structure of Policy XML fragment:
+*
+*   <Policy>
+*       <Transport>
+*           <IapId>
+*               1234567890
+*           </IapId>
+*       </Transport>
+*       <IdentityProviderIDs strict="true">
+*           <IdentityProviderID>
+*             urn:first.id.example.com
+*           </IdentityProviderID>
+*           <IdentityProviderID>
+*             urn:second.id.example.com
+*           </IdentityProviderID>
+*       </IdentityProviderIDs>
+*   </Policy>
+*/
+class MSenPolicy
+    {
+    public: // New functions
+
+        /**
+        * Setter for Internet Access Point (IAP) ID.
+        * Method is used to define default access point
+        * to avoid IAP selection dialog prompt.
+        * @since Series60 3.0
+        * @param aIapId is the ID found from CommDB.
+        */ 
+        virtual void SetIapIdL(TUint32 aIapId) = 0;
+
+        /**
+        * Getter for IAP ID.
+        * @param aCurrentIapId will contain the current Internet Access Point ID
+        * Max value for IAP ID is 2147483647
+        * @return
+        *  - KErrNone if <IapId> element is found and has valid content
+        *  - KErrNotFound if no <IapId> element has been found or it has
+        *       no content
+        *  - TLex error codes, if <IapId> element has non-numeric value,
+        *    which cannot be resolved
+        */ 
+        virtual TInt IapId(TUint32& aCurrentIapId) = 0;
+
+        /**
+        * Setter for IdentityProvider IDs. Overrides 
+        * current values with the given values from the array.
+        * When initiating a new service connection, this list of
+        * ProviderIDs define, which IdentityProviders are preferred
+        * OR which are strictly acceptable ones.
+        * @since Series60 3.0
+        * @param aList  list of IdentityProvider IDs.
+        */ 
+        virtual void SetIdentityProviderIdsL(
+                                    CSenIdentityProviderIdArray8& aList) = 0;
+
+        /**
+        * Adds a new Identity provider ID value at the end of the current list 
+        * values
+        * Checks for duplicate (does not insert new ID elements with equal
+        * content)
+        * @return   KErrAlreadyExists, if a duplicate is tried to add
+        *           KErrArgument if a zero-length descriptor is tried to add
+        *           (aProviderId.Length() == 0)
+        */
+        virtual TInt AddIdentityProviderIdL(const TDesC8& aProviderId) = 0;
+
+        /**
+        * Method reads provider policy class instance values from given
+        * template. Values may include an IAP ID, preferred IdentityProvider
+        * IDs etc.
+        * @since Series60 3.0
+        * @param aTemplate from which the values are read.
+        * @return       KErrNone            Everything went ok.
+        *               KErrAlreadyExists   Duplicates were found
+        *               KErrArgument        Invalid providerIds were found
+        *               Other error codes are system-wide Symbian error codes.
+        */ 
+        virtual TInt RebuildFrom(MSenPolicy& aTemplate) = 0;
+
+        /**
+        * Getter for IdentityProvider IDs.
+        * @since Series60 3.0
+        * @return a list of IDP arrays if such value(s) have been set
+        *           or an empty array if no IDP:s have been specified.
+        */ 
+        virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0;
+
+        /**
+        * Checks if policies match.
+        * @return ETrue if policies match, EFalse if not.
+        */
+        virtual TBool Accepts(MSenPolicy& aPolicyPattern) = 0;
+        
+        virtual void SetSnapIdL(TUint32 aSnapId) = 0;
+        
+        virtual TInt SnapId(TUint32& aCurrentSnapId) = 0;
+    };
+
+#endif //M_SEN_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/mservicepolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SERVICE_POLICY_H
+#define M_SERVICE_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+typedef RPointerArray<CSenElement> RPolicyArray;
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+
+/**
+* Example structure of Policy XML fragment:
+*
+*   <ServicePolicy>
+*       <ClientPolicy>
+*			<MetadataEndpoint>uri.1</MetadataEndpoint>
+*			<MetadataEndpoint>uri.2</MetadataEndpoint>
+*			<MetadataEndpoint>uri.3</MetadataEndpoint>
+*           <PolicyValue1/>				
+*           <PolicyValue2/>				
+*       </ClientPolicy>
+*       <PolicyArrray>
+*			<wsp:Policy1/>
+*			<wsp:Policy2/>
+*       </PolicyArrray>
+*   </ServicePolicy>
+*/
+class MServicePolicy
+    {
+    public: // New functions
+
+        /**
+        * Adds a policy in SD
+        * Method is used to add a RAW policy obtained 
+        * by Network or some dynamic means
+        * @since Series60 4.0
+        * @param aPolicy is the Policy Element
+        */ 
+        virtual TInt AddPolicyL(CSenElement* aPolicy) = 0;
+
+        /**
+        * Remove  a Policy from SD
+        * @param aPolicyName , Policy with this name will be removed from SD
+        * @return
+        *  - KErrNone 
+        
+        */ 
+        virtual TInt RemovePolicyL(TDesC8& aPolicyName) = 0;
+
+        /**
+        * Method reads provider policy class instance values from given
+        * template. 
+        * @since Series60 4.0
+        * @param aTemplate from which the values are read.
+        * @return   
+        *           
+        */ 
+        virtual TInt RebuildServicePolicyFrom(MServicePolicy& aTemplate) = 0;
+        
+        /**
+        * Checks if policies match.
+        * @return ETrue if policies match, EFalse if not.
+        */
+        virtual TBool Accepts(MServicePolicy& aPolicyPattern) = 0;
+       
+        /**
+        * Getter for ServicePolicies
+        * @since Series60 4.0
+        * @return 
+        *           
+        */ 
+
+        virtual TInt ServicePolicies(RPolicyArray& aPolicies) = 0;
+    };
+
+#endif //M_SEN_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/senconsumerpolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        The SenConsumerPolicy is a non-public implementation of
+*                a ConsumerPolicy, which offers functionality for classes
+*                implementing MSenConsumerPolicy interface. Those classes
+*                typically delegate their function calls to ready mehthods
+*                defined in this class.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CONSUMER_POLICY_H
+#define SEN_CONSUMER_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+#include "MSenConsumerPolicy.h"
+#include "senpolicy.h"
+
+// FORWARD DECLARATION
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+* Example structure of ConsumerPolicy> XML fragment:
+*
+*   <ConsumerPolicy>
+*       <Transport>
+*           <IapId>
+*               1234567890
+*           </IapId>
+*       </Transport>
+*
+*       <IdentityProviderIDs strict="true">
+*           <IdentityProviderID>
+*             urn:first.id.example.com
+*           </IdentityProviderID>
+*           <IdentityProviderID>
+*             urn:second.id.example.com
+*           </IdentityProviderID>
+*       </IdentityProviderIDs>
+*   </ConsumerPolicy>
+*/
+class CSenConsumerPolicy : public CSenPolicy
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructors.
+        * These parameterless constructors are ment to be used
+        * for example before parsing XML stream.
+        */
+        IMPORT_C static CSenConsumerPolicy* NewL();
+        IMPORT_C static CSenConsumerPolicy* NewLC();
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenConsumerPolicy* NewL(TUint32 aIapId);
+        IMPORT_C static CSenConsumerPolicy* NewLC(TUint32 aIapId);
+        
+        IMPORT_C static CSenConsumerPolicy* NewL(TUint32 aId, TBool aIsSnapId);
+        IMPORT_C static CSenConsumerPolicy* NewLC(TUint32 aId, TBool aIsSnapId);        
+
+        // Functions from base classes
+    
+        // From MSenConsumerPolicy 
+    
+        /**
+        * Method reads provider policy class instance values from given
+        * template. Values may include an IAP ID, preferred IdentityProvider
+        * IDs etc.
+        * @since Series60 3.0
+        * @param aTemplate from which the values are read.
+        * @return       KErrNone            Everything went ok.
+        *               KErrAlreadyExists   Duplicates were found
+        *               KErrArgument        Invalid providerIds were found
+        *               Other error codes are system-wide Symbian error codes.
+        */ 
+        IMPORT_C virtual TInt RebuildFrom(MSenConsumerPolicy& aTemplate);
+
+        /**
+        * Checks if service pattern accepts given policy.
+        * @param aPolicyPattern the consumer policy to check.
+        * @return ETrue if accepts, EFalse if not
+        */
+        IMPORT_C virtual TBool Accepts(MSenConsumerPolicy& aPolicyPattern);
+
+        /**
+        * Destructor
+        */
+        virtual ~CSenConsumerPolicy();
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenConsumerPolicy();
+
+        /**
+        * By default Symbian 2nd phase constructors are private.
+        */
+        IMPORT_C void BaseConstructL();
+        IMPORT_C void BaseConstructL(TUint32 aIapId);
+        IMPORT_C void BaseConstructL(TUint32 aId, TBool aIsSnapId);
+        
+        
+        // New functions
+        
+        /**
+        * Leaving variants of the functions.
+        */
+        TBool AcceptsL(MSenConsumerPolicy& aPolicyPattern);
+        TInt RebuildFromL(MSenConsumerPolicy& aTemplate);
+    };
+
+#endif //SEN_CONSUMER_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/senpolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_POLICY_H
+#define SEN_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+#include "msenpolicy.h"
+
+// FORWARD DECLARATION
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+* Example structure of Policy XML fragment:
+*   <Policy>
+*
+*       <Transport>
+*           <IapId>
+*               1234567890
+*           </IapId>
+*       </Transport>
+*
+*       <IdentityProviderIDs strict="true">
+*           <IdentityProviderID>
+*             urn:first.id.example.com
+*           </IdentityProviderID>
+*           <IdentityProviderID>
+*             urn:second.id.example.com
+*           </IdentityProviderID>
+*       </IdentityProviderIDs>
+*
+*   </Policy>
+*/
+class CSenPolicy : public CSenDomFragment, public MSenPolicy
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructors.
+        * These parameterless constructors are ment to be used
+        * for example before parsing XML stream.
+        */
+        IMPORT_C static CSenPolicy* NewL();
+        IMPORT_C static CSenPolicy* NewLC();
+        IMPORT_C static CSenPolicy* NewL(TUint32 aIapId);
+        IMPORT_C static CSenPolicy* NewLC(TUint32 aIapId);
+        IMPORT_C static CSenPolicy* NewL(TUint32 aId, TBool aIsSnapId);
+        IMPORT_C static CSenPolicy* NewLC(TUint32 aId, TBool aIsSnapId);        
+
+        /**
+        * Destructor
+        */
+        virtual ~CSenPolicy();
+        
+        // Functions from base classes
+        
+        // From MSenPolicy
+    
+        /**
+        * Setter for Internet Access Point (IAP) ID.
+        * Method is used to define default access point
+        * to avoid IAP selection dialog prompt.
+        * @since Series60 3.0
+        * @param aIapId is the ID found from CommDB.
+        */ 
+        IMPORT_C virtual void SetIapIdL(TUint32 aIapId);
+
+        /**
+        * Getter for IAP ID.
+        * @param aCurrentIapId will contain the current Internet Access Point ID
+        * Max value for IAP ID is 2147483647
+        * @return
+        *  - KErrNone if <IapId> element is found and has valid content
+        *  - KErrNotFound if no <IapId> element has been found or it has
+        *       no content
+        *  - TLex error codes, if <IapId> element has non-numeric value,
+        *    which cannot be resolved
+        */ 
+        IMPORT_C virtual TInt IapId(TUint32& aCurrentIapId);
+
+        /**
+        * Setter for IdentityProvider IDs. Overrides 
+        * current values with the given values from the array.
+        * When initiating a new service connection, this list of
+        * ProviderIDs define, which IdentityProviders are preferred
+        * OR which are strictly acceptable ones.
+        * @since Series60 3.0
+        * @param aList  list of IdentityProvider IDs.
+        */ 
+        IMPORT_C virtual void SetIdentityProviderIdsL(
+                                        CSenIdentityProviderIdArray8& aList);
+
+        /**
+        * Adds a new Identity provider ID value at the end of the current list 
+        * values
+        * Checks for duplicate (does not insert new ID elements with equal
+        * content)
+        * @return   KErrAlreadyExists, if a duplicate is tried to add
+        *           KErrArgument if a zero-length descriptor is tried to add
+        *           (aProviderId.Length() == 0)
+        */
+        IMPORT_C virtual TInt AddIdentityProviderIdL(const TDesC8& aProviderId);
+
+        /**
+        * Method reads provider policy class instance values from given
+        * template. Values may include an IAP ID, preferred IdentityProvider
+        * IDs etc.
+        * @since Series60 3.0
+        * @param aTemplate from which the values are read.
+        * @return       KErrNone            Everything went ok.
+        *               KErrAlreadyExists   Duplicates were found
+        *               KErrArgument        Invalid providerIds were found
+        *               Other error codes are system-wide Symbian error codes.
+        */ 
+        IMPORT_C virtual TInt RebuildFrom(MSenPolicy& aTemplate);
+
+        /**
+        * Getter for IdentityProvider IDs.
+        * @since Series60 3.0
+        * @return a list of IDP arrays if such value(s) have been set
+        *           or an empty array if no IDP:s have been specified.
+        */ 
+        IMPORT_C virtual const CSenIdentityProviderIdArray8&
+                                                    IdentityProviderIds8L();
+        /**
+        * Checks if policies match.
+        * @param    aPolicyPattern  the policy to match
+        * @return ETrue if policies match, EFalse if not.
+        */
+        IMPORT_C virtual TBool Accepts(MSenPolicy& aPolicyPattern);
+        
+        /**
+        * Sets the SnapId
+        * @param    aSnapId snap id
+        */
+        IMPORT_C virtual void SetSnapIdL(TUint32 aSnapId) ;
+        
+        /**
+        * Gets the SnapId
+        * @param    aCurrentSnapId snap id
+        * @return KErrNone if snap id is get properly
+        */
+        IMPORT_C virtual TInt SnapId(TUint32& aCurrentSnapId) ;         
+
+    protected: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenPolicy();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName,
+                                     TUint32 aIapId);
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName,
+                                     TUint32 aId, TBool aIsSnapId);
+    
+    private: // New functions
+    
+        /**
+        * Leaving variants of the functions.
+        */
+        TBool AcceptsL(MSenPolicy& aPolicyPattern);
+        TInt RebuildFromL(MSenPolicy& aTemplate);
+
+    private: // Data
+        CSenIdentityProviderIdArray8* iIdpIdList;
+    };
+
+#endif //SEN_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/senproviderpolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        The SenProviderPolicy is a non-public implementation of
+*                a "ProviderPolicy", which offers functionality for classes
+*                implementing MSenProviderPolicy interface. Those classes
+*                typically delegate their function calls to ready methods
+*                defined in this class.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_PROVIDER_POLICY_H
+#define SEN_PROVIDER_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+#include "MSenProviderPolicy.h"
+#include "senpolicy.h"
+
+// FORWARD DECLARATIONS
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+* Example structure of ProviderPolicy XML fragment:
+*
+*   <ProviderPolicy>
+*
+*       <Transport>
+*           <IapId>
+*               1234567890
+*           </IapId>
+*       </Transport>
+*
+*       <IdentityProviderIDs strict="true">
+*           <IdentityProviderID>
+*             urn:first.id.example.com
+*           </IdentityProviderID>
+*           <IdentityProviderID>
+*             urn:second.id.example.com
+*           </IdentityProviderID>
+*       </IdentityProviderIDs>
+*
+*   </ProviderPolicy>
+*/
+class CSenProviderPolicy : public CSenPolicy
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructors.
+        * These parameterless constructors are ment to be used
+        * for example before parsing XML stream.
+        */
+        IMPORT_C static CSenProviderPolicy* NewL();
+        IMPORT_C static CSenProviderPolicy* NewLC();
+        IMPORT_C static CSenProviderPolicy* NewL(TUint32 aIapId);
+        IMPORT_C static CSenProviderPolicy* NewLC(TUint32 aIapId);
+        IMPORT_C static CSenProviderPolicy* NewL(TUint32 aId, TBool aIsSnapId);
+        IMPORT_C static CSenProviderPolicy* NewLC(TUint32 aId, TBool aIsSnapId);        
+
+        virtual ~CSenProviderPolicy();
+        
+        // New functions
+        
+        /**
+        * Checks if policies match.
+        * @since    Series60 3.0
+        * @param    aPolicyPattern is the policy being compared 
+        *           with this instance.
+        * @return   ETrue if policy candidate is accepted by current policy
+        *           definition, EFalse if not.
+        */
+        IMPORT_C virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern);
+
+        /**
+        * Method reads provider policy class instance values from given
+        * template. Values may include an IAP ID, preferred IdentityProvider
+        * IDs etc.
+        * @since Series60 3.0
+        * @param aTemplate from which the values are read.
+        * @return       KErrNone            Everything went ok.
+        *               KErrAlreadyExists   Duplicates were found
+        *               KErrArgument        Invalid providerIds were found
+        *               Other error codes are system-wide Symbian error codes.
+        */ 
+        IMPORT_C virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate);
+       
+        
+        /**
+        * Sets transport specific properties.
+        * @param aProperties contains the transport properties in serialized (UTF-8) form.
+        * With HTTP, this descriptor is typically created by utilizing CSenHttpProperties class.
+        * @return KErrNone if successful or otherwise some system-wide error code.
+        */
+        IMPORT_C TInt SetTransportPropertiesL(const TDesC8& aProperties);
+
+
+        /*
+        * Method returns currently effective transport properties as a serialized
+        * descriptor. With HTTP, one may utilize CSenHttpProperities class in
+        * order to read this data into properties object. Note that returned 
+        * list of properties also includes properties, which are defined as default
+        * for certain transport in the webservice framework.
+        */
+        IMPORT_C TInt TransportPropertiesL(HBufC8*& aProperties);
+    private: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenProviderPolicy();
+        
+        /**
+        * By default Symbian 2nd phase constructors are private.
+        */
+        IMPORT_C void BaseConstructL();
+        IMPORT_C void BaseConstructL(TUint32 aIapId);
+        IMPORT_C void BaseConstructL(TUint32 aId, TBool aIsSnapId);
+    
+        // New functions
+        
+        /**
+        * Leaving variants of the functions.
+        */
+        TBool AcceptsL(MSenProviderPolicy& aPolicyPattern);
+        TInt RebuildFromL(MSenProviderPolicy& aTemplate);
+    };
+
+#endif //SEN_PROVIDER_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/senservicepolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        The SenServicePolicy is a non-public implementation of
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_POLICY_H
+#define SEN_SERVICE_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+#include "MSenServiceDescription.h"
+#include "servicepolicy.h"
+#include "MSenServicePolicy.h"
+// FORWARD DECLARATIONS
+
+
+// CLASS DECLARATION
+
+/**
+* Example structure of ServicePolicy XML fragment:
+*
+*	<ServicePolicy>
+*
+*	</ServicePolicy>
+*/
+class CSenServicePolicy : public CServicePolicy
+    {
+	public: // Constructors and destructor
+
+		/**
+     	* Two-phased constructors.
+	 	* These parameterless constructors are ment to be used
+	 	* for example before parsing XML stream.
+     	*/
+    	static CSenServicePolicy* NewL();
+    	static CSenServicePolicy* NewLC();
+
+		virtual ~CSenServicePolicy();
+        // From CServicePolicy
+        virtual TInt RebuildServicePolicyFrom(MSenServicePolicy& aTemplate);
+        virtual TBool Accepts(MSenServicePolicy& aPolicyPattern);
+        virtual CSenElement* ClientPolicy();
+ 	private: 
+		/**
+        * C++ default constructor.
+        */
+		CSenServicePolicy();
+        void ConstructL();		
+		/**
+        * By default Symbian 2nd phase constructors are private.
+        */
+		void BaseConstructL();
+    };
+
+#endif //SEN_SERVICE_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/inc/servicepolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SERVICE_POLICY_H
+#define SERVICE_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+// INCLUDES
+#include <flogger.h>        
+#include "SenDomFragment.h"
+#include "MSenServicePolicy.h"
+#include "SenBaseFragment.h"
+
+// FORWARD DECLARATION
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+/**
+* Example structure of ServicePolicy XML fragment:
+*
+*   <ServicePolicy>
+*   </ServicePolicy>
+*/
+class CServicePolicy : public CSenDomFragment, public MSenServicePolicy
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructors.
+        * These parameterless constructors are ment to be used
+        * for example before parsing XML stream.
+        */
+        static CServicePolicy* NewL();
+        static CServicePolicy* NewLC();
+
+        /**
+        * Destructor
+        */
+        virtual ~CServicePolicy();
+        
+        // Functions from base classes
+        
+        // From MServicePolicy
+        virtual TInt AddPolicyL(CSenElement* aPolicy);
+        virtual TInt RemovePolicyL(TDesC8& aPolicyName);
+        virtual TInt ServicePolicies(RPolicyArray& aPolicies);
+        virtual TInt RebuildServicePolicyFrom(MSenServicePolicy& aTemplate);
+        virtual TBool Accepts(MSenServicePolicy& aPolicyPattern);
+        virtual CSenElement* ClientPolicy();
+        virtual TBool ClientPolicy(const TDesC8& aKey);
+        virtual HBufC8* ClientPolicyValue(const TDesC8& aKey);        
+        TInt AddClientPolicyL(CSenElement* aTemplate);                    
+        
+    protected: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CServicePolicy();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL(const TDesC8& aLocalName);
+        //RFileLogger* Log() const;        
+    
+    private: // New functions
+    
+        /**
+        * Leaving variants of the functions.
+        */
+        TBool AcceptsL(MSenServicePolicy& aPolicyPattern);
+        TInt RebuildServicePolicyFromL(MSenServicePolicy& aTemplate);
+        
+        
+        TInt AddWspPolicyL(CSenElement* aPolicy);
+        TBool ValidatePolicy(CSenElement* aPolicy);
+        TPtrC8 PolicyIdL(CSenElement* aPolicy);	//codescannerwarnings
+        TPtrC8 PolicyNameL(CSenElement* aPolicy);	//codescannerwarnings
+        TPtrC8 PolicyUriL(CSenElement* aPolicy);
+        void GenerateDeviceIdL(CSenElement* aPolicy);	//codescannerwarnings
+        
+        void AddApplicationInfoElementsL(CSenElement* aApplicationInfoElement);
+        void AddAppicationElementsL(CSenElement* aApplicationElement);
+        void AddDeviceElementsL(CSenElement* aDeviceElement);
+        void AddUserAgentElementsL(CSenElement* aUserAgentElement);
+        void AddOSElementsL(CSenElement* aOSElement);
+
+    private: // Data
+//        CSenIdentityProviderIdArray8* iIdpIdList;
+        //RFileLogger iLog;
+    };
+
+#endif //SEN_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/rom/wsdescription.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSDESCRIPTION_IBY__
+#define __WSDESCRIPTION_IBY__
+
+// ServiceDescription
+file=ABI_DIR\BUILD_DIR\SenServDesc.dll          PROGRAMS_DIR\SenServDesc.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senconsumerpolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <s32strm.h>
+
+#include "senconsumerpolicy.h"
+#include "SenElement.h"
+#include "SenXmlUtils.h"
+
+#include "SenIdentityProviderIdArray8.h"
+
+
+
+// ============================ LOCAL FUNCTIONS ===============================
+
+namespace
+    {
+    _LIT8(KConsumerPolicyLocalName, "ConsumerPolicy");
+    }
+
+
+EXPORT_C CSenConsumerPolicy* CSenConsumerPolicy::NewL()
+    {
+    CSenConsumerPolicy* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenConsumerPolicy* CSenConsumerPolicy::NewLC()
+    {
+    CSenConsumerPolicy* pNew = new (ELeave) CSenConsumerPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+EXPORT_C CSenConsumerPolicy* CSenConsumerPolicy::NewL(TUint32 aIapId)
+    {
+    CSenConsumerPolicy* pNew = NewLC(aIapId);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenConsumerPolicy* CSenConsumerPolicy::NewLC(TUint32 aIapId)
+    {
+    CSenConsumerPolicy* pNew = new (ELeave) CSenConsumerPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aIapId);
+    return pNew;
+    }
+
+EXPORT_C CSenConsumerPolicy* CSenConsumerPolicy::NewL(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenConsumerPolicy* pNew = NewLC(aId, aIsSnapId);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenConsumerPolicy* CSenConsumerPolicy::NewLC(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenConsumerPolicy* pNew = new (ELeave) CSenConsumerPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aId, aIsSnapId);
+    return pNew;
+    }
+
+CSenConsumerPolicy::CSenConsumerPolicy()
+    {
+    }
+
+CSenConsumerPolicy::~CSenConsumerPolicy()
+    {
+    }
+
+EXPORT_C void CSenConsumerPolicy::BaseConstructL()
+    {
+    CSenPolicy::BaseConstructL(KConsumerPolicyLocalName());
+    }
+
+EXPORT_C void CSenConsumerPolicy::BaseConstructL(TUint32 aIapId)
+    {
+    CSenPolicy::BaseConstructL(KConsumerPolicyLocalName());
+    SetIapIdL(aIapId);
+    }
+
+EXPORT_C void CSenConsumerPolicy::BaseConstructL(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenPolicy::BaseConstructL(KConsumerPolicyLocalName());
+    if (aIsSnapId == EFalse)
+        {
+    SetIapIdL(aId);
+        }
+    else
+        {
+    SetSnapIdL(aId);
+        }   
+    }
+
+EXPORT_C TBool CSenConsumerPolicy::Accepts(MSenConsumerPolicy& aPolicyPattern)
+    {
+    TBool retVal(ETrue);
+    TRAPD(err, retVal = AcceptsL(aPolicyPattern));
+    if (err) return retVal;
+    return retVal;
+    }
+
+TBool CSenConsumerPolicy::AcceptsL(MSenConsumerPolicy& aPolicyPattern)
+    {
+    TUint32 thisIapID(0);
+    TUint32 patternIapID(0);
+
+    if(aPolicyPattern.ConsumerIapId(patternIapID)==KErrNone
+        && (IapId(thisIapID) != KErrNone
+         || patternIapID!=thisIapID))
+        {
+        return EFalse; // policies do NOT match(!)
+        }
+
+    const CSenIdentityProviderIdArray8& patternIdps =
+                                aPolicyPattern.ConsumerIdentityProviderIds8L();
+    if(patternIdps.IsStrict())
+        {
+        const CSenIdentityProviderIdArray8& thisIdps = IdentityProviderIds8L();
+        TInt thisCount(thisIdps.Count());
+        TInt pos(KErrNotFound);
+        TBool matches(EFalse);
+        for(TInt i=0; i<thisCount; i++)
+            {
+            pos = KErrNotFound;
+            if(patternIdps.Find(thisIdps[i], pos, ECmpNormal)==KErrNone)
+                {
+                matches = ETrue;
+                break;
+                }
+            }
+        return matches;
+        }
+
+    return ETrue;
+    }
+
+EXPORT_C TInt CSenConsumerPolicy::RebuildFrom(
+                                    MSenConsumerPolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+    TRAPD(err, retVal = RebuildFromL(aTemplate));
+    if (err != KErrNone)
+        {
+        retVal = err;
+        }
+    return retVal;
+    }
+
+TInt CSenConsumerPolicy::RebuildFromL(MSenConsumerPolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+        // check for possible provider policy definition
+
+    TUint32 iapId(0);
+    TInt err = aTemplate.ConsumerIapId(iapId);
+    if(err==KErrNone)
+        {
+        // update the latest IAP "recommendation"
+        SetIapIdL(iapId);
+        }
+    const CSenIdentityProviderIdArray8& ids =
+                                    aTemplate.ConsumerIdentityProviderIds8L();
+    TInt idsCount(ids.MdcaCount());
+    for(TInt j=0; j<idsCount; j++)
+        {
+        TPtrC8 value = ids[j];
+        if(value.Length()>0)
+            {
+            err = AddIdentityProviderIdL(value);
+            if(err!=KErrNone)
+                {
+                retVal = err; // indicate that some IDP could not be added
+                }
+            }
+        }
+    return retVal;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/sencredential.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,319 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenCredential.h"
+
+//#include "SenDebug.h"
+
+#include <SenDateUtils.h>
+
+#include <SenXmlElement.h>
+#include <SenXmlUtils.h>
+
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    // for S60 FP3 (2.8) platform or newer (3.0 and above)
+    #include <xml/attribute.h> // needed for RAttributeArray
+//#else  // for S60 FP2 platform (2.6) or older
+    //#include "Attribute.h"
+#endif
+
+using namespace Xml;
+
+namespace
+{
+    /* milliseconds before actual notOnOrAfter time
+     * when credentials are treated
+     * as expired.
+     */
+
+    // Identifiers which are accepted (and searched after)
+    _LIT8(KId,                      "ID");
+    _LIT8(Kwsu_ns_plus_Id,          "wsu:Id");
+    _LIT8(KAssertionId,             "AssertionID");
+
+    _LIT8(KConditions,              "Conditions");
+    _LIT8(KVal_NotOnOrAfter,        "NotOnOrAfter");
+}
+
+EXPORT_C CSenCredential* CSenCredential::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CSenCredential* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential* CSenCredential::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CSenCredential* pNew = new (ELeave) CSenCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+EXPORT_C CSenCredential* CSenCredential::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    CSenElement& aParent
+    )
+    {
+    CSenCredential* pNew = NewLC(aNsUri, aLocalName, 
+                                aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential* CSenCredential::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    CSenElement& aParent
+    )
+    {
+    CSenCredential* pNew = new (ELeave) CSenCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+
+EXPORT_C CSenCredential* CSenCredential::NewL(
+                                             const CSenCredential& aCredential)
+    {
+    CSenCredential* pNew = NewLC(aCredential);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential* CSenCredential::NewLC(
+                                             const CSenCredential& aCredential)
+    {
+    CSenCredential* pNew = new (ELeave) CSenCredential;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL((CSenCredential&)aCredential);
+    return pNew;
+    }
+
+
+EXPORT_C void CSenCredential::ConstructL(CSenCredential& aCredential)
+    {
+    ipElement = CSenXmlElement::NewL(aCredential.ipElement->LocalName());
+    ipElement->CopyFromL(*(CSenXmlElement*)(aCredential.ipElement));
+    if (aCredential.ValidUntil() != Time::NullTTime())
+        {
+        SetValidUntil(aCredential.ValidUntil());
+        }
+    SetIdL(aCredential.Id());
+    }
+
+EXPORT_C void CSenCredential::ConstructL(
+    const TDesC8&  aNsUri,
+    const TDesC8&  aLocalName,
+    const TDesC8&  aQName,
+    const RAttributeArray& aAttributes,
+    CSenElement& aParent
+    )
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    // this ensures we take note of possible namespaces and
+    // prefixed attributes
+    CSenBaseFragment::SetAttributesL(aAttributes);
+    // we want to save its ID and validity
+
+    TPtrC8 identifier = SenXmlUtils::AttrValue(aAttributes, KId);
+    if(identifier.Length()>0)
+        {
+        SetIdL(identifier);
+        }
+
+    TPtrC8 identifier2 = SenXmlUtils::AttrValue(aAttributes, Kwsu_ns_plus_Id);
+    if(identifier2.Length()>0)
+        {
+        SetIdL(identifier2);
+        }
+    
+    TPtrC8 identifier3 = SenXmlUtils::AttrValue(aAttributes, KAssertionId);
+    if(identifier3.Length()>0)
+        {
+        SetIdL(identifier3);
+        }
+
+    /*
+
+    for(int i=0; i<aAttributes.Count(); i++)
+        {
+        TPtrC8 attrName = aAttributes[i].Attribute().LocalName().DesC();
+        if( attrName == KId)
+            {
+
+            SetIdL(aAttributes[i].Value().DesC());
+            }
+        else if(attrName == Kwsu_ns_plus_Id)
+            {
+            SetIdL(aAttributes[i].Value().DesC());
+            }
+
+        else if(attrName == KAssertionId)
+            {
+            SetIdL(aAttributes[i].Value().DesC());
+            }
+        }
+    */
+
+    }
+
+EXPORT_C void CSenCredential::ConstructL(
+    const TDesC8&  aNsUri,
+    const TDesC8&  aLocalName,
+    const TDesC8&  aQName,
+    const RAttributeArray& aAttributes )
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    // this ensures we take note of possible namespaces and
+    // prefixed attributes
+    CSenBaseFragment::SetAttributesL(aAttributes);
+
+    TPtrC8 identifier = SenXmlUtils::AttrValue(aAttributes, KId);
+    if(identifier.Length()>0)
+        {
+        SetIdL(identifier);
+        }
+
+    TPtrC8 identifier2 = SenXmlUtils::AttrValue(aAttributes, Kwsu_ns_plus_Id);
+    if(identifier2.Length()>0)
+        {
+        SetIdL(identifier2);
+        }
+    
+    TPtrC8 identifier3 = SenXmlUtils::AttrValue(aAttributes, KAssertionId);
+    if(identifier3.Length()>0)
+        {
+        SetIdL(identifier3);
+        }
+    /*
+    // we want to save its ID and validity
+    for(int i=0; i<aAttributes.Count(); i++)
+        {
+        TPtrC8 attrName = aAttributes[i].Attribute().LocalName().DesC();
+        if(attrName == KId)  
+            {
+            SetIdL(aAttributes[i].Value().DesC());
+            }
+
+        if(attrName == Kwsu_ns_plus_Id)
+            {
+            SetIdL(aAttributes[i].Value().DesC());
+            }
+
+        if(attrName == KAssertionId)
+            {
+            SetIdL(aAttributes[i].Value().DesC());
+            }
+        }
+    */
+    }
+
+EXPORT_C CSenCredential::CSenCredential()
+:
+    iId(NULL),
+    iNotOnOrAfter(Time::NullTTime())
+    {
+    }
+
+EXPORT_C CSenCredential::~CSenCredential()
+    {
+    delete iId;
+    }
+
+void CSenCredential::SetIdL(const TDesC8& aNewId)
+    {
+    HBufC8* pNew = aNewId.AllocL();
+    delete iId;
+    iId = pNew;
+    }
+
+EXPORT_C const TDesC8& CSenCredential::Id()
+    {
+    if(iId)
+        {
+        return *iId;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+
+EXPORT_C void CSenCredential::StartElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    if(aLocalName.Compare(KConditions) == 0)
+        {
+        // we should save the notOnOrAfter attribute value
+        TPtrC8 ptr = SenXmlUtils::AttrValue(aAttributes, KVal_NotOnOrAfter );
+
+        // Convert dateTime (from XML schema) to Symbian TTime.
+        // The returned time will be in UTC.
+        if (ptr.Length() > 0)
+            {
+            iNotOnOrAfter = SenDateUtils::FromXmlDateTimeL(ptr);
+            }
+        }
+    CSenBaseFragment::StartElementL(aNsUri, 
+            aLocalName, aQName, aAttributes);
+    }
+
+EXPORT_C TTime& CSenCredential::ValidUntil()
+    {
+    return iNotOnOrAfter;
+    }
+
+
+EXPORT_C void CSenCredential::SetValidUntil(TTime& aTime)
+    {
+    iNotOnOrAfter = aTime;
+    }
+
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/sencredential2.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,335 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenCredential2.h>
+#include <SenFacet.h>
+#include <SenDateUtils.h>
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include <SenXmlUtils.h>
+#include <SenXmlServiceDescription.h>
+
+
+#ifdef SYMBIAN_SECURE_ECOM
+    // for S60 FP3 (2.8) platform or newer (3.0 and above)
+    #include <xml/attribute.h> // needed for RAttributeArray
+//#else  // for S60 FP2 platform (2.6) or older
+    //#include "Attribute.h"
+#endif
+
+using namespace Xml;
+
+namespace
+    {
+//    _LIT8(KSenCredentialIdentifierLocalname, "CredentialIdentifier");
+
+    // Identifiers which are accepted (and searched after)
+    _LIT8(KId,                      "ID");
+    _LIT8(Kwsu_ns_plus_Id,          "wsu:Id");
+    _LIT8(KAssertionId,             "AssertionID");
+
+    _LIT8(KConditions,              "Conditions");
+    _LIT8(KVal_NotOnOrAfter,        "NotOnOrAfter");
+    
+//    _LIT8(KSenCredentialId,         "SenCredentialId");
+//    _LIT8(KProviderIdLocalName,     "ProviderID");
+    
+//    const TInt KCredIdBufSize       = 128;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewL()
+    {
+    CSenCredential2* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewLC()
+    {
+    CSenCredential2* pNew = new (ELeave) CSenCredential2;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(KNullDesC8);
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenCredential2* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenCredential2* pNew = new (ELeave) CSenCredential2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenCredential2* pNew = NewLC(aNsUri, aLocalName,
+                                aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent)
+    {
+    CSenCredential2* pNew = new (ELeave) CSenCredential2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+    
+EXPORT_C CSenCredential2* CSenCredential2::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenCredential2* pNew = NewLC(aNsUri, aLocalName,
+                                       aQName, aAttributes,
+                                       aParent, aOwnerDocument);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aParent,
+                                            RSenDocument& aOwnerDocument)
+    {
+    CSenCredential2* pNew = new (ELeave) CSenCredential2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent,
+                         aOwnerDocument);
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewL(
+                                             const CSenCredential2& aCredential)
+    {
+    CSenCredential2* pNew = NewLC(aCredential);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenCredential2* CSenCredential2::NewLC(
+                                             const CSenCredential2& aCredential)
+    {
+    CSenCredential2* pNew = new (ELeave) CSenCredential2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL((CSenCredential2&)aCredential);
+    return pNew;
+    }
+
+EXPORT_C void CSenCredential2::ConstructL(const TDesC8& aLocalName)
+    {
+    CSenFragmentBase::BaseConstructL(aLocalName);
+    }
+
+EXPORT_C void CSenCredential2::BaseConstructL(CSenCredential2& aCredential)
+    {
+    CSenFragmentBase::BaseConstructL(aCredential.AsElementL());
+    if (aCredential.ValidUntil() != Time::NullTTime())
+        {
+        SetValidUntil(aCredential.ValidUntil());
+        }
+    SetIdL(aCredential.Id());
+    }
+
+EXPORT_C void CSenCredential2::BaseConstructL(
+                                        const TDesC8&  aNsUri,
+                                        const TDesC8&  aLocalName,
+                                        const TDesC8&  aQName,
+                                        const RAttributeArray& aAttributes,
+                                        TXmlEngElement& aParent)
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName, aAttributes,
+                                     aParent);
+
+    // we want to save its ID and validity
+    TPtrC8 identifier = SenXmlUtils::AttrValue(aAttributes, KId);
+    if(identifier.Length()>0)
+        {
+        SetIdL(identifier);
+        }
+
+    TPtrC8 identifier2 = SenXmlUtils::AttrValue(aAttributes, Kwsu_ns_plus_Id);
+    if(identifier2.Length()>0)
+        {
+        SetIdL(identifier2);
+        }
+
+    TPtrC8 identifier3 = SenXmlUtils::AttrValue(aAttributes, KAssertionId);
+    if(identifier3.Length()>0)
+        {
+        SetIdL(identifier3);
+        }
+    }
+
+EXPORT_C void CSenCredential2::BaseConstructL(const TDesC8&  aNsUri,
+                                        const TDesC8&  aLocalName,
+                                        const TDesC8&  aQName,
+                                        const RAttributeArray& aAttributes,
+                                        TXmlEngElement& aParent,
+                                        RSenDocument& aOwnerDocument)
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName, aAttributes,
+                                     aParent, aOwnerDocument);
+
+    // we want to save its ID and validity
+    TPtrC8 identifier = SenXmlUtils::AttrValue(aAttributes, KId);
+    if(identifier.Length()>0)
+        {
+        SetIdL(identifier);
+        }
+
+    TPtrC8 identifier2 = SenXmlUtils::AttrValue(aAttributes, Kwsu_ns_plus_Id);
+    if(identifier2.Length()>0)
+        {
+        SetIdL(identifier2);
+        }
+
+    TPtrC8 identifier3 = SenXmlUtils::AttrValue(aAttributes, KAssertionId);
+    if(identifier3.Length()>0)
+        {
+        SetIdL(identifier3);
+        }
+    }
+
+EXPORT_C void CSenCredential2::BaseConstructL(const TDesC8&  aNsUri,
+                                        const TDesC8&  aLocalName,
+                                        const TDesC8&  aQName,
+                                        const RAttributeArray& aAttributes)
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+
+    TPtrC8 identifier = SenXmlUtils::AttrValue(aAttributes, KId);
+    if(identifier.Length()>0)
+        {
+        SetIdL(identifier);
+        }
+
+    TPtrC8 identifier2 = SenXmlUtils::AttrValue(aAttributes, Kwsu_ns_plus_Id);
+    if(identifier2.Length()>0)
+        {
+        SetIdL(identifier2);
+        }
+
+    TPtrC8 identifier3 = SenXmlUtils::AttrValue(aAttributes, KAssertionId);
+    if(identifier3.Length()>0)
+        {
+        SetIdL(identifier3);
+        }
+    }
+
+EXPORT_C CSenCredential2::CSenCredential2()
+:
+    iId(NULL),
+    iNotOnOrAfter(Time::NullTTime())
+    {
+    }
+
+EXPORT_C CSenCredential2::~CSenCredential2()
+    {
+    delete iId;
+    }
+
+EXPORT_C void CSenCredential2::SetIdL(const TDesC8& aNewId)
+    {
+    HBufC8* pNew = aNewId.AllocL();
+    delete iId;
+    iId = pNew;
+    }
+
+EXPORT_C const TDesC8& CSenCredential2::Id()
+    {
+    if(iId)
+        {
+        return *iId;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+
+EXPORT_C void CSenCredential2::OnStartElementL(const RTagInfo& aElement,
+        							           const RAttributeArray& aAttributes,
+        						 	           TInt aErrorCode)
+    {
+    if ( aElement.LocalName().DesC().Compare(KConditions) == 0)
+        {
+        // we should save the notOnOrAfter attribute value
+        TPtrC8 ptr = SenXmlUtils::AttrValue(aAttributes, KVal_NotOnOrAfter );
+
+        // Convert dateTime (from XML schema) to Symbian TTime.
+        // The returned time will be in UTC.
+        if (ptr.Length() > 0)
+            {
+            iNotOnOrAfter = SenDateUtils::FromXmlDateTimeL(ptr);
+            }
+        }
+    CSenFragmentBase::OnStartElementL(aElement, aAttributes, aErrorCode);
+    }
+
+EXPORT_C TTime& CSenCredential2::ValidUntil()
+    {
+    return iNotOnOrAfter;
+    }
+
+
+EXPORT_C void CSenCredential2::SetValidUntil(TTime& aTime)
+    {
+    iNotOnOrAfter = aTime;
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senfacet.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES 
+#include "SenFacet.h"
+
+EXPORT_C CSenFacet* CSenFacet::NewL()
+    {
+    CSenFacet* pNew = new (ELeave) CSenFacet;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(KSenFacet);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenFacet* CSenFacet::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CSenFacet* pNew = new (ELeave) CSenFacet;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenFacet* CSenFacet::NewL(CSenElement& aCopiedSource)
+    {
+    CSenFacet* pNew = new (ELeave) CSenFacet;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aCopiedSource);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+
+EXPORT_C CSenFacet::~CSenFacet()
+    {
+    }
+
+EXPORT_C CSenFacet::CSenFacet()
+    {
+    }
+
+EXPORT_C void CSenFacet::ConstructL(const TDesC8& aLocalName)
+    {
+    BaseConstructL(aLocalName);
+    }
+
+EXPORT_C void CSenFacet::ConstructL(CSenElement& aCopiedSource)
+    {
+    BaseConstructL(aCopiedSource.LocalName());
+    CopyFromL(aCopiedSource);
+    }
+
+EXPORT_C void CSenFacet::ConstructL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aQName,
+                             const RAttributeArray& aAttributes)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    }
+
+EXPORT_C void CSenFacet::SetNameL(const TDesC8& aName)
+    {
+    AddAttributeL(KFacetAttrName,aName);
+    }
+
+EXPORT_C void CSenFacet::SetTypeL(const TDesC8& aType)
+    {
+    AddAttributeL(KFacetAttrType,aType);
+    }
+
+EXPORT_C void CSenFacet::SetValueL(const TDesC8& aValue)
+    {
+    SetContentL(aValue);
+    }
+
+EXPORT_C TPtrC8 CSenFacet::Name()
+    {
+    const TDesC8* pAttrValue = AttrValue(KFacetAttrName);
+    if (pAttrValue) return TPtrC8(*pAttrValue);
+    else return KNullDesC8();
+    }
+
+EXPORT_C TPtrC8 CSenFacet::Type()
+    {
+    const TDesC8* pAttrValue = AttrValue(KFacetAttrType);
+    if (pAttrValue) return TPtrC8(*pAttrValue);
+    else return KNullDesC8();
+    }
+
+EXPORT_C TPtrC8 CSenFacet::Value()
+    {
+    return this->Content();
+    }
+    
+void CSenFacet::CopyFromL(CSenElement& aSource)
+    {
+    TPtrC8 sourceContent = aSource.Content();
+    if (sourceContent.Length() > 0)
+        {
+        if ( ! HasContent() )
+            {
+            SetContentL(sourceContent);
+            }
+        else
+            {
+            RWriteStream& ws = ContentWriteStreamL();
+            ws.WriteL(sourceContent);
+            }
+        }
+
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aSource.AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+
+            // duplicate check. Now overrides the original value
+            CSenBaseAttribute* pOriginal = FindAttr(pBaseAttribute->Name());
+            if (pOriginal)
+                {
+                pOriginal->SetValueL(pBaseAttribute->Value());
+                continue;
+                }
+
+            CSenBaseAttribute* pNewBaseAttribute =
+                CSenBaseAttribute::NewL(pBaseAttribute->Name(),
+                                        pBaseAttribute->Value());
+            CleanupStack::PushL(pNewBaseAttribute);
+            
+            RPointerArray<CSenBaseAttribute>& attributes = AttributesL();
+#ifdef EKA2
+            attributes.AppendL(pNewBaseAttribute);
+#else
+            User::LeaveIfError(attributes.Append(pNewBaseAttribute));
+#endif
+            CleanupStack::Pop(pNewBaseAttribute);
+            }
+        }
+
+    RPointerArray<CSenElement> sourceElements = aSource.ElementsL();
+    if (sourceElements.Count() > 0)
+        {
+        for (TInt i=0;i<sourceElements.Count(); i++)
+            {
+            CSenElement* pElement = sourceElements[i];
+            CSenElement* pNewElement =
+                                CSenBaseElement::NewL(pElement->LocalName());
+            pNewElement->SetParent(this);
+            CleanupStack::PushL(pNewElement);
+            pNewElement->CopyFromL(*pElement);
+            
+            RPointerArray<CSenElement>& elements = ElementsL();
+#ifdef EKA2
+            elements.AppendL(pNewElement);
+#else
+            User::LeaveIfError(elements.Append(pNewElement));
+#endif // EKA2
+            CleanupStack::Pop(pNewElement);
+            }
+        }
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senidentityprovider.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,425 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+
+#include <SenServiceConnection.h> // framework IDs
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include <SenXmlUtils.h>
+
+// #include "SenDebug.h"
+
+//#include "MSenIdentityManager.h"
+#include "SenIdentityProvider.h"
+
+// CONSTANTS
+
+
+
+
+namespace
+    {
+    _LIT8(KDefaultIdentityAttributeName,    "default");
+    _LIT8(KNewElementName,                  "IdentityProvider");
+    _LIT8(KServiceID,                       "ServiceID");
+//    _LIT8(KFakeIMEI8,                       "012345678901234");
+    }
+
+EXPORT_C CSenIdentityProvider::CSenIdentityProvider(
+                                                TDescriptionClassType aType)
+: CSenXmlServiceDescription(aType)
+    {
+    }
+
+EXPORT_C const TDesC8& CSenIdentityProvider::NewElementName()
+    {
+    return KNewElementName();
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewL(
+                                                    const TDesC8& aEndpoint)
+    {
+    CSenIdentityProvider* pNew = NewLC(aEndpoint);
+    CleanupStack::Pop();
+    return(pNew);
+    }
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewLC(
+                                                    const TDesC8& aEndpoint)
+    {
+    CSenIdentityProvider* pNew =
+        new (ELeave) CSenIdentityProvider(EIdentityProvider);
+
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aEndpoint);
+    return pNew;
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewL(
+                                                    const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract )
+    {
+    CSenIdentityProvider* pNew = NewLC(aEndpoint, aContract);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewLC(
+                                                    const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract )
+    {
+    CSenIdentityProvider* pNew =
+        new (ELeave) CSenIdentityProvider(EIdentityProvider);
+
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aEndpoint, aContract);
+    return pNew;
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewL(
+                                                    const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID)
+    {
+    CSenIdentityProvider* pNew = NewLC(aEndpoint, aContract, aProviderID);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewLC(
+                                                    const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID)
+    {
+    CSenIdentityProvider* pNew =
+        new (ELeave) CSenIdentityProvider(EIdentityProvider);
+
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aEndpoint, aContract, aProviderID);
+    return pNew;
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewL(
+                                                    const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID,
+                                                    const TDesC8& aServiceID)
+    {
+    CSenIdentityProvider* pNew = NewLC(aEndpoint, aContract,
+                                        aProviderID, aServiceID);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenIdentityProvider* CSenIdentityProvider::NewLC(
+                                                    const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID,
+                                                    const TDesC8& aServiceID)
+    {
+    CSenIdentityProvider* pNew =
+        new (ELeave) CSenIdentityProvider(EIdentityProvider);
+
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aEndpoint, aContract, aProviderID, aServiceID);
+    return pNew;
+    }
+
+
+
+EXPORT_C void CSenIdentityProvider::ConstructL(const TDesC8& aEndpoint)
+    {
+    if(aEndpoint.Length()>0)
+        {
+        CSenXmlServiceDescription::ConstructL(aEndpoint, KSenIdpLibertyIdWsfAsContract);
+        SetFrameworkIdL( KDefaultIdWsfFrameworkID );
+        }
+    else
+        {
+        CSenXmlServiceDescription::ConstructL();
+        }
+    }
+
+EXPORT_C void CSenIdentityProvider::ConstructL( const TDesC8& aEndpoint,
+                                                const TDesC8& aContract)
+    {
+    if(aContract.Length()>0)
+        {
+        CSenXmlServiceDescription::ConstructL(aEndpoint, aContract);
+        }
+    else
+        {
+        // Defaults to ID-WSF framework authentication service contract:
+        // - "urn:liberty:as:2004-04".
+        ConstructL(aEndpoint);
+        }
+    }
+
+EXPORT_C void CSenIdentityProvider::ConstructL( const TDesC8& aEndpoint,
+                                                const TDesC8& aContract,
+                                                const TDesC8& aProviderID)
+    {
+    ConstructL(aEndpoint, aContract);
+    if(aProviderID.Length()>0)
+        {
+        SetProviderID(aProviderID);
+        }
+    // else: no <ProviderID> child element will be added
+    }
+
+EXPORT_C void CSenIdentityProvider::ConstructL( const TDesC8& aEndpoint,
+                                                const TDesC8& aContract,
+                                                const TDesC8& aProviderID,
+                                                const TDesC8& aServiceID)
+    {
+    ConstructL(aEndpoint, aContract, aProviderID);
+    if(aServiceID.Length()>0)
+        {
+        SetServiceID(aServiceID);
+        }
+    // else: no <ServiceID> child element will be added
+    }
+
+//////////////////////////////////////////////////////////////////////////
+
+
+EXPORT_C CSenIdentityProvider::~CSenIdentityProvider()
+    {
+    }
+
+EXPORT_C TPtrC8 CSenIdentityProvider::UserName()
+    {
+    TPtrC8 username = AuthzID();
+    if (username.Length()==0)
+        {
+        return AdvisoryAuthnID();
+        }
+    return username;
+    }
+
+EXPORT_C TPtrC8 CSenIdentityProvider::AuthzID()
+    {
+    return ContentOf( KSenIdpAuthzIDLocalname() );
+    }
+
+EXPORT_C TPtrC8 CSenIdentityProvider::AdvisoryAuthnID()
+    {
+    return ContentOf( KSenIdpAdvisoryAuthnIdLocalname() );
+    }
+
+EXPORT_C TPtrC8 CSenIdentityProvider::ProviderID()
+    {
+    return ContentOf( KSenIdpProviderIdLocalname() );
+    }
+
+EXPORT_C TPtrC8 CSenIdentityProvider::Password()
+    {
+    return ContentOf( KSenIdpPasswordLocalname() );
+    }
+
+EXPORT_C const TDesC8& CSenIdentityProvider::IMEI()
+    {
+    return KFakeIMEI8();
+    }
+
+EXPORT_C TBool CSenIdentityProvider::IsDefault()
+    {
+    TBool ret = EFalse;
+    if ( AsElement().AttrValue( KDefaultIdentityAttributeName ) )
+        {
+        ret = ETrue;
+        }
+
+    return ret;
+    }
+//EXPORT_C TInt CSenIdentityProvider::SetUserInfo(const TDesC8& aAuthzID,
+//                                                const TDesC8& aAdvisoryAuthnID,
+//                                                const TDesC8& aPassword )
+//    {
+//    TInt leaveCode(KErrNone);
+//    TRAP(leaveCode, SetUserInfoL(aAuthzID, aAdvisoryAuthnID, aPassword));
+//    return leaveCode;
+//    }
+    
+EXPORT_C TInt CSenIdentityProvider::SetUserInfoL(const TDesC8& aAuthzID,
+                                                const TDesC8& aAdvisoryAuthnID,
+                                                const TDesC8& aPassword )
+    {
+    // For MS this function sud be commented as WLM already send xml encoded password
+    //HBufC8* encPassword = SenXmlUtils::EncodeHttpCharactersLC(aPassword);
+    if(aAuthzID.Length()>0)
+        {
+        SetContentOfL(KSenIdpAuthzIDLocalname, aAuthzID);
+        }
+    if(aAdvisoryAuthnID.Length()>0)
+        {
+        SetContentOfL(KSenIdpAdvisoryAuthnIdLocalname, aAdvisoryAuthnID);
+        }
+    //if(aPassword.Length()>0) // in order to clean password, when listing accounts
+        {
+        SetContentOfL(KSenIdpPasswordLocalname, aPassword );
+        }
+    //CleanupStack::PopAndDestroy(encPassword);
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenIdentityProvider::SetAccountExtensionsL(const TDesC8& aDetail)
+    {
+    SetContentOfL(KSenAccountExtensions, aDetail);
+    //CSenElement* elem = NULL;
+    //AddElementL(elem);
+    return KErrNone;
+    }
+
+EXPORT_C TPtrC8 CSenIdentityProvider::AccountExtensions(CSenElement*& aAccExt)
+    {
+    aAccExt = this->AsElement().Element(KSenAccountExtensions());
+    return ContentOf( KSenAccountExtensions() );
+    }
+
+EXPORT_C TBool CSenIdentityProvider::IsTrustedByL(
+                        MSenServiceDescription& aServiceDescription )
+    {
+    TBool retVal(EFalse);
+    TPtrC8 endpoint = aServiceDescription.Endpoint();
+    TPtrC8 contract = aServiceDescription.Contract();
+
+    TPtrC8 providerID = ProviderID();
+    if(providerID.Length()>0)
+        {
+        if((endpoint.Length() > 0) && (providerID.Length() > 0)
+                       && endpoint == providerID)
+            {
+            retVal = ETrue;
+            }
+        }
+
+    if(!retVal) // no need to allocate new array etc if we already have a trust
+        {
+        // owned elsewhere:
+        RPointerArray<CSenElement> services = AsElement().ElementsL();
+        TInt serviceCount = services.Count();
+        TInt i(0);
+        while (!retVal && i < serviceCount)
+            {
+            if(services[i]->LocalName() == KServiceID)
+                {
+                TPtrC8 serviceID = services[i]->Content();
+
+                if(serviceID.Length()>0 &&
+                        ( (endpoint.Length() > 0 && serviceID == endpoint)
+                                       ||
+                          (contract.Length() > 0 && serviceID == contract))
+                   )
+                    {
+                    retVal = ETrue;
+                    }
+                }
+            i++;
+            }
+        }
+
+    return retVal;
+    }
+
+EXPORT_C TBool CSenIdentityProvider::IsTrustedByL( const TDesC8& aProviderIdOrServiceId )
+    {
+    //SENDEBUG_L("CSenIdentityProvider::IsTrustedByL");
+    TBool trusted(EFalse);
+    TPtrC8 providerID = ProviderID();
+    if(providerID.Length()>0)
+        {
+        if(aProviderIdOrServiceId == providerID)
+            {
+            //SENDEBUG_L("  The ProviderID's are equal.");
+            trusted = ETrue;
+            }
+        }
+
+    if(!trusted) // no need for new array etc if we already have a trust
+        {
+        RPointerArray<CSenElement> services = AsElement().ElementsL();
+        TInt serviceCount = services.Count();
+        TInt i(0);
+        while (!trusted && i < serviceCount)
+            {
+            if (services[i]->LocalName() == KServiceID )
+                {
+                TPtrC8 serviceID = services[i]->Content();
+                if (serviceID.Length()>0 && serviceID == aProviderIdOrServiceId)
+                    {
+                    trusted = ETrue;
+                    }
+                }
+            i++;
+            }
+        }
+    return trusted;
+    }
+
+EXPORT_C TInt CSenIdentityProvider::SetProviderID( const TDesC8& aProviderID )
+    {
+    TInt retVal(KErrNone);
+    TInt leaveCode(KErrNone);
+    TRAP( leaveCode, retVal = SetProviderIdL( aProviderID ); )
+    if ( leaveCode )
+        {
+        retVal = leaveCode;
+        }
+    return retVal;
+    }
+    
+EXPORT_C TInt CSenIdentityProvider::SetProviderIdL( const TDesC8& aProviderID )
+    {
+    if ( aProviderID.Length() == 0 )
+        {
+        return KErrArgument; // zero-length provider ID
+        }
+    else 
+        {
+        SetContentOfL( KSenIdpProviderIdLocalname, aProviderID );
+        return KErrNone;
+        }
+    }
+
+EXPORT_C TInt CSenIdentityProvider::SetServiceID( const TDesC8& aServiceID )
+    {
+    TInt retVal(KErrNone);
+    if(aServiceID.Length()>0)
+        {
+        TRAP(retVal, SetContentOfL(KServiceID, aServiceID);)
+        }
+    return retVal;
+    }
+
+// @deprecated. This method is no longer in use. Kept only to keep BC with 3.0
+EXPORT_C HBufC8* CSenIdentityProvider::HttpCredentialsL( MSenIdentityManager& /* aMgr */ )
+    {
+    return NULL;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senidentityprovideridarray8.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenIdentityProviderIdArray8.h"
+
+
+EXPORT_C CSenIdentityProviderIdArray8* CSenIdentityProviderIdArray8::NewL()
+    {
+    CSenIdentityProviderIdArray8* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenIdentityProviderIdArray8* CSenIdentityProviderIdArray8::NewLC()
+    {
+    // without an argument, a non-strict array is created:
+    CSenIdentityProviderIdArray8* pNew =
+                            new (ELeave) CSenIdentityProviderIdArray8(EFalse);
+
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenIdentityProviderIdArray8* CSenIdentityProviderIdArray8::NewL(
+                                                        const TBool aStrict)
+    {
+    CSenIdentityProviderIdArray8* pNew = NewLC(aStrict);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenIdentityProviderIdArray8* CSenIdentityProviderIdArray8::NewLC(
+                                                        const TBool aStrict)
+    {
+    CSenIdentityProviderIdArray8* pNew =
+                            new (ELeave) CSenIdentityProviderIdArray8(aStrict);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+
+void CSenIdentityProviderIdArray8::ConstructL()
+    {
+    }
+
+CSenIdentityProviderIdArray8::CSenIdentityProviderIdArray8(const TBool aStrict)
+:   CDesC8ArraySeg(5),
+    iStrict(aStrict)
+    {
+    }
+
+// destructor
+EXPORT_C CSenIdentityProviderIdArray8::~CSenIdentityProviderIdArray8()
+    {
+
+    }
+
+EXPORT_C TBool CSenIdentityProviderIdArray8::IsStrict() const
+    {
+    return iStrict;
+    }
+
+EXPORT_C void CSenIdentityProviderIdArray8::SetStrict(TBool aStrict)
+    {
+    iStrict =  aStrict;
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senpolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,493 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <s32strm.h>
+
+//#include "SenDebug.h"
+
+#include <SenElement.h>
+#include <SenXmlUtils.h>
+
+#include "senpolicy.h"
+#include "SenIdentityProviderIdArray8.h"
+
+// ============================ LOCAL FUNCTIONS ===============================
+
+namespace
+    {
+    _LIT8(KPolicyLocalName, "Policy");
+    _LIT8(KTransportLocalName, "Transport");
+    _LIT8(KIapIdLocalName, "IapId");
+    _LIT8(KSnapIdLocalName, "SnapId");
+    _LIT8(KIdentityProviderIDsLocalName, "IdentityProviderIDs");
+    _LIT8(KIdentityProviderIDsStrictAttrName, "strict");
+    _LIT8(KIdentityProviderIDsStrictAttrTrue, "true");
+    _LIT8(KIdentityProviderIDLocalName, "IdentityProviderID");
+    }
+
+
+EXPORT_C CSenPolicy* CSenPolicy::NewL()
+    {
+    CSenPolicy* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenPolicy* CSenPolicy::NewLC()
+    {
+    CSenPolicy* pNew = new (ELeave) CSenPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KPolicyLocalName());
+    return pNew;
+    }
+
+
+EXPORT_C CSenPolicy* CSenPolicy::NewL(TUint32 aIapId)
+    {
+    CSenPolicy* pNew = NewLC(aIapId);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenPolicy* CSenPolicy::NewLC(TUint32 aIapId)
+    {
+    CSenPolicy* pNew = new (ELeave) CSenPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KPolicyLocalName(), aIapId);
+    return pNew;
+    }
+
+EXPORT_C CSenPolicy* CSenPolicy::NewL(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenPolicy* pNew = NewLC(aId, aIsSnapId);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenPolicy* CSenPolicy::NewLC(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenPolicy* pNew = new (ELeave) CSenPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KPolicyLocalName(), aId, aIsSnapId);
+    return pNew;
+    }
+
+
+CSenPolicy::CSenPolicy()
+:   iIdpIdList(NULL)
+    {
+    }
+
+CSenPolicy::~CSenPolicy()
+    {
+    delete iIdpIdList;
+    }
+
+EXPORT_C void CSenPolicy::BaseConstructL(const TDesC8& aPolicyLocalName)
+    {
+    CSenBaseFragment::BaseConstructL(aPolicyLocalName);
+    }
+
+EXPORT_C void CSenPolicy::BaseConstructL(const TDesC8& aPolicyLocalName,
+                                         TUint32 aIapId)
+    {
+    CSenBaseFragment::BaseConstructL(aPolicyLocalName);
+    SetIapIdL(aIapId);
+    }
+
+EXPORT_C void CSenPolicy::BaseConstructL(const TDesC8& aPolicyLocalName,
+                                         TUint32 aId, TBool aIsSnapId)
+    {
+    CSenBaseFragment::BaseConstructL(aPolicyLocalName);
+    if (aIsSnapId == EFalse)
+        {
+    SetIapIdL(aId);
+        }
+    else
+        {
+    SetSnapIdL(aId);
+        }
+    }
+
+EXPORT_C TBool CSenPolicy::Accepts(MSenPolicy& aPolicyPattern)
+    {
+    TBool retVal(ETrue);
+    TRAPD(err, retVal = AcceptsL(aPolicyPattern));
+    if (err) return EFalse;
+    return retVal;
+    }
+
+TBool CSenPolicy::AcceptsL(MSenPolicy& aPolicyPattern)
+    {
+    TUint32 thisIapID(0);
+    TUint32 patternIapID(0);
+
+    if(aPolicyPattern.IapId(patternIapID) == KErrNone
+        && (IapId(thisIapID) != KErrNone
+         || patternIapID!=thisIapID))
+        {
+        return EFalse; // policies do NOT match(!)
+        }
+
+    const CSenIdentityProviderIdArray8& patternIdps =
+                                    aPolicyPattern.IdentityProviderIds8L();
+    if(patternIdps.IsStrict())
+        {
+        const CSenIdentityProviderIdArray8& thisIdps = IdentityProviderIds8L();
+        TInt thisCount(thisIdps.Count());
+        TInt pos(-1);
+        TBool matches(EFalse);
+        for(TInt i=0; i<thisCount; i++)
+            {
+            if(patternIdps.Find(thisIdps[i], pos, ECmpNormal)==KErrNone)
+                {
+                matches = ETrue;
+                break;
+                }
+            }
+        return matches;
+        }
+
+    return ETrue;
+    }
+
+
+// Setter for IAP ID
+EXPORT_C void CSenPolicy::SetIapIdL(TUint32 aIapId)
+    {
+    CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+    if(aIapId > 0)
+        {
+        if(!pTransportElement)
+            {
+            pTransportElement = &(AsElement().AddElementL(KTransportLocalName));
+            }
+        CSenElement* pSnapIdElement =
+        pTransportElement->Element(KSnapIdLocalName);
+
+        if(pSnapIdElement)
+            {
+            pSnapIdElement = pTransportElement->RemoveElement(KSnapIdLocalName);
+            }        
+        CSenElement* pIapIdElement =
+                                pTransportElement->Element(KIapIdLocalName);
+        if(!pIapIdElement)
+            {
+            pIapIdElement = &(pTransportElement->AddElementL(KIapIdLocalName));
+            }
+        TBuf8<128> buf;
+        buf.AppendFormat(_L8("%u"), aIapId);
+        pIapIdElement->SetContentL(buf);        
+        }
+    else 
+        {
+        if(pTransportElement)
+            {
+            CSenElement* pIapIdElement =
+            pTransportElement->Element(KIapIdLocalName);
+
+            if(pIapIdElement)
+                {
+                pIapIdElement = pTransportElement->RemoveElement(KIapIdLocalName);
+                }
+            }
+        }
+
+
+    }
+
+// Getter for IAP ID
+EXPORT_C TInt CSenPolicy::IapId(TUint32& aCurrentIapId)
+    {
+    CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+    if(pTransportElement)
+        {
+        CSenElement* pIapIdElement =
+                                pTransportElement->Element(KIapIdLocalName);
+        if(pIapIdElement && pIapIdElement->HasContent())
+            {
+            //SENDEBUG((_L("CSenPolicy::IapIdL: content found")));
+            TPtrC8 content = pIapIdElement->Content();
+            TLex8 lex(content);
+
+            TInt err = lex.Val(aCurrentIapId, EDecimal);
+            return err;
+            }
+        //SENDEBUG((_L("CSenPolicy::IapIdL: <IapId> element not found")));
+        }
+    //SENDEBUG((_L("CSenPolicy::IapIdL: <Transport> element not found")));
+    return KErrNotFound;
+    }
+
+// Setter for SNAP ID
+EXPORT_C void CSenPolicy::SetSnapIdL(TUint32 aSnapId)
+    {
+    if(aSnapId > 0)
+        {
+        CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+        if(!pTransportElement)
+            {
+            pTransportElement = &(AsElement().AddElementL(KTransportLocalName));
+            }
+        
+        CSenElement* pIapIdElement =
+        pTransportElement->Element(KIapIdLocalName);
+
+        if(pIapIdElement)
+            {
+            pIapIdElement = pTransportElement->RemoveElement(KIapIdLocalName);
+            }        
+        
+        CSenElement* pSnapIdElement =
+                                pTransportElement->Element(KSnapIdLocalName);
+        if(!pSnapIdElement)
+            {
+            pSnapIdElement = &(pTransportElement->AddElementL(KSnapIdLocalName));
+            }
+        TBuf8<128> buf;
+        buf.AppendFormat(_L8("%u"), aSnapId);
+        pSnapIdElement->SetContentL(buf);        
+        }
+    else
+        {
+        CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+        if(pTransportElement)
+            {
+            CSenElement* pSnapIdElement =
+            pTransportElement->Element(KSnapIdLocalName);
+
+            if(pSnapIdElement)
+                {
+                pSnapIdElement = pTransportElement->RemoveElement(KSnapIdLocalName);
+                }
+            }
+        }
+
+    }
+
+// Getter for SNAP ID
+EXPORT_C TInt CSenPolicy::SnapId(TUint32& aCurrentSnapId)
+    {
+    CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+    if(pTransportElement)
+        {
+        CSenElement* pSnapIdElement =
+                                pTransportElement->Element(KSnapIdLocalName);
+        if(pSnapIdElement && pSnapIdElement->HasContent())
+            {
+            //SENDEBUG((_L("CSenPolicy::SnapIdL: content found")));
+            TPtrC8 content = pSnapIdElement->Content();
+            TLex8 lex(content);
+
+            TInt err = lex.Val(aCurrentSnapId, EDecimal);
+            return err;
+            }
+        //SENDEBUG((_L("CSenPolicy::SnapIdL: <SnapId> element not found")));
+        }
+    //SENDEBUG((_L("CSenPolicy::SnapIdL: <Transport> element not found")));
+    return KErrNotFound;
+    }
+
+// Setter: overrides current values with the given values from the array
+EXPORT_C void CSenPolicy::SetIdentityProviderIdsL(
+                                        CSenIdentityProviderIdArray8& aList)
+    {
+    CSenElement* pListElement =
+                            AsElement().Element(KIdentityProviderIDsLocalName);
+
+    if(pListElement)
+        {
+        CSenElement* pRemoved = AsElement().RemoveElement(*pListElement);
+        delete pRemoved;
+        }
+
+    TInt count(aList.Count());
+    if(count>0)
+        {
+        for(TInt i=0; i<count; i++)
+            {
+            TPtrC8 providerId = aList[i];
+            if(providerId.Length()>0)
+                {
+                AddIdentityProviderIdL(providerId);
+                }
+            }
+        }
+    }
+
+// Adder: adds a new IDP ID value at the end of the current list value(s)
+// Checks for duplicate (does not insert new ID elements with equal content)
+// @return KErrAlreadyExists, if a duplicate is tried to add
+//         KErrArgument if a zero-length descriptor is tried
+//         to add (aProviderId.Length() == 0)
+//
+//          NOTE: allocates a copy of given aProviderId!
+//
+EXPORT_C TInt CSenPolicy::AddIdentityProviderIdL(const TDesC8& aProviderId)
+    {
+    if(aProviderId.Length()>0)
+        {
+        // there is something relevant to add..
+
+        // check next that <IdentityProviderIDs> element exists
+        CSenElement* pListElement =
+                            AsElement().Element(KIdentityProviderIDsLocalName);
+
+        // check if this policy is "empty" (no content yet)
+        if(!pListElement)
+            {
+            // add the <IdentityProviderIDs> element..
+            pListElement =
+                    &AsElement().AddElementL(KIdentityProviderIDsLocalName);
+            }
+        else
+            {
+            // check if ID being inserted already exists
+            // (prevent inserting a duplicate)
+
+            RPointerArray<CSenElement>& children = pListElement->ElementsL();
+            TInt childCount(children.Count());
+
+            // loop through child elements and check their content
+            for(TInt i=0; i<childCount; i++)
+                {
+                TPtrC8 content = children[i]->Content();
+                if(content == aProviderId)
+                    {
+                    // duplicate found(!)
+                    return KErrAlreadyExists;   
+                    }
+                }
+
+            }
+
+        CSenElement& added =
+                    pListElement->AddElementL(KIdentityProviderIDLocalName);
+
+        added.SetContentL(aProviderId);
+        // content set: ok
+        return KErrNone;
+        }
+    else // tried to add zero length descriptor (aProviderId.Length() == 0)
+        {
+        // return argument error
+        return KErrArgument;
+        }
+    }
+
+// sets (rebuilds) the IAP ID and IDP ID list values from template
+// @return  - a error, if at least one addition of new contents has
+// failed OR KerrNone if every property was successfully reset
+EXPORT_C TInt CSenPolicy::RebuildFrom(MSenPolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+    TRAPD(err, retVal = RebuildFromL(aTemplate));
+    if (err != KErrNone)
+        {
+        retVal = err;
+        }
+    return retVal;
+    }
+
+TInt CSenPolicy::RebuildFromL(MSenPolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+    // check for possible provider policy definition
+
+    TUint32 iapId(0);
+    TInt err = aTemplate.IapId(iapId);
+    if(err==KErrNone)
+        {
+        // update the latest IAP "recommendation"
+        SetIapIdL(iapId);
+        }
+    const CSenIdentityProviderIdArray8& ids =
+                                        aTemplate.IdentityProviderIds8L();
+    TInt idsCount(ids.MdcaCount());
+    for(TInt j=0; j<idsCount; j++)
+        {
+        TPtrC8 value = ids[j];
+        if(value.Length()>0)
+            {
+            err = AddIdentityProviderIdL(value);
+            if(err!=KErrNone)
+                {
+                retVal = err; // indicate that some IDP could not be added
+                }
+            }
+        }
+    return retVal;
+    }
+
+// Getter: return an empty array if no IDP:s have been spesified
+// or a list of IDP arrays if such value(s) have been set.
+//
+// Ownership of the array remains within this class
+EXPORT_C const CSenIdentityProviderIdArray8&
+                                        CSenPolicy::IdentityProviderIds8L()
+    {
+    // construct temporary array and fill it with the xml content
+    CSenIdentityProviderIdArray8* pArray =
+                                        CSenIdentityProviderIdArray8::NewLC();
+
+    // check next that <IdentityProviderIDs> element exists
+    CSenElement* pListElement =
+                            AsElement().Element(KIdentityProviderIDsLocalName);
+    if(pListElement)
+        {
+        // Check if strict attribute has "true" value.
+        const TDesC8* pStrictValue =
+                pListElement->AttrValue(KIdentityProviderIDsStrictAttrName);
+        if(pStrictValue && *pStrictValue == KIdentityProviderIDsStrictAttrTrue)
+            {
+            pArray->SetStrict(ETrue);
+            }
+
+        // next check that child elements exist
+        RPointerArray<CSenElement>& elements  = pListElement->ElementsL();
+        TInt count(elements.Count());
+        for(TInt i=0; i<count; i++)
+            {
+            CSenElement* element = elements[i];
+            if(element && element->HasContent())
+                {
+                pArray->AppendL(element->Content());
+                }
+            }
+        }
+
+    delete iIdpIdList;
+    iIdpIdList = pArray;
+    CleanupStack::Pop(); // pArray
+    return *iIdpIdList;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senproviderpolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This class represents the policy information, which has been
+*                resolved in some way from the actual WSP. Currently applications
+*                typically "just know", which policy WSP prefers, but in the
+*                future this class may be used as a container for data
+*                originating directly from a WSP (as the for example, when the
+*                Liberty ID-WSF evolves).
+*                To point out a single feature, lets go through the Identity
+*                Provider ID list getter, setter and adder -methods; these are
+*                meant to be used as a storing place for a the policy information
+*                Typically the IDP ID list is just a recommendation, and rarely
+*                a strict list.
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <s32strm.h>
+
+#include "senproviderpolicy.h"
+#include "SenElement.h"
+#include "SenXmlUtils.h"
+
+#include "SenIdentityProviderIdArray8.h"
+
+namespace
+    {
+    _LIT8(KTransportLocalName, "Transport");
+    }
+// ============================= LOCAL FUNCTIONS ===============================
+
+namespace
+    {
+    _LIT8(KProviderPolicyLocalName, "ProviderPolicy");
+    }
+
+
+EXPORT_C CSenProviderPolicy* CSenProviderPolicy::NewL()
+    {
+    CSenProviderPolicy* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenProviderPolicy* CSenProviderPolicy::NewLC()
+    {
+    CSenProviderPolicy* pNew = new (ELeave) CSenProviderPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+EXPORT_C CSenProviderPolicy* CSenProviderPolicy::NewL(TUint32 aIapId)
+    {
+    CSenProviderPolicy* pNew = NewLC(aIapId);
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+
+EXPORT_C CSenProviderPolicy* CSenProviderPolicy::NewLC(TUint32 aIapId)
+    {
+    CSenProviderPolicy* pNew = new (ELeave) CSenProviderPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aIapId);
+    return pNew;
+    }
+
+EXPORT_C CSenProviderPolicy* CSenProviderPolicy::NewL(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenProviderPolicy* pNew = NewLC(aId, aIsSnapId);
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+
+EXPORT_C CSenProviderPolicy* CSenProviderPolicy::NewLC(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenProviderPolicy* pNew = new (ELeave) CSenProviderPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aId, aIsSnapId);
+    return pNew;
+    }
+
+CSenProviderPolicy::CSenProviderPolicy()
+    {
+    }
+
+CSenProviderPolicy::~CSenProviderPolicy()
+    {
+    }
+
+EXPORT_C void CSenProviderPolicy::BaseConstructL()
+    {
+    CSenPolicy::BaseConstructL(KProviderPolicyLocalName());
+    }
+
+EXPORT_C void CSenProviderPolicy::BaseConstructL(TUint32 aIapId)
+    {
+    CSenPolicy::BaseConstructL(KProviderPolicyLocalName(), aIapId);
+    }
+
+EXPORT_C void CSenProviderPolicy::BaseConstructL(TUint32 aId, TBool aIsSnapId)
+    {
+    CSenPolicy::BaseConstructL(KProviderPolicyLocalName(), aId, aIsSnapId);
+    }
+
+EXPORT_C TBool CSenProviderPolicy::Accepts(MSenProviderPolicy& aPolicyPattern)
+    {
+    TBool retVal(ETrue);
+    TRAPD(err, retVal = AcceptsL(aPolicyPattern));
+    if (err) return EFalse;
+    return retVal;
+    }
+
+TBool CSenProviderPolicy::AcceptsL(MSenProviderPolicy& aPolicyPattern)
+    {
+    TUint32 thisIapID(0);
+    TUint32 patternIapID(0);
+
+    if(aPolicyPattern.IapId(patternIapID)==KErrNone
+        && (IapId(thisIapID) != KErrNone
+         || patternIapID!=thisIapID))
+        {
+        return EFalse; // policies do NOT match(!)
+        }
+    
+    if(aPolicyPattern.SnapId(patternIapID)==KErrNone
+        && (SnapId(thisIapID) != KErrNone
+         || patternIapID!=thisIapID))
+        {
+        return EFalse; // policies do NOT match(!)
+        }    
+
+    const CSenIdentityProviderIdArray8& patternIdps =
+                                    aPolicyPattern.IdentityProviderIds8L();
+    if(patternIdps.IsStrict())
+        {
+        const CSenIdentityProviderIdArray8& thisIdps = IdentityProviderIds8L();
+        TInt thisCount(thisIdps.Count());
+        TInt pos(KErrNotFound);
+        TBool matches(EFalse);
+        for(TInt i=0; i<thisCount; i++)
+            {
+            pos = KErrNotFound;
+            if(patternIdps.Find(thisIdps[i], pos, ECmpNormal) == KErrNone)
+                {
+                matches = ETrue;
+                break;
+                }
+            }
+        return matches;
+        }
+
+    return ETrue;
+    }
+
+// sets (rebuilds) the IAP ID and IDP ID list values from template
+// @return  - a error, if at least one addition of new contents has
+// failed OR KerrNone if every property was successfully reset
+EXPORT_C TInt CSenProviderPolicy::RebuildFrom(MSenProviderPolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+    TRAPD(err, retVal = RebuildFromL(aTemplate));
+    if (err != KErrNone)
+        {
+        retVal = err;
+        }
+    return retVal;
+    }
+
+TInt CSenProviderPolicy::RebuildFromL(MSenProviderPolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+        // check for possible provider policy definition
+
+    TUint32 iapId(0);
+    TInt err = aTemplate.IapId(iapId);
+    if(err==KErrNone)
+        {
+        // update the latest IAP "recommendation"
+        SetIapIdL(iapId);
+        }
+    
+    err = aTemplate.SnapId(iapId);
+    if(err==KErrNone)
+        {
+        // update the latest SNAP "recommendation"
+        SetSnapIdL(iapId);
+        }    
+    const CSenIdentityProviderIdArray8& ids =
+                                        aTemplate.IdentityProviderIds8L();
+    TInt idsCount(ids.MdcaCount());
+    for(TInt j=0; j<idsCount; j++)
+        {
+        TPtrC8 value = ids[j];
+        if(value.Length()>0)
+            {
+            err = AddIdentityProviderIdL(value);
+            if(err!=KErrNone)
+                {
+                retVal = err; // indicate that some IDP could not be added
+                }
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TInt CSenProviderPolicy::SetTransportPropertiesL(const TDesC8& aProperties)
+    {
+    CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+    if(!pTransportElement)
+        {
+        pTransportElement = &(AsElement().AddElementL(KTransportLocalName));
+        }
+    pTransportElement->SetContentL(aProperties);
+    return KErrNone;
+    }
+
+
+EXPORT_C TInt CSenProviderPolicy::TransportPropertiesL(HBufC8*& aProperties)
+    {
+    CSenElement* pTransportElement = AsElement().Element(KTransportLocalName);
+    if(pTransportElement)
+        {
+        aProperties = pTransportElement->AsXmlL();
+        }
+    return KErrNone;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senservdescdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senservicepattern.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenServicePattern.h"
+#include "senconsumerpolicy.h"
+
+namespace
+    {
+    _LIT8(KConsumerPolicyLocalName, "ConsumerPolicy");
+    }
+
+
+
+EXPORT_C CSenServicePattern* CSenServicePattern::NewL()
+    {
+    CSenServicePattern* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenServicePattern* CSenServicePattern::NewLC()
+    {
+    CSenServicePattern* pNew = 
+                            new (ELeave) CSenServicePattern(EServicePattern);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenServicePattern* CSenServicePattern::NewL(
+                                                const TDesC8& aNamespaceURI)
+    {
+    CSenServicePattern* pNew = NewLC(aNamespaceURI);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenServicePattern* CSenServicePattern::NewLC(
+                                                const TDesC8& aNamespaceURI)
+    {
+    CSenServicePattern* pNew = 
+                            new (ELeave) CSenServicePattern(EServicePattern);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNamespaceURI);
+    return pNew;
+    }
+
+EXPORT_C CSenServicePattern* CSenServicePattern::NewL(const TDesC8& aEndPoint, 
+                                                      const TDesC8& aContract)
+    {
+    CSenServicePattern* pNew = NewLC(aEndPoint, aContract);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenServicePattern* CSenServicePattern::NewLC(const TDesC8& aEndPoint, 
+                                                       const TDesC8& aContract)
+    {
+    CSenServicePattern* pNew = 
+                            new (ELeave) CSenServicePattern(EServicePattern);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aEndPoint, aContract);
+    return pNew;
+    }
+
+EXPORT_C CSenServicePattern::CSenServicePattern(
+                        MSenServiceDescription::TDescriptionClassType aType)
+: CSenXmlServiceDescription(aType)
+    {
+    }
+
+EXPORT_C CSenServicePattern::~CSenServicePattern()
+    {
+    delete iConsumerPolicy;
+    }
+
+EXPORT_C void CSenServicePattern::BaseConstructL()
+    {
+    CSenXmlServiceDescription::ConstructL();
+    // construct empty consumer policy...
+
+    // NOTE; iConsumerPolicy is, AS INTENDED, a separate XML object
+    // from the "ServicePattern", which contains it
+    iConsumerPolicy = CSenConsumerPolicy::NewL();
+    }
+
+EXPORT_C void CSenServicePattern::BaseConstructL(const TDesC8& aNamespaceURI)
+    {
+    CSenXmlServiceDescription::ConstructL(aNamespaceURI);
+    // construct empty consumer policy...
+    iConsumerPolicy = CSenConsumerPolicy::NewL();
+    }
+
+EXPORT_C void CSenServicePattern::BaseConstructL(const TDesC8& aEndPoint, 
+                                                const TDesC8& aContract)
+    {
+    CSenXmlServiceDescription::ConstructL(aEndPoint, aContract);
+    // construct empty consumer policy...
+    iConsumerPolicy = CSenConsumerPolicy::NewL();
+    }
+
+
+EXPORT_C TBool CSenServicePattern::Matches(
+                                    MSenServiceDescription& aServicePattern)
+    {
+    TBool matches = CSenXmlServiceDescription::Matches(aServicePattern);
+    if(matches && aServicePattern.DescriptionClassType() == EServicePattern)
+        {
+        CSenServicePattern* pPattern = (CSenServicePattern*)&aServicePattern;
+        return iConsumerPolicy->Accepts(*(MSenConsumerPolicy*)pPattern);
+        }
+    else 
+        return EFalse; // even the service descriptions wont match
+    }
+
+// from MSenConsumerPolicy
+EXPORT_C void CSenServicePattern::SetConsumerIapIdL(TUint32 aIapId)
+    {
+    iConsumerPolicy->SetIapIdL(aIapId);
+    }
+
+// getter for IAP ID
+EXPORT_C TInt CSenServicePattern::ConsumerIapId(TUint32& aCurrentIapId)
+    {
+    return iConsumerPolicy->IapId(aCurrentIapId);
+    }
+
+// setter for SNAP ID
+EXPORT_C void CSenServicePattern::SetConsumerSnapIdL(TUint32 aSnapId)
+    {
+    iConsumerPolicy->SetSnapIdL(aSnapId);
+    }
+
+// getter for SNAP ID
+EXPORT_C TInt CSenServicePattern::ConsumerSnapId(TUint32& aCurrentSnapId)
+    {
+    return iConsumerPolicy->SnapId(aCurrentSnapId);
+    }
+
+
+// Setter: overrides current values with the given values from the array
+EXPORT_C void CSenServicePattern::SetConsumerIdentityProviderIdsL(
+                            CSenIdentityProviderIdArray8& aList)
+    {
+    iConsumerPolicy->SetIdentityProviderIdsL(aList);
+    }
+
+// Adder: adds a new IDP ID value at the end of the current list value(s)
+// Does not insert duplicate values. 
+//
+// @return KErrAlreadyExists, if a duplicate is tried to add
+//         KErrArgument if a zero-length descriptor is tried to add 
+//         (aProviderId.Length() == 0)
+EXPORT_C TInt CSenServicePattern::AddConsumerIdentityProviderIdL(
+                                        const TDesC8& aProviderId)
+    {
+    return iConsumerPolicy->AddIdentityProviderIdL(aProviderId);
+    }
+
+
+// Getter: return an empty array if no IDP:s have been spesified
+// or a list of IDP arrays if such value(s) have been set.
+EXPORT_C const CSenIdentityProviderIdArray8&
+                CSenServicePattern::ConsumerIdentityProviderIds8L()
+    {
+    return iConsumerPolicy->IdentityProviderIds8L();
+    }
+
+
+EXPORT_C TBool CSenServicePattern::AcceptsConsumerPolicy(
+                                            MSenConsumerPolicy& aPolicyPattern)
+    {
+    return iConsumerPolicy->Accepts(aPolicyPattern);
+    }
+
+EXPORT_C TBool CSenServicePattern::RebuildFromConsumerPolicy(
+                                                MSenConsumerPolicy& aTemplate)
+    {
+    return iConsumerPolicy->RebuildFrom(aTemplate);
+    }
+
+// overrides CXmlServiceDescription
+EXPORT_C void CSenServicePattern::StartElementL(
+                                    const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName,
+                                    const RAttributeArray& aAttributes)
+    {
+
+    if(aLocalName == KConsumerPolicyLocalName)
+        {
+        // get rid of existing stuff
+        delete iConsumerPolicy;
+        iConsumerPolicy = NULL;
+        iConsumerPolicy = CSenConsumerPolicy::NewL();
+
+        iConsumerPolicy->SetAttributesL(aAttributes);
+        DelegateParsingL(*iConsumerPolicy);
+        }
+    else 
+        {
+        CSenXmlServiceDescription::StartElementL(
+            aNsUri, aLocalName, aQName, aAttributes);
+        }
+    }
+
+EXPORT_C HBufC8* CSenServicePattern::ConsumerPolicyAsXmlL()
+    {
+    return iConsumerPolicy->AsXmlL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senservicepolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This class represents the policy information
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <s32strm.h>
+#include "sendebug.h"
+#include "senservicepolicy.h"
+#include "SenXmlElement.h"
+#include "senguidgen.h"
+#include "SenXmlServiceDescription.h"
+#include "senlogger.h"
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+namespace
+	{
+	_LIT8(KServicePolicyLocalName, "ServicePolicy");
+	_LIT8(KSenNsUri, "urn:com.nokia.Sen.config.1.0");
+	_LIT8(KPolicyLocalName, "Policy");
+	_LIT8(KPolicyArrayLocalName, "PolicyArray");
+	_LIT8(KWsPolicyNsUri , "http://schemas.xmlsoap.org/ws/2004/09/policy"); // Namespace of WS-Policy
+	_LIT8(KClientServicePolicyLocalName, "ClientPolicy");
+	}
+
+
+CSenServicePolicy* CSenServicePolicy::NewL()
+	{
+    CSenServicePolicy* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServicePolicy* CSenServicePolicy::NewLC()
+    {
+    CSenServicePolicy* pNew = new (ELeave) CSenServicePolicy();
+    CleanupStack::PushL(pNew);
+	pNew->BaseConstructL();
+    return pNew;
+    }
+
+CSenServicePolicy::CSenServicePolicy()
+    {
+    }
+
+CSenServicePolicy::~CSenServicePolicy()
+	{
+	}
+
+void CSenServicePolicy::BaseConstructL()
+	{
+	CServicePolicy::BaseConstructL(KServicePolicyLocalName());
+	}
+	
+//Rebuild both client and Service Policy from the given Template
+TInt CSenServicePolicy::RebuildServicePolicyFrom(MSenServicePolicy& aTemplate)
+{
+    TInt retVal(KErrNone);
+    TInt err( KErrNone );
+    // check for possible policies definition
+    CSenServicePolicy* policy = (CSenServicePolicy*)&aTemplate;
+    CSenElement& pServicePolicyElement = policy->AsElement();
+    CSenElement* copy = NULL;
+    TRAP( err, copy = CSenXmlElement::NewL(KServicePolicyLocalName); )
+    if( !copy ) 
+        {
+        return KErrNoMemory;
+        }
+    else if( !err )
+        {
+        TRAP( err, copy->CopyFromL( pServicePolicyElement ); )
+        if( !err )
+            {
+#ifdef _SENDEBUG
+                { // parenthesis -pair added to avoid local variable visibility scope collision
+                TLSLOG_L(KSenServConnLogChannelBase,KMaxLogLevel,"TInt CSenServicePolicy::RebuildServicePolicyFrom POLICY");
+                TLSLOG_L(KSenServConnLogChannelBase,KMaxLogLevel,"-----------COPY----------------------------------------");
+                TLSLOG_L(KSenServConnLogChannelBase,KMaxLogLevel,"-------------------------------------------------------");
+                TLSLOG_L(KSenServConnLogChannelBase,KMaxLogLevel,"-------------------------------------------------------");
+                HBufC8* pXml = NULL;
+                TRAP_IGNORE
+                    ( 
+                    pXml = copy->AsXmlL(); 
+                    if( pXml )
+                        {
+                        TLSLOG_ALL(KSenServConnLogChannelBase,KMaxLogLevel,( *pXml ));
+                        }
+                    )
+                delete pXml;
+                }
+#endif // _SENDEBUG
+            // UpdateClientPolicy        
+            CSenElement* pClientPolicy = copy->Element( KClientServicePolicyLocalName );
+            if(!pClientPolicy)
+                {
+                pClientPolicy = copy->Element( KSenNsUri, KClientServicePolicyLocalName );
+                }
+            if( pClientPolicy )
+                {
+                TRAP( err, retVal = AddClientPolicyL( pClientPolicy ); )
+                //if( err )
+                //    {
+                //    retVal = err;
+                //    }
+                }
+    
+            // UpdateServicePolicyArray        
+            CSenElement* pPolicyArray = copy->Element( KPolicyArrayLocalName );
+            if(!pPolicyArray)
+                {
+                pPolicyArray = copy->Element( KSenNsUri, KPolicyArrayLocalName );
+                }
+                
+            if(!pPolicyArray)
+                {
+                pPolicyArray = copy->Element( KNullDesC8, KPolicyArrayLocalName );
+                }
+                
+            if(pPolicyArray)
+                {
+                RPointerArray<CSenElement> elements;
+                TRAP( err, pPolicyArray->ElementsL( elements, KWsPolicyNsUri, KPolicyLocalName ); )
+                // -- CleanupClosePushL(elements); // not needed, since array is living in non-leaving code
+                if( !err )
+                    {
+                    TInt count = elements.Count();
+                    CSenElement* pPolicy = NULL;
+                    for( TInt i = 0; i < count; i++ )
+                        {
+                        pPolicy = elements[i];
+                        if( pPolicy )
+                            {
+                            TRAP( err, AddPolicyL( pPolicy ); )
+                            }
+                        }
+                    // -- CleanupStack::PopAndDestroy(&elements);
+                    }
+                }
+            }
+        }
+    delete copy; 
+    return retVal;  
+    }
+    
+//Do nuthing
+TBool CSenServicePolicy::Accepts(MSenServicePolicy& aPolicyPattern)
+{
+   return Accepts(aPolicyPattern);
+}
+
+CSenElement* CSenServicePolicy::ClientPolicy()
+{
+     CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    
+    if(!pClientPolicyElement)
+        {
+        pClientPolicyElement =  AsElement().Element(KSenNsUri, KClientServicePolicyLocalName);
+        }
+        
+    return pClientPolicyElement;   
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/senxmlservicedescription.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1208 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILESS
+#include <e32base.h>
+#include <e32des8.h>    // HBufC8
+
+#include "SenDateUtils.h"
+
+#include "SenXmlServiceDescription.h"
+#include "SenBaseFragment.h"
+#include "SenXmlUtils.h"
+#include "sendebug.h"
+
+#include "SenCredential.h"
+#include "senproviderpolicy.h"
+#include "senservicepolicy.h"
+#include "SenFacet.h"
+#include "SenXmlUtils.h"
+
+#include <SenServiceConnection.h> // for KErrSenNoEndpoint
+
+
+namespace
+    {
+    // Local names for XML element: 
+    _LIT8(KServiceDescriptionLocalName, "ServiceDescription");
+    _LIT8(KEndpointLocalname,           "Endpoint");
+    _LIT8(KContractLocalname,           "Contract");
+    _LIT8(KProviderPolicyLocalName,     "ProviderPolicy");
+    _LIT8(KServicePolicyLocalName,      "ServicePolicy");
+    _LIT8(KClientServicePolicyLocalName, "ClientPolicy");
+    _LIT8(KSenIdpProviderIdLocalname,       "ProviderID");
+    // Names for XML attributes:
+    _LIT8(KNotOnOrAfter,                "notOnOrAfter");
+    _LIT8(KFramework,                   "framework");
+    _LIT8(KCue,                         "cue");
+    _LIT8(KTouch, 						"touch");
+    }
+
+
+EXPORT_C CSenXmlServiceDescription* CSenXmlServiceDescription::NewL()
+    {
+    CSenXmlServiceDescription* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenXmlServiceDescription* CSenXmlServiceDescription::NewLC()
+    {
+    CSenXmlServiceDescription* pNew =
+        new (ELeave) CSenXmlServiceDescription(EXmlServiceDescription);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+EXPORT_C void CSenXmlServiceDescription::ConstructL()
+    {
+    BaseConstructL(NewElementName());
+    // Create empty policy
+    iProviderPolicy = CSenProviderPolicy::NewL();
+    CSenElement& element = iProviderPolicy->AsElement();
+    AsElement().AddElementL(element);
+    iServicePolicy = CSenServicePolicy::NewL();
+    CSenElement& servicePolicyElement = iServicePolicy->AsElement();
+    AsElement().AddElementL(servicePolicyElement);
+    }
+
+EXPORT_C const TDesC8& CSenXmlServiceDescription::NewElementName()
+    {
+    return KServiceDescriptionLocalName();
+    }
+
+EXPORT_C CSenXmlServiceDescription* CSenXmlServiceDescription::NewL(
+                                                const TDesC8& aNamespaceURI)
+    {
+    CSenXmlServiceDescription* pNew = NewLC(aNamespaceURI);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenXmlServiceDescription* CSenXmlServiceDescription::NewLC(
+                                                const TDesC8& aNamespaceURI)
+    {
+    CSenXmlServiceDescription* pNew =
+                new (ELeave) CSenXmlServiceDescription(EXmlServiceDescription);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNamespaceURI);
+    return pNew;
+    }
+
+EXPORT_C void CSenXmlServiceDescription::ConstructL(const TDesC8& aNamespaceURI)
+    {
+    BaseConstructL(aNamespaceURI, NewElementName());
+    // create empty policy
+    iProviderPolicy = CSenProviderPolicy::NewL();
+    CSenElement& element = iProviderPolicy->AsElement();
+    AsElement().AddElementL(element);
+    iServicePolicy = CSenServicePolicy::NewL();
+    CSenElement& servicePolicyElement = iServicePolicy->AsElement();
+    AsElement().AddElementL(servicePolicyElement);
+    }
+
+EXPORT_C CSenXmlServiceDescription* CSenXmlServiceDescription::NewL(
+                                                    const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract)
+    {
+    CSenXmlServiceDescription* pNew = NewLC(aEndPoint, aContract);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenXmlServiceDescription* CSenXmlServiceDescription::NewLC(
+                                                     const TDesC8& aEndPoint,
+                                                     const TDesC8& aContract)
+    {
+    CSenXmlServiceDescription* pNew =
+        new (ELeave) CSenXmlServiceDescription(EXmlServiceDescription);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aEndPoint, aContract);
+    return pNew;
+    }
+
+EXPORT_C void CSenXmlServiceDescription::ConstructL(const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract)
+    {
+    BaseConstructL(NewElementName());
+    if(aEndPoint.Length()>0)
+        {
+        SetContentOfL(KEndpointLocalname, aEndPoint);
+        }
+
+    if(aContract.Length()>0)
+        {
+        SetContentOfL(KContractLocalname, aContract);
+        }
+    // create empty policy
+    iProviderPolicy = CSenProviderPolicy::NewL();
+    CSenElement& element = iProviderPolicy->AsElement();
+    AsElement().AddElementL(element);
+    iServicePolicy = CSenServicePolicy::NewL();
+    CSenElement& servicePolicyElement = iServicePolicy->AsElement();
+    AsElement().AddElementL(servicePolicyElement);
+    }
+
+
+EXPORT_C CSenXmlServiceDescription::CSenXmlServiceDescription(
+                                                TDescriptionClassType aType)
+:   
+    iType(aType),
+    iServicePolicy(NULL),   
+    iCredential(NULL),
+    iNotOnOrAfter(Time::NullTTime()), // sets this session to be valid if read from db
+    iProviderPolicy(NULL)
+    
+    {
+    }
+
+EXPORT_C CSenXmlServiceDescription::~CSenXmlServiceDescription()
+    {
+    // Bugfix 2004-07-27
+    if(iCredential)
+        {
+        TInt index(KErrNotFound);
+        index = iCredentialList.Find(iCredential);
+        if(index==KErrNotFound)
+            {
+            delete iCredential; // otherwise deleted by ResetAndDestroy()
+            }
+        }
+
+
+    iCredentialList.ResetAndDestroy(); // owns
+
+    if( iProviderPolicy )
+        {
+        iProviderPolicy->ExtractElement();
+        }    
+    delete iProviderPolicy;
+     if( iServicePolicy )
+        {
+        iServicePolicy->ExtractElement();
+        }
+         delete iServicePolicy;            
+    }
+
+EXPORT_C MSenServiceDescription::TDescriptionClassType
+                            CSenXmlServiceDescription::DescriptionClassType()
+    {
+    return iType;
+    }
+
+
+EXPORT_C void CSenXmlServiceDescription::SetAttributesL(const RAttributeArray& aAttributes)
+    {
+    // Call superclass for namespace attributes only
+    CSenBaseFragment::SetAttributesL(aAttributes); 
+
+    // SenXmlUtils::AttrValue returns KNullDesC8 if attribute is not found:
+    const TDesC8& id = SenXmlUtils::AttrValue(aAttributes, KFramework);
+    if( id.Length()>0 )
+        {
+        // Add real attribute for ServiceDescription -element. If "framework"
+        // attribute already exists, it's value will be overwritten:
+        SenXmlUtils::AddAttributeL(AsElement(), KFramework, id); 
+        }
+    const TDesC8& touch = SenXmlUtils::AttrValue(aAttributes, KTouch);
+    if( touch.Length()>0 )
+        {
+        // Add touch attribute for ServiceDescription -element. If "touch"
+        // attribute already exists, it's value will be overwritten:
+
+        CSenElement* elem = &AsElement();
+        elem->AddAttrL(KTouch, touch);
+        
+        }
+    const TDesC8& userInfoPrompt = SenXmlUtils::AttrValue(aAttributes, KSenAttrPromptUserInfo);
+    if( userInfoPrompt.Length() > 0 )
+        {
+        SenXmlUtils::AddAttributeL(AsElement(), KSenAttrPromptUserInfo, userInfoPrompt ); 
+        }
+    }
+
+EXPORT_C RCredentialList& CSenXmlServiceDescription::Credentials()
+    {
+    return iCredentialList;
+    }
+
+EXPORT_C TBool CSenXmlServiceDescription::Matches( MSenServiceDescription& aOtherServiceDescription )
+    {
+    TPtrC8 patternEndpoint = aOtherServiceDescription.Endpoint();
+    TPtrC8 thisEndpoint = Endpoint();
+
+    if(patternEndpoint.Length()>0)
+        {
+        if(!(thisEndpoint.Length()>0 && patternEndpoint == thisEndpoint))
+            {
+            return EFalse;
+            }
+        }
+
+    TPtrC8 patternContract = aOtherServiceDescription.Contract();
+    TPtrC8 thisContract = Contract();
+
+    if(patternContract.Length()>0)
+        {
+        if(!(thisContract.Length()>0 && patternContract == thisContract))
+            {
+            return EFalse;
+            }
+        }
+		
+    TBool match(ETrue);
+    
+		TRAPD(retVal,
+		    RFacetArray otherFacets;
+		    CleanupClosePushL(otherFacets);
+		    aOtherServiceDescription.FacetsL(otherFacets);
+		
+		    TPtrC8 facetName;
+		    TInt leave(KErrNone);
+		    TInt count(otherFacets.Count());
+		    for (TInt i=0; i<count && match; i++)
+		        {
+		        facetName.Set(otherFacets[i]->Name());
+		        TRAP( leave, HasFacetL(facetName, match); )
+		        }
+		    otherFacets.ResetAndDestroy();
+		    CleanupStack::Pop(); // otherFacets
+				);
+				
+    return match;
+    }
+
+
+EXPORT_C TPtrC8 CSenXmlServiceDescription::Contract()
+    {
+    return ContentOf(KContractLocalname());
+    }
+
+
+EXPORT_C TPtrC8 CSenXmlServiceDescription::Endpoint()
+    {
+    return ContentOf(KEndpointLocalname());
+    }
+
+EXPORT_C TPtrC8 CSenXmlServiceDescription::FrameworkId()
+    {
+    const TDesC8* value = AsElement().AttrValue(KFramework);
+    if(value)
+        {
+        return *value;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+EXPORT_C TPtrC8 CSenXmlServiceDescription::FrameworkVersion()
+    {
+    return KNullDesC8();
+    }
+
+EXPORT_C void CSenXmlServiceDescription::SetContractL(const TDesC8& aContract)
+    {
+    SetContentOfL(KContractLocalname(), aContract);
+    }
+
+
+EXPORT_C void CSenXmlServiceDescription::SetEndPointL(const TDesC8& aEndPoint)
+    {
+    SetContentOfL(KEndpointLocalname(), aEndPoint);
+    }
+
+EXPORT_C void CSenXmlServiceDescription::SetFrameworkIdL(const TDesC8& aFrameworkId)
+    {
+    if ( aFrameworkId != KNullDesC8 )
+        {
+        // overwrites the value of "framework" attribute, if such attribute exists
+        SenXmlUtils::AddAttributeL(AsElement(), KFramework, aFrameworkId);
+        }
+    else
+        {
+        // If there would not have been RemoveAttributeL() method, 
+        // then AddAtributeL(KNullDesC8) could have been used
+        delete SenXmlUtils::RemoveAttributeL(AsElement(), KFramework);
+        }
+    }
+
+EXPORT_C HBufC8* CSenXmlServiceDescription::AsXmlL()
+    {
+    return AsElement().AsXmlL();
+    }
+
+EXPORT_C HBufC* CSenXmlServiceDescription::AsXmlUnicodeL()
+    {
+    return AsElement().AsXmlUnicodeL();
+    }
+
+EXPORT_C void CSenXmlServiceDescription::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    AsElement().WriteAsXMLToL(aWriteStream);
+    }
+
+
+EXPORT_C void CSenXmlServiceDescription::StartElementL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttributes)
+    {
+
+    switch (iState)
+        {
+        case KStateSave: // IOP(!)
+            {
+            if(aLocalName.Compare(KCredentialsName) == 0)
+                {
+                iState = KStateParsingCredentials;
+
+                TPtrC8 attValue = SenXmlUtils::AttrValue(aAttributes, 
+                                                    KNotOnOrAfter);
+                if(attValue.Length()>0)
+                    {
+                    iNotOnOrAfter = SenDateUtils::FromXmlDateTimeL(attValue);
+                    }
+                }
+            else if(aLocalName.Compare(KProviderPolicyLocalName) == 0)
+                {
+                iState = KStateParsingProviderPolicy;
+                
+                TPtrC8 prefix(KNullDesC8);
+                if(aQName.Length()>0)
+                    {
+                    TInt colon = aQName.Locate(':');
+                    if(colon>0) // Note: 0 also treated as no prefix
+                        {
+                        prefix.Set(aQName.Ptr(), colon);
+                        }
+                    }
+                iProviderPolicy->AsElement().SetNamespaceL(prefix, aNsUri);
+
+                DelegateParsingL(*iProviderPolicy);
+                }
+             else if(aLocalName.Compare(KServicePolicyLocalName) == 0)
+                {
+                iState = KStateParsingServicePolicy;
+                
+                TPtrC8 prefix(KNullDesC8);
+                if(aQName.Length()>0)
+                    {
+                    TInt colon = aQName.Locate(':');
+                    if(colon>0) // Note: 0 also treated as no prefix
+                        {
+                        prefix.Set(aQName.Ptr(), colon);
+                        }
+                   }
+                iServicePolicy->AsElement().SetNamespaceL(prefix, aNsUri);
+                DelegateParsingL(*iServicePolicy);
+                }
+            else
+                {
+                CSenDomFragment::StartElementL( aNsUri,
+                                                aLocalName,
+                                                aQName,
+                                                aAttributes );
+
+                // For each endpoint, preserve the "cue" attribute
+                if( aLocalName == KEndpointLocalname )
+                    {
+                    const TDesC8& cue = SenXmlUtils::AttrValue(aAttributes, KCue);
+                    CSenElement* pEndpointElement = AsElement().Element( aLocalName );
+                    if( cue.Length() > 0 && pEndpointElement)
+                        {
+                        SenXmlUtils::AddAttributeL(*pEndpointElement, KCue, cue );
+                        }
+                    }
+                }
+            break;
+            }
+        case KStateParsingCredentials:
+            {
+            iState = KStateParsingSingleCredential;
+
+            // see destructor: iCredentialList.ResetAndDestroy(); // owns
+            iCredential = CSenCredential::NewL( aNsUri,
+                                                aLocalName,
+                                                aQName,
+                                                aAttributes,
+                                                AsElement());
+            iCredential->SetValidUntil(iNotOnOrAfter);
+
+            DelegateParsingL(*iCredential);
+            break;
+            }
+        default: // iState is KStateIgnore or some other..
+            {
+            // 2005-11: changed
+            if(aLocalName == KServiceDescriptionLocalName())
+                {
+                SetAttributesL(aAttributes);
+                }
+
+            CSenDomFragment::StartElementL( aNsUri,
+                                            aLocalName,
+                                            aQName,
+                                            aAttributes);
+            }
+        }
+    }
+
+EXPORT_C void CSenXmlServiceDescription::EndElementL(const TDesC8& aNsUri,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aQName )
+    {
+
+    switch (iState)
+        {
+        case KStateParsingCredentials:
+            {
+            if(aLocalName == KCredentialsName)
+                {
+                iState = KStateSave;
+                }
+            } break;
+        case KStateParsingSingleCredential:
+            {
+            iCredential->DetachL();
+            iCredentialList.Append(iCredential);
+            if(aLocalName == KCredentialsName)
+                {
+                iState = KStateIgnore;
+                }
+            else
+                {
+                iState = KStateParsingCredentials;
+                }
+            break;
+            }
+        case KStateParsingServicePolicy:
+            {
+//            if(aLocalName == KServicePolicyLocalName)
+                {
+                iState = KStateSave;
+                }
+            } break;            
+        case KStateParsingProviderPolicy:
+            {
+            iState = KStateSave;
+            } break;
+        default:
+            {
+            CSenDomFragment::EndElementL(aNsUri, aLocalName, aQName);
+            }
+        }
+    }
+
+// From Provider Policy:
+// Setter for Internet Access Point (IAP) ID
+EXPORT_C void CSenXmlServiceDescription::SetIapIdL(TUint32 aIapId)
+    {
+    iProviderPolicy->SetIapIdL(aIapId);
+    }
+
+// Getter for IAP ID
+EXPORT_C TInt CSenXmlServiceDescription::IapId(TUint32& aCurrentIapId)
+    {
+    return iProviderPolicy->IapId(aCurrentIapId);
+    }
+
+// Setter for SNAP
+EXPORT_C void CSenXmlServiceDescription::SetSnapIdL(TUint32 aSnapId)
+    {
+    iProviderPolicy->SetSnapIdL(aSnapId);
+    }
+
+// Getter for SNAP
+EXPORT_C TInt CSenXmlServiceDescription::SnapId(TUint32& aCurrentSnapId)
+    {
+    return iProviderPolicy->SnapId(aCurrentSnapId);
+    }
+
+// From Provider Policy:
+EXPORT_C TInt CSenXmlServiceDescription::SetTransportPropertiesL(const TDesC8& aProperties)
+    {
+    return iProviderPolicy->SetTransportPropertiesL(aProperties);
+    }
+
+// Getter for IAP ID
+EXPORT_C TInt CSenXmlServiceDescription::TransportPropertiesL(HBufC8*& aProperties)
+    {
+    return iProviderPolicy->TransportPropertiesL(aProperties);
+    }
+
+// Setter: overrides current values with the given values from the array
+EXPORT_C void CSenXmlServiceDescription::SetIdentityProviderIdsL( CSenIdentityProviderIdArray8& aList )
+    {
+    iProviderPolicy->SetIdentityProviderIdsL(aList);
+    }
+
+
+// Adder: adds a new IDP ID value at the end of the current list value(s)
+// Checks for duplicates (does not insert new ID elements with equal content)
+// @return KErrAlreadyExists, if a duplicate is tried to add
+//         KErrArgument if a zero-length descriptor is tried to add
+//         (aProviderId.Length() == 0)
+
+EXPORT_C TInt CSenXmlServiceDescription::AddIdentityProviderIdL(
+                                                        TDesC8& aProviderId)
+    {
+    return iProviderPolicy->AddIdentityProviderIdL(aProviderId);
+    }
+
+// sets (rebuilds) the IAP ID and IDP ID list values from template
+// @return  - a error, if at least one addition of new contents has
+// failed OR KerrNone if every property was successfully reset
+EXPORT_C TInt CSenXmlServiceDescription::RebuildFrom(
+                                                MSenProviderPolicy& aTemplate)
+    {
+    return iProviderPolicy->RebuildFrom(aTemplate);
+    }
+
+// Getter: return an empty array if no IDP:s have been spesified
+// or a list of IDP arrays if such value(s) have been set.
+EXPORT_C const CSenIdentityProviderIdArray8&
+                            CSenXmlServiceDescription::IdentityProviderIds8L()
+    {
+    return iProviderPolicy->IdentityProviderIds8L();
+    }
+
+EXPORT_C TBool CSenXmlServiceDescription::Accepts( MSenProviderPolicy& aPolicyPattern )
+    {
+    return iProviderPolicy->Accepts(aPolicyPattern);
+    }
+
+// Overridden from CSenDomFragment
+EXPORT_C void CSenXmlServiceDescription::ResumeParsingFromL( const TDesC8& aNsUri,
+                                                             const TDesC8& aLocalName,
+                                                             const TDesC8& aQName )
+    {
+    iXmlReader->SetContentHandler(*this);
+
+    switch (iState)
+        {
+        // no other states may be resumed(!)
+        case KStateParsingCredentials:
+        case KStateParsingSingleCredential:
+        case KStateParsingProviderPolicy:
+        case KStateParsingServicePolicy:
+            {
+            EndElementL(aNsUri, aLocalName, aQName);
+            }
+            break;
+        }
+    }
+
+    
+EXPORT_C TInt CSenXmlServiceDescription::HasFacetL( const TDesC8& aURI, TBool& aHasFacet )
+    {
+    aHasFacet = EFalse;
+    RPointerArray<CSenElement> elements;
+    CleanupClosePushL(elements);
+    AsElement().ElementsL(elements,KSenFacet);
+
+    const TDesC8* pValue = NULL;
+
+    TInt count(elements.Count());
+    for (TInt i=0; i<count && !aHasFacet; i++)
+        {
+        pValue = elements[i]->AttrValue(KFacetAttrName);
+        if (pValue)
+            {
+            if (*pValue == aURI) aHasFacet = ETrue;
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // elements
+    return KErrNone;
+    }
+
+/*
+EXPORT_C TInt CSenXmlServiceDescription::FacetValue(TDesC8& aURI,
+                                                    HBufC8*& aValueTo)
+    {
+    delete aValueTo;
+    aValueTo = NULL;
+
+    TInt retVal = KErrNotFound;
+    RPointerArray<CSenElement> elements;
+    TRAPD(err, CleanupClosePushL(elements);)
+    if (err != KErrNone)
+        {
+        // cleanupstack was emptied when one of the above caused a Leave
+        return err;
+        }
+    
+    TRAP(err, AsElement().ElementsL(elements,KSenFacet);)
+    if (err != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // elements
+        return err;
+        }
+
+    const TDesC8* pValue = NULL;
+
+    TInt count(elements.Count());
+    for (TInt i=0; i<count && !aValueTo; i++)
+        {
+        pValue = elements[i]->AttrValue(KFacetAttrName);
+        if (pValue)
+            {
+            if (*pValue == aURI)
+                {
+                if (elements[i]->Content().Length() < 1)
+                    {
+                    aValueTo = KSenFacetValTrue().Alloc();
+                    }
+                else
+                    {
+                    aValueTo = elements[i]->Content().Alloc();
+                    }
+                if (aValueTo == NULL) retVal = KErrNoMemory;
+                else retVal = KErrNone;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // elements
+    return retVal;
+    }
+*/
+
+// public, TRAPping version of FacetValue -getter:
+EXPORT_C TInt CSenXmlServiceDescription::FacetValue(TDesC8& aURI,
+                                                    HBufC8*& aValueTo)
+    {
+    TInt retVal(KErrNone);
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, retVal = FacetValueL(aURI, aValueTo);)
+    if (leaveCode != KErrNone) 
+        {
+        retVal = leaveCode;
+        }
+    return retVal;
+    }
+
+// private, leaving version of FacetValue -getter:
+TInt CSenXmlServiceDescription::FacetValueL(TDesC8& aURI,
+                                            HBufC8*& aValueTo)
+    {
+    delete aValueTo;
+    aValueTo = NULL;
+
+    TInt retVal = KErrNotFound;
+    RPointerArray<CSenElement> elements;
+    CleanupClosePushL(elements);
+    
+    AsElement().ElementsL(elements, KSenFacet);
+
+    const TDesC8* pValue = NULL;
+
+    TInt count(elements.Count());
+    for (TInt i=0; i<count && !aValueTo; i++)
+        {
+        pValue = elements[i]->AttrValue(KFacetAttrName);
+        if (pValue)
+            {
+            if (*pValue == aURI)
+                {
+                if(elements[i]->Content().Length() < 1)
+                    {
+                    aValueTo = KSenFacetValTrue().Alloc();
+                    }
+                else
+                    {
+                    aValueTo = elements[i]->Content().Alloc();
+                    }
+                if(!aValueTo) // OOM
+                    {
+                    retVal = KErrNoMemory;
+                    }
+                else 
+                    {
+                    retVal = KErrNone;
+                    }
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // elements
+    return retVal;
+    }
+
+/*
+EXPORT_C TInt CSenXmlServiceDescription::RemoveFacet(const TDesC8& aURI)
+    {
+    RPointerArray<CSenElement> elements;
+    TRAPD(err, 
+            CleanupClosePushL(elements);
+            AsElement().ElementsL(elements,KSenFacet);
+         )
+
+    if (err != KErrNone)
+        {
+        return err; // nothing needs to be popped from the cleanup stack
+        }
+
+    const TDesC8* pValue = NULL;
+    CSenElement* pFacet = NULL;
+
+    TInt count(elements.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        pFacet = elements[i];
+        pValue = pFacet->AttrValue(KFacetAttrName);
+        if (pValue)
+            {
+            if (*pValue == aURI)
+                {
+                delete AsElement().RemoveElement(*pFacet);
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // elements.Close()
+
+    return KErrNone;
+    }
+*/
+// public, TRAPping version of FacetValue -getter:
+EXPORT_C TInt CSenXmlServiceDescription::RemoveFacet(const TDesC8& aURI)
+    {
+    TInt retVal(KErrNone);
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, retVal = RemoveFacetL(aURI);)
+    if (leaveCode != KErrNone)
+        {
+        retVal = leaveCode;
+        }
+    return retVal;
+    }
+
+// private, leaving version of FacetValue -getter:
+TInt CSenXmlServiceDescription::RemoveFacetL(const TDesC8& aURI)
+    {
+    RPointerArray<CSenElement> elements;
+    CleanupClosePushL(elements);
+    AsElement().ElementsL(elements,KSenFacet);
+    const TDesC8* pValue = NULL;
+    CSenElement* pFacet = NULL;
+    TInt retVal(KErrNotFound); // returned, if no match
+    TInt count(elements.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        pFacet = elements[i];
+        pValue = pFacet->AttrValue(KFacetAttrName);
+        if(pValue)
+            {
+            if(*pValue == aURI)
+                {
+                delete AsElement().RemoveElement(*pFacet);
+                retVal = KErrNone; // ok: facet removed
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(); // elements.Close()
+    return retVal;
+    }
+
+
+EXPORT_C TInt CSenXmlServiceDescription::AddFacetL(const CSenFacet& aFacet)
+    {
+    TInt retVal(KErrNone);
+    RPointerArray<CSenElement> elements;
+    CleanupClosePushL(elements);
+    AsElement().ElementsL(elements,KSenFacet);
+
+    const TDesC8* pValue = NULL;
+    CSenElement* pFacet = NULL;
+
+    TInt count(elements.Count());
+    for(TInt i=0; i<count && !pFacet; i++)
+        {
+        pFacet = elements[i];
+        pValue = pFacet->AttrValue(KFacetAttrName);
+        if(pValue)
+            {
+            if(*pValue != ((CSenFacet&)aFacet).Name()) 
+                {
+                pFacet = NULL;  
+                }
+            else // facet with equal name already exists!
+                {
+                retVal = KErrAlreadyExists;
+                }
+            }
+        else
+            {
+            pFacet = NULL;
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // elements.Close()
+
+    if(pFacet && (retVal == KErrAlreadyExists))
+        {
+        return retVal;
+        }
+    else // facet did not already exist
+        {
+        pFacet = &AsElement().AddElementL(KSenFacet);
+        pFacet->AddAttrL(KFacetAttrName,((CSenFacet&)aFacet).Name());   
+        if(((CSenFacet&)aFacet).Type() != KNullDesC8)
+            {
+            pFacet->AddAttrL(KFacetAttrType,((CSenFacet&)aFacet).Type());
+            }
+        pFacet->SetContentL(((CSenFacet&)aFacet).Value());
+        retVal = KErrNone;
+        return retVal;
+        }
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::SetFacetL(const CSenFacet& aFacet)
+    {
+    RPointerArray<CSenElement> elements;
+    CleanupClosePushL(elements);
+    AsElement().ElementsL(elements,KSenFacet);
+
+    const TDesC8* pValue = NULL;
+    CSenElement* pFacet = NULL;
+
+    TInt count(elements.Count());
+    for(TInt i=0; i<count && !pFacet; i++)
+        {
+        pFacet = elements[i];
+        pValue = pFacet->AttrValue(KFacetAttrName);
+        if (pValue)
+            {
+            if(*pValue != ((CSenFacet&)aFacet).Name()) pFacet = NULL;
+            }
+        else
+            {
+            pFacet = NULL;
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // elements.Close()
+
+    if(!pFacet) 
+        {
+        // add new facet element
+        pFacet = &AsElement().AddElementL(KSenFacet);
+        }
+
+    pFacet->AddAttrL(KFacetAttrName,((CSenFacet&)aFacet).Name());
+    if (((CSenFacet&)aFacet).Type() != KNullDesC8)
+        {
+        pFacet->AddAttrL(KFacetAttrType,((CSenFacet&)aFacet).Type());
+        }
+    pFacet->SetContentL(((CSenFacet&)aFacet).Value());
+
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::FacetsL(RFacetArray& aFacetArray)
+    {
+    RPointerArray<CSenElement> elements;
+    CleanupClosePushL(elements);
+    AsElement().ElementsL(elements,KSenFacet);
+
+    CSenFacet* pNewFacet = NULL;
+
+    TInt count(elements.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        pNewFacet = CSenFacet::NewL(*elements[i]);
+        aFacetArray.Append(pNewFacet);
+        }
+
+    CleanupStack::PopAndDestroy(); // elements.Close()
+    return KErrNone;
+    }
+
+
+EXPORT_C TInt CSenXmlServiceDescription::ScoreMatchL( MSenServiceDescription& aPattern )
+    {
+    TInt score(0);
+
+    if ((aPattern.Endpoint().Length() > 0) && (aPattern.Endpoint() == Endpoint()))
+        {
+        score++;
+        }
+    if ((aPattern.Contract().Length() > 0) && (aPattern.Contract() == Contract()))
+        {
+        score++;
+        }
+
+    RFacetArray otherFacets;
+    CleanupClosePushL(otherFacets);
+    aPattern.FacetsL(otherFacets);
+
+    HBufC8* pFacetValue = NULL;
+    TPtrC8 facetName;
+    TPtrC8 otherFacetValue;
+
+    TInt count(otherFacets.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        facetName.Set(otherFacets[i]->Name());
+        FacetValue(facetName,pFacetValue);
+        if (pFacetValue)
+            {
+            if (otherFacets[i]->Value().Length() < 1)
+                {
+                otherFacetValue.Set(KSenFacetValTrue());
+                }
+            else
+                {
+                otherFacetValue.Set(otherFacets[i]->Value());
+                }
+            if (*pFacetValue == otherFacetValue)
+                {
+                score++;
+                }
+            }
+        delete pFacetValue;
+        pFacetValue = NULL;
+        }
+
+    otherFacets.ResetAndDestroy();
+    CleanupStack::Pop(); // otherFacets
+
+    return score;
+    }
+
+EXPORT_C TBool CSenXmlServiceDescription::HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate)
+    {
+    TBool retVal(EFalse);
+    if(aCandidate.Endpoint()  == Endpoint() && 
+       aCandidate.Contract() == Contract() &&
+       aCandidate.FrameworkId() == FrameworkId())
+        {
+        retVal = ETrue;
+        }
+    return retVal;    
+    }
+    
+EXPORT_C TBool CSenXmlServiceDescription::IsLocalL()
+    {
+    TBool local(EFalse);
+
+    // Check transport cue; if such XML attribute
+    // has been set to <Endpoint element, it is
+    // "stronger" than actual endpoint scheme
+    if(ipElement)
+        {
+        CSenElement* child = AsElement().Element(KEndpointLocalname());
+        if(child)
+            {
+            const TDesC8* cue = child->AttrValue(KCue);
+            TInt length(KSenTransportSchemeLocal().Length());
+            if(cue && cue->Length()>=length && cue->Left(length) == KSenTransportSchemeLocal)
+                {
+                local = ETrue; // match!
+                }
+            }
+        }
+    
+    if(!local) // no match yet
+        {
+        // Resolve the endpoint scheme
+        TPtrC8 uri = Endpoint();
+        if(uri.Length()>0)
+            {
+            TInt index = uri.Locate(':');
+            if(index!=KErrNotFound)
+                {
+                TPtrC8 uriScheme = uri.Left(index);
+                if(uriScheme == KSenTransportSchemeLocal)
+                    {
+                    local = ETrue;
+                    }
+                }
+            }
+        }
+    return local;            
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::SetTransportCueL(const TDesC8& aTransportCue)
+    {
+    TInt retVal(KErrSenNoEndpoint);
+    if(ipElement)
+        {
+        CSenElement* child = AsElement().Element(KEndpointLocalname());
+        if(child)
+            {
+            // Method either adds new attribute or updates existing one:
+            SenXmlUtils::AddAttributeL(*child, KCue, aTransportCue);
+            retVal = KErrNone;
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TPtrC8 CSenXmlServiceDescription::TransportCue()
+    {
+    if(ipElement)
+        {
+        CSenElement* child = AsElement().Element(KEndpointLocalname());
+        if(child)
+            {
+            const TDesC8* value = child->AttrValue(KCue);
+            if(value)
+                {
+                return *value;
+                }
+            }
+        }
+    return KNullDesC8();
+    }
+
+EXPORT_C MSenServicePolicy* CSenXmlServiceDescription::ServicePolicy()
+    {
+    if(iServicePolicy)
+        {
+        return (MSenServicePolicy*)iServicePolicy;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::SetPolicyL(const TDesC8& aName)
+    {
+    if(aName==KNullDesC8())
+        return KErrArgument;
+    
+    CSenElement* servicePolicy = AsElement().Element(KServicePolicyLocalName); 
+    CSenElement* clientPolicy = servicePolicy->Element(KClientServicePolicyLocalName);     
+    if( clientPolicy == NULL )
+        {
+        clientPolicy = &(servicePolicy->AddElementL( KClientServicePolicyLocalName ));
+        }
+    clientPolicy->AddElementL(aName);        
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::SetPolicyL(const TDesC8& aName, const TDesC8& aValue)
+    {
+    if(aName==KNullDesC8() || aValue == KNullDesC8())
+        return KErrArgument;
+    
+    CSenElement* servicePolicy = AsElement().Element(KServicePolicyLocalName); 
+    CSenElement* clientPolicy = servicePolicy->Element(KClientServicePolicyLocalName);     
+    if( clientPolicy == NULL )
+        {
+        clientPolicy = & (servicePolicy->AddElementL( KClientServicePolicyLocalName ));
+        }
+    clientPolicy->AddElementL(aName).SetContentL(aValue);       
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::SetPolicyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aAttribName, const TDesC8& aAttribValue)
+    {
+
+    if(aName==KNullDesC8() || aValue == KNullDesC8() || aAttribName == KNullDesC8() || aAttribValue == KNullDesC8())
+        return KErrArgument;
+    
+    CSenElement* servicePolicy = AsElement().Element(KServicePolicyLocalName); 
+    CSenElement* clientPolicy = servicePolicy->Element(KClientServicePolicyLocalName);     
+    if( clientPolicy == NULL )
+        {
+        clientPolicy = & (servicePolicy->AddElementL( KClientServicePolicyLocalName ));
+        }
+    CSenElement& ele = clientPolicy->AddElementL(aName);
+    ele.SetContentL(aValue);           
+    SenXmlUtils::AddAttributeL(ele, aAttribName, aAttribValue);
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenXmlServiceDescription::SetProviderIdL( const TDesC8& aProviderID )
+    {
+    if ( aProviderID.Length() == 0 )
+        {
+        return KErrArgument; // zero-length provider ID
+        }
+    else 
+        {
+        SetContentOfL(KSenIdpProviderIdLocalname, aProviderID);
+        return KErrNone;
+        }
+    }
+    
+EXPORT_C TPtrC8 CSenXmlServiceDescription::ProviderId()
+    {
+    return ContentOf( KSenIdpProviderIdLocalname );
+    }
+
+EXPORT_C void CSenXmlServiceDescription::SetPromptUserInfoL( TBool aPromptUserInfoMode )
+    {
+    if( aPromptUserInfoMode )
+        {
+#ifndef _RD_SEN_WS_STAR_DO_NOT_PROMPT_AUTHINFO_BY_DEFAULT
+
+        // macro is disabled
+
+        // When attribute does not exist, by default, the userinfo prompt is displayed:
+        // (when authentication service tells that authentication fails)
+        delete SenXmlUtils::RemoveAttributeL(AsElement(), KSenAttrPromptUserInfo);
+
+#else 
+        // macro is not in effect
+				_LIT8(KTrue,"true");
+        // Attribute with "true" value must *explicitely* exist, since default is "do not prompt":
+        SenXmlUtils::AddAttributeL(AsElement(), KSenAttrPromptUserInfo, KTrue );	//CodeScannerWarnings
+#endif        
+        }
+    else
+        {
+				_LIT8(KFalse,"false");
+        // Attribute is needed only (with value "false"), when API caller wants to disable
+        // end-user prompt from being displayed
+        SenXmlUtils::AddAttributeL(AsElement(), KSenAttrPromptUserInfo, KFalse );	//CodeScannerWarnings
+        }
+    }
+
+EXPORT_C TBool CSenXmlServiceDescription::PromptUserInfo()
+    {
+    _LIT8(KFalse,"false");
+    TBool retVal(ETrue); // by default, prompting is enabled
+    const TDesC8* value = AsElement().AttrValue( KSenAttrPromptUserInfo );
+    if( value && *value == KFalse )	//CodeScannerWarnings
+        {
+        // Only, and only if attribute EXISTS AND it HAS value "false", 
+        // the user info should NOT be prompted from end-user(!)
+        retVal = EFalse;
+        }
+    // else retVal = ETrue;
+    return retVal;    
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsdescription/src/servicepolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,819 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <s32strm.h>
+#include "sendebug.h"                 // internal Utils\inc - logging MACROs
+
+#include <SenElement.h>
+#include <SenXmlUtils.h>
+#include "SenXmlElement.h"
+#include "servicepolicy.h"
+#include "SenIdentityProviderIdArray8.h"
+#include "senguidgen.h"
+#include "senlogger.h"
+	
+namespace
+    {
+    _LIT8(KServicePolicyLocalName, "ServicePolicy");
+    _LIT8(KClientServicePolicyLocalName, "ClientPolicy");
+    _LIT8(KPolicyArrayLocalName, "PolicyArray");
+    _LIT8(KMetaDataLocalName, "MetadataEndpoint");
+    _LIT8(KName, "Name");
+    _LIT8(KSenNsUri, "urn:com.nokia.Sen.config.1.0");
+    _LIT8(KPolicyLocalName, "Policy");
+    _LIT8(KWsPolicyNsUri , "http://schemas.xmlsoap.org/ws/2004/09/policy"); // Namespace of WS-Policy
+    _LIT8(KId, "wsu:Id"); 
+	_LIT8(KWsuPrefix, "wsu"); 
+	_LIT8(KWsuNsUri, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd");
+    _LIT8(KAppInfoLocalName, "AppInfo");
+    _LIT8(KApplicationLocalName, "Application");
+    _LIT8(KDeviceOptionsLocalName, "DeviceOptions");
+    _LIT8(KUserAgentLocalName, "UserAgent");
+    _LIT8(KOSLocalName, "OS");
+    //_LIT8(KAppInfoNsUri , "http://schemas.live.com/mws/2006/10/core");
+    }
+
+
+CServicePolicy* CServicePolicy::NewL()
+    {
+    CServicePolicy* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CServicePolicy* CServicePolicy::NewLC()
+    {
+    CServicePolicy* pNew = new (ELeave) CServicePolicy();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KServicePolicyLocalName());
+    return pNew;
+    }
+
+CServicePolicy::CServicePolicy()
+    {
+    }
+
+CServicePolicy::~CServicePolicy()
+    {
+    TLSLOG_CLOSE(KSenServConnLogChannelBase);
+    //LOG_CLOSE;
+    }
+
+void CServicePolicy::BaseConstructL(const TDesC8& aPolicyLocalName)
+    {
+    CSenBaseFragment::BaseConstructL(aPolicyLocalName);
+#ifdef _SENDEBUG    
+    _LIT(KSenServConn, "SenServicePolicy");
+    _LIT(KSenServConnLog, "SenServicePolicy.log");
+    
+    
+    // Open connection to the file logger server
+    TLSLOG_OPEN(KSenServConnLogChannelBase,KSenServConnLogLevel ,KSenServConn,KSenServConnLog);
+    //LOG_CREATELOG((KSenServConn, KSenServConnLog, EFileLoggingModeOverwrite));
+#endif    
+    }
+
+//Do nothing
+TBool CServicePolicy::Accepts(MSenServicePolicy& aPolicyPattern)
+    {
+    TBool retVal(ETrue);
+    TRAPD(err, retVal = AcceptsL(aPolicyPattern));
+    if (err) return EFalse;
+    return retVal;
+    }
+
+//Do nothing
+TBool CServicePolicy::AcceptsL(MSenServicePolicy& /*aPolicyPattern*/)
+    {
+    return ETrue;
+    }
+
+//Return all of the Services polices from SD only <wsp:Policy> tags
+TInt CServicePolicy::ServicePolicies(RPolicyArray& aPolicies)
+    {
+    TInt err( KErrNone );
+    CSenElement* pPolicyArrayElement = AsElement().Element(KPolicyArrayLocalName);
+    if(pPolicyArrayElement)
+        {
+        TRAP( err, aPolicies = pPolicyArrayElement->ElementsL(); ) //, KWsPolicyNsUri, KPolicyLocalName);
+        if(!err && aPolicies.Count() > 0)
+           {
+           return KErrNone;
+           }
+        return KErrNotFound;
+        }
+    return KErrNotFound;        
+    }
+
+//Adding client policy to SD
+TInt CServicePolicy::AddClientPolicyL(CSenElement* aTemplate)
+    {
+    CSenElement* pServicePolicyElement = AsElement().Element(KServicePolicyLocalName);
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    
+    if(!pClientPolicyElement)
+        {
+        pClientPolicyElement = AsElement().Element(KSenNsUri, KClientServicePolicyLocalName);
+        if(!pClientPolicyElement)
+            {
+            pClientPolicyElement = &(AsElement().AddElementL(KClientServicePolicyLocalName));  
+            }
+        }
+    
+    if(!pClientPolicyElement->ConsistsOfL(*aTemplate))
+        {
+        RPointerArray<CSenElement> children = aTemplate->ElementsL();
+        for(TInt i = 0; i< children.Count(); i++)
+            {
+                CSenElement* ele = children[i];
+                
+                if(!ele->LocalName().Compare(KAppInfoLocalName))
+                {
+                    AddApplicationInfoElementsL(ele);
+                }
+                else
+                {
+                     CSenElement& added = pClientPolicyElement->AddElementL(ele->LocalName());
+                     
+                    TPtrC8 sourceContent = ele->Content();
+                    if(sourceContent.Length() > 0)
+                        {
+                        added.SetContentL(sourceContent);
+                        }
+                    RPointerArray<CSenBaseAttribute> sourceAttributes = ele->AttributesL();
+                    if (sourceAttributes.Count() > 0)
+                        {
+                        for (TInt i=0;i<sourceAttributes.Count(); i++)
+                            {
+                            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+                            SenXmlUtils::AddAttributeL(added, pBaseAttribute->Name(), pBaseAttribute->Value());
+                            }
+                        }
+                            
+                }
+                
+            }
+        }
+    return KErrNone;
+    }
+void CServicePolicy::AddApplicationInfoElementsL(CSenElement* aApplicationInfoElement)
+    {
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    CSenElement* pAppPolicyElement = pClientPolicyElement->Element(KAppInfoLocalName);
+    
+    if(!pAppPolicyElement)
+        {
+        pAppPolicyElement = pClientPolicyElement->Element(KSenNsUri, KAppInfoLocalName);
+        if(!pAppPolicyElement)
+            {
+            pAppPolicyElement = &(pClientPolicyElement->AddElementL(KAppInfoLocalName));  
+            }
+        }
+             
+    TPtrC8 sourceContent = aApplicationInfoElement->Content();
+    if(sourceContent.Length() > 0)
+        {
+        pAppPolicyElement->SetContentL(sourceContent);
+        }
+        
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aApplicationInfoElement->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+            SenXmlUtils::AddAttributeL(*pAppPolicyElement, pBaseAttribute->Name(), pBaseAttribute->Value());
+            }
+        }
+        
+    RPointerArray<CSenElement> children = aApplicationInfoElement->ElementsL();
+    for(TInt i = 0; i< children.Count(); i++)
+        {
+            CSenElement* ele = children[i];
+            
+            if(!ele->LocalName().Compare(KApplicationLocalName))
+            {
+                AddAppicationElementsL(ele);
+            }
+            else if(!ele->LocalName().Compare(KDeviceOptionsLocalName))
+            {
+                AddDeviceElementsL(ele);
+            }
+            else
+            {
+                CSenElement& added = pAppPolicyElement->AddElementL(ele->LocalName());
+                TPtrC8 sourceContent = ele->Content();
+                if(sourceContent.Length() > 0)
+                    {
+                    added.SetContentL(sourceContent);
+                    }
+                RPointerArray<CSenBaseAttribute> sourceAttributes = ele->AttributesL();
+                if (sourceAttributes.Count() > 0)
+                    {
+                    for (TInt i=0;i<sourceAttributes.Count(); i++)
+                        {
+                        CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+                        SenXmlUtils::AddAttributeL(added, pBaseAttribute->Name(), pBaseAttribute->Value());
+                        }
+                    }
+            }
+         }
+
+     }
+void CServicePolicy::AddAppicationElementsL(CSenElement* aApplicationElement)
+    {
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    CSenElement* pAppInfoPolicyElement = pClientPolicyElement->Element(KAppInfoLocalName);
+    CSenElement* pAppPolicyElement = pAppInfoPolicyElement->Element(KApplicationLocalName);
+    
+    if(!pAppPolicyElement)
+        {
+        pAppPolicyElement = pAppInfoPolicyElement->Element(KSenNsUri, KApplicationLocalName);
+        if(!pAppPolicyElement)
+            {
+            pAppPolicyElement = &(pAppInfoPolicyElement->AddElementL(KApplicationLocalName));  
+            }
+        }
+    TPtrC8 sourceContent = aApplicationElement->Content();
+    if(sourceContent.Length() > 0)
+        {
+        pAppPolicyElement->SetContentL(sourceContent);
+        }
+        
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aApplicationElement->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+            SenXmlUtils::AddAttributeL(*pAppPolicyElement, pBaseAttribute->Name(), pBaseAttribute->Value());
+            }
+        }
+        
+    RPointerArray<CSenNamespace> sourceNamespaces = aApplicationElement->NamespacesL();
+    if (sourceNamespaces.Count() > 0)
+        {
+        for (TInt i=0;i<sourceNamespaces.Count(); i++)
+            {
+            CSenNamespace* pNameSapce = sourceNamespaces[i];
+            pAppPolicyElement->AddNamespaceL(*pNameSapce,ETrue);
+            }
+        }
+        
+    RPointerArray<CSenElement> children = aApplicationElement->ElementsL();
+    for(TInt i = 0; i< children.Count(); i++)
+        {
+            CSenElement* ele = children[i];
+            CSenElement& added = pAppPolicyElement->AddElementL(ele->LocalName());
+             
+          TPtrC8 sourceContent = ele->Content();
+            if(sourceContent.Length() > 0)
+                {
+                added.SetContentL(sourceContent);
+                }
+            RPointerArray<CSenBaseAttribute> sourceAttributes = ele->AttributesL();
+            if (sourceAttributes.Count() > 0)
+                {
+                for (TInt i=0;i<sourceAttributes.Count(); i++)
+                    {
+                    CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+                    SenXmlUtils::AddAttributeL(added, pBaseAttribute->Name(), pBaseAttribute->Value());
+                    }
+                }
+             
+        }
+
+     }
+void CServicePolicy::AddDeviceElementsL(CSenElement* aDeviceElement)
+    {
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    CSenElement* pAppPolicyElement = pClientPolicyElement->Element(KAppInfoLocalName);
+    CSenElement* pDevicePolicyElement = pAppPolicyElement->Element(KDeviceOptionsLocalName);
+    
+    if(!pDevicePolicyElement)
+        {
+        pDevicePolicyElement = pAppPolicyElement->Element(KSenNsUri, KDeviceOptionsLocalName);
+        if(!pDevicePolicyElement)
+            {
+            pDevicePolicyElement = &(pAppPolicyElement->AddElementL(KDeviceOptionsLocalName));  
+            }
+        }
+            
+    TPtrC8 sourceContent = aDeviceElement->Content();
+    if(sourceContent.Length() > 0)
+        {
+        pDevicePolicyElement->SetContentL(sourceContent);
+        }
+        
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aDeviceElement->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+            SenXmlUtils::AddAttributeL(*pDevicePolicyElement, pBaseAttribute->Name(), pBaseAttribute->Value());
+            }
+        }
+        
+    RPointerArray<CSenNamespace> sourceNamespaces = aDeviceElement->NamespacesL();
+    if (sourceNamespaces.Count() > 0)
+        {
+        for (TInt i=0;i<sourceNamespaces.Count(); i++)
+            {
+            CSenNamespace* pNameSapce = sourceNamespaces[i];
+            pDevicePolicyElement->AddNamespaceL(*pNameSapce,ETrue);
+            }
+        }
+            
+    RPointerArray<CSenElement> children = aDeviceElement->ElementsL();
+    for(TInt i = 0; i< children.Count(); i++)
+        {
+            CSenElement* ele = children[i];
+                    
+            if(!ele->LocalName().Compare(KUserAgentLocalName))
+            {
+                AddUserAgentElementsL(ele);
+            }
+            else
+            {
+
+            CSenElement& added = pDevicePolicyElement->AddElementL(ele->LocalName());
+             
+          TPtrC8 sourceContent = ele->Content();
+            if(sourceContent.Length() > 0)
+                {
+                added.SetContentL(sourceContent);
+                }
+            RPointerArray<CSenBaseAttribute> sourceAttributes = ele->AttributesL();
+            if (sourceAttributes.Count() > 0)
+                {
+                for (TInt i=0;i<sourceAttributes.Count(); i++)
+                    {
+                    CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+                    SenXmlUtils::AddAttributeL(added, pBaseAttribute->Name(), pBaseAttribute->Value());
+                    }
+                }
+                
+            } 
+             
+        }
+
+     }
+void CServicePolicy::AddUserAgentElementsL(CSenElement* aUserAgentElement)
+    {
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    CSenElement* pAppPolicyElement = pClientPolicyElement->Element(KAppInfoLocalName);
+    CSenElement* pDevicePolicyElement = pAppPolicyElement->Element(KDeviceOptionsLocalName);
+    CSenElement* pUserAgentElement = pDevicePolicyElement->Element(KUserAgentLocalName);
+    
+    if(!pUserAgentElement)
+        {
+        pUserAgentElement = pDevicePolicyElement->Element(KSenNsUri, KUserAgentLocalName);
+        if(!pUserAgentElement)
+            {
+            pUserAgentElement = &(pDevicePolicyElement->AddElementL(KUserAgentLocalName));  
+            }
+        }
+            
+    TPtrC8 sourceContent = aUserAgentElement->Content();
+    if(sourceContent.Length() > 0)
+        {
+        pUserAgentElement->SetContentL(sourceContent);
+        }
+        
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aUserAgentElement->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+            SenXmlUtils::AddAttributeL(*pUserAgentElement, pBaseAttribute->Name(), pBaseAttribute->Value());
+            }
+        }
+        
+    RPointerArray<CSenElement> children = aUserAgentElement->ElementsL();
+    for(TInt i = 0; i< children.Count(); i++)
+        {
+            CSenElement* ele = children[i];
+            
+            if(!ele->LocalName().Compare(KOSLocalName))
+            {
+                AddOSElementsL(ele);
+            }
+            else
+            {
+
+            CSenElement& added = pUserAgentElement->AddElementL(ele->LocalName());
+             
+          TPtrC8 sourceContent = ele->Content();
+            if(sourceContent.Length() > 0)
+                {
+                added.SetContentL(sourceContent);
+                }
+            RPointerArray<CSenBaseAttribute> sourceAttributes = ele->AttributesL();
+            if (sourceAttributes.Count() > 0)
+                {
+                for (TInt i=0;i<sourceAttributes.Count(); i++)
+                    {
+                    CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+                    SenXmlUtils::AddAttributeL(added, pBaseAttribute->Name(), pBaseAttribute->Value());
+                    }
+                }
+             
+            } 
+        }
+
+     }
+void CServicePolicy::AddOSElementsL(CSenElement* aOSElement)
+    {
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    CSenElement* pAppPolicyElement = pClientPolicyElement->Element(KAppInfoLocalName);
+    CSenElement* pDevicePolicyElement = pAppPolicyElement->Element(KDeviceOptionsLocalName);
+    CSenElement* pUserAgentElement = pDevicePolicyElement->Element(KUserAgentLocalName);
+    CSenElement* pOSElement = pUserAgentElement->Element(KOSLocalName);
+    
+    if(!pOSElement)
+        {
+        pOSElement = pUserAgentElement->Element(KSenNsUri, KOSLocalName);
+        if(!pOSElement)
+            {
+            pOSElement = &(pUserAgentElement->AddElementL(KOSLocalName));  
+            }
+        }
+            
+    TPtrC8 sourceContent = aOSElement->Content();
+    if(sourceContent.Length() > 0)
+        {
+        pOSElement->SetContentL(sourceContent);
+        }
+        
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aOSElement->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+            SenXmlUtils::AddAttributeL(*pOSElement, pBaseAttribute->Name(), pBaseAttribute->Value());
+            }
+        }
+        
+    RPointerArray<CSenElement> children = aOSElement->ElementsL();
+    for(TInt i = 0; i< children.Count(); i++)
+        {
+            CSenElement* ele = children[i];
+            CSenElement& added = pOSElement->AddElementL(ele->LocalName());
+             
+          TPtrC8 sourceContent = ele->Content();
+            if(sourceContent.Length() > 0)
+                {
+                added.SetContentL(sourceContent);
+                }
+            RPointerArray<CSenBaseAttribute> sourceAttributes = ele->AttributesL();
+            if (sourceAttributes.Count() > 0)
+                {
+                for (TInt i=0;i<sourceAttributes.Count(); i++)
+                    {
+                    CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+                    SenXmlUtils::AddAttributeL(added, pBaseAttribute->Name(), pBaseAttribute->Value());
+                    }
+                }
+             
+        }
+
+     }
+
+// Public function for adding a policy
+TInt CServicePolicy::AddPolicyL(CSenElement* aPolicy)
+    {
+    TInt retVal(KErrNotFound);
+    retVal = ValidatePolicy(aPolicy);
+    
+#ifdef _SENDEBUG
+    {
+    TLSLOG(KSenServConnLogChannelBase,KMaxLogLevel,(_L("TInt CServicePolicy::AddPolicyL  POLICY")));
+    TLSLOG(KSenServConnLogChannelBase,KMaxLogLevel,(_L("-----------DIRECT ADDING---------------")));
+    TLSLOG(KSenServConnLogChannelBase,KMaxLogLevel,(_L("---------------------------------------")));
+    TLSLOG(KSenServConnLogChannelBase,KMaxLogLevel,(_L("---------------------------------------")));
+    HBufC8* xml = aPolicy->AsXmlL();
+    if(xml)
+        {
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,(*xml));
+
+        }
+        delete xml;
+    }    
+#endif // _SENDEBUG
+
+    if(retVal)
+        {
+        retVal =  AddWspPolicyL(aPolicy); 
+        }
+    return retVal;
+    }
+//Add a policy to SD
+TInt CServicePolicy::AddWspPolicyL(CSenElement* aPolicy)
+    {
+    TInt retVal(KErrNotFound);
+    CSenElement& pServicePolicy = AsElement();
+    CSenElement* pPolicyArray = pServicePolicy.Element(KPolicyArrayLocalName);
+    //get the PolicyArray which is holding all the <wsp:policy> elements
+    if(!pPolicyArray)
+        {
+        pPolicyArray = pServicePolicy.Element(KSenNsUri, KPolicyArrayLocalName);
+        if(!pPolicyArray)
+            pPolicyArray = &(pServicePolicy.AddElementL(KPolicyArrayLocalName));
+        }
+    //get all the policies from <PolicyArray>        
+    RPointerArray<CSenElement> policies;
+    pPolicyArray->ElementsL(policies,KWsPolicyNsUri,KPolicyLocalName);
+    
+    CSenElement* pPolicy = NULL;
+   
+    TInt count(policies.Count());
+    //If we have existing polcies then verify that this new policy doesnt exist there
+    if(count > 0)
+        {    
+        for(TInt i=0; i<count; i++)
+            {
+            pPolicy = policies[i];
+            if(pPolicy)
+                {
+                    if(pPolicy->LocalName().Compare(aPolicy->LocalName()) == 0 &&
+                    (PolicyIdL(pPolicy).Compare(PolicyIdL(aPolicy)) != 0))	//codescannerwarnings
+                        {
+                        //same policy with same wsu:Id then 
+                        // We are trying to add a policy with endpoint same
+                        // it means that our current policy is expired and we have 
+                        // fetched new policy
+                        // we have to delete here old policy and then add new policy
+                            if(PolicyUriL(pPolicy).Compare(PolicyUriL(aPolicy)) == 0)
+                            {
+                                CSenElement* deletedPolicy = pPolicyArray->RemoveElement(*pPolicy);
+                                delete deletedPolicy;
+                            }
+                        //then add fresh policy here
+                        CSenElement& apol= pPolicyArray->AddElementL(KPolicyLocalName);
+                        apol.CopyFromL(*aPolicy);                        
+                        retVal = KErrNone;
+                        policies.Close();
+                        return retVal;
+                        }
+                }
+
+            }
+        }
+    else //Just add this policy in the <PolicyArray>
+        {
+        
+        CSenElement& apol= pPolicyArray->AddElementL(KPolicyLocalName);
+        apol.CopyFromL(*aPolicy);                                
+        PolicyIdL(&apol);	//codescannerwarnings
+        retVal = KErrNone;
+        }
+     
+     policies.Close();
+    return retVal;
+    }
+
+//Remove a policy from current SD
+TInt CServicePolicy::RemovePolicyL(TDesC8& aPolicyUri)
+    {
+    TInt retVal(KErrNone);
+    CSenElement& pServicePolicy = AsElement();
+    CSenElement* pPolicyArray = pServicePolicy.Element(KPolicyArrayLocalName);
+//get the PolicyArray which is holding all the <wsp:policy> elements
+    if(!pPolicyArray)
+        {
+        pPolicyArray = pServicePolicy.Element(KSenNsUri, KPolicyArrayLocalName);
+        if(!pPolicyArray)
+               retVal = KErrNotFound; 
+        }
+    if(retVal == KErrNone)
+		{
+		//get all the policies from <PolicyArray>        
+		RPointerArray<CSenElement> policies;
+		CleanupClosePushL(policies);
+		pPolicyArray->ElementsL(policies,KWsPolicyNsUri,KPolicyLocalName);
+    
+		CSenElement* pPolicy = NULL;
+   
+		TInt count(policies.Count());
+//If we have existing polcies then verify that this new policy doesnt exist there
+		if(count > 0)
+			{    
+			for(TInt i=0; i<count; i++)
+				{
+				pPolicy = policies[i];
+				if(pPolicy)
+					{
+						if(PolicyNameL(pPolicy).Compare(aPolicyUri) == 0)	//codescannerwarnings
+							{
+                        //same policy with same NAME 
+                        CSenElement* removed = pPolicyArray->RemoveElement(*pPolicy);
+                        delete removed;
+                        retVal = KErrNone; 
+							}
+					}
+
+				}
+			}
+		CleanupStack::PopAndDestroy(); // policies
+		}
+    return retVal;
+    }
+
+
+// sets (rebuilds) the Service Policy in SD from template
+// @return  - a error, if at least one addition of new contents has
+// failed OR KerrNone if every property was successfully reset
+TInt CServicePolicy::RebuildServicePolicyFrom(MSenServicePolicy& aTemplate)
+    {
+    TInt retVal(KErrNone);
+    TRAPD(err, retVal = RebuildServicePolicyFromL(aTemplate));
+    if (err != KErrNone)
+        {
+        retVal = err;
+        }
+    return retVal;
+    }
+
+TInt CServicePolicy::RebuildServicePolicyFromL(MSenServicePolicy& /*aTemplate*/)
+    {
+    TInt retVal(KErrNone);
+    // check for possible provider policy definition
+    return retVal;
+    }
+    
+// Returns a Policy ID value. 
+// If the value not found then generate a random 
+// value and assign it to the policy
+TPtrC8 CServicePolicy::PolicyIdL(CSenElement* aPolicy)	//codescannerwarnings
+    {
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+    for (TInt j=0; j < ele_count; j++)
+        {
+        bs = (attrs)[j];
+        if(bs && bs->Name().Compare(KId) == 0)
+            {
+            return bs->Value();
+            }
+         }
+    // If there is no ID for a policy, then add a random
+    // Policy ID to the policy and put it into Service Description
+    GenerateDeviceIdL(aPolicy);
+    return PolicyIdL(aPolicy);
+    }
+    
+//Generate a random ID
+void CServicePolicy::GenerateDeviceIdL(CSenElement* aPolicy)	//codescannerwarnings
+    {
+
+    CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
+    HBufC8* iPolicyId = pGuidGenerator->GetRandomGuid8LC();
+    TPtr8 policyIdDes = iPolicyId->Des();
+    policyIdDes.LowerCase();
+    
+    aPolicy->AddAttrL(KId, policyIdDes);
+    aPolicy->AddNamespaceL(KWsuPrefix, KWsuNsUri);
+    
+    CleanupStack::PopAndDestroy(iPolicyId);
+    CleanupStack::PopAndDestroy(pGuidGenerator);
+    }
+
+//return Policy atribute Name
+TPtrC8 CServicePolicy::PolicyNameL(CSenElement* aPolicy)		//codescannerwarnings
+    {
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name() == KName)
+            {
+             return bs->Value();
+            }
+         }
+         return NULL;
+    }
+
+TPtrC8 CServicePolicy::PolicyUriL(CSenElement* aPolicy)
+{
+
+    if(aPolicy == NULL) { User::Leave(KErrGeneral); }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(KMetaDataLocalName) == 0)
+            {
+                 return bs->Value();
+            }
+         }
+
+            
+        }
+    return KNullDesC8();
+}
+
+TBool CServicePolicy::ValidatePolicy(CSenElement* /*aPolicy*/)
+    {
+    return ETrue;  
+    }
+CSenElement* CServicePolicy::ClientPolicy()
+{
+    CSenElement* pClientPolicyElement = AsElement().Element(KClientServicePolicyLocalName);
+    
+    if(!pClientPolicyElement)
+        {
+        return AsElement().Element(KSenNsUri, KClientServicePolicyLocalName);
+        }
+        
+    return NULL;
+}    
+TBool CServicePolicy::ClientPolicy(const TDesC8& aKey)
+{
+
+    CSenElement* pClientPolicy = ClientPolicy();
+
+    if(!pClientPolicy)
+        return EFalse;
+    
+    if(pClientPolicy)
+    {
+        CSenElement* result = NULL;
+        result = pClientPolicy->Element(aKey);
+        if(result)
+            return ETrue;
+        else
+            return EFalse;
+    }                    
+
+    return EFalse;
+    
+}
+HBufC8* CServicePolicy::ClientPolicyValue(const TDesC8& aKey)
+    {
+    HBufC8* retVal = NULL;        
+    TInt err(KErrNone);
+    CSenElement* pClientPolicy = ClientPolicy();
+    if( pClientPolicy )
+        {
+        CSenElement* result = NULL;
+        result = pClientPolicy->Element(aKey);
+        if( result && result->HasContent() )
+            {
+            TRAP( err, retVal = result->Content().AllocL(); )
+            if( err ) 
+                {
+                retVal = NULL;
+                }
+            }
+        }                    
+    return retVal;
+    }
+/*    
+RFileLogger* CServicePolicy::Log() const 
+    {
+    return (RFileLogger*) &iLog;
+    }    
+*/
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/BWINSCW/SenFragmentU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,136 @@
+EXPORTS
+	??0CSenDomFragmentBase@@IAE@XZ @ 1 NONAME ; CSenDomFragmentBase::CSenDomFragmentBase(void)
+	??0CSenFragmentBase@@IAE@XZ @ 2 NONAME ; CSenFragmentBase::CSenFragmentBase(void)
+	??1CSenDomFragmentBase@@UAE@XZ @ 3 NONAME ; CSenDomFragmentBase::~CSenDomFragmentBase(void)
+	??1CSenFragmentBase@@UAE@XZ @ 4 NONAME ; CSenFragmentBase::~CSenFragmentBase(void)
+	?AddAttributesL@CSenDomFragmentBase@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 5 NONAME ; void CSenDomFragmentBase::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddAttributesL@CSenFragmentBase@@MAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 6 NONAME ; void CSenFragmentBase::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddAttributesToElementL@CSenFragmentBase@@MAEXVTXmlEngElement@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 7 NONAME ; void CSenFragmentBase::AddAttributesToElementL(class TXmlEngElement, class RArray<class Xml::RAttribute> const &)
+	?AddContentL@CSenFragmentBase@@MAEXABVTDesC8@@@Z @ 8 NONAME ; void CSenFragmentBase::AddContentL(class TDesC8 const &)
+	?AddNamespacesL@CSenDomFragmentBase@@MAEXXZ @ 9 NONAME ; void CSenDomFragmentBase::AddNamespacesL(void)
+	?AddNamespacesL@CSenFragmentBase@@MAEXXZ @ 10 NONAME ; void CSenFragmentBase::AddNamespacesL(void)
+	?AsDocumentL@CSenDomFragmentBase@@UAEAAVRSenDocument@@XZ @ 11 NONAME ; class RSenDocument & CSenDomFragmentBase::AsDocumentL(void)
+	?AsDocumentL@CSenFragmentBase@@UAEAAVRSenDocument@@XZ @ 12 NONAME ; class RSenDocument & CSenFragmentBase::AsDocumentL(void)
+	?AsElementL@CSenDomFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 13 NONAME ; class TXmlEngElement CSenDomFragmentBase::AsElementL(void)
+	?AsElementL@CSenFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 14 NONAME ; class TXmlEngElement CSenFragmentBase::AsElementL(void)
+	?AsXmlL@CSenDomFragmentBase@@UAEPAVHBufC8@@XZ @ 15 NONAME ; class HBufC8 * CSenDomFragmentBase::AsXmlL(void)
+	?AsXmlL@CSenFragmentBase@@UAEPAVHBufC8@@XZ @ 16 NONAME ; class HBufC8 * CSenFragmentBase::AsXmlL(void)
+	?AsXmlUnicodeL@CSenDomFragmentBase@@UAEPAVHBufC16@@XZ @ 17 NONAME ; class HBufC16 * CSenDomFragmentBase::AsXmlUnicodeL(void)
+	?AsXmlUnicodeL@CSenFragmentBase@@UAEPAVHBufC16@@XZ @ 18 NONAME ; class HBufC16 * CSenFragmentBase::AsXmlUnicodeL(void)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00@Z @ 19 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 20 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 21 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 22 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@0@Z @ 23 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@@Z @ 24 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTXmlEngElement@@@Z @ 25 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TXmlEngElement const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXXZ @ 26 NONAME ; void CSenDomFragmentBase::BaseConstructL(void)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00@Z @ 27 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 28 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 29 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 30 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@0@Z @ 31 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@@Z @ 32 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTXmlEngElement@@@Z @ 33 NONAME ; void CSenFragmentBase::BaseConstructL(class TXmlEngElement const &)
+	?Close@RSenDocument@@QAEXXZ @ 34 NONAME ; void RSenDocument::Close(void)
+	?ConsistsOfL@CSenDomFragmentBase@@MAEHAAVTXmlEngElement@@0@Z @ 35 NONAME ; int CSenDomFragmentBase::ConsistsOfL(class TXmlEngElement &, class TXmlEngElement &)
+	?ConsistsOfL@CSenDomFragmentBase@@UAEHAAVCSenFragmentBase@@@Z @ 36 NONAME ; int CSenDomFragmentBase::ConsistsOfL(class CSenFragmentBase &)
+	?ConsistsOfL@CSenFragmentBase@@MAEHAAVTXmlEngElement@@0@Z @ 37 NONAME ; int CSenFragmentBase::ConsistsOfL(class TXmlEngElement &, class TXmlEngElement &)
+	?ConsistsOfL@CSenFragmentBase@@UAEHAAV1@@Z @ 38 NONAME ; int CSenFragmentBase::ConsistsOfL(class CSenFragmentBase &)
+	?ContentL@CSenDomFragmentBase@@UAE?AVTPtrC8@@XZ @ 39 NONAME ; class TPtrC8 CSenDomFragmentBase::ContentL(void)
+	?ContentL@CSenFragmentBase@@UAE?AVTPtrC8@@XZ @ 40 NONAME ; class TPtrC8 CSenFragmentBase::ContentL(void)
+	?ContentOf@CSenDomFragmentBase@@IAE?AVTPtrC8@@ABVTDesC8@@@Z @ 41 NONAME ; class TPtrC8 CSenDomFragmentBase::ContentOf(class TDesC8 const &)
+	?ContentOf@CSenFragmentBase@@IAE?AVTPtrC8@@ABVTDesC8@@@Z @ 42 NONAME ; class TPtrC8 CSenFragmentBase::ContentOf(class TDesC8 const &)
+	?Copy@RSenDocument@@QAE?AV1@XZ @ 43 NONAME ; class RSenDocument RSenDocument::Copy(void)
+	?Destroy@RSenDocument@@QAEXXZ @ 44 NONAME ; void RSenDocument::Destroy(void)
+	?ExpandL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 45 NONAME ; void CSenDomFragmentBase::ExpandL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?ExtractElement@CSenDomFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 46 NONAME ; class TXmlEngElement CSenDomFragmentBase::ExtractElement(void)
+	?ExtractElement@CSenFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 47 NONAME ; class TXmlEngElement CSenFragmentBase::ExtractElement(void)
+	?GetExtendedInterface@CSenDomFragmentBase@@UAEPAXJ@Z @ 48 NONAME ; void * CSenDomFragmentBase::GetExtendedInterface(long)
+	?GetExtendedInterface@CSenFragmentBase@@UAEPAXJ@Z @ 49 NONAME ; void * CSenFragmentBase::GetExtendedInterface(long)
+	?LocalName@CSenDomFragmentBase@@UBE?AVTPtrC8@@XZ @ 50 NONAME ; class TPtrC8 CSenDomFragmentBase::LocalName(void) const
+	?LocalName@CSenFragmentBase@@UBE?AVTPtrC8@@XZ @ 51 NONAME ; class TPtrC8 CSenFragmentBase::LocalName(void) const
+	?Namespace@CSenDomFragmentBase@@UAE?AVTXmlEngNamespace@@ABVTDesC8@@@Z @ 52 NONAME ; class TXmlEngNamespace CSenDomFragmentBase::Namespace(class TDesC8 const &)
+	?Namespace@CSenFragmentBase@@UAE?AVTXmlEngNamespace@@ABVTDesC8@@@Z @ 53 NONAME ; class TXmlEngNamespace CSenFragmentBase::Namespace(class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00@Z @ 54 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 55 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 56 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 57 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@0@Z @ 58 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@@Z @ 59 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTXmlEngElement@@@Z @ 60 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TXmlEngElement const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@XZ @ 61 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(void)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00@Z @ 62 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 63 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 64 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 65 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@0@Z @ 66 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@@Z @ 67 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTXmlEngElement@@@Z @ 68 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TXmlEngElement const &)
+	?NewL@CSenParser@@SAPAV1@AAVCMatchData@Xml@@@Z @ 69 NONAME ; class CSenParser * CSenParser::NewL(class Xml::CMatchData &)
+	?NewL@CSenParser@@SAPAV1@ABVTDesC8@@@Z @ 70 NONAME ; class CSenParser * CSenParser::NewL(class TDesC8 const &)
+	?NewL@CSenParser@@SAPAV1@PAVCParser@Xml@@@Z @ 71 NONAME ; class CSenParser * CSenParser::NewL(class Xml::CParser *)
+	?NewL@CSenParser@@SAPAV1@XZ @ 72 NONAME ; class CSenParser * CSenParser::NewL(void)
+	?NewL@RSenDocument@@SA?AV1@PAX@Z @ 73 NONAME ; class RSenDocument RSenDocument::NewL(void *)
+	?NewL@RSenDocument@@SA?AV1@XZ @ 74 NONAME ; class RSenDocument RSenDocument::NewL(void)
+	?NewLC@CSenParser@@SAPAV1@AAVCMatchData@Xml@@@Z @ 75 NONAME ; class CSenParser * CSenParser::NewLC(class Xml::CMatchData &)
+	?NewLC@CSenParser@@SAPAV1@ABVTDesC8@@@Z @ 76 NONAME ; class CSenParser * CSenParser::NewLC(class TDesC8 const &)
+	?NewLC@CSenParser@@SAPAV1@PAVCParser@Xml@@@Z @ 77 NONAME ; class CSenParser * CSenParser::NewLC(class Xml::CParser *)
+	?NewLC@CSenParser@@SAPAV1@XZ @ 78 NONAME ; class CSenParser * CSenParser::NewLC(void)
+	?NewLC@RSenDocument@@SA?AV1@PAX@Z @ 79 NONAME ; class RSenDocument RSenDocument::NewLC(void *)
+	?NewLC@RSenDocument@@SA?AV1@XZ @ 80 NONAME ; class RSenDocument RSenDocument::NewLC(void)
+	?NsPrefix@CSenDomFragmentBase@@UBE?AVTPtrC8@@XZ @ 81 NONAME ; class TPtrC8 CSenDomFragmentBase::NsPrefix(void) const
+	?NsPrefix@CSenFragmentBase@@UBE?AVTPtrC8@@XZ @ 82 NONAME ; class TPtrC8 CSenFragmentBase::NsPrefix(void) const
+	?NsUri@CSenDomFragmentBase@@UBE?AVTPtrC8@@XZ @ 83 NONAME ; class TPtrC8 CSenDomFragmentBase::NsUri(void) const
+	?NsUri@CSenFragmentBase@@UBE?AVTPtrC8@@XZ @ 84 NONAME ; class TPtrC8 CSenFragmentBase::NsUri(void) const
+	?OnContentL@CSenDomFragmentBase@@UAEXABVTDesC8@@H@Z @ 85 NONAME ; void CSenDomFragmentBase::OnContentL(class TDesC8 const &, int)
+	?OnContentL@CSenFragmentBase@@UAEXABVTDesC8@@H@Z @ 86 NONAME ; void CSenFragmentBase::OnContentL(class TDesC8 const &, int)
+	?OnDelegateParsingL@CSenDomFragmentBase@@UAEXAAVCSenFragmentBase@@@Z @ 87 NONAME ; void CSenDomFragmentBase::OnDelegateParsingL(class CSenFragmentBase &)
+	?OnDelegateParsingL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 88 NONAME ; void CSenDomFragmentBase::OnDelegateParsingL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnDelegateParsingL@CSenFragmentBase@@UAEXAAV1@@Z @ 89 NONAME ; void CSenFragmentBase::OnDelegateParsingL(class CSenFragmentBase &)
+	?OnDelegateParsingL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 90 NONAME ; void CSenFragmentBase::OnDelegateParsingL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnEndDocumentL@CSenDomFragmentBase@@UAEXH@Z @ 91 NONAME ; void CSenDomFragmentBase::OnEndDocumentL(int)
+	?OnEndDocumentL@CSenFragmentBase@@UAEXH@Z @ 92 NONAME ; void CSenFragmentBase::OnEndDocumentL(int)
+	?OnEndElementL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 93 NONAME ; void CSenDomFragmentBase::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnEndElementL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 94 NONAME ; void CSenFragmentBase::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnEndPrefixMappingL@CSenDomFragmentBase@@UAEXABVRString@@H@Z @ 95 NONAME ; void CSenDomFragmentBase::OnEndPrefixMappingL(class RString const &, int)
+	?OnEndPrefixMappingL@CSenFragmentBase@@UAEXABVRString@@H@Z @ 96 NONAME ; void CSenFragmentBase::OnEndPrefixMappingL(class RString const &, int)
+	?OnError@CSenDomFragmentBase@@UAEXH@Z @ 97 NONAME ; void CSenDomFragmentBase::OnError(int)
+	?OnError@CSenFragmentBase@@UAEXH@Z @ 98 NONAME ; void CSenFragmentBase::OnError(int)
+	?OnIgnorableWhiteSpaceL@CSenDomFragmentBase@@UAEXABVTDesC8@@H@Z @ 99 NONAME ; void CSenDomFragmentBase::OnIgnorableWhiteSpaceL(class TDesC8 const &, int)
+	?OnIgnorableWhiteSpaceL@CSenFragmentBase@@UAEXABVTDesC8@@H@Z @ 100 NONAME ; void CSenFragmentBase::OnIgnorableWhiteSpaceL(class TDesC8 const &, int)
+	?OnProcessingInstructionL@CSenDomFragmentBase@@UAEXABVTDesC8@@0H@Z @ 101 NONAME ; void CSenDomFragmentBase::OnProcessingInstructionL(class TDesC8 const &, class TDesC8 const &, int)
+	?OnProcessingInstructionL@CSenFragmentBase@@UAEXABVTDesC8@@0H@Z @ 102 NONAME ; void CSenFragmentBase::OnProcessingInstructionL(class TDesC8 const &, class TDesC8 const &, int)
+	?OnResumeParsingFromL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 103 NONAME ; void CSenDomFragmentBase::OnResumeParsingFromL(class Xml::RTagInfo const &, int)
+	?OnResumeParsingFromL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 104 NONAME ; void CSenFragmentBase::OnResumeParsingFromL(class Xml::RTagInfo const &, int)
+	?OnSkippedEntityL@CSenDomFragmentBase@@UAEXABVRString@@H@Z @ 105 NONAME ; void CSenDomFragmentBase::OnSkippedEntityL(class RString const &, int)
+	?OnSkippedEntityL@CSenFragmentBase@@UAEXABVRString@@H@Z @ 106 NONAME ; void CSenFragmentBase::OnSkippedEntityL(class RString const &, int)
+	?OnStartDocumentL@CSenDomFragmentBase@@UAEXABVRDocumentParameters@Xml@@H@Z @ 107 NONAME ; void CSenDomFragmentBase::OnStartDocumentL(class Xml::RDocumentParameters const &, int)
+	?OnStartDocumentL@CSenFragmentBase@@UAEXABVRDocumentParameters@Xml@@H@Z @ 108 NONAME ; void CSenFragmentBase::OnStartDocumentL(class Xml::RDocumentParameters const &, int)
+	?OnStartElementL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 109 NONAME ; void CSenDomFragmentBase::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnStartElementL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 110 NONAME ; void CSenFragmentBase::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnStartPrefixMappingL@CSenDomFragmentBase@@UAEXABVRString@@0H@Z @ 111 NONAME ; void CSenDomFragmentBase::OnStartPrefixMappingL(class RString const &, class RString const &, int)
+	?OnStartPrefixMappingL@CSenFragmentBase@@UAEXABVRString@@0H@Z @ 112 NONAME ; void CSenFragmentBase::OnStartPrefixMappingL(class RString const &, class RString const &, int)
+	?OnWriteEndElementL@CSenDomFragmentBase@@QAEXABVRTagInfo@Xml@@@Z @ 113 NONAME ; void CSenDomFragmentBase::OnWriteEndElementL(class Xml::RTagInfo const &)
+	?OnWriteEndElementL@CSenFragmentBase@@QAEXABVRTagInfo@Xml@@@Z @ 114 NONAME ; void CSenFragmentBase::OnWriteEndElementL(class Xml::RTagInfo const &)
+	?OnWriteStartElementL@CSenDomFragmentBase@@QAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 115 NONAME ; void CSenDomFragmentBase::OnWriteStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?OnWriteStartElementL@CSenFragmentBase@@QAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 116 NONAME ; void CSenFragmentBase::OnWriteStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?ResetContentL@CSenDomFragmentBase@@UAEXXZ @ 117 NONAME ; void CSenDomFragmentBase::ResetContentL(void)
+	?ResetContentL@CSenFragmentBase@@UAEXXZ @ 118 NONAME ; void CSenFragmentBase::ResetContentL(void)
+	?SetContentHandler@CSenDomFragmentBase@@QAEXAAVCSenFragmentBase@@@Z @ 119 NONAME ; void CSenDomFragmentBase::SetContentHandler(class CSenFragmentBase &)
+	?SetContentHandler@CSenFragmentBase@@QAEXAAV1@@Z @ 120 NONAME ; void CSenFragmentBase::SetContentHandler(class CSenFragmentBase &)
+	?SetContentL@CSenFragmentBase@@MAEXABVTDesC8@@@Z @ 121 NONAME ; void CSenFragmentBase::SetContentL(class TDesC8 const &)
+	?SetContentOfL@CSenDomFragmentBase@@IAE?AVTXmlEngElement@@ABVTDesC8@@0@Z @ 122 NONAME ; class TXmlEngElement CSenDomFragmentBase::SetContentOfL(class TDesC8 const &, class TDesC8 const &)
+	?SetContentOfL@CSenFragmentBase@@IAE?AVTXmlEngElement@@ABVTDesC8@@0@Z @ 123 NONAME ; class TXmlEngElement CSenFragmentBase::SetContentOfL(class TDesC8 const &, class TDesC8 const &)
+	?SetOwner@CSenDomFragmentBase@@UAEXAAVCSenFragmentBase@@@Z @ 124 NONAME ; void CSenDomFragmentBase::SetOwner(class CSenFragmentBase &)
+	?SetOwner@CSenFragmentBase@@UAEXAAV1@@Z @ 125 NONAME ; void CSenFragmentBase::SetOwner(class CSenFragmentBase &)
+	?SetParser@CSenFragmentBase@@EAEXAAVCSenParser@@@Z @ 126 NONAME ; void CSenFragmentBase::SetParser(class CSenParser &)
+	?WriteAsXMLToL@CSenDomFragmentBase@@UAEXAAVRWriteStream@@@Z @ 127 NONAME ; void CSenDomFragmentBase::WriteAsXMLToL(class RWriteStream &)
+	?WriteAsXMLToL@CSenFragmentBase@@UAEXAAVRWriteStream@@@Z @ 128 NONAME ; void CSenFragmentBase::WriteAsXMLToL(class RWriteStream &)
+	?StartSavingContent@CSenFragmentBase@@IAEXXZ @ 129 NONAME ; void CSenFragmentBase::StartSavingContent(void)
+	?BaseConstructL@CSenFragmentBase@@IAEXAAVTXmlEngElement@@AAVRSenDocument@@@Z @ 130 NONAME ; void CSenFragmentBase::BaseConstructL(class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenFragmentBase@@SAPAV1@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 131 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TXmlEngElement &, class RSenDocument &)
+	?SetDocument@CSenFragmentBase@@QAEXAAVRSenDocument@@@Z @ 132 NONAME ; void CSenFragmentBase::SetDocument(class RSenDocument &)
+	?ManualXmlEngineTlsAttachL@RSenDocument@@SAHXZ @ 133 NONAME ; int RSenDocument::ManualXmlEngineTlsAttachL(void)
+	?ManualXmlEngineTlsCleanup@RSenDocument@@SAHXZ @ 134 NONAME ; int RSenDocument::ManualXmlEngineTlsCleanup(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/BWINSCW/SenFragment_3.0U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,135 @@
+EXPORTS
+	??0CSenDomFragmentBase@@IAE@XZ @ 1 NONAME ; CSenDomFragmentBase::CSenDomFragmentBase(void)
+	??0CSenFragmentBase@@IAE@XZ @ 2 NONAME ; CSenFragmentBase::CSenFragmentBase(void)
+	??1CSenDomFragmentBase@@UAE@XZ @ 3 NONAME ; CSenDomFragmentBase::~CSenDomFragmentBase(void)
+	??1CSenFragmentBase@@UAE@XZ @ 4 NONAME ; CSenFragmentBase::~CSenFragmentBase(void)
+	?AddAttributesL@CSenDomFragmentBase@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 5 NONAME ; void CSenDomFragmentBase::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddAttributesL@CSenFragmentBase@@MAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 6 NONAME ; void CSenFragmentBase::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddAttributesToElementL@CSenFragmentBase@@MAEXVTXmlEngElement@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 7 NONAME ; void CSenFragmentBase::AddAttributesToElementL(class TXmlEngElement, class RArray<class Xml::RAttribute> const &)
+	?AddContentL@CSenFragmentBase@@MAEXABVTDesC8@@@Z @ 8 NONAME ; void CSenFragmentBase::AddContentL(class TDesC8 const &)
+	?AddNamespacesL@CSenDomFragmentBase@@MAEXXZ @ 9 NONAME ; void CSenDomFragmentBase::AddNamespacesL(void)
+	?AddNamespacesL@CSenFragmentBase@@MAEXXZ @ 10 NONAME ; void CSenFragmentBase::AddNamespacesL(void)
+	?AsDocumentL@CSenDomFragmentBase@@UAEAAVRSenDocument@@XZ @ 11 NONAME ; class RSenDocument & CSenDomFragmentBase::AsDocumentL(void)
+	?AsDocumentL@CSenFragmentBase@@UAEAAVRSenDocument@@XZ @ 12 NONAME ; class RSenDocument & CSenFragmentBase::AsDocumentL(void)
+	?AsElementL@CSenDomFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 13 NONAME ; class TXmlEngElement CSenDomFragmentBase::AsElementL(void)
+	?AsElementL@CSenFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 14 NONAME ; class TXmlEngElement CSenFragmentBase::AsElementL(void)
+	?AsXmlL@CSenDomFragmentBase@@UAEPAVHBufC8@@XZ @ 15 NONAME ; class HBufC8 * CSenDomFragmentBase::AsXmlL(void)
+	?AsXmlL@CSenFragmentBase@@UAEPAVHBufC8@@XZ @ 16 NONAME ; class HBufC8 * CSenFragmentBase::AsXmlL(void)
+	?AsXmlUnicodeL@CSenDomFragmentBase@@UAEPAVHBufC16@@XZ @ 17 NONAME ; class HBufC16 * CSenDomFragmentBase::AsXmlUnicodeL(void)
+	?AsXmlUnicodeL@CSenFragmentBase@@UAEPAVHBufC16@@XZ @ 18 NONAME ; class HBufC16 * CSenFragmentBase::AsXmlUnicodeL(void)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00@Z @ 19 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 20 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 21 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 22 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@0@Z @ 23 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTDesC8@@@Z @ 24 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXABVTXmlEngElement@@@Z @ 25 NONAME ; void CSenDomFragmentBase::BaseConstructL(class TXmlEngElement const &)
+	?BaseConstructL@CSenDomFragmentBase@@IAEXXZ @ 26 NONAME ; void CSenDomFragmentBase::BaseConstructL(void)
+	?BaseConstructL@CSenFragmentBase@@IAEXAAVTXmlEngElement@@AAVRSenDocument@@@Z @ 27 NONAME ; void CSenFragmentBase::BaseConstructL(class TXmlEngElement &, class RSenDocument &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00@Z @ 28 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 29 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 30 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 31 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@0@Z @ 32 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTDesC8@@@Z @ 33 NONAME ; void CSenFragmentBase::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenFragmentBase@@IAEXABVTXmlEngElement@@@Z @ 34 NONAME ; void CSenFragmentBase::BaseConstructL(class TXmlEngElement const &)
+	?Close@RSenDocument@@QAEXXZ @ 35 NONAME ; void RSenDocument::Close(void)
+	?ConsistsOfL@CSenDomFragmentBase@@MAEHAAVTXmlEngElement@@0@Z @ 36 NONAME ; int CSenDomFragmentBase::ConsistsOfL(class TXmlEngElement &, class TXmlEngElement &)
+	?ConsistsOfL@CSenDomFragmentBase@@UAEHAAVCSenFragmentBase@@@Z @ 37 NONAME ; int CSenDomFragmentBase::ConsistsOfL(class CSenFragmentBase &)
+	?ConsistsOfL@CSenFragmentBase@@MAEHAAVTXmlEngElement@@0@Z @ 38 NONAME ; int CSenFragmentBase::ConsistsOfL(class TXmlEngElement &, class TXmlEngElement &)
+	?ConsistsOfL@CSenFragmentBase@@UAEHAAV1@@Z @ 39 NONAME ; int CSenFragmentBase::ConsistsOfL(class CSenFragmentBase &)
+	?ContentL@CSenDomFragmentBase@@UAE?AVTPtrC8@@XZ @ 40 NONAME ; class TPtrC8 CSenDomFragmentBase::ContentL(void)
+	?ContentL@CSenFragmentBase@@UAE?AVTPtrC8@@XZ @ 41 NONAME ; class TPtrC8 CSenFragmentBase::ContentL(void)
+	?ContentOf@CSenDomFragmentBase@@IAE?AVTPtrC8@@ABVTDesC8@@@Z @ 42 NONAME ; class TPtrC8 CSenDomFragmentBase::ContentOf(class TDesC8 const &)
+	?ContentOf@CSenFragmentBase@@IAE?AVTPtrC8@@ABVTDesC8@@@Z @ 43 NONAME ; class TPtrC8 CSenFragmentBase::ContentOf(class TDesC8 const &)
+	?Copy@RSenDocument@@QAE?AV1@XZ @ 44 NONAME ; class RSenDocument RSenDocument::Copy(void)
+	?Destroy@RSenDocument@@QAEXXZ @ 45 NONAME ; void RSenDocument::Destroy(void)
+	?ExpandL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 46 NONAME ; void CSenDomFragmentBase::ExpandL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?ExtractElement@CSenDomFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 47 NONAME ; class TXmlEngElement CSenDomFragmentBase::ExtractElement(void)
+	?ExtractElement@CSenFragmentBase@@UAE?AVTXmlEngElement@@XZ @ 48 NONAME ; class TXmlEngElement CSenFragmentBase::ExtractElement(void)
+	?GetExtendedInterface@CSenDomFragmentBase@@UAEPAXJ@Z @ 49 NONAME ; void * CSenDomFragmentBase::GetExtendedInterface(long)
+	?GetExtendedInterface@CSenFragmentBase@@UAEPAXJ@Z @ 50 NONAME ; void * CSenFragmentBase::GetExtendedInterface(long)
+	?LocalName@CSenDomFragmentBase@@UBE?AVTPtrC8@@XZ @ 51 NONAME ; class TPtrC8 CSenDomFragmentBase::LocalName(void) const
+	?LocalName@CSenFragmentBase@@UBE?AVTPtrC8@@XZ @ 52 NONAME ; class TPtrC8 CSenFragmentBase::LocalName(void) const
+	?Namespace@CSenDomFragmentBase@@UAE?AVTXmlEngNamespace@@ABVTDesC8@@@Z @ 53 NONAME ; class TXmlEngNamespace CSenDomFragmentBase::Namespace(class TDesC8 const &)
+	?Namespace@CSenFragmentBase@@UAE?AVTXmlEngNamespace@@ABVTDesC8@@@Z @ 54 NONAME ; class TXmlEngNamespace CSenFragmentBase::Namespace(class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00@Z @ 55 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 56 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 57 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 58 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@0@Z @ 59 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTDesC8@@@Z @ 60 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TDesC8 const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@ABVTXmlEngElement@@@Z @ 61 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(class TXmlEngElement const &)
+	?NewL@CSenDomFragmentBase@@SAPAV1@XZ @ 62 NONAME ; class CSenDomFragmentBase * CSenDomFragmentBase::NewL(void)
+	?NewL@CSenFragmentBase@@SAPAV1@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 63 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00@Z @ 64 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 65 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@@Z @ 66 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 67 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@0@Z @ 68 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTDesC8@@@Z @ 69 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TDesC8 const &)
+	?NewL@CSenFragmentBase@@SAPAV1@ABVTXmlEngElement@@@Z @ 70 NONAME ; class CSenFragmentBase * CSenFragmentBase::NewL(class TXmlEngElement const &)
+	?NewL@CSenParser@@SAPAV1@ABVTDesC8@@@Z @ 71 NONAME ; class CSenParser * CSenParser::NewL(class TDesC8 const &)
+	?NewL@CSenParser@@SAPAV1@PAVCParser@Xml@@@Z @ 72 NONAME ; class CSenParser * CSenParser::NewL(class Xml::CParser *)
+	?NewL@CSenParser@@SAPAV1@XZ @ 73 NONAME ; class CSenParser * CSenParser::NewL(void)
+	?NewL@RSenDocument@@SA?AV1@PAX@Z @ 74 NONAME ; class RSenDocument RSenDocument::NewL(void *)
+	?NewL@RSenDocument@@SA?AV1@XZ @ 75 NONAME ; class RSenDocument RSenDocument::NewL(void)
+	?NewLC@CSenParser@@SAPAV1@ABVTDesC8@@@Z @ 76 NONAME ; class CSenParser * CSenParser::NewLC(class TDesC8 const &)
+	?NewLC@CSenParser@@SAPAV1@PAVCParser@Xml@@@Z @ 77 NONAME ; class CSenParser * CSenParser::NewLC(class Xml::CParser *)
+	?NewLC@CSenParser@@SAPAV1@XZ @ 78 NONAME ; class CSenParser * CSenParser::NewLC(void)
+	?NewLC@RSenDocument@@SA?AV1@PAX@Z @ 79 NONAME ; class RSenDocument RSenDocument::NewLC(void *)
+	?NewLC@RSenDocument@@SA?AV1@XZ @ 80 NONAME ; class RSenDocument RSenDocument::NewLC(void)
+	?NsPrefix@CSenDomFragmentBase@@UBE?AVTPtrC8@@XZ @ 81 NONAME ; class TPtrC8 CSenDomFragmentBase::NsPrefix(void) const
+	?NsPrefix@CSenFragmentBase@@UBE?AVTPtrC8@@XZ @ 82 NONAME ; class TPtrC8 CSenFragmentBase::NsPrefix(void) const
+	?NsUri@CSenDomFragmentBase@@UBE?AVTPtrC8@@XZ @ 83 NONAME ; class TPtrC8 CSenDomFragmentBase::NsUri(void) const
+	?NsUri@CSenFragmentBase@@UBE?AVTPtrC8@@XZ @ 84 NONAME ; class TPtrC8 CSenFragmentBase::NsUri(void) const
+	?OnContentL@CSenDomFragmentBase@@UAEXABVTDesC8@@H@Z @ 85 NONAME ; void CSenDomFragmentBase::OnContentL(class TDesC8 const &, int)
+	?OnContentL@CSenFragmentBase@@UAEXABVTDesC8@@H@Z @ 86 NONAME ; void CSenFragmentBase::OnContentL(class TDesC8 const &, int)
+	?OnDelegateParsingL@CSenDomFragmentBase@@UAEXAAVCSenFragmentBase@@@Z @ 87 NONAME ; void CSenDomFragmentBase::OnDelegateParsingL(class CSenFragmentBase &)
+	?OnDelegateParsingL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 88 NONAME ; void CSenDomFragmentBase::OnDelegateParsingL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnDelegateParsingL@CSenFragmentBase@@UAEXAAV1@@Z @ 89 NONAME ; void CSenFragmentBase::OnDelegateParsingL(class CSenFragmentBase &)
+	?OnDelegateParsingL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 90 NONAME ; void CSenFragmentBase::OnDelegateParsingL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnEndDocumentL@CSenDomFragmentBase@@UAEXH@Z @ 91 NONAME ; void CSenDomFragmentBase::OnEndDocumentL(int)
+	?OnEndDocumentL@CSenFragmentBase@@UAEXH@Z @ 92 NONAME ; void CSenFragmentBase::OnEndDocumentL(int)
+	?OnEndElementL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 93 NONAME ; void CSenDomFragmentBase::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnEndElementL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 94 NONAME ; void CSenFragmentBase::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnEndPrefixMappingL@CSenDomFragmentBase@@UAEXABVRString@@H@Z @ 95 NONAME ; void CSenDomFragmentBase::OnEndPrefixMappingL(class RString const &, int)
+	?OnEndPrefixMappingL@CSenFragmentBase@@UAEXABVRString@@H@Z @ 96 NONAME ; void CSenFragmentBase::OnEndPrefixMappingL(class RString const &, int)
+	?OnError@CSenDomFragmentBase@@UAEXH@Z @ 97 NONAME ; void CSenDomFragmentBase::OnError(int)
+	?OnError@CSenFragmentBase@@UAEXH@Z @ 98 NONAME ; void CSenFragmentBase::OnError(int)
+	?OnIgnorableWhiteSpaceL@CSenDomFragmentBase@@UAEXABVTDesC8@@H@Z @ 99 NONAME ; void CSenDomFragmentBase::OnIgnorableWhiteSpaceL(class TDesC8 const &, int)
+	?OnIgnorableWhiteSpaceL@CSenFragmentBase@@UAEXABVTDesC8@@H@Z @ 100 NONAME ; void CSenFragmentBase::OnIgnorableWhiteSpaceL(class TDesC8 const &, int)
+	?OnProcessingInstructionL@CSenDomFragmentBase@@UAEXABVTDesC8@@0H@Z @ 101 NONAME ; void CSenDomFragmentBase::OnProcessingInstructionL(class TDesC8 const &, class TDesC8 const &, int)
+	?OnProcessingInstructionL@CSenFragmentBase@@UAEXABVTDesC8@@0H@Z @ 102 NONAME ; void CSenFragmentBase::OnProcessingInstructionL(class TDesC8 const &, class TDesC8 const &, int)
+	?OnResumeParsingFromL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 103 NONAME ; void CSenDomFragmentBase::OnResumeParsingFromL(class Xml::RTagInfo const &, int)
+	?OnResumeParsingFromL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@H@Z @ 104 NONAME ; void CSenFragmentBase::OnResumeParsingFromL(class Xml::RTagInfo const &, int)
+	?OnSkippedEntityL@CSenDomFragmentBase@@UAEXABVRString@@H@Z @ 105 NONAME ; void CSenDomFragmentBase::OnSkippedEntityL(class RString const &, int)
+	?OnSkippedEntityL@CSenFragmentBase@@UAEXABVRString@@H@Z @ 106 NONAME ; void CSenFragmentBase::OnSkippedEntityL(class RString const &, int)
+	?OnStartDocumentL@CSenDomFragmentBase@@UAEXABVRDocumentParameters@Xml@@H@Z @ 107 NONAME ; void CSenDomFragmentBase::OnStartDocumentL(class Xml::RDocumentParameters const &, int)
+	?OnStartDocumentL@CSenFragmentBase@@UAEXABVRDocumentParameters@Xml@@H@Z @ 108 NONAME ; void CSenFragmentBase::OnStartDocumentL(class Xml::RDocumentParameters const &, int)
+	?OnStartElementL@CSenDomFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 109 NONAME ; void CSenDomFragmentBase::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnStartElementL@CSenFragmentBase@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 110 NONAME ; void CSenFragmentBase::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnStartPrefixMappingL@CSenDomFragmentBase@@UAEXABVRString@@0H@Z @ 111 NONAME ; void CSenDomFragmentBase::OnStartPrefixMappingL(class RString const &, class RString const &, int)
+	?OnStartPrefixMappingL@CSenFragmentBase@@UAEXABVRString@@0H@Z @ 112 NONAME ; void CSenFragmentBase::OnStartPrefixMappingL(class RString const &, class RString const &, int)
+	?OnWriteEndElementL@CSenDomFragmentBase@@QAEXABVRTagInfo@Xml@@@Z @ 113 NONAME ; void CSenDomFragmentBase::OnWriteEndElementL(class Xml::RTagInfo const &)
+	?OnWriteEndElementL@CSenFragmentBase@@QAEXABVRTagInfo@Xml@@@Z @ 114 NONAME ; void CSenFragmentBase::OnWriteEndElementL(class Xml::RTagInfo const &)
+	?OnWriteStartElementL@CSenDomFragmentBase@@QAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 115 NONAME ; void CSenDomFragmentBase::OnWriteStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?OnWriteStartElementL@CSenFragmentBase@@QAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 116 NONAME ; void CSenFragmentBase::OnWriteStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?ResetContentL@CSenDomFragmentBase@@UAEXXZ @ 117 NONAME ; void CSenDomFragmentBase::ResetContentL(void)
+	?ResetContentL@CSenFragmentBase@@UAEXXZ @ 118 NONAME ; void CSenFragmentBase::ResetContentL(void)
+	?SetContentHandler@CSenDomFragmentBase@@QAEXAAVCSenFragmentBase@@@Z @ 119 NONAME ; void CSenDomFragmentBase::SetContentHandler(class CSenFragmentBase &)
+	?SetContentHandler@CSenFragmentBase@@QAEXAAV1@@Z @ 120 NONAME ; void CSenFragmentBase::SetContentHandler(class CSenFragmentBase &)
+	?SetContentL@CSenFragmentBase@@MAEXABVTDesC8@@@Z @ 121 NONAME ; void CSenFragmentBase::SetContentL(class TDesC8 const &)
+	?SetContentOfL@CSenDomFragmentBase@@IAE?AVTXmlEngElement@@ABVTDesC8@@0@Z @ 122 NONAME ; class TXmlEngElement CSenDomFragmentBase::SetContentOfL(class TDesC8 const &, class TDesC8 const &)
+	?SetContentOfL@CSenFragmentBase@@IAE?AVTXmlEngElement@@ABVTDesC8@@0@Z @ 123 NONAME ; class TXmlEngElement CSenFragmentBase::SetContentOfL(class TDesC8 const &, class TDesC8 const &)
+	?SetDocument@CSenFragmentBase@@QAEXAAVRSenDocument@@@Z @ 124 NONAME ; void CSenFragmentBase::SetDocument(class RSenDocument &)
+	?SetOwner@CSenDomFragmentBase@@UAEXAAVCSenFragmentBase@@@Z @ 125 NONAME ; void CSenDomFragmentBase::SetOwner(class CSenFragmentBase &)
+	?SetOwner@CSenFragmentBase@@UAEXAAV1@@Z @ 126 NONAME ; void CSenFragmentBase::SetOwner(class CSenFragmentBase &)
+	?SetParser@CSenFragmentBase@@EAEXAAVCSenParser@@@Z @ 127 NONAME ; void CSenFragmentBase::SetParser(class CSenParser &)
+	?StartSavingContent@CSenFragmentBase@@IAEXXZ @ 128 NONAME ; void CSenFragmentBase::StartSavingContent(void)
+	?WriteAsXMLToL@CSenDomFragmentBase@@UAEXAAVRWriteStream@@@Z @ 129 NONAME ; void CSenDomFragmentBase::WriteAsXMLToL(class RWriteStream &)
+	?WriteAsXMLToL@CSenFragmentBase@@UAEXAAVRWriteStream@@@Z @ 130 NONAME ; void CSenFragmentBase::WriteAsXMLToL(class RWriteStream &)
+	?ManualXmlEngineTlsAttachL@RSenDocument@@SAHXZ @ 131 NONAME ; int RSenDocument::ManualXmlEngineTlsAttachL(void)
+	?ManualXmlEngineTlsCleanup@RSenDocument@@SAHXZ @ 132 NONAME ; int RSenDocument::ManualXmlEngineTlsCleanup(void)
+	?XmlEngRenameElementL@WsXmlUtils@@QAEXVTXmlEngElement@@ABVTDesC8@@11@Z @ 133 NONAME ; void WsXmlUtils::XmlEngRenameElementL(class TXmlEngElement, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/eabi/SenFragment_3.0U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,173 @@
+EXPORTS
+	_ZN10CSenParser4NewLEPN3Xml7CParserE @ 1 NONAME
+	_ZN10CSenParser4NewLERK6TDesC8 @ 2 NONAME
+	_ZN10CSenParser4NewLEv @ 3 NONAME
+	_ZN10CSenParser5NewLCEPN3Xml7CParserE @ 4 NONAME
+	_ZN10CSenParser5NewLCERK6TDesC8 @ 5 NONAME
+	_ZN10CSenParser5NewLCEv @ 6 NONAME
+	_ZN12RSenDocument4CopyEv @ 7 NONAME
+	_ZN12RSenDocument4NewLEPv @ 8 NONAME
+	_ZN12RSenDocument4NewLEv @ 9 NONAME
+	_ZN12RSenDocument5CloseEv @ 10 NONAME
+	_ZN12RSenDocument5NewLCEPv @ 11 NONAME
+	_ZN12RSenDocument5NewLCEv @ 12 NONAME
+	_ZN12RSenDocument7DestroyEv @ 13 NONAME
+	_ZN16CSenFragmentBase10AsElementLEv @ 14 NONAME
+	_ZN16CSenFragmentBase10OnContentLERK6TDesC8i @ 15 NONAME
+	_ZN16CSenFragmentBase11AddContentLERK6TDesC8 @ 16 NONAME
+	_ZN16CSenFragmentBase11AsDocumentLEv @ 17 NONAME
+	_ZN16CSenFragmentBase11ConsistsOfLER14TXmlEngElementS1_ @ 18 NONAME
+	_ZN16CSenFragmentBase11ConsistsOfLERS_ @ 19 NONAME
+	_ZN16CSenFragmentBase11SetContentLERK6TDesC8 @ 20 NONAME
+	_ZN16CSenFragmentBase11SetDocumentER12RSenDocument @ 21 NONAME
+	_ZN16CSenFragmentBase13AsXmlUnicodeLEv @ 22 NONAME
+	_ZN16CSenFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 23 NONAME
+	_ZN16CSenFragmentBase13ResetContentLEv @ 24 NONAME
+	_ZN16CSenFragmentBase13SetContentOfLERK6TDesC8S2_ @ 25 NONAME
+	_ZN16CSenFragmentBase13WriteAsXMLToLER12RWriteStream @ 26 NONAME
+	_ZN16CSenFragmentBase14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 27 NONAME
+	_ZN16CSenFragmentBase14AddNamespacesLEv @ 28 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLER14TXmlEngElementR12RSenDocument @ 29 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK14TXmlEngElement @ 30 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8 @ 31 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_ @ 32 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_ @ 33 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 34 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 35 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 36 NONAME
+	_ZN16CSenFragmentBase14ExtractElementEv @ 37 NONAME
+	_ZN16CSenFragmentBase14OnEndDocumentLEi @ 38 NONAME
+	_ZN16CSenFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 39 NONAME
+	_ZN16CSenFragmentBase16OnSkippedEntityLERK7RStringi @ 40 NONAME
+	_ZN16CSenFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 41 NONAME
+	_ZN16CSenFragmentBase17SetContentHandlerERS_ @ 42 NONAME
+	_ZN16CSenFragmentBase18OnDelegateParsingLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 43 NONAME
+	_ZN16CSenFragmentBase18OnDelegateParsingLERS_ @ 44 NONAME
+	_ZN16CSenFragmentBase18OnWriteEndElementLERKN3Xml8RTagInfoE @ 45 NONAME
+	_ZN16CSenFragmentBase18StartSavingContentEv @ 46 NONAME
+	_ZN16CSenFragmentBase19OnEndPrefixMappingLERK7RStringi @ 47 NONAME
+	_ZN16CSenFragmentBase20GetExtendedInterfaceEl @ 48 NONAME
+	_ZN16CSenFragmentBase20OnResumeParsingFromLERKN3Xml8RTagInfoEi @ 49 NONAME
+	_ZN16CSenFragmentBase20OnWriteStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 50 NONAME
+	_ZN16CSenFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 51 NONAME
+	_ZN16CSenFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 52 NONAME
+	_ZN16CSenFragmentBase23AddAttributesToElementLE14TXmlEngElementRK6RArrayIN3Xml10RAttributeEE @ 53 NONAME
+	_ZN16CSenFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 54 NONAME
+	_ZN16CSenFragmentBase4NewLER14TXmlEngElementR12RSenDocument @ 55 NONAME
+	_ZN16CSenFragmentBase4NewLERK14TXmlEngElement @ 56 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8 @ 57 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_ @ 58 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_ @ 59 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 60 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 61 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 62 NONAME
+	_ZN16CSenFragmentBase6AsXmlLEv @ 63 NONAME
+	_ZN16CSenFragmentBase7OnErrorEi @ 64 NONAME
+	_ZN16CSenFragmentBase8ContentLEv @ 65 NONAME
+	_ZN16CSenFragmentBase8SetOwnerERS_ @ 66 NONAME
+	_ZN16CSenFragmentBase9ContentOfERK6TDesC8 @ 67 NONAME
+	_ZN16CSenFragmentBase9NamespaceERK6TDesC8 @ 68 NONAME
+	_ZN16CSenFragmentBase9SetParserER10CSenParser @ 69 NONAME
+	_ZN16CSenFragmentBaseC1Ev @ 70 NONAME
+	_ZN16CSenFragmentBaseC2Ev @ 71 NONAME
+	_ZN16CSenFragmentBaseD0Ev @ 72 NONAME
+	_ZN16CSenFragmentBaseD1Ev @ 73 NONAME
+	_ZN16CSenFragmentBaseD2Ev @ 74 NONAME
+	_ZN19CSenDomFragmentBase10AsElementLEv @ 75 NONAME
+	_ZN19CSenDomFragmentBase10OnContentLERK6TDesC8i @ 76 NONAME
+	_ZN19CSenDomFragmentBase11AsDocumentLEv @ 77 NONAME
+	_ZN19CSenDomFragmentBase11ConsistsOfLER14TXmlEngElementS1_ @ 78 NONAME
+	_ZN19CSenDomFragmentBase11ConsistsOfLER16CSenFragmentBase @ 79 NONAME
+	_ZN19CSenDomFragmentBase13AsXmlUnicodeLEv @ 80 NONAME
+	_ZN19CSenDomFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 81 NONAME
+	_ZN19CSenDomFragmentBase13ResetContentLEv @ 82 NONAME
+	_ZN19CSenDomFragmentBase13SetContentOfLERK6TDesC8S2_ @ 83 NONAME
+	_ZN19CSenDomFragmentBase13WriteAsXMLToLER12RWriteStream @ 84 NONAME
+	_ZN19CSenDomFragmentBase14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 85 NONAME
+	_ZN19CSenDomFragmentBase14AddNamespacesLEv @ 86 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK14TXmlEngElement @ 87 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8 @ 88 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_ @ 89 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_ @ 90 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 91 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 92 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 93 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLEv @ 94 NONAME
+	_ZN19CSenDomFragmentBase14ExtractElementEv @ 95 NONAME
+	_ZN19CSenDomFragmentBase14OnEndDocumentLEi @ 96 NONAME
+	_ZN19CSenDomFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 97 NONAME
+	_ZN19CSenDomFragmentBase16OnSkippedEntityLERK7RStringi @ 98 NONAME
+	_ZN19CSenDomFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 99 NONAME
+	_ZN19CSenDomFragmentBase17SetContentHandlerER16CSenFragmentBase @ 100 NONAME
+	_ZN19CSenDomFragmentBase18OnDelegateParsingLER16CSenFragmentBase @ 101 NONAME
+	_ZN19CSenDomFragmentBase18OnDelegateParsingLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 102 NONAME
+	_ZN19CSenDomFragmentBase18OnWriteEndElementLERKN3Xml8RTagInfoE @ 103 NONAME
+	_ZN19CSenDomFragmentBase19OnEndPrefixMappingLERK7RStringi @ 104 NONAME
+	_ZN19CSenDomFragmentBase20GetExtendedInterfaceEl @ 105 NONAME
+	_ZN19CSenDomFragmentBase20OnResumeParsingFromLERKN3Xml8RTagInfoEi @ 106 NONAME
+	_ZN19CSenDomFragmentBase20OnWriteStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 107 NONAME
+	_ZN19CSenDomFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 108 NONAME
+	_ZN19CSenDomFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 109 NONAME
+	_ZN19CSenDomFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 110 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK14TXmlEngElement @ 111 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8 @ 112 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_ @ 113 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_ @ 114 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 115 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 116 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 117 NONAME
+	_ZN19CSenDomFragmentBase4NewLEv @ 118 NONAME
+	_ZN19CSenDomFragmentBase6AsXmlLEv @ 119 NONAME
+	_ZN19CSenDomFragmentBase7ExpandLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 120 NONAME
+	_ZN19CSenDomFragmentBase7OnErrorEi @ 121 NONAME
+	_ZN19CSenDomFragmentBase8ContentLEv @ 122 NONAME
+	_ZN19CSenDomFragmentBase8SetOwnerER16CSenFragmentBase @ 123 NONAME
+	_ZN19CSenDomFragmentBase9ContentOfERK6TDesC8 @ 124 NONAME
+	_ZN19CSenDomFragmentBase9NamespaceERK6TDesC8 @ 125 NONAME
+	_ZN19CSenDomFragmentBaseC1Ev @ 126 NONAME
+	_ZN19CSenDomFragmentBaseC2Ev @ 127 NONAME
+	_ZN19CSenDomFragmentBaseD0Ev @ 128 NONAME
+	_ZN19CSenDomFragmentBaseD1Ev @ 129 NONAME
+	_ZN19CSenDomFragmentBaseD2Ev @ 130 NONAME
+	_ZNK16CSenFragmentBase5NsUriEv @ 131 NONAME
+	_ZNK16CSenFragmentBase8NsPrefixEv @ 132 NONAME
+	_ZNK16CSenFragmentBase9LocalNameEv @ 133 NONAME
+	_ZNK19CSenDomFragmentBase5NsUriEv @ 134 NONAME
+	_ZNK19CSenDomFragmentBase8NsPrefixEv @ 135 NONAME
+	_ZNK19CSenDomFragmentBase9LocalNameEv @ 136 NONAME
+	_ZTI14CSenParserImpl @ 137 NONAME ; #<TI>#
+	_ZTI16CSenFragmentBase @ 138 NONAME ; #<TI>#
+	_ZTI17CSenNamespaceData @ 139 NONAME ; #<TI>#
+	_ZTI19CSenDomFragmentBase @ 140 NONAME ; #<TI>#
+	_ZTV14CSenParserImpl @ 141 NONAME ; #<VT>#
+	_ZTV16CSenFragmentBase @ 142 NONAME ; #<VT>#
+	_ZTV17CSenNamespaceData @ 143 NONAME ; #<VT>#
+	_ZTV19CSenDomFragmentBase @ 144 NONAME ; #<VT>#
+	_ZThn4_N16CSenFragmentBase10OnContentLERK6TDesC8i @ 145 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 146 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase14OnEndDocumentLEi @ 147 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 148 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase16OnSkippedEntityLERK7RStringi @ 149 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 150 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase19OnEndPrefixMappingLERK7RStringi @ 151 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase20GetExtendedInterfaceEl @ 152 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 153 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 154 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 155 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase7OnErrorEi @ 156 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase10OnContentLERK6TDesC8i @ 157 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 158 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase14OnEndDocumentLEi @ 159 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 160 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase16OnSkippedEntityLERK7RStringi @ 161 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 162 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase19OnEndPrefixMappingLERK7RStringi @ 163 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase20GetExtendedInterfaceEl @ 164 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 165 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 166 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 167 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase7OnErrorEi @ 168 NONAME ; #<thunk>#
+	_ZN12RSenDocument25ManualXmlEngineTlsAttachLEv @ 169 NONAME
+	_ZN12RSenDocument25ManualXmlEngineTlsCleanupEv @ 170 NONAME
+	_ZN10WsXmlUtils20XmlEngRenameElementLE14TXmlEngElementRK6TDesC8S3_S3_ @ 171 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/eabi/SenFragmentu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,174 @@
+EXPORTS
+	_ZN10CSenParser4NewLEPN3Xml7CParserE @ 1 NONAME
+	_ZN10CSenParser4NewLERK6TDesC8 @ 2 NONAME
+	_ZN10CSenParser4NewLERN3Xml10CMatchDataE @ 3 NONAME
+	_ZN10CSenParser4NewLEv @ 4 NONAME
+	_ZN10CSenParser5NewLCEPN3Xml7CParserE @ 5 NONAME
+	_ZN10CSenParser5NewLCERK6TDesC8 @ 6 NONAME
+	_ZN10CSenParser5NewLCERN3Xml10CMatchDataE @ 7 NONAME
+	_ZN10CSenParser5NewLCEv @ 8 NONAME
+	_ZN12RSenDocument4CopyEv @ 9 NONAME
+	_ZN12RSenDocument4NewLEPv @ 10 NONAME
+	_ZN12RSenDocument4NewLEv @ 11 NONAME
+	_ZN12RSenDocument5CloseEv @ 12 NONAME
+	_ZN12RSenDocument5NewLCEPv @ 13 NONAME
+	_ZN12RSenDocument5NewLCEv @ 14 NONAME
+	_ZN12RSenDocument7DestroyEv @ 15 NONAME
+	_ZN16CSenFragmentBase10AsElementLEv @ 16 NONAME
+	_ZN16CSenFragmentBase10OnContentLERK6TDesC8i @ 17 NONAME
+	_ZN16CSenFragmentBase11AddContentLERK6TDesC8 @ 18 NONAME
+	_ZN16CSenFragmentBase11AsDocumentLEv @ 19 NONAME
+	_ZN16CSenFragmentBase11ConsistsOfLER14TXmlEngElementS1_ @ 20 NONAME
+	_ZN16CSenFragmentBase11ConsistsOfLERS_ @ 21 NONAME
+	_ZN16CSenFragmentBase11SetContentLERK6TDesC8 @ 22 NONAME
+	_ZN16CSenFragmentBase13AsXmlUnicodeLEv @ 23 NONAME
+	_ZN16CSenFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 24 NONAME
+	_ZN16CSenFragmentBase13ResetContentLEv @ 25 NONAME
+	_ZN16CSenFragmentBase13SetContentOfLERK6TDesC8S2_ @ 26 NONAME
+	_ZN16CSenFragmentBase13WriteAsXMLToLER12RWriteStream @ 27 NONAME
+	_ZN16CSenFragmentBase14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 28 NONAME
+	_ZN16CSenFragmentBase14AddNamespacesLEv @ 29 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK14TXmlEngElement @ 30 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8 @ 31 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_ @ 32 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_ @ 33 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 34 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 35 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 36 NONAME
+	_ZN16CSenFragmentBase14ExtractElementEv @ 37 NONAME
+	_ZN16CSenFragmentBase14OnEndDocumentLEi @ 38 NONAME
+	_ZN16CSenFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 39 NONAME
+	_ZN16CSenFragmentBase16OnSkippedEntityLERK7RStringi @ 40 NONAME
+	_ZN16CSenFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 41 NONAME
+	_ZN16CSenFragmentBase17SetContentHandlerERS_ @ 42 NONAME
+	_ZN16CSenFragmentBase18OnDelegateParsingLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 43 NONAME
+	_ZN16CSenFragmentBase18OnDelegateParsingLERS_ @ 44 NONAME
+	_ZN16CSenFragmentBase18OnWriteEndElementLERKN3Xml8RTagInfoE @ 45 NONAME
+	_ZN16CSenFragmentBase19OnEndPrefixMappingLERK7RStringi @ 46 NONAME
+	_ZN16CSenFragmentBase20GetExtendedInterfaceEl @ 47 NONAME
+	_ZN16CSenFragmentBase20OnResumeParsingFromLERKN3Xml8RTagInfoEi @ 48 NONAME
+	_ZN16CSenFragmentBase20OnWriteStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 49 NONAME
+	_ZN16CSenFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 50 NONAME
+	_ZN16CSenFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 51 NONAME
+	_ZN16CSenFragmentBase23AddAttributesToElementLE14TXmlEngElementRK6RArrayIN3Xml10RAttributeEE @ 52 NONAME
+	_ZN16CSenFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 53 NONAME
+	_ZN16CSenFragmentBase4NewLERK14TXmlEngElement @ 54 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8 @ 55 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_ @ 56 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_ @ 57 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 58 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 59 NONAME
+	_ZN16CSenFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 60 NONAME
+	_ZN16CSenFragmentBase6AsXmlLEv @ 61 NONAME
+	_ZN16CSenFragmentBase7OnErrorEi @ 62 NONAME
+	_ZN16CSenFragmentBase8ContentLEv @ 63 NONAME
+	_ZN16CSenFragmentBase8SetOwnerERS_ @ 64 NONAME
+	_ZN16CSenFragmentBase9ContentOfERK6TDesC8 @ 65 NONAME
+	_ZN16CSenFragmentBase9NamespaceERK6TDesC8 @ 66 NONAME
+	_ZN16CSenFragmentBase9SetParserER10CSenParser @ 67 NONAME
+	_ZN16CSenFragmentBaseC1Ev @ 68 NONAME
+	_ZN16CSenFragmentBaseC2Ev @ 69 NONAME
+	_ZN16CSenFragmentBaseD0Ev @ 70 NONAME
+	_ZN16CSenFragmentBaseD1Ev @ 71 NONAME
+	_ZN16CSenFragmentBaseD2Ev @ 72 NONAME
+	_ZN19CSenDomFragmentBase10AsElementLEv @ 73 NONAME
+	_ZN19CSenDomFragmentBase10OnContentLERK6TDesC8i @ 74 NONAME
+	_ZN19CSenDomFragmentBase11AsDocumentLEv @ 75 NONAME
+	_ZN19CSenDomFragmentBase11ConsistsOfLER14TXmlEngElementS1_ @ 76 NONAME
+	_ZN19CSenDomFragmentBase11ConsistsOfLER16CSenFragmentBase @ 77 NONAME
+	_ZN19CSenDomFragmentBase13AsXmlUnicodeLEv @ 78 NONAME
+	_ZN19CSenDomFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 79 NONAME
+	_ZN19CSenDomFragmentBase13ResetContentLEv @ 80 NONAME
+	_ZN19CSenDomFragmentBase13SetContentOfLERK6TDesC8S2_ @ 81 NONAME
+	_ZN19CSenDomFragmentBase13WriteAsXMLToLER12RWriteStream @ 82 NONAME
+	_ZN19CSenDomFragmentBase14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 83 NONAME
+	_ZN19CSenDomFragmentBase14AddNamespacesLEv @ 84 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK14TXmlEngElement @ 85 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8 @ 86 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_ @ 87 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_ @ 88 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 89 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 90 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 91 NONAME
+	_ZN19CSenDomFragmentBase14BaseConstructLEv @ 92 NONAME
+	_ZN19CSenDomFragmentBase14ExtractElementEv @ 93 NONAME
+	_ZN19CSenDomFragmentBase14OnEndDocumentLEi @ 94 NONAME
+	_ZN19CSenDomFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 95 NONAME
+	_ZN19CSenDomFragmentBase16OnSkippedEntityLERK7RStringi @ 96 NONAME
+	_ZN19CSenDomFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 97 NONAME
+	_ZN19CSenDomFragmentBase17SetContentHandlerER16CSenFragmentBase @ 98 NONAME
+	_ZN19CSenDomFragmentBase18OnDelegateParsingLER16CSenFragmentBase @ 99 NONAME
+	_ZN19CSenDomFragmentBase18OnDelegateParsingLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 100 NONAME
+	_ZN19CSenDomFragmentBase18OnWriteEndElementLERKN3Xml8RTagInfoE @ 101 NONAME
+	_ZN19CSenDomFragmentBase19OnEndPrefixMappingLERK7RStringi @ 102 NONAME
+	_ZN19CSenDomFragmentBase20GetExtendedInterfaceEl @ 103 NONAME
+	_ZN19CSenDomFragmentBase20OnResumeParsingFromLERKN3Xml8RTagInfoEi @ 104 NONAME
+	_ZN19CSenDomFragmentBase20OnWriteStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 105 NONAME
+	_ZN19CSenDomFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 106 NONAME
+	_ZN19CSenDomFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 107 NONAME
+	_ZN19CSenDomFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 108 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK14TXmlEngElement @ 109 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8 @ 110 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_ @ 111 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_ @ 112 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 113 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElement @ 114 NONAME
+	_ZN19CSenDomFragmentBase4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 115 NONAME
+	_ZN19CSenDomFragmentBase4NewLEv @ 116 NONAME
+	_ZN19CSenDomFragmentBase6AsXmlLEv @ 117 NONAME
+	_ZN19CSenDomFragmentBase7ExpandLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 118 NONAME
+	_ZN19CSenDomFragmentBase7OnErrorEi @ 119 NONAME
+	_ZN19CSenDomFragmentBase8ContentLEv @ 120 NONAME
+	_ZN19CSenDomFragmentBase8SetOwnerER16CSenFragmentBase @ 121 NONAME
+	_ZN19CSenDomFragmentBase9ContentOfERK6TDesC8 @ 122 NONAME
+	_ZN19CSenDomFragmentBase9NamespaceERK6TDesC8 @ 123 NONAME
+	_ZN19CSenDomFragmentBaseC1Ev @ 124 NONAME
+	_ZN19CSenDomFragmentBaseC2Ev @ 125 NONAME
+	_ZN19CSenDomFragmentBaseD0Ev @ 126 NONAME
+	_ZN19CSenDomFragmentBaseD1Ev @ 127 NONAME
+	_ZN19CSenDomFragmentBaseD2Ev @ 128 NONAME
+	_ZNK16CSenFragmentBase5NsUriEv @ 129 NONAME
+	_ZNK16CSenFragmentBase8NsPrefixEv @ 130 NONAME
+	_ZNK16CSenFragmentBase9LocalNameEv @ 131 NONAME
+	_ZNK19CSenDomFragmentBase5NsUriEv @ 132 NONAME
+	_ZNK19CSenDomFragmentBase8NsPrefixEv @ 133 NONAME
+	_ZNK19CSenDomFragmentBase9LocalNameEv @ 134 NONAME
+	_ZTI14CSenParserImpl @ 135 NONAME ; #<TI>#
+	_ZTI16CSenFragmentBase @ 136 NONAME ; #<TI>#
+	_ZTI17CSenNamespaceData @ 137 NONAME ; #<TI>#
+	_ZTI19CSenDomFragmentBase @ 138 NONAME ; #<TI>#
+	_ZTV14CSenParserImpl @ 139 NONAME ; #<VT>#
+	_ZTV16CSenFragmentBase @ 140 NONAME ; #<VT>#
+	_ZTV17CSenNamespaceData @ 141 NONAME ; #<VT>#
+	_ZTV19CSenDomFragmentBase @ 142 NONAME ; #<VT>#
+	_ZThn4_N16CSenFragmentBase10OnContentLERK6TDesC8i @ 143 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 144 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase14OnEndDocumentLEi @ 145 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 146 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase16OnSkippedEntityLERK7RStringi @ 147 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 148 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase19OnEndPrefixMappingLERK7RStringi @ 149 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase20GetExtendedInterfaceEl @ 150 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 151 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 152 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 153 NONAME ; #<thunk>#
+	_ZThn4_N16CSenFragmentBase7OnErrorEi @ 154 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase10OnContentLERK6TDesC8i @ 155 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase13OnEndElementLERKN3Xml8RTagInfoEi @ 156 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase14OnEndDocumentLEi @ 157 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 158 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase16OnSkippedEntityLERK7RStringi @ 159 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase16OnStartDocumentLERKN3Xml19RDocumentParametersEi @ 160 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase19OnEndPrefixMappingLERK7RStringi @ 161 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase20GetExtendedInterfaceEl @ 162 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase21OnStartPrefixMappingLERK7RStringS2_i @ 163 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase22OnIgnorableWhiteSpaceLERK6TDesC8i @ 164 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase24OnProcessingInstructionLERK6TDesC8S2_i @ 165 NONAME ; #<thunk>#
+	_ZThn4_N19CSenDomFragmentBase7OnErrorEi @ 166 NONAME ; #<thunk>#
+	_ZN16CSenFragmentBase18StartSavingContentEv @ 167 NONAME
+	_ZN16CSenFragmentBase14BaseConstructLER14TXmlEngElementR12RSenDocument @ 168 NONAME
+	_ZN16CSenFragmentBase4NewLER14TXmlEngElementR12RSenDocument @ 169 NONAME
+	_ZN16CSenFragmentBase11SetDocumentER12RSenDocument @ 170 NONAME
+	_ZN12RSenDocument25ManualXmlEngineTlsAttachLEv @ 171 NONAME
+	_ZN12RSenDocument25ManualXmlEngineTlsCleanupEv @ 172 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsfragment    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+ 
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsfragment.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsfragment.iby)
+PRJ_MMPFILES
+senfragment.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/group/senfragment.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        S60 4.0 reference implementation
+*
+*/
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenFragment.dll
+UID             0x1000008d 0x2000039A
+#else
+TARGET          wsfragment.dll
+UID             0x1000008d 0x101F9746
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+
+SOURCE          senfragmentbase.cpp
+SOURCE          sendomfragmentbase.cpp
+SOURCE          senparser.cpp
+SOURCE          senparserimpl.cpp
+SOURCE          rsendocument.cpp
+SOURCE          wslibxml2utils.cpp
+
+USERINCLUDE     ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+SYSTEMINCLUDE   /epoc32/include/libc
+
+
+
+
+LIBRARY         charconv.lib
+LIBRARY estlib.lib // strlen 
+LIBRARY         estor.lib
+LIBRARY         euser.lib
+LIBRARY         bafl.lib    // RStringbase
+
+// Symbian XML framework is used since S60 3rd edition (3.0)
+LIBRARY         XMLFRAMEWORK.lib
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngine.lib
+    LIBRARY         XmlEngineDOM.lib
+    LIBRARY         XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+    #if defined(ARMCC)
+      DEFFILE ../eabi/SenFragment_3.0.DEF
+    #elif defined(WINSCW)
+      DEFFILE ../BWINSCW/SenFragment_3.0.DEF
+    #elif defined(WINS)
+      DEFFILE ../BWINS/SenFragment_3.0.DEF
+    #else 
+      DEFFILE ../BMARM/SenFragment_3.0.DEF
+    #endif
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/inc/senparserimpl.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This is the real, internal implementation of CSenParser
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_PARSERIMPL_H
+#define SEN_PARSERIMPL_H
+
+#include <SenParser.h>
+
+class CSenParserImpl : public CSenParser
+    {
+    public: // Constructors and destructor
+
+        static CSenParserImpl* NewL();
+        static CSenParserImpl* NewLC();
+
+        static CSenParserImpl* NewL(CParser* aParser);
+        static CSenParserImpl* NewLC(CParser* aParser);
+
+        static CSenParserImpl* NewL(const TDesC8& aParserMimeType);
+        static CSenParserImpl* NewLC(const TDesC8& aParserMimeType);
+
+        virtual ~CSenParserImpl();
+        
+        virtual void SetContentHandler(CSenFragmentBase& aContentHandler);
+
+        virtual void ParseBeginL();
+        virtual void ParseBeginL(const TDesC8& aDocumentMimeType);
+
+
+        virtual void ParseL(const TDesC8& aFragment,
+                                CSenFragmentBase& aContentHandler);
+        virtual void ParseL(RFs& aFs, const TDesC& aFilename,
+                                 CSenFragmentBase& aContentHandler);
+        virtual void ParseL(RFile& aFile, CSenFragmentBase& aContentHandler);
+                                
+        virtual void ParseEndL();
+
+        virtual void SetProcessorChainL(const RContentProcessorUids& aPlugins);
+
+        virtual TInt EnableFeature(TInt aParserFeature);
+        virtual TInt DisableFeature(TInt aParserFeature);
+        virtual TBool IsFeatureEnabled(TInt aParserFeature) const;
+
+        virtual void AddPreloadedDictionaryL(const TDesC8& aPublicId);
+
+        virtual RStringPool& StringPool();
+        virtual RStringDictionaryCollection& StringDictionaryCollection();
+
+    private:
+        CSenParserImpl(CParser* apParser);
+        void ConstructL();
+        void ConstructL(const TDesC8& aParserMimeType);
+
+    private: // Data
+        CSenContentHandler*     ipContentHandler;
+        CParser*                ipParser;
+    };
+
+NONSHARABLE_CLASS(CSenContentHandler) : public CBase, public MContentHandler
+    {
+    public: // Constructors and destructor
+
+        static CSenContentHandler* NewL();
+        static CSenContentHandler* NewLC();
+
+        static CSenContentHandler* NewL(MContentHandler& aContentHandler);
+        static CSenContentHandler* NewLC(MContentHandler& aContentHandler);
+        
+        virtual ~CSenContentHandler();
+
+        void SetContentHandler(MContentHandler& aContentHandler);
+
+        MContentHandler& ContentHandler();
+
+    public: // From MContentHandler
+
+        virtual void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode);
+
+        virtual void OnEndDocumentL(TInt aErrorCode);
+
+
+        virtual void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes,
+                                 TInt aErrorCode);
+
+        virtual void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+
+        virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+
+        virtual void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri,
+                                       TInt aErrorCode);
+
+        virtual void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+
+        virtual void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+
+        virtual void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+
+        virtual void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData,
+                                          TInt aErrorCode);
+
+        /*
+        * Symbian XML Framework errocodes:
+        * [from XmlParserErrors.h]
+        * EXmlParserError = -1000,
+        * EXmlSyntax = 2+EXmlParserError,       // -998
+        * EXmlNoElements,                       // -997
+        * EXmlInvalidToken,                     // -996
+        * EXmlUnclosedToken,                    // -995
+        * EXmlPartialChar,                      // -994
+        * EXmlTagMismatch,                      // -993
+        * EXmlDuplicateAttribute,               // -992
+        * EXmlJunkAfterDocElement,              // -991
+        * EXmlPeRef,                            // -990
+        * EXmlUndefinedEntity,                  // -989
+        * EXmlRecursiveEntity,                  // -988
+        * EXmlAsyncEntity,                      // -987
+        * EXmlBadCharRef,                       // -986
+        * EXmlBinaryEntityRef,                  // -985
+        * EXmlAttributeExternalEntityRef,       // -984
+        * EXmlMisplacedPi,                      // -983
+        * EXmlUnknownEncoding,                  // -982
+        * EXmlIncorrectEncoding,                // -981
+        * EXmlUnclosedCdata,                    // -980
+        * EXmlExternalEntityHandling,           // -979
+        * EXmlNotStandalone,                    // -978
+        * EXmlUnexpectedState,                  // -977
+        * EXmlEntityDeclInPe,                   // -976
+        * EXmlDtdRequired,                      // -975
+        * EXmlFeatureLockedWhileParsing         // -974
+        */
+        virtual void OnError(TInt aErrorCode);
+
+        virtual TAny* GetExtendedInterface(const TInt32 aUid);
+
+    private:
+        CSenContentHandler(MContentHandler* apContentHandler);
+
+    private: // Data
+        MContentHandler* ipContentHandler;
+    };
+
+#endif //SEN_PARSERIMPL_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/inc/wslibxml2utils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This class offers a set of utility functions for XML data
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WS_LIBXML2_UTILS_H_INCLUDED
+#define WS_LIBXML2_UTILS_H_INCLUDED
+
+#include <e32base.h>
+#include "xmlengelement.h"
+
+class WsXmlUtils
+{
+  public:
+  
+/**
+ * Renames TXmlEngElement node.
+ *
+ * @since S60 v5.1
+ * @param aElement Element node
+ * @param aLocalName New name
+ * @param aNamespaceUri New namespace uri
+ * @param aPrefix New namespace prefix
+ */
+			
+	IMPORT_C void  XmlEngRenameElementL(TXmlEngElement aElement, const TDesC8& aLocalName, 
+                               const TDesC8& aNamespaceUri, 
+                               const TDesC8& aPrefix);  
+                                   
+    
+};
+
+
+#endif /* WS_LIBXML2_UTILS_H_INCLUDED */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/rom/wsfragment.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSFRAGMENT_IBY__
+#define __WSFRAGMENT_IBY__
+
+// Fragment
+file=ABI_DIR\BUILD_DIR\SenFragment.dll               PROGRAMS_DIR\SenFragment.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/src/rsendocument.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+#include "RSenDocument.h"
+#include <xmlengxestd.h>
+#include <xmlengdomimplementation.h>
+
+LOCAL_C void CleanupRSenDocument(TAny* aDocumentData)
+	{
+	TSenDocumentData* pData = 
+		REINTERPRET_CAST(TSenDocumentData*, aDocumentData);
+    if ( *pData->ipOpenDocuments <= 1)
+        {
+        RSenDocument document;
+    	document.ipData = pData;
+    	document.Close();
+        }
+    else
+        {
+        *pData->ipOpenDocuments = *pData->ipOpenDocuments-1;
+        }
+	}
+
+EXPORT_C RSenDocument RSenDocument::NewL()
+    {
+    RSenDocument self = RSenDocument::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+EXPORT_C RSenDocument RSenDocument::NewLC()
+    {
+	TBool* pDisabled = (TBool*)Dll::Tls();
+	if ( !pDisabled )
+	    {
+        XmlEngineAttachL();
+	    }
+    RXmlEngDOMImplementation domImpl;
+    domImpl.OpenL();
+    RXmlEngDocument doc;
+    doc.OpenL(domImpl);
+    RSenDocument document;
+    document.ipData = new (ELeave) TSenDocumentData;
+    document.iInternal =
+        (reinterpret_cast<RSenDocument*>(const_cast<RXmlEngDocument*>(&doc)))->iInternal;
+    document.ipData->iInternal = document.iInternal;
+    document.ipData->ipOpenDocuments = new (ELeave) TInt(1);
+    document.ipData->iDomImpl = domImpl;
+    TCleanupItem cleanup(CleanupRSenDocument, document.ipData);
+    CleanupStack::PushL(cleanup);
+    return document;
+    }
+
+EXPORT_C RSenDocument RSenDocument::NewL(void* aInternal)
+    {
+    RSenDocument self = RSenDocument::NewLC(aInternal);
+    CleanupStack::Pop();
+    return self;
+    }
+
+EXPORT_C RSenDocument RSenDocument::NewLC(void* aInternal)
+    {
+	TBool* pDisabled = (TBool*)Dll::Tls();
+	if ( !pDisabled ) // NOTE: when enabled, pointer does NOT EXIST in TLS!
+	    {
+        XmlEngineAttachL();
+	    }
+    RXmlEngDOMImplementation domImpl;
+    domImpl.OpenL();
+    RXmlEngDocument doc;
+    doc.OpenL(domImpl, aInternal);
+    RSenDocument document;
+    document.ipData = new (ELeave) TSenDocumentData;
+    document.iInternal =
+        (reinterpret_cast<RSenDocument*>(const_cast<RXmlEngDocument*>(&doc)))->iInternal;
+    document.ipData->iInternal = document.iInternal;
+    document.ipData->ipOpenDocuments = new (ELeave) TInt(1);
+    document.ipData->iDomImpl = domImpl;
+    TCleanupItem cleanup(CleanupRSenDocument, document.ipData);
+    CleanupStack::PushL(cleanup);
+    return document;
+    }
+
+EXPORT_C RSenDocument RSenDocument::Copy()
+    {
+    *ipData->ipOpenDocuments = *ipData->ipOpenDocuments + 1;
+    return *this;
+    }
+
+EXPORT_C void RSenDocument::Close()
+    {
+    *ipData->ipOpenDocuments = *ipData->ipOpenDocuments - 1;
+    if ( !*ipData->ipOpenDocuments )
+        {
+        RXmlEngDOMImplementation domImpl = ipData->iDomImpl;
+        iInternal = ipData->iInternal;
+        delete ipData->ipOpenDocuments;
+        delete ipData;
+        RXmlEngDocument::Close();
+        domImpl.Close();
+    	TBool* pDisabled = (TBool*)Dll::Tls();
+    	if ( !pDisabled )
+    	    {
+            XmlEngineCleanup();
+    	    }
+        }
+    else
+        {
+        iInternal = NULL;
+        }
+       
+    }
+
+EXPORT_C void RSenDocument::Destroy()
+    {
+    RSenDocument::Close();
+    /*        
+    *ipData->ipOpenDocuments = *ipData->ipOpenDocuments - 1;
+    if ( !*ipData->ipOpenDocuments )
+        {
+        RXmlEngDOMImplementation domImpl = ipData->ipDomImpl;            
+        delete ipData->ipOpenDocuments;
+        delete ipData;
+        ipData = NULL;
+        RXmlEngDocument::Destroy();
+        domImpl.Close();        
+    	TBool* pDisabled = (TBool*)Dll::Tls();
+    	if ( !pDisabled )
+    	    {
+            XmlEngineCleanup();
+    	    }
+        }
+    else
+        {
+        iInternal = NULL;
+        }
+    */        
+    }
+    
+EXPORT_C TInt RSenDocument::ManualXmlEngineTlsAttachL()
+    {
+	TBool* pDisabled = (TBool*)Dll::Tls();
+		
+	if ( !pDisabled )
+  		{
+  		pDisabled = new (ELeave) TBool();
+        if ( pDisabled )
+            {
+      		Dll::SetTls(pDisabled);
+            }
+        else
+            {
+            return KErrUnknown;
+            }
+  	    }
+  	else
+  	    {
+  	    return KErrAlreadyExists;
+  	    }
+  	
+    XmlEngineAttachL();
+    
+  	return KErrNone;
+    }
+
+EXPORT_C TInt RSenDocument::ManualXmlEngineTlsCleanup()
+    {
+	TBool* pDisabled = (TBool*)Dll::Tls();
+	if ( pDisabled )
+  		{
+        delete pDisabled;
+        Dll::FreeTls();	            
+  	    }
+  	else
+  	    {
+  	    return KErrNotFound;
+  	    }
+
+    XmlEngineCleanup();
+  	
+  	return KErrNone;
+    }
+    
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/src/sendomfragmentbase.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,560 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements XML DOM fragment using libxml2 classes
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenDomFragmentBase.h"
+#include <xmlengserializationoptions.h> // needed for TSerializationOptions
+
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL()
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    CleanupStack::Pop(); // Pop pNew
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(const TXmlEngElement& aElement)
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aElement);
+    CleanupStack::Pop(); // Pop pNew
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(const TDesC8& aLocalName)
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName);
+    CleanupStack::Pop(); // Pop pNew
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName
+    )
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName);
+    CleanupStack::Pop(); // Pop pNew
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttrs
+    )
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs);
+    CleanupStack::Pop(); // Pop pNew
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttrs,
+    TXmlEngElement& aParent
+    )
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs, aParent);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttrs,
+    TXmlEngElement& aParent,
+    RSenDocument& aOwnerDocument
+    )
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs, aParent,
+                         aOwnerDocument);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase* CSenDomFragmentBase::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix
+    )
+    {
+    CSenDomFragmentBase* pNew = new (ELeave) CSenDomFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragmentBase::~CSenDomFragmentBase()
+    {
+    if ( ipDomDelegate )
+        {
+        // We do not own the element, so remove it from the fragment.
+        //ipDomDelegate->ExtractElement();
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+    }
+
+EXPORT_C CSenDomFragmentBase::CSenDomFragmentBase()
+:   ipDomDelegate(NULL)
+    {
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL()
+    {
+    iDocument = RSenDocument::NewL();
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(const TXmlEngElement& aElement)
+    {
+    CSenFragmentBase::BaseConstructL(aElement);
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(const TDesC8& aLocalName)
+    {
+    CSenFragmentBase::BaseConstructL(aLocalName);
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName
+    )
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName);
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttrs
+    )
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs);
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttrs,
+    TXmlEngElement& aParent
+    )
+    {
+    CSenFragmentBase::BaseConstructL(   aNsUri,
+                                        aLocalName,
+                                        aPrefix,
+                                        aAttrs,
+                                        aParent);
+    }
+    
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttrs,
+    TXmlEngElement& aParent,
+    RSenDocument& aOwnerDocument
+    )
+    {
+    CSenFragmentBase::BaseConstructL(   aNsUri,
+                                        aLocalName,
+                                        aPrefix,
+                                        aAttrs,
+                                        aParent,
+                                        aOwnerDocument);
+    }
+
+EXPORT_C void CSenDomFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix
+    )
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aPrefix);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnStartElementL(const RTagInfo& aElement, 
+                                                 const RAttributeArray& aAttributes, 
+                                                 TInt aErrorCode)
+    {
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+    
+    
+    if ( iElement.IsNull() )
+        {
+        if ( saxNsUri == KNullDesC8 && saxPrefix == KNullDesC8 )
+            {
+            iDocument.CreateDocumentElementL(saxLocalName);
+            }
+        else
+            {
+            if ( saxPrefix == KNullDesC8 )
+                {
+                iDocument.CreateDocumentElementL(saxLocalName,
+                                                 saxNsUri,
+                                                 KNullDesC8);
+                }
+            else
+                {
+                iDocument.CreateDocumentElementL(saxLocalName,
+                                                 saxNsUri,
+                                                 saxPrefix);
+                }
+            }
+        iElement = iDocument.DocumentElement();        
+        }    
+    
+    TXmlEngElement element = AsElementL();
+    
+    TPtrC8 localName =  element.Name();
+    TPtrC8 nsUri(KNullDesC8);
+    if ( element.NamespaceUri() != KNullDesC8 )
+        {
+        nsUri.Set(element.NamespaceUri());
+        }
+    
+    if(iState == KSenStateIgnore)
+        {
+        if(localName == saxLocalName && nsUri == saxNsUri) 
+            {
+            iState = KSenStateSave;
+            AddNamespacesL();
+            AddAttributesL(aAttributes);
+            }
+        else
+            {
+            if ( ipNamespaceArray )
+                {
+                ipNamespaceArray->ResetAndDestroy();
+                }
+            }
+        }
+    else if((iState & KSenStateSave) == KSenStateSave)
+        {
+        ExpandL(aElement, aAttributes, aErrorCode);
+        }
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnContentL(const TDesC8& aBytes,
+                                              TInt /*aErrorCode*/)
+    {
+    if((iState & KSenStateSave) == KSenStateSave)
+        {
+        TXmlEngElement element = AsElementL();
+        element.AddTextL(aBytes);
+        }
+    }
+
+EXPORT_C void CSenDomFragmentBase::ExpandL(const RTagInfo& aElement,
+                                           const RAttributeArray& aAttributes,
+                                           TInt /*aErrorCode*/)
+    {
+    if ( ipDomDelegate )
+        {
+        // We do not own the element, so remove it from the fragment.
+        //ipDomDelegate->ExtractElement();
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+    TXmlEngElement element = AsElementL();
+    RSenDocument document = AsDocumentL();
+    
+    // delegate parsing to a new DOMFragment,
+    // until we encounter the end of an element with the given qualified name
+    ipDomDelegate = CSenDomFragmentBase::NewL( saxNsUri,
+                                               saxLocalName,
+                                               saxPrefix,
+                                               aAttributes,
+                                               element,
+                                               document );
+                                               
+    ipDomDelegate->iState = KSenStateDelegate;
+                                                
+    OnDelegateParsingL(*ipDomDelegate); // note that the parsing is actually
+                                      // performed AFTER the StartElement()
+                                      // method, which called this ExpandL()
+                                      // has been fully executed (this is an
+                                      // async signal send to the _same_
+                                      // parser(!)    
+    }
+
+
+EXPORT_C void CSenDomFragmentBase::OnWriteStartElementL(
+                                        const RTagInfo& /*aElement*/, 
+                                        const RAttributeArray& /*aAttributes*/)
+    {
+    // in DOM fragment: do nothing
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnWriteEndElementL(
+                                        const RTagInfo& /*aElement*/)
+    {
+    // in DOM fragment: do nothing
+    }
+
+
+// Overridden from CSenBaseFragment to be much more simple
+EXPORT_C void CSenDomFragmentBase::OnResumeParsingFromL(
+                                        const RTagInfo& /*aElement*/,
+                                        TInt /*aErrorCode*/)
+    {
+    SetContentHandler(*this);
+    
+    if ( ipDomDelegate )
+        {
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+    }
+    
+EXPORT_C HBufC8* CSenDomFragmentBase::AsXmlL()
+    {
+    return CSenFragmentBase::AsXmlL();
+    }
+    
+EXPORT_C void CSenDomFragmentBase::AddNamespacesL()
+    {
+    CSenFragmentBase::AddNamespacesL();
+    }
+
+EXPORT_C void CSenDomFragmentBase::AddAttributesL(const RAttributeArray& aAttrs)
+    {
+    CSenFragmentBase::AddAttributesL(aAttrs);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnEndElementL(const RTagInfo& aElement, TInt aErrorCode)
+    {
+    CSenFragmentBase::OnEndElementL(aElement, aErrorCode);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnStartDocumentL(const RDocumentParameters& /*aDocParam*/, TInt /*aErrorCode*/)
+    {
+    // in DOM fragment: do nothing
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnEndDocumentL(TInt /*aErrorCode*/)
+    {
+    // in DOM fragment: do nothing
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode)
+    {
+    CSenFragmentBase::OnStartPrefixMappingL(aPrefix, aUri, aErrorCode);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode)
+    {
+    CSenFragmentBase::OnEndPrefixMappingL(aPrefix, aErrorCode);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt ErrorCode)
+    {
+    CSenFragmentBase::OnIgnorableWhiteSpaceL(aBytes, ErrorCode);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnSkippedEntityL(const RString& aName, TInt aErrorCode)
+    {
+    CSenFragmentBase::OnSkippedEntityL(aName, aErrorCode);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode)
+    {
+    CSenFragmentBase::OnProcessingInstructionL(aTarget, aData, aErrorCode);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnError(TInt aErrorCode)
+    {
+    CSenFragmentBase::OnError(aErrorCode);
+    }
+
+EXPORT_C TAny* CSenDomFragmentBase::GetExtendedInterface(const TInt32 aUid)
+    {
+    return CSenFragmentBase::GetExtendedInterface(aUid);
+    }
+
+EXPORT_C TPtrC8 CSenDomFragmentBase::ContentL()
+    {
+    return CSenFragmentBase::ContentL();
+    }
+        
+EXPORT_C TXmlEngNamespace CSenDomFragmentBase::Namespace(const TDesC8& aPrefix)
+    {
+    return CSenFragmentBase::Namespace(aPrefix);
+    }
+        
+//EXPORT_C void CSenDomFragmentBase::DetachL()
+//    {
+//    CSenFragmentBase::DetachL();
+//    }
+        
+EXPORT_C void CSenDomFragmentBase::ResetContentL()
+    {
+    CSenFragmentBase::ResetContentL();
+    }
+
+EXPORT_C TPtrC8 CSenDomFragmentBase::LocalName() const
+    {
+    return CSenFragmentBase::LocalName();
+    }
+        
+EXPORT_C TPtrC8 CSenDomFragmentBase::NsUri() const
+    {
+    return CSenFragmentBase::NsUri();
+    }
+
+EXPORT_C TPtrC8 CSenDomFragmentBase::NsPrefix() const
+    {
+    return CSenFragmentBase::NsPrefix();
+    }
+
+EXPORT_C TXmlEngElement CSenDomFragmentBase::AsElementL()
+    {
+    return CSenFragmentBase::AsElementL();
+    }
+
+EXPORT_C RSenDocument& CSenDomFragmentBase::AsDocumentL()
+    {
+    return CSenFragmentBase::AsDocumentL();
+    }
+
+EXPORT_C TXmlEngElement CSenDomFragmentBase::ExtractElement()
+    {
+    return CSenFragmentBase::ExtractElement();
+    }
+        
+EXPORT_C void CSenDomFragmentBase::OnDelegateParsingL(CSenFragmentBase& aDelegate)
+    {
+    CSenFragmentBase::OnDelegateParsingL(aDelegate);
+    }
+
+EXPORT_C void CSenDomFragmentBase::OnDelegateParsingL(const RTagInfo& aElement, 
+                                                 const RAttributeArray& aAttributes, 
+                                                 TInt aErrorCode)
+    {
+    CSenFragmentBase::OnDelegateParsingL(aElement, aAttributes, aErrorCode);
+    }
+        
+EXPORT_C void CSenDomFragmentBase::SetOwner(CSenFragmentBase& aFragment)
+    {
+    CSenFragmentBase::SetOwner(aFragment);
+    }
+
+EXPORT_C HBufC* CSenDomFragmentBase::AsXmlUnicodeL()
+    {
+    return CSenFragmentBase::AsXmlUnicodeL();
+    }
+
+EXPORT_C void CSenDomFragmentBase::WriteAsXMLToL(RWriteStream& aWs)
+    {
+    CSenFragmentBase::WriteAsXMLToL(aWs);
+    }
+
+EXPORT_C TBool CSenDomFragmentBase::ConsistsOfL(CSenFragmentBase& aCandidate)
+    {
+    return CSenFragmentBase::ConsistsOfL(aCandidate);
+    }
+        
+EXPORT_C void CSenDomFragmentBase::SetContentHandler(CSenFragmentBase& aContentHandler)
+    {
+    CSenFragmentBase::SetContentHandler(aContentHandler);
+    }
+        
+void CSenDomFragmentBase::RenameL(const TDesC8& aLocalName, const TDesC8& aPrefix, const TDesC8& aNamespace)
+    {
+    CSenFragmentBase::RenameL(aLocalName, aPrefix, aNamespace);
+    }
+
+void CSenDomFragmentBase::RenameL(const TDesC8& aLocalName, const TDesC8& aNamespace)
+    {
+    CSenFragmentBase::RenameL(aLocalName, aNamespace);
+    }
+
+void CSenDomFragmentBase::RenameLocalNameL(const TDesC8& aLocalName)
+    {
+    CSenFragmentBase::RenameLocalNameL(aLocalName);
+    }
+
+void CSenDomFragmentBase::RenameNamespaceL(const TDesC8& aNamespace)
+    {
+    CSenFragmentBase::RenameNamespaceL(aNamespace);
+    }
+
+void CSenDomFragmentBase::RenamePrefixL(const TDesC8& aPrefix)
+    {
+    CSenFragmentBase::RenamePrefixL(aPrefix);
+    }
+
+void CSenDomFragmentBase::RenameNamespaceL(const TDesC8& aPrefix, const TDesC8& aNamespace)
+    {
+    CSenFragmentBase::RenameNamespaceL(aPrefix, aNamespace);
+    }
+         
+EXPORT_C TXmlEngElement CSenDomFragmentBase::SetContentOfL(const TDesC8& aLocalName,
+                                        const TDesC8& aContent)
+    {
+    return CSenFragmentBase::SetContentOfL(aLocalName, aContent);
+    }
+
+EXPORT_C TPtrC8 CSenDomFragmentBase::ContentOf(const TDesC8& aLocalName)
+    {
+    return CSenFragmentBase::ContentOf(aLocalName);
+    }
+
+EXPORT_C TBool CSenDomFragmentBase::ConsistsOfL(TXmlEngElement& aElement,
+                                                TXmlEngElement& aCandidate)
+    {
+    return CSenFragmentBase::ConsistsOfL(aElement, aCandidate);
+    }
+    
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/src/senfragmentbase.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1632 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements XML base fragment using libxml2 classes
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <flogger.h>
+#include <utf.h>
+#include <s32mem.h>
+#include "SenFragmentBase.h"
+#include "SenParser.h"
+#include "wslibxml2utils.h"
+
+#include <SenXmlConstants.h>
+
+#include <xml/attribute.h>               // needed for RAttributeArray
+#include <xml/parserfeature.h>           // for TParserFeature enumeration
+#include <xmlengserializationoptions.h> // for TSerializationOptions
+#include <xmlengbinarycontainer.h>
+#include <xmlengnodelist.h>
+
+
+typedef unsigned char xmlChar; // from "libxml/Libxml2_xmlstring.h"
+
+using namespace Xml;
+
+// ***************************************************************************
+// Fragment class state constants are as following (declared in subclasses):
+// KSenStateNotSet                  = -1;
+// KSenStateIgnore                  =  0; // even ones ignore(0),
+// KSenStateSave                    =  1; // and odd ones save(1)
+// KSenStateResume                  =  2;
+// KStateParsingFramework           =  4;
+// KStateParsingSoapFault           =  5;  // odd, save
+// KStateParsingServiceDescription  =  6;
+// KStateParsingResourceOffering    =  11; // odd, save
+// KStateParsingCredentials         =  12;
+// KStateParsingService             =  13; // odd state, saves content
+// KStateParsingPwTransforms        =  14;
+// KStateParsingSoapHeader          =  20; // ignore state (even num)
+// KStateParsingSoapBody            =  40; // ignore state (even num)
+// KStateParsingSingleCredential    =  122;
+// KStateParsingProviderPolicy      =  1222;
+
+namespace
+    {
+    const TInt KFlatBufSize = 128;
+    _LIT(KSenFragmentPanic, "SenFragment");
+    
+    TBool EncodeXmlEscapesL( const TDesC8& aOriginal, HBufC8*& aEncoded )
+        {
+        TBool retVal = EFalse;
+        delete aEncoded;
+        aEncoded = NULL;
+    
+        if (aOriginal == KNullDesC8)
+            {
+            return retVal;
+            }
+        TPtrC8 tokens[] =
+            {
+            KSenEscapedAmp(),
+            KSenEscapedApos(),
+            KSenEscapedDblQuot(),
+            KSenEscapedGt(),
+            KSenEscapedLt()  
+            };
+        TText16 tokenChars[] =
+            {
+            '&',
+            '\'',
+            '\"',
+            '>',
+            '<'
+            };
+        
+        // Replace escaped characters, if any
+        for (TInt i = 0; i < aOriginal.Length(); i++)
+            {
+            TBool foundChar = EFalse;
+            //for (TInt j = 0; j < (sizeof(tokenChars) / sizeof(TText16)); j++)
+            for (TInt j = 0; j < 5; j++)
+                {
+                if (aOriginal[i] == tokenChars[j])
+                    {
+                    if ( !aEncoded )
+                        {
+                        aEncoded =
+                            HBufC8::NewL(aOriginal.Length() * KSenMaxXmlEscapedLength);
+                        aEncoded->Des().Append(aOriginal.Left(i));
+                        }
+                    foundChar = ETrue;
+                    aEncoded->Des().Append(tokens[j]);
+                    retVal = ETrue; // indicate, that encoding was done
+                    break;
+                    }
+                }
+            if (!foundChar)
+                {
+                if (aEncoded)
+                    {
+                    
+                    aEncoded->Des().Append(aOriginal[i]);
+                    }
+                }
+            }
+        return retVal;
+        }
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TXmlEngElement& aElement)
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aElement);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TDesC8& aLocalName)
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName
+    )
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aPrefix,
+                                                  const RAttributeArray& aAttrs
+    )
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aPrefix,
+                                                  const RAttributeArray& aAttrs,
+                                                  TXmlEngElement& aParent
+    )
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs, aParent);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aPrefix,
+                                                  const RAttributeArray& aAttrs,
+                                                  TXmlEngElement& aParent,
+                                                  RSenDocument& aOwnerDocument
+    )
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix, aAttrs, aParent,
+                         aOwnerDocument);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aPrefix
+    )
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aPrefix);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+    
+EXPORT_C CSenFragmentBase* CSenFragmentBase::NewL(TXmlEngElement& aRootElement,
+                                                  RSenDocument& aOwnerDocument)
+    {
+    CSenFragmentBase* pNew = new (ELeave) CSenFragmentBase;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aRootElement, aOwnerDocument);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenFragmentBase::~CSenFragmentBase()
+    {
+    if ( ipNamespaceArray )
+        {
+        ipNamespaceArray->ResetAndDestroy();
+        delete ipNamespaceArray;
+        }
+    iDocument.Close();
+    if ( ipContentBuf )
+    	{
+                
+        delete ipContentBuf;
+        ipContentBuf = NULL;
+        
+        delete ipContentWriteStream;
+        ipContentWriteStream = NULL;
+        }
+        
+     if ( ipDelegate )
+        {
+        delete ipDelegate;
+        ipDelegate = NULL;
+        }   
+    }
+
+EXPORT_C CSenFragmentBase::CSenFragmentBase()
+:   iState(KSenStateIgnore),
+    ipParser(NULL),
+    ipOwner(NULL),
+    ipDelegate(NULL)
+    {
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(const TXmlEngElement& aSrc)
+    {
+    iElement = aSrc.CopyL();
+    iDocument = RSenDocument::NewL();
+    iDocument.SetDocumentElement(iElement);
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(const TDesC8& aLocalName)
+    {
+    iDocument = RSenDocument::NewL();
+    if ( aLocalName != KNullDesC8 )
+        {
+        iDocument.CreateDocumentElementL(aLocalName);
+        iElement = iDocument.DocumentElement();
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName
+    )
+    {
+    iDocument = RSenDocument::NewL();
+    iDocument.CreateDocumentElementL(aLocalName, aNsUri);
+    iElement = iDocument.DocumentElement();
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aPrefix,
+                                               const RAttributeArray& aAttrs
+    )
+    {
+    iDocument = RSenDocument::NewL();
+    if (aPrefix == KNullDesC8)
+        {
+        iDocument.CreateDocumentElementL(aLocalName, aNsUri);
+        }
+    else
+        {
+        iDocument.CreateDocumentElementL(aLocalName, aNsUri, aPrefix);
+        }
+
+    iElement = iDocument.DocumentElement();
+    AddAttributesL(aAttrs);
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent
+    )
+    {
+    iDocument = RSenDocument::NewL();
+    iElement = aParent.AddNewElementL(aLocalName);
+
+    if (aNsUri != KNullDesC8 || aPrefix != KNullDesC8)
+        {
+        if (aPrefix == KNullDesC8)
+            {
+            // Check if namespace declaration for the root tag
+            // is already defined in parent element.
+            TXmlEngNamespace ns = aParent.LookupNamespaceByUriL(aNsUri);
+            if ( ns.IsNull() )
+                {
+                // Namespace declaration will be added to iElement
+                iElement.AddNamespaceDeclarationL(aNsUri, KNullDesC8);
+                }
+
+            WsXmlUtils domUtils;       
+            domUtils.XmlEngRenameElementL(iElement, aLocalName, aNsUri, KNullDesC8);
+            }
+        else
+            {
+            // Check if namespace declaration for the root tag
+            // is already defined in parent element.
+            TXmlEngNamespace ns = aParent.LookupNamespaceByUriL(aNsUri);
+            if ( ns.IsNull() )
+                {
+                // Namespace declaration will be added to iElement
+                iElement.AddNamespaceDeclarationL(aNsUri, aPrefix);
+                }
+
+            WsXmlUtils domUtils;
+            domUtils.XmlEngRenameElementL(iElement, aLocalName, aNsUri, aPrefix);
+            }
+        }
+    
+    aParent.AppendChildL(iElement);
+
+    AddAttributesL(aAttributes);
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aPrefix,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent,
+    RSenDocument& aOwnerDocument
+    )
+    {
+    iDocument = aOwnerDocument.Copy();
+    iElement = aParent.AddNewElementL(aLocalName);
+    
+    if ( aNsUri != KNullDesC8 || aPrefix != KNullDesC8 )
+        {
+        if ( aPrefix == KNullDesC8 )
+            {
+            // Check if namespace declaration for the root tag
+            // is already defined in parent element.
+            TXmlEngNamespace ns = aParent.LookupNamespaceByUriL(aNsUri);
+            if ( ns.IsNull() )
+                {
+                // Namespace declaration will be added to iElement
+                iElement.AddNamespaceDeclarationL(aNsUri, KNullDesC8);
+                }
+
+            WsXmlUtils domUtils;
+            domUtils.XmlEngRenameElementL(iElement, aLocalName, aNsUri, KNullDesC8);
+            }
+        else
+            {
+            // Check if namespace declaration for the root tag
+            // is already defined in parent element.
+            TXmlEngNamespace ns = aParent.LookupNamespaceByUriL(aNsUri);
+            if ( ns.IsNull() )
+                {
+                // Namespace declaration will be added to iElement
+                iElement.AddNamespaceDeclarationL(aNsUri, aPrefix);
+                }
+            WsXmlUtils domUtils;
+            domUtils.XmlEngRenameElementL(iElement, aLocalName, aNsUri, aPrefix);
+            }
+        }
+    
+    aParent.AppendChildL(iElement);
+
+    AddAttributesL(aAttributes);
+    }
+
+EXPORT_C void CSenFragmentBase::BaseConstructL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aPrefix
+    )
+    {
+    iDocument = RSenDocument::NewL();
+    if ( aNsUri == KNullDesC8 && aPrefix == KNullDesC8 )
+        {
+        iDocument.CreateDocumentElementL(aLocalName);
+        }
+    else
+        {
+        if ( aPrefix == KNullDesC8 )
+            {
+            iDocument.CreateDocumentElementL(aLocalName, aNsUri, KNullDesC8);
+            }
+        else
+            {
+            iDocument.CreateDocumentElementL(aLocalName, aNsUri, aPrefix);
+            }
+        }
+    iElement = iDocument.DocumentElement();
+    }
+    
+EXPORT_C void CSenFragmentBase::BaseConstructL(TXmlEngElement& aRootElement,
+                                               RSenDocument& aOwnerDocument)
+    {
+    iDocument = aOwnerDocument.Copy();
+    iElement = aRootElement;
+    }
+
+EXPORT_C void CSenFragmentBase::AddNamespacesL()
+    {
+    if (ipParser)
+        {
+        if ( ipParser->IsFeatureEnabled(EReportNamespaceMapping) )
+            {
+            // Add namespaces, if any
+            if ( ipNamespaceArray )
+                {
+                TInt count = ipNamespaceArray->Count();
+                for (TInt i=0; i < count; i++)
+                    {
+                    CSenNamespaceData* pNamespace = (*ipNamespaceArray)[i];
+                    TXmlEngNamespace ns =
+                                AsElementL().LookupNamespaceByUriL(*pNamespace->ipNamespaceUri);
+                    if ( ns.IsNull() )
+                        {
+                        if (pNamespace->ipPrefix == NULL)
+                            {
+                            AsElementL().AddNamespaceDeclarationL(*pNamespace->ipNamespaceUri,
+                                                                  KNullDesC8);
+                            }
+                        else
+                            {
+                            AsElementL().AddNamespaceDeclarationL(*pNamespace->ipNamespaceUri,
+                                                                  *pNamespace->ipPrefix);
+                            }
+                        }
+                    }
+                ipNamespaceArray->ResetAndDestroy();
+                }
+            }
+        }
+    }
+    
+EXPORT_C void CSenFragmentBase::AddAttributesToElementL(TXmlEngElement aElement,
+                                               const RAttributeArray& apAttrs)
+    {
+    TInt count(apAttrs.Count());
+
+    for(TInt i=0; i<count; i++)
+        {
+        TPtrC8 localName = apAttrs[i].Attribute().LocalName().DesC();
+        TPtrC8 value = apAttrs[i].Value().DesC();
+
+        if (apAttrs[i].Attribute().Uri().DesC() == KNullDesC8)
+            {
+            aElement.AddNewAttributeL(localName, value);
+            }
+        else
+            {
+            TPtrC8 namespaceUri = apAttrs[i].Attribute().Uri().DesC();
+            TPtrC8 prefix(KNullDesC8);
+            if ( apAttrs[i].Attribute().Prefix().DesC() != KNullDesC8 )
+                {
+                prefix.Set(apAttrs[i].Attribute().Prefix().DesC());
+                }
+                
+            TXmlEngNamespace ns = aElement.LookupNamespaceByUriL(namespaceUri);
+            if ( ns.NotNull() )
+                {
+                if (ns.Prefix() == KNullDesC8 && prefix == KNullDesC8)
+                    {
+                    aElement.AddNewAttributeWithNsL(localName, value, namespaceUri);
+                    }
+                else if ( ns.Prefix() == prefix )
+                    {
+                    aElement.AddNewAttributeL(localName, value, ns);
+                    }
+                else
+                    {
+                    aElement.AddNewAttributeL(localName, value, namespaceUri, prefix);
+                    }
+                }
+            else
+                {
+                if ( prefix == KNullDesC8 )
+                    {
+                    aElement.AddNamespaceDeclarationL(namespaceUri, KNullDesC8);
+                    aElement.AddNewAttributeWithNsL(localName, value, namespaceUri);
+                    }
+                else
+                    {
+                    aElement.AddNewAttributeL(localName, value, namespaceUri, prefix);
+                    }
+                }
+            }
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::AddAttributesL(const RAttributeArray& apAttrs)
+    {
+    AddAttributesToElementL(AsElementL(), apAttrs);
+    }
+
+EXPORT_C RSenDocument& CSenFragmentBase::AsDocumentL()
+    {
+    return iDocument;
+    }
+
+EXPORT_C TXmlEngElement CSenFragmentBase::AsElementL()
+    {
+    __ASSERT_ALWAYS(iElement.NotNull(), User::Panic(KSenFragmentPanic, EFragmentElementNotInitialized));
+    
+    return iElement;
+    }
+    
+void CSenFragmentBase::RenameL(const TDesC8& aLocalName, const TDesC8& aPrefix, const TDesC8& aNamespace)
+    {
+    WsXmlUtils domUtils;       
+    domUtils.XmlEngRenameElementL(AsElementL(), aLocalName, aNamespace, aPrefix); // Note that in TElement the *prefix* is the last arg(!)
+    }
+
+void CSenFragmentBase::RenameL(const TDesC8& aLocalName, const TDesC8& aNamespace)
+    {
+    WsXmlUtils domUtils;       
+    domUtils.XmlEngRenameElementL(AsElementL(), aLocalName, aNamespace, KNullDesC8); // Note that in TElement the *prefix* is the last arg(!)
+    }
+    
+void CSenFragmentBase::RenameLocalNameL(const TDesC8& aLocalName)
+    {
+    WsXmlUtils domUtils;       
+    domUtils.XmlEngRenameElementL(AsElementL(), aLocalName, KNullDesC8, KNullDesC8); // Note that in TElement the *prefix* is the last arg(!)
+    }
+
+void CSenFragmentBase::RenameNamespaceL(const TDesC8& aNamespace)
+    {
+    WsXmlUtils domUtils;       
+    domUtils.XmlEngRenameElementL(AsElementL(), KNullDesC8, aNamespace, KNullDesC8); // Note that in TElement the *prefix* is the last arg(!)
+    }
+    
+void CSenFragmentBase::RenameNamespaceL(const TDesC8& aPrefix, const TDesC8& aNamespace)
+    {
+    WsXmlUtils domUtils;       
+    domUtils.XmlEngRenameElementL(AsElementL(), KNullDesC8, aNamespace, aPrefix); // Note that in TElement the *prefix* is the last arg(!)
+    }
+    
+void CSenFragmentBase::RenamePrefixL(const TDesC8& aPrefix)
+    {
+    WsXmlUtils domUtils;       
+    domUtils.XmlEngRenameElementL(AsElementL(), KNullDesC8, KNullDesC8, aPrefix); // Note that in TElement the *prefix* is the last arg(!)
+    }
+    
+EXPORT_C TXmlEngElement CSenFragmentBase::ExtractElement()
+    {
+    TXmlEngElement element = iDocument.DocumentElement();
+
+    if ( element.IsSameNode(iElement) )
+        {
+        // Unlink only when element is root element of this document.
+        //
+        // This fragment maybe delegate and element is still part
+        // of other Fragment's DOM Tree.
+        iElement.Unlink();
+        }
+
+    TXmlEngElement retElement = iElement;        
+    TXmlEngElement nullElement;
+    iElement = nullElement;
+    
+    return retElement;
+    }
+
+EXPORT_C void CSenFragmentBase::SetParser(CSenParser& aParser)
+    {
+    ipParser = &aParser;
+    }
+
+EXPORT_C void CSenFragmentBase::OnDelegateParsingL(CSenFragmentBase& aDelegate)
+    {
+    // Delegate parsing to a new Fragment, until we encounter 
+    // the end of an element with the given qualified name
+    aDelegate.SetOwner(*this);
+    aDelegate.ipParser = ipParser;
+    aDelegate.StartSavingContent();
+    SetContentHandler(aDelegate);
+    }
+
+EXPORT_C void CSenFragmentBase::OnDelegateParsingL(const RTagInfo& aElement, 
+                                                   const RAttributeArray& aAttributes, 
+                                                   TInt /*aErrorCode*/)
+    {
+    // Delegate parsing to a new Fragment, until we encounter the end of an
+    // element with the given qualified name
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+    TXmlEngElement element = AsElementL();
+    RSenDocument document = AsDocumentL();
+
+
+    __ASSERT_ALWAYS(
+        ipDelegate == NULL,
+        User::Panic(KSenFragmentPanic, EDelegatedFragmentAlreadySet)
+        );
+    ipDelegate = CSenFragmentBase::NewL(saxNsUri, 
+                                        saxLocalName, 
+                                        saxPrefix, 
+                                        aAttributes, 
+                                        element, 
+                                        document);
+
+    OnDelegateParsingL(*ipDelegate);
+    }
+
+EXPORT_C void CSenFragmentBase::StartSavingContent()
+    {
+    iState = KSenStateSave;
+    }
+
+EXPORT_C void CSenFragmentBase::SetOwner(CSenFragmentBase& aFragment)
+    {
+    ipOwner = &aFragment;
+    }
+
+EXPORT_C void CSenFragmentBase::OnResumeParsingFromL(const RTagInfo& aElement, TInt aErrorCode)
+    {
+    SetContentHandler(*this);
+    
+    // Destroy delegate
+    if ( ipDelegate )
+        {
+        HBufC8* pAsXml = ipDelegate->AsXmlL();
+        CleanupStack::PushL(pAsXml);
+                
+        delete ipDelegate; // free memory
+        ipDelegate = NULL;
+        
+        if ( !ipContentBuf )
+            {
+            ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+            ipContentWriteStream = new (ELeave) RBufWriteStream;
+            ipContentWriteStream->Open(*ipContentBuf);
+            }
+        ipContentWriteStream->WriteL(*pAsXml);
+        
+        CleanupStack::PopAndDestroy(pAsXml);
+        }
+    
+    TInt currentState = KSenStateNotSet; // == -1
+    if ( iElement.NotNull() )
+        {
+        const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+        const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+        TPtrC8 localName            = iElement.Name();
+        TPtrC8 nsUri                = iElement.NamespaceUri();
+    
+        if(localName == saxLocalName  && nsUri == saxNsUri)
+            {
+            currentState = iState;
+            // Before calling EndElementL, which may execute
+            // unpredictable amount of code in subclasses, the
+            // the state must be set to "ignore"
+            iState = KSenStateResume;
+            }
+        }
+    
+    OnEndElementL(aElement, aErrorCode);
+    // now check if current state was to be preserved
+    if(currentState!=KSenStateNotSet) // IOP
+        {
+        // restore the state preserved prior to
+        // "set ignore for endelement" -case
+        iState = currentState;
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::OnStartElementL(const RTagInfo& aElement, 
+                                                const RAttributeArray& aAttributes, 
+                                                TInt aErrorCode) 
+    {
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+    
+    if ( iElement.IsNull() )
+        {
+        if ( saxNsUri == KNullDesC8 && saxPrefix == KNullDesC8 )
+            {
+            iDocument.CreateDocumentElementL(saxLocalName);
+            }
+        else
+            {
+            if ( saxPrefix == KNullDesC8 )
+                {
+                iDocument.CreateDocumentElementL(saxLocalName,
+                                                 saxNsUri,
+                                                 KNullDesC8);
+                }
+            else
+                {
+                iDocument.CreateDocumentElementL(saxLocalName,
+                                                 saxNsUri,
+                                                 saxPrefix);
+                }
+            }
+        iElement = iDocument.DocumentElement();        
+        }    
+    
+    TXmlEngElement element = AsElementL();
+    
+    TPtrC8 localName =  element.Name();
+    TPtrC8 nsUri(KNullDesC8);
+    if (element.NamespaceUri() != KNullDesC8)
+        {
+        nsUri.Set(element.NamespaceUri());
+        }
+    
+    if(iState == KSenStateIgnore)
+        {
+        if(localName == saxLocalName && nsUri == saxNsUri) 
+            {
+            iState = KSenStateSave;
+            AddNamespacesL();
+            AddAttributesL(aAttributes);
+            }
+        }
+    else if((iState & KSenStateSave) == KSenStateSave)
+        {
+        if(localName == saxLocalName && nsUri == saxNsUri)
+            {
+            // start a new BaseFragment otherwise we loose
+            // track of nested elements with the same name
+            OnDelegateParsingL(aElement, aAttributes, aErrorCode);
+            }
+        else
+            {
+            OnWriteStartElementL(aElement, aAttributes);
+            }
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::OnEndElementL(const RTagInfo& aElement, TInt aErrorCode)
+    {
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+    TXmlEngElement element = AsElementL();
+
+    TPtrC8 localName =  element.Name();
+    TPtrC8 nsUri(KNullDesC8);
+    if (element.NamespaceUri() != KNullDesC8)
+        {
+        nsUri.Set(element.NamespaceUri());
+        }
+
+    if(localName == saxLocalName && nsUri == saxNsUri)
+        {
+        if(iState != KSenStateResume && ipOwner)
+            {
+            if ( ipContentBuf )
+                {
+                SetContentL(ipContentBuf->Ptr(0));
+            
+                delete ipContentBuf;
+                ipContentBuf = NULL;
+                delete ipContentWriteStream;
+                ipContentWriteStream = NULL;
+                }
+
+            ipOwner->OnResumeParsingFromL(aElement, aErrorCode);
+            return; // This is mandatory, since ResumeParsingFromL 
+                    // de-allocates delegate fragment!
+            }
+        iState = KSenStateIgnore;
+        }
+    if((iState & KSenStateSave) == KSenStateSave)
+        {
+        OnWriteEndElementL(aElement);
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::OnContentL(const TDesC8& aBytes, TInt /*aErrorCode*/)
+    {
+    if((iState & KSenStateSave) == KSenStateSave)
+        {
+        if ( !ipContentBuf )
+            {
+            ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+            ipContentWriteStream = new (ELeave) RBufWriteStream;
+            ipContentWriteStream->Open( *ipContentBuf );
+            }   
+        HBufC8* reEncoded = NULL;
+        TBool contentIncludesEncodedChars = EncodeXmlEscapesL( aBytes, reEncoded);
+        if ( contentIncludesEncodedChars )
+            {
+            CleanupStack::PushL( reEncoded );
+            ipContentWriteStream->WriteL( *reEncoded );
+            CleanupStack::PopAndDestroy( reEncoded  );
+            }
+        else
+            {
+            ipContentWriteStream->WriteL( aBytes );
+            }
+        }
+    }
+    
+EXPORT_C void CSenFragmentBase::OnStartDocumentL( const RDocumentParameters& /*aDocParam*/,
+                                                  TInt /*aErrorCode*/ )
+    {
+    if ( !ipContentBuf )
+        {
+        ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+        ipContentWriteStream = new (ELeave) RBufWriteStream;
+        ipContentWriteStream->Open(*ipContentBuf);
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::OnEndDocumentL(TInt /*aErrorCode*/)
+    {
+    if ( ipNamespaceArray)
+        {
+        ipNamespaceArray->ResetAndDestroy();
+        delete ipNamespaceArray;
+        ipNamespaceArray = NULL;
+        }
+    
+    if ( ipContentBuf )
+        {
+        if ( ipContentBuf->Ptr(0).Length() > 0 )
+            {
+            SetContentL(ipContentBuf->Ptr(0));
+            }
+
+        delete ipContentBuf;
+        ipContentBuf = NULL;
+        delete ipContentWriteStream;
+        ipContentWriteStream = NULL;
+        }
+    }
+
+EXPORT_C void CSenFragmentBase::OnStartPrefixMappingL(
+                                    const RString& aPrefix,
+                                    const RString& aUri,
+                                    TInt /*aErrorCode*/)
+    {
+    if ( !ipNamespaceArray )
+        {
+        ipNamespaceArray = new (ELeave) RPointerArray<CSenNamespaceData>;
+        }
+
+    CSenNamespaceData* pNamespaceData = new (ELeave) CSenNamespaceData;
+    CleanupStack::PushL(pNamespaceData);
+    pNamespaceData->ipNamespaceUri  = aUri.DesC().AllocL();
+    if (aPrefix.DesC() != KNullDesC8)
+        {
+        pNamespaceData->ipPrefix    = aPrefix.DesC().AllocL();
+        }
+    User::LeaveIfError(ipNamespaceArray->Append(pNamespaceData));
+    CleanupStack::Pop(pNamespaceData);
+    }
+
+EXPORT_C void CSenFragmentBase::OnEndPrefixMappingL(
+                                    const RString& /*aPrefix*/,
+                                    TInt /*aErrorCode*/)
+    {
+    }
+
+EXPORT_C void CSenFragmentBase::OnIgnorableWhiteSpaceL(
+                                    const TDesC8& /*aBytes*/,
+                                    TInt /*aErrorCode*/)
+    {
+    }
+
+EXPORT_C void CSenFragmentBase::OnSkippedEntityL(
+                                    const RString& /*aName*/,
+                                    TInt /*aErrorCode*/)
+    {
+    }
+
+EXPORT_C void CSenFragmentBase::OnProcessingInstructionL(
+                                    const TDesC8& /*aTarget*/,
+                                    const TDesC8& /*aData*/,
+                                    TInt /*aErrorCode*/)
+    {
+    }
+
+EXPORT_C void CSenFragmentBase::OnError(TInt /*aErrorCode*/)
+    {
+    }
+
+EXPORT_C TAny* CSenFragmentBase::GetExtendedInterface(const TInt32 /*aUid*/)
+    {
+    return NULL;
+    }    
+
+
+EXPORT_C void CSenFragmentBase::ResetContentL()
+    {
+    TXmlEngElement element = AsElementL();
+    element.RemoveChildren();
+    }
+
+EXPORT_C TPtrC8 CSenFragmentBase::ContentL()
+    {
+    TXmlEngElement element = AsElementL();
+    return element.Text();
+    }
+
+
+EXPORT_C HBufC* CSenFragmentBase::AsXmlUnicodeL()
+    {
+    HBufC8* pAsXml = AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    HBufC16* pBuf = HBufC16::NewL(2 * pAsXml->Length());
+    CleanupStack::PushL(pBuf);
+    TPtr16 des = pBuf->Des();
+    TInt ret = CnvUtfConverter::ConvertToUnicodeFromUtf8(des, *pAsXml);
+    User::LeaveIfError(ret);
+    CleanupStack::Pop(pBuf);
+    CleanupStack::PopAndDestroy(pAsXml);
+    return pBuf;
+    }
+
+EXPORT_C HBufC8* CSenFragmentBase::AsXmlL()
+    {
+    TXmlEngElement element = AsElementL();
+    
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+    
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    iDocument.SaveL(asXml, element, options);
+    CleanupClosePushL(asXml);
+    HBufC8* pAsXml = asXml.AllocL();
+    CleanupStack::PopAndDestroy(&asXml);
+
+    return pAsXml;
+    }
+    
+
+EXPORT_C void CSenFragmentBase::WriteAsXMLToL(RWriteStream& aWs)
+    {
+    HBufC8* pAsXml = AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    aWs.WriteL(*pAsXml);
+    CleanupStack::PopAndDestroy(pAsXml);
+    }
+
+EXPORT_C TPtrC8 CSenFragmentBase::ContentOf(const TDesC8& aLocalName)
+    {
+    TInt err( KErrNone );
+    RXmlEngNodeList<TXmlEngElement> list;
+    TRAP(   
+        err, 
+        TXmlEngElement element = AsElementL(); 
+        element.GetElementsByTagNameL(list, aLocalName);
+        )
+    if ( !err && list.Count() > 0 )
+        {
+        TXmlEngElement firstElement = list.Next();
+        return firstElement.Text();
+        }
+    return KNullDesC8();
+    }
+
+EXPORT_C TXmlEngElement CSenFragmentBase::SetContentOfL(const TDesC8& aLocalName,
+                                                      const TDesC8& aContent)
+    {
+    TXmlEngElement element = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    
+    element.GetElementsByTagNameL(list, aLocalName);
+        
+    if ( list.Count() > 0 )
+        {
+        TXmlEngElement firstElement = list.Next();
+        firstElement.SetTextNoEncL(aContent);
+        return firstElement;
+        }
+    CleanupStack::PopAndDestroy(&list);
+
+    TXmlEngElement newElement = element.AddNewElementL(aLocalName);
+    newElement.SetTextNoEncL(aContent);
+    return newElement;
+    }
+
+EXPORT_C void CSenFragmentBase::OnWriteStartElementL(const RTagInfo& aElement,  
+                                                     const RAttributeArray& aAttributes)
+    {
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+    
+    if ( !ipContentBuf )
+        {
+        ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+        ipContentWriteStream = new (ELeave) RBufWriteStream;
+        ipContentWriteStream->Open(*ipContentBuf);
+        }
+    
+    ipContentWriteStream->WriteL(KSenLessThan);
+    if (saxPrefix != KNullDesC8)
+        {
+        ipContentWriteStream->WriteL(saxPrefix);
+        ipContentWriteStream->WriteL(KSenColon);
+        }
+    ipContentWriteStream->WriteL(saxLocalName);
+
+    TInt startPoint(0);
+    if ( !ipParser->IsFeatureEnabled(EReportNamespaceMapping) )
+        {
+        if ( !ipNamespaceArray)
+            {
+            ipNamespaceArray = new (ELeave) RPointerArray<CSenNamespaceData>;
+            }
+
+        // Collect namespace declaration from this element (if it's not
+        // previously defined)
+        TBool found(EFalse);
+        if ( saxNsUri != KNullDesC8 )
+            {
+            // Check if element of this document has already handled
+            // namespace definition.
+            TXmlEngNamespace ns = AsElementL().LookupNamespaceByUriL(saxNsUri);
+            if ( ns.NotNull() )
+                {
+                found = ETrue;
+                }
+            else
+                {
+                // Check if internal namespace array has already handled
+                // namespace defintion. <= Means that one of the parent
+                // elements (in flat content) has already namespace
+                // definition we are dealing with.
+                TInt jcount = ipNamespaceArray->Count();
+                for (TInt j=0; j < jcount; j++)
+                    {
+                    CSenNamespaceData* pNamespace = (*ipNamespaceArray)[j];
+                    if ( pNamespace->ipPrefix && *(pNamespace->ipPrefix) == saxPrefix )
+                        {
+                        if ( *pNamespace->ipNamespaceUri == saxNsUri )
+                            {
+                            found = ETrue;
+                            break;
+                            }
+                        }
+                    }
+                }
+            }
+
+        startPoint = ipNamespaceArray->Count();
+        if ( !found )
+            {
+            CSenNamespaceData* pNamespaceData = new (ELeave) CSenNamespaceData;
+            CleanupStack::PushL(pNamespaceData);
+            TInt retVal = ipNamespaceArray->Append(pNamespaceData);
+            User::LeaveIfError(retVal);
+            CleanupStack::Pop(pNamespaceData);
+            if (retVal == KErrNone )
+                {
+                pNamespaceData->ipNamespaceUri  = saxNsUri.AllocL();
+                pNamespaceData->ipPrefix        = saxPrefix.AllocL();
+                pNamespaceData->ipLocalName     = saxLocalName.AllocL();
+                }
+            }
+        
+        // Collect new (not previously defined) namespaces from attributes
+        TInt attCount(aAttributes.Count());
+        for ( TInt i = 0; i < attCount; i++)
+            {
+            found = EFalse;
+            TPtrC8 nsUri = aAttributes[i].Attribute().Uri().DesC();
+            if ( nsUri != KNullDesC8 )
+                {
+                TPtrC8 nsPrefix = aAttributes[i].Attribute().Prefix().DesC();
+                TBool found(EFalse);
+                // Check if element of this document has already handled
+                // namespace definition.
+                TXmlEngNamespace ns = AsElementL().LookupNamespaceByUriL(nsUri);
+                if ( ns.NotNull() )
+                    {
+                    found = ETrue;
+                    }
+                else
+                    {
+                    // Check if internal namespace array has already handled
+                    // namespace defintion. <= Means that one of the parent
+                    // elements (in flat content) has already namespace
+                    // definition we are dealing with.
+                    TInt jcount = ipNamespaceArray->Count();
+                    for (TInt j=0; j < jcount; j++)
+                        {
+                        CSenNamespaceData* pNamespace = (*ipNamespaceArray)[j];
+                        if ( pNamespace->ipPrefix && *(pNamespace->ipPrefix) == nsPrefix )
+                            {
+                            if ( *pNamespace->ipNamespaceUri == nsUri )
+                                {
+                                found = ETrue;
+                                break;
+                                }
+                            }
+                        }
+                    }
+                    
+                // If namespace was not found
+                // namespace will be added to internal array 
+                if ( !found )
+                    {
+                    CSenNamespaceData* pNamespaceData
+                                            = new (ELeave) CSenNamespaceData;
+                    CleanupStack::PushL(pNamespaceData);
+                    TInt retVal = ipNamespaceArray->Append(pNamespaceData);
+                    User::LeaveIfError(retVal);
+                    CleanupStack::Pop(pNamespaceData);
+                    if (retVal == KErrNone )
+                        {
+                        pNamespaceData->ipNamespaceUri  = nsUri.AllocL();
+                        pNamespaceData->ipPrefix        = nsPrefix.AllocL();
+                        if ( startPoint == ipNamespaceArray->Count() )
+                            {
+                            pNamespaceData->ipLocalName = saxLocalName.AllocL();
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        
+    // Write namespaces, if any
+    if ( ipNamespaceArray )
+        {
+        TInt count = ipNamespaceArray->Count();
+        for (TInt i=startPoint; i < count; i++)
+            {
+            CSenNamespaceData* pNamespace = (*ipNamespaceArray)[i];
+            ipContentWriteStream->WriteL(KSenSpace);
+            ipContentWriteStream->WriteL(KSenXmlns);
+            if ( pNamespace->ipPrefix && *(pNamespace->ipPrefix) != KNullDesC8 )
+                {
+                ipContentWriteStream->WriteL(KSenColon);
+                ipContentWriteStream->WriteL(*pNamespace->ipPrefix);
+                }
+            ipContentWriteStream->WriteL(KSenEqualsDblQuot);
+            ipContentWriteStream->WriteL(*pNamespace->ipNamespaceUri);
+            ipContentWriteStream->WriteL(KSenDblQuot);
+            }
+            
+        if ( ipParser->IsFeatureEnabled(EReportNamespaceMapping) )
+            {
+            ipNamespaceArray->ResetAndDestroy();
+            }
+        }
+
+    // Write attributes, if any
+    TInt attCount(aAttributes.Count());
+    for (TInt i = 0; i < attCount; i++)
+        {
+        TPtrC8 prefix   = aAttributes[i].Attribute().Prefix().DesC();
+        TPtrC8 lAttName = aAttributes[i].Attribute().LocalName().DesC();
+        TPtrC8 attValue = aAttributes[i].Value().DesC();
+
+        ipContentWriteStream->WriteL(KSenSpace);
+        if (prefix != KNullDesC8)
+            {
+            ipContentWriteStream->WriteL(prefix);
+            ipContentWriteStream->WriteL(KSenColon);
+            }
+        ipContentWriteStream->WriteL(lAttName);
+
+        ipContentWriteStream->WriteL(KSenEqualsDblQuot);
+        ipContentWriteStream->WriteL(attValue);
+        ipContentWriteStream->WriteL(KSenDblQuot);
+        }
+
+    ipContentWriteStream->WriteL(KSenGreaterThan);
+    }
+
+EXPORT_C void CSenFragmentBase::OnWriteEndElementL(const RTagInfo& aElement)
+    {
+    const TPtrC8 saxLocalName = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix = aElement.Prefix().DesC();
+
+    if ( !ipContentBuf )
+        {
+        ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+        ipContentWriteStream = new (ELeave) RBufWriteStream;
+        ipContentWriteStream->Open(*ipContentBuf);
+        }
+    
+    if ( ipNamespaceArray && !ipParser->IsFeatureEnabled(EReportNamespaceMapping) )
+        {
+        TInt foundIndex(KErrNotFound);
+        TInt jcount = ipNamespaceArray->Count();
+        for (TInt j=jcount-1; j >= 0 ; j--)
+            {
+            CSenNamespaceData* pNamespace = (*ipNamespaceArray)[j];
+            if ( pNamespace->ipLocalName != NULL )
+                {
+                if ( *pNamespace->ipLocalName == saxLocalName )
+                    {
+                    foundIndex = j;
+                    }
+                break;
+                }
+            }
+        if ( foundIndex != KErrNotFound )
+            {
+            for (TInt j=foundIndex; j < jcount; j++)
+                {
+                delete (*ipNamespaceArray)[foundIndex];
+                ipNamespaceArray->Remove(foundIndex);
+                }
+            }
+        }
+
+    // Check if EndTag should be written or not.
+    // There is no need to write EndTag if
+    // previous tag is StartTag for this element
+    // and there is no content for the element.
+    TBool writeEndTag = ETrue;        
+    TInt size = ipContentBuf->Size();
+    if ( size > 1 )
+        {
+        // Check if first character before this possible
+        // EndTag is '>'
+        if ( ipContentBuf->Ptr(size-1) == KSenGreaterThan )
+            {
+            // This element does not have content
+            // There is possibility that EndTag is not needed
+            TInt colon = KErrNotFound;
+            TInt space = KErrNotFound;
+            TBool insideDblQuot = EFalse;
+            
+            // Search backwards first '<'.
+            // Search also first ':' and space which
+            // are right after '<' (if those characters
+            // can be found).
+            // 
+            // => Following situations are handled:
+            // 1) <prefix:localname attr...>
+            // 2) <prefix:localname>
+            // 3) <localname>
+            TInt i=size-2;
+            TPtrC8 currentCharacter(KNullDesC8);
+            for (; i > 0; i--)
+                {
+                currentCharacter.Set(ipContentBuf->Ptr(i).Left(1));
+                
+                if ( currentCharacter == KSenDblQuot ) 
+                    {
+                    if ( insideDblQuot )
+                        {
+                        insideDblQuot = EFalse;
+                        }
+                    else
+                        {
+                        insideDblQuot = ETrue;
+                        }
+                    }
+                else if ( !insideDblQuot )
+                    {
+                    if ( currentCharacter == KSenSlash ) 
+                        {
+                        i = KErrNotFound;
+                        break;
+                        }
+                    else if ( currentCharacter == KSenLessThan ) 
+                        {
+                        break;
+                        }
+                    else if ( currentCharacter == KSenColon )
+                        {
+                        colon = i;
+                        }
+                    else if ( currentCharacter == KSenSpace )
+                        {
+                        colon = KErrNotFound;
+                        space = i;
+                        }
+                    }
+                }
+
+            // Now that we know place of '<' character and
+            // also places of ':' and space characters (if
+            // those two characters exist),
+            // we can find out possible prefix and localname.
+            if ( i > 0 )
+                {
+                TPtrC8 localNamePtr(KNullDesC8);
+                TPtrC8 prefixPtr(KNullDesC8);
+                if ( colon != KErrNotFound )
+                    {
+                    // Both Prefix and LocalName can be found.
+                    if ( space != KErrNotFound )
+                        {
+                        localNamePtr.Set(ipContentBuf->Ptr(colon+1).MidTPtr(0, space-colon-1));
+                        }
+                    else
+                        {
+                        localNamePtr.Set(ipContentBuf->Ptr(colon+1).MidTPtr(0, size-colon-2));
+                        }
+                    prefixPtr.Set(ipContentBuf->Ptr(i+1).MidTPtr(0, colon-i-1));
+                    }
+                else
+                    {
+                    // Only LocalName can be found.
+                    if ( space != KErrNotFound )
+                        {
+                        localNamePtr.Set(ipContentBuf->Ptr(i+1).MidTPtr(0, space-i-1));
+                        }
+                    else
+                        {
+                        localNamePtr.Set(ipContentBuf->Ptr(i+1).MidTPtr(0, size-i-2));
+                        }
+                    }
+                
+                // Do comparison for localname and prefix of
+                // this EndTag
+                if ( ( localNamePtr == saxLocalName ) && 
+                     ( prefixPtr == saxPrefix ) )
+                    {
+                    // LocalName and prefix matched. So
+                    // the EndTag should not be written.
+                    // => Now the last character '>' of StartTag can
+                    //    be replaced with characters '\' and '>'
+                    //    which means that element is closed without
+                    //    separate EndTag.
+                    ipContentBuf->Delete((ipContentBuf->Size()-1),1);
+                    ipContentBuf->InsertL((ipContentBuf->Size()), KSenSlash);
+                    ipContentWriteStream->WriteL(KSenGreaterThan);
+                    writeEndTag = EFalse;
+                    }
+                }
+            }
+        }
+    
+    if ( writeEndTag )
+        {
+        ipContentWriteStream->WriteL(KSenLessThanSlash());
+        
+        if ( saxPrefix.Length() > 0)
+            {
+            HBufC8*  pQName = HBufC8::NewLC( saxPrefix.Length()
+                                             +KSenColon().Length()
+                                             +saxLocalName.Length());
+            TPtr8 qname = pQName->Des();
+            qname.Append(saxPrefix);
+            qname.Append(KSenColon);
+            qname.Append(saxLocalName);
+            ipContentWriteStream->WriteL(qname);
+            CleanupStack::PopAndDestroy(pQName);
+            }
+        else
+            {
+            ipContentWriteStream->WriteL(saxLocalName);
+            }
+       
+        ipContentWriteStream->WriteL(KSenGreaterThan());
+        }    
+    }
+
+EXPORT_C TXmlEngNamespace CSenFragmentBase::Namespace(const TDesC8& aPrefix)
+    {
+    TXmlEngNamespace ns;
+    if (aPrefix.Length() == 0) return ns;
+    TRAP_IGNORE
+        (    
+        TXmlEngElement element = AsElementL();
+        ns = element.LookupNamespaceByPrefixL(aPrefix);
+        )
+    return ns;
+    }
+
+/*EXPORT_C void CSenFragmentBase::DetachL()
+    {
+    //First add all the namespaces referred to in the content.
+    if (iNamespaces.Count() > 0)
+        {
+        TInt count(iNamespaces.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            CSenNamespace* pNamespace = (CSenNamespace*) iNamespaces[i];
+            ipElement->AddNamespaceL(*pNamespace, EFalse);
+            //TRAPD(err, ipElement->AddNamespaceL(*pNamespace, EFalse));
+            //if (err) ;
+            }
+        }
+    //Detach the element from its parent.
+    ipElement->DetachL();
+    }*/
+
+EXPORT_C TPtrC8 CSenFragmentBase::LocalName() const
+    {
+    __ASSERT_ALWAYS(iElement.NotNull(), User::Panic(KSenFragmentPanic, EFragmentElementNotInitialized));
+        
+    return iElement.Name();
+    }
+
+EXPORT_C TPtrC8 CSenFragmentBase::NsUri() const
+    {
+    __ASSERT_ALWAYS(iElement.NotNull(), User::Panic(KSenFragmentPanic, EFragmentElementNotInitialized));
+
+    return iElement.NamespaceUri();
+    }
+
+EXPORT_C TPtrC8 CSenFragmentBase::NsPrefix() const
+    {
+    __ASSERT_ALWAYS(iElement.NotNull(), User::Panic(KSenFragmentPanic, EFragmentElementNotInitialized));
+
+    return iElement.Prefix();
+    }
+    
+EXPORT_C TBool CSenFragmentBase::ConsistsOfL(TXmlEngElement& aElement, TXmlEngElement& aCandidate)
+    {
+    // First check the names and namespaces
+    TPtrC8 elementLocalName         = aElement.Name();
+    TPtrC8 candidateLocalName       = aCandidate.Name();
+    // Check localnames (element should always have localname
+    //                  <=> localname can't be Null).
+    if ( elementLocalName != candidateLocalName )
+        {
+        return EFalse;
+        }
+        
+    TPtrC8 elementNamespaceUri      = aElement.NamespaceUri();
+    TPtrC8 candidateNamespaceUri    = aCandidate.NamespaceUri();
+    // Check namespaceUris (element does not always have namespaceUri
+    //                      <=> namespaceUri can be Null).
+    if ( elementNamespaceUri != KNullDesC8 && candidateNamespaceUri != KNullDesC8 )
+        {
+        if ( elementNamespaceUri != candidateNamespaceUri )
+            {
+            return EFalse;
+            }
+        }
+    else
+        {
+        if ( elementNamespaceUri != KNullDesC8 || candidateNamespaceUri != KNullDesC8 )
+            {
+            return EFalse;
+            }
+        }
+        
+    TPtrC8 elementPrefix            = aElement.Prefix();
+    TPtrC8 candidatePrefix          = aCandidate.Prefix();
+    // Check prefixes (element does not always have prefix
+    //                 <=> prefix can be Null).
+    if ( elementPrefix != KNullDesC8 && candidatePrefix != KNullDesC8 )
+        {
+        if ( elementPrefix != candidatePrefix )
+            {
+            return EFalse;
+            }
+        }
+    else
+        {
+        if ( elementPrefix != KNullDesC8 || candidatePrefix != KNullDesC8 )
+            {
+            return EFalse;
+            }
+        }
+
+    RBuf8 candidateContent;
+    aCandidate.WholeTextContentsCopyL(candidateContent);
+    CleanupClosePushL(candidateContent);
+    RBuf8 content;
+    aElement.WholeTextContentsCopyL(content);
+    CleanupClosePushL(content);
+    if ( candidateContent != content )
+        {
+        CleanupStack::PopAndDestroy(&content);
+        CleanupStack::PopAndDestroy(&candidateContent);
+        return EFalse;  // Content doesn't match => no match
+        }
+    CleanupStack::PopAndDestroy(&content);
+    CleanupStack::PopAndDestroy(&candidateContent);
+    
+    // Then handle the children
+    RXmlEngNodeList<TXmlEngElement> candidateChildren;
+    CleanupClosePushL(candidateChildren);
+    aCandidate.GetChildElements(candidateChildren);
+
+    RXmlEngNodeList<TXmlEngElement> children;
+    CleanupClosePushL(children);
+    aElement.GetChildElements(children);
+    
+    // Element should have at least as many child elements
+    // as candidateElement has.
+    TInt childrenCount = children.Count();
+    TInt candidateChildrenCount = candidateChildren.Count();
+    if ( childrenCount < candidateChildrenCount )
+        {
+        CleanupStack::PopAndDestroy(&children);
+        CleanupStack::PopAndDestroy(&candidateChildren);
+        return EFalse;
+        }
+    
+    // Every child element of candidate should be found
+    // from element.
+    while ( candidateChildren.HasNext() )
+        {
+        TXmlEngElement candidateMatchChild = candidateChildren.Next();
+        RXmlEngNodeList<TXmlEngElement> matchChilds;
+        CleanupClosePushL(matchChilds);
+
+        aElement.GetElementsByTagNameL(matchChilds,
+                                       candidateMatchChild.Name(),
+                                       candidateMatchChild.NamespaceUri());
+        if ( !matchChilds.HasNext() )
+            {
+            CleanupStack::PopAndDestroy(&matchChilds);
+            CleanupStack::PopAndDestroy(&children);
+            CleanupStack::PopAndDestroy(&candidateChildren);
+            return EFalse;
+            }
+        else
+            {
+            TBool found = EFalse;
+            while ( matchChilds.HasNext() )
+                {
+                TXmlEngElement matchChild = matchChilds.Next();
+                found = ConsistsOfL(matchChild, candidateMatchChild);
+                if ( found ) break;
+                }
+            if ( !found )
+                {
+                CleanupStack::PopAndDestroy(&matchChilds);
+                CleanupStack::PopAndDestroy(&children);
+                CleanupStack::PopAndDestroy(&candidateChildren);
+                return EFalse;
+                }
+            }
+            
+        CleanupStack::PopAndDestroy(&matchChilds);
+        }
+        
+    CleanupStack::PopAndDestroy(&children);
+    CleanupStack::PopAndDestroy(&candidateChildren);
+    return ETrue;    
+    }
+
+EXPORT_C TBool CSenFragmentBase::ConsistsOfL(CSenFragmentBase& aCandidate)
+    {
+    TXmlEngElement element          = AsElementL();
+    TXmlEngElement candidateElement = aCandidate.AsElementL();
+    return ConsistsOfL(element, candidateElement);
+    }
+
+EXPORT_C void CSenFragmentBase::SetContentHandler(
+                                            CSenFragmentBase& aContentHandler)
+    {
+    ipParser->SetContentHandler(aContentHandler);
+    }
+
+EXPORT_C void CSenFragmentBase::SetContentL(const TDesC8& aContent)
+    {
+    TXmlEngElement element = AsElementL();
+    element.SetTextNoEncL(aContent);
+    }
+
+EXPORT_C void CSenFragmentBase::AddContentL(const TDesC8& aContent)
+    {
+    TPtrC8 content = ContentL();
+    TXmlEngElement element = AsElementL();
+    if ( content.Length() > 0 )
+        {
+        HBufC8* pContent = HBufC8::NewLC( content.Length() + aContent.Length() );
+        TPtr8 ptrContent = pContent->Des();
+        ptrContent.Append(content);
+        ptrContent.Append(aContent);
+        element.SetTextNoEncL(*pContent);
+        CleanupStack::PopAndDestroy(pContent);
+        }
+    else
+        {
+        element.SetTextNoEncL(aContent);
+        }
+    }
+    
+EXPORT_C void CSenFragmentBase::SetDocument(RSenDocument& aDocument)
+    {
+    iDocument.Close();
+    iDocument = aDocument.Copy();
+    }
+
+CSenNamespaceData::~CSenNamespaceData()
+    {
+    delete ipNamespaceUri;
+    delete ipPrefix;
+    delete ipLocalName;
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/src/senparser.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements XML Parser capable of service multiple handlers
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include "senparserimpl.h"
+
+CSenParser::CSenParser()
+    {
+    }
+
+EXPORT_C CSenParser* CSenParser::NewL()
+    {
+    return CSenParserImpl::NewL();
+    }
+
+EXPORT_C CSenParser* CSenParser::NewLC()
+    {
+    return CSenParserImpl::NewLC();
+    }
+
+EXPORT_C CSenParser* CSenParser::NewL(CParser* apParser)
+    {
+    return CSenParserImpl::NewL(apParser);
+    }
+
+EXPORT_C CSenParser* CSenParser::NewLC(CParser* apParser)
+    {
+    return CSenParserImpl::NewLC(apParser);
+    }
+
+EXPORT_C CSenParser* CSenParser::NewL(const TDesC8& aParserMimeType)
+    {
+    return CSenParserImpl::NewL(aParserMimeType);
+    }
+
+EXPORT_C CSenParser* CSenParser::NewLC(const TDesC8& aParserMimeType)
+    {
+    return CSenParserImpl::NewLC(aParserMimeType);
+    }
+
+// End of file
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/src/senparserimpl.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements XML Parser capable of service multiple handlers
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senparserimpl.h"
+#include "SenFragmentBase.h"
+
+#include <xml/matchdata.h> // to select libxml2 sax parser
+namespace
+    {
+#ifdef RD_SEN_FORCE_LIBXML_SAX_PLUGIN_MIMETYPE
+    _LIT8(KXmlParserMimeType,   "text/wsstarlibxml2");
+    _LIT8(KXmlVariant,          "wsstarlibxml2");
+#else
+    _LIT8(KXmlParserMimeType,   "text/xml"); // Expat on S60 3.0, and on S60 3.1, goes according to variant
+    _LIT8(KXmlVariant,          "libxml2");  // LibXml2 SAX parser
+#endif
+    }
+
+CSenParserImpl* CSenParserImpl::NewL()
+    {
+    CSenParserImpl* self = CSenParserImpl::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSenParserImpl* CSenParserImpl::NewLC()
+    {
+    CSenParserImpl* self = new (ELeave) CSenParserImpl(NULL);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CSenParserImpl* CSenParserImpl::NewL(CParser* apParser)
+    {
+    CSenParserImpl* self = CSenParserImpl::NewLC(apParser);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSenParserImpl* CSenParserImpl::NewLC(CParser* apParser)
+    {
+    CSenParserImpl* self = new (ELeave) CSenParserImpl(apParser);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+CSenParserImpl* CSenParserImpl::NewL(const TDesC8& aParserMimeType)
+    {
+    CSenParserImpl* self = CSenParserImpl::NewLC(aParserMimeType);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSenParserImpl* CSenParserImpl::NewLC(const TDesC8& aParserMimeType)
+    {
+    CSenParserImpl* self = new (ELeave) CSenParserImpl(NULL);
+    CleanupStack::PushL(self);
+    self->ConstructL(aParserMimeType);
+    return self;
+    }
+
+CSenParserImpl::CSenParserImpl(CParser* apParser)
+:   ipParser(apParser)
+    {
+    }
+
+
+void CSenParserImpl::ConstructL()
+    {
+    CMatchData* pMatchData = CMatchData::NewL();
+    CleanupStack::PushL(pMatchData);
+    // Set the default variant type (libxml2)
+    pMatchData->SetVariantL(KXmlVariant);
+    pMatchData->SetMimeTypeL(KXmlParserMimeType);
+    ipContentHandler = CSenContentHandler::NewL();
+    ipParser = CParser::NewL(*pMatchData, *ipContentHandler);  // to select libxml2 sax parser
+
+    CleanupStack::PopAndDestroy(pMatchData);
+    }
+
+void CSenParserImpl::ConstructL(const TDesC8& aParserMimeType)
+    {
+    ipContentHandler = CSenContentHandler::NewL();
+    ipParser = CParser::NewL(aParserMimeType, *ipContentHandler); // Left to client to chose the appropriat parser
+    }
+
+CSenParserImpl::~CSenParserImpl()
+    {
+    delete ipContentHandler;
+    delete ipParser;
+    }
+    
+void CSenParserImpl::SetContentHandler(CSenFragmentBase& aContentHandler)
+    {
+    ipContentHandler->SetContentHandler(aContentHandler);
+    }
+
+void CSenParserImpl::ParseBeginL()
+    {
+    ipParser->ParseBeginL();
+    }
+
+void CSenParserImpl::ParseBeginL(const TDesC8& aDocumentMimeType)
+    {
+    ipParser->ParseBeginL(aDocumentMimeType);
+    }
+
+void CSenParserImpl::ParseL(const TDesC8& aFragment,
+                                    CSenFragmentBase& aContentHandler)
+    {
+    ipContentHandler->SetContentHandler(aContentHandler);
+    aContentHandler.SetParser(*this);
+    
+    ipParser->ParseL(aFragment);
+    // Following enables Symbian XML framework to invoke OnErrorL() callback:
+    ipParser->ParseEndL();
+    }
+    
+void CSenParserImpl::ParseL(RFs& aFs, const TDesC& aFilename, CSenFragmentBase& aContentHandler)
+    {
+    ipContentHandler->SetContentHandler(aContentHandler);
+    aContentHandler.SetParser(*this);
+    Xml::ParseL( *ipParser, aFs, aFilename );
+    }
+
+void CSenParserImpl::ParseL(RFile& aFile, CSenFragmentBase& aContentHandler)
+    {
+    ipContentHandler->SetContentHandler(aContentHandler);
+    aContentHandler.SetParser(*this);
+    Xml::ParseL( *ipParser, aFile );
+    }
+
+void CSenParserImpl::ParseEndL()
+    {
+    ipParser->ParseEndL();
+    }
+
+void CSenParserImpl::SetProcessorChainL(const RContentProcessorUids& aPlugins)
+    {
+    ipParser->SetProcessorChainL(aPlugins);
+    }
+
+TInt CSenParserImpl::EnableFeature(TInt aParserFeature)
+    {
+    return ipParser->EnableFeature(aParserFeature);
+    }
+
+TInt CSenParserImpl::DisableFeature(TInt aParserFeature)
+    {
+    return ipParser->DisableFeature(aParserFeature);
+    }
+
+TBool CSenParserImpl::IsFeatureEnabled(TInt aParserFeature) const
+    {
+    return ipParser->IsFeatureEnabled(aParserFeature);
+    }
+
+void CSenParserImpl::AddPreloadedDictionaryL(const TDesC8& aPublicId)
+    {
+    ipParser->AddPreloadedDictionaryL(aPublicId);
+    }
+
+RStringPool& CSenParserImpl::StringPool()
+    {
+    return ipParser->StringPool();
+    }
+
+RStringDictionaryCollection& CSenParserImpl::StringDictionaryCollection()
+    {
+    return ipParser->StringDictionaryCollection();
+    }
+
+CSenContentHandler* CSenContentHandler::NewL(MContentHandler& aContentHandler)
+    {
+    CSenContentHandler* self = CSenContentHandler::NewLC(aContentHandler);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSenContentHandler* CSenContentHandler::NewLC(MContentHandler& aContentHandler)
+    {
+    CSenContentHandler* self = new (ELeave) CSenContentHandler(&aContentHandler);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+CSenContentHandler* CSenContentHandler::NewL()
+    {
+    CSenContentHandler* self = CSenContentHandler::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSenContentHandler* CSenContentHandler::NewLC()
+    {
+    CSenContentHandler* self = new (ELeave) CSenContentHandler(NULL);
+    CleanupStack::PushL(self);
+    return self;
+    }
+    
+CSenContentHandler::CSenContentHandler(MContentHandler* apContentHandler)
+:   ipContentHandler(apContentHandler)
+    {
+    }
+
+MContentHandler& CSenContentHandler::ContentHandler()
+    {
+    return *ipContentHandler;
+    }
+    
+CSenContentHandler::~CSenContentHandler()
+    {
+    }
+
+void CSenContentHandler::SetContentHandler(MContentHandler& aContentHandler)
+    {
+    ipContentHandler = &aContentHandler;
+    }
+
+void CSenContentHandler::OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode)
+    {
+    ipContentHandler->OnStartDocumentL(aDocParam, aErrorCode);
+    }
+
+void CSenContentHandler::OnEndDocumentL(TInt aErrorCode)
+    {
+    ipContentHandler->OnEndDocumentL(aErrorCode);
+    }
+
+void CSenContentHandler::OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes,
+                                 TInt aErrorCode)
+    {
+    ipContentHandler->OnStartElementL(aElement, aAttributes, aErrorCode);
+    }
+
+void CSenContentHandler::OnEndElementL(const RTagInfo& aElement, TInt aErrorCode)
+    {
+    ipContentHandler->OnEndElementL(aElement, aErrorCode);
+    }
+
+void CSenContentHandler::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
+    {
+    ipContentHandler->OnContentL(aBytes, aErrorCode);
+    }
+
+void CSenContentHandler::OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri,
+                                       TInt aErrorCode)
+    {
+    ipContentHandler->OnStartPrefixMappingL(aPrefix, aUri, aErrorCode);
+    }
+
+void CSenContentHandler::OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode)
+    {
+    ipContentHandler->OnEndPrefixMappingL(aPrefix, aErrorCode);
+    }
+
+void CSenContentHandler::OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode)
+    {
+    ipContentHandler->OnIgnorableWhiteSpaceL(aBytes, aErrorCode);
+    }
+
+void CSenContentHandler::OnSkippedEntityL(const RString& aName, TInt aErrorCode)
+    {
+    ipContentHandler->OnSkippedEntityL(aName, aErrorCode);
+    }
+
+void CSenContentHandler::OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData,
+                                          TInt aErrorCode)
+    {
+    ipContentHandler->OnProcessingInstructionL(aTarget, aData, aErrorCode);
+    }
+
+void CSenContentHandler::OnError(TInt aErrorCode)
+    {
+    ipContentHandler->OnError(aErrorCode);
+    }
+
+TAny* CSenContentHandler::GetExtendedInterface(const TInt32 aUid)
+    {
+    return ipContentHandler->GetExtendedInterface(aUid);
+    }
+    
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsfragment/src/wslibxml2utils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Utility for webservices
+*
+*/
+
+
+
+
+
+
+
+
+#include "wslibxml2utils.h"
+
+#include <libxml2_globals.h>
+#include <xmlengelement.h>
+#include <xmlengerrors.h>
+#include <xmlengxestd.h>
+
+#define INTERNAL_NODEPTR(aNodeObject)   (*reinterpret_cast<xmlNodePtr*>(&(aNodeObject)))
+#define INTERNAL_NSPTR(aNsDefObject)    (*reinterpret_cast<xmlNsPtr*>(&(aNsDefObject)))
+#define XE_ASSERT_DEBUG(assertion)  __ASSERT_DEBUG((assertion),  XmlEngLeaveL(KXmlEngErrWrongUseOfAPI))
+#define XE_ASSERT_ALWAYS(assertion) __ASSERT_ALWAYS((assertion), XmlEngLeaveL(KXmlEngErrNullNode))
+
+
+xmlChar* xmlCharFromDesC8L(const TDesC8& aDesc)
+    {
+    if(!aDesc.Length())
+        {
+        return NULL;
+        }
+    xmlChar* newContent = (xmlChar*)new(ELeave) TUint8[aDesc.Length() + 1];
+    *(Mem::Copy((TAny*)newContent, aDesc.Ptr(), aDesc.Length())) = 0;
+    return newContent;
+    }
+    
+EXPORT_C void WsXmlUtils::XmlEngRenameElementL(TXmlEngElement aElement, const TDesC8& aLocalName, 
+                               const TDesC8& aNamespaceUri, 
+                               const TDesC8& aPrefix)
+    {
+			xmlNodePtr element = INTERNAL_NODEPTR(aElement);
+
+    	XE_ASSERT_DEBUG( element->type == XML_ELEMENT_NODE );
+
+      const xmlChar* oldName = element->name;
+       	
+      XE_ASSERT_ALWAYS(aLocalName.Length());
+       	
+      element->name = xmlCharFromDesC8L(aLocalName);
+       	
+      xmlFree((void*)oldName );
+       	
+      if (aNamespaceUri.Length() || aPrefix.Length())
+        {
+        	TXmlEngNamespace ns = aElement.FindOrCreateNsDeclL(aNamespaceUri, aPrefix);
+          element->ns = INTERNAL_NSPTR(ns);
+      	}
+    }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/BMARM/SENFRAMEWORKU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,240 @@
+EXPORTS
+	__27CSenInternalServiceConsumerQ222MSenServiceDescription21TDescriptionClassTypeR4CSIF @ 1 NONAME R3UNUSED ; CSenInternalServiceConsumer::CSenInternalServiceConsumer(MSenServiceDescription::TDescriptionClassType, CSIF &)
+	AddConsumerL__21CSenWebServiceSessionR25MSenRemoteServiceConsumer @ 2 NONAME R3UNUSED ; CSenWebServiceSession::AddConsumerL(MSenRemoteServiceConsumer &)
+	AddCredentialL__21CSenWebServiceSessionR14CSenCredential @ 3 NONAME R3UNUSED ; CSenWebServiceSession::AddCredentialL(CSenCredential &)
+	AddFacetL__18CSenServiceSessionRC9CSenFacet @ 4 NONAME R3UNUSED ; CSenServiceSession::AddFacetL(CSenFacet const &)
+	AsServiceDescription__18CSenServiceSession @ 5 NONAME R3UNUSED ; CSenServiceSession::AsServiceDescription(void)
+	BaseConstructL__18CSenServiceSession @ 6 NONAME R3UNUSED ; CSenServiceSession::BaseConstructL(void)
+	ClearPasswordL__14CSaslMechanism @ 7 NONAME R3UNUSED ; CSaslMechanism::ClearPasswordL(void)
+	ClientServerInterval__21CSenWebServiceSession @ 8 NONAME R3UNUSED ; CSenWebServiceSession::ClientServerInterval(void)
+	CompleteServerMessagesOnOffL__18CSenServiceSessionRCi @ 9 NONAME R3UNUSED ; CSenServiceSession::CompleteServerMessagesOnOffL(int const &)
+	ComputeStatusL__18CSenServiceSession @ 10 NONAME R3UNUSED ; CSenServiceSession::ComputeStatusL(void)
+	ComputeStatusL__21CSenWebServiceSession @ 11 NONAME R3UNUSED ; CSenWebServiceSession::ComputeStatusL(void)
+	ConstructL__21CSenWebServiceSession @ 12 NONAME R3UNUSED ; CSenWebServiceSession::ConstructL(void)
+	ConstructL__27CSenInternalServiceConsumer @ 13 NONAME R3UNUSED ; CSenInternalServiceConsumer::ConstructL(void)
+	ConstructSecurityTokenL__21CSenWebServiceSessionR14CSenCredentialRP6HBufC8 @ 14 NONAME R3UNUSED ; CSenWebServiceSession::ConstructSecurityTokenL(CSenCredential &, HBufC8 *&)
+	Contract__18CSenServiceSession @ 15 NONAME R3UNUSED ; CSenServiceSession::Contract(void)
+	Contract__21CSenWebServiceSession @ 16 NONAME R3UNUSED ; CSenWebServiceSession::Contract(void)
+	Endpoint__18CSenServiceSession @ 17 NONAME R3UNUSED ; CSenServiceSession::Endpoint(void)
+	Endpoint__21CSenWebServiceSession @ 18 NONAME R3UNUSED ; CSenWebServiceSession::Endpoint(void)
+	FacetValue__18CSenServiceSessionR6TDesC8RP6HBufC8 @ 19 NONAME R3UNUSED ; CSenServiceSession::FacetValue(TDesC8 &, HBufC8 *&)
+	FacetsL__18CSenServiceSessionRt13RPointerArray1Z9CSenFacet @ 20 NONAME R3UNUSED ; CSenServiceSession::FacetsL(RPointerArray<CSenFacet> &)
+	FrameworkId__21CSenWebServiceSession @ 21 NONAME R3UNUSED ; CSenWebServiceSession::FrameworkId(void)
+	FrameworkVersion__21CSenWebServiceSession @ 22 NONAME R3UNUSED ; CSenWebServiceSession::FrameworkVersion(void)
+	Framework__27CSenInternalServiceConsumer @ 23 NONAME R3UNUSED ; CSenInternalServiceConsumer::Framework(void)
+	Consumer__21CSenWebServiceSession @ 24 NONAME R3UNUSED ; CSenWebServiceSession::Consumer(void)
+	Consumers__C21CSenWebServiceSessionRt13RPointerArray1Z25MSenRemoteServiceConsumer @ 25 NONAME R3UNUSED ; CSenWebServiceSession::Consumers(RPointerArray<MSenRemoteServiceConsumer> &) const
+	HandleSoapFaultL__21CSenWebServiceSessionR15CSenSoapMessageiiR25MSenRemoteServiceConsumerP14MSenProperties @ 26 NONAME ; CSenWebServiceSession::HandleSoapFaultL(CSenSoapMessage &, int, int, MSenRemoteServiceConsumer &, MSenProperties *)
+	HandleSoapFaultL__21CSenWebServiceSessionR15CSenSoapMessageRP6HBufC8 @ 27 NONAME R3UNUSED ; CSenWebServiceSession::HandleSoapFaultL(CSenSoapMessage &, HBufC8 *&)
+	SendErrorToConsumerL__21CSenWebServiceSessioniRC6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 28 NONAME ; CSenWebServiceSession::SendErrorToConsumerL(int, TDesC8 const &, int, MSenRemoteServiceConsumer &, MSenProperties *)
+	HandleErrorL__27CSenInternalServiceConsumerRC6TDesC8iiP14MSenProperties @ 29 NONAME ; CSenInternalServiceConsumer::HandleErrorL(TDesC8 const &, int, int, MSenProperties *)
+	SendToConsumerL__21CSenWebServiceSessionRC6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 30 NONAME ; CSenWebServiceSession::SendToConsumerL(TDesC8 const &, int, MSenRemoteServiceConsumer &, MSenProperties *)
+	HandleMessageL__27CSenInternalServiceConsumerRC6TDesC8iP14MSenProperties @ 31 NONAME ; CSenInternalServiceConsumer::HandleMessageL(TDesC8 const &, int, MSenProperties *)
+	HasConsumer__C21CSenWebServiceSession @ 32 NONAME R3UNUSED ; CSenWebServiceSession::HasConsumer(void) const
+	HasFacetL__18CSenServiceSessionRC6TDesC8Ri @ 33 NONAME R3UNUSED ; CSenServiceSession::HasFacetL(TDesC8 const &, int &)
+	Id__C27CSenInternalServiceConsumer @ 34 NONAME R3UNUSED ; CSenInternalServiceConsumer::Id(void) const
+	InitFrom__14CSaslMechanismT0 @ 35 NONAME R3UNUSED ; CSaslMechanism::InitFrom(CSaslMechanism)
+	InitializeFromL__18CSenServiceSessionR22MSenServiceDescription @ 36 NONAME R3UNUSED ; CSenServiceSession::InitializeFromL(MSenServiceDescription &)
+	InitializeFromL__21CSenWebServiceSessionR22MSenServiceDescription @ 37 NONAME R3UNUSED ; CSenWebServiceSession::InitializeFromL(MSenServiceDescription &)
+	IsExpiredL__21CSenWebServiceSession @ 38 NONAME R3UNUSED ; CSenWebServiceSession::IsExpiredL(void)
+	IsPasswordFromUser__14CSaslMechanism @ 39 NONAME R3UNUSED ; CSaslMechanism::IsPasswordFromUser(void)
+	IsReadyL__18CSenServiceSession @ 40 NONAME R3UNUSED ; CSenServiceSession::IsReadyL(void)
+	IsReadyL__21CSenWebServiceSession @ 41 NONAME R3UNUSED ; CSenWebServiceSession::IsReadyL(void)
+	IsReadyL__27CSenInternalServiceConsumer @ 42 NONAME R3UNUSED ; CSenInternalServiceConsumer::IsReadyL(void)
+	Log__C18CSenServiceSession @ 43 NONAME R3UNUSED ; CSenServiceSession::Log(void) const
+	Log__C27CSenInternalServiceConsumer @ 44 NONAME R3UNUSED ; CSenInternalServiceConsumer::Log(void) const
+	Matches__18CSenServiceSessionR22MSenServiceDescription @ 45 NONAME R3UNUSED ; CSenServiceSession::Matches(MSenServiceDescription &)
+	MaxAttempts__14CSaslMechanism @ 46 NONAME R3UNUSED ; CSaslMechanism::MaxAttempts(void)
+	MessageForSendingL__21CSenWebServiceSessionRC6TDesC8T1RP15CSenSoapMessage @ 47 NONAME ; CSenWebServiceSession::MessageForSendingL(TDesC8 const &, TDesC8 const &, CSenSoapMessage *&)
+	NewLC__14CSaslMechanism @ 48 NONAME R3UNUSED ; CSaslMechanism::NewLC(void)
+	NewL__14CSaslMechanism @ 49 NONAME R3UNUSED ; CSaslMechanism::NewL(void)
+	NewMessageL__21CSenWebServiceSessionRP15CSenSoapMessage @ 50 NONAME R3UNUSED ; CSenWebServiceSession::NewMessageL(CSenSoapMessage *&)
+	ParseMessageL__21CSenWebServiceSessionR15CSenSoapMessage @ 51 NONAME R3UNUSED ; CSenWebServiceSession::ParseMessageL(CSenSoapMessage &)
+	ParseResponseL__18CSenServiceSessionRC6TDesC8RP6HBufC8 @ 52 NONAME R3UNUSED ; CSenServiceSession::ParseResponseL(TDesC8 const &, HBufC8 *&)
+	ParseResponseL__21CSenWebServiceSessionRC6TDesC8RP15CSenSoapMessage @ 53 NONAME R3UNUSED ; CSenWebServiceSession::ParseResponseL(TDesC8 const &, CSenSoapMessage *&)
+	ParseResponseL__21CSenWebServiceSessionRC6TDesC8RP6HBufC8 @ 54 NONAME R3UNUSED ; CSenWebServiceSession::ParseResponseL(TDesC8 const &, HBufC8 *&)
+	Password8L__14CSaslMechanism @ 55 NONAME R3UNUSED ; CSaslMechanism::Password8L(void)
+	Identifier__C27CSenInternalServiceConsumer @ 56 NONAME R3UNUSED ; CSenInternalServiceConsumer::Identifier(void) const
+	RemoteConsumerL__18CSenServiceSessionRC6TDesC8 @ 57 NONAME R3UNUSED ; CSenServiceSession::RemoteConsumerL(TDesC8 const &)
+	RemoveFacet__18CSenServiceSessionRC6TDesC8 @ 58 NONAME R3UNUSED ; CSenServiceSession::RemoveFacet(TDesC8 const &)
+	SaveL__18CSenServiceSession @ 59 NONAME R3UNUSED ; CSenServiceSession::SaveL(void)
+	ScoreMatchL__18CSenServiceSessionR22MSenServiceDescription @ 60 NONAME R3UNUSED ; CSenServiceSession::ScoreMatchL(MSenServiceDescription &)
+	SendL__18CSenServiceSessionRC6TDesC8T1R25MSenRemoteServiceConsumerRi @ 61 NONAME ; CSenServiceSession::SendL(TDesC8 const &, TDesC8 const &, MSenRemoteServiceConsumer &, int &)
+	SendL__21CSenWebServiceSessionRC6TDesC8T1R25MSenRemoteServiceConsumerRi @ 62 NONAME ; CSenWebServiceSession::SendL(TDesC8 const &, TDesC8 const &, MSenRemoteServiceConsumer &, int &)
+	SendSoapMessageToConsumerL__21CSenWebServiceSessionR15CSenSoapMessageiR25MSenRemoteServiceConsumerP14MSenProperties @ 63 NONAME ; CSenWebServiceSession::SendSoapMessageToConsumerL(CSenSoapMessage &, int, MSenRemoteServiceConsumer &, MSenProperties *)
+	SendSoapL__21CSenWebServiceSessionRC6TDesC8T1R25MSenRemoteServiceConsumerRi @ 64 NONAME ; CSenWebServiceSession::SendSoapL(TDesC8 const &, TDesC8 const &, MSenRemoteServiceConsumer &, int &)
+	SetClientServerInterval__21CSenWebServiceSessionG25TTimeIntervalMicroSeconds @ 65 NONAME ; CSenWebServiceSession::SetClientServerInterval(TTimeIntervalMicroSeconds)
+	SetContractL__21CSenWebServiceSessionRC6TDesC8 @ 66 NONAME R3UNUSED ; CSenWebServiceSession::SetContractL(TDesC8 const &)
+	SetEndPointL__21CSenWebServiceSessionRC6TDesC8 @ 67 NONAME R3UNUSED ; CSenWebServiceSession::SetEndPointL(TDesC8 const &)
+	SetFacetL__18CSenServiceSessionRC9CSenFacet @ 68 NONAME R3UNUSED ; CSenServiceSession::SetFacetL(CSenFacet const &)
+	SetFrameworkHeadersL__21CSenWebServiceSessionR15CSenSoapMessage @ 69 NONAME R3UNUSED ; CSenWebServiceSession::SetFrameworkHeadersL(CSenSoapMessage &)
+	SetIdentity__14CSaslMechanismP20CSenIdentityProviderP19MSenIdentityManager @ 70 NONAME R3UNUSED ; CSaslMechanism::SetIdentity(CSenIdentityProvider *, MSenIdentityManager *)
+	SetSecurityL__21CSenWebServiceSessionRC6TDesC8 @ 71 NONAME R3UNUSED ; CSenWebServiceSession::SetSecurityL(TDesC8 const &)
+	SetSessionL__27CSenInternalServiceConsumerR24MSenRemoteServiceSession @ 72 NONAME R3UNUSED ; CSenInternalServiceConsumer::SetSessionL(MSenRemoteServiceSession &)
+	SetStatusL__27CSenInternalServiceConsumeri @ 73 NONAME R3UNUSED ; CSenInternalServiceConsumer::SetStatusL(int)
+	SetStatusL__18CSenServiceSession @ 74 NONAME R3UNUSED ; CSenServiceSession::SetStatusL(void)
+	HandleErrorL__21CSenWebServiceSessioniRC6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 75 NONAME ; CSenWebServiceSession::HandleErrorL(int, TDesC8 const &, int, MSenRemoteServiceConsumer &, MSenProperties *)
+	SetTransforms__14CSaslMechanismGt13RPointerArray1Z21CSenPasswordTransform @ 76 NONAME ; CSaslMechanism::SetTransforms(RPointerArray<CSenPasswordTransform>)
+	SetUserNameL__21CSenWebServiceSessionR6TDesC8 @ 77 NONAME R3UNUSED ; CSenWebServiceSession::SetUserNameL(TDesC8 &)
+	StartTransaction__21CSenWebServiceSession @ 78 NONAME R3UNUSED ; CSenWebServiceSession::StartTransaction(void)
+	StatusL__18CSenServiceSession @ 79 NONAME R3UNUSED ; CSenServiceSession::StatusL(void)
+	SubmitL__18CSenServiceSessionRC6TDesC8T1R25MSenRemoteServiceConsumerRP6HBufC8 @ 80 NONAME ; CSenServiceSession::SubmitL(TDesC8 const &, TDesC8 const &, MSenRemoteServiceConsumer &, HBufC8 *&)
+	SubmitL__21CSenWebServiceSessionRC6TDesC8T1R25MSenRemoteServiceConsumerRP6HBufC8 @ 81 NONAME ; CSenWebServiceSession::SubmitL(TDesC8 const &, TDesC8 const &, MSenRemoteServiceConsumer &, HBufC8 *&)
+	SubmitSoapL__21CSenWebServiceSessionRC6TDesC8T1R25MSenRemoteServiceConsumerRP6HBufC8 @ 82 NONAME ; CSenWebServiceSession::SubmitSoapL(TDesC8 const &, TDesC8 const &, MSenRemoteServiceConsumer &, HBufC8 *&)
+	TransactionCompleted__21CSenWebServiceSession @ 83 NONAME R3UNUSED ; CSenWebServiceSession::TransactionCompleted(void)
+	TransformL__C14CSaslMechanismG6TPtrC8 @ 84 NONAME ; CSaslMechanism::TransformL(TPtrC8) const
+	ValidUntilL__21CSenWebServiceSession @ 85 NONAME R3UNUSED ; CSenWebServiceSession::ValidUntilL(void)
+	WriteAsXMLToL__21CSenWebServiceSessionR12RWriteStream @ 86 NONAME R3UNUSED ; CSenWebServiceSession::WriteAsXMLToL(RWriteStream &)
+	WriteExtensionsAsXMLToL__18CSenServiceSessionR12RWriteStream @ 87 NONAME R3UNUSED ; CSenServiceSession::WriteExtensionsAsXMLToL(RWriteStream &)
+	XmlReader__21CSenWebServiceSession @ 88 NONAME R3UNUSED ; CSenWebServiceSession::XmlReader(void)
+	"_._14CSaslMechanism" @ 89 NONAME R3UNUSED ; CSaslMechanism::~CSaslMechanism(void)
+	"_._18CSenServiceSession" @ 90 NONAME R3UNUSED ; CSenServiceSession::~CSenServiceSession(void)
+	"_._21CSenWebServiceSession" @ 91 NONAME R3UNUSED ; CSenWebServiceSession::~CSenWebServiceSession(void)
+	"_._27CSenInternalServiceConsumer" @ 92 NONAME R3UNUSED ; CSenInternalServiceConsumer::~CSenInternalServiceConsumer(void)
+	__14CSaslMechanism @ 93 NONAME R3UNUSED ; CSaslMechanism::CSaslMechanism(void)
+	__18CSenServiceSessionQ222MSenServiceDescription21TDescriptionClassTypeR4MSIF @ 94 NONAME R3UNUSED ; CSenServiceSession::CSenServiceSession(MSenServiceDescription::TDescriptionClassType, MSIF &)
+	__21CSenWebServiceSessionQ222MSenServiceDescription21TDescriptionClassTypeR4MSIF @ 95 NONAME R3UNUSED ; CSenWebServiceSession::CSenWebServiceSession(MSenServiceDescription::TDescriptionClassType, MSIF &)
+	Account__14CSaslMechanism @ 96 NONAME R3UNUSED ; CSaslMechanism::Account(void)
+	SetTransportPropertiesL__18CSenServiceSessionRC6TDesC8R25MSenRemoteServiceConsumer @ 97 NONAME R3UNUSED ; CSenServiceSession::SetTransportPropertiesL(TDesC8 const &, MSenRemoteServiceConsumer &)
+	DescriptionClassType__18CSenServiceSession @ 98 NONAME R3UNUSED ; CSenServiceSession::DescriptionClassType(void)
+	FrameworkId__18CSenServiceSession @ 99 NONAME R3UNUSED ; CSenServiceSession::FrameworkId(void)
+	__30CSenLayeredTransportProperties @ 100 NONAME R3UNUSED ; CSenLayeredTransportProperties::CSenLayeredTransportProperties(void)
+	AsUtf8LC__30CSenLayeredTransportProperties @ 101 NONAME R3UNUSED ; CSenLayeredTransportProperties::AsUtf8LC(void)
+	AsUtf8LC__30CSenLayeredTransportPropertiesQ221MSenLayeredProperties19TSenPropertiesLayer @ 102 NONAME R3UNUSED ; CSenLayeredTransportProperties::AsUtf8LC(MSenLayeredProperties::TSenPropertiesLayer)
+	AsUtf8L__30CSenLayeredTransportProperties @ 103 NONAME R3UNUSED ; CSenLayeredTransportProperties::AsUtf8L(void)
+	AsUtf8L__30CSenLayeredTransportPropertiesQ221MSenLayeredProperties19TSenPropertiesLayer @ 104 NONAME R3UNUSED ; CSenLayeredTransportProperties::AsUtf8L(MSenLayeredProperties::TSenPropertiesLayer)
+	AsXmlL__15CSenHandlerBase @ 105 NONAME R3UNUSED ; CSenHandlerBase::AsXmlL(void)
+	BaseConstructL__17CSenSyncRequester @ 106 NONAME R3UNUSED ; CSenSyncRequester::BaseConstructL(void)
+	BaseConstructL__30CSenLayeredTransportPropertiesRC11CSenElementP11RStringPool @ 107 NONAME R3UNUSED ; CSenLayeredTransportProperties::BaseConstructL(CSenElement const &, RStringPool *)
+	BaseConstructL__30CSenLayeredTransportPropertiesRC6TDesC8N21P13CSenXmlReaderP11RStringPool @ 108 NONAME ; CSenLayeredTransportProperties::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, CSenXmlReader *, RStringPool *)
+	BaseConstructL__30CSenLayeredTransportPropertiesRC6TDesC8N31P13CSenXmlReaderP11RStringPool @ 109 NONAME ; CSenLayeredTransportProperties::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, TDesC8 const &, CSenXmlReader *, RStringPool *)
+	BaseConstructL__30CSenLayeredTransportPropertiesRC6TDesC8T1P13CSenXmlReaderP11RStringPool @ 110 NONAME ; CSenLayeredTransportProperties::BaseConstructL(TDesC8 const &, TDesC8 const &, CSenXmlReader *, RStringPool *)
+	BoolPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8Ri @ 111 NONAME R3UNUSED ; CSenLayeredTransportProperties::BoolPropertyL(TDesC8 const &, int &)
+	BoolPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8RiQ221MSenLayeredProperties19TSenPropertiesLayer @ 112 NONAME ; CSenLayeredTransportProperties::BoolPropertyL(TDesC8 const &, int &, MSenLayeredProperties::TSenPropertiesLayer)
+	ExpandToL__30CSenLayeredTransportPropertiesQ221MSenLayeredProperties19TSenPropertiesLayer @ 113 NONAME R3UNUSED ; CSenLayeredTransportProperties::ExpandToL(MSenLayeredProperties::TSenPropertiesLayer)
+	IntPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8Ri @ 114 NONAME R3UNUSED ; CSenLayeredTransportProperties::IntPropertyL(TDesC8 const &, int &)
+	IntPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8RiQ221MSenLayeredProperties19TSenPropertiesLayer @ 115 NONAME ; CSenLayeredTransportProperties::IntPropertyL(TDesC8 const &, int &, MSenLayeredProperties::TSenPropertiesLayer)
+	NewLC__17CSenSyncRequesterR13MSenTransportR22MSenCoreServiceManager @ 116 NONAME R3UNUSED ; CSenSyncRequester::NewLC(MSenTransport &, MSenCoreServiceManager &)
+	NewLC__30CSenLayeredTransportProperties @ 117 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewLC(void)
+	NewLC__30CSenLayeredTransportPropertiesR11RStringPool @ 118 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewLC(RStringPool &)
+	NewLC__30CSenLayeredTransportPropertiesRC11CSenElement @ 119 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewLC(CSenElement const &)
+	NewLC__30CSenLayeredTransportPropertiesRC11CSenElementR11RStringPool @ 120 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewLC(CSenElement const &, RStringPool &)
+	NewLC__30CSenLayeredTransportPropertiesRC6TDesC8R13CSenXmlReader @ 121 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &)
+	NewLC__30CSenLayeredTransportPropertiesRC6TDesC8R13CSenXmlReaderR11RStringPool @ 122 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &, RStringPool &)
+	NewLC__34CSenLayeredHttpTransportProperties @ 123 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewLC(void)
+	NewLC__34CSenLayeredHttpTransportPropertiesR11RStringPool @ 124 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewLC(RStringPool &)
+	NewLC__34CSenLayeredHttpTransportPropertiesRC11CSenElement @ 125 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewLC(CSenElement const &)
+	NewLC__34CSenLayeredHttpTransportPropertiesRC11CSenElementR11RStringPool @ 126 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewLC(CSenElement const &, RStringPool &)
+	NewLC__34CSenLayeredHttpTransportPropertiesRC6TDesC8R13CSenXmlReader @ 127 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &)
+	NewLC__34CSenLayeredHttpTransportPropertiesRC6TDesC8R13CSenXmlReaderR11RStringPool @ 128 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &, RStringPool &)
+	NewL__17CSenSyncRequesterR13MSenTransportR22MSenCoreServiceManager @ 129 NONAME R3UNUSED ; CSenSyncRequester::NewL(MSenTransport &, MSenCoreServiceManager &)
+	NewL__30CSenLayeredTransportProperties @ 130 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewL(void)
+	NewL__30CSenLayeredTransportPropertiesR11RStringPool @ 131 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewL(RStringPool &)
+	NewL__30CSenLayeredTransportPropertiesRC11CSenElement @ 132 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewL(CSenElement const &)
+	NewL__30CSenLayeredTransportPropertiesRC11CSenElementR11RStringPool @ 133 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewL(CSenElement const &, RStringPool &)
+	NewL__30CSenLayeredTransportPropertiesRC6TDesC8R13CSenXmlReader @ 134 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewL(TDesC8 const &, CSenXmlReader &)
+	NewL__30CSenLayeredTransportPropertiesRC6TDesC8R13CSenXmlReaderR11RStringPool @ 135 NONAME R3UNUSED ; CSenLayeredTransportProperties::NewL(TDesC8 const &, CSenXmlReader &, RStringPool &)
+	NewL__34CSenLayeredHttpTransportProperties @ 136 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewL(void)
+	NewL__34CSenLayeredHttpTransportPropertiesR11RStringPool @ 137 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewL(RStringPool &)
+	NewL__34CSenLayeredHttpTransportPropertiesRC11CSenElement @ 138 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewL(CSenElement const &)
+	NewL__34CSenLayeredHttpTransportPropertiesRC11CSenElementR11RStringPool @ 139 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewL(CSenElement const &, RStringPool &)
+	NewL__34CSenLayeredHttpTransportPropertiesRC6TDesC8R13CSenXmlReader @ 140 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewL(TDesC8 const &, CSenXmlReader &)
+	NewL__34CSenLayeredHttpTransportPropertiesRC6TDesC8R13CSenXmlReaderR11RStringPool @ 141 NONAME R3UNUSED ; CSenLayeredHttpTransportProperties::NewL(TDesC8 const &, CSenXmlReader &, RStringPool &)
+	ProcessHandlerContextL__15CSenHandlerBaseR18MSenHandlerContext @ 142 NONAME R3UNUSED ; CSenHandlerBase::ProcessHandlerContextL(MSenHandlerContext &)
+	PropertiesByTypeL__30CSenLayeredTransportPropertiesRC6TDesC8Rt13RPointerArray1Z12MSenProperty @ 143 NONAME R3UNUSED ; CSenLayeredTransportProperties::PropertiesByTypeL(TDesC8 const &, RPointerArray<MSenProperty> &)
+	PropertiesClassType__30CSenLayeredTransportProperties @ 144 NONAME R3UNUSED ; CSenLayeredTransportProperties::PropertiesClassType(void)
+	PropertyL__30CSenLayeredTransportPropertiesRC6TDesC8R6TPtrC8 @ 145 NONAME R3UNUSED ; CSenLayeredTransportProperties::PropertyL(TDesC8 const &, TPtrC8 &)
+	PropertyL__30CSenLayeredTransportPropertiesRC6TDesC8R6TPtrC8Q221MSenLayeredProperties19TSenPropertiesLayer @ 146 NONAME ; CSenLayeredTransportProperties::PropertyL(TDesC8 const &, TPtrC8 &, MSenLayeredProperties::TSenPropertiesLayer)
+	PropertyL__30CSenLayeredTransportPropertiesRC6TDesC8R6TPtrC8T2 @ 147 NONAME ; CSenLayeredTransportProperties::PropertyL(TDesC8 const &, TPtrC8 &, TPtrC8 &)
+	PropertyL__30CSenLayeredTransportPropertiesRC6TDesC8RP12MSenProperty @ 148 NONAME R3UNUSED ; CSenLayeredTransportProperties::PropertyL(TDesC8 const &, MSenProperty *&)
+	PropertyL__30CSenLayeredTransportPropertiesRC6TDesC8RP12MSenPropertyQ221MSenLayeredProperties19TSenPropertiesLayer @ 149 NONAME ; CSenLayeredTransportProperties::PropertyL(TDesC8 const &, MSenProperty *&, MSenLayeredProperties::TSenPropertiesLayer)
+	ReadFromL__30CSenLayeredTransportPropertiesRC6TDesC8 @ 150 NONAME R3UNUSED ; CSenLayeredTransportProperties::ReadFromL(TDesC8 const &)
+	ReadFromL__30CSenLayeredTransportPropertiesRC6TDesC8Q221MSenLayeredProperties19TSenPropertiesLayer @ 151 NONAME R3UNUSED ; CSenLayeredTransportProperties::ReadFromL(TDesC8 const &, MSenLayeredProperties::TSenPropertiesLayer)
+	SetBoolPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8i @ 152 NONAME R3UNUSED ; CSenLayeredTransportProperties::SetBoolPropertyL(TDesC8 const &, int)
+	SetBoolPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8iQ221MSenLayeredProperties19TSenPropertiesLayer @ 153 NONAME ; CSenLayeredTransportProperties::SetBoolPropertyL(TDesC8 const &, int, MSenLayeredProperties::TSenPropertiesLayer)
+	SetIntPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8i @ 154 NONAME R3UNUSED ; CSenLayeredTransportProperties::SetIntPropertyL(TDesC8 const &, int)
+	SetIntPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8iQ221MSenLayeredProperties19TSenPropertiesLayer @ 155 NONAME ; CSenLayeredTransportProperties::SetIntPropertyL(TDesC8 const &, int, MSenLayeredProperties::TSenPropertiesLayer)
+	SetPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8N21 @ 156 NONAME ; CSenLayeredTransportProperties::SetPropertyL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	SetPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8T1 @ 157 NONAME R3UNUSED ; CSenLayeredTransportProperties::SetPropertyL(TDesC8 const &, TDesC8 const &)
+	SetPropertyL__30CSenLayeredTransportPropertiesRC6TDesC8T1Q221MSenLayeredProperties19TSenPropertiesLayer @ 158 NONAME ; CSenLayeredTransportProperties::SetPropertyL(TDesC8 const &, TDesC8 const &, MSenLayeredProperties::TSenPropertiesLayer)
+	SetReader__30CSenLayeredTransportPropertiesR13CSenXmlReader @ 159 NONAME R3UNUSED ; CSenLayeredTransportProperties::SetReader(CSenXmlReader &)
+	ShrinkTo__30CSenLayeredTransportPropertiesQ221MSenLayeredProperties19TSenPropertiesLayer @ 160 NONAME R3UNUSED ; CSenLayeredTransportProperties::ShrinkTo(MSenLayeredProperties::TSenPropertiesLayer)
+	TopLayer__30CSenLayeredTransportProperties @ 161 NONAME R3UNUSED ; CSenLayeredTransportProperties::TopLayer(void)
+	TransportPropertiesL__18CSenServiceSessionRP6HBufC8R25MSenRemoteServiceConsumer @ 162 NONAME R3UNUSED ; CSenServiceSession::TransportPropertiesL(HBufC8 *&, MSenRemoteServiceConsumer &)
+	WriteAsXMLToL__15CSenHandlerBaseR12RWriteStream @ 163 NONAME R3UNUSED ; CSenHandlerBase::WriteAsXMLToL(RWriteStream &)
+	WriteToL__30CSenLayeredTransportPropertiesR12RWriteStream @ 164 NONAME R3UNUSED ; CSenLayeredTransportProperties::WriteToL(RWriteStream &)
+	WriteToL__30CSenLayeredTransportPropertiesR12RWriteStreamQ221MSenLayeredProperties19TSenPropertiesLayer @ 165 NONAME R3UNUSED ; CSenLayeredTransportProperties::WriteToL(RWriteStream &, MSenLayeredProperties::TSenPropertiesLayer)
+	"_._15CSenHandlerBase" @ 166 NONAME R3UNUSED ; CSenHandlerBase::~CSenHandlerBase(void)
+	"_._17CSenSyncRequester" @ 167 NONAME R3UNUSED ; CSenSyncRequester::~CSenSyncRequester(void)
+	"_._30CSenLayeredTransportProperties" @ 168 NONAME R3UNUSED ; CSenLayeredTransportProperties::~CSenLayeredTransportProperties(void)
+	__15CSenHandlerBase @ 169 NONAME R3UNUSED ; CSenHandlerBase::CSenHandlerBase(void)
+	__17CSenSyncRequesterR13MSenTransportR22MSenCoreServiceManager @ 170 NONAME R3UNUSED ; CSenSyncRequester::CSenSyncRequester(MSenTransport &, MSenCoreServiceManager &)
+	Hostlet__C18CSenServiceSession @ 171 NONAME R3UNUSED ; CSenServiceSession::Hostlet(void) const
+	RemoveConsumerL__18CSenServiceSessionR25MSenRemoteServiceConsumer @ 172 NONAME R3UNUSED ; CSenServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer &)
+	SetHostletL__18CSenServiceSessionP17MSenRemoteHostlet @ 173 NONAME R3UNUSED ; CSenServiceSession::SetHostletL(MSenRemoteHostlet *)
+	ChunkByTxnIdL__27CSenInternalServiceConsumeriRP9CSenChunk @ 174 NONAME R3UNUSED ; CSenInternalServiceConsumer::ChunkByTxnIdL(int, CSenChunk *&)
+	SetTransportL__18CSenServiceSessionP17CSenTransportBase @ 175 NONAME R3UNUSED ; CSenServiceSession::SetTransportL(CSenTransportBase *)
+	TransportL__18CSenServiceSessionR25MSenRemoteServiceConsumer @ 176 NONAME R3UNUSED ; CSenServiceSession::TransportL(MSenRemoteServiceConsumer &)
+	Transport__C18CSenServiceSession @ 177 NONAME R3UNUSED ; CSenServiceSession::Transport(void) const
+	DeviceIDL__30CSenLayeredTransportPropertiesR6TPtrC8 @ 178 NONAME R3UNUSED ; CSenLayeredTransportProperties::DeviceIDL(TPtrC8 &)
+	IapIdL__30CSenLayeredTransportPropertiesRUl @ 179 NONAME R3UNUSED ; CSenLayeredTransportProperties::IapIdL(unsigned long &)
+	ProxyHostL__30CSenLayeredTransportPropertiesR6TPtrC8 @ 180 NONAME R3UNUSED ; CSenLayeredTransportProperties::ProxyHostL(TPtrC8 &)
+	ProxyPortL__30CSenLayeredTransportPropertiesRi @ 181 NONAME R3UNUSED ; CSenLayeredTransportProperties::ProxyPortL(int &)
+	ProxyUsageL__30CSenLayeredTransportPropertiesRi @ 182 NONAME R3UNUSED ; CSenLayeredTransportProperties::ProxyUsageL(int &)
+	UserAgentL__30CSenLayeredTransportPropertiesR6TPtrC8 @ 183 NONAME R3UNUSED ; CSenLayeredTransportProperties::UserAgentL(TPtrC8 &)
+	HasSuperClass__18CSenServiceSessionQ222MSenServiceDescription21TDescriptionClassType @ 184 NONAME R3UNUSED ; CSenServiceSession::HasSuperClass(MSenServiceDescription::TDescriptionClassType)
+	HasSuperClass__21CSenWebServiceSessionQ222MSenServiceDescription21TDescriptionClassType @ 185 NONAME R3UNUSED ; CSenWebServiceSession::HasSuperClass(MSenServiceDescription::TDescriptionClassType)
+	HasSuperClass__27CSenInternalServiceConsumerQ222MSenServiceDescription21TDescriptionClassType @ 186 NONAME R3UNUSED ; CSenInternalServiceConsumer::HasSuperClass(MSenServiceDescription::TDescriptionClassType)
+	BaseConstructL__11CSenContext @ 187 NONAME R3UNUSED ; CSenContext::BaseConstructL(void)
+	BaseConstructL__20CSenTransportContextR22MSenCoreServiceManagerR25CSenXmlServiceDescriptionP18CSenServiceSession @ 188 NONAME ; CSenTransportContext::BaseConstructL(MSenCoreServiceManager &, CSenXmlServiceDescription &, CSenServiceSession *)
+	NewLC__11CSenContextQ210SenContext17TContextDirection @ 189 NONAME R3UNUSED ; CSenContext::NewLC(SenContext::TContextDirection)
+	NewLC__15CSenContextItemP11CSenElement @ 190 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenElement *)
+	NewLC__15CSenContextItemP13CSenXmlReader @ 191 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenXmlReader *)
+	NewLC__15CSenContextItemP17CSenXmlProperties @ 192 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenXmlProperties *)
+	NewLC__15CSenContextItemP24CSenLayeredXmlProperties @ 193 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenLayeredXmlProperties *)
+	NewLC__15CSenContextItemP25CSenXmlServiceDescription @ 194 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenXmlServiceDescription *)
+	NewLC__15CSenContextItemP6TDesC8 @ 195 NONAME R3UNUSED ; CSenContextItem::NewLC(TDesC8 *)
+	NewLC__15CSenContextItemPUi @ 196 NONAME R3UNUSED ; CSenContextItem::NewLC(unsigned int *)
+	NewLC__15CSenContextItemPi @ 197 NONAME R3UNUSED ; CSenContextItem::NewLC(int *)
+	NewLC__15CSenContextItemPv @ 198 NONAME R3UNUSED ; CSenContextItem::NewLC(void *)
+	NewLC__15CSenContextItemR11CSenElement @ 199 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenElement &)
+	NewLC__15CSenContextItemR13CSenXmlReader @ 200 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenXmlReader &)
+	NewLC__15CSenContextItemR14MSenProperties @ 201 NONAME R3UNUSED ; CSenContextItem::NewLC(MSenProperties &)
+	NewLC__15CSenContextItemR17MSenRemoteHostlet @ 202 NONAME R3UNUSED ; CSenContextItem::NewLC(MSenRemoteHostlet &)
+	NewLC__15CSenContextItemR22MSenCoreServiceManager @ 203 NONAME R3UNUSED ; CSenContextItem::NewLC(MSenCoreServiceManager &)
+	NewLC__15CSenContextItemR25CSenXmlServiceDescription @ 204 NONAME R3UNUSED ; CSenContextItem::NewLC(CSenXmlServiceDescription &)
+	NewLC__15CSenContextItemR25MSenRemoteServiceConsumer @ 205 NONAME R3UNUSED ; CSenContextItem::NewLC(MSenRemoteServiceConsumer &)
+	NewLC__15CSenContextItemRC6TDesC8 @ 206 NONAME R3UNUSED ; CSenContextItem::NewLC(TDesC8 const &)
+	NewLC__15CSenContextItemUi @ 207 NONAME R3UNUSED ; CSenContextItem::NewLC(unsigned int)
+	NewLC__15CSenContextItemi @ 208 NONAME R3UNUSED ; CSenContextItem::NewLC(int)
+	NewLC__20CSenTransportContextR22MSenCoreServiceManagerR25CSenXmlServiceDescription @ 209 NONAME R3UNUSED ; CSenTransportContext::NewLC(MSenCoreServiceManager &, CSenXmlServiceDescription &)
+	NewLC__20CSenTransportContextR22MSenCoreServiceManagerR25CSenXmlServiceDescriptionR18CSenServiceSession @ 210 NONAME R3UNUSED ; CSenTransportContext::NewLC(MSenCoreServiceManager &, CSenXmlServiceDescription &, CSenServiceSession &)
+	NewL__11CSenContextQ210SenContext17TContextDirection @ 211 NONAME R3UNUSED ; CSenContext::NewL(SenContext::TContextDirection)
+	NewL__15CSenContextItemP11CSenElement @ 212 NONAME R3UNUSED ; CSenContextItem::NewL(CSenElement *)
+	NewL__15CSenContextItemP13CSenXmlReader @ 213 NONAME R3UNUSED ; CSenContextItem::NewL(CSenXmlReader *)
+	NewL__15CSenContextItemP17CSenXmlProperties @ 214 NONAME R3UNUSED ; CSenContextItem::NewL(CSenXmlProperties *)
+	NewL__15CSenContextItemP24CSenLayeredXmlProperties @ 215 NONAME R3UNUSED ; CSenContextItem::NewL(CSenLayeredXmlProperties *)
+	NewL__15CSenContextItemP25CSenXmlServiceDescription @ 216 NONAME R3UNUSED ; CSenContextItem::NewL(CSenXmlServiceDescription *)
+	NewL__15CSenContextItemP6TDesC8 @ 217 NONAME R3UNUSED ; CSenContextItem::NewL(TDesC8 *)
+	NewL__15CSenContextItemPUi @ 218 NONAME R3UNUSED ; CSenContextItem::NewL(unsigned int *)
+	NewL__15CSenContextItemPi @ 219 NONAME R3UNUSED ; CSenContextItem::NewL(int *)
+	NewL__15CSenContextItemPv @ 220 NONAME R3UNUSED ; CSenContextItem::NewL(void *)
+	NewL__15CSenContextItemR11CSenElement @ 221 NONAME R3UNUSED ; CSenContextItem::NewL(CSenElement &)
+	NewL__15CSenContextItemR13CSenXmlReader @ 222 NONAME R3UNUSED ; CSenContextItem::NewL(CSenXmlReader &)
+	NewL__15CSenContextItemR14MSenProperties @ 223 NONAME R3UNUSED ; CSenContextItem::NewL(MSenProperties &)
+	NewL__15CSenContextItemR17MSenRemoteHostlet @ 224 NONAME R3UNUSED ; CSenContextItem::NewL(MSenRemoteHostlet &)
+	NewL__15CSenContextItemR22MSenCoreServiceManager @ 225 NONAME R3UNUSED ; CSenContextItem::NewL(MSenCoreServiceManager &)
+	NewL__15CSenContextItemR25CSenXmlServiceDescription @ 226 NONAME R3UNUSED ; CSenContextItem::NewL(CSenXmlServiceDescription &)
+	NewL__15CSenContextItemR25MSenRemoteServiceConsumer @ 227 NONAME R3UNUSED ; CSenContextItem::NewL(MSenRemoteServiceConsumer &)
+	NewL__15CSenContextItemRC6TDesC8 @ 228 NONAME R3UNUSED ; CSenContextItem::NewL(TDesC8 const &)
+	NewL__15CSenContextItemUi @ 229 NONAME R3UNUSED ; CSenContextItem::NewL(unsigned int)
+	NewL__15CSenContextItemi @ 230 NONAME R3UNUSED ; CSenContextItem::NewL(int)
+	NewL__20CSenTransportContextR22MSenCoreServiceManagerR25CSenXmlServiceDescription @ 231 NONAME R3UNUSED ; CSenTransportContext::NewL(MSenCoreServiceManager &, CSenXmlServiceDescription &)
+	NewL__20CSenTransportContextR22MSenCoreServiceManagerR25CSenXmlServiceDescriptionR18CSenServiceSession @ 232 NONAME R3UNUSED ; CSenTransportContext::NewL(MSenCoreServiceManager &, CSenXmlServiceDescription &, CSenServiceSession &)
+	"_._11CSenContext" @ 233 NONAME R3UNUSED ; CSenContext::~CSenContext(void)
+	"_._15CSenContextItem" @ 234 NONAME R3UNUSED ; CSenContextItem::~CSenContextItem(void)
+	"_._20CSenTransportContext" @ 235 NONAME R3UNUSED ; CSenTransportContext::~CSenTransportContext(void)
+	__11CSenContextQ210SenContext17TContextDirection @ 236 NONAME R3UNUSED ; CSenContext::CSenContext(SenContext::TContextDirection)
+	__20CSenTransportContext @ 237 NONAME R3UNUSED ; CSenTransportContext::CSenTransportContext(void)
+	ActionL__30CSenLayeredTransportPropertiesR6TPtrC8 @ 238 NONAME R3UNUSED ; CSenLayeredTransportProperties::ActionL(TPtrC8 &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/BWINS/SENFRAMEWORKU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,241 @@
+EXPORTS
+	??0CSaslMechanism@@IAE@XZ @ 1 NONAME ; protected: __thiscall CSaslMechanism::CSaslMechanism(void)
+	??0CSenInternalServiceConsumer@@IAE@W4TDescriptionClassType@MSenServiceDescription@@AAVCSIF@@@Z @ 2 NONAME ; protected: __thiscall CSenInternalServiceConsumer::CSenInternalServiceConsumer(enum MSenServiceDescription::TDescriptionClassType,class CSIF &)
+	??0CSenServiceSession@@IAE@W4TDescriptionClassType@MSenServiceDescription@@AAVMSIF@@@Z @ 3 NONAME ; protected: __thiscall CSenServiceSession::CSenServiceSession(enum MSenServiceDescription::TDescriptionClassType,class MSIF &)
+	??0CSenWebServiceSession@@IAE@W4TDescriptionClassType@MSenServiceDescription@@AAVMSIF@@@Z @ 4 NONAME ; protected: __thiscall CSenWebServiceSession::CSenWebServiceSession(enum MSenServiceDescription::TDescriptionClassType,class MSIF &)
+	??1CSaslMechanism@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CSaslMechanism::~CSaslMechanism(void)
+	??1CSenInternalServiceConsumer@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CSenInternalServiceConsumer::~CSenInternalServiceConsumer(void)
+	??1CSenServiceSession@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CSenServiceSession::~CSenServiceSession(void)
+	??1CSenWebServiceSession@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CSenWebServiceSession::~CSenWebServiceSession(void)
+	?Account@CSaslMechanism@@UAEAAVCSenIdentityProvider@@XZ @ 9 NONAME ; public: virtual class CSenIdentityProvider & __thiscall CSaslMechanism::Account(void)
+	?AddConsumerL@CSenWebServiceSession@@UAEHAAVMSenRemoteServiceConsumer@@@Z @ 10 NONAME ; public: virtual int __thiscall CSenWebServiceSession::AddConsumerL(class MSenRemoteServiceConsumer &)
+	?AddCredentialL@CSenWebServiceSession@@UAEHAAVCSenCredential@@@Z @ 11 NONAME ; public: virtual int __thiscall CSenWebServiceSession::AddCredentialL(class CSenCredential &)
+	?AddFacetL@CSenServiceSession@@UAEHABVCSenFacet@@@Z @ 12 NONAME ; public: virtual int __thiscall CSenServiceSession::AddFacetL(class CSenFacet const &)
+	?AsServiceDescription@CSenServiceSession@@UAEAAVMSenServiceDescription@@XZ @ 13 NONAME ; public: virtual class MSenServiceDescription & __thiscall CSenServiceSession::AsServiceDescription(void)
+	?BaseConstructL@CSenServiceSession@@IAEXXZ @ 14 NONAME ; protected: void __thiscall CSenServiceSession::BaseConstructL(void)
+	?ClearPasswordL@CSaslMechanism@@UAEXXZ @ 15 NONAME ; public: virtual void __thiscall CSaslMechanism::ClearPasswordL(void)
+	?ClientServerInterval@CSenWebServiceSession@@UAE?AVTTimeIntervalMicroSeconds@@XZ @ 16 NONAME ; public: virtual class TTimeIntervalMicroSeconds __thiscall CSenWebServiceSession::ClientServerInterval(void)
+	?CompleteServerMessagesOnOffL@CSenServiceSession@@UAEHABH@Z @ 17 NONAME ; public: virtual int __thiscall CSenServiceSession::CompleteServerMessagesOnOffL(int const &)
+	?ComputeStatusL@CSenServiceSession@@UAEHXZ @ 18 NONAME ; public: virtual int __thiscall CSenServiceSession::ComputeStatusL(void)
+	?ComputeStatusL@CSenWebServiceSession@@UAEHXZ @ 19 NONAME ; public: virtual int __thiscall CSenWebServiceSession::ComputeStatusL(void)
+	?ConstructL@CSenInternalServiceConsumer@@IAEXXZ @ 20 NONAME ; protected: void __thiscall CSenInternalServiceConsumer::ConstructL(void)
+	?ConstructL@CSenWebServiceSession@@IAEXXZ @ 21 NONAME ; protected: void __thiscall CSenWebServiceSession::ConstructL(void)
+	?ConstructSecurityTokenL@CSenWebServiceSession@@UAEHAAVCSenCredential@@AAPAVHBufC8@@@Z @ 22 NONAME ; public: virtual int __thiscall CSenWebServiceSession::ConstructSecurityTokenL(class CSenCredential &,class HBufC8 * &)
+	?Contract@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 23 NONAME ; public: virtual class TPtrC8 __thiscall CSenServiceSession::Contract(void)
+	?Contract@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 24 NONAME ; public: virtual class TPtrC8 __thiscall CSenWebServiceSession::Contract(void)
+	?Endpoint@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 25 NONAME ; public: virtual class TPtrC8 __thiscall CSenServiceSession::Endpoint(void)
+	?Endpoint@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 26 NONAME ; public: virtual class TPtrC8 __thiscall CSenWebServiceSession::Endpoint(void)
+	?FacetValue@CSenServiceSession@@UAEHAAVTDesC8@@AAPAVHBufC8@@@Z @ 27 NONAME ; public: virtual int __thiscall CSenServiceSession::FacetValue(class TDesC8 &,class HBufC8 * &)
+	?FacetsL@CSenServiceSession@@UAEHAAV?$RPointerArray@VCSenFacet@@@@@Z @ 28 NONAME ; public: virtual int __thiscall CSenServiceSession::FacetsL(class RPointerArray<class CSenFacet> &)
+	?Framework@CSenInternalServiceConsumer@@IAEAAVCSIF@@XZ @ 29 NONAME ; protected: class CSIF & __thiscall CSenInternalServiceConsumer::Framework(void)
+	?FrameworkId@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 30 NONAME ; public: virtual class TPtrC8 __thiscall CSenWebServiceSession::FrameworkId(void)
+	?FrameworkVersion@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 31 NONAME ; public: virtual class TPtrC8 __thiscall CSenWebServiceSession::FrameworkVersion(void)
+	?Consumer@CSenWebServiceSession@@UAEPAVMSenRemoteServiceConsumer@@XZ @ 32 NONAME ; public: virtual class MSenRemoteServiceConsumer * __thiscall CSenWebServiceSession::Consumer(void)
+	?Consumers@CSenWebServiceSession@@UBEHAAV?$RPointerArray@VMSenRemoteServiceConsumer@@@@@Z @ 33 NONAME ; public: virtual int __thiscall CSenWebServiceSession::Consumers(class RPointerArray<class MSenRemoteServiceConsumer> &)const 
+	?HandleErrorL@CSenInternalServiceConsumer@@UAEHABVTDesC8@@HH0@Z @ 34 NONAME ; public: virtual int __thiscall CSenInternalServiceConsumer::HandleErrorL(class TDesC8 const &,int,int,class TDesC8 const &)
+	?HandleSoapFaultL@CSenWebServiceSession@@UAEHAAVCSenSoapMessage@@HHAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 35 NONAME ; public: virtual int __thiscall CSenWebServiceSession::HandleSoapFaultL(class CSenSoapMessage &,int,int,class MSenRemoteServiceConsumer &,class MSenProperties *)
+	?HandleSoapFaultL@CSenWebServiceSession@@UAEHAAVCSenSoapMessage@@AAPAVHBufC8@@@Z @ 36 NONAME ; public: virtual int __thiscall CSenWebServiceSession::HandleSoapFaultL(class CSenSoapMessage &,class HBufC8 * &)
+	?SendErrorToConsumerL@CSenWebServiceSession@@UAEHHABVTDesC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 37 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SendErrorToConsumerL(int,class TDesC8 const &,int,class MSenRemoteServiceConsumer &,class MSenProperties *)
+	?HandleMessageL@CSenInternalServiceConsumer@@UAEHABVTDesC8@@H0@Z @ 38 NONAME ; public: virtual int __thiscall CSenInternalServiceConsumer::HandleMessageL(class TDesC8 const &,int,class TDesC8 const &)
+	?SendToConsumerL@CSenWebServiceSession@@UAEHABVTDesC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 39 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SendToConsumerL(class TDesC8 const &,int,class MSenRemoteServiceConsumer &,class MSenProperties *)
+	?HasConsumer@CSenWebServiceSession@@QBEHXZ @ 40 NONAME ; public: int __thiscall CSenWebServiceSession::HasConsumer(void)const 
+	?HasFacetL@CSenServiceSession@@UAEHABVTDesC8@@AAH@Z @ 41 NONAME ; public: virtual int __thiscall CSenServiceSession::HasFacetL(class TDesC8 const &,int &)
+	?Id@CSenInternalServiceConsumer@@UBEABVTDesC8@@XZ @ 42 NONAME ; public: virtual class TDesC8 const & __thiscall CSenInternalServiceConsumer::Id(void)const 
+	?InitFrom@CSaslMechanism@@UAEXV1@@Z @ 43 NONAME ; public: virtual void __thiscall CSaslMechanism::InitFrom(class CSaslMechanism)
+	?InitializeFromL@CSenServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 44 NONAME ; public: virtual int __thiscall CSenServiceSession::InitializeFromL(class MSenServiceDescription &)
+	?InitializeFromL@CSenWebServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 45 NONAME ; public: virtual int __thiscall CSenWebServiceSession::InitializeFromL(class MSenServiceDescription &)
+	?IsExpiredL@CSenWebServiceSession@@UAEHXZ @ 46 NONAME ; public: virtual int __thiscall CSenWebServiceSession::IsExpiredL(void)
+	?IsPasswordFromUser@CSaslMechanism@@UAEHXZ @ 47 NONAME ; public: virtual int __thiscall CSaslMechanism::IsPasswordFromUser(void)
+	?IsReadyL@CSenInternalServiceConsumer@@UAEHXZ @ 48 NONAME ; public: virtual int __thiscall CSenInternalServiceConsumer::IsReadyL(void)
+	?IsReadyL@CSenServiceSession@@UAEHXZ @ 49 NONAME ; public: virtual int __thiscall CSenServiceSession::IsReadyL(void)
+	?IsReadyL@CSenWebServiceSession@@UAEHXZ @ 50 NONAME ; public: virtual int __thiscall CSenWebServiceSession::IsReadyL(void)
+	?Log@CSenInternalServiceConsumer@@QBEPAVRFileLogger@@XZ @ 51 NONAME ; public: class RFileLogger * __thiscall CSenInternalServiceConsumer::Log(void)const 
+	?Log@CSenServiceSession@@IBEPAVRFileLogger@@XZ @ 52 NONAME ; protected: class RFileLogger * __thiscall CSenServiceSession::Log(void)const 
+	?Matches@CSenServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 53 NONAME ; public: virtual int __thiscall CSenServiceSession::Matches(class MSenServiceDescription &)
+	?MaxAttempts@CSaslMechanism@@UAEHXZ @ 54 NONAME ; public: virtual int __thiscall CSaslMechanism::MaxAttempts(void)
+	?MessageForSendingL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAPAVCSenSoapMessage@@@Z @ 55 NONAME ; public: virtual int __thiscall CSenWebServiceSession::MessageForSendingL(class TDesC8 const &,class TDesC8 const &,class CSenSoapMessage * &)
+	?NewL@CSaslMechanism@@SAPAV1@XZ @ 56 NONAME ; public: static class CSaslMechanism * __cdecl CSaslMechanism::NewL(void)
+	?NewLC@CSaslMechanism@@SAPAV1@XZ @ 57 NONAME ; public: static class CSaslMechanism * __cdecl CSaslMechanism::NewLC(void)
+	?NewMessageL@CSenWebServiceSession@@UAEHAAPAVCSenSoapMessage@@@Z @ 58 NONAME ; public: virtual int __thiscall CSenWebServiceSession::NewMessageL(class CSenSoapMessage * &)
+	?ParseMessageL@CSenWebServiceSession@@UAEHAAVCSenSoapMessage@@@Z @ 59 NONAME ; public: virtual int __thiscall CSenWebServiceSession::ParseMessageL(class CSenSoapMessage &)
+	?ParseResponseL@CSenServiceSession@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 60 NONAME ; public: virtual int __thiscall CSenServiceSession::ParseResponseL(class TDesC8 const &,class HBufC8 * &)
+	?ParseResponseL@CSenWebServiceSession@@UAEHABVTDesC8@@AAPAVCSenSoapMessage@@@Z @ 61 NONAME ; public: virtual int __thiscall CSenWebServiceSession::ParseResponseL(class TDesC8 const &,class CSenSoapMessage * &)
+	?ParseResponseL@CSenWebServiceSession@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 62 NONAME ; public: virtual int __thiscall CSenWebServiceSession::ParseResponseL(class TDesC8 const &,class HBufC8 * &)
+	?Password8L@CSaslMechanism@@UAEPAVHBufC8@@XZ @ 63 NONAME ; public: virtual class HBufC8 * __thiscall CSaslMechanism::Password8L(void)
+	?Identifier@CSenInternalServiceConsumer@@UBEAAVCSenIdentifier@@XZ @ 64 NONAME ; public: virtual class CSenIdentifier & __thiscall CSenInternalServiceConsumer::Identifier(void)const 
+	?RemoteConsumerL@CSenServiceSession@@UAEPAVMSenRemoteServiceConsumer@@ABVTDesC8@@@Z @ 65 NONAME ; public: virtual class MSenRemoteServiceConsumer * __thiscall CSenServiceSession::RemoteConsumerL(class TDesC8 const &)
+	?RemoveFacet@CSenServiceSession@@UAEHABVTDesC8@@@Z @ 66 NONAME ; public: virtual int __thiscall CSenServiceSession::RemoveFacet(class TDesC8 const &)
+	?SaveL@CSenServiceSession@@UAEXXZ @ 67 NONAME ; public: virtual void __thiscall CSenServiceSession::SaveL(void)
+	?ScoreMatchL@CSenServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 68 NONAME ; public: virtual int __thiscall CSenServiceSession::ScoreMatchL(class MSenServiceDescription &)
+	?SendL@CSenServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAH@Z @ 69 NONAME ; public: virtual int __thiscall CSenServiceSession::SendL(class TDesC8 const &,class TDesC8 const &,class MSenRemoteServiceConsumer &,int &)
+	?SendL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAH@Z @ 70 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SendL(class TDesC8 const &,class TDesC8 const &,class MSenRemoteServiceConsumer &,int &)
+	?SendMessageToConsumerL@CSenWebServiceSession@@UAEHAAVCSenSoapMessage@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 71 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SendMessageToConsumerL(class CSenSoapMessage &,int,class MSenRemoteServiceConsumer &,class MSenProperties *)
+	?SendSoapL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAH@Z @ 72 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SendSoapL(class TDesC8 const &,class TDesC8 const &,class MSenRemoteServiceConsumer &,int &)
+	?SetClientServerInterval@CSenWebServiceSession@@UAEXVTTimeIntervalMicroSeconds@@@Z @ 73 NONAME ; public: virtual void __thiscall CSenWebServiceSession::SetClientServerInterval(class TTimeIntervalMicroSeconds)
+	?SetContractL@CSenWebServiceSession@@UAEXABVTDesC8@@@Z @ 74 NONAME ; public: virtual void __thiscall CSenWebServiceSession::SetContractL(class TDesC8 const &)
+	?SetEndPointL@CSenWebServiceSession@@UAEXABVTDesC8@@@Z @ 75 NONAME ; public: virtual void __thiscall CSenWebServiceSession::SetEndPointL(class TDesC8 const &)
+	?SetFacetL@CSenServiceSession@@UAEHABVCSenFacet@@@Z @ 76 NONAME ; public: virtual int __thiscall CSenServiceSession::SetFacetL(class CSenFacet const &)
+	?SetFrameworkHeadersL@CSenWebServiceSession@@UAEXAAVCSenSoapMessage@@@Z @ 77 NONAME ; public: virtual void __thiscall CSenWebServiceSession::SetFrameworkHeadersL(class CSenSoapMessage &)
+	?SetIdentity@CSaslMechanism@@UAEXPAVCSenIdentityProvider@@PAVMSenIdentityManager@@@Z @ 78 NONAME ; public: virtual void __thiscall CSaslMechanism::SetIdentity(class CSenIdentityProvider *,class MSenIdentityManager *)
+	?SetSecurityL@CSenWebServiceSession@@UAEXABVTDesC8@@@Z @ 79 NONAME ; public: virtual void __thiscall CSenWebServiceSession::SetSecurityL(class TDesC8 const &)
+	?SetSessionL@CSenInternalServiceConsumer@@UAEHAAVMSenRemoteServiceSession@@@Z @ 80 NONAME ; public: virtual int __thiscall CSenInternalServiceConsumer::SetSessionL(class MSenRemoteServiceSession &)
+	?SetStatusL@CSenServiceSession@@UAEHXZ @ 81 NONAME ; public: virtual int __thiscall CSenServiceSession::SetStatusL(void)
+    ?HandleErrorL@CSenWebServiceSession@@UAEHHABVTDesC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 82 NONAME ; public: virtual int __thiscall CSenWebServiceSession::HandleErrorL(int,class TDesC8 const &,int,class MSenRemoteServiceConsumer &,class MSenProperties *)
+	?SetStatusL@CSenInternalServiceConsumer@@UAEXH@Z @ 83 NONAME ; public: virtual void __thiscall CSenInternalServiceConsumer::SetStatusL(int)
+	?SetTransforms@CSaslMechanism@@UAEXV?$RPointerArray@VCSenPasswordTransform@@@@@Z @ 84 NONAME ; public: virtual void __thiscall CSaslMechanism::SetTransforms(class RPointerArray<class CSenPasswordTransform>)
+	?SetUserNameL@CSenWebServiceSession@@UAEHAAVTDesC8@@@Z @ 85 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SetUserNameL(class TDesC8 &)
+	?StartTransaction@CSenWebServiceSession@@UAEXXZ @ 86 NONAME ; public: virtual void __thiscall CSenWebServiceSession::StartTransaction(void)
+	?StatusL@CSenServiceSession@@UAEHXZ @ 87 NONAME ; public: virtual int __thiscall CSenServiceSession::StatusL(void)
+	?SubmitL@CSenServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAPAVHBufC8@@@Z @ 88 NONAME ; public: virtual int __thiscall CSenServiceSession::SubmitL(class TDesC8 const &,class TDesC8 const &,class MSenRemoteServiceConsumer &,class HBufC8 * &)
+	?SubmitL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAPAVHBufC8@@@Z @ 89 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SubmitL(class TDesC8 const &,class TDesC8 const &,class MSenRemoteServiceConsumer &,class HBufC8 * &)
+	?SubmitSoapL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAPAVHBufC8@@@Z @ 90 NONAME ; public: virtual int __thiscall CSenWebServiceSession::SubmitSoapL(class TDesC8 const &,class TDesC8 const &,class MSenRemoteServiceConsumer &,class HBufC8 * &)
+	?TransactionCompleted@CSenWebServiceSession@@UAEXXZ @ 91 NONAME ; public: virtual void __thiscall CSenWebServiceSession::TransactionCompleted(void)
+	?TransformL@CSaslMechanism@@UBEPAVHBufC8@@VTPtrC8@@@Z @ 92 NONAME ; public: virtual class HBufC8 * __thiscall CSaslMechanism::TransformL(class TPtrC8)const 
+	?ValidUntilL@CSenWebServiceSession@@UAEABVTTime@@XZ @ 93 NONAME ; public: virtual class TTime const & __thiscall CSenWebServiceSession::ValidUntilL(void)
+	?WriteAsXMLToL@CSenWebServiceSession@@UAEXAAVRWriteStream@@@Z @ 94 NONAME ; public: virtual void __thiscall CSenWebServiceSession::WriteAsXMLToL(class RWriteStream &)
+	?WriteExtensionsAsXMLToL@CSenServiceSession@@UAEXAAVRWriteStream@@@Z @ 95 NONAME ; public: virtual void __thiscall CSenServiceSession::WriteExtensionsAsXMLToL(class RWriteStream &)
+	?XmlReader@CSenWebServiceSession@@UAEPAVCSenXmlReader@@XZ @ 96 NONAME ; public: virtual class CSenXmlReader * __thiscall CSenWebServiceSession::XmlReader(void)
+	?SetTransportPropertiesL@CSenServiceSession@@UAEHABVTDesC8@@AAVMSenRemoteServiceConsumer@@@Z @ 97 NONAME ; public: virtual int __thiscall CSenServiceSession::SetTransportPropertiesL(class TDesC8 const &,class MSenRemoteServiceConsumer &)
+	?DescriptionClassType@CSenServiceSession@@UAE?AW4TDescriptionClassType@MSenServiceDescription@@XZ @ 98 NONAME ; public: virtual enum MSenServiceDescription::TDescriptionClassType __thiscall CSenServiceSession::DescriptionClassType(void)
+	?FrameworkId@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 99 NONAME ; public: virtual class TPtrC8 __thiscall CSenServiceSession::FrameworkId(void)
+	??0CSenHandlerBase@@IAE@XZ @ 100 NONAME ; protected: __thiscall CSenHandlerBase::CSenHandlerBase(void)
+	??0CSenLayeredTransportProperties@@IAE@XZ @ 101 NONAME ; protected: __thiscall CSenLayeredTransportProperties::CSenLayeredTransportProperties(void)
+	??0CSenSyncRequester@@IAE@AAVMSenTransport@@AAVMSenCoreServiceManager@@@Z @ 102 NONAME ; protected: __thiscall CSenSyncRequester::CSenSyncRequester(class MSenTransport &,class MSenCoreServiceManager &)
+	??1CSenHandlerBase@@UAE@XZ @ 103 NONAME ; public: virtual __thiscall CSenHandlerBase::~CSenHandlerBase(void)
+	??1CSenLayeredTransportProperties@@UAE@XZ @ 104 NONAME ; public: virtual __thiscall CSenLayeredTransportProperties::~CSenLayeredTransportProperties(void)
+	??1CSenSyncRequester@@UAE@XZ @ 105 NONAME ; public: virtual __thiscall CSenSyncRequester::~CSenSyncRequester(void)
+	?AsUtf8L@CSenLayeredTransportProperties@@UAEPAVHBufC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 106 NONAME ; public: virtual class HBufC8 * __thiscall CSenLayeredTransportProperties::AsUtf8L(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?AsUtf8L@CSenLayeredTransportProperties@@UAEPAVHBufC8@@XZ @ 107 NONAME ; public: virtual class HBufC8 * __thiscall CSenLayeredTransportProperties::AsUtf8L(void)
+	?AsUtf8LC@CSenLayeredTransportProperties@@UAEPAVHBufC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 108 NONAME ; public: virtual class HBufC8 * __thiscall CSenLayeredTransportProperties::AsUtf8LC(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?AsUtf8LC@CSenLayeredTransportProperties@@UAEPAVHBufC8@@XZ @ 109 NONAME ; public: virtual class HBufC8 * __thiscall CSenLayeredTransportProperties::AsUtf8LC(void)
+	?AsXmlL@CSenHandlerBase@@UAEPAVHBufC8@@XZ @ 110 NONAME ; public: virtual class HBufC8 * __thiscall CSenHandlerBase::AsXmlL(void)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVCSenElement@@PAVRStringPool@@@Z @ 111 NONAME ; protected: virtual void __thiscall CSenLayeredTransportProperties::BaseConstructL(class CSenElement const &,class RStringPool *)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVTDesC8@@000PAVCSenXmlReader@@PAVRStringPool@@@Z @ 112 NONAME ; protected: virtual void __thiscall CSenLayeredTransportProperties::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class CSenXmlReader *,class RStringPool *)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVTDesC8@@00PAVCSenXmlReader@@PAVRStringPool@@@Z @ 113 NONAME ; protected: virtual void __thiscall CSenLayeredTransportProperties::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class CSenXmlReader *,class RStringPool *)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVTDesC8@@0PAVCSenXmlReader@@PAVRStringPool@@@Z @ 114 NONAME ; protected: virtual void __thiscall CSenLayeredTransportProperties::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class CSenXmlReader *,class RStringPool *)
+	?BaseConstructL@CSenSyncRequester@@IAEXXZ @ 115 NONAME ; protected: void __thiscall CSenSyncRequester::BaseConstructL(void)
+	?BoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 116 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::BoolPropertyL(class TDesC8 const &,int &)
+	?BoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAHW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 117 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::BoolPropertyL(class TDesC8 const &,int &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?ExpandToL@CSenLayeredTransportProperties@@UAEXW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 118 NONAME ; public: virtual void __thiscall CSenLayeredTransportProperties::ExpandToL(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?IntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 119 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::IntPropertyL(class TDesC8 const &,int &)
+	?IntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAHW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 120 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::IntPropertyL(class TDesC8 const &,int &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 121 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewL(class RStringPool &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 122 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 123 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewL(class CSenElement const &,class RStringPool &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 124 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 125 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &,class RStringPool &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@XZ @ 126 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewL(void)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 127 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewL(class RStringPool &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 128 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 129 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewL(class CSenElement const &,class RStringPool &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 130 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 131 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &,class RStringPool &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@XZ @ 132 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewL(void)
+	?NewL@CSenSyncRequester@@SAPAV1@AAVMSenTransport@@AAVMSenCoreServiceManager@@@Z @ 133 NONAME ; public: static class CSenSyncRequester * __cdecl CSenSyncRequester::NewL(class MSenTransport &,class MSenCoreServiceManager &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 134 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewLC(class RStringPool &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 135 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 136 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewLC(class CSenElement const &,class RStringPool &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 137 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 138 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &,class RStringPool &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@XZ @ 139 NONAME ; public: static class CSenLayeredHttpTransportProperties * __cdecl CSenLayeredHttpTransportProperties::NewLC(void)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 140 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewLC(class RStringPool &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 141 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 142 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewLC(class CSenElement const &,class RStringPool &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 143 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 144 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &,class RStringPool &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@XZ @ 145 NONAME ; public: static class CSenLayeredTransportProperties * __cdecl CSenLayeredTransportProperties::NewLC(void)
+	?NewLC@CSenSyncRequester@@SAPAV1@AAVMSenTransport@@AAVMSenCoreServiceManager@@@Z @ 146 NONAME ; public: static class CSenSyncRequester * __cdecl CSenSyncRequester::NewLC(class MSenTransport &,class MSenCoreServiceManager &)
+	?ProcessHandlerContextL@CSenHandlerBase@@MAEXAAVMSenHandlerContext@@@Z @ 147 NONAME ; protected: virtual void __thiscall CSenHandlerBase::ProcessHandlerContextL(class MSenHandlerContext &)
+	?PropertiesByTypeL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAV?$RPointerArray@VMSenProperty@@@@@Z @ 148 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::PropertiesByTypeL(class TDesC8 const &,class RPointerArray<class MSenProperty> &)
+	?PropertiesClassType@CSenLayeredTransportProperties@@UAE?AW4TSenPropertiesClassType@MSenProperties@@XZ @ 149 NONAME ; public: virtual enum MSenProperties::TSenPropertiesClassType __thiscall CSenLayeredTransportProperties::PropertiesClassType(void)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAPAVMSenProperty@@@Z @ 150 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::PropertyL(class TDesC8 const &,class MSenProperty * &)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAPAVMSenProperty@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 151 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::PropertyL(class TDesC8 const &,class MSenProperty * &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@1@Z @ 152 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::PropertyL(class TDesC8 const &,class TPtrC8 &,class TPtrC8 &)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@@Z @ 153 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::PropertyL(class TDesC8 const &,class TPtrC8 &)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 154 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::PropertyL(class TDesC8 const &,class TPtrC8 &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?ReadFromL@CSenLayeredTransportProperties@@UAEXABVTDesC8@@@Z @ 155 NONAME ; public: virtual void __thiscall CSenLayeredTransportProperties::ReadFromL(class TDesC8 const &)
+	?ReadFromL@CSenLayeredTransportProperties@@UAEXABVTDesC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 156 NONAME ; public: virtual void __thiscall CSenLayeredTransportProperties::ReadFromL(class TDesC8 const &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetBoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@H@Z @ 157 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetBoolPropertyL(class TDesC8 const &,int)
+	?SetBoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@HW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 158 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetBoolPropertyL(class TDesC8 const &,int,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetIntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@H@Z @ 159 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetIntPropertyL(class TDesC8 const &,int)
+	?SetIntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@HW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 160 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetIntPropertyL(class TDesC8 const &,int,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@00@Z @ 161 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetPropertyL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?SetPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@0@Z @ 162 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetPropertyL(class TDesC8 const &,class TDesC8 const &)
+	?SetPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@0W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 163 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::SetPropertyL(class TDesC8 const &,class TDesC8 const &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetReader@CSenLayeredTransportProperties@@UAEXAAVCSenXmlReader@@@Z @ 164 NONAME ; public: virtual void __thiscall CSenLayeredTransportProperties::SetReader(class CSenXmlReader &)
+	?ShrinkTo@CSenLayeredTransportProperties@@UAEHW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 165 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::ShrinkTo(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?TopLayer@CSenLayeredTransportProperties@@UAE?AW4TSenPropertiesLayer@MSenLayeredProperties@@XZ @ 166 NONAME ; public: virtual enum MSenLayeredProperties::TSenPropertiesLayer __thiscall CSenLayeredTransportProperties::TopLayer(void)
+	?TransportPropertiesL@CSenServiceSession@@UAEHAAPAVHBufC8@@AAVMSenRemoteServiceConsumer@@@Z @ 167 NONAME ; public: virtual int __thiscall CSenServiceSession::TransportPropertiesL(class HBufC8 * &,class MSenRemoteServiceConsumer &)
+	?WriteAsXMLToL@CSenHandlerBase@@UAEXAAVRWriteStream@@@Z @ 168 NONAME ; public: virtual void __thiscall CSenHandlerBase::WriteAsXMLToL(class RWriteStream &)
+	?WriteToL@CSenLayeredTransportProperties@@UAEXAAVRWriteStream@@@Z @ 169 NONAME ; public: virtual void __thiscall CSenLayeredTransportProperties::WriteToL(class RWriteStream &)
+	?WriteToL@CSenLayeredTransportProperties@@UAEXAAVRWriteStream@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 170 NONAME ; public: virtual void __thiscall CSenLayeredTransportProperties::WriteToL(class RWriteStream &,enum MSenLayeredProperties::TSenPropertiesLayer)
+	?Hostlet@CSenServiceSession@@UBEPAVMSenRemoteHostlet@@XZ @ 171 NONAME ; public: virtual class MSenRemoteHostlet * __thiscall CSenServiceSession::Hostlet(void)const 
+	?RemoveConsumerL@CSenServiceSession@@UAEHAAVMSenRemoteServiceConsumer@@@Z @ 172 NONAME ; public: virtual int __thiscall CSenServiceSession::RemoveConsumerL(class MSenRemoteServiceConsumer &)
+	?SetHostletL@CSenServiceSession@@UAEHPAVMSenRemoteHostlet@@@Z @ 173 NONAME ; public: virtual int __thiscall CSenServiceSession::SetHostletL(class MSenRemoteHostlet *)
+	?ChunkByTxnIdL@CSenInternalServiceConsumer@@UAEHHAAPAVCSenChunk@@@Z @ 174 NONAME ; public: virtual int __thiscall CSenInternalServiceConsumer::ChunkByTxnIdL(int,class CSenChunk * &)
+	?SetTransportL@CSenServiceSession@@UAEXPAVCSenTransportBase@@@Z @ 175 NONAME ; public: virtual void __thiscall CSenServiceSession::SetTransportL(class CSenTransportBase *)
+	?Transport@CSenServiceSession@@UBEPAVMSenTransport@@XZ @ 176 NONAME ; public: virtual class MSenTransport * __thiscall CSenServiceSession::Transport(void)const 
+	?TransportL@CSenServiceSession@@UAEAAVMSenTransport@@AAVMSenRemoteServiceConsumer@@@Z @ 177 NONAME ; public: virtual class MSenTransport & __thiscall CSenServiceSession::TransportL(class MSenRemoteServiceConsumer &)
+	?DeviceIDL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 178 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::DeviceIDL(class TPtrC8 &)
+	?IapIdL@CSenLayeredTransportProperties@@UAEHAAK@Z @ 179 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::IapIdL(unsigned long &)
+	?ProxyHostL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 180 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::ProxyHostL(class TPtrC8 &)
+	?ProxyPortL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 181 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::ProxyPortL(int &)
+	?ProxyUsageL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 182 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::ProxyUsageL(int &)
+	?UserAgentL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 183 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::UserAgentL(class TPtrC8 &)
+	??0CSenContext@@IAE@W4TContextDirection@SenContext@@@Z @ 184 NONAME ; protected: __thiscall CSenContext::CSenContext(enum SenContext::TContextDirection)
+	??0CSenTransportContext@@IAE@XZ @ 185 NONAME ; protected: __thiscall CSenTransportContext::CSenTransportContext(void)
+	??1CSenContext@@UAE@XZ @ 186 NONAME ; public: virtual __thiscall CSenContext::~CSenContext(void)
+	??1CSenContextItem@@UAE@XZ @ 187 NONAME ; public: virtual __thiscall CSenContextItem::~CSenContextItem(void)
+	??1CSenTransportContext@@UAE@XZ @ 188 NONAME ; public: virtual __thiscall CSenTransportContext::~CSenTransportContext(void)
+	?BaseConstructL@CSenContext@@IAEXXZ @ 189 NONAME ; protected: void __thiscall CSenContext::BaseConstructL(void)
+	?BaseConstructL@CSenTransportContext@@IAEXAAVMSenCoreServiceManager@@AAVCSenXmlServiceDescription@@PAVCSenServiceSession@@@Z @ 190 NONAME ; protected: void __thiscall CSenTransportContext::BaseConstructL(class MSenCoreServiceManager &,class CSenXmlServiceDescription &,class CSenServiceSession *)
+	?HasSuperClass@CSenInternalServiceConsumer@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 191 NONAME ; public: virtual int __thiscall CSenInternalServiceConsumer::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenServiceSession@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 192 NONAME ; public: virtual int __thiscall CSenServiceSession::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenWebServiceSession@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 193 NONAME ; public: virtual int __thiscall CSenWebServiceSession::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?NewL@CSenContext@@SAPAV1@W4TContextDirection@SenContext@@@Z @ 194 NONAME ; public: static class CSenContext * __cdecl CSenContext::NewL(enum SenContext::TContextDirection)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenElement@@@Z @ 195 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenElement &)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenXmlReader@@@Z @ 196 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenXmlReader &)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenXmlServiceDescription@@@Z @ 197 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenXmlServiceDescription &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 198 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class MSenCoreServiceManager &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenProperties@@@Z @ 199 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class MSenProperties &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenRemoteHostlet@@@Z @ 200 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class MSenRemoteHostlet &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenRemoteServiceConsumer@@@Z @ 201 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class MSenRemoteServiceConsumer &)
+	?NewL@CSenContextItem@@SAPAV1@ABVTDesC8@@@Z @ 202 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class TDesC8 const &)
+	?NewL@CSenContextItem@@SAPAV1@H@Z @ 203 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(int)
+	?NewL@CSenContextItem@@SAPAV1@I@Z @ 204 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(unsigned int)
+	?NewL@CSenContextItem@@SAPAV1@PAH@Z @ 205 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(int *)
+	?NewL@CSenContextItem@@SAPAV1@PAI@Z @ 206 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(unsigned int *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenElement@@@Z @ 207 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenElement *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenLayeredXmlProperties@@@Z @ 208 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenLayeredXmlProperties *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenXmlProperties@@@Z @ 209 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenXmlProperties *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenXmlReader@@@Z @ 210 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenXmlReader *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenXmlServiceDescription@@@Z @ 211 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class CSenXmlServiceDescription *)
+	?NewL@CSenContextItem@@SAPAV1@PAVTDesC8@@@Z @ 212 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(class TDesC8 *)
+	?NewL@CSenContextItem@@SAPAV1@PAX@Z @ 213 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewL(void *)
+	?NewL@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenXmlServiceDescription@@@Z @ 214 NONAME ; public: static class CSenTransportContext * __cdecl CSenTransportContext::NewL(class MSenCoreServiceManager &,class CSenXmlServiceDescription &)
+	?NewL@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenXmlServiceDescription@@AAVCSenServiceSession@@@Z @ 215 NONAME ; public: static class CSenTransportContext * __cdecl CSenTransportContext::NewL(class MSenCoreServiceManager &,class CSenXmlServiceDescription &,class CSenServiceSession &)
+	?NewLC@CSenContext@@SAPAV1@W4TContextDirection@SenContext@@@Z @ 216 NONAME ; public: static class CSenContext * __cdecl CSenContext::NewLC(enum SenContext::TContextDirection)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenElement@@@Z @ 217 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenElement &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenXmlReader@@@Z @ 218 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenXmlReader &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenXmlServiceDescription@@@Z @ 219 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenXmlServiceDescription &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 220 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class MSenCoreServiceManager &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenProperties@@@Z @ 221 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class MSenProperties &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenRemoteHostlet@@@Z @ 222 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class MSenRemoteHostlet &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenRemoteServiceConsumer@@@Z @ 223 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class MSenRemoteServiceConsumer &)
+	?NewLC@CSenContextItem@@SAPAV1@ABVTDesC8@@@Z @ 224 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class TDesC8 const &)
+	?NewLC@CSenContextItem@@SAPAV1@H@Z @ 225 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(int)
+	?NewLC@CSenContextItem@@SAPAV1@I@Z @ 226 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(unsigned int)
+	?NewLC@CSenContextItem@@SAPAV1@PAH@Z @ 227 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(int *)
+	?NewLC@CSenContextItem@@SAPAV1@PAI@Z @ 228 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(unsigned int *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenElement@@@Z @ 229 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenElement *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenLayeredXmlProperties@@@Z @ 230 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenLayeredXmlProperties *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenXmlProperties@@@Z @ 231 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenXmlProperties *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenXmlReader@@@Z @ 232 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenXmlReader *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenXmlServiceDescription@@@Z @ 233 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class CSenXmlServiceDescription *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVTDesC8@@@Z @ 234 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(class TDesC8 *)
+	?NewLC@CSenContextItem@@SAPAV1@PAX@Z @ 235 NONAME ; public: static class CSenContextItem * __cdecl CSenContextItem::NewLC(void *)
+	?NewLC@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenXmlServiceDescription@@@Z @ 236 NONAME ; public: static class CSenTransportContext * __cdecl CSenTransportContext::NewLC(class MSenCoreServiceManager &,class CSenXmlServiceDescription &)
+	?NewLC@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenXmlServiceDescription@@AAVCSenServiceSession@@@Z @ 237 NONAME ; public: static class CSenTransportContext * __cdecl CSenTransportContext::NewLC(class MSenCoreServiceManager &,class CSenXmlServiceDescription &,class CSenServiceSession &)
+	?ActionL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 238 NONAME ; public: virtual int __thiscall CSenLayeredTransportProperties::ActionL(class TPtrC8 &)
+	
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/BWINSCW/SENFRAMEWORKU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,387 @@
+EXPORTS
+	??0CSaslMechanism@@IAE@XZ @ 1 NONAME ; CSaslMechanism::CSaslMechanism(void)
+	??0CSenApplicationContext@@IAE@VTSecureId@@AAVCSenServerContext@@@Z @ 2 NONAME ; CSenApplicationContext::CSenApplicationContext(class TSecureId, class CSenServerContext &)
+	??0CSenClientContext@@IAE@HAAVCSenApplicationContext@@@Z @ 3 NONAME ; CSenClientContext::CSenClientContext(int, class CSenApplicationContext &)
+	??0CSenContext@@IAE@W4TContextDirection@SenContext@@@Z @ 4 NONAME ; CSenContext::CSenContext(enum SenContext::TContextDirection)
+	??0CSenHandlerBase@@IAE@XZ @ 5 NONAME ; CSenHandlerBase::CSenHandlerBase(void)
+	??0CSenInternalServiceConsumer@@IAE@W4TDescriptionClassType@MSenServiceDescription@@AAVCSIF@@@Z @ 6 NONAME ; CSenInternalServiceConsumer::CSenInternalServiceConsumer(enum MSenServiceDescription::TDescriptionClassType, class CSIF &)
+	??0CSenLayeredTransportProperties@@IAE@XZ @ 7 NONAME ; CSenLayeredTransportProperties::CSenLayeredTransportProperties(void)
+	??0CSenMessageContext@@IAE@W4TContextDirection@SenContext@@PAVMSenProperties@@@Z @ 8 NONAME ; CSenMessageContext::CSenMessageContext(enum SenContext::TContextDirection, class MSenProperties *)
+	??0CSenServerContext@@IAE@AAVMSenCoreServiceManager@@@Z @ 9 NONAME ; CSenServerContext::CSenServerContext(class MSenCoreServiceManager &)
+	??0CSenServiceSession@@IAE@W4TDescriptionClassType@MSenServiceDescription@@AAVMSIF@@@Z @ 10 NONAME ; CSenServiceSession::CSenServiceSession(enum MSenServiceDescription::TDescriptionClassType, class MSIF &)
+	??0CSenSessionContext@@IAE@XZ @ 11 NONAME ; CSenSessionContext::CSenSessionContext(void)
+	??0CSenSyncRequester@@IAE@AAVMSenTransport@@AAVMSenCoreServiceManager@@@Z @ 12 NONAME ; CSenSyncRequester::CSenSyncRequester(class MSenTransport &, class MSenCoreServiceManager &)
+	??0CSenTransportContext@@IAE@XZ @ 13 NONAME ; CSenTransportContext::CSenTransportContext(void)
+	??0CSenWSDescription@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 14 NONAME ; CSenWSDescription::CSenWSDescription(enum MSenServiceDescription::TDescriptionClassType)
+	??0CSenWSPattern@@IAE@W4TDescriptionClassType@MSenServiceDescription@@@Z @ 15 NONAME ; CSenWSPattern::CSenWSPattern(enum MSenServiceDescription::TDescriptionClassType)
+	??0CSenWebServiceSession@@IAE@W4TDescriptionClassType@MSenServiceDescription@@AAVMSIF@@@Z @ 16 NONAME ; CSenWebServiceSession::CSenWebServiceSession(enum MSenServiceDescription::TDescriptionClassType, class MSIF &)
+	??1CSaslMechanism@@UAE@XZ @ 17 NONAME ; CSaslMechanism::~CSaslMechanism(void)
+	??1CSenApplicationContext@@UAE@XZ @ 18 NONAME ; CSenApplicationContext::~CSenApplicationContext(void)
+	??1CSenClientContext@@UAE@XZ @ 19 NONAME ; CSenClientContext::~CSenClientContext(void)
+	??1CSenContext@@UAE@XZ @ 20 NONAME ; CSenContext::~CSenContext(void)
+	??1CSenContextItem@@UAE@XZ @ 21 NONAME ; CSenContextItem::~CSenContextItem(void)
+	??1CSenHandlerBase@@UAE@XZ @ 22 NONAME ; CSenHandlerBase::~CSenHandlerBase(void)
+	??1CSenInternalServiceConsumer@@UAE@XZ @ 23 NONAME ; CSenInternalServiceConsumer::~CSenInternalServiceConsumer(void)
+	??1CSenLayeredTransportProperties@@UAE@XZ @ 24 NONAME ; CSenLayeredTransportProperties::~CSenLayeredTransportProperties(void)
+	??1CSenMessageContext@@UAE@XZ @ 25 NONAME ; CSenMessageContext::~CSenMessageContext(void)
+	??1CSenServerContext@@UAE@XZ @ 26 NONAME ; CSenServerContext::~CSenServerContext(void)
+	??1CSenServiceSession@@UAE@XZ @ 27 NONAME ; CSenServiceSession::~CSenServiceSession(void)
+	??1CSenSessionContext@@UAE@XZ @ 28 NONAME ; CSenSessionContext::~CSenSessionContext(void)
+	??1CSenSyncRequester@@UAE@XZ @ 29 NONAME ; CSenSyncRequester::~CSenSyncRequester(void)
+	??1CSenTransportContext@@UAE@XZ @ 30 NONAME ; CSenTransportContext::~CSenTransportContext(void)
+	??1CSenWSDescription@@UAE@XZ @ 31 NONAME ; CSenWSDescription::~CSenWSDescription(void)
+	??1CSenWSPattern@@UAE@XZ @ 32 NONAME ; CSenWSPattern::~CSenWSPattern(void)
+	??1CSenWebServiceSession@@UAE@XZ @ 33 NONAME ; CSenWebServiceSession::~CSenWebServiceSession(void)
+	?AcceptsConsumerPolicy@CSenWSPattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 34 NONAME ; int CSenWSPattern::AcceptsConsumerPolicy(class MSenConsumerPolicy &)
+	?Account@CSaslMechanism@@UAEAAVCSenIdentityProvider@@XZ @ 35 NONAME ; class CSenIdentityProvider & CSaslMechanism::Account(void)
+	?AddConsumerIdentityProviderIdL@CSenWSPattern@@UAEHABVTDesC8@@@Z @ 36 NONAME ; int CSenWSPattern::AddConsumerIdentityProviderIdL(class TDesC8 const &)
+	?AddConsumerL@CSenWebServiceSession@@UAEHAAVMSenRemoteServiceConsumer@@@Z @ 37 NONAME ; int CSenWebServiceSession::AddConsumerL(class MSenRemoteServiceConsumer &)
+	?AddCredentialL@CSenWebServiceSession@@UAEHAAVCSenCredential@@@Z @ 38 NONAME ; int CSenWebServiceSession::AddCredentialL(class CSenCredential &)
+	?AddCredentialObserverL@CSenWebServiceSession@@QAEHAAVCSenInternalCredential@@@Z @ 39 NONAME ; int CSenWebServiceSession::AddCredentialObserverL(class CSenInternalCredential &)
+	?AddFacetL@CSenServiceSession@@UAEHABVCSenFacet@@@Z @ 40 NONAME ; int CSenServiceSession::AddFacetL(class CSenFacet const &)
+	?AsServiceDescription@CSenServiceSession@@UAEAAVMSenServiceDescription@@XZ @ 41 NONAME ; class MSenServiceDescription & CSenServiceSession::AsServiceDescription(void)
+	?AsUtf8L@CSenLayeredTransportProperties@@UAEPAVHBufC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 42 NONAME ; class HBufC8 * CSenLayeredTransportProperties::AsUtf8L(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?AsUtf8L@CSenLayeredTransportProperties@@UAEPAVHBufC8@@XZ @ 43 NONAME ; class HBufC8 * CSenLayeredTransportProperties::AsUtf8L(void)
+	?AsUtf8LC@CSenLayeredTransportProperties@@UAEPAVHBufC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 44 NONAME ; class HBufC8 * CSenLayeredTransportProperties::AsUtf8LC(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?AsUtf8LC@CSenLayeredTransportProperties@@UAEPAVHBufC8@@XZ @ 45 NONAME ; class HBufC8 * CSenLayeredTransportProperties::AsUtf8LC(void)
+	?AsXmlL@CSenHandlerBase@@UAEPAVHBufC8@@XZ @ 46 NONAME ; class HBufC8 * CSenHandlerBase::AsXmlL(void)
+	?BaseConstructL@CSenApplicationContext@@IAEXXZ @ 47 NONAME ; void CSenApplicationContext::BaseConstructL(void)
+	?BaseConstructL@CSenClientContext@@IAEXXZ @ 48 NONAME ; void CSenClientContext::BaseConstructL(void)
+	?BaseConstructL@CSenContext@@IAEXXZ @ 49 NONAME ; void CSenContext::BaseConstructL(void)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVCSenElement@@PAVRStringPool@@@Z @ 50 NONAME ; void CSenLayeredTransportProperties::BaseConstructL(class CSenElement const &, class RStringPool *)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVTDesC8@@000PAVCSenXmlReader@@PAVRStringPool@@@Z @ 51 NONAME ; void CSenLayeredTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *, class RStringPool *)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVTDesC8@@00PAVCSenXmlReader@@PAVRStringPool@@@Z @ 52 NONAME ; void CSenLayeredTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *, class RStringPool *)
+	?BaseConstructL@CSenLayeredTransportProperties@@MAEXABVTDesC8@@0PAVCSenXmlReader@@PAVRStringPool@@@Z @ 53 NONAME ; void CSenLayeredTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *, class RStringPool *)
+	?BaseConstructL@CSenMessageContext@@IAEXXZ @ 54 NONAME ; void CSenMessageContext::BaseConstructL(void)
+	?BaseConstructL@CSenServerContext@@IAEXXZ @ 55 NONAME ; void CSenServerContext::BaseConstructL(void)
+	?BaseConstructL@CSenServiceSession@@IAEXXZ @ 56 NONAME ; void CSenServiceSession::BaseConstructL(void)
+	?BaseConstructL@CSenSessionContext@@IAEXXZ @ 57 NONAME ; void CSenSessionContext::BaseConstructL(void)
+	?BaseConstructL@CSenSyncRequester@@IAEXXZ @ 58 NONAME ; void CSenSyncRequester::BaseConstructL(void)
+	?BaseConstructL@CSenTransportContext@@IAEXAAVMSenCoreServiceManager@@AAVCSenWSDescription@@PAVCSenServiceSession@@@Z @ 59 NONAME ; void CSenTransportContext::BaseConstructL(class MSenCoreServiceManager &, class CSenWSDescription &, class CSenServiceSession *)
+	?BaseConstructL@CSenWSPattern@@IAEXABVTDesC8@@0@Z @ 60 NONAME ; void CSenWSPattern::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenWSPattern@@IAEXABVTDesC8@@@Z @ 61 NONAME ; void CSenWSPattern::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenWSPattern@@IAEXXZ @ 62 NONAME ; void CSenWSPattern::BaseConstructL(void)
+	?BoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 63 NONAME ; int CSenLayeredTransportProperties::BoolPropertyL(class TDesC8 const &, int &)
+	?BoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAHW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 64 NONAME ; int CSenLayeredTransportProperties::BoolPropertyL(class TDesC8 const &, int &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?BoundaryLineEndL@SenMultiPartUtils@@SAXABVRBuf8@@AAV2@@Z @ 65 NONAME ; void SenMultiPartUtils::BoundaryLineEndL(class RBuf8 const &, class RBuf8 &)
+	?BoundaryLineStartL@SenMultiPartUtils@@SAXABVRBuf8@@AAV2@@Z @ 66 NONAME ; void SenMultiPartUtils::BoundaryLineStartL(class RBuf8 const &, class RBuf8 &)
+	?ChunkByTxnIdL@CSenInternalServiceConsumer@@UAEHHAAPAVCSenChunk@@@Z @ 67 NONAME ; int CSenInternalServiceConsumer::ChunkByTxnIdL(int, class CSenChunk * &)
+	?CidL@SenMultiPartUtils@@SAXABVRBuf8@@AAV?$RArray@VRBuf8@@@@@Z @ 68 NONAME ; void SenMultiPartUtils::CidL(class RBuf8 const &, class RArray<class RBuf8> &)
+	?ClearPasswordL@CSaslMechanism@@UAEXXZ @ 69 NONAME ; void CSaslMechanism::ClearPasswordL(void)
+	?ClientServerInterval@CSenWebServiceSession@@UAE?AVTTimeIntervalMicroSeconds@@XZ @ 70 NONAME ; class TTimeIntervalMicroSeconds CSenWebServiceSession::ClientServerInterval(void)
+	?Clone@CSenLayeredTransportProperties@@UBEPAVMSenProperties@@AAH@Z @ 71 NONAME ; class MSenProperties * CSenLayeredTransportProperties::Clone(int &) const
+	?CloneL@CSenLayeredTransportProperties@@UBEPAVMSenProperties@@XZ @ 72 NONAME ; class MSenProperties * CSenLayeredTransportProperties::CloneL(void) const
+	?CompleteServerMessagesOnOffL@CSenServiceSession@@UAEHABH@Z @ 73 NONAME ; int CSenServiceSession::CompleteServerMessagesOnOffL(int const &)
+	?ComputeStatusL@CSenServiceSession@@UAEHXZ @ 74 NONAME ; int CSenServiceSession::ComputeStatusL(void)
+	?ComputeStatusL@CSenWebServiceSession@@UAEHXZ @ 75 NONAME ; int CSenWebServiceSession::ComputeStatusL(void)
+	?ConstructL@CSenInternalServiceConsumer@@IAEXXZ @ 76 NONAME ; void CSenInternalServiceConsumer::ConstructL(void)
+	?ConstructL@CSenWebServiceSession@@IAEXXZ @ 77 NONAME ; void CSenWebServiceSession::ConstructL(void)
+	?ConstructSecurityTokenL@CSenWebServiceSession@@UAEHAAVCSenCredential@@AAPAVHBufC8@@@Z @ 78 NONAME ; int CSenWebServiceSession::ConstructSecurityTokenL(class CSenCredential &, class HBufC8 * &)
+	?Consumer@CSenWebServiceSession@@UAEPAVMSenRemoteServiceConsumer@@XZ @ 79 NONAME ; class MSenRemoteServiceConsumer * CSenWebServiceSession::Consumer(void)
+	?ConsumerIapId@CSenWSPattern@@UAEHAAK@Z @ 80 NONAME ; int CSenWSPattern::ConsumerIapId(unsigned long &)
+	?ConsumerIdentityProviderIds8L@CSenWSPattern@@UAEABVCSenIdentityProviderIdArray8@@XZ @ 81 NONAME ; class CSenIdentityProviderIdArray8 const & CSenWSPattern::ConsumerIdentityProviderIds8L(void)
+	?ConsumerPolicyAsXmlL@CSenWSPattern@@QAEPAVHBufC8@@XZ @ 82 NONAME ; class HBufC8 * CSenWSPattern::ConsumerPolicyAsXmlL(void)
+	?Consumers@CSenWebServiceSession@@UBEHAAV?$RPointerArray@VMSenRemoteServiceConsumer@@@@@Z @ 83 NONAME ; int CSenWebServiceSession::Consumers(class RPointerArray<class MSenRemoteServiceConsumer> &) const
+	?Contract@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 84 NONAME ; class TPtrC8 CSenServiceSession::Contract(void)
+	?Contract@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 85 NONAME ; class TPtrC8 CSenWebServiceSession::Contract(void)
+	?CredentialChanged@CSenWebServiceSession@@UAEXW4TSenCredentialChange@MSenCredentialObserver@@PAX@Z @ 86 NONAME ; void CSenWebServiceSession::CredentialChanged(enum MSenCredentialObserver::TSenCredentialChange, void *)
+	?DescriptionClassType@CSenServiceSession@@UAE?AW4TDescriptionClassType@MSenServiceDescription@@XZ @ 87 NONAME ; enum MSenServiceDescription::TDescriptionClassType CSenServiceSession::DescriptionClassType(void)
+	?DeviceIDL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 88 NONAME ; int CSenLayeredTransportProperties::DeviceIDL(class TPtrC8 &)
+	?DownloadFolderL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 89 NONAME ; int CSenLayeredTransportProperties::DownloadFolderL(class TPtrC8 &)
+	?Endpoint@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 90 NONAME ; class TPtrC8 CSenServiceSession::Endpoint(void)
+	?Endpoint@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 91 NONAME ; class TPtrC8 CSenWebServiceSession::Endpoint(void)
+	?ExpandToL@CSenLayeredTransportProperties@@UAEXW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 92 NONAME ; void CSenLayeredTransportProperties::ExpandToL(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?FacetValue@CSenServiceSession@@UAEHAAVTDesC8@@AAPAVHBufC8@@@Z @ 93 NONAME ; int CSenServiceSession::FacetValue(class TDesC8 &, class HBufC8 * &)
+	?FacetsL@CSenServiceSession@@UAEHAAV?$RPointerArray@VCSenFacet@@@@@Z @ 94 NONAME ; int CSenServiceSession::FacetsL(class RPointerArray<class CSenFacet> &)
+	?FileAttachmentL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 95 NONAME ; int CSenLayeredTransportProperties::FileAttachmentL(class TDesC8 const &, class HBufC8 * &)
+	?FileDataPartL@SenMultiPartUtils@@SAXIIAAV?$RArray@VTXmlEngDataContainer@@@@AAVRBuf8@@@Z @ 96 NONAME ; void SenMultiPartUtils::FileDataPartL(unsigned int, unsigned int, class RArray<class TXmlEngDataContainer> &, class RBuf8 &)
+	?FileDataRestL@SenMultiPartUtils@@SAXIIIAAV?$RArray@VTXmlEngDataContainer@@@@AAVRBuf8@@@Z @ 97 NONAME ; void SenMultiPartUtils::FileDataRestL(unsigned int, unsigned int, unsigned int, class RArray<class TXmlEngDataContainer> &, class RBuf8 &)
+	?FileProgress@CSenInternalServiceConsumer@@UAEXHHHABVTDesC8@@H@Z @ 98 NONAME ; void CSenInternalServiceConsumer::FileProgress(int, int, int, class TDesC8 const &, int)
+	?FillCredentialIdentifierL@CSenWebServiceSession@@UAEXAAVCSenCredentialIdentifier@@@Z @ 99 NONAME ; void CSenWebServiceSession::FillCredentialIdentifierL(class CSenCredentialIdentifier &)
+	?Framework@CSenInternalServiceConsumer@@IAEAAVCSIF@@XZ @ 100 NONAME ; class CSIF & CSenInternalServiceConsumer::Framework(void)
+	?FrameworkId@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 101 NONAME ; class TPtrC8 CSenServiceSession::FrameworkId(void)
+	?FrameworkId@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 102 NONAME ; class TPtrC8 CSenWebServiceSession::FrameworkId(void)
+	?FrameworkVersion@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 103 NONAME ; class TPtrC8 CSenWebServiceSession::FrameworkVersion(void)
+	?GenerateRandomBoundaryL@SenMultiPartUtils@@SAXAAVRBuf8@@@Z @ 104 NONAME ; void SenMultiPartUtils::GenerateRandomBoundaryL(class RBuf8 &)
+	?GenerateRandomRootCidL@SenMultiPartUtils@@SAXAAVRBuf8@@@Z @ 105 NONAME ; void SenMultiPartUtils::GenerateRandomRootCidL(class RBuf8 &)
+	?GetCredentialIdL@CSenWebServiceSession@@QAEHXZ @ 106 NONAME ; int CSenWebServiceSession::GetCredentialIdL(void)
+	?HandleErrorL@CSenInternalServiceConsumer@@UAEHPAVHBufC8@@HHPAVMSenProperties@@@Z @ 107 NONAME ; int CSenInternalServiceConsumer::HandleErrorL(class HBufC8 *, int, int, class MSenProperties *)
+	?HandleErrorL@CSenWebServiceSession@@UAEHHPAVHBufC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 108 NONAME ; int CSenWebServiceSession::HandleErrorL(int, class HBufC8 *, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?HandleMessageL@CSenInternalServiceConsumer@@UAEHPAVHBufC8@@HPAVMSenProperties@@@Z @ 109 NONAME ; int CSenInternalServiceConsumer::HandleMessageL(class HBufC8 *, int, class MSenProperties *)
+	?HandleSoapFaultL@CSenWebServiceSession@@UAEHPAVCSenSoapMessage@@AAPAVHBufC8@@@Z @ 110 NONAME ; int CSenWebServiceSession::HandleSoapFaultL(class CSenSoapMessage *, class HBufC8 * &)
+	?HandleSoapFaultL@CSenWebServiceSession@@UAEHPAVCSenSoapMessage@@HHAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 111 NONAME ; int CSenWebServiceSession::HandleSoapFaultL(class CSenSoapMessage *, int, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?HasConsumer@CSenWebServiceSession@@QBEHXZ @ 112 NONAME ; int CSenWebServiceSession::HasConsumer(void) const
+	?HasEqualPrimaryKeysL@CSenWSDescription@@UAEHAAVMSenServiceDescription@@@Z @ 113 NONAME ; int CSenWSDescription::HasEqualPrimaryKeysL(class MSenServiceDescription &)
+	?HasFacetL@CSenServiceSession@@UAEHABVTDesC8@@AAH@Z @ 114 NONAME ; int CSenServiceSession::HasFacetL(class TDesC8 const &, int &)
+	?HasSecurity@CSenWebServiceSession@@IAEHXZ @ 115 NONAME ; int CSenWebServiceSession::HasSecurity(void)
+	?HasSuperClass@CSenInternalServiceConsumer@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 116 NONAME ; int CSenInternalServiceConsumer::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenServiceSession@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 117 NONAME ; int CSenServiceSession::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenWSDescription@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 118 NONAME ; int CSenWSDescription::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenWSPattern@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 119 NONAME ; int CSenWSPattern::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HasSuperClass@CSenWebServiceSession@@UAEHW4TDescriptionClassType@MSenServiceDescription@@@Z @ 120 NONAME ; int CSenWebServiceSession::HasSuperClass(enum MSenServiceDescription::TDescriptionClassType)
+	?HeaderBinaryDataL@SenMultiPartUtils@@SAXIAAV?$RArray@VTXmlEngDataContainer@@@@AAVRBuf8@@@Z @ 121 NONAME ; void SenMultiPartUtils::HeaderBinaryDataL(unsigned int, class RArray<class TXmlEngDataContainer> &, class RBuf8 &)
+	?HeaderRootL@SenMultiPartUtils@@SAXPAVMSenMessage@@ABVRBuf8@@AAV3@@Z @ 122 NONAME ; void SenMultiPartUtils::HeaderRootL(class MSenMessage *, class RBuf8 const &, class RBuf8 &)
+	?HeartbeatL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 123 NONAME ; int CSenLayeredTransportProperties::HeartbeatL(int &)
+	?Hostlet@CSenServiceSession@@UBEPAVMSenRemoteHostlet@@XZ @ 124 NONAME ; class MSenRemoteHostlet * CSenServiceSession::Hostlet(void) const
+	?IAPDialogL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 125 NONAME ; int CSenLayeredTransportProperties::IAPDialogL(int &)
+	?IapIdL@CSenLayeredTransportProperties@@UAEHAAK@Z @ 126 NONAME ; int CSenLayeredTransportProperties::IapIdL(unsigned long &)
+	?Id@CSenInternalServiceConsumer@@UBEABVTDesC8@@XZ @ 127 NONAME ; class TDesC8 const & CSenInternalServiceConsumer::Id(void) const
+	?Identifier@CSenInternalServiceConsumer@@UBEAAVCSenIdentifier@@XZ @ 128 NONAME ; class CSenIdentifier & CSenInternalServiceConsumer::Identifier(void) const
+	?InitFrom@CSaslMechanism@@UAEXV1@@Z @ 129 NONAME ; void CSaslMechanism::InitFrom(class CSaslMechanism)
+	?InitializeFromL@CSenServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 130 NONAME ; int CSenServiceSession::InitializeFromL(class MSenServiceDescription &)
+	?InitializeFromL@CSenWebServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 131 NONAME ; int CSenWebServiceSession::InitializeFromL(class MSenServiceDescription &)
+	?IntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 132 NONAME ; int CSenLayeredTransportProperties::IntPropertyL(class TDesC8 const &, int &)
+	?IntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAHW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 133 NONAME ; int CSenLayeredTransportProperties::IntPropertyL(class TDesC8 const &, int &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?IsExpiredL@CSenWebServiceSession@@UAEHXZ @ 134 NONAME ; int CSenWebServiceSession::IsExpiredL(void)
+	?IsLocalL@CSenWSDescription@@UAEHXZ @ 135 NONAME ; int CSenWSDescription::IsLocalL(void)
+	?IsPasswordFromUser@CSaslMechanism@@UAEHXZ @ 136 NONAME ; int CSaslMechanism::IsPasswordFromUser(void)
+	?IsReadyL@CSenInternalServiceConsumer@@UAEHXZ @ 137 NONAME ; int CSenInternalServiceConsumer::IsReadyL(void)
+	?IsReadyL@CSenServiceSession@@UAEHXZ @ 138 NONAME ; int CSenServiceSession::IsReadyL(void)
+	?IsReadyL@CSenWebServiceSession@@UAEHXZ @ 139 NONAME ; int CSenWebServiceSession::IsReadyL(void)
+	?IsSafeToCast@CSenLayeredTransportProperties@@UAEHW4TSenPropertiesClassType@MSenProperties@@@Z @ 140 NONAME ; int CSenLayeredTransportProperties::IsSafeToCast(enum MSenProperties::TSenPropertiesClassType)
+	?Log@CSenServiceSession@@IBEPAVRFileLogger@@XZ @ 141 NONAME ; class RFileLogger * CSenServiceSession::Log(void) const
+	?Matches@CSenServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 142 NONAME ; int CSenServiceSession::Matches(class MSenServiceDescription &)
+	?Matches@CSenWSPattern@@UAEHAAVMSenServiceDescription@@@Z @ 143 NONAME ; int CSenWSPattern::Matches(class MSenServiceDescription &)
+	?MaxAttempts@CSaslMechanism@@UAEHXZ @ 144 NONAME ; int CSaslMechanism::MaxAttempts(void)
+	?MaxTimeToLiveL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 145 NONAME ; int CSenLayeredTransportProperties::MaxTimeToLiveL(int &)
+	?MessageForSendingL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAPAVCSenSoapMessage@@@Z @ 146 NONAME ; int CSenWebServiceSession::MessageForSendingL(class TDesC8 const &, class TDesC8 const &, class CSenSoapMessage * &)
+	?MinTimeToLiveL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 147 NONAME ; int CSenLayeredTransportProperties::MinTimeToLiveL(int &)
+	?MwsNamespaceL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 148 NONAME ; int CSenLayeredTransportProperties::MwsNamespaceL(class TPtrC8 &)
+	?NewL@CSaslMechanism@@SAPAV1@XZ @ 149 NONAME ; class CSaslMechanism * CSaslMechanism::NewL(void)
+	?NewL@CSenApplicationContext@@CAPAV1@VTSecureId@@AAVCSenServerContext@@@Z @ 150 NONAME ; class CSenApplicationContext * CSenApplicationContext::NewL(class TSecureId, class CSenServerContext &)
+	?NewL@CSenClientContext@@CAPAV1@HAAVCSenApplicationContext@@@Z @ 151 NONAME ; class CSenClientContext * CSenClientContext::NewL(int, class CSenApplicationContext &)
+	?NewL@CSenContext@@SAPAV1@W4TContextDirection@SenContext@@@Z @ 152 NONAME ; class CSenContext * CSenContext::NewL(enum SenContext::TContextDirection)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenChunk@@@Z @ 153 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenChunk &)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenElement@@@Z @ 154 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenElement &)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenSoapMessage@@@Z @ 155 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenSoapMessage &)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenWSDescription@@@Z @ 156 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenWSDescription &)
+	?NewL@CSenContextItem@@SAPAV1@AAVCSenXmlReader@@@Z @ 157 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenXmlReader &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 158 NONAME ; class CSenContextItem * CSenContextItem::NewL(class MSenCoreServiceManager &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenMessage@@@Z @ 159 NONAME ; class CSenContextItem * CSenContextItem::NewL(class MSenMessage &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenProperties@@@Z @ 160 NONAME ; class CSenContextItem * CSenContextItem::NewL(class MSenProperties &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenRemoteHostlet@@@Z @ 161 NONAME ; class CSenContextItem * CSenContextItem::NewL(class MSenRemoteHostlet &)
+	?NewL@CSenContextItem@@SAPAV1@AAVMSenRemoteServiceConsumer@@@Z @ 162 NONAME ; class CSenContextItem * CSenContextItem::NewL(class MSenRemoteServiceConsumer &)
+	?NewL@CSenContextItem@@SAPAV1@ABVTDesC8@@@Z @ 163 NONAME ; class CSenContextItem * CSenContextItem::NewL(class TDesC8 const &)
+	?NewL@CSenContextItem@@SAPAV1@H@Z @ 164 NONAME ; class CSenContextItem * CSenContextItem::NewL(int)
+	?NewL@CSenContextItem@@SAPAV1@I@Z @ 165 NONAME ; class CSenContextItem * CSenContextItem::NewL(unsigned int)
+	?NewL@CSenContextItem@@SAPAV1@PAH@Z @ 166 NONAME ; class CSenContextItem * CSenContextItem::NewL(int *)
+	?NewL@CSenContextItem@@SAPAV1@PAI@Z @ 167 NONAME ; class CSenContextItem * CSenContextItem::NewL(unsigned int *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenAtomEntry@@@Z @ 168 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenAtomEntry *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenChunk@@@Z @ 169 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenChunk *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenElement@@@Z @ 170 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenElement *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenLayeredXmlProperties@@@Z @ 171 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenLayeredXmlProperties *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenMessageBase@@@Z @ 172 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenMessageBase *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenSoapEnvelope2@@@Z @ 173 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenSoapEnvelope2 *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenSoapMessage@@@Z @ 174 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenSoapMessage *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenWSDescription@@@Z @ 175 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenWSDescription *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenXmlProperties@@@Z @ 176 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenXmlProperties *)
+	?NewL@CSenContextItem@@SAPAV1@PAVCSenXmlReader@@@Z @ 177 NONAME ; class CSenContextItem * CSenContextItem::NewL(class CSenXmlReader *)
+	?NewL@CSenContextItem@@SAPAV1@PAVTDesC8@@@Z @ 178 NONAME ; class CSenContextItem * CSenContextItem::NewL(class TDesC8 *)
+	?NewL@CSenContextItem@@SAPAV1@PAX@Z @ 179 NONAME ; class CSenContextItem * CSenContextItem::NewL(void *)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 180 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewL(class RStringPool &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 181 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 182 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewL(class CSenElement const &, class RStringPool &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 183 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 184 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &, class RStringPool &)
+	?NewL@CSenLayeredHttpTransportProperties@@SAPAV1@XZ @ 185 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewL(void)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 186 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewL(class RStringPool &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 187 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 188 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewL(class CSenElement const &, class RStringPool &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 189 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 190 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &, class RStringPool &)
+	?NewL@CSenLayeredTransportProperties@@SAPAV1@XZ @ 191 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewL(void)
+	?NewL@CSenLayeredVtcpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 192 NONAME ; class CSenLayeredVtcpTransportProperties * CSenLayeredVtcpTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenLayeredVtcpTransportProperties@@SAPAV1@XZ @ 193 NONAME ; class CSenLayeredVtcpTransportProperties * CSenLayeredVtcpTransportProperties::NewL(void)
+	?NewL@CSenMessageContext@@SAPAV1@W4TContextDirection@SenContext@@PAVMSenProperties@@@Z @ 194 NONAME ; class CSenMessageContext * CSenMessageContext::NewL(enum SenContext::TContextDirection, class MSenProperties *)
+	?NewL@CSenServerContext@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 195 NONAME ; class CSenServerContext * CSenServerContext::NewL(class MSenCoreServiceManager &)
+	?NewL@CSenSessionContext@@SAPAV1@XZ @ 196 NONAME ; class CSenSessionContext * CSenSessionContext::NewL(void)
+	?NewL@CSenSyncRequester@@SAPAV1@AAVMSenTransport@@AAVMSenCoreServiceManager@@@Z @ 197 NONAME ; class CSenSyncRequester * CSenSyncRequester::NewL(class MSenTransport &, class MSenCoreServiceManager &)
+	?NewL@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenWSDescription@@@Z @ 198 NONAME ; class CSenTransportContext * CSenTransportContext::NewL(class MSenCoreServiceManager &, class CSenWSDescription &)
+	?NewL@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenWSDescription@@AAVCSenServiceSession@@@Z @ 199 NONAME ; class CSenTransportContext * CSenTransportContext::NewL(class MSenCoreServiceManager &, class CSenWSDescription &, class CSenServiceSession &)
+	?NewL@CSenWSDescription@@SAPAV1@ABVTDesC8@@0@Z @ 200 NONAME ; class CSenWSDescription * CSenWSDescription::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenWSDescription@@SAPAV1@ABVTDesC8@@@Z @ 201 NONAME ; class CSenWSDescription * CSenWSDescription::NewL(class TDesC8 const &)
+	?NewL@CSenWSDescription@@SAPAV1@XZ @ 202 NONAME ; class CSenWSDescription * CSenWSDescription::NewL(void)
+	?NewL@CSenWSPattern@@SAPAV1@ABVTDesC8@@0@Z @ 203 NONAME ; class CSenWSPattern * CSenWSPattern::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenWSPattern@@SAPAV1@ABVTDesC8@@@Z @ 204 NONAME ; class CSenWSPattern * CSenWSPattern::NewL(class TDesC8 const &)
+	?NewL@CSenWSPattern@@SAPAV1@XZ @ 205 NONAME ; class CSenWSPattern * CSenWSPattern::NewL(void)
+	?NewLC@CSaslMechanism@@SAPAV1@XZ @ 206 NONAME ; class CSaslMechanism * CSaslMechanism::NewLC(void)
+	?NewLC@CSenApplicationContext@@CAPAV1@VTSecureId@@AAVCSenServerContext@@@Z @ 207 NONAME ; class CSenApplicationContext * CSenApplicationContext::NewLC(class TSecureId, class CSenServerContext &)
+	?NewLC@CSenClientContext@@CAPAV1@HAAVCSenApplicationContext@@@Z @ 208 NONAME ; class CSenClientContext * CSenClientContext::NewLC(int, class CSenApplicationContext &)
+	?NewLC@CSenContext@@SAPAV1@W4TContextDirection@SenContext@@@Z @ 209 NONAME ; class CSenContext * CSenContext::NewLC(enum SenContext::TContextDirection)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenChunk@@@Z @ 210 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenChunk &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenElement@@@Z @ 211 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenElement &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenSoapMessage@@@Z @ 212 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenSoapMessage &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenWSDescription@@@Z @ 213 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenWSDescription &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVCSenXmlReader@@@Z @ 214 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenXmlReader &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 215 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class MSenCoreServiceManager &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenMessage@@@Z @ 216 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class MSenMessage &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenProperties@@@Z @ 217 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class MSenProperties &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenRemoteHostlet@@@Z @ 218 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class MSenRemoteHostlet &)
+	?NewLC@CSenContextItem@@SAPAV1@AAVMSenRemoteServiceConsumer@@@Z @ 219 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class MSenRemoteServiceConsumer &)
+	?NewLC@CSenContextItem@@SAPAV1@ABVTDesC8@@@Z @ 220 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class TDesC8 const &)
+	?NewLC@CSenContextItem@@SAPAV1@H@Z @ 221 NONAME ; class CSenContextItem * CSenContextItem::NewLC(int)
+	?NewLC@CSenContextItem@@SAPAV1@I@Z @ 222 NONAME ; class CSenContextItem * CSenContextItem::NewLC(unsigned int)
+	?NewLC@CSenContextItem@@SAPAV1@PAH@Z @ 223 NONAME ; class CSenContextItem * CSenContextItem::NewLC(int *)
+	?NewLC@CSenContextItem@@SAPAV1@PAI@Z @ 224 NONAME ; class CSenContextItem * CSenContextItem::NewLC(unsigned int *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenAtomEntry@@@Z @ 225 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenAtomEntry *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenChunk@@@Z @ 226 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenChunk *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenElement@@@Z @ 227 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenElement *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenLayeredXmlProperties@@@Z @ 228 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenLayeredXmlProperties *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenMessageBase@@@Z @ 229 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenMessageBase *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenSoapEnvelope2@@@Z @ 230 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenSoapEnvelope2 *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenSoapMessage@@@Z @ 231 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenSoapMessage *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenWSDescription@@@Z @ 232 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenWSDescription *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenXmlProperties@@@Z @ 233 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenXmlProperties *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVCSenXmlReader@@@Z @ 234 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class CSenXmlReader *)
+	?NewLC@CSenContextItem@@SAPAV1@PAVTDesC8@@@Z @ 235 NONAME ; class CSenContextItem * CSenContextItem::NewLC(class TDesC8 *)
+	?NewLC@CSenContextItem@@SAPAV1@PAX@Z @ 236 NONAME ; class CSenContextItem * CSenContextItem::NewLC(void *)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 237 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewLC(class RStringPool &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 238 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 239 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewLC(class CSenElement const &, class RStringPool &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 240 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 241 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &, class RStringPool &)
+	?NewLC@CSenLayeredHttpTransportProperties@@SAPAV1@XZ @ 242 NONAME ; class CSenLayeredHttpTransportProperties * CSenLayeredHttpTransportProperties::NewLC(void)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@AAVRStringPool@@@Z @ 243 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewLC(class RStringPool &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 244 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVCSenElement@@AAVRStringPool@@@Z @ 245 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewLC(class CSenElement const &, class RStringPool &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 246 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@AAVRStringPool@@@Z @ 247 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &, class RStringPool &)
+	?NewLC@CSenLayeredTransportProperties@@SAPAV1@XZ @ 248 NONAME ; class CSenLayeredTransportProperties * CSenLayeredTransportProperties::NewLC(void)
+	?NewLC@CSenLayeredVtcpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 249 NONAME ; class CSenLayeredVtcpTransportProperties * CSenLayeredVtcpTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenLayeredVtcpTransportProperties@@SAPAV1@XZ @ 250 NONAME ; class CSenLayeredVtcpTransportProperties * CSenLayeredVtcpTransportProperties::NewLC(void)
+	?NewLC@CSenMessageContext@@SAPAV1@W4TContextDirection@SenContext@@PAVMSenProperties@@@Z @ 251 NONAME ; class CSenMessageContext * CSenMessageContext::NewLC(enum SenContext::TContextDirection, class MSenProperties *)
+	?NewLC@CSenServerContext@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 252 NONAME ; class CSenServerContext * CSenServerContext::NewLC(class MSenCoreServiceManager &)
+	?NewLC@CSenSessionContext@@SAPAV1@XZ @ 253 NONAME ; class CSenSessionContext * CSenSessionContext::NewLC(void)
+	?NewLC@CSenSyncRequester@@SAPAV1@AAVMSenTransport@@AAVMSenCoreServiceManager@@@Z @ 254 NONAME ; class CSenSyncRequester * CSenSyncRequester::NewLC(class MSenTransport &, class MSenCoreServiceManager &)
+	?NewLC@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenWSDescription@@@Z @ 255 NONAME ; class CSenTransportContext * CSenTransportContext::NewLC(class MSenCoreServiceManager &, class CSenWSDescription &)
+	?NewLC@CSenTransportContext@@SAPAV1@AAVMSenCoreServiceManager@@AAVCSenWSDescription@@AAVCSenServiceSession@@@Z @ 256 NONAME ; class CSenTransportContext * CSenTransportContext::NewLC(class MSenCoreServiceManager &, class CSenWSDescription &, class CSenServiceSession &)
+	?NewLC@CSenWSDescription@@SAPAV1@ABVTDesC8@@0@Z @ 257 NONAME ; class CSenWSDescription * CSenWSDescription::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenWSDescription@@SAPAV1@ABVTDesC8@@@Z @ 258 NONAME ; class CSenWSDescription * CSenWSDescription::NewLC(class TDesC8 const &)
+	?NewLC@CSenWSDescription@@SAPAV1@XZ @ 259 NONAME ; class CSenWSDescription * CSenWSDescription::NewLC(void)
+	?NewLC@CSenWSPattern@@SAPAV1@ABVTDesC8@@0@Z @ 260 NONAME ; class CSenWSPattern * CSenWSPattern::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenWSPattern@@SAPAV1@ABVTDesC8@@@Z @ 261 NONAME ; class CSenWSPattern * CSenWSPattern::NewLC(class TDesC8 const &)
+	?NewLC@CSenWSPattern@@SAPAV1@XZ @ 262 NONAME ; class CSenWSPattern * CSenWSPattern::NewLC(void)
+	?NewMessageL@CSenWebServiceSession@@UAEHAAPAVCSenSoapMessage@@@Z @ 263 NONAME ; int CSenWebServiceSession::NewMessageL(class CSenSoapMessage * &)
+	?ParseMessageL@CSenWebServiceSession@@UAEHAAVCSenSoapMessage@@@Z @ 264 NONAME ; int CSenWebServiceSession::ParseMessageL(class CSenSoapMessage &)
+	?ParseResponseL@CSenServiceSession@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 265 NONAME ; int CSenServiceSession::ParseResponseL(class TDesC8 const &, class HBufC8 * &)
+	?ParseResponseL@CSenWebServiceSession@@UAEHABVTDesC8@@AAPAVCSenSoapMessage@@@Z @ 266 NONAME ; int CSenWebServiceSession::ParseResponseL(class TDesC8 const &, class CSenSoapMessage * &)
+	?ParseResponseL@CSenWebServiceSession@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 267 NONAME ; int CSenWebServiceSession::ParseResponseL(class TDesC8 const &, class HBufC8 * &)
+	?Password8L@CSaslMechanism@@UAEPAVHBufC8@@XZ @ 268 NONAME ; class HBufC8 * CSaslMechanism::Password8L(void)
+	?ProcessHandlerContextL@CSenHandlerBase@@MAEXAAVMSenHandlerContext@@@Z @ 269 NONAME ; void CSenHandlerBase::ProcessHandlerContextL(class MSenHandlerContext &)
+	?PropertiesByTypeL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAV?$RPointerArray@VMSenProperty@@@@@Z @ 270 NONAME ; int CSenLayeredTransportProperties::PropertiesByTypeL(class TDesC8 const &, class RPointerArray<class MSenProperty> &)
+	?PropertiesClassType@CSenLayeredTransportProperties@@UAE?AW4TSenPropertiesClassType@MSenProperties@@XZ @ 271 NONAME ; enum MSenProperties::TSenPropertiesClassType CSenLayeredTransportProperties::PropertiesClassType(void)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAPAVMSenProperty@@@Z @ 272 NONAME ; int CSenLayeredTransportProperties::PropertyL(class TDesC8 const &, class MSenProperty * &)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAPAVMSenProperty@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 273 NONAME ; int CSenLayeredTransportProperties::PropertyL(class TDesC8 const &, class MSenProperty * &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@1@Z @ 274 NONAME ; int CSenLayeredTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &, class TPtrC8 &)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@@Z @ 275 NONAME ; int CSenLayeredTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &)
+	?PropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 276 NONAME ; int CSenLayeredTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?ProvideHostletResponseL@CSenServiceSession@@UAEHAAVMSenRemoteHostlet@@HHABVTDesC8@@AAVCSenChunk@@@Z @ 277 NONAME ; int CSenServiceSession::ProvideHostletResponseL(class MSenRemoteHostlet &, int, int, class TDesC8 const &, class CSenChunk &)
+	?ProvideHostletResponseL@CSenWebServiceSession@@UAEHAAVMSenRemoteHostlet@@HHABVTDesC8@@AAVCSenChunk@@@Z @ 278 NONAME ; int CSenWebServiceSession::ProvideHostletResponseL(class MSenRemoteHostlet &, int, int, class TDesC8 const &, class CSenChunk &)
+	?ProxyHostL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 279 NONAME ; int CSenLayeredTransportProperties::ProxyHostL(class TPtrC8 &)
+	?ProxyPortL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 280 NONAME ; int CSenLayeredTransportProperties::ProxyPortL(int &)
+	?ProxyUsageL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 281 NONAME ; int CSenLayeredTransportProperties::ProxyUsageL(int &)
+	?ReadFromL@CSenLayeredTransportProperties@@UAEXABVTDesC8@@@Z @ 282 NONAME ; void CSenLayeredTransportProperties::ReadFromL(class TDesC8 const &)
+	?ReadFromL@CSenLayeredTransportProperties@@UAEXABVTDesC8@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 283 NONAME ; void CSenLayeredTransportProperties::ReadFromL(class TDesC8 const &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?RebuildFromConsumerPolicy@CSenWSPattern@@UAEHAAVMSenConsumerPolicy@@@Z @ 284 NONAME ; int CSenWSPattern::RebuildFromConsumerPolicy(class MSenConsumerPolicy &)
+	?RefreshMTL@CSenServiceSession@@UAEHAAPAVHBufC8@@@Z @ 285 NONAME ; int CSenServiceSession::RefreshMTL(class HBufC8 * &)
+	?RemoteConsumerL@CSenServiceSession@@UAEPAVMSenRemoteServiceConsumer@@ABVTDesC8@@@Z @ 286 NONAME ; class MSenRemoteServiceConsumer * CSenServiceSession::RemoteConsumerL(class TDesC8 const &)
+	?RemoveConsumerL@CSenServiceSession@@UAEHAAVMSenRemoteServiceConsumer@@@Z @ 287 NONAME ; int CSenServiceSession::RemoveConsumerL(class MSenRemoteServiceConsumer &)
+	?RemoveFacet@CSenServiceSession@@UAEHABVTDesC8@@@Z @ 288 NONAME ; int CSenServiceSession::RemoveFacet(class TDesC8 const &)
+	?SaveL@CSenServiceSession@@UAEXXZ @ 289 NONAME ; void CSenServiceSession::SaveL(void)
+	?ScoreMatchL@CSenServiceSession@@UAEHAAVMSenServiceDescription@@@Z @ 290 NONAME ; int CSenServiceSession::ScoreMatchL(class MSenServiceDescription &)
+	?SecurityL@CSenWebServiceSession@@IAEPAVHBufC8@@XZ @ 291 NONAME ; class HBufC8 * CSenWebServiceSession::SecurityL(void)
+	?SendErrorToConsumerL@CSenWebServiceSession@@UAEHHPAVHBufC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 292 NONAME ; int CSenWebServiceSession::SendErrorToConsumerL(int, class HBufC8 *, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?SendL@CSenServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAHAAPAVHBufC8@@@Z @ 293 NONAME ; int CSenServiceSession::SendL(class TDesC8 const &, class TDesC8 const &, class MSenRemoteServiceConsumer &, int &, class HBufC8 * &)
+	?SendL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAHAAPAVHBufC8@@@Z @ 294 NONAME ; int CSenWebServiceSession::SendL(class TDesC8 const &, class TDesC8 const &, class MSenRemoteServiceConsumer &, int &, class HBufC8 * &)
+	?SendSoapL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAHAAPAVHBufC8@@@Z @ 295 NONAME ; int CSenWebServiceSession::SendSoapL(class TDesC8 const &, class TDesC8 const &, class MSenRemoteServiceConsumer &, int &, class HBufC8 * &)
+	?SendSoapMessageToConsumerL@CSenWebServiceSession@@UAEHPAVCSenSoapMessage@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 296 NONAME ; int CSenWebServiceSession::SendSoapMessageToConsumerL(class CSenSoapMessage *, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?SendToConsumerL@CSenWebServiceSession@@UAEHPAVHBufC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 297 NONAME ; int CSenWebServiceSession::SendToConsumerL(class HBufC8 *, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?SendToHostletL@CSenServiceSession@@UAEHAAVMSenRemoteHostlet@@ABVTDesC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 298 NONAME ; int CSenServiceSession::SendToHostletL(class MSenRemoteHostlet &, class TDesC8 const &, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?SendToHostletL@CSenWebServiceSession@@UAEHAAVMSenRemoteHostlet@@ABVTDesC8@@HAAVMSenRemoteServiceConsumer@@PAVMSenProperties@@@Z @ 299 NONAME ; int CSenWebServiceSession::SendToHostletL(class MSenRemoteHostlet &, class TDesC8 const &, int, class MSenRemoteServiceConsumer &, class MSenProperties *)
+	?SerializeMessageL@SenMultiPartUtils@@SAXAAVCSenFragmentBase@@AAVRBuf8@@W4TXmlEngSerializerType@@@Z @ 300 NONAME ; void SenMultiPartUtils::SerializeMessageL(class CSenFragmentBase &, class RBuf8 &, enum TXmlEngSerializerType)
+	?ServicePolicy@CSenWSDescription@@UAEPAVMSenServicePolicy@@XZ @ 301 NONAME ; class MSenServicePolicy * CSenWSDescription::ServicePolicy(void)
+	?SetBoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@H@Z @ 302 NONAME ; int CSenLayeredTransportProperties::SetBoolPropertyL(class TDesC8 const &, int)
+	?SetBoolPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@HW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 303 NONAME ; int CSenLayeredTransportProperties::SetBoolPropertyL(class TDesC8 const &, int, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetClientServerIntervalL@CSenWebServiceSession@@UAEXVTTimeIntervalMicroSeconds@@@Z @ 304 NONAME ; void CSenWebServiceSession::SetClientServerIntervalL(class TTimeIntervalMicroSeconds)
+	?SetConsumerIapIdL@CSenWSPattern@@UAEXK@Z @ 305 NONAME ; void CSenWSPattern::SetConsumerIapIdL(unsigned long)
+	?SetConsumerIdentityProviderIdsL@CSenWSPattern@@UAEXAAVCSenIdentityProviderIdArray8@@@Z @ 306 NONAME ; void CSenWSPattern::SetConsumerIdentityProviderIdsL(class CSenIdentityProviderIdArray8 &)
+	?SetContractL@CSenWebServiceSession@@UAEXABVTDesC8@@@Z @ 307 NONAME ; void CSenWebServiceSession::SetContractL(class TDesC8 const &)
+	?SetCredentialPtrL@CSenWebServiceSession@@UAEXVRSenCredentialPtr@@@Z @ 308 NONAME ; void CSenWebServiceSession::SetCredentialPtrL(class RSenCredentialPtr)
+	?SetEndPointL@CSenWebServiceSession@@UAEXABVTDesC8@@@Z @ 309 NONAME ; void CSenWebServiceSession::SetEndPointL(class TDesC8 const &)
+	?SetFacetL@CSenServiceSession@@UAEHABVCSenFacet@@@Z @ 310 NONAME ; int CSenServiceSession::SetFacetL(class CSenFacet const &)
+	?SetFileL@SenMultiPartUtils@@SAHIHAAVTDesC8@@AAV?$RArray@VRBuf8@@@@@Z @ 311 NONAME ; int SenMultiPartUtils::SetFileL(unsigned int, int, class TDesC8 &, class RArray<class RBuf8> &)
+	?SetFrameworkHeadersL@CSenWebServiceSession@@UAEXAAVCSenSoapMessage@@@Z @ 312 NONAME ; void CSenWebServiceSession::SetFrameworkHeadersL(class CSenSoapMessage &)
+	?SetHostletL@CSenServiceSession@@UAEHPAVMSenRemoteHostlet@@@Z @ 313 NONAME ; int CSenServiceSession::SetHostletL(class MSenRemoteHostlet *)
+	?SetIdentity@CSaslMechanism@@UAEXPAVCSenIdentityProvider@@PAVMSenIdentityManager@@@Z @ 314 NONAME ; void CSaslMechanism::SetIdentity(class CSenIdentityProvider *, class MSenIdentityManager *)
+	?SetIntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@H@Z @ 315 NONAME ; int CSenLayeredTransportProperties::SetIntPropertyL(class TDesC8 const &, int)
+	?SetIntPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@HW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 316 NONAME ; int CSenLayeredTransportProperties::SetIntPropertyL(class TDesC8 const &, int, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetPolicyL@CSenWSDescription@@UAEHABVTDesC8@@000@Z @ 317 NONAME ; int CSenWSDescription::SetPolicyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetPolicyL@CSenWSDescription@@UAEHABVTDesC8@@0@Z @ 318 NONAME ; int CSenWSDescription::SetPolicyL(class TDesC8 const &, class TDesC8 const &)
+	?SetPolicyL@CSenWSDescription@@UAEHABVTDesC8@@@Z @ 319 NONAME ; int CSenWSDescription::SetPolicyL(class TDesC8 const &)
+	?SetPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@00@Z @ 320 NONAME ; int CSenLayeredTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@0@Z @ 321 NONAME ; int CSenLayeredTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &)
+	?SetPropertyL@CSenLayeredTransportProperties@@UAEHABVTDesC8@@0W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 322 NONAME ; int CSenLayeredTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SetProviderIdL@CSenWSDescription@@UAEHABVTDesC8@@@Z @ 323 NONAME ; int CSenWSDescription::SetProviderIdL(class TDesC8 const &)
+	?SetReader@CSenLayeredTransportProperties@@UAEXAAVCSenXmlReader@@@Z @ 324 NONAME ; void CSenLayeredTransportProperties::SetReader(class CSenXmlReader &)
+	?SetSecurityL@CSenWebServiceSession@@UAEXABVTDesC8@@@Z @ 325 NONAME ; void CSenWebServiceSession::SetSecurityL(class TDesC8 const &)
+	?SetSessionL@CSenInternalServiceConsumer@@UAEHAAVMSenRemoteServiceSession@@@Z @ 326 NONAME ; int CSenInternalServiceConsumer::SetSessionL(class MSenRemoteServiceSession &)
+	?SetStatusL@CSenInternalServiceConsumer@@UAEXH@Z @ 327 NONAME ; void CSenInternalServiceConsumer::SetStatusL(int)
+	?SetStatusL@CSenServiceSession@@UAEHXZ @ 328 NONAME ; int CSenServiceSession::SetStatusL(void)
+	?SetTransforms@CSaslMechanism@@UAEXV?$RPointerArray@VCSenPasswordTransform@@@@@Z @ 329 NONAME ; void CSaslMechanism::SetTransforms(class RPointerArray<class CSenPasswordTransform>)
+	?SetTransportCueL@CSenServiceSession@@UAEHABVTDesC8@@@Z @ 330 NONAME ; int CSenServiceSession::SetTransportCueL(class TDesC8 const &)
+	?SetTransportCueL@CSenWSDescription@@UAEHABVTDesC8@@@Z @ 331 NONAME ; int CSenWSDescription::SetTransportCueL(class TDesC8 const &)
+	?SetTransportCueL@CSenWebServiceSession@@UAEHABVTDesC8@@@Z @ 332 NONAME ; int CSenWebServiceSession::SetTransportCueL(class TDesC8 const &)
+	?SetTransportL@CSenServiceSession@@UAEXPAVCSenTransportBase@@@Z @ 333 NONAME ; void CSenServiceSession::SetTransportL(class CSenTransportBase *)
+	?SetTransportPropertiesL@CSenServiceSession@@UAEHABVTDesC8@@AAVMSenRemoteServiceConsumer@@@Z @ 334 NONAME ; int CSenServiceSession::SetTransportPropertiesL(class TDesC8 const &, class MSenRemoteServiceConsumer &)
+	?SetUserNameL@CSenWebServiceSession@@UAEHAAVTDesC8@@@Z @ 335 NONAME ; int CSenWebServiceSession::SetUserNameL(class TDesC8 &)
+	?ShrinkTo@CSenLayeredTransportProperties@@UAEHW4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 336 NONAME ; int CSenLayeredTransportProperties::ShrinkTo(enum MSenLayeredProperties::TSenPropertiesLayer)
+	?SoapActionL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 337 NONAME ; int CSenLayeredTransportProperties::SoapActionL(class TPtrC8 &)
+	?StartElementL@CSenWSPattern@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 338 NONAME ; void CSenWSPattern::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?StartTransaction@CSenWebServiceSession@@UAEXXZ @ 339 NONAME ; void CSenWebServiceSession::StartTransaction(void)
+	?StatusL@CSenServiceSession@@UAEHXZ @ 340 NONAME ; int CSenServiceSession::StatusL(void)
+	?SubmitL@CSenServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAPAVHBufC8@@@Z @ 341 NONAME ; int CSenServiceSession::SubmitL(class TDesC8 const &, class TDesC8 const &, class MSenRemoteServiceConsumer &, class HBufC8 * &)
+	?SubmitL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAPAVHBufC8@@@Z @ 342 NONAME ; int CSenWebServiceSession::SubmitL(class TDesC8 const &, class TDesC8 const &, class MSenRemoteServiceConsumer &, class HBufC8 * &)
+	?SubmitSoapL@CSenWebServiceSession@@UAEHABVTDesC8@@0AAVMSenRemoteServiceConsumer@@AAPAVHBufC8@@@Z @ 343 NONAME ; int CSenWebServiceSession::SubmitSoapL(class TDesC8 const &, class TDesC8 const &, class MSenRemoteServiceConsumer &, class HBufC8 * &)
+	?TopLayer@CSenLayeredTransportProperties@@UAE?AW4TSenPropertiesLayer@MSenLayeredProperties@@XZ @ 344 NONAME ; enum MSenLayeredProperties::TSenPropertiesLayer CSenLayeredTransportProperties::TopLayer(void)
+	?TransactionCompleted@CSenWebServiceSession@@UAEXXZ @ 345 NONAME ; void CSenWebServiceSession::TransactionCompleted(void)
+	?TransformL@CSaslMechanism@@UBEPAVHBufC8@@VTPtrC8@@@Z @ 346 NONAME ; class HBufC8 * CSaslMechanism::TransformL(class TPtrC8) const
+	?Transport@CSenServiceSession@@UBEPAVMSenTransport@@XZ @ 347 NONAME ; class MSenTransport * CSenServiceSession::Transport(void) const
+	?TransportCue@CSenServiceSession@@UAE?AVTPtrC8@@XZ @ 348 NONAME ; class TPtrC8 CSenServiceSession::TransportCue(void)
+	?TransportCue@CSenWSDescription@@UAE?AVTPtrC8@@XZ @ 349 NONAME ; class TPtrC8 CSenWSDescription::TransportCue(void)
+	?TransportCue@CSenWebServiceSession@@UAE?AVTPtrC8@@XZ @ 350 NONAME ; class TPtrC8 CSenWebServiceSession::TransportCue(void)
+	?TransportL@CSenServiceSession@@UAEAAVMSenTransport@@AAVMSenRemoteServiceConsumer@@@Z @ 351 NONAME ; class MSenTransport & CSenServiceSession::TransportL(class MSenRemoteServiceConsumer &)
+	?TransportPropertiesL@CSenServiceSession@@UAEHAAPAVHBufC8@@AAVMSenRemoteServiceConsumer@@@Z @ 352 NONAME ; int CSenServiceSession::TransportPropertiesL(class HBufC8 * &, class MSenRemoteServiceConsumer &)
+	?TryToSearchValidCredentialL@CSenWebServiceSession@@QAEHXZ @ 353 NONAME ; int CSenWebServiceSession::TryToSearchValidCredentialL(void)
+	?UserAgentL@CSenLayeredTransportProperties@@UAEHAAVTPtrC8@@@Z @ 354 NONAME ; int CSenLayeredTransportProperties::UserAgentL(class TPtrC8 &)
+	?ValidUntilL@CSenWebServiceSession@@UAEABVTTime@@XZ @ 355 NONAME ; class TTime const & CSenWebServiceSession::ValidUntilL(void)
+	?WriteAsXMLToL@CSenHandlerBase@@UAEXAAVRWriteStream@@@Z @ 356 NONAME ; void CSenHandlerBase::WriteAsXMLToL(class RWriteStream &)
+	?WriteAsXMLToL@CSenWebServiceSession@@UAEXAAVRWriteStream@@@Z @ 357 NONAME ; void CSenWebServiceSession::WriteAsXMLToL(class RWriteStream &)
+	?WriteExtensionsAsXMLToL@CSenServiceSession@@UAEXAAVRWriteStream@@@Z @ 358 NONAME ; void CSenServiceSession::WriteExtensionsAsXMLToL(class RWriteStream &)
+	?WriteToL@CSenLayeredTransportProperties@@UAEXAAVRWriteStream@@@Z @ 359 NONAME ; void CSenLayeredTransportProperties::WriteToL(class RWriteStream &)
+	?WriteToL@CSenLayeredTransportProperties@@UAEXAAVRWriteStream@@W4TSenPropertiesLayer@MSenLayeredProperties@@@Z @ 360 NONAME ; void CSenLayeredTransportProperties::WriteToL(class RWriteStream &, enum MSenLayeredProperties::TSenPropertiesLayer)
+	?XmlReader@CSenWebServiceSession@@UAEPAVCSenXmlReader@@XZ @ 361 NONAME ; class CSenXmlReader * CSenWebServiceSession::XmlReader(void)
+	?SnapDialogL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 362 NONAME ; int CSenLayeredTransportProperties::SnapDialogL(int &)
+	?SnapIdL@CSenLayeredTransportProperties@@UAEHAAK@Z @ 363 NONAME ; int CSenLayeredTransportProperties::SnapIdL(unsigned long &)
+	?ConsumerSnapId@CSenWSPattern@@UAEHAAK@Z @ 364 NONAME ; int CSenWSPattern::ConsumerSnapId(unsigned long &)
+	?SetConsumerSnapIdL@CSenWSPattern@@UAEXK@Z @ 365 NONAME ; void CSenWSPattern::SetConsumerSnapIdL(unsigned long)
+	?SetSnapIdL@CSenWSDescription@@UAEXK@Z @ 366 NONAME ; void CSenWSDescription::SetSnapIdL(unsigned long)
+	?SnapId@CSenWSDescription@@UAEHAAK@Z @ 367 NONAME ; int CSenWSDescription::SnapId(unsigned long &)
+	?BoundaryLineStartL@SenMtomUtils@@SAXABVRBuf8@@AAV2@@Z @ 368 NONAME ; void SenMtomUtils::BoundaryLineStartL(class RBuf8 const &, class RBuf8 &)
+	?GenerateRandomBoundaryL@SenMtomUtils@@SAXAAVRBuf8@@@Z @ 369 NONAME ; void SenMtomUtils::GenerateRandomBoundaryL(class RBuf8 &)
+	?SetDataTrafficDetails@CSenInternalServiceConsumer@@UAEXAAUTSenDataTrafficDetails@@@Z @ 370 NONAME ; void CSenInternalServiceConsumer::SetDataTrafficDetails(struct TSenDataTrafficDetails &)
+	?FileDataPartL@SenMtomUtils@@SAXIIAAV?$RArray@VTXmlEngDataContainer@@@@AAVRBuf8@@@Z @ 371 NONAME ; void SenMtomUtils::FileDataPartL(unsigned int, unsigned int, class RArray<class TXmlEngDataContainer> &, class RBuf8 &)
+	?HeaderRootL@SenMtomUtils@@SAXAAVCSenSoapEnvelope2@@ABVRBuf8@@AAV3@@Z @ 372 NONAME ; void SenMtomUtils::HeaderRootL(class CSenSoapEnvelope2 &, class RBuf8 const &, class RBuf8 &)
+	?CidL@SenMtomUtils@@SAXABVRBuf8@@AAV?$RArray@VRBuf8@@@@@Z @ 373 NONAME ; void SenMtomUtils::CidL(class RBuf8 const &, class RArray<class RBuf8> &)
+	?GenerateRandomRootCidL@SenMtomUtils@@SAXAAVRBuf8@@@Z @ 374 NONAME ; void SenMtomUtils::GenerateRandomRootCidL(class RBuf8 &)
+	?SerializeEnvelope2L@SenMtomUtils@@SAXAAVCSenSoapEnvelope2@@AAVRBuf8@@@Z @ 375 NONAME ; void SenMtomUtils::SerializeEnvelope2L(class CSenSoapEnvelope2 &, class RBuf8 &)
+	?BoundaryLineEndL@SenMtomUtils@@SAXABVRBuf8@@AAV2@@Z @ 376 NONAME ; void SenMtomUtils::BoundaryLineEndL(class RBuf8 const &, class RBuf8 &)
+	?SetFileL@SenMtomUtils@@SAHIHAAVTDesC8@@AAV?$RArray@VRBuf8@@@@@Z @ 377 NONAME ; int SenMtomUtils::SetFileL(unsigned int, int, class TDesC8 &, class RArray<class RBuf8> &)
+	?FileDataRestL@SenMtomUtils@@SAXIIIAAV?$RArray@VTXmlEngDataContainer@@@@AAVRBuf8@@@Z @ 378 NONAME ; void SenMtomUtils::FileDataRestL(unsigned int, unsigned int, unsigned int, class RArray<class TXmlEngDataContainer> &, class RBuf8 &)
+	?HeaderBinaryDataL@SenMtomUtils@@SAXIAAV?$RArray@VTXmlEngDataContainer@@@@AAVRBuf8@@@Z @ 379 NONAME ; void SenMtomUtils::HeaderBinaryDataL(unsigned int, class RArray<class TXmlEngDataContainer> &, class RBuf8 &)
+	?SetMinRetryTTLL@CSenLayeredTransportProperties@@UAEHH@Z @ 380 NONAME ; int CSenLayeredTransportProperties::SetMinRetryTTLL(int)
+	?MaxRetryTTLL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 381 NONAME ; int CSenLayeredTransportProperties::MaxRetryTTLL(int &)
+	?MinRetryTTLL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 382 NONAME ; int CSenLayeredTransportProperties::MinRetryTTLL(int &)
+	?SetMaxRetryTTLL@CSenLayeredTransportProperties@@UAEHH@Z @ 383 NONAME ; int CSenLayeredTransportProperties::SetMaxRetryTTLL(int)
+	?SetRetryDeltaTimeoutL@CSenLayeredTransportProperties@@UAEHH@Z @ 384 NONAME ; int CSenLayeredTransportProperties::SetRetryDeltaTimeoutL(int)
+	?RetryDeltaTimeoutL@CSenLayeredTransportProperties@@UAEHAAH@Z @ 385 NONAME ; int CSenLayeredTransportProperties::RetryDeltaTimeoutL(int &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/eabi/SENFRAMEWORKu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,586 @@
+EXPORTS
+	_ZN11CSenContext14BaseConstructLEv @ 1 NONAME
+	_ZN11CSenContext4NewLEN10SenContext17TContextDirectionE @ 2 NONAME
+	_ZN11CSenContext5NewLCEN10SenContext17TContextDirectionE @ 3 NONAME
+	_ZN11CSenContextC1EN10SenContext17TContextDirectionE @ 4 NONAME
+	_ZN11CSenContextC2EN10SenContext17TContextDirectionE @ 5 NONAME
+	_ZN11CSenContextD0Ev @ 6 NONAME
+	_ZN11CSenContextD1Ev @ 7 NONAME
+	_ZN11CSenContextD2Ev @ 8 NONAME
+	_ZN13CSenWSPattern13ConsumerIapIdERm @ 9 NONAME
+	_ZN13CSenWSPattern13HasSuperClassEN22MSenServiceDescription21TDescriptionClassTypeE @ 10 NONAME
+	_ZN13CSenWSPattern13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 11 NONAME
+	_ZN13CSenWSPattern14BaseConstructLERK6TDesC8 @ 12 NONAME
+	_ZN13CSenWSPattern14BaseConstructLERK6TDesC8S2_ @ 13 NONAME
+	_ZN13CSenWSPattern14BaseConstructLEv @ 14 NONAME
+	_ZN13CSenWSPattern14ConsumerSnapIdERm @ 15 NONAME
+	_ZN13CSenWSPattern17SetConsumerIapIdLEm @ 16 NONAME
+	_ZN13CSenWSPattern18SetConsumerSnapIdLEm @ 17 NONAME
+	_ZN13CSenWSPattern20ConsumerPolicyAsXmlLEv @ 18 NONAME
+	_ZN13CSenWSPattern21AcceptsConsumerPolicyER18MSenConsumerPolicy @ 19 NONAME
+	_ZN13CSenWSPattern25RebuildFromConsumerPolicyER18MSenConsumerPolicy @ 20 NONAME
+	_ZN13CSenWSPattern29ConsumerIdentityProviderIds8LEv @ 21 NONAME
+	_ZN13CSenWSPattern30AddConsumerIdentityProviderIdLERK6TDesC8 @ 22 NONAME
+	_ZN13CSenWSPattern31SetConsumerIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 23 NONAME
+	_ZN13CSenWSPattern4NewLERK6TDesC8 @ 24 NONAME
+	_ZN13CSenWSPattern4NewLERK6TDesC8S2_ @ 25 NONAME
+	_ZN13CSenWSPattern4NewLEv @ 26 NONAME
+	_ZN13CSenWSPattern5NewLCERK6TDesC8 @ 27 NONAME
+	_ZN13CSenWSPattern5NewLCERK6TDesC8S2_ @ 28 NONAME
+	_ZN13CSenWSPattern5NewLCEv @ 29 NONAME
+	_ZN13CSenWSPattern7MatchesER22MSenServiceDescription @ 30 NONAME
+	_ZN13CSenWSPatternC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 31 NONAME
+	_ZN13CSenWSPatternC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 32 NONAME
+	_ZN13CSenWSPatternD0Ev @ 33 NONAME
+	_ZN13CSenWSPatternD1Ev @ 34 NONAME
+	_ZN13CSenWSPatternD2Ev @ 35 NONAME
+	_ZN14CSaslMechanism10Password8LEv @ 36 NONAME
+	_ZN14CSaslMechanism11MaxAttemptsEv @ 37 NONAME
+	_ZN14CSaslMechanism11SetIdentityEP20CSenIdentityProviderP19MSenIdentityManager @ 38 NONAME
+	_ZN14CSaslMechanism13SetTransformsE13RPointerArrayI21CSenPasswordTransformE @ 39 NONAME
+	_ZN14CSaslMechanism14ClearPasswordLEv @ 40 NONAME
+	_ZN14CSaslMechanism18IsPasswordFromUserEv @ 41 NONAME
+	_ZN14CSaslMechanism4NewLEv @ 42 NONAME
+	_ZN14CSaslMechanism5NewLCEv @ 43 NONAME
+	_ZN14CSaslMechanism7AccountEv @ 44 NONAME
+	_ZN14CSaslMechanism8InitFromES_ @ 45 NONAME
+	_ZN14CSaslMechanismC1Ev @ 46 NONAME
+	_ZN14CSaslMechanismC2Ev @ 47 NONAME
+	_ZN14CSaslMechanismD0Ev @ 48 NONAME
+	_ZN14CSaslMechanismD1Ev @ 49 NONAME
+	_ZN14CSaslMechanismD2Ev @ 50 NONAME
+	_ZN15CSenContextItem4NewLEP11CSenElement @ 51 NONAME
+	_ZN15CSenContextItem4NewLEP13CSenAtomEntry @ 52 NONAME
+	_ZN15CSenContextItem4NewLEP13CSenXmlReader @ 53 NONAME
+	_ZN15CSenContextItem4NewLEP15CSenMessageBase @ 54 NONAME
+	_ZN15CSenContextItem4NewLEP15CSenSoapMessage @ 55 NONAME
+	_ZN15CSenContextItem4NewLEP17CSenSoapEnvelope2 @ 56 NONAME
+	_ZN15CSenContextItem4NewLEP17CSenWSDescription @ 57 NONAME
+	_ZN15CSenContextItem4NewLEP17CSenXmlProperties @ 58 NONAME
+	_ZN15CSenContextItem4NewLEP24CSenLayeredXmlProperties @ 59 NONAME
+	_ZN15CSenContextItem4NewLEP6TDesC8 @ 60 NONAME
+	_ZN15CSenContextItem4NewLEP9CSenChunk @ 61 NONAME
+	_ZN15CSenContextItem4NewLEPi @ 62 NONAME
+	_ZN15CSenContextItem4NewLEPj @ 63 NONAME
+	_ZN15CSenContextItem4NewLEPv @ 64 NONAME
+	_ZN15CSenContextItem4NewLER11CSenElement @ 65 NONAME
+	_ZN15CSenContextItem4NewLER11MSenMessage @ 66 NONAME
+	_ZN15CSenContextItem4NewLER13CSenXmlReader @ 67 NONAME
+	_ZN15CSenContextItem4NewLER14MSenProperties @ 68 NONAME
+	_ZN15CSenContextItem4NewLER15CSenSoapMessage @ 69 NONAME
+	_ZN15CSenContextItem4NewLER17CSenWSDescription @ 70 NONAME
+	_ZN15CSenContextItem4NewLER17MSenRemoteHostlet @ 71 NONAME
+	_ZN15CSenContextItem4NewLER22MSenCoreServiceManager @ 72 NONAME
+	_ZN15CSenContextItem4NewLER25MSenRemoteServiceConsumer @ 73 NONAME
+	_ZN15CSenContextItem4NewLER9CSenChunk @ 74 NONAME
+	_ZN15CSenContextItem4NewLERK6TDesC8 @ 75 NONAME
+	_ZN15CSenContextItem4NewLEi @ 76 NONAME
+	_ZN15CSenContextItem4NewLEj @ 77 NONAME
+	_ZN15CSenContextItem5NewLCEP11CSenElement @ 78 NONAME
+	_ZN15CSenContextItem5NewLCEP13CSenAtomEntry @ 79 NONAME
+	_ZN15CSenContextItem5NewLCEP13CSenXmlReader @ 80 NONAME
+	_ZN15CSenContextItem5NewLCEP15CSenMessageBase @ 81 NONAME
+	_ZN15CSenContextItem5NewLCEP15CSenSoapMessage @ 82 NONAME
+	_ZN15CSenContextItem5NewLCEP17CSenSoapEnvelope2 @ 83 NONAME
+	_ZN15CSenContextItem5NewLCEP17CSenWSDescription @ 84 NONAME
+	_ZN15CSenContextItem5NewLCEP17CSenXmlProperties @ 85 NONAME
+	_ZN15CSenContextItem5NewLCEP24CSenLayeredXmlProperties @ 86 NONAME
+	_ZN15CSenContextItem5NewLCEP6TDesC8 @ 87 NONAME
+	_ZN15CSenContextItem5NewLCEP9CSenChunk @ 88 NONAME
+	_ZN15CSenContextItem5NewLCEPi @ 89 NONAME
+	_ZN15CSenContextItem5NewLCEPj @ 90 NONAME
+	_ZN15CSenContextItem5NewLCEPv @ 91 NONAME
+	_ZN15CSenContextItem5NewLCER11CSenElement @ 92 NONAME
+	_ZN15CSenContextItem5NewLCER11MSenMessage @ 93 NONAME
+	_ZN15CSenContextItem5NewLCER13CSenXmlReader @ 94 NONAME
+	_ZN15CSenContextItem5NewLCER14MSenProperties @ 95 NONAME
+	_ZN15CSenContextItem5NewLCER15CSenSoapMessage @ 96 NONAME
+	_ZN15CSenContextItem5NewLCER17CSenWSDescription @ 97 NONAME
+	_ZN15CSenContextItem5NewLCER17MSenRemoteHostlet @ 98 NONAME
+	_ZN15CSenContextItem5NewLCER22MSenCoreServiceManager @ 99 NONAME
+	_ZN15CSenContextItem5NewLCER25MSenRemoteServiceConsumer @ 100 NONAME
+	_ZN15CSenContextItem5NewLCER9CSenChunk @ 101 NONAME
+	_ZN15CSenContextItem5NewLCERK6TDesC8 @ 102 NONAME
+	_ZN15CSenContextItem5NewLCEi @ 103 NONAME
+	_ZN15CSenContextItem5NewLCEj @ 104 NONAME
+	_ZN15CSenContextItemD0Ev @ 105 NONAME
+	_ZN15CSenContextItemD1Ev @ 106 NONAME
+	_ZN15CSenContextItemD2Ev @ 107 NONAME
+	_ZN15CSenHandlerBase13WriteAsXMLToLER12RWriteStream @ 108 NONAME
+	_ZN15CSenHandlerBase22ProcessHandlerContextLER18MSenHandlerContext @ 109 NONAME
+	_ZN15CSenHandlerBase6AsXmlLEv @ 110 NONAME
+	_ZN15CSenHandlerBaseC2Ev @ 111 NONAME
+	_ZN15CSenHandlerBaseD0Ev @ 112 NONAME
+	_ZN15CSenHandlerBaseD1Ev @ 113 NONAME
+	_ZN15CSenHandlerBaseD2Ev @ 114 NONAME
+	_ZN17CSenClientContext14BaseConstructLEv @ 115 NONAME
+	_ZN17CSenClientContext4NewLEiR22CSenApplicationContext @ 116 NONAME
+	_ZN17CSenClientContext5NewLCEiR22CSenApplicationContext @ 117 NONAME
+	_ZN17CSenClientContextC1EiR22CSenApplicationContext @ 118 NONAME
+	_ZN17CSenClientContextC2EiR22CSenApplicationContext @ 119 NONAME
+	_ZN17CSenClientContextD0Ev @ 120 NONAME
+	_ZN17CSenClientContextD1Ev @ 121 NONAME
+	_ZN17CSenClientContextD2Ev @ 122 NONAME
+	_ZN17CSenServerContext14BaseConstructLEv @ 123 NONAME
+	_ZN17CSenServerContext4NewLER22MSenCoreServiceManager @ 124 NONAME
+	_ZN17CSenServerContext5NewLCER22MSenCoreServiceManager @ 125 NONAME
+	_ZN17CSenServerContextC1ER22MSenCoreServiceManager @ 126 NONAME
+	_ZN17CSenServerContextC2ER22MSenCoreServiceManager @ 127 NONAME
+	_ZN17CSenServerContextD0Ev @ 128 NONAME
+	_ZN17CSenServerContextD1Ev @ 129 NONAME
+	_ZN17CSenServerContextD2Ev @ 130 NONAME
+	_ZN17CSenSyncRequester14BaseConstructLEv @ 131 NONAME
+	_ZN17CSenSyncRequester4NewLER13MSenTransportR22MSenCoreServiceManager @ 132 NONAME
+	_ZN17CSenSyncRequester5NewLCER13MSenTransportR22MSenCoreServiceManager @ 133 NONAME
+	_ZN17CSenSyncRequesterC1ER13MSenTransportR22MSenCoreServiceManager @ 134 NONAME
+	_ZN17CSenSyncRequesterC2ER13MSenTransportR22MSenCoreServiceManager @ 135 NONAME
+	_ZN17CSenSyncRequesterD0Ev @ 136 NONAME
+	_ZN17CSenSyncRequesterD1Ev @ 137 NONAME
+	_ZN17CSenSyncRequesterD2Ev @ 138 NONAME
+	_ZN17CSenWSDescription10SetPolicyLERK6TDesC8 @ 139 NONAME
+	_ZN17CSenWSDescription10SetPolicyLERK6TDesC8S2_ @ 140 NONAME
+	_ZN17CSenWSDescription10SetPolicyLERK6TDesC8S2_S2_S2_ @ 141 NONAME
+	_ZN17CSenWSDescription10SetSnapIdLEm @ 142 NONAME
+	_ZN17CSenWSDescription12TransportCueEv @ 143 NONAME
+	_ZN17CSenWSDescription13HasSuperClassEN22MSenServiceDescription21TDescriptionClassTypeE @ 144 NONAME
+	_ZN17CSenWSDescription13ServicePolicyEv @ 145 NONAME
+	_ZN17CSenWSDescription14SetProviderIdLERK6TDesC8 @ 146 NONAME
+	_ZN17CSenWSDescription16SetTransportCueLERK6TDesC8 @ 147 NONAME
+	_ZN17CSenWSDescription20HasEqualPrimaryKeysLER22MSenServiceDescription @ 148 NONAME
+	_ZN17CSenWSDescription4NewLERK6TDesC8 @ 149 NONAME
+	_ZN17CSenWSDescription4NewLERK6TDesC8S2_ @ 150 NONAME
+	_ZN17CSenWSDescription4NewLEv @ 151 NONAME
+	_ZN17CSenWSDescription5NewLCERK6TDesC8 @ 152 NONAME
+	_ZN17CSenWSDescription5NewLCERK6TDesC8S2_ @ 153 NONAME
+	_ZN17CSenWSDescription5NewLCEv @ 154 NONAME
+	_ZN17CSenWSDescription6SnapIdERm @ 155 NONAME
+	_ZN17CSenWSDescription8IsLocalLEv @ 156 NONAME
+	_ZN17CSenWSDescriptionC1EN22MSenServiceDescription21TDescriptionClassTypeE @ 157 NONAME
+	_ZN17CSenWSDescriptionC2EN22MSenServiceDescription21TDescriptionClassTypeE @ 158 NONAME
+	_ZN17CSenWSDescriptionD0Ev @ 159 NONAME
+	_ZN17CSenWSDescriptionD1Ev @ 160 NONAME
+	_ZN17CSenWSDescriptionD2Ev @ 161 NONAME
+	_ZN17SenMultiPartUtils11HeaderRootLEP11MSenMessageRK5RBuf8RS2_ @ 162 NONAME
+	_ZN17SenMultiPartUtils13FileDataPartLEjjR6RArrayI20TXmlEngDataContainerER5RBuf8 @ 163 NONAME
+	_ZN17SenMultiPartUtils13FileDataRestLEjjjR6RArrayI20TXmlEngDataContainerER5RBuf8 @ 164 NONAME
+	_ZN17SenMultiPartUtils16BoundaryLineEndLERK5RBuf8RS0_ @ 165 NONAME
+	_ZN17SenMultiPartUtils17HeaderBinaryDataLEjR6RArrayI20TXmlEngDataContainerER5RBuf8 @ 166 NONAME
+	_ZN17SenMultiPartUtils17SerializeMessageLER16CSenFragmentBaseR5RBuf821TXmlEngSerializerType @ 167 NONAME
+	_ZN17SenMultiPartUtils18BoundaryLineStartLERK5RBuf8RS0_ @ 168 NONAME
+	_ZN17SenMultiPartUtils22GenerateRandomRootCidLER5RBuf8 @ 169 NONAME
+	_ZN17SenMultiPartUtils23GenerateRandomBoundaryLER5RBuf8 @ 170 NONAME
+	_ZN17SenMultiPartUtils4CidLERK5RBuf8R6RArrayIS0_E @ 171 NONAME
+	_ZN17SenMultiPartUtils8SetFileLEjiR6TDesC8R6RArrayI5RBuf8E @ 172 NONAME
+	_ZN18CSenMessageContext14BaseConstructLEv @ 173 NONAME
+	_ZN18CSenMessageContext4NewLEN10SenContext17TContextDirectionEP14MSenProperties @ 174 NONAME
+	_ZN18CSenMessageContext5NewLCEN10SenContext17TContextDirectionEP14MSenProperties @ 175 NONAME
+	_ZN18CSenMessageContextC1EN10SenContext17TContextDirectionEP14MSenProperties @ 176 NONAME
+	_ZN18CSenMessageContextC2EN10SenContext17TContextDirectionEP14MSenProperties @ 177 NONAME
+	_ZN18CSenMessageContextD0Ev @ 178 NONAME
+	_ZN18CSenMessageContextD1Ev @ 179 NONAME
+	_ZN18CSenMessageContextD2Ev @ 180 NONAME
+	_ZN18CSenServiceSession10FacetValueER6TDesC8RP6HBufC8 @ 181 NONAME
+	_ZN18CSenServiceSession10RefreshMTLERP6HBufC8 @ 182 NONAME
+	_ZN18CSenServiceSession10SetStatusLEv @ 183 NONAME
+	_ZN18CSenServiceSession10TransportLER25MSenRemoteServiceConsumer @ 184 NONAME
+	_ZN18CSenServiceSession11FrameworkIdEv @ 185 NONAME
+	_ZN18CSenServiceSession11RemoveFacetERK6TDesC8 @ 186 NONAME
+	_ZN18CSenServiceSession11ScoreMatchLER22MSenServiceDescription @ 187 NONAME
+	_ZN18CSenServiceSession11SetHostletLEP17MSenRemoteHostlet @ 188 NONAME
+	_ZN18CSenServiceSession12TransportCueEv @ 189 NONAME
+	_ZN18CSenServiceSession13HasSuperClassEN22MSenServiceDescription21TDescriptionClassTypeE @ 190 NONAME
+	_ZN18CSenServiceSession13SetTransportLEP17CSenTransportBase @ 191 NONAME
+	_ZN18CSenServiceSession14BaseConstructLEv @ 192 NONAME
+	_ZN18CSenServiceSession14ComputeStatusLEv @ 193 NONAME
+	_ZN18CSenServiceSession14ParseResponseLERK6TDesC8RP6HBufC8 @ 194 NONAME
+	_ZN18CSenServiceSession14SendToHostletLER17MSenRemoteHostletRK6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 195 NONAME
+	_ZN18CSenServiceSession15InitializeFromLER22MSenServiceDescription @ 196 NONAME
+	_ZN18CSenServiceSession15RemoteConsumerLERK6TDesC8 @ 197 NONAME
+	_ZN18CSenServiceSession15RemoveConsumerLER25MSenRemoteServiceConsumer @ 198 NONAME
+	_ZN18CSenServiceSession16SetTransportCueLERK6TDesC8 @ 199 NONAME
+	_ZN18CSenServiceSession20AsServiceDescriptionEv @ 200 NONAME
+	_ZN18CSenServiceSession20DescriptionClassTypeEv @ 201 NONAME
+	_ZN18CSenServiceSession20TransportPropertiesLERP6HBufC8R25MSenRemoteServiceConsumer @ 202 NONAME
+	_ZN18CSenServiceSession23ProvideHostletResponseLER17MSenRemoteHostletiiRK6TDesC8R9CSenChunk @ 203 NONAME
+	_ZN18CSenServiceSession23SetTransportPropertiesLERK6TDesC8R25MSenRemoteServiceConsumer @ 204 NONAME
+	_ZN18CSenServiceSession23WriteExtensionsAsXMLToLER12RWriteStream @ 205 NONAME
+	_ZN18CSenServiceSession28CompleteServerMessagesOnOffLERKi @ 206 NONAME
+	_ZN18CSenServiceSession5SaveLEv @ 207 NONAME
+	_ZN18CSenServiceSession5SendLERK6TDesC8S2_R25MSenRemoteServiceConsumerRiRP6HBufC8 @ 208 NONAME
+	_ZN18CSenServiceSession7FacetsLER13RPointerArrayI9CSenFacetE @ 209 NONAME
+	_ZN18CSenServiceSession7MatchesER22MSenServiceDescription @ 210 NONAME
+	_ZN18CSenServiceSession7StatusLEv @ 211 NONAME
+	_ZN18CSenServiceSession7SubmitLERK6TDesC8S2_R25MSenRemoteServiceConsumerRP6HBufC8 @ 212 NONAME
+	_ZN18CSenServiceSession8ContractEv @ 213 NONAME
+	_ZN18CSenServiceSession8EndpointEv @ 214 NONAME
+	_ZN18CSenServiceSession8IsReadyLEv @ 215 NONAME
+	_ZN18CSenServiceSession9AddFacetLERK9CSenFacet @ 216 NONAME
+	_ZN18CSenServiceSession9HasFacetLERK6TDesC8Ri @ 217 NONAME
+	_ZN18CSenServiceSession9SetFacetLERK9CSenFacet @ 218 NONAME
+	_ZN18CSenServiceSessionC2EN22MSenServiceDescription21TDescriptionClassTypeER4MSIF @ 219 NONAME
+	_ZN18CSenServiceSessionD0Ev @ 220 NONAME
+	_ZN18CSenServiceSessionD1Ev @ 221 NONAME
+	_ZN18CSenServiceSessionD2Ev @ 222 NONAME
+	_ZN18CSenSessionContext14BaseConstructLEv @ 223 NONAME
+	_ZN18CSenSessionContext4NewLEv @ 224 NONAME
+	_ZN18CSenSessionContext5NewLCEv @ 225 NONAME
+	_ZN18CSenSessionContextC1Ev @ 226 NONAME
+	_ZN18CSenSessionContextC2Ev @ 227 NONAME
+	_ZN18CSenSessionContextD0Ev @ 228 NONAME
+	_ZN18CSenSessionContextD1Ev @ 229 NONAME
+	_ZN18CSenSessionContextD2Ev @ 230 NONAME
+	_ZN20CSenTransportContext14BaseConstructLER22MSenCoreServiceManagerR17CSenWSDescriptionP18CSenServiceSession @ 231 NONAME
+	_ZN20CSenTransportContext4NewLER22MSenCoreServiceManagerR17CSenWSDescription @ 232 NONAME
+	_ZN20CSenTransportContext4NewLER22MSenCoreServiceManagerR17CSenWSDescriptionR18CSenServiceSession @ 233 NONAME
+	_ZN20CSenTransportContext5NewLCER22MSenCoreServiceManagerR17CSenWSDescription @ 234 NONAME
+	_ZN20CSenTransportContext5NewLCER22MSenCoreServiceManagerR17CSenWSDescriptionR18CSenServiceSession @ 235 NONAME
+	_ZN20CSenTransportContextC1Ev @ 236 NONAME
+	_ZN20CSenTransportContextC2Ev @ 237 NONAME
+	_ZN20CSenTransportContextD0Ev @ 238 NONAME
+	_ZN20CSenTransportContextD1Ev @ 239 NONAME
+	_ZN20CSenTransportContextD2Ev @ 240 NONAME
+	_ZN21CSenWebServiceSession10ConstructLEv @ 241 NONAME
+	_ZN21CSenWebServiceSession10IsExpiredLEv @ 242 NONAME
+	_ZN21CSenWebServiceSession11FrameworkIdEv @ 243 NONAME
+	_ZN21CSenWebServiceSession11HasSecurityEv @ 244 NONAME
+	_ZN21CSenWebServiceSession11NewMessageLERP15CSenSoapMessage @ 245 NONAME
+	_ZN21CSenWebServiceSession11SubmitSoapLERK6TDesC8S2_R25MSenRemoteServiceConsumerRP6HBufC8 @ 246 NONAME
+	_ZN21CSenWebServiceSession11ValidUntilLEv @ 247 NONAME
+	_ZN21CSenWebServiceSession12AddConsumerLER25MSenRemoteServiceConsumer @ 248 NONAME
+	_ZN21CSenWebServiceSession12HandleErrorLEiP6HBufC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 249 NONAME
+	_ZN21CSenWebServiceSession12SetContractLERK6TDesC8 @ 250 NONAME
+	_ZN21CSenWebServiceSession12SetEndPointLERK6TDesC8 @ 251 NONAME
+	_ZN21CSenWebServiceSession12SetSecurityLERK6TDesC8 @ 252 NONAME
+	_ZN21CSenWebServiceSession12SetUserNameLER6TDesC8 @ 253 NONAME
+	_ZN21CSenWebServiceSession12TransportCueEv @ 254 NONAME
+	_ZN21CSenWebServiceSession13HasSuperClassEN22MSenServiceDescription21TDescriptionClassTypeE @ 255 NONAME
+	_ZN21CSenWebServiceSession13ParseMessageLER15CSenSoapMessage @ 256 NONAME
+	_ZN21CSenWebServiceSession13WriteAsXMLToLER12RWriteStream @ 257 NONAME
+	_ZN21CSenWebServiceSession14AddCredentialLER14CSenCredential @ 258 NONAME
+	_ZN21CSenWebServiceSession14ComputeStatusLEv @ 259 NONAME
+	_ZN21CSenWebServiceSession14ParseResponseLERK6TDesC8RP15CSenSoapMessage @ 260 NONAME
+	_ZN21CSenWebServiceSession14ParseResponseLERK6TDesC8RP6HBufC8 @ 261 NONAME
+	_ZN21CSenWebServiceSession14SendToHostletLER17MSenRemoteHostletRK6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 262 NONAME
+	_ZN21CSenWebServiceSession15InitializeFromLER22MSenServiceDescription @ 263 NONAME
+	_ZN21CSenWebServiceSession15SendToConsumerLEP6HBufC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 264 NONAME
+	_ZN21CSenWebServiceSession16FrameworkVersionEv @ 265 NONAME
+	_ZN21CSenWebServiceSession16GetCredentialIdLEv @ 266 NONAME
+	_ZN21CSenWebServiceSession16HandleSoapFaultLEP15CSenSoapMessageRP6HBufC8 @ 267 NONAME
+	_ZN21CSenWebServiceSession16HandleSoapFaultLEP15CSenSoapMessageiiR25MSenRemoteServiceConsumerP14MSenProperties @ 268 NONAME
+	_ZN21CSenWebServiceSession16SetTransportCueLERK6TDesC8 @ 269 NONAME
+	_ZN21CSenWebServiceSession16StartTransactionEv @ 270 NONAME
+	_ZN21CSenWebServiceSession17CredentialChangedEN22MSenCredentialObserver20TSenCredentialChangeEPv @ 271 NONAME
+	_ZN21CSenWebServiceSession17SetCredentialPtrLE17RSenCredentialPtr @ 272 NONAME
+	_ZN21CSenWebServiceSession18MessageForSendingLERK6TDesC8S2_RP15CSenSoapMessage @ 273 NONAME
+	_ZN21CSenWebServiceSession20ClientServerIntervalEv @ 274 NONAME
+	_ZN21CSenWebServiceSession20SendErrorToConsumerLEiP6HBufC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 275 NONAME
+	_ZN21CSenWebServiceSession20SetFrameworkHeadersLER15CSenSoapMessage @ 276 NONAME
+	_ZN21CSenWebServiceSession20TransactionCompletedEv @ 277 NONAME
+	_ZN21CSenWebServiceSession22AddCredentialObserverLER22CSenInternalCredential @ 278 NONAME
+	_ZN21CSenWebServiceSession23ConstructSecurityTokenLER14CSenCredentialRP6HBufC8 @ 279 NONAME
+	_ZN21CSenWebServiceSession23ProvideHostletResponseLER17MSenRemoteHostletiiRK6TDesC8R9CSenChunk @ 280 NONAME
+	_ZN21CSenWebServiceSession24SetClientServerIntervalLE25TTimeIntervalMicroSeconds @ 281 NONAME
+	_ZN21CSenWebServiceSession25FillCredentialIdentifierLER24CSenCredentialIdentifier @ 282 NONAME
+	_ZN21CSenWebServiceSession26SendSoapMessageToConsumerLEP15CSenSoapMessageiR25MSenRemoteServiceConsumerP14MSenProperties @ 283 NONAME
+	_ZN21CSenWebServiceSession27TryToSearchValidCredentialLEv @ 284 NONAME
+	_ZN21CSenWebServiceSession5SendLERK6TDesC8S2_R25MSenRemoteServiceConsumerRiRP6HBufC8 @ 285 NONAME
+	_ZN21CSenWebServiceSession7SubmitLERK6TDesC8S2_R25MSenRemoteServiceConsumerRP6HBufC8 @ 286 NONAME
+	_ZN21CSenWebServiceSession8ConsumerEv @ 287 NONAME
+	_ZN21CSenWebServiceSession8ContractEv @ 288 NONAME
+	_ZN21CSenWebServiceSession8EndpointEv @ 289 NONAME
+	_ZN21CSenWebServiceSession8IsReadyLEv @ 290 NONAME
+	_ZN21CSenWebServiceSession9SecurityLEv @ 291 NONAME
+	_ZN21CSenWebServiceSession9SendSoapLERK6TDesC8S2_R25MSenRemoteServiceConsumerRiRP6HBufC8 @ 292 NONAME
+	_ZN21CSenWebServiceSession9XmlReaderEv @ 293 NONAME
+	_ZN21CSenWebServiceSessionC1EN22MSenServiceDescription21TDescriptionClassTypeER4MSIF @ 294 NONAME
+	_ZN21CSenWebServiceSessionC2EN22MSenServiceDescription21TDescriptionClassTypeER4MSIF @ 295 NONAME
+	_ZN21CSenWebServiceSessionD0Ev @ 296 NONAME
+	_ZN21CSenWebServiceSessionD1Ev @ 297 NONAME
+	_ZN21CSenWebServiceSessionD2Ev @ 298 NONAME
+	_ZN22CSenApplicationContext14BaseConstructLEv @ 299 NONAME
+	_ZN22CSenApplicationContext4NewLE9TSecureIdR17CSenServerContext @ 300 NONAME
+	_ZN22CSenApplicationContext5NewLCE9TSecureIdR17CSenServerContext @ 301 NONAME
+	_ZN22CSenApplicationContextC1E9TSecureIdR17CSenServerContext @ 302 NONAME
+	_ZN22CSenApplicationContextC2E9TSecureIdR17CSenServerContext @ 303 NONAME
+	_ZN22CSenApplicationContextD0Ev @ 304 NONAME
+	_ZN22CSenApplicationContextD1Ev @ 305 NONAME
+	_ZN22CSenApplicationContextD2Ev @ 306 NONAME
+	_ZN27CSenInternalServiceConsumer10ConstructLEv @ 307 NONAME
+	_ZN27CSenInternalServiceConsumer10SetStatusLEi @ 308 NONAME
+	_ZN27CSenInternalServiceConsumer11SetSessionLER24MSenRemoteServiceSession @ 309 NONAME
+	_ZN27CSenInternalServiceConsumer12FileProgressEiiiRK6TDesC8i @ 310 NONAME
+	_ZN27CSenInternalServiceConsumer12HandleErrorLEP6HBufC8iiP14MSenProperties @ 311 NONAME
+	_ZN27CSenInternalServiceConsumer13ChunkByTxnIdLEiRP9CSenChunk @ 312 NONAME
+	_ZN27CSenInternalServiceConsumer13HasSuperClassEN22MSenServiceDescription21TDescriptionClassTypeE @ 313 NONAME
+	_ZN27CSenInternalServiceConsumer14HandleMessageLEP6HBufC8iP14MSenProperties @ 314 NONAME
+	_ZN27CSenInternalServiceConsumer8IsReadyLEv @ 315 NONAME
+	_ZN27CSenInternalServiceConsumer9FrameworkEv @ 316 NONAME
+	_ZN27CSenInternalServiceConsumerC2EN22MSenServiceDescription21TDescriptionClassTypeER4CSIF @ 317 NONAME
+	_ZN27CSenInternalServiceConsumerD0Ev @ 318 NONAME
+	_ZN27CSenInternalServiceConsumerD1Ev @ 319 NONAME
+	_ZN27CSenInternalServiceConsumerD2Ev @ 320 NONAME
+	_ZN30CSenLayeredTransportProperties10HeartbeatLERi @ 321 NONAME
+	_ZN30CSenLayeredTransportProperties10IAPDialogLERi @ 322 NONAME
+	_ZN30CSenLayeredTransportProperties10ProxyHostLER6TPtrC8 @ 323 NONAME
+	_ZN30CSenLayeredTransportProperties10ProxyPortLERi @ 324 NONAME
+	_ZN30CSenLayeredTransportProperties10UserAgentLER6TPtrC8 @ 325 NONAME
+	_ZN30CSenLayeredTransportProperties11ProxyUsageLERi @ 326 NONAME
+	_ZN30CSenLayeredTransportProperties11SnapDialogLERi @ 327 NONAME
+	_ZN30CSenLayeredTransportProperties11SoapActionLER6TPtrC8 @ 328 NONAME
+	_ZN30CSenLayeredTransportProperties12IntPropertyLERK6TDesC8Ri @ 329 NONAME
+	_ZN30CSenLayeredTransportProperties12IntPropertyLERK6TDesC8RiN21MSenLayeredProperties19TSenPropertiesLayerE @ 330 NONAME
+	_ZN30CSenLayeredTransportProperties12IsSafeToCastEN14MSenProperties23TSenPropertiesClassTypeE @ 331 NONAME
+	_ZN30CSenLayeredTransportProperties12SetPropertyLERK6TDesC8S2_ @ 332 NONAME
+	_ZN30CSenLayeredTransportProperties12SetPropertyLERK6TDesC8S2_N21MSenLayeredProperties19TSenPropertiesLayerE @ 333 NONAME
+	_ZN30CSenLayeredTransportProperties12SetPropertyLERK6TDesC8S2_S2_ @ 334 NONAME
+	_ZN30CSenLayeredTransportProperties13BoolPropertyLERK6TDesC8Ri @ 335 NONAME
+	_ZN30CSenLayeredTransportProperties13BoolPropertyLERK6TDesC8RiN21MSenLayeredProperties19TSenPropertiesLayerE @ 336 NONAME
+	_ZN30CSenLayeredTransportProperties13MwsNamespaceLER6TPtrC8 @ 337 NONAME
+	_ZN30CSenLayeredTransportProperties14BaseConstructLERK11CSenElementP11RStringPool @ 338 NONAME
+	_ZN30CSenLayeredTransportProperties14BaseConstructLERK6TDesC8S2_P13CSenXmlReaderP11RStringPool @ 339 NONAME
+	_ZN30CSenLayeredTransportProperties14BaseConstructLERK6TDesC8S2_S2_P13CSenXmlReaderP11RStringPool @ 340 NONAME
+	_ZN30CSenLayeredTransportProperties14BaseConstructLERK6TDesC8S2_S2_S2_P13CSenXmlReaderP11RStringPool @ 341 NONAME
+	_ZN30CSenLayeredTransportProperties14MaxTimeToLiveLERi @ 342 NONAME
+	_ZN30CSenLayeredTransportProperties14MinTimeToLiveLERi @ 343 NONAME
+	_ZN30CSenLayeredTransportProperties15DownloadFolderLER6TPtrC8 @ 344 NONAME
+	_ZN30CSenLayeredTransportProperties15FileAttachmentLERK6TDesC8RP6HBufC8 @ 345 NONAME
+	_ZN30CSenLayeredTransportProperties15SetIntPropertyLERK6TDesC8i @ 346 NONAME
+	_ZN30CSenLayeredTransportProperties15SetIntPropertyLERK6TDesC8iN21MSenLayeredProperties19TSenPropertiesLayerE @ 347 NONAME
+	_ZN30CSenLayeredTransportProperties16SetBoolPropertyLERK6TDesC8i @ 348 NONAME
+	_ZN30CSenLayeredTransportProperties16SetBoolPropertyLERK6TDesC8iN21MSenLayeredProperties19TSenPropertiesLayerE @ 349 NONAME
+	_ZN30CSenLayeredTransportProperties17PropertiesByTypeLERK6TDesC8R13RPointerArrayI12MSenPropertyE @ 350 NONAME
+	_ZN30CSenLayeredTransportProperties19PropertiesClassTypeEv @ 351 NONAME
+	_ZN30CSenLayeredTransportProperties4NewLER11RStringPool @ 352 NONAME
+	_ZN30CSenLayeredTransportProperties4NewLERK11CSenElement @ 353 NONAME
+	_ZN30CSenLayeredTransportProperties4NewLERK11CSenElementR11RStringPool @ 354 NONAME
+	_ZN30CSenLayeredTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 355 NONAME
+	_ZN30CSenLayeredTransportProperties4NewLERK6TDesC8R13CSenXmlReaderR11RStringPool @ 356 NONAME
+	_ZN30CSenLayeredTransportProperties4NewLEv @ 357 NONAME
+	_ZN30CSenLayeredTransportProperties5NewLCER11RStringPool @ 358 NONAME
+	_ZN30CSenLayeredTransportProperties5NewLCERK11CSenElement @ 359 NONAME
+	_ZN30CSenLayeredTransportProperties5NewLCERK11CSenElementR11RStringPool @ 360 NONAME
+	_ZN30CSenLayeredTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 361 NONAME
+	_ZN30CSenLayeredTransportProperties5NewLCERK6TDesC8R13CSenXmlReaderR11RStringPool @ 362 NONAME
+	_ZN30CSenLayeredTransportProperties5NewLCEv @ 363 NONAME
+	_ZN30CSenLayeredTransportProperties6IapIdLERm @ 364 NONAME
+	_ZN30CSenLayeredTransportProperties7AsUtf8LEN21MSenLayeredProperties19TSenPropertiesLayerE @ 365 NONAME
+	_ZN30CSenLayeredTransportProperties7AsUtf8LEv @ 366 NONAME
+	_ZN30CSenLayeredTransportProperties7SnapIdLERm @ 367 NONAME
+	_ZN30CSenLayeredTransportProperties8AsUtf8LCEN21MSenLayeredProperties19TSenPropertiesLayerE @ 368 NONAME
+	_ZN30CSenLayeredTransportProperties8AsUtf8LCEv @ 369 NONAME
+	_ZN30CSenLayeredTransportProperties8ShrinkToEN21MSenLayeredProperties19TSenPropertiesLayerE @ 370 NONAME
+	_ZN30CSenLayeredTransportProperties8TopLayerEv @ 371 NONAME
+	_ZN30CSenLayeredTransportProperties8WriteToLER12RWriteStream @ 372 NONAME
+	_ZN30CSenLayeredTransportProperties8WriteToLER12RWriteStreamN21MSenLayeredProperties19TSenPropertiesLayerE @ 373 NONAME
+	_ZN30CSenLayeredTransportProperties9DeviceIDLER6TPtrC8 @ 374 NONAME
+	_ZN30CSenLayeredTransportProperties9ExpandToLEN21MSenLayeredProperties19TSenPropertiesLayerE @ 375 NONAME
+	_ZN30CSenLayeredTransportProperties9PropertyLERK6TDesC8R6TPtrC8 @ 376 NONAME
+	_ZN30CSenLayeredTransportProperties9PropertyLERK6TDesC8R6TPtrC8N21MSenLayeredProperties19TSenPropertiesLayerE @ 377 NONAME
+	_ZN30CSenLayeredTransportProperties9PropertyLERK6TDesC8R6TPtrC8S4_ @ 378 NONAME
+	_ZN30CSenLayeredTransportProperties9PropertyLERK6TDesC8RP12MSenProperty @ 379 NONAME
+	_ZN30CSenLayeredTransportProperties9PropertyLERK6TDesC8RP12MSenPropertyN21MSenLayeredProperties19TSenPropertiesLayerE @ 380 NONAME
+	_ZN30CSenLayeredTransportProperties9ReadFromLERK6TDesC8 @ 381 NONAME
+	_ZN30CSenLayeredTransportProperties9ReadFromLERK6TDesC8N21MSenLayeredProperties19TSenPropertiesLayerE @ 382 NONAME
+	_ZN30CSenLayeredTransportProperties9SetReaderER13CSenXmlReader @ 383 NONAME
+	_ZN30CSenLayeredTransportPropertiesC1Ev @ 384 NONAME
+	_ZN30CSenLayeredTransportPropertiesC2Ev @ 385 NONAME
+	_ZN30CSenLayeredTransportPropertiesD0Ev @ 386 NONAME
+	_ZN30CSenLayeredTransportPropertiesD1Ev @ 387 NONAME
+	_ZN30CSenLayeredTransportPropertiesD2Ev @ 388 NONAME
+	_ZN34CSenLayeredHttpTransportProperties4NewLER11RStringPool @ 389 NONAME
+	_ZN34CSenLayeredHttpTransportProperties4NewLERK11CSenElement @ 390 NONAME
+	_ZN34CSenLayeredHttpTransportProperties4NewLERK11CSenElementR11RStringPool @ 391 NONAME
+	_ZN34CSenLayeredHttpTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 392 NONAME
+	_ZN34CSenLayeredHttpTransportProperties4NewLERK6TDesC8R13CSenXmlReaderR11RStringPool @ 393 NONAME
+	_ZN34CSenLayeredHttpTransportProperties4NewLEv @ 394 NONAME
+	_ZN34CSenLayeredHttpTransportProperties5NewLCER11RStringPool @ 395 NONAME
+	_ZN34CSenLayeredHttpTransportProperties5NewLCERK11CSenElement @ 396 NONAME
+	_ZN34CSenLayeredHttpTransportProperties5NewLCERK11CSenElementR11RStringPool @ 397 NONAME
+	_ZN34CSenLayeredHttpTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 398 NONAME
+	_ZN34CSenLayeredHttpTransportProperties5NewLCERK6TDesC8R13CSenXmlReaderR11RStringPool @ 399 NONAME
+	_ZN34CSenLayeredHttpTransportProperties5NewLCEv @ 400 NONAME
+	_ZN34CSenLayeredVtcpTransportProperties4NewLERK11CSenElement @ 401 NONAME
+	_ZN34CSenLayeredVtcpTransportProperties4NewLEv @ 402 NONAME
+	_ZN34CSenLayeredVtcpTransportProperties5NewLCERK11CSenElement @ 403 NONAME
+	_ZN34CSenLayeredVtcpTransportProperties5NewLCEv @ 404 NONAME
+	_ZNK14CSaslMechanism10TransformLE6TPtrC8 @ 405 NONAME
+	_ZNK18CSenServiceSession3LogEv @ 406 NONAME
+	_ZNK18CSenServiceSession7HostletEv @ 407 NONAME
+	_ZNK18CSenServiceSession9TransportEv @ 408 NONAME
+	_ZNK21CSenWebServiceSession11HasConsumerEv @ 409 NONAME
+	_ZNK21CSenWebServiceSession9ConsumersER13RPointerArrayI25MSenRemoteServiceConsumerE @ 410 NONAME
+	_ZNK27CSenInternalServiceConsumer10IdentifierEv @ 411 NONAME
+	_ZNK27CSenInternalServiceConsumer2IdEv @ 412 NONAME
+	_ZNK30CSenLayeredTransportProperties5CloneERi @ 413 NONAME
+	_ZNK30CSenLayeredTransportProperties6CloneLEv @ 414 NONAME
+	_ZTI11CSenContext @ 415 NONAME ; #<TI>#
+	_ZTI13CSenWSPattern @ 416 NONAME ; #<TI>#
+	_ZTI14CSaslMechanism @ 417 NONAME ; #<TI>#
+	_ZTI15CSenContextItem @ 418 NONAME ; #<TI>#
+	_ZTI15CSenHandlerBase @ 419 NONAME ; #<TI>#
+	_ZTI17CSenClientContext @ 420 NONAME ; #<TI>#
+	_ZTI17CSenServerContext @ 421 NONAME ; #<TI>#
+	_ZTI17CSenSyncRequester @ 422 NONAME ; #<TI>#
+	_ZTI17CSenWSDescription @ 423 NONAME ; #<TI>#
+	_ZTI18CSenMessageContext @ 424 NONAME ; #<TI>#
+	_ZTI18CSenServiceSession @ 425 NONAME ; #<TI>#
+	_ZTI18CSenSessionContext @ 426 NONAME ; #<TI>#
+	_ZTI20CSenTransportContext @ 427 NONAME ; #<TI>#
+	_ZTI21CSenWebServiceSession @ 428 NONAME ; #<TI>#
+	_ZTI22CSenApplicationContext @ 429 NONAME ; #<TI>#
+	_ZTI24CSenLayeredXmlProperties @ 430 NONAME ; #<TI>#
+	_ZTI27CSenInternalServiceConsumer @ 431 NONAME ; #<TI>#
+	_ZTI30CSenLayeredTransportProperties @ 432 NONAME ; #<TI>#
+	_ZTI34CSenLayeredHttpTransportProperties @ 433 NONAME ; #<TI>#
+	_ZTI34CSenLayeredVtcpTransportProperties @ 434 NONAME ; #<TI>#
+	_ZTV11CSenContext @ 435 NONAME ; #<VT>#
+	_ZTV13CSenWSPattern @ 436 NONAME ; #<VT>#
+	_ZTV14CSaslMechanism @ 437 NONAME ; #<VT>#
+	_ZTV15CSenContextItem @ 438 NONAME ; #<VT>#
+	_ZTV15CSenHandlerBase @ 439 NONAME ; #<VT>#
+	_ZTV17CSenClientContext @ 440 NONAME ; #<VT>#
+	_ZTV17CSenServerContext @ 441 NONAME ; #<VT>#
+	_ZTV17CSenSyncRequester @ 442 NONAME ; #<VT>#
+	_ZTV17CSenWSDescription @ 443 NONAME ; #<VT>#
+	_ZTV18CSenMessageContext @ 444 NONAME ; #<VT>#
+	_ZTV18CSenServiceSession @ 445 NONAME ; #<VT>#
+	_ZTV18CSenSessionContext @ 446 NONAME ; #<VT>#
+	_ZTV20CSenTransportContext @ 447 NONAME ; #<VT>#
+	_ZTV21CSenWebServiceSession @ 448 NONAME ; #<VT>#
+	_ZTV22CSenApplicationContext @ 449 NONAME ; #<VT>#
+	_ZTV24CSenLayeredXmlProperties @ 450 NONAME ; #<VT>#
+	_ZTV27CSenInternalServiceConsumer @ 451 NONAME ; #<VT>#
+	_ZTV30CSenLayeredTransportProperties @ 452 NONAME ; #<VT>#
+	_ZTV34CSenLayeredHttpTransportProperties @ 453 NONAME ; #<VT>#
+	_ZTV34CSenLayeredVtcpTransportProperties @ 454 NONAME ; #<VT>#
+	_ZThn100_N15CSenHandlerBase13WriteAsXMLToLER12RWriteStream @ 455 NONAME ; #<thunk>#
+	_ZThn100_N15CSenHandlerBase6AsXmlLEv @ 456 NONAME ; #<thunk>#
+	_ZThn104_N13CSenWSPattern7MatchesER22MSenServiceDescription @ 457 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession10FacetValueER6TDesC8RP6HBufC8 @ 458 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession11FrameworkIdEv @ 459 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession11RemoveFacetERK6TDesC8 @ 460 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession11ScoreMatchLER22MSenServiceDescription @ 461 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession20DescriptionClassTypeEv @ 462 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession7FacetsLER13RPointerArrayI9CSenFacetE @ 463 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession7MatchesER22MSenServiceDescription @ 464 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession8ContractEv @ 465 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession8EndpointEv @ 466 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession9AddFacetLERK9CSenFacet @ 467 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession9HasFacetLERK6TDesC8Ri @ 468 NONAME ; #<thunk>#
+	_ZThn104_N18CSenServiceSession9SetFacetLERK9CSenFacet @ 469 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession11FrameworkIdEv @ 470 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession12SetContractLERK6TDesC8 @ 471 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession12SetEndPointLERK6TDesC8 @ 472 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession13WriteAsXMLToLER12RWriteStream @ 473 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession16FrameworkVersionEv @ 474 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession8ContractEv @ 475 NONAME ; #<thunk>#
+	_ZThn104_N21CSenWebServiceSession8EndpointEv @ 476 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern13ConsumerIapIdERm @ 477 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern17SetConsumerIapIdLEm @ 478 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern21AcceptsConsumerPolicyER18MSenConsumerPolicy @ 479 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern25RebuildFromConsumerPolicyER18MSenConsumerPolicy @ 480 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern29ConsumerIdentityProviderIds8LEv @ 481 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern30AddConsumerIdentityProviderIdLERK6TDesC8 @ 482 NONAME ; #<thunk>#
+	_ZThn168_N13CSenWSPattern31SetConsumerIdentityProviderIdsLER28CSenIdentityProviderIdArray8 @ 483 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession10FacetValueER6TDesC8RP6HBufC8 @ 484 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession10TransportLER25MSenRemoteServiceConsumer @ 485 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession11FrameworkIdEv @ 486 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession11SetHostletLEP17MSenRemoteHostlet @ 487 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession13SetTransportLEP17CSenTransportBase @ 488 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession15RemoveConsumerLER25MSenRemoteServiceConsumer @ 489 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession20AsServiceDescriptionEv @ 490 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession20DescriptionClassTypeEv @ 491 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession20TransportPropertiesLERP6HBufC8R25MSenRemoteServiceConsumer @ 492 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession23ProvideHostletResponseLER17MSenRemoteHostletiiRK6TDesC8R9CSenChunk @ 493 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession23SetTransportPropertiesLERK6TDesC8R25MSenRemoteServiceConsumer @ 494 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession28CompleteServerMessagesOnOffLERKi @ 495 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession5SendLERK6TDesC8S2_R25MSenRemoteServiceConsumerRiRP6HBufC8 @ 496 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession7StatusLEv @ 497 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession7SubmitLERK6TDesC8S2_R25MSenRemoteServiceConsumerRP6HBufC8 @ 498 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession8ContractEv @ 499 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession8EndpointEv @ 500 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession8IsReadyLEv @ 501 NONAME ; #<thunk>#
+	_ZThn168_N18CSenServiceSession9HasFacetLERK6TDesC8Ri @ 502 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession11FrameworkIdEv @ 503 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession11SubmitSoapLERK6TDesC8S2_R25MSenRemoteServiceConsumerRP6HBufC8 @ 504 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession13WriteAsXMLToLER12RWriteStream @ 505 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession16StartTransactionEv @ 506 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession20TransactionCompletedEv @ 507 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession23ProvideHostletResponseLER17MSenRemoteHostletiiRK6TDesC8R9CSenChunk @ 508 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession5SendLERK6TDesC8S2_R25MSenRemoteServiceConsumerRiRP6HBufC8 @ 509 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession7SubmitLERK6TDesC8S2_R25MSenRemoteServiceConsumerRP6HBufC8 @ 510 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession8ContractEv @ 511 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession8EndpointEv @ 512 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession8IsReadyLEv @ 513 NONAME ; #<thunk>#
+	_ZThn168_N21CSenWebServiceSession9SendSoapLERK6TDesC8S2_R25MSenRemoteServiceConsumerRiRP6HBufC8 @ 514 NONAME ; #<thunk>#
+	_ZThn168_N27CSenInternalServiceConsumer10SetStatusLEi @ 515 NONAME ; #<thunk>#
+	_ZThn168_N27CSenInternalServiceConsumer11SetSessionLER24MSenRemoteServiceSession @ 516 NONAME ; #<thunk>#
+	_ZThn168_N27CSenInternalServiceConsumer12FileProgressEiiiRK6TDesC8i @ 517 NONAME ; #<thunk>#
+	_ZThn168_N27CSenInternalServiceConsumer12HandleErrorLEP6HBufC8iiP14MSenProperties @ 518 NONAME ; #<thunk>#
+	_ZThn168_N27CSenInternalServiceConsumer13ChunkByTxnIdLEiRP9CSenChunk @ 519 NONAME ; #<thunk>#
+	_ZThn168_N27CSenInternalServiceConsumer14HandleMessageLEP6HBufC8iP14MSenProperties @ 520 NONAME ; #<thunk>#
+	_ZThn168_NK18CSenServiceSession7HostletEv @ 521 NONAME ; #<thunk>#
+	_ZThn168_NK18CSenServiceSession9TransportEv @ 522 NONAME ; #<thunk>#
+	_ZThn168_NK27CSenInternalServiceConsumer10IdentifierEv @ 523 NONAME ; #<thunk>#
+	_ZThn168_NK27CSenInternalServiceConsumer2IdEv @ 524 NONAME ; #<thunk>#
+	_ZThn172_N18CSenServiceSession14SendToHostletLER17MSenRemoteHostletRK6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 525 NONAME ; #<thunk>#
+	_ZThn172_N21CSenWebServiceSession12HandleErrorLEiP6HBufC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 526 NONAME ; #<thunk>#
+	_ZThn172_N21CSenWebServiceSession14SendToHostletLER17MSenRemoteHostletRK6TDesC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 527 NONAME ; #<thunk>#
+	_ZThn172_N21CSenWebServiceSession15SendToConsumerLEP6HBufC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 528 NONAME ; #<thunk>#
+	_ZThn172_N21CSenWebServiceSession20SendErrorToConsumerLEiP6HBufC8iR25MSenRemoteServiceConsumerP14MSenProperties @ 529 NONAME ; #<thunk>#
+	_ZThn172_NK18CSenServiceSession7HostletEv @ 530 NONAME ; #<thunk>#
+	_ZThn244_N21CSenWebServiceSession17CredentialChangedEN22MSenCredentialObserver20TSenCredentialChangeEPv @ 531 NONAME ; #<thunk>#
+	_ZThn4_N15CSenHandlerBase13WriteAsXMLToLER12RWriteStream @ 532 NONAME ; #<thunk>#
+	_ZThn4_N15CSenHandlerBase6AsXmlLEv @ 533 NONAME ; #<thunk>#
+	_ZThn4_N21CSenWebServiceSession13WriteAsXMLToLER12RWriteStream @ 534 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties12IntPropertyLERK6TDesC8Ri @ 535 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties12IntPropertyLERK6TDesC8RiN21MSenLayeredProperties19TSenPropertiesLayerE @ 536 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties12IsSafeToCastEN14MSenProperties23TSenPropertiesClassTypeE @ 537 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties12SetPropertyLERK6TDesC8S2_ @ 538 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties12SetPropertyLERK6TDesC8S2_N21MSenLayeredProperties19TSenPropertiesLayerE @ 539 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties13BoolPropertyLERK6TDesC8Ri @ 540 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties13BoolPropertyLERK6TDesC8RiN21MSenLayeredProperties19TSenPropertiesLayerE @ 541 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties15SetIntPropertyLERK6TDesC8i @ 542 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties15SetIntPropertyLERK6TDesC8iN21MSenLayeredProperties19TSenPropertiesLayerE @ 543 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties16SetBoolPropertyLERK6TDesC8i @ 544 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties16SetBoolPropertyLERK6TDesC8iN21MSenLayeredProperties19TSenPropertiesLayerE @ 545 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties17PropertiesByTypeLERK6TDesC8R13RPointerArrayI12MSenPropertyE @ 546 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties19PropertiesClassTypeEv @ 547 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties7AsUtf8LEN21MSenLayeredProperties19TSenPropertiesLayerE @ 548 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties7AsUtf8LEv @ 549 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties8AsUtf8LCEN21MSenLayeredProperties19TSenPropertiesLayerE @ 550 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties8AsUtf8LCEv @ 551 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties8ShrinkToEN21MSenLayeredProperties19TSenPropertiesLayerE @ 552 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties8TopLayerEv @ 553 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties8WriteToLER12RWriteStream @ 554 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties8WriteToLER12RWriteStreamN21MSenLayeredProperties19TSenPropertiesLayerE @ 555 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9ExpandToLEN21MSenLayeredProperties19TSenPropertiesLayerE @ 556 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9PropertyLERK6TDesC8R6TPtrC8 @ 557 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9PropertyLERK6TDesC8R6TPtrC8N21MSenLayeredProperties19TSenPropertiesLayerE @ 558 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9PropertyLERK6TDesC8RP12MSenProperty @ 559 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9PropertyLERK6TDesC8RP12MSenPropertyN21MSenLayeredProperties19TSenPropertiesLayerE @ 560 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9ReadFromLERK6TDesC8 @ 561 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9ReadFromLERK6TDesC8N21MSenLayeredProperties19TSenPropertiesLayerE @ 562 NONAME ; #<thunk>#
+	_ZThn4_N30CSenLayeredTransportProperties9SetReaderER13CSenXmlReader @ 563 NONAME ; #<thunk>#
+	_ZThn4_NK30CSenLayeredTransportProperties5CloneERi @ 564 NONAME ; #<thunk>#
+	_ZThn4_NK30CSenLayeredTransportProperties6CloneLEv @ 565 NONAME ; #<thunk>#
+	_ZN12SenMtomUtils11HeaderRootLER17CSenSoapEnvelope2RK5RBuf8RS2_ @ 566 NONAME
+	_ZN12SenMtomUtils13FileDataPartLEjjR6RArrayI20TXmlEngDataContainerER5RBuf8 @ 567 NONAME
+	_ZN12SenMtomUtils13FileDataRestLEjjjR6RArrayI20TXmlEngDataContainerER5RBuf8 @ 568 NONAME
+	_ZN12SenMtomUtils16BoundaryLineEndLERK5RBuf8RS0_ @ 569 NONAME
+	_ZN12SenMtomUtils17HeaderBinaryDataLEjR6RArrayI20TXmlEngDataContainerER5RBuf8 @ 570 NONAME
+	_ZN12SenMtomUtils18BoundaryLineStartLERK5RBuf8RS0_ @ 571 NONAME
+	_ZN12SenMtomUtils19SerializeEnvelope2LER17CSenSoapEnvelope2R5RBuf8 @ 572 NONAME
+	_ZN12SenMtomUtils22GenerateRandomRootCidLER5RBuf8 @ 573 NONAME
+	_ZN12SenMtomUtils23GenerateRandomBoundaryLER5RBuf8 @ 574 NONAME
+	_ZN12SenMtomUtils4CidLERK5RBuf8R6RArrayIS0_E @ 575 NONAME
+	_ZN12SenMtomUtils8SetFileLEjiR6TDesC8R6RArrayI5RBuf8E @ 576 NONAME
+	_ZN27CSenInternalServiceConsumer21SetDataTrafficDetailsER22TSenDataTrafficDetails @ 577 NONAME
+	_ZThn168_N27CSenInternalServiceConsumer21SetDataTrafficDetailsER22TSenDataTrafficDetails @ 578 NONAME ; #<thunk>#
+	_ZN30CSenLayeredTransportProperties12MaxRetryTTLLERi @ 579 NONAME
+	_ZN30CSenLayeredTransportProperties12MinRetryTTLLERi @ 580 NONAME
+	_ZN30CSenLayeredTransportProperties15SetMaxRetryTTLLEi @ 581 NONAME
+	_ZN30CSenLayeredTransportProperties15SetMinRetryTTLLEi @ 582 NONAME
+	_ZN30CSenLayeredTransportProperties18RetryDeltaTimeoutLERi @ 583 NONAME
+	_ZN30CSenLayeredTransportProperties21SetRetryDeltaTimeoutLEi @ 584 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for wsframework    *
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+ 
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsframework.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsframework.iby)
+PRJ_MMPFILES
+senframework.mmp
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/group/senframework.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      Project specification file for wsframework
+*
+*/
+
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+TARGETTYPE    DLL
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET        SenFramework.DLL
+UID           0x1000008d 0x101F96F5
+#else
+TARGET        wsframework.dll
+UID           0x1000008d 0x101F972D
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH ../src
+SOURCE senwspattern.cpp
+SOURCE senwsdescription.cpp
+SOURCE senframeworkdll.cpp
+SOURCE senservicesession.cpp
+SOURCE senwebservicesession.cpp
+SOURCE seninternalserviceconsumer.cpp
+SOURCE saslmechanism.cpp
+SOURCE senlayeredxmlproperties.cpp
+SOURCE senlayeredtransportproperties.cpp
+SOURCE senlayeredhttptransportproperties.cpp
+SOURCE senlayeredvtcptransportproperties.cpp
+SOURCE sencontextitem.cpp
+SOURCE sencontext.cpp
+SOURCE senmessagecontext.cpp
+SOURCE sentransportcontext.cpp
+
+SOURCE senhandlerbase.cpp
+SOURCE sensyncrequester.cpp
+SOURCE senmultipartutils.cpp
+SOURCE senmtomutils.cpp
+
+SOURCE senservercontext.cpp
+SOURCE senapplicationcontext.cpp
+SOURCE senclientcontext.cpp
+SOURCE sensessioncontext.cpp
+
+USERINCLUDE ../inc 
+USERINCLUDE ../../wscore/inc
+USERINCLUDE ../../wsutils/inc // SenDebug.h - filelogging MACROs
+USERINCLUDE ../../wsidentitymanager/inc // MSenIdentityManager.h
+USERINCLUDE ../../wscredentialmanager/inc
+USERINCLUDE ../../wsdescription/inc // MSenPolicy.h (bc)
+USERINCLUDE ../../wsmessages/inc
+USERINCLUDE ../../wsxml/inc								//senxmldebug.h
+USERINCLUDE ../../wslogger/inc		
+USERINCLUDE   ../../wshostletconnection/inc // MSenHostlet.h, MSenHostletRequest.h, MSenHostletResponse.h
+
+SYSTEMINCLUDE   ../../inc
+SYSTEMINCLUDE /epoc32/include/libc
+MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+// System libs
+LIBRARY euser.lib 
+LIBRARY flogger.lib
+LIBRARY estor.lib 
+LIBRARY ecom.lib
+LIBRARY efsrv.lib
+LIBRARY imut.lib 
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// Serene libs
+LIBRARY senlogger.lib   // for TLS based logging
+LIBRARY SenUtils.lib
+LIBRARY SenServDesc.lib
+LIBRARY SenXml.lib
+LIBRARY SenMessages.lib
+LIBRARY SenFragment.lib
+LIBRARY SenCredentialManager.lib
+#else
+// Serene libs
+LIBRARY wslogger.lib   // for TLS based logging
+LIBRARY wsUtils.lib
+LIBRARY wsServDesc.lib
+LIBRARY wsXml.lib
+LIBRARY wsMessages.lib
+LIBRARY wsFragment.lib
+LIBRARY wsCredentialManager.lib
+#endif
+
+// Libxml2 libs
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+    LIBRARY         XmlEngineUtils.lib
+    LIBRARY         XmlEngineSerializer.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineSerializer.lib
+#endif
+
+#if defined(ARMCC)
+    DEFFILE     ../eabi/SENFRAMEWORK.DEF
+#elif defined(WINSCW)
+    DEFFILE     ../BWINSCW/SENFRAMEWORK.DEF
+#elif defined(WINS)
+    DEFFILE     ../BWINS/SENFRAMEWORK.DEF
+#else 
+    DEFFILE     ../BMARM/SENFRAMEWORK.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msencontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,332 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_CONTEXT_H
+#define M_SEN_CONTEXT_H
+
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class CSenElement;
+class CSenXmlReader;
+
+// CONSTANTS
+namespace SenContext
+    {
+    // COMMON CONTEXT KEYS
+    _LIT8(KSenCtxKeyCoreServiceManager,     "urn:com.nokia.serene:core:service-manager");
+    _LIT8(KSenCtxKeySessionInitializer,     "urn:com.nokia.serene:framework:session-initializer");    
+    _LIT8(KSenCtxKeyServiceSession,         "urn:com.nokia.serene:framework:service-session");        
+    _LIT8(KSenCtxKeyTransportProperties,    "urn:com.nokia.serene:framework:transport-properties");   
+    
+    _LIT8(KSenCtxKeyMessage,                "urn:com.nokia.serene:framework:message"); 
+    _LIT8(KSenCtxKeyChunk,                  "urn:com.nokia.serene:framework:chunk"); 
+    _LIT8(KSenCtxKeyMessageProperties,      "urn:com.nokia.serene:framework:message:properties"); 
+//    _LIT8(KSenCtxKeyXmlParser,              "urn:com.nokia.serene:framework:xml-parser"); 
+
+
+    // DEPRECATED KEYS,
+    _LIT8(KSenCtxKeyCurrentSoapMessage,  "urn:com.nokia.serene:framework:current-soap-msg"); 
+    _LIT8(KSenCtxKeyCurrentMessageAsDesc,"urn:com.nokia.serene:framework:current-msg-desc");
+    
+        
+    enum TContextType
+        {
+        EContextBase = 0,
+        EHandlerContext, 
+        ESessionContext, 
+        EMessageContext, 
+        ETransportContext
+        };
+
+    enum TContextDirection
+        {
+        EOutgoing = 1, 
+        EIncoming,
+        EBoth
+        };
+    }
+
+
+// CLASS DECLARATION
+/**
+* This is the abstract super class for all WSF context classes, providing 
+* convenience methods for basic, excessively used data types, and some
+* foundation methods for general context properties, like context type and
+* direction.
+*
+*/
+class MSenContext
+    {
+    public:
+    
+        // New functions
+        
+        /**
+        * Method is used to resolve concrete type (class)
+        * for this context.
+        * 
+        * @return the class type of this handler
+        */
+        virtual SenContext::TContextType Type() const = 0;        
+    
+    	/**
+    	* Indicates the direction this context is serving.
+        * 
+    	* @return enum, which tells where this handler will 
+    	* be applied - outgoing, incoming, or on both directions.
+    	*/
+    	virtual SenContext::TContextDirection Direction() const = 0;
+    	
+        /**
+        * Adds new const TDesC8& type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. 
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue) = 0;
+
+        /**
+        * Updates new const TDesC8& type value into context, identified by given key.
+        * If some value for the same key already exists, it is destroyed and replaced 
+        * by the new value. If key does not already exist, a new one will be added.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is transferred to this context.
+        * 
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue) = 0;
+
+        /**
+        * Method returns TDesC8* type value.
+        * 
+        * @param aKey identifies descriptor object
+        * 
+        * @return value behind given key, or NULL, if
+        * not found.
+        * Ownership is  not transferred, but remains
+        * to be held by this context.   
+        * NOTE: Method leaves with KErrSenTypeMismatch error code,
+        * if value behind this key of UCS8 descriptor type.   
+        */
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey) = 0;
+
+        /**
+        * Adds new TInt type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added.
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, TInt aValue) = 0;
+
+        /**
+        * Updates new TInt type value into context, identified by given key.
+        * If some value for the same key already exists, it is destroyed and
+        * replaced by the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        * 
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, TInt aValue) = 0;
+
+        /**
+        * Method returns TInt* type value.
+        * 
+        * @param aKey identifies integer object
+        * 
+        * @return value behind given key, or NULL, if
+        * not found.
+        * Ownership is  not transferred, but remains
+        * to be held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value behind this descriptor is not TInt* type.   
+        */
+        virtual const TInt* GetIntL(const TDesC8& aKey) = 0;
+
+        /**
+        * Adds new CSenElement* type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue) = 0;
+
+        /**
+        * Updates new CSenElement* type value into context, identified by given key.
+        * If some value for the same key already exists, it is destroyed and replaced
+        * by the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is transferred to this context.
+        * 
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue) = 0;
+
+        /**
+        * Method returns CSenElement* type value.
+        * 
+        * @param aKey identifies the XML element object
+        * 
+        * @return value behind given key, or NULL, if
+        * not found.
+        * Ownership is  not transferred, but remains
+        * to be held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value behind this descriptor is not CSenElement* type.   
+        */
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) = 0;
+
+        /**
+        * Adds new TAny* type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is NOT transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue) = 0;
+
+        /**
+        * Updates new TAny* type value into context, identified by given key.
+        * If some value for the same key already exists, it is replaced with 
+        * the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is NOT transferred this context.
+        * 
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) = 0;
+
+        /**
+        * Method returns TAny* type value.
+        * 
+        * @param aKey identifying the requested value
+        * 
+        * @return value behind given key, or NULL, if
+        * not found.
+        * Ownership can NOT be transferred, since it was NEVER
+        * held by this context.   
+        * Caller is supposed to know the type (class) of returned
+        * value from the pre-defined binding to certain key.
+        */
+        virtual TAny* GetAnyL(const TDesC8& aKey) = 0;	//codescannerwarnings
+
+        // virtual TInt AddParser(CSenXmlReader* aValue) = 0; // protected context
+        // virtual TInt UpdateParser(CSenXmlReader* aValue) = 0;  // protected context
+        /**
+        * Method returns XML parser (CSenXmlReader*)
+        * 
+        * @return pointer to parser or NULL, if not
+        * found.
+        * Ownership of returned pointer is NOT transferred.
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value behind this descriptor is not CSenXmlReader* type.   
+        */
+        virtual const CSenXmlReader* GetParser() = 0;
+
+        /**
+        * Removes value from the context, possibly destroying the
+        * value, too - if it is owned by this context.
+        * 
+        * @param aKey used to identify value which needs to be removed
+        * 
+        * @return the index of removed key-value pair, or
+        * KErrNotFound, if such key was not found
+        */
+        virtual TInt Remove(const TDesC8& aKey) = 0;     	
+
+        /**
+        * Methods tells the count of context items (key-value pairs).
+        * 
+        * @return count of current items in this context.
+        */
+        virtual TInt Count() const = 0;
+
+        /**
+        * Resolves key at certain index, if it is
+        * not out of bounds of the current context.
+        * 
+        * @return the key at certain index.
+        * Method can be used to interate through
+        * context values.
+        * If index is out of bounds, method leaves
+        * with either KErrUnderflow (negative index),
+        *          or KErrOverflow(index>count-1)
+        */
+        virtual TPtrC8 KeyAtL(TInt aIndex) = 0;
+        
+        /**
+        * Method clears (possibly destroys) the current contents
+        * of this context, making it possible to re-use this instance.
+        */
+        virtual void Reset() = 0;
+
+
+        
+        /**
+        * Sets the direction (inbound or outbound for this context).
+        * @return KErrNone or error code (KErrNotSupported is expected,
+        * if method is not implemented).
+        */        
+        virtual TInt SetDirection( SenContext::TContextDirection aDirection ) = 0;
+
+
+    };
+
+#endif // M_SEN_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msencontextitem.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_CONTEXT_ITEM_H
+#define M_SEN_CONTEXT_ITEM_H
+
+
+// INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+
+const TInt KErrSenCtxItemTypeMismatch = -30350; 
+
+
+// CLASS DECLARATION
+/**
+* This is the abstract super class for all WSF context iten classes, 
+* providing generic interface for resolving context item type, and
+* equal properties.
+*/
+class MSenContextItem
+    {
+    public:
+        enum TClass
+            {
+            EContextItem = 1, 
+            EProtectedContextItem
+            };
+
+        enum TData
+            {
+            ETAny = 0,
+            ETDesC8, 
+            ETInt,
+            ETUint,
+            EMSenCoreServiceManager,
+            ECSenElement,
+            ECSenSoapMessage,
+            ECSenChunk,
+            EMSenMessage,
+            ECSenMessageBase,
+            ECSenSoapEnvelope2,
+            ECSenXmlReader,
+            ECSenWSDescription,
+            EMSenRemoteServiceConsumer,
+            EMSenRemoteHostlet,
+            EMSenProperties,
+            ECSenAtomMessage
+            };
+    
+        // New functions
+        
+        /**
+        * Method is used to resolve the class-type of the context item implementation
+        * 
+        * @return the class type of this handler
+        */
+        virtual MSenContextItem::TClass Type() const = 0;        
+    };
+
+#endif // M_SEN_CONTEXT_ITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msencoreservicemanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_CORE_SERVICE_MANAGER_H
+#define M_SEN_CORE_SERVICE_MANAGER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <flogger.h>
+#include <badesca.h>    //CDesC8Array
+
+#include "msenservicemanager.h"
+#include "msenidentitymanager.h"
+#include "msencredentialmanager.h"
+
+// FORWARD DECLARATIONS
+class MSenTransport;
+class MSenProvider;
+
+class CSenXmlReader;
+class CSenWSDescription;
+class CSenIdentityProvider;
+class CSenServiceSession;
+class CSenIdentifier;
+class CSIF;
+
+// CLASS DECLARATION
+
+/**
+*
+* MSenCoreServiceManager represents the internal (core) side interface of
+* a CoreServiceManager
+* The methods defined in this interface are executed from MDAO implementations
+* and from different frameworks, which are expected to operate in the same
+* process as the CoreServiceManager.
+*/
+class MSenCoreServiceManager :  public MSenServiceManager,
+                                public MSenIdentityManager,
+                                public MSenCredentialManager
+    {
+    public: // New methods
+
+        virtual TInt AddServiceDescriptionL( CSenWSDescription* apServiceDescription ) = 0;
+
+        virtual TInt RemoveServiceDescriptionL( CSenWSDescription& aServiceDescription ) = 0;
+
+        virtual TInt SaveL( const CSenServiceSession& aServiceSession ) = 0;
+        
+        virtual TInt SaveL( const CSIF& aServiceInvocationFramework ) = 0;
+
+        //virtual MSenIdentityManager& IdentityManager() = 0;
+
+        /**
+        * Notifies *ALL* framework plug-ins about certain event
+        * @return some system-wide error code, if an error occurred
+        */
+        //virtual TInt NotifyFrameworksL(const TInt aEvent) = 0;
+
+        /**
+        * Notifies *ALL* framework plug-ins about certain event and
+        * an additional object pointer may be passed
+        * NULL is also accepted
+        * @return some system-wide error code, if an error occurred
+        */
+        //virtual TInt NotifyFrameworksL(const TInt aEvent, 
+        //                               TAny* aArgument) = 0;
+
+
+        /**
+        * Notifies only those frameworks plug-ins, which match
+        * with given framework ID (aFrameworkID)
+        * Note(!): if aFrameworkID == KNullDesC8 (zero-length),
+        * then *all* known framework plug-ins are notified
+        * about the event.
+        * @return some system-wide error code, if an error occurred
+        */
+        //virtual TInt NotifyFrameworksL(const TDesC8& aFrameworkID,
+        //                               const TInt aEvent) = 0;
+
+        /**
+        * Notifies only those frameworks plug-ins, which match
+        * with given framework ID (aFrameworkID) and 
+        * an additional object pointer may be passed
+        * NULL is also accepted
+
+        * Note(!): if aFrameworkID == KNullDesC8 (zero-length),
+        * then *all* known framework plug-ins are notified
+        * about the event.
+        * @return some system-wide error code, if an error occurred
+        */
+        //virtual TInt NotifyFrameworksL(const TDesC8& aFrameworkID,
+        //                              const TInt aEvent,
+        //                              TAny* aArgument) = 0;
+
+        /**
+         * Return a list with FrameworkId strings (TDesC&), 
+         * each a name of a supported ServiceInvocationFramework.
+         * This may help applications, to decide what to ask for.
+         */
+        virtual CDesC8Array& SupportedFrameworksL() = 0;
+
+        /**
+        * Method for requesting a MSenProvider reference
+        * to a hostlet (provider) accessible behind given
+        * endpoint. Core service manager implementation 
+        * typically owns the instances behind this reference,
+        * as well as it often does some pooling / caching / 
+        * proxy-ing of these instances for several requesters.
+        * Typical caller of this method is transport plug-in.
+        * @param aHostletEndpoint is the endpoint of requested provider.
+        * @param aReqThreadId is the full name of the requesting thread
+        * @param aReqConsumerId is the unique id (urn) of the requesting
+        *        service consumer
+        * @return reference to found provider. If provider was not
+        * found from the system, this method will leave with
+        * KErrNotFound error code. Other leave codes are system-wide.
+        */
+        virtual MSenProvider& LookupHostletForL( const TDesC8& aHostletEndpoint,
+                                                 const TDesC& aReqThreadId,
+                                                 const TDesC8& aReqConsumerId ) = 0;
+
+        /** 
+        * Unsharable hostlets (providers) should be released from server (main)
+        * thread's memory by calling this method. 
+        * @param aHostlet is a pointer to the hostlet (provider) being released,
+        *        and possibly de-allocated.
+        * @param aReqThreadId is the full name of the requesting thread
+        * @param aReqConsumerId is the unique id (urn) of the requesting
+        *        service consumer
+        * @return KErrNone on success or otherwise some system-wide error code.
+        */
+        virtual TInt ReleaseHostletL( const MSenProvider* aHostlet,
+                                      const TDesC& aReqThreadId,
+                                      const TDesC8& aReqConsumerId ) = 0;
+        virtual TPtrC8 IMSI() = 0;
+        
+        virtual TPtrC8 IMEI() = 0;
+
+    };
+
+#endif // M_SEN_CORE_SERVICE_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msencredentialmanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_CREDENTIAL_MANAGER_H
+#define M_SEN_CREDENTIAL_MANAGER_H
+
+// INCLUDES
+#include <e32base.h>
+
+//#include "MSenDAO.h"
+
+// FORWARD DECLARATIONS
+class CSenWSDescription;
+class CSenIdentityProvider;
+class CSenInternalCredential;
+class RSenCredentialPtr;
+class CSenXMLDAO;
+
+typedef RPointerArray<CSenInternalCredential> RSenCredentialArray;
+typedef RArray<RSenCredentialPtr> RSenCredentialPtrArray;
+
+class MSenCredentialManager
+    {
+    
+    friend class CSenXMLDAO; // only component that saves Credential DB outside CRED-MGR
+    
+    public:
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  RSenCredentialArray& aCredentials) = 0;
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  const CSenIdentityProvider& aIdP,
+								  RSenCredentialArray& aCredentials) = 0;
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  RSenCredentialPtrArray& aCredentials) = 0;
+
+		virtual TInt CredentialsL(const CSenWSDescription& aPattern,
+								  const CSenIdentityProvider& aIdP,
+								  RSenCredentialPtrArray& aCredentials) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL(CSenInternalCredential* apCredential,
+		                                          TInt& aErrorTo) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL(CSenIdentityProvider* apIdP,
+									              CSenInternalCredential* apCredential,
+									              TInt& aErrorTo) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL(const TDesC8& aCredential,
+		                                          TInt& aErrorTo) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL(CSenIdentityProvider* apIdP,
+                                                 const TDesC8& aCredential,
+                                                 TInt& aErrorTo) = 0;
+
+		virtual TInt RemoveCredentialsL(const CSenWSDescription& aPattern) = 0;
+
+		virtual TInt RemoveCredentialsL(const CSenWSDescription& aPattern,
+										const CSenIdentityProvider& aIdP) = 0;
+
+        virtual TInt RemoveCredentialsL(const TDesC8& aProviderId) = 0;
+										
+        virtual TInt RemoveCredentialL(TInt aInternalCredentialId) = 0;	//codescannerwarnings
+        
+        virtual RSenCredentialPtr CredentialL(TInt aInternalCredentialId,
+                                              TInt& aErrorTo) = 0;
+
+        virtual RSenCredentialPtr UpdateCredentialL(TInt aInternalCredentialId,
+                                                    CSenInternalCredential* apCredential,
+                                                    TInt& aErrorTo) = 0;
+        
+        virtual RSenCredentialPtr UpdateCredentialL(TInt aInternalCredentialId,
+                                                    const TDesC8& aCredential,
+                                                    TInt& aErrorTo) = 0;
+                                                    
+    private:
+        virtual TInt SaveCredentialDB() = 0;
+    };
+
+#endif // M_SEN_CREDENTIAL_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_HANDLER_H
+#define M_SEN_HANDLER_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+namespace SenHandler
+    {
+    enum THandlerType
+        {
+        ESessionHandler = 1, // CSenMessageHandler instance
+        EMessageHandler      // CSenSessionHandler instance
+        };
+
+    enum THandlerDirection
+        {
+        EOutgoing = 1, 
+        EIncoming,
+        EBoth   
+        };
+        
+    enum THandlerPhase
+        {
+        EDiscovery = 1,
+        EValidate,
+        EMessage
+        };
+    }
+
+// FORWARD DECLARATIONS
+class MSenHandlerContext;
+
+// CLASS DECLARATION
+class MSenHandler
+    {
+    public:
+    
+        // New functions
+        
+        /**
+        * Method is used to resolve concrete type (class)
+        * for this handler instance.
+        * @return the class type of this handler
+        */
+        virtual SenHandler::THandlerType Type() const = 0;        
+    
+    	/**
+    	* Indicates the direction this handler is serving.
+    	* @return enum, which tells where this handler will 
+    	* be applied - outgoing, incoming, or on both directions.
+    	*/
+    	virtual SenHandler::THandlerDirection Direction() const = 0;
+
+    	/**
+    	* Dictates the phase on which this handler is performing.
+    	* @return phase enum, telling at what phase of processing 
+    	* will this hanlder be applied
+    	*/
+    	virtual SenHandler::THandlerPhase Phase() = 0;
+
+        /**
+        * Method is used to resolve real, system-widely
+        * unique name for this handler. By default, this
+        * typically returns the ECOM cue (default_data)
+        * of the concrete plug-in instance.
+        * @return the unique name of this handler
+        */
+        virtual TPtrC8 Name() const = 0;      
+
+        /**
+        * Handlers must also be capable to represent their structure and state 
+        * (type, direction and phase) in UCS8 XML form. This can be achieved either 
+        * by overriding this method, or by deriving from xml fragment class, like
+        * CSenBaseFragment.
+        * @ param aWs is the stream where to write UCS8 (UTF-8) XML document into.
+        */
+        virtual void WriteAsXMLToL(RWriteStream& aWs) = 0;
+        
+        /**
+        * Method for getting XML representation of a handler.
+        * 
+        * @return UCS8 (UTF-8) XML document representation of this handler.
+        * This XML will include handlers type, direction, phase and name.
+        */
+        virtual HBufC8* AsXmlL() = 0;
+        
+        /**
+        * InitL method uses a handler context to initialize this 
+        * handler instance, and it is called once right after
+        * a ECOM instance lookup is done successfully. InitL()
+        * method may also be used in re-initialization of 
+        * ready allocated, preserved handler instancies owned
+        * by a WSF.
+        * @return KErrNone or some WSF specific or system-wide error code
+        */
+        virtual TInt InitL(MSenHandlerContext& aCtx) = 0;
+        
+    };
+
+#endif // M_SEN_HANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenhandlercontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_HANDLER_CONTEXT_H
+#define M_SEN_HANDLER_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include "msencontext.h" // internal Framework\inc
+
+// FORWARD DECLARE
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class MSenHandlerContext : public MSenContext
+    {
+    public:
+        /**
+        * Adds new MSenCoreServiceManager& type value into context,
+        * typically identified by this key: KSenCtxKeyCoreServiceManager.
+        * @aKey identifies new value
+        * @aValue is the value being added. 
+        * Ownership is NOT transferred to this context.
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(MSenCoreServiceManager& aValue) = 0;
+
+        /*
+        * Method returns MSenCoreServiceManager* type value.
+        * @return value at certain index, or NULL, if not found.
+        * Ownership is not transferred, as it was never held by
+        * this context.   
+        */
+        virtual MSenCoreServiceManager* GetSenCoreServiceManager() = 0;
+    };
+
+#endif // M_SEN_HANDLER_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenlayeredproperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_LAYERED_PROPERTIES_H
+#define M_SEN_LAYERED_PROPERTIES_H
+
+// INCLUDES
+#include <e32std.h>
+#include "MSenProperties.h"
+#include "MSenProperty.h"
+
+class MSenLayeredProperties : public MSenProperties // Does not implement ReadFromL(UTF-8), but DOES implement WriteToL() in a way, where a flat property is generated looping through all the layers..
+    {
+    public:
+        /**
+        * PropertiesClassType enumeration.
+        */
+        enum TSenPropertiesLayer
+        	{
+        	ESenTransportLayer          = 1,
+        	ESenSereneLayer             = 2,
+        	ESenFrameworkLayer          = 3,
+        	ESenProviderSessionLayer    = 4,
+        	ESenConsumerSessionLayer    = 5,
+        	ESenMessageLayer            = 6,
+        	ESenLastLayer               = ESenMessageLayer
+        	};
+        	
+        	     
+        	
+        /**
+        * Writes given layer from this properties object as descriptor
+        * into a stream.
+        * UTF-8 charset encoding will be used.
+        * @since Series60
+        * @param aLayer The layer to be used.
+        * @param aWriteStream The stream to write to.
+        */
+        virtual void WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer) = 0;
+
+        /**
+        * Reads this properties object from the descriptor to given
+        * layer.
+        * UTF-8 charset encoding should be used.
+        * @since Series60
+        * @param aBuffer The buffer to read from.
+        * @param aLayer The layer to be used.
+        */
+        virtual void ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer) = 0;
+
+        /**
+        * Get the given layer from these properties as UTF-8 charset
+        * encoded descriptor.
+        * @since Series60
+        * @param aLayer The layer to be used.
+        * @return a pointer to UTF-8 encoded descriptor.
+        * Caller takes ownership.
+        */
+        virtual HBufC8* AsUtf8L(TSenPropertiesLayer aLayer) = 0;
+
+        /**
+        * Get the given layer from these properties as UTF-8 charset
+        * encoded descriptor.
+        * @since Series60
+        * @param aLayer The layer to be used.
+        * @return a pointer to UTF-8 encoded descriptor, which is
+        * has been left on cleanup stack.
+        * Caller takes ownership.
+        */
+        virtual HBufC8* AsUtf8LC(TSenPropertiesLayer aLayer) = 0;
+        
+        virtual TInt ShrinkTo(TSenPropertiesLayer aLayer) = 0;
+        
+        virtual void ExpandToL(TSenPropertiesLayer aLayer) = 0;
+        
+        virtual TSenPropertiesLayer TopLayer() = 0;
+        
+        /**
+        * Sets new property.
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        Is the value of this property.
+        * @param aLayer        The layer to be used.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        * Leave codes:
+        *                      According to implementing classes. 
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName,
+                                  const TDesC8& aValue,
+                                  TSenPropertiesLayer aLayer) = 0;
+        
+        /**
+        * Gets the value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TPtrC8 reference to be filled in with the value of
+        *                 the property.
+        * @param aLayer   The layer to be used.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        virtual TInt PropertyL(const TDesC8& aName,
+                               TPtrC8& aValue,
+                               TSenPropertiesLayer aLayer) = 0;
+                               
+        /**
+        * Gets the MSenProperty of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A MSenProperty reference to pointer to be filled in with
+        *                 the pointer to the property.
+        * @param aLayer   The layer to be used.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        virtual TInt PropertyL(const TDesC8& aName,
+                               MSenProperty*& aValue,
+                               TSenPropertiesLayer aLayer) = 0;                               
+        
+        /**
+        * Gets the MSenProperty of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A MSenProperty reference to pointer to be filled in with
+        *                 the pointer to the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        virtual TInt PropertyL(const TDesC8& aName,
+                               MSenProperty*& aValue) = 0;                               
+
+        /**
+        * Gets the array of MSenProperties which match to given property type.
+        * @since Series60
+        * @param aTypeName The name identifying property type.
+        * @param aArray    An array containing MSenProperties which macth
+        *                  to given property type.
+        * @return          KErrNone if no error, or some of the system wide
+        *                  error codes.
+        */
+        virtual TInt PropertiesByTypeL(const TDesC8& aTypeName,
+                                      RPointerArray<MSenProperty>& aArray) = 0;
+
+        /**
+        * Sets new integer property.
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        Is the integer value of this property.
+        * @param aLayer        The layer to be used.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        * Leave codes:
+        *                      According to implementing classes. 
+        */
+        virtual TInt SetIntPropertyL(const TDesC8& aName,
+                                     const TInt aValue,
+                                     TSenPropertiesLayer aLayer) = 0;
+        
+        /**
+        * Gets the integer value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TInt reference to be filled in with the value of
+        *                 the property.
+        * @param aLayer   The layer to be used.
+        * @return         The value of the property, or KNullDesC8 if
+        *                 property is not found.
+        */
+        virtual TInt IntPropertyL(const TDesC8& aName,
+                                  TInt& aValue,
+                                  TSenPropertiesLayer aLayer) = 0;
+        
+        /**
+        * Sets new boolean property.
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        The boolean value of this property.
+        * @param aLayer        The layer to be used.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        * Leave codes:
+        *                      According to implementing classes. 
+        */
+        virtual TInt SetBoolPropertyL(const TDesC8& aName,
+                                      const TBool aValue,
+                                      TSenPropertiesLayer aLayer) = 0;
+        
+        /**
+        * Gets the boolean value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TBool reference to be filled in with the value of
+        *                 the property.
+        * @param aLayer   The layer to be used.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        virtual TInt BoolPropertyL(const TDesC8& aName,
+                                   TBool& aValue,
+                                   TSenPropertiesLayer aLayer) = 0;
+        
+    };
+
+#endif // M_SEN_LAYERED_PROPERTIES_H
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenmessagecontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_MESSAGE_CONTEXT_H
+#define M_SEN_MESSAGE_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32std.h>
+#include "msencontext.h"
+#include "MSenProperties.h"
+#include "MSenMessage.h"
+
+
+// CONSTANTS
+namespace SenContext
+    {
+    _LIT8(KSenCurrentSoapMessageCtxKey,             "urn:com.nokia.serene:message:soap:current");
+    _LIT8(KRemoteConsumer,                          "RemoteConsumer");
+    }
+
+/**
+* This is the message context interface, which is visible to CSenMessageHandler ECOM plug-in implementations.
+*/
+
+// FORWARD DECLARATIONS
+class CSenSoapEnvelope;
+class CSenSoapMessage;
+class CSenChunk;
+
+// CLASS DECLARATION
+class MSenMessageContext : public MSenContext
+    {
+    public:
+
+        /**
+        * Getter for the current message held by this message context.
+        * @return pointer to MSenMessage, or NULL if message is not 
+        * within this context at the moment.
+        */
+        virtual MSenMessage* MessageL() = 0;	//codescannerwarnigns
+
+        /**
+        * Sets the current message for this context, potentially freeing 
+        * currently owned message (de-alloc) if such exists. 
+        * @param apMessage provides pointer to new message. Note that
+        * by default the ownership *is* passed to this context.
+        * @return status code: 
+        *   KErrArgument if argument is NULL.
+        *   KErrNone on success.
+        */
+        virtual TInt SetMessage(MSenMessage* apMessage, TBool aOwned = ETrue) = 0;
+        
+
+        /**
+        * Getter for chunk which representates of the main message,
+        * held by this message context.
+        * @return pointer to CSenChunk, or NULL if message is not 
+        * within this context at the moment.
+        */
+        virtual CSenChunk* ChunkL() = 0;	//codescannerwarnings
+
+
+        /**
+        * Sets the current message (as chunk) for this context, potentially freeing 
+        * currently owned message (de-alloc) if such exists. 
+        * @param apMsgAsChunk provides pointer to chunk. Note that
+        * by default the ownership *is* passed to this context.
+        * @return status code: 
+        *   KErrArgument if argument is NULL.
+        *   KErrNone on success.
+        */
+        virtual TInt SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned = ETrue) = 0;
+
+        /*
+        * Setter for message specific (transport) properties
+        * @param apProperties is the pointer to properties.
+        * Note that by default the ownership *is* passed to this context.
+        * @return status code: 
+        *   KErrArgument if argument is NULL.
+        *   KErrNone on success.
+        */
+        virtual TInt SetProperties(MSenProperties* apProperties, TBool aOwned = ETrue) = 0;
+
+        /*
+        * Getter for message specific (transport) properties
+        * @return transport properites as MSenProperties pointer, or NULL
+        * if properties object does not exist.
+        */
+        virtual MSenProperties* Properties() = 0;
+
+
+        virtual TInt Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue) = 0;
+        virtual TInt Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue) = 0;
+        virtual MSenMessage* GetMessageL(const TDesC8& aKey) = 0;	//codescannerwarnings
+
+
+        // ---
+        
+        // Old, deprecated methods
+
+        /*
+        * Method returns "current" CSenSoapMessage*.
+        * @return value, or NULL, if not found.
+        * Ownership is not transferred, but remains to be held by this context.   
+        * Caller is supposed to know the type (class) of returned value from 
+        * the pre-defined binding to certain key.
+        * @deprecated: use Message() getter instead!
+        */
+        virtual CSenSoapMessage* GetCurrentSoapMessage() = 0;  // DEPRECATED: remove this method; replace with MSenMessage variant
+
+
+        
+        /*
+        * Method returns original message serialized into UCS8 by
+        * service consumer (msg=request), or service (msg=response),
+        * depending direction of this context.
+        * @return serialized message (outgoing one from
+        * service consumer, or incoming, original response
+        * which transport has received from (remote) service.
+        * - or KNullDesC8, if not set.
+        * Ownership is NOT transferred, but remains to be held by this context.   
+        * Caller is supposed to know the type (class) of returned
+        * value from the pre-defined binding to certain key.
+        */
+        virtual TPtrC8 GetMessageL() = 0; // DEPRECATED: keep but rename this method 
+
+        /*
+        * Adds new CSenSoapEnvelope* type value into context, identified by given key.
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is transferred
+        * to this context.
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, CSenSoapEnvelope* aValue) = 0; // DEPRECATED: remove this method; replace with MSenMessage variant
+
+        /*
+        * Updates new CSenSoapEnvelope* type value into context, identified by given key.
+        * If some value for the same key already exists, it is destroyed and replaced
+        * by the new value.
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is transferred to this context.
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, CSenSoapEnvelope* aValue) = 0;  // DEPRECATED: remove this method; replace with MSenMessage variant
+
+        /*
+        * Method returns CSenSoapEnvelope* type value.
+        * 
+        * @param aKey identifies SOAP envelope object
+        * 
+        * @return value behind given key, or NULL, if not found.
+        * Ownership is NOT transferred, but remains to be held by
+        * this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenSoapEnvelope* type.   
+        */
+        virtual const CSenSoapEnvelope* GetSenSoapEnvelopeL(const TDesC8& aKey) = 0;  // DEPRECATED: remove this method; replace with MSenMessage variant
+    };
+
+#endif // M_SEN_MESSAGE_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenprovider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_PROVIDER_H
+#define M_SEN_PROVIDER_H
+
+#include "MSenHostlet.h" // public
+
+// FORWARD DECLARATIONS
+class CSenIdentifier;
+class MSenServiceDescription;
+class CSenWSDescription;
+class RCriticalSection;
+
+// CLASS DECLARATION
+
+/**
+* Class for delivering SOAP request to WSP and getting back a response
+*
+*/       
+class MSenProvider : public MSenHostlet
+    {
+    friend class CSenProvider;
+    friend class CSenLocalRequest;
+
+    public: 
+        /**
+        * Separate session initialization method, which is called when
+        * some session of certain requester (service consumer) is "attached"
+        * to this provider. In case of non-sharable provider, this happens
+        * only once. Method performs some auto-configuration to that session,
+        * describing the capabilities (facets), that are enabled in this 
+        * provider implementation.
+        *
+        * @param aRequestor identifiers the caller of the service. This
+        * service consumer owns the actual service session. Sharable
+        * providers may wish to use this information in order to handle
+        * multiple service-side sessions and to map incoming messages
+        * to provider's internal state.
+        *
+        * @param aSession is a handle to the client side session being served.
+        * Some providers may want to store some service specific information
+        * into the session, which further can be utilized by service framework.
+        * For example, the default implementation for this method typically
+        * sets some facets into the session, which affect on messaging and
+        * session handling; provider may indicate, that it is sharable, or
+        * provider may say, that it wants complete messages instead of message
+        * bodies by changing pre-defined facets on a session. Framework (session)
+        * can then recognize these facets and change the way it talks to the provider.
+        *
+        * Typically, frameworks should call this method when they find provider
+        * to be local, in order to fully initialize their client side session 
+        * which represents the provided service.
+        *
+        * So, this method is performing "auto-configuration" for service sessions,
+        * so that caller (session itself) can read these properties of the provider
+        * from the XML SD (aSession). This way, a deployed provider does not need
+        * to be followed by explicit Service Management API calls configuring, lets
+        * say, whether a provider is exposed or not.
+        */
+        
+
+        // virtual void InitServiceSessionL(MSenServiceDescription& aSession) = 0; // @deprecated: implement inherited MSenHostlet::ServiceDescriptionL instead(!)
+    	// virtual CSenWSDescription* SessionDescriptionLC() = 0; // @deprecated: implement inherited MSenHostlet::ServiceDescriptionL instead(!)
+    
+        /**
+        * Provider implementation, which wishes to explicitly expose it's
+        * service to outside world (outbound requests from network) should
+        * override this method and make it return ETrue. This would cause 
+        * "expose" facet to be added to service session (SD), granting access 
+        * from otherwise *trusted* requester (access control is done using policies).
+        * Even trusted identities cannot access providers in the device, if 
+        * they don't explicitly expose their service.
+        *
+        * @return boolean indicating whether this provider is exposed
+        * to any trusted digital identity, which is making requests
+        * from outside world.
+        *
+        * Default implementation typically returns EFalse, which means that
+        * the provider is meant for local service consumers only.
+        */
+        virtual TBool Exposed() const = 0;
+        
+        /**
+        * Provider implementation should override this method and set the
+        * value to ETrue, if it implements capability to server several 
+        * service consumers (sessions). 
+        *
+        * @return boolean indicating whether this provider is sharable
+        * between multiple service consumers (sessions) simultaneously.
+        * Corresponding facet is KProviderSharableFacet.
+        *
+        * Default implementation typically returns EFalse, which means
+        * that provider is NOT shared between multiple consumers (sessions).
+        */
+        virtual TBool Sharable() const = 0;    
+    
+        /**
+        * Provider implementation should override this method and set the
+        * value to ETrue, if it wants to receive complete messages instead
+        * of plain message bodies (example: full SOAP Envelope vs. SOAP Body).
+        *
+        * @return boolean indicating whether this provider wants to receive
+        * complete messages from a client.
+        * Corresponding facet is KProviderCompleteClientMsgsFacet.
+        *
+        * Default implementation typically returns EFalse, which means that
+        * provider will receive the body of the message only.
+        */
+        virtual TBool CompleteClientMessages() const = 0;
+
+        /**
+        * Provider implementation should override this method and make it
+        * return ETrue, if it wants to speed up the run time invocation
+        * of this provider, performed by certain service consumer. Such
+        * provider will be recognized and loaded when Core Service Manager
+        * (WSF server process) starts up. Provider will be de-allocated
+        * depending whether it is sharable and if it is multi-threaded or not
+        * - which is similar to how providers behave in any other case, too.
+        *
+        * @return boolean indicating whether this provider is loaded on WSF
+        * startup or not.
+        * Corresponding facet is KProviderLoadOnStartupFacet.
+        *
+        * Default implementation typically returns EFalse, which means that
+        * provider will not be loaded on WSF main process (Symbian server)
+        * start-up.
+        */
+        virtual TBool LoadOnStartup() const = 0;
+
+        /**
+        * Provider implementation should override this method and make
+        * it return EFalse, if it wants to implement multi-threaded,
+        * non thread-safe  ServiceL. This typically means that such providers
+        * will make use of RCriticalSection inside of their own implementation.
+        *
+        * If a provider is sharable *but not* thread-safe, it means, that
+        * it is possible that multiple requests to ServiceL, from multiple 
+        * consumers are executed simultaneously from separate threads.
+        * It is strongly recommended to use critical sections inside the
+        * provider plug-in implementation. This kind of sharable providers
+        * might be serving under quite heave load. The requesters (threads)
+        * should be identified by the information available in hostlet request
+        * interface
+        *
+        * Then again, if provider is not sharable *but not* thread-safe,
+        * it means that multiple request threads from *same service consumer* 
+        * might execute ServiceL simultaneously. Provider implementation should
+        * therefore offer thread-safe functionality inside ServiceL, possibly via
+        * use of RCriticalSection instance, or through some other mutex.
+        *
+        * @see MSenHostletRequest to figure out ids for requesters / addressees
+        *
+        * @return boolean indicating whether this provider is thread-safe or not.
+        * Corresponding facet is KProviderThreadsafeFacet. Default implementation
+        * typically returns EFalse, which means that ServiceL of the provider will
+        * not be called by several threads simultaneously. Threadsafe sharable 
+        * providers have critical section surrounding ServiceL, which prevents 
+        * more than one thread accessing the method simultaneously. Unsharable 
+        * providers are typically loaded only to serve certain request, after 
+        * which they are de-allocated. However, the non thread-safe unsharable 
+        * providers allow multiple request threads of the *same* service consumer
+        * to execute ServiceL simultaneously.
+        */
+        virtual TBool Threadsafe() const = 0;
+
+        /** 
+        * Provider implementation should override this method and make it 
+        * return ETrue, if they are capable of returning their internal state
+        * to one equal with state that they were right after original construction.
+        *
+        * @return ETrue, if ReinitL() will reset this provider, and EFalse, if
+        * such re-init capability is not implemented (default). Corresponding
+        * facet is KProviderReinitializableFacet.
+        */
+        virtual TBool Reinitializable() const = 0;
+
+        /*
+        * Provider implementation should override this method and make it
+        * return ETrue, if they wish to keep any invoked instance on the
+        * background, after the provider is released. Service consumer 
+        * and it's thread executing the request typically release any unsharable
+        * provider ECOM instance after response from such is received.
+        *
+        * @return ETrue, if provider wants to stay on background as long as WSF
+        * main process thread is alive (WSF Core Service Manager). Default
+        * implementation returns EFalse, which allows unloading and de-allocation
+        * of any "released", non-used provider instances. Corresponding facet is
+        * KProviderStayOnBackgroundFacet.
+        */
+        virtual TBool StayOnBackground() const = 0;
+        
+        /**
+        * Re-init should be implemented by those Hostlets (providers), which
+        * want to allow that instance to be re-used, that is resetted by the
+        * invoker. For example, then some component responsible of loading of
+        * the providers might be able to improve performance of slowly constructed
+        * providers by calling this method, instead of de-allocating that instance
+        * and making a ECOM lookup creating a similar, but new instance to same
+        * service provider endpoint.
+        * Implementations should thus reset any state variables that they have, 
+        * and set themselves to the state in which they were right after first
+        * construction. However, some performance benefits can be achieved if 
+        * some class members can be treated as "stateless objects", which can
+        * be re-used without possibly much slower re-instatiation.
+        *
+        * This method is a pair to Reinitializable() function, meaning that when
+        * one develops such provider which supports reinitialization, that re-init 
+        * should be implemented behind this ReinitL() method.
+        *
+        * Default implementation typically does nothing and returns KErrNotSupported,
+        * since most of the providers don't support re-initialization.
+        *
+        * @return KErrNone if this provider instance is successfully reinitialized.
+        *         Otherwise method returns some system-wide error code.
+        */
+        virtual TInt ReinitL() = 0;
+
+        /**
+        * Re-initializable or shared service providers, which instance is being called
+        * from multiple threads may wish to override this method in order to act on this
+        * signal and to properly initialize their thread specific components, like those 
+        * which have Thread Local Store (TLS) based implementation.
+        * 
+        * If the method leaves, it is treaded equally as if the leave occured in the actual
+        * ServiceL.
+        */
+        //virtual void ThreadInitL(const TDesC& aThreadId) = 0;
+
+        /**
+        * Re-initializable or shared service providers, which instance is being called
+        * from multiple threads may wish to override this method in order to act on this
+        * signal and to properly initialize their thread specific components, like those 
+        * which have Thread Local Store (TLS) based implementation.
+        */
+        //virtual void ThreadDestroy(const TDesC& aThreadId) = 0;
+
+
+    private:
+        RCriticalSection iCriticalSection;
+    };
+
+
+#endif 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenremotehostlet.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Non-public callback interface, which transports typically call
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_REMOTE_HOSTLET
+#define M_SEN_REMOTE_HOSTLET
+
+
+/**
+ * MSenRemoteHostlet is non-public interface, which is typically implemented by
+ * Symbian server-side session implementations (like CSenClientSession) and
+ * called by Transport plug-ins (like HostletTransportPlugin) classes.
+ * Interface is used send requests (transactions from service consumers)
+ * to hostlet applications (residing behind process boundary) - in this sense
+ * the "remote" here stands for for that hostlet application process, which
+ * is remotely manipulated. Any methods introduced in this interface, are
+ * typically turned into IPC operations by the implementing classes, so
+ * that corresponding real communication (data transfer) may take place.
+ */
+
+ // CLASS DECLARATION
+class MSenRemoteHostlet
+    {
+    public:
+        /**
+        * Send a message with transaction ID to the service consumer.
+        * This method allows session implementation to perform internal
+        * mechanisms prior handing the response to the actual, already
+        * known consumer (MSenRemoteServiceConsumer).
+        *
+        * Session implementation might decide, that certain messages are
+        * not delivered to consumer(s). Or, the session may validate the
+        * received message and actually decide sending an error to the
+        * consumer.
+        * 
+        * @see sendToConsumer in com.nokia.serene.framework.RServiceSession
+        *
+        * @param aMessage is the request message from service consumer
+        * @param aConsumer is the consumer sending the request. 
+        * @param aTxnId is the transaction id of this async request. 
+        * This id is most likely used by MSenRemoteHostlet implementations
+        * to query CSenChunk (RChunk) from RSenRemoteServiceConsumer, so
+        * that copying of that payload can be avoided altogether.
+        * @return KErrNone if message was successfully delivered to hostlet
+        *         KErrSen
+        *         Otherwise, some system-wide error code.
+        * Method leaves with some system-wide code, if message cannot be
+        * processed by the hostlet implementation without some major fault.
+        */
+        virtual TInt ProcessRequestFromConsumerL(const TDesC8& aMessage,
+                                                 const TInt aTxnId,
+                                                 MSenRemoteServiceConsumer& aConsumer) = 0; 
+
+
+        // Call-back which tells when HostletConnection's Respond (ASYNC OP) has been
+        // completed and with what code (error code or KErrNone)
+        virtual TInt OnServiceCompleteL(const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc = KNullDesC8) = 0; 
+        virtual void TransferProgressForHostlet(TInt aTxnId, TBool aIncoming,
+                TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress) = 0;
+    };
+#endif // M_SEN_SERVICE_SESSION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenremoteserviceconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_REMOTE_SERVICE_CONSUMER_H
+#define M_SEN_REMOTE_SERVICE_CONSUMER_H
+
+
+#include <e32base.h>
+#include <e32des8.h>    // HBufC8
+#include <SenServiceConnection.h>
+
+//#include "MSenRemoteServiceSession.h"
+//#include "MSenTransport.h"
+
+// FORWARD DECLARE
+class MSenRemoteServiceSession;
+class MSenTransport;
+class CSenIdentifier;
+class CSenServiceSession;
+class CSenChunk;
+class MSenProperties;
+class MSenMessageContext;
+class CSenIdentityProvider;
+
+// CLASS DECLARATION
+class MSenRemoteServiceConsumer
+    {
+    public:
+    
+        // New functions
+ 
+        /**
+        * Getter to the ID of this service consumer. Actually this is a convenience
+        * method which returns the value of the CSenIdentifier which is globally 
+        * identifying this consumer. This helper is handy in cases where identifier
+        * type is not relevant. In more complex, global junctions, Identitifier()
+        * getter method should be called.
+        * @return a descriptor which locally identifies this session. This is actually
+        *         the value of CSenIdentifier, which is the unique identifier of this
+        *         consumer.
+        */       
+        virtual const TDesC8& Id() const = 0;
+ 
+        virtual TInt SetSessionL(MSenRemoteServiceSession& aServiceSession) = 0;
+
+        /**
+         * This callback will be called when a response message is received 
+         * from (remote) service. The framework spesific overhead is removed
+         * from the message, unless the application has indicated that it wants
+         * to receive complete messages. This means that response could be only 
+         * the message body OR complete message with header information. In SOAP
+         * spesific services, it could be either SOAP Body or complete SOAP 
+         * envelope. Also, in most cases, the string is actually XML.
+         *
+         * @param aMessage is the response from the service. Depending on client's
+         * wishes, it might be complete message, or only a body of the original
+         * message from which all framework spesific overhead has been removed.
+         * @param aTxnId identifies what request is being responded. This transaction
+         *        was originally generated by the transport layer.
+         * @param aTranportProperties is optional argument, which may be NULL,
+         *        or it could include some transport spesific information about the
+         *        message. In case of HTTP transport, it could include the content 
+         *        type of the response.
+         * @param   aMessage - a String with the service specific part of the
+         *          message.
+         * @return KErrNone, if this consumer was able to successfully carry out
+         *         and process this callback. Consumer should return an error otherwise,
+         *         so that the service session (or even transport) will know that 
+         *         problems occured during the delivery.
+         */
+        virtual TInt HandleMessageL(HBufC8* aMessage,
+                                    const TInt aTxnId,
+                                    MSenProperties* aResponseTransportProperties) = 0;
+
+        /**
+         * This callback will be called when an error response (marked as a fault)
+         * is received from (remote) service. The framework spesific overhead is 
+         * removed from the error, unless the application has indicated that it 
+         * wants to receive complete messages. This means that response could be
+         * only the fault part of message body OR complete error message with header
+         * information. In SOAP spesific services, it could be either SOAP fault or 
+         * complete SOAP envelope. In most cases, the error string is XML.
+         *
+         * @param aError is the error received from the service. Depending on client's
+         * wishes, it might be complete error message, or only a body of the original
+         * error from which all framework spesific overhead has been removed. In SOAP
+         * based services, this means that it could be either complete SOAP Envelope
+         * or just the SOAP fault extracted from the SOAP body.
+         * @param aErrorCode is the code identifying the error type.
+         * @param aTxnId identifies what request is being responded. This transaction
+         *        was originally generated by the transport layer.
+         * @param aTranportProperties is optional argument, which may be NULL,
+         *        or it could include some transport spesific information about the
+         *        message. In case of HTTP transport, it could include the content 
+         *        type of the response.
+         * @param   aMessage - a String with the service specific part of the
+         *          message.
+         * @return KErrNone, if this consumer was able to successfully carry out
+         *         and process this callback. Consumer should return an error otherwise,
+         *         so that the service session (or even transport) will know that 
+         *         problems occured during the delivery.
+         */
+        virtual TInt HandleErrorL(HBufC8* aError,
+                                  const TInt aErrorCode,
+                                  const TInt aTxnId,
+                                  MSenProperties* aResponseTransportProperties) = 0;
+
+        /**
+         * This method is called when service connection status changes.
+         * The status constant (TInt) may be be spesified by the actual
+         * ServiceInvocationFramework implementation. The following
+         * status codes are possible for *any* service invocation 
+         * framework (as defined in SenServiceConnection.h):
+         *
+         *   - KSenConnectionStatusNew     
+         *   - KSenConnectionStatusReady   
+         *
+         * In addition, some web services frameworks might notify when
+         * the service credentials get expired, by sending this status:
+         *
+         *   - KSenConnectionStatusExpired 
+         *
+         * @param   aStatus - a code expressing new status
+         */
+        virtual void SetStatusL(const TInt aStatus) = 0;
+
+
+        /**
+         * This method is offered for the use of service invocation frameworks
+         * (SIFs) and typically for service sessions, which need handle transport
+         * to pre-allocated transport instance.
+         *
+         * return   MSenTransport   the transport owned by remote client
+         *
+         */
+        virtual MSenTransport& TransportL() = 0;
+
+        /**
+        * Getter for unique identifier of this service consumer, which
+        * further provides the´identifier type and value.
+        * @return CSenIdentifier object which identifies this consumer.
+        */
+        virtual CSenIdentifier& Identifier() const = 0;
+
+
+        /**
+        * Method for requesting a chunk behind a known, pending transaction
+        * id. This method is typically called by MSenRemoteHostlet implementations,
+        * when they wish to acquire handle to same RChunk -- encapsulated by CSenChunk
+        * -- which was created by consumer who is sending a message to that hostlet.
+        * This way, the copying of memory (payload of the message) can be avoided
+        * inside Web Services Framework server process.
+        * @param aTxnId is the id of known, pending transaction
+        * @param aChunk is a ref-to-pointer, which will be set
+        * to provide access to a chunk, if such can be find with
+        * provided aTxnId
+        * @return KErrNone, if successful: this means that aChunk != NULL.
+        *         KErrNone, if chunk was not found; aChunk will be set to NULL.
+        * Method leaves with some system-wide errorcode, if a fatal situation
+        * is met during the search and validation of the chunk (transaction)
+        * in question.
+        */
+        // INTERNAL NOTE: please be careful not to base your code on this method, as this will
+        // be made obsolate (deprecated) when message context implementations are available
+        virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk) = 0;
+        
+        
+        
+        inline virtual MSenMessageContext* MessageContextByTxnIdL(TInt /* aTxnId */, TInt& aError) 
+            {
+            aError = KErrNotSupported;
+            return NULL; 
+            }
+
+        inline virtual void StateChanged(TInt /*aState*/) {}; 
+
+        inline virtual TBool HasAuthenticationCallback() { return EFalse;};
+        // Constantness on TInt return type has no meaning
+        virtual TInt ConnectionId() { return 0; };
+        virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress) = 0;
+        virtual TInt ReauthenticationNeededL(CSenIdentityProvider*& /*aIdp*/) { return 0; };
+        virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) = 0; 	
+        virtual TBool OnGetBrandIdL(  const TDesC8& /* aBrandIdListAsXmlSnippet */, RBuf8& /* aSelectedBrandId */){return EFalse;};
+        virtual TBool HasCoBrandingCallback(){return EFalse;};
+        virtual TSecureId SecureId( ) {return 0;};
+        virtual TVendorId VendorId() { return 0; };
+        };
+
+#endif // M_SEN_REMOTE_SERVICE_CONSUMER_H
+
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenremoteservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,348 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_REMOTE_SERVICE_SESSION
+#define M_SEN_REMOTE_SERVICE_SESSION
+
+
+/*
+ * MSenRemoteServiceSession is a non-public remote interface that is only 
+ * implemented by the CSenServiceSession class. The methods of this interface 
+ * are called upon by instances of CSenClientSession.
+ *
+ * @see RService in Java reference implementation (2005) - regardless of 
+ * name-mismatch methods of this interface *equal* with RService. 
+ * 
+*/
+
+// INCLUDES
+#include "MSenServiceDescription.h"
+#include "msentransport.h"
+#include "MSenFragment.h"
+
+// FORWARD DECLARE
+class CSenTransportBase;
+class MSenRemoteServiceConsumer;
+class MSenRemoteHostlet;
+class CSenChunk;
+
+//enum TDescriptionClassType;
+
+
+// CLASS DECLARATION
+class MSenRemoteServiceSession  //: public MSenFragment
+    {
+    public:
+    
+        // New functions
+        
+        virtual MSenServiceDescription& AsServiceDescription() = 0;
+        /*
+         * 
+         * 
+         * 
+         */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+
+    
+        /*
+         * StatusL() will compute and return the status code.
+         *
+         * @return current status of this service session. Basic
+         * constants are defined in public MSenServiceConsumer.h:
+         *
+         * KSenConnectionStatusNew              Connection is being initialized, but not yet ready.
+         * KSenConnectionStatusReady            Connection is ready to be used. For example, SubmitL()
+         *                                      and SendL() methods (depending of framework) are in
+         *                                      invocable state.
+         * KSenConnectionStatusExpired          Connection is expired. Typically, a new connection
+         *                                      needs next to be initialized in order to communicate
+         *                                      with the underlying service behind this service
+         *                                      connection.
+         * If any error should occur in this method, it leaves.
+         *  
+         */
+        virtual TInt StatusL() = 0;
+    
+        /*
+         * Method synchronously submits a message to (remote) service 
+         * via the transport of this session. Method will block until
+         * the response is received.
+         * 
+         * @param aMessage is the actual request body to be sent to
+         *        the remote service via the transport of this session.
+         * @param aTransportProperties are the properties to be passed
+         *        to the transport. Transport properties further define
+         *        how the message should be carried out to the service
+         *        provider. In HTTP transport's case, properties could
+         *        dictate what HTTP method, header(s) and proxy params
+         *        are to be used in the transport layer.
+         * @param aConsumer is a reference to the actual caller of the
+         *        service, which is consuming this session. Transport
+         *        might be interested to resolve identifier, and other
+         *        aspects of the consumer via this handle.
+         * @param aResponse is reference to a pointer where transport
+         *        is expected to reserve memory for tha actual response.
+         * @return KErrNone if submit is successfull or otherwise some 
+         *        system-wide error code.
+         */
+        virtual TInt SubmitL(const TDesC8& aMessage, 
+                             const TDesC8& aTransportProperties,
+                             MSenRemoteServiceConsumer& aConsumer,
+                             HBufC8*& aResponse) = 0;
+    
+        /*
+         * Method asynchronously sends a message to (remote) service
+         * via the transport of this session. Function will typically
+         * return almost immediately, since the service response will
+         * be received via spesific callback methods.
+         * 
+         * @param aMessage is the actual request body to be sent to
+         *        the remote service via the transport of this session.
+         * @param aTransportProperties are the properties to be passed
+         *        to the transport. Transport properties further define
+         *        how the message should be carried out to the service
+         *        provider. In HTTP transport's case, properties could
+         *        dictate what HTTP method, header(s) and proxy params
+         *        are to be used in the transport layer.
+         * @param aConsumer is a reference to the actual caller of the
+         *        service, which is consuming this session. Transport
+         *        might be interested to resolve identifier, and other
+         *        aspects of the consumer via this handle.
+         * @param aTxnId is reference to transaction id,
+         *        to be set by the transport to identify
+         *        this request.
+         * @param aRevalidationError contains error / SOAP Fault from
+         *        authentication service (like WS-* STS or Liberty AS / IDP)
+         * @return KErrNone if send is successfull or otherwise some 
+         *        system-wide error code.
+         */
+        virtual TInt SendL( const TDesC8& aMessage, 
+                            const TDesC8& aTransportProperties,
+                            MSenRemoteServiceConsumer& aConsumer,
+                            TInt& aTxnId,
+                            HBufC8*& aRevalidationError ) = 0;
+    
+        /*
+         * Method synchronously submits a message to (remote) service 
+         * via the transport of this session.
+         * 
+         * @param aSoapMessage is the actual request body - a SOAP
+         *        envelope, which is to be sent to remote service 
+         *        via the transport of this session.
+         * @param aTransportProperties are the properties to be passed
+         *        to the transport. Transport properties further define
+         *        how the message should be carried out to the service
+         *        provider. In HTTP transport's case, properties could
+         *        dictate what HTTP method, header(s) and proxy params
+         *        are to be used in the transport layer.
+         * @param aConsumer is a reference to the actual caller of the
+         *        service, which is consuming this session. Transport
+         *        might be interested to resolve identifier, and other
+         *        aspects of the consumer via this handle.
+         * @param aResponse is reference to a pointer where transport
+         *        is expected to reserve memory for tha actual response.
+         * @return KErrNone if submit is successfull or otherwise some 
+         *        system-wide error code.
+         */
+        virtual TInt SubmitSoapL(const TDesC8& aSoapMessage,
+                                 const TDesC8& aTransportProperties,
+                                 MSenRemoteServiceConsumer& aConsumer,
+                                 HBufC8*& aResponse) = 0;
+        /*
+         * Method asynchronously sends a message to (remote) service
+         * via the transport of this session. Function will typically
+         * return almost immediately, since the service response will
+         * be received via spesific callback methods.
+         * 
+         * @param aSoapMessage is the actual request body - a SOAP
+         *        envelope, which is to be sent to remote service 
+         *        via the transport of this session.
+         * @param aTransportProperties are the properties to be passed
+         *        to the transport. Transport properties further define
+         *        how the message should be carried out to the service
+         *        provider. In HTTP transport's case, properties could
+         *        dictate what HTTP method, header(s) and proxy params
+         *        are to be used in the transport layer.
+         * @param aConsumer is a reference to the actual caller of the
+         *        service, which is consuming this session. Transport
+         *        might be interested to resolve identifier, and other
+         *        aspects of the consumer via this handle.
+         * @param aTxnId is reference to transaction id,
+         *        to be set by the transport to identify
+         *        this request.
+         * @param aRevalidationError contains error / SOAP Fault from
+         *        authentication service (like WS-* STS or Liberty AS / IDP)
+         * @return KErrNone if send is successfull or otherwise some 
+         *        system-wide error code.
+         */
+        virtual TInt SendSoapL( const TDesC8& aSoapMessage,
+                                const TDesC8& aTransportProperties,
+                                MSenRemoteServiceConsumer& aConsumer,
+                                TInt& aTxnId,
+                                HBufC8*& aRevalidationError ) = 0;
+    
+    
+        /**
+        * Method checks if this session is ready to interact with (remote)
+        * service. Typically, if service invocation framework requires 
+        * credentials, they are checked inside this method.
+<        * @return boolean indicating if this session is ready (ETrue) or
+        *         not (EFalse) to interact with (possibly remote) service.
+        */
+        virtual TBool IsReadyL() = 0;
+
+        virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) = 0;
+        virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo) = 0;
+        virtual TInt CompleteServerMessagesOnOffL(const TBool& aCompleteOnOff) = 0;
+        virtual TPtrC8 Endpoint() = 0;
+        virtual TPtrC8 Contract() = 0;
+        virtual TPtrC8 FrameworkId() = 0;
+        virtual void StartTransaction() = 0;
+        virtual void TransactionCompleted() = 0;
+        virtual MSenServiceDescription::TDescriptionClassType DescriptionClassType() = 0;
+
+        /**
+        * Method is used to apply transport properties for this service session.
+        * In basic implementation, the properties information is passed to 
+        * transport of this session.
+        * @param aProperties contains transport properties properties as descriptor
+        * @param aConsumer is the "actor", typically the remote consumer which is 
+        *        invoking this method.
+        * @return KErrNone if successful, or otherwise some system-wide error code
+        */
+        virtual TInt SetTransportPropertiesL(const TDesC8& aProperties,
+                                             MSenRemoteServiceConsumer& aConsumer) = 0;
+
+        virtual TInt TransportPropertiesL(HBufC8*& aProperties,
+                                             MSenRemoteServiceConsumer& aConsumer) = 0;
+
+
+
+        /**
+        * Sets the transport plug-in instance,
+        * passing the ownership to this 
+        * session.
+        * @param aTransport is the new transport for this session.
+        * Note that if a Transport instance is already owned, it 
+        * will be deleted.
+        */
+        virtual void SetTransportL(CSenTransportBase* aTransport) = 0;
+
+        /**
+        * Getter for currently effective transport instance.
+        * It is strongly recommended, that service sessions
+        * themselves acquire transport via TransportL -variant,
+        * which is capable of factoring a transport in case
+        * that it does not exist already.
+        * @return currently set transport, or NULL
+        * 
+        */
+        virtual MSenTransport* Transport() const = 0;
+
+        /**
+        * Returns the transport of this session. If transport is not
+        * yet known (owned), an attempt to create a transport for this
+        * session will be performed, and this attempt may result this
+        * method to leave.
+        * @param aRequestor is the consumer of this session, which is
+        * about to utilize the transport of this session.
+        * Leaves with system-wide error code in case that a new transport
+        * cannot be instantiated.
+        */
+        virtual MSenTransport& TransportL(MSenRemoteServiceConsumer& aRequestor) = 0;
+
+        /**
+        * Sets the hostlet for this session. HostletConnection server-side
+        * sessions (CSenClientSessions) call this method in order to provide
+        * their own reference to session, which can be utilized by HostletTransport
+        * plug-ins, so that the messages from remote service consumers can be routed.
+        * @param aHostlet is a reference to MSenRemoteHostlet implementation, typically
+        * to CSenClientSession class. Note that it is perfectly legal to pass
+        * NULL as aHostlet - that call just means, that any existing MSenRemoteHostlet
+        * will be "unset" / detached from this session.
+        * @return KErrNone if successful, or otherwise some system-wide error code.
+        * Method may leave, if aHostlet is found invalid.
+        */
+        virtual TInt SetHostletL(MSenRemoteHostlet* aHostlet) = 0;
+
+ 
+        virtual MSenRemoteHostlet* Hostlet() const = 0;        
+
+        /**
+        * Removes a service consumer from this session.
+        *
+        * Removed consumer will no longer receive any callbacks
+        * from the service provider it used to communicate with.
+        * Typically, MSenRemoteServiceConsumer implementations call
+        * this method from their destructors. When the count of
+        * session consumers is decreased to zero, and session
+        * does not hold any reference to a MSenRemoteHostlet either
+        * the default implementation provided in here will also
+        * delete the associated transport plug-in instance, in order
+        * to save (memory, messaging stack etc) resources .
+        * @param aConsumer is the service consumer to be removed.
+        * @return positive index of successfully removed consumer or
+        *         KErrNotFound - if consumer was not found
+        */
+        virtual TInt RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer) = 0;
+        
+        /**
+        * This method is invoked by WS-stack Core on each call to
+        * CSenHostletConnection::RespondL. The typical implementation
+        * in service session class will use associated transport plug-in
+        * to complete the pending transaction. If contents of the message
+        * do not require any modification, then the session can rely that
+        * the response set by the hostlet application (MSenHostlet) is
+        * already in place. If there is need to modify the response in
+        * SIF spesific way, then the message can be resolved using the
+        * txn ID (before completing this transaction).
+        * @param aProvider is the interface to the hostlet that is providing
+        * this response -- via RespondL issued inside (or after) 
+        * MSenHostlet::ServiceL.
+        * @param aTxnId is the transaction ID of this request/response pair
+        * @param aServiceCode is the code that was set to MSenHostletResponse
+        * by the hostlet application
+        * @param aRecipientsConsumerId may be used to resolve interested
+        * service consumer, which issued the request to the hostlet
+        * @param aMessageChunk contains the message as raw 8-bit data,
+        * plus it's other properties
+        * @return TInt KErrNone on success, or otherwise some of the system-wide
+        * error codes.
+        */
+        virtual TInt ProvideHostletResponseL(MSenRemoteHostlet& aProvider,
+                                             const TInt aTxnId,
+                                             const TInt aServiceCode,
+                                             const TDesC8& aRecipientsConsumerId,
+                                             CSenChunk& aMessageChunk) = 0;
+        
+
+        //virtual HBufC8* AsXmlL() = 0;
+
+        //virtual TInt SignMessages(const TDesC8& aAlgoritm,
+        //                          const TDesC8& aSigningKey) = 0;
+    };
+#endif // M_SEN_REMOTE_SERVICE_SESSION
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msensaslmessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SASL_MESSAGE_H
+#define SEN_SASL_MESSAGE_H
+
+// INCLUDES
+#include <MSenFragment.h>
+
+#include "msencoreservicemanager.h"
+#include "senpasswordtransform.h"
+
+// CLASS DECLARATION
+class MSenSaslMessage 
+    {
+    public:
+        
+        // New functions
+        
+        /**
+         *  Accepts KNullDesC.
+         */
+        virtual TInt ConstructInitRequestFromL(const TDesC8& aAllMechanismNames,
+                                               CSenIdentityProvider& aAccount) = 0;
+
+        virtual TInt ConstructRequestFromL(const TDesC8& aMech) = 0;
+        virtual TInt ConstructRequestFromL(const TDesC8& aMech,
+                                           const TDesC8& aData) = 0;
+
+        virtual TBool IsContinue() = 0;
+        virtual TBool IsAbort() = 0;
+
+        /**
+         *  @return KNullDesC if not set.
+         */
+         virtual TPtrC8 Mechanism() = 0;
+
+        /**
+         *  @return KNullDesC if not set.
+         */
+        virtual TPtrC8 ParameterName() = 0;
+
+        /**
+         *  @return KNullDesC if not set.
+         */
+        virtual TPtrC8 Data() = 0;
+        virtual RPointerArray<CSenPasswordTransform> Transforms() = 0;
+    };
+
+#endif // SEN_SASL_MESSAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenserviceinvocationframework.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_SERVICE_INVOCATION_FRAMEWORK_H
+#define M_SEN_SERVICE_INVOCATION_FRAMEWORK_H
+
+// INCLUDES
+#include "msencoreservicemanager.h"
+#include "MSenServiceDescription.h"
+#include "MSenServiceDescription.h"
+
+// FORWARD DECLARATIONS
+class CSenServiceSession;
+class CSenCredential2;
+
+// CLASS DECLARATION
+
+/**
+* The core (father) interface for all Service Invocation Frameworks
+*/
+class MSIF
+    {
+    public:
+        
+        // New functions
+        
+        /**
+         * @return TDesC8& that indicates the TYPE of this framework (like ID-WSF, WS-STAR, ATOM, REST, OVI).
+         *         Typically it is a relaxed "binding" to either propriatary or well known and/or open 
+         *         spesification(s) that the framework implements.
+         */
+        virtual const TDesC8& Id() = 0;
+
+        /**
+         * Create a ServiceSession based upon the given ServiceDescription.
+         * The ServiceSession is expected to be "valid", i.e. ready for use
+         * by a client.
+         * @param aServiceDescription is the service description that was found
+         * (match) with given service invokation paramaters ("service pattern")
+         * @param aPattern contains the invokation parameters defined by the
+         * consumer who wishes to connect to a service. At minimum, this SD
+         * includes and endpoint and/or contract (service type).
+         * @param aNewSession is a ref-to-pointer that is used to "return"
+         * a valid sessions. Important note: in case that this method fails,
+         * it is ILLEGAL to put orphan object into this ref-to-ptr. Only in
+         * case of success, the ownership of aNewSession is transferred to caller(!)
+         * @param    aErrorMsg will be allocated to provide detailed
+         *           information about error, if available (like SOAP fault)
+         * @return KErrNone if successful (aNewSession ownership is transferred to
+         * caller) or some of the system-wide errorcodes (aNewSession should be NULL)
+         */
+        virtual TInt CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                            MSenServiceDescription& aPattern,
+                                            CSenServiceSession*& aNewSession,
+                                            MSenRemoteServiceConsumer& aRemoteConsumer,
+                                            HBufC8*& aErrorMsg ) = 0;
+
+
+        /**
+         * @return a new instance of a framework specific class that
+         * implements the ServiceDesccription interface.
+         */
+        virtual CSenWSDescription* NewServiceDescriptionL() = 0;
+
+        /**
+         * @return the CoreServiceManager for which this instance is working.
+         * This is used by the ServiceSession instances created by this
+         * framework.
+         * Note, in WSF, ServiceManager IS SINGLETON(!), so all Frameworks
+         * return their "owner" - that is - the only service manager in
+         * SenFramework
+         */
+        virtual MSenCoreServiceManager& Manager() = 0;
+
+        /**
+         * Attempt to register the ServiceDescription to the CoreServiceManager
+         * that owns the framework.
+         * This is a callback used by the ServiceManager to give frameworks
+         * a chance to replace a generic ServiceDescription into something
+         * that is more specific, and more useful, to the
+         * ServiceInvocationFramework.
+         * @param aServiceDescription A ServiceDescription
+         * @return TInt aError - indicates the error or KErrNone if successful
+         */
+        virtual TInt RegisterServiceDescriptionL( MSenServiceDescription& aServiceDescription ) = 0;
+
+
+        /**
+         * Attempts to unregister the ServiceDescription from the
+         * CoreServiceManager that owns the framework.
+         * This is a callback used by the ServiceManager.
+         * @param aServiceDescription A ServiceDescription
+         * @return TInt aError - indicates the error or KErrNone if successful
+         */
+        virtual TInt UnregisterServiceDescriptionL( MSenServiceDescription& aServiceDescription ) = 0;
+
+        /**
+         * Logging method intended for the use of Service Invocation Frameworks
+         * and their component classes.
+         */
+        //virtual RFileLogger* Log() const = 0; 
+        
+        /**
+        * SIF should set any framework specific transport properties via this method.
+        * @param aTransport is the transport plug-in where the (framework layer)
+        * properties transport properties can be applied
+        * @return KErrNone if success, or othewise a system-wide error code 
+        */
+        virtual TInt SetTransportPropertiesL( MSenTransport& aTransport ) = 0;
+        
+        /**
+         * @return a string that is the unique for this implementation. Note that there might be multiple
+         * frameworks, which all implement same TYPE (framework ID is the same), but which have different
+         * design. This might mean that they implement different VERSION of the framework. It is recommended
+         * that framework CUE is the ECOM cue of the framework, and that it is in form of URN (unique resource
+         * name).
+         */
+        virtual TPtrC8 Cue() const = 0;
+    };
+
+#endif // M_SEN_SERVICE_INVOCATION_FRAMEWORK_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenservicemanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,410 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_SERVICE_MANAGER_H
+#define M_SEN_SERVICE_MANAGER_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <flogger.h> // RFileLogger
+#include <badesca.h> // CDesCArray etc
+
+#include "msentransportfactory.h"
+
+// FORWARD DECLARATIONS
+class CSenXmlReader;
+class MSenServiceDescription;
+class MSenIdentityManager;
+class MSenRemoteServiceConsumer;
+class CSenWSDescription;
+class CSenServiceSession;
+class CSenIdentityProvider;
+class CSenBaseFragment;
+class MSenProviderPolicy;
+class MSenConsumerPolicy;
+class RStringPool;
+class CSenInternalCredential;
+class RSenCredentialPtr;
+
+// DATA TYPES
+typedef RPointerArray<CSenWSDescription> RWSDescriptionArray;
+typedef RPointerArray<CSenInternalCredential> RSenCredentialArray;
+typedef RArray<RSenCredentialPtr> RSenCredentialPtrArray;
+
+// CLASS DECLARATION
+
+/**
+* MSenServiceManager represents the client side interface of a
+* CoreServiceManager
+* The methods defined in this interface may executed from a client
+* (ServiceConnection) via the server-side session (SenClientSession).
+* Note that the singleton CoreServiceManager also has a number of public
+* methods (defined in MSenCoreServiceManager interface) that are used by
+* e.g. plug-ins, that are expected to operate in the same process as the
+* CoreServiceManager.
+*/
+class MSenServiceManager : public MSenTransportFactory
+    {
+    public:
+    
+        // New functions
+        
+        /**
+        * @param aServiceConnection is the ServiceConnection to 
+        * be initialized. Method attempts to initialize connection
+        * according to a pattern, which this service manager receives.
+        * Pattern is spesified by some service consumer (WSC app's), 
+        * which requests a new connection to be initialized.
+        * Therefore, the new connection should be to a service that
+        * has a service description matching with the pattern.
+        * @param aPattern is a - typically partial - service description
+        * that is used as a search pattern.
+        * @param aErrorMsg may contain the error message (SOAP-ENV or SOAP 
+        * fault) in case that this function is returning an error from service
+        * @return KErrNone or a system-wide error code, if error occurred.
+        */
+        virtual TInt InitServiceConnectionL( MSenRemoteServiceConsumer& aServiceConsumer,
+                                             CSenWSDescription& aPattern,
+                                             HBufC8*& aErrorMsg) = 0;
+        /**
+        * Search for services whose service descriptions using a contract URI.
+        * @param   aMatches is the list into which 0 or more ServiceDescriptions
+        * will be appended, if one or more matches are found. Onership of the
+        * appended pointers is not transferred to the caller.
+        * @param   aContract is the URI which specifies the searhed contract.
+        * @return KErrNone if successful, or otherwise a system-wide error code.
+        */
+        virtual TInt ServiceDescriptionsL( RWSDescriptionArray& aMatches,
+                                           const TDesC8& aContract ) = 0;
+        
+        /**
+        * Search for services with a matching ServiceDescription,
+        * which can contain any combination of contract, endpoint and facets.
+        * @param   aMatches is the list into which 0 or more service descriptions
+        * will be appended. Ownership of appended pointers is not transferred to
+        * the caller.
+        * @param aPattern is the service description used as "search pattern", 
+        * as a kind of "search mask". This means, that it is typically a "partial"
+        * service description, which fields include only those fields that need
+        * to match - the content of other fields (elements) is not relevant to
+        * the caller.
+        * @return KErrNone if successful, or otherwise a system-wide error code.
+        */
+        virtual TInt ServiceDescriptionsL( RWSDescriptionArray& aMatches,
+                                           MSenServiceDescription& aPattern ) = 0;
+
+        /**
+        * Used by applications to inform the Service Manager about a service,
+        * for example about an Authentication Service, which typically cannot
+        * be discovered through other means.
+        * @param aServiceDescription which is being registered.
+        * @return KErrNone if registration was successful or otherwise:
+        *  a system error
+        */
+        virtual TInt RegisterServiceDescriptionL( CSenWSDescription* apServiceDescription ) = 0;
+
+        /**
+        * Used by application to to inform the Service Manager about a service
+        * which no longer is available. The ServiceManager will remove the
+        * service from its database as soon as it is no longer used.
+        * @param aServiceDescription
+        * @return KErrNone if registration succeeded or otherwise some system-wide
+        * error code.
+        */
+        virtual TInt UnregisterServiceDescriptionL( MSenServiceDescription& aServiceDescription ) = 0;
+
+        /**
+        * Method attempts to find new framework using given FrameworkId. If framework ECOM
+        * is found, the a pointer to it's configuration reader (fragment) is returned, or
+        * NULL otherwise.
+        */
+        virtual CSenBaseFragment* InstallFrameworkL( const TDesC8& aFrameworkId ) = 0;
+
+        /**
+        * Return the XML reader instance used and owned by this Core Service Manager
+        */
+        virtual CSenXmlReader* XMLReader() = 0;
+
+        /**
+        * @return totally randomly generated (but not cryptographically strong)
+        * GUID. The GUID is based on the MD5 hash of a random number and the 
+        * current time. 
+        */
+        virtual HBufC8* RandomGuidL() = 0;
+
+        /*
+        * @return pointer to the file logger owned by this Core Service Manager
+        */
+        virtual RFileLogger* Log() const = 0;
+
+        virtual void IncrementConnections() = 0;
+        virtual void DecrementConnections() = 0;
+
+        /**
+        * Register an IdentityProvider for the current active Identity.
+        * Ownerships is transferred. Method is typically implemented
+        * by some Identity Manager which this Core Service Manager knows.
+        * @param aIdp a registered IdentityProvider
+        * @return KErrNone or system-wide error code.
+        */
+        virtual TInt RegisterIdentityProviderL( CSenIdentityProvider* aIdp ) = 0;
+
+        /**
+        * Unregister an IdentityProvider for the current active Identity.
+        * Method is typically implemented by some Identity Manager which 
+        * this Core Service Manager knows.
+        * @param aIdp an unregistered IdentityProvider
+        * @return true if successful.
+        */
+        virtual TBool UnregisterIdentityProviderL( CSenIdentityProvider& aIdp ) = 0;
+
+        /**
+        * Associate a service to an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool AssociateServiceL( const TDesC8& aServiceID,
+                                         const TDesC8& providerID ) = 0;
+
+        /**
+         * Dissociate a service from an IdentityProvider.
+         * @param aServiceID the contract or endpoint of a service
+         * @param aProviderID the id of an IdentityProvider
+         * @return true if successful. Failure may be caused by non-existence
+         * of the IdentityProvider for the current user.
+         */
+        virtual TBool DissociateServiceL( const TDesC8& aServiceID,
+                                          const TDesC8& aProviderID ) = 0;
+
+        virtual void SetShowPasswordDialog( const TBool aState ) = 0;
+
+        /**
+         *  Check if there is an existing service description with identical data
+         *  already in the database. The service description in the database can
+         *  contain more information than the pattern, but all the pattern 
+         *  information MUST match exactly for a match.
+         *  @param  aContains contains the boolean value in return, ETrue if found,
+         *          EFalse if not
+         *  @param  aPattern the service description data to be searched.
+         *  @return KErrNone or other system-wide Symbian error codes.
+         */
+        virtual TInt ContainsServiceDescriptionL( TBool& aContains,
+                                                  CSenWSDescription& aPattern ) = 0;
+
+        /**
+         *  Check if there is an existing identity provider with identical data
+         *  already in the database. The identity provider in the database can
+         *  contain more information than the pattern identity provider, 
+         *  but all the pattern information MUST match exactly for a match.
+         *  @param  aContains contains the boolean value in return, ETrue if found,
+         *          EFalse if not
+         *  @param  aPattern the identity provider data to be searched.
+         *  @return KErrNone or other system-wide Symbian error codes.
+         */
+        virtual TInt ContainsIdentityProviderL( TBool& aContains,
+                                                CSenIdentityProvider& aIDP) = 0;
+
+        /**
+        * Notifies all framework plug-ins about certain event
+        * @param aEvent is the event code passed to all plug-ins
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL( const TInt aEvent ) = 0;
+
+        /**
+        * Notifies all framework plug-ins about certain event and
+        * object.
+        * @param aEvent is the event code passed to all plug-ins
+        * @param aArgument is an additional object pointer may be
+        * passed. NULL is also accepted.
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL( const TInt aEvent, 
+                                        TAny* aArgument ) = 0;
+
+
+        /**
+        * Notifies only those frameworks plug-ins, which match
+        * with given framework ID (aFrameworkID)
+        * @param aEvent is the event code passed to certain plug-ins
+        * @param aFrameworkID spesifies which frameworks are need to
+        * be notified. Note, that if aFrameworkID is KNullDesC8 
+        * (zero-length),then all known framework plug-ins are notified
+        * about the event.
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL( const TDesC8& aFrameworkID,
+                                        const TInt aEvent ) = 0;
+
+        /**
+        * Notifies only those frameworks plug-ins, which match
+        * with given framework ID (aFrameworkID) and 
+        * an additional object pointer may be passed
+        * NULL is also accepted
+        * @param aEvent is the event code passed to certain plug-ins
+        * @param aFrameworkID spesifies which frameworks are need to
+        * be notified. Note, that if aFrameworkID is KNullDesC8 
+        * (zero-length),then all known framework plug-ins are notified
+        * about the event.
+        * @param aArgument is an additional object pointer may be
+        * passed. NULL is also accepted.
+        * @return some system-wide error code, if an error occurred
+        */
+        virtual TInt NotifyFrameworksL( const TDesC8& aFrameworkID,
+                                        const TInt aEvent,
+                                        TAny* aArgument ) = 0;
+
+        /**
+        * Calculates the size of service descriptions, in bytes.
+        * Internally, this method calls WriteAsXMLToL() from each
+        * service description instance found inside aArray.
+        *
+        * @param aArray contains the service descriptions, which
+        * size in XML is requested.
+        * @return total amount of bytes that XML representation of
+        *         service descriptions included in aArray take.
+        *
+        * In case of error, this method will leaves and passes on
+        * the system-wide error code in question.
+        */
+        virtual TInt SizeOfServiceDescriptionsL( RWSDescriptionArray& aArray ) = 0;
+        
+        /**
+        * Calculates the size of credentials, in bytes.
+        * Internally, this method calls WriteAsXMLToL() from each
+        * credential instance found inside aArray.
+        *
+        * @param aArray contains the credentials, which size in
+        *               XML is requested.
+        * @return       total amount of bytes that XML representation
+        *               of credentials included in aArray take.
+        *
+        * In case of error, this method will leaves and passes on
+        * the system-wide error code in question.
+        */
+        virtual TInt SizeOfCredentialsL( RSenCredentialArray& aArray ) = 0;
+        virtual TInt SizeOfIdentityProvidersL(const RPointerArray<CSenIdentityProvider>& aArray) = 0;
+
+
+        /**
+        * Getter for WSF-wide string pool. Any subcomponent utilizing
+        * a string pool based API should use this instance, which is
+        * owned by service manager implementation behind this interface.
+        * @return RStringPool reference to string pool owned by the manager
+        *
+        */
+        virtual RStringPool& StringPool() = 0;
+
+        /**
+        * Method attempts to add an entry to the list of active hostlet connection
+        * endpoints.
+        * @param aEndpoint is the identifier, typically some URN, representing the
+        *        endpoint. It is expected to be locally unique. MSenRemoteHostlet
+        *        implementations typically call this method to figure out whether
+        *        the endpoint proposed by actual Hostlet Connection is available
+        *        or not. In case of error, that error is then normally propagated
+        *        all the way back to the public API, so that constructor -- 
+        *        CSenHostletConnection::NewL will leave.
+        * @return KErrNone if add succeeded
+        *         KErrSenEndpointReserved, if the endpoint is already allocated 
+        *         for some other hostlet connection.
+        * Note: KErrSenEndpointReserved is defined in SenHostletConnection.h
+        */
+//        virtual TInt AddActiveHostletConnectionEndpointL(const TDesC8& aEndpoint) = 0;
+
+        /**
+        * Removes entry from the list of active hostlet connection endpoints.
+        * @param aEndpoint is the identifier, typically some URN, representing the
+        *        endpoint. MSenRemoteHostlet impelemtations typically call this method
+        *        when the hostlet connection (server-side session) is being de-allocated.
+        * @return KErrNone if add succeeded
+        *         KErrSenEndpointReserved, if the endpoint is already allocated 
+        *         for some other hostlet connection.
+        * Note: KErrSenEndpointReserved is defined in SenHostletConnection.h
+        */
+//        virtual TInt RemoveActiveHostletConnectionEndpoint(const TDesC8& aEndpoint) = 0;
+
+        virtual TInt NextTransactionId() = 0;
+        
+		virtual TInt CredentialsL( const CSenWSDescription& aPattern,
+								   RSenCredentialArray& aCredentials ) = 0;
+
+		virtual TInt CredentialsL( const CSenWSDescription& aPattern,
+								   const CSenIdentityProvider& aIdP,
+								   RSenCredentialArray& aCredentials ) = 0;
+
+		virtual TInt CredentialsL( const CSenWSDescription& aPattern,
+								   RSenCredentialPtrArray& aCredentials ) = 0;
+
+		virtual TInt CredentialsL( const CSenWSDescription& aPattern,
+								   const CSenIdentityProvider& aIdP,
+								   RSenCredentialPtrArray& aCredentials ) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL( CSenInternalCredential* apCredential,
+		                                           TInt& aErrorTo ) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL( CSenIdentityProvider* apIdP,
+									               CSenInternalCredential* apCredential,
+									               TInt& aErrorTo ) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL( const TDesC8& aCredential,
+		                                           TInt& aErrorTo ) = 0;
+
+		virtual RSenCredentialPtr AddCredentialL( CSenIdentityProvider* apIdP,
+									               const TDesC8& aCredential,
+									               TInt& aErrorTo ) = 0;
+
+		virtual TInt RemoveCredentialsL( const CSenWSDescription& aPattern ) = 0;
+
+		virtual TInt RemoveCredentialsL( const CSenWSDescription& aPattern,
+										 const CSenIdentityProvider& aIdP ) = 0;
+        
+        virtual TInt RemoveCredentialsL(const TDesC8& aProviderId) = 0;
+										
+        virtual TInt RemoveCredentialL( TInt aInternalCredentialId ) = 0; //codescannerwarnings
+        
+        virtual RSenCredentialPtr CredentialL( TInt aInternalCredentialId,
+                                               TInt& aErrorTo ) = 0;
+
+        virtual RSenCredentialPtr UpdateCredentialL( TInt aInternalCredentialId,
+                                                     CSenInternalCredential* apCredential,
+                                                     TInt& aErrorTo ) = 0;
+        
+        virtual RSenCredentialPtr UpdateCredentialL( TInt aInternalCredentialId,
+                                                     const TDesC8& aCredential,
+                                                     TInt& aErrorTo ) = 0;
+										
+        virtual TInt FindMatchingIdentityProviderL( CSenIdentityProvider &aIdp,
+                                                    CSenIdentityProvider*& apMatch ) = 0;
+                                                   
+        virtual TInt UpdateIdentityProviderL( CSenIdentityProvider& aIdp ) = 0;
+        
+        virtual TInt NextConnectionID() = 0;
+    };
+
+#endif // M_SEN_SERVICE_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msenservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Non-public callback interface, which transports typically call
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_SERVICE_SESSION
+#define M_SEN_SERVICE_SESSION
+
+
+/**
+ * RServiceSession is a non-public remote interface
+ * only implemented by the CSenServiceSession class. 
+ * These methods are typically invoked by transport
+ * instancies.
+ *
+ * Interface equals with com.nokia.serene.framework.RServiceSession
+ * 
+ * @see CSenServiceSession and Jave ref-implementation
+ * in com.nokia.serene.framework.ServiceSession (2005)
+ */
+
+ 
+
+// FORWARD DECLARES
+class MSenRemoteServiceConsumer;
+class MSenRemoteHostlet;
+class MSenProperties;
+
+// CLASS DECLARATION
+class MSenServiceSession
+    {
+    public:
+        /**
+        * Send a message with transaction ID to the service consumer.
+        * This method allows session implementation to perform internal
+        * mechanisms prior handing the response to the actual, already
+        * known consumer (MSenRemoteServiceConsumer).
+        *
+        * Session implementation might decide, that certain messages are
+        * not delivered to consumer(s). Or, the session may validate the
+        * received message and actually decide sending an error to the
+        * consumer.
+        * 
+        * @see sendToConsumer in com.nokia.serene.framework.RServiceSession
+        *
+        * @param aMessage is the response message from service
+        * @param aTxnId is the transaction id of this async responsed message
+        * @param aConsumer is the consumer of the service. It could
+        * be CSenClientSession or some subclass of CSenInternalConsumer
+        * (like in Liberty ID-WSF it could be authentication service client
+        * or discovery service client).
+        * @param aResponseTransportProperties contains the properties related
+        * to this response (from the transport plug-in).
+        * @return KErrNone if message was successfully delivered to consumer(s).
+        *         Otherwise, some system-wide error code.
+        */
+        virtual TInt SendToConsumerL(HBufC8* apMessage,
+                                     const TInt aTxnId,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     MSenProperties* aResponseTransportProperties = NULL) = 0; 
+
+        /**
+        * Send an error code and message with transaction ID to the service 
+        * consumer. This method allows session implementation to perform 
+        * internal mechanisms prior handing the response to the actual, 
+        * already known consumer (MSenRemoteServiceConsumer).
+        *
+        * Session implementation might decide, that certain errors are handled
+        * without notifying the consumer(s).
+        *
+        * @see sendFaultToConsumer in com.nokia.serene.framework.RServiceSession
+        *
+        * @param aErrorCode is the error code identifying this error
+        * @param aError is the error message - a response from service
+        * @param aConsumer is the consumer of the service. It could
+        * be CSenClientSession or some subclass of CSenInternalConsumer
+        * (like in Liberty ID-WSF it could be authentication service client
+        * or discovery service client).
+        * @param aTxnId is the transaction id of this async responsed error.
+        * @return KErrNone if error message was successfully delivered to 
+        *         consumer(s). Otherwise, some system-wide error code.
+        */
+        virtual TInt SendErrorToConsumerL(const TInt aErrorCode,
+                                          HBufC8* apError,
+                                          const TInt aTxnId,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          MSenProperties* aResponseTransportProperties = NULL) = 0; 
+
+
+        /**
+        * Method allows sessions of service invocation framework to recover
+        * from certain errors (like certain SOAP faults) which can be recognized
+        * at (low) transport layer. This way these faults could be  processed 
+        * silently between service and its session, without disturbing the 
+        * actual service consumer.
+        *  
+        * Since this type of errors (or faults) usually consists of XML,
+        * a spesific error class can also be created to parse received
+        * error.
+        *
+        * @see Java ref-implementation: handleFault in 
+        *  com.nokia.serene.framework.RServiceSession
+        *
+        * @param aErrorCode is the error code identifying this error
+        * @param aError is the error message - actual response from service
+        * @param aTxnId is the transaction id of this async responsed error.
+        * @param aConsumer is the consumer of the service. It could
+        * be CSenClientSession or some subclass of CSenInternalConsumer
+        * (like in Liberty ID-WSF it could be authentication service client
+        * or discovery service client).
+        * @param aResponseTransportProperties contains the properties related
+        * to this response (from the transport plug-in).
+        * @return KErrNone if error message was successfully delivered to 
+        *         consumer(s). Otherwise, some system-wide error code.
+        */
+        virtual TInt HandleErrorL(const TInt aErrorCode,
+                                  HBufC8* aError,
+                                  const TInt aTxnId,
+                                  MSenRemoteServiceConsumer& aConsumer,
+                                  MSenProperties* aResponseTransportProperties = NULL) = 0; 
+
+        /**
+        * Returns the currently set hostlet 
+        * @return MSenRemoteHostlet pointer or NULL, if this session
+        * does not interact with hostlet (local service provider 
+        * application).
+        */
+        virtual MSenRemoteHostlet* Hostlet() const = 0;
+
+                      
+       /*
+        * @param aReceiver is the hostlet to which the message should be delivered
+        * @param aMessage is the request from service a service consumer. 
+        * SIF spesific service session implementation(s) may read or manipulate this
+        * message by before handling it over to the hostlet (application).
+        * @param aFrom is the consumer of the service, which is sending
+        * the message.
+        * @param aTxnId is the transaction id of this async message
+        * @return KErrNone if message was successfully delivered to consumer(s).
+        *         Otherwise, some system-wide error code.
+        */             
+        virtual TInt SendToHostletL(MSenRemoteHostlet& aReceiver,
+                                    const TDesC8& aMessage,
+                                    const TInt aTxnId,
+                                    MSenRemoteServiceConsumer& aFrom,
+                                    MSenProperties* aProperties = NULL) = 0; 
+                                                                       
+    };
+#endif // M_SEN_SERVICE_SESSION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msensessioncontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_SESSION_CONTEXT_H
+#define M_SEN_SESSION_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include "msencontext.h"
+/**
+* This is the session context interface, which is visible to CSenSessionHandler ECOM plug-in implementations.
+*/
+
+// FORWARD DECLARATIONS
+class CSenWSDescription;
+class MSenRemoteServiceSession;
+
+
+// CLASS DECLARATION
+class MSenSessionContext : public MSenContext
+    {
+    public:
+        /*
+        * Adds session description (as CSenWSDescription*) into context,
+        * typically identified by following key: KSenCtxKeyServiceSession
+        * 
+        * @param aValue is the value being added. Ownership is NOT transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        // virtual TInt AddSession(CSenWSDescription* aValue) = 0; // protected context
+
+        /*
+        * Updates new CSenWSDescription* type value into context, typically
+        * identified by following key: KSenCtxKeyServiceSession
+        * If some value for the same key already exists, it is replaced with new.
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is NOT transferred to this context.
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        //virtual TInt UpdateSession(CSenWSDescription* aValue) = 0;  // protected context
+
+        /*
+        * Method returns current service session as CSenWSDescriptionL* type value.
+        * 
+        * @return value behind given key, or NULL, if not
+        * found.
+        * Ownership is NOT transferred, as it was NOT held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenSoapEnvelope* type.   
+        */
+        virtual const CSenWSDescription* GetSession() = 0;
+
+        // virtual TInt AddInitializer(CSenWSDescription* aValue) = 0; // protected context
+        // virtual TInt UpdateInitializer(CSenWSDescription* aValue) = 0;  // protected context
+
+        /*
+        * Method returns session initializer as CSenWSDescriptionL* type value.
+        * 
+        * @returns value behind given key, or NULL, if not
+        * found.
+        * Ownership is NOT transferred, as it is never held by
+        * this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenSoapEnvelope* type.   
+        */
+        virtual const CSenWSDescription* GetInitializer() = 0;
+
+        /*
+        * Adds new CSenWSDescription* type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, CSenWSDescription* aValue) = 0;
+
+        /*
+        * Updates session description (as CSenWSDescription*) into context,
+        * typically identified by following key: KSenCtxKeyServiceSession
+        * If some value for this key already exists, it is destroyed and replaced
+        * by the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is transferred to this context.
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, CSenWSDescription* aValue) = 0;
+
+        /*
+        * Method returns CSenWSDescriptionL* type value.
+        * 
+        * @return value behind given key, or NULL, if not
+        * found.
+        * Ownership is not transferred, but remains to be held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenSoapEnvelope* type.   
+        */
+        virtual const CSenWSDescription* GetSenWSDescriptionL(const TDesC8& aKey) = 0;
+
+        /*
+        * Adds new MSenRemoteServiceSession& type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is NOT transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        virtual TInt Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue) = 0; // protected context
+
+        /*
+        * Updates new MSenRemoteServiceSession& type value into context, identified by given key.
+        * If some value for the same key already exists, it is replaced with the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is NOT transferred to this context.
+        * 
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        virtual TInt Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue) = 0;
+
+        /*
+        * Method returns MSenRemoteServiceSession* type value.
+        * 
+        * @param aKey identifies remote service session
+        * 
+        * @returns value behind given key, or NULL, if not
+        * found.
+        * Ownership is NOT transferred, as it was never held 
+        * by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not MSenRemoteServiceSession* type.   
+        */
+        virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey) = 0;
+
+    };
+
+#endif // M_SEN_SESSION_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msentransport.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_TRANSPORT_H
+#define M_SEN_TRANSPORT_H
+
+// INCLUDES
+#include <e32std.h>
+
+#include "msenservicesession.h"
+#include "msenremoteserviceconsumer.h"
+#include "msenlayeredproperties.h"
+
+#include "MSenElement.h"
+
+// CONSTANTS
+const TInt KErrSenTransactionComplete = 20;
+
+// FORWARD DECLARATIONS
+class CSenFragment;
+class CSenTransportProperties;
+
+// DATA TYPES
+typedef RPointerArray<CSenFragment> RTransportProperties;
+
+// CLASS DECLARATION
+class MSenTransport
+    {
+    public:
+    
+        // New functions
+        
+        /**
+        * Method for sending synchronous  request to a known endpoint (URI). This method
+        * will block the current ActiveScheduler until the response from service is received.
+        *
+        * @param aEndpoint is the endpoint, typically an URI of the service being invoked
+        * @param aMessage is the actual message to the service behind known endpoint
+        * @param aTransportProperties containts the transport related request properties
+        * @param aResponse will contain the response after this synchronous call returns.
+        * @param aConsumer is the underlying caller invoking this request.
+        * @return KErrSenNoEndpoint if aEndpoint lenght is zero or negative.
+        */
+        virtual TInt SubmitL(const TDesC8& aEndpoint,
+                             const TDesC8& aMessage,
+                             const TDesC8& aTransportProperties,
+                             HBufC8*& aResponse,
+                             MSenRemoteServiceConsumer& aConsumer) = 0;  
+    
+        /**
+        * Method for sending asynchronous request to a known endpoint (URI).
+        * @param aEndpoint is the endpoint, typically an URI of the service being invoked
+        * @param aMessage is the actual message to the service behind known endpoint
+        * @param aTransportProperties containts the transport related request properties
+        * @param aReplyTo is the session session performing this request for the caller 
+        * @param aConsumer is the underlying caller invoking this request (addressee)
+        * @param aTxnId will be set to refer to the new transaction id of this request
+        * @return KErrNone or some error, if the method fails. Error code can be either some
+        * system-wide constnat, or a WSF specific KErrSenNoEndpoint if aEndpoint lenght is zero
+        * or negative.
+        */
+        virtual TInt SendL(const TDesC8& aEndpoint,
+                           const TDesC8& aMessage,
+                           const TDesC8& aTransportProperties,
+                           MSenServiceSession& aReplyTo,
+                           MSenRemoteServiceConsumer& aConsumer,
+                           TInt& aTxnId) = 0;
+
+        /**
+        * Method parses and applies the given properties on top of current properties 
+        * (state) of the transport. This means, that all spesified property entries 
+        * override existing ones 
+        */
+        virtual TInt SetPropertiesL(const TDesC8& aProperties,
+                                    MSenLayeredProperties::TSenPropertiesLayer aTargetLayer,
+                                    MSenRemoteServiceConsumer* aConsumer) = 0;
+        
+        virtual TInt PropertiesL(HBufC8*& aProperties) = 0;
+
+        /**
+        * Cancels the transaction from the transport, removing interested pending
+        * consumers from list of response receivers, preventing any callbacks
+        * being performed even though transport itself may still receive response
+        * from some (network stack) server.
+        * @return KErrNone, if cancel was performed
+        *         KErrNotFound if transaction was not found 
+        */
+        virtual TInt CancelTransaction(const TInt aTxnId) = 0;
+
+        /**
+        * Method requests the transport plug-in implementation to complete
+        * a pending transaction. Typically, service provider sessions
+        * (like MSenRemoteHostlet) implementations call this method to
+        * signalize, that certain pending, asynchronous transaction
+        * issued earlier by some consumer has been completed.
+        * @param aTxnId is the id of the transaction to be completed
+        * @param aStatus is an optional, additinal status code, which
+        * transport plug-in should pass to the "addressee", the consumer,
+        * who originated this transaction.
+        * @return KErrNone if transaction was completed successfully
+        *         KErrNotFound if pending transaction, matching with
+        *         given aTxnId was not found.
+        */
+        virtual TInt CompleteTransaction(const TInt aTxnId,
+                                         const TInt aStatus = KErrNone) = 0;
+
+        /**
+        * Getter for the URI scheme of this transport plug-in implementation,
+        * Examples of such scheme are: http, tcp, udp and local.
+        * @return the scheme of this transport
+        */
+        virtual TPtrC8 UriSchemeL() = 0;
+        
+        
+        
+        virtual MSenProperties& PropertiesL() = 0;
+    
+        inline virtual TInt SubscribeEventListenerL(MSenRemoteServiceConsumer& /*aConsumer*/) 
+            {
+            return KErrNotSupported;
+            }
+        inline virtual TInt UnsubscribeEventListenerL(MSenRemoteServiceConsumer& /*aConsumer*/)
+            {
+            return KErrNotSupported;
+            }
+    };
+
+#endif // SEN_MTRANSPORT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msentransportcontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_TRANSPORT_CONTEXT_H
+#define M_SEN_TRANSPORT_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include "msencontext.h"
+
+/**
+* This class defines abstract interface for transport plug-in context, 
+* which is visible to CSenTransport ECOM plug-in implementations.
+*/
+
+// FORWARD DECLARATIONS
+class MSenRemoteServiceSession;
+class MSenCoreServiceManager;
+class CSenWSDescription;
+class CSenServiceSession;
+
+
+// CLASS DECLARATION
+class MSenTransportContext : public MSenContext
+    {
+    public:
+        /**
+        * Adds new MSenCoreServiceManager& type value into context,
+        * typically identified by this key: KSenCtxKeyCoreServiceManager.
+        * @aKey identifies new value
+        * @aValue is the value being added. Ownership is NEVER transferred
+        * to this context.
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        // virtual TInt AddCore(MSenCoreServiceManager& aValue) = 0;
+
+        /*
+        * Method returns MSenCoreServiceManager* type value.
+        * @return reference to Core Service Manager.
+        * LeaveCode:
+        *        KErrNotFound - If Core is not available in this context
+        *        KErrSenTypeMismatch - If KSenCtxKeyCoreServiceManager
+        *        illegally points to other than CSenCoreServiceManager
+        *        instance (not to happen).
+        */
+        virtual MSenCoreServiceManager& GetCoreL() = 0;
+        //virtual MSenCoreServiceManager* GetCore() = 0;
+
+        /*
+        * Adds session description (as CSenWSDescription*) into context,
+        * typically identified by following key: KSenCtxKeyServiceSession
+        * 
+        * @param aValue is the value being added. Ownership is NOT transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        // virtual TInt AddSession(CSenServiceSession* aValue) = 0; // protected context
+
+        /*
+        * Updates new CSenWSDescription* type value into context, typically
+        * identified by following key: KSenCtxKeyServiceSession
+        * If some value for the same key already exists, it is replaced with the new value.
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is NOT transferred to this context.
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        //virtual TInt UpdateSession(CSenServiceSession* aValue) = 0;  // protected context
+
+        /*
+        * Method returns the service session which loaded (created) this transport plug-in instance.
+        * 
+        * @return value behind given key, or NULL, if such is not found.
+        * Ownership cannot be transferred, as it is never to be held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenServiceSession type,
+        * or any of it's subclass's.
+        */
+        virtual const CSenServiceSession* GetSession() = 0;
+        //virtual CSenServiceSession& GetSessionL() = 0;
+
+        // virtual TInt AddInitializer(CSenWSDescription* aValue) = 0; // protected context
+        // virtual TInt UpdateInitializer(CSenWSDescription* aValue) = 0;  // protected context
+
+        /*
+        * Method returns session initializer as CSenWSDescriptionL* type value.
+        * 
+        * @returns value behind given key, or NULL, if not
+        * found.
+        * Ownership is NOT transferred, as it is NEVER to be held by this context.
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenWSDescription*
+        * type, or any of it's subclass's.   
+        */
+        virtual CSenWSDescription& GetInitializerL() = 0;
+
+        //virtual const CSenWSDescription* GetInitializer() = 0;
+
+        /*
+        * Adds new CSenWSDescription* type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        //virtual TInt AddServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue) = 0;
+
+        /*
+        * Updates session description (as CSenWSDescription*) into context,
+        * typically identified by following key: KSenCtxKeyServiceSession
+        * If some value for this key already exists, it is destroyed and replaced
+        * by the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is transferred to this context.
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        //virtual TInt UpdateServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue) = 0;
+
+        /*
+        * Method returns CSenWSDescriptionL* type value.
+        * 
+        * @return value behind given key, or NULL, if not
+        * found.
+        * Ownership is  not transferred, but remains
+        * to be held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not CSenSoapEnvelope* type.   
+        */
+        //virtual const CSenWSDescription* GetServiceDescriptionL(const TDesC8& aKey) = 0;
+
+        /*
+        * Adds new MSenRemoteServiceSession& type value into context, identified by given key.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the value being added. Ownership is transferred
+        * to this context.
+        * 
+        * @return KErrNone on success, 
+        *         KErrAlreadyExists, if the key is reserved,
+        *         or some other system-wide error code.
+        */
+        //virtual TInt Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue) = 0; // protected context
+
+        /*
+        * Updates new MSenRemoteServiceSession& type value into context, identified by given key.
+        * If some value for the same key already exists, it is destroyed and replaced
+        * by the new value.
+        * 
+        * @param aKey identifies new value
+        * @param aValue is the updated value, which may replace
+        *         any existing value, which used same key.
+        *         Ownership is transferred to this context.
+        * 
+        * @return KErrNone on success, 
+        *         or some other system-wide error code.
+        */
+        //virtual TInt Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue) = 0;
+
+        /*
+        * Method returns MSenRemoteServiceSession* type value.
+        * 
+        * @param aKey identifies remote service session
+        * 
+        * @returns value behind given key, or NULL, if not
+        * found.
+        * Ownership is  not transferred, but remains
+        * to be held by this context.   
+        * Method leaves with KErrSenTypeMismatch error code,
+        * if value at this index is not MSenRemoteServiceSession* type.   
+        */
+        //virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey) = 0;
+    };
+
+#endif // M_SEN_SESSION_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/msentransportfactory.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_TRANSPORT_FACTORY_H
+#define M_SEN_TRANSPORT_FACTORY_H
+
+// FORWARD DECLARE
+class MSenConsumerPolicy;
+class CSenTransportBase;
+class CSenWSDescription;
+class CSenServiceSession;
+
+// CLASS DECLARATION
+class MSenTransportFactory
+    {
+    public:
+    
+        /**
+        * CreateL() produces new CSenTransportBase instance from this factory.
+        * The instance itself may or may not be an ECOM plug-in.
+        * @param aInitializer is used to resolve what type of class
+        * the new instance will be (the scheme of the endpoint can also
+        * indicate which ECOM cue should be used when creating a new instance)
+        * Additionally, one can pass some SD subclass, like CSenWSPattern
+        * to this method. Consumer and Provider policies may further be included
+        * within such SD, and the transport related context may be applied from
+        * those policies.
+        * @param apSession is a pointer (which ownership will not be changed)
+        * to the session which request new transport.
+        * @return pointer to new transport instance, a CSenTransportBase*,
+        *         or NULL if no transport could be created using input policy.
+        */
+        virtual CSenTransportBase* CreateL(CSenWSDescription& aInitializer,
+                                           CSenServiceSession* apSession) = 0;
+    };
+
+#endif // M_SEN_TRANSPORT_FACTORY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/saslmechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SASL_MECHANISM_H
+#define SASL_MECHANISM_H
+
+// INCLUDES
+#include <e32base.h>
+
+#include <SenIdentityProvider.h>
+
+#include "senpasswordtransform.h"
+
+#include "msenidentitymanager.h" // internal IdentityManager\inc
+
+// CLASS DECLARATION
+
+class CSaslMechanism : public CBase
+    {
+    public: // Constructors and destructor
+        IMPORT_C static CSaslMechanism* NewL();
+        IMPORT_C static CSaslMechanism* NewLC();
+        IMPORT_C ~CSaslMechanism();
+
+        // New functions
+        IMPORT_C virtual void ClearPasswordL();
+        IMPORT_C virtual HBufC8* Password8L();
+        IMPORT_C virtual void InitFrom( CSaslMechanism aSaslMechanism );
+        IMPORT_C virtual TInt MaxAttempts();
+        IMPORT_C virtual void SetIdentity(
+                              CSenIdentityProvider* aIdentityProvider,
+                              MSenIdentityManager* aIdentityManager);
+
+        IMPORT_C virtual TBool IsPasswordFromUser();
+        IMPORT_C virtual CSenIdentityProvider& Account();
+        IMPORT_C virtual void SetTransforms(
+                                RPointerArray<CSenPasswordTransform> aList);
+
+        IMPORT_C virtual HBufC8* TransformL(TPtrC8 aPassphrase) const;
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSaslMechanism();
+
+    protected: // Data
+        CSenIdentityProvider*   ipAccount;          // NOT owned
+        MSenIdentityManager*    ipIdentityManager;  // NOT owned
+        RPointerArray<CSenPasswordTransform> iTransforms; // owned
+    };
+
+#endif //SASL_MECHANISM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senapplicationcontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Each application that connects WS-stack through client-server
+*                interface has an application context of it's own, which can
+*                hold a list for active connections and service sessions, 
+*                acting as a common place holder and bridge between the
+*                smaller (contexts) that those contain. Class allows 
+*                application-wide information to be shared efficiently
+*                at proper layer.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_APPLICATION_CONTEXT_H
+#define SEN_APPLICATION_CONTEXT_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include "e32cmn.h"
+
+//#include "SenContext.h"
+#include "senpointermap.h"
+
+#include "senclientcontext.h"
+
+// FORWARD DECLARATIONS
+class CSenServerContext;
+//class CSenClientContext;
+
+// TYPE DEFS
+typedef RSenPointerMap<TInt, CSenClientContext> RClientCtxMap; 
+
+// CLASS DECLARATION
+class CSenApplicationContext : public CBase // CSenContext
+    {
+    friend class CSenServerContext;
+        
+    public:
+        // Destructor:
+        IMPORT_C virtual ~CSenApplicationContext();
+        
+        // New methods:
+        
+        virtual CSenServerContext& ServerContext() const;
+        
+        virtual TSecureId SecureId() const;
+        virtual CSenClientContext& OpenClientContextL(TInt aClientId);
+        virtual TInt CloseClientContext(const CSenClientContext& aCtx);
+        
+    protected:
+        IMPORT_C  CSenApplicationContext(TSecureId aSecureId, CSenServerContext& aCtx);
+                                     
+        IMPORT_C void BaseConstructL();
+
+    private: 
+        /**
+        * Standard 2-phased constructor
+        * @return pointer to new context.
+        */ 
+        IMPORT_C static  CSenApplicationContext* NewL(TSecureId aSecureId, CSenServerContext& aCtx);
+        
+        /**
+        * Standard 2-phased constructor 
+        * @return pointer to new context,
+        * which is left on cleanupstack.
+        */ 
+        IMPORT_C static  CSenApplicationContext* NewLC(TSecureId aSecureId, CSenServerContext& aCtx);
+        
+    private: // data
+        TSecureId iSecureId;
+        CSenServerContext& iServerContext; 
+        RClientCtxMap iClients;       
+    };
+
+#endif // SEN_APPLICATION_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senclientcontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Each application that connects WS-stack through client-server
+*                interface has an application context of it's own, which can
+*                hold a list for active connections and service sessions, 
+*                acting as a common place holder and bridge between the
+*                smaller (contexts) that those contain. Class allows 
+*                application-wide information to be shared efficiently
+*                at proper layer.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CLIENT_CONTEXT_H
+#define SEN_CLIENT_CONTEXT_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+//#include "SenContext.h"
+#include "senpointermap.h"
+
+// FORWARD DECLARATIONS
+class CSenSessionContext;
+class CSenApplicationContext;
+class CSenClientSession;
+
+// TYPE DEFS
+typedef RSenPointerMap<TInt, CSenSessionContext> RSessionCtxMap; 
+
+
+// CLASS DECLARATION
+class CSenClientContext : public CBase // CSenContext
+    {
+    friend class CSenApplicationContext;
+    friend class CSenClientSession;
+    public:
+        // Destructor:
+        IMPORT_C virtual ~CSenClientContext();
+        
+        // New methods:
+        virtual TInt ClientId() const;
+        
+    protected:
+        IMPORT_C  CSenClientContext(TInt aClientId, CSenApplicationContext& aCtx);
+                                     
+        IMPORT_C void BaseConstructL();
+
+    private: 
+        /**
+        * Standard 2-phased constructor
+        * @return pointer to new context.
+        */ 
+        IMPORT_C static  CSenClientContext* NewL(TInt aClientId, CSenApplicationContext& aCtx);
+        /**
+        * Standard 2-phased constructor 
+        * @return pointer to new context,
+        * which is left on cleanupstack.
+        */ 
+        IMPORT_C static  CSenClientContext* NewLC(TInt aClientId, CSenApplicationContext& aCtx);
+
+    private: // Data
+        TInt iClientId;
+        CSenApplicationContext& iApplicationContext;
+        RSessionCtxMap iSessions;
+    };
+
+#endif // SEN_CLIENT_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sencontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CONTEXT_H
+#define SEN_CONTEXT_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include "msencontext.h"
+#include "senpointermap.h"
+
+// FORWARD DECLARATIONS
+class CSenContextItem;
+class CSenXmlReader;
+
+
+
+// TYPE DEFS
+typedef RSenPointerMap<TDesC8, CSenContextItem> RCtxItemMap; // pointer map is internal: Utils\inc
+
+// CLASS DECLARATION
+/**
+* This class is ment for INTERNAL use only, never to be
+* published "as it is". The reason for not to inherit from MSenContext
+* is here: this allows one to utilize this base class in *children*
+* of MSenContext, which get ready base for *basic* context implementation
+* and thus only need to write new methods they define in their own
+* interface (if it is all that is needed).
+*/
+class CSenContext : public CBase //, public MSenContext
+    {
+    public:
+        /**
+        * Standard 2-phased constructor
+        * @param aDirection indicate the initial direction of this message context.
+        * For requests, it is "outbound", and for responses or one way notifications
+        * from some (remote) service) it is "inbound".
+        * @param aXmlReader is a reference to XML parser (not owned)
+        * @return pointer to new context
+        */ 
+        IMPORT_C static CSenContext* NewL(SenContext::TContextDirection aDirection);
+        /**
+        * Standard 2-phased constructor
+        * @param aDirection indicate the initial direction of this message context.
+        * For requests, it is "outbound", and for responses or one way notifications
+        * from some (remote) service) it is "inbound".
+        * @return pointer to new context, which is left on cleanup stack.
+        */ 
+        IMPORT_C static CSenContext* NewLC(SenContext::TContextDirection aDirection);
+
+        // Destructor:
+        IMPORT_C virtual ~CSenContext();
+
+        // Defined in MSenContext (must remain equal):
+        virtual SenContext::TContextType Type() const;        
+    	virtual SenContext::TContextDirection Direction() const;
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue);
+        virtual TAny* GetAnyL(const TDesC8& aKey);		//codescannerwarnings
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Remove(const TDesC8& aKey);     	
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset();
+        
+        virtual TInt SetDirection(SenContext::TContextDirection aDirection);
+
+
+
+        protected:
+            IMPORT_C CSenContext(SenContext::TContextDirection aDirection);
+            IMPORT_C void BaseConstructL();
+
+            // Data:
+            RCtxItemMap iItems;                      // owned
+
+        private: 
+            // Data: 
+            SenContext::TContextDirection iDirection; 
+
+    };
+
+#endif // SEN_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sencontextitem.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,736 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CONTEXT_ITEM_H
+#define SEN_CONTEXT_ITEM_H
+
+//  INCLUDES
+#include <ecom/ecom.h>
+#include <e32std.h>   // for RCriticalSection
+
+#include "senwsdescription.h"
+
+#include "msencontextitem.h" // internal Framework\inc
+#include "msencontext.h"
+
+// FORWARD DECLARE
+class MSenCoreServiceManager;
+class MSenRemoteServiceConsumer;
+class MSenRemoteHostlet;
+class MSenWSDescription;
+class CSenWSDescription;
+class CSenIdentityProvider;
+class CSenWSPattern;
+class CSenServiceSession;
+class CSenWebServiceSession;
+class CSenBasicWebServiceSession;
+class CIdWSFServiceSession;
+class CIdWsfServiceInstance;
+class CSenCoreServiceConsumer;
+class CSenSenInternalServiceConsumer;
+class CIdWsfAuthenticationServiceClient;
+class CIdWsfDiscoveryServiceClient;
+class CSenRestServiceSession;
+class CWSStarServiceSession;
+class CWSStarSTSClient;
+
+class CSenChunk;
+class CSenElement;
+class CSenMessageBase;
+class CSenSoapEnvelope2;
+class MSenMessage;
+class CSenSoapEnvelope;
+class CSenAtomEntry;
+class CSenSoapMessage;
+class CSenXmlReader;
+class MSenProperties;
+class CSenXmlProperties;
+class CSenTransportProperties;
+class CSenHttpTransportProperties;
+class CSenVtcpTransportProperties;
+class CSenLayeredXmlProperties;
+class CSenLayeredTransportProperties;
+class CSenLayeredHttpTransportProperties;
+class CSenLayeredVtcpTransportProperties;
+
+using namespace SenContext;
+
+// CLASS DECLARATION
+
+/**
+* Class for wrapping objects so that they can be moved in 
+* and out of context a context using 
+* 
+* Sub-classing actual Service Providers have to implement MSenContextItem
+* interface.
+*
+*/       
+class CSenContextItem : public CBase, public MSenContextItem
+    {
+    public: 
+    
+        // Constructors and destructor
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETAny
+        * @param apValue is the data to be stored
+        * @param aIsOwnedOrNot determines whether the value is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(TAny* apNotOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETAny
+        * @param apOwned is owned 
+        * @param aIsOwnedOrNot determines whether the value is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(TAny* apNotOwned);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETDesC8
+        * @param aRefToValue is copied (alloc)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(const TDesC8& aRefToValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETDesC8
+        * @param aRefToValue is copied (alloc)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(const TDesC8& aRefToValue);
+        
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETDesC8
+        * @param apOwned is owned 
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(TDesC8* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETDesC8
+        * @param apOwned is owned 
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(TDesC8* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETInt
+        * @param apValue is copied (alloc)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(const TInt apValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETInt
+        * @param apValue is copied (alloc)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(const TInt apValue);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETInt
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(TInt* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETInt
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(TInt* apOwned);
+        
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETUint
+        * @param aValue is copied (alloc)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(const TUint aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETUint
+        * @param aValue is copied (alloc)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(const TUint aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETUint
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(TUint* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ETUint
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(TUint* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenCoreServiceManager
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(MSenCoreServiceManager& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenCoreServiceManager
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(MSenCoreServiceManager& aValue);
+
+
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteServiceConsumer
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(MSenRemoteServiceConsumer& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteServiceConsumer
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(MSenRemoteServiceConsumer& aValue);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteHostlet
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(MSenRemoteHostlet& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteHostlet
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(MSenRemoteHostlet& aValue);
+        
+        
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenWSDescription
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenWSDescription& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenWSDescription
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenWSDescription& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenServiceDescription
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenWSDescription* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenServiceDescription
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenWSDescription* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenChunk& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenChunk& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenChunk* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenChunk* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenElement& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenElement& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenElement* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenElement* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenXmlReader& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlReader
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenXmlReader& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlReader
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenXmlReader* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlReader
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenXmlReader* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(MSenProperties& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(MSenProperties& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenXmlProperties* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenXmlProperties* apOwned);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenLayeredXmlProperties* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenLayeredXmlProperties* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenMessage
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(MSenMessage& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::EMSenMessage
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(MSenMessage& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenSoapEnvelope2
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenSoapEnvelope2* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenSoapEnvelope2
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenSoapEnvelope2* apOwned);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::CSenAtomEntry
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenAtomEntry* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::CSenAtomEntry
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenAtomEntry* apOwned);
+        
+        
+        
+        
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenMessageBase
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenMessageBase* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenMessageBase
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenMessageBase* apOwned);
+
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param aValue is referenced (not owned)
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenSoapMessage& aValue);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param aValue is referenced owned (not owned)
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenSoapMessage& aValue);
+
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param apOwned is owned
+        * @return pointer to new context item
+        */
+        IMPORT_C static CSenContextItem* NewL(CSenSoapMessage* apOwned);
+        /**
+        * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
+        * @param apOwned is owned
+        * @return pointer to new context item
+        * which is also left on cleanup stack.
+        */
+        IMPORT_C static CSenContextItem* NewLC(CSenSoapMessage* apOwned);
+
+
+        // From MSenContextItem:
+
+        /*
+        * Method for resolving real C-class type (implemenation class).
+        * Inherited from MSenContextItem.
+        * @return the type of this class (EContextItem)
+        */
+        virtual MSenContextItem::TClass Type() const;            
+
+
+        // New methods:
+
+        /** 
+        * 
+        * Returns the pointer to the data that is wrapped inside this item.
+        * @return pointer to wrapped data, but only if this context item 
+        * was constructed with TAny -argument. In case that this item knows
+        * the data type of the object (!=TAny), method will leave.
+        * Supported data type(s):
+        *       TAny (root) -- TContextItemDataType::ETAny
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual TAny* ToAnyL() const;
+
+        /** 
+        * Returns the 8-bit descriptor that is wrapped inside this item.
+        * @return 8-bit descriptor, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       TDesC8 (root) -- TContextItemDataType::ETDesC8
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual TPtrC8 ToPtrC8L() const;
+
+            
+        /** 
+        * Returns the 8-bit descriptor that is wrapped inside this item.
+        * @return 8-bit descriptor, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       TDesC8 (root) -- TContextItemDataType::ETDesC8
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual const TDesC8* ToDesC8L() const;
+        
+        /** 
+        * Returns the signed integer descriptor that is wrapped inside this item.
+        * @return integer, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       TInt -- TContextItemDataType::ETInt
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual const TInt* ToIntL() const;
+
+        /** 
+        * Returns the unsigned integer descriptor that is wrapped inside this item.
+        * @return integer, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       TUint -- TContextItemDataType::ETUint
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual const TUint* ToUintL() const;
+        
+        /** 
+        * Returns MSenCoreServiceManager that is wrapped inside this item.
+        * @return core, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       MSenCoreServiceManager -- TContextItemDataType::EMSenCoreServiceManager
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual MSenCoreServiceManager& ToSenCoreL() const;
+
+        /** 
+        * Returns MSenRemoteServiceConsumer that is wrapped inside this item.
+        * @return consumer, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       MSenRemoteServiceConsumer -- TContextItemDataType::EMSenRemoteServiceConsumer
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual MSenRemoteServiceConsumer& ToSenRemoteConsumerL() const;
+
+        /** 
+        * Returns MSenRemoteHostlet that is wrapped inside this item.
+        * @return hostlet, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       MSenRemoteHostlet (root) -- TContextItemDataType::EMSenRemoteHostlet
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual MSenRemoteHostlet& ToSenRemoteHostletL() const;
+
+        /** 
+        * Returns CSenWSDescription that is wrapped inside this item.
+        * @return XML service description, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenWSDescription (root) -- TContextItemDataType::EMSenServiceDescription
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenWSDescription& ToSenServiceDescriptionL() const;
+
+        /** 
+        * Returns CSenServiceSession that is wrapped inside this item.
+        * @return session, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenServiceSession -- TContextItemDataType::EMSenServiceDescription
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenServiceSession& ToSenServiceSessionL() const;
+
+        /** 
+        * Returns properties object that is wrapped inside this item.
+        * @return XML properties, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenXmlProperties (root) -- TContextItemDataType::EMSenProperties
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenXmlProperties& ToSenXmlPropertiesL() const;
+
+        /** 
+        * Returns layered properties object that is wrapped inside this item.
+        * @return layered XML properties, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenLayeredXmlProperties (root) -- TContextItemDataType::EMSenProperties
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenLayeredXmlProperties& ToSenLayeredXmlPropertiesL() const;
+
+        /** 
+        * Returns the XML element that is wrapped inside this item.
+        * @return XML element, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenElement (root) -- TContextItemDataType::ECSenElement
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenElement& ToSenElementL() const;
+
+        /** 
+        * Returns the SOAP message that is wrapped inside this item.
+        * @return SOAP message, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenElement (root) -- TContextItemDataType::ECSenSoapEnvelope
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenSoapMessage& ToSenSoapMessageL() const;
+
+        /** 
+        * Returns the message that is wrapped inside this item.
+        * @return message, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenElement (root) -- TContextItemDataType::EMSenMessage
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual MSenMessage& ToSenMessageL() const;
+
+
+        /** 
+        * Returns the chunk that is wrapped inside this item.
+        * @return message, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenElement (root) -- TContextItemDataType::ECSenChunk
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenChunk& ToSenChunkL() const;
+
+        /** 
+        * Returns the XML element that is wrapped inside this item.
+        * @return XML element, but only if this context item was constructed
+        * to hold such data. In case that this item holds some object of different
+        * type instead, the method will leave.
+        * Supported data type(s):
+        *       CSenXmlReader -- TContextItemDataType::ECSenXmlReader
+        * Leave codes:
+        *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
+        */
+        virtual CSenXmlReader& ToSenXmlReaderL() const;
+
+        /**
+        * Function:    ~CSenContextItem
+        *
+        * Description: Destroy the object
+        */
+        IMPORT_C virtual ~CSenContextItem();
+
+    private:
+
+        CSenContextItem(TAny* apData, MSenContextItem::TData aType, TInt* apFlags);
+
+
+    private: // Data
+
+        // This pointer holds the actual data wrapped by this context item:´
+        TAny* ipData;
+        // This member specifies the item class-type:
+        MSenContextItem::TData iType;
+        // This pointer holds information about data; whether it is owned or not, etc.
+        TInt* ipFlags;
+    };
+#endif // SEN_CONTEXT_ITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senhandlerbase.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Abstract class providing CBase 
+*                functionality on top of MSenHandler
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_HANDLER_BASE_H
+#define SEN_HANDLER_BASE_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h> // for CActive
+#include <SenBaseFragment.h>
+#include "msenhandler.h"
+#include "msenhandlercontext.h"
+
+// FORWARD DECLARATIONS
+class MSenHandlerContext;
+
+
+// CLASS DECLARATION
+/**
+* This base class makes it possible to create a "Handler Factory",
+* which may produce instances of different CSenHandlerBase subclasses.
+* [ It even might be useful to be able to create both ECOM and non-ECOM
+*   versions of handlers, if such factory pattern is further utilized.]
+*
+* Mainly, this abstract class exists to offer re-usable basic functionality
+* to its direct subclasses. Functionality includes default handling of
+* MSenHandlerContext properties, and base functions and "services".
+*/
+class CSenHandlerBase : public CSenBaseFragment, public MSenHandler
+    {
+    public:
+        /**
+        * C++ destructor
+        */
+        IMPORT_C virtual ~CSenHandlerBase();
+
+        /**
+        * Handlers must also be capable to represent their structure and state 
+        * (type, direction and phase) in UCS8 XML form. This can be achieved either 
+        * by overriding this method, or by deriving from xml fragment class, like
+        * CSenBaseFragment.
+        * 
+        * @param aWs is the stream where to write UCS8 (UTF-8) XML document into.
+        */
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWs);
+        
+        /**
+        * This method returns an XML document that will include handler types, direction, phase and name.
+        * 
+        * @return UCS8 (UTF-8) XML document representation of this handler.
+        */
+        IMPORT_C virtual HBufC8* AsXmlL();
+
+    protected:
+        /**
+        * C++ constructor
+        */
+        IMPORT_C CSenHandlerBase();
+
+        /**
+        * Default mechanism for processing received handler specific context.
+        * Typically, handlers receive their context as construction phase
+        * argument.
+        * 
+        * @param aCtx The context that contains the configuration description of the handler.
+        */
+        IMPORT_C virtual void ProcessHandlerContextL(MSenHandlerContext& aCtx);
+    };
+
+#endif // SEN_HANDLER_BASE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/seninternalserviceconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_INTERNAL_SERVICE_CONSUMER_H
+#define SEN_INTERNAL_SERVICE_CONSUMER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+
+#include "senserviceinvocationframework.h"
+#include "msenremoteserviceconsumer.h"
+#include "senwsdescription.h"
+#include <SenServiceConnection.h>
+
+// FORWARD DECLARATION
+//class MSenPolicy;
+//class CSenPolicy;
+class CSenServiceSession;
+class CSenIdentifier;
+class MSenProperties;
+
+// CLASS DECLARATION
+
+/**
+* Base class for internal consumers of various SIF implementations,
+* offers for example a unique id implementation..
+*/
+class CSenInternalServiceConsumer : public CSenWSDescription,
+                                    public MSenRemoteServiceConsumer
+    {
+    public: // Constructors and destructor
+        IMPORT_C virtual ~CSenInternalServiceConsumer();
+
+        // New functions
+    
+        virtual CSenServiceSession* ServiceSession() = 0; 
+        IMPORT_C virtual TBool IsReadyL();
+        IMPORT_C RFileLogger* Log() const;  
+        
+        // Functions from base classes
+    
+        // From MSenRemoteServiceConsumer
+        IMPORT_C virtual const TDesC8& Id() const;
+        IMPORT_C virtual TInt SetSessionL(MSenRemoteServiceSession& aServiceSession);
+
+        IMPORT_C virtual TInt HandleMessageL(HBufC8* aMessage,
+                                             const TInt aTxnId,
+                                             MSenProperties* aResponseTransportProperties);
+
+        IMPORT_C virtual TInt HandleErrorL(HBufC8* aError,
+                                           const TInt aErrorCode,
+                                           const TInt aTxnId,
+                                           MSenProperties* aResponseTransportProperties);
+
+        IMPORT_C virtual void SetStatusL(const TInt aStatus);
+
+        IMPORT_C CSenIdentifier& CSenInternalServiceConsumer::Identifier() const;
+
+        IMPORT_C TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
+
+        IMPORT_C virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress);    
+        /**
+        * @see CSenWSDescription
+        */
+        IMPORT_C virtual TBool HasSuperClass( TDescriptionClassType aType );
+		IMPORT_C virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; 		
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenInternalServiceConsumer(TDescriptionClassType aType,
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */                                   CSIF& aSIF);
+        IMPORT_C void ConstructL();
+
+        /**
+        * getter for children
+        */
+        IMPORT_C CSIF& Framework();
+
+    private: // Data
+        CSIF& iSIF; // Not owned
+        // Owned. Typically an empty policy.
+        //CSenPolicy* iPolicy; // is deprecated, not in use
+        HBufC8* ipConsumerId;
+        CSenIdentifier* ipIdentifier;
+        TSenDataTrafficDetails iDetails;
+    };
+
+#endif // SEN_INTERNAL_SERVICE_CONSUMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senlayeredhttptransportproperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_LAYERED_HTTP_TRANSPORT_PROPERTIES_H
+#define SEN_LAYERED_HTTP_TRANSPORT_PROPERTIES_H
+
+#include "senlayeredtransportproperties.h"
+
+class CSenLayeredHttpTransportProperties : public CSenLayeredTransportProperties
+    {
+    public:
+        enum TSenHttpMethod
+        	{
+        	ESenHttpPut,
+        	ESenHttpDelete,
+        	ESenHttpGet,
+            ESenHttpPost        	
+            };
+            
+        enum TSenHttpVersion
+        	{
+        	ESenHttp10,
+        	ESenHttp11
+            };
+            
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewL();
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewLC();
+
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser);
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser);
+
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewL(const CSenElement& aElement);
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewLC(const CSenElement& aElement);
+                
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewL(RStringPool& aStringPool);
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewLC(RStringPool& aStringPool);
+
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool);
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool);
+
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewL(const CSenElement& aElement, RStringPool& aStringPool);
+        IMPORT_C static CSenLayeredHttpTransportProperties* NewLC(const CSenElement& aElement, RStringPool& aStringPool);
+                
+        // From MSenProperties
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual TSenPropertiesClassType PropertiesClassType();
+        virtual void WriteToL(RWriteStream& aWriteStream);
+        virtual void ReadFromL(const TDesC8& aBuffer);
+        virtual HBufC8* AsUtf8L();
+        virtual HBufC8* AsUtf8LC();
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+
+        // From MSenLayeredProperties 
+        virtual void WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer);
+        virtual void ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer);
+        virtual HBufC8* AsUtf8L(TSenPropertiesLayer aLayer);
+        virtual HBufC8* AsUtf8LC(TSenPropertiesLayer aLayer);
+        virtual TInt ShrinkTo(TSenPropertiesLayer aLayer);
+        virtual void ExpandToL(TSenPropertiesLayer aLayer);
+        virtual TSenPropertiesLayer TopLayer();
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, TSenPropertiesLayer aLayer);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TSenPropertiesLayer aLayer);
+        virtual TInt PropertyL(const TDesC8& aName, MSenProperty*& aValue, TSenPropertiesLayer aLayer);
+        virtual TInt PropertyL(const TDesC8& aName, MSenProperty*& aValue);                               
+        virtual TInt PropertiesByTypeL(const TDesC8& aTypeName, RPointerArray<MSenProperty>& aArray);
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue, TSenPropertiesLayer aLayer);
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue, TSenPropertiesLayer aLayer);
+        virtual MSenProperties* CloneL() const;
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue, TSenPropertiesLayer aLayer);
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue, TSenPropertiesLayer aLayer);     
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);   
+        
+  
+        
+        // New Functions       
+        /**
+        * Gets the IAP ID.
+        * @param aCurrentIapId  A TUint32 reference to be filled in with the
+        *                       value of the IAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        virtual TInt IapIdL(TUint32& aCurrentIapId);
+
+        /**
+        * Gets the Proxy Port.
+        * @param aProxyPort  A TInt reference to be filled in with the
+        *                    value of the Proxy Port.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyPortL(TInt& aProxyPort);
+
+        /**
+        * Gets the Proxy Host.
+        * @param aProxyHost  A TPtrC8 reference to be filled in with the
+        *                    value of the Proxy Host.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyHostL(TPtrC8& aProxyHost);
+
+        /**
+        * Gets the Proxy Usage.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the Proxy Usage.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyUsageL(TBool& aProxyUsage);
+
+        /**
+        * Gets the IAP Dialog.
+        * @param aIAPDialog A TBool reference to be filled in with the
+        *                   value of the IAPDialog.
+        * @return           KErrNone if no error, or some of the system
+        *                   wide error codes.
+        */
+        virtual TInt IAPDialogL(TBool& aIAPDialog);
+
+        /**
+        * Gets the Content Type.
+        * @param aContentType A TPtrC8 reference to be filled in with the
+        *                     value of the Content Type.
+        * @return             KErrNone if no error, or some of the system
+        *                     wide error codes.
+        */
+        virtual TInt ContentTypeL(TPtrC8& aContentType);
+        
+        /**
+        * Gets the SoapAction.
+        * @param aSoapAction A TPtrC8 reference to be filled in with the
+        *                    value of the SoapAction.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SoapActionL(TPtrC8& aSoapAction);
+        
+        /**
+        * Gets the UserAgent.
+        * @param aUserAgent  A TPtrC8 reference to be filled in with the
+        *                    value of the UserAgent.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt UserAgentL(TPtrC8& aUserAgent);
+        
+        /**
+        * Gets the Accept.
+        * @param aAccept     A MSenProperty reference to be filled in with the
+        *                    value of the Accept.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt AcceptL(MSenProperty*& aAccept);
+        
+        /**
+        * Gets the Http method.
+        * @param aHttpMethod A TSenHttpMethod reference to be filled in with
+        *                    the value of the Http method.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt HttpMethodL(TSenHttpMethod& aHttpMethod);
+        
+        /**
+        * Gets the Http version.
+        * @param aHttpVersion A TSenHttpVersion reference to be filled in with
+        *                     the value of the Http version.
+        * @return             KErrNone if no error, or some of the system
+        *                     wide error codes.
+        */
+        virtual TInt HttpVersionL(TSenHttpVersion& aHttpVersion);
+        
+        /**
+        * Gets the Http version.
+        * @param aHttpVersion A TSenHttpVersion reference to be filled in with
+        *                     the value of the Http version.
+        * @return             KErrNone if no error, or some of the system
+        *                     wide error codes.
+        */
+        virtual TInt HttpHeadersL(RPointerArray<MSenProperty>& aArray);
+        /**
+        * Gets the Device ID.
+        * @param aDeviceID   A TPtrC8 reference to be filled in with the
+        *                    value of the DeviceId.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DeviceIDL(TPtrC8& aDeviceID);
+
+        /**
+        * Gets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
+        *                    value of the shared, public folder for downloaded 
+        *                    content
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+
+        virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
+
+        /**
+        * Gets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
+
+        /**
+        * Gets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenLayeredHttpTransportProperties();
+
+    protected: // base class functions
+
+
+        virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aQualifiedName, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        virtual void BaseConstructL(const CSenElement& aElement,
+                                    RStringPool* aStringPool = NULL);
+
+	public:
+        /**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+		virtual  TInt SnapIdL(TUint32& aCurrentSnapId) ;
+
+		/**
+        * Gets the SNAP Dialog.
+        * @param aSNAPDialog A TBool reference to be filled in with the
+        *                   value of the IAPDialog.
+        * @return           KErrNone if no error, or some of the system
+        *                   wide error codes.
+        */
+        virtual TInt SnapDialogL(TBool& aSnapDialog);		
+    protected:
+        /**
+        * Constructor.
+        */
+        CSenLayeredHttpTransportProperties();
+    };
+
+#endif // SEN_LAYERED_HTTP_TRANSPORT_PROPERTIES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senlayeredtransportproperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_LAYERED_TRANSPORT_PROPERTIES_H
+#define SEN_LAYERED_TRANSPORT_PROPERTIES_H
+
+#include "senlayeredxmlproperties.h"
+
+class CSenLayeredTransportProperties : public CSenLayeredXmlProperties
+    {
+    public:
+    public:
+        IMPORT_C static CSenLayeredTransportProperties* NewL();
+        IMPORT_C static CSenLayeredTransportProperties* NewLC();
+
+        IMPORT_C static CSenLayeredTransportProperties* NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser);
+        IMPORT_C static CSenLayeredTransportProperties* NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser);
+
+        IMPORT_C static CSenLayeredTransportProperties* NewL(const CSenElement& aElement);
+        IMPORT_C static CSenLayeredTransportProperties* NewLC(const CSenElement& aElement);
+
+        IMPORT_C static CSenLayeredTransportProperties* NewL(RStringPool& aStringPool);
+        IMPORT_C static CSenLayeredTransportProperties* NewLC(RStringPool& aStringPool);
+
+        IMPORT_C static CSenLayeredTransportProperties* NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool);
+        IMPORT_C static CSenLayeredTransportProperties* NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool);
+
+        IMPORT_C static CSenLayeredTransportProperties* NewL(const CSenElement& aElement, RStringPool& aStringPool);
+        IMPORT_C static CSenLayeredTransportProperties* NewLC(const CSenElement& aElement, RStringPool& aStringPool);
+
+        // From MSenProperties 
+        IMPORT_C virtual void SetReader(CSenXmlReader& aReader);
+        IMPORT_C virtual TSenPropertiesClassType PropertiesClassType();
+        IMPORT_C virtual void WriteToL(RWriteStream& aWriteStream);
+        IMPORT_C virtual void ReadFromL(const TDesC8& aBuffer);
+        IMPORT_C virtual HBufC8* AsUtf8L();
+        IMPORT_C virtual HBufC8* AsUtf8LC();
+        IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+        IMPORT_C virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
+        IMPORT_C virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
+        IMPORT_C virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);
+        IMPORT_C virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);        
+        IMPORT_C virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+        
+        // From MSenLayeredProperties 
+        IMPORT_C virtual void WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual void ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual HBufC8* AsUtf8L(TSenPropertiesLayer aLayer);
+        IMPORT_C virtual HBufC8* AsUtf8LC(TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt ShrinkTo(TSenPropertiesLayer aLayer);
+        IMPORT_C virtual void ExpandToL(TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TSenPropertiesLayer TopLayer();
+        IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, MSenProperty*& aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, MSenProperty*& aValue);                               
+        IMPORT_C virtual TInt PropertiesByTypeL(const TDesC8& aTypeName, RPointerArray<MSenProperty>& aArray);                                        
+        IMPORT_C virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual MSenProperties* CloneL() const;
+        IMPORT_C virtual MSenProperties* Clone(TInt& aOkOrError) const;
+        IMPORT_C virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue, TSenPropertiesLayer aLayer);
+        IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);  
+        
+        //common transport properties
+         // New Functions       
+        /**
+        * Gets the IAP ID.
+        * @param aCurrentIapId  A TUint32 reference to be filled in with the
+        *                       value of the IAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt IapIdL(TUint32& aCurrentIapId);
+
+        /**
+        * Gets the Proxy Port.
+        * @param aProxyPort  A TInt reference to be filled in with the
+        *                    value of the Proxy Port.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt ProxyPortL(TInt& aProxyPort);
+
+        /**
+        * Gets the Proxy Host.
+        * @param aProxyHost  A TPtrC8 reference to be filled in with the
+        *                    value of the Proxy Host.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt ProxyHostL(TPtrC8& aProxyHost);
+
+        /**
+        * Gets the Proxy Usage.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the Proxy Usage.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt ProxyUsageL(TBool& aProxyUsage);
+
+        /**
+        * Gets the IAP Dialog.
+        * @param aIAPDialog A TBool reference to be filled in with the
+        *                   value of the IAPDialog.
+        * @return           KErrNone if no error, or some of the system
+        *                   wide error codes.
+        */
+        IMPORT_C virtual TInt IAPDialogL(TBool& aIAPDialog);
+
+        /**
+        * Gets the UserAgent.
+        * @param aUserAgent  A TPtrC8 reference to be filled in with the
+        *                    value of the UserAgent.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt UserAgentL(TPtrC8& aUserAgent);
+        
+        /**
+        * Gets the Device ID.
+        * @param aDeviceID   A TPtrC8 reference to be filled in with the
+        *                    value of the DeviceId.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt DeviceIDL(TPtrC8& aDeviceID);
+        
+        /**
+        * Gets the Action of message
+        * @param aAction A TPtrC8 reference to be filled in with the
+        *                    value of the Action.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt SoapActionL(TPtrC8& aAction);
+        
+        /**
+        * Gets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
+        *                    value of the shared, public folder for downloaded 
+        *                    content
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
+
+        /**
+        * Gets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
+        
+        /**
+        * Gets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
+        
+        IMPORT_C virtual TInt HeartbeatL(TInt& aHeartbeat);
+
+        IMPORT_C virtual TInt MaxTimeToLiveL(TInt& aMax);
+
+        IMPORT_C virtual TInt MinTimeToLiveL(TInt& aMin);
+		IMPORT_C virtual TInt SetMaxRetryTTLL(TInt aMaxRetryTTL);
+		IMPORT_C virtual TInt MaxRetryTTLL(TInt& aMaxRetryTTL);
+		IMPORT_C virtual TInt SetRetryDeltaTimeoutL(TInt aTimeout);
+		IMPORT_C virtual TInt RetryDeltaTimeoutL(TInt& aTimeout);
+		IMPORT_C virtual TInt SetMinRetryTTLL(TInt aMinRetryTTL);
+		IMPORT_C virtual TInt MinRetryTTLL(TInt& aMinRetryTTL);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenLayeredTransportProperties();
+
+    protected: // base class functions
+
+        IMPORT_C virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        IMPORT_C virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        IMPORT_C virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aQualifiedName, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        IMPORT_C virtual void BaseConstructL(const CSenElement& aElement, RStringPool* aStringPool = NULL);
+
+	public:
+	/**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SnapIdL(TUint32& aCurrentSnapId);		
+
+	/**
+        * Gets the SNAP Dialog.
+        * @param aSNAPDialog A TBool reference to be filled in with the
+        *                   value of the IAPDialog.
+        * @return           KErrNone if no error, or some of the system
+        *                   wide error codes.
+        */
+        IMPORT_C virtual TInt SnapDialogL(TBool& aSNAPDialog);		
+    protected:
+        /**
+        * Constructor.
+        */
+        IMPORT_C CSenLayeredTransportProperties();
+    };
+
+#endif // SEN_LAYERED_TRANSPORT_PROPERTIES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senlayeredvtcptransportproperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,215 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_LAYERED_VTCP_TRANSPORT_PROPERTIES_H
+#define SEN_LAYERED_VTCP_TRANSPORT_PROPERTIES_H
+
+#include "senlayeredtransportproperties.h"
+
+class CSenLayeredVtcpTransportProperties : public CSenLayeredTransportProperties
+    {
+    public:
+        IMPORT_C static CSenLayeredVtcpTransportProperties* NewL();
+        IMPORT_C static CSenLayeredVtcpTransportProperties* NewLC();
+        IMPORT_C static CSenLayeredVtcpTransportProperties* NewL(const CSenElement& aElement);
+        IMPORT_C static CSenLayeredVtcpTransportProperties* NewLC(const CSenElement& aElement);        
+
+        // From MSenProperties
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual TSenPropertiesClassType PropertiesClassType();
+        virtual void WriteToL(RWriteStream& aWriteStream);
+        virtual void ReadFromL(const TDesC8& aBuffer);
+        virtual HBufC8* AsUtf8L();
+        virtual HBufC8* AsUtf8LC();
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+
+        // From MSenLayeredProperties 
+        virtual void WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer);
+        virtual void ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer);
+        virtual HBufC8* AsUtf8L(TSenPropertiesLayer aLayer);
+        virtual HBufC8* AsUtf8LC(TSenPropertiesLayer aLayer);
+        virtual TInt ShrinkTo(TSenPropertiesLayer aLayer);
+        virtual void ExpandToL(TSenPropertiesLayer aLayer);
+        virtual TSenPropertiesLayer TopLayer();
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, TSenPropertiesLayer aLayer);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TSenPropertiesLayer aLayer);
+        virtual TInt PropertyL(const TDesC8& aName, MSenProperty*& aValue, TSenPropertiesLayer aLayer);
+        virtual TInt PropertyL(const TDesC8& aName, MSenProperty*& aValue);                               
+        virtual TInt PropertiesByTypeL(const TDesC8& aTypeName, RPointerArray<MSenProperty>& aArray);
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue, TSenPropertiesLayer aLayer);
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue, TSenPropertiesLayer aLayer);
+        virtual MSenProperties* CloneL() const;
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue, TSenPropertiesLayer aLayer);
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue, TSenPropertiesLayer aLayer);     
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);   
+  
+        
+        // New Functions       
+        /**
+        * Gets the IAP ID.
+        * @param aCurrentIapId  A TUint32 reference to be filled in with the
+        *                       value of the IAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        virtual TInt IapIdL(TUint32& aCurrentIapId);
+
+        /**
+        * Gets the Proxy Port.
+        * @param aProxyPort  A TInt reference to be filled in with the
+        *                    value of the Proxy Port.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyPortL(TInt& aProxyPort);
+
+        /**
+        * Gets the Proxy Host.
+        * @param aProxyHost  A TPtrC8 reference to be filled in with the
+        *                    value of the Proxy Host.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyHostL(TPtrC8& aProxyHost);
+        /**
+        * Gets the Proxy Usage.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the Proxy Usage.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyUsageL(TBool& aProxyUsage);
+        /**
+        * Gets the UserAgent.
+        * @param aUserAgent  A TPtrC8 reference to be filled in with the
+        *                    value of the UserAgent.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt UserAgentL(TPtrC8& aUserAgent);
+        
+        /**
+        * Gets the Device ID.
+        * @param aDeviceID   A TPtrC8 reference to be filled in with the
+        *                    value of the DeviceId.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DeviceIDL(TPtrC8& aDeviceID);
+
+        /**
+        * Gets the Action of message
+        * @param aAction A TPtrC8 reference to be filled in with the
+        *                    value of the Action.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SoapActionL(TPtrC8& aAction);
+
+        /**
+        * Gets the Device LCID.
+        * @param aDeviceLCId   A TPtrC8 reference to be filled in with the
+        *                    value of the DeviceLCID.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DeviceLCIDL(TPtrC8& aDeviceLCID);
+        
+        /**
+        * Gets the connection mode (Bound/Unbound)
+        * @param aConnectionBound A Bool reference to be filled in with the
+        *                    value (true if connection is bound).
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ConnectionBoundL(TBool& aConnectionBound);
+        
+        /**
+        * Gets the connection time out (in minutes)
+        * @param aConnectionBound A TInt reference to be filled in with the
+        *                    value of time out for virtual connection
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ConnectionTimeOutL(TInt& aConnectionTimeOut);
+        
+        /**
+        * Gets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
+        *                    value of the shared, public folder for downloaded 
+        *                    content
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
+       
+        /**
+        * Gets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
+
+        /**
+        * Gets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
+
+       /**
+        * Destructor.
+        */
+        virtual ~CSenLayeredVtcpTransportProperties();
+
+		/**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        virtual TInt SnapIdL(TUint32& aCurrentSnapId);	
+
+    protected:
+        /**
+        * Constructor.
+        */
+        CSenLayeredVtcpTransportProperties();
+    };
+
+#endif // SEN_LAYERED_VTCP_TRANSPORT_PROPERTIES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senlayeredxmlproperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_LAYERED_XML_PROPERTIES_H
+#define SEN_LAYERED_XML_PROPERTIES_H
+
+#include <e32std.h>
+#include <SenDomFragment.h>
+
+#include "msenlayeredproperties.h"
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class CSenXmlReader;
+class CSenPropertiesFragment;
+
+_LIT8(KSenLayeredXmlPropertiesLocalname,      "Properties");
+
+class CSenLayeredXmlProperties : public CBase, public MSenLayeredProperties
+    {
+    public:
+
+        static CSenLayeredXmlProperties* NewL();
+        static CSenLayeredXmlProperties* NewLC();
+
+        static CSenLayeredXmlProperties* NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser);
+        static CSenLayeredXmlProperties* NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser);
+
+        static CSenLayeredXmlProperties* NewL(const CSenElement& aElement);
+        static CSenLayeredXmlProperties* NewLC(const CSenElement& aElement);
+
+        static CSenLayeredXmlProperties* NewL(RStringPool& aStringPool);
+        static CSenLayeredXmlProperties* NewLC(RStringPool& aStringPool);
+
+        static CSenLayeredXmlProperties* NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool);
+        static CSenLayeredXmlProperties* NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool);
+
+        static CSenLayeredXmlProperties* NewL(const CSenElement& aElement, RStringPool& aStringPool);
+        static CSenLayeredXmlProperties* NewLC(const CSenElement& aElement, RStringPool& aStringPool);
+
+        // From MSenProperties
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual TSenPropertiesClassType PropertiesClassType();
+        virtual void WriteToL(RWriteStream& aWriteStream);
+        virtual void ReadFromL(const TDesC8& aBuffer);
+        virtual HBufC8* AsUtf8L();
+        virtual HBufC8* AsUtf8LC();
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName,
+                                  const TDesC8& aValue);
+                                  
+        virtual TInt PropertyL(const TDesC8& aName, 
+                               TPtrC8& aValue);
+               
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetIntPropertyL(const TDesC8& aName,
+                                     const TInt aValue);
+                                     
+        virtual TInt IntPropertyL(const TDesC8& aName,
+                                  TInt& aValue);
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetBoolPropertyL(const TDesC8& aName,
+                                      const TBool aValue);
+        virtual TInt BoolPropertyL(const TDesC8& aName,
+                                   TBool& aValue);
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue);
+        virtual TInt RemovePropertyL(const TDesC8& aName);
+                                   
+        // From MSenLayeredProperties 
+        virtual void WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer);
+        virtual void ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer);
+        virtual HBufC8* AsUtf8L(TSenPropertiesLayer aLayer);
+        virtual HBufC8* AsUtf8LC(TSenPropertiesLayer aLayer);        
+        virtual TInt ShrinkTo(TSenPropertiesLayer aLayer);
+        virtual void ExpandToL(TSenPropertiesLayer aLayer);
+        virtual TSenPropertiesLayer TopLayer();
+
+        /**
+        * @see MSenLayeredProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName, 
+                                  const TDesC8& aValue,
+                                  TSenPropertiesLayer aLayer);
+                                  
+        virtual TInt PropertyL(const TDesC8& aName, 
+                               TPtrC8& aValue,
+                               TSenPropertiesLayer aLayer);
+                               
+        virtual TInt PropertyL(const TDesC8& aName,
+                               MSenProperty*& aValue,
+                               TSenPropertiesLayer aLayer);
+        
+        virtual TInt PropertyL(const TDesC8& aName,
+                               MSenProperty*& aValue);      
+                               
+        /**
+        * Sets new property with certain type. 
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of 
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used to
+        *                      refer the given value.
+        * @param aValue        Is the value of this property.
+        * @param aType         Is the type of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName, 
+                                  const TDesC8& aValue,
+                                  const TDesC8& aType);
+
+        /**
+        * Gets the value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TPtrC8 reference to be filled in with the value of
+        *                 the property.
+        * @param aType    A TPtrC8 reference to be filled in with the type of
+        *                 the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.     
+        */
+        virtual TInt PropertyL(const TDesC8& aName, 
+                               TPtrC8& aValue,
+                               TPtrC8& aType);                                                        
+
+        virtual TInt PropertiesByTypeL(const TDesC8& aTypeName,
+                                       RPointerArray<MSenProperty>& aArray);
+                               
+        /**
+        * @see MSenLayeredProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue,
+                                     TSenPropertiesLayer aLayer);
+                                     
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue,
+                                  TSenPropertiesLayer aLayer);
+                                  
+        virtual MSenProperties* CloneL() const;
+        
+        virtual MSenProperties* Clone(TInt& aOkOrError) const;
+        
+        /**
+        * @see MSenLayeredProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue,
+                                      TSenPropertiesLayer aLayer);
+                                      
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue,
+                                   TSenPropertiesLayer aLayer);        
+                                   
+        /**
+        * @see MSenLayeredProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue,
+                                 TSenPropertiesLayer aLayer);
+
+        virtual TInt RemovePropertyL(const TDesC8& aName,
+                                     TSenPropertiesLayer aLayer);
+                                     
+        /**
+        * Destructor.
+        */
+        virtual ~CSenLayeredXmlProperties();
+
+    protected: // base class functions
+
+        virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aQualifiedName, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL,
+                                    RStringPool* aStringPool = NULL);
+
+        virtual void BaseConstructL(const CSenElement& aElement,
+                                    RStringPool* aStringPool = NULL);
+
+        virtual TInt AllPropertiesByTypeL(const TDesC8& aTypeName,
+                                          RPointerArray<MSenProperty>& aArray);
+
+    protected:
+        /**
+        * Constructor.
+        */
+        CSenLayeredXmlProperties();
+        
+    private:
+        void CreateChildPropertiesL(); //codescannerwarnings
+        void ElementsL(RPointerArray<CSenElement>& aProps) const;
+        
+    protected:
+        CSenPropertiesFragment*     ipFragment;
+        CSenLayeredXmlProperties*   ipChildProperties;
+        
+    private:
+        TSenPropertiesLayer         iLayer;
+        CSenXmlReader*              ipReader;
+        CSenLayeredXmlProperties*   ipParentProperties;
+    };
+
+#endif // SEN_LAYERED_XML_PROPERTIES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senmessagecontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Note that this class is ment for WS internal components,
+*                and not ment to act as part of public API
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_MESSAGE_CONTEXT_H
+#define SEN_MESSAGE_CONTEXT_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include "sencontext.h"
+#include "senpointermap.h"
+#include "msenmessagecontext.h"
+
+// FORWARD DECLARATIONS
+class CSenContextItem;
+class MSenProperties;
+class CSenXmlReader;
+class MSenRemoteServiceConsumer;
+class CSenChunk;
+
+
+// CLASS DECLARATION
+class CSenMessageContext : public  CSenContext, public MSenMessageContext
+    {
+    public:
+        /**
+        * Standard 2-phased constructor
+        * @param aDirection indicate the initial direction of this message context.
+        * For requests, it is "outbound", and for responses or one way notifications
+        * from some (remote) service) it is "inbound".
+        * @param apOwnedTp - pointer to (transport) properties, which ownership is taken.
+        * These properties are typically a clone to the propeties currently owned
+        * by transport plug-in (ECOM) instance. Cloning allows independency upon
+        * changes that last during the life-time of a message transaction only.
+        * Note that if apOwnedTp is NULL, this constructor will leave with KErrArgument.
+        * @return pointer to new message context
+        */ 
+        IMPORT_C static  CSenMessageContext* NewL(SenContext::TContextDirection aDirection, 
+                                                  MSenProperties* apOwnedTp);
+        /**
+        * Standard 2-phased constructor
+        * @param aDirection indicate the initial direction of this message context.
+        * For requests, it is "outbound", and for responses or one way notifications
+        * from some (remote) service) it is "inbound".
+        * @param apOwnedTp - pointer to transport properties, which ownership is taken.
+        * These properties are typically a clone to the propeties currently owned
+        * by transport plug-in (ECOM) instance. Cloning allows independency upon
+        * changes that last during the life-time of a message transaction only.
+        * Note that if apOwnedTp is NULL, this constructor will leave with KErrArgument.
+        */ 
+        IMPORT_C static  CSenMessageContext* NewLC(SenContext::TContextDirection aDirection,
+                                                   MSenProperties* apOwnedTp);
+
+        // Destructor:
+        IMPORT_C virtual ~CSenMessageContext();
+        
+        // New methods:
+        
+        // From MSenMessageContext:
+        virtual MSenMessage* MessageL();	//codescannerwarnigs
+        virtual TInt SetMessage(MSenMessage* apMessage, TBool aOwned = ETrue);
+        
+        virtual CSenChunk* ChunkL();	//codescannerwarnings
+        virtual TInt SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned = ETrue);        
+
+        virtual TInt SetProperties(MSenProperties* apProperties, TBool aOwned = ETrue);
+        virtual MSenProperties* Properties();
+        
+        virtual TInt Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual TInt Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
+        MSenMessage* GetMessageL(const TDesC8& aKey);	//codescannerwarnings
+       
+        
+        // --> deprecated, remove from MSenMessageContext: <--
+        virtual CSenSoapMessage* GetCurrentSoapMessage();
+        virtual TPtrC8 GetMessageL();
+        
+        virtual TInt Add(const TDesC8& aKey, CSenSoapEnvelope* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenSoapEnvelope* aValue);
+        virtual const CSenSoapEnvelope* GetSenSoapEnvelopeL(const TDesC8& aKey);
+        
+
+
+        // From MSenContext:
+        virtual SenContext::TContextType Type() const;        
+    	virtual SenContext::TContextDirection Direction() const;
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue);
+        virtual TAny* GetAnyL(const TDesC8& aKey);  //codescannerwarnings
+        virtual TInt Remove(const TDesC8& aKey);     	
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset();
+        virtual const CSenXmlReader* GetParser();
+
+        virtual TInt SetDirection( SenContext::TContextDirection aDirection );
+        
+    protected:
+        IMPORT_C  CSenMessageContext(SenContext::TContextDirection aDirection,
+                                     MSenProperties* apOwnedTp);
+                                     
+        IMPORT_C void BaseConstructL();
+
+    private: 
+        // Helper method(s):
+        CSenContextItem* MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError);
+        
+        // Data: 
+        MSenProperties* ipOwnedTp; // owned; delallocated via IsSafeToCast()
+    };
+
+#endif // SEN_MESSAGE_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senmessagehandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECOM interface for Handler plug-in implementation
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_MESSAGE_HANDLER_H
+#define SEN_MESSAGE_HANDLER_H
+
+// INCLUDES
+#include <ecom/ecom.h>
+
+#include "senhandlerbase.h"     // internal Framework\inc
+#include "msenhandlercontext.h" // internal Framework\inc
+#include "msenmessagecontext.h" // internal Framework\inc
+
+// CLASS DECLARATION
+
+/**
+* Custom ECOM interface definition. This interface is used by
+* clients to find specific handler plugins which implement 
+* pure virtual functions defined in MSenTranport interface.
+*/
+class CSenMessageHandler : public CSenHandlerBase
+    {
+    public:
+        
+        // Constructors and destructor:
+
+        /**
+        * Wraps ECom object instantiation, which returns the
+        * default ECOM implementation for this interface.
+        * Note: This is not a "normal" NewL method, since 
+        * normally NewL methods are only defined for concrete
+        * classes. Note that the implementations of this interface
+        * also provide NewL methods.
+        *
+        * Additionally, this static constructor performs InitL()
+        * using the provided handler context for the newly allocated
+        * handler instance.
+        * 
+        * @param aCtx is handle to the handler specific context
+        */
+        static CSenMessageHandler* NewL(MSenHandlerContext& aCtx);
+
+        /**
+        * Wraps ECom object instantiation, which returns the
+        * interface implementation matching to given aCue,
+        * IMPLEMENTATION_INFO::default_data.
+        * For details, see EcomSIFDefinition.inl comments.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface 
+        * also provide NewL methods. 
+        *
+        * Additionally, this static constructor performs InitL()
+        * using the provided handler context for the newly allocated
+        * handler instance.
+        *
+        * @param aCue is the "name" of the requested implementation.
+        *             Implementations advertise their cue as specified
+        *             in their resource file field
+        * @param aCtx is handle to the handler specific context
+        */
+        static CSenMessageHandler* NewL(const TDesC8& aCue,
+                                        MSenHandlerContext& aCtx);
+        /**
+        * Destructor.
+        */
+        virtual ~CSenMessageHandler();
+
+        // From MSenHandler:
+        /**
+        * Method is used to resolve concrete type (class)
+        * for this handler instance.
+        * 
+        * @return the class type of this handler
+        */
+        inline SenHandler::THandlerType Type() const;        
+
+        /**
+        * Method is used to resolve real, system-wide
+        * unique name for this handler. By default, this
+        * typically returns the ECOM cue (default_data)
+        * of the concrete plug-in instance.
+        * 
+        * @return the unique name of this handler
+        */
+        inline TPtrC8 Name() const;        
+        
+
+        // New functions:
+        
+        /**
+        * InvokeL is the most emergent method in message handler interface.
+        * Each sub-class must implement this method thus providing message
+        * processing routine.
+        * 
+        * @param aCtx is the message context that will be accessed and 
+        * typically altered by implemented handler, in order to provide
+        * modifications on the layer in message construction, validation,
+        * or some other focused area that the handler was intended to take
+        * responsibility for. For example, certain handler might add
+        * some new (SOAP) headers into the message through this context.
+        * @return KErrNone or some WSF specific, or system-wide error code
+        */
+        virtual TInt InvokeL(MSenMessageContext& aCtx) = 0;
+        
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenMessageHandler(MSenHandlerContext& aCtx);
+
+    protected: // Data
+        MSenHandlerContext& iHandlerContext;    
+
+    private: // Data
+        /** 
+        * Instance identifier key. When instance of an implementation is created 
+        * by ECOM framework, the framework will assign UID for it. 
+        * The UID is used in destructor to notify framework that this instance is
+        * being destroyed and resources can be released.
+        */
+        TUid iDtor_ID_Key;
+        
+        HBufC8* iName;
+    };
+
+// This includes the implementation of the instantiation functions and destructor
+#include "senmessagehandler.inl"
+
+#endif // SEN_MESSAGE_HANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senmessagehandler.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Inlines for the Handler ECOM plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concrete plug-in
+// implementation.
+//
+// Instantiates the default message handler plug-in
+inline CSenMessageHandler* CSenMessageHandler::NewL(MSenHandlerContext& aCtx)
+    {
+    const TUid KSenDefaultMessageHandlerPluginUid = {0x20000397};
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aCtx);
+
+    // Find implementation behind KTestHandlerPluginUid
+    TAny* intf = REComSession::CreateImplementationL(KSenDefaultMessageHandlerPluginUid, 
+                                                     _FOFF (CSenMessageHandler, 
+                                                     iDtor_ID_Key), 
+                                                     constructorParameters);
+
+    if(intf)
+        {
+        _LIT8(KSenDefaultMessageHandlerPluginName, "urn:com.nokia.serene:handlers:message:default");
+        CSenMessageHandler* handler = reinterpret_cast <CSenMessageHandler*> (intf);
+        CleanupStack::PushL(handler);
+        handler->iName = KSenDefaultMessageHandlerPluginName().AllocL();
+        handler->InitL(aCtx);
+        CleanupStack::Pop(); // handler
+        }
+
+    return reinterpret_cast <CSenMessageHandler*> (intf);
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concret plug-in
+// implementation.
+inline CSenMessageHandler* CSenMessageHandler::NewL(const TDesC8& aCue, 
+                                                    MSenHandlerContext& aCtx)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    const TUid KSenMessageHandlerInterfaceUid = {0x20000393};
+#else
+    const TUid KSenMessageHandlerInterfaceUid = {0x10282C5C};
+#endif    
+
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aCue);
+    resolverParams.SetWildcardMatch(EFalse);
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aCtx);
+
+    // Find implementation for our interface.
+    // - KCSenMessageHandlerInterfaceUid is the UID of Handler ECOM interface.
+    // - This call will leave, if the plugin architecture cannot find
+    //   implementation.
+    // - The returned pointer points to one of our interface implementation
+    //   instances.
+    TAny* intf = REComSession::CreateImplementationL(KSenMessageHandlerInterfaceUid,
+                                                     _FOFF (CSenMessageHandler, 
+                                                     iDtor_ID_Key), 
+                                                     constructorParameters, 
+                                                     resolverParams); 
+
+    if(intf)
+        {
+        CSenMessageHandler* handler = reinterpret_cast <CSenMessageHandler*> (intf);
+        CleanupStack::PushL(handler);
+        handler->iName = aCue.AllocL();
+        handler->InitL(aCtx);
+        CleanupStack::Pop(); // handler
+        }
+    return reinterpret_cast<CSenMessageHandler*> (intf);
+    }
+
+
+// Interface's (abstract base class's) destructor
+inline CSenMessageHandler::~CSenMessageHandler()
+    {
+    // Any member data must be released here. 
+    delete iName; 
+
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation(iDtor_ID_Key);
+    }
+
+inline CSenMessageHandler::CSenMessageHandler(MSenHandlerContext& aCtx)
+        :iHandlerContext(aCtx)        
+        {
+        }
+
+inline SenHandler::THandlerType CSenMessageHandler::Type() const
+    {
+    return SenHandler::EMessageHandler;
+    }
+
+inline TPtrC8 CSenMessageHandler::Name() const
+    {
+    if(iName)
+        return *iName;
+    else
+        return KNullDesC8();
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senmtomutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+#ifndef SEN_MTOM_UTILS_H
+#define SEN_MTOM_UTILS_H
+
+#include <e32math.h>
+#include <imcvcodc.h>
+
+#include <SenSoapEnvelope2.h>
+#include <RSenDocument.h>
+
+#include <xmlengserializer.h>
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+#include <xmlengbinarycontainer.h>
+#include <xmlengnodelist.h>
+
+// CONSTANTS
+_LIT(KMtomNoRequestSoapEnvelopePanicText, "NULL MTOM request soap envelope");
+_LIT(KMtomNoBlobsPanicText, "NULL MTOM BLOB part");
+_LIT(KMtomNoContentTypeInBlobHeaderPanicText, "NULL MTOM ContentType in BLOB header");
+_LIT(KMtomNoCidPanicText, "NULL MTOM Cid");
+_LIT(KMtomSoapVersionInvalidPanicText, "MTOM SOAP version unknown");
+_LIT(KMtomBlobContainerTypeInvalidPanicText, "MTOM BLOB container type unknown");
+_LIT(KMtomResponseBodyInvalidPanicText, "MTOM response body doesn't conform XOP rules");
+_LIT(KMtomCidInvalidPanicText, "MTOM Cid doesn't conform XOP rules");
+
+_LIT(KMtomPanicText, "MTOM panic");
+
+const TUint KTenKBytes = 10240;
+
+/** numbers 11 or 12 at the end of constant names mean SOAP versions (1.1 or 1.2) */
+_LIT8(KHeaderRootStart11, "Content-Type: application/xop+xml;charset=UTF-8;type=\"text/xml\"\r\nContent-Transfer-Encoding: 8bit\r\nContent-ID: <");
+_LIT8(KHeaderRootStart12, "Content-Type: application/xop+xml;charset=UTF-8;type=\"application/soap+xml\"\r\nContent-Transfer-Encoding: binary\r\nContent-ID: <");
+_LIT8(KHeaderRootEnd, ">\r\n\r\n");    
+
+_LIT8(KContentTypeName, "contentType");
+_LIT8(KHeaderBinaryDataContentType, "Content-Type: ");
+_LIT8(KHeaderBinaryDataContentID, "\r\nContent-Transfer-Encoding: binary\r\nContent-ID: <");
+_LIT8(KHeaderBinaryDataEnd, ">\r\n\r\n"); 
+
+_LIT8(KNewLine, "\r\n");
+_LIT8(KDush, "--");
+
+/** the common part of file name where will be stored Blobs from Response */
+_LIT(KFileName, "c:\\SenBlobResponses\\SenBlobResponse");
+
+/**
+ * Prepares XOP message with binary data to transmit it through HTTP Channel
+ * and extracts BLOBs from XOP message responsed through HTTP channel 
+ *
+ * @lib
+ * @since S60 v3.2
+ */
+class SenMtomUtils
+	{
+public:
+
+    /**
+     * different cases of panics
+     */
+     enum TMtomPanics
+	    {
+	    EMtomNoRequestSoapEnvelope,
+	    EMtomNoBlobs,
+	    EMtomNoContentTypeInBlobHeader,
+	    EMtomNoCid,
+	    EMtomSoapVersionInvalid,
+	    EMtomBlobContainerTypeInvalid,
+	    EMtomResponseBodyInvalid,
+	    EMtomCidInvalid
+	    };
+
+    /**
+     * ContentType for MTOM consists of 
+     * FiledName = "Content-Type" FiledValue = "Multipart/Related"
+     * ParamName1 = "boundary" 	  ParamValue1 = BoundaryValue
+     * ParamName2 = "type"  	  ParamValue1 = TypeValue
+     * ParamName1 = "start" 	  ParamValue1 = StartValue
+     * ParamName1 = "start-info"  ParamValue1 = StartInfoValue
+     * ParamName1 = "action" 	  ParamValue1 = ActionValue
+     * This structure describes ParamName & ParamValue of ConetentType
+     */ 
+    struct TMtomContentTypeParam
+        {
+        TPtrC8 paramName;
+        TPtrC8 paramValue;
+        };	    
+    
+    /**
+     * This structure describes FieldValue & Params of ContentType
+     */
+    struct TMtomContentType
+        {
+        TPtrC8 fieldValue;
+        RArray<TMtomContentTypeParam> params;
+        };
+
+public:
+
+    /**
+     * Serializes SoapEnvelope message in XOP message
+     * @since S60 v3.2
+     * @param aSoapEnvelope2 The message with multiparts (usual view of Soap message)
+     * @param aXopEnvelope The message serialized from usual view to XOP message
+     */	
+	IMPORT_C static void SerializeEnvelope2L(CSenSoapEnvelope2& aSoapEnvelope2, 
+	                                         RBuf8& aXopEnvelope);
+	
+    /**
+   	 * Generates random content-ID for header of XOP message and for headers of BLOBs 
+     * as randomNumber@homeTime
+   	 * @since S60 v3.2     
+   	 * @param aRootCid Generated content-ID
+   	 */
+ 	IMPORT_C static void GenerateRandomRootCidL(RBuf8& aRootCid);
+ 	
+ 	/**
+	* Generates random boundary for mime header as randomNumber
+	* @since S60 v3.2
+	* @param aBoundary Generated random boundary
+	*/
+ 	IMPORT_C static void GenerateRandomBoundaryL(RBuf8& aBoundary);
+ 	
+ 	/**
+ 	* Generates MimeBoundary to separate mime parts of the message as --randomNumber
+ 	* @since S60 v3.2
+ 	* @param aBoundary random boundary
+ 	* @param aBoundaryStart Generated MIME boundary
+ 	*/
+ 	IMPORT_C static void BoundaryLineStartL(const RBuf8& aBoundary, RBuf8& aBoundaryStart);
+ 	
+ 	/**
+ 	* Generates MimeBoundaryEnd to end multipart message (MTOM) as --randomNumber--
+ 	* @since S60 v3.2
+ 	* @param aBoundary random boundary
+ 	* @param aBoundaryEnd Generated MIME boundary end
+ 	*/
+  	IMPORT_C static void BoundaryLineEndL(const RBuf8& aBoundary, RBuf8& aBoundaryEnd);
+
+    /**
+     * Creates Header for Root of XOP message
+     * The header sould be the next:
+     *
+     * --MIME_boundary
+     * Content-Type: application/xop+xml; 
+     * charset=UTF-8; 
+     * type="text/xml" (for SOAP 1.1) or "application/soap+xml" (for SOAP 1.2)
+     * Content-Transfer-Encoding: 8bit
+     * Content-ID: <randomNumber@homeTime>
+     *
+     * where "Content-ID" is the same as "start" in Header of Outer Package
+     *
+     * @since S60 v3.2
+     * @param aSoapEnvelope2 The message with multiparts (usual view of Soap message)
+     * @param aRootCid The content ID for the header of XOP
+     * @param aHeaderRoot11  Header of root of XOP message
+     */
+    IMPORT_C static void HeaderRootL(CSenSoapEnvelope2& aSoapEnvelope2,
+    							     const RBuf8& aRootCid, RBuf8& aHeaderRoot);
+	
+    /**
+     * Creates Header for Binary Data[aIndex] of XOP message 
+     * The header sould be the next:
+	 *
+     * --MIME_boundary
+	 * Content-Type: image/png
+	 * Content-Transfer-Encoding: binary
+	 * Content-ID: <randomNumber@homeTime>
+	 *
+	 * @since S60 v3.2
+     * @param aIndex Which BLOB from array of TXmlEngDataContainer is processed, starts from 0
+     * @param aBinaryDataList The list of BLOBs
+     * @param aHeaderBinaryData Header of binary data[aIndex]
+     */
+    IMPORT_C static void HeaderBinaryDataL(TUint aIndex, 
+									       RArray<TXmlEngDataContainer>& aBinaryDataList,
+			 						 	   RBuf8& aHeaderBinaryData);
+
+    /**
+     * Extracts a part of BLOB (10KB) from a file
+     * @since S60 v3.2
+     * @param aPart Which part of BLOB should be extracted
+     * @param aIndex Which BLOB from array of TXmlEngDataContainer is processed, starts from 0
+     * @param aBinaryDataList The list of BLOBs
+     * @param aBinaryData Part of BLOB that was extracted from a file
+     */
+    IMPORT_C static void FileDataPartL(TUint aPart, TUint aIndex, 
+								       RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       	       RBuf8& aBinaryData);									 
+
+    /**
+     * Extracts the rest of BLOB (less than 10KB) from a file
+     * @since S60 v3.2
+     * @param aParts How many parts of BLOB has already been extracted from a file
+     * @param aRest How many bytes should be exracted from a file 
+     * @param aIndex Which BLOB from array of TXmlEngDataContainer is processed, starts from 0
+     * @param aBinaryDataList The list of BLOBs
+     * @param aBinaryData The last part of BLOB that was extracted from a file
+     */
+    IMPORT_C static void FileDataRestL(TUint aParts, TUint aRest, TUint aIndex, 
+								       RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       	       RBuf8& aBinaryData);									 
+
+    /**
+     * Extracts CIDs of BLOBs from response MTOM message
+     * @since S60 v3.2
+     * @param aBlobHeader Header of Blob from that should be extracted CID of BLOB
+     * @param aCids Array of CIDs for all BLOBs    
+     */
+    IMPORT_C static void CidL(const RBuf8& aBlobHeader, RArray<RBuf8>& aCids);
+
+    /**
+     * Extracts BLOB from response MTOM message and writes it in a file
+     * @since S60 v3.2
+     * @param aIndex Which BLOB from response is processed, starts from 0
+     * @param aFirst Shows is it First part of BLOB or not
+     * @param aBlob The part of BLOB from response that should be written in fhe file
+     * @param aFileNames Array of File names for the all responsed BLOBs
+     * @return size of file in order to monitor progess
+     */	
+    IMPORT_C static TInt SetFileL(TUint aIndex, TBool aFirst, TDesC8& aBlob, 
+                                  RArray<RBuf8>& aFileNames);
+
+private:													
+		
+    /**
+     * Generates the file name for BLOB of response MTOM message 
+     * and collects it in array of file names for the all BLOBs
+     * @since S60 v3.2
+     * @param aIndex Which BLOB from response is processed, starts from 0
+     * @param aFileNames Array of File names for the all responsed BLOBs
+     */
+     static void FileNameL(TUint aIndex, RArray<RBuf8>& aFileNames);
+	};
+									 
+#endif // SEN_MTOM_UTILS_H
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senmultipartutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,269 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Preparation XOP message for HTTP transmission in case 
+*				 of request	and extracting BLOBs from XOP message responsed 
+*				 through HTTP channel in case of response
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_MultiPart_UTILS_H
+#define SEN_MultiPart_UTILS_H
+
+#include <e32math.h>
+#include <SenSoapEnvelope2.h>
+#include "senatomentry.h"
+#include <RSenDocument.h>
+
+#include <xmlengserializer.h>
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+#include <xmlengbinarycontainer.h>
+#include <xmlengnodelist.h>
+
+// CONSTANTS
+_LIT(KMultiPartNoRequestMessagePanicText, "NULL MultiPart request message");
+_LIT(KMultiPartNoBlobsPanicText, "NULL MultiPart BLOB part");
+_LIT(KMultiPartNoContentTypeInBlobHeaderPanicText, "NULL MultiPart ContentType in BLOB header");
+_LIT(KMultiPartNoCidPanicText, "NULL MultiPart Cid");
+_LIT(KMultiPartSoapVersionInvalidPanicText, "MultiPart SOAP version unknown");
+_LIT(KMultiPartBlobContainerTypeInvalidPanicText, "MultiPart BLOB container type unknown");
+_LIT(KMultiPartResponseBodyInvalidPanicText, "MultiPart response body doesn't conform XOP rules");
+_LIT(KMultiPartCidInvalidPanicText, "MultiPart Cid doesn't conform XOP rules");
+
+_LIT(KMultiPartPanicText, "MultiPart panic");
+
+
+
+/** numbers 11 or 12 at the end of constant names mean SOAP versions (1.1 or 1.2) */
+_LIT8(KMultiPartHeaderRootStart11, "Content-Type: application/xop+xml;charset=UTF-8;type=\"text/xml\"\r\nContent-Transfer-Encoding: 8bit\r\nContent-ID: <");
+_LIT8(KMultiPartHeaderRootStart12, "Content-Type: application/xop+xml;charset=UTF-8;type=\"application/soap+xml\"\r\nContent-Transfer-Encoding: binary\r\nContent-ID: <");
+_LIT8(KMultiPartAtomHeaderRootStart, "Content-Type: application/atom+xml;charset=UTF-8;type=\"text/xml\"\r\nContent-Transfer-Encoding: 8bit\r\nContent-ID: <");
+_LIT8(KMultiPartHeaderRootEnd, ">\r\n\r\n");    
+
+_LIT8(KMultiPartContentTypeName, "contentType");
+_LIT8(KMultiPartDefaultBinaryContentTypeValue, "application/octet-stream)");// video/mp4 or video/x-flv
+_LIT8(KMultiPartHeaderBinaryDataContentType, "Content-Type: ");
+_LIT8(KMultiPartHeaderBinaryDataContentID, "\r\nContent-Transfer-Encoding: binary\r\nContent-ID: <");
+_LIT8(KMultiPartHeaderBinaryDataEnd, ">\r\n\r\n"); 
+
+const TUint KTenKBytes = 10240;
+_LIT8(KNewLine, "\r\n");
+_LIT8(KDush, "--");
+
+/** the common part of file name where will be stored Blobs from Response */
+_LIT(KFileName, "c:\\SenBlobResponses\\SenBlobResponse");
+
+/**
+ * Prepares XOP message with binary data to transmit it through HTTP Channel
+ * and extracts BLOBs from XOP message responsed through HTTP channel 
+ *
+ * @lib
+ * @since S60 v3.2
+ */
+class SenMultiPartUtils
+	{
+public:
+
+    /**
+     * different cases of panics
+     */
+     enum TMultiPartPanics
+	    {
+	    EMultiPartNoRequestMessage,
+	    EMultiPartNoBlobs,
+	    EMultiPartNoContentTypeInBlobHeader,
+	    EMultiPartNoCid,
+	    EMultiPartSoapVersionInvalid,
+	    EMultiPartBlobContainerTypeInvalid,
+	    EMultiPartResponseBodyInvalid,
+	    EMultiPartCidInvalid
+	    };
+
+    /**
+     * ContentType for MultiPart consists of 
+     * FiledName = "Content-Type" FiledValue = "Multipart/Related"
+     * ParamName1 = "boundary" 	  ParamValue1 = BoundaryValue
+     * ParamName2 = "type"  	  ParamValue1 = TypeValue
+     * ParamName1 = "start" 	  ParamValue1 = StartValue
+     * ParamName1 = "start-info"  ParamValue1 = StartInfoValue
+     * ParamName1 = "action" 	  ParamValue1 = ActionValue
+     * This structure describes ParamName & ParamValue of ConetentType
+     */ 
+    struct TMultiPartContentTypeParam
+        {
+        TPtrC8 paramName;
+        TPtrC8 paramValue;
+        };	    
+    
+    /**
+     * This structure describes FieldValue & Params of ContentType
+     */
+    struct TMultiPartContentType
+        {
+        TPtrC8 fieldValue;
+        RArray<TMultiPartContentTypeParam> params;
+        };
+
+public:
+
+    /**
+     * Serializes SenMessage message in MultiPart message
+     * @since S60 v5.0
+     * @param aMessage The message with multiparts (usual view of message)
+     * @param aMultiPartMessage The message serialized from usual view to MultiPart message
+     * @param aType mode of serialization (see xmlengserializer.h)
+     */	
+	IMPORT_C static void SerializeMessageL(CSenFragmentBase& aMessage, 
+	                                         RBuf8& aMultiPartMessage,
+	                                         TXmlEngSerializerType aType = ESerializerXOPInfoset);
+	
+    /**
+   	 * Generates random content-ID for header of XOP message and for headers of BLOBs 
+     * as randomNumber@homeTime
+   	 * @since S60 v3.2     
+   	 * @param aRootCid Generated content-ID
+   	 */
+ 	IMPORT_C static void GenerateRandomRootCidL(RBuf8& aRootCid);
+ 	
+ 	/**
+	* Generates random boundary for mime header as randomNumber
+	* @since S60 v3.2
+	* @param aBoundary Generated random boundary
+	*/
+ 	IMPORT_C static void GenerateRandomBoundaryL(RBuf8& aBoundary);
+ 	
+ 	/**
+ 	* Generates MimeBoundary to separate mime parts of the message as --randomNumber
+ 	* @since S60 v3.2
+ 	* @param aBoundary random boundary
+ 	* @param aBoundaryStart Generated MIME boundary
+ 	*/
+ 	IMPORT_C static void BoundaryLineStartL(const RBuf8& aBoundary, RBuf8& aBoundaryStart);
+ 	
+ 	/**
+ 	* Generates MimeBoundaryEnd to end multipart message (MultiPart) as --randomNumber--
+ 	* @since S60 v3.2
+ 	* @param aBoundary random boundary
+ 	* @param aBoundaryEnd Generated MIME boundary end
+ 	*/
+  	IMPORT_C static void BoundaryLineEndL(const RBuf8& aBoundary, RBuf8& aBoundaryEnd);
+
+    /**
+     * Creates Header for Root of XOP message or other multiPart message
+     * The header sould be the next:
+     *
+     * --MIME_boundary
+     * Content-Type: application/xop+xml; 
+     * charset=UTF-8; 
+     * type="text/xml" (for SOAP 1.1) or "application/soap+xml" (for SOAP 1.2)
+     * Content-Transfer-Encoding: 8bit
+     * Content-ID: <randomNumber@homeTime>
+     *
+     * where "Content-ID" is the same as "start" in Header of Outer Package
+     *
+     * @since S60 v3.2
+     * @param aMessage The message with multiparts
+     * @param aRootCid The content ID for the header of XOP or other multiPart message
+     * @param aHeaderRoot11  Header of root of XOP message or other multiPart message
+     */
+     IMPORT_C static void HeaderRootL(MSenMessage* aMessage,
+    							     const RBuf8& aRootCid, RBuf8& aHeaderRoot);
+	
+    /**
+     * Creates Header for Binary Data[aIndex] of XOP message 
+     * The header sould be the next:
+	 *
+     * --MIME_boundary
+	 * Content-Type: image/png
+	 * Content-Transfer-Encoding: binary
+	 * Content-ID: <randomNumber@homeTime>
+	 *
+	 * @since S60 v3.2
+     * @param aIndex Which BLOB from array of TXmlEngDataContainer is processed, starts from 0
+     * @param aBinaryDataList The list of BLOBs
+     * @param aHeaderBinaryData Header of binary data[aIndex]
+     */
+    IMPORT_C static void HeaderBinaryDataL(TUint aIndex, 
+									       RArray<TXmlEngDataContainer>& aBinaryDataList,
+			 						 	   RBuf8& aHeaderBinaryData);
+
+    /**
+     * Extracts a part of BLOB (10KB) from a file
+     * @since S60 v3.2
+     * @param aPart Which part of BLOB should be extracted
+     * @param aIndex Which BLOB from array of TXmlEngDataContainer is processed, starts from 0
+     * @param aBinaryDataList The list of BLOBs
+     * @param aBinaryData Part of BLOB that was extracted from a file
+     */
+    IMPORT_C static void FileDataPartL(TUint aPart, TUint aIndex, 
+								       RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       	       RBuf8& aBinaryData);									 
+
+    /**
+     * Extracts the rest of BLOB (less than 10KB) from a file
+     * @since S60 v3.2
+     * @param aParts How many parts of BLOB has already been extracted from a file
+     * @param aRest How many bytes should be exracted from a file 
+     * @param aIndex Which BLOB from array of TXmlEngDataContainer is processed, starts from 0
+     * @param aBinaryDataList The list of BLOBs
+     * @param aBinaryData The last part of BLOB that was extracted from a file
+     */
+    IMPORT_C static void FileDataRestL(TUint aParts, TUint aRest, TUint aIndex, 
+								       RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       	       RBuf8& aBinaryData);									 
+
+    /**
+     * Extracts CIDs of BLOBs from response MultiPart message
+     * @since S60 v3.2
+     * @param aBlobHeader Header of Blob from that should be extracted CID of BLOB
+     * @param aCids Array of CIDs for all BLOBs    
+     */
+    IMPORT_C static void CidL(const RBuf8& aBlobHeader, RArray<RBuf8>& aCids);
+
+    /**
+     * Extracts BLOB from response MultiPart message and writes it in a file
+     * @since S60 v3.2
+     * @param aIndex Which BLOB from response is processed, starts from 0
+     * @param aFirst Shows is it First part of BLOB or not
+     * @param aBlob The part of BLOB from response that should be written in fhe file
+     * @param aFileNames Array of File names for the all responsed BLOBs
+     * @return size of file in order to monitor progess
+     */	
+    IMPORT_C static TInt SetFileL(TUint aIndex, TBool aFirst, TDesC8& aBlob, 
+                                  RArray<RBuf8>& aFileNames);
+
+private:													
+		
+    /**
+     * Generates the file name for BLOB of response MultiPart message 
+     * and collects it in array of file names for the all BLOBs
+     * @since S60 v3.2
+     * @param aIndex Which BLOB from response is processed, starts from 0
+     * @param aFileNames Array of File names for the all responsed BLOBs
+     */
+     static void FileNameL(TUint aIndex, RArray<RBuf8>& aFileNames);
+	};
+									 
+#endif // SEN_MultiPart_UTILS_H
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senpasswordtransform.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECom interface for Sen Security Mechanism plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_PASSWORD_TRANSFORM_H
+#define SEN_PASSWORD_TRANSFORM_H
+
+// INCLUDES
+#include <ecom/ecom.h>
+
+#include "msencoreservicemanager.h"
+
+// CLASS DECLARATION
+
+/**
+* Custom ECOM interface definition. This interface is used by
+* clients to find specific security mechanism plugin instance
+* implementations which implement pure virtual functions.
+*/
+class CSenPasswordTransform : public CBase
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Wraps ECom object instantiation, which returns the
+        * default interface implementation.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface
+        * ALSO provide NewL methods. They are the familiar
+        * EPOC NewL's, which create instance of classes.
+        */
+        static CSenPasswordTransform* NewL(MSenCoreServiceManager& aManager);
+
+        /**
+        * Wraps ECom object instantitation, which returns the
+        * interface implementation matching to given aCue.
+        * IMPLEMENTATION_INFO::default_data.
+        * For details, see EcomSIFDefinition.inl comments.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface ALSO
+        * provide NewL methods. They are the familiar EPOC NewL's,
+        * which create instances of classes.
+        * @param: aCue is the "name" of the requested implementation.
+        *              Implementations advertise their cue as specified
+        *              in their resource file field
+        */
+        static CSenPasswordTransform* NewL(const TDesC8& aCue,
+                                           MSenCoreServiceManager& aManager);
+        /**
+        * Destructor.
+        */
+        virtual ~CSenPasswordTransform();
+
+        // New functions
+        
+        // the actual security mechanism interface methods
+
+        /**
+        * Set transform parameters
+        *  @return KErrNone or one of the system-wide error codes,
+        *          KErrNotSupported, if parameter name is unknown!
+        */
+        virtual TInt SetParameterL(TPtrC8 aName, TPtrC8 aValue) = 0;
+
+        /**
+        * Does the actual tranform
+        * @return the transformed password.
+        * Caller takes ownership of the returned object. Never returns NULL.
+        */
+        virtual HBufC8* TransformL(TPtrC8 aPassphrase) const = 0;
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenPasswordTransform(MSenCoreServiceManager& aServiceManager);
+
+    protected: // Data
+        // to access base64, encoding/decoding
+        MSenCoreServiceManager& iServiceManager;    
+
+    private: // Data
+        /** 
+        * Instance identifier key. When instance of an implementation is created 
+        * by ECOM framework, the framework will assign UID for it. 
+        * The UID is used in destructor to notify framework that this instance is
+      * being destroyed and resources can be released.
+      */
+        TUid iDtor_ID_Key;
+    };
+
+// This includes the implementation of the instantiation functions and destructor
+#include "senpasswordtransform.inl"
+
+#endif // SEN_PASSWORD_TRANSFORM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senpasswordtransform.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECom interface for Sen Security Mechanism plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concret plugin
+// implementation.
+inline CSenPasswordTransform* CSenPasswordTransform::NewL(MSenCoreServiceManager& aManager)
+    {
+    // Wish to instantiate the default interface - TruncateTransform
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES        
+    const TUid KTruncateTransformPluginUid = {0x101F9708};
+#else
+    const TUid KTruncateTransformPluginUid = {0x101F973E};
+#endif    
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
+
+    // Find implementation behind KTruncateTransformPluginUid
+    TAny* intf = REComSession::CreateImplementationL (KTruncateTransformPluginUid, 
+                                                      _FOFF (CSenPasswordTransform, 
+                                                      iDtor_ID_Key), 
+                                                      constructorParameters);
+
+    return reinterpret_cast <CSenPasswordTransform*> (intf);
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concret plugin
+// implementation.
+inline CSenPasswordTransform* CSenPasswordTransform::NewL(const TDesC8& aMatch, 
+                                                          MSenCoreServiceManager& aManager)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    const TUid KCSenPasswordTransformInterfaceUid = {0x101F9707};
+#else
+    const TUid KCSenPasswordTransformInterfaceUid = {0x101F973D};
+#endif    
+
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aMatch);
+    resolverParams.SetWildcardMatch(EFalse);
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
+
+    // Find implementation for our interface.
+    // - KCSenPasswordTransformInterfaceUid is the 
+    //   UID of Password Transform ECOM interface.          
+    //
+    // - This call will leave, if the plugin architecture cannot find
+    //   implementation.
+    // - The returned pointer points to one of our interface implementation
+    //   instances.
+    TAny* intf = REComSession::CreateImplementationL (KCSenPasswordTransformInterfaceUid,
+                                                      _FOFF (CSenPasswordTransform, 
+                                                      iDtor_ID_Key), 
+                                                      constructorParameters, 
+                                                      resolverParams); 
+
+    return reinterpret_cast<CSenPasswordTransform*> (intf);
+    }
+
+// Interface's (abstract base class's) destructor
+inline CSenPasswordTransform::~CSenPasswordTransform()
+    {
+    // If in the NewL some memory is reserved for member data, it must be
+    // released here. This interface does not have any instance variables so
+    // no need to delete anything.
+
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation (iDtor_ID_Key);
+    }
+
+inline CSenPasswordTransform::CSenPasswordTransform(MSenCoreServiceManager& aServiceManager)
+        :iServiceManager(aServiceManager)
+        {
+        }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senprovider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_PROVIDER_H
+#define SEN_PROVIDER_H
+
+//  INCLUDES
+#include <ecom/ecom.h>
+#include <e32std.h>   // for RCriticalSection
+
+#include <MSenServiceDescription.h>
+#include "senwsdescription.h"
+#include <SenFacet.h>
+
+#include "senidentifier.h" // internal Utils\inc
+#include "msenprovider.h" // internal Framework\inc
+
+// FORWARD DECLARE
+class CSenLocalRequest;
+
+// CLASS DECLARATION
+
+/**
+* Class for delivering SOAP request to Serene and response back.
+* Sub-classing actual Service Providers have to implement MSenProvider
+* interface.
+*
+*/       
+class CSenProvider : public CBase, public MSenProvider
+    {
+    public: // Constructors and destructor
+            /**
+            * Two-phased constructor.
+        */
+        static CSenProvider* NewL(const TDesC8& aMatch);
+        
+        static CSenProvider* NewL();
+        
+        /**
+        * Function:    ~CSenProvider
+        *
+        * Description: Destroy the object
+        */
+        virtual ~CSenProvider();
+
+        // From MSenHostlet:
+        /** 
+        * Default implementation returns the ECOM cue as endpoint of this local provider.
+        * @return ECOM cue of this plug-in implementation
+        */
+        inline virtual TPtrC8 Endpoint() const;
+
+        /**
+    	* Method provides the default implementation of adding facets in the SD after 
+    	* checking the  default values of the provider properties (exposed, shareable, 
+    	* complete client message etc). Each overriden default facet value is added
+    	* to the service description (SD).
+        *
+        * @param aSD is the service description into which all the facets of this
+        * hostlet (local service provider) will be added. 
+        *
+        * Method provides means of "auto-configuration" for service session creation.
+        * The sessions themself can read properties of the provider from the altered
+        * XML service description. This way, provider deployment does not need to be 
+        * followed by explicit Service Management API calls (configuration) to add 
+        * these facet.
+    	*/
+        inline virtual void DescribeServiceL(CSenWSDescription& aSD);
+        
+        /**
+        * This default, inline version returns EFalse. Any service exposed to outside world should
+        * override to return ETrue instead. That would cause inline method 
+        * InitServiceSession to add corresponding facet to the session.
+        * @see MSenProvider interface
+        */
+        inline virtual TBool Exposed() const;
+
+
+        /**
+        * This default, inline version version returns EFalse. Sharable, sub-classing providers need 
+        * to override this to return ETrue instead, if they allow multiple service consumers to have
+        * queued access to the ServiceL() of the same provider instance.
+        * @see MSenProvider interface
+        */
+        inline virtual TBool Sharable() const;
+
+        /**
+        * This default, inline version version returns EFalse. Providers, which wish to receive
+        * complete messages (with header information) need to override this to return ETrue instead.
+        * @see MSenProvider interface
+        */
+        inline virtual TBool CompleteClientMessages() const;
+
+
+        /**
+        * This default, inline version version returns EFalse. Providers, which have slow construction
+        * mechanism should make this return ETrue, to make WSF Core Service Manager to pre-load them
+        * after that (Symbian server) process is created and sensessions.xml database is being loaded.
+        * @see MSenProvider interface
+        */
+        inline virtual TBool LoadOnStartup() const;
+
+        /**
+        * This default, inline version version returns ETrue. Providers, which wish to permit
+        * un-thread-safe access to their ServiceL need to make this return EFalse instead.
+        * @see MSenProvider interface
+        */
+        inline virtual TBool Threadsafe() const;
+
+        /**
+        * This default, inline version version returns EFalse. Providers, which allow themselves
+        * to be re-cycled (reused) need to make this return EFalse. 
+        * @see MSenProvider interface
+        */
+        inline virtual TBool Reinitializable() const;
+
+        /**
+        * This default, inline version version returns EFalse. Providers, which want themselves
+        * to be left on background as long as main thread (Core Service Manager) is alive, need
+        * to make this return ETrue instead.
+        * @see MSenProvider interface
+        */
+        inline virtual TBool StayOnBackground() const;
+
+        /** 
+        * Default implementation does nothing, and
+        * returns KErrNotSupported.
+        * Subclasses should override this method in
+        * order to re-initialize any state variables
+        * that are not related to exact construction
+        * phase; for example, some provider might
+        * reset any state data it has, but still it
+        * might decide to keep negotiated client
+        * (connection) to some server open, making
+        * just corresponding "re-init" to that service
+        * being internally consumed by that provider.
+        *
+        * Typically, this method is a pair to Reinitializable()
+        * function, meaning that when one develops such provider 
+        * which supports reinitialization, that re-init should be 
+        * implemented behind this ReinitL() method.
+        *
+        * @see MSenProvider
+        */
+        inline virtual TInt ReinitL();
+
+        /**
+        * Default implementation does nothing. Subclasses should override this.
+        */
+        //inline virtual void ThreadInitL(const TDesC& /* aThreadId */) { ; }
+
+        /**
+        * Default implementation does nothing. Subclasses should override this.
+        */
+        //inline virtual void ThreadDestroy(const TDesC& /* aThreadId */) { ; }
+
+    private:
+        /** iDtor_ID_Key Instance identifier key. When instance of an
+        *               implementation is created by ECOM framework, the
+        *               framework will assign UID for it. The UID is used in
+        *               destructor to notify framework that this instance is
+        *               being destroyed and resources can be released.
+        */
+        TUid iDtor_ID_Key;
+
+        HBufC8* iCue;
+        
+        TAny* _reserved;
+        TAny* _reserved2;
+    };
+
+#include "senprovider.inl"
+
+#endif 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senprovider.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plug-in framework to instantiate appropriate concrete plug-in
+// implementation.
+
+// What to do if there are NO providers to be found - should there always be a 
+// "dummy" provider?
+
+inline CSenProvider* CSenProvider::NewL()
+    {
+    // Wish to instantiate the default provider - just a test provider...
+    const TUid KTestProviderUid = {0x10273114};
+    
+    // Find implementation behind KTestProviderUid.
+    TAny* intf = REComSession::CreateImplementationL(KTestProviderUid, 
+        _FOFF (CSenProvider, 
+        iDtor_ID_Key), 
+        NULL);
+
+    if(intf)
+        {
+        CSenProvider* provider = reinterpret_cast <CSenProvider*> (intf);
+        CleanupStack::PushL(provider);
+        provider->iCriticalSection.CreateLocal();
+        _LIT8(KTestProviderCue, "local://com.nokia.provider/TestProvider");
+        provider->iCue=KTestProviderCue().AllocL();
+        CleanupStack::Pop(); // provider
+        }
+
+    return reinterpret_cast <CSenProvider*> (intf);
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plug-in framework to instantiate appropriate concrete plug-in
+// implementation.
+inline CSenProvider* CSenProvider::NewL(const TDesC8& aCue)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES     
+    const TUid KUidSenHostletPlugin = { 0x02000502 };
+#else
+    const TUid KUidSenHostletPlugin = { 0x10282C5D };
+#endif    
+    
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aCue);
+    resolverParams.SetWildcardMatch(EFalse);
+    
+    // Find implementation for our interface.
+    
+    TAny* intf = REComSession::CreateImplementationL(KUidSenHostletPlugin,
+        _FOFF (CSenProvider, iDtor_ID_Key), 
+        NULL, 
+        resolverParams); 
+    
+    if(intf)
+        {
+        CSenProvider* provider = reinterpret_cast <CSenProvider*> (intf);
+        provider->iCriticalSection.CreateLocal();
+        CleanupStack::PushL(provider);
+        provider->iCue = aCue.AllocL();
+        CleanupStack::Pop(); // provider
+        }
+    
+    return reinterpret_cast<CSenProvider*> (intf);
+    }
+
+
+// Interface's (abstract base class's) destructor
+inline CSenProvider::~CSenProvider()
+    {
+    // If in the NewL some memory is reserved for member data, it must be
+    // released here. This interface does not have any instance variables so
+    // no need to delete anything.
+    
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation (iDtor_ID_Key);
+    delete iCue;
+    iCue = NULL;
+    iCriticalSection.Close();
+    }
+
+inline TPtrC8 CSenProvider::Endpoint() const
+    {
+    if(iCue)
+        return *iCue;
+    else
+        return KNullDesC8();
+    }
+
+// protected
+inline void CSenProvider::DescribeServiceL(CSenWSDescription& aSD)
+    {
+    aSD.SetEndPointL(Endpoint());
+    aSD.SetContractL(Contract());
+    aSD.SetFrameworkIdL(FrameworkId());
+      
+    if(Exposed())
+        {
+        CSenFacet* pExposed = CSenFacet::NewL();
+        CleanupStack::PushL(pExposed);
+        pExposed->SetNameL(KExposeLocalServiceFacet); // from MSenServiceDescription.h
+        aSD.SetFacetL(*pExposed);
+        CleanupStack::PopAndDestroy(); // pExposed
+        }
+    
+    if(Sharable())
+        {
+        CSenFacet* pSharable = CSenFacet::NewL();
+        CleanupStack::PushL(pSharable);
+        pSharable->SetNameL(KProviderSharableFacet);
+        aSD.SetFacetL(*pSharable);
+        CleanupStack::PopAndDestroy(); // pSharable
+
+       }
+    
+    if(CompleteClientMessages())
+        {
+        CSenFacet* pCompleteClientMsgs = CSenFacet::NewL();
+        CleanupStack::PushL(pCompleteClientMsgs);
+        pCompleteClientMsgs->SetNameL(KProviderCompleteClientMsgsFacet);
+        aSD.SetFacetL(*pCompleteClientMsgs);
+        CleanupStack::PopAndDestroy(); // pCompleteClientMsgs
+        }
+
+    if(LoadOnStartup())
+        {
+        CSenFacet* pLoadOnStartup = CSenFacet::NewL();
+        CleanupStack::PushL(pLoadOnStartup);
+        pLoadOnStartup->SetNameL(KProviderLoadOnStartupFacet);
+        aSD.SetFacetL(*pLoadOnStartup);
+        CleanupStack::PopAndDestroy(); // pLoadOnStartup
+        }
+
+    if(Threadsafe())
+        {
+        CSenFacet* pThreadsafe = CSenFacet::NewL();
+        CleanupStack::PushL(pThreadsafe);
+        pThreadsafe->SetNameL(KProviderThreadsafeFacet);
+        aSD.SetFacetL(*pThreadsafe);
+        CleanupStack::PopAndDestroy(); // pLoadOnStartup
+        }
+    
+    if(Reinitializable())
+        {
+        CSenFacet* pReinitializable = CSenFacet::NewL();
+        CleanupStack::PushL(pReinitializable);
+        pReinitializable->SetNameL(KProviderReinitializableFacet);
+        aSD.SetFacetL(*pReinitializable);
+        CleanupStack::PopAndDestroy(); // pReinitializable
+        }
+    
+    if(StayOnBackground())
+        {
+        CSenFacet* pStayOnBackgroudnd = CSenFacet::NewL();
+        CleanupStack::PushL(pStayOnBackgroudnd);
+        pStayOnBackgroudnd->SetNameL(KProviderStayOnBackgroundFacet);
+        aSD.SetFacetL(*pStayOnBackgroudnd);
+        CleanupStack::PopAndDestroy(); // pStayOnBackgroudnd
+        }
+    }
+  
+inline TBool CSenProvider::Exposed() const
+    {
+    return EFalse;
+    }
+    
+inline TBool CSenProvider::Sharable() const
+    {
+    return EFalse;
+    }
+
+inline TBool CSenProvider::CompleteClientMessages() const
+    {
+    return EFalse;
+    }
+
+
+inline TBool CSenProvider::LoadOnStartup() const
+    {
+    return EFalse;
+    }
+
+inline TBool CSenProvider::Threadsafe() const
+    {
+    return ETrue;
+    }
+
+inline TBool CSenProvider::Reinitializable() const
+    {
+    return EFalse;
+    }
+
+inline TBool CSenProvider::StayOnBackground() const
+    {
+    return EFalse;
+    }
+
+inline TInt CSenProvider::ReinitL()
+    {
+    return KErrNotSupported;
+    }
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sensecuritymechanism.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECom interface for Sen Security Mechanism plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SECURITY_MECHANISM_H
+#define SEN_SECURITY_MECHANISM_H
+
+// INCLUDES
+#include <ecom/ecom.h>
+
+#include "msensaslmessage.h"
+#include "msencoreservicemanager.h"
+#include "saslmechanism.h"
+
+// CLASS DECLARATION
+
+/**
+* Custom ECOM interface definition. This interface is used by
+* clients to find specific security mechanism plugin instance
+* implementations which implement pure virtual functions.
+*/
+class CSenSecurityMechanism : public CSaslMechanism
+    {
+    public: // Constructors and destructor
+        /**
+        * Wraps ECom object instantitation, which returns the
+        * default interface implementation.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface
+        * ALSO provide NewL methods. They are the familiar
+        * EPOC NewL's, which create instance of classes.
+        */
+        static CSenSecurityMechanism* NewL(MSenCoreServiceManager& aManager);
+
+        /**
+        * Wraps ECom object instantitation, which returns the
+        * interface implementation matching to given aCue.
+        * IMPLEMENTATION_INFO::default_data.
+        * For details, see EcomSIFDefinition.inl comments.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface ALSO
+        * provide NewL methods. They are the familiar EPOC NewL's,
+        * which create instance of classes.
+        * @param  aCue is the "name" of the requested implementation.
+        *         Implementations advertise their cue as specified
+        *         in their resource file field
+        */
+        static CSenSecurityMechanism* NewL(const TDesC8& aCue,
+                                           MSenCoreServiceManager& aManager);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenSecurityMechanism();
+
+        // New functions
+        
+        // the actual security mechanism interface methods
+        
+        /**
+        * @return the name of the mechanism, like "PLAIN".
+        */
+        virtual const TDesC8& Name() = 0;
+
+        /**
+        * @return a SASL request that is a response to the passed response.
+        * Caller takes ownership of the returned object. Never returns NULL.
+        */
+        virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
+                                     MSenSaslMessage& aNewRequest) = 0;
+
+    protected:
+        CSenSecurityMechanism(MSenCoreServiceManager& aServiceManager);
+
+    protected: // Data
+        // to access base64, encoding/decoding
+        MSenCoreServiceManager& iServiceManager;
+
+    private:
+        /**
+        * Instance identifier key. When instance of an
+        * implementation is created by ECOM framework, the
+        * framework will assign UID for it. The UID is used in
+        * destructor to notify framework that this instance is
+        * being destroyed and resources can be released.
+        */
+        TUid iDtor_ID_Key;
+    };
+
+// This includes the implementation of the instantiation functions and
+// destructor
+#include "sensecuritymechanism.inl"
+
+#endif // SEN_SECURITY_MECHANISM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sensecuritymechanism.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECom interface for Sen Security Mechanism plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concrete plugin
+// implementation.
+inline CSenSecurityMechanism* CSenSecurityMechanism::NewL(MSenCoreServiceManager& aManager)
+    {
+    // Instantiate the default SASL plugin - AnonymousSasl
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    const TUid KAnonymousSaslPluginUid = {0x101F96FD};
+#else
+    const TUid KAnonymousSaslPluginUid = {0x101F9734};
+#endif    
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
+
+    // Find implementation behind KAnonymousSaslPluginUid
+    TAny* intf = REComSession::CreateImplementationL (KAnonymousSaslPluginUid, 
+                                                      _FOFF (CSenSecurityMechanism, 
+                                                      iDtor_ID_Key), 
+                                                      constructorParameters);
+
+    return reinterpret_cast <CSenSecurityMechanism*> (intf);
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concret plugin
+// implementation.
+inline CSenSecurityMechanism* CSenSecurityMechanism::NewL(const TDesC8& aMatch, 
+                                                          MSenCoreServiceManager& aManager)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TUid KCSenSecurityMechanismInterfaceUid = {0x101F96FC};
+#else
+    const TUid KCSenSecurityMechanismInterfaceUid = {0x101F9733};
+#endif
+
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aMatch);
+    resolverParams.SetWildcardMatch(EFalse);
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
+
+    // Find implementation for our interface.
+    // - KCSenSecurityMechanismInterfaceUid is the UID of
+    //  SASL SECURITY MECHANISM ECOM interface.         
+    //
+    // - This call will leave, if the plugin architecture 
+    // cannot find implementation.
+    // - The returned pointer points to one of our interface implementation
+    //   instances.
+    TAny* intf = REComSession::CreateImplementationL (KCSenSecurityMechanismInterfaceUid,
+                                                      _FOFF (CSenSecurityMechanism, 
+                                                      iDtor_ID_Key), 
+                                                      constructorParameters, 
+                                                      resolverParams); 
+
+    return reinterpret_cast<CSenSecurityMechanism*> (intf);
+    }
+
+
+// Interface's (abstract base class's) destructor
+inline CSenSecurityMechanism::~CSenSecurityMechanism()
+    {
+    // we need to call this, because destroying is too late
+    // in virtual destructor in super class (virtual destructor & ECOM)
+    // If superclass resets the contents, the memory will be in illegal
+    // state in case that there is ONE or MORE password transform ECOM
+    // instancies inside this array(!) -> this will cause crash in 
+    // unknown location, typically in next destructor.
+    iTransforms.ResetAndDestroy(); // were owned
+
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation (iDtor_ID_Key);
+    }
+
+inline CSenSecurityMechanism::CSenSecurityMechanism(MSenCoreServiceManager& aServiceManager)
+        :iServiceManager(aServiceManager)
+        {
+        }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senservercontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Each application that connects WS-stack through client-server
+*                interface has an application context of it's own, which can
+*                hold a list for active connections and service sessions, 
+*                acting as a common place holder and bridge between the
+*                smaller (contexts) that those contain. Class allows 
+*                application-wide information to be shared efficiently
+*                at proper layer.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVER_CONTEXT_H
+#define SEN_SERVER_CONTEXT_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+//#include "SenContext.h"
+#include "senpointermap.h" // pointer map is internal/ado: Utils\inc
+
+#include "sencoreservicemanager.h"
+
+// FORWARD DECLARATIONS
+class CSenApplicationContext;
+class CSenCoreServiceManager;
+
+
+// TYPE DEFS
+typedef RSenPointerMap<TUint32, CSenApplicationContext> RApplicationCtxMap; 
+
+// CLASS DECLARATION
+class CSenServerContext : public CBase // CSenContext
+    {
+    public:
+        /**
+        * Standard 2-phased constructor
+        * @return pointer to new context.
+        */ 
+        IMPORT_C static CSenServerContext* NewL(MSenCoreServiceManager& aCore);
+        /**
+        * Standard 2-phased constructor 
+        * @return pointer to new context,
+        * which is left on cleanupstack.
+        */ 
+        IMPORT_C static CSenServerContext* NewLC(MSenCoreServiceManager& aCore);
+
+        // Destructor:
+        IMPORT_C virtual ~CSenServerContext();
+        
+        // New methods:
+        //TInt AddApplicationContext(CSenApplicationContext& aCtx); // takes ownership
+        
+        // This method either creates a new ctx or returns existing one.
+        // When application context is created, it is added to server context.
+        virtual CSenApplicationContext& OpenApplicationContextL(TSecureId aSecureId);
+        
+        // Closes the application context, but ONLY if it does not have any clients
+        // When application context is closed, it is removed from server context.
+        virtual TInt CloseApplicationContext(const CSenApplicationContext& aCtx);
+        
+        // Getter for core
+        virtual MSenCoreServiceManager& Core();
+        
+    protected:
+        IMPORT_C  CSenServerContext(MSenCoreServiceManager& aCore);
+                                     
+        IMPORT_C void BaseConstructL();
+
+    private: // Data
+        RApplicationCtxMap iApplications;
+        MSenCoreServiceManager& iCore;
+    
+    };
+
+#endif // SEN_SERVER_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senserviceinvocationframework.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SERVICE_INVOCATION_FRAMEWORK_INTERFACE_H
+#define SERVICE_INVOCATION_FRAMEWORK_INTERFACE_H
+
+// INCLUDES
+#include <ecom/ecom.h>
+
+#include "msenserviceinvocationframework.h"
+
+// CONTANTS
+const TInt KErrSenReinitRequired = -30304;
+const TInt KErrSenResendRequired = -30316;
+const TInt KErrSenFailedAuthentication  = -30320;
+//const TInt KErrSenResendComplete = -30322; 
+
+// Default events
+const TInt KSenEventWsfReady                            = 1;
+const TInt KSenEventSessionsDbReadBegin                 = 100;
+const TInt KSenEventSessionsDbReadComplete              = 101;
+const TInt KSenEventSessionsDbWriteBegin                = 102;
+const TInt KSenEventSessionsDbWriteComplete             = 103;
+const TInt KSenEventIdWsfSessionValidatorRequested      = 200;
+const TInt KSenEventConsumerReleasesSession             = 300;
+const TInt KSenEventConsumerAdded                       = 301;
+const TInt KSenEventConsumerRemoved                     = 302;
+const TInt KSenEventRegisterNewServiceDescription       = 400;
+const TInt KSenEventRegisterIdentityProvider            = 500;
+const TInt KSenEventUnregisterIdentityProvider          = 501;
+
+// FORWARD DECLARATIONS
+class CSenSecurityMechanism;
+struct TSifData;
+
+/**
+ * Class: CSIF (ServiceInvocationFramework ECOM interface)
+ * Custom ECOM interface definition. This interface is used by
+ * clients to find specific instance implementation(s).
+ */
+class CSIF : public CSenBaseFragment, public MSIF
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Wraps ECom object instantiation, which returns the
+        * default interface implementation.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface
+        * ALSO provide NewL methods. They are the familiar
+        * EPOC NewL's, which create instance of classes.
+        */
+        static CSIF* NewL( MSenCoreServiceManager& aManager );
+
+        /**
+        * Wraps ECom object instantitation, which returns the
+        * interface implementation matching to given aCue.
+        * IMPLEMENTATION_INFO::default_data.
+        * For details, see EcomSIFDefinition.inl comments.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        *       methods are only defined for concrete classes.
+        * Note that the implementations of this interface ALSO
+        * provide NewL methods. They are the familiar EPOC
+        * NewL's, which create instance of classes.
+        * @param  aCue is the "name" of the requested implementation.
+        *         Implementations advertise their cue as specified
+        *         in their resource file field
+        */
+        static CSIF* NewL( const TDesC8& aCue, MSenCoreServiceManager& aManager );
+
+        /**
+         * Destructor.
+         */
+        virtual ~CSIF();
+
+        // New functions
+        
+        /**
+        * Try to find one or more services that match the given
+        * ServiceDescription. Register ServiceDescriptions for these to the
+        * owner of the framework, i.e. to the ServiceManager. Return the
+        * number of ServiceDescriptions that were added.
+        * @param    aPattern - A ServiceDescriptin that should be treated
+        *           as a pattern
+        * @param    aErrorMsg will be allocated to provide detailed
+        *           information about error, if available (like SOAP fault)
+        * @return   On success, returns a positive number: - a total count 
+        *           of matching ServiceDescriptions that were added.
+        *           In case of error, the returned value will be negative:
+        *           - one of the system-wide error codes.
+        */
+        virtual TInt AddServiceDescriptionL( MSenServiceDescription& aPattern,
+                                             MSenRemoteServiceConsumer& aRemoteConsumer,
+                                             HBufC8*& aErrorMsg ) = 0;
+
+        /**
+        * Set the ServiceManager to which this instance reports.
+        * The (singleton) ServiceManager calls this method when
+        * it instantiates a framework.
+        * @param aServiceManager The singleton ServiceManager in the system.
+        */
+        virtual void SetManager( MSenCoreServiceManager& aServiceManager ) = 0;
+
+        /**
+        * The CoreServiceManager asks for this BaseFragment upon startup
+        * in order to give this framework a chance to read its configuration
+        * information from the central ServiceManager configuration document.
+        * @return CSenBaseFragment - an object that can do SAX based parsing of a XML fragment
+        * that contains framework specific configuration information.
+        */
+        virtual CSenBaseFragment& ConfigParser() = 0;
+
+        /**
+        * This method may be called to pass certain events to the SIF 
+        * plug-in.
+        * There may be few common events in WSF scope plus other, plug-in 
+        * specific events.
+        * Plug-ins can themselves decide, whether or not to take action
+        * on notified event. For example, ID-WSF plug-in might be interested
+        * to assign "session validators" (AS and DS clients) to the newly
+        * instantiated sessions, after it has been notified, that all sessions
+        * have been parsed into memory (de-serialized) from sensessions.xml
+        * database.
+        */
+        virtual TInt OnEvent( const TInt aEvent, TAny* aArgument ) = 0;
+
+        /**
+        * Getter for SIF specific extension interface, which caller
+        * typically class-casts to pre-known type
+        * @return pointer to plug-in specific interface, or NULL
+        *         if interface extension is NOT implemented.
+        */
+        virtual TAny* ExtendedInterface() = 0;
+        
+        /**
+         * @return a string that is the unique for this implementation. Note that there might be multiple
+         * frameworks, which all implement same TYPE (framework ID is the same), but which have different
+         * design. This might mean that they implement different VERSION of the framework. It is recommended
+         * that framework CUE is the ECOM cue of the framework, and that it is in form of URN (unique resource
+         * name). 
+         * This default, inline implementation is returning the ECOM cue value of this plug-in.
+         */
+        virtual TPtrC8 Cue() const;        
+    private:
+
+        struct TSifData
+            {
+            /** Instance identifier key. When instance of an
+            * implementation is created by ECOM framework, the
+            * framework will assign UID for it. The UID is used in
+            * destructor to notify framework that this instance is
+            * being destroyed and resources can be released.
+            */
+            TUid iDtor_ID_Key;
+            
+            /*
+            * This equals to ECOM's data type (== "cue" of the plug-in)
+            */
+            HBufC8* iCue;
+            //HBufC8* iReserved;
+            //HBufC8* iReserved*;
+            inline void Close();
+            };        
+
+    private: // Data
+        TSifData* iData;
+    };
+    
+// Inline includes the implementation of the instantiation
+// functions and destructor
+#include "senserviceinvocationframework.inl"
+
+#endif // SERVICE_INVOCATION_FRAMEWORK_INTERFACE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senserviceinvocationframework.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Defines the ECom interface for Sen Service Invocation
+*                Framework plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+#include <SenCredential2.h>
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plug-in framework to instantiate appropriate concrete plug-in
+// implementation.
+inline CSIF* CSIF::NewL(MSenCoreServiceManager& aManager)
+    {
+    // Caller wants to instantiate the default plug-in - ID-WSF  
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES      
+    const TUid KIDWSFInterfaceUid = {0x101F96FA};
+#else
+    const TUid KIDWSFInterfaceUid = {0x101F9731};
+#endif    
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
+
+    // Find implementation for our interface.
+    // - KIDWSFInterfaceUid is the UID of our custom ECOM interface.
+    // - This call will leave, if the plugin architecture cannot find any implementation.
+    // - The returned pointer points to one of the interface implementations.
+    TUid dtor_id_key;
+    TAny* intf = REComSession::CreateImplementationL ( KIDWSFInterfaceUid, dtor_id_key, constructorParameters );
+    //TAny* intf = REComSession::CreateImplementationL ( KIDWSFUid, _FOFF (CSIF, dtor_id_key), constructorParameters );
+    CSIF* sif = reinterpret_cast <CSIF*> (intf);
+    if ( sif )
+        {
+        
+        // Resolve the DataType of this plug-in (ECOM cue):
+        RImplInfoPtrArray ecomInfoArray;
+        REComSession::ListImplementationsL( KIDWSFInterfaceUid, ecomInfoArray );
+
+        TInt infoCount(ecomInfoArray.Count());
+        // NOTE: current code uses the plug-in that has highest version number
+        //TInt index_with_highest_version(0);
+        CImplementationInformation* match = NULL;
+        for (TInt i=0; i<infoCount; i++)
+            {
+            CImplementationInformation* candidate = ecomInfoArray[i];
+            if( !match || candidate->Version() > match->Version() )
+                {
+                match = candidate;
+                // index of plug-in with highest version number
+                //index_with_highest_version = i;
+                }
+            }
+        CleanupStack::PushL( sif );
+        sif->iData = new (ELeave) TSifData();
+        sif->iData->iDtor_ID_Key = dtor_id_key;
+        if( match )
+            {
+            sif->iData->iCue = match->DataType().AllocL();
+            }
+        CleanupStack::Pop( sif );
+        ecomInfoArray.ResetAndDestroy();        
+        }
+
+    return sif;
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plug-in framework to instantiate appropriate concrete plug-in
+// implementation.
+inline CSIF* CSIF::NewL(const TDesC8& aCue, MSenCoreServiceManager& aManager)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    const TUid KCSIFInterfaceUid = {0x101F96F9};
+#else
+    const TUid KCSIFInterfaceUid = {0x101F9730};
+#endif    
+    //const TUid KCSIFResolverUid = {0x101F614E}; // default resolver used, not needed..
+
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType( aCue );
+    //resolverParams.SetWildcardMatch(ETrue); 
+    resolverParams.SetWildcardMatch(EFalse); 
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aManager);
+    
+
+    // Find implementation for our interface.
+    // - XXX is the UID of our custom ECOM
+    //   interface. It is defined in EComInterfaceDefinition.h          
+    // - This call will leave, if the plugin architecture cannot find implementation.
+    // - The returned pointer points to one of the interface implementations
+    TUid dtor_id_key;
+    TAny* intf = REComSession::CreateImplementationL (KCSIFInterfaceUid, dtor_id_key, constructorParameters, resolverParams); 
+    // TAny* intf = REComSession::CreateImplementationL (KCSIFInterfaceUid, _FOFF (CSIF, dtor_id_key), constructorParameters, resolverParams); 
+
+    CSIF* sif = reinterpret_cast<CSIF*> (intf);
+    if ( sif )
+        {
+        CleanupStack::PushL( sif );
+        sif->iData = new (ELeave) TSifData();
+        sif->iData->iDtor_ID_Key = dtor_id_key;
+        sif->iData->iCue = aCue.AllocL();
+        CleanupStack::Pop( sif );
+        }
+
+    return sif;
+    }
+
+// Interface's (abstract base class's) destructor
+inline CSIF::~CSIF()
+    {
+    // If in the NewL some memory is reserved for member data, it must be
+    // released here.
+    if( iData ) // actually, this MUST always be true
+        {
+        // Inform the ECOM framework that this specific instance of the
+        // interface has been destroyed.
+        REComSession::DestroyedImplementation ( iData->iDtor_ID_Key );
+        iData->Close(); // de-allocates iData members
+        delete iData;
+        iData = NULL;
+        }
+    }
+
+inline TPtrC8 CSIF::Cue() const
+    {
+    if(iData && iData->iCue)
+        return *(iData->iCue);
+    else
+        return KNullDesC8();
+    }
+    
+inline void CSIF::TSifData::Close()
+    {
+    delete iCue;
+    iCue = NULL;
+    }
+    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,327 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_SESSION_H
+#define SEN_SERVICE_SESSION_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32des8.h>
+#include <e32std.h>
+
+#include "senwsdescription.h"
+#include <SenFacet.h>
+
+#include "msenremoteservicesession.h"
+#include "msenservicesession.h"
+
+#include "msenserviceinvocationframework.h"
+#include "MSenServiceConsumer.h"
+#include "msenremoteserviceconsumer.h"
+#include "msencoreservicemanager.h"
+
+// CONSTANTS
+_LIT8(KMessageThread, "urn:com.nokia.serene.facet.message-thread");
+
+// DATA TYPES
+typedef RPointerArray<MSenRemoteServiceConsumer> RServiceConsumerArray;
+
+// FORWARD DECLARATIONS
+class CSIF;
+class CSenTransportBase;
+class MSenRemoteHostlet;
+
+// CLASS DECLARATION
+class CSenServiceSession :  public CSenWSDescription,
+                            public MSenRemoteServiceSession,
+                            public MSenServiceSession
+    {
+    public:
+    
+        // New functions
+        
+        IMPORT_C virtual TInt InitializeFromL(MSenServiceDescription& aServiceDescription);
+
+        /**
+        * Parse the service session related information out of a message
+        * sent by the service. Default is to do nothing.
+        * Subclasses should override this.
+        * @param    aString containing a message received from a service.
+        * @param    String with parsed data
+        * @return TInt - a KErrNone or error
+        */
+        IMPORT_C virtual TInt ParseResponseL(const TDesC8& aInput,
+                                             HBufC8*& aOutput);
+
+        /**
+         * Ask the core service manager to save this service session into
+         * XML DAO database.
+         *
+         * This convenience method can be called from within other methods of
+         * this class or subclass, or by some service invocation framework
+         * implementations.
+         * Leave codes: Symbian system-wide error codes.
+         */
+        IMPORT_C virtual void SaveL();
+
+        /**
+        * This getter method does not trigger any execution, it just returns
+        * the current status of this session.
+        * @return  TInt the status of this service session.
+        */
+        IMPORT_C virtual TInt StatusL();
+
+        /**
+        * Compute the status of the ServiceSession. If the status
+        * changes to (or from) of "KSenConnectionStatusReady"
+        * the service consumers are notified. Internally, method
+        * calls ComputeStatusL().
+        * @return TInt status code indicating the current status,
+        *  which may have changed when this method was executed.
+        *  
+        */
+        IMPORT_C virtual TInt SetStatusL();
+
+        /**
+        * Method computes the current status of this service session.
+        * Subclasses typically override this. Method does NOT set
+        * the internal status variable of this class and so it NEITHER
+        * notifies consumer(s) about the computed result.
+        * @return integer (TInt), which indicates current, but only 
+        * computed status of this service session.
+        */
+        IMPORT_C virtual TInt ComputeStatusL();
+        
+        /**
+        * Adds a service consumer for this session.
+        *
+        * This service consumer will be notified of service responses
+        * (to it's own queries) and of all status changes.
+        * This method needs to be implemented -- often some 
+        * service invocation framework specific subclass.
+        * @param aConsumer is the service consumer object that exposes 
+        * the MSenRemoteServiceConsumer interface. Typically some 
+        * Symbian server-side session, which represents "remote"
+        * consumer application, separate process behind IPC boundary.
+        * @return KErrNone or some system-wide error code
+        */
+        virtual TInt AddConsumerL(MSenRemoteServiceConsumer& aConsumer) = 0;
+
+
+        // from MSenRemoteServiceSession
+        IMPORT_C TInt RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer);
+        
+        /**
+        * Return a iterator over a list with the consumers (clients) of this
+        * ServiceSession.
+        * This method is called from within several other methods of the abstract
+        * ServiceSession class.
+        * This method should be implemented by a subclass
+        * specific to a ServiceInvocationFramework implementation.
+        * Ownership of the aConsumers is NOT transfered to the caller.
+        * @param    aConsumers  List of the current consumers.
+        *           Owned by ServiceSession.
+        * @return  TInt - a KErrNone or error
+        */
+        virtual TInt Consumers(RServiceConsumerArray& aConsumers) const = 0;
+
+        // Functions from base classes
+
+        // from MSenRemoteServiceSession
+
+        IMPORT_C virtual TInt SetTransportPropertiesL(const TDesC8& aProperties,
+                                                      MSenRemoteServiceConsumer& aConsumer);
+
+        IMPORT_C virtual TInt TransportPropertiesL(HBufC8*& aProperties,
+                                                   MSenRemoteServiceConsumer& aConsumer);
+                                                      
+        IMPORT_C virtual TInt SubmitL(const TDesC8& aMessage, 
+                                      const TDesC8& aTransportProperties,
+                                      MSenRemoteServiceConsumer& aConsumer,
+                                      HBufC8*& aResponse);
+
+        IMPORT_C virtual TInt SendL( const TDesC8& aMessage, 
+                                     const TDesC8& aTransportProperties,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     TInt& aTxnId,
+                                     HBufC8*& aRevalidationError );
+
+        virtual TInt SubmitSoapL(const TDesC8& aSoapMessage, 
+                                 const TDesC8& aTransportProperties,
+                                 MSenRemoteServiceConsumer& aConsumer,
+                                 HBufC8*& aResponse) = 0;
+
+        virtual TInt SendSoapL( const TDesC8& aSoapMessage, 
+                                const TDesC8& aTransportProperties,
+                                MSenRemoteServiceConsumer& aConsumer,
+                                TInt& aTxnId,
+                                HBufC8*& aRevalidationError ) = 0;
+
+        // from MSenServiceDescription
+        IMPORT_C virtual TBool Matches(MSenServiceDescription& aPattern);
+        IMPORT_C virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet);
+        IMPORT_C virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo);
+        IMPORT_C virtual TInt AddFacetL(const CSenFacet& aFacet);
+        IMPORT_C virtual TInt SetFacetL(const CSenFacet& aFacet);
+        IMPORT_C virtual TInt RemoveFacet(const TDesC8& aURI);
+        IMPORT_C virtual TInt FacetsL(RFacetArray& aFacetArray);
+        IMPORT_C virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
+
+        // from MSenRemoteServiceSession
+        IMPORT_C virtual TBool IsReadyL(); // This method equals with isValid() in Java ref-impl
+        IMPORT_C virtual TInt CompleteServerMessagesOnOffL(const TBool& aCompleteOnOff);
+
+        // from CSenWSDescription (overrides)
+        virtual void SetContractL(const TDesC8& aContract) = 0;
+        virtual void SetEndPointL(const TDesC8& aEndPoint) = 0;
+        virtual TPtrC8 FrameworkVersion() = 0;
+
+        // implement the MSenRemoteServiceSession:
+        IMPORT_C virtual TPtrC8 Endpoint();
+        IMPORT_C virtual TPtrC8 Contract();
+        IMPORT_C TPtrC8 FrameworkId();
+
+        IMPORT_C virtual MSenRemoteServiceConsumer* RemoteConsumerL(const TDesC8& aSenderID);
+        IMPORT_C virtual void WriteExtensionsAsXMLToL(RWriteStream& aWriteStream);
+
+        IMPORT_C MSenServiceDescription::TDescriptionClassType DescriptionClassType();
+        IMPORT_C MSenServiceDescription& AsServiceDescription();
+        
+        IMPORT_C void SetTransportL(CSenTransportBase* aTransport);
+        IMPORT_C MSenTransport* Transport() const;
+        IMPORT_C MSenTransport& TransportL(MSenRemoteServiceConsumer& aRequestor);
+
+        // Destructor
+        IMPORT_C virtual ~CSenServiceSession();
+
+
+        // From MSenServiceSession:
+        virtual TInt SendToConsumerL(HBufC8* apMessage,
+                                     const TInt aTxnId,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     MSenProperties* aResponseTransportProperties = NULL) = 0; 
+
+        virtual TInt SendErrorToConsumerL(const TInt aErrorCode,
+                                          HBufC8* apError,
+                                          const TInt aTxnId,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          MSenProperties* aResponseTransportProperties = NULL) = 0; 
+
+
+        /**
+        * In addition of meeting the MSenServiceSession interface, service session
+        * extends this method to be available for the sessions (frameworks) themselves:
+        * any session class implementation should override this method in order to 
+        * provide a possibility for the service invocation framework to recover from 
+        * particular (SOAP and other) errors.
+        *
+        * @param aErrorCode is the error code identifying this error
+        * @param aError is the error message - actual response from service
+        * @param aConsumer is the consumer of the service. It could
+        * be CSenClientSession or some subclass of CSenInternalConsumer
+        * (like in Liberty ID-WSF it could be authentication service client
+        * or discovery service client).
+        * @param aTxnId is the transaction id of this async responsed error.
+        * @param aResponseTransportProperties includes the response properties
+        * from transport
+        * @return KErrNone if error message was successfully delivered to 
+        *         consumer(s). Otherwise, some system-wide error code.
+        */
+        
+        virtual TInt HandleErrorL(const TInt aErrorCode,
+                                  HBufC8* apError,
+                                  const TInt aTxnId,
+                                  MSenRemoteServiceConsumer& aConsumer,
+                                  MSenProperties* aResponseTransportProperties = NULL) = 0; 
+
+
+
+        // from MSenRemoteHostlet:
+
+        IMPORT_C TInt SetHostletL(MSenRemoteHostlet* aHostlet);
+        IMPORT_C MSenRemoteHostlet* Hostlet() const;
+        
+        // From MSenServiceSession:
+        IMPORT_C virtual TInt SendToHostletL(MSenRemoteHostlet& aReceiver,
+                                             const TDesC8& aMessage,
+                                             const TInt aTxnId,
+                                             MSenRemoteServiceConsumer& aFrom,
+                                             MSenProperties* aProperties);
+         
+        IMPORT_C virtual TInt ProvideHostletResponseL( MSenRemoteHostlet& aProvider,
+                                                       const TInt aTxnId,
+                                                       const TInt aServiceCode,
+                                                       const TDesC8& aRecipientsConsumerId,
+                                                       CSenChunk& aMessageChunk );
+                                                      
+        // From CSenWSDescription:
+        IMPORT_C virtual TBool HasSuperClass( TDescriptionClassType aType );
+        IMPORT_C virtual TInt SetTransportCueL(const TDesC8& aCue);
+        IMPORT_C virtual TPtrC8 TransportCue();
+//new
+        IMPORT_C virtual TInt RefreshMTL(HBufC8*& aRevalidationError);
+    protected: 
+    
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenServiceSession(TDescriptionClassType aType, MSIF& aFramework);
+        
+        /**
+        * BaseConstructL is made available for subclasses, since they should call
+        * it in their own ConstructL or BaseConstructL method.
+        */
+        IMPORT_C void BaseConstructL();
+
+        // Filelogging method:
+        IMPORT_C RFileLogger* Log() const;
+        
+        /**
+        * Note that this non-virtual method allows subclasses to notify about following
+        * *pre-state* kind of status codes ONLY (from SenServiceConnection.h):
+        *
+        * const TInt KSenConnectionStatusAuthentication       =   3; // pre-state
+        * const TInt KSenConnectionStatusDiscovery            =   4; // pre-state
+        * const TInt KSenConnectionStatusMetadataExchange     =   5; // pre-state
+        *
+        * In other words, this method cannot be used in credential state notfications (valid / expired).
+        */
+        //void SendStatusToConsumersL(const TInt aStatus);
+        TInt                    iStatus;
+
+    protected: // Data
+        MSIF&                   iFramework;     // Not owned
+        RServiceConsumerArray   iConsumerList;  
+        MSenRemoteHostlet*      ipHostlet;      // Not owned
+
+    private: // Data
+        //TInt                    iStatus;
+        RFacetArray             iFacets;        // Owned 
+        CSenTransportBase*      ipTransport;     // Owned
+        TBool                   iTransportOwned;
+    };
+
+#endif // SEN_SERVICE_SESSION_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sensessioncontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Each application that connects WS-stack through client-server
+*                interface has an application context of it's own, which can
+*                hold a list for active connections and service sessions, 
+*                acting as a common place holder and bridge between the
+*                smaller (contexts) that those contain. Class allows 
+*                application-wide information to be shared efficiently
+*                at proper layer.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SESSION_CONTEXT_H
+#define SEN_SESSION_CONTEXT_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+//#include "SenContext.h"
+#include "senpointermap.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class CSenSessionContext : public CBase // CSenContext
+    {
+    public:
+        /**
+        * Standard 2-phased constructor
+        * @return pointer to new application context.
+        */ 
+        IMPORT_C static  CSenSessionContext* NewL();
+        /**
+        * Standard 2-phased constructor 
+        * @return pointer to new application context,
+        * which is left on cleanupstack.
+        */ 
+        IMPORT_C static  CSenSessionContext* NewLC();
+
+        // Destructor:
+        IMPORT_C virtual ~CSenSessionContext();
+        
+        // New methods:
+        
+    protected:
+        IMPORT_C  CSenSessionContext();
+                                     
+        IMPORT_C void BaseConstructL();
+
+    private: 
+    };
+
+#endif // SEN_SESSION_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sensessionhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECOM interface for Handler plug-in implementation
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SESSION_HANDLER_H
+#define SEN_SESSION_HANDLER_H
+
+// INCLUDES
+#include <ecom/ecom.h>
+
+#include "senhandlerbase.h"     // internal Framework\inc
+#include "msenhandlercontext.h" // internal Framework\inc
+#include "msensessioncontext.h" // internal Framework\inc
+
+// CLASS DECLARATION
+
+/**
+* Custom ECOM interface definition. This interface is used by
+* clients to find specific handler plugins which implement 
+* pure virtual functions defined in MSenTranport interface.
+*/
+class CSenSessionHandler : public CSenHandlerBase
+    {
+    public:
+        
+        // Constructors and destructor:
+
+        /**
+        * Wraps ECom object instantiation, which returns the
+        * default ECOM implementation for this interface.
+        * Note: This is not a "normal" NewL method, since 
+        * normally NewL methods are only defined for concrete
+        * classes. Note that the implementations of this interface
+        * also provide NewL methods.
+        * 
+        * Additionally, this static constructor performs InitL()
+        * using the provided handler context for the newly allocated
+        * handler instance.
+        *
+        * @param aCtx is handle to the handler specific context
+        */
+        static CSenSessionHandler* NewL(MSenHandlerContext& aCtx);
+
+        /**
+        * Wraps ECom object instantitation, which returns the
+        * interface implementation matching to given aCue,
+        * IMPLEMENTATION_INFO::default_data.
+        * For details, see EcomSIFDefinition.inl comments.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface 
+        * also provide NewL methods. 
+        *
+        * Additionally, this static constructor performs InitL()
+        * using the provided handler context for the newly allocated
+        * handler instance.
+        *
+        * @param aCue is the "name" of the requested implementation.
+        *             Implementations advertise their cue as specified
+        *             in their resource file field
+        * @param aCtx is handle to the handler specific context
+        */
+        static CSenSessionHandler* NewL(const TDesC8& aCue,
+                                        MSenHandlerContext& aCtx);
+        /**
+        * Destructor.
+        */
+        virtual ~CSenSessionHandler();
+
+        // From MSenHandler:
+        /**
+        * Method is used to resolve concrete type (class)
+        * for this handler instance.
+        * 
+        * @return the class type of this handler
+        */
+        inline SenHandler::THandlerType Type() const;        
+        /**
+        * Method is used to resolve real, system-wide
+        * unique name for this handler. By default, this
+        * typically returns the ECOM cue (default_data)
+        * of the concrete plug-in instance.
+        * 
+        * @return the unique name of this handler
+        */
+        inline TPtrC8 Name() const;        
+        
+
+        // New functions:
+        
+        /**
+        * InvokeL is the most emergent method in message handler interface.
+        * Each sub-class must implement this method thus providing message
+        * processing routine.
+        * 
+        * @param aCtx is the session context that will be accessed and 
+        * typically altered by implemented handler, in order to provide
+        * modifications on the layer of the session construction, validation,
+        * or some other, focused area that the handler was intended to take
+        * responsibility for. For example, certain handler can itself create
+        * a session of its own, send message(s) to (authentication) service
+        * (invoking other handlers), and finally access session context in 
+        * order to update credentials. One example of such session handler
+        * could be WS-TRUST client type handler, an "internal service consumer".
+        * @return KErrNone or some WSF specific, or system-wide error code
+        */
+        virtual TInt InvokeL(MSenSessionContext& aCtx) = 0;
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        * 
+        * @param aCtx is handle to the handler specific context
+        */
+        CSenSessionHandler(MSenHandlerContext& aCtx);
+
+    protected: // Data
+        MSenHandlerContext& iHandlerContext;    
+
+    private: // Data
+        /** 
+        * Instance identifier key. When instance of an implementation is created 
+        * by ECOM framework, the framework will assign UID for it. 
+        * The UID is used in destructor to notify framework that this instance is
+        * being destroyed and resources can be released.
+        */
+        TUid iDtor_ID_Key;
+        
+        HBufC8* iName;
+    };
+
+// This includes the implementation of the instantiation functions and destructor
+#include "sensessionhandler.inl"
+
+#endif // SEN_SESSION_HANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sensessionhandler.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Inlines for the Handler ECOM plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concrete plug-in
+// implementation.
+//
+// Instantiates the default message handler plug-in
+inline CSenSessionHandler* CSenSessionHandler::NewL(MSenHandlerContext& aCtx)
+    {
+    const TUid KSenDefaultSessionHandlerPluginUid = {0x20000395};
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aCtx);
+
+    // Find implementation behind KTestHandlerPluginUid
+    TAny* intf = REComSession::CreateImplementationL(KSenDefaultSessionHandlerPluginUid, 
+                                                     _FOFF (CSenSessionHandler, 
+                                                     iDtor_ID_Key), 
+                                                     constructorParameters);
+
+    if(intf)
+        {
+        _LIT8(KSenDefaultSessionHandlerPluginName, "urn:com.nokia.serene:handlers:session:default");
+        CSenSessionHandler* handler = reinterpret_cast <CSenSessionHandler*> (intf);
+        CleanupStack::PushL(handler);
+        handler->iName = KSenDefaultSessionHandlerPluginName().AllocL();
+        handler->InitL(aCtx);
+        CleanupStack::Pop(); // handler
+        }
+
+    return reinterpret_cast <CSenSessionHandler*> (intf);
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concret plug-in
+// implementation.
+inline CSenSessionHandler* CSenSessionHandler::NewL(const TDesC8& aCue, 
+                                                    MSenHandlerContext& aCtx)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    const TUid KSenSessionHandlerInterfaceUid = {0x20000392};
+#else
+    const TUid KSenSessionHandlerInterfaceUid = {0x10282C5B};
+#endif    
+
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aCue);
+    resolverParams.SetWildcardMatch(EFalse);
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(&aCtx);
+
+    // Find implementation for our interface.
+    // - KCSenSessionHandlerInterfaceUid is the UID of Handler ECOM interface.
+    // - This call will leave, if the plugin architecture cannot find
+    //   implementation.
+    // - The returned pointer points to one of our interface implementation
+    //   instances.
+    TAny* intf = REComSession::CreateImplementationL(KSenSessionHandlerInterfaceUid ,
+                                                     _FOFF (CSenSessionHandler, 
+                                                     iDtor_ID_Key), 
+                                                     constructorParameters, 
+                                                     resolverParams); 
+
+    if(intf)
+        {
+        CSenSessionHandler* handler = reinterpret_cast <CSenSessionHandler*> (intf);
+        CleanupStack::PushL(handler);
+        handler->iName = aCue.AllocL();
+        handler->InitL(aCtx);
+        CleanupStack::Pop(); // handler
+        }
+    return reinterpret_cast<CSenSessionHandler*> (intf);
+    }
+
+
+// Interface's (abstract base class's) destructor
+inline CSenSessionHandler::~CSenSessionHandler()
+    {
+    // Any member data must be released here. 
+    delete iName; 
+
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation(iDtor_ID_Key);
+    }
+
+inline CSenSessionHandler::CSenSessionHandler(MSenHandlerContext& aCtx)
+        :iHandlerContext(aCtx)        
+        {
+        }
+
+inline SenHandler::THandlerType CSenSessionHandler::Type() const
+    {
+    return SenHandler::ESessionHandler;
+    }
+
+inline TPtrC8 CSenSessionHandler::Name() const
+    {
+    if(iName)
+        return *iName;
+    else
+        return KNullDesC8();
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sensyncrequester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           The class for submitting synchronous requests via call
+*                to asynchronous SendL of a certain MSenTransport instance
+*                and making the ActiveScheduler to wait until a response
+*                callback is received from the transport (typically a server
+*                for certain networking stack).
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_SYNC_REQUESTER_H
+#define SEN_SYNC_REQUESTER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+#include "msenservicesession.h"
+#include "msenremoteserviceconsumer.h"
+#include "MSenProperties.h"
+
+// FORWARD DECLARATIONS
+class MSenServiceSession;
+class MSenRemoteServiceConsumer;
+class MSenCoreServiceManager;
+class MSenTransport;
+class CSenGuidGen;
+class MSenRemoteHostlet;
+class MSenProperties;
+// CLASS DECLARATION
+
+/**
+ * The class for submitting requests in a synchronous
+ * *manner* using the async SendL implementation offered
+ * by given MSenTransport reference.
+ *
+ * Any transport plug-in developer may wish to use this
+ * class to implement SubmitL of her transport, using
+ * the SendL method implementation of that transport.
+ * In most of the cases, that is the most beneficial
+ * way to implement SubmitL, blocking the caller's 
+ * ActiveScheduler execution until a response is 
+ * received.
+ *
+ * One can take a look of LocalTransportPlugin implementation
+ * and use it as a reference of how this synchronous requester
+ * class can be implemented.
+ */
+class CSenSyncRequester : public CBase,
+                          public MSenServiceSession,
+                          public MSenRemoteServiceConsumer
+    {
+    public:
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CSenSyncRequester* NewL(MSenTransport& aTransport,
+                                                MSenCoreServiceManager& iServiceManager);
+
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CSenSyncRequester* NewLC(MSenTransport& aTransport,
+                                                 MSenCoreServiceManager& iServiceManager);
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C virtual ~CSenSyncRequester();
+
+
+        /**
+         * Submit a synchronous HTTP POST request to a given URI using
+         * the - asynchronous - SendL method of the MSenTransport that
+         * this class is "wrapping". Any transport plugin, which wishes
+         * to implement SubmitL by calling and waiting SendL to complete,
+         * can use this method to implement their synchronous SubmitL
+         * function.
+         *
+         * @param aRequestUri service endpoint (URI) for the outgoing message.
+         * @param aMessage outgoing message content.
+         * @param aRequestTransportProperties outgoing message properties
+         * @param aResponseContent incoming response message (content).
+         * @param aStatusCode the status code of the response message,
+         *        indicating whether or not an error occurred
+         * @return a transaction id of the "wrapped" SendL, which is performed
+         *         inside this method, or error code, negative integer, if
+         *         sending of the message fails.
+         */
+        virtual TInt SubmitL(const TDesC8& aEndpointUri,
+                     const TDesC8& aMessage,
+                     const TDesC8& aRequestTransportProperties,
+                     HBufC8*& apResponseTo);
+
+        // Functions from base classes
+    
+        /**
+        *   from MSenServiceSession
+        */
+    
+        virtual TInt SendToConsumerL(HBufC8* apMessage,
+                                     const TInt aTxnId,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     MSenProperties* aResponseTransportProperties = NULL);
+
+        virtual TInt SendErrorToConsumerL(const TInt aErrorCode,
+                                          HBufC8* apError,
+                                          const TInt aTxnId,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          MSenProperties* aResponseTransportProperties = NULL);  
+
+        virtual TInt HandleErrorL(const TInt aErrorCode,
+                                  HBufC8* apError,
+                                  const TInt aTxnId,
+                                  MSenRemoteServiceConsumer& aConsumer,
+                                  MSenProperties* aResponseTransportProperties = NULL);
+        /**
+        *   from MSenRemoteServiceConsumer
+        */
+        virtual const TDesC8& Id() const;
+        virtual TInt SetSessionL(MSenRemoteServiceSession& aServiceSession);
+        virtual TInt HandleMessageL(HBufC8* apMessage,
+                                    const TInt aTxnId,
+                                    MSenProperties* aResponseTransportProperties);
+
+        virtual TInt HandleErrorL(HBufC8* aError,
+                                  const TInt aErrorCode,
+                                  const TInt aTxnId,
+                                  MSenProperties* aResponseTransportProperties);
+
+         virtual void SetStatusL(const TInt aStatus);
+         virtual MSenTransport& TransportL();
+         virtual CSenIdentifier& Identifier() const;  
+         virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
+         virtual MSenRemoteHostlet* CSenSyncRequester::Hostlet() const;
+
+         virtual TInt SendToHostletL(MSenRemoteHostlet& aReceiver,
+                                     const TDesC8& aMessage,
+                                     const TInt aTxnId,
+                                     MSenRemoteServiceConsumer& aFrom,
+                                     MSenProperties* aProperties = NULL);
+        virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress);
+		virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails); 	
+    protected:
+        IMPORT_C CSenSyncRequester(MSenTransport& aTransport, 
+                                   MSenCoreServiceManager& iServiceManager);
+                          
+        IMPORT_C void BaseConstructL();
+
+    private:  // Data
+        MSenTransport& iTransport;
+        MSenCoreServiceManager& iServiceManager; // for GUID generation API access etc
+        CActiveSchedulerWait iSchedulerWait;
+
+        CSenIdentifier* ipIdentifier;   // owned
+        HBufC8* ipConsumerId;           // owned
+        HBufC8* ipResponse;             // owned
+        HBufC8* ipResponseProperties;   // owned, contains properties of the response
+        MSenProperties::TSenPropertiesClassType         iResponsePropertiesType;
+        TInt iStatusCode;               // contains KErrNone or some error
+    };
+
+#endif //SEN_SYNC_REQUESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sentransport.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Defines the ECOM interface for Transport plug-in implementation
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_TRANSPORT_H
+#define SEN_TRANSPORT_H
+
+// INCLUDES
+#include <ecom/ecom.h>
+
+#include "sentransportbase.h"
+#include "sentransportcontext.h"
+
+// CLASS DECLARATION
+
+/**
+* Custom ECOM interface definition. This interface is used by
+* clients to find specific transport plugins which implement 
+* pure virtual functions defined in MSenTranport interface.
+*/
+class CSenTransport : public CSenTransportBase
+    {
+    enum TPanic
+        {
+        ETransportCtxNotInitialized = 1
+        };
+
+    public: // Constructors and destructor
+
+        /**
+        * Wraps ECom object instantiation, which returns the
+        * default interface implementation.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface
+        * also provide NewL methods.
+        * @param apCtx is the context, which ownership IS transferred
+        * to this new transport plug-in instance
+        * @return a pointer to new transport plug-in, 
+        */
+        static CSenTransport* NewL(CSenTransportContext* apCtx);
+
+        //static CSenTransport* NewL(MSenCoreServiceManager& aManager);
+
+        /**
+        * Wraps ECom object instantitation, which returns the
+        * interface implementation matching to given aCue.
+        * IMPLEMENTATION_INFO::default_data.
+        * For details, see EcomSIFDefinition.inl comments.
+        * Note: This is not a "normal" NewL method, since normally NewL
+        * methods are only defined for concrete classes.
+        * Note that the implementations of this interface 
+        * also provide NewL methods. 
+        *
+        * @param: aCue is the "name" of the requested implementation.
+        *              Implementations advertise their cue as specified
+        *              in their resource file field
+        * @param apCtx is the context, which ownership IS transferred
+        * to this new transport plug-in instance
+        * @return a pointer to new transport plug-in, which is left
+        *  on cleanup stack.
+        */
+        static CSenTransport* NewL(const TDesC8& aCue,
+                                   CSenTransportContext* apCtx);
+        //static CSenTransport* NewL(const TDesC8& aCue,
+        //                           MSenCoreServiceManager& aManager);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenTransport();
+
+        // New functions
+        
+        // the actual security mechanism interface methods
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenTransport(CSenTransportContext* apCtx, TBool aSessionOwned = ETrue);
+
+        MSenTransportContext& Context();
+
+    protected: // Data
+        CSenTransportContext* ipCtx;     // owned
+
+    private: // Data
+        /** 
+        * Instance identifier key. When instance of an implementation is created 
+        * by ECOM framework, the framework will assign UID for it. 
+        * The UID is used in destructor to notify framework that this instance is
+      * being destroyed and resources can be released.
+      */
+        TUid iDtor_ID_Key;
+    };
+
+// This includes the implementation of the instantiation functions and destructor
+#include "sentransport.inl"
+
+#endif // SEN_TRANSPORT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sentransport.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Inlines for the Transport ECOM plug-ins
+*
+*/
+
+
+
+
+
+
+
+
+namespace
+    {
+    _LIT(KPanic, "SenTransport");
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concrete plugin
+// implementation.
+//
+// Instantiates the default WSF transport: HTTP Channel plug-in
+inline CSenTransport* CSenTransport::NewL(CSenTransportContext* apCtx)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TUid KHttpChannelTransportPluginUid = {0x10274C74};
+#else
+    const TUid KHttpChannelTransportPluginUid = {0x101F974A};
+#endif
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(apCtx);
+
+    // Find implementation behind KHttpChannelTransportPluginUid
+    TAny* intf = REComSession::CreateImplementationL(KHttpChannelTransportPluginUid, 
+                                                     _FOFF (CSenTransport, 
+                                                     iDtor_ID_Key), 
+                                                     constructorParameters);
+
+
+    return reinterpret_cast <CSenTransport*> (intf);
+    }
+
+// Interface's (abstract base class's) static factory method implementation.
+// Asks ECOM plugin framework to instantiate appropriate concret plugin
+// implementation.
+inline CSenTransport* CSenTransport::NewL(const TDesC8& aCue, 
+                                          CSenTransportContext* apCtx)
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TUid KCSenTransportInterfaceUid = {0x10274C72};
+#else
+    const TUid KCSenTransportInterfaceUid = {0x101F9749};
+#endif
+
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aCue);
+    resolverParams.SetWildcardMatch(EFalse);
+
+    TAny* constructorParameters = reinterpret_cast<TAny*>(apCtx);
+
+    // Find implementation for our interface.
+    // - KCSenTransportInterfaceUid is the UID of Transport ECOM plugin.
+    // - This call will leave, if the plugin architecture cannot find
+    //   implementation.
+    // - The returned pointer points to one of our interface implementation
+    //   instances.
+    TAny* intf = REComSession::CreateImplementationL (KCSenTransportInterfaceUid,
+                                                      _FOFF (CSenTransport, 
+                                                      iDtor_ID_Key), 
+                                                      constructorParameters, 
+                                                      resolverParams); 
+
+    return reinterpret_cast<CSenTransport*> (intf);
+    }
+
+
+// Interface's (abstract base class's) destructor
+inline CSenTransport::~CSenTransport()
+    {
+    // If in the NewL some memory is reserved for member data, it must be
+    // released here.
+    delete ipCtx;
+    ipCtx = NULL;
+
+    // Inform the ECOM framework that this specific instance of the
+    // interface has been destroyed.
+    REComSession::DestroyedImplementation(iDtor_ID_Key);
+    }
+
+inline CSenTransport::CSenTransport(CSenTransportContext* apCtx,
+        TBool aSessionOwned):
+        CSenTransportBase(aSessionOwned), ipCtx(apCtx)
+        {
+        }
+
+inline MSenTransportContext& CSenTransport::Context()
+    {
+    __ASSERT_ALWAYS(ipCtx != NULL, User::Panic(KPanic, ETransportCtxNotInitialized));
+
+    return *ipCtx;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sentransportbase.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Abstract class providing CBase 
+*                functionality in top of MSenTransport
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_TRANSPORT_BASE_H
+#define SEN_TRANSPORT_BASE_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h> // for CActive
+#include "msentransport.h"
+
+/**
+* This base class makes it possible to create a "Transport Factory",
+* which may produce instancies of different CSenTransportBase subclasses.
+* It might be useful to be able to create both ECOM and non-ECOM versions
+* of transports, if such factory pattern is further utilized.
+*/
+
+// CLASS DECLARATION
+
+class CSenTransportBase : public CBase, public MSenTransport
+    {
+    public:
+        inline virtual ~CSenTransportBase() { };
+        CSenTransportBase(TBool aSessionOwned): iSessionOwned(aSessionOwned) 
+            {
+            }
+        TBool SessionOwned() 
+            {
+            return iSessionOwned;
+            }
+
+    private:
+        TBool iSessionOwned;
+    };
+
+#endif // SEN_TRANSPORT_BASE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/sentransportcontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_TRANSPORT_CONTEXT_H
+#define SEN_TRANSPORT_CONTEXT_H
+
+
+// INCLUDES
+#include <e32std.h>
+
+#include "msentransportcontext.h"
+#include "senpointermap.h"
+#include "sencontext.h"
+
+// FORWARD DECLARE
+class MSenCoreServiceManager;
+class CSenWSDescription;
+class CSenServiceSession;
+class CSenContextItem;
+
+// TYPE DEFS
+typedef RSenPointerMap<TDesC8, CSenContextItem> RCtxItemMap;
+
+// CLASS DECLARATION
+/**
+* This is the abstract super class for all WSF context iten classes, 
+* providing generic interface for resolving context item type, and
+* equal properties.
+*/
+class CSenTransportContext : public CSenContext, public MSenTransportContext
+    {
+    public:
+        
+        /**
+        * Standard 2-phased constructor
+        * @param aCore provides reference to to core, which is stored into
+        * this transport context. There is only single core instance in WS-stack.
+        * @param aSessionInitializer is the XML service description used to 
+        * initialize the connection (HC or SC) to the core.
+        * @return pointer to new transport context
+        */ 
+        IMPORT_C static CSenTransportContext* NewL(MSenCoreServiceManager& aCore,
+                                                   CSenWSDescription& aSessionInitializer);
+        /**
+        * Standard 2-phased constructor
+        * @param aCore provides reference to to core, which is stored into
+        * this transport context. There is only single core instance in WS-stack.
+        * @param aSessionInitializer is the XML service description used to 
+        * initialize the connection (HC or SC) to the core.
+        * @return pointer to new transport context, which is left on cleanup stack.
+        */ 
+        IMPORT_C static CSenTransportContext* NewLC(MSenCoreServiceManager& aCore,
+                                                    CSenWSDescription& aSessionInitializer);
+
+        /**
+        * Standard 2-phased constructor
+        * @param aCore provides reference to to core, which is stored into
+        * this transport context. There is only single core instance in WS-stack.
+        * @param aSessionInitializer is the XML service description used to 
+        * initialize the connection (HC or SC) to the core.
+        * @param aInvoker is the session which is about to create new transport plug-in 
+        * instance, into which this transport context is utilized.
+        * @return pointer to new transport context
+        */ 
+        IMPORT_C static CSenTransportContext* NewL(MSenCoreServiceManager& aCore,
+                                                   CSenWSDescription& aSessionInitializer,
+                                                   CSenServiceSession& aInvoker);
+        /**
+        * Standard 2-phased constructor
+        * @param aCore provides reference to to core, which is stored into
+        * this transport context. There is only single core instance in WS-stack.
+        * @param aSessionInitializer is the XML service description used to 
+        * initialize the connection (HC or SC) to the core.
+        * @param aInvoker is the session which is about to create new transport plug-in 
+        * instance, into which this transport context is utilized.
+        * @return pointer to new transport context, which is left on cleanup stack.
+        */ 
+        IMPORT_C static CSenTransportContext* NewLC(MSenCoreServiceManager& aCore,
+                                                    CSenWSDescription& aSessionInitializer,
+                                                    CSenServiceSession& aInvoker);
+
+        // Destructor:
+        IMPORT_C virtual ~CSenTransportContext();
+
+        // From MSenTransportContext:
+        // virtual TInt AddCore(MSenCoreServiceManager& aValue);
+        virtual MSenCoreServiceManager& GetCoreL();
+        //virtual MSenCoreServiceManager* GetCore();
+        //virtual TInt AddSession(CSenServiceSession* aValue); 
+        //virtual TInt UpdateSession(CSenServiceSession* aValue);
+        virtual const CSenServiceSession* GetSession();
+        //CSenServiceSession& GetSessionL();
+        // virtual TInt AddInitializer(CSenWSDescription* aValue);
+        // virtual TInt UpdateInitializer(CSenWSDescription* aValue);
+        virtual CSenWSDescription& GetInitializerL();
+        
+        //virtual const CSenWSDescription* GetInitializer();
+        //virtual TInt AddServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue);
+        //virtual TInt UpdateServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue);
+        //virtual const CSenWSDescription* GetServiceDescriptionL(const TDesC8& aKey);
+        //virtual TInt Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue); // protected context
+        //virtual TInt Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue);
+        //virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey);
+
+        // From MSenContext:
+        virtual SenContext::TContextType Type() const;        
+    	virtual SenContext::TContextDirection Direction() const;
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue);
+        virtual TAny* GetAnyL(const TDesC8& aKey);	//codescannerwarnings
+        virtual const CSenXmlReader* GetParser();
+
+        virtual TInt Remove(const TDesC8& aKey);     	
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset();
+        
+        virtual TInt SetDirection( SenContext::TContextDirection aDirection );
+
+        
+    protected:
+        IMPORT_C CSenTransportContext();
+        IMPORT_C void BaseConstructL(MSenCoreServiceManager& aCore,
+                                     CSenWSDescription& aSessionInitializer,
+                                     CSenServiceSession* apInvoker);
+    };
+
+#endif // SEN_TRANSPORT_CONTEXT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senwebservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,312 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_WEB_SERVICE_SESSION_H
+#define SEN_WEB_SERVICE_SESSION_H
+
+//  INCLUDES
+#include "senservicesession.h"
+#include "seninternalcredential.h"
+
+// FORWARD DECLARATIONS
+class MSenServiceConsumer;
+class MServiceDescription;
+class CSenCredential;
+class CSenSoapMessage;
+
+// CLASS DECLARATION
+class CSenWebServiceSession : public CSenServiceSession,
+                              public MSenCredentialObserver
+    {
+    public: // Destructor
+        IMPORT_C virtual ~CSenWebServiceSession();
+
+        // New functions
+        IMPORT_C virtual TInt InitializeFromL(MSenServiceDescription& aServiceDescription);
+
+        /**
+        * Computes the status of this session (checks the credentials).
+        * @return the status code, one of the following:
+        * 
+        */
+        IMPORT_C virtual TInt ComputeStatusL();
+
+        /*
+        * Computes the status of this session and returns the status.
+        * @return ETrue, if this session is expired and has invalid credentials
+        *         EFalse, if this session is is ready and has valid credentials
+        */
+        IMPORT_C virtual TBool IsExpiredL(); // Remove, not called from anywhere
+
+        IMPORT_C virtual TInt AddCredentialL(CSenCredential& aCredential);
+        IMPORT_C virtual TInt ConstructSecurityTokenL(CSenCredential& aCredential,
+                                                      HBufC8*& aToken);
+
+        IMPORT_C virtual TInt NewMessageL(CSenSoapMessage*& aMessage);
+        IMPORT_C virtual TInt MessageForSendingL(const TDesC8& aBody,
+                                                 const TDesC8& aSenderID,
+                                                 CSenSoapMessage*& aMessage);
+
+        IMPORT_C virtual TInt ParseResponseL(const TDesC8& aResponse,
+                                             HBufC8*& aParsed);
+
+
+        IMPORT_C virtual CSenXmlReader* XmlReader();
+        IMPORT_C virtual TInt ParseResponseL(const TDesC8& aResponse,
+                                         CSenSoapMessage*& aMessage);
+
+        IMPORT_C virtual TInt ParseMessageL(CSenSoapMessage& aSOAPMessage);
+
+        /**
+        * Adds a consumer. Takes ownership!
+        * @return KErrNone if no errors, otherwise some system-wide errorcode
+        */
+        IMPORT_C virtual TInt AddConsumerL(MSenRemoteServiceConsumer& aConsumer);
+        IMPORT_C virtual MSenRemoteServiceConsumer* Consumer();
+
+        /**
+        * Return an array in which the consumers (clients) of this ServiceSession
+        * reside. This method is called from within several other methods of the
+        * abstract ServiceSession class.
+        * This method should be implemented by a subclass
+        * specific to a ServiceInvocationFramework implementation.
+        * @param    aConsumers  List of the current consumers. Owned by
+        *           ServiceSession.
+        * Ownership of the aConsumers is NOT transfered to the caller
+        * @return TInt - a KErrNone or error
+        */
+        IMPORT_C virtual TInt Consumers(RServiceConsumerArray& aConsumers) const;
+
+        IMPORT_C virtual TInt SubmitL(const TDesC8& aMessage,
+                                      const TDesC8& aTransportProperties,
+                                      MSenRemoteServiceConsumer& aConsumer,
+                                      HBufC8*& aResponse);
+
+        IMPORT_C virtual TInt SendL( const TDesC8& aMessage, 
+                                     const TDesC8& aTransportProperties,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     TInt& aTxnId,
+                                     HBufC8*& aRevalidationError );
+
+
+        IMPORT_C virtual TInt SubmitSoapL(const TDesC8& aSoapMessage, 
+                                          const TDesC8& aTransportProperties,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          HBufC8*& aResponse);
+
+        IMPORT_C virtual TInt SendSoapL( const TDesC8& aSoapMessage, 
+                                         const TDesC8& aTransportProperties,
+                                         MSenRemoteServiceConsumer& aConsumer,
+                                         TInt& aTxnId,
+                                         HBufC8*& aRevalidationError );
+
+        /**
+        * Method checks if this session is ready to interact with (remote)
+        * service. Typically, if service invocation framework requires 
+        * credentials, they are checked inside this method.
+        * @return boolean indicating if this session is ready (ETrue) or
+        *         not (EFalse) to interact with (possibly remote) service.
+        */
+        IMPORT_C virtual TBool IsReadyL();
+
+        // SOAP processing callback functions:
+        IMPORT_C virtual TInt SendSoapMessageToConsumerL( CSenSoapMessage* apMessage,
+                                                          const TInt aTxnId,
+                                                          MSenRemoteServiceConsumer& aConsumer,
+                                                          MSenProperties* aResponseTransportProperties );
+
+        /**
+        * This synchronous method (pair for SubmitL) checks if the service 
+        * invocation framework (this session) can handle this fault, and 
+        * if not, then an attempt is made to delivered this fault to session
+        * consumer.
+        *
+        * @param aSoapMessage is the SOAP message representing fault.
+        * @param aResponse is where either SOAP fault OR - if some
+        * framework (like ID-WSF) was able to handle this fault (recover)
+        *        - the valid response from the service, achieved
+        *        by re-submitted request (for example to new endpoint,
+        *        if the handled fault was "endpoint moved" -type fault.
+        * @param aResponseTransportProperties will contain the properties of
+        * handled error (either for fault OR valid response -transaction)
+        *        
+        * 
+        * @return KErrSenSoapFault, if this error (fault) could not be handled.
+        *         In this case, aResponse contains (extracted) SOAP fault
+        *         element.
+        *         KErrNone, if recovery was possible and successful, and
+        *                   then aResponse contains valid response from 
+        *                   the service. The SOAP fault, which was taken
+        *                   care here - between (remote) service and
+        *                   framework - remains thus "hidden" from actual 
+        *                   web service consumer.
+        *         KErrSenSoapFault, if fault could not be handled. Now
+        *                   aResponse will contain the extracted SOAP
+        *                   fault element as UTF-8 descriptor (TDesC8)
+        *         KErrSenInternal, the SOAP fault could not be found from
+        *                   aSoapMessage.
+        *         KErrNotFound - the consumer could not be found.
+        */
+        IMPORT_C virtual TInt HandleSoapFaultL(CSenSoapMessage* apSoapMessage,
+                                               HBufC8*& aResponse /*,
+                                               CSenTransportProperties*& aResponseTransportProperties */);
+       
+        /**
+        * This asynchronous method (pair for SendL) checks if the service 
+        * invocation framework (this session) can handle this fault, and 
+        * if not, then an attempt is made to delivered this fault to 
+        * session consumer.
+        *
+        * @param aSoapMessage is the SOAP message representing fault.
+        * @param aErrorCode, is the error code received from transport
+        * @param aTxnId is the transaaction id from transport, which 
+        *        can be used to map this error response to consumer's 
+        *        request.
+        * @param aConsumer is the consumer which was calling the transport
+        *        and originally sent the request.
+        * @param aResponseTransportProperties includes response properties
+        * for the handled error
+        * @return KErrNone, if error was either succesfully handled or
+        *         processed (delivered to consumer) The SOAP fault, which 
+        *         was taken care between (remote) service and ID-WSF framework
+        *         is hereby "hidden" from actual web service consumer.
+        */
+        IMPORT_C virtual TInt HandleSoapFaultL(CSenSoapMessage* apSoapMessage,
+                                           const TInt aErrorCode,
+                                           const TInt aTxnID,
+                                           MSenRemoteServiceConsumer& aConsumer,
+                                           MSenProperties* aResponseTransportProperties);
+
+
+        // From MSenServiceSession:
+        IMPORT_C TInt SendToConsumerL(HBufC8* aMessage,
+                                      const TInt aTxnId,
+                                      MSenRemoteServiceConsumer& aConsumer,
+                                      MSenProperties* aResponseTransportProperties = NULL); 
+
+        IMPORT_C TInt SendErrorToConsumerL(const TInt aErrorCode,
+                                           HBufC8* apError,
+                                           const TInt aTxnId,
+                                           MSenRemoteServiceConsumer& aConsumer,
+                                           MSenProperties* aResponseTransportProperties = NULL); 
+
+        IMPORT_C TInt HandleErrorL(const TInt aErrorCode,
+                                   HBufC8* apError,
+                                   const TInt aTxnId,
+                                   MSenRemoteServiceConsumer& aConsumer,
+                                   MSenProperties* aResponseTransportProperties = NULL); 
+
+        IMPORT_C virtual TInt SendToHostletL(MSenRemoteHostlet& aReceiver,
+                                             const TDesC8& aMessage,
+                                             const TInt aTxnId,
+                                             MSenRemoteServiceConsumer& aFrom,
+                                             MSenProperties* aProperties);
+
+        IMPORT_C virtual TInt ProvideHostletResponseL( MSenRemoteHostlet& aProvider,
+                                                       const TInt aTxnId,
+                                                       const TInt aServiceCode,
+                                                       const TDesC8& aRecipientsConsumerId,
+                                                       CSenChunk& aMessageChunk );
+
+        IMPORT_C virtual void SetFrameworkHeadersL(CSenSoapMessage& aMsg);
+        IMPORT_C virtual TInt SetUserNameL(TDesC8& aUsername);
+
+        IMPORT_C virtual TPtrC8 Endpoint();
+        IMPORT_C virtual TPtrC8 Contract();
+        IMPORT_C virtual TPtrC8 FrameworkId();
+        IMPORT_C virtual TPtrC8 FrameworkVersion();
+        IMPORT_C virtual const TTime& ValidUntilL();
+        IMPORT_C virtual void SetContractL(const TDesC8& aContract);
+        IMPORT_C virtual void SetEndPointL(const TDesC8& aURI);
+        IMPORT_C virtual void SetSecurityL(const TDesC8& aSecurity);
+        IMPORT_C virtual void SetCredentialPtrL(RSenCredentialPtr aCredentialPtr);	//codescannerwarnings
+        IMPORT_C virtual void FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier);
+        IMPORT_C virtual void StartTransaction();
+        IMPORT_C virtual void TransactionCompleted();
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+        IMPORT_C virtual TTimeIntervalMicroSeconds ClientServerInterval();
+        IMPORT_C virtual void SetClientServerIntervalL(TTimeIntervalMicroSeconds aInterval);	//codescannerwarnings
+        IMPORT_C TBool HasConsumer() const;
+
+        
+        // From CSenWSDescription:
+        IMPORT_C virtual TBool HasSuperClass( TDescriptionClassType aType );
+        IMPORT_C virtual TInt SetTransportCueL(const TDesC8& aCue);
+        IMPORT_C virtual TPtrC8 TransportCue();
+
+        IMPORT_C TInt TryToSearchValidCredentialL();	//codescannerwarnings
+        
+        IMPORT_C virtual void CredentialChanged(TSenCredentialChange aChange, TAny* aPointer);
+        
+        // from MSenRemoteServiceSession
+//        IMPORT_C TInt RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer);
+
+        IMPORT_C TInt GetCredentialIdL();
+        
+        IMPORT_C TInt AddCredentialObserverL(CSenInternalCredential& aCredential);
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenWebServiceSession( TDescriptionClassType aType,
+                                        MSIF& aFramework);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */                              
+        IMPORT_C void ConstructL();
+    
+        IMPORT_C HBufC8* SecurityL();
+        
+        IMPORT_C TBool HasSecurity();
+        
+        void SetCredentialIdL(TInt aCredentialId);	//codescannerwarnings
+        
+    private:
+        TInt HandleBodyWithoutParsingL(CSenSoapMessage& aMessage, const TDesC8& aResponse);
+    
+    protected: // Data
+        TTimeIntervalMicroSeconds iClientServerInterval;
+
+         // Data, which also subclasses can access
+        TTime iValidUntil;
+        
+        RSenCredentialPtr  iCredentialPtr;
+        HBufC8* iTransportCue; 
+
+    private: // Data
+        HBufC8* iEndpoint;
+        HBufC8* iContract;
+        HBufC8* iFrameworkId;
+       
+
+        // credentials as xml
+        HBufC8* iSecurity;
+    };
+
+#endif // SEN_WEB_SERVICE_SESSION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senwsdescription.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,312 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements the most common value object used in WSF,
+*                which is used to  describe some invocable service.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_WS_DESCRIPTION_H
+#define SEN_WS_DESCRIPTION_H
+
+//  INCLUDES
+#include "SenXmlServiceDescription.h"
+
+/*
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenWSDescription : public CSenXmlServiceDescription
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Standard 2 phase constructor
+        * @return a pointer to a new CSenWSDescription instance.
+        */
+        IMPORT_C static CSenWSDescription* NewL();
+
+        /**
+        * Standard 2 phase constructor
+        * @return a pointer to a new CSenWSDescription instance,
+        *        which is left on cleanup stack.
+        */
+        IMPORT_C static CSenWSDescription* NewLC();
+
+        /**
+        * Standard 2 phase constructor
+        * @param aNamespaceURI namespace URI for the service description.
+        * @return a pointer to a new CSenWSDescription instance
+        */
+        IMPORT_C static CSenWSDescription* NewL(const TDesC8& aNamespaceURI);
+
+        /**
+        * Standard 2 phase constructor
+        * @param aNamespaceURI namespace URI for the service description.
+        * @return a pointer to a new CSenWSDescription instance,
+        *        which is left on cleanup stack.
+        */
+        IMPORT_C static CSenWSDescription* NewLC(const TDesC8& aNamespaceURI);
+
+        /**
+        * Standard 2 phase constructors
+        * @param aEndpoint the service endpoint. Note that endpoint cannot
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type.
+        * @return a pointer to a new CSenWSDescription instance
+        */
+        IMPORT_C static CSenWSDescription* NewL(const TDesC8& aEndPoint,
+                                                        const TDesC8& aContract);
+
+        /**
+        * Standard 2 phase constructors
+        * @param aEndpoint the service endpoint. Note that endpoint cannot
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type.
+        * @return a pointer to a new CSenWSDescription instance,
+        *        which is left on cleanup stack.
+        */
+        IMPORT_C static CSenWSDescription* NewLC(const TDesC8& aEndPoint,
+                                                         const TDesC8& aContract);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenWSDescription();
+
+        // New functions
+        /**
+        * Method returns ETrue if the primary keys of this service description
+        * are equal. Definition of primary keys varies on concrete implementations.
+        *
+        * In a typical XML sub class implementation the primary keys are Contract
+        * and Endpoint elements.
+        *
+        * Difference to Match() method is that primary keys - often descriptors -
+        * MUST be equal both in this service description and in aCandidate, unlike
+        * in Match(), where argument is more like wildcard pattern matching even
+        * in cases where it includes fewer fields (less information).
+        *
+        * @since Series60
+        * @param    aCandidate is a service description, which primary keys are
+        *           checked in this comparison.
+        *
+        * @return TBool ETrue if primary keys are equal, EFalse otherwise.
+        */
+        IMPORT_C virtual TBool HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate);
+
+        /*
+        * Method checks specific pieces of information to determine, whether this
+        * service description is local or not. Typically this is defined by the
+        * endpoint's scheme, which is KSenTransportSchemeLocal in most of the cases,
+        * when this method returns true.
+        * @return boolean indicating whether this endpoint is local or not.
+        */
+        IMPORT_C virtual TBool IsLocalL(); 
+
+
+        /*
+        * Method for binding transport plug-in type with the endpoint in question.
+        * Function adds/sets XML attribute called "cue" for <Endpoint> element:
+        *
+        *  <ServiceDescription>
+        *    <Endpoint cue="com.nokia.wsf.transport.plugin.hostlet">
+        *      urn:nokia.com.test.hostlet
+        *    </Endpoint>
+        *  </ServiceDescription>
+        *
+        * In above example, eventhough endpoint scheme "local://" would normally
+        * invoke different type of plug-in, the "cue" attribute overrides this, and
+        * forces hostlet transport plugin to be loaded.
+        *
+        * Transport plug-in types (cues):
+        *
+        *    _LIT8(KSenTransportCueHTTP,              "com.nokia.wsf.transport.plugin.httpchannel");
+        *    _LIT8(KSenTransportCueVirtualTCP,        ""); 
+        *    _LIT8(KSenTransportCueLocalEcom,         "com.nokia.wsf.transport.plugin.local");
+        *    _LIT8(KSenTransportCueHostletConnection, "com.nokia.wsf.transport.plugin.hostlet");
+        *
+        *
+        * Note that this method does not attempt to load the plug-in - it might not
+        * even exist in the system. Neither is this attribute checked when XML service
+        * description is parsed. As a conclusion, if non-existant plug-ins are bind
+        * to endpoints, they will be ignored, and the transport is created in normal
+        * way and plug-in is chosen based on endpoint scheme and/or defaults.
+        *
+        * @param aTransportCue is the ECOM cue of CSenTransport implementation.
+        * @return KErrNone on success
+        *         KErrSenNoEndpoint, if actual endpoint element does not exist
+        *
+        */
+        IMPORT_C virtual TInt SetTransportCueL(const TDesC8& aTransportCue);
+
+
+        /**
+        * Getter for transport cue, assuming that attribute has been set,
+        * and that has "cue" -attribute.
+        * @return transport plug-in ECOM cue, or KNullDesC8, if it has
+        * not been set in this service description.
+        */
+        IMPORT_C virtual TPtrC8 TransportCue();
+
+        /**
+        * Method provides convenient way to ensure up-casting of a subclass instance,
+        * when it is seen via CSenWSDescription handle.
+        * Each subclass has to implement this method.
+        * @return boolean indicating whether the class in question has a super class
+        * of requested type. ETrue is returned if any super class up in the inheritance
+        * chain has mathing parent, via recursion. Method returns EFalse, if none of the
+        * classes in the inheritance chain derives from requested type.
+        */
+        IMPORT_C virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+        /**
+        * Getter for (web) service policy
+        * @return pointer to service policy, or NULL, if it is not available
+        */
+        IMPORT_C virtual MSenServicePolicy* ServicePolicy();
+
+        /**
+        * Method provides convenient way to add a new value in Client Policy
+        * This method will add attributes such as <SOAP12> or <UsernameTokenOverTLS>
+        * in the Policy to be used by stack. Infact this method adds a new element
+        * in xml representation of ServicePolicy.
+        * @param aName is the Name of the attribute.
+        * @return KErrNone on success, KErrArgument if any of the arguments
+        * (descriptors) is of zero-length, or one of the system-wide
+        * error codes otherwise.
+        */
+        IMPORT_C virtual TInt SetPolicyL(const TDesC8& aName);
+
+        /**
+        * Method provides convenient way to add a new value in Client Policy
+        * This method will add attributes such as <Addressing>
+        * in the Policy to be used by stack. Infact this method adds a new element
+        * in xml representation of ServicePolicy and adds its value as contents of the element.
+        * <Addressing>http://schemas.xmlsoap.org/ws/2004/03/addressing</Addressing>
+        * @param aName is the Name of the Policy attribute.
+        * @param aValue is the Contents of the Policy attribute.
+        * @return KErrNone on success, KErrArgument if any of the arguments
+        * (descriptors) is of zero-length, or one of the system-wide
+        * error codes otherwise.
+        */
+
+        IMPORT_C virtual TInt SetPolicyL(const TDesC8& aName, const TDesC8& aValue);
+        /**
+        * Method provides convenient way to add a new value in Client Policy
+        * This method will add attributes such as <Addressing>
+        * in the Policy to be used by stack. Infact this method adds a new element
+        * in xml representation of ServicePolicy and adds its value as contents of the element.
+        * <MetadataEndpoint method = "GET">http://www.mypolicyendpoint.com/policy2/</MetadataEndpoint>
+        * @param aName is the Name of the Policy attribute.
+        * @param aValue is the Contents of the Policy attribute.
+        * @param aAttribName is the Name of the attribute in element aName
+        * @param aAttribValue is the Contents of the aAttribName attribute.
+        * @return KErrNone on success, KErrArgument if any of the arguments
+        * (descriptors) is of zero-length, or one of the system-wide
+        * error codes otherwise.
+        */
+
+        IMPORT_C virtual TInt SetPolicyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aAttribName, const TDesC8& aAttribValue);
+
+        /**
+        * Setter for (identity) provider ID
+        * @since Series60 5.0
+        * @param aProviderID the unique identifier of the (identity) provider
+        * @return KErrNone on success, KErrArgument if aProviderID is of zero-length,
+        * or one of the system-wide Symbian error codes otherwise.
+        */
+        IMPORT_C virtual TInt SetProviderIdL( const TDesC8& aProviderID );
+
+        /**
+        * Getter for (identity) provider ID
+        * @since Series60 5.0
+        * @return the (locally) unique identifier of the (identity) provider
+        * @return KErrNone on success, KErrArgument if aProviderID is of zero-length,
+        * or one of the system-wide Symbian error codes otherwise.
+        */
+        IMPORT_C TPtrC8 ProviderId();
+
+        /**
+        * Setter for userinfo attribute, which determinates whether the username
+        * - password notifier dialog is shown to end-user or not, when authentication
+        * fails (due wrong, or incomplete userinfo).
+        * @param aPromptUserInfoMode
+        *  EFalse dictates that an error must be returned when creating
+        *         a service connection and userinfo is not accepted by
+        *         (remote) authentication, instead of showing the dialog.
+        *  ETrue (or if attribute does not exist in this XML SD) means that
+        *         end-user should be prompted (default behaviour). The number
+        *         of retry attempts (each showing a dialog) is service invocation
+        *         framework spesific; typically 3 retries are permitted.
+        */
+        IMPORT_C void SetPromptUserInfoL( TBool aPromptUserInfoMode );
+
+        /**
+        * Getter for current userinfo mode (attribute).
+        * @return Boolean that indicates the mode:
+        *  EFalse means that end-user prompts (notifier dialogs) have been
+        *  explicitely surpressed, and thus will not be shown to end-user:
+        *  attribute value is exactly as follows: "false"
+        *  ETrue means that attribute does not exist (default), or it has ANY OTHER
+        *  value, but NOT "false"
+        */
+        IMPORT_C TBool PromptUserInfo();
+
+    protected:  // New functions
+
+        /**
+        * C++ default constructor.
+        * @param aType enumeration defining the type of this class.
+        */
+        IMPORT_C CSenWSDescription(TDescriptionClassType aType);
+
+	public:
+		/**
+        * Sets the SNAP ID.
+        * @param aSnapId  A Snap ID
+        */
+	   	IMPORT_C virtual void SetSnapIdL(TUint32 aSnapId); 
+		/**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+       IMPORT_C virtual TInt SnapId(TUint32& aCurrentSnapId); 	
+
+    private: // Data
+        CSenServicePolicy* 	iServicePolicy;
+    };
+
+#endif // SEN_WS_DESCRIPTION_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/senwspattern.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,234 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class derives the XML service description and further extends
+*                it by adding consumer policy interface implementation.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_PATTERN_H
+#define SEN_SERVICE_PATTERN_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include "senwsdescription.h"
+#include <MSenConsumerPolicy.h>
+
+// FORWARD DECLARATIONS
+class CSenConsumerPolicy;
+
+// CLASS DECLARATION
+
+/**
+* Class derives the WS description and further extends
+* it by implementing consumer policy interface.
+*
+* WS pattern is typically used by Basic Web Service consumers,
+* which often know, which policy to use in the communication with
+* certain Web Service Provider (WSP).
+*
+* For example, a Basic Web Service consumer application might want
+* strictly define certain Internet Access Point (IAP) to be used when
+* initializing new service connection. Such an application can simply
+* instantiate new WSPattern and set pre-known IAP ID into it.
+*
+* The main purpose of this class is to simplify the initialization
+* of service connections for Basic Web Services.
+*
+* It is important to note, that all the consumer policy information entered
+* via WSPattern extending the MSenConsumerPolicy is treated
+* in "policy-per-client" terms. In other words, any consumer
+* policy information will not be stored for latter use of other
+* applications (even they might happen to use same WSP and contract!).
+*
+* This is due the nature of Service Pattern: it acts as a consumer
+* originated filter, after which a service will be resolved.
+*
+* Any service which "meets" the Service Pattern "constraints", is
+* considered as a "match", because such service accepts this
+* (search) pattern.
+*
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenWSPattern : public CSenWSDescription, public MSenConsumerPolicy
+
+    {
+    public:  // Constructors and destructor
+
+        /**
+         *  Standard 2 phase constructors
+         */
+        IMPORT_C static CSenWSPattern* NewL();
+
+        /**
+         *  Standard 2 phase constructors
+         */
+        IMPORT_C static CSenWSPattern* NewLC();
+
+        /**
+         *  Standard 2 phase constructor
+         *  @param aNamespaceURI    namespace URI for the service pattern.
+         */
+        IMPORT_C static CSenWSPattern* NewL(const TDesC8& aNamespaceURI);
+
+        /**
+         *  Standard 2 phase constructor
+         *  @param aNamespaceURI    namespace URI for the service pattern.
+         */
+        IMPORT_C static CSenWSPattern* NewLC(const TDesC8& aNamespaceURI);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aEndPoint    service pattern endpoint.
+         *  @param aContract    service pattern contract.
+         */
+        IMPORT_C static CSenWSPattern* NewL(   const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract );
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aEndPoint    service pattern endpoint.
+         *  @param aContract    service pattern contract.
+         */
+        IMPORT_C static CSenWSPattern* NewLC(  const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenWSPattern();
+
+        // New functions
+
+        /**
+        * Convenience method for writing out the consumer policy as XML
+        * in UTF-8 form.
+        * @since Series60 3.0
+        * @return consumer policy as UTF-8 form XML.
+        */
+        IMPORT_C HBufC8* ConsumerPolicyAsXmlL();
+
+        // Functions from base classes
+
+        // From CSenWSDescription
+
+        /**
+        * Compares that both service description and possible
+        * policy inside of it matches with this instance.
+        * @since Series60 3.0
+        * @param aPattern   the service description to compare to
+        * @return ETrue both service description and policy information
+        *         matches, otherwise EFalse. If some value is not set
+        *         in current instance, it is not compared.
+        */
+        IMPORT_C TBool Matches(MSenServiceDescription& aWSPattern);
+
+        /**
+        * Callback function which implements the XML content handler interface.
+        * Parses the consumer policies independently.
+        * @since Series60 3.0
+        * @param aNsUri         The namespace URI of the new element
+        * @param aLocalName     The local name of the new element
+        * @param aQName         The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C void StartElementL(const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName,
+                                    const RAttributeArray& aAttributes);
+
+        // From MSenConsumerPolicy
+        IMPORT_C virtual void SetConsumerIapIdL(TUint32 aIapId);
+        IMPORT_C virtual TInt ConsumerIapId(TUint32& aCurrentIapId);
+        IMPORT_C virtual void SetConsumerIdentityProviderIdsL(
+                                    CSenIdentityProviderIdArray8& aList);
+
+        IMPORT_C virtual TInt AddConsumerIdentityProviderIdL(
+                                                        const TDesC8& aProviderId);
+
+        IMPORT_C virtual const CSenIdentityProviderIdArray8&
+                                                ConsumerIdentityProviderIds8L();
+
+        IMPORT_C virtual TBool AcceptsConsumerPolicy(
+                                            MSenConsumerPolicy& aPolicyPattern);
+
+        IMPORT_C virtual TInt RebuildFromConsumerPolicy(
+                                                    MSenConsumerPolicy& aTemplate);
+
+        IMPORT_C virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+    protected:  // New functions
+
+        /**
+        * C++ constructor.
+        * @since Series60 3.0
+        * @param aType enumeration defininng the type of this class.
+        */
+        IMPORT_C CSenWSPattern(
+                            MSenServiceDescription::TDescriptionClassType aType);
+
+        /**
+        * Base constructor offered to sub class implementations.
+        * @since Series60 3.0
+        */
+        IMPORT_C void BaseConstructL();
+
+        /**
+        * Base constructor offered to sub class implementations.
+        * @since Series60 3.0
+        * @param aNamespaceURI the localname for XML element representation
+        *        of this class.
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNamespaceURI);
+
+        /**
+        * Base constructor offered to sub class implementations.
+        * @since Series60 3.0
+        * @param aEndPoint is the actual endpoint to the service
+        * @param aContract of the service, typically some URI
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aEndPoint, const TDesC8& aContract);
+
+	public:
+		/**
+        * Sets the Consumer SNAP ID.
+        * @param aSnapId  A TUint32 consumer SNAP ID
+        */
+        IMPORT_C virtual void SetConsumerSnapIdL(TUint32 aSnapId);
+		/**
+        * Gets the Consumer SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt ConsumerSnapId(TUint32& aCurrentSnapId);
+		
+    protected:  // Data
+
+        // Consumer policy class instance, used as a delegate in parsing
+        CSenConsumerPolicy* iConsumerPolicy;
+    };
+
+#endif SEN_SERVICE_PATTERN_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/inc/xmllocalnameconstants.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef XML_LOCALNAME_CONSTANTS_H
+#define XML_LOCALNAME_CONSTANTS_H
+
+_LIT8(KIdentityProvider8, "IdentityProvider"); 	
+_LIT8(KFakeIMEI8, "012345678901234");		
+_LIT8(KContract8, "urn:liberty:as:2004-04");		
+_LIT8(KImei, "IMEI");		
+_LIT8(KType, "type");		
+
+_LIT8(KAuthzID8, "AuthzID");		
+_LIT8(KAdvisoryAuthnID8, "AdvisoryAuthnID");				
+_LIT8(KPassword8, "Password");		
+_LIT8(KProviderID8, "ProviderID");		
+
+
+#endif XML_LOCALNAME_CONSTANTS_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/rom/wsframework.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSFRAMEWORK_IBY__
+#define __WSFRAMEWORK_IBY__
+
+// Framework
+file=ABI_DIR\BUILD_DIR\SenFramework.dll         PROGRAMS_DIR\SenFramework.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/saslmechanism.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "saslmechanism.h" 
+
+#include <SenIdentityProvider.h>
+
+EXPORT_C CSaslMechanism* CSaslMechanism::NewL()
+    {
+    CSaslMechanism* pNew = NewLC();
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSaslMechanism* CSaslMechanism::NewLC()
+    {
+    CSaslMechanism* pNew = new (ELeave) CSaslMechanism();
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSaslMechanism::CSaslMechanism()
+:   ipAccount(NULL),
+    ipIdentityManager(NULL)
+    {
+    }
+
+EXPORT_C CSaslMechanism::~CSaslMechanism()
+    {
+    iTransforms.ResetAndDestroy(); // were owned
+    }
+
+EXPORT_C void CSaslMechanism::ClearPasswordL()
+    {
+    //subclasses should implement this.
+    }
+
+EXPORT_C HBufC8* CSaslMechanism::Password8L()
+    {
+	HBufC8* pPassWd = NULL;
+	TSenAuthentication output;
+	TPckgBuf<TSenAuthentication> outputPair(output);
+	if(ipAccount)
+		{
+	    TInt error = ipIdentityManager->AuthenticationForL(*ipAccount, outputPair);
+	    if (error == KErrNone)
+		    {
+		    pPassWd = outputPair().iPassword.AllocL();
+		    }
+		}
+    return pPassWd;
+    }
+
+EXPORT_C void CSaslMechanism::InitFrom(CSaslMechanism aSaslMechanism)
+    {
+    ipIdentityManager = aSaslMechanism.ipIdentityManager;
+    ipAccount = aSaslMechanism.ipAccount;
+    iTransforms = aSaslMechanism.iTransforms;
+    }
+
+EXPORT_C HBufC8* CSaslMechanism::TransformL(TPtrC8 aPassphrase) const
+    {
+    HBufC8* pPassword = aPassphrase.AllocL();
+    HBufC8* pTransformed = NULL;
+    for(TInt i=0; i<iTransforms.Count(); i++)
+        {
+        if(pPassword)
+            {
+            CleanupStack::PushL(pPassword);
+            pTransformed = iTransforms[i]->TransformL(*pPassword);
+            CleanupStack::PopAndDestroy(); // pPassword
+            pPassword = pTransformed;
+            pTransformed = NULL;
+            }
+        }
+    return pPassword;
+    }
+
+EXPORT_C TInt CSaslMechanism::MaxAttempts()
+    {
+    return 0; // 0 means that the system default can be applied
+    }
+
+EXPORT_C void CSaslMechanism::SetIdentity(
+                                      CSenIdentityProvider* aIdentityProvider,
+                                      MSenIdentityManager* aIdentityManager)
+    {
+    ipIdentityManager = aIdentityManager;
+    ipAccount = aIdentityProvider;
+    }
+
+EXPORT_C TBool CSaslMechanism::IsPasswordFromUser()
+    {
+    return EFalse;
+    }
+
+EXPORT_C CSenIdentityProvider& CSaslMechanism::Account()
+    {
+    return *ipAccount;
+    }
+
+EXPORT_C void CSaslMechanism::SetTransforms(
+                        RPointerArray<CSenPasswordTransform> aList)
+    {
+    iTransforms = aList;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senapplicationcontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,506 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senapplicationcontext.h" 
+#include "senservercontext.h"
+#include "senclientcontext.h"
+#include "SenServiceConnection.h" // KErrSenInternal
+
+EXPORT_C CSenApplicationContext* CSenApplicationContext::NewL(TSecureId aSecureId,
+                                                              CSenServerContext& aServerContext)
+    {
+    CSenApplicationContext* pNew = CSenApplicationContext::NewLC(aSecureId, aServerContext);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenApplicationContext* CSenApplicationContext::NewLC(TSecureId aSecureId,
+                                                               CSenServerContext& aServerContext)
+    {
+    CSenApplicationContext* pNew = new (ELeave) CSenApplicationContext(aSecureId, aServerContext);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenApplicationContext::CSenApplicationContext(TSecureId aSecureId,
+                                                        CSenServerContext& aServerContext)
+:   iSecureId(aSecureId),
+    iServerContext(aServerContext),
+    iClients(ETrue, ETrue)
+    {
+    }
+
+EXPORT_C CSenApplicationContext::~CSenApplicationContext()
+    {
+    }
+       
+EXPORT_C void CSenApplicationContext::BaseConstructL()
+    {
+//    CSenContext::BaseConstructL();
+    }
+    
+CSenServerContext& CSenApplicationContext::ServerContext() const
+    {
+    return iServerContext;
+    }
+    
+TSecureId CSenApplicationContext::SecureId() const
+    {
+    return iSecureId;
+    }
+
+CSenClientContext& CSenApplicationContext::OpenClientContextL(TInt aClientId)
+    {
+    CSenClientContext* pCtx = NULL;
+    // Check if requested client context already exists, held by this server context
+    TInt index = iClients.Find( aClientId );
+    if ( index == KErrNotFound )
+        {
+        // New client context needs to be created
+        pCtx = CSenClientContext::NewLC(aClientId, *this );
+        TInt* pClientId = new (ELeave) TInt(aClientId);
+        TInt err = iClients.Append( pClientId, pCtx );
+        if( err )
+            {
+            // Append failed: cleanup and leave
+            delete pClientId; // de-alloc this orphan
+            CleanupStack::PopAndDestroy( pCtx );
+            User::Leave( err ); 
+            }
+        else
+            {
+            // Remove the new context from cleanup stack, 
+            // it is now owned by this application context
+            CleanupStack::Pop( pCtx );
+            }
+        }
+    else
+        {
+        // Return the existing client context
+        pCtx = (CSenClientContext*)iClients.ValueAt( index );
+        if( !pCtx )
+            {
+            // Should NOT occur: map failed => leave with internal error code
+            User::Leave( KErrSenInternal ); 
+            }
+        } 
+    return *pCtx;
+    }
+
+TInt CSenApplicationContext::CloseClientContext(const CSenClientContext& aCtx)
+    {
+    TInt retVal(KErrNotFound);
+    if ( aCtx.iSessions.Count() == 0 )
+        {
+        // Note: RemoveByKey returns KErrNotFound or index of removed item(!)
+        retVal = iClients.RemoveByKey( aCtx.ClientId() );
+        if( retVal != KErrNotFound )
+            {
+            retVal = KErrNone;
+            }
+        }
+    else
+        {
+        retVal = KErrInUse;
+        }
+    return retVal;
+    }
+
+// From MSenApplicationContext:
+/*
+SenContext::TContextType CSenApplicationContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+       
+SenContext::TContextDirection CSenApplicationContext::Direction() const
+    {
+    return CSenContext::Direction();
+    }
+       
+TInt CSenApplicationContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenApplicationContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TDesC8* CSenApplicationContext::GetDesC8L(const TDesC8& aKey)
+    {
+    return CSenContext::GetDesC8L( aKey );
+    }
+       
+TInt CSenApplicationContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenApplicationContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TInt* CSenApplicationContext::GetIntL(const TDesC8& aKey)
+    {
+    return CSenContext::GetIntL( aKey );
+    }
+       
+TInt CSenApplicationContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenApplicationContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const CSenElement* CSenApplicationContext::GetSenElementL(const TDesC8& aKey)
+    {
+    return CSenContext::GetSenElementL( aKey );
+    }
+       
+TInt CSenApplicationContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenApplicationContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+TAny* CSenApplicationContext::GetAny(const TDesC8& aKey)
+    {
+    return CSenContext::GetAny( aKey );
+    }
+       
+TInt CSenApplicationContext::Remove(const TDesC8& aKey) 
+    {
+    return CSenContext::Remove(aKey);
+    }
+
+TInt CSenApplicationContext::Count() const
+    {
+    return CSenContext::Count();
+    }
+
+TPtrC8 CSenApplicationContext::KeyAtL(TInt aIndex)
+    {
+    return CSenContext::KeyAtL(aIndex);
+    }
+
+void CSenApplicationContext::Reset()
+    {
+    CSenContext::Reset();
+    }
+    
+CSenSoapMessage* CSenApplicationContext::GetCurrentSoapMessage() // DEPRECATED: 
+    {
+    CSenSoapMessage* pSoapMessage = NULL;
+    
+    TInt index = iItems.Find( KSenCtxKeyCurrentSoapMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        pSoapMessage = &(pItem->ToSenSoapMessageL());
+        }
+    return pSoapMessage;
+    }
+    
+TPtrC8 CSenApplicationContext::GetMessage()
+    {
+    TInt index = iItems.Find( KSenCtxKeyCurrentMessageAsDesc );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const TDesC8* desc = pItem->ToDesC8L();
+        return *desc;
+        }
+    return KNullDesC8();
+    }
+    
+TInt CSenApplicationContext::Add(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );    
+    }
+    
+TInt CSenApplicationContext::Update(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+    
+const CSenSoapEnvelope* CSenApplicationContext::GetSenSoapEnvelopeL(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find( aKey );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const CSenSoapEnvelope* envelope = ((CSenSoapEnvelope*)&(pItem->ToSenSoapMessageL()));
+        return envelope;
+        }
+    return NULL;
+    }
+    
+MSenMessage* CSenApplicationContext::Message()
+    {
+    TInt index = iItems.Find( KSenCtxKeyMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((MSenMessage*)&(pItem->ToSenMessageL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenApplicationContext::SetMessage(MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyMessage(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+    
+CSenChunk* CSenApplicationContext::Chunk()
+    {
+    TInt index = iItems.Find( KSenCtxKeyChunk );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((CSenChunk*)&(pItem->ToSenChunkL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenApplicationContext::SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(apMsgAsChunk); )
+        }
+    else // chunk is not to be owned
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(*apMsgAsChunk); )
+        }
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyChunk(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+
+TInt CSenApplicationContext::SetProperties(MSenProperties* apProperties, TBool aOwned)
+    {
+    if( !apProperties )
+        {
+        return KErrArgument;
+        }
+        
+    TInt retCode(KErrNone);
+    if ( aOwned )
+        {
+        delete ipOwnedTp;
+        ipOwnedTp = NULL;
+        ipOwnedTp = apProperties;
+        }
+    else
+        {
+        
+        CSenContextItem* pItem = NULL;
+        TInt leaveCode(KErrNone);
+//        if( aOwned )
+//            {
+//            TRAP( leaveCode, pItem = CSenContextItem::NewL(apProperties); )
+//            }
+//        else // chunk is not to be owned
+//            {
+            TRAP( leaveCode, pItem = CSenContextItem::NewL(*apProperties); )
+//            }
+
+        if( leaveCode != KErrNone ) 
+            {
+            delete pItem; // should ALWAYS be NULL(!)
+            return leaveCode;
+            }
+            
+        retCode = iItems.UpdateValue(&KSenCtxKeyChunk(), pItem);
+        if( retCode != KErrNone && aOwned )
+            {
+            delete pItem; // delete the orphan item
+            } 
+        }
+    return retCode;
+    }
+
+
+MSenProperties* CSenApplicationContext::Properties()
+    {
+    if( ipOwnedTp )
+        {
+        return ipOwnedTp;
+        }
+    else
+        {
+        TInt index = iItems.Find( KSenCtxKeyMessageProperties );
+        if ( index != KErrNotFound )
+            {
+            const CSenContextItem* pItem = iItems.ValueAt(index);
+            if( pItem->Type() == MSenContextItem::EMSenProperties )
+                {
+                MSenProperties* pProperties = (MSenProperties*)pItem;
+                return pProperties;
+                }
+            }
+        return NULL;
+        }
+    }
+
+// Method for adding an "intermediate" message behind certain key; used normally to conduct final "service message"
+TInt CSenApplicationContext::Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+    
+// Method for updating some "intermediate" message behind certain key; used normally to conduct final "service message"    
+TInt CSenApplicationContext::Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem;
+        }
+    return retCode;    
+    }
+    
+// Method for getting "intermediate" message behind certain key; used normally to conduct final "service message"    
+MSenMessage* CSenApplicationContext::GetMessage(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if(pItem)
+            {
+            return &pItem->ToSenMessageL();
+            }
+        }
+    return NULL;    
+    }
+ 
+// private helper method(s):
+CSenContextItem* CSenApplicationContext::MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError)
+    {
+    aError = KErrNone;
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        if( apMessage->IsSafeToCast( MSenMessage::EMessageBase ) )
+            {
+            CSenMessageBase* msgBase = (CSenMessageBase*) apMessage;
+            TRAP( aError, pItem = CSenContextItem::NewL( msgBase ); )
+            }
+        else if ( apMessage->IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+            {
+            CSenSoapEnvelope2* msgSoap2 = (CSenSoapEnvelope2*) apMessage;
+            TRAP( aError,  pItem = CSenContextItem::NewL( msgSoap2 ); )
+            }
+        else 
+            {
+            aError = KErrNotSupported;
+            return NULL;
+            }
+        }
+    else // provided message is *not to be owned*
+        {
+        TRAP( aError, pItem = CSenContextItem::NewL(*apMessage); )
+        }
+    return pItem;        
+    } 
+    
+TInt CSenApplicationContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    CSenContext::SetDirection( aDirection );
+    return KErrNone;
+    }
+
+const CSenXmlReader* CSenApplicationContext::GetParser()
+    {
+    return CSenContext::GetParser();
+    }
+*/       
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senclientcontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,442 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senclientcontext.h"
+#include "senapplicationcontext.h" 
+#include "sensessioncontext.h"
+
+EXPORT_C CSenClientContext* CSenClientContext::NewL(TInt aClientId, 
+                                                    CSenApplicationContext& aCtx)
+    {
+    CSenClientContext* pNew = CSenClientContext::NewLC(aClientId, aCtx);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenClientContext* CSenClientContext::NewLC(TInt aClientId, 
+                                                     CSenApplicationContext& aCtx)
+    {
+    CSenClientContext* pNew = new (ELeave) CSenClientContext(aClientId, aCtx);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenClientContext::CSenClientContext(TInt aClientId, CSenApplicationContext& aCtx)
+:   iClientId(aClientId),
+    iApplicationContext(aCtx),
+    iSessions(ETrue, ETrue)
+    {
+    }
+
+EXPORT_C CSenClientContext::~CSenClientContext()
+    {
+    }
+       
+EXPORT_C void CSenClientContext::BaseConstructL()
+    {
+//    CSenContext::BaseConstructL();
+    }
+
+TInt CSenClientContext::ClientId() const
+    {
+    return iClientId;
+    }
+    
+// From MSenClientContext:
+/*
+SenContext::TContextType CSenClientContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+       
+SenContext::TContextDirection CSenClientContext::Direction() const
+    {
+    return CSenContext::Direction();
+    }
+       
+TInt CSenClientContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenClientContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TDesC8* CSenClientContext::GetDesC8L(const TDesC8& aKey)
+    {
+    return CSenContext::GetDesC8L( aKey );
+    }
+       
+TInt CSenClientContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenClientContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TInt* CSenClientContext::GetIntL(const TDesC8& aKey)
+    {
+    return CSenContext::GetIntL( aKey );
+    }
+       
+TInt CSenClientContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenClientContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const CSenElement* CSenClientContext::GetSenElementL(const TDesC8& aKey)
+    {
+    return CSenContext::GetSenElementL( aKey );
+    }
+       
+TInt CSenClientContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenClientContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+TAny* CSenClientContext::GetAny(const TDesC8& aKey)
+    {
+    return CSenContext::GetAny( aKey );
+    }
+       
+TInt CSenClientContext::Remove(const TDesC8& aKey) 
+    {
+    return CSenContext::Remove(aKey);
+    }
+
+TInt CSenClientContext::Count() const
+    {
+    return CSenContext::Count();
+    }
+
+TPtrC8 CSenClientContext::KeyAtL(TInt aIndex)
+    {
+    return CSenContext::KeyAtL(aIndex);
+    }
+
+void CSenClientContext::Reset()
+    {
+    CSenContext::Reset();
+    }
+    
+CSenSoapMessage* CSenClientContext::GetCurrentSoapMessage() // DEPRECATED: 
+    {
+    CSenSoapMessage* pSoapMessage = NULL;
+    
+    TInt index = iItems.Find( KSenCtxKeyCurrentSoapMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        pSoapMessage = &(pItem->ToSenSoapMessageL());
+        }
+    return pSoapMessage;
+    }
+    
+TPtrC8 CSenClientContext::GetMessage()
+    {
+    TInt index = iItems.Find( KSenCtxKeyCurrentMessageAsDesc );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const TDesC8* desc = pItem->ToDesC8L();
+        return *desc;
+        }
+    return KNullDesC8();
+    }
+    
+TInt CSenClientContext::Add(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );    
+    }
+    
+TInt CSenClientContext::Update(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+    
+const CSenSoapEnvelope* CSenClientContext::GetSenSoapEnvelopeL(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find( aKey );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const CSenSoapEnvelope* envelope = ((CSenSoapEnvelope*)&(pItem->ToSenSoapMessageL()));
+        return envelope;
+        }
+    return NULL;
+    }
+    
+MSenMessage* CSenClientContext::Message()
+    {
+    TInt index = iItems.Find( KSenCtxKeyMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((MSenMessage*)&(pItem->ToSenMessageL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenClientContext::SetMessage(MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyMessage(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+    
+CSenChunk* CSenClientContext::Chunk()
+    {
+    TInt index = iItems.Find( KSenCtxKeyChunk );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((CSenChunk*)&(pItem->ToSenChunkL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenClientContext::SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(apMsgAsChunk); )
+        }
+    else // chunk is not to be owned
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(*apMsgAsChunk); )
+        }
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyChunk(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+
+TInt CSenClientContext::SetProperties(MSenProperties* apProperties, TBool aOwned)
+    {
+    if( !apProperties )
+        {
+        return KErrArgument;
+        }
+        
+    TInt retCode(KErrNone);
+    if ( aOwned )
+        {
+        delete ipOwnedTp;
+        ipOwnedTp = NULL;
+        ipOwnedTp = apProperties;
+        }
+    else
+        {
+        
+        CSenContextItem* pItem = NULL;
+        TInt leaveCode(KErrNone);
+//        if( aOwned )
+//            {
+//            TRAP( leaveCode, pItem = CSenContextItem::NewL(apProperties); )
+//            }
+//        else // chunk is not to be owned
+//            {
+            TRAP( leaveCode, pItem = CSenContextItem::NewL(*apProperties); )
+//            }
+
+        if( leaveCode != KErrNone ) 
+            {
+            delete pItem; // should ALWAYS be NULL(!)
+            return leaveCode;
+            }
+            
+        retCode = iItems.UpdateValue(&KSenCtxKeyChunk(), pItem);
+        if( retCode != KErrNone && aOwned )
+            {
+            delete pItem; // delete the orphan item
+            } 
+        }
+    return retCode;
+    }
+
+
+MSenProperties* CSenClientContext::Properties()
+    {
+    if( ipOwnedTp )
+        {
+        return ipOwnedTp;
+        }
+    else
+        {
+        TInt index = iItems.Find( KSenCtxKeyMessageProperties );
+        if ( index != KErrNotFound )
+            {
+            const CSenContextItem* pItem = iItems.ValueAt(index);
+            if( pItem->Type() == MSenContextItem::EMSenProperties )
+                {
+                MSenProperties* pProperties = (MSenProperties*)pItem;
+                return pProperties;
+                }
+            }
+        return NULL;
+        }
+    }
+
+// Method for adding an "intermediate" message behind certain key; used normally to conduct final "service message"
+TInt CSenClientContext::Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+    
+// Method for updating some "intermediate" message behind certain key; used normally to conduct final "service message"    
+TInt CSenClientContext::Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem;
+        }
+    return retCode;    
+    }
+    
+// Method for getting "intermediate" message behind certain key; used normally to conduct final "service message"    
+MSenMessage* CSenClientContext::GetMessage(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if(pItem)
+            {
+            return &pItem->ToSenMessageL();
+            }
+        }
+    return NULL;    
+    }
+ 
+// private helper method(s):
+CSenContextItem* CSenClientContext::MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError)
+    {
+    aError = KErrNone;
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        if( apMessage->IsSafeToCast( MSenMessage::EMessageBase ) )
+            {
+            CSenMessageBase* msgBase = (CSenMessageBase*) apMessage;
+            TRAP( aError, pItem = CSenContextItem::NewL( msgBase ); )
+            }
+        else if ( apMessage->IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+            {
+            CSenSoapEnvelope2* msgSoap2 = (CSenSoapEnvelope2*) apMessage;
+            TRAP( aError,  pItem = CSenContextItem::NewL( msgSoap2 ); )
+            }
+        else 
+            {
+            aError = KErrNotSupported;
+            return NULL;
+            }
+        }
+    else // provided message is *not to be owned*
+        {
+        TRAP( aError, pItem = CSenContextItem::NewL(*apMessage); )
+        }
+    return pItem;        
+    } 
+    
+TInt CSenClientContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    CSenContext::SetDirection( aDirection );
+    return KErrNone;
+    }
+
+const CSenXmlReader* CSenClientContext::GetParser()
+    {
+    return CSenContext::GetParser();
+    }
+*/       
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/sencontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sencontext.h" 
+#include "sencontextitem.h"
+#include "SenElement.h"
+#include "SenXmlReader.h"
+
+//#include "SenPointerMap.h" // internal: Utils\inc
+
+EXPORT_C CSenContext* CSenContext::NewL(SenContext::TContextDirection aDirection)
+    {
+    CSenContext* pNew = CSenContext::NewLC(aDirection);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenContext* CSenContext::NewLC(SenContext::TContextDirection aDirection)
+    {
+    CSenContext* pNew = new (ELeave) CSenContext(aDirection);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenContext::CSenContext(SenContext::TContextDirection aDirection)
+:  iItems( EFalse, ETrue ),
+   iDirection( aDirection )
+    {
+    }
+
+EXPORT_C CSenContext::~CSenContext()
+    {
+    iItems.Reset();
+    }
+       
+EXPORT_C void CSenContext::BaseConstructL()
+    {
+    }
+
+// From MSenContext:
+SenContext::TContextType CSenContext::Type() const
+    {
+    return SenContext::EContextBase;
+    }
+       
+SenContext::TContextDirection CSenContext::Direction() const
+    {
+    return iDirection;
+    }
+       
+TInt CSenContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    CSenContextItem* pItem = NULL;
+    TInt leaveCode(KErrNone);
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+TInt CSenContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+const TDesC8* CSenContext::GetDesC8L(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if( pItem )
+            {
+            return pItem->ToDesC8L();
+            }
+        }
+    return NULL;
+    }
+       
+TInt CSenContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+TInt CSenContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+const TInt* CSenContext::GetIntL(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if(pItem)
+            {
+            return pItem->ToIntL();
+            }
+        }
+    return NULL;
+    }
+       
+TInt CSenContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+TInt CSenContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+const CSenElement* CSenContext::GetSenElementL(const TDesC8& aKey)
+    {
+    CSenElement* pElement = NULL;
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        pElement = &(pItem->ToSenElementL());
+        }
+    return pElement;
+    }
+       
+TInt CSenContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+TInt CSenContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = NULL;
+    TRAP( leaveCode, pItem = CSenContextItem::NewL(aValue); )
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+       
+TAny* CSenContext::GetAnyL(const TDesC8& aKey)	//codescannerwarnings
+    {
+    TAny* retVal = NULL;
+
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        retVal = pItem->ToAnyL();
+        }
+    return retVal;
+    }
+     
+TInt CSenContext::Remove(const TDesC8& aKey) 
+    {
+    return iItems.RemoveByKey(aKey);
+    }
+
+TInt CSenContext::Count() const
+    {
+    return iItems.Count();
+    }
+
+TPtrC8 CSenContext::KeyAtL(TInt aIndex)
+    {
+    return *iItems.KeyAt(aIndex);
+    }
+
+void CSenContext::Reset()
+    {
+    iItems.Reset();
+    }
+    
+TInt CSenContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    iDirection = aDirection;
+    return KErrNone;
+    }
+    
+const CSenXmlReader* CSenContext::GetParser()
+    {
+    return NULL; 
+    }
+    
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/sencontextitem.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,828 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sencontextitem.h" 
+
+
+#include "msencoreservicemanager.h"     // internal: Core\inc
+#include "msenremotehostlet.h"
+
+#include "SenXmlElement.h"              // Xml\inc
+#include "SenXmlReader.h"               // Xml\inc
+#include "senwsdescription.h"   // ServiceDescription\inc
+#include "SenHttpTransportProperties.h" // Utils\inc
+#include "senlayeredhttptransportproperties.h"
+
+#include "senmessagebase.h"
+#include "SenSoapMessage2.h"
+#include "senatomentry.h"
+#include "SenSoapMessage.h"
+
+#include "MSenMessage.h"
+
+#include "senchunk.h"
+
+// From MSenContextItem:
+MSenContextItem::TClass CSenContextItem::Type() const
+    { 
+    return MSenContextItem::EContextItem; 
+    }
+
+CSenContextItem::CSenContextItem(TAny* apData, MSenContextItem::TData aType, TInt* apFlags)
+: ipData(apData), iType(aType), ipFlags(apFlags) 
+// NOTE: currently only "flag" is ownership: **if ipFlags == NULL, data is owned**
+    {
+    }
+
+EXPORT_C CSenContextItem::~CSenContextItem()
+    {
+    if(ipFlags == NULL)
+        {
+        // Destroy the owned data
+        switch(iType)
+            {
+            case ETDesC8:
+                {
+                TDesC8* p = (TDesC8*) ipData;
+                delete p; 
+                ipData = NULL;
+                }
+                break;
+            case ETInt:
+                {
+                TInt* p = (TInt*) ipData;
+                delete p; 
+                ipData = NULL;
+                }
+                break;
+            case ETUint:
+                {
+                TUint* p = (TUint*) ipData;
+                delete p; 
+                ipData = NULL;
+                }
+                break;
+            case EMSenProperties:
+                {
+                MSenProperties* pM = (MSenProperties*) ipData;
+                MSenProperties::TSenPropertiesClassType t = pM->PropertiesClassType();
+                if( t == MSenProperties::ESenXmlProperties           ||
+                    t == MSenProperties::ESenTransportProperties     ||
+                    t == MSenProperties::ESenHttpTransportProperties ||
+                    t == MSenProperties::ESenVtcpTransportProperties )
+                    {
+                    CSenXmlProperties* p = (CSenXmlProperties*)ipData; 
+                    delete p;
+                    ipData = NULL;
+                    }
+                else if( t == MSenProperties::ESenLayeredXmlProperties          ||
+                         t == MSenProperties::ESenLayeredTransportProperties     ||
+                         t == MSenProperties::ESenLayeredHttpTransportProperties ||
+                         t == MSenProperties::ESenLayeredVtcpTransportProperties )
+                    {
+                    CSenLayeredXmlProperties* p = (CSenLayeredXmlProperties*)ipData; 
+                    delete p;
+                    ipData = NULL;
+                    }
+                }
+            case ECSenWSDescription:
+                {
+                CSenWSDescription* p = (CSenWSDescription*) ipData;
+                delete p;
+                ipData = NULL;
+                }
+                break;
+            case ECSenXmlReader:
+                {
+                CSenXmlReader* p = (CSenXmlReader*) ipData;
+                delete p;
+                ipData = NULL;
+                }
+                break;
+            case ECSenElement:
+                {
+                CSenElement* p = (CSenElement*) ipData;
+                delete p;
+                ipData = NULL;
+                }
+                break;
+            case ECSenSoapMessage:
+                    {
+                    CSenSoapEnvelope* p = (CSenSoapEnvelope*) ipData;
+                    delete p;
+                    ipData = NULL;
+                    }
+                break;
+            case ECSenSoapEnvelope2:
+                    {
+                    CSenSoapEnvelope2* p = (CSenSoapEnvelope2*) ipData;
+                    delete p;
+                    ipData = NULL;
+                    }
+                break;
+            case ECSenAtomMessage:
+                    {
+                    CSenAtomEntry* p = (CSenAtomEntry*) ipData;
+                    delete p;
+                    ipData = NULL;
+                    }
+                break;
+            case ECSenMessageBase:
+                    {
+                    CSenMessageBase* p = (CSenMessageBase*) ipData;
+                    delete p;
+                    ipData = NULL;
+                    }
+                break;
+            case ETAny: // delete void* is not defined(!)
+            case EMSenCoreServiceManager:
+            case EMSenRemoteServiceConsumer:
+            case EMSenRemoteHostlet:
+            case EMSenMessage:
+            default:
+                {
+                #ifdef _SENDEBUG
+                User::Panic(KErrUnknown, _LIT("~SenCtxItem"));
+                #endif
+                }
+            }
+        }
+    else delete ipFlags; // onlyg ipFlags were owned..
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(TAny* apNotOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apNotOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(TAny* apNotOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apNotOwned, MSenContextItem::ETAny, new (ELeave) TInt(1)); // not owned
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+/*
+EXPORT_C CSenContextItem* CSenContextItem::NewL(TAny* apValue, TBool aIsOwnedOrNot)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apValue, aIsOwnedOrNot);
+    // REMOVED, REASON: if owned: deleting of void* pointer is undefined => 
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(TAny* apValue, TBool aIsOwnedOrNot)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apValue, MSenContextItem::ETAny, aIsOwnedOrNot?NULL:(new (ELeave) TInt(1)));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+*/
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(const TDesC8& aRefToValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aRefToValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(const TDesC8& aRefToValue)
+    {
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&(TDesC8&)aRefToValue, MSenContextItem::ETDesC8, new (ELeave) TInt(1)); // not owned
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(TDesC8* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(TDesC8* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ETDesC8, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(const TInt apValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(const TInt apValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(new (ELeave) TInt(apValue), MSenContextItem::ETInt, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(TInt* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(TInt* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ETInt, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(const TUint aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(const TUint aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(new (ELeave) TUint(aValue), MSenContextItem::ETUint, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(TUint* apOwned)
+    {
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(TUint* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ETInt, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(MSenCoreServiceManager& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(MSenCoreServiceManager& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::EMSenCoreServiceManager, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(MSenRemoteServiceConsumer& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(MSenRemoteServiceConsumer& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::EMSenRemoteServiceConsumer, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(MSenRemoteHostlet& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(MSenRemoteHostlet& aValue)
+    {
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::EMSenRemoteHostlet, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenWSDescription& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenWSDescription& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::ECSenWSDescription, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenWSDescription* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenWSDescription* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenWSDescription, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenChunk& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenChunk& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::ECSenChunk, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenChunk* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenChunk* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenChunk, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenElement& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenElement& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::ECSenElement, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenElement* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenElement* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenElement, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenSoapMessage& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenSoapMessage& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::ECSenSoapMessage, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(MSenMessage& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(MSenMessage& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::EMSenMessage, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenSoapMessage* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenSoapMessage* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenSoapMessage, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+    
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenSoapEnvelope2* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenSoapEnvelope2* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenSoapEnvelope2, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }    
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenAtomEntry* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenAtomMessage, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }    
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenAtomEntry* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }    
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenMessageBase* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenMessageBase* apOwned)
+    { 
+    CSenContextItem* pNew = new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenMessageBase, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }  
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenXmlReader& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenXmlReader& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::ECSenXmlReader, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenXmlReader* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenXmlReader* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::ECSenXmlReader, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(MSenProperties& aValue)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(aValue);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(MSenProperties& aValue)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(&aValue, MSenContextItem::EMSenProperties, new (ELeave) TInt(1));
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenXmlProperties* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenXmlProperties* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::EMSenProperties, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewL(CSenLayeredXmlProperties* apOwned)
+    { 
+    CSenContextItem* pNew = CSenContextItem::NewLC(apOwned);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenContextItem* CSenContextItem::NewLC(CSenLayeredXmlProperties* apOwned)
+    { 
+    CSenContextItem* pNew = 
+        new (ELeave) CSenContextItem(apOwned, MSenContextItem::EMSenProperties, NULL);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+// New methods:
+TAny* CSenContextItem::ToAnyL() const
+    { 
+    if( iType != MSenContextItem::ETAny )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return ipData; 
+    }
+
+TPtrC8 CSenContextItem::ToPtrC8L() const
+    { 
+    if( iType != MSenContextItem::ETDesC8 )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    
+    return *((TDesC8*)ipData); 
+    }
+
+const TDesC8* CSenContextItem::ToDesC8L() const
+    { 
+    if( iType != MSenContextItem::ETDesC8 )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    
+    return (TDesC8*)ipData;
+    }
+
+
+const TInt* CSenContextItem::ToIntL() const
+    { 
+    if( iType != MSenContextItem::ETInt )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return (TInt*)ipData; 
+    }
+
+const TUint* CSenContextItem::ToUintL() const
+    { 
+    if( iType != MSenContextItem::ETInt )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return (TUint*)ipData; 
+    }
+
+MSenCoreServiceManager& CSenContextItem::ToSenCoreL() const
+    { 
+    if( iType != MSenContextItem::EMSenCoreServiceManager )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return *((MSenCoreServiceManager*)ipData); 
+    }
+    
+MSenRemoteServiceConsumer& CSenContextItem::ToSenRemoteConsumerL() const
+    { 
+    if( iType != MSenContextItem::EMSenRemoteServiceConsumer )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return *((MSenRemoteServiceConsumer*)ipData); 
+    }
+
+MSenRemoteHostlet& CSenContextItem::ToSenRemoteHostletL() const
+    { 
+    if( iType != MSenContextItem::EMSenRemoteHostlet )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return *((MSenRemoteHostlet*)ipData); 
+    }
+
+CSenWSDescription& CSenContextItem::ToSenServiceDescriptionL() const
+    { 
+    if(ipData)
+        {
+        if( iType == MSenContextItem::ECSenWSDescription )
+            {
+            CSenWSDescription* pDesc = (CSenWSDescription*) ipData;
+            if( pDesc->HasSuperClass( MSenServiceDescription::EWSDescription ) )
+                {
+                return *((CSenWSDescription*)ipData); 
+                }
+            else if ( pDesc->DescriptionClassType() == MSenServiceDescription::EWSDescription )
+                {
+                return *((CSenWSDescription*)ipData); 
+                }
+            }
+        }
+    User::Leave( KErrSenCtxItemTypeMismatch );
+    return *((CSenWSDescription*)ipData); 
+    }
+
+CSenServiceSession& CSenContextItem::ToSenServiceSessionL() const
+    { 
+    if(ipData) 
+        {
+        if( iType == MSenContextItem::ECSenWSDescription )
+            {
+            CSenWSDescription* pDesc = (CSenWSDescription*) ipData;
+            if( pDesc->HasSuperClass( MSenServiceDescription::EServiceSession ) )
+                {
+                return *((CSenServiceSession*)ipData); 
+                }
+            else if ( pDesc->DescriptionClassType() == MSenServiceDescription::EServiceSession )
+                {
+                return *((CSenServiceSession*)ipData);
+                }
+            }
+        }
+    User::Leave( KErrSenCtxItemTypeMismatch );
+    return *((CSenServiceSession*)ipData); 
+    }
+
+CSenXmlProperties& CSenContextItem::ToSenXmlPropertiesL() const
+    { 
+    if(ipData)
+        {
+        if( iType == MSenContextItem::EMSenProperties )
+            {
+            MSenProperties* pProp = (MSenProperties*) ipData;
+            MSenProperties::TSenPropertiesClassType t = pProp->PropertiesClassType();
+            if( t == MSenProperties::ESenXmlProperties           ||
+                t == MSenProperties::ESenTransportProperties     ||
+                t == MSenProperties::ESenHttpTransportProperties ||
+                t == MSenProperties::ESenVtcpTransportProperties )
+                {
+                return *((CSenXmlProperties*)ipData); 
+                }
+            }
+        }
+    User::Leave( KErrSenCtxItemTypeMismatch );
+    return *((CSenXmlProperties*)ipData); 
+    }
+
+CSenLayeredXmlProperties& CSenContextItem::ToSenLayeredXmlPropertiesL() const
+    { 
+    if(ipData) 
+        {
+        if( iType == MSenContextItem::EMSenProperties )
+            {
+            MSenProperties* pProp = (MSenProperties*) ipData;
+            MSenProperties::TSenPropertiesClassType t = pProp->PropertiesClassType();
+            if( t == MSenProperties::ESenLayeredXmlProperties           ||
+                t == MSenProperties::ESenLayeredTransportProperties     ||
+                t == MSenProperties::ESenLayeredHttpTransportProperties ||
+                t == MSenProperties::ESenLayeredVtcpTransportProperties )
+                {
+                return *((CSenLayeredXmlProperties*)ipData); 
+                }
+            }
+        }
+    User::Leave( KErrSenCtxItemTypeMismatch );
+    return *((CSenLayeredXmlProperties*)ipData); 
+    }
+    
+MSenMessage& CSenContextItem::ToSenMessageL() const
+    {
+    if(ipData)
+        {
+        if( iType == MSenContextItem::EMSenMessage )
+            {
+            return *((MSenMessage*)ipData); 
+            }
+        else if (iType == MSenContextItem::ECSenSoapEnvelope2)
+            {
+            return *((CSenSoapEnvelope2*)ipData); 
+            }
+        else if (iType == MSenContextItem::ECSenAtomMessage)
+            {
+            return *((CSenAtomEntry*)ipData); 
+            }
+        }
+    User::Leave( KErrSenCtxItemTypeMismatch );
+    return *((MSenMessage*)ipData); 
+    }
+
+CSenSoapMessage& CSenContextItem::ToSenSoapMessageL() const
+    {
+    if(ipData)
+        {
+        if( iType == MSenContextItem::ECSenSoapMessage )
+            {
+            return *((CSenSoapMessage*)ipData); 
+            }
+        }
+    User::Leave( KErrSenCtxItemTypeMismatch );
+    return *((CSenSoapMessage*)ipData); 
+    }
+    
+
+CSenChunk& CSenContextItem::ToSenChunkL() const
+    { 
+    if( iType != MSenContextItem::ECSenChunk )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return *((CSenChunk*)ipData); 
+    }
+
+
+CSenElement& CSenContextItem::ToSenElementL() const
+    { 
+    if( iType != MSenContextItem::ECSenElement )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return *((CSenElement*)ipData); 
+    }
+
+CSenXmlReader& CSenContextItem::ToSenXmlReaderL() const
+    { 
+    if( iType != MSenContextItem::ECSenXmlReader )
+        {
+        User::Leave( KErrSenCtxItemTypeMismatch );
+        }
+    return *((CSenXmlReader*)ipData); 
+    }
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senframeworkdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senhandlerbase.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senhandlerbase.h" 
+
+EXPORT_C CSenHandlerBase::CSenHandlerBase()
+    {
+    
+    }
+
+EXPORT_C CSenHandlerBase::~CSenHandlerBase()
+    {
+    // destroy any base member allocations here.
+    }
+
+
+EXPORT_C void CSenHandlerBase::ProcessHandlerContextL(MSenHandlerContext& /* aCtx */)
+    {
+    }
+
+EXPORT_C void CSenHandlerBase::WriteAsXMLToL(RWriteStream& aWs)
+    {
+    CSenBaseFragment::WriteAsXMLToL(aWs);
+    }
+
+EXPORT_C HBufC8* CSenHandlerBase::AsXmlL()
+    {
+    return CSenBaseFragment::AsXmlL();
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senhttptransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,314 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include "SenHttpTransportProperties.h"
+
+namespace
+    {
+    _LIT8(KIapIdLocalName, "IapId"); 
+    _LIT8(KProxyHostLocalName, "ProxyHost"); 
+    _LIT8(KProxyPortLocalName, "ProxyPort"); 
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL()
+    {
+    CSenHttpTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC()
+    {
+    CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL(const TDesC8& aXmlUtf8,
+                                                               CSenXmlReader& aParser)
+    {
+    CSenHttpTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                                CSenXmlReader& aParser)
+    {
+    CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenHttpTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+
+
+
+/**
+* Get an integer identifying properties class type.
+* All subclasses MUST return use unique integer value.
+* @return unique TInt identifying this properties class type
+*/
+TInt CSenHttpTransportProperties::PropertiesClassType() 
+    { 
+    return KSenPropertiesClassTypeSenHttpTransportProperties; 
+    }
+
+/**
+* Writes this properties object as descriptor into a stream.
+* UTF-8 charset encoding will be used.
+* @since Series60
+* @param aWriteStream The stream to write to.
+*/
+void CSenHttpTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenTransportProperties::WriteAsXMLToL(aWriteStream);
+    /*
+    WriteAsXMLToL(aWriteStream);
+    */
+    }
+
+/**
+* Get these properties as UTF-8 charset encoded descriptor.
+* @since Series60
+* @return a pointer to UTF-8 encoded descriptor. 
+* Caller takes ownership.
+*/
+HBufC8* CSenHttpTransportProperties::AsUtf8L()
+    {
+    return CSenTransportProperties::AsUtf8L();
+    /*
+    return AsXmlL();
+    */
+    }
+
+
+/**
+* Get these properties as UTF-8 charset encoded descriptor.
+* @since Series60
+* @return a pointer to UTF-8 encoded descriptor, which is
+* has been left on cleanup stack.
+* Caller takes ownership.
+*/
+HBufC8* CSenHttpTransportProperties::AsUtf8LC()
+    {
+    return CSenTransportProperties::AsUtf8LC();
+    /*
+    HBufC8* pAsXml = AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    return pAsXml;
+    */
+    }
+
+/**
+* Destructor.
+*/
+CSenHttpTransportProperties::~CSenHttpTransportProperties()
+    {
+    }
+
+/**
+* Constructs this fragment. Subclasses should call this
+* function in their corresponding 2nd phase constructor.
+*
+* @param aLocalname is used as XML localname for this instance
+* @param aXml is the XML document to be parsed into this DOM tree
+* this properties instance represents.
+* Parsing is omitted iff descriptor is zero-length: KNullDesC8.
+*/
+void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aLocalname, aXml, aParser);
+    }
+
+/**
+* Constructs this fragment. Subclasses should call this
+* function in their corresponding 2nd phase constructor.
+*
+* @param aNamespace is the XML namespace
+* @param aLocalname is the XML localname
+* @param aXml is the XML document to be parsed into this DOM tree
+* this properties instance represents.
+* Parsing is omitted iff descriptor is zero-length: KNullDesC8.
+*/
+void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser);
+    }
+
+/**
+* Constructs this fragment. Subclasses should call this
+* function in their corresponding 2nd phase constructor.
+*
+* @param aNamespace is the XML namespace
+* @param aLocalname is the XML localname
+* @param aLocalname is the XML qualified name
+* @param aXml is the XML document to be parsed into this DOM tree
+* this properties instance represents.
+* Parsing is omitted iff descriptor is zero-length: KNullDesC8.
+*/
+void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aQualifiedName, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, aXml, aParser);
+
+    }
+
+/**
+* 2nd phase constructor:
+*/
+void CSenHttpTransportProperties::BaseConstructL(const CSenElement& aElement)
+    {
+    CSenTransportProperties::BaseConstructL(aElement);
+    }
+
+
+
+
+CSenHttpTransportProperties::CSenHttpTransportProperties()
+    {
+    }
+
+
+// First versions of real HTTP spesific transport methods:
+
+EXPORT_C TInt CSenHttpTransportProperties::IapId(TUint32& aCurrentIapId)
+    {
+    CSenElement* pIapIdElement = AsElement().Element(KIapIdLocalName);
+    if(pIapIdElement && pIapIdElement->HasContent())
+        {
+        TPtrC8 content = pIapIdElement->Content();
+        TLex8 lex(content);
+
+        TInt retVal = lex.Val(aCurrentIapId, EDecimal);
+        return retVal;
+        }
+    return KErrNotFound;
+    }
+
+
+EXPORT_C void CSenHttpTransportProperties::SetIapIdL(TUint32 aIapId)
+    {
+    CSenElement* pIapIdElement = AsElement().Element(KIapIdLocalName);
+    if(!pIapIdElement)
+        {
+        pIapIdElement = &(AsElement().AddElementL(KIapIdLocalName));
+        }
+    TBuf8<128> buf;
+    buf.AppendFormat(_L8("%u"), aIapId);
+    pIapIdElement->SetContentL(buf);
+    }
+
+EXPORT_C TInt CSenHttpTransportProperties::ProxyPort()
+    {
+    CSenElement* pProxyPortElement = AsElement().Element(KProxyPortLocalName);
+    if(pProxyPortElement && pProxyPortElement->HasContent())
+        {
+        TPtrC8 content = pProxyPortElement->Content();
+        TLex8 lex(content);
+
+        TUint proxyPort(0);
+        TInt retVal = lex.Val(proxyPort, EDecimal);
+        if(retVal==KErrNone)
+            {
+            return (TInt)proxyPort;
+            }
+        else
+            {
+            return retVal;
+            }
+        }
+    return KErrNotFound;
+    }
+
+EXPORT_C void CSenHttpTransportProperties::SetProxyPortL(TInt aProxyPort)
+    {
+    CSenElement* pProxyPortElement = AsElement().Element(KProxyPortLocalName);
+    if(!pProxyPortElement)
+        {
+        pProxyPortElement = &(AsElement().AddElementL(KProxyPortLocalName));
+        }
+    TBuf8<128> buf;
+    buf.AppendFormat(_L8("%u"), aProxyPort);
+    pProxyPortElement->SetContentL(buf);
+    }
+
+EXPORT_C TPtrC8 CSenHttpTransportProperties::ProxyHost()
+    {
+    CSenElement* pProxyHostElement = AsElement().Element(KProxyHostLocalName);
+    if(pProxyHostElement && pProxyHostElement->HasContent())
+        {
+        return pProxyHostElement->Content();
+        }
+    else return KNullDesC8();
+    }
+
+EXPORT_C void CSenHttpTransportProperties::SetProxyHostL(const TDesC8& aProxyHost)
+    {
+    CSenElement* pProxyHostElement = AsElement().Element(KProxyHostLocalName);
+    if(!pProxyHostElement)
+        {
+        pProxyHostElement = &(AsElement().AddElementL(KProxyHostLocalName));
+        }
+    pProxyHostElement->SetContentL(aProxyHost);
+    }
+
+// END OF FILE´
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/seninternalserviceconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <w32std.h>
+
+#include "seninternalserviceconsumer.h"
+#include "senservicesession.h"
+#include "senidentifier.h"
+
+//#include "MSenPolicy.h" // internal ServiceDescription\inc 
+#include "senpolicy.h" // internal ServiceDescription\inc 
+#include "sendebug.h" // internal Utils\inc
+
+EXPORT_C CSenInternalServiceConsumer::CSenInternalServiceConsumer(
+                                                TDescriptionClassType aType,
+                                                CSIF& aSIF)
+:   CSenWSDescription(aType),
+    iSIF(aSIF),
+    //iPolicy(NULL), // deprecated, not in use
+    ipConsumerId(NULL),
+    ipIdentifier(NULL)
+    {
+    }
+
+
+EXPORT_C void CSenInternalServiceConsumer::ConstructL()
+    {
+    // Set the local name to "ServiceDescription"
+    // and initialize the inner ipElement
+    CSenWSDescription::ConstructL();
+
+    // Construct an empty policy
+    // iPolicy = CSenPolicy::NewL(); // deprecated, not in use
+
+    ipConsumerId = iSIF.Manager().RandomGuidL();
+    ipIdentifier = CSenIdentifier::NewL(SenIdentifier::ESession, 
+                                        *ipConsumerId);
+    }
+
+EXPORT_C CSenInternalServiceConsumer::~CSenInternalServiceConsumer()
+    {
+    //delete iPolicy; // deprecated, not in use
+    delete ipConsumerId;
+    delete ipIdentifier;
+    }
+
+EXPORT_C TBool CSenInternalServiceConsumer::IsReadyL()
+    {
+    if(!ServiceSession())
+        {
+        return EFalse;
+        }
+    else
+        {
+        return ServiceSession()->IsReadyL();
+        }
+    }
+
+EXPORT_C const TDesC8& CSenInternalServiceConsumer::Id() const
+    {
+    if(ipConsumerId)
+        {
+        return *ipConsumerId;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+EXPORT_C TInt CSenInternalServiceConsumer::SetSessionL(MSenRemoteServiceSession& /* aServiceSession */)
+    {
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenInternalServiceConsumer::HandleMessageL(HBufC8* apMessage,
+                                                          const TInt /* aTxnId */,
+                                                          MSenProperties* /* aResponseTransportProperties */)
+    {
+    delete apMessage;
+    return KErrNone; // KErrNotImplemented
+    }
+
+
+EXPORT_C TInt CSenInternalServiceConsumer::HandleErrorL(HBufC8* apError,
+                                                        const TInt /* aErrorCode */,
+                                                        const TInt /* aTxnId */,
+                                                        MSenProperties* /* aResponseTransportProperties */)
+    {
+    delete apError;
+    return KErrNone; // KErrNotImplemented
+    }
+
+EXPORT_C void CSenInternalServiceConsumer::SetStatusL(const TInt /* aStatus */)
+    {
+    }
+
+EXPORT_C CSIF& CSenInternalServiceConsumer::Framework()
+    {
+    return iSIF;
+    }
+
+/*
+EXPORT_C RFileLogger* CSenInternalServiceConsumer::Log() const
+    {
+    // logs all into the service invocation framework's log:
+    return iSIF.Log();
+*/
+
+EXPORT_C CSenIdentifier& CSenInternalServiceConsumer::Identifier() const
+    {
+    return *ipIdentifier;
+    }
+
+EXPORT_C TInt CSenInternalServiceConsumer::ChunkByTxnIdL(TInt /* aTxnId */, CSenChunk*& /* aChunk */)
+    {
+    return KErrNotSupported;
+    }
+
+EXPORT_C TBool CSenInternalServiceConsumer::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWSDescription ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWSDescription::HasSuperClass( aType ); 
+        }
+    }
+
+EXPORT_C void CSenInternalServiceConsumer::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
+                const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
+    {
+    }
+EXPORT_C void CSenInternalServiceConsumer::SetDataTrafficDetails( TSenDataTrafficDetails& /* aDetails*/)  
+	{
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senlayeredhttptransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,517 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:         
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include "senlayeredhttptransportproperties.h"
+#include <SenHttpTransportProperties.h>              // property keys (constants)
+#include <SenTransportProperties.h>                  // property keys (constants)
+#include "senpropertieselement.h"   // private: Utils\inc
+#include "senpropertiesfragment.h"  // private: Utils\inc
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewL()
+    {
+    CSenLayeredHttpTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewLC()
+    {
+    CSenLayeredHttpTransportProperties* pNew = new (ELeave) CSenLayeredHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, KNullDesC8, NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser)
+    {
+    CSenLayeredHttpTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser)
+    {
+    CSenLayeredHttpTransportProperties* pNew = new (ELeave) CSenLayeredHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, aXmlUtf8, &aParser);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenLayeredHttpTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenLayeredHttpTransportProperties* pNew = new (ELeave) CSenLayeredHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+
+// RStringPool variants:
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewL(RStringPool& aStringPool)
+    {
+    CSenLayeredHttpTransportProperties* pNew = NewLC(aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewLC(RStringPool& aStringPool)
+    {
+    CSenLayeredHttpTransportProperties* pNew = new (ELeave) CSenLayeredHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, KNullDesC8, NULL, &aStringPool);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewL(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool)
+    {
+    CSenLayeredHttpTransportProperties* pNew = NewLC(aXmlUtf8, aParser, aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewLC(const TDesC8& aXmlUtf8, CSenXmlReader& aParser, RStringPool& aStringPool)
+    {
+    CSenLayeredHttpTransportProperties* pNew = new (ELeave) CSenLayeredHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, aXmlUtf8, &aParser, &aStringPool);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewL(const CSenElement& aElement, RStringPool& aStringPool)
+    {
+    CSenLayeredHttpTransportProperties* pNew = NewLC(aElement, aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredHttpTransportProperties* CSenLayeredHttpTransportProperties::NewLC(const CSenElement& aElement, RStringPool& aStringPool)
+    {
+    CSenLayeredHttpTransportProperties* pNew = new (ELeave) CSenLayeredHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement, &aStringPool);
+    return pNew;
+    }
+
+    
+void CSenLayeredHttpTransportProperties::SetReader(CSenXmlReader& aReader)
+    {
+    CSenLayeredTransportProperties::SetReader(aReader);
+    }    
+    
+
+MSenProperties::TSenPropertiesClassType CSenLayeredHttpTransportProperties::PropertiesClassType() 
+    {
+    return ESenLayeredHttpTransportProperties;
+    }
+
+void CSenLayeredHttpTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenLayeredTransportProperties::WriteToL(aWriteStream);
+    }
+
+void CSenLayeredHttpTransportProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    CSenLayeredTransportProperties::ReadFromL(aBuffer);
+    }
+    
+HBufC8* CSenLayeredHttpTransportProperties::AsUtf8L()
+    {
+    return CSenLayeredTransportProperties::AsUtf8L();
+    }
+
+HBufC8* CSenLayeredHttpTransportProperties::AsUtf8LC()
+    {
+    return CSenLayeredTransportProperties::AsUtf8LC();
+    }
+    
+TBool CSenLayeredHttpTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenLayeredHttpTransportProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return CSenLayeredTransportProperties::IsSafeToCast( aClass );
+        }
+    }
+
+TInt CSenLayeredHttpTransportProperties::SetPropertyL(const TDesC8& aName, const TDesC8& aValue)
+    {
+    return CSenLayeredTransportProperties::SetPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::PropertyL(const TDesC8& aName, MSenProperty*& aValue, TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue, aLayer);
+    }
+        
+TInt CSenLayeredHttpTransportProperties::PropertyL(const TDesC8& aName, MSenProperty*& aValue)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue);
+    }
+
+TInt CSenLayeredHttpTransportProperties::PropertiesByTypeL(const TDesC8& aType, RPointerArray<MSenProperty>& aArray)
+    {
+    return CSenLayeredTransportProperties::PropertiesByTypeL(aType, aArray);
+    }
+
+TInt CSenLayeredHttpTransportProperties::SetIntPropertyL(const TDesC8& aName, const TInt aValue)
+    {
+    return CSenLayeredTransportProperties::SetIntPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::IntPropertyL(const TDesC8& aName, TInt& aValue)
+    {
+    return CSenLayeredTransportProperties::IntPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::SetBoolPropertyL(const TDesC8& aName, const TBool aValue)
+    {
+    return CSenLayeredTransportProperties::SetBoolPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::BoolPropertyL(const TDesC8& aName, TBool& aValue)
+    {
+    return CSenLayeredTransportProperties::BoolPropertyL(aName, aValue);
+    }   
+
+void CSenLayeredHttpTransportProperties::WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredTransportProperties::WriteToL(aWriteStream, aLayer);
+    }
+
+void CSenLayeredHttpTransportProperties::ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredTransportProperties::ReadFromL(aBuffer, aLayer);
+    }
+    
+HBufC8* CSenLayeredHttpTransportProperties::AsUtf8L(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::AsUtf8L(aLayer);
+    }
+
+HBufC8* CSenLayeredHttpTransportProperties::AsUtf8LC(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::AsUtf8LC(aLayer);
+    }
+
+TInt CSenLayeredHttpTransportProperties::ShrinkTo(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::ShrinkTo(aLayer);
+    }
+    
+void CSenLayeredHttpTransportProperties::ExpandToL(TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredTransportProperties::ExpandToL(aLayer);
+    }
+    
+MSenLayeredProperties::TSenPropertiesLayer CSenLayeredHttpTransportProperties::TopLayer()
+    {
+    return CSenLayeredTransportProperties::TopLayer();
+    }
+    
+TInt CSenLayeredHttpTransportProperties::SetPropertyL(const TDesC8& aName, const TDesC8& aValue, TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::SetPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::PropertyL(const TDesC8& aName,
+                                                     TPtrC8& aValue,
+                                                     TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue, aLayer);
+    }
+
+TInt CSenLayeredHttpTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                            const TInt aValue,
+                                                            TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::SetIntPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::IntPropertyL(const TDesC8& aName,
+                                                           TInt& aValue,
+                                                           TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::IntPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                               const TBool aValue,
+                                                               TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::SetBoolPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                            TBool& aValue,
+                                                            TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::BoolPropertyL(aName, aValue, aLayer);
+    }    
+
+TInt CSenLayeredHttpTransportProperties::IapIdL(TUint32& aCurrentIapId)
+    {
+    return CSenLayeredTransportProperties::IapIdL(aCurrentIapId);
+    }
+
+TInt CSenLayeredHttpTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
+    {
+    return CSenLayeredTransportProperties::SnapIdL(aCurrentSnapId);
+    }
+
+TInt CSenLayeredHttpTransportProperties::ProxyPortL(TInt& aProxyPort)
+    {
+    return CSenLayeredTransportProperties::ProxyPortL(aProxyPort);
+    }
+
+TInt CSenLayeredHttpTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
+    {
+    return CSenLayeredTransportProperties::ProxyHostL(aProxyHost);
+    }
+
+TInt CSenLayeredHttpTransportProperties::ProxyUsageL(TBool& aValue)
+    {
+    return CSenLayeredTransportProperties::ProxyUsageL(aValue);
+    }
+
+TInt CSenLayeredHttpTransportProperties::IAPDialogL(TBool& aValue)
+    {
+    return CSenLayeredTransportProperties::IAPDialogL(aValue);
+    }
+
+TInt CSenLayeredHttpTransportProperties::SnapDialogL(TBool& aValue)
+	{
+	return CSenLayeredTransportProperties::SnapDialogL(aValue);
+	}
+TInt CSenLayeredHttpTransportProperties::ContentTypeL(TPtrC8& aContentType)
+    {
+    return PropertyL(KContentTypeLocalName, aContentType);
+    }
+
+TInt CSenLayeredHttpTransportProperties::UserAgentL(TPtrC8& aUserAgent)
+    {
+    return CSenLayeredTransportProperties::UserAgentL(aUserAgent);
+    }
+
+TInt CSenLayeredHttpTransportProperties::AcceptL(MSenProperty*& aAccept)
+    {
+    return CSenLayeredXmlProperties::PropertyL(KAcceptLocalName, aAccept);
+    }
+
+TInt CSenLayeredHttpTransportProperties::HttpMethodL(TSenHttpMethod& aMethod)
+    {
+    TPtrC8 method;
+    TInt retVal = PropertyL(KHttpMethodLocalName, method);
+    if (retVal == KErrNone)
+        {
+        if (method == KHttpGet)
+            {
+            aMethod = ESenHttpGet;
+            return KErrNone;
+            }
+        else if (method == KHttpPost)
+            {
+            aMethod = ESenHttpPost;
+            return KErrNone;
+            }
+        else if (method == KHttpPut)
+            {
+            aMethod = ESenHttpPut;
+            return KErrNone;
+            }
+        else if (method == KHttpDelete)
+            {
+            aMethod = ESenHttpDelete;
+            return KErrNone;
+            }
+        else
+            {
+            return KErrUnknown;
+            }
+        }
+    else
+        {
+        return retVal;
+        }
+    }
+
+TInt CSenLayeredHttpTransportProperties::HttpVersionL(TSenHttpVersion& aHttpVersion)
+    {
+    TPtrC8 method;
+    TInt retVal = PropertyL(KHttpVersionLocalName, method);
+    if (retVal == KErrNone)
+        {
+        if (method == KHttp10)
+            {
+            aHttpVersion = ESenHttp10;
+            return KErrNone;
+            }
+        else if (method == KHttp11)
+            {
+            aHttpVersion = ESenHttp11;
+            return KErrNone;
+            }
+        else
+            {
+            return KErrUnknown;
+            }
+        }
+    else
+        {
+        return retVal;
+        }
+    }
+    
+TInt CSenLayeredHttpTransportProperties::HttpHeadersL(
+                                        RPointerArray<MSenProperty>& aArray)
+    {
+    return PropertiesByTypeL(KHttpHeaderType, aArray);
+    }
+
+TInt CSenLayeredHttpTransportProperties::SetPropertyL(const TDesC8& aName, 
+                                                      const TDesC8& aValue,
+                                                      const TDesC8& aType)
+    {
+    return CSenLayeredTransportProperties::SetPropertyL(aName, aValue, aType);
+    }
+
+TInt CSenLayeredHttpTransportProperties::PropertyL(const TDesC8& aName, 
+                                                   TPtrC8& aValue,
+                                                   TPtrC8& aType)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue, aType);
+    }
+MSenProperties* CSenLayeredHttpTransportProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenLayeredHttpTransportProperties* pProperties = NewLC(element);
+    if ( ipChildProperties )
+        {
+        CSenLayeredHttpTransportProperties* pChildProperties =
+                                (CSenLayeredHttpTransportProperties*)ipChildProperties->CloneL();
+        pProperties->ipChildProperties = pChildProperties;
+        }
+    
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+void CSenLayeredHttpTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser,
+                                                 RStringPool* aStringPool)
+    {
+    CSenLayeredTransportProperties::BaseConstructL(aLocalname, aXml, aParser, aStringPool);
+    }
+
+void CSenLayeredHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser,
+                                                 RStringPool* aStringPool)
+    {
+    CSenLayeredTransportProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser, aStringPool);
+    }
+
+void CSenLayeredHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aQualifiedName, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser,
+                                                 RStringPool* aStringPool)
+    {
+    CSenLayeredTransportProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, 
+                                                   aXml, aParser, aStringPool);
+    }
+
+void CSenLayeredHttpTransportProperties::BaseConstructL(const CSenElement& aElement, RStringPool* aStringPool)
+    {
+    CSenLayeredTransportProperties::BaseConstructL(aElement, aStringPool);
+    }
+
+CSenLayeredHttpTransportProperties::CSenLayeredHttpTransportProperties()
+    {
+    }
+
+CSenLayeredHttpTransportProperties::~CSenLayeredHttpTransportProperties()
+    {
+    }
+
+TInt CSenLayeredHttpTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
+    {
+    return CSenLayeredTransportProperties::DeviceIDL(aDeviceID);
+    }
+
+TInt CSenLayeredHttpTransportProperties::SoapActionL(TPtrC8& aAction)
+    {
+    return CSenLayeredTransportProperties::SoapActionL(aAction);
+    }
+TInt CSenLayeredHttpTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
+    {
+    return CSenLayeredTransportProperties::DownloadFolderL(aDownloadFolder);
+    }
+    
+TInt CSenLayeredHttpTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
+    {
+    return CSenLayeredTransportProperties::FileAttachmentL(aCid, aFileName);
+    }
+
+TInt CSenLayeredHttpTransportProperties::MwsNamespaceL(TPtrC8& aMwsNamespace)
+    {
+    return CSenLayeredTransportProperties::MwsNamespaceL(aMwsNamespace);
+    }
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senlayeredtransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,600 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:         
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include "senlayeredtransportproperties.h"
+#include <SenTransportProperties.h>
+#include "senpropertieselement.h"   // private: Utils\inc
+#include "senpropertiesfragment.h"  // private: Utils\inc
+#include "senxmldebug.h"
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL()
+    {
+    CSenLayeredTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC()
+    {
+    CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const TDesC8& aXmlUtf8,
+                                                                              CSenXmlReader& aParser)
+    {
+    CSenLayeredTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                                               CSenXmlReader& aParser)
+    {
+    CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenLayeredTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+
+
+// The RStringPool variants:
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(RStringPool& aStringPool)
+    {
+    CSenLayeredTransportProperties* pNew = NewLC(aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(RStringPool& aStringPool)
+    {
+    CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL,
+                         &aStringPool);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const TDesC8& aXmlUtf8,
+                                                                              CSenXmlReader& aParser,
+                                                                              RStringPool& aStringPool)
+    {
+    CSenLayeredTransportProperties* pNew = NewLC(aXmlUtf8, aParser, aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                                               CSenXmlReader& aParser,
+                                                                               RStringPool& aStringPool)
+    {
+    CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser,
+                         &aStringPool);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const CSenElement& aElement,
+                                                                              RStringPool& aStringPool)
+    {
+    CSenLayeredTransportProperties* pNew = NewLC(aElement, aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const CSenElement& aElement,
+                                                                               RStringPool& aStringPool)
+    {
+    CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // Pparse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement, &aStringPool);
+    return pNew;
+    }
+
+
+    
+EXPORT_C void CSenLayeredTransportProperties::SetReader(CSenXmlReader& aReader)
+    {
+    CSenLayeredXmlProperties::SetReader(aReader);
+    }    
+
+EXPORT_C MSenProperties::TSenPropertiesClassType CSenLayeredTransportProperties::PropertiesClassType() 
+    {
+    return ESenLayeredTransportProperties;
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenLayeredXmlProperties::WriteToL(aWriteStream);
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    CSenLayeredXmlProperties::ReadFromL(aBuffer);
+    }
+    
+EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8L()
+    {
+    return CSenLayeredXmlProperties::AsUtf8L();
+    }
+
+EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8LC()
+    {
+    return CSenLayeredXmlProperties::AsUtf8LC();
+    }
+
+
+EXPORT_C TBool CSenLayeredTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenLayeredTransportProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return CSenLayeredXmlProperties::IsSafeToCast( aClass );
+        }
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::SetPropertyL(const TDesC8& aName,
+                                                        const TDesC8& aValue)
+    {
+    return CSenLayeredXmlProperties::SetPropertyL(aName, aValue);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName,
+                                                        TPtrC8& aValue)
+    {
+    return CSenLayeredXmlProperties::PropertyL(aName, aValue);
+    }
+    
+    
+EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName,
+                                                MSenProperty*& aValue,
+                                                TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::PropertyL(aName, aValue, aLayer);
+    }
+        
+EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName,
+                                                MSenProperty*& aValue)
+    {
+    return CSenLayeredXmlProperties::PropertyL(aName, aValue);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::PropertiesByTypeL(
+                                            const TDesC8& aType,
+                                            RPointerArray<MSenProperty>& aArray)
+    {
+    return CSenLayeredXmlProperties::PropertiesByTypeL(aType, aArray);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                            const TInt aValue)
+    {
+    return CSenLayeredXmlProperties::SetIntPropertyL(aName, aValue);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::IntPropertyL(const TDesC8& aName,
+                                                           TInt& aValue)
+    {
+    return CSenLayeredXmlProperties::IntPropertyL(aName, aValue);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                               const TBool aValue)
+    {
+    return CSenLayeredXmlProperties::SetBoolPropertyL(aName, aValue);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                            TBool& aValue)
+    {
+    return CSenLayeredXmlProperties::BoolPropertyL(aName, aValue);
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredXmlProperties::WriteToL(aWriteStream, aLayer);
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredXmlProperties::ReadFromL(aBuffer, aLayer);
+    }
+    
+EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8L(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::AsUtf8L(aLayer);
+    }
+
+EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8LC(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::AsUtf8LC(aLayer);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::ShrinkTo(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::ShrinkTo(aLayer);
+    }
+    
+EXPORT_C void CSenLayeredTransportProperties::ExpandToL(TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredXmlProperties::ExpandToL(aLayer);
+    }
+    
+EXPORT_C MSenLayeredProperties::TSenPropertiesLayer CSenLayeredTransportProperties::TopLayer()
+    {
+    return CSenLayeredXmlProperties::TopLayer();
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::SetPropertyL(const TDesC8& aName,
+                                                        const TDesC8& aValue,
+                                                        TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::SetPropertyL(aName, aValue, aLayer);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName,
+                                                     TPtrC8& aValue,
+                                                     TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::PropertyL(aName, aValue, aLayer);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                            const TInt aValue,
+                                                            TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::SetIntPropertyL(aName, aValue, aLayer);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::IntPropertyL(const TDesC8& aName,
+                                                           TInt& aValue,
+                                                           TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::IntPropertyL(aName, aValue, aLayer);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                               const TBool aValue,
+                                                               TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::SetBoolPropertyL(aName, aValue, aLayer);
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                            TBool& aValue,
+                                                            TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredXmlProperties::BoolPropertyL(aName, aValue, aLayer);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::SetPropertyL(const TDesC8& aName, 
+                                                           const TDesC8& aValue,
+                                                           const TDesC8& aType)
+    {
+    return CSenLayeredXmlProperties::SetPropertyL(aName, aValue, aType);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName, 
+                                                       TPtrC8& aValue,
+                                                       TPtrC8& aType)
+    {
+    return CSenLayeredXmlProperties::PropertyL(aName, aValue, aType);
+    }
+EXPORT_C MSenProperties* CSenLayeredTransportProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenLayeredTransportProperties* pProperties = NewLC(element);
+    if ( ipChildProperties )
+        {
+        CSenLayeredTransportProperties* pChildProperties =
+                                (CSenLayeredTransportProperties*)ipChildProperties->CloneL();
+        pProperties->ipChildProperties = pChildProperties;
+        }
+    
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+EXPORT_C MSenProperties* CSenLayeredTransportProperties::Clone(TInt& aOkOrError) const
+    {
+    MSenProperties* pClone = NULL;
+    TRAP( aOkOrError, pClone = CloneL(); )
+    return pClone;
+    }    
+
+EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser,
+                                                 RStringPool* aStringPool)
+    {
+    CSenLayeredXmlProperties::BaseConstructL(aLocalname, aXml, aParser, aStringPool);
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser,
+                                                 RStringPool* aStringPool)
+    {
+    CSenLayeredXmlProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser, aStringPool);
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aQualifiedName, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser,
+                                                 RStringPool* aStringPool)
+    {
+    CSenLayeredXmlProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, 
+                                             aXml, aParser, aStringPool);
+    }
+
+EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const CSenElement& aElement,
+                                                             RStringPool* aStringPool)
+    {
+    CSenLayeredXmlProperties::BaseConstructL(aElement, aStringPool);
+    }
+
+EXPORT_C CSenLayeredTransportProperties::CSenLayeredTransportProperties()
+    {
+    }
+
+EXPORT_C CSenLayeredTransportProperties::~CSenLayeredTransportProperties()
+    {
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
+    {
+    return PropertyL(KDeviceIDLocalName, aDeviceID);    
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::SoapActionL(TPtrC8& aAction)
+    {
+    return PropertyL(KSoapActionLocalName, aAction);    
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::IapIdL(TUint32& aCurrentIapId)
+    {
+    TPtrC8 value;
+    TInt retVal = PropertyL(KIapIdLocalName, value);
+    
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aCurrentIapId, EDecimal);
+        }
+    if(aCurrentIapId > 0) return retVal;
+    else return KErrNotFound;
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
+    {
+    TPtrC8 value;
+    TInt retVal = PropertyL(KSnapIdLocalName, value);
+    
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aCurrentSnapId, EDecimal);
+        }
+        
+    if(aCurrentSnapId > 0) return retVal;
+    else return KErrNotFound;
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::ProxyPortL(TInt& aProxyPort)
+    {
+    TPtrC8 value;
+    TInt retVal = PropertyL(KProxyPortLocalName, value);
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        TUint proxyPort;
+        retVal = lex.Val(proxyPort, EDecimal);
+        if ( retVal == KErrNone )
+            {
+            aProxyPort = proxyPort;
+            }
+        }
+
+    return retVal;
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::HeartbeatL(TInt& aHeartbeat)
+    {
+    return IntPropertyL(KSenConnectionHeartbeat, aHeartbeat);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::MaxTimeToLiveL(TInt& aMax)
+    {
+    return IntPropertyL(KSenConnectionHeartbeatMaxTTL, aMax);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::MinTimeToLiveL(TInt& aMin)
+    {
+    return IntPropertyL(KSenConnectionHeartbeatMinTTL, aMin);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
+    {
+    return PropertyL(KProxyHostLocalName, aProxyHost);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::ProxyUsageL(TBool& aValue)
+    {
+    return BoolPropertyL(KProxyUsageLocalName, aValue);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::IAPDialogL(TBool& aValue)
+    {
+    return BoolPropertyL(KSenIAPDoNotPrompt, aValue);
+    }
+
+EXPORT_C TInt CSenLayeredTransportProperties::SnapDialogL(TBool& aValue)
+    {
+    return BoolPropertyL(KSenSNAPDoNotPrompt, aValue);
+    }
+EXPORT_C TInt CSenLayeredTransportProperties::UserAgentL(TPtrC8& aUserAgent)
+    {
+    return PropertyL(KUserAgentLocalName, aUserAgent);
+    }
+EXPORT_C TInt CSenLayeredTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
+    {
+    return PropertyL(KDownloadFolderLocalName, aDownloadFolder);
+    }  
+EXPORT_C TInt CSenLayeredTransportProperties::SetMaxRetryTTLL(TInt aMaxRetryTTL)
+	{ 
+	return SetIntPropertyL( KSenConnectionRetryMaxTTL, aMaxRetryTTL );
+	}
+	
+EXPORT_C TInt CSenLayeredTransportProperties::MaxRetryTTLL(TInt& aMaxRetryTTL)
+	{ 
+	return IntPropertyL( KSenConnectionRetryMaxTTL, aMaxRetryTTL ); 
+	}
+
+EXPORT_C TInt CSenLayeredTransportProperties::SetMinRetryTTLL(TInt aMinRetryTTL)
+	{ 
+	return SetIntPropertyL( KSenConnectionRetryMinTTL, aMinRetryTTL );
+	}
+	
+EXPORT_C TInt CSenLayeredTransportProperties::MinRetryTTLL(TInt& aMinRetryTTL)
+	{ 
+	return IntPropertyL( KSenConnectionRetryMinTTL, aMinRetryTTL ); 
+	}
+	
+EXPORT_C TInt CSenLayeredTransportProperties::SetRetryDeltaTimeoutL(TInt aTimeout)
+	{ 
+	return SetIntPropertyL( KSenConnectionRetryDelta, aTimeout );
+	}
+	
+EXPORT_C TInt CSenLayeredTransportProperties::RetryDeltaTimeoutL(TInt& aTimeout)
+	{ 
+	return IntPropertyL( KSenConnectionRetryDelta, aTimeout ); 
+	}
+
+      
+
+EXPORT_C TInt CSenLayeredTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
+    {
+    _LIT8(KAttachment,"Attachment");
+    TPtrC8 pFileAttachments;
+    TInt err(KErrNone);
+    err = PropertyL(KFileAttachmentsLocalName,pFileAttachments);    
+    if (err!=KErrNone)
+        {
+        return err;
+        }
+    else
+        {
+        CSenXmlReader* reader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+        CleanupStack::PushL(reader);
+        CSenDomFragment* pFragment = CSenDomFragment::NewL();
+        CleanupStack::PushL(pFragment);
+        pFragment->SetReader(*reader);    
+        pFragment->BuildFrom(pFileAttachments);  
+        HBufC8* pLocalName = HBufC8::NewLC(KAttachment().Length()+aCid.Length());
+        TPtr8 localNameDes = pLocalName->Des();
+        localNameDes.Append(KAttachment);
+        localNameDes.Append(aCid);
+        CSenElement* pElement = pFragment->AsElement().Element(*pLocalName);
+        if(pElement)
+            {
+            if (aFileName)
+                {
+                delete aFileName;
+                aFileName = NULL;
+                }
+            aFileName = HBufC8::NewL(pElement->Content().Length());
+            TPtr8 fileNameDes = aFileName->Des();  //CodeScannerWarnings
+            fileNameDes.Append(pElement->Content());
+            CleanupStack::PopAndDestroy(pLocalName);
+            CleanupStack::PopAndDestroy(pFragment);
+            CleanupStack::PopAndDestroy(reader);
+            return KErrNone;
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(pLocalName);
+            CleanupStack::PopAndDestroy(pFragment);
+            CleanupStack::PopAndDestroy(reader);
+            return KErrNotFound;
+            }
+        }
+    }
+    
+EXPORT_C TInt CSenLayeredTransportProperties::MwsNamespaceL(TPtrC8& aMwsNamespace)
+    {
+    return PropertyL(KMwsNamespaceLocalName, aMwsNamespace);
+    }    
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senlayeredvtcptransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,341 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:         
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include "senlayeredvtcptransportproperties.h"
+#include "senvtcptransportproperties.h"              // property keys (constants)
+#include <SenTransportProperties.h>
+#include "senpropertieselement.h"   // private: Utils\inc
+#include "senpropertiesfragment.h"  // private: Utils\inc
+
+EXPORT_C CSenLayeredVtcpTransportProperties* CSenLayeredVtcpTransportProperties::NewL()
+    {
+    CSenLayeredVtcpTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredVtcpTransportProperties* CSenLayeredVtcpTransportProperties::NewLC()
+    {
+    CSenLayeredVtcpTransportProperties* pNew = new (ELeave) CSenLayeredVtcpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, KNullDesC8, NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredVtcpTransportProperties* CSenLayeredVtcpTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenLayeredVtcpTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenLayeredVtcpTransportProperties* CSenLayeredVtcpTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenLayeredVtcpTransportProperties* pNew = new (ELeave) CSenLayeredVtcpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+        
+void CSenLayeredVtcpTransportProperties::SetReader(CSenXmlReader& aReader)
+    {
+    CSenLayeredTransportProperties::SetReader(aReader);
+    }    
+    
+
+MSenProperties::TSenPropertiesClassType CSenLayeredVtcpTransportProperties::PropertiesClassType() 
+    {
+    return ESenLayeredVtcpTransportProperties;
+    }
+
+void CSenLayeredVtcpTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenLayeredTransportProperties::WriteToL(aWriteStream);
+    }
+
+void CSenLayeredVtcpTransportProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    CSenLayeredTransportProperties::ReadFromL(aBuffer);
+    }
+    
+HBufC8* CSenLayeredVtcpTransportProperties::AsUtf8L()
+    {
+    return CSenLayeredTransportProperties::AsUtf8L();
+    }
+
+HBufC8* CSenLayeredVtcpTransportProperties::AsUtf8LC()
+    {
+    return CSenLayeredTransportProperties::AsUtf8LC();
+    }
+
+TBool CSenLayeredVtcpTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenLayeredVtcpTransportProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return CSenLayeredTransportProperties::IsSafeToCast( aClass );
+        }
+    }
+
+TInt CSenLayeredVtcpTransportProperties::SetPropertyL(const TDesC8& aName, const TDesC8& aValue)
+    {
+    return CSenLayeredTransportProperties::SetPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::PropertyL(const TDesC8& aName, MSenProperty*& aValue, TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue, aLayer);
+    }
+        
+TInt CSenLayeredVtcpTransportProperties::PropertyL(const TDesC8& aName, MSenProperty*& aValue)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::PropertiesByTypeL(const TDesC8& aType, RPointerArray<MSenProperty>& aArray)
+    {
+    return CSenLayeredTransportProperties::PropertiesByTypeL(aType, aArray);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::SetIntPropertyL(const TDesC8& aName, const TInt aValue)
+    {
+    return CSenLayeredTransportProperties::SetIntPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::IntPropertyL(const TDesC8& aName, TInt& aValue)
+    {
+    return CSenLayeredTransportProperties::IntPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::SetBoolPropertyL(const TDesC8& aName, const TBool aValue)
+    {
+    return CSenLayeredTransportProperties::SetBoolPropertyL(aName, aValue);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::BoolPropertyL(const TDesC8& aName, TBool& aValue)
+    {
+    return CSenLayeredTransportProperties::BoolPropertyL(aName, aValue);
+    }   
+
+void CSenLayeredVtcpTransportProperties::WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredTransportProperties::WriteToL(aWriteStream, aLayer);
+    }
+
+void CSenLayeredVtcpTransportProperties::ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredTransportProperties::ReadFromL(aBuffer, aLayer);
+    }
+    
+HBufC8* CSenLayeredVtcpTransportProperties::AsUtf8L(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::AsUtf8L(aLayer);
+    }
+
+HBufC8* CSenLayeredVtcpTransportProperties::AsUtf8LC(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::AsUtf8LC(aLayer);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::ShrinkTo(TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::ShrinkTo(aLayer);
+    }
+    
+void CSenLayeredVtcpTransportProperties::ExpandToL(TSenPropertiesLayer aLayer)
+    {
+    CSenLayeredTransportProperties::ExpandToL(aLayer);
+    }
+    
+MSenLayeredProperties::TSenPropertiesLayer CSenLayeredVtcpTransportProperties::TopLayer()
+    {
+    return CSenLayeredTransportProperties::TopLayer();
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::SetPropertyL(const TDesC8& aName, const TDesC8& aValue, TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::SetPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::PropertyL(const TDesC8& aName,
+                                                     TPtrC8& aValue,
+                                                     TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue, aLayer);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                            const TInt aValue,
+                                                            TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::SetIntPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::IntPropertyL(const TDesC8& aName,
+                                                           TInt& aValue,
+                                                           TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::IntPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                               const TBool aValue,
+                                                               TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::SetBoolPropertyL(aName, aValue, aLayer);
+    }
+    
+TInt CSenLayeredVtcpTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                            TBool& aValue,
+                                                            TSenPropertiesLayer aLayer)
+    {
+    return CSenLayeredTransportProperties::BoolPropertyL(aName, aValue, aLayer);
+    }    
+
+TInt CSenLayeredVtcpTransportProperties::IapIdL(TUint32& aCurrentIapId)
+    {
+    return CSenLayeredTransportProperties::IapIdL(aCurrentIapId);
+    }
+
+ TInt CSenLayeredVtcpTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
+ 	{
+	return CSenLayeredTransportProperties::SnapIdL(aCurrentSnapId); 	
+ 	}
+TInt CSenLayeredVtcpTransportProperties::ProxyPortL(TInt& aProxyPort)
+    {
+    return CSenLayeredTransportProperties::ProxyPortL(aProxyPort);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
+    {
+    return CSenLayeredTransportProperties::ProxyHostL(aProxyHost);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::ProxyUsageL(TBool& aValue)
+    {
+    return CSenLayeredTransportProperties::ProxyUsageL(aValue);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::UserAgentL(TPtrC8& aUserAgent)
+    {
+    return CSenLayeredTransportProperties::UserAgentL(aUserAgent);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::SetPropertyL(const TDesC8& aName, 
+                                                      const TDesC8& aValue,
+                                                      const TDesC8& aType)
+    {
+    return CSenLayeredTransportProperties::SetPropertyL(aName, aValue, aType);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::PropertyL(const TDesC8& aName, 
+                                                   TPtrC8& aValue,
+                                                   TPtrC8& aType)
+    {
+    return CSenLayeredTransportProperties::PropertyL(aName, aValue, aType);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::SoapActionL(TPtrC8& aAction)
+    {
+    return CSenLayeredTransportProperties::SoapActionL(aAction);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
+    {
+    return CSenLayeredTransportProperties::DeviceIDL(aDeviceID);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::DeviceLCIDL(TPtrC8& aDeviceLCID)
+    {
+    return PropertyL(KDeviceLCIDLocalName, aDeviceLCID);    
+    }
+
+TInt CSenLayeredVtcpTransportProperties::ConnectionBoundL(TBool& aConnectionBound)
+    {
+    return BoolPropertyL(KConnectionBoundLocalName, aConnectionBound);    
+    }
+
+TInt CSenLayeredVtcpTransportProperties::ConnectionTimeOutL(TInt& aConnectionTimeOut)
+    {
+    return IntPropertyL(KConnectionTimeOutLocalName, aConnectionTimeOut);    
+    }
+TInt CSenLayeredVtcpTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
+    {
+    return CSenLayeredTransportProperties::DownloadFolderL(aDownloadFolder);
+    }
+
+TInt CSenLayeredVtcpTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
+    {
+    return CSenLayeredTransportProperties::FileAttachmentL(aCid, aFileName);
+    }
+
+CSenLayeredVtcpTransportProperties::CSenLayeredVtcpTransportProperties()
+    {
+    }
+
+CSenLayeredVtcpTransportProperties::~CSenLayeredVtcpTransportProperties()
+    {
+    }
+
+MSenProperties* CSenLayeredVtcpTransportProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenLayeredVtcpTransportProperties* pProperties = NewLC(element);
+    if ( ipChildProperties )
+        {
+        CSenLayeredVtcpTransportProperties* pChildProperties =
+                                (CSenLayeredVtcpTransportProperties*)ipChildProperties->CloneL();
+        pProperties->ipChildProperties = pChildProperties;
+        }
+    
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+TInt CSenLayeredVtcpTransportProperties::MwsNamespaceL(TPtrC8& aMwsNamespace)
+    {
+    return CSenLayeredTransportProperties::MwsNamespaceL(aMwsNamespace);
+    }
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senlayeredxmlproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1398 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include "senpropertieselement.h"   // private: Utils\inc
+#include "senpropertiesfragment.h"  // private: Utils\inc
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+
+#include "senlayeredxmlproperties.h"
+#include "SenXmlProperties.h"
+#include "senxmldebug.h"
+
+namespace
+    {
+    const TInt KFlatBufSize         = 64;  // CBufFlat
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewL()
+    {
+    CSenLayeredXmlProperties* pNew =
+            CSenLayeredXmlProperties::NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewLC()
+    {
+    CSenLayeredXmlProperties* pNew = new (ELeave) CSenLayeredXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewL(const TDesC8& aXmlUtf8,
+                                                         CSenXmlReader& aParser)
+    {
+    CSenLayeredXmlProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                          CSenXmlReader& aParser)
+    {
+    CSenLayeredXmlProperties* pNew = new (ELeave) CSenLayeredXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewL(const CSenElement& aElement)
+    {
+    CSenLayeredXmlProperties* pNew =
+                CSenLayeredXmlProperties::NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenLayeredXmlProperties* pNew = new (ELeave) CSenLayeredXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // Parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewL(RStringPool& aStringPool)
+    {
+    CSenLayeredXmlProperties* pNew =
+            CSenLayeredXmlProperties::NewLC(aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewLC(RStringPool& aStringPool)
+    {
+    CSenLayeredXmlProperties* pNew = new (ELeave) CSenLayeredXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL,
+                         &aStringPool);
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewL(const TDesC8& aXmlUtf8,
+                                                         CSenXmlReader& aParser,
+                                                         RStringPool& aStringPool)
+    {
+    CSenLayeredXmlProperties* pNew = NewLC(aXmlUtf8, aParser, aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                          CSenXmlReader& aParser,
+                                                          RStringPool& aStringPool)
+    {
+    CSenLayeredXmlProperties* pNew = new (ELeave) CSenLayeredXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser,
+                         &aStringPool);
+    return pNew;
+    }
+
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewL(const CSenElement& aElement,
+                                                         RStringPool& aStringPool)
+    {
+    CSenLayeredXmlProperties* pNew =
+                CSenLayeredXmlProperties::NewLC(aElement, aStringPool);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+CSenLayeredXmlProperties* CSenLayeredXmlProperties::NewLC(const CSenElement& aElement,
+                                                          RStringPool& aStringPool)
+    {
+    CSenLayeredXmlProperties* pNew = new (ELeave) CSenLayeredXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // Parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement, &aStringPool);
+    return pNew;
+    }
+
+    
+void CSenLayeredXmlProperties::SetReader(CSenXmlReader& aReader)
+    {
+    // De-allocate the owned reader, if one exists:
+    if( ipReader )
+        {
+        delete ipReader; 
+        ipReader = NULL;
+        }
+    // Note: ipFragment does not own the reader 
+    // behind the given reference (aReader) 
+    ipFragment->SetReader(aReader);
+    
+    if ( ipChildProperties )
+        {
+        ipChildProperties->SetReader(aReader);
+        }
+    }
+
+MSenProperties::TSenPropertiesClassType CSenLayeredXmlProperties::PropertiesClassType() 
+    { 
+    return ESenLayeredXmlProperties; 
+    }
+
+void CSenLayeredXmlProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    // Find out whether we should declare the namespace
+    TPtrC8 nsPrefix = ipFragment->NsPrefix();
+
+    // Element name
+    aWriteStream.WriteL(KSenLessThan);
+    if ( nsPrefix.Length() > 0 )
+        {
+        aWriteStream.WriteL(nsPrefix);
+        aWriteStream.WriteL(KSenColon);
+        }
+    aWriteStream.WriteL(ipFragment->AsElement().LocalName());
+
+    RPointerArray<CSenBaseAttribute>& attrs = ipFragment->AsElement().AttributesL();
+    RPointerArray<CSenNamespace>& namespaces = ipFragment->AsElement().NamespacesL();
+    if ( ( attrs.Count() > 0 ) || ( namespaces.Count() > 0 ) )
+        {
+        CSenNamespace* ns = NULL;
+        TInt count = namespaces.Count();
+        for (TInt i=0; i < count; i++)
+            {
+            ns = (namespaces)[i];
+            if (ns)
+                {
+                aWriteStream.WriteL(KSenSpaceXmlns);
+                if (ns->Prefix().Length() > 0)
+                    {
+                    aWriteStream.WriteL(KSenColon);
+                    aWriteStream.WriteL(ns->Prefix());
+                    }
+                aWriteStream.WriteL(KSenEqualsDblQuot);
+                aWriteStream.WriteL(ns->URI());
+                aWriteStream.WriteL(KSenDblQuot);
+                }
+            }
+        count = attrs.Count();
+        for (TInt j = 0; j < count; j++)
+            {
+            aWriteStream.WriteL(KSenSpace);
+            aWriteStream.WriteL((attrs)[j]->Name());
+            aWriteStream.WriteL(KSenEqualsDblQuot);
+            aWriteStream.WriteL((attrs)[j]->Value());
+            aWriteStream.WriteL(KSenDblQuot);
+            }
+        }
+        
+    // Elements and content
+    RPointerArray<CSenElement> elements;
+    ElementsL(elements);
+    if ( (elements.Count() > 0) || ipFragment->AsElement().HasContent() )
+        {
+        aWriteStream.WriteL(KSenGreaterThan);
+
+        // Body
+        TInt elementCount(elements.Count());
+        for (TInt k=0; k<elementCount; k++)
+            {
+            elements[k]->WriteAsXMLToL(aWriteStream);
+            }        
+        aWriteStream.WriteL(ipFragment->AsElement().Content());
+
+        // Closing element
+        aWriteStream.WriteL(KSenLessThanSlash);
+        if (nsPrefix.Length() > 0)
+            {
+            aWriteStream.WriteL(nsPrefix);
+            aWriteStream.WriteL(KSenColon);
+            }
+        aWriteStream.WriteL(ipFragment->AsElement().LocalName());
+        aWriteStream.WriteL(KSenGreaterThan);
+        }
+    else
+        {
+        aWriteStream.WriteL(KSenSlashGreaterThan);
+        }
+    elements.Close();
+    }
+
+void CSenLayeredXmlProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    // Sanity check: ignore zero-length strings
+    if ( aBuffer.Length() == 0)
+        {
+        return;
+        }
+    // Check if fragment already has a reference to *some*
+    // XML reader
+    if ( !ipFragment->Reader() )
+        {
+        // Check if there is already an owned reader instance
+        if( !ipReader )
+            {
+            ipReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+            }
+        // Sets reference of that XML reader for this fragment:
+        ipFragment->ParseWithL(*ipReader);
+        }
+    ipFragment->ParseL(aBuffer);   
+    }
+    
+HBufC8* CSenLayeredXmlProperties::AsUtf8L()
+    {
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+    this->WriteToL(bufWs);
+    CleanupStack::PopAndDestroy(); // bufWs.Close();
+    TPtrC8 p = pBuf->Ptr(0);    
+    HBufC8* pRet = p.AllocL();
+    CleanupStack::PopAndDestroy(); // pBuf;
+    return pRet;
+    
+    // return ipFragment->AsXmlL();
+    }
+
+HBufC8* CSenLayeredXmlProperties::AsUtf8LC()
+    {
+    HBufC8* pRet = this->AsUtf8L();
+    CleanupStack::PushL(pRet);
+    return pRet;
+    }
+    
+TInt CSenLayeredXmlProperties::SetPropertyL(const TDesC8& aName,
+                                            const TDesC8& aValue)
+    {
+	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if(!pElement)
+		{
+		// Add new element
+		pElement =  &ipFragment->AsElement().AddElementL(aName);
+		}
+    pElement->SetContentL(aValue);
+    return KErrNone;
+    }
+
+TInt CSenLayeredXmlProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+    {
+    if ( ipChildProperties )
+        {
+        TInt retVal = ipChildProperties->PropertyL(aName, aValue);
+        if ( retVal == KErrNotFound )
+            {
+        	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        	if ( pElement )
+        		{
+        		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+        		if ( pAttrValue )
+                    {
+                    if ( *pAttrValue == KSenOmittedTrueNoValue)
+        		        {
+                        return KErrSenOmitted;
+                        }
+                    else if ( *pAttrValue == KSenPropertyTrue)
+                        {
+                        return KErrSenOmitted;
+                        }
+        		    }
+        		aValue.Set(pElement->Content());
+        		return KErrNone;
+        		}
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+            
+        return retVal;
+        }
+    else
+        {
+    	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+    	if ( pElement )
+    		{
+    		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+    		if ( pAttrValue )
+                {
+                if ( *pAttrValue == KSenOmittedTrueNoValue)
+    		        {
+                    return KErrSenOmitted;
+                    }
+                else if ( *pAttrValue == KSenPropertyTrue)
+                    {
+                    return KErrSenOmitted;
+                    }
+    		    }
+        	aValue.Set(pElement->Content());
+        	return KErrNone;
+    		}
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    }
+    
+TInt CSenLayeredXmlProperties::SetIntPropertyL(const TDesC8& aName,
+                                               const TInt aValue)
+    {
+    TBuf8<KFlatBufSize> buffer;
+    buffer.Num(aValue);
+    return SetPropertyL(aName, buffer);
+    }
+
+TInt CSenLayeredXmlProperties::IntPropertyL(const TDesC8& aName, TInt& aValue)
+    {
+    TPtrC8 value;
+    TInt retVal(KErrNone);
+    retVal = PropertyL(aName, value);
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aValue);
+        }
+    return retVal;
+    }
+    
+TInt CSenLayeredXmlProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                const TBool aValue)
+    {
+    if ( aValue )
+        {
+        return SetPropertyL(aName, KSenPropertyTrue);
+        }
+    else
+        {
+        return SetPropertyL(aName, KSenPropertyFalse);
+        }
+    }
+
+TInt CSenLayeredXmlProperties::BoolPropertyL(const TDesC8& aName,
+                                             TBool& aValue)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 value;
+    retVal = PropertyL(aName, value);
+    if ( retVal == KErrNone )
+        {
+        if (value == KSenPropertyTrue)
+            {
+            aValue = ETrue;
+            }
+        else if (value == KSenPropertyFalse)
+            {
+            aValue = EFalse;
+            }
+        else
+            {
+            retVal = KErrGeneral;
+            }
+        }
+    return retVal;
+    }
+    
+TInt CSenLayeredXmlProperties::SetOmittedL(const TDesC8& aName, TBool aValue)
+    {
+    TBool newElementCreated = EFalse;
+ 	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if ( !pElement )
+		{
+		// Add new element
+		pElement =  &ipFragment->AsElement().AddElementL(aName);
+		newElementCreated = ETrue;
+		}
+    else
+        {
+        const TDesC8* pVal = pElement->AttrValue(KSenOmittedAttributeName);
+        if ( pVal )
+            {
+            delete SenXmlUtils::RemoveAttributeL(*pElement, KSenOmittedAttributeName);
+            }
+        }
+      
+    if ( pElement )  
+        {
+        if ( aValue )
+            {
+            if ( newElementCreated )
+                {
+                SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenOmittedTrueNoValue);
+                }
+            else
+                {
+                SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenPropertyTrue);
+                }
+            }
+        else
+            {
+            SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenPropertyFalse);
+            }
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+        
+    return KErrNone;   
+    }
+    
+TInt CSenLayeredXmlProperties::RemovePropertyL(const TDesC8& aName)
+    {
+ 	CSenElement* pElement = ipFragment->AsElement().RemoveElement(aName);
+	if ( pElement )
+		{
+		delete pElement;
+		return KErrNone;
+		}
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+void CSenLayeredXmlProperties::WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( ipChildProperties )
+            {
+            ipChildProperties->AsUtf8L(aLayer);
+            }
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+            ipFragment->WriteAsXMLToL(aWriteStream);
+            }
+        }
+    }
+
+void CSenLayeredXmlProperties::ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer)
+    {
+
+    // Sanity check: ignore zero-length strings
+    if ( aBuffer.Length() == 0)
+        {
+        return;
+        }
+
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            CreateChildPropertiesL();	//codescannerwarnings
+            }
+        ipChildProperties->ReadFromL(aBuffer, aLayer);
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+            if ( !ipFragment->Reader() )
+                {
+                if ( !ipReader )
+                    {
+                    ipReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+                    }
+                ipFragment->ParseWithL(*ipReader);
+                }
+            ipFragment->ParseL(aBuffer);   
+            }
+        }
+    }
+
+HBufC8* CSenLayeredXmlProperties::AsUtf8L(TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            return NULL;
+            }
+        else
+            {
+            return ipChildProperties->AsUtf8L(aLayer);
+            }
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+            return ipFragment->AsXmlL();
+            }
+        else
+            {
+            return NULL;
+            }
+        }
+    }
+
+HBufC8* CSenLayeredXmlProperties::AsUtf8LC(TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            return NULL;
+            }
+        else
+            {
+            return ipChildProperties->AsUtf8LC(aLayer);
+            }
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+            HBufC8* pAsXml = ipFragment->AsXmlL();
+            CleanupStack::PushL(pAsXml);
+            return pAsXml;
+            }
+        else
+            {
+            return NULL;
+            }
+        }
+    }
+    
+TBool CSenLayeredXmlProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenLayeredXmlProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse; // has only abstact, layered TP super classes 
+        }
+    }    
+    
+TInt CSenLayeredXmlProperties::ShrinkTo(TSenPropertiesLayer aLayer)
+    {
+    if ( ipChildProperties )
+        {
+        return ipChildProperties->ShrinkTo(aLayer);
+        }
+    else
+        {
+        if (iLayer > aLayer)
+            {
+            CSenLayeredXmlProperties* pParent = ipParentProperties;
+            delete this;
+            pParent->ipChildProperties = NULL;
+            return pParent->ShrinkTo(aLayer);
+            }
+        else
+            {
+            if (iLayer < aLayer)
+                {
+                return KErrNotFound;
+                }
+            }
+        }
+    return KErrNone;
+    }
+    
+void CSenLayeredXmlProperties::ExpandToL(TSenPropertiesLayer aLayer)
+    {
+    if ( ipChildProperties )
+        {
+        if (iLayer < aLayer)
+            {
+            ipChildProperties->ExpandToL(aLayer);
+            }
+        }
+    else
+        {
+        if (iLayer < aLayer)
+            {
+            CreateChildPropertiesL();	//codescannerwarnings
+            ipChildProperties->ExpandToL(aLayer);
+            }
+        }    
+    }
+    
+MSenLayeredProperties::TSenPropertiesLayer CSenLayeredXmlProperties::TopLayer()
+    {
+    if ( ipChildProperties )
+        {
+        return ipChildProperties->TopLayer();
+        }
+    else
+        {
+        return iLayer;
+        }    
+    }
+    
+TInt CSenLayeredXmlProperties::SetPropertyL(const TDesC8& aName,
+                                            const TDesC8& aValue,
+                                            TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            CreateChildPropertiesL();	//codescannerwarnings
+            }
+        return ipChildProperties->SetPropertyL(aName, aValue, aLayer);
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+        	CSenElement* pChildElement = ipFragment->AsElement().Element(aName);
+        	if(!pChildElement)
+        		{
+        		// Add new element
+        		pChildElement =  &ipFragment->AsElement().AddElementL(aName);
+        		}
+        	pChildElement->SetContentL(aValue);
+            return KErrNone;
+            }
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    }
+
+TInt CSenLayeredXmlProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue,
+                                         TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            return KErrNotFound;
+            }
+        else
+            {
+            return ipChildProperties->PropertyL(aName, aValue, aLayer);
+            }
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+        	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        	if( pElement )
+        		{
+        		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+        		if ( pAttrValue )
+                    {
+                    if ( *pAttrValue == KSenOmittedTrueNoValue)
+        		        {
+                        return KErrSenOmitted;
+                        }
+                    else if ( *pAttrValue == KSenPropertyTrue)
+                        {
+                        return KErrSenOmitted;
+                        }
+        		    }
+        		aValue.Set(pElement->Content());
+                return KErrNone;
+        		}
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    }
+    
+TInt CSenLayeredXmlProperties::PropertyL(const TDesC8& aName,
+                                         MSenProperty*& aValue,
+                                         TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            return KErrNotFound;
+            }
+        else
+            {
+            return ipChildProperties->PropertyL(aName, aValue, aLayer);
+            }
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+        	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        	if( pElement )
+        		{
+                CSenPropertiesElement* pPropertiesElement
+                    = (CSenPropertiesElement*)pElement;
+        		aValue = pPropertiesElement;
+                return KErrNone;
+        		}
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    
+    }
+        
+TInt CSenLayeredXmlProperties::PropertyL(const TDesC8& aName,
+                                         MSenProperty*& aValue)
+    {
+    if ( ipChildProperties )
+        {
+        TInt retVal = ipChildProperties->PropertyL(aName, aValue);
+        if ( retVal == KErrNotFound )
+            {
+        	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        	if ( pElement )
+        		{
+        		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+        		if ( pAttrValue )
+                    {
+                    if ( *pAttrValue == KSenOmittedTrueNoValue)
+        		        {
+                        return KErrSenOmitted;
+                        }
+                    else if ( *pAttrValue == KSenPropertyTrue)
+                        {
+                        return KErrSenOmitted;
+                        }
+        		    }        		
+                CSenPropertiesElement* pPropertyElement 
+                    = (CSenPropertiesElement*) pElement;
+        		aValue = pPropertyElement;
+        		return KErrNone;
+        		}
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+            
+        return retVal;
+        }
+    else
+        {
+    	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        if ( pElement )
+            {
+    		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+    		if ( pAttrValue )
+                {
+                if ( *pAttrValue == KSenOmittedTrueNoValue)
+    		        {
+                    return KErrSenOmitted;
+                    }
+                else if ( *pAttrValue == KSenPropertyTrue)
+                    {
+                    return KErrSenOmitted;
+                    }
+    		    }            
+            CSenPropertiesElement* pPropertyElement 
+                = (CSenPropertiesElement*) pElement;
+        	aValue = pPropertyElement;
+            return KErrNone;
+    		}
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    }
+    
+TInt CSenLayeredXmlProperties::SetPropertyL(const TDesC8& aName,
+                                            const TDesC8& aValue,
+                                            const TDesC8& aType)
+    {
+	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if ( !pElement )
+		{
+		// Add new element
+		pElement =  &ipFragment->AsElement().AddElementL(aName);
+		}
+    pElement->SetContentL(aValue);
+	SenXmlUtils::AddAttributeL(*pElement, KSenTypeAttributeName, aType);
+    return KErrNone;
+    }
+
+TInt CSenLayeredXmlProperties::PropertyL(const TDesC8& aName,
+                                         TPtrC8& aValue,
+                                         TPtrC8& aType)
+    {
+    if ( ipChildProperties )
+        {
+        TInt retVal = ipChildProperties->PropertyL(aName, aValue);
+        if ( retVal == KErrNotFound )
+            {
+        	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        	if ( pElement )
+        		{
+        		/*
+                CSenPropertiesElement* pPropertyElement 
+                    = (CSenPropertiesElement*) pElement;
+        		aValue.Set(pPropertyElement->Value());
+        		aType.Set(pPropertyElement->Type());
+        		*/
+        		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+        		if ( pAttrValue )
+                    {
+                    if ( *pAttrValue == KSenOmittedTrueNoValue)
+        		        {
+                        return KErrSenOmitted;
+                        }
+                    else if ( *pAttrValue == KSenPropertyTrue)
+                        {
+                        return KErrSenOmitted;
+                        }
+        		    }
+        		aValue.Set(pElement->Content());
+        		aType.Set(*pElement->AttrValue(KSenTypeAttributeName));
+        		return KErrNone;
+        		}
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+            
+        return retVal;
+        }
+    else
+        {
+    	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        if ( pElement )
+            {
+            /*
+            CSenPropertiesElement* pPropertyElement 
+                = (CSenPropertiesElement*) pElement;
+    		aValue.Set(pPropertyElement->Value());
+    		aType.Set(pPropertyElement->Type());
+    		*/
+    		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+    		if ( pAttrValue )
+                {
+                if ( *pAttrValue == KSenOmittedTrueNoValue)
+    		        {
+                    return KErrSenOmitted;
+                    }
+                else if ( *pAttrValue == KSenPropertyTrue)
+                    {
+                    return KErrSenOmitted;
+                    }
+    		    }
+    		aValue.Set(pElement->Content());
+    		aType.Set(*pElement->AttrValue(KSenTypeAttributeName));
+            return KErrNone;
+    		}
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    }    
+     
+    
+
+TInt CSenLayeredXmlProperties::PropertiesByTypeL(const TDesC8& aType,
+                                                 RPointerArray<MSenProperty>& aArray)
+    {
+    TInt retVal(KErrNotFound);
+
+    retVal = AllPropertiesByTypeL(aType, aArray);
+
+    // Remove omitted values from the array.
+    TInt propsCount = aArray.Count()-1;
+    for (TInt i=propsCount; i>=0; i--)
+        {
+        CSenPropertiesElement* pElement = (CSenPropertiesElement*)aArray[i];
+		const TDesC8* pAttrValue = pElement->AttrValue(KSenOmittedAttributeName);
+		if ( pAttrValue )
+            {
+            if ( *pAttrValue == KSenOmittedTrueNoValue)
+		        {
+		        aArray.Remove(i);
+                }
+            else if ( *pAttrValue == KSenPropertyTrue)
+                {
+		        aArray.Remove(i);
+                }
+            }
+        }
+    
+    if ( aArray.Count() > 0 )
+        {
+        retVal=KErrNone;
+        }
+    
+    return retVal;
+    }
+
+TInt CSenLayeredXmlProperties::AllPropertiesByTypeL(const TDesC8& aType,
+                                                    RPointerArray<MSenProperty>& aArray)
+    {
+    TInt retVal(KErrNotFound);
+    if ( ipChildProperties )
+        {
+        retVal = ipChildProperties->AllPropertiesByTypeL(aType, aArray);
+        }
+
+    CSenElement& element = ipFragment->AsElement();
+    RPointerArray<CSenElement>& elements = element.ElementsL();
+    TInt elementCount(elements.Count());
+    TInt propsCount(0);
+    TBool found(EFalse);
+    for (TInt i=0; i<elementCount; i++)
+        {
+        CSenElement* pElement = elements[i];
+        found = EFalse;
+
+        // Go through properties which are already added into returned array.
+        // => If property is already in the array
+        //    it won't be added into array for the second time.
+        propsCount = aArray.Count();
+        for (TInt j=0; j<propsCount; j++)
+            {
+             MSenProperty* pProperty = aArray[j];
+             if ( pElement->LocalName() == pProperty->Name() )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        
+        if ( !found )
+            {
+            const TDesC8* propertyType =
+                        pElement->AttrValue(KSenTypeAttributeName);
+
+            if ( propertyType )
+                {
+                if ( *propertyType == aType )
+                    {
+#ifdef EKA2
+                    CSenPropertiesElement* pPropElement
+                        = (CSenPropertiesElement*)pElement;
+                    aArray.AppendL(pPropElement);
+#else
+                    CSenPropertiesElement* pPropElement
+                        = (CSenPropertiesElement*)pElement;
+			        User::LeaveIfError(aArray.Append(pPropElement));
+#endif
+                    }
+                }
+            }
+        }
+
+    if ( aArray.Count() > 0 )
+        {
+        retVal=KErrNone;
+        }
+        
+    return retVal;
+    }
+    
+TInt CSenLayeredXmlProperties::SetIntPropertyL(const TDesC8& aName, const TInt aValue,
+                                               TSenPropertiesLayer aLayer)
+    {
+    TBuf8<KFlatBufSize> buffer;
+    buffer.Num(aValue);
+    return SetPropertyL(aName, buffer, aLayer);
+    }
+
+TInt CSenLayeredXmlProperties::IntPropertyL(const TDesC8& aName, TInt& aValue,
+                                            TSenPropertiesLayer aLayer)
+    {
+    TPtrC8 value;
+    TInt retVal(KErrNone);
+    retVal = PropertyL(aName, value, aLayer);
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aValue);
+        }
+    return retVal;
+    }
+    
+TInt CSenLayeredXmlProperties::SetBoolPropertyL(const TDesC8& aName, const TBool aValue,
+                                                TSenPropertiesLayer aLayer)
+    {
+    if ( aValue )
+        {
+        return SetPropertyL(aName, KSenPropertyTrue, aLayer);
+        }
+    else
+        {
+        return SetPropertyL(aName, KSenPropertyFalse, aLayer);
+        }
+    }
+
+TInt CSenLayeredXmlProperties::BoolPropertyL(const TDesC8& aName, TBool& aValue,
+                                             TSenPropertiesLayer aLayer)
+    {
+    TPtrC8 value;
+    TInt retVal(KErrNone);
+    retVal = PropertyL(aName, value, aLayer);
+    if ( retVal == KErrNone )
+        {
+        if (value == KSenPropertyTrue)
+            {
+            aValue = ETrue;
+            }
+        else if (value == KSenPropertyFalse)
+            {
+            aValue = EFalse;
+            }
+        else
+            {
+            retVal = KErrGeneral;
+            }
+        }
+    return retVal;
+    }
+    
+TInt CSenLayeredXmlProperties::SetOmittedL( const TDesC8& aName, 
+                                            TBool aValue,
+                                            TSenPropertiesLayer aLayer )
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            CreateChildPropertiesL();	//codescannerwarnings
+            }
+        return ipChildProperties->SetOmittedL(aName, aValue, aLayer);
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+            TBool newElementCreated = EFalse;
+         	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+        	if ( !pElement )
+        		{
+        		// Add new element
+        		pElement =  &ipFragment->AsElement().AddElementL(aName);
+        		newElementCreated = ETrue;
+        		}
+            else
+                {
+                const TDesC8* pVal = pElement->AttrValue(KSenOmittedAttributeName);
+                if ( pVal )
+                    {
+                    delete SenXmlUtils::RemoveAttributeL(*pElement, KSenOmittedAttributeName);
+                    }
+                }
+              
+            if ( pElement )  
+                {
+                if ( aValue )
+                    {
+                    if ( newElementCreated )
+                        {
+                        SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenOmittedTrueNoValue);
+                        }
+                    else
+                        {
+                        SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenPropertyTrue);
+                        }
+                    }
+                else
+                    {
+                    SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenPropertyFalse);
+                    }
+                }
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+        
+    return KErrNone;
+    }
+
+TInt CSenLayeredXmlProperties::RemovePropertyL(const TDesC8& aName,
+                                               TSenPropertiesLayer aLayer)
+    {
+    if ( aLayer > iLayer )
+        {
+        if ( !ipChildProperties )
+            {
+            return KErrNotFound;
+            }
+        return ipChildProperties->RemovePropertyL(aName, aLayer);
+        }
+    else
+        {
+        if ( aLayer == iLayer )
+            {
+         	CSenElement* pElement = ipFragment->AsElement().RemoveElement(aName);
+        	if ( pElement )
+        		{
+        		delete pElement;
+        		return KErrNone;
+        		}
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+        else
+            {
+            return KErrNotFound;
+            }
+        }
+    }
+
+void CSenLayeredXmlProperties::CreateChildPropertiesL()	//codescannerwarnings
+    {
+    if ( !ipFragment->Reader() )
+        {
+        if( !ipReader )
+            {
+            ipReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+            }
+        ipFragment->ParseWithL(*ipReader);
+        }
+    
+    if ( ipFragment->HasStringPool() )
+        {
+        ipChildProperties =
+                CSenLayeredXmlProperties::NewL(ipFragment->StringPool());
+        }
+    else
+        {
+        ipChildProperties = CSenLayeredXmlProperties::NewL();
+        }
+    ipChildProperties->ipParentProperties = this;
+    ipChildProperties->ipFragment->ParseWithL(*ipFragment->Reader());
+    
+    switch ( iLayer )
+        {
+        case ESenTransportLayer:
+            ipChildProperties->iLayer = ESenSereneLayer;
+            break;
+        case ESenSereneLayer:
+            ipChildProperties->iLayer = ESenFrameworkLayer;
+            break;
+        case ESenFrameworkLayer:
+            ipChildProperties->iLayer = ESenProviderSessionLayer;
+            break;
+        case ESenProviderSessionLayer:
+            ipChildProperties->iLayer = ESenConsumerSessionLayer;
+            break;
+        case ESenConsumerSessionLayer:
+            ipChildProperties->iLayer = ESenMessageLayer;
+            break;
+        case ESenMessageLayer:
+            // Not possible
+            break;
+        default:
+            // Not possible
+            break;
+        }
+    }
+    
+void CSenLayeredXmlProperties::ElementsL(RPointerArray<CSenElement>& aProps) const
+    {
+    if ( ipChildProperties )
+        {
+        ipChildProperties->ElementsL(aProps);
+        }
+            
+    RPointerArray<CSenElement>& elements = ipFragment->AsElement().ElementsL();
+    TInt elementCount(elements.Count());
+    TInt propsCount(0);
+    TBool found;
+    for (TInt i=0; i<elementCount; i++)
+        {
+        found = EFalse;
+        propsCount = aProps.Count();
+        for (TInt j=0; j<propsCount; j++)
+            {
+             if ( elements[i]->LocalName() == aProps[j]->LocalName() )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        if ( !found )
+            {
+#ifdef EKA2
+            aProps.AppendL(elements[i]);
+#else
+            User::LeaveIfError(aProps.Append(elements[i]));
+#endif
+            }
+        }
+    }
+
+MSenProperties* CSenLayeredXmlProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenLayeredXmlProperties* pProperties = NewLC(element);
+    if ( ipChildProperties )
+        {
+        CSenLayeredXmlProperties* pChildProperties =
+                                (CSenLayeredXmlProperties*)ipChildProperties->CloneL();
+        pProperties->ipChildProperties = pChildProperties;
+        }
+    
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+MSenProperties* CSenLayeredXmlProperties::Clone(TInt& aOkOrError) const
+    {
+    MSenProperties* pClone = NULL;
+    TRAP( aOkOrError, pClone = CloneL(); )
+    return pClone;
+    }
+
+void CSenLayeredXmlProperties::BaseConstructL(
+                                        const TDesC8& aLocalname, 
+                                        const TDesC8& aXml,
+                                        CSenXmlReader* aParser,
+                                        RStringPool* aStringPool)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aLocalname, aStringPool);
+    if ( aParser && aXml!=KNullDesC8 )
+        {
+        // Do parsing
+        ipFragment->ParseWithL(*aParser);
+        ipFragment->ParseL(aXml);
+        }
+   }
+
+void CSenLayeredXmlProperties::BaseConstructL(
+                                        const TDesC8& aNamespace, 
+                                        const TDesC8& aLocalname, 
+                                        const TDesC8& aXml,
+                                        CSenXmlReader* aParser,
+                                        RStringPool* aStringPool)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aNamespace,
+                                              aLocalname,
+                                              aStringPool);
+    if ( aParser && aXml != KNullDesC8 )
+        {
+        // Do parsing
+        ipFragment->ParseWithL(*aParser);
+        ipFragment->ParseL(aXml);
+        }
+    }
+
+void CSenLayeredXmlProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                       const TDesC8& aLocalname, 
+                                       const TDesC8& aQualifiedName, 
+                                       const TDesC8& aXml,
+                                       CSenXmlReader* aParser,
+                                       RStringPool* aStringPool)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aNamespace, 
+                                              aLocalname, 
+                                              aQualifiedName,
+                                              aStringPool);
+    if ( aParser && aXml != KNullDesC8 )
+        {
+        // Do parsing
+        ipFragment->ParseWithL(*aParser);
+        ipFragment->ParseL(aXml);
+        }
+    }
+
+void CSenLayeredXmlProperties::BaseConstructL(const CSenElement& aElement,
+                                              RStringPool* aStringPool)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aElement.LocalName(),
+                                              aStringPool);
+    
+    CSenElement& element = ipFragment->AsElement();
+    element.CopyFromL((CSenElement&)aElement);
+    }
+
+CSenLayeredXmlProperties::CSenLayeredXmlProperties()
+    : ipFragment(NULL),
+      ipChildProperties(NULL),
+      iLayer(ESenTransportLayer),
+      ipReader(NULL),
+      ipParentProperties(NULL)
+    {
+    }
+
+CSenLayeredXmlProperties::~CSenLayeredXmlProperties()
+    {
+    delete ipReader;
+    delete ipFragment;
+    delete ipChildProperties;
+    }
+
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senmessagecontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,491 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senmessagecontext.h" 
+#include "sencontextitem.h"
+#include "SenElement.h"
+
+#include "sencontextitem.h"
+#include "SenXmlReader.h"
+#include "msenremoteserviceconsumer.h"
+
+#include "MSenMessage.h"
+#include "senmessagebase.h"
+#include "SenSoapEnvelope2.h"
+#include "senatomentry.h"
+#include "SenSoapMessage2.h"
+
+#include "MSenProperties.h"
+
+#include "SenXmlReader.h"
+
+#include "senlayeredtransportproperties.h"
+#include <SenTransportProperties.h>
+
+
+EXPORT_C CSenMessageContext* CSenMessageContext::NewL(SenContext::TContextDirection aDirection, 
+                                                      MSenProperties* apOwnedTp)
+    {
+    CSenMessageContext* pNew = CSenMessageContext::NewLC(aDirection, apOwnedTp);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenMessageContext* CSenMessageContext::NewLC(SenContext::TContextDirection aDirection,
+                                                       MSenProperties* apOwnedTp)
+    {
+    CSenMessageContext* pNew = new (ELeave) CSenMessageContext(aDirection, apOwnedTp);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenMessageContext::CSenMessageContext(SenContext::TContextDirection aDirection,
+                                                MSenProperties* apOwnedTp)
+:  CSenContext( aDirection),
+   ipOwnedTp ( apOwnedTp )
+    {
+    }
+
+EXPORT_C CSenMessageContext::~CSenMessageContext()
+    {
+    if( ipOwnedTp )
+        {
+        if( ipOwnedTp->IsSafeToCast(MSenProperties::ESenXmlProperties) )
+            {
+            CSenXmlProperties* p = (CSenXmlProperties*)ipOwnedTp;
+            delete p;
+            }
+        else if( ipOwnedTp->IsSafeToCast(MSenProperties::ESenLayeredXmlProperties) )
+            {
+            CSenLayeredXmlProperties* lp = (CSenLayeredXmlProperties*)ipOwnedTp;
+            delete lp;
+            }
+            ipOwnedTp = NULL;
+        }
+    }
+       
+EXPORT_C void CSenMessageContext::BaseConstructL()
+    {
+    CSenContext::BaseConstructL();
+    }
+
+// From MSenMessageContext:
+SenContext::TContextType CSenMessageContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+       
+SenContext::TContextDirection CSenMessageContext::Direction() const
+    {
+    return CSenContext::Direction();
+    }
+       
+TInt CSenMessageContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenMessageContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TDesC8* CSenMessageContext::GetDesC8L(const TDesC8& aKey)
+    {
+    return CSenContext::GetDesC8L( aKey );
+    }
+       
+TInt CSenMessageContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenMessageContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TInt* CSenMessageContext::GetIntL(const TDesC8& aKey)
+    {
+    return CSenContext::GetIntL( aKey );
+    }
+       
+TInt CSenMessageContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenMessageContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const CSenElement* CSenMessageContext::GetSenElementL(const TDesC8& aKey)
+    {
+    return CSenContext::GetSenElementL( aKey );
+    }
+       
+TInt CSenMessageContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenMessageContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+TAny* CSenMessageContext::GetAnyL(const TDesC8& aKey)		//codescannerwarnings
+    {
+    return CSenContext::GetAnyL( aKey );		//codescannerwarnings
+    }
+       
+TInt CSenMessageContext::Remove(const TDesC8& aKey) 
+    {
+    return CSenContext::Remove(aKey);
+    }
+
+TInt CSenMessageContext::Count() const
+    {
+    return CSenContext::Count();
+    }
+
+TPtrC8 CSenMessageContext::KeyAtL(TInt aIndex)
+    {
+    return CSenContext::KeyAtL(aIndex);
+    }
+
+void CSenMessageContext::Reset()
+    {
+    CSenContext::Reset();
+    }
+    
+CSenSoapMessage* CSenMessageContext::GetCurrentSoapMessage() // DEPRECATED: 
+    {
+    CSenSoapMessage* pSoapMessage = NULL;
+    
+    TInt index = iItems.Find( KSenCtxKeyCurrentSoapMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        TRAPD( err, pSoapMessage = &(pItem->ToSenSoapMessageL()); )
+        if( err )
+            {
+            pSoapMessage = NULL;   
+            }
+        }
+    return pSoapMessage;
+    }
+    
+TPtrC8 CSenMessageContext::GetMessageL()
+    {
+    TPtrC8 retVal( KNullDesC8 );        
+    TInt index = iItems.Find( KSenCtxKeyCurrentMessageAsDesc );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        TInt err( KErrNone );
+        //TRAP( err, retVal.Set ( *(pItem->ToDesC8L()) );
+        TRAP
+            ( 
+            err, 
+            const TDesC8* pDesc = pItem->ToDesC8L(); 
+            if( pDesc )
+                {
+                retVal.Set( *pDesc );
+                }
+            )
+        err = 0; // ignored
+        }
+    return retVal;
+    }
+    
+TInt CSenMessageContext::Add(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );    
+    }
+    
+TInt CSenMessageContext::Update(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+    
+const CSenSoapEnvelope* CSenMessageContext::GetSenSoapEnvelopeL(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find( aKey );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const CSenSoapEnvelope* envelope = ((CSenSoapEnvelope*)&(pItem->ToSenSoapMessageL()));
+        return envelope;
+        }
+    return NULL;
+    }
+    
+MSenMessage* CSenMessageContext::MessageL()		//codescannerwarnigs
+    {
+    TInt index = iItems.Find( KSenCtxKeyMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((MSenMessage*)&(pItem->ToSenMessageL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenMessageContext::SetMessage(MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyMessage(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+    
+CSenChunk* CSenMessageContext::ChunkL()	//codescannerwarnings
+    {
+    TInt index = iItems.Find( KSenCtxKeyChunk );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((CSenChunk*)&(pItem->ToSenChunkL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenMessageContext::SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(apMsgAsChunk); )
+        }
+    else // chunk is not to be owned
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(*apMsgAsChunk); )
+        }
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyChunk(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+
+TInt CSenMessageContext::SetProperties(MSenProperties* apProperties, TBool aOwned)
+    {
+    if( !apProperties )
+        {
+        return KErrArgument;
+        }
+        
+    TInt retCode(KErrNone);
+    if ( aOwned )
+        {
+        delete ipOwnedTp;
+        ipOwnedTp = NULL;
+        ipOwnedTp = apProperties;
+        }
+    else
+        {
+        
+        CSenContextItem* pItem = NULL;
+        TInt leaveCode(KErrNone);
+//        if( aOwned )
+//            {
+//            TRAP( leaveCode, pItem = CSenContextItem::NewL(apProperties); )
+//            }
+//        else // chunk is not to be owned
+//            {
+            TRAP( leaveCode, pItem = CSenContextItem::NewL(*apProperties); )
+//            }
+
+        if( leaveCode != KErrNone ) 
+            {
+            delete pItem; // should ALWAYS be NULL(!)
+            return leaveCode;
+            }
+            
+        retCode = iItems.UpdateValue(&KSenCtxKeyChunk(), pItem);
+        if( retCode != KErrNone && aOwned )
+            {
+            delete pItem; // delete the orphan item
+            } 
+        }
+    return retCode;
+    }
+
+
+MSenProperties* CSenMessageContext::Properties()
+    {
+    if( ipOwnedTp )
+        {
+        return ipOwnedTp;
+        }
+    else
+        {
+        TInt index = iItems.Find( KSenCtxKeyMessageProperties );
+        if ( index != KErrNotFound )
+            {
+            const CSenContextItem* pItem = iItems.ValueAt(index);
+            if( pItem->Type() == MSenContextItem::EMSenProperties )
+                {
+                MSenProperties* pProperties = (MSenProperties*)pItem;
+                return pProperties;
+                }
+            }
+        return NULL;
+        }
+    }
+
+// Method for adding an "intermediate" message behind certain key; used normally to conduct final "service message"
+TInt CSenMessageContext::Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+    
+// Method for updating some "intermediate" message behind certain key; used normally to conduct final "service message"    
+TInt CSenMessageContext::Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem;
+        }
+    return retCode;    
+    }
+    
+// Method for getting "intermediate" message behind certain key; used normally to conduct final "service message"    
+MSenMessage* CSenMessageContext::GetMessageL(const TDesC8& aKey)	//codescannerwarnings
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if(pItem)
+            {
+            return &pItem->ToSenMessageL();
+            }
+        }
+    return NULL;    
+    }
+ 
+// private helper method(s):
+CSenContextItem* CSenMessageContext::MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError)
+    {
+    aError = KErrNone;
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        if( apMessage->IsSafeToCast( MSenMessage::EMessageBase ) )
+            {
+            CSenMessageBase* msgBase = (CSenMessageBase*) apMessage;
+            TRAP( aError, pItem = CSenContextItem::NewL( msgBase ); )
+            }
+        else if ( apMessage->IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+            {
+            CSenSoapEnvelope2* msgSoap2 = (CSenSoapEnvelope2*) apMessage;
+            TRAP( aError,  pItem = CSenContextItem::NewL( msgSoap2 ); )
+            }
+        else if ( apMessage->IsSafeToCast( MSenMessage::EAtomMessage ) )
+            {
+            CSenAtomEntry* msgAtomEntry = (CSenAtomEntry*) apMessage;
+            TRAP( aError,  pItem = CSenContextItem::NewL( msgAtomEntry ); )
+            }
+        else 
+            {
+            aError = KErrNotSupported;
+            return NULL;
+            }
+        }
+    else // provided message is *not to be owned*
+        {
+        TRAP( aError, pItem = CSenContextItem::NewL(*apMessage); )
+        }
+    return pItem;        
+    } 
+    
+TInt CSenMessageContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    CSenContext::SetDirection( aDirection );
+    return KErrNone;
+    }
+
+const CSenXmlReader* CSenMessageContext::GetParser()
+    {
+    return CSenContext::GetParser();
+    }
+       
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senmtomutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,321 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+#include "senmtomutils.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Serializes SoapEnvelope message in XOP message
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::SerializeEnvelope2L(CSenSoapEnvelope2& aSoapEnvelope2, 
+                                                RBuf8& aXopEnvelope)
+    {
+	__ASSERT_ALWAYS(&aSoapEnvelope2, 
+	                User::Panic(KMtomNoRequestSoapEnvelopePanicText, EMtomNoRequestSoapEnvelope));
+	RSenDocument doc = aSoapEnvelope2.AsDocumentL();
+    CXmlEngSerializer* serializer = CXmlEngSerializer::NewL(ESerializerXOPInfoset);
+	__ASSERT_ALWAYS(serializer, User::Panic(KMtomPanicText, KErrNotFound));
+    CleanupStack::PushL(serializer);
+    TXmlEngSerializationOptions options(TXmlEngSerializationOptions::KOptionIndent & TXmlEngSerializationOptions::KOptionOmitXMLDeclaration);
+    serializer->SetOutput(aXopEnvelope);	
+    serializer->SetSerializationOptions(options);
+    serializer->SerializeL(doc);
+    CleanupStack::PopAndDestroy(serializer);
+    }
+
+// ---------------------------------------------------------------------------
+// Generates random content-ID for header of XOP message and for headers of BLOBs 
+// as randomNumber@homeTime
+// @param aRootCid is ReAlloc'd, which means that any existing data is freed
+// prior the generated root cid is assinged to that buffer.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::GenerateRandomRootCidL(RBuf8& aRootCid)
+    {
+    _LIT8(KAt, "@");
+	TTime now;
+	now.HomeTime();
+	TInt64 homeTime = now.Int64();
+	TInt64 randomNumber = Math::Random();
+	aRootCid.ReAllocL(32+KAt().Length());
+	aRootCid.AppendNum(randomNumber);
+	aRootCid.Append(KAt);
+	aRootCid.AppendNum(homeTime);
+    }
+
+// ---------------------------------------------------------------------------
+// Generates random boundary for mime header as randomNumber
+// @param aBoundary is ReAlloc'd, which means that any existing data is freed
+// prior the generated root cid is assinged to that buffer.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::GenerateRandomBoundaryL(RBuf8& aBoundary)
+    {
+  	TInt64 randomNumber = Math::Random();
+  	aBoundary.ReAllocL(16);
+	aBoundary.AppendNum(randomNumber);
+    }
+
+// ---------------------------------------------------------------------------
+// Generates MimeBoundary to separate mime parts of the message
+// as --randomNumber
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::BoundaryLineStartL(const RBuf8& aBoundary, RBuf8& aBoundaryStart)
+	{
+	aBoundaryStart.ReAllocL(KNewLine().Length()+KDush().Length()+aBoundary.Length());
+	aBoundaryStart.Append(KDush);
+	aBoundaryStart.Append(aBoundary);
+	aBoundaryStart.Append(KNewLine);
+	}
+
+// ---------------------------------------------------------------------------
+// Generates MimeBoundaryEnd to end the multipart message (MTOM message)
+// as --randomNumber--
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::BoundaryLineEndL(const RBuf8& aBoundary, RBuf8& aBoundaryEnd)
+	{
+	aBoundaryEnd.ReAllocL(3*KNewLine().Length()+2*KDush().Length()+aBoundary.Length());
+	aBoundaryEnd.Append(KNewLine);
+	aBoundaryEnd.Append(KNewLine);
+	aBoundaryEnd.Append(KDush);
+	aBoundaryEnd.Append(aBoundary);
+	aBoundaryEnd.Append(KDush);
+	aBoundaryEnd.Append(KNewLine);
+	}
+         
+// ---------------------------------------------------------------------------
+// Creates header for root of XOP message
+// The header sould be the next:
+//
+// Content-Type: application/xop+xml;
+// charset=UTF-8; 
+// type="text/xml" (for SOAP 1.1) or "application/soap+xml" (for SOAP 1.2)
+// Content-Transfer-Encoding: 8bit
+// Content-ID: <randomNumber@homeTime>
+//
+// where "Content-ID" is the same as "start" in Header of Outer Package
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::HeaderRootL(CSenSoapEnvelope2& aSoapEnvelope2,
+										const RBuf8& aRootCid, RBuf8& aHeaderRoot)
+	{
+	switch (aSoapEnvelope2.SoapVersion())
+		{
+ 		case ESOAP11:
+			{
+			aHeaderRoot.ReAllocL(KHeaderRootStart11().Length()+KHeaderRootEnd().Length()+aRootCid.Length());
+			aHeaderRoot.Append(KHeaderRootStart11);
+			break;
+			}
+		case ESOAP12:
+			{
+			aHeaderRoot.ReAllocL(KHeaderRootStart12().Length()+KHeaderRootEnd().Length()+aRootCid.Length());
+			aHeaderRoot.Append(KHeaderRootStart12);		
+			break;
+			}
+		default:
+			{
+			User::Panic(KMtomSoapVersionInvalidPanicText, EMtomSoapVersionInvalid);
+			}			
+		}
+	aHeaderRoot.Append(aRootCid);
+	aHeaderRoot.Append(KHeaderRootEnd);
+	}
+	
+// ---------------------------------------------------------------------------
+// Creates  the header for binary data[aIndex] of XOP message
+// The header sould be the next:
+//
+// --MIME_boundary
+// Content-Type: image/png (for images) or some other type for other BLOBs
+// Content-Transfer-Encoding: binary
+// Content-ID: <randomNumber@homeTime>
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::HeaderBinaryDataL(TUint aIndex, 
+										      RArray<TXmlEngDataContainer>& aBinaryDataList,
+			 					     	      RBuf8& aHeaderBinaryData)
+	{
+	__ASSERT_ALWAYS(aBinaryDataList.Count(), User::Panic(KMtomNoBlobsPanicText, EMtomNoBlobs)); 
+	__ASSERT_ALWAYS((aIndex < aBinaryDataList.Count()), User::Panic(KMtomPanicText, KErrArgument));	    
+	
+	TPtrC8 cid = aBinaryDataList[aIndex].Cid();
+	
+	RXmlEngNodeList<TXmlEngAttr> attributes; // to take value of "ContentType" attribute
+	aBinaryDataList[aIndex].ParentNode().AsElement().GetAttributes(attributes);
+	CleanupClosePushL(attributes);
+
+	RBuf8 contentType;
+	CleanupClosePushL(contentType);
+	while (attributes.HasNext())
+		{
+		TXmlEngAttr attr = attributes.Next();
+		if (attr.Name() == KContentTypeName)
+			{
+			contentType.ReAllocL(attr.Value().Length());
+			contentType.Copy(attr.Value()); 
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS((contentType != _L8("")), 
+	                User::Panic(KMtomNoContentTypeInBlobHeaderPanicText, EMtomNoContentTypeInBlobHeader));
+
+	aHeaderBinaryData.ReAllocL(KHeaderBinaryDataContentType().Length()+
+							   KHeaderBinaryDataContentID().Length()+
+							   KHeaderBinaryDataEnd().Length()+
+							   contentType.Length()+
+							   cid.Length());
+	aHeaderBinaryData.Append(KHeaderBinaryDataContentType);
+	aHeaderBinaryData.Append(contentType);
+	aHeaderBinaryData.Append(KHeaderBinaryDataContentID);
+	aHeaderBinaryData.Append(cid);
+	aHeaderBinaryData.Append(KHeaderBinaryDataEnd);
+
+	CleanupStack::PopAndDestroy(&contentType);
+	CleanupStack::PopAndDestroy(&attributes);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts a part of BLOB (10KB) from a file
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMtomUtils::FileDataPartL(TUint aPart, TUint aIndex, 
+									      RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       		      RBuf8& aBinaryData)
+	{
+	__ASSERT_ALWAYS(aBinaryDataList.Count(), User::Panic(KMtomNoBlobsPanicText, EMtomNoBlobs)); 
+	__ASSERT_ALWAYS((aIndex < aBinaryDataList.Count()), User::Panic(KMtomPanicText, KErrArgument));	    
+	
+   	aBinaryData.ReAllocL(KTenKBytes);
+
+	RFile& file = aBinaryDataList[aIndex].AsFileContainer().File();
+	file.Flush();
+	file.Read(aPart*KTenKBytes, aBinaryData, KTenKBytes);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts the rest of BLOB (less than 10KB) from a file
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C void SenMtomUtils::FileDataRestL(TUint aParts, TUint aRest, TUint aIndex, 
+									      RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       		      RBuf8& aBinaryData)
+	{
+	__ASSERT_ALWAYS(aBinaryDataList.Count(), User::Panic(KMtomNoBlobsPanicText, EMtomNoBlobs)); 
+	__ASSERT_ALWAYS((aIndex < aBinaryDataList.Count()), User::Panic(KMtomPanicText, KErrArgument));	    
+
+   	aBinaryData.ReAllocL(aRest);
+	RFile& file = aBinaryDataList[aIndex].AsFileContainer().File();
+	file.Flush();
+	file.Read(aParts*KTenKBytes, aBinaryData, aRest);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts CIDs of BLOBs from response MTOM message
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C void SenMtomUtils::CidL(const RBuf8& aBlobHeader, RArray<RBuf8>& aCids)
+	{
+    _LIT8(KContentIDName, "Content-ID: <");
+	TInt offset = aBlobHeader.Find(KContentIDName);
+	if (offset == KErrNotFound)
+		{
+		User::Panic(KMtomNoCidPanicText, EMtomNoCid);
+		}
+	TPtrC8 blobHeaderPtr; // to extract BLOB header from Response message
+	blobHeaderPtr.Set(aBlobHeader.Right(aBlobHeader.Length()-offset-KContentIDName().Length()));
+		
+	offset = blobHeaderPtr.Find(_L8(">"));
+	if (offset == KErrNotFound)
+		{
+		User::Panic(KMtomCidInvalidPanicText, EMtomCidInvalid);
+		}
+	RBuf8 cid; // CID of the BLOB
+	cid.ReAllocL(offset);		
+	cid.Copy(blobHeaderPtr.Left(offset));
+	aCids.AppendL(cid); // collects CIDs of all BLOBs
+	}	
+
+// ---------------------------------------------------------------------------
+// Generates the file name for BLOB of response MTOM message 
+// and collects it in array of file names for the all BLOBs
+// ---------------------------------------------------------------------------
+//	
+void SenMtomUtils::FileNameL(TUint aIndex, RArray<RBuf8>& aFileNames)
+	{
+	RBuf8 fileName;
+	fileName.ReAllocL(KFileName().Length()+7);
+	fileName.Append(KFileName);
+	fileName.AppendNum(aIndex);
+	aFileNames.Append(fileName);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts BLOB from response MTOM message and writes it in a file
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C TInt SenMtomUtils::SetFileL(TUint aIndex, TBool aFirst, TDesC8& aBlob, 
+						             RArray<RBuf8>& aFileNames)
+	{
+	RFs rfs;
+	RFile file;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);	
+	TInt retVal = rfs.ShareProtected();
+    CleanupClosePushL(file);
+    
+    TInt sizeFile = 0;
+    RBuf fileName; //fileName is necessary to convert from 8bites(aFileNames[aIndex]) to 16
+    
+    if (aFirst) // check if is it the first part of a BLOB to write in a file
+        {
+        FileNameL(aIndex, aFileNames); // generates the new file
+        fileName.ReAllocL(aFileNames[aIndex].Length());
+        fileName.Copy(aFileNames[aIndex]);
+        User::LeaveIfError(file.Replace(rfs, fileName, EFileWrite)); // replases the old one to the new one
+        }
+    else // if it's not the first part of BLOB then only open the existing file and write a BLOB part in it 
+        {
+        fileName.ReAllocL(aFileNames[aIndex].Length());
+        fileName.Copy(aFileNames[aIndex]);
+        User::LeaveIfError(file.Open(rfs, fileName, EFileWrite));
+        }
+  
+    file.Size(sizeFile);
+	User::LeaveIfError(file.Write(sizeFile, aBlob, aBlob.Length()));
+    
+    file.Flush();
+    file.Close();
+
+    User::LeaveIfError(file.Open(rfs, fileName, EFileRead));
+    fileName.Close();
+    CleanupStack::PopAndDestroy(&file);
+	CleanupStack::PopAndDestroy(&rfs);
+	return (sizeFile+aBlob.Length());
+	}
+
+// End of file
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senmultipartutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,347 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Preparation XOP message for HTTP transmission in case 
+*				 of request	and extracting BLOBs from XOP message responsed 
+*				 through HTTP channel in case of response
+*
+*/
+
+
+
+
+
+
+
+
+#include "senmultipartutils.h"
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Serializes SoapEnvelope message in XOP message
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::SerializeMessageL(CSenFragmentBase& aMessage, 
+                                                RBuf8& aMultiPartMessage,
+                                                TXmlEngSerializerType aType)
+    {
+	__ASSERT_ALWAYS(&aMessage, 
+	                User::Panic(KMultiPartNoRequestMessagePanicText, EMultiPartNoRequestMessage));
+	RSenDocument doc = aMessage.AsDocumentL();
+    CXmlEngSerializer* serializer = CXmlEngSerializer::NewL(aType);
+	__ASSERT_ALWAYS(serializer, User::Panic(KMultiPartPanicText, KErrNotFound));
+    CleanupStack::PushL(serializer);
+    TXmlEngSerializationOptions options(TXmlEngSerializationOptions::KOptionIndent & TXmlEngSerializationOptions::KOptionOmitXMLDeclaration);
+    serializer->SetOutput(aMultiPartMessage);	
+    serializer->SetSerializationOptions(options);
+    serializer->SerializeL(doc);
+    CleanupStack::PopAndDestroy(serializer);
+    }
+
+// ---------------------------------------------------------------------------
+// Generates random content-ID for header of XOP message and for headers of BLOBs 
+// as randomNumber@homeTime
+// @param aRootCid is ReAlloc'd, which means that any existing data is freed
+// prior the generated root cid is assinged to that buffer.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::GenerateRandomRootCidL(RBuf8& aRootCid)
+    {
+    _LIT8(KAt, "@");
+	TTime now;
+	now.HomeTime();
+	TInt64 homeTime = now.Int64();
+	TInt64 randomNumber = Math::Random();
+	aRootCid.ReAllocL(32+KAt().Length());
+	aRootCid.AppendNum(randomNumber);
+	aRootCid.Append(KAt);
+	aRootCid.AppendNum(homeTime);
+    }
+
+// ---------------------------------------------------------------------------
+// Generates random boundary for mime header as randomNumber
+// @param aBoundary is ReAlloc'd, which means that any existing data is freed
+// prior the generated root cid is assinged to that buffer.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::GenerateRandomBoundaryL(RBuf8& aBoundary)
+    {
+  	TInt64 randomNumber = Math::Random();
+  	aBoundary.ReAllocL(16);
+	aBoundary.AppendNum(randomNumber);
+    }
+
+// ---------------------------------------------------------------------------
+// Generates MimeBoundary to separate mime parts of the message
+// as --randomNumber
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::BoundaryLineStartL(const RBuf8& aBoundary, RBuf8& aBoundaryStart)
+	{
+	aBoundaryStart.ReAllocL(KNewLine().Length()+KDush().Length()+aBoundary.Length());
+	aBoundaryStart.Append(KDush);
+	aBoundaryStart.Append(aBoundary);
+	aBoundaryStart.Append(KNewLine);
+	}
+
+// ---------------------------------------------------------------------------
+// Generates MimeBoundaryEnd to end the multipart message (MultiPart message)
+// as --randomNumber--
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::BoundaryLineEndL(const RBuf8& aBoundary, RBuf8& aBoundaryEnd)
+	{
+	aBoundaryEnd.ReAllocL(3*KNewLine().Length()+2*KDush().Length()+aBoundary.Length());
+	aBoundaryEnd.Append(KNewLine);
+	aBoundaryEnd.Append(KNewLine);
+	aBoundaryEnd.Append(KDush);
+	aBoundaryEnd.Append(aBoundary);
+	aBoundaryEnd.Append(KDush);
+	aBoundaryEnd.Append(KNewLine);
+	}
+         
+// ---------------------------------------------------------------------------
+// Creates header for root of XOP message or other multiPart message
+// The header sould be the next:
+//
+// Content-Type: application/xop+xml;
+// charset=UTF-8; 
+// type="text/xml" (for SOAP 1.1) or "application/soap+xml" (for SOAP 1.2)
+// Content-Transfer-Encoding: 8bit
+// Content-ID: <randomNumber@homeTime>
+//
+// where "Content-ID" is the same as "start" in Header of Outer Package
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::HeaderRootL(MSenMessage* aMessage,
+										const RBuf8& aRootCid, RBuf8& aHeaderRoot)
+	{
+	
+	if( aMessage->IsSafeToCast(MSenMessage::ESoapEnvelope2 ))
+	    {
+	    CSenSoapEnvelope2* pSoapEnvelope2 = (CSenSoapEnvelope2*)aMessage;
+    	switch (pSoapEnvelope2->SoapVersion())
+    		{
+     		case ESOAP11:
+    			{
+    			aHeaderRoot.ReAllocL(KMultiPartHeaderRootStart11().Length()+KMultiPartHeaderRootEnd().Length()+aRootCid.Length());
+    			aHeaderRoot.Append(KMultiPartHeaderRootStart11);
+    			break;
+    			}
+    		case ESOAP12:
+    			{
+    			aHeaderRoot.ReAllocL(KMultiPartHeaderRootStart12().Length()+KMultiPartHeaderRootEnd().Length()+aRootCid.Length());
+    			aHeaderRoot.Append(KMultiPartHeaderRootStart12);		
+    			break;
+    			}
+    		default:
+    			{
+    			User::Panic(KMultiPartSoapVersionInvalidPanicText, EMultiPartSoapVersionInvalid);
+    			}			
+    		}
+	    }
+	else if( aMessage->IsSafeToCast(MSenMessage::EAtomMessage ))
+	    {
+		aHeaderRoot.ReAllocL(KMultiPartAtomHeaderRootStart().Length()+KMultiPartHeaderRootEnd().Length()+aRootCid.Length());
+		aHeaderRoot.Append(KMultiPartAtomHeaderRootStart);
+	    }
+	aHeaderRoot.Append(aRootCid);
+	aHeaderRoot.Append(KMultiPartHeaderRootEnd);
+	}
+	
+// ---------------------------------------------------------------------------
+// Creates  the header for binary data[aIndex] of XOP message
+// The header sould be the next:
+//
+// --MIME_boundary
+// Content-Type: image/png (for images) or some other type for other BLOBs
+// Content-Transfer-Encoding: binary
+// Content-ID: <randomNumber@homeTime>
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::HeaderBinaryDataL(TUint aIndex, 
+										      RArray<TXmlEngDataContainer>& aBinaryDataList,
+			 					     	      RBuf8& aHeaderBinaryData)
+	{
+	__ASSERT_ALWAYS(aBinaryDataList.Count(), User::Panic(KMultiPartNoBlobsPanicText, EMultiPartNoBlobs)); 
+	__ASSERT_ALWAYS((aIndex < aBinaryDataList.Count()), User::Panic(KMultiPartPanicText, KErrArgument));	    
+	
+	TPtrC8 cid = aBinaryDataList[aIndex].Cid();
+	
+	RXmlEngNodeList<TXmlEngAttr> attributes; // to take value of "ContentType" attribute
+	aBinaryDataList[aIndex].ParentNode().AsElement().GetAttributes(attributes);
+	CleanupClosePushL(attributes);
+
+	RBuf8 contentType;
+	CleanupClosePushL(contentType);
+	while (attributes.HasNext())
+		{
+		TXmlEngAttr attr = attributes.Next();
+		if (attr.Name() == KMultiPartContentTypeName)
+			{
+			contentType.ReAllocL(attr.Value().Length());
+			contentType.Copy(attr.Value()); 
+			break;
+			}
+		}
+    if (contentType == KNullDesC8)
+        {
+        contentType.ReAllocL(KMultiPartDefaultBinaryContentTypeValue().Length());
+        contentType.Copy(KMultiPartDefaultBinaryContentTypeValue);
+        }
+
+	
+	aHeaderBinaryData.ReAllocL(KMultiPartHeaderBinaryDataContentType().Length()+
+							   KMultiPartHeaderBinaryDataContentID().Length()+
+							   KMultiPartHeaderBinaryDataEnd().Length()+
+							   contentType.Length()+
+							   cid.Length());
+	aHeaderBinaryData.Append(KMultiPartHeaderBinaryDataContentType);
+	aHeaderBinaryData.Append(contentType);
+	aHeaderBinaryData.Append(KMultiPartHeaderBinaryDataContentID);
+	aHeaderBinaryData.Append(cid);
+	aHeaderBinaryData.Append(KMultiPartHeaderBinaryDataEnd);
+
+	CleanupStack::PopAndDestroy(&contentType);
+	CleanupStack::PopAndDestroy(&attributes);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts a part of BLOB (10KB) from a file
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void SenMultiPartUtils::FileDataPartL(TUint aPart, TUint aIndex, 
+									      RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       		      RBuf8& aBinaryData)
+	{
+	__ASSERT_ALWAYS(aBinaryDataList.Count(), User::Panic(KMultiPartNoBlobsPanicText, EMultiPartNoBlobs)); 
+	__ASSERT_ALWAYS((aIndex < aBinaryDataList.Count()), User::Panic(KMultiPartPanicText, KErrArgument));	    
+	
+   	aBinaryData.ReAllocL(KTenKBytes);
+
+	RFile& file = aBinaryDataList[aIndex].AsFileContainer().File();
+	file.Flush();
+	file.Read(aPart*KTenKBytes, aBinaryData, KTenKBytes);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts the rest of BLOB (less than 10KB) from a file
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C void SenMultiPartUtils::FileDataRestL(TUint aParts, TUint aRest, TUint aIndex, 
+									      RArray<TXmlEngDataContainer>& aBinaryDataList,
+						       		      RBuf8& aBinaryData)
+	{
+	__ASSERT_ALWAYS(aBinaryDataList.Count(), User::Panic(KMultiPartNoBlobsPanicText, EMultiPartNoBlobs)); 
+	__ASSERT_ALWAYS((aIndex < aBinaryDataList.Count()), User::Panic(KMultiPartPanicText, KErrArgument));	    
+
+   	aBinaryData.ReAllocL(aRest);
+	RFile& file = aBinaryDataList[aIndex].AsFileContainer().File();
+	file.Flush();
+	file.Read(aParts*KTenKBytes, aBinaryData, aRest);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts CIDs of BLOBs from response MultiPart message
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C void SenMultiPartUtils::CidL(const RBuf8& aBlobHeader, RArray<RBuf8>& aCids)
+	{
+    _LIT8(KContentIDName, "Content-ID: <");
+    _LIT8(KGreaterThan,">");
+	TInt offset = aBlobHeader.Find(KContentIDName);
+	if (offset == KErrNotFound)
+		{
+		User::Panic(KMultiPartNoCidPanicText, EMultiPartNoCid);
+		}
+	TPtrC8 blobHeaderPtr; // to extract BLOB header from Response message
+	blobHeaderPtr.Set(aBlobHeader.Right(aBlobHeader.Length()-offset-KContentIDName().Length()));
+		
+	offset = blobHeaderPtr.Find(KGreaterThan);//CodeScannerWarning
+	if (offset == KErrNotFound)
+		{
+		User::Panic(KMultiPartCidInvalidPanicText, EMultiPartCidInvalid);
+		}
+	RBuf8 cid; // CID of the BLOB
+	cid.ReAllocL(offset);		
+	cid.Copy(blobHeaderPtr.Left(offset));
+	aCids.AppendL(cid); // collects CIDs of all BLOBs
+	}	
+
+// ---------------------------------------------------------------------------
+// Generates the file name for BLOB of response MultiPart message 
+// and collects it in array of file names for the all BLOBs
+// ---------------------------------------------------------------------------
+//	
+void SenMultiPartUtils::FileNameL(TUint aIndex, RArray<RBuf8>& aFileNames)
+	{
+	RBuf8 fileName;
+	fileName.ReAllocL(KFileName().Length()+7);
+	fileName.Append(KFileName);
+	fileName.AppendNum(aIndex);
+	aFileNames.Append(fileName);
+	}
+
+// ---------------------------------------------------------------------------
+// Extracts BLOB from response MultiPart message and writes it in a file
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C TInt SenMultiPartUtils::SetFileL(TUint aIndex, TBool aFirst, TDesC8& aBlob, 
+						             RArray<RBuf8>& aFileNames)
+	{
+	RFs rfs;
+	RFile file;
+
+    User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);	
+	TInt retVal = rfs.ShareProtected();
+    CleanupClosePushL(file);
+    
+    TInt sizeFile = 0;
+    RBuf fileName; //fileName is necessary to convert from 8bites(aFileNames[aIndex]) to 16
+    CleanupClosePushL(fileName);
+    if (aFirst) // check if is it the first part of a BLOB to write in a file
+        {
+        FileNameL(aIndex, aFileNames); // generates the new file
+        fileName.ReAllocL(aFileNames[aIndex].Length());
+        fileName.Copy(aFileNames[aIndex]);
+        User::LeaveIfError(file.Replace(rfs, fileName, EFileWrite)); // replases the old one to the new one
+        }
+    else // if it's not the first part of BLOB then only open the existing file and write a BLOB part in it 
+        {
+        fileName.ReAllocL(aFileNames[aIndex].Length());
+        fileName.Copy(aFileNames[aIndex]);
+        User::LeaveIfError(file.Open(rfs, fileName, EFileWrite));
+        }
+  
+    file.Size(sizeFile);
+	User::LeaveIfError(file.Write(sizeFile, aBlob, aBlob.Length()));
+    
+    file.Flush();
+    file.Close();
+
+    User::LeaveIfError(file.Open(rfs, fileName, EFileRead));
+    
+    //fileName.Close();
+    CleanupStack::PopAndDestroy(&fileName);
+    CleanupStack::PopAndDestroy(&file);
+	CleanupStack::PopAndDestroy(&rfs);
+	return (sizeFile+aBlob.Length());
+	}
+
+// End of file
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senservercontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,500 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "e32cmn.h"
+
+#include "senservercontext.h" 
+#include "sencoreservicemanager.h" // Core\inc
+#include "senapplicationcontext.h"
+#include <SenServiceConnection.h> // KErrSenInternal
+
+EXPORT_C CSenServerContext* CSenServerContext::NewL(MSenCoreServiceManager& aCore)
+    {
+    CSenServerContext* pNew = CSenServerContext::NewLC(aCore);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenServerContext* CSenServerContext::NewLC(MSenCoreServiceManager& aCore)
+    {
+    CSenServerContext* pNew = new (ELeave) CSenServerContext(aCore);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenServerContext::CSenServerContext(MSenCoreServiceManager& aCore)
+: iApplications(ETrue, ETrue),
+  iCore(aCore)
+    {
+    }
+
+EXPORT_C CSenServerContext::~CSenServerContext()
+    {
+    iApplications.Reset(); // de-alloc secure-id's and application contexts
+    }
+       
+EXPORT_C void CSenServerContext::BaseConstructL()
+    {
+//    CSenContext::BaseConstructL();
+    }
+    
+MSenCoreServiceManager& CSenServerContext::Core()
+    {
+    return iCore;
+    }
+
+CSenApplicationContext& CSenServerContext::OpenApplicationContextL(TSecureId aSecureId)
+    {
+    CSenApplicationContext* pCtx = NULL;
+    // Check if application context already exists, held by this server context
+    TInt index = iApplications.Find( aSecureId );
+    if ( index == KErrNotFound )
+        {
+        // New application context needs to be created
+        pCtx = CSenApplicationContext::NewLC(aSecureId, *this );
+        TUint32* pSecureId = new (ELeave) TUint32(aSecureId);
+        TInt err = iApplications.Append( pSecureId, pCtx );
+        if( err )
+            {
+            // Append failed: cleanup and leave
+            delete pSecureId; // de-alloc this orphan
+            CleanupStack::PopAndDestroy( pCtx );
+            User::Leave( err ); 
+            }
+        else
+            {
+            // Remove the new context from cleanup stack, 
+            // it is now owned by this server context
+            CleanupStack::Pop( pCtx );
+            }
+        }
+    else
+        {
+        // Return the existing application context
+        pCtx = (CSenApplicationContext*)iApplications.ValueAt( index );
+        if( !pCtx )
+            {
+            // Should NOT occur: map failed => leave with internal error code
+            User::Leave( KErrSenInternal ); 
+            }
+        } 
+    return *pCtx;
+    }
+
+TInt CSenServerContext::CloseApplicationContext(const CSenApplicationContext& aCtx)
+    {
+    TInt retVal(KErrNotFound);
+    if ( aCtx.iClients.Count() == 0 )
+        {
+        // Note: RemoveByKey returns KErrNotFound or index of removed item(!)
+        retVal = iApplications.RemoveByKey( aCtx.SecureId() );
+        if( retVal != KErrNotFound )
+            {
+            retVal = KErrNone;
+            }
+        }
+    else
+        {
+        retVal = KErrInUse;
+        }
+    return retVal;
+    }
+
+// From MSenServerContext:
+/*
+SenContext::TContextType CSenServerContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+       
+SenContext::TContextDirection CSenServerContext::Direction() const
+    {
+    return CSenContext::Direction();
+    }
+       
+TInt CSenServerContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenServerContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TDesC8* CSenServerContext::GetDesC8L(const TDesC8& aKey)
+    {
+    return CSenContext::GetDesC8L( aKey );
+    }
+       
+TInt CSenServerContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenServerContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TInt* CSenServerContext::GetIntL(const TDesC8& aKey)
+    {
+    return CSenContext::GetIntL( aKey );
+    }
+       
+TInt CSenServerContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenServerContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const CSenElement* CSenServerContext::GetSenElementL(const TDesC8& aKey)
+    {
+    return CSenContext::GetSenElementL( aKey );
+    }
+       
+TInt CSenServerContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenServerContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+TAny* CSenServerContext::GetAny(const TDesC8& aKey)
+    {
+    return CSenContext::GetAny( aKey );
+    }
+       
+TInt CSenServerContext::Remove(const TDesC8& aKey) 
+    {
+    return CSenContext::Remove(aKey);
+    }
+
+TInt CSenServerContext::Count() const
+    {
+    return CSenContext::Count();
+    }
+
+TPtrC8 CSenServerContext::KeyAtL(TInt aIndex)
+    {
+    return CSenContext::KeyAtL(aIndex);
+    }
+
+void CSenServerContext::Reset()
+    {
+    CSenContext::Reset();
+    }
+    
+CSenSoapMessage* CSenServerContext::GetCurrentSoapMessage() // DEPRECATED: 
+    {
+    CSenSoapMessage* pSoapMessage = NULL;
+    
+    TInt index = iItems.Find( KSenCtxKeyCurrentSoapMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        pSoapMessage = &(pItem->ToSenSoapMessageL());
+        }
+    return pSoapMessage;
+    }
+    
+TPtrC8 CSenServerContext::GetMessage()
+    {
+    TInt index = iItems.Find( KSenCtxKeyCurrentMessageAsDesc );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const TDesC8* desc = pItem->ToDesC8L();
+        return *desc;
+        }
+    return KNullDesC8();
+    }
+    
+TInt CSenServerContext::Add(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );    
+    }
+    
+TInt CSenServerContext::Update(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+    
+const CSenSoapEnvelope* CSenServerContext::GetSenSoapEnvelopeL(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find( aKey );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const CSenSoapEnvelope* envelope = ((CSenSoapEnvelope*)&(pItem->ToSenSoapMessageL()));
+        return envelope;
+        }
+    return NULL;
+    }
+    
+MSenMessage* CSenServerContext::Message()
+    {
+    TInt index = iItems.Find( KSenCtxKeyMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((MSenMessage*)&(pItem->ToSenMessageL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenServerContext::SetMessage(MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyMessage(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+    
+CSenChunk* CSenServerContext::Chunk()
+    {
+    TInt index = iItems.Find( KSenCtxKeyChunk );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((CSenChunk*)&(pItem->ToSenChunkL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenServerContext::SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(apMsgAsChunk); )
+        }
+    else // chunk is not to be owned
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(*apMsgAsChunk); )
+        }
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyChunk(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+
+TInt CSenServerContext::SetProperties(MSenProperties* apProperties, TBool aOwned)
+    {
+    if( !apProperties )
+        {
+        return KErrArgument;
+        }
+        
+    TInt retCode(KErrNone);
+    if ( aOwned )
+        {
+        delete ipOwnedTp;
+        ipOwnedTp = NULL;
+        ipOwnedTp = apProperties;
+        }
+    else
+        {
+        
+        CSenContextItem* pItem = NULL;
+        TInt leaveCode(KErrNone);
+//        if( aOwned )
+//            {
+//            TRAP( leaveCode, pItem = CSenContextItem::NewL(apProperties); )
+//            }
+//        else // chunk is not to be owned
+//            {
+            TRAP( leaveCode, pItem = CSenContextItem::NewL(*apProperties); )
+//            }
+
+        if( leaveCode != KErrNone ) 
+            {
+            delete pItem; // should ALWAYS be NULL(!)
+            return leaveCode;
+            }
+            
+        retCode = iItems.UpdateValue(&KSenCtxKeyChunk(), pItem);
+        if( retCode != KErrNone && aOwned )
+            {
+            delete pItem; // delete the orphan item
+            } 
+        }
+    return retCode;
+    }
+
+
+MSenProperties* CSenServerContext::Properties()
+    {
+    if( ipOwnedTp )
+        {
+        return ipOwnedTp;
+        }
+    else
+        {
+        TInt index = iItems.Find( KSenCtxKeyMessageProperties );
+        if ( index != KErrNotFound )
+            {
+            const CSenContextItem* pItem = iItems.ValueAt(index);
+            if( pItem->Type() == MSenContextItem::EMSenProperties )
+                {
+                MSenProperties* pProperties = (MSenProperties*)pItem;
+                return pProperties;
+                }
+            }
+        return NULL;
+        }
+    }
+
+// Method for adding an "intermediate" message behind certain key; used normally to conduct final "service message"
+TInt CSenServerContext::Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+    
+// Method for updating some "intermediate" message behind certain key; used normally to conduct final "service message"    
+TInt CSenServerContext::Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem;
+        }
+    return retCode;    
+    }
+    
+// Method for getting "intermediate" message behind certain key; used normally to conduct final "service message"    
+MSenMessage* CSenServerContext::GetMessage(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if(pItem)
+            {
+            return &pItem->ToSenMessageL();
+            }
+        }
+    return NULL;    
+    }
+ 
+// private helper method(s):
+CSenContextItem* CSenServerContext::MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError)
+    {
+    aError = KErrNone;
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        if( apMessage->IsSafeToCast( MSenMessage::EMessageBase ) )
+            {
+            CSenMessageBase* msgBase = (CSenMessageBase*) apMessage;
+            TRAP( aError, pItem = CSenContextItem::NewL( msgBase ); )
+            }
+        else if ( apMessage->IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+            {
+            CSenSoapEnvelope2* msgSoap2 = (CSenSoapEnvelope2*) apMessage;
+            TRAP( aError,  pItem = CSenContextItem::NewL( msgSoap2 ); )
+            }
+        else 
+            {
+            aError = KErrNotSupported;
+            return NULL;
+            }
+        }
+    else // provided message is *not to be owned*
+        {
+        TRAP( aError, pItem = CSenContextItem::NewL(*apMessage); )
+        }
+    return pItem;        
+    } 
+    
+TInt CSenServerContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    CSenContext::SetDirection( aDirection );
+    return KErrNone;
+    }
+
+const CSenXmlReader* CSenServerContext::GetParser()
+    {
+    return CSenContext::GetParser();
+    }
+*/       
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,815 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <e32std.h>  // for RPointerArray
+
+#include "SenServiceConnection.h" // session status constants
+#include "senservicesession.h"
+#include "SenXmlUtils.h"
+#include "senpolicy.h"
+#include "senserviceinvocationframework.h"
+#include "senprovider.h"
+#include "senidentifier.h"
+#include "sentransportbase.h"
+
+#include "msenlayeredproperties.h"
+
+#include "msenremotehostlet.h" // internal
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+EXPORT_C CSenServiceSession::CSenServiceSession(TDescriptionClassType aType,
+                                                MSIF& aFramework) :
+    CSenWSDescription(aType),
+    iStatus(KSenConnectionStatusNew),
+    iFramework(aFramework),
+    ipTransport(NULL)
+    {
+    }
+
+EXPORT_C CSenServiceSession::~CSenServiceSession()
+    {
+    // The REMOTE consumers are also sessions which are
+    // owned by XMLDAO or ClientSession
+    iConsumerList.Reset();
+    iFacets.ResetAndDestroy();
+    if (iTransportOwned)
+        {
+        delete ipTransport;
+        }
+    ipTransport = NULL;
+    }
+
+// Constructor offered to subclasses:
+EXPORT_C void CSenServiceSession::BaseConstructL()
+    {
+	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenServiceSession::BaseConstructL - Version 2 [2006-05-09]");
+        
+    // Sets the local name to "ServiceDescription"
+    // and initiates the inner ipElement
+    CSenWSDescription::ConstructL();
+    }
+
+EXPORT_C TInt CSenServiceSession::InitializeFromL(MSenServiceDescription& aServiceDescription)
+    { 
+    _LIT8(KTouch, "touch");
+    CSenWSDescription& sd = (CSenWSDescription&)aServiceDescription;
+    const TDesC8* attrValue = sd.AsElement().AttrValue(KTouch);
+    if(attrValue != NULL)
+    	{
+    	AsElement().AddAttrL(KTouch, *attrValue);
+    	}
+    _LIT8(KEndpointLocalname, "Endpoint");
+    CSenElement* pEndpointElement = sd.AsElement().Element(KEndpointLocalname);
+    TPtrC8 transportCue;
+    if(pEndpointElement)
+        {
+        _LIT8(KCue, "cue");
+        const TDesC8* cue = pEndpointElement->AttrValue(KCue);
+        if(cue && cue->Length()>0)
+            {
+            transportCue.Set(*cue);
+            SetTransportCueL(transportCue);
+            }
+        }
+
+    if(IsLocalL())
+        {
+        // Initialize local service sessions by trying to lookup the hostlet plug-in
+        // behind a local endpoint, and if such exists, by asking it to add (facet)
+        // data into this session.
+
+        // Check transport cue; if such XML attribute
+        // has been set to <Endpoint element, it is
+        // "stronger" than actual endpoint scheme
+
+        TPtrC8 hostletCue = aServiceDescription.Endpoint();
+        if( transportCue.Length() > 0 )
+            {
+            hostletCue.Set( transportCue );
+            }
+
+
+
+	    CSenProvider* pHostlet = NULL;
+        TInt leaveCode(KErrNone);
+	    TRAP(leaveCode, pHostlet = CSenProvider::NewL(hostletCue));
+	    if(leaveCode == KErrNone && pHostlet)
+	        {	
+	        CleanupStack::PushL(pHostlet);
+
+            // Inside InitServiceSessionL, the hostlet can add it's facets into this
+            // session and possibly initialize some other data required.
+            CSenWSDescription* pSD = CSenWSDescription::NewLC();
+            pHostlet->DescribeServiceL(*pSD); // pHostlet->InitServiceSessionL(*this);
+            this->InitializeFromL(*pSD);
+            CleanupStack::PopAndDestroy(pSD);
+	        
+
+            /*
+            CSenWSDescription* pSD = pHostlet->SessionDescriptionLC();
+            // this->InitializeFacetsFromL(*pSD);
+            
+            // Copy the facets from local service provider  session description
+            RFacetArray facets;
+            pSD->FacetsL(facets);
+            CleanupClosePushL(facets);
+        
+            TInt count(facets.Count());
+            for (TInt i=0; i<count; i++)
+                {
+                SetFacetL(*facets[i]);
+                }
+        
+            descFacets.ResetAndDestroy();
+            CleanupStack::Pop(); // facets.Close()
+            
+            CleanupStack::PopAndDestroy(); // pSD
+            */
+
+	        CleanupStack::PopAndDestroy(); //pHostlet	                
+	        }
+        }
+        
+                
+    RFacetArray descFacets;
+    aServiceDescription.FacetsL(descFacets);
+    CleanupClosePushL(descFacets);
+
+    TInt count(descFacets.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        SetFacetL(*descFacets[i]);
+        }
+
+    descFacets.ResetAndDestroy();
+    CleanupStack::Pop(); // descFacets.Close()
+
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenServiceSession::ParseResponseL(const TDesC8& aInput,
+                                                 HBufC8*& aOutput)
+    {
+    aOutput = HBufC8::NewL(aInput.Length());
+    aOutput->Des().Append(aInput); 
+    return KErrNone;
+    }
+
+/**
+ * Ask the ServiceManager to save a description
+ * of this ServiceSession (in its DAO storage).
+ *
+ * This (convenience) method can be called from within other methods of
+ * ServiceSession (and/or subclasses) and by ServiceInvocationFramework
+ * implementations.
+ *
+ */
+EXPORT_C void CSenServiceSession::SaveL()
+    {
+    iFramework.Manager().SaveL(*this);
+    }
+
+/**
+ * Return the status of this ServiceSession.
+ *
+ * @return  TInt the status
+ */
+EXPORT_C TInt CSenServiceSession::StatusL()
+    {
+    return(iStatus);
+    }
+
+
+
+/**
+ * SetStatus
+ *
+ * Compute the status of the ServiceSession. If the status
+ * changes to, or from, "KSenConnectionStatusReady"
+ * inform service consumers about the new status.
+ *
+ * @return TInt indicating the CHANGED status that was set
+ *
+ */
+EXPORT_C TInt CSenServiceSession::SetStatusL()
+    {
+
+    TInt currentStatus = iStatus;
+    iStatus = ComputeStatusL();
+    if (    (currentStatus == KSenConnectionStatusReady
+            && iStatus != KSenConnectionStatusReady)
+            ||
+            (currentStatus != KSenConnectionStatusReady
+            && iStatus == KSenConnectionStatusReady)    )
+        {
+
+        // notify clients
+        RServiceConsumerArray consumers;
+        CleanupClosePushL(consumers);
+        TInt err = Consumers(consumers);
+
+        if(err==KErrNone)
+            {
+            TInt count = consumers.Count();
+            for (TInt i=0; i<count; i++)
+                {
+                TRAPD(error, (consumers[i])->SetStatusL(iStatus));
+                if(error!=KErrNone)
+                    {
+			TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CSenServiceSession::SetStatusL() \
+                        failed to set status of %d consumer, error code (%d)"),
+                        (i+1), error));
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(); // close() consumers
+        }
+    return(iStatus);
+    }
+
+/**
+ * Compute the current status of the ServiceSession.
+ * Subclasses __will__ override this.
+ * This method does not actually set the status of the ServiceSession
+ * and does not notify consumers about changes.
+ *
+ * @return  TInt indicating the CURRENT computed status
+ */
+EXPORT_C TInt CSenServiceSession::ComputeStatusL()
+    {
+    TInt result = KSenConnectionStatusNew;
+    TPtrC8 endpoint = Endpoint();
+
+    if(endpoint.Length()>1)
+        result = KSenConnectionStatusReady;
+
+    return result;
+    }
+
+EXPORT_C MSenRemoteServiceConsumer* CSenServiceSession::RemoteConsumerL(
+            const TDesC8& aSenderID)
+    {
+    TInt consumersCount(iConsumerList.Count());
+
+    for(TInt i=0; i<consumersCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aSenderID)
+            {
+            return iConsumerList[i];
+            }
+        }
+    return NULL; // not found
+
+    }
+
+
+EXPORT_C TInt CSenServiceSession::SubmitL(const TDesC8& aMessage, 
+                                          const TDesC8& aTransportProperties,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          HBufC8*& aResponse)
+    {
+//    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenServiceSession::SubmitL");
+    TPtrC8 endpoint = Endpoint();
+    //////////////////////////////////////////////////////////////////////////
+    //CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"***********************************************************");
+    //CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    //CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Request (%d bytes):"), aMessage.Length()));
+    //CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( aMessage ));
+    //CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"***********************************************************");
+    //////////////////////////////////////////////////////////////////////////
+
+    delete aResponse;
+    aResponse = NULL;
+
+    //MSenRemoteServiceConsumer* pConsumer = RemoteConsumerL(aSenderId);
+    
+    MSenTransport& transport = aConsumer.TransportL();
+    TInt retVal( transport.SubmitL(endpoint, aMessage, aTransportProperties, aResponse,aConsumer) );
+    if(retVal==KErrNone)
+        {
+        // attempt to parse the response. 
+
+        HBufC8* parsedResponse = NULL;
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, ParseResponseL(*aResponse, parsedResponse));
+        if(leaveCode!=KErrNone)
+            {
+            // response is returned as it is: unparsed (for debugging reasons)
+            retVal = leaveCode;
+            }
+        else
+            {
+            // parsing went OK. Release unparsed buffer
+            delete aResponse;
+            // assign the parsed buffer to aResponse
+            aResponse = parsedResponse;
+            }
+        }
+    // else directly return the error received from transport
+    return retVal;
+    }
+
+
+/*
+ * @see CServiceConnection.Send(...)
+ */
+// add txnid, transport properties
+EXPORT_C TInt CSenServiceSession::SendL( const TDesC8& aMessage, 
+                                         const TDesC8& aTransportProperties,
+                                         MSenRemoteServiceConsumer& aConsumer,
+                                         TInt& aTxnId,
+                                         HBufC8*& /*aRevalidationError*/ )
+    {
+    //CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenServiceSession::SendL:");
+    TPtrC8 endpoint = Endpoint();
+    //////////////////////////////////////////////////////////////////////////
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"***********************************************************");
+    //CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    //CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Request (%d bytes):"), aMessage.Length()));
+    //CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( aMessage ));
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"***********************************************************");
+    //////////////////////////////////////////////////////////////////////////
+    MSenTransport& t = aConsumer.TransportL();
+    TInt retVal(t.SendL(endpoint, aMessage, aTransportProperties, *this, aConsumer, aTxnId));
+    return retVal;
+    }
+
+
+/*
+ * @see CServiceConnection.IsReadyL()
+ * *** Note: in Java reference implementation method's was named "isValid()"!
+ */
+EXPORT_C TBool CSenServiceSession::IsReadyL()
+    {
+    return (iStatus==KSenConnectionStatusReady);
+    }
+
+EXPORT_C TInt CSenServiceSession::CompleteServerMessagesOnOffL(
+                                                const TBool& aCompleteOnOff)
+    {
+
+    if (aCompleteOnOff)
+        {
+        CSenFacet* pFacet = CSenFacet::NewL();
+        CleanupStack::PushL(pFacet);
+        pFacet->SetNameL(KCompleteMessagesFacet);
+        pFacet->SetValueL(KSenFacetValTrue);
+        SetFacetL(*pFacet);
+        CleanupStack::PopAndDestroy(); // pFacet
+        }
+    else
+        {
+        RemoveFacet(KCompleteMessagesFacet);
+        }
+
+    return KErrNone;
+    }
+
+
+EXPORT_C TInt CSenServiceSession::HasFacetL(const TDesC8& aURI, TBool& aHasFacet)
+    {
+    aHasFacet = EFalse;
+    TInt count(iFacets.Count());
+
+    for (TInt i=0;i<count && !aHasFacet;i++)
+        {
+        if (iFacets[i]->Name() == aURI)
+            {
+            aHasFacet = ETrue;
+            }
+        }
+
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenServiceSession::FacetValue(TDesC8& aURI, HBufC8*& aValueTo)
+    {
+    delete aValueTo;
+    aValueTo = NULL;
+
+    TInt retVal = KErrNotFound;
+    TInt count(iFacets.Count());
+
+    for (TInt i=0; i<count && retVal == KErrNotFound;i++)
+        {
+        if (iFacets[i]->Name() == aURI)
+            {
+            aValueTo = iFacets[i]->Value().Alloc();
+            if (aValueTo == NULL) 
+                {
+                retVal = KErrNoMemory;
+                }
+            else
+                {
+                retVal = KErrNone;
+                }
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TInt CSenServiceSession::AddFacetL(const CSenFacet& aFacet)
+    {
+    // In XML SD, this does not equal with SetFacetL(), but checks
+    // for duplicate, already reserved facet name and returns an
+    // error if such exists.
+    return SetFacetL(aFacet); 
+    }
+
+EXPORT_C TInt CSenServiceSession::SetFacetL(const CSenFacet& aFacet)
+    {
+    TBool hasFacet;
+    HasFacetL(((CSenFacet&)aFacet).Name(),hasFacet);
+    if (hasFacet)
+        {
+        RemoveFacet(((CSenFacet&)aFacet).Name());
+        }
+    CSenFacet* pNewFacet = CSenFacet::NewL(((CSenFacet&)aFacet));
+    return iFacets.Append(pNewFacet);
+    }
+
+EXPORT_C TInt CSenServiceSession::RemoveFacet(const TDesC8& aURI)
+    {
+    TInt count(iFacets.Count());
+
+    for (TInt i=0;i<count;i++)
+        {
+        if (iFacets[i]->Name() == aURI)
+            {
+            delete iFacets[i];
+            iFacets.Remove(i);
+            return KErrNone;
+            }
+        }
+
+    return KErrNotFound;
+    }
+
+EXPORT_C TInt CSenServiceSession::FacetsL(RFacetArray& aFacetArray)
+    {
+    CSenFacet* pFacet = NULL;
+    TInt count(iFacets.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        pFacet = CSenFacet::NewL(*iFacets[i]);
+        aFacetArray.Append(pFacet);
+        }
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenServiceSession::ScoreMatchL(MSenServiceDescription& aPattern)
+    {
+    TInt score(0);
+    
+    if ( (aPattern.FrameworkId().Length() == 0) ||
+         ( (aPattern.FrameworkId().Length() > 0) && (aPattern.FrameworkId() == FrameworkId()) ) )
+        {
+        if ((aPattern.Endpoint().Length() > 0) && (aPattern.Endpoint() == Endpoint()))
+            {
+            score = score + KSenServiceDescriptionBaseScore;
+            }
+        if ((aPattern.Contract().Length() > 0) && (aPattern.Contract() == Contract()))
+            {
+            score = score + KSenServiceDescriptionBaseScore;
+            }
+        }
+    
+
+    if ( score > 0 )
+        {
+        RFacetArray otherFacets;
+        CleanupClosePushL(otherFacets); 
+        aPattern.FacetsL(otherFacets);
+
+        HBufC8* pFacetValue = NULL;
+        TPtrC8 facetName;
+
+        TInt count(otherFacets.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            facetName.Set(otherFacets[i]->Name());
+            FacetValue(facetName,pFacetValue);
+            if (pFacetValue && *pFacetValue == otherFacets[i]->Value()) score++;
+            delete pFacetValue;
+            pFacetValue = NULL;
+            }
+
+        otherFacets.ResetAndDestroy();
+        CleanupStack::Pop();
+
+        if ( ipHostlet )
+            {
+            score++;
+            }
+        }
+
+    return score;
+    }
+
+EXPORT_C TBool CSenServiceSession::Matches(MSenServiceDescription& aOtherServiceDescription)
+    {
+    TPtrC8 patternEndpoint = aOtherServiceDescription.Endpoint();
+    TPtrC8 thisEndpoint = Endpoint();
+
+    if(patternEndpoint.Length()>0)
+        {
+        if(!(thisEndpoint.Length()>0 && patternEndpoint == thisEndpoint))
+            {
+            return EFalse;
+            }
+        }
+
+    TPtrC8 patternContract = aOtherServiceDescription.Contract();
+    TPtrC8 thisContract = Contract();
+
+    if(patternContract.Length()>0)
+        {
+        if(!(thisContract.Length()>0 && patternContract == thisContract))
+            {
+            return EFalse;
+            }
+        }
+
+    TPtrC8 patternFrameworkId = aOtherServiceDescription.FrameworkId();
+    TPtrC8 thisFrameworkId = FrameworkId();
+    if(patternFrameworkId.Length()>0)
+        {
+        if(!(thisFrameworkId.Length()>0 && patternFrameworkId == thisFrameworkId))
+            {
+            return EFalse;
+            }
+        }
+
+
+    TBool match(ETrue);
+		TRAPD(retVal,
+		    RFacetArray otherFacets;
+		    CleanupClosePushL(otherFacets);
+		    aOtherServiceDescription.FacetsL(otherFacets);
+		
+		    TPtrC8 facetName;
+		    TInt count(otherFacets.Count());
+		    for (TInt i=0; i<count && match; i++)
+		        {
+		        facetName.Set(otherFacets[i]->Name());
+		        HasFacetL(facetName, match);
+		        }
+		    otherFacets.ResetAndDestroy();
+		    CleanupStack::Pop(); // otherFacets
+				);
+    return match;
+    }
+
+// implement the MSenRemoteServiceSession:
+EXPORT_C TPtrC8 CSenServiceSession::Endpoint()
+    {
+    return CSenWSDescription::Endpoint();
+    }
+
+EXPORT_C TPtrC8 CSenServiceSession::Contract()
+    {
+    return CSenWSDescription::Contract();
+    }
+
+// implement the MSenRemoteServiceSession:
+EXPORT_C TPtrC8 CSenServiceSession::FrameworkId()
+    {
+    return CSenWSDescription::FrameworkId();
+    }
+
+
+EXPORT_C RFileLogger* CSenServiceSession::Log() const
+    {
+    return iFramework.Manager().Log();
+    }
+
+EXPORT_C void CSenServiceSession::WriteExtensionsAsXMLToL(RWriteStream& aWriteStream)
+    {
+    HBufC8* pFacetAsXML = NULL;
+
+    TInt count(iFacets.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        if (iFacets[i]->Name() != KCompleteMessagesFacet)
+            {
+            pFacetAsXML = iFacets[i]->AsXmlL();
+            CleanupStack::PushL(pFacetAsXML);
+            aWriteStream.WriteL(*pFacetAsXML);
+            CleanupStack::PopAndDestroy(1); // pFacetAsXML
+            }
+        }
+    }
+
+// This base class implementation passes the properties directly to consumer's transport
+EXPORT_C TInt CSenServiceSession::SetTransportPropertiesL( const TDesC8& aProperties,
+                                                           MSenRemoteServiceConsumer& aConsumer )
+    {
+    
+    return aConsumer.TransportL().SetPropertiesL(aProperties, MSenLayeredProperties::ESenConsumerSessionLayer, &aConsumer);
+    }
+
+EXPORT_C TInt CSenServiceSession::TransportPropertiesL(HBufC8*& aProperties,
+                                             MSenRemoteServiceConsumer& aConsumer )
+    {
+    return aConsumer.TransportL().PropertiesL(aProperties);
+    }
+
+EXPORT_C MSenServiceDescription::TDescriptionClassType CSenServiceSession::DescriptionClassType()
+    {
+    return CSenWSDescription::DescriptionClassType();
+    }
+
+
+
+EXPORT_C MSenServiceDescription& CSenServiceSession::AsServiceDescription()
+    {
+    return *this;
+    }
+
+EXPORT_C TInt CSenServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+		CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel ,"CSenServiceSession::RemoveConsumerL");
+    TInt count(iConsumerList.Count());
+    TInt index(KErrNotFound);
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MSenRemoteServiceConsumer* consumer = iConsumerList[i];
+        if ( consumer )
+            {
+            if ( consumer == &aConsumer )
+                {
+                // match
+                index = i;
+                break;
+                }
+
+            if ( consumer->Id() == aConsumer.Id() )
+                {
+                // match
+                index = i;
+                break;
+                }
+            }
+        }
+    if( index != KErrNotFound )
+        {
+        //CSLOG_FORMAT((aConsumer.ConnectionId() , KNormalLogLevel, _L8("- Removing consumer: %d/%d"), (index+1), iConsumerList.Count()));
+        iConsumerList.Remove(index);
+        index = KErrNone; // success
+        //CSLOG_FORMAT((aConsumer.ConnectionId() , KNormalLogLevel, _L8("- Consumer count now: %d"), iConsumerList.Count()));
+        //CSLOG_FORMAT((aConsumer.ConnectionId() , KNormalLogLevel, _L8("- Hostlet:            %d"), ipHostlet?1:0));
+        //CSLOG_FORMAT((aConsumer.ConnectionId() , KNormalLogLevel, _L8("- Transport:          %d"), ipTransport?1:0));
+        
+        if(ipTransport && iConsumerList.Count() == 0 && !ipHostlet)
+            {
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- this session has no consumer(s) and no hostlet; deleting the transport -- START:");
+            delete ipTransport;
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- deleting transport --- END");
+            ipTransport = NULL;
+            }
+        }
+    if (iTransportOwned)
+        {
+        delete ipTransport;
+        ipTransport = NULL;
+        }
+
+    return index;
+    }
+
+EXPORT_C void CSenServiceSession::SetTransportL(CSenTransportBase* aTransport)
+    {
+    if (aTransport)
+        {
+    if(ipTransport && ipTransport != aTransport)
+        {
+        // delete the current transport, if it does not match with new one
+        delete ipTransport; // this will naturally cancel all pending txns
+        ipTransport = NULL;
+        }
+    ipTransport = aTransport;
+    iTransportOwned = aTransport->SessionOwned();
+    }
+    }
+EXPORT_C MSenTransport* CSenServiceSession::Transport() const
+    {
+    return ipTransport;
+    }
+
+EXPORT_C MSenTransport& CSenServiceSession::TransportL(MSenRemoteServiceConsumer& aRequestor)
+    {
+    if(!ipTransport)
+        {
+        MSenTransport& transport = aRequestor.TransportL();
+        ipTransport = (CSenTransportBase*) &transport;
+        }
+    return *ipTransport;
+    }
+
+EXPORT_C TInt CSenServiceSession::SetHostletL(MSenRemoteHostlet* aHostlet)
+    {
+    ipHostlet = aHostlet;
+    if(!ipHostlet && iConsumerList.Count() == 0)
+        {
+        delete ipTransport;
+        ipTransport = NULL;
+        }
+    return KErrNone; // return value not used atm
+    }
+
+EXPORT_C MSenRemoteHostlet* CSenServiceSession::Hostlet() const
+    {
+    return ipHostlet;
+    }
+
+EXPORT_C TBool CSenServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWSDescription ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWSDescription::HasSuperClass( aType ); 
+        }
+    }
+
+EXPORT_C TInt CSenServiceSession::SendToHostletL(MSenRemoteHostlet& aReceiver,
+                                                 const TDesC8& aMessage,
+                                                 const TInt aTxnId,
+                                                 MSenRemoteServiceConsumer& aFrom,
+                                                 MSenProperties* /* aProperties */)
+    {
+    // default impelementation routes the request directly to the hostlet
+    // Handler aware framework could load the required handlers in here
+    // to enable addressing / message correlation etc.
+    return aReceiver.ProcessRequestFromConsumerL(aMessage, aTxnId, aFrom /*, aProperties */); 
+    }
+
+EXPORT_C TInt CSenServiceSession::ProvideHostletResponseL( MSenRemoteHostlet& /* aProvider */,
+                                                           const TInt aTxnId,
+                                                           const TInt aServiceCode,
+                                                           const TDesC8& /* aRecipientsConsumerId */,
+                                                           CSenChunk& /* aMessageChunk */ )
+    {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenServiceSession::ProvideHostletResponseL");
+    TInt retVal(KErrNone);
+    MSenTransport* pTransport = Transport();
+    if ( pTransport )
+        {
+		TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Completing the transaction %d"), aTxnId));
+        retVal = pTransport->CompleteTransaction( aTxnId, aServiceCode );
+        }
+    else
+        {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Fatal - Transport is NULL.");
+        retVal = KErrSenInternal; 
+        }
+    return retVal;
+    }
+
+EXPORT_C TInt CSenServiceSession::SetTransportCueL(const TDesC8& aCue)
+    {
+    return CSenWSDescription::SetTransportCueL(aCue);
+    }
+
+EXPORT_C TPtrC8 CSenServiceSession::TransportCue()
+    {
+    return CSenWSDescription::TransportCue();
+    }
+
+EXPORT_C TInt CSenServiceSession::RefreshMTL(HBufC8*& /*aRevalidationError*/)
+    {
+    return KErrNotSupported;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/sensessioncontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,430 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sensessioncontext.h" 
+
+EXPORT_C CSenSessionContext* CSenSessionContext::NewL()
+    {
+    CSenSessionContext* pNew = CSenSessionContext::NewLC();
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenSessionContext* CSenSessionContext::NewLC()
+    {
+    CSenSessionContext* pNew = new (ELeave) CSenSessionContext();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenSessionContext::CSenSessionContext()
+    {
+    }
+
+EXPORT_C CSenSessionContext::~CSenSessionContext()
+    {
+    }
+       
+EXPORT_C void CSenSessionContext::BaseConstructL()
+    {
+//    CSenContext::BaseConstructL();
+    }
+
+// From MSenSessionContext:
+/*
+SenContext::TContextType CSenSessionContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+       
+SenContext::TContextDirection CSenSessionContext::Direction() const
+    {
+    return CSenContext::Direction();
+    }
+       
+TInt CSenSessionContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenSessionContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TDesC8* CSenSessionContext::GetDesC8L(const TDesC8& aKey)
+    {
+    return CSenContext::GetDesC8L( aKey );
+    }
+       
+TInt CSenSessionContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenSessionContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const TInt* CSenSessionContext::GetIntL(const TDesC8& aKey)
+    {
+    return CSenContext::GetIntL( aKey );
+    }
+       
+TInt CSenSessionContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenSessionContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+const CSenElement* CSenSessionContext::GetSenElementL(const TDesC8& aKey)
+    {
+    return CSenContext::GetSenElementL( aKey );
+    }
+       
+TInt CSenSessionContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );
+    }
+       
+TInt CSenSessionContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+       
+TAny* CSenSessionContext::GetAny(const TDesC8& aKey)
+    {
+    return CSenContext::GetAny( aKey );
+    }
+       
+TInt CSenSessionContext::Remove(const TDesC8& aKey) 
+    {
+    return CSenContext::Remove(aKey);
+    }
+
+TInt CSenSessionContext::Count() const
+    {
+    return CSenContext::Count();
+    }
+
+TPtrC8 CSenSessionContext::KeyAtL(TInt aIndex)
+    {
+    return CSenContext::KeyAtL(aIndex);
+    }
+
+void CSenSessionContext::Reset()
+    {
+    CSenContext::Reset();
+    }
+    
+CSenSoapMessage* CSenSessionContext::GetCurrentSoapMessage() // DEPRECATED: 
+    {
+    CSenSoapMessage* pSoapMessage = NULL;
+    
+    TInt index = iItems.Find( KSenCtxKeyCurrentSoapMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        pSoapMessage = &(pItem->ToSenSoapMessageL());
+        }
+    return pSoapMessage;
+    }
+    
+TPtrC8 CSenSessionContext::GetMessage()
+    {
+    TInt index = iItems.Find( KSenCtxKeyCurrentMessageAsDesc );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const TDesC8* desc = pItem->ToDesC8L();
+        return *desc;
+        }
+    return KNullDesC8();
+    }
+    
+TInt CSenSessionContext::Add(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Add( aKey, aValue );    
+    }
+    
+TInt CSenSessionContext::Update(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    return CSenContext::Update( aKey, aValue );
+    }
+    
+const CSenSoapEnvelope* CSenSessionContext::GetSenSoapEnvelopeL(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find( aKey );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        const CSenSoapEnvelope* envelope = ((CSenSoapEnvelope*)&(pItem->ToSenSoapMessageL()));
+        return envelope;
+        }
+    return NULL;
+    }
+    
+MSenMessage* CSenSessionContext::Message()
+    {
+    TInt index = iItems.Find( KSenCtxKeyMessage );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((MSenMessage*)&(pItem->ToSenMessageL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenSessionContext::SetMessage(MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyMessage(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+    
+CSenChunk* CSenSessionContext::Chunk()
+    {
+    TInt index = iItems.Find( KSenCtxKeyChunk );
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        return ((CSenChunk*)&(pItem->ToSenChunkL()));
+        }
+    return NULL;
+    }
+    
+TInt CSenSessionContext::SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(apMsgAsChunk); )
+        }
+    else // chunk is not to be owned
+        {
+        TRAP( leaveCode, pItem = CSenContextItem::NewL(*apMsgAsChunk); )
+        }
+
+    if( leaveCode != KErrNone ) 
+        {
+        delete pItem; // should ALWAYS be NULL(!)
+        return leaveCode;
+        }
+        
+    TInt retCode(iItems.UpdateValue(&KSenCtxKeyChunk(), pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem; // delete the orphan item
+        } 
+    return retCode;
+    }
+    
+
+TInt CSenSessionContext::SetProperties(MSenProperties* apProperties, TBool aOwned)
+    {
+    if( !apProperties )
+        {
+        return KErrArgument;
+        }
+        
+    TInt retCode(KErrNone);
+    if ( aOwned )
+        {
+        delete ipOwnedTp;
+        ipOwnedTp = NULL;
+        ipOwnedTp = apProperties;
+        }
+    else
+        {
+        
+        CSenContextItem* pItem = NULL;
+        TInt leaveCode(KErrNone);
+//        if( aOwned )
+//            {
+//            TRAP( leaveCode, pItem = CSenContextItem::NewL(apProperties); )
+//            }
+//        else // chunk is not to be owned
+//            {
+            TRAP( leaveCode, pItem = CSenContextItem::NewL(*apProperties); )
+//            }
+
+        if( leaveCode != KErrNone ) 
+            {
+            delete pItem; // should ALWAYS be NULL(!)
+            return leaveCode;
+            }
+            
+        retCode = iItems.UpdateValue(&KSenCtxKeyChunk(), pItem);
+        if( retCode != KErrNone && aOwned )
+            {
+            delete pItem; // delete the orphan item
+            } 
+        }
+    return retCode;
+    }
+
+
+MSenProperties* CSenSessionContext::Properties()
+    {
+    if( ipOwnedTp )
+        {
+        return ipOwnedTp;
+        }
+    else
+        {
+        TInt index = iItems.Find( KSenCtxKeyMessageProperties );
+        if ( index != KErrNotFound )
+            {
+            const CSenContextItem* pItem = iItems.ValueAt(index);
+            if( pItem->Type() == MSenContextItem::EMSenProperties )
+                {
+                MSenProperties* pProperties = (MSenProperties*)pItem;
+                return pProperties;
+                }
+            }
+        return NULL;
+        }
+    }
+
+// Method for adding an "intermediate" message behind certain key; used normally to conduct final "service message"
+TInt CSenSessionContext::Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    if( iItems.Count() > 0 && iItems.Find(aKey) != KErrNotFound )
+        {
+        return KErrAlreadyExists;
+        }
+
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.Append(&aKey, pItem));
+    if( retCode != KErrNone )
+        {
+        delete pItem;
+        }
+    return retCode;
+    }
+    
+// Method for updating some "intermediate" message behind certain key; used normally to conduct final "service message"    
+TInt CSenSessionContext::Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned)
+    {
+    TInt leaveCode(KErrNone);
+    CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode );
+    if( leaveCode != KErrNone ) 
+        {
+        return leaveCode;
+        }
+
+    TInt retCode(iItems.UpdateValue(&aKey, pItem));
+    if( retCode != KErrNone && aOwned )
+        {
+        delete pItem;
+        }
+    return retCode;    
+    }
+    
+// Method for getting "intermediate" message behind certain key; used normally to conduct final "service message"    
+MSenMessage* CSenSessionContext::GetMessage(const TDesC8& aKey)
+    {
+    TInt index = iItems.Find(aKey);
+    if ( index != KErrNotFound )
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if(pItem)
+            {
+            return &pItem->ToSenMessageL();
+            }
+        }
+    return NULL;    
+    }
+ 
+// private helper method(s):
+CSenContextItem* CSenSessionContext::MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError)
+    {
+    aError = KErrNone;
+    CSenContextItem* pItem = NULL;
+    if( aOwned )
+        {
+        if( apMessage->IsSafeToCast( MSenMessage::EMessageBase ) )
+            {
+            CSenMessageBase* msgBase = (CSenMessageBase*) apMessage;
+            TRAP( aError, pItem = CSenContextItem::NewL( msgBase ); )
+            }
+        else if ( apMessage->IsSafeToCast( MSenMessage::ESoapEnvelope2 ) )
+            {
+            CSenSoapEnvelope2* msgSoap2 = (CSenSoapEnvelope2*) apMessage;
+            TRAP( aError,  pItem = CSenContextItem::NewL( msgSoap2 ); )
+            }
+        else 
+            {
+            aError = KErrNotSupported;
+            return NULL;
+            }
+        }
+    else // provided message is *not to be owned*
+        {
+        TRAP( aError, pItem = CSenContextItem::NewL(*apMessage); )
+        }
+    return pItem;        
+    } 
+    
+TInt CSenSessionContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    CSenContext::SetDirection( aDirection );
+    return KErrNone;
+    }
+
+const CSenXmlReader* CSenSessionContext::GetParser()
+    {
+    return CSenContext::GetParser();
+    }
+*/       
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/sensyncrequester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sensyncrequester.h"
+#include "msentransport.h"
+#include "msencoreservicemanager.h" // internal: Core\inc
+#include "senidentifier.h"
+#include "senguidgen.h"             // internal: Utils\inc
+#include "MSenHostlet.h"
+#include "MSenProperties.h"
+
+EXPORT_C CSenSyncRequester* CSenSyncRequester::NewL(MSenTransport& aTransport,
+                                                    MSenCoreServiceManager& aManager)
+    {
+    CSenSyncRequester* pNew = CSenSyncRequester::NewLC(aTransport, aManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenSyncRequester* CSenSyncRequester::NewLC(MSenTransport& aTransport,
+                                                     MSenCoreServiceManager& aManager)
+    {
+    CSenSyncRequester* pNew = new (ELeave) CSenSyncRequester(aTransport, aManager);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenSyncRequester::~CSenSyncRequester()
+    {
+    delete ipResponse;
+    delete ipResponseProperties;
+    delete ipConsumerId;
+    delete ipIdentifier;
+    }
+
+EXPORT_C CSenSyncRequester::CSenSyncRequester(MSenTransport& aTransport,
+                                     MSenCoreServiceManager& aManager)
+
+:   iTransport(aTransport),
+    iServiceManager(aManager),
+    ipIdentifier(NULL),
+    ipConsumerId(NULL),
+    ipResponse(NULL),
+    ipResponseProperties(NULL),
+    iResponsePropertiesType(MSenProperties::ESenXmlProperties),
+    iStatusCode(KErrNone)
+    {
+    }
+
+EXPORT_C void CSenSyncRequester::BaseConstructL()
+    {
+    ipConsumerId =  iServiceManager.RandomGuidL();
+    ipIdentifier = CSenIdentifier::NewL(SenIdentifier::ESession, *ipConsumerId);
+    }
+
+TInt CSenSyncRequester::SubmitL(const TDesC8& aEndpointUri,
+                                const TDesC8& aMessage,
+                                const TDesC8& aRequestTransportProperties,
+                                HBufC8*& apResponseTo)
+    {
+    iStatusCode = KErrNone;
+    TInt txnId(KErrNone);
+    TInt retCode = iTransport.SendL(aEndpointUri,
+                                    aMessage,
+                                    aRequestTransportProperties,
+                                    *this,
+                                    *this,
+                                    txnId);
+                                    
+    if(retCode==KErrNone)
+        {
+        // Wait here until a callback from transport is received:
+        iSchedulerWait.Start();
+    
+        // Now read the response and return code from member variables,
+        // and assign them to the references passed by the SubmitL caller:
+
+        apResponseTo = ipResponse;
+        ipResponse = NULL;
+        //apResponseProperties = ipResponseProperties; // transport properties of the response.
+        //ipResponseProperties = NULL;
+
+        // On success, always return the transaction ID received from the transport:
+        return txnId;
+        }                                    
+    else // error occurred
+        {
+        // SendL failed, return the error immediately:
+        return retCode;
+        }
+    }
+
+
+TInt CSenSyncRequester::SendToConsumerL(HBufC8* apMessage,
+                                        const TInt aTxnId,
+                                        MSenRemoteServiceConsumer& aConsumer,
+                                        MSenProperties* aResponseTransportProperties)
+    {
+    // SendToConsumerL method will be changed to provide reference to 
+    // the transport properties which describe the RESPONSE, not request..
+    return aConsumer.HandleMessageL(apMessage, aTxnId, aResponseTransportProperties);
+    }
+
+TInt CSenSyncRequester::SendErrorToConsumerL(const TInt aErrorCode,
+                                             HBufC8* apError,
+                                             const TInt aTxnId,
+                                             MSenRemoteServiceConsumer& aConsumer,
+                                             MSenProperties* aResponseTransportProperties)
+    {
+    // SendErrorToConsumerL method will be changed to provide reference to 
+    // the transport properties which describe the RESPONSE, not request..
+    return aConsumer.HandleErrorL(apError, aErrorCode, aTxnId, aResponseTransportProperties);
+    }
+
+// Note: this method is meant for those SESSION implementations, which
+// actually are capable of handling certain errors between transport
+// and session.
+TInt CSenSyncRequester::HandleErrorL(const TInt aErrorCode,
+                                     HBufC8* apError,
+                                     const TInt /*aTxnId*/,
+                                     MSenRemoteServiceConsumer& /*aConsumer*/,
+                                     MSenProperties* /*aResponseTransportProperties*/)
+    {
+    // NONE of the errors between transport and session are handled in this level:
+    delete apError;
+    return aErrorCode; // simply bounce the error back to the caller
+    }
+
+const TDesC8& CSenSyncRequester::Id() const
+    {
+    return *ipConsumerId;
+    }
+
+TInt CSenSyncRequester::SetSessionL(MSenRemoteServiceSession& /*aServiceSession*/)
+    {
+    return KErrNone;
+    }
+
+// From MSenRemoteServiceConsumer
+TInt CSenSyncRequester::HandleMessageL(HBufC8* apMessage,
+                                       const TInt aTxnId,
+                                       MSenProperties* aResponseTransportProperties)
+    {
+    iStatusCode = KErrNone;
+    ipResponse = apMessage;
+    if( aResponseTransportProperties ) 
+        {
+        iResponsePropertiesType = aResponseTransportProperties->PropertiesClassType();
+        ipResponseProperties = aResponseTransportProperties->AsUtf8L();
+        }
+    // Now stop the SYNC wait in the SubmitL, so that the main thread 
+    // of the Serene Core Active Scheduler can continue it's execution
+    iSchedulerWait.AsyncStop();
+    return aTxnId;
+    }
+
+// From MSenServiceSession
+TInt CSenSyncRequester::HandleErrorL(HBufC8* apError,
+                                     const TInt aErrorCode,
+                                     const TInt aTxnId,
+                                     MSenProperties* aResponseTransportProperties)
+    {
+    iStatusCode = aErrorCode;
+    ipResponse = apError;
+    if( aResponseTransportProperties ) 
+        {
+        iResponsePropertiesType = aResponseTransportProperties->PropertiesClassType();
+        ipResponseProperties = aResponseTransportProperties->AsUtf8L();
+        }
+    // Now stop the SYNC wait in the SubmitL, so that the main thread 
+    // of the Serene Core Active Scheduler can continue it's execution
+    iSchedulerWait.AsyncStop();
+    return aTxnId;
+    }
+
+void CSenSyncRequester::SetStatusL(const TInt /*aStatus*/)
+    {
+    // not implemented
+    }
+
+MSenTransport& CSenSyncRequester::TransportL()
+    {
+    return  (MSenTransport&)iTransport;
+    }
+
+CSenIdentifier& CSenSyncRequester::Identifier() const
+    {
+    return *ipIdentifier;
+    }
+  
+
+TInt CSenSyncRequester::ChunkByTxnIdL(TInt /* aTxnId */, CSenChunk*& /* aChunk */)
+    {
+    return KErrNotSupported;
+    }
+
+MSenRemoteHostlet* CSenSyncRequester::Hostlet() const
+    {
+    return NULL;
+    }
+
+TInt CSenSyncRequester::SendToHostletL(MSenRemoteHostlet& /* aReceiver */,
+                                       const TDesC8& /* aMessage */,
+                                       const TInt /* aTxnId */,
+                                       MSenRemoteServiceConsumer& /* aFrom */,
+                                       MSenProperties* /* aProperties */)
+    {
+    return KErrNotSupported;
+    }
+
+void CSenSyncRequester::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
+                const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/) 
+    {
+    }
+void CSenSyncRequester::SetDataTrafficDetails( TSenDataTrafficDetails& /*aDetails*/)		
+	{
+	}
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/sentransportcontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senwsdescription.h"
+#include "sentransportcontext.h"
+#include "msencoreservicemanager.h"
+#include "senservicesession.h"
+#include "sencontextitem.h"
+
+EXPORT_C CSenTransportContext::CSenTransportContext()
+: CSenContext(SenContext::EBoth)
+    {
+    }
+
+EXPORT_C CSenTransportContext::~CSenTransportContext()
+    {
+    }
+
+
+EXPORT_C CSenTransportContext* CSenTransportContext::NewL(MSenCoreServiceManager& aCore,
+                                                                 CSenWSDescription& aSessionInitializer)
+    {
+    CSenTransportContext* pNew = CSenTransportContext::NewLC(aCore, aSessionInitializer);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenTransportContext* CSenTransportContext::NewLC(MSenCoreServiceManager& aCore,
+                                                           CSenWSDescription& aSessionInitializer)
+    {
+//    CSenXmlReader* reader = aCore.XMLReader();
+//    if(!reader) User::Leave(KErrArgument); 
+    CSenTransportContext* pNew = new (ELeave) CSenTransportContext();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aCore, aSessionInitializer, NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenTransportContext* CSenTransportContext::NewL(MSenCoreServiceManager& aCore,
+                                                                 CSenWSDescription& aSessionInitializer,
+                                                                 CSenServiceSession& aInvoker)
+    {
+    CSenTransportContext* pNew = CSenTransportContext::NewLC(aCore, aSessionInitializer, aInvoker);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenTransportContext* CSenTransportContext::NewLC(MSenCoreServiceManager& aCore,
+                                                           CSenWSDescription& aSessionInitializer,
+                                                           CSenServiceSession& aInvoker)
+    {
+    CSenTransportContext* pNew = new (ELeave) CSenTransportContext();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aCore, aSessionInitializer, &aInvoker);
+    return pNew;
+    }
+
+EXPORT_C void CSenTransportContext::BaseConstructL(MSenCoreServiceManager& aCore,
+                                                   CSenWSDescription& aSessionInitializer,
+                                                   CSenServiceSession* apInvoker)
+    {
+    CSenContextItem* pCore = CSenContextItem::NewLC(aCore);
+    User::LeaveIfError( iItems.Append( &KSenCtxKeyCoreServiceManager(), pCore ) );
+    CleanupStack::Pop(pCore);
+
+    CSenContextItem* pInit = CSenContextItem::NewLC(aSessionInitializer);
+    User::LeaveIfError( iItems.Append( &KSenCtxKeySessionInitializer(), pInit ) );
+    CleanupStack::Pop(pInit);
+
+    if(apInvoker)
+        {
+        CSenContextItem* pSess = CSenContextItem::NewLC(*apInvoker);
+        User::LeaveIfError( iItems.Append(&KSenCtxKeyServiceSession(), pSess ) );
+        CleanupStack::Pop(pSess);
+        }
+    }
+
+// From MSenTransportContext:
+//TInt CSenTransportContext::AddCore(MSenCoreServiceManager& aValue)
+//    {
+//    }
+
+MSenCoreServiceManager& CSenTransportContext::GetCoreL()
+    {
+    TInt index = iItems.Find( KSenCtxKeyCoreServiceManager );
+    User::LeaveIfError( index );
+
+    const CSenContextItem* pItem = iItems.ValueAt(index);
+    if ( pItem == NULL ) 
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    return pItem->ToSenCoreL();
+
+
+
+    /*
+    TInt leaveCode(KErrNone);
+    MSenCoreServiceManager* pCore = NULL;
+    TRAP( leaveCode, pCore = pItem->ToSenCoreL(); )
+    if( leaveCode == KErrNone ) 
+        {
+        return pCore;
+        }
+    */
+    }
+
+// TInt CSenTransportContext::AddSession(CSenServiceSession* aValue) { };
+// TInt CSenTransportContext::UpdateSession(CSenServiceSession* aValue) { };
+
+
+//CSenServiceSession& CSenTransportContext::GetSessionL()
+const CSenServiceSession* CSenTransportContext::GetSession()
+    {
+    CSenServiceSession* pSession = NULL;
+    TInt index = iItems.Find( KSenCtxKeyServiceSession );
+    if(index != KErrNotFound) 
+        {
+        const CSenContextItem* pItem = iItems.ValueAt(index);
+        if ( pItem ) 
+            {
+            TInt leaveCode(KErrNone);
+            TRAP( leaveCode, pSession = &(pItem->ToSenServiceSessionL()); )
+            if ( leaveCode != KErrNone )
+                {
+                pSession = NULL;
+                }
+            }
+        }
+    return pSession;
+    }
+
+//TInt CSenTransportContext::AddInitializer(CSenWSDescription* aValue) { };
+
+//  TInt CSenTransportContext::UpdateInitializer(CSenWSDescription* aValue);
+
+//const CSenWSDescription* CSenTransportContext::GetInitializer()
+CSenWSDescription& CSenTransportContext::GetInitializerL()
+     {
+    TInt index = iItems.Find( KSenCtxKeySessionInitializer );
+    User::LeaveIfError( index );
+
+    const CSenContextItem* pItem = iItems.ValueAt(index);
+    if ( pItem == NULL ) 
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    return pItem->ToSenServiceDescriptionL();
+    }
+
+// TInt CSenTransportContext::AddServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue);
+// TInt CSenTransportContext::UpdateServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue);
+// const CSenWSDescription* CSenTransportContext::GetServiceDescriptionL(const TDesC8& aKey);
+// TInt CSenTransportContext::Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue); // protected context
+// TInt CSenTransportContext::Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue);
+// const MSenRemoteServiceSession* CSenTransportContext::GetSenRemoteServiceSessionL(const TDesC8& aKey);
+
+
+ // From MSenContext:
+SenContext::TContextType CSenTransportContext::Type() const
+    {
+    return SenContext::ETransportContext;
+    }
+       
+SenContext::TContextDirection CSenTransportContext::Direction() const
+    {
+    return CSenContext::Direction();
+    }
+       
+TInt CSenTransportContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Add(aKey, aValue);
+    }
+       
+TInt CSenTransportContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    return CSenContext::Update(aKey, aValue);
+    }
+       
+const TDesC8* CSenTransportContext::GetDesC8L(const TDesC8& aKey)
+    {
+    return CSenContext::GetDesC8L(aKey);
+    }
+       
+TInt CSenTransportContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Add(aKey, aValue);
+    }
+       
+TInt CSenTransportContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    return CSenContext::Update(aKey, aValue);
+    }
+       
+const TInt* CSenTransportContext::GetIntL(const TDesC8& aKey)
+    {
+    return CSenContext::GetIntL(aKey);
+    }
+       
+TInt CSenTransportContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Add(aKey, aValue);
+    }
+       
+TInt CSenTransportContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return CSenContext::Update(aKey, aValue);
+    }
+       
+const CSenElement* CSenTransportContext::GetSenElementL(const TDesC8& aKey)
+    {
+    return CSenContext::GetSenElementL(aKey);
+    }
+       
+TInt CSenTransportContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Add(aKey, aValue);
+    }
+       
+TInt CSenTransportContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    return CSenContext::Update(aKey, aValue);
+    }
+       
+TAny* CSenTransportContext::GetAnyL(const TDesC8& aKey)	//codescannerwarnings
+    {
+    return CSenContext::GetAnyL(aKey);	//codescannerwarnings
+    }
+
+TInt CSenTransportContext::Remove(const TDesC8& aKey) 
+    {
+    return CSenContext::Remove(aKey);
+    }
+
+TInt CSenTransportContext::Count() const
+    {
+    return CSenContext::Count();
+    }
+
+TPtrC8 CSenTransportContext::KeyAtL(TInt aIndex)
+    {
+    return CSenContext::KeyAtL(aIndex);
+    }
+
+void CSenTransportContext::Reset()
+    {
+    CSenContext::Reset();
+    }
+
+
+TInt CSenTransportContext::SetDirection( SenContext::TContextDirection aDirection )
+    {
+    return CSenContext::SetDirection( aDirection );
+    }
+    
+const CSenXmlReader* CSenTransportContext::GetParser()
+    {
+    CSenXmlReader* reader = NULL;
+    MSenCoreServiceManager* core = NULL;
+    TInt leaveCode(KErrNone);
+    TRAP( leaveCode, core = &GetCoreL(); )
+    if( leaveCode == KErrNone && core)
+        {
+        TRAP( leaveCode, reader = core->XMLReader(); )
+        if( leaveCode == KErrNone && reader )
+            {
+            return reader;
+            }
+        
+        }
+    return NULL;
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senwebservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2158 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "senwebservicesession.h"
+
+#include <SenServiceConnection.h> // error codes etc
+
+#include "senservicesession.h"
+#include "SenServiceConnection.h" // session status constants
+#include "SenSoapMessage.h"
+#include "senwsdescription.h"
+#include "msencoreservicemanager.h"
+#include "msenremoteserviceconsumer.h"
+#include "SenXmlUtils.h"
+#include "SenDateUtils.h"
+#include "msentransport.h"
+#include "SenCredential.h"
+//#include "SenPolicy.h"
+#include "SenSoapFault.h"
+#include "sendebug.h"
+#include "senservicemanagerdefines.h"
+#include "senservicepolicy.h"
+#include "seninternalcredential.h"
+#include "sensaxutils.h"
+#include <xmlengnodelist.h>
+#include <SenIdentityProvider.h>
+#include "senlogger.h"
+#include <SenXmlConstants.h>
+
+#include <SenTransportProperties.h>
+// CONSTANTS
+
+namespace
+    {
+    _LIT8(KServiceInterval1,"ServiceInterval");
+    _LIT(KInvalideDate,"19000101:");
+    /* microseconds before actual notOnOrAfter time
+     * when credentials are treated
+     * as expired.
+     */
+    const TInt KClockSlipMicroSeconds = 3*60*1000*1000;
+
+    // constants for parsing
+    _LIT8(KSDFramework,"<ServiceDescription framework=\"");
+    _LIT8(KContractStart, "<Contract>");
+    _LIT8(KContractEnd, "</Contract>");
+    _LIT8(KTagWithAttrEnd, "\">");
+    _LIT8(KEndPointStart, "<Endpoint>");
+    _LIT8(KEndPointStartWithCue, "<Endpoint cue=\"");   
+    _LIT8(KTagWithAttrClose, "\"/>"); 
+    _LIT8(KEndPointEnd, "</Endpoint>");
+    _LIT8(KCredentialsStart, "<Credentials");
+    _LIT8(KCredentialsEnd, "</Credentials>");
+    _LIT8(KNotOnOrAfterFormat, " notOnOrAfter=\"%S\" >");
+    _LIT8(KEmptyTagEnd, " >");
+    _LIT8(KSDEnd, "</ServiceDescription>");
+    // localnames for element(s)
+    _LIT8(KProviderPolicyLocalName, "ProviderPolicy");
+    _LIT8(KNewLine, "\n");
+    
+    const TInt KCredIdBufSize           = 128;
+    _LIT8(KCredentialIdLocalName,       "SenCredentialId");
+    _LIT8(KCredentialIdStart,           "<SenCredentialId>");
+    _LIT8(KCredentialIdEnd,             "</SenCredentialId>");
+    _LIT8(KEndpointLocalname,           "Endpoint");
+//    _LIT8(KContractLocalname,           "Contract");
+    }
+
+EXPORT_C CSenWebServiceSession::CSenWebServiceSession(TDescriptionClassType aType,
+                                                      MSIF& aFramework)
+:   CSenServiceSession(aType, aFramework)
+    {
+    }
+
+EXPORT_C void CSenWebServiceSession::ConstructL()
+    {
+
+    // Sets the local name to "ServiceDescription"
+    // and initiates the inner ipElement
+    CSenServiceSession::BaseConstructL();
+    // Init member variables
+    iClientServerInterval = 0;
+    iValidUntil = Time::NullTTime();
+    iFrameworkId = iFramework.Id().AllocL();
+    }
+
+EXPORT_C CSenWebServiceSession::~CSenWebServiceSession()
+    {
+    delete iSecurity;
+    delete iContract;
+    delete iEndpoint;
+    delete iFrameworkId;
+    iFrameworkId = NULL;
+    delete iTransportCue;
+    iTransportCue = NULL;
+    iCredentialPtr.RemoveCredentialObserver(*this);
+    iCredentialPtr.Close();
+    }
+
+EXPORT_C TPtrC8 CSenWebServiceSession::TransportCue()
+    {
+    if( iTransportCue )
+        {
+        return *iTransportCue;
+        }
+    else 
+        {
+        return CSenServiceSession::TransportCue();
+        }
+    }
+
+EXPORT_C TInt CSenWebServiceSession::InitializeFromL(MSenServiceDescription& aServiceDescription)
+    {
+   TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,_L("Zapping filelogged messages (.xml)"));
+    
+    // Call superclass method to initialize facets, transport (endpoint) cue, etc..
+	CSenServiceSession::InitializeFromL(aServiceDescription);
+
+    HBufC8* pContract = aServiceDescription.Contract().AllocL();
+    delete iContract;
+    iContract = pContract;
+    
+    HBufC8* pEndpoint = aServiceDescription.Endpoint().AllocL();
+    delete iEndpoint;
+    iEndpoint = pEndpoint;
+
+    if(aServiceDescription.DescriptionClassType()
+                        ==
+        MSenServiceDescription::EWSDescription
+                        ||
+        aServiceDescription.DescriptionClassType()
+                        ==
+        MSenServiceDescription::EWSPattern
+                        ||
+        aServiceDescription.DescriptionClassType()
+                        ==
+        MSenServiceDescription::EIdentityProvider
+        )
+        {
+
+        CSenWSDescription& xmlDesc =
+                            (CSenWSDescription&)aServiceDescription;
+
+        CSenElement* pElement =
+                    (xmlDesc.AsElement()).Element(KServiceInterval1);
+        if(pElement)
+            {
+            TLex8 lex(pElement->Content());
+            TInt64 val;
+            User::LeaveIfError(lex.Val(val));
+            iClientServerInterval = val;
+			TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase, KNormalLogLevel , _L8("Interval in microseconds (from file): %d"),
+                                iClientServerInterval.Int64()));
+            }
+
+        RCredentialList& credentials = xmlDesc.Credentials();
+        TInt count(credentials.Count());
+        for(TInt i=0; i<count; i++)
+            {
+            CSenCredential* pCredential = credentials[i];
+            if(pCredential)
+                {
+                // note: errors while adding single credential must ignored:
+                // - the remaining credentials (array) must be processed..
+
+                //CSenCredential* pCopy = CSenCredential::NewL(*pCredential);
+                //CleanupStack::PushL(pCopy);
+                AddCredentialL(*pCredential);
+                //CleanupStack::Pop(); // pCopy
+                }
+            }
+        // rebuild provider policy definition
+        RebuildFrom(xmlDesc);
+        // update provider policy information (new feature)
+
+        MSenServicePolicy* servicePolicy = ServicePolicy();
+        if(servicePolicy)
+            {
+            MSenServicePolicy* givenServicePolicy = xmlDesc.ServicePolicy();
+            if(givenServicePolicy)
+                (CSenServicePolicy*)servicePolicy->RebuildServicePolicyFrom(*givenServicePolicy);
+            }            
+        }
+    SetStatusL();
+    return KErrNone; // err value not currently in use
+    }
+
+EXPORT_C TInt CSenWebServiceSession::ComputeStatusL()
+    {
+    TInt retVal = CSenServiceSession::ComputeStatusL();
+
+    if (retVal == KSenConnectionStatusReady)
+        {
+        TTime now;
+        now.UniversalTime();
+        now += iClientServerInterval;
+
+#ifdef _SENDEBUG
+            if (iValidUntil != Time::NullTTime())
+                {
+			TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase, KNormalLogLevel , _L8("Client-Server Interval in microseconds: %d"),
+                                    iClientServerInterval.Int64()));
+                
+                TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(ts, now);)
+                if (leaveCode == KErrNone)
+                    {
+                    
+					TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("Fixed client time : %S"), &ts));
+                
+                    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts2;
+                    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(ts2, iValidUntil);)
+			     TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("Credential time : %S, clockslip: %d micros"), &ts2, KClockSlipMicroSeconds));
+                    }
+                leaveCode = 0; // not used
+                }
+#endif // _SENDEBUG
+
+        if ((iValidUntil != Time::NullTTime() ) &&
+            now >
+            (iValidUntil-TTimeIntervalMicroSeconds(KClockSlipMicroSeconds)))
+            {
+			TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,_L("Credential is expired."));
+            retVal = KSenConnectionStatusExpired;
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TBool CSenWebServiceSession::IsExpiredL()
+    {
+    ComputeStatusL();
+    return (CSenServiceSession::StatusL() == KSenConnectionStatusExpired);
+    }
+
+EXPORT_C TInt CSenWebServiceSession::AddCredentialL(
+                                                CSenCredential& aCredential)
+    {
+    if ( aCredential.AsElement().LocalName() == KCredentialIdLocalName )
+        {
+        delete iSecurity;
+        iSecurity = NULL;
+        iSecurity = aCredential.AsXmlL();
+        
+        TInt credentialId;
+        TLex8 lex;
+        lex.Assign(aCredential.AsElement().Content());
+        lex.Val(credentialId);                        
+
+        TInt error(KErrNone);
+        RSenCredentialPtr credentialPtr;
+        credentialPtr = ((MSenServiceManager&)iFramework.Manager()).CredentialL(credentialId,
+                                                                                error);
+        if ( error == KErrNone )
+            {
+            iCredentialPtr = credentialPtr.Clone();
+            iCredentialPtr.AddCredentialObserverL(*this);		//codescannerwarnings
+            iValidUntil = iCredentialPtr.Credential()->ValidUntil();
+            if ( iClientServerInterval == 0 )
+                {
+                TPtrC8 value;
+                TInt ret = iCredentialPtr.Credential()->PropertiesL().PropertyL( KServiceInterval1,
+                                                                                 value );
+                if ( ret == KErrNone )
+                    {
+                    TLex8 lex(value);
+                    TInt64 val;
+                    ret = lex.Val(val);
+                    if ( ret == KErrNone )
+                        {
+                        iClientServerInterval = val;
+                        }
+                    }
+                }
+            }
+        else
+            {
+            // invalidate the session, because we have no credential 
+            iValidUntil.Set(KInvalideDate); // way back in history: January 1st 1900
+
+            iCredentialPtr.RemoveCredentialObserver(*this);
+            iCredentialPtr.Close();
+
+            delete iSecurity;
+            iSecurity = NULL;
+
+            TBuf8<KCredIdBufSize> buffer;
+            buffer.Num(KErrNotFound);
+
+            iSecurity = HBufC8::NewL(buffer.Length()+KCredentialIdStart().Length()+KCredentialIdEnd().Length());
+            TPtr8 sec = iSecurity->Des();
+            sec.Append(KCredentialIdStart);
+            sec.Append(buffer);
+            sec.Append(KCredentialIdEnd);
+            }
+        }
+    else
+        {
+        TInt retVal(KErrNone);
+
+        delete iSecurity;
+        iSecurity = NULL;
+        HBufC8* pSecurityToken = 0;
+        retVal = ConstructSecurityTokenL(aCredential, pSecurityToken);
+        if (KErrNone != retVal)
+            {
+            if ( pSecurityToken != NULL )
+                {
+                delete pSecurityToken;
+                pSecurityToken = NULL;
+                iCredentialPtr.RemoveCredentialObserver(*this);
+                iCredentialPtr.Close();
+                }
+            return retVal;
+            }
+            
+        iValidUntil = aCredential.ValidUntil(); // SetSecurityL needs up-to-date iValidUntil(!)
+
+        CleanupStack::PushL(pSecurityToken);
+        SetSecurityL(*pSecurityToken);
+        CleanupStack::PopAndDestroy(pSecurityToken);
+        }
+        
+    SetStatusL();
+    
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::ConstructSecurityTokenL( CSenCredential& aCredential,
+                                                              HBufC8*& aToken )
+    {
+    aToken = aCredential.AsXmlL();
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::NewMessageL( CSenSoapMessage*& aMessage )
+    {
+    aMessage = CSenSoapMessage::NewL();
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::MessageForSendingL( const TDesC8& aBody,
+                                                         const TDesC8& /* aSenderID */,
+                                                         CSenSoapMessage*& aMessage )
+    {
+    TInt retVal(KErrNone);
+    aMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(aMessage);
+    SetFrameworkHeadersL(*aMessage); 
+    aMessage->SetBodyL(aBody);
+    CleanupStack::Pop(); // aMessage
+    return retVal;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::ParseResponseL( const TDesC8& aResponse,
+                                                     HBufC8*& aParsed )
+    {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::ParseResponseL(const TDesC8&, HBufC8*&)");
+    // this called only from the synchronous submit(..) methods
+    TInt retVal(KErrNone);
+    CSenSoapMessage* pSoapMessage = NULL;
+    retVal = ParseResponseL(aResponse, pSoapMessage);
+    if(retVal!=KErrNone)
+        {
+        delete pSoapMessage;
+        return retVal;
+        }
+
+    CleanupStack::PushL(pSoapMessage);
+
+    // Check for completeMessages
+    TBool completeServerMessages;
+    HasFacetL(KCompleteMessagesFacet,completeServerMessages);
+    if (completeServerMessages)
+        {
+        aParsed = pSoapMessage->AsXmlL();
+        }
+    else
+        {
+        // If the message contained SOAP fault it will be in the body.
+        // It's up to the client to check for a Fault.
+        aParsed = pSoapMessage->BodyAsStringL();
+        if (!aParsed)
+            {
+            retVal = KErrSenNoSoapBody; 
+						TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::ParseResponseL - NULL from BodyAsStringL - return KErrSenNoSoapBody");
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // pSoapMessage
+    return retVal;
+    }
+
+
+EXPORT_C TInt CSenWebServiceSession::SendSoapMessageToConsumerL( CSenSoapMessage* apMessage,
+                                                                 const TInt aTxnId,
+                                                                 MSenRemoteServiceConsumer& aConsumer,
+                                                                 MSenProperties* aResponseTransportProperties )
+    {
+    if ( !apMessage )
+        {
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendSoapMessageToConsumerL");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"Fatal()!: NULL argument passed instead of valid pointer to CSenSoapMessage");
+        return HandleErrorL( KErrSenInternal, NULL, aTxnId, aConsumer, aResponseTransportProperties );
+        }
+
+    CleanupStack::PushL(apMessage);
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendSoapMessageToConsumerL");
+    TInt retVal(KErrNone);
+    // Check if consumer wishes to receive complete server messages:
+    TBool completeServerMessages;
+    HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+    if(completeServerMessages)
+        {
+        HBufC8* pMessageAsXML = apMessage->AsXmlL();
+        CleanupStack::PopAndDestroy(apMessage);
+        if (pMessageAsXML)
+            {
+            retVal = aConsumer.HandleMessageL( pMessageAsXML, aTxnId, aResponseTransportProperties );
+            }
+        }
+    else
+        {
+        //HBufC8* pBody = apMessage->BodyL().Content().AllocL(); 
+        HBufC8* pBody = apMessage->BodyAsStringL();
+        CleanupStack::PopAndDestroy(apMessage);
+        retVal = aConsumer.HandleMessageL( pBody, aTxnId, aResponseTransportProperties );
+        }    
+    return retVal;
+    }
+
+// SYNC, takes ownership of apSoapMessage
+EXPORT_C TInt CSenWebServiceSession::HandleSoapFaultL( CSenSoapMessage* apSoapMessage,
+                                                       HBufC8*& aResponse /*,
+                                                       CSenTransportProperties*& aResponseTransportProperties */) 
+    {
+    if( apSoapMessage )
+        {
+        CleanupStack::PushL(apSoapMessage);
+        CSenSoapFault* pDetached = apSoapMessage->DetachFaultL();
+        CleanupStack::PopAndDestroy( apSoapMessage );
+        TBool completeServerMessages(ETrue);
+        HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+        if(pDetached)
+            {
+            CleanupStack::PushL(pDetached);
+            // Response contains only soapfault in case no completeServerMessages facet 
+            // otherwise it should be left empty
+            // aResponse is updated only when detached soap fault is required.
+            if(completeServerMessages == EFalse)
+            	{
+            	aResponse = pDetached->AsXmlL();	
+            	}
+						TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::HandleErrorL:");
+						TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- successfully detached SOAP fault:");
+            CleanupStack::PopAndDestroy(pDetached); // pDetached
+            // From *this* method, KErrSenSoapFault is *OK return code*, 
+            // just like KErrNone generally is..
+            return KErrSenSoapFault; 
+            }
+        }
+    return KErrNotFound; // SOAP fault not found
+    }
+
+// ASYNC, takes ownership of apSoapMessage
+EXPORT_C TInt CSenWebServiceSession::HandleSoapFaultL( CSenSoapMessage* apSoapMessage,
+                                                       const TInt aErrorCode,
+                                                       const TInt aTxnId,
+                                                       MSenRemoteServiceConsumer& aConsumer,
+                                                       MSenProperties* aResponseTransportProperties )
+    {
+    TInt retVal( KErrSenInternal );
+    if ( apSoapMessage ) 
+        {
+        CleanupStack::PushL(apSoapMessage); // ownership is here
+    
+        CSenSoapFault* pDetached = apSoapMessage->DetachFaultL();
+        if(pDetached)
+            {
+            CleanupStack::PopAndDestroy( apSoapMessage ); // de-alloc msg, detach OK
+            
+            CleanupStack::PushL(pDetached);
+            HBufC8* pAsXml = pDetached->AsXmlL();
+            CleanupStack::PopAndDestroy(pDetached);
+            
+            retVal = aConsumer.HandleErrorL(pAsXml, aErrorCode, aTxnId, aResponseTransportProperties);
+            }
+        else
+            {
+            // Could not detach Soap fault (this method was called, but aSoapMessage did not include fault!)
+            HBufC8* pAsXml = apSoapMessage->AsXmlL();
+            CleanupStack::PopAndDestroy( apSoapMessage ); // de-alloc, serialization ok
+            retVal = aConsumer.HandleErrorL(pAsXml, aErrorCode, aTxnId, aResponseTransportProperties);
+            }
+        }
+    else
+        {
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"Fatal(!): CSenWebServiceSession::HandleSoapFaultL - apSoapMessage arg is NULL. ");
+            retVal = aConsumer.HandleErrorL(NULL, aErrorCode, aTxnId, aResponseTransportProperties);
+        }        
+    return retVal;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SendToConsumerL( HBufC8* apMessage,
+                                                      const TInt aTxnId,
+                                                      MSenRemoteServiceConsumer& aConsumer,
+                                                      MSenProperties* aResponseTransportProperties )
+    {
+    CleanupStack::PushL( apMessage );
+    CSLOG_L( aConsumer.ConnectionId(), KMinLogLevel,"CSenWebServiceSession::SendToConsumerL - begin" );
+    TInt retVal(KErrNone);
+
+    // Check whether this is a response to one-way request; in such case, 
+    // there is no body to validate (but only few response properties):
+    if ( aResponseTransportProperties )
+        {
+        TBool isOnewayMsgRsp(EFalse);
+        aResponseTransportProperties->BoolPropertyL( KSenOnewayMessageOnOff, isOnewayMsgRsp );
+        if ( isOnewayMsgRsp )
+            {
+            // There is no response body to process, halt the execution of this method in here,
+            // and invoke the consumer immediately:
+            CSLOG_L( aConsumer.ConnectionId(), KMinLogLevel,"-- About to invoke MSenRemoteServiceConsumer::HandleMessageL" );
+            CleanupStack::Pop( apMessage );
+            retVal = aConsumer.HandleMessageL( apMessage, aTxnId, aResponseTransportProperties );
+            CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("CSenWebServiceSession::SendToConsumerL - end: HandleMessageL returned: %d"), retVal));
+            return retVal; // skip the SOAP validation, response carries no body
+            }
+        }
+
+    
+    // SOAP orientated implementation:
+    CSenSoapMessage* pSoapMessage = NULL;
+    TInt leaveCode(KErrNone); 
+    
+    if( apMessage && apMessage->Length() > 0 )
+        {
+        TRAP( leaveCode, retVal = ParseResponseL( *apMessage, pSoapMessage ); )
+        }
+    else // apMessage == NULL or descriptor is of zero-length
+        {
+        if ( !apMessage )
+            {
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Note: apMessage argument is NULL => response is treated through KErrSenNoSoapBody");
+            }    
+        retVal = KErrSenNoSoapBody; // clearly, WSS assumes that all messages are SOAP!
+        }
+        
+    if( leaveCode != KErrNone )
+        {
+        // Parsing WAS attempted, but it failed(!)  
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendToConsumerL");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- Error: response could not be parsed into SOAP msg, leave code from parse: %d"), leaveCode));
+        pSoapMessage = NULL;
+        if( retVal==KErrNone )
+            {
+            // indicate with return value, that response is
+            // invalid - even though submit was ok, the
+            // response could NOT be parsed!
+            retVal = leaveCode;
+            }
+        }
+        
+    if(retVal == KErrNone)
+        {
+        CleanupStack::PopAndDestroy(apMessage);
+        CleanupStack::PushL( pSoapMessage );
+        // Response was parsed OK, now check whether it is a SOAP fault:
+        if (pSoapMessage->IsFault())
+            {
+            CleanupStack::Pop(pSoapMessage); // next method takes the ownership:
+            retVal = HandleSoapFaultL(pSoapMessage, KErrSenSoapFault, aTxnId, aConsumer, aResponseTransportProperties);
+            if( retVal == KErrSenSoapFault )
+                {
+                // SOAP fault response is treated as "OK"
+                retVal = KErrNone;
+                }
+            }
+        else
+            {
+            // Response is a valid SOAP envelope
+            CSLOG_L(aConsumer.ConnectionId()  ,  KMinLogLevel ,"CSenWebServiceSession::SendToConsumerL:");
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel ,"- Sending SOAP message to consumer.");
+            CleanupStack::Pop(pSoapMessage); // next method takes the ownership:
+            retVal = SendSoapMessageToConsumerL( pSoapMessage, aTxnId, aConsumer, aResponseTransportProperties );
+#ifdef _SENDEBUG
+            if( retVal!=KErrNone )
+                {
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendToConsumerL:");
+                CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- SendSoapMessageToConsumerL failed: %d"), retVal ));
+                }
+#endif
+            }
+        }
+    else // error recognized
+        {
+        delete pSoapMessage;
+        pSoapMessage = NULL;
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendToConsumerL");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Error: response is not a SOAP message!");
+        
+        CleanupStack::Pop(apMessage);
+        retVal = HandleErrorL(retVal, apMessage, aTxnId, aConsumer, aResponseTransportProperties);
+        }
+    CSLOG_L( aConsumer.ConnectionId(), KMinLogLevel,"CSenWebServiceSession::SendToConsumerL - end" );        
+    return retVal;
+    }
+
+// THIS IS WHAT TRANSPORT SEES:
+EXPORT_C TInt CSenWebServiceSession::SendErrorToConsumerL( const TInt aErrorCode,
+                                                           HBufC8* apError,
+                                                           const TInt aTxnId,
+                                                           MSenRemoteServiceConsumer& aConsumer,
+                                                           MSenProperties* aResponseTransportProperties )
+    {
+    CleanupStack::PushL(apError);
+    TInt retVal(KErrNone);
+
+    // Check whether this is a response to one-way request; in such case, 
+    // there is no body to validate (but only few response properties):
+    if ( aResponseTransportProperties )
+        {
+        TBool isOnewayMsgRsp(EFalse);
+        aResponseTransportProperties->BoolPropertyL( KSenOnewayMessageOnOff, isOnewayMsgRsp );
+        if ( isOnewayMsgRsp )
+            {
+            // There is no response body to process, halt the execution of this method in here,
+            // and invoke the consumer immediately:
+            CSLOG_L( aConsumer.ConnectionId(), KMinLogLevel,"-- About to invoke MSenRemoteServiceConsumer::HandleMessageL" );
+            CleanupStack::Pop( apError );
+            retVal = aConsumer.HandleErrorL( apError, aErrorCode, aTxnId, aResponseTransportProperties );
+            CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("CSenWebServiceSession::SendToConsumerL - end: HandleMessageL returned: %d"), retVal));
+            return retVal; // skip the SOAP validation, response carries no body
+            }
+        }
+    
+    // SOAP orientated implementation:
+    CSenSoapMessage* pSoapMessage = NULL;
+    
+        TInt leaveCode(KErrNone); 
+    
+    if( apError && apError->Length() > 0 )
+        {
+        TRAP( leaveCode, retVal = ParseResponseL( *apError, pSoapMessage ); )
+        }
+    else // apMessage == NULL or descriptor is of zero-length
+        {
+        if ( !apError )
+            {
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Note: apError argument is NULL => response is treated through KErrSenNoSoapBody");
+            }    
+        retVal = KErrSenNoSoapBody; // clearly, WSS assumes that all messages are SOAP!
+        }
+    
+    if( leaveCode != KErrNone )
+        {
+        // Parsing WAS attempted, but it failed(!)
+        pSoapMessage = NULL;
+        
+        // THE RESPONSE IS NOT SOAP
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendErrorToConsumerL");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Error: response could not be parsed into SOAP msg!");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- ParseResponseL leaved: %d"), leaveCode ));
+        if( aErrorCode == KErrNone )
+            {
+            // In this rare case, indicate that SOAP envelope was broken!
+            // So, return KErrSenBrokenSoapEnvelope in here.
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- aErrorCode==KErrNone, but SOAP env is broken!");
+            
+            CleanupStack::Pop(apError);
+            retVal = HandleErrorL(KErrSenBrokenSoapEnvelope, apError, aTxnId, aConsumer, aResponseTransportProperties);
+            }
+        else
+            {
+            CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- Returning error code received from transport: %d"), 
+                aErrorCode));
+
+            CleanupStack::Pop(apError);
+            retVal = HandleErrorL(aErrorCode, apError, aTxnId, aConsumer, aResponseTransportProperties);
+            }
+        }
+    else // ParseResponseL did not leave 
+        {
+        if (retVal == KErrNone )
+            {
+            CleanupStack::PopAndDestroy(apError);
+            // ParseResponseL OK
+            // Call for functionality which checks certain, "recoverable" SOAP errors:
+            // Some frameworks might be able to handle certain SOAP faults themselves
+            retVal = HandleSoapFaultL(pSoapMessage, aErrorCode, aTxnId, aConsumer, aResponseTransportProperties);
+            }
+        else // parsing failed or apError == NULL
+            {
+            delete pSoapMessage;
+            // ParseResponseL NOT ok!
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendErrorToConsumerL");
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Error: response is not a SOAP message!");
+            if ( aErrorCode == KErrNone )
+                {
+                // Rare case: for some odd reason transport did not return error code:
+                // - return the error code from ParseResponseL
+                CSLOG_L(aConsumer.ConnectionId()  , KNormalLogLevel,"- Transport did not return error code.");
+                CleanupStack::Pop(apError);
+                retVal = HandleErrorL(retVal, apError, aTxnId, aConsumer, aResponseTransportProperties);
+                }
+            else
+                {
+                // Just pass forward the error code received from transport:
+                CSLOG_L(aConsumer.ConnectionId()  , KNormalLogLevel,"- Just pass forward error code from transport.");
+                CleanupStack::Pop(apError);
+                retVal = HandleErrorL(aErrorCode, apError, aTxnId, aConsumer, aResponseTransportProperties);
+                }
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::HandleErrorL( const TInt aErrorCode,
+                                                   HBufC8* apError,
+                                                   const TInt aTxnId,
+                                                   MSenRemoteServiceConsumer& aConsumer,
+                                                   MSenProperties* aResponseTransportProperties )
+    {
+    // Current implementation does not handle non-SOAP errors 
+    // that occured at transport layer. Instead, the error is
+    // simply passed to consumer:
+    return aConsumer.HandleErrorL(apError, aErrorCode, aTxnId, aResponseTransportProperties); 
+    // Frameworks should override this method in order to recover
+    // from specific errors/faults
+    }
+
+
+EXPORT_C CSenXmlReader* CSenWebServiceSession::XmlReader()
+    {
+    return iFramework.Manager().XMLReader();
+    }
+
+EXPORT_C TInt CSenWebServiceSession::ParseResponseL(const TDesC8& aResponse,
+                                                    CSenSoapMessage*& aMessage)
+    {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::ParseResponseL(TDesC8&, CSenSoapMessage*&");
+
+    TInt retVal(KErrNone);
+    retVal = NewMessageL(aMessage);
+
+    CleanupStack::PushL(aMessage);
+
+    if (retVal != KErrNone)
+        {
+        return retVal;
+        }
+
+    //////////////////////////////////////////////////////////////////////////
+		TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(_L("******************************************************")));
+		TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMaxLogLevel  , _L("Response to be parsed (%d bytes):"), aResponse.Length()));
+        {
+				TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,aResponse);
+        //FILELOGALL(_L("WsLog"), _L("last_rsp.xml"), aResponse);
+        }
+		TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(_L("******************************************************")));
+    //////////////////////////////////////////////////////////////////////////
+
+    aMessage->SetReader(*XmlReader());
+    TInt leaveCode(KErrNone);
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Parsing response into SOAP message object:");
+    TBool normalParsing(ETrue);
+    if ( aResponse.Size() > KSenMaxLengthSaxParsingSoapMsg )
+        {
+        TInt ret(KErrNotFound);
+        TRAP(leaveCode, ret = HandleBodyWithoutParsingL(*aMessage, aResponse);)
+        if (leaveCode == KErrNone && ret == KErrNone)
+            {
+            normalParsing = EFalse;
+            }
+        }
+    
+    if ( normalParsing )
+        {
+        TRAP(leaveCode, aMessage->ParseL(aResponse));
+        }
+    
+    if(leaveCode==KErrNone)
+        {
+#ifdef _SENDEBUG
+        ///////////////////////////////////////////////////////////////////////
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(_L("---------------------------------------------------")));
+        HBufC8* pAsXml = aMessage->AsXmlL();
+        if(pAsXml)
+            {
+            CleanupStack::PushL(pAsXml);
+						TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::ParseResponseL: OK!");
+						TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMaxLogLevel  , _L(" SOAP message (%d bytes)"),
+                                pAsXml->Length()));
+						TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(*pAsXml));
+            CleanupStack::PopAndDestroy(); //pAsXml
+            }
+				TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel ,(_L("---------------------------------------------------")));
+        ///////////////////////////////////////////////////////////////////////
+#endif // _SENDEBUG
+        retVal = ParseMessageL(*aMessage);
+        }
+    else
+        {
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Response is not SOAP message!");
+        retVal = leaveCode;
+        }
+    CleanupStack::Pop(); // aMessage
+    return retVal;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::ParseMessageL(CSenSoapMessage& aSoapMessage)
+    {
+    // We can verify, that SOAP message has Body:
+    if(!aSoapMessage.HasBody())
+        {
+        return KErrSenNoSoapBody;
+        }
+    else
+        {
+        return KErrNone;
+        }
+    /**
+     * We could verify wsse:Security headers
+     * but we don't have a need for that right now.
+     */
+    }
+
+EXPORT_C TInt CSenWebServiceSession::AddConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::AddConsumerL");
+    iConsumerList.Reset(); 
+    TInt retVal = iConsumerList.Append(&aConsumer);
+    return retVal;
+    }
+
+// 2005: refactored GetConsumer() to Consumer()
+// Note: Same as client() in Java Ref. Impl.
+EXPORT_C MSenRemoteServiceConsumer* CSenWebServiceSession::Consumer()
+    {
+    TInt count(iConsumerList.Count());
+    if(count>0)
+        {
+        return iConsumerList[0];
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+EXPORT_C TBool CSenWebServiceSession::IsReadyL()
+    {
+    return (CSenServiceSession::StatusL() == KSenConnectionStatusReady);
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SubmitL(const TDesC8& aMessage,
+                                             const TDesC8& aTransportProperties,
+                                             MSenRemoteServiceConsumer& aConsumer,
+                                             HBufC8*& aResponse /*,
+                                             CSenTransportProperities*& apResponseTransportProperties */)
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL");
+
+    CSenSoapMessage* pMsg = NULL;
+    TInt retVal( MessageForSendingL(aMessage, aConsumer.Id(), pMsg) ); 
+    CleanupStack::PushL(pMsg);
+
+    if(retVal!=KErrNone)
+        {
+         CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- MessageForSendingL returned an error: %d"), retVal));
+        CleanupStack::PopAndDestroy(); // pMsg
+        return retVal;
+        }
+
+    HBufC8* pHttpBody = pMsg->AsXmlL();
+    if ( pHttpBody )
+        {
+        TPtrC8 endpoint = Endpoint();
+        CleanupStack::PushL(pHttpBody);
+        TPtr8 httpBody = pHttpBody->Des();
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Message (%d) about to submit:"),
+                            httpBody.Length()));
+        //CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,(httpBody));
+//wslog        FILELOGALL(_L("WsLog"), _L("last_req.xml"), httpBody);
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+
+
+        MSenTransport& transport = aConsumer.TransportL();
+        retVal = transport.SubmitL(endpoint, httpBody, aTransportProperties, aResponse, aConsumer);
+
+        CleanupStack::PopAndDestroy(); // pHttpBody
+        }
+
+    CleanupStack::PopAndDestroy(); //  pMsg
+
+    if ( !aResponse )
+        {
+        // Response was NULL: probably either out
+        // of heap or some transport malfunction.
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Received NULL from transport.");
+        return retVal;
+        }
+
+    else if( aResponse->Length() < KSenSoapEnvelopeName().Length()*2 )
+        {
+        // No use parsing, Envelope -root element not there
+
+        // deliver non-soap body to consumer
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- response is not a SOAP envelope.");
+        return retVal;
+        }
+
+    CSenSoapMessage* pResponseSoapMsg = NULL;
+    TInt leaveCode(KErrNone);
+    TInt parseRetVal(KErrNone);
+    TRAP( leaveCode, parseRetVal = ParseResponseL(*aResponse, pResponseSoapMsg));
+
+    if( leaveCode!=KErrNone ) // parsing leaved!
+        {
+
+        pResponseSoapMsg = NULL; 
+
+        // Return directly the response, which was received from
+        // transport. Note that pResponseSoapMsg has already
+        // been deleted because of leave
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel , "CSenWebServiceSession::SubmitL:");
+       CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel , "- Error: response could not be parsed into SOAP msg!");
+        
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- ParseResponseL leaved: %d"), leaveCode ));
+
+        retVal = leaveCode;
+        // else return the error code received from transport (retVal)
+        }
+    else // parsing did not leave..
+        {
+        if ( parseRetVal != KErrNone ) // .. but parsing failed
+            {
+            // Not mandatory, ParseResponseL should take 
+            // care of gc, if it returns an error:
+            delete pResponseSoapMsg; 
+
+            // NOTE - 2005 change: now the body of such
+            // response will be returned to the caller
+            // (with the error code).
+
+            // Response could not be parsed into SOAP message(!)
+            CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- Response could not be parsed, error: (%d)"),
+                parseRetVal));
+
+            if(retVal==KErrNone)
+                {
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Returning error code from ParseResponseL");
+                // transport did not return error, return error from ParseResponseL
+                retVal = parseRetVal;
+                }
+            // else: return the error code received from transport
+            }
+        else // .. and parsing went ok
+            {
+            CleanupStack::PushL( pResponseSoapMsg );
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Response is a SOAP message");
+
+            // Check whether "complete server messages" is on or off
+            TBool completeServerMessages(EFalse);
+            HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+
+            // Response is OK and SOAP message. 
+            if( pResponseSoapMsg->IsFault() )
+                {
+                // Response is a SOAP fault
+                retVal = KErrSenSoapFault; // might change, if framework handles this fault
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"Response is a SOAP fault. Calling HandleErrorL.");
+
+                // Check if SOAP fault could be handled by the framework:
+                HBufC8* pResponse = NULL;
+
+                // Note that HandleSoapFaultL -method normally detaches any SOAP fault:
+                CleanupStack::Pop(pResponseSoapMsg);
+                retVal = HandleSoapFaultL(pResponseSoapMsg, pResponse);
+                if(retVal == KErrSenSoapFault)
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+                    if( completeServerMessages )
+                        {
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Returning SOAP envelope with fault");
+                        // The following lines are important when there is a resending
+                        // the new response is copied to aResponse.
+                        // When there is no resend, then pResponse = NULL no copy happens                     
+                        if(pResponse)
+                        	{
+                        	delete aResponse;
+                        	aResponse = pResponse;
+                        	}
+                        // aResponse will be returned (original response from transport)
+                        }
+                    else // we can pass the detached fault
+                        {
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Returning detached a SOAP fault.");
+                        // Destroy the original response buffer received from transport,
+                        // since now the parsed SOAP envelope can be returned
+                        delete aResponse;
+                        aResponse = pResponse;
+                        }
+                    }
+                else if ( retVal == KErrNone )
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Framework handled this SOAP fault.");
+                    // KErrNone means that fault was handled
+                    // properly (by framework spesific code)
+                    // and consumer may receive the response 
+                    // it requested.
+
+                    // Currently there are no SOAP faults handled
+                    // in WebServiceSession class, so KErrNone is
+                    // never returned. This if -section is here 
+                    // only for *frameworks to extend*.
+
+                    // Destroy the original response buffer received from transport,
+                    // since now the parsed SOAP envelope can be returned
+                    delete aResponse;
+                    aResponse = pResponse;
+                    }
+                else if ( retVal == KErrNotFound )
+                    {
+                    // SOAP fault element  could not be found
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL - MAJOR:");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"-IsFault()==true BUT fault element NOT found!");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"-returning KErrSenBrokenSoapFault");
+                    retVal = KErrSenBrokenSoapFault;
+                    // Note: 2005 change: now the broken (original) response
+                    // from the transport is returned, instead of NULL
+                    }
+#ifdef _SENDEBUG
+                else 
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+                    CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- HandleErrorL failed: %d"), retVal));
+                    }
+#endif // _SENDEBUG
+
+                }
+            else // This SOAP envelope is NOT a fault
+                {
+                if ( completeServerMessages )
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Returning complete SOAP envelope.");
+                    // Destroy the original response buffer received from
+                    // transport, since now the parsed SOAP envelope can
+                    // be returned
+
+                    delete aResponse;
+                    aResponse = NULL;
+                    aResponse = pResponseSoapMsg->AsXmlL(); 
+                    }
+                else
+                    {
+                    HBufC8* pBody = pResponseSoapMsg->BodyAsStringL();
+                    if(pBody)
+                        {
+                        // Destroy the original response buffer received from 
+                        // transport, since now the SOAP body must be returned
+                        delete aResponse;
+                        aResponse = pBody;
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Detached SOAP message body.");
+                        }
+                    else
+                        {
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitL:");
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Could not detach SOAP body(!) - return KErrSenNoSoapBody");
+                        retVal = KErrSenNoSoapBody;
+                        }
+                    }
+                CleanupStack::PopAndDestroy(pResponseSoapMsg);
+                }
+            }
+        }
+
+#ifdef _SENDEBUG
+    if(aResponse)
+        {
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"-------------------------------------------------------------------");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("Submit response (%d bytes):"),
+                            aResponse->Length()));
+        //CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( *aResponse ));
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"-------------------------------------------------------------------");
+        }
+#endif
+
+    return retVal;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SendL( const TDesC8& aMessage, 
+                                            const TDesC8& aTransportProperties,
+                                            MSenRemoteServiceConsumer& aConsumer,
+                                            TInt& aTxnId,
+                                            HBufC8*& /*aRevalidationError*/ )
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendL");
+
+    CSenSoapMessage* pMsg = NULL;
+    TInt retVal( MessageForSendingL(aMessage, aConsumer.Id(), pMsg) ); 
+    CleanupStack::PushL(pMsg);
+
+    if(retVal!=KErrNone)
+        {
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- MessageForSendingL returned an error: %d"), retVal));
+        CleanupStack::PopAndDestroy(); // pMsg
+        return retVal;
+        }
+
+    HBufC8* pHttpBody = pMsg->AsXmlL();
+    if(pHttpBody)
+        {
+        TPtrC8 endpoint  = Endpoint();
+        CleanupStack::PushL(pHttpBody);
+        TPtr8 httpBody = pHttpBody->Des();
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Message (%d bytes) about to send:"), httpBody.Length()));
+        CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,(httpBody));
+//wslog        FILELOGALL(_L("WsLog"), _L("last_req.xml"), httpBody);
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+
+        MSenTransport& t = aConsumer.TransportL();
+
+        retVal = t.SendL( endpoint, httpBody, aTransportProperties, *this, aConsumer, aTxnId );
+
+        CleanupStack::PopAndDestroy(); // pHttpBody
+        }
+
+    CleanupStack::PopAndDestroy(); //  pMsg
+    return retVal;
+    }
+
+
+
+EXPORT_C void CSenWebServiceSession::SetFrameworkHeadersL(CSenSoapMessage& aMsg)
+    {
+    if ( iCredentialPtr.Credential() )
+        {
+        CSenInternalCredential* pCred = iCredentialPtr.Credential();
+        HBufC8* pAsXml = pCred->AsXmlL();
+        CleanupStack::PushL(pAsXml);
+        aMsg.SetSecurityHeaderL(*pAsXml);
+        CleanupStack::PopAndDestroy(pAsXml);
+        }
+    else
+        {
+        // There is no credential available
+        aMsg.SetSecurityHeaderL(KNullDesC8); 
+        }
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SetUserNameL(TDesC8& aUsername)
+    {
+    TInt retVal(KErrNone);
+    HBufC8* pToken8 = NULL;
+
+    retVal = CSenWsSecurityHeader::UsernameTokenL(aUsername, pToken8);
+    CleanupStack::PushL(pToken8);
+
+    if(retVal != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(1); // token
+        return retVal;
+        }
+    else if(pToken8)
+        {
+        if(iSecurity == NULL)
+            {
+            iSecurity = pToken8->Des().AllocL();
+            }
+        else
+            {
+            TPtr8 ptr = iSecurity->Des();
+
+            if (ptr.MaxLength() < pToken8->Length() + ptr.Length())
+                {
+                HBufC8* newSecurity = HBufC8::NewLC(pToken8->Length()
+                                                    +ptr.Length());
+                TPtr8 newPtr = newSecurity->Des();
+                newPtr.Append(*iSecurity);
+                newPtr.Append(*pToken8);
+                delete iSecurity;
+                iSecurity = newSecurity;
+                CleanupStack::Pop();    // newSecurity
+                }
+            else
+                {
+                ptr.Append(*pToken8);
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(); // pToken8
+
+    return retVal;
+    }
+
+EXPORT_C TPtrC8 CSenWebServiceSession::Endpoint()
+    {
+    if(iEndpoint)
+        return *iEndpoint;
+    else
+        return KNullDesC8();
+    }
+
+EXPORT_C TPtrC8 CSenWebServiceSession::Contract()
+    {
+    if(iContract)
+        return *iContract;
+    else
+        return KNullDesC8();
+    }
+
+EXPORT_C TPtrC8 CSenWebServiceSession::FrameworkId()
+    {
+    if(iFrameworkId)
+        return *iFrameworkId;
+    else
+        return KNullDesC8();
+    }
+
+EXPORT_C TPtrC8 CSenWebServiceSession::FrameworkVersion()
+    {
+    return KNullDesC8();
+    }
+
+EXPORT_C void CSenWebServiceSession::SetContractL(const TDesC8& aContract)
+    {
+    HBufC8* pNew = NULL;
+    if(aContract!=KNullDesC8)
+        {
+        pNew = aContract.AllocL();
+        }
+
+    delete iContract;
+    iContract = pNew;
+    }
+
+EXPORT_C void CSenWebServiceSession::SetEndPointL(const TDesC8& aEndpoint)
+    {
+    HBufC8* pNew =NULL;
+    if(aEndpoint!=KNullDesC8)
+        {
+        pNew = aEndpoint.AllocL();
+        }
+
+    delete iEndpoint;
+    iEndpoint = pNew;
+
+    SetStatusL();
+    }
+
+EXPORT_C void CSenWebServiceSession::SetSecurityL(const TDesC8& aSecurity)
+    {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::SetSecurityL");
+    TInt retVal(KErrNone);
+    
+    if ( aSecurity.Length() < 1 )
+        {
+        delete iSecurity;
+        iSecurity = NULL;
+        iCredentialPtr.RemoveCredentialObserver(*this);
+        iCredentialPtr.Close();
+
+        // invalidate the session, because we have no credential 
+        //iValidUntil.Set(_L("19000101:")); // way back in history: January 1st 1900
+        //acording to ID-WSF no need of reset the credential here
+        }
+     else
+        {
+        if ( HasSecurity() )
+            {
+            iCredentialPtr.RemoveCredentialObserver(*this);
+            ((MSenServiceManager&)iFramework.Manager()).UpdateCredentialL(
+                                iCredentialPtr.Credential()->IdentifierL().IdL(),
+                                aSecurity,
+                                retVal);
+            if ( retVal == KErrNone )
+                {
+                iCredentialPtr.AddCredentialObserverL(*this);
+                CSenInternalCredential* pCred = iCredentialPtr.Credential();
+                
+                if ( iClientServerInterval.Int64() != 0 )
+                    {
+                    TBuf8<64> buf;
+                    buf.AppendNum(iClientServerInterval.Int64());
+                    pCred->PropertiesL().SetPropertyL(KServiceInterval1, buf);
+                    }
+                FillCredentialIdentifierL(pCred->IdentifierL());
+
+                TTime validUntil = iValidUntil;
+                pCred->PropertiesL().SetValidUntilL(validUntil);
+                }
+            else
+                {
+                delete iSecurity;
+                iSecurity = NULL;
+                iCredentialPtr.Close();
+                
+                // invalidate the session, because we have no credential 
+        		iValidUntil.Set(KInvalideDate); // way back in history: January 1st 1900  //CodeScannerWarnings
+                }
+            }
+        else
+            {
+            RSenCredentialPtr credentialPtr =
+                    ((MSenServiceManager&)iFramework.Manager()).AddCredentialL(aSecurity, retVal);
+        
+            if ( retVal == KErrNone )
+                {        
+
+                iCredentialPtr.RemoveCredentialObserver(*this);
+                iCredentialPtr.Close();
+                iCredentialPtr = credentialPtr.Clone();
+                iCredentialPtr.AddCredentialObserverL(*this);	//codescannerwarnings
+
+                CSenInternalCredential* pCred = iCredentialPtr.Credential();
+                
+                if ( iClientServerInterval.Int64() != 0 )
+                    {
+                    TBuf8<64> buf;
+                    buf.AppendNum(iClientServerInterval.Int64());
+                    pCred->PropertiesL().SetPropertyL(KServiceInterval1, buf);
+                    }
+                FillCredentialIdentifierL(pCred->IdentifierL());	//codescannerwarnings
+                
+                TTime validUntil = iValidUntil;
+                pCred->PropertiesL().SetValidUntilL(validUntil);
+                
+                SetCredentialIdL(pCred->IdentifierL().IdL());
+                }
+            else
+                {
+                delete iSecurity;
+                iSecurity = NULL;
+                iCredentialPtr.RemoveCredentialObserver(*this);
+                iCredentialPtr.Close();
+                
+                // invalidate the session, because we have no credential 
+                iValidUntil.Set(KInvalideDate); // way back in history: January 1st 1900
+                }
+            }
+        }
+    }
+    
+/*    
+EXPORT_C TInt CSenWebServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer)    
+    {
+    LOG_WRITE_L("CSenWebServiceSession::RemoveConsumerL");
+    CSenServiceSession::RemoveConsumerL(aConsumer);
+    
+    // If this session has no consumers, we can hold our grip to the credential
+    // (note: this does NOT mean that credential is removed, not at all(!), but
+    //  that new search for the credential has to be performed).
+    
+    // NOTE: this cannot be done at ws service session layer as long as ID-WSF does not
+    // use credential sharing / lookup mechanism in cases where session is found invalid
+    // (this is done in WS-* framework plug-in)
+    TInt count(iConsumerList.Count());
+    if( count == 0 )
+        {
+        LOG_WRITE_L("- Credential count == 0");
+        LOG_WRITE_L("-> Closing the handle to the credential owned by Credential Manager.");
+        SetSecurityL(KNullDesC8);    
+        }
+    }
+*/    
+void CSenWebServiceSession::SetCredentialIdL(TInt aCredentialId)
+    {
+    TBuf8<KCredIdBufSize> buffer;
+    buffer.Num(aCredentialId);
+
+    delete iSecurity;
+    iSecurity = NULL;
+    TInt leaveCode( KErrNone );
+    TRAP( leaveCode, iSecurity = HBufC8::NewL( buffer.Length()+KCredentialIdStart().Length()+KCredentialIdEnd().Length() ); )
+    if( !leaveCode && iSecurity )
+        {
+        TPtr8 sec = iSecurity->Des();
+        sec.Append( KCredentialIdStart );
+        sec.Append( buffer);
+        sec.Append( KCredentialIdEnd );
+        }
+#ifdef _SENDEBUG
+    else
+        {
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::SetCredentialId(): iSecurity = HBufC8::NewL leaved (OOM)!");
+        }
+#endif // _SENDEBUG        
+    }
+
+EXPORT_C TInt CSenWebServiceSession::GetCredentialIdL()
+    {
+    TInt retVal(0);
+    if (HasSecurity())
+        {
+        retVal = iCredentialPtr.Credential()->IdentifierL().IdL();	//codescannerwarnings
+        }
+    return retVal;
+    }
+
+    
+EXPORT_C void CSenWebServiceSession::FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier)
+    {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::FillCredentialIdentifierL");
+    if ( iEndpoint )
+        {
+				TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,  _L8("- Setting endpoint to credential as property: %S"), iEndpoint ));
+        aIdentifier.SetPropertyL(KEndpointLocalname, *iEndpoint);
+        }
+    }
+    
+EXPORT_C TInt CSenWebServiceSession::TryToSearchValidCredentialL()
+    {
+		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::TryToSearchValidCredentialL()");
+    
+    // Get CredentialIdentifier which should include ProviderID
+    CSenCredentialIdentifier* pCredIdentifier = CSenCredentialIdentifier::NewLC();
+    FillCredentialIdentifierL(*pCredIdentifier);
+    
+    CSenWSDescription* pPattern = CSenWSDescription::NewLC();
+    CSenElement& patternElement = ((CSenWSDescription*)pPattern)->AsElement();
+    
+    TPtrC8 providerId(KNullDesC8);
+    
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    TXmlEngElement element = pCredIdentifier->AsElementL();
+    element.GetChildElements(list);
+    while ( list.HasNext() )
+        {
+        TXmlEngElement element = list.Next();
+        if ( element.Name() != KSenIdpProviderIdLocalname )
+            {
+            CSenElement& addedElement = patternElement.AddElementL(element.Name());
+            addedElement.SetContentL(element.Text());
+            }
+        else
+            {
+            providerId.Set(element.Text());
+            }
+        }
+    
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if ( providerId != KNullDesC8 )
+        {
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::TryToSearchValidCredentialL():");
+				TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  , _L8("- Trying to search IdentityProvider using ProviderId : %S"), &providerId));
+        CSenWSDescription* pIdpPattern = CSenWSDescription::NewLC();
+        pIdpPattern->SetEndPointL(providerId);
+        pIdentityProvider = iFramework.Manager().IdentityProviderL(*pIdpPattern);
+        CleanupStack::PopAndDestroy(pIdpPattern);
+        }
+
+    RSenCredentialPtrArray credentialPtrsArray;
+    CleanupClosePushL(credentialPtrsArray);
+
+    TInt retVal(KErrNone);
+    if ( pIdentityProvider )
+        {
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::TryToSearchValidCredentialL() - IdentityProvider was found. Trying to search related Credentials.");
+        retVal = ((MSenServiceManager&)iFramework.Manager()).CredentialsL(*pPattern, 
+                                                                          *pIdentityProvider,
+                                                                          credentialPtrsArray);
+        }
+    else
+        {
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::TryToSearchValidCredentialL() - FATAL: IdentityProvider was NOT found:");
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"- Trying to search Credentials without IdentityProvider information.");
+                retVal = ((MSenServiceManager&)iFramework.Manager()).CredentialsL(*pPattern,
+                                                                          credentialPtrsArray);
+        }
+        
+    if ( (retVal == KErrNone) && (credentialPtrsArray.Count() > 0) )
+        {
+				TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KNormalLogLevel  ,_L8("CSenWebServiceSession::TryToSearchValidCredentialL(): %d Credentials found."), credentialPtrsArray.Count()));
+        // Take the first valid Credential from found Credentials array.
+        TBool credentialOK(EFalse);
+        TInt count = credentialPtrsArray.Count();
+        for (TInt i=0; i < count; i++)
+            {
+            SetCredentialPtrL(credentialPtrsArray[0]);//codescannerwarnings
+            iValidUntil = iCredentialPtr.Credential()->PropertiesL().ValidUntilL();	//codescannerwarnings
+            
+            if ( ComputeStatusL() == KSenConnectionStatusReady)
+                {
+                credentialOK = ETrue;
+                break;
+                }
+            }
+            
+        if ( credentialOK )
+            {
+						TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase   , KMinLogLevel  , _L8("CSenWebServiceSession::TryToSearchValidCredentialL(): Valid Credential were found. CredentialId : %d"),
+                            iCredentialPtr.Credential()->IdentifierL().IdL()));	//codescannerwarnings
+            retVal = KErrNone;
+            }
+        else
+            {
+						TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::TryToSearchValidCredentialL(): Valid Credentials were not found.");
+            SetSecurityL(KNullDesC8);
+            retVal = KErrNotFound;
+            }
+        }
+    else
+        {
+				TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel ,"CSenWebServiceSession::TryToSearchValidCredentialL(): Credentials were not found.");
+        retVal = KErrNotFound;
+        }
+        
+    CleanupStack::PopAndDestroy(&credentialPtrsArray);
+        
+    CleanupStack::PopAndDestroy(&list); // Close()
+    CleanupStack::PopAndDestroy(pPattern);
+    CleanupStack::PopAndDestroy(pCredIdentifier);
+    
+    return retVal;
+    }
+
+EXPORT_C const TTime& CSenWebServiceSession::ValidUntilL()
+    {
+    if (iValidUntil != Time::NullTTime())
+        {
+        return iValidUntil;
+        }
+    else
+        {
+        const TTime& MAX_TIME = Time::MaxTTime();
+        return MAX_TIME; // if no expiration was set, the session is
+                         // valid forever(!)
+        }
+    }
+
+EXPORT_C void CSenWebServiceSession::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    _LIT8(KTouch, "touch");
+    aWriteStream.WriteL(KSDFramework);
+    aWriteStream.WriteL(FrameworkId());
+    CSenElement* elem = &AsElement();
+    
+    const TDesC8* attrVal = elem->AttrValue(KTouch);
+    	if(attrVal != NULL)
+    	{
+    	aWriteStream.WriteL(KSenDblQuot);
+    	aWriteStream.WriteL(KSenSpace);
+    	aWriteStream.WriteL(KTouch);
+    	aWriteStream.WriteL(KSenEqualsDblQuot);
+    	aWriteStream.WriteL(*attrVal);	
+    	}
+    aWriteStream.WriteL(KTagWithAttrEnd);
+
+    // write contract
+    if(iContract && iContract->Length()>0)
+        {
+        aWriteStream.WriteL(KContractStart);
+        aWriteStream.WriteL(*iContract);
+        aWriteStream.WriteL(KContractEnd);
+        }
+
+    // write endpoint
+    TPtrC8 cue = TransportCue();
+    if(iEndpoint && iEndpoint->Length()>0)
+        {
+        if( iTransportCue && iTransportCue->Length()>0)
+            {
+            // both cue and endpoint
+            aWriteStream.WriteL(KEndPointStartWithCue);
+            aWriteStream.WriteL(*iTransportCue);
+            aWriteStream.WriteL(KTagWithAttrEnd);
+            aWriteStream.WriteL(*iEndpoint);
+            aWriteStream.WriteL(KEndPointEnd);
+            
+            }
+        else
+            {
+            // just endpoint
+            aWriteStream.WriteL(KEndPointStart);
+            aWriteStream.WriteL(*iEndpoint);
+            aWriteStream.WriteL(KEndPointEnd);
+            }
+        }
+    else if ( iTransportCue && iTransportCue->Length() > 0 )
+        {
+        // only cue, but no endpoint
+        aWriteStream.WriteL(KEndPointStartWithCue);
+        aWriteStream.WriteL(*iTransportCue);
+        aWriteStream.WriteL(KTagWithAttrClose);
+        }
+
+    // write security credentials
+    if(iSecurity)
+        {
+        aWriteStream.WriteL(KCredentialsStart);
+        if (iValidUntil != Time::NullTTime())
+            {
+            HBufC8* dateDes = HBufC8::NewLC(256);
+            TPtr8 datePtr = dateDes->Des();
+            SenDateUtils::ToXmlDateTimeUtf82L(datePtr, iValidUntil);
+            HBufC8* tempBuf = HBufC8::NewLC(KNotOnOrAfterFormat().Length() +
+                                            datePtr.Length());
+
+            TPtr8 ptr = tempBuf->Des();
+            ptr.Format(KNotOnOrAfterFormat, dateDes);
+
+            aWriteStream.WriteL(ptr);
+            CleanupStack::PopAndDestroy(2); // tempBuf, dateDes
+            tempBuf = NULL;
+            }
+        else
+            {
+            aWriteStream.WriteL(KEmptyTagEnd);
+            }
+
+        aWriteStream.WriteL(*iSecurity);
+        aWriteStream.WriteL(KCredentialsEnd);
+        }
+
+    CSenElement* pProviderPolicyElement =
+                            AsElement().Element(KProviderPolicyLocalName);
+
+    if(pProviderPolicyElement)
+        {
+        HBufC8* pProviderPolicyAsXmlUtf8 = pProviderPolicyElement->AsXmlL();
+        if(pProviderPolicyAsXmlUtf8)
+            {
+            CleanupStack::PushL(pProviderPolicyAsXmlUtf8);
+            aWriteStream.WriteL(*pProviderPolicyAsXmlUtf8);
+            CleanupStack::PopAndDestroy(); // pProviderPolicyAsXmlUtf8
+            }
+        }
+
+    WriteExtensionsAsXMLToL(aWriteStream);
+    
+  //Writing the ServicePolicy to XML  
+    MSenServicePolicy* servicePolicy = ServicePolicy();
+    if(servicePolicy)
+        {
+        CSenServicePolicy* ele = (CSenServicePolicy*)servicePolicy;
+        CSenElement* pServicePolicyElement = &ele->AsElement();          
+        if(pServicePolicyElement)
+            {
+            HBufC8* pServicePolicyAsXmlUtf8 = pServicePolicyElement->AsXmlL();
+            if(pServicePolicyAsXmlUtf8)
+                {
+                CleanupStack::PushL(pServicePolicyAsXmlUtf8);            
+                aWriteStream.WriteL(*pServicePolicyAsXmlUtf8);
+                CleanupStack::PopAndDestroy(); // pProviderPolicyAsXmlUtf8
+                }
+            }
+        }            
+
+    aWriteStream.WriteL(KSDEnd);
+    aWriteStream.WriteL(KNewLine);
+
+
+
+    }
+
+
+
+EXPORT_C TInt CSenWebServiceSession::SubmitSoapL(const TDesC8& aSoapMessage, 
+                                                 const TDesC8& aTransportProperties,
+                                                 MSenRemoteServiceConsumer& aConsumer,
+                                                 HBufC8*& aResponse)
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+    TPtrC8 endpoint  = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Message (%d bytes) about to submit:"), aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( aSoapMessage ));
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+#endif
+
+    MSenTransport& t = aConsumer.TransportL();
+
+    TInt retVal = t.SubmitL(endpoint, aSoapMessage, aTransportProperties, aResponse, aConsumer);
+
+    if(!aResponse)
+        {
+        // Response was NULL: probably either out
+        // of heap or some transport malfunction.
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Received NULL from transport.");
+        return retVal;
+        }
+    else if(aResponse->Length() < KSenSoapEnvelopeName().Length()*2)
+        {
+        // No use parsing, Envelope -root element not there.
+        // Just deliver this "non-soap" response to consumer
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Response is not a SOAP envelope.");
+        return retVal;
+        }
+
+    // Attempt to parse the response here. SOAP faults 
+    // are to be searched after,
+    CSenSoapMessage* pResponseSoapMsg = NULL;
+    TInt leaveCode(KErrNone);
+    TInt parseRetCode(KErrNone);
+    TRAP( leaveCode, (parseRetCode =
+        ParseResponseL(*aResponse, pResponseSoapMsg)) );
+
+    if(leaveCode!=KErrNone)
+        {
+        // Return directly the response, which was received from
+        // transport. Note that pResponseSoapMsg has already
+        // been deleted because of leave
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8(" - ParseResponseL leaved: %d"), leaveCode ));
+        
+        if(retVal==KErrNone) // retVal still SubmitL() return value
+            {
+            // Indicate with return value, that response is
+            // invalid - even though submit was ok, the
+            // response could NOT be parsed(!).
+            retVal = leaveCode;
+            }
+        }
+    else // ParseResponseL did not leave..
+        {
+        if(parseRetCode != KErrNone) // .. but returned an error
+            {
+            // Not mandatory, ParseResponseL should take 
+            // care of gc, if it returns an error:
+             delete pResponseSoapMsg; 
+             CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+
+            CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- Parsing failed, error: %d"),
+                    parseRetCode));
+
+            if(retVal==KErrNone) // submit was ok
+                {
+                // Indicate with return value, that response is
+                // invalid - even though submit was ok, the
+                // response could NOT be parsed!
+                retVal = parseRetCode;
+                }
+            }
+        else // .. and parsing was successful
+            {
+            CleanupStack::PushL(pResponseSoapMsg);
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Response is a SOAP message");
+
+            TBool completeServerMessages(ETrue);
+            HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+
+            // response is OK and in SOAP form.
+            if(pResponseSoapMsg->IsFault())
+                {
+                // Response is a SOAP fault
+                retVal = KErrSenSoapFault; // might change, if framework handles this fault
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Response is a SOAP fault. Calling HandleErrorL.");
+
+                // Check if this SOAP fault could be handled by the framework
+                HBufC8* pResponse = NULL;
+                CleanupStack::Pop(pResponseSoapMsg);
+                retVal = HandleSoapFaultL(pResponseSoapMsg, pResponse/*, aResponseTransportProperties */);
+
+                if(retVal == KErrSenSoapFault)
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+                    if(completeServerMessages)
+                        {
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Returning SOAP envelope with fault");
+						// The following lines are important when there is a resending
+                        // the new response is copied to aResponse.
+                        // When there is no resend, then pResponse = NULL no copy happens                     
+                        if(pResponse)
+                        	{
+                        	delete aResponse;
+                        	aResponse = pResponse;
+                        	}                        // aResponse will be returned (original response from transport)
+                        }
+                    else // Pass the detached fault
+                        {
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Returning detached a SOAP fault.");
+                        // Destroy the original response buffer received from transport,
+                        // since now the parsed SOAP envelope can be returned
+                        delete aResponse;
+                        aResponse = pResponse;
+                        }
+                    }
+                else if(retVal == KErrNone)
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Framework handled this SOAP fault.");
+                    // KErrNone means that fault was handled
+                    // properly (by framework spesific code)
+                    // and consumer may receive the response 
+                    // it requested.
+
+                    // Currently there are no SOAP faults handled
+                    // in WebServiceSession class, so KErrNone is
+                    // never returned. This if -section is here 
+                    // only for *frameworks to extend*.
+
+                    // Destroy the original response buffer received from transport,
+                    // since now the parsed SOAP envelope can be returned
+                    delete aResponse;
+                    aResponse = pResponse;
+                    }
+                else if(retVal==KErrNotFound)
+                    {
+                    // SOAP fault element  could not be found
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL - MAJOR:");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"-IsFault()==true BUT fault element NOT found!");
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"-returning KErrSenBrokenSoapFault");
+                    retVal = KErrSenBrokenSoapFault;
+                    // Note: 2005 change: now the broken (original) response
+                    // from the transport is returned, instead of NULL
+                    }
+#ifdef _SENDEBUG
+                else 
+                    {
+                    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+                    CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- HandleErrorL failed: %d"), retVal));
+                    }
+#endif // _SENDEBUG
+                } 
+            else // this SOAP envelope is NOT a fault
+                {
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+                CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Response is a SOAP envelope.");
+
+                // Check complete server messages on/off
+                if(!completeServerMessages)
+                    {
+                    HBufC8* pBody = pResponseSoapMsg->BodyAsStringL();
+                    if(pBody)
+                        {
+                        // Destroy the original response buffer received from transport,
+                        // since now the parsed SOAP envelope can be returned
+                        delete aResponse;
+                        aResponse = pBody;
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Detached SOAP message body.");
+                        }
+                    else
+                        {
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Could not detach SOAP body(!) - return KErrSenNoSoapBody");
+                        // Note: 2005 change: now the broken (original) response
+                        // from the transport is returned, instead of NULL
+                        retVal = KErrSenNoSoapBody;
+                        }
+                    }
+                
+                CleanupStack::PopAndDestroy(pResponseSoapMsg);
+                }
+                // else { // return complete server message }
+                
+            }
+        }
+
+#ifdef _SENDEBUG
+    if(aResponse)
+        {
+        
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"------------------------------------------------------------");
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"CSenWebServiceSession::SubmitSoapL:");
+        CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Response (%d bytes):"), aResponse->Length()));
+        CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( *aResponse ));
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"------------------------------------------------------------");
+        }
+#endif
+    return retVal;
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SendSoapL( const TDesC8& aSoapMessage, 
+                                                const TDesC8& aTransportProperties,
+                                                MSenRemoteServiceConsumer& aConsumer,
+                                                TInt& aTxnId,
+                                                HBufC8*& /* aRevalidationError*/ ) // SIFs should utilize aRevalidationError
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendSoapL:");
+    TPtrC8 endpoint  = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Endpoint: %S:"), &endpoint));
+    CSLOG_FORMAT((aConsumer.ConnectionId() , KMaxLogLevel, _L8("- Message (%d bytes) about to send:"), 
+                    aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( aSoapMessage ));
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"////////////////////////////////////////////////////////");
+#endif
+
+    MSenTransport& t = aConsumer.TransportL();
+    TInt retVal( t.SendL(endpoint, aSoapMessage, aTransportProperties, *this, aConsumer, aTxnId) );
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWebServiceSession::SendSoapL:");
+
+    CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel, _L8("- Received transaction ID: %d"), aTxnId));
+    return retVal;
+    }
+
+
+
+// NOTE: the ownership of the consumer-pointer(s), which are copied (appended)
+// into aConsumers array is NOT transfered to the caller!
+
+// 2005: refactored GetConsumers() to Consumers()
+EXPORT_C TInt CSenWebServiceSession::Consumers(RServiceConsumerArray& aConsumers) const
+    {
+    TInt count(iConsumerList.Count());
+        {
+        for(TInt i=0; i<count; i++)
+            {
+            // creates a copy of pointers, but ownership is NOT transferred!
+            TInt error = aConsumers.Append(iConsumerList[i]);
+            if(error != KErrNone)
+                return error;
+            }
+        }
+        return KErrNone;
+    }
+
+EXPORT_C TTimeIntervalMicroSeconds
+                                CSenWebServiceSession::ClientServerInterval()
+    {
+    return iClientServerInterval;
+    }
+
+EXPORT_C void CSenWebServiceSession::SetClientServerIntervalL(
+                                        TTimeIntervalMicroSeconds aInterval)	//codescannerwarnings
+    {
+    iClientServerInterval = aInterval;
+    if ( iCredentialPtr.Credential() )
+        {
+        TBuf8<64> buf;
+        buf.AppendNum(iClientServerInterval.Int64());
+        iCredentialPtr.Credential()->PropertiesL().SetPropertyL(KServiceInterval1, buf);	//CodeScannerWarnings
+        }
+    }
+
+EXPORT_C TBool CSenWebServiceSession::HasConsumer() const
+    {
+    if (iConsumerList.Count() > 0) 
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }
+    }
+
+EXPORT_C void CSenWebServiceSession::StartTransaction()
+    {
+    // Nothing in framework base class level
+    }
+
+EXPORT_C void CSenWebServiceSession::TransactionCompleted()
+    {
+    // Nothing in framework base class level
+    }
+
+EXPORT_C TBool CSenWebServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EServiceSession ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        { 
+        // Otherwise, ask from direct superclass (may invoke chain of recursive calls)
+        return CSenServiceSession::HasSuperClass( aType ); 
+        }
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SetTransportCueL(const TDesC8& aCue)
+    {
+    HBufC8* pNew =NULL;
+    if(aCue!=KNullDesC8)
+        {
+        pNew = aCue.AllocL();
+        }
+    delete iTransportCue;
+    iTransportCue = pNew;
+    
+    return KErrNone;
+    }
+
+EXPORT_C HBufC8* CSenWebServiceSession::SecurityL()
+    {
+    if ( HasSecurity() )
+        {
+        return iCredentialPtr.Credential()->AsXmlL();
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+    
+EXPORT_C TBool CSenWebServiceSession::HasSecurity()
+    {
+    if ( iCredentialPtr.Credential() )
+        {
+        return ETrue;
+        }
+    
+    return EFalse;
+    }
+    
+EXPORT_C void CSenWebServiceSession::SetCredentialPtrL(RSenCredentialPtr aCredentialPtr)	//codescannerwarnings
+    {
+    // Stop observing the removal of credential as this instance is itself doing the removal
+    iCredentialPtr.RemoveCredentialObserver(*this);
+    //temp pointer eliminate self deleting when counter = 1 and aCredentail points same data as iCredentialPtr
+    // in other words there is a chance that closing iCredentialPtr make dirty aCredentialPtr. Temp ptr keeps balance so 
+    //  that counter has proper value.
+    RSenCredentialPtr tempPtr = iCredentialPtr.Clone();
+    iCredentialPtr.Close();
+    iCredentialPtr = aCredentialPtr.Clone();
+    tempPtr.Close();    
+    // Start observing the new credential
+    iCredentialPtr.AddCredentialObserverL(*this);	//codescannerwarnings
+    SetCredentialIdL(iCredentialPtr.Credential()->IdentifierL().IdL());	//codescannerwarnings
+    }
+
+EXPORT_C TInt CSenWebServiceSession::SendToHostletL(MSenRemoteHostlet& aReceiver,
+                                                 const TDesC8& aMessage,
+                                                 const TInt aTxnId,
+                                                 MSenRemoteServiceConsumer& aFrom,
+                                                 MSenProperties* aProperties)
+    {
+    // default impelementation routes the request directly to the hostlet
+    // Handler aware framework could load the required handlers in here
+    // to enable addressing / message correlation etc.
+    return CSenServiceSession::SendToHostletL(aReceiver, aMessage, aTxnId, aFrom, aProperties); 
+    }
+
+EXPORT_C TInt CSenWebServiceSession::ProvideHostletResponseL( MSenRemoteHostlet& aProvider,
+                                                              const TInt aTxnId,
+                                                              const TInt aServiceCode,
+                                                              const TDesC8& aRecipientsConsumerId,
+                                                              CSenChunk& aMessageChunk)
+    {
+    return CSenServiceSession::ProvideHostletResponseL( aProvider, 
+                                                        aTxnId, 
+                                                        aServiceCode, 
+                                                        aRecipientsConsumerId, 
+                                                        aMessageChunk ); 
+    }
+    
+TInt CSenWebServiceSession::HandleBodyWithoutParsingL(CSenSoapMessage& aMessage,
+                                                      const TDesC8& aResponse)
+    {
+    TInt ret;
+    TInt endTagStart;
+    TInt endTagEnd;
+    TInt startTagStart;
+    TInt startTagEnd;
+    TPtrC8 prefix;
+
+    ret = SenSaxUtils::SearchEndTagL(aResponse,KSenSoapEnvelopeBodyName,
+                                     endTagStart, endTagEnd, prefix);
+    if ( ret != KErrNotFound )
+        {
+        ret = SenSaxUtils::SearchStartTagL(aResponse,prefix,KSenSoapEnvelopeBodyName,
+                                           startTagStart, startTagEnd);
+        if ( ret != KErrNotFound )
+            {
+            TPtrC8 startPart(aResponse.Ptr(),startTagEnd+1);
+            TPtrC8 endPart(aResponse.Ptr()+endTagStart,aResponse.Size()-endTagStart);
+            HBufC8* pXmlWithoutBody = HBufC8::NewLC(startPart.Length()+endPart.Length());
+            pXmlWithoutBody->Des().Append(startPart);
+            pXmlWithoutBody->Des().Append(endPart);
+            
+            aMessage.ParseL(*pXmlWithoutBody);
+            CleanupStack::PopAndDestroy(pXmlWithoutBody);
+            
+            TPtrC8 bodyContent(aResponse.Ptr()+startTagEnd+1, endTagStart-startTagEnd-1);
+            aMessage.SetBodyL(bodyContent);
+            }
+        }
+    
+    return ret;
+    }
+
+EXPORT_C void CSenWebServiceSession::CredentialChanged(TSenCredentialChange aChange,
+		                                               TAny* /* aPointer */)
+    {
+    if ( aChange == MSenCredentialObserver::EDestroyed )
+        {
+        iValidUntil.Set(KInvalideDate); // way back in history: January 1st 1900  \\CodeScannerWarnings
+        TRAP_IGNORE( SetStatusL(); ) 
+        }
+    }
+    
+EXPORT_C  TInt CSenWebServiceSession::AddCredentialObserverL(CSenInternalCredential& aCredential)
+{
+	TInt error(KErrNone);
+	RSenCredentialPtr credentialPtr = 
+	((MSenServiceManager&)iFramework.Manager()).CredentialL(
+	    aCredential.IdentifierL().IdL(), error);
+	if ( error == KErrNone )
+	{
+		iCredentialPtr.RemoveCredentialObserver(*this);
+		iCredentialPtr.Close();
+		iCredentialPtr = credentialPtr.Clone();
+		iCredentialPtr.AddCredentialObserverL(*this);
+		iValidUntil = credentialPtr.Credential()->PropertiesL().ValidUntilL();
+		if ( iClientServerInterval == 0 )
+		{
+			TPtrC8 value;
+			TInt ret = iCredentialPtr.Credential()->PropertiesL().PropertyL(_L8("ServiceInterval"),
+			                                                               value);
+			if ( ret == KErrNone )
+			{
+				TLex8 lex(value);
+				TInt64 val;
+				ret = lex.Val(val);
+				if ( ret == KErrNone )
+				{
+					iClientServerInterval = val;
+				}
+			}
+		}
+                
+	}
+    CredentialChanged(MSenCredentialObserver::EAdded, NULL);      
+	SetStatusL();
+
+	return KErrNone;
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senwsdescription.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILESS
+#include "senwsdescription.h"
+
+EXPORT_C CSenWSDescription* CSenWSDescription::NewL()
+    {
+    CSenWSDescription* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenWSDescription* CSenWSDescription::NewLC()
+    {
+    CSenWSDescription* pNew =
+        new (ELeave) CSenWSDescription(EWSDescription);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenWSDescription* CSenWSDescription::NewL(const TDesC8& aNamespaceURI)
+    {
+    CSenWSDescription* pNew = NewLC(aNamespaceURI);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenWSDescription* CSenWSDescription::NewLC(const TDesC8& aNamespaceURI)
+    {
+    CSenWSDescription* pNew =
+                new (ELeave) CSenWSDescription(EWSDescription);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNamespaceURI);
+    return pNew;
+    }
+
+EXPORT_C CSenWSDescription* CSenWSDescription::NewL(const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract)
+    {
+    CSenWSDescription* pNew = NewLC(aEndPoint, aContract);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenWSDescription* CSenWSDescription::NewLC(const TDesC8& aEndPoint,
+                                                     const TDesC8& aContract)
+    {
+    CSenWSDescription* pNew =
+        new (ELeave) CSenWSDescription(EWSDescription);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aEndPoint, aContract);
+    return pNew;
+    }
+    
+EXPORT_C CSenWSDescription::CSenWSDescription(TDescriptionClassType aType)
+: CSenXmlServiceDescription(aType)
+    {
+    }
+
+EXPORT_C CSenWSDescription::~CSenWSDescription()
+    {
+    }
+    
+EXPORT_C TBool CSenWSDescription::HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate)
+    {
+    return CSenXmlServiceDescription::HasEqualPrimaryKeysL(aCandidate);
+    }
+
+EXPORT_C TBool CSenWSDescription::IsLocalL()
+    {
+    return CSenXmlServiceDescription::IsLocalL();
+    }
+
+EXPORT_C TInt CSenWSDescription::SetTransportCueL(const TDesC8& aTransportCue)
+    {
+    return CSenXmlServiceDescription::SetTransportCueL(aTransportCue);
+    }
+
+EXPORT_C TPtrC8 CSenWSDescription::TransportCue()
+    {
+    return CSenXmlServiceDescription::TransportCue();
+    }
+
+EXPORT_C TBool CSenWSDescription::HasSuperClass( TDescriptionClassType /* aType */ )
+    {
+    return EFalse;
+    }
+
+EXPORT_C MSenServicePolicy* CSenWSDescription::ServicePolicy()
+    {
+    return CSenXmlServiceDescription::ServicePolicy();
+    }
+
+EXPORT_C TInt CSenWSDescription::SetPolicyL(const TDesC8& aName)
+    {
+    return CSenXmlServiceDescription::SetPolicyL(aName);
+    }
+
+EXPORT_C TInt CSenWSDescription::SetPolicyL(const TDesC8& aName, const TDesC8& aValue)
+    {
+    return CSenXmlServiceDescription::SetPolicyL(aName, aValue);
+    }
+
+EXPORT_C TInt CSenWSDescription::SetPolicyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aAttribName, const TDesC8& aAttribValue)
+    {
+    return CSenXmlServiceDescription::SetPolicyL(aName, aValue, aAttribName, aAttribValue);
+    }
+
+EXPORT_C TInt CSenWSDescription::SetProviderIdL( const TDesC8& aProviderID )
+    {
+    return CSenXmlServiceDescription::SetProviderIdL(aProviderID);
+    }
+
+// Setter for SNAP
+EXPORT_C void CSenWSDescription::SetSnapIdL(TUint32 aSnapId)
+    {
+    CSenXmlServiceDescription::SetSnapIdL(aSnapId);
+    }
+
+// Getter for SNAP
+EXPORT_C TInt CSenWSDescription::SnapId(TUint32& aCurrentSnapId)
+    {
+    return CSenXmlServiceDescription::SnapId(aCurrentSnapId);
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsframework/src/senwspattern.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senwspattern.h"
+#include "senconsumerpolicy.h"
+
+namespace
+    {
+    _LIT8(KConsumerPolicyLocalName, "ConsumerPolicy");
+    }
+
+EXPORT_C CSenWSPattern* CSenWSPattern::NewL()
+    {
+    CSenWSPattern* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenWSPattern* CSenWSPattern::NewLC()
+    {
+    CSenWSPattern* pNew =
+                            new (ELeave) CSenWSPattern(EWSPattern);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenWSPattern* CSenWSPattern::NewL(
+                                                const TDesC8& aNamespaceURI)
+    {
+    CSenWSPattern* pNew = NewLC(aNamespaceURI);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+
+EXPORT_C CSenWSPattern* CSenWSPattern::NewLC(
+                                                const TDesC8& aNamespaceURI)
+    {
+    CSenWSPattern* pNew =
+                            new (ELeave) CSenWSPattern(EWSPattern);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNamespaceURI);
+    return pNew;
+    }
+
+EXPORT_C CSenWSPattern* CSenWSPattern::NewL(const TDesC8& aEndPoint,
+                                                      const TDesC8& aContract)
+    {
+    CSenWSPattern* pNew = NewLC(aEndPoint, aContract);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenWSPattern* CSenWSPattern::NewLC(const TDesC8& aEndPoint,
+                                                       const TDesC8& aContract)
+    {
+    CSenWSPattern* pNew =
+                            new (ELeave) CSenWSPattern(EWSPattern);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aEndPoint, aContract);
+    return pNew;
+    }
+
+EXPORT_C CSenWSPattern::CSenWSPattern(
+                        MSenServiceDescription::TDescriptionClassType aType)
+: CSenWSDescription(aType)
+    {
+    }
+
+EXPORT_C CSenWSPattern::~CSenWSPattern()
+    {
+    delete iConsumerPolicy;
+    }
+
+EXPORT_C void CSenWSPattern::BaseConstructL()
+    {
+    CSenWSDescription::ConstructL();
+    // construct empty consumer policy...
+
+    // NOTE; iConsumerPolicy is, AS INTENDED, a separate XML object
+    // from the "WSPattern", which contains it
+    iConsumerPolicy = CSenConsumerPolicy::NewL();
+    }
+
+EXPORT_C void CSenWSPattern::BaseConstructL(const TDesC8& aNamespaceURI)
+    {
+    CSenWSDescription::ConstructL(aNamespaceURI);
+    // construct empty consumer policy...
+    iConsumerPolicy = CSenConsumerPolicy::NewL();
+    }
+
+EXPORT_C void CSenWSPattern::BaseConstructL(const TDesC8& aEndPoint,
+                                                const TDesC8& aContract)
+    {
+    CSenWSDescription::ConstructL(aEndPoint, aContract);
+    // construct empty consumer policy...
+    iConsumerPolicy = CSenConsumerPolicy::NewL();
+    }
+
+
+EXPORT_C TBool CSenWSPattern::Matches(
+                                    MSenServiceDescription& aWSPattern)
+    {
+    TBool matches = CSenWSDescription::Matches(aWSPattern);
+    if(matches && aWSPattern.DescriptionClassType() == EWSPattern)
+        {
+        CSenWSPattern* pPattern = (CSenWSPattern*)&aWSPattern;
+        return iConsumerPolicy->Accepts(*(MSenConsumerPolicy*)pPattern);
+        }
+    else
+        return EFalse; // even the service descriptions wont match
+    }
+
+// from MSenConsumerPolicy
+EXPORT_C void CSenWSPattern::SetConsumerIapIdL(TUint32 aIapId)
+    {
+    iConsumerPolicy->SetIapIdL(aIapId);
+    }
+
+// getter for IAP ID
+EXPORT_C TInt CSenWSPattern::ConsumerIapId(TUint32& aCurrentIapId)
+    {
+    return iConsumerPolicy->IapId(aCurrentIapId);
+    }
+
+EXPORT_C void CSenWSPattern::SetConsumerSnapIdL(TUint32 aSnapId)
+    {
+    iConsumerPolicy->SetSnapIdL(aSnapId);
+    }
+
+// getter for SNAP
+EXPORT_C TInt CSenWSPattern::ConsumerSnapId(TUint32& aCurrentSnapId)
+    {
+    return iConsumerPolicy->SnapId(aCurrentSnapId);
+    }
+
+// Setter: overrides current values with the given values from the array
+EXPORT_C void CSenWSPattern::SetConsumerIdentityProviderIdsL(
+                            CSenIdentityProviderIdArray8& aList)
+    {
+    iConsumerPolicy->SetIdentityProviderIdsL(aList);
+    }
+
+// Adder: adds a new IDP ID value at the end of the current list value(s)
+// Does not insert duplicate values.
+//
+// @return KErrAlreadyExists, if a duplicate is tried to add
+//         KErrArgument if a zero-length descriptor is tried to add
+//         (aProviderId.Length() == 0)
+EXPORT_C TInt CSenWSPattern::AddConsumerIdentityProviderIdL(
+                                        const TDesC8& aProviderId)
+    {
+    return iConsumerPolicy->AddIdentityProviderIdL(aProviderId);
+    }
+
+
+// Getter: return an empty array if no IDP:s have been spesified
+// or a list of IDP arrays if such value(s) have been set.
+EXPORT_C const CSenIdentityProviderIdArray8&
+                CSenWSPattern::ConsumerIdentityProviderIds8L()
+    {
+    return iConsumerPolicy->IdentityProviderIds8L();
+    }
+
+
+EXPORT_C TBool CSenWSPattern::AcceptsConsumerPolicy(
+                                            MSenConsumerPolicy& aPolicyPattern)
+    {
+    return iConsumerPolicy->Accepts(aPolicyPattern);
+    }
+
+EXPORT_C TBool CSenWSPattern::RebuildFromConsumerPolicy(
+                                                MSenConsumerPolicy& aTemplate)
+    {
+    return iConsumerPolicy->RebuildFrom(aTemplate);
+    }
+
+// overrides CWSDescription
+EXPORT_C void CSenWSPattern::StartElementL(
+                                    const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName,
+                                    const RAttributeArray& aAttributes)
+    {
+
+    if(aLocalName == KConsumerPolicyLocalName)
+        {
+        // get rid of existing stuff
+        delete iConsumerPolicy;
+        iConsumerPolicy = NULL;
+        iConsumerPolicy = CSenConsumerPolicy::NewL();
+
+        iConsumerPolicy->SetAttributesL(aAttributes);
+        DelegateParsingL(*iConsumerPolicy);
+        }
+    else
+        {
+        CSenWSDescription::StartElementL(
+            aNsUri, aLocalName, aQName, aAttributes);
+        }
+    }
+
+EXPORT_C HBufC8* CSenWSPattern::ConsumerPolicyAsXmlL()
+    {
+    return iConsumerPolicy->AsXmlL();
+    }
+
+EXPORT_C TBool CSenWSPattern::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWSDescription ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue;
+        }
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWSDescription::HasSuperClass( aType );
+        }
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/BMARM/SENHOSTCONNU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	NewLC__21CSenHostletConnectionR11MSenHostlet @ 1 NONAME R3UNUSED ; CSenHostletConnection::NewLC(MSenHostlet &)
+	NewL__21CSenHostletConnectionR11MSenHostlet @ 2 NONAME R3UNUSED ; CSenHostletConnection::NewL(MSenHostlet &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/BWINS/SENHOSTCONNU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?NewL@CSenHostletConnection@@SAPAV1@AAVMSenHostlet@@@Z @ 1 NONAME ; public: static class CSenHostletConnection * __cdecl CSenHostletConnection::NewL(class MSenHostlet &)
+	?NewLC@CSenHostletConnection@@SAPAV1@AAVMSenHostlet@@@Z @ 2 NONAME ; public: static class CSenHostletConnection * __cdecl CSenHostletConnection::NewLC(class MSenHostlet &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/BWINSCW/SENHOSTCONNU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?NewL@CSenHostletConnection@@SAPAV1@AAVMSenHostlet@@@Z @ 1 NONAME ; class CSenHostletConnection * CSenHostletConnection::NewL(class MSenHostlet &)
+	?NewLC@CSenHostletConnection@@SAPAV1@AAVMSenHostlet@@@Z @ 2 NONAME ; class CSenHostletConnection * CSenHostletConnection::NewLC(class MSenHostlet &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/eabi/SENHOSTCONNu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	_ZTI25CSenHostletConnectionImpl @ 1 NONAME ; #<TI>#
+	_ZTV25CSenHostletConnectionImpl @ 2 NONAME ; #<VT>#
+	_ZN21CSenHostletConnection4NewLER11MSenHostlet @ 3 NONAME
+	_ZN21CSenHostletConnection5NewLCER11MSenHostlet @ 4 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wshostletconnection    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wshostletconnection.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wshostletconnection.iby)
+PRJ_MMPFILES
+senhostletconnection.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/group/senhostletconnection.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Component providing (local) service provider functionality
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenHostConn.dll
+UID             0x1000008d 0x20000398
+#else
+TARGET          wshostconn.dll
+UID             0x1000008d 0x101F9748
+#endif
+
+MACRO _FORCE_DESCRIBED_MSW_2005_08_CONTRACT_TO_2006_10
+#define _FORCE_DESCRIBED_MSW_2005_08_CONTRACT_TO_2006_10 1
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_CLIENT_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_CLIENT_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senhostletconnectionimpl.cpp
+SOURCE          rsenhostletconnection.cpp
+SOURCE          senhostletconnectiondll.cpp
+SOURCE          senregistrationtimer.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc // SenDebug.h - debugging definitions, SenChunk.h
+USERINCLUDE     ../../wslogger/inc // SenLogger.h - filelogging macros
+USERINCLUDE     ../../wsprovider/inc  // SenServiceManagerDefines.h
+USERINCLUDE     ../../wsframework/inc  // MSenMessageContext.h 
+USERINCLUDE     ../../wscore/inc  // SenServiceManagerDefines.h  - IPC enumerations
+USERINCLUDE     ../../wsconnectionagent/inc
+
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+// System libs
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libs:
+LIBRARY         wsconnagent.lib
+LIBRARY         SenUtils.lib     // for debugging macros
+LIBRARY         SenLogger.lib    // for TLS based file logging
+LIBRARY         SenProvider.lib  // for CSenHostletRequest and CSenHostletResponse
+LIBRARY         SenServDesc.lib  // for CSenXmlServiceDescription
+LIBRARY         SenXml.lib       // for CSenParser
+LIBRARY         SenMessages.lib
+#else
+// SOA for S60 libs:
+LIBRARY         senconnagent.lib
+LIBRARY         wsUtils.lib     // for debugging macros
+LIBRARY         wsLogger.lib    // for TLS based file logging
+LIBRARY         wsProvider.lib  // for CSenHostletRequest and CSenHostletResponse
+LIBRARY         wsServDesc.lib  // for CSenXmlServiceDescription
+LIBRARY         wsxml.lib       // for CSenParser
+LIBRARY         wsMessages.lib
+#endif
+
+LANG        SC
+#if defined(ARMCC)
+  DEFFILE ../eabi/SENHOSTCONN.DEF
+#elif defined(WINSCW)
+  DEFFILE ../BWINSCW/SENHOSTCONN.DEF
+#elif defined(WINS)
+  DEFFILE ../BWINS/SENHOSTCONN.DEF
+#else 
+  DEFFILE ../BMARM/SENHOSTCONN.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/inc/rsenhostletconnection.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef R_SEN_HOSTLET_CONNECTION_H
+#define R_SEN_HOSTLET_CONNECTION_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+
+// FORWARD DECLARE
+class CSenSoapEnvelope;
+class CSenChunk;
+
+// CLASS DECLARATION
+class RSenHostletConnection : public RSessionBase
+    {
+public:
+        /**
+        * C++ default constructor.
+        */
+        RSenHostletConnection();
+        
+        // New functions
+        TInt Connect();
+        TVersion Version() const;
+        
+        void CancelSession(TRequestStatus& aStatus);
+
+        TInt Establish(TDesC8& aHostletServiceDescription);
+        void AwaitRequest(TRequestStatus& aStatus, TDes8& aErrPtr, TDes8& aTxnPtr);
+        TInt AcquireRequestHandle(TDes8& aErrPtr, TDes8& aTxnPtr);
+
+        void ProvideResponse(TRequestStatus& aStatus, 
+                             TDes8& aErrPtr, TDes8& aTxnPtr, 
+                             CSenChunk& aClientOp, 
+                             const TInt aResponseCode);
+                             
+        TInt ConnectionID();
+        TInt RegisterTransferObserver(const TDesC* aServerName, TAny* aConnection);
+
+//        void SetTlsLogChannel(TInt aTlsLogChannel);
+        
+   private: // Helper functions
+        RFileLogger* Log() const;
+
+    private: // Data
+        RFileLogger* iLog;
+        TInt iTlsLogChannel;
+    };
+
+#endif //R_SEN_HOSTLET_CONNECTION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/inc/senhostletconnectionimpl.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Custom plug-in implementations offer their own API documentation
+*                where detailed characteristics about how methods declared in this
+*                class are implemented.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_HOSTLET_CONNECTION_IMPL_H
+#define SEN_HOSTLET_CONNECTION_IMPL_H
+
+// INCLUDES
+#include <e32property.h>
+#include <flogger.h>
+
+#include "SenHostletConnection.h"   // public 
+
+#include "rsenhostletconnection.h"
+#include "senpointermap.h"
+#include "senlogger.h"
+#include "sendebug.h"
+
+#include "senregistrationtimer.h"
+
+// FORWARD DECLARATIONS
+class MSenHostlet;
+class MSenHostletRequest;
+class MSenHostletResponse;
+//class MSenServiceDescription;
+class CSenChunk;
+class CSenAsyncOperation;
+class CSenHostletTransaction;
+class CSenIdentifier;
+class CSenHostletRequest;
+class CSenHostletResponse;
+class CSenFileProgressObserver;
+
+// TYPEDEFS
+typedef RSenPointerMap<TInt, CSenHostletTransaction> RHostletTransactionMap;
+
+
+// CLASS DECLARATION
+
+/**
+* Custom plug-in implementations offer their own API documentation
+* where detailed characteristics about how methods declared in this
+* class are implemented.
+*/
+class CSenHostletConnectionImpl : public CSenHostletConnection, MSenRegistrationActor
+    {
+        friend class CSenAsyncOperation;
+    public: 
+
+        // Constructors and destructor:
+        static CSenHostletConnectionImpl* NewL(MSenHostlet& aProvider);
+
+        static CSenHostletConnectionImpl* NewLC(MSenHostlet& aProvider);
+
+        virtual ~CSenHostletConnectionImpl();
+
+        // New functions:
+        virtual TInt RespondL(MSenHostletResponse& aResponse);
+        
+        virtual TInt Identifier();
+
+        
+    protected: // Functions from base classes 
+        
+        // from CActive
+        void RunL();
+        void DoCancel();
+
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenHostletConnectionImpl(MSenHostlet& aProvider);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+        TInt EstablishConnectionL(MSenHostlet& aProvider);
+        TInt RegisterAndSubscribeFileProgressObserversL();
+
+        // Utility functions:
+        RHostletTransactionMap& HostletTransactionMapL();
+        TPtrC SessionID();
+        RPointerArray<CSenAsyncOperation>& AsyncOpsArrayL();
+        void HandleErrorFromChildAOL(TInt aError, TInt aTxnId, const TDesC8& aDesc, CSenAsyncOperation& aChild);
+        void HandleMessageFromChildAOL(TInt aStatus, CSenAsyncOperation& aChild);
+
+        TInt RegisterFilesObserver();
+    private: // Data
+        RSenHostletConnection iConnection;  // owned
+        MSenHostlet& iProvider;             // not owned
+
+        TInt    iResponseLength;
+        TInt    iErrorNumber;
+        TPtr8   iErrorNumberBuffer;
+        TInt    iTxnId;
+        TPtr8   iTxnIdBuffer;
+
+        RHostletTransactionMap* iHostletTransactionMap;
+
+        HBufC* ipSessionId;
+        TPtr iSessionIdBuffer;
+        TInt iChunkNameNumber;
+        HBufC* ipChunkName;
+        TBool iAlive;
+        
+        TBool iTransactionIdKnown;
+        TUint iAsyncOpsCount;
+        RPointerArray<CSenAsyncOperation>* iAsyncOpsArray;
+        TInt iConnectionID;
+        MSenFilesObserver*                  iFilesObserver;
+        TInt iTlsLogChannel;
+        TAny*                               ipInterface;
+        TBool 								iCancelSession;
+        CSenFileProgressObserver*			ipFileProgressObserver; // owned
+        TBool iRegisterFileObserverDone;
+        CSenRegistrationTimer*              ipRegistrationTimer;
+    };
+
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenAsyncOperation) : public CActive
+#else
+class CSenAsyncOperation : public CActive 
+#endif
+    {
+    public: // Constructors and destructor
+        static CSenAsyncOperation* NewL(CSenHostletConnectionImpl* aActive);
+        static CSenAsyncOperation* NewLC(CSenHostletConnectionImpl* aActive);
+        virtual ~CSenAsyncOperation();
+
+    protected: // Functions from base classes 
+        // from CActive
+        void RunL();
+        void DoCancel();
+        TInt RunError(TInt aError);
+        
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        CSenAsyncOperation(CSenHostletConnectionImpl* iActive);
+
+    public: // Data
+        CSenHostletConnectionImpl* iActive;
+        TInt    iErrorNumber;
+        TPtr8   iErrorNumberBuffer;
+        TInt    iTxnId;
+        TPtr8   iTxnIdBuffer;
+    };    
+    
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenHostletTransaction) : public CBase
+#else
+class CSenHostletTransaction : public CBase 
+#endif
+    {
+    public: // Constructors and destructor
+        static CSenHostletTransaction* NewL(CSenChunk* aSenChunk);
+        static CSenHostletTransaction* NewLC(CSenChunk* aSenChunk);
+        virtual ~CSenHostletTransaction();
+        
+        void SetChunk(CSenChunk* aChunk);
+        CSenChunk* Chunk();
+
+        void SetIdentifier(CSenIdentifier* aIdentifier);
+        CSenIdentifier* Identifier();
+
+        void SetRequest(CSenHostletRequest* aRequest);
+        CSenHostletRequest* Request();
+
+        void SetResponse(CSenHostletResponse* aResponse);
+        CSenHostletResponse* Response();
+
+    private:
+        CSenHostletTransaction(CSenChunk* aSenChunk);
+
+    private: // Data
+        CSenChunk*              iSenChunk;
+        CSenIdentifier*         iIdentifier;
+        CSenHostletRequest*     iRequest;
+        CSenHostletResponse*    iResponse;
+    };    
+    
+#ifdef EKA2
+NONSHARABLE_CLASS(CSenFileProgressObserver) : public CActive
+#else
+class CSenFileProgressObserver : public CActive
+#endif
+    {
+    public:
+        static CSenFileProgressObserver* NewL( MSenFilesObserver& aObserver,
+                                               TInt aConnectionID );
+
+        static CSenFileProgressObserver* NewLC( MSenFilesObserver& aObserver,
+                                                TInt aConnectionID );
+        ~CSenFileProgressObserver();
+
+    private:
+        CSenFileProgressObserver( MSenFilesObserver& aObserver,
+                                  TInt aConnectionID );
+        void ConstructL();
+         /*
+        * Method update the consumer about the file progress transfer info
+        */
+        void RunL();
+        void DoCancel();
+        TInt RunError(TInt aError);
+
+    private:
+        RProperty                   iFileProgressProperty;
+        MSenFilesObserver*        	iFileProgressObserver;        // not owned
+        TInt                        iConnectionID;
+    };    
+
+     
+    
+
+#endif //SEN_HOSTLET_CONNECTION_IMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/inc/senregistrationtimer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    not a public class       
+*
+*/
+
+
+
+
+#ifndef SEN_REGISTRATION_TIMER
+#define SEN_REGISTRATION_TIMER
+
+// INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+const TInt KSenDefaultRegistrationTimeout = 1; // 1 second
+
+// CLASS DECLARATION
+
+#ifdef EKA2
+NONSHARABLE_CLASS( MSenRegistrationActor )
+#else
+class MSenRegistrationActor
+#endif
+    {
+    public:
+        // Registers the files observer (connection agent) and/or RProperty subscription for (file) progress (BLOB) info
+        virtual TInt RegisterAndSubscribeFileProgressObserversL() = 0;
+    };
+
+
+#ifdef EKA2
+//NONSHARABLE_CLASS(CSenRegistrationTimer) : public CTimer
+NONSHARABLE_CLASS( CSenRegistrationTimer ) : public CActive
+#else
+//class CSenRegistrationTimer : public CTimer
+class CSenRegistrationTimer : public CActive
+#endif
+    {
+    public:
+        static CSenRegistrationTimer* NewL( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs = KSenDefaultRegistrationTimeout );
+        static CSenRegistrationTimer* NewLC( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs = KSenDefaultRegistrationTimeout );
+            
+        ~CSenRegistrationTimer();
+
+        /**
+        * Calling this method will activate the registration, that will happen N seconds.
+        */
+        void IssueRegistrations( TBool aRegisterFilesObserver = ETrue );
+
+        virtual void RunL();
+        void DoCancel();
+
+        //virtual TInt RunError(TInt aError);
+    
+    private:
+        CSenRegistrationTimer( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs );
+        void ConstructL();
+        
+    private: // Data:
+		MSenRegistrationActor& iActor;
+        TInt iRegistrationTimeoutInSecs;		
+		RTimer iTimer;
+		// Registration flags
+		TBool iRegisterFilesObserver;
+    };
+
+#endif // SEN_REGISTRATION_TIMER
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/rom/wshostletconnection.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSHOSTLETCONNECTION_IBY__
+#define __WSHOSTLETCONNECTION_IBY__
+
+// SenHostConn
+file=ABI_DIR\BUILD_DIR\SenHostConn.dll          PROGRAMS_DIR\SenHostConn.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/src/rsenhostletconnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,401 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <e32math.h>
+
+//#include "SenHostletConnectionLog.h"
+#include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations
+
+#include "rsenhostletconnection.h"
+#include "senchunk.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+#include <SenSoapMessage.h>
+
+#if defined (__WINS__) && !defined(EKA2)
+static const TUint KServerMinHeapSize =   0x1000;  // 4K
+static const TUint KServerMaxHeapSize = 0x100000;  // 1000K
+#endif
+
+static TInt StartServerL();
+static TInt CreateServerProcessL();
+
+RSenHostletConnection::RSenHostletConnection()
+    : RSessionBase(), iTlsLogChannel(1000)
+    {
+    // No implementation required
+    }
+
+TInt RSenHostletConnection::Connect()
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::Connect");
+    TInt error(KErrNone);
+    TRAPD(err, error = ::StartServerL());
+    
+    if(err != KErrNone)
+        {
+        error = err;
+        }
+    if(KErrNone == error)
+        {
+        TLSLOG(iTlsLogChannel, KMinLogLevel,
+            _L("RSenHostletConnection::Connect - Now creating session"));
+        error = CreateSession(KSenServiceManager,
+                              Version(),
+                              KDefaultMessageSlots);
+#ifdef _SENDEBUG
+        if(error != KErrNone)
+            {
+            TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel,
+            _L("RSenHostletConnection::Connect - CreateSession returned error: (%d)"), error));
+            }
+        else
+            {
+            TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::Connect - CreateSession returned KErrNone");
+            }
+#endif // _SENDEBUG
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel,
+        _L8("RSenHostletConnection::Connect - StartServerL failed, error: (%d)"), error));
+        }
+#endif // _SENDEBUG
+    return error;
+    }
+
+TVersion RSenHostletConnection::Version() const
+    {
+    TLSLOG(iTlsLogChannel, KMinLogLevel, _L("RSenHostletConnection::Version"));
+    return(TVersion(KWsfServMajorVersionNumber,
+                    KWsfServMinorVersionNumber,
+                    KWsfServBuildVersionNumber));
+    }
+    
+void RSenHostletConnection::CancelSession(TRequestStatus& aStatus)
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenServiceConnection::CancelSession(sync)");
+    SendReceive(ESenServCancelSession, aStatus);
+    }
+
+
+// SYNC: Called from CSenHostletConnection::ConstructL
+TInt RSenHostletConnection::Establish(TDesC8& aHostletServiceDescription)
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::EstablishL");
+
+    TLSLOG_ALL(iTlsLogChannel, KMaxLogLevel, aHostletServiceDescription);
+
+    TInt sdLength = aHostletServiceDescription.Length();
+
+    TIpcArgs args;
+    args.Set(0, &aHostletServiceDescription);
+    args.Set(1, sdLength);
+
+    return SendReceive(ESenServEstablishHostletConnection, args);
+    }
+
+// ASYNC: Completes when request handle is ready to be acquired
+void RSenHostletConnection::AwaitRequest(TRequestStatus& aStatus,
+                                         TDes8& aErrPtr,
+                                         TDes8& aTxnPtr)
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::AwaitRequest");
+
+    TIpcArgs args;
+    args.Set(0, &aErrPtr);
+    args.Set(1, &aTxnPtr);
+    SendReceive(ESenServAwaitHostletRequest, args, aStatus);
+    }
+
+// SYNC: returns RHandleBase ID if successful
+TInt RSenHostletConnection::AcquireRequestHandle( TDes8& aErrPtr, TDes8& aTxnPtr )
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::AcquireRequestHandle");
+
+    TIpcArgs args;
+    args.Set(0, &aErrPtr);
+    args.Set(1, &aTxnPtr);
+    return SendReceive(ESenServTransaction, args);
+    }
+
+void RSenHostletConnection::ProvideResponse( TRequestStatus& aStatus, 
+                                             TDes8& aErrPtr,
+                                             TDes8& aTxnPtr,
+                                             CSenChunk& aClientOp,
+                                             const TInt aResponseCode )
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::ProvideResponse");
+
+    TIpcArgs args;
+    args.Set(0, &aErrPtr);
+    args.Set(1, &aTxnPtr);
+    aClientOp.ChunkToArgs(args,2);
+    args.Set(3, aResponseCode);
+    SendReceive(ESenServProvideHostletResponse, args, aStatus);
+    }
+
+TInt RSenHostletConnection::ConnectionID()
+    {
+    TInt connectionID = SendReceive( ESenServConnectionID );
+                   
+    iTlsLogChannel = KSenHostletConnectionLogChannelBase + connectionID;
+    //TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L("- Connection ID: (%d)"), connectionID));
+    return connectionID;
+    }
+    
+TInt RSenHostletConnection::RegisterTransferObserver(
+        const TDesC* aServerName, TAny* aConnection)
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::RegisterTransferObserver");
+    CActiveSchedulerWait asWait;
+    TIpcArgs args(aServerName, aConnection, &asWait);
+    TRequestStatus rs = KRequestPending;
+    SendReceive(ESenObserveTransfer, args, rs);
+    Mem::FillZ(&asWait, sizeof(asWait));
+    asWait.Start();
+    User::WaitForRequest(rs);
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "RSenHostletConnection::RegisterTransferObserver Completed");
+    return rs.Int();
+    }
+
+//void RSenHostletConnection::SetTlsLogChannel(TInt aTlsLogChannel)
+//    {
+//    iTlsLogChannel = aTlsLogChannel;
+//    }
+
+static TInt StartServerL()
+    {
+    TInt result(KErrNotFound);
+    
+#ifdef _SENDEBUG    
+    RFileLogger log;
+    CleanupClosePushL(log);
+    User::LeaveIfError( log.Connect() );
+    log.CreateLog(KSenHostletConnectionLogDir, _L("SenStartServer.log"), EFileLoggingModeAppend);
+    log.Write(_L("StartServerL() invoked by HC."));
+#endif
+
+    TFindServer findSenServiceManager(KSenServiceManager);
+    TFullName name;
+
+    result = findSenServiceManager.Next(name);
+    if (result == KErrNone)
+        {
+        // Server already running
+#ifdef _SENDEBUG        
+        log.Write(_L8("- Server already running, KErrNone"));
+        log.CloseLog();
+        CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG        
+        return KErrNone;
+        }
+
+    RSemaphore semaphore;
+    CleanupClosePushL(semaphore);
+
+    // First, try to open the semaphore (if someone else created it already):
+    result = semaphore.OpenGlobal( KSenServiceManagerSemaphoreName );
+    if( result == KErrNone )
+        {
+        // If another client is starting up SEN.EXE, this client should return
+        // to re-connect loop (wait one sec, max 5 times)
+#ifdef _SENDEBUG        
+        log.Write(_L8("- OpenGlobal OK => Another client already starting up SEN.EXE. About to WAIT and RE-CONNECT."));
+#endif        
+        result = KErrServerBusy;
+        }
+    else // could not find any already opened global semaphore ==> it is safe to create new one
+        {   
+        // Semaphore has not yet been created, so instantiate it now(!)
+        result = semaphore.CreateGlobal( KSenServiceManagerSemaphoreName, 0 );
+#ifdef _SENDEBUG        
+        if( result != KErrNone )
+            {
+            log.Write(_L8("CreateGlobal failed"));
+            log.WriteFormat(_L8("- error: %d"), result);
+            }
+#endif        
+        }
+        
+    if (result != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // semaphore.Close()
+#ifdef _SENDEBUG        
+        log.CloseLog();
+#endif // _SENDEBUG        
+        if( result != KErrServerBusy )
+            {
+#ifdef _SENDEBUG        
+            log.Write(_L8("- CreateGlobal failed => Another client already starting up SEN.EXE. About to WAIT and RE-CONNECT."));
+            CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG        
+            result = KErrServerBusy; // again, this error will activate re-connect loop (max 5 times)
+            }
+        return result;
+        }
+
+    result = CreateServerProcessL();
+    if (result != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // semaphore.Close()
+#ifdef _SENDEBUG        
+        log.Write(_L8("CreateServerProcessL failed"));
+        log.CloseLog();
+        CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG         
+        return result;
+        }
+
+    // Now start waiting for signal from server: it will release this semaphore from wait:
+    semaphore.Wait();  
+    CleanupStack::PopAndDestroy(); // semaphore.Close()
+
+#ifdef _SENDEBUG        
+    log.Write(_L("Log file closed."));
+    log.CloseLog();
+    CleanupStack::PopAndDestroy(); // log.Close()    
+#endif // _SENDEBUG
+    return  KErrNone;
+    }
+
+static TInt CreateServerProcessL()
+    {
+    TInt result(KErrNone);
+
+#ifdef _SENDEBUG
+    RFileLogger log;
+    CleanupClosePushL(log);
+    User::LeaveIfError( log.Connect() );
+    // Note: this appends to the log created in StartServer()
+    log.CreateLog(KSenHostletConnectionLogDir, _L("SenStartServer.log"), EFileLoggingModeAppend);
+    log.Write(_L("CreateServerProcessL() invoked by HC."));
+#endif // _SENDEBUG
+
+    const TUidType serverUid(KNullUid, KNullUid, KServerUid3);
+
+#if defined(__WINS__) && !defined(EKA2)
+
+    RLibrary lib;
+    CleanupClosePushL(lib);
+
+    RThread server;
+    CleanupClosePushL(server);
+
+    result = lib.Load(KSenServiceManagerFileName, serverUid);
+
+    if( result == KErrNone )
+        {
+#ifdef _SENDEB
+        log.Write(_L8("Library successfully loaded, KErrNone"));
+#endif // _SENDEBUG
+
+        //  Get the WinsMain function
+        TLibraryFunction functionWinsMain = lib.Lookup(1);
+
+        //  Call it and cast the result to a thread function
+        TThreadFunction serverThreadFunction =
+            reinterpret_cast<TThreadFunction>(functionWinsMain());
+
+        TName threadName(KSenServiceManagerFileName);
+
+        // Append a random number to make it unique
+        threadName.AppendNum(Math::Random(), EHex);
+
+
+        result = server.Create(threadName,   // create new server thread
+                               serverThreadFunction, // thread's main function
+                               KDefaultStackSize,
+                               NULL,
+                               &lib,
+                               NULL,
+                               KServerMinHeapSize,
+                               KServerMaxHeapSize,
+                               EOwnerProcess);
+
+        // if successful, server thread now has the handle to library:
+
+        if ( result == KErrNone )
+            {
+            server.SetPriority( EPriorityMore );
+            }
+#ifdef _SENDEBUG
+        else
+            {
+            log.Write(_L8("Failed to create server thread."));
+            }
+#endif // _SENDEBUG
+            
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        log.Write(_L8("Could not load library"));
+        }
+#endif // _SENDEBUG
+
+    CleanupStack::Pop(); // server (thread)
+    CleanupStack::PopAndDestroy(); // lib
+    CleanupClosePushL(server);
+
+#else // NON WINS TARGET(S):
+    RProcess server;
+    CleanupClosePushL(server);
+    result = server.Create(KSenServiceManagerFileName, KNullDesC, serverUid);//CodeScannerWarning
+#endif
+
+    if( result == KErrNone )
+        {
+#ifdef _SENDEBUG
+        log.Write(_L8("Server successfully created, KErrNone"));
+#endif // _SENDEBUG
+        server.Resume();
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        log.Write(_L8("Could not create server"));
+        }
+#endif // _SENDEBUG
+
+    CleanupStack::PopAndDestroy(); // server.Close();
+
+#ifdef _SENDEBUG
+    CleanupStack::PopAndDestroy(); // log.Close();
+#endif
+
+    return result;
+    }
+    
+
+// End of file
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/src/senhostletconnectiondll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+
+#include "senhostletconnectionimpl.h"
+//#include "SenHostletConnectionLog.h"
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+EXPORT_C CSenHostletConnection* CSenHostletConnection::NewL(MSenHostlet& aProvider)
+    {
+    return CSenHostletConnectionImpl::NewL(aProvider);
+    }
+
+EXPORT_C CSenHostletConnection* CSenHostletConnection::NewLC(MSenHostlet& aProvider)
+    {
+    return CSenHostletConnectionImpl::NewLC(aProvider);
+    }
+
+CSenHostletConnection::CSenHostletConnection()
+    : CActive(EPriorityStandard)
+    {
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason)
+    {
+    return(KErrNone);
+    }
+#endif
+
+#ifdef _SENDEBUG
+
+// static logging functions
+/*
+void CSenHostletConnectionLogger::WriteFormat(TRefByValue<const TDesC16> aFmt,...)
+    {
+    CSenLogger::WriteFormat(KSenHostletConnectionLogChannel, KHostletConnectionLogLevel, aFmt);
+    }
+    
+void CSenHostletConnectionLogger::WriteFormat(TRefByValue<const TDesC16> aFmt, VA_LIST& aList)
+    {
+    CSenLogger::WriteFormat(KSenHostletConnectionLogChannel, KHostletConnectionLogLevel, aFmt, aList);
+    }
+
+void CSenHostletConnectionLogger::WriteFormat(TRefByValue<const TDesC8> aFmt,...)
+    {
+    CSenLogger::WriteFormat(KSenHostletConnectionLogChannel, KHostletConnectionLogLevel, aFmt);
+    }
+
+void CSenHostletConnectionLogger::WriteFormat(TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
+    {
+    CSenLogger::WriteFormat(KSenHostletConnectionLogChannel, KHostletConnectionLogLevel, aFmt, aList);
+    }
+*/
+#endif // _SENDEBUG
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/src/senhostletconnectionimpl.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1011 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32strm.h>
+#include <SenXmlUtils.h>
+
+//#include "SenHostletConnectionLog.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+#include "senhostletconnectionimpl.h"
+#include "MSenHostlet.h"              // public
+#include "MSenHostletRequest.h"       // public
+#include "MSenHostletResponse.h"      // public
+#include "senhostletrequest.h"
+#include "senhostletresponse.h"
+
+#include "rsenhostletconnection.h"
+
+#include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations
+
+#include "SenXmlServiceDescription.h"
+
+#include "senguidgen.h"  // internal: Utils\inc - the prefix length constant for WSF GUIDs
+#include "senchunk.h"
+#include "senidentifier.h"
+
+#include "MSenMessage.h"
+#include "senconnagentserver.h"
+#include "senvtcptransportproperties.h"
+#include "SenXmlReader.h"
+
+namespace
+    {
+    _LIT8( KSenCidPostfix, "@example.org" );
+    const TInt KMaxCidLength = 512;
+    }
+
+
+CSenHostletConnectionImpl* CSenHostletConnectionImpl::NewL(MSenHostlet& aProvider)
+    {
+    CSenHostletConnectionImpl* pNew = NewLC(aProvider);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenHostletConnectionImpl* CSenHostletConnectionImpl::NewLC(MSenHostlet& aProvider)
+    {
+    CSenHostletConnectionImpl* pNew = new (ELeave) CSenHostletConnectionImpl(aProvider);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+void CSenHostletConnectionImpl::ConstructL()
+    {
+    TInt connErr = iConnection.Connect();
+    TInt connAttemp(0); // max 5 attempts are allowed
+    while ( (connErr == KErrServerTerminated || connErr == KErrServerBusy)
+                     && connAttemp < KSenMaxClientConnectionOpeningAttempts  )
+        {
+//        TLSLOG_L(iTlsLogChannel, KSenHostletConnectionLogLevel, "CSenHostletConnection::ConstructL - Server busy/going down");
+        User::After(1000000); // wait for a second if server has been shut down
+//        TLSLOG_L(iTlsLogChannel, KSenHostletConnectionLogLevel, "CSenHostletConnection::ConstructL - Creating connection");
+        connErr = iConnection.Connect();
+        connAttemp++;
+        }
+    if ( connErr != KErrNone )
+        {
+        User::Leave( connErr );
+        }
+
+    iConnectionID = iConnection.ConnectionID();
+    iTlsLogChannel = KSenHostletConnectionLogChannelBase + iConnectionID;
+
+    ipRegistrationTimer = CSenRegistrationTimer::NewL( *this );
+
+#ifdef _SENDEBUG
+    RThread thread;
+    RProcess process;
+    TFileName logFile;
+    logFile.Append( KSenHostletConnectionLogFile().Left(KSenHostletConnectionLogFile().Length()-4) ); // exclude ".log" file extension
+    logFile.AppendNum( iConnectionID );
+    logFile.Append( KSenUnderline );
+    logFile.Append( process.Name().Left(32));
+    logFile.Append( KSenUnderline );
+    logFile.Append( thread.Name().Left(20));
+    logFile.Append( KSenHostletConnectionLogFile().Right(4) ); // postfix with ".log" file extension
+
+    // Open connection to the file logger server
+    TLSLOG_OPEN( iTlsLogChannel, KSenHostletConnectionLogLevel, KSenHostletConnectionLogDir, logFile );
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnection::ConstructL - About to establish new hostlet connection..");
+    TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L("- Connection ID: (%d)"), iConnectionID));
+#endif
+
+    User::LeaveIfError(EstablishConnectionL(iProvider));
+    }
+
+CSenHostletConnectionImpl::CSenHostletConnectionImpl(MSenHostlet& aProvider) :
+    iProvider(aProvider),
+    iErrorNumber(0),
+    iErrorNumberBuffer(NULL, 0),
+    iTxnId(KErrNotFound),
+    iTxnIdBuffer(NULL, 0),
+    iHostletTransactionMap(NULL),
+    ipSessionId(NULL),
+    iSessionIdBuffer(NULL, 0),
+    iChunkNameNumber(0),
+    ipChunkName(NULL),
+    iAlive(ETrue),
+    iConnectionID(KErrNotReady),
+    iTlsLogChannel(KSenHostletConnectionLogChannelBase),
+    iCancelSession(EFalse),
+    ipFileProgressObserver(NULL),
+    iRegisterFileObserverDone(EFalse),
+    ipRegistrationTimer(NULL)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CSenHostletConnectionImpl::~CSenHostletConnectionImpl()
+    {
+    delete ipRegistrationTimer; // Invokes connagent registrations & subscribes for RProperty updates
+    delete ipFileProgressObserver; // Subscriber (observer) for RProperty update
+    TLSLOG(iTlsLogChannel, KMinLogLevel, _L("CSenHostletConnectionImpl::~CSenHostletConnectionImpl"));
+    CSenHostletConnectionImpl::Cancel(); // Causes call to DoCancel()
+    CSenHostletConnectionImpl::iAlive = EFalse;
+   if (iFilesObserver)
+        {
+        CSenConnAgentServer::Close();
+        }
+    if (iAsyncOpsArray)
+        {
+        TInt count(iAsyncOpsArray->Count());
+        for(TInt i=0; i<count; i++)
+            {
+            CSenAsyncOperation* pOp = (*iAsyncOpsArray)[i];
+            if ( pOp )
+                {
+                TRequestStatus* status = &pOp->iStatus;
+                User::RequestComplete( status, KErrSenCancelled );
+                pOp->iActive = NULL;
+                }
+            }
+        iAsyncOpsArray->ResetAndDestroy();
+        delete iAsyncOpsArray;
+        }
+
+    if ( iHostletTransactionMap )
+        {
+        iHostletTransactionMap->Reset();
+        delete iHostletTransactionMap;
+        }
+
+    delete ipSessionId;
+    delete ipChunkName;
+
+    iConnection.Close();
+
+    // Close the log file and the connection to the server.
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "Log file closed.");
+    TLSLOG_CLOSE( iTlsLogChannel );
+    //TLSLOG_CLOSE( KSenHostletConnectionLogChannel );
+    }
+
+
+TInt CSenHostletConnectionImpl::Identifier()
+    {
+    return iConnectionID;    
+    }
+
+TInt CSenHostletConnectionImpl::RegisterFilesObserver()
+    {
+    TLSLOG(iTlsLogChannel, KMinLogLevel, _L("CSenHostletConnectionImpl::RegisterFilesObserver"));
+    TInt retVal(KErrNone);
+    const TDesC& name = CSenConnAgentServer::Open();
+    if (name == KNullDesC)
+        {
+        return KErrGeneral;
+        }
+    retVal = iConnection.RegisterTransferObserver(&name, iFilesObserver);
+    TLSLOG(iTlsLogChannel, KMinLogLevel, _L("CSenHostletConnectionImpl::RegisterFilesObserver Completed"));
+    return retVal; 
+    }
+
+TPtrC CSenHostletConnectionImpl::SessionID()
+    {
+    if(ipSessionId)
+        {
+        return *ipSessionId;
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+TInt CSenHostletConnectionImpl::RespondL(MSenHostletResponse& aResponse)
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::RespondL");
+    TInt retVal(KErrNone);
+    
+    retVal = HostletTransactionMapL().Find(aResponse.RequestId());
+    
+    if ( retVal != KErrNotFound )
+        {
+        CSenHostletTransaction* pTransaction = (CSenHostletTransaction*)HostletTransactionMapL().ValueAt(retVal);
+        CSenChunk* pOperation = (CSenChunk*)pTransaction->Chunk();
+        if ( pOperation )
+            {
+            // First check whether this request has ALREADY BEEN responded (to prevent multiple RespondL
+            // calls performed inside MSenHostlet::ServiceL / per single request):
+            MSenMessage::TDirection direction = pOperation->ChunkHeader().MessageDirection();
+            
+            if( direction == MSenMessage::EOutbound )
+                {
+                // Note: direction is always consumers point of view. So outbound here
+                // means "a request from consumer" - inbound would be "response to consumer".
+                
+                // Note: this sort of really double-safety action, since hostlet transport plugin also turns the 
+                // direction to "inbound" before sending responses to consumers. But better be safe than sorry
+                pOperation->ChunkHeader().SetMessageDirection( MSenMessage::EInbound );
+
+
+                MSenProperties* pProperties = aResponse.ResponseProperties();
+                if( pProperties )
+                    {
+                    // Serialize properties
+                    HBufC8* pPropsAsXml = pProperties->AsUtf8LC();
+                    // Store the properties class type into chunk
+                    MSenProperties::TSenPropertiesClassType type
+                        = pProperties->PropertiesClassType();
+                    pOperation->ChunkHeader().SetPropertiesType( type );
+                    // Store response message AND properties into chunk
+                    TPtrC8 properties = pPropsAsXml->Des();
+                    pOperation->DescsToChunk( aResponse.ResponseUtf8(), properties );
+                    CleanupStack::PopAndDestroy(pPropsAsXml);
+                    }
+                else
+                    {
+                    // There is only a response message. Store it into chunk.
+                    pOperation->ChunkHeader().SetPropertiesType(MSenProperties::ENotInUse);
+                    pOperation->DescToChunk( aResponse.ResponseUtf8() );
+                    }            
+                CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+                iConnection.ProvideResponse(pSenAO->iStatus, 
+                                            pSenAO->iErrorNumberBuffer,
+                                            pSenAO->iTxnIdBuffer,
+                                            *pOperation,
+                                            aResponse.ResponseCode());
+                }
+            else
+                {
+                retVal = KErrAlreadyExists; 
+                }                
+            }
+        else
+            {
+            retVal = KErrNotFound; 
+            }
+        }
+        
+    TLSLOG_FORMAT((iTlsLogChannel, KNormalLogLevel, _L8("- ProvideResponse returned: %d"), retVal));
+    return retVal;
+    }
+
+// This method is executed when one of the static constructors of
+// service connection (NewL or NewLC) is called.
+TInt CSenHostletConnectionImpl::EstablishConnectionL(MSenHostlet& aProvider)
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::InitializeL");
+
+	TInt retVal = KErrNone;
+    ipInterface = NULL;
+    ipInterface = aProvider.GetInterfaceByUid(KSenInterfaceUidFilesObserver);
+    if(ipInterface)
+    {
+        iFilesObserver = (MSenFilesObserver*) ipInterface;
+
+        
+        if ( !iRegisterFileObserverDone )
+            {
+            TLSLOG_L( iTlsLogChannel, KMinLogLevel, "EstablishConnectionL(): - Calling IssueRegistrations()");
+            ipRegistrationTimer->IssueRegistrations( ETrue );
+                TLSLOG_L(iTlsLogChannel, KMinLogLevel ,"- RegisterFilesObserver() failed!");
+            } // end of if ( !iRegisterFileObserverDone )
+        
+    }
+    if(retVal == KErrNone)
+        {
+    TPtrC8 endpoint     = aProvider.Endpoint();
+    TPtrC8 contract     = aProvider.Contract();
+    TPtrC8 frameworkId  = aProvider.FrameworkId();
+    CSenXmlServiceDescription* pDescription = CSenXmlServiceDescription::NewLC(endpoint, contract);
+    pDescription->SetFrameworkIdL(frameworkId);
+
+    aProvider.DescribeServiceL(*pDescription);
+
+    if(pDescription->Endpoint().Length()==0 && pDescription->Contract().Length()==0)
+        {
+        User::Leave(KErrSenNoContractNoEndPoint);
+        }
+        
+    if ( pDescription->Endpoint().Length() == 0 )
+        {
+#ifdef EKA2            
+        RProcess process;
+        TSecureId sId = process.SecureId();
+        if ( sId == 0 )
+            {
+            User::Leave(KErrSenNoEndpoint);
+            }
+
+        TBuf8<128> buf;
+        TUint i(sId);
+        _LIT8(KFormat, "%u");
+        buf.Format(KFormat, i);
+
+        pDescription->SetEndPointL(buf);
+#else
+        User::Leave(KErrSenNoEndpoint); // in EKA1, endpoints are not generated!
+#endif // EKA2/EKA1        
+        }
+
+    // Ensure that hostlet connection transport-plugin cue is applied,
+    // unless the application has specified some other plug-in:
+    TPtrC8 cue = pDescription->TransportCue();
+    if( cue.Length() == 0 )
+        {
+        // Set the default cue (hostlet connection transport plug-in) to the XML SD:
+        pDescription->SetTransportCueL(KSenTransportCueHostletConnection);
+//        LOG_WRITEFORMAT((_L8("- Setting the default transport cue: '%S'"), &KSenTransportCueHostletConnection()));
+        }
+
+
+#ifdef _FORCE_DESCRIBED_MSW_2005_08_CONTRACT_TO_2006_10
+    /// // Hard coded workaround for update hostlet contract: // ///
+    //     Update contract from 2005 => 2006
+    _LIT8( KMessaging200508, "http://schemas.live.com/mws/2005/08/messaging" );
+    _LIT8( KMessaging200510, "http://schemas.live.com/mws/2006/10/messaging" );
+    if( pDescription->Contract() == KMessaging200508 )
+        {
+        pDescription->SetContractL( KMessaging200510 );
+        }
+#endif // _FORCE_DESCRIBED_MSW_2005_08_CONTRACT_TO_2006_10
+
+
+#ifdef _SENDEBUG
+    //TPtrC8 providerID  = ((CSenXmlServiceDescription&)aSD).ProviderId();
+
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
+    TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L8("- FrameworkID:  %S"), &frameworkId ));
+    TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L8("- Endpoint:     %S"), &endpoint ));
+    TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L8("- Contract:     %S"), &contract ));
+    TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L8("- TransportCue: %S"), &cue ));
+//    LOG_WRITEFORMAT((iTlsLogChannel, KSenHostletConnectionLogLevel, _L8("- ProviderID:  %S"), &providerID ));
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
+#endif //_SENDEBUG            
+    
+    HBufC8* pServiceDescriptionXml = pDescription->AsXmlL();
+    CleanupStack::PopAndDestroy(pDescription);
+
+    CleanupStack::PushL(pServiceDescriptionXml);
+
+#ifdef _SENDEBUG
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::EstablishConnectionL - Service description:");
+    if ( pServiceDescriptionXml )
+        {
+            TPtrC8 xml = pServiceDescriptionXml->Des();
+            TLSLOG_ALL(iTlsLogChannel, KMinLogLevel, (xml));
+        }
+#endif // _SENDEBUG
+    
+	 if ( pServiceDescriptionXml )
+		{
+			TPtr8 ptrServiceDescriptionXml(pServiceDescriptionXml->Des());
+
+			retVal = iConnection.Establish(ptrServiceDescriptionXml);
+		}
+		else
+		{
+	    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "EstablishConnectionL ---- Returning KErrGeneral");		
+		retVal = KErrGeneral;
+		}
+
+    TLSLOG_FORMAT((iTlsLogChannel, KNormalLogLevel, _L("- Establish returned: %d"), retVal));
+    User::LeaveIfError( retVal );
+
+    CleanupStack::PopAndDestroy(pServiceDescriptionXml);
+
+    // Start awaiting for next hostlet request
+    iErrorNumber = 0;
+    iTxnId = 0;
+
+    CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this); // appends itself into array
+
+    // NOTE, following ASYNC AwaitRequest() will stay as pending IPC -operation; this is the design:
+    iConnection.AwaitRequest(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer); 
+        }
+	TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::InitializeL Completed");        
+    return retVal;
+    }
+
+void CSenHostletConnectionImpl::RunL()
+    {
+    TLSLOG_FORMAT((iTlsLogChannel, KNormalLogLevel, _L("CSenHostletConnectionImpl::RunL( %d )"),  iStatus.Int()));
+    }
+    
+void CSenHostletConnectionImpl::HandleErrorFromChildAOL(TInt aError, TInt aTxnId, const TDesC8& aDesc, CSenAsyncOperation& aChild )
+    {
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::HandleErrorFromChildAOL");
+    TInt leaveCode(KErrNone);
+    TRAP( leaveCode, iProvider.OnServiceCompleteL(aTxnId, aError, aDesc); )
+    
+    HostletTransactionMapL().RemoveByKey(aTxnId);
+    
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::HandleErrorFromChildAOL:");
+#ifdef _SEDEBUG
+    if( leaveCode != KErrNone ) 
+        {
+        TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L(" - OnServiceCompleteL leaved: %d"), leaveCode));
+        }
+    if( aChild.iStatus.Int() == ESenOnServiceComplete && aError == KErrSenCancelled )
+        {
+        TLSLOG_L(iTlsLogChannel, KMinLogLevel, "- Await was cancelled (ESenOnServiceComplete).");
+        }
+#endif // _SENDEBUG
+    if( aChild.iStatus.Int() == ESenOnServiceComplete && iAlive )
+        {
+        CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this); // appends itself into array
+        iConnection.AwaitRequest(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer); 
+        }
+    leaveCode = 0; // not used in release builds
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::HandleErrorFromChildAOL Completed");
+    }
+    
+void CSenHostletConnectionImpl::HandleMessageFromChildAOL(TInt aStatus, CSenAsyncOperation& aChild)
+    {
+    TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L("CSenHostletConnectionImpl::HandleMessageFromChildAOL( %d )"), aStatus));
+
+    iAsyncOpsCount--;
+//    TLSLOG_FORMAT((iTlsLogChannel, KSenHostletConnectionLogLevel, _L("One asynchronous operation completed. Pending iAsyncOpsCount: %i"), iAsyncOpsCount));
+    
+    TLSLOG_FORMAT((iTlsLogChannel, KNormalLogLevel, _L("One asynchronous operation completed. Pending iAsyncOpsCount: %i"), iAsyncOpsCount));
+    
+    if ( aStatus == ESenOnServiceComplete) // temporary: implement "acquire request handle" operation and use switch case here..
+        {
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, iProvider.OnServiceCompleteL(aChild.iTxnId, aChild.iErrorNumber, KNullDesC8); ) 
+        
+        HostletTransactionMapL().RemoveByKey(aChild.iTxnId);
+        
+        TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::HandleMessageFromChildAOL: ESenOnServiceComplete");
+#ifdef _SEDEBUG
+        if( leaveCode != KErrNone ) 
+            {
+            TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L(" - OnServiceCompleteL leaved: %d"), leaveCode));
+            }
+        if( aChild.iErrorNumber == KErrSenCancelled )
+            {
+            TLSLOG_L(iTlsLogChannel, KMinLogLevel, "- Await was cancelled.");
+            }
+#endif // _SENDEBUG
+        if( aChild.iErrorNumber != KErrSenCancelled && iAlive )
+            {
+            CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this); // appends itself into array
+
+            // NOTE, following ASYNC AwaitRequest() will stay as pending IPC -operation; this is the design:
+            iConnection.AwaitRequest(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer); 
+            }
+        leaveCode = 0; // not used in release builds
+        }
+    else if ( aStatus > KErrNone )
+        {
+        TLSLOG_L(iTlsLogChannel, KMinLogLevel, "- handle received.");
+        CSenChunk* pOperation = CSenChunk::NewLC(KNullDesC);
+        TInt retVal = pOperation->OpenChunkFromHandleNumberL(aStatus);
+        if ( retVal == KErrNone )
+            {
+            CSenHostletTransaction* pHostletTxn = CSenHostletTransaction::NewL(pOperation);
+            CleanupStack::Pop(pOperation);
+            CleanupStack::PushL(pHostletTxn);
+            
+            TInt* pTxnId = new (ELeave) TInt(pOperation->ChunkHeader().TransactionId());
+            CleanupStack::PushL(pTxnId);
+            retVal = HostletTransactionMapL().Append(pTxnId, pHostletTxn);
+            
+            if ( retVal == KErrNone )
+                {
+                CleanupStack::Pop(pTxnId);
+                CleanupStack::Pop(pHostletTxn);
+                TPtrC8 request;
+                retVal = pOperation->DescFromChunk(request);
+                
+                if ( retVal == KErrNone )
+                    {
+                    RThread thread;
+                    CSenIdentifier* pIdentifier = CSenIdentifier::NewL();
+                    pHostletTxn->SetIdentifier(pIdentifier);
+                    
+                    CSenHostletRequest* pRequest =
+                            CSenHostletRequest::NewL(pOperation->ChunkHeader().TransactionId(),
+                                                     request,
+                                                     thread,
+                                                     *pIdentifier,
+                                                     pOperation);
+                    pHostletTxn->SetRequest(pRequest);
+                                                     
+                    CSenHostletResponse* pResponse = 
+                            CSenHostletResponse::NewL(pOperation->ChunkHeader().TransactionId());
+                    pHostletTxn->SetResponse(pResponse);
+                    
+					MSenProperties::TSenPropertiesClassType type = MSenProperties::ESenVtcpTransportProperties ;
+					TPtrC8 properties = pRequest->Properties(type) ;
+					if (properties != KNullDesC8)
+						{
+						CSenXmlReader* pXmlReader = CSenXmlReader::NewL();
+						if(pXmlReader)	
+							{
+							CleanupStack::PushL(pXmlReader);
+							CSenVtcpTransportProperties * vtcpTransProp = CSenVtcpTransportProperties::NewL(properties, *pXmlReader);
+							if(vtcpTransProp)
+							    {
+							    CleanupStack::PushL(vtcpTransProp);
+								TBool boolValue = EFalse ;
+								if (vtcpTransProp->OnewayMessageOnOffL(boolValue) != KErrNotFound
+									&& boolValue)
+									{
+									//Now hostlet implementation can automaticaly reply with zero-length
+									//string (KNullDesC8)
+									//NOW SET THE ONE WAY RESPONSE PROPERTY AS WELL
+									pResponse->SetResponseUtf8L(KNullDesC8(), KErrNone, vtcpTransProp) ;
+						            iProvider.ServiceL(*pRequest, *pResponse);
+									//RespondL(*pResponse) ; 
+									}
+									else
+									{
+						      		iProvider.ServiceL(*pRequest, *pResponse);
+									//RespondL(*pResponse) ; 
+									}
+								CleanupStack::PopAndDestroy(vtcpTransProp) ;
+								}
+							CleanupStack::PopAndDestroy(pXmlReader) ;					
+							}
+						}
+					else
+						{
+			            iProvider.ServiceL(*pRequest, *pResponse);
+						}
+//                    if( iAlive )
+//                        {
+//                        CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this); // appends itself into array
+//                        iConnection.AwaitRequest(pSenAO->iStatus, pSenAO->iErrorNumberBuffer, pSenAO->iTxnIdBuffer); 
+//                        }
+                    }
+                else
+                    {
+                    User::Leave(retVal);
+                    }
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(pTxnId);
+                CleanupStack::PopAndDestroy(pHostletTxn);
+                User::Leave(retVal);
+                }
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(pOperation);
+            User::Leave(retVal);
+            }
+        }
+    else
+        {
+        User::Leave(aStatus);
+        }
+                  
+    /*                                         
+    switch (aStatus)
+        {
+        case ESenHostletRequestPending:
+            {
+            TLSLOG_L(iTlsLogChannel, KSenHostletConnectionLogLevel, "HandleMessageFromChildAOL: ESenHostletRequestPending");
+            if (iErrorNumber == KErrNone)
+                {
+                TLSLOG_FORMAT((iTlsLogChannel, KSenHostletConnectionLogLevel, _L("- Request from consumer received:"), iSessionIdBuffer.Length()));
+
+
+                //TInt handle = iConnection.AcquireRequestHandle(aChild.iErrorNumberBuffer, aChild.iTxnIdBuffer);
+                //CSenChunk* pChunk = CSenChunk::OpenChunkFromRMsgL
+
+                }
+
+            }
+        break;
+
+        case ESenInternalError:
+            {
+            // we could have someting in iErrorNumber in some cases
+            TLSLOG_L(iTlsLogChannel, KSenHostletConnectionLogLevel, "HandleMessageFromChildAOL: ESenInternalError");
+            TLSLOG_FORMAT((iTlsLogChannel, KSenHostletConnectionLogLevel, 
+                _L("- Last received error from server: (%d)"),
+                    iErrorNumber));
+
+            //DeliverResponseL(KNullDesC8, KErrSenInternal);
+            }
+            break;
+
+
+        default:
+            {
+#ifdef _SENDEBUG                
+            if(aStatus == KErrPermissionDenied)
+                {
+                TLSLOG_L(iTlsLogChannel, KSenHostletConnectionLogLevel, "HandleMessageFromChildAOL: default - KErrPermissionDenied");
+                }
+            else
+                {
+                TLSLOG_L(iTlsLogChannel, KSenHostletConnectionLogLevel, "RunL: default - unexpected error.");
+                TLSLOG_FORMAT((iTlsLogChannel, KSenHostletConnectionLogLevel, _L("Last received error from server: (%d)"), iErrorNumber));
+                }
+            TLSLOG_FORMAT((iTlsLogChannel, KSenHostletConnectionLogLevel, _L("RunL, iStatus.Int(): (%d)"), iStatus.Int()));
+            
+#endif // _SENDEBUG             
+            // WSF does not generalize errors:
+            //DeliverResponseL(KNullDesC8, aStatus);
+            break ;
+            }
+        }*/
+    TLSLOG_L(iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::HandleMessageFromChildAOL Completed");
+    }
+
+void CSenHostletConnectionImpl::DoCancel()
+    {
+    TLSLOG(iTlsLogChannel, KMinLogLevel, _L("CSenHostletConnectionImpl::DoCancel"));
+    TInt cancelLeaveCode(KErrNone);
+    if (iCancelSession == EFalse)
+        {
+        CSenAsyncOperation* pSenAO = CSenAsyncOperation::NewL(this);
+        TRAP(cancelLeaveCode, iConnection.CancelSession(pSenAO->iStatus));
+        
+    #ifdef _SENDEBUG
+        if(cancelLeaveCode!=KErrNone)
+            {
+            TLSLOG_FORMAT((iTlsLogChannel, KMinLogLevel, _L("- CancelSession leaved: %d)"), cancelLeaveCode));
+            }
+    #endif
+        cancelLeaveCode=0;   
+        iCancelSession = ETrue; 
+        }
+    TLSLOG(iTlsLogChannel, KMinLogLevel, _L("CSenHostletConnectionImpl::DoCancel Completed"));
+    }
+RHostletTransactionMap& CSenHostletConnectionImpl::HostletTransactionMapL()
+    {
+    if ( !iHostletTransactionMap )
+        {
+        iHostletTransactionMap = new (ELeave) RHostletTransactionMap(ETrue, ETrue);
+        }
+    return *iHostletTransactionMap;
+    }
+    
+RPointerArray<CSenAsyncOperation>& CSenHostletConnectionImpl::AsyncOpsArrayL()
+    {
+    if(!iAsyncOpsArray)
+        {
+        iAsyncOpsArray = new (ELeave) RPointerArray<CSenAsyncOperation>;
+        }
+    return *iAsyncOpsArray;
+    }
+
+TInt CSenHostletConnectionImpl::RegisterAndSubscribeFileProgressObserversL()
+    {
+    TInt retCode( KErrNone );
+#ifndef RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC        
+    if(iFilesObserver && !iRegisterFileObserverDone)
+    	{
+    	
+  #ifndef RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS // pub&sub not in use for outgoing file progress
+        TLSLOG( iTlsLogChannel, KMinLogLevel,(_L("CSenHostletConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == FALSE")));
+    	retCode = RegisterFilesObserver();
+  #else // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE
+        TLSLOG( iTlsLogChannel, KMinLogLevel,(_L("CSenHostletConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS == TRUE")));
+    	ipFileProgressObserver = CSenFileProgressObserver::NewL( *iFilesObserver, iConnectionID );
+
+    #ifdef RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+        TLSLOG_L( iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == TRUE");
+        TLSLOG_L( iTlsLogChannel, KMinLogLevel, "=> calling RegisterFilesObserver()");
+        retCode = RegisterFilesObserver(); // MIXED MODE, using conn agent for SOAP progress..
+    #else // RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == FALSE
+        TLSLOG_L( iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS == FALSE");
+    #endif // RD_SEN_USE_CONNAGENT_FOR_SOAP_PROGRESS
+
+  #endif // RD_SEN_USE_PUBSUB_FOR_OUTGOING_FILE_PROGRESS end 	
+    	iRegisterFileObserverDone = ETrue; // register only once
+    	}
+#else
+    TLSLOG_L( iTlsLogChannel, KMinLogLevel, "CSenHostletConnectionImpl::RegisterAndSubscribeFileProgressObserversL: RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC == TRUE, not registering connagent, nor subscribing for the RProperty");
+#endif // end of: #ifndef RD_SEN_DISABLE_TRANSFER_PROGRESS_FOR_HC    
+    return retCode;
+    }
+        
+
+
+
+
+CSenAsyncOperation* CSenAsyncOperation::NewL(CSenHostletConnectionImpl* aActive)
+    {
+    CSenAsyncOperation* pNew = NewLC(aActive);
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+CSenAsyncOperation* CSenAsyncOperation::NewLC(CSenHostletConnectionImpl* aActive)
+    {
+    CSenAsyncOperation* pNew = new (ELeave) CSenAsyncOperation(aActive);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+    
+CSenAsyncOperation::CSenAsyncOperation(CSenHostletConnectionImpl* aActive)
+:   CActive(EPriorityNormal),
+    iActive(aActive),
+    iErrorNumber(0),
+    iErrorNumberBuffer(NULL, 0),
+    iTxnId(0),
+    iTxnIdBuffer(NULL, 0)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+void CSenAsyncOperation::ConstructL()
+    {
+    iErrorNumberBuffer.Set(reinterpret_cast<TUint8*>(&iErrorNumber),
+                           sizeof(TInt),
+                           sizeof(TInt));
+                           
+    iTxnIdBuffer.Set(reinterpret_cast<TUint8*>(&iTxnId),
+                     sizeof(TInt),
+                     sizeof(TInt));
+                     
+    SetActive();
+#ifdef EKA2
+    iActive->AsyncOpsArrayL().AppendL(this);
+#else
+    RPointerArray<CSenAsyncOperation>& ops = iActive->AsyncOpsArrayL();
+    User::LeaveIfError(ops.Append(this));
+#endif
+
+    iActive->iAsyncOpsCount++;
+    }
+
+CSenAsyncOperation::~CSenAsyncOperation()
+    {
+    Cancel(); // invokes CSenAsyncOperation::DoCancel()
+    }
+
+void CSenAsyncOperation::RunL()
+    {
+    if ( iActive )
+        {
+        iActive->iErrorNumber = iErrorNumber;
+        iActive->iTxnId = iTxnId;    
+        iActive->HandleMessageFromChildAOL(iStatus.Int(), *this);
+            
+        TInt idx = iActive->AsyncOpsArrayL().Find(this);
+        if (idx >= 0)
+            {
+            iActive->AsyncOpsArrayL().Remove(idx);
+            }
+        }
+    delete this;
+    }
+    
+TInt CSenAsyncOperation::RunError(TInt aError)
+    {
+    TInt leaveCode( KErrNone );
+    if (iActive)
+        {
+        TRAP( leaveCode, iActive->HandleErrorFromChildAOL(aError, iTxnId, KNullDesC8, *this); ) 
+
+        RPointerArray<CSenAsyncOperation>* pOps = NULL;
+        TRAP( leaveCode, pOps = &(iActive->AsyncOpsArrayL()); )
+        if ( pOps )
+            {
+            TInt idx = pOps->Find(this);
+            if ( idx != KErrNotFound )
+                {
+                pOps->Remove( idx );
+                }
+            }
+        delete this;
+        }
+    return leaveCode; // return != KErrNone ONLY and ONLY IF the error really could not be handled by this AO!
+    }
+        
+void CSenAsyncOperation::DoCancel()
+    {
+    }
+
+CSenHostletTransaction* CSenHostletTransaction::NewL(CSenChunk* aSenChunk)
+    {
+    CSenHostletTransaction* pNew = NewLC(aSenChunk);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+    }
+
+CSenHostletTransaction* CSenHostletTransaction::NewLC(CSenChunk* aSenChunk)
+    {
+    CSenHostletTransaction* pNew = new (ELeave) CSenHostletTransaction(aSenChunk);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenHostletTransaction::~CSenHostletTransaction()
+    {
+    delete iIdentifier;
+    delete iSenChunk;
+    delete iRequest;
+    delete iResponse;
+    }
+
+CSenHostletTransaction::CSenHostletTransaction(CSenChunk* aSenChunk)
+    : iSenChunk( aSenChunk )
+    {
+    }
+
+void CSenHostletTransaction::SetChunk(CSenChunk* aChunk)
+    {
+    iSenChunk = aChunk;
+    }
+        
+CSenChunk* CSenHostletTransaction::Chunk()
+    {
+    return iSenChunk;
+    }
+
+void CSenHostletTransaction::SetIdentifier(CSenIdentifier* aIdentifier)
+    {
+    iIdentifier = aIdentifier;
+    }
+    
+CSenIdentifier* CSenHostletTransaction::Identifier()
+    {
+    return iIdentifier;
+    }
+
+void CSenHostletTransaction::SetRequest(CSenHostletRequest* aRequest)
+    {
+    iRequest = aRequest;
+    }
+    
+CSenHostletRequest* CSenHostletTransaction::Request()
+    {
+    return iRequest;
+    }
+
+void CSenHostletTransaction::SetResponse(CSenHostletResponse* aResponse)
+    {
+    iResponse = aResponse;
+    }
+
+CSenHostletResponse* CSenHostletTransaction::Response()
+    {
+    return iResponse;
+    }
+    
+
+
+// ------------------------------------------------------------------------------------------------------------
+
+CSenFileProgressObserver* CSenFileProgressObserver::NewL( MSenFilesObserver& aObserver,
+                                                          TInt aConnectionID )
+    {
+    CSenFileProgressObserver* pNew = NewLC( aObserver, aConnectionID );
+    CleanupStack::Pop();
+    return(pNew);
+    }
+
+CSenFileProgressObserver* CSenFileProgressObserver::NewLC( MSenFilesObserver& aObserver,
+                                                           TInt aConnectionID )
+    {
+    CSenFileProgressObserver* pNew = new (ELeave) CSenFileProgressObserver( aObserver, aConnectionID );
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+    
+    
+
+CSenFileProgressObserver::CSenFileProgressObserver( MSenFilesObserver& aObserver,
+                                                    TInt aConnectionID )
+//:   CActive(EPriorityNormal),
+:   CActive(EPriorityMore),
+    iFileProgressObserver(&aObserver),
+    iConnectionID(aConnectionID)
+    {
+    }
+
+void CSenFileProgressObserver::ConstructL()
+    {
+    _LIT_SECURITY_POLICY_PASS(KReadPropPassAll);
+    _LIT_SECURITY_POLICY_S0(KWritePropSenCoreSidOnlyPolicy, KServerUid3.iUid);
+    
+    // Define the property
+    TInt err = RProperty::Define( KSenInterfaceUidFilesObserver,
+                                  iConnectionID,
+                                  RProperty::ELargeByteArray, 
+                                  KReadPropPassAll,
+                                  KWritePropSenCoreSidOnlyPolicy,
+                                  512 );
+	// Use KSenInterfaceUidFilesObserver extended consumer interface UID
+	User::LeaveIfError(iFileProgressProperty.Attach(KSenInterfaceUidFilesObserver,  iConnectionID)); // KSenInterfaceUidFilesObserver UID will be category
+    CActiveScheduler::Add(this);
+    // Initial subscription
+    iFileProgressProperty.Subscribe(iStatus);
+    SetActive();
+    iStatus = KRequestPending;
+    }
+
+CSenFileProgressObserver::~CSenFileProgressObserver()
+    {
+    Cancel();
+    iFileProgressProperty.Close();
+    
+    TInt err = RProperty::Delete( KSenInterfaceUidFilesObserver, iConnectionID );
+    
+    }
+
+void CSenFileProgressObserver::DoCancel()
+    {
+    iFileProgressProperty.Cancel();
+    }
+
+void CSenFileProgressObserver::RunL()
+    {
+    // Resubscribe before processing new value to prevent missing updates(!):
+	iFileProgressProperty.Subscribe( iStatus );
+    SetActive();
+    iStatus = KRequestPending;
+
+    TLSLOG_L( KSenHostletConnectionLogChannelBase + iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenFileProgressObserver::RunL" );
+       
+    TPckgBuf<TFileOutgoingTransferProgressBase> progress;
+    TInt getPropertyCode = iFileProgressProperty.Get( progress );
+    if ( getPropertyCode == KErrNone )
+        {
+        TLSLOG_L( KSenHostletConnectionLogChannelBase + iConnectionID, KSenServiceConnectionStatusLogLevel, "CSenFileProgressObserver::RunL [new value published] - Calling TransferProgress" );
+        TFileOutgoingTransferProgressBase data = progress();
+
+        HBufC8* pCid = HBufC8::NewLC( KMaxCidLength );
+        TPtr8 cid = pCid->Des();
+        cid.Num( data.iCid );
+        if( data.iCid2 != KErrNotFound )
+            {
+            cid.AppendNum( data.iCid2 );
+            }
+        if( data.iHasCidPostfix )
+            {
+            cid.Append( KSenCidPostfix );
+            }
+        TLSLOG_FORMAT(( KSenHostletConnectionLogChannelBase + iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("- txn '%d', progress '%d', isIncoming '%d', cid '%S',  '"), data.iTxnId, data.iProgress, data.iIsIncoming, &cid ));
+        TRAP_IGNORE( iFileProgressObserver->TransferProgress( data.iTxnId, data.iIsIncoming, KNullDesC8, cid, data.iProgress );	)
+        CleanupStack::PopAndDestroy( pCid );
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT(( KSenHostletConnectionLogChannelBase + iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("- MAJOR: iFileProgressProperty.Get(propertyValue) failed: %d"), getPropertyCode ));
+        }
+#endif // _SENDEBUG 
+    }
+    
+TInt CSenFileProgressObserver::RunError( TInt aError )
+	{
+	TLSLOG_FORMAT(( KSenHostletConnectionLogChannelBase + iConnectionID, KSenServiceConnectionStatusLogLevel, _L8("CSenFileProgressObserver::RunError:[%d]"), aError ));
+	// return aError;
+	return KErrNone; // ignore the error, this is conscious decision.
+	}
+
+
+// ------------------------------------------------------------------------------------------------------------
+    
+    
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostletconnection/src/senregistrationtimer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    not a public class       
+*
+*/
+
+
+
+
+// INCLUDES
+#include "senregistrationtimer.h"
+
+// CLASS DECLARATION
+CSenRegistrationTimer* CSenRegistrationTimer::NewL( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs )
+    {
+    CSenRegistrationTimer* pNew = CSenRegistrationTimer::NewLC( aActor, aRegistrationTimeoutInSecs );
+    CleanupStack::Pop( pNew );
+    return pNew;
+    }
+
+CSenRegistrationTimer* CSenRegistrationTimer::NewLC( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs )
+    {
+    CSenRegistrationTimer* pNew = new (ELeave)CSenRegistrationTimer( aActor, aRegistrationTimeoutInSecs );
+    CleanupStack::PushL( pNew );
+    pNew->ConstructL();
+    return pNew;
+    }
+     
+CSenRegistrationTimer::CSenRegistrationTimer( MSenRegistrationActor& aActor, TInt aRegistrationTimeoutInSecs )
+//:CTimer( EPriorityNormal ), iActor(aActor), iRegistrationTimeoutInSecs( aRegistrationTimeoutInSecs ), iRegisterFilesObserver(EFalse)
+:CActive( EPriorityNormal ), iActor(aActor), iRegistrationTimeoutInSecs( aRegistrationTimeoutInSecs ), iRegisterFilesObserver(EFalse)
+    {
+    }     
+
+void CSenRegistrationTimer::ConstructL ()
+	{
+	User::LeaveIfError (iTimer.CreateLocal());	
+	CActiveScheduler::Add(this);	
+	}
+
+          
+CSenRegistrationTimer::~CSenRegistrationTimer()
+    {
+	CActive::Cancel();
+	iTimer.Close();	
+    }
+
+void CSenRegistrationTimer::IssueRegistrations( TBool aRegisterFilesObserver )
+    {
+    iRegisterFilesObserver = aRegisterFilesObserver;
+    // iRegisterMobilityObserver = aRegisterMobilityObserver;
+    // iRegister<some>Observer = aRegister<some>Observer ;
+
+    TInt interval( KErrNone );
+	if( iRegistrationTimeoutInSecs > 0 )
+		{
+		interval = iRegistrationTimeoutInSecs * 1000 * 1000;
+		}
+	else // use the timeout value of 1 second (default)
+		{
+		interval = KSenDefaultRegistrationTimeout * 1000 * 1000;
+		}
+	if (!IsActive())
+        {
+        iTimer.After( iStatus, interval );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSenRegistrationTimer::DoCancel
+// -----------------------------------------------------------------------------
+//	
+void CSenRegistrationTimer::DoCancel ()
+    {
+    iRegisterFilesObserver = EFalse;
+	iTimer.Cancel();
+    }
+
+void CSenRegistrationTimer::RunL()
+    {
+    if (iStatus.Int() == KErrNone)
+    	{
+    	if( iRegisterFilesObserver )
+        	{
+        	/* TInt err = */ 
+        	TRAP_IGNORE( iActor.RegisterAndSubscribeFileProgressObserversL(); )
+    		// err = 0; // not used in release builds
+        	}
+        // if ( iRegisterMobilityObserver  ) {} ...
+        // if ( iRegister<some>Observer  ) {} ...
+    	}
+    }
+
+//virtual TInt CSenRegistrationTimer::RunError(TInt aError) { ; }
+//void CSenRegistrationTimer::DoCancel() { ; }    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/data/101f974c.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F974C;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of the WSF transport plug-in interface
+            interface_uid = 0x101F9749;
+            implementations = 
+                {
+                // Info for HTTP Channel Transport plugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C4D;
+                    version_no         = 1;
+                    display_name       = "Sen Hostlet Transport plug-in";
+                    default_data       = "com.nokia.wsf.transport.plugin.hostlet";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/data/2000039e.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x2000039E;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of the WSF transport plug-in interface
+            interface_uid = 0x10274C72;
+            implementations = 
+                {
+                // Info for HTTP Channel Transport plugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x2000039F;
+                    version_no         = 1;
+                    display_name       = "Sen Hostlet Transport plug-in";
+                    default_data       = "com.nokia.wsf.transport.plugin.hostlet";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wshostlettransportplugin    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wshostlettransportplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wshostlettransportplugin.iby)
+
+PRJ_MMPFILES
+senhostlettransportplugin.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/group/senhostlettransportplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senhostlettransportplugin    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenHostletTransportPlugin.DLL
+UID 0x10009D8D 0x2000039E
+#else
+TARGET wsHostletTransportPlugin.DLL
+UID 0x10009D8D 0x101F974C
+#endif
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+// ECom Dll recognition UID followed by the unique UID for this dll
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  2000039e.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenHostletTransportPlugin.rsc
+#endif
+
+#else
+START RESOURCE  101F974C.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsHostletTransportPlugin.rsc
+#endif
+
+#endif
+END
+
+SOURCEPATH      ../src
+SOURCE          senhostlettransportpluginmain.cpp
+SOURCE          senhostlettransportpluginproxy.cpp
+SOURCE          senhostlettransportplugin.cpp
+
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsframework/inc         // internal: MSenTransport.h, SenProvider.h, SenProvider.inl
+USERINCLUDE     ../../wsprovider/inc          // internal: MSenHostletRequest.h, MSenHostletResponse.h
+USERINCLUDE     ../../wsutils/inc             // internal: SenDebug.h
+USERINCLUDE     ../../wslogger/inc            // internal: SenLogger.h
+USERINCLUDE     ../../wsidentitymanager/inc   // MSenIdentityManager.h
+
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+
+LANG            SC
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY         ecom.lib
+LIBRARY         euser.lib
+// LIBRARY         SenProvider.lib
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenUtils.lib     // CSenIdentifier
+LIBRARY         SenLogger.lib  
+LIBRARY         SenFramework.lib // CSenSyncRequester
+
+#ifdef EABI
+    LIBRARY         SenServDesc.lib // for some reason WINSCW, and other compilers do not requires this lib
+#endif // EABI
+#else
+LIBRARY         wsUtils.lib     // CSenIdentifier
+LIBRARY         wsLogger.lib  
+LIBRARY         wsFramework.lib // CSenSyncRequester
+
+#ifdef EABI
+    LIBRARY         wsservDesc.lib // for some reason WINSCW, and other compilers do not requires this lib
+#endif // EABI
+
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/inc/senhostlettransportplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_HOSTLET_TRANSPORT_PLUGIN
+#define SEN_HOSTLET_TRANSPORT_PLUGIN
+
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32std.h>
+
+#include <MSenProperties.h>
+
+#include "sentransport.h"
+#include "senpointermap.h" // from Utils\inc
+
+
+// CONSTANTS
+_LIT8(KSenHostletTransportUriScheme, "hostlet");
+
+// FORWARD DECLARE
+class MSenProvider;
+class CSenProvider;
+class CSenActiveHostletRequest;
+class CSenHostletRequest;
+class CSenHostletResponse;
+class CSenSyncRequester;
+class CSenLayeredXmlProperties;
+class CSenTransportProperties;
+class MSenTransportContext;
+
+// TYPEDEFS
+typedef RSenPointerMap<MSenRemoteServiceConsumer, TInt> RConsumerMap;
+typedef RSenPointerMap<MSenServiceSession, TInt> RSessionMap;
+
+typedef RSenPointerMap<CSenActiveHostletRequest, TInt> RLocalRequestMap;
+
+
+
+class CSenHostletTransportPlugin : public CSenTransport
+    {
+    public: 
+
+        // Constructors:
+        static CSenHostletTransportPlugin* NewL(CSenTransportContext* apCtx);
+        static CSenHostletTransportPlugin* NewLC(CSenTransportContext* apCtx);
+
+        // Destructor:
+        virtual ~CSenHostletTransportPlugin();
+
+         // from MSenTransport
+        virtual TInt SubmitL(const TDesC8& aEndpoint,
+                             const TDesC8& aMessage,
+                             const TDesC8& aTransportProperties,
+                             HBufC8*& aResponse,
+                             MSenRemoteServiceConsumer& aConsumer);
+
+        virtual TInt SendL(const TDesC8& aEndpoint,
+                           const TDesC8& aMessage,
+                           const TDesC8& aTransportProperties,
+                           MSenServiceSession& aReplyTo,
+                           MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                           TInt& aTxnId);
+
+        virtual TInt SetPropertiesL(const TDesC8& aProperties, 
+                                    MSenLayeredProperties::TSenPropertiesLayer aTargetLayer,
+									MSenRemoteServiceConsumer* aConsumer);
+        virtual TInt PropertiesL(HBufC8*& aProperties);
+        virtual TInt CompleteTransaction(const TInt aTxnId, const TInt aStatus = KErrNone);
+        virtual TInt CancelTransaction(const TInt aTxnId);
+        virtual TPtrC8 CSenHostletTransportPlugin::UriSchemeL();
+        
+        virtual MSenProperties& PropertiesL();
+        
+        //RConsumerMap ConsumerMap();
+        //RSessionMap SessionMap();
+
+    private:
+        void ConstructL();
+        CSenHostletTransportPlugin(CSenTransportContext* apCtx);
+
+        // Helper, to locally "proxy" the provider, which was invoked *last* time
+        MSenProvider& ProviderL(const TDesC8& aEndpoint);
+
+    private: // member data
+        CSenSyncRequester* ipRequester;
+        CSenProvider* iInvokedProvider;
+        TInt iStatusCode ;
+        TInt iTransactionID;
+        //RConsumerMap iConsumerMap; // values owned (TxnIds), keys not (consumers)
+        //RSessionMap iSessionMap;   // values NOT owned (TxnIds), neither keys (sessions)
+        RLocalRequestMap iRequestMap;
+        CSenLayeredXmlProperties* ipLayeredXmlProperties;
+    } ;
+
+class CSenActiveHostletRequest : public CActive
+    {
+    friend class CSenHostletTransportPlugin;
+
+    
+
+    public:
+
+        enum TLocalRequestState
+            {
+            EInvokeService = 1,
+            ECompleteTransaction
+            };
+
+        // Standard 2 phased constructor
+        static CSenActiveHostletRequest* NewLC(const TDesC8& aEndpoint,
+                                               MSenServiceSession& aReplyTo,
+                                               MSenRemoteServiceConsumer& aConsumer,
+                                               TInt aTxnId,
+                                               RLocalRequestMap& aRequestMap,
+                                               MSenTransport& aParent,
+                                               MSenTransportContext& aParentCtx);
+
+        // C++ destructor
+        virtual ~CSenActiveHostletRequest();
+
+        MSenServiceSession& Session() const;
+        MSenRemoteServiceConsumer& Consumer() const;
+        TInt TxnId() const;
+        // TPtrC8 TransportProperties() const;
+        RLocalRequestMap& RequestMap();
+        
+        // This method is called when txn is ready to be completed
+        // Note that this sets this AO in active state(!)
+        TInt Complete(TRequestStatus*& aStatus, TInt aCompletionCode = KErrNone); 
+        
+        virtual void RunL(); 
+        virtual void DoCancel();
+        virtual TInt RunError(TInt aError);
+
+    private:
+        // 2nd phase constructor
+        void ConstructL();
+
+        // C++ constructor
+        CSenActiveHostletRequest(const TDesC8& aEndpoint,
+                                 MSenServiceSession& aReplyTo,
+                                 MSenRemoteServiceConsumer& aConsumer,
+                                 TInt aTxnId,
+                                 RLocalRequestMap& aRequestMap,
+                                 MSenTransport& aParent,
+                                 MSenTransportContext& aParentCtx);
+
+        CSenChunk* CSenActiveHostletRequest::FindChunkL(const TInt aTxnId, TInt& aIndex) ;                      
+
+        CSenTransportProperties* NewPropertiesByTypeL( MSenProperties::TSenPropertiesClassType aType, const TDesC8& aPropertiesAsXml );
+
+    private: // Data
+        const TDesC8&               iEndpoint;
+        TInt                        iCompletionCode;
+        MSenServiceSession&         iReplyTo;
+        MSenRemoteServiceConsumer&  iConsumer;
+        TInt                        iTxnId;
+        RLocalRequestMap&           iRequestMap;
+        MSenTransport&              iParent;
+        MSenTransportContext&       iParentContext;
+        TPtrC8                      iMessage;
+        TPtrC8                      iProperties; 
+        
+    };
+
+#endif // SEN_HOSTLET_TRANSPORT_PLUGIN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/rom/wshostlettransportplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSHOSTLETTRANSPORTPLUGIN_IBY__
+#define __WSHOSTLETTRANSPORTPLUGIN_IBY__
+
+//SenHostletTransportPlugin
+ECOM_PLUGIN(SenHostletTransportPlugin.DLL, 2000039E.rsc)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/src/senhostlettransportplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,764 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "senhostlettransportplugin.h"
+
+#include <SenServiceConnection.h>   // errorcode constants, like KErrSenNoEndpoint
+
+#include "msenprovider.h"
+#include "senhostletrequest.h"      // internal Provider\inc
+#include "senhostletresponse.h"     // internal Provider\inc
+
+#include "senidentifier.h"          // internal Utils\inc
+#include "senidentifier.h"          // internal Utils\inc
+#include "sendebug.h"               // internal Utils\inc - debugging MACROs
+
+#include "senprovider.h"            // internal Framework\inc
+#include "sensyncrequester.h"       // internal Framework\inc
+#include <SenTransportProperties.h> // internal Framework\inc
+#include "senservicesession.h"      // internal Framework\inc
+#include "msentransport.h"          // internal Framework\inc
+#include "msenremotehostlet.h"      // internal Framework\inc
+
+#include "msencoreservicemanager.h" // internal: Core\inc
+
+#include "senchunk.h"               // Internal Utils\inc
+#include "senlogger.h"              // internal Logger\inc - logging MACROs
+
+#include "msenservicesession.h"
+#include "msenremoteserviceconsumer.h"
+
+#include "senlayeredtransportproperties.h"
+
+
+#include "senvtcptransportproperties.h"
+#include "SenHttpTransportProperties.h"
+
+namespace
+    {
+    }
+
+
+CSenHostletTransportPlugin* CSenHostletTransportPlugin::NewL(CSenTransportContext* apCtx)
+    {
+    CSenHostletTransportPlugin* pNew = NewLC(apCtx);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenHostletTransportPlugin* CSenHostletTransportPlugin::NewLC(CSenTransportContext* apCtx)
+    {
+
+    const CSenServiceSession* pSession = apCtx->GetSession();
+    if( pSession == NULL ||  pSession->Hostlet() == NULL) 
+        {
+        User::Leave( KErrSenHostNotAvailable );
+        }
+    CSenHostletTransportPlugin* pNew = new (ELeave) CSenHostletTransportPlugin(apCtx);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenHostletTransportPlugin::CSenHostletTransportPlugin(CSenTransportContext* apCtx)
+:   CSenTransport(apCtx),
+	ipRequester(NULL),
+    iInvokedProvider(NULL),
+    iStatusCode(0),
+    iTransactionID(0),
+//    iConsumerMap(EFalse, ETrue), 
+//    iSessionMap(EFalse, EFalse), // iConsumerMap deletes the txnIds (using same "new reserved" TInt here!)
+    iRequestMap(EFalse, ETrue), // CSenActiveHostletRequest (keys) objects are NOT owned!
+    ipLayeredXmlProperties(NULL)
+    {
+    }
+
+CSenHostletTransportPlugin::~CSenHostletTransportPlugin()
+    {
+    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "Log file closed.");
+    TLSLOG_CLOSE( KHostletTransportLogChannel );
+
+    TInt count( iRequestMap.Count() );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CSenActiveHostletRequest* pReq = iRequestMap.KeyAt(i);
+        if( pReq )
+            {
+            pReq->Deque();
+            }
+        }
+    iRequestMap.Reset(); 
+    delete ipRequester;
+    delete iInvokedProvider;
+    delete ipLayeredXmlProperties;
+    }
+
+void CSenHostletTransportPlugin::ConstructL()
+    {
+    // Open connection to the file logger server
+    TLSLOG_OPEN(KHostletTransportLogChannel, KHostletTransportLogLevel, KLogDir, KLogFile);
+    
+    //LOG_CONNECT;
+    // LOG_CREATELOG((KLogDir, KLogFile, EFileLoggingModeOverwrite));
+    //TLSLOG_L(KHostletTransportLogChannel, KHostletTransportLogLevel,  "CSenHostletTransportPlugin::ConstructL(): log file opened.");
+    MSenCoreServiceManager& core = Context().GetCoreL();
+    ipRequester = CSenSyncRequester::NewL(*this, core);
+    ipLayeredXmlProperties = CSenLayeredTransportProperties::NewL();    
+    }
+
+TInt CSenHostletTransportPlugin::SubmitL(const TDesC8& aEndpoint,
+                                       const TDesC8& aMessage,
+                                       const TDesC8& aTransportProperties,
+                                       HBufC8*& apResponse,
+                                       MSenRemoteServiceConsumer& /*aConsumer*/)
+    {
+    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "CSenHostletTransportPlugin::SubmitL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "- No endpoint!");
+        return KErrSenNoEndpoint; // from SenServiceConnection.h (public API)
+        }
+    
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+//    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "- Message:");
+//    TLSLOG_ALL((KHostletTransportLogChannel, KHostletTransportLogLevel,  aMessage ));
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMaxLogLevel, _L8("- Message: %S"), &aMessage));
+
+    TInt leaveCode(KErrNone);
+    TInt statusCode(KErrNone);
+
+    /*
+    statusCode = ipRequester->SubmitL(aEndpoint,            // endpoint
+                                      aMessage,             // request body
+                                      aTransportProperties, // request props
+                                      apResponse);
+    */
+    
+    TRAP( leaveCode, statusCode = ipRequester->SubmitL(aEndpoint,            // endpoint
+                                                       aMessage,             // request body
+                                                       aTransportProperties, // request props
+                                                       apResponse); )         // response body
+    
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L8("CSenHostletTransportPlugin::SubmitL returned: (%d)"), statusCode));
+
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L8("CSenHostletTransportPlugin::SubmitL leaved: (%d)"), leaveCode));
+        if(statusCode==KErrNone)
+            {
+            statusCode = leaveCode;
+            }
+        }
+    else // did not leave
+        {
+        if(!apResponse)
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "After calling CSenHostletTransportPlugin::SubmitL => response==NULL => leaving!");
+            User::Leave(KErrCorrupt);
+            }
+        TLSLOG_L(KHostletTransportLogChannel, KMaxLogLevel,  "CSenHostletTransportPlugin::SubmitL response:");
+//        TLSLOG_ALL((KHostletTransportLogChannel, KHostletTransportLogLevel, *apResponse));
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KMaxLogLevel, _L8("- Response: %S"), apResponse));
+        }
+                                        
+    return statusCode;
+    }
+
+/*
+TInt CSenHostletTransportPlugin::SendL(const TDesC8& aEndpoint,
+                                     const TDesC8& aMessage,
+                                     const TDesC8& aTransportProperties,
+                                     MSenServiceSession& aReplyTo,
+                                     MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                                     TInt& aTxnId)
+    {
+    TLSLOG_L(KHostletTransportLogChannel, KHostletTransportLogLevel,  "CSenHostletTransportPlugin::SendL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KHostletTransportLogLevel,  "- No endpoint!");
+        return KErrSenNoEndpoint; // from SenServiceConnection.h (public API)
+        }
+    
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KHostletTransportLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+    TLSLOG_L(KHostletTransportLogChannel, KHostletTransportLogLevel,  "- Message:");
+//    TLSLOG_ALL((KHostletTransportLogChannel, KHostletTransportLogLevel,  aMessage ));
+    
+//    MSenCoreServiceManager& core = Context().GetCoreL();
+    //const CSenServiceSession* pSession = Context().GetSession();
+    //if( pSession == NULL ||  pSession->Hostlet() == NULL) 
+
+    // NOTE: this solution requires following line in CSenClientSession::SendMsgL:
+///    iAllowShowDialogCount++;
+///    TInt transactionId( KErrNotFound );
+///    pSenChunk->ChunkHeader().SetTransactionId( transactionId ); 
+///    TInt sendRetCode(KErrNone);
+
+
+    if(aReplyTo.Hostlet() == NULL) 
+        {
+        User::Leave( KErrSenHostNotAvailable );
+        }
+        
+    CSenChunk* pChunk = NULL;
+    TInt retVal = aConsumer.ChunkByTxnIdL(aTxnId, pChunk);
+    if ( retVal >= KErrNone )
+        {
+        iTransactionID++;
+        TInt* txnID = new (ELeave) TInt(iTransactionID);
+        aTxnId = iTransactionID;
+        pChunk->ChunkHeader().SetTransactionId(aTxnId);
+
+        MSenRemoteHostlet* pHostlet = aReplyTo.Hostlet();
+        TInt retVal = pHostlet->ProcessRequestFromConsumerL(aMessage, aTxnId, aConsumer);
+
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KHostletTransportLogLevel, _L("- ProcessRequestFromConsumerL returned: %d"), retVal ));
+        // No leave occurred
+
+        if( retVal == KErrNone )
+            {
+            TInt retVal = iSessionMap.Append(&aReplyTo, txnID);
+            if( retVal==KErrNone )
+                {
+                retVal = iConsumerMap.Append(&aConsumer, txnID);
+                if(retVal!=KErrNone)
+                    {
+                    TLSLOG_FORMAT((KHostletTransportLogChannel, KHostletTransportLogLevel, 
+                        _L("- iConsumerMap.Append failed: %d"), retVal ));
+
+                    // Last entry to iSessionMap must be removed
+                    TInt removeRetVal = iSessionMap.Remove(*txnID);
+#ifdef _SENDEBUG
+                    if(removeRetVal==KErrNotFound)
+                        {
+                        TLSLOG_FORMAT((KHostletTransportLogChannel, KHostletTransportLogLevel, 
+                            _L("- MAJOR: Could not remove session by txnId(%d)"), *txnID));
+                        }
+#endif // _SENDEBUG
+                    removeRetVal = 0; // not used in release builds
+                    }
+                }
+            else
+                {
+                TLSLOG_FORMAT((KHostletTransportLogChannel, KHostletTransportLogLevel, _L("- FATAL: iConsumerMap.Append failed: %d"), retVal ));
+                }
+            }
+        }
+
+    return retVal;
+    }
+*/
+
+/*
+RConsumerMap CSenHostletTransportPlugin::ConsumerMap()
+    {
+    return iConsumerMap;    
+    
+    }
+RSessionMap CSenHostletTransportPlugin::SessionMap()
+    {
+    return iSessionMap;
+    }
+*/
+
+TInt CSenHostletTransportPlugin::SendL(const TDesC8& aEndpoint,
+                                     const TDesC8& aMessage,
+                                     const TDesC8& /* aTransportProperties */,
+                                     MSenServiceSession& aReplyTo,
+                                     MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                                     TInt& aTxnId)
+    {
+    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "CSenHostletTransportPlugin::SendL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "- No endpoint!");
+        return KErrSenNoEndpoint; // from SenServiceConnection.h (public API)
+        }
+
+    if(aReplyTo.Hostlet() == NULL) 
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "- Failure: no Hostlet for the session: leave with KErrSenHostNotAvailable");
+        return KErrSenHostNotAvailable;
+        }
+    
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+//    TLSLOG_L(KHostletTransportLogChannel, KHostletTransportLogLevel,  "- Message:");
+//    TLSLOG_ALL((KHostletTransportLogChannel, KHostletTransportLogLevel, aMessage));
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L8("- Message: %S"), &aMessage));
+
+    
+    iTransactionID++;
+    TInt* txnID = new (ELeave) TInt(iTransactionID);
+    aTxnId = iTransactionID;
+
+//    MSenCoreServiceManager& core = Context().GetCoreL();
+    CSenActiveHostletRequest* pRequest = CSenActiveHostletRequest::NewLC( aEndpoint,
+                                                                          //aMessage, 
+                                                                          //aTransportProperties,
+                                                                          aReplyTo,
+                                                                          aConsumer,
+                                                                          *txnID,
+                                                                          iRequestMap,
+                                                                          *this,
+                                                                          *ipCtx );
+
+    TInt retVal = iRequestMap.Append(pRequest, txnID);
+
+    if(retVal==KErrNone)
+        {
+        CleanupStack::Pop(pRequest);
+        if(!pRequest->IsActive())
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "- Activating request / async call to the provider.");
+            pRequest->SetActive();
+            }
+        pRequest->iStatus = KRequestPending;
+        TRequestStatus* status = &pRequest->iStatus;
+        User::RequestComplete( status, CSenActiveHostletRequest::EInvokeService ); //iTransactionID );
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, _L8("- Request status: %d"), pRequest->iStatus.Int()));
+        }
+    else
+        {
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("- FATAL: iRequestMap.Append failed: %d"), retVal ));
+        CleanupStack::PopAndDestroy(pRequest); // orphanized request
+        }
+    return retVal; // status code
+    }
+
+TInt CSenHostletTransportPlugin::SetPropertiesL(const TDesC8& /* aProperties */,
+                                                MSenLayeredProperties::TSenPropertiesLayer /* aTargetLayer */,
+												MSenRemoteServiceConsumer* /*aConsumer*/)
+    {
+    return KErrNotSupported; // not implemented
+    }
+
+TInt CSenHostletTransportPlugin::PropertiesL(HBufC8*& /* aProperties */)
+    {
+    return KErrNotSupported; // not implemented
+    }
+
+// ASYNC
+TInt CSenHostletTransportPlugin::CompleteTransaction(const TInt aTxnId,
+                                                     const TInt aCompletionCode)
+    {
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, 
+        _L("CSenHostletTransportPlugin::CompleteTransaction(%d, %d)"), aTxnId, aCompletionCode));
+
+    TInt index = iRequestMap.FindValue(aTxnId);
+    
+    // complete the request (transaction)
+    if(index != KErrNotFound)
+        {
+        // Consumer found
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, 
+            _L("- Pending transaction at index %d found. Completing it."),
+            index));
+
+        CSenActiveHostletRequest* pRequest = iRequestMap.KeyAt(index);
+        TRequestStatus status;
+        TRequestStatus* pStatus = &status;
+        index = pRequest->Complete(pStatus, aCompletionCode);
+        TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, _L("- Request.Complete() returned: %d"), index));
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "- Cannot find pending transaction with given ID.");
+        }
+#endif
+    return index;
+    }
+
+
+TInt CSenHostletTransportPlugin::CancelTransaction( const TInt aTxnId )
+    {
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("CSenHostletTransportPlugin::CancelTransaction(%d)"), aTxnId));
+    return CompleteTransaction( aTxnId, KErrSenCancelled );
+    }
+
+TPtrC8 CSenHostletTransportPlugin::UriSchemeL()
+    {
+    return KSenHostletTransportUriScheme();
+    }
+    
+MSenProperties& CSenHostletTransportPlugin::PropertiesL()
+    {
+    return *ipLayeredXmlProperties;
+    }
+
+
+// ------------------------------------------------------------------------------- //
+
+CSenActiveHostletRequest* CSenActiveHostletRequest::NewLC(const TDesC8& aEndpoint,
+                                          MSenServiceSession& aReplyTo,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          TInt aTxnId,
+                                          RLocalRequestMap& aRequestMap,
+                                          MSenTransport& aParent,
+                                          MSenTransportContext& aParentCtx)
+    {
+    CSenActiveHostletRequest* pNew = new (ELeave) CSenActiveHostletRequest(aEndpoint, aReplyTo, aConsumer, aTxnId, aRequestMap, aParent, aParentCtx);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+
+CSenActiveHostletRequest::CSenActiveHostletRequest(const TDesC8& aEndpoint,
+                                                   MSenServiceSession& aReplyTo,
+                                                   MSenRemoteServiceConsumer& aConsumer,
+                                                   TInt aTxnId,
+                                                   RLocalRequestMap& aRequestMap,
+                                                   MSenTransport& aParent,
+                                                   MSenTransportContext& aParentContext)
+:   CActive(EPriorityStandard),
+    iEndpoint(aEndpoint),
+    iCompletionCode(KErrNone),
+    iReplyTo(aReplyTo),
+    iConsumer(aConsumer),
+    iTxnId(aTxnId),
+    iRequestMap(aRequestMap),
+    iParent(aParent),
+    iParentContext(aParentContext),
+    iMessage(KNullDesC8),
+    iProperties(KNullDesC8)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+    
+CSenActiveHostletRequest::~CSenActiveHostletRequest()
+    {
+    if ( IsActive() )
+        {
+        Cancel(); // calls CSenActiveHostletRequest::DoCancel()
+        }
+    else
+        {
+        RequestMap().Remove(TxnId());
+        }
+    }
+
+// returns chunk index or an error
+CSenChunk* CSenActiveHostletRequest::FindChunkL(const TInt aTxnId, TInt& aRetVal)
+    {
+    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "CSenActiveHostletRequest::DataFromChunkL");
+    CSenChunk* pChunk = NULL;
+   
+    // This lookup needs to be performed at every state of this AO,
+    //  since the transaction (chunk) might have been removed..
+    aRetVal = iConsumer.ChunkByTxnIdL(aTxnId, pChunk);
+    
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, _L("- ChunkByTxnIdL() returned: %d"), aRetVal));
+  
+    if( aRetVal == KErrNone )
+        {
+        if ( pChunk )
+            {
+            iMessage.Set(KNullDesC8);
+            iProperties.Set(KNullDesC8);
+            TInt error(KErrNone);
+            if (pChunk->ChunkHeader().PropertiesType() == MSenProperties::ENotInUse )
+                {
+                error = pChunk->DescFromChunk(iMessage);
+                }
+            else
+                {
+                error = pChunk->DescsFromChunk(iMessage, iProperties);
+                }
+                
+            if( error )
+                {
+                aRetVal = error;
+                iMessage.Set(KNullDesC8);
+                iProperties.Set(KNullDesC8);
+                }
+            }
+        else
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "- Chunk from consumer == NULL, eventhough getter returned KErrNone(!)");
+            // No chunk, eventhough KErrNone was returned, should NEVER happen
+            // ==> report "internal error"
+            aRetVal = KErrSenInternal; // error code is from SenServiceConnection.h
+            }
+        }
+    return pChunk;        
+    }
+    
+TInt CSenActiveHostletRequest::RunError(TInt aError)
+    {
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("CSenActiveHostletRequest::RunError(%d)"), aError));
+    delete this;
+    return KErrNone;
+    }
+
+CSenTransportProperties* CSenActiveHostletRequest::NewPropertiesByTypeL( MSenProperties::TSenPropertiesClassType aType, const TDesC8& aPropertiesAsXml )
+    {
+    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "CSenActiveHostletRequest::NewPropertiesByTypeL - begin");    
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L(" - aProperties: '%S'"), &aPropertiesAsXml ));
+
+    CSenTransportProperties* pProps = NULL;
+    CSenXmlReader& reader = *(iParentContext.GetCoreL().XMLReader());
+
+    // Check whether the response carries properties and allocate properties object, if it does
+    switch ( aType )
+        {
+        case MSenProperties::ENotInUse:
+            {
+            // pProps = NULL;
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "Properties type: MSenProperties::ENotInUse");    
+            }
+        break;
+
+        case MSenProperties::ESenHttpTransportProperties:
+            {
+            pProps = CSenHttpTransportProperties::NewL( iProperties, reader );
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "Properties type: MSenProperties::ESenHttpTransportProperties");    
+            }
+        break;
+
+        case MSenProperties::ESenVtcpTransportProperties:
+            {
+            pProps = CSenVtcpTransportProperties::NewL( iProperties, reader );
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "Properties type: MSenProperties::ESenVtcpTransportProperties");    
+            }
+        break;
+
+        case MSenProperties::ESenTransportProperties:
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "Properties type: MSenProperties::ESenTransportProperties");    
+            pProps = CSenTransportProperties::NewL( iProperties, reader );    
+            }
+        break;
+        
+        default:
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "Properties type is unknown, defaulting to MSenProperties::ESenTransportProperties");
+            pProps = CSenTransportProperties::NewL( iProperties, reader );    
+            }
+        break;
+        } 
+    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "CSenActiveHostletRequest::NewPropertiesByTypeL - end");    
+    return pProps;           
+    }
+
+void CSenActiveHostletRequest::RunL() 
+    {
+    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("CSenActiveHostletRequest::RunL(), status: %d"), iStatus.Int()));
+    TInt leaveCode(KErrNone);
+    TInt retVal(KErrNone); // for UDEB, logging
+    CSenChunk* pChunk = NULL;
+    switch(iStatus.Int())
+        {
+        
+        case EInvokeService:
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "HostletTransport req AO::RunL -- EInvokeService -- ");
+            MSenRemoteHostlet* pHostlet = iReplyTo.Hostlet();
+            if( pHostlet )
+                {
+                TRAP( leaveCode, pChunk = FindChunkL(iTxnId, retVal) );
+                MSenProperties::TSenPropertiesClassType type = pChunk->ChunkHeader().PropertiesType();
+
+                if ( leaveCode != KErrNone ) 
+                    {
+                    retVal = leaveCode;
+                    }
+                    
+                if ( retVal == KErrNone )
+                    {
+//                    CSenTransportProperties* pProps = NewPropertiesByTypeL( type, iProperties );
+//                    if( pProps )
+//                        {
+//                        CleanupStack::PushL( pProps );
+//                        retVal = iReplyTo.SendToHostletL( *pHostlet, iMessage, iTxnId, iConsumer, pProps );
+//                        CleanupStack::PopAndDestroy( pProps );
+//                        }
+//                    else // no properties in this request
+//                        {
+                        retVal = iReplyTo.SendToHostletL( *pHostlet, iMessage, iTxnId, iConsumer );
+//                        }
+                    TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, _L8("- HostletTransport req AO::RunL: ProcessRequestFromConsumerL returned: %d "), retVal));
+                    }
+                }
+            }
+            break;
+
+        case ECompleteTransaction:
+            {
+            TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "HostletTransport req AO::RunL -- ECompleteTransaction -- ");
+            
+            // This lookup needs to be performed (again), since the transaction (chunk) might have been removed..
+            TRAP( leaveCode, pChunk = FindChunkL(iTxnId, retVal) );
+            TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("- FindChunkL() returned: %d [%d]"), retVal, leaveCode));
+            if( leaveCode != KErrNone ) 
+                {
+                retVal = leaveCode;
+                }
+            
+            if( retVal == KErrNone )
+                {
+                // It is VERY important to change the chunk's (message's) direction to INBOUND. Among other things,
+                // it will indicate that the descriptor(s) passed to session & consumer -- msg & props -- are in
+                // chunk (no need to delete a copy from heap, etc)
+                pChunk->ChunkHeader().SetMessageDirection(MSenMessage::EInbound);
+
+                MSenProperties::TSenPropertiesClassType type = pChunk->ChunkHeader().PropertiesType();
+                
+                HBufC8* pMessage = (HBufC8*)&iMessage; // This is OK, since we have set the message direction to INBOUND, and message will NOT be de-allocated(!),
+                                                       // Neither will it be copied to its own address (it is already in the chunk)
+                                                       // NOTE(!): Remote consumer checks chunk header's message direction and does not delete the desc behind this pointer
+                                                       // if the direction is already "inbound"
+                                                       
+                CSenTransportProperties* pProps = NewPropertiesByTypeL( type, iProperties );
+
+                if( iCompletionCode < KErrNone ) // aCompletionCode == ERROR
+                    {
+                    if ( pProps )
+                        {
+                        CleanupStack::PushL( pProps );
+                        TRAP( leaveCode, retVal = iReplyTo.SendErrorToConsumerL(iCompletionCode, pMessage, iTxnId, iConsumer, pProps); )
+                        CleanupStack::PopAndDestroy( pProps );
+                        }
+                    else
+                        {
+                        TRAP( leaveCode, retVal = iReplyTo.SendErrorToConsumerL(iCompletionCode, pMessage, iTxnId, iConsumer); )
+                        }
+                    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("- SendErrorToConsumerL() returned: %d [%d]"), retVal, leaveCode));
+                    }
+                else // completionCode == KErrNone (all is fine)
+                    {
+                    if ( pProps )
+                        {
+                        CleanupStack::PushL( pProps );
+                        TRAP( leaveCode, retVal = iReplyTo.SendToConsumerL(pMessage, iTxnId, iConsumer, pProps); )
+                        CleanupStack::PopAndDestroy( pProps );
+                        }
+                    else
+                        {
+                        TRAP( leaveCode, retVal = iReplyTo.SendToConsumerL(pMessage, iTxnId, iConsumer); )
+                        }
+                    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L("- SendToConsumerL() returned: %d [%d]"), retVal, leaveCode));
+                    }
+                if ( retVal == KErrNone && leaveCode != KErrNone) 
+                    {
+                    retVal = leaveCode;
+                    }
+
+                MSenRemoteHostlet* pHostlet = iReplyTo.Hostlet();
+                if( pHostlet )
+                    {
+                    TRAP( leaveCode, retVal = pHostlet->OnServiceCompleteL(iTxnId, retVal, KNullDesC8); ) 
+                    TLSLOG_FORMAT((KHostletTransportLogChannel, KMinLogLevel, _L8("- OnServiceCompleteL returned: %d [%d]"), retVal, leaveCode));
+                    retVal = 0; // not used in release builds
+                    }
+#ifdef _SENDEBUG                        
+                else 
+                    {
+                    TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "- Remote Hostlet == NULL");
+                    }
+#endif                        
+                }
+                
+            if(retVal == KErrNone)
+                {
+                retVal = RequestMap().Remove(iTxnId); // deletes the request (transaction)
+                TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, _L("- Remove() returned: %d"), retVal));
+                }
+            // de-allocate this in EVERY CASE
+            delete this; // (*) => this MUST ALWAYS BE PERFORMED!
+            }
+            break;
+            
+        default:
+            {
+            TLSLOG_FORMAT((KHostletTransportLogChannel, KNormalLogLevel, _L("- HostletTransport req AO::RunL: Unknown request: %d"), iStatus.Int()));
+            }
+            // unknown
+            break;
+        }
+    TInt unused = leaveCode; leaveCode = unused; // not used in release builds
+    unused = retVal; retVal = unused;       // not used in release builds
+    } 
+
+TInt CSenActiveHostletRequest::Complete(TRequestStatus*& aStatus, TInt aCompletionCode) 
+    {
+    iCompletionCode = aCompletionCode;
+    if(!IsActive())
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel,  "CSenActiveHostletRequest::Complete()");
+        SetActive();
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KHostletTransportLogChannel, KMinLogLevel, "CSenActiveHostletRequest::Complete(): AO already active (?)");
+        }
+#endif // _SEDEBUG        
+    iStatus = KRequestPending;
+    aStatus = &iStatus;
+    User::RequestComplete( aStatus, CSenActiveHostletRequest::ECompleteTransaction );
+    return KErrNone; 
+    }
+
+
+void CSenActiveHostletRequest::DoCancel() 
+    {
+    RequestMap().Remove(TxnId()); 
+    }
+
+void CSenActiveHostletRequest::ConstructL()
+    {
+    }
+
+RLocalRequestMap& CSenActiveHostletRequest::RequestMap()
+    {
+    return iRequestMap;
+    }
+
+MSenServiceSession& CSenActiveHostletRequest::Session() const
+    {
+    return iReplyTo;
+    }
+
+MSenRemoteServiceConsumer& CSenActiveHostletRequest::Consumer() const
+    {
+    return iConsumer;
+    }
+
+
+TInt CSenActiveHostletRequest::TxnId() const
+    {
+    return iTxnId;
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/src/senhostlettransportpluginmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshostlettransportplugin/src/senhostlettransportpluginproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "senhostlettransportplugin.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TInt32 KSenHostletTransportPlugin = 0x2000039F;
+#else
+const TInt32 KSenHostletTransportPlugin = 0x10282C4D;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+    IMPLEMENTATION_PROXY_ENTRY(KSenHostletTransportPlugin,  CSenHostletTransportPlugin::NewL)
+#else
+    {{KSenHostletTransportPlugin},  CSenHostletTransportPlugin::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/data/101f974d.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F974D;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9749;
+            implementations = 
+                {
+                // Info for HTTP Channel Transport plugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F974A;
+                    version_no         = 1;
+                    display_name       = "Sen HTTP Channel Transport plug-in";
+                    default_data       = "com.nokia.wsf.transport.plugin.httpchannel";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/data/10274c73.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10274C73;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x10274C72;
+            implementations = 
+                {
+                // Info for HTTP Channel Transport plugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10274C74;
+                    version_no         = 1;
+                    display_name       = "Sen HTTP Channel Transport plug-in";
+                    default_data       = "com.nokia.wsf.transport.plugin.httpchannel";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wshttpchanneltransportplugin    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wshttpchanneltransportplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wshttpchanneltransportplugin.iby)
+PRJ_MMPFILES
+../../wshttpchanneltransportplugin/group/senhttpchanneltransportplugin.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/group/senhttpchanneltransportplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       Project specification file for senhttpchanneltransportpugin    
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+#ifdef SYMBIAN_SECURE_ECOM 
+TARGETTYPE PLUGIN
+#else
+TARGETTYPE ECOMIIC
+#endif
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenHttpChannelTransport.dll
+UID 0x10009D8D 0x10274C73
+#else
+TARGET wshttpchanneltransport.dll
+UID 0x10009D8D 0x101F974D
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+VENDORID 0x101FB657
+    #else
+VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+CAPABILITY ALL -TCB
+    #else
+CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+SOURCEPATH      ../src
+SOURCE          senhttpchanneltransportpluginmain.cpp
+SOURCE          senhttpchanneltransportpluginproxy.cpp
+SOURCE          senhttpchanneltransportplugin.cpp
+SOURCE          senhttpchannelimpl.cpp
+SOURCE          senhttpeventhandler.cpp
+SOURCE          sentxnstate.cpp
+SOURCE          senhttpsyncrequester.cpp
+SOURCE          senmultiparttxnstate.cpp
+SOURCE          senmtomtxnstate.cpp
+SOURCE          senatomtxnstate.cpp
+SOURCE          senasynctimeout.cpp
+SOURCE          senrfiletxnstate.cpp
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  10274c73.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenHttpChannelTransport.rsc
+#endif 
+
+#else
+START RESOURCE  101F974D.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wshttpchanneltransport.rsc
+#endif 
+
+#endif
+
+
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wscore/inc
+USERINCLUDE     ../../wsframework/inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wsidentitymanager/inc
+USERINCLUDE     ../../wsfragment/inc
+USERINCLUDE     ../../wsmessages/inc
+USERINCLUDE     ../../wslogger/inc ../../inc // for TLS based logging
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY         bafl.lib
+LIBRARY         commdb.lib // for forcing IAP ID
+LIBRARY         ecom.lib
+LIBRARY         efsrv.lib 
+LIBRARY         esock.lib
+LIBRARY         estor.lib
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+LIBRARY         http.lib
+LIBRARY         inetprotutil.lib
+LIBRARY         HttpFilterCommon.lib
+LIBRARY         netmeta.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// WSF libraries:
+LIBRARY         SenServDesc.lib
+LIBRARY         SenFramework.lib // CSenHttpTransportProperties
+LIBRARY         SenUtils.lib
+LIBRARY         SenFragment.lib
+LIBRARY         SenMessages.lib
+LIBRARY         SenXml.lib
+LIBRARY         SenLogger.lib // for TLS based logging
+
+#else
+LIBRARY         wsServDesc.lib
+LIBRARY         wsFramework.lib // CSenHttpTransportProperties
+LIBRARY         wsUtils.lib
+LIBRARY         wsFragment.lib
+LIBRARY         wsMessages.lib
+LIBRARY         wsXml.lib
+LIBRARY         wslogger.lib // for TLS based logging
+
+#endif
+// libxml2parser libs:
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+LIBRARY         XmlEngineDOM.lib
+LIBRARY         XmlEngineSerializer.lib
+#else
+LIBRARY         WsStarXmlEngineDOM.lib
+LIBRARY         WsStarXmlEngineSerializer.lib
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senasynctimeout.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef ASYNCTIMEOUT_H
+#define ASYNCTIMEOUT_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+
+class CSenTxnState;
+
+class CSenAsyncTimeOut : public CTimer
+    {
+public:
+    // Cancel and destroy
+    ~CSenAsyncTimeOut();
+
+    // Two-phased constructor.
+    static CSenAsyncTimeOut* NewL(CSenTxnState* aTxnState);
+
+    // Two-phased constructor.
+    static CSenAsyncTimeOut* NewLC(CSenTxnState* aTxnState);
+
+public:
+    // New functions
+    // Function for making the initial request
+    void StartL(TInt aTimeOutSec);
+
+private:
+    // C++ constructor
+    CSenAsyncTimeOut(CSenTxnState* aTxnState);
+
+    // Second-phase constructor
+    void ConstructL();
+
+private:
+    // From CActive
+    // Handle completion
+    void RunL();
+
+
+    // Override to handle leaves from RunL(). Default implementation causes
+    // the active scheduler to panic.
+    TInt RunError(TInt aError);
+
+    CSenTxnState* iTxnState;//not owned
+    };
+
+#endif // ASYNCTIMEOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senatomtxnstate.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSF_ATOM_TXN_STATE_H
+#define WSF_ATOM_TXN_STATE_H
+
+//  INCLUDES
+#include "sentxnstate.h"
+#include "senmultipartutils.h"
+#include "senmultiparttxnstate.h"
+
+// CONSTANTS
+
+
+	
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+ * Class for working with MultiPart messages - creates MultiPart request and parse MultiPart response
+ * Implements the MHTTPDataSupplier interface.
+ *
+ */
+class CSenAtomTxnState : public CSenMultiPartTxnState
+    {
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenAtomTxnState* NewLC(MSenResponseObserver& aObserver,
+                             	   const TDesC8* aUri,
+                               	   CSenAtomEntry& aAtomEntry);
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenAtomTxnState* NewL(MSenResponseObserver& aObserver,
+                              	  const TDesC8* aUri,
+                              	  CSenAtomEntry& aAtomEntry);
+
+
+    // Functions from base classes
+    
+    /**
+     * From CSenTxnState
+     * Creates and sets ContentType in MultiPart envelope header
+     * @param aSession
+     * @param aHeaders
+     */
+    void SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders);
+    void MessageL();
+    
+private:
+
+    /**
+     * C++ default constructor.
+     *
+     */
+    CSenAtomTxnState(MSenResponseObserver& aObserver);
+
+    /**
+     * 2nd phase constructor.
+     *
+     */
+    void ConstructL(const TDesC8* aUri,
+                    CSenAtomEntry& aAtomEntry);
+    };
+
+#endif // WSF_ATOM_TXN_STATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senhttpchannel.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header description       
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_HTTP_CHANNEL_H
+#define SEN_HTTP_CHANNEL_H
+
+//  INCLUDES
+#include <e32base.h> // for CBase
+
+#include "senresponseobserver.h"
+#include "MSenElement.h"
+
+//FORWARD DECLARATION
+class MSenIdentityManager;
+class CSenSoapEnvelope2;
+class CSenAtomEntry;
+class CSenLayeredHttpTransportProperties;
+
+
+// CLASS DECLARATION
+
+/**
+ * The class for submitting multiple simultaneous HTTP requests.
+ * Accept header and User-Agent header have to be set before
+ * the class is used. You should call the set methods only after
+ * construction, not after any requests are submitted.
+ *
+ */
+
+class CSenHttpChannel : public CBase
+    {
+public:
+    enum TPanics
+        {
+        ENoAcceptHeader = 1,
+        ENoUserAgentHeader,
+        EAddedHeadersCount,
+        ETxnStateNull,
+        ERequestUriNull,
+        EPostContentTypeNull,
+        EPostContentNull,
+        ERespBodyNull,
+		EContentTypeUnrecognisedValueType
+        };
+
+public: // Constructors and destructor
+    /**
+     * Two-phased constructor.
+     */
+    static CSenHttpChannel* NewL(MSenIdentityManager& aManager);
+
+    /**
+     * Two-phased constructor.
+     */
+    static CSenHttpChannel* NewLC(MSenIdentityManager& aManager);
+
+    static CSenHttpChannel* NewL(MSenIdentityManager& aManager,
+                                            TUint32 aIapId);
+
+    static CSenHttpChannel* NewLC(MSenIdentityManager& aManager,
+                                            TUint32 aIapId);
+    // New functions
+
+    /**
+     * Submit HTTP POST request to a given URI with the given
+     * content type and the message body. Observer is called
+     * when the response is ready. The method leaves if an
+     * error occurs.
+     * @param aObserver observer is called when the response
+     * @param aUri outgoing request URI.
+     * @param aContent outgoing request content.
+     * @param aProps outgoing transport properties for the
+     * submitted message.
+     * @return submit id which identifies the request.
+     */
+    virtual TInt SendL(MSenResponseObserver& aObserver,
+                       const TDesC8& aUri,
+                       const TDesC8& aContent,
+                       CSenLayeredHttpTransportProperties& aProps) = 0;
+                       
+                       
+    virtual TInt SendL(MSenResponseObserver& aObserver,
+                       const TDesC8& aUri,
+                       CSenSoapEnvelope2& aContent,
+                       CSenLayeredHttpTransportProperties& aProps) = 0;
+    virtual TInt SendL(MSenResponseObserver& aObserver,
+                       const TDesC8& aUri,
+                       CSenAtomEntry& aContent,
+                       CSenLayeredHttpTransportProperties& aProps) = 0;
+                       
+	virtual TInt SendL(MSenResponseObserver& aObserver,
+						const TDesC8& aUri,
+						const RFile& aFile,
+						CSenLayeredHttpTransportProperties& aProps) = 0;                       
+    
+    /**
+     * Set web proxy to be used when sending requests.
+     * If you try to connect with the phone emulator to the Internet
+     * from Nokia Intranet you need to set this. Internally, this
+     * method will call the version, which takes in the complete
+     * proxy address:
+     * @see SetProxyL(const TDesC8& aProxyAddrStr)
+     *
+     * @param aProxyHostBaseAddr, e.g. 172.19.160.50
+     * @param aProxyPort, e.g. 8080. Note that, if a negative value
+     * is provided, then the HTTP port is not used in forming of
+     * the host address. In such case, the default proxy port
+     * value of HTTP stack implemtation will be used.
+     */
+    virtual void SetProxyL(const TDesC8& aProxyHostBaseAddr,
+                           TInt aProxyPort) = 0;
+    /**
+     * Set web proxy to be used when sending requests.
+     * If you try to connect with the phone emulator to the Internet
+     * from Nokia Intranet you need to set this.
+     *
+     * @param aProxyAddrStr proxy address, e.g. 131.228.55.140:8080.
+     */
+    virtual void SetProxyL(const TDesC8& aProxyAddrStr) = 0;
+
+    /**
+     * By default HTTP v. 1.1 is used. If you want to set
+     * set HTTP 1.0 call SetHttpVersionL(0).
+     *
+     * @param aVersion HTTP version, give x for HTTP 1.x.
+     */
+    virtual void SetHttpVersionL(TInt aVersion) = 0;
+
+    virtual void SetProxyUsageL(TBool aProxyUsage) = 0;
+    virtual void SetSecureDialogL(TBool aSecureDialog) = 0;
+    virtual TBool EffectiveIapId(TUint32 &aIapId) = 0;
+    virtual TInt CancelTransaction(const TInt aTxnId) = 0;
+    virtual void CancelAllTransactions() = 0;
+    virtual void EnableTimeOutL(TInt aTxnId, TInt aTimeOutSec) = 0;
+    virtual void DisableTimeOutL(TInt aTxnId) = 0;
+    virtual TInt32 UsedIap() = 0;
+    
+    };
+
+#endif // SEN_HTTP_CHANNEL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senhttpchannelimpl.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header description       
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_HTTP_CHANNEL_IMPL_H
+#define SEN_HTTP_CHANNEL_IMPL_H
+
+// INCLUDES
+#include <badesca.h>
+#include <http/mhttpauthenticationcallback.h>
+#include <flogger.h>
+#include <es_sock.h>
+#include <commdbconnpref.h>
+
+#include "senhttpchannel.h"
+#include "MSenElement.h"
+#include "SenIdentityProvider.h"
+#include "senpointermap.h"
+#include "senmtomtxnstate.h"
+
+_LIT(KColon,                            ":");
+
+// Multipart message
+_LIT8(KMimeAccept, "*/*");
+
+// Panics
+_LIT(KUnrecognisedValueTypeOfContentTypePanicText, "ContentType has unrecognised value");
+
+// FORWARD DECLARATIONS
+class CSenHttpEventHandler;
+class CSenTxnState;
+class CSenAtomEntry;
+//class CSenMtomTxnState;
+class MSenIdentityManager;
+//class CSenElement;
+class CSenLayeredHttpTransportProperties;
+
+// CLASS DECLARATION
+class CSenHttpChannelImpl : public CSenHttpChannel,
+                            public MHTTPAuthenticationCallback
+    {
+public:
+    static CSenHttpChannelImpl* NewL(MSenIdentityManager& aManager);
+    static CSenHttpChannelImpl* NewLC(MSenIdentityManager& aManager);
+    static CSenHttpChannelImpl* NewL(MSenIdentityManager& aManager, TUint32 aIapId);
+    static CSenHttpChannelImpl* NewLC(MSenIdentityManager& aManager, TUint32 aIapId);
+
+    virtual ~CSenHttpChannelImpl();
+
+    void HandleResponseHeadersL(RHTTPTransaction aTransaction);
+    void HandleResponseBodyDataL(RHTTPTransaction aTransaction);
+    void HandleResponseL(RHTTPTransaction aTransaction);
+    void HandleRunErrorL(RHTTPTransaction aTransaction, TInt aError);
+    void HandleRedirectRequiresConfirmationL(RHTTPTransaction aTransaction);
+
+    // Functions from base classes
+    virtual TInt SendL(MSenResponseObserver& aObserver,
+                       const TDesC8& aUri,
+                       const TDesC8& aContent,
+                       CSenLayeredHttpTransportProperties& aProps);
+                       
+    virtual TInt SendL(MSenResponseObserver& aObserver,
+                 	   const TDesC8& aUri,
+                       CSenSoapEnvelope2& aContent, 
+                       CSenLayeredHttpTransportProperties& aProps);
+    virtual TInt SendL(MSenResponseObserver& aObserver,
+                           	    const TDesC8& aUri,
+                               	CSenAtomEntry& aContent, 
+                               	CSenLayeredHttpTransportProperties& aProps);
+                               	
+	virtual TInt SendL(MSenResponseObserver& aObserver,
+						const TDesC8& aUri,
+						const RFile& aFile,
+						CSenLayeredHttpTransportProperties& aProps);
+					                                                      	
+     
+    virtual void SetProxyL(const TDesC8& aProxyHostBaseAddr,
+                           TInt aProxyPort);
+    virtual void SetProxyL(const TDesC8& aProxyAddrStr);
+    virtual void SetHttpVersionL(TInt aVersion);
+    virtual void SetProxyUsageL(TBool aProxyUsage);
+    virtual void SetSecureDialogL(TBool aSecureDialog);
+
+    TInt CancelTransaction(const TInt aTxnId);
+    void CancelAllTransactions();
+
+    void SetExplicitIapDefined(TBool aExplicitIapDefined);
+    /*
+    * Getter for currently effective IAP ID
+    * @param aIapId will be assigned to hold
+    * the value of that Internet Access Point
+    * identifier (an unsigned integer utilized
+    * by CommsDB API).
+    * @return EFalse, if IAP ID has not been
+    * specified. Otherwise, returns ETrue.
+    */
+    virtual TBool EffectiveIapId(TUint32 &aIapId);
+
+    // Helper, for file logging. 
+    //RFileLogger* Log() const;
+    void NotifyMoreBodyL();
+
+    // Functions from MHTTPAuthenticationCallback
+    virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm,
+                                  RStringF aAuthenticationType,
+                                  RString& aUsername,
+                                  RString& aPassword);
+    void EnableTimeOutL(TInt aTxnId, TInt aTimeOutSec);
+    void DisableTimeOutL(TInt aTxnId);
+    virtual TInt32 UsedIap();
+    
+protected:
+    CSenHttpChannelImpl(MSenIdentityManager& aManager);
+
+    void AddRequestHeadersL(RHTTPHeaders& aHeaders, CSenLayeredHttpTransportProperties& aProps);
+    void AppendNewTxnStateL(CSenTxnState* aTxnState);
+    void DeleteTxnState(TInt aTxnId);
+    CSenTxnState* FindTxnState(TInt aTxnId, TInt* aIndex = NULL);
+    /**
+    * Applies new IAP preferencies to current HTTP Session (RHTTPSession)
+    * @param aIapId new IAP ID
+    * @param aDialogPref shows is IAPDialog allowed or not 
+    * @param aConnection is the connection to be attached to HTTP session
+    * @param aSocketServer is the socket server to be attached to HTTP session
+    * Leaves with system-wide error code if preferences cannot be set.
+    */
+    TInt SetIapPrefsL( TUint32 aIapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer );
+    TInt SetSnapPrefsL( TUint32 aSnapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer );
+    
+    //void SetupConnectionWithIapPrefsL( TUint32 aIapId, RConnection& aConnection, RSocketServ& aSocketServer );
+    //void AttachSocketServerAndConnectionWithHttpSession( TUint32 aIapId, RConnection& aConnection, RSocketServ& aSocketServer );
+
+    void ConstructL();
+    void ConstructL( TUint32 aIapId );
+
+
+private:
+    
+    // New functions
+    
+    
+    TPtrC8 SoapActionL(MSenElement& aSoapEnvelope);
+    TInt SubmitRequestL(MSenResponseObserver& aObserver,
+                        const TDesC8& aUri,
+                        const TDesC8* aContentType = NULL,
+                        const TDesC8* aContent = NULL);
+
+    TInt SubmitRequestL(MSenResponseObserver& aObserver,
+                        const TDesC8& aUri,
+                        MSenElement& aMessage,
+                        const TDesC8* aContentType = NULL);
+
+    TInt InvokeHttpMethodL(CSenTxnState* aTxnState,
+                           CSenLayeredHttpTransportProperties& aProps);
+	
+    void ListFilters();
+    void DumpRespHeadersL(RHTTPTransaction& aTrans);
+    void DumpBodyData(const TDesC8& aData);
+    TInt ContentTypeParamValueL(const RHTTPHeaders& aResponseHeaders,
+                                const RStringF& aContent, 
+                                const TPtrC8& aParamName,
+                                SenMultiPartUtils::TMultiPartContentType& aMultiPartContentType);
+
+protected:
+    RSocketServ iSockServ;
+    RConnection iConnection;
+    TUint32 iIapId;
+    TUint32 iUsedIapId;
+    TUint32 iSnapId;
+    RStringPool iStringPool;
+    RHTTPSession iSess;
+    CSenHttpEventHandler* iTransObs;
+    //RFileLogger iLog;
+    
+private:
+
+    CArrayPtrFlat<CSenTxnState>* iTxnStates;
+    MSenIdentityManager& iManager;
+    TInt iBasicConnectionTries;
+    CSenIdentityProvider*   iSessionAuthentication; // NOT owned
+    TBool   iPasswordFromUser;  // Is ETrue if data from identitymanager is
+    TPtrC8 iContentType; // content type of usual response
+    TBool iExplicitIapDefined;
+    HBufC8* iProxyHostPort;
+    TBool iXopResponse;
+    TBool iDeflateFilter;//Is true if deflate filter loaded for a session
+    TBool iHasHttpContentType;
+    SenMultiPartUtils::TMultiPartContentType iMultiPartContentType; // content type of MultiPart response
+    RHTTPTransaction iHttpTransaction ;
+    };
+
+#endif //SEN_HTTP_CHANNEL_IMPL_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senhttpchanneltransportplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,310 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_HTTP_CHANNEL_TRANSPORT_PLUGIN_H
+#define SEN_HTTP_CHANNEL_TRANSPORT_PLUGIN_H
+
+// INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <s32file.h>    // filestream
+
+#include <flogger.h>
+#include "sendebug.h"
+#include "sentransport.h"
+#include "msencoreservicemanager.h"
+#include "msenremoteserviceconsumer.h"
+#include "msenservicesession.h"
+#include "senpointermap.h"
+#include "senresponseobserver.h"
+#include "SenHttpTransportProperties.h"
+#include <SenServiceConnection.h>
+// CONSTANTS
+_LIT8(KSenHttpChannelTransportUriScheme,        "http");
+_LIT8(KSenHttpChannelUserAgentHeaderDefault,    "Serene");
+_LIT8(KSenHttpChannelAcceptHeaderDefault,       "text/xml");
+
+
+// FORWARD DECLARE
+class CSenHttpChannel;
+class CSenHttpSyncRequester;
+class CSenLayeredHttpTransportProperties;
+class CSenIdentityProvider;
+
+class CSenSoapEnvelope2;
+
+// TYPE DEF
+typedef RSenPointerMap<MSenRemoteServiceConsumer, TInt> RConsumerMap;
+typedef RSenPointerMap<MSenServiceSession, TInt> RSessionMap;
+
+/**********************************************************************
+ Here is the full list of HTTP error codes
+ (taken from: \src\common\generic\application-protocols\http\inc\httperr.h)
+
+       KErrHttpEncodeDefault                     -7200 
+       KErrHttpEncodeAccept                      -7201 
+       KErrHttpEncodeAcceptCharset               -7202 
+       KErrHttpEncodeQValue                      -7203 
+       KErrHttpEncodeAuthorization               -7204 
+       KErrHttpEncodeBasicAuth                   -7205 
+       KErrHttpEncodeDigestAuth                  -7206 
+       KErrHttpEncodeConnection                  -7207 
+       KErrHttpEncodeContentLength               -7208 
+       KErrHttpEncodeContentType                 -7209 
+       KErrHttpEncodeHost                        -7210 
+       KErrHttpEncodeHostPort                    -7211 
+       KErrHttpEncodeTransferEncoding            -7212 
+       KErrHttpEncodeUserAgent                   -7213 
+       KErrHttpEncodeDate                        -7214 
+       KErrHttpEncodeCookie                      -7215 
+       KErrHttpEncodeCacheControl                -7216 
+       KErrHttpEncodePragma                      -7217 
+       KErrHttpEncodeIfMatch                     -7218 
+       KErrHttpEncodeIfNoneMatch                 -7219 
+       KErrHttpEncodeIfModifiedSince             -7220 
+       KErrHttpEncodeIfUnmodifiedSince           -7221 
+       KErrHttpEncodeCookie2                     -7222 
+       KErrHttpEncodeContentLanguage             -7223 
+       KErrHttpEncodeDoWWWAuthenticate           -7224 
+       KErrHttpEncodeDoAge                       -7225 
+       KErrHttpEncodeDoVary                      -7226 
+       KErrHttpEncodeDoContentLanguage           -7227 
+       KErrHttpEncodeContentEncoding             -7228 
+       KErrHttpEncodeContentLocation             -7229 
+       KErrHttpEncodeContentMD5                  -7230 
+       KErrHttpEncodeAcceptLanguage              -7231 
+       KErrHttpEncodeAcceptEncoding              -7232 
+       KErrHttpEncodeTE                          -7233 
+                                                       
+       KErrHttpDecodeMalformedDate               -7260 
+       KErrHttpDecodeMalformedYear               -7261 
+       KErrHttpDecodeMalformedMonth              -7262 
+       KErrHttpDecodeMalformedDay                -7263 
+       KErrHttpDecodeMalformedWkDay              -7264 
+       KErrHttpDecodeMalformedWeekDay            -7265 
+       KErrHttpDecodeMalformedInteger            -7266 
+       KErrHttpDecodeMalformedQuotedStr          -7267 
+                                                       
+       KErrHttpDecodeAccept                      -7270 
+       KErrHttpDecodeConnection                  -7271 
+       KErrHttpDecodeContentLength               -7272 
+       KErrHttpDecodeContentType                 -7273 
+       KErrHttpDecodeTransferEncoding            -7274 
+       KErrHttpDecodeWWWAuthenticate             -7275 
+       KErrHttpDecodeUnknownAuthScheme           -7276 
+       KErrHttpDecodeBasicAuth                   -7277 
+       KErrHttpDecodeDigestAuth                  -7278 
+       KErrHttpDecodeCookie                      -7279 
+       KErrHttpDecodeAuthorization               -7280 
+       KErrHttpDecodeAcceptCharset               -7281 
+       KErrHttpDecodeAcceptLanguage              -7282 
+       KErrHttpDecodeAcceptEncoding              -7283 
+       KErrHttpDecodeTE                          -7284 
+       KErrHttpDecodeExpect                      -7285 
+                                                       
+       KErrHttpRedirectExceededLimit             -7300 
+       KErrHttpRedirectUseProxy                  -7301 
+       KErrHttpRedirectNoLocationField           -7302 
+       KErrHttpUnknownParseState                 -7303 
+                                                       
+       KErrHttpRequestHasBody                    -7330 
+       KErrHttpRequestBodyMissing                -7331 
+       KErrHttpTraceReqWithoutMaxForwardHeader   -7332 
+       KErrHttpPostReqBodyWithoutSizeOnHTTP10    -7333 
+       KErrHttpInvalidHeaderInRequest            -7334 
+                                                       
+       KErrHttpEntityHeaderMissingContentType    -7360 
+       KErrHttpGeneralHeaderMissingHost          -7361 
+                                                       
+       KErrHttpCantResetRequestBody              -7370 
+       KErrHttpProtTransactionNotInitialised     -7371 
+       KErrHttpCannotEstablishTunnel             -7372 
+       KErrHttpInvalidUri                        -7373 
+       KErrHttpNonPipeliningError                -7374 
+       KErrHttpPipeliningError                   -7375 
+
+ ***********************************************************************/
+
+// CLASS DECLARATION
+class CSenHttpChannelTransportPlugin : public CSenTransport,
+                                       public MSenResponseObserver
+    {
+    public: // Constructors and destructor
+    
+        static CSenHttpChannelTransportPlugin* NewL(CSenTransportContext* apCtx);
+        static CSenHttpChannelTransportPlugin* NewLC(CSenTransportContext* apCtx);
+
+        //static CSenHttpChannelTransportPlugin* NewL(MSenCoreServiceManager& aServiceManager);
+        //static CSenHttpChannelTransportPlugin* NewLC(MSenCoreServiceManager& aServiceManager);
+
+        /*        
+        // @depracated: remove when Transport Properties is used as initializer:
+        static CSenHttpChannelTransportPlugin* NewL(MSenCoreServiceManager& aManager,
+                                                    TInt aProxyPort,
+                                                    TPtrC8 aProxyHost);
+
+        // @depracated: remove when Transport Properties is used as initializer:
+        static CSenHttpChannelTransportPlugin* NewLC(MSenCoreServiceManager& aManager,
+                                                     TInt aProxyPort,
+                                                     TPtrC8 aProxyHost);
+
+        // @depracated: remove when Transport Properties is used as initializer:
+        static CSenHttpChannelTransportPlugin* NewL(MSenCoreServiceManager& aManager,
+                                                    TUint32 aIapId);
+
+        // @depracated: remove when Transport Properties is used as initializer:
+        static CSenHttpChannelTransportPlugin* NewLC(MSenCoreServiceManager& aManager,
+                                                     TUint32 aIapId);
+    
+        // @depracated: remove when Transport Properties is used as initializer:
+        static CSenHttpChannelTransportPlugin* NewL(MSenCoreServiceManager& aManager, 
+                                                    TInt aProxyPort, 
+                                                    TPtrC8 aProxyHost,
+                                                    TUint32 aIapId);
+
+        // @depracated: remove when Transport Properties is used as initializer:
+        static CSenHttpChannelTransportPlugin* NewLC(MSenCoreServiceManager& aManager, 
+                                                     TInt aProxyPort, 
+                                                     TPtrC8 aProxyHost,
+                                                     TUint32 aIapId);
+        */
+
+        virtual ~CSenHttpChannelTransportPlugin();
+
+        // from MSenResponseObserver
+
+        /**
+        * Receive response to a request submitted. This method
+        * takes the ownership of the heap buffer aContent.
+        *
+        * @param aRequestId submit id which identifies the request.
+        * @param aContentType incoming response content type.
+        * @param aContent incoming response content, or NULL.
+        * @param aHttpProperties - properies of response(e.g.such as file names where BLOBs are saved) or NULL
+        */
+        virtual void ResponseReceivedL(TInt aRequestId,
+                                       const TAny* aContentType, 
+                                       HBufC8* aContent,
+                                       CSenHttpTransportProperties* aHttpProperties = NULL);
+
+        /**
+        * Error occured while receiving response. Error code
+        * is either system error code or own error code. Own
+        * error codes start from -20000
+        *
+        * @param aRequestId submit id which identifies the request.
+        * @param aErrorCode  error code of the response.
+        * @param aErrorBody is the received error response. Might
+        *       be zero-lenght, if nothing was received.
+        */
+        virtual void ResponseErrorL(TInt aRequestId, TInt aError, HBufC8* aErrorBody,
+                                    CSenHttpTransportProperties* aHttpProperties = NULL);
+
+        // from MSenTransport
+
+        virtual TInt SubmitL(const TDesC8& aEndpoint,
+                             const TDesC8& aMessage,
+                             const TDesC8& aTransportProperties,
+                             HBufC8*& aResponse,
+                             MSenRemoteServiceConsumer& aConsumer);
+
+        virtual TInt SendL(const TDesC8& aEndpoint,
+                           const TDesC8& aMessage,
+                           const TDesC8& aTransportProperties,
+                           MSenServiceSession& aReplyTo,
+                           MSenRemoteServiceConsumer& aConsumer, // "adressee", could be CSenIdentifier
+                           TInt& aTxnId);
+
+        virtual TInt SetPropertiesL(const TDesC8& aProperties, 
+                                    MSenLayeredProperties::TSenPropertiesLayer aTargetLayer,
+                                    MSenRemoteServiceConsumer* aConsumer);
+        virtual TInt PropertiesL(HBufC8*& aProperties);
+        virtual TInt CompleteTransaction(const TInt aTxnId, const TInt aStatus);
+        virtual TInt CancelTransaction(const TInt aTxnId);
+        virtual TPtrC8 UriSchemeL();
+        
+        virtual MSenProperties& PropertiesL();
+        
+        virtual void StateChanged(TInt aId, TInt aState); // in order to propagate http status codes
+        virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+            const TDesC8& aSoapOrCid, TInt aProgress);
+		virtual void SetTrafficDetails(TSenDataTrafficDetails& aDetails);
+        void DataTrafficDetails(TSenDataTrafficDetails& aDetails); 	
+    protected:
+    
+        /**
+        * C++ default constructor.
+        * @param apCtx - ownership is taken to this instance(!)
+        */
+
+        CSenHttpChannelTransportPlugin(CSenTransportContext* apCtx,
+                                       MSenCoreServiceManager& aCore);
+        //CSenHttpChannelTransportPlugin(MSenCoreServiceManager& aServiceManager);
+
+    private:
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL();
+
+        // @depracated: remove when Transport Properties is used as initializer:
+        //void ConstructL(TInt aProxyPort, TPtrC8 aProxyHost);
+        // @depracated: remove when Transport Properties is used as initializer:
+        //void ConstructL(TUint32 aIapId);
+        // @depracated: remove when Transport Properties is used as initializer:
+        //void ConstructL(TInt aProxyPort, TPtrC8 aProxyHost, TUint32 aIapId);
+
+        /**
+        * Helper, which resets HTTP transport properties
+        */
+        TInt ApplyPropertiesL();
+
+        TInt ResetHttpChannelByIapIdL(TUint32 aIapId);
+
+        CSenLayeredHttpTransportProperties& LayeredPropertiesL();
+        
+
+        /**
+        * Logging 
+        */
+        //RFileLogger* Log() const;
+        
+    private: // data
+        MSenCoreServiceManager& iServiceManager; // not owned
+        CSenHttpSyncRequester* iRequester;
+        CSenHttpChannel *iHttpChannel;
+        CSenLayeredHttpTransportProperties* iProperties;
+        RConsumerMap iConsumerMap; // values owned (TxnIds), keys not (consumers)
+        RSessionMap iSessionMap;   // values NOT owned (TxnIds), neither keys (sessions)
+        //RFileLogger iLogger;
+        TInt iStatusCode; // containts latest error or zero
+		TSenDataTrafficDetails iDetails;
+    };
+
+#endif // SEN_HTTP_CHANNEL_TRANSPORT_PLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senhttpeventhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSF_HTTP_EVENT_HANDLER_H
+#define WSF_HTTP_EVENT_HANDLER_H
+
+// INCLUDES
+#include <http/mhttptransactioncallback.h>
+#include <flogger.h>
+
+// FORWARD DECLARATIONS
+class CSenHttpChannelImpl;
+
+// CLASS DECLARATION
+class CSenHttpEventHandler : public CBase, public MHTTPTransactionCallback
+    {
+    public: // Constructors and destructor
+    
+        static CSenHttpEventHandler* NewLC(CSenHttpChannelImpl* aChannel);//,
+                                           //RFileLogger* aLog);
+        static CSenHttpEventHandler* NewL(CSenHttpChannelImpl* aChannel);//,
+                                          //RFileLogger* aLog);
+
+        virtual ~CSenHttpEventHandler();
+
+        // Functions from base classes
+    
+        // from MHTTPTransactionCallback
+        virtual void MHFRunL(RHTTPTransaction aTransaction,
+                             const THTTPEvent& aEvent);
+        virtual TInt MHFRunError(TInt aError,
+                                 RHTTPTransaction aTransaction,
+                                const THTTPEvent& aEvent);
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenHttpEventHandler(CSenHttpChannelImpl* aChannel);//,
+                             //RFileLogger* aLog);
+                             
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */                   
+        void ConstructL();
+
+    private:
+        
+        //RFileLogger* Log() const;
+
+    private: // Data
+        CSenHttpChannelImpl* iHttpChannel;
+        //RFileLogger* iLog;
+        TInt iTries;
+    };
+
+#endif // WSF_HTTP_EVENT_HANDLER_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senhttpsyncrequester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           The class for submitting synchronous HTTP requests.
+*                Create and initialize instance of CSenHttpChannel
+*                first and pass it as a parameter to this wrapper
+*                class in a constructor.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSF_HTTP_SYNC_REQUESTER_H
+#define WSF_HTTP_SYNC_REQUESTER_H
+
+//  INCLUDES
+#include <badesca.h>
+
+#include "senresponseobserver.h"
+#include "MSenElement.h"
+
+// FORWARD DECLARATIONS
+class CSenHttpChannel;
+class CSenLayeredHttpTransportProperties;
+
+// CLASS DECLARATION
+
+/**
+ * The class for submitting synchronous HTTP requests.
+ * Create and initialize instance of CSenHttpChannel
+ * first and pass it as a parameter to this wrapper
+ * class in a constructor.
+ *
+ */
+class CSenHttpSyncRequester : public CTimer,
+                              public MSenResponseObserver
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static CSenHttpSyncRequester* NewL(CSenHttpChannel* aHttpChannel);
+
+    /**
+     * Two-phased constructor.
+     */
+    static CSenHttpSyncRequester* NewLC(CSenHttpChannel* aHttpChannel);
+
+    /**
+     * Two-phased constructor.
+     */
+    static CSenHttpSyncRequester* NewL(CSenHttpChannel* aHttpChannel,
+                                        MSenResponseObserver* aParentObserver);
+
+    /**
+     * Two-phased constructor.
+     */
+    static CSenHttpSyncRequester* NewLC(CSenHttpChannel* aHttpChannel,
+                                        MSenResponseObserver* aParentObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CSenHttpSyncRequester();
+
+    /**
+     * Submit a synchronous HTTP GET request to a given URI.
+     * The method leaves if an error occurs. This method
+     * takes the ownership of the heap buffers aResponseContentType
+     * and aResponseContent.
+     *
+     * @param aRequestUri outgoing request URI.
+     * @param aResponseContentType incoming response content type.
+     * @param aResponseContent incoming response content.
+     */
+    // HTTP GET
+    //TInt SubmitL(const TDesC8& aRequestUri,
+    //                      HBufC8*& aResponseContentType,
+    //                      HBufC8*& aResponseContent,
+    //                      TInt& aErrorCode);
+
+    /**
+     * Submit a synchronous HTTP POST request to a given URI.
+     * The method leaves if an error occurs. This method
+     * takes the ownership of the heap buffers aResponseContentType
+     * and aResponseContent.
+     *
+     * @param aRequestUri outgoing request URI.
+     * @param aRequestContentType outgoing request content type.
+     * @param aRequestContent outgoing request content.
+     * @param aResponseContentType incoming response content type.
+     * @param aResponseContent incoming response content.
+     */
+    TInt SubmitL(const TDesC8& aRequestUri,
+                 CSenLayeredHttpTransportProperties& aProps,
+                 const TDesC8& aRequestContent,
+                 HBufC8*& aResponseContentType,
+                 HBufC8*& aResponseContent,
+                 TInt& aErrorCode);
+
+    /*
+    // SOAP envelope version of HTTP POST, IOP
+    TInt SubmitL(const TDesC8& aRequestUri,
+                    const TDesC8* aRequestContentType,
+                    MSenElement& aMessage, // SOAP envelope
+                    HBufC8*& aResponseContentType,
+                    HBufC8*& aResponseContent,
+                    TInt& aErrorCode);
+    */
+
+        // Functions from base classes
+        
+    /**
+     * Callback method from MSenResponseObserver.
+     */
+    virtual void ResponseReceivedL( TInt aRequestId,
+                                    const TAny* aContentType, 
+                                    HBufC8* apContent,
+                                    CSenHttpTransportProperties* aHttpPrperties = NULL );
+
+    /**
+     * Callback method from MSenResponseObserver.
+     */
+    virtual void ResponseErrorL(TInt aId, TInt aError, HBufC8* aErrorBody, CSenHttpTransportProperties* aHttpProperties  );
+    virtual void FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/,
+            TBool /*aIsSoap*/, const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
+        {
+        }
+
+    virtual void StateChanged(TInt aRequestId, TInt aState); // In order to propagate http status codes
+	virtual void SetTrafficDetails(TSenDataTrafficDetails& aDetails) ; 
+    virtual MSenProperties& PropertiesL();
+    
+//from activeObject
+    void DoCancel();
+    void RunL();
+    TInt RunError(TInt /*aError*/);
+
+private:
+    CSenHttpSyncRequester(CSenHttpChannel* aHttpChannel,
+                          MSenResponseObserver* aParentObserver);
+    void ConstructL();
+
+private:  // Data
+    CSenHttpChannel* iHttpChannel;          // not owned
+    CActiveSchedulerWait iSchedulerWait;
+    TBool isStopped;
+    HBufC8* iContentType;
+    HBufC8* iContent;
+    TInt iStatusCode; // containts KErrNone or some error
+    MSenResponseObserver* iParentObserver;  // not owned
+    };
+
+#endif //WSF_HTTP_SYNC_REQUESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senmtomtxnstate.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSF_MTOM_TXN_STATE_H
+#define WSF_MTOM_TXN_STATE_H
+
+//  INCLUDES
+#include "sentxnstate.h"
+#include "senmultipartutils.h"
+#include "senmultiparttxnstate.h"
+// CONSTANTS
+
+_LIT8(KDownloadFolder, "SenBlobResponses"); // folder where should be created Blobs from Response
+	
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+ * Class for working with MTOM messages - creates MTOM request and parse MTOM response
+ * Implements the MHTTPDataSupplier interface.
+ *
+ */
+class CSenMtomTxnState : public CSenMultiPartTxnState
+    {
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenMtomTxnState* NewLC(MSenResponseObserver& aObserver,
+                             	   const TDesC8* aUri,
+                               	   const TDesC8& aSoapAction,
+                               	   CSenSoapEnvelope2& aSoapEnvelope2);
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenMtomTxnState* NewL(MSenResponseObserver& aObserver,
+                              	  const TDesC8* aUri,
+                              	  const TDesC8& aSoapAction,
+                              	  CSenSoapEnvelope2& aSoapEnvelope2);
+
+
+
+    // Functions from base classes
+
+
+
+    
+    /**
+     * From CSenTxnState
+     * Creates and sets ContentType in MTOM envelope header
+     * @param aSession
+     * @param aHeaders
+     */
+    void SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders);
+    void MessageL();
+    
+private:
+
+    /**
+     * C++ default constructor.
+     *
+     */
+    CSenMtomTxnState(MSenResponseObserver& aObserver);
+
+    /**
+     * 2nd phase constructor.
+     *
+     */
+    void ConstructL(const TDesC8* aUri,
+                    const TDesC8& aSoapAction,
+                    CSenSoapEnvelope2& aSoapEnvelope2);
+    };
+
+#endif // WSF_MTOM_TXN_STATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senmultiparttxnstate.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,314 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSF_MultiPart_TXN_STATE_H
+#define WSF_MultiPart_TXN_STATE_H
+
+//  INCLUDES
+#include "sentxnstate.h"
+#include "senmultipartutils.h"
+
+
+// CONSTANTS
+
+
+	
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+ * Class for working with MultiPart messages - creates MultiPart request and parse MultiPart response
+ * Implements the MHTTPDataSupplier interface.
+ *
+ */
+class CSenMultiPartTxnState : public CSenTxnState
+    {
+public:  // Constructors and destructor
+
+    
+    /**
+     * Virtual destructor.
+     *
+     */
+    virtual ~CSenMultiPartTxnState();
+
+    // New functions
+
+    /**
+     * Parses Response from server (MultiPart message) 
+     * @param aDataPart Part of data come from server side
+     */ 
+    void ParseMultiPartResponseL(TDesC8& aDataPart);
+
+    /**
+     * Added HttpTransportProperties about Cids of Blobs and File names, 
+     * where Blobs are kept and passes transport properties and XopEnvelope 
+     * to an observer
+     * @param aMultiPartContentType ContentType of MultiPart Response
+     */
+    void ResponseReceivedL(const SenMultiPartUtils::TMultiPartContentType& aMultiPartContentType);
+
+    // Functions from base classes
+
+    /**
+     * From MHTTPDataSupplier::GetNextDataPart.
+     * Obtain a data part from the supplier.  The data is guaranteed
+     * to survive until a call is made to ReleaseData().
+     * @param aDataPart The data part that sould be sent to server side.
+     * @return ETrue if this is the last part, EFalse otherwise.
+     */
+    virtual TBool GetNextDataPart(TPtrC8& aDataPart);
+
+    /**
+     * From MHTTPDataSupplier::ReleaseData.
+     * Release the current data part being held at the data
+     * supplier.  This call indicates to the supplier that the part
+     * is no longer needed, and another one can be supplied, if
+     * appropriate.
+     */
+    virtual void ReleaseData();
+
+    /**
+     * From MHTTPDataSupplier::OverallDataSize.
+     * Obtain the overall size of the data being supplied, if known
+     * to the supplier.  Where a body of data is supplied in several
+     * parts this size will be the sum of all the part sizes. If
+     * the size is not known, KErrNotFound is returned; in this case
+     * the client must use the return code of GetNextDataPart to find
+     * out when the data is complete.
+     *
+     * @return A size in bytes, or KErrNotFound if the size is not known.
+     */
+    virtual TInt OverallDataSize();
+
+    /**
+     * From MHTTPDataSupplier::Reset.
+     * Reset the data supplier.  This indicates to the data supplier
+     * that it should return to the first part of the data.
+     * This could be used in a situation where the data consumer has
+     * encountered an error and needs the data to be supplied afresh.
+     * Even if the last part has been supplied (i.e. GetNextDataPart
+     * has returned ETrue), the data supplier should reset to the
+     * first part. If the supplier cannot reset it should return an
+     * error code; otherwise it should return KErrNone, where the
+     * reset will be assumed to have succeeded.
+     *
+     * @return KErrNone if successful, otherwise another error code.
+     */
+    virtual TInt Reset();
+    
+    /**
+     * From CSenTxnState
+     * Creates and sets ContentType in MultiPart header
+     * @param aSession
+     * @param aHeaders
+     */
+    virtual void SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders) = 0;
+    
+    
+protected:
+
+    /**
+     * C++ default constructor.
+     *
+     */
+    CSenMultiPartTxnState(MSenResponseObserver& aObserver);
+
+               
+    // New functions
+
+    /**
+     * Creates Request for MultiPart message in MultiPart format 
+     * should be used to send MultiPart message through HTTP Channel
+     * @param aDataPart The data part that sould be sent to server side.
+     * @return ETrue if this is the last part, EFalse otherwise.
+     */
+    TBool GetNextDataPartL(TPtrC8& aDataPart);
+                                        
+    /**
+     * Calculates number of parts in BLOB (every part = 10KB) 
+     * and how many bytes there are in the last part
+     * @param aIndex Which Blob from an array should be calculated.
+     */
+    void SizeBinaryData(TUint aIndex);
+    
+    /**
+     * Creates header for Blob in Request
+     */
+    void BlobHeaderL();
+    
+    /**
+     * for case if Blob is kept in a file 
+     * This function passes Blob from a file part by part (every part = 10KB)
+     * in Request
+     * @param aIndex Which Blob from an array should be passed.
+     */
+    void FileContainerL(TUint aIndex);
+    
+    /**
+     * Creates the last part (MimeBoundaryEnd) in Request
+     */
+    void XopEndL();
+    
+    /**
+     * Parses Response from server (MultiPart message) and extracts MimeBoundary part
+     * and MimeBoundaryEnd part
+     * @param aDataPartPtr DataPart come from server that to be parsed and after parsing 
+     *                     changed aDataPartPtr will be used for future parsing 
+     *                     (ParseMultiPartResponse() function)  
+     * @param aOffset Global offset using since beginning of calling ParseMultiPartResponse(). 
+     * @param aOffset1 Global offset1 (searches the end of MultiPart message)
+                       using since beginning of calling ParseMultiPartResponse(). 
+     */
+    void MimeBoundaryInL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1);
+    
+    /**
+     * Parses Response from server (MultiPart message) and extracts XopEnvelope part
+     * @param aDataPartPtr DataPart come from server that to be parsed and after parsing 
+     *                     changed aDataPartPtr will be used for future parsing 
+     *                     (ParseMultiPartResponse() function)  
+     * @param aOffset Global offset using since beginning of calling ParseMultiPartResponse(). 
+     * @param aOffset1 Global offset1 (searches the end of MultiPart message)
+                       using since beginning of calling ParseMultiPartResponse(). 
+     */
+    void XopEnvelopeResponseL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1);    
+
+    /**
+     * Parses Response from server (MultiPart message) and extracts header of Blob part
+     * @param aDataPartPtr DataPart come from server that to be parsed and after parsing 
+     *                     changed aDataPartPtr will be used for future parsing 
+     *                     (ParseMultiPartResponse() function)  
+     * @param aOffset Global offset using since beginning of calling ParseMultiPartResponse(). 
+     * @param aOffset1 Global offset1 (searches the end of MultiPart message)
+                       using since beginning of calling ParseMultiPartResponse(). 
+     */
+    void BlobHeaderResponseL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1); 
+    
+    /**
+     * Parses Response from server (MultiPart message) and extracts Blob part
+     * and puts it in the file
+     * @param aDataPartPtr DataPart come from server that to be parsed and after parsing 
+     *                     changed aDataPartPtr will be used for future parsing 
+     *                     (ParseMultiPartResponse() function)  
+     * @param aOffset Global offset using since beginning of calling ParseMultiPartResponse(). 
+     * @param aOffset1 Global offset1 (searches the end of MultiPart message)
+                       using since beginning of calling ParseMultiPartResponse(). 
+     */
+    void BlobResponseL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1);
+    
+        // New functions
+
+                                        
+ 
+    /**
+     * Creates header for SoapEnvelope in Request
+     */
+    virtual void MessageHeaderL();
+    
+    /**
+     * Creates SoapEnvelope in Request
+     */
+    virtual void MessageL();
+    
+
+protected: // Data
+
+    
+	// stores an array consisting Blobs (Request)
+   	RArray<TXmlEngDataContainer> iBinaryDataList; // owned
+   	
+   	// stores XopEnvelope come from server side (Response)
+   	RBuf8 iXopEnvelopeResponse;         // owned
+   	
+   	// stores SoapAction taken from HttpTransportProperties
+    RBuf8 iSoapAction;                  // owned   
+	
+	// stores content-ID for root header (Request)
+	RBuf8 iRootCid;                     // owned
+	
+	// stores MimeBoundary of MultiPart (Request)
+	RBuf8 iMimeBoundaryOut;             // owned
+	
+	// stores MimeBoundary of MultiPart (Response)
+	RBuf8 iMimeBoundaryIn;              // owned
+	
+	// stores MimeBoundaryEnd of MultiPart (Response)
+	RBuf8 iMimeBoundaryEndIn;           // owned
+	
+	// stores header of Blob (Response)
+	RBuf8 iBlobHeader;                  // owned  
+    
+    // stores number of a part that sould be sent (Request) 
+    TUint iPartDataOut;
+    
+    // stores is it the last part or not (Request)
+    TBool iLastPartOut;
+    
+    // stores number of a part that comes from server (Response)
+    TUint iPartDataIn;
+    
+    // stores is it the last part or not (Response)
+    TBool iLastPartIn;
+    
+    // stores how many parts there are in XOP (Request)
+   	TUint iCountDataParts;
+   	
+   	// stores the data of current part that should be sent (Request) 
+   	RBuf8 iCurrentPart;                 // owned
+   	
+   	// stores is it still CurrentPart or now goes a new one - 
+   	//for big parts that HttpChannel can't get at once  (Request)
+   	TBool iCurPart;
+   	
+   	// stores is it end of Blob (Request)
+   	TBool iBinaryDataEnd;
+   	
+   	// stores status that size of Blob was calculated/wasn't calculated (Request)
+ 	TBool iChecked;
+ 	
+ 	// stores which part of Blob goes to the server (Request)
+ 	TUint iBinaryDataPart;
+ 	
+ 	// stores number of Blob parts (calculated in SizeBinaryData() function)
+ 	TUint iBinaryDataParts;
+ 	
+ 	// stores hom many bytes there are in the last Blob part (calculated in SizeBinaryData())
+ 	TUint iBinaryDataRest;
+ 	
+ 	// stores was already created File for incoming Blob or not (Response)
+ 	TBool iFirst;
+ 	
+ 	// stores array of Cids of incoming Blobs (Response)
+ 	RArray<RBuf8> iCids;                // owned
+ 	
+ 	// stores array of file names of incoming Blobs (Response)
+ 	RArray<RBuf8> iFileNames;           // owned
+ 	
+ 	MSenMessage* iMessage;
+    };
+
+#endif // WSF_MultiPart_TXN_STATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senresponseobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           An interface class for receiving responses to the HTTP
+*                requests submitted.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_RESPONSE_OBSERVER_H
+#define SEN_RESPONSE_OBSERVER_H
+
+#include "SenHttpTransportProperties.h"
+#include "SenServiceConnection.h"
+_LIT8(KDefaultContentType,              "text/xml; charset=UTF-8");
+
+
+// CLASS DECLARATION
+
+/**
+ * An interface class for receiving responses to the HTTP
+ * requests submitted.
+ *
+ */
+
+class MSenResponseObserver
+    {
+    public:
+    
+        /**
+         * Receive response to a request submitted. This method
+         * takes the ownership of the heap buffer aContent.
+         *
+         * @param aId submit id which identifies the request.
+         * @param aContentType incoming response content type.
+         * @param aContent incoming response content.
+         * @param aHttpProperties - properies of response(e.g.such as file names where BLOBs are saved) or NULL
+         * @leave if aContent is NULL.
+         */
+        virtual void ResponseReceivedL(TInt aId,
+                                       const TAny* aContentType,
+                                       HBufC8* aContent,
+                                       CSenHttpTransportProperties* aHttpProperties = NULL) = 0;
+    
+        /**
+         * Error occurred while receiving response. Error code
+         * is either system error code or own error code. 
+         *
+         * @param aId submit id which identifies the request.
+         * @param aError error code.
+         */
+        virtual void ResponseErrorL(TInt aId,
+                                   TInt aError,
+                                   HBufC8* aErrorBody,
+                                   CSenHttpTransportProperties* aHttpProperties = NULL) = 0;
+	    /**
+	     * State has changed 
+	     * 
+	     * @param aId submit id which identifies the request.
+	     * @param aState New State of the transaction.
+	     */
+		virtual void StateChanged(TInt aId, TInt aState) = 0;
+        virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                    const TDesC8& aSoapOrCid, TInt aProgress) = 0;
+		virtual void SetTrafficDetails(TSenDataTrafficDetails& aDetails) = 0; 
+
+        virtual MSenProperties& PropertiesL() = 0;
+
+    };
+
+
+
+#endif // SEN_RESPONSE_OBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/senrfiletxnstate.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#ifndef WSF_RFILE_TXN_STATE_H
+#define WSF_RFILE_TXN_STATE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "sentxnstate.h"
+#include "senhttpchannelimpl.h"
+
+// CLASS DECLARATION
+/**
+ * Class for handling the transaction state in the http client class.
+ * Implements the MHTTPDataSupplier interface.
+ *	
+ */
+class CSenRfileTxnState : public CSenTxnState
+    {
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenRfileTxnState* NewLC(MSenResponseObserver& aObserver,
+                               //RFileLogger* aLog,
+                               const TDesC8* aUri,
+                               CSenHttpChannelImpl* aHttpClient,
+                               const TDesC8& aContentType,
+                               const RFile& aContent);
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenRfileTxnState* NewL(MSenResponseObserver& aObserver,
+                              //RFileLogger* aLog,
+                              const TDesC8* aUri,
+                              CSenHttpChannelImpl* aHttpClient,
+                              const TDesC8& aContentType,
+                              const RFile& aContent);
+
+    /**
+     * Virtual destructor.
+     *
+     */
+    virtual ~CSenRfileTxnState();
+
+        // New functions
+
+    // Functions from base classes
+
+    /**
+     * From MHTTPDataSupplier::GetNextDataPart.
+     * Obtain a data part from the supplier.  The data is guaranteed
+     * to survive until a call is made to ReleaseData().
+     * @param aDataPart The data part.
+     * @return ETrue if this is the last part, EFalse otherwise.
+     */
+    virtual TBool GetNextDataPart(TPtrC8& aDataPart);
+
+    /**
+     * From MHTTPDataSupplier::ReleaseData.
+     * Release the current data part being held at the data
+     * supplier.  This call indicates to the supplier that the part
+     * is no longer needed, and another one can be supplied, if
+     * appropriate.
+     */
+    virtual void ReleaseData();
+
+    /**
+     * From MHTTPDataSupplier::OverallDataSize.
+     * Obtain the overall size of the data being supplied, if known
+     * to the supplier.  Where a body of data is supplied in several
+     * parts this size will be the sum of all the part sizes. If
+     * the size is not known, KErrNotFound is returned; in this case
+     * the client must use the return code of GetNextDataPart to find
+     * out when the data is complete.
+     *
+     * @return A size in bytes, or KErrNotFound if the size is not known.
+     */
+    virtual TInt OverallDataSize();
+
+    /**
+     * From MHTTPDataSupplier::Reset.
+     * Reset the data supplier.  This indicates to the data supplier
+     * that it should return to the first part of the data.
+     * This could be used in a situation where the data consumer has
+     * encountered an error and needs the data to be supplied afresh.
+     * Even if the last part has been supplied (i.e. GetNextDataPart
+     * has returned ETrue), the data supplier should reset to the
+     * first part. If the supplier cannot reset it should return an
+     * error code; otherwise it should return KErrNone, where the
+     * reset will be assumed to have succeeded.
+     *
+     * @return KErrNone if successful, otherwise another error code.
+     */
+    virtual TInt Reset();
+    
+protected:
+    /**
+     * C++ default constructor.
+     *
+     */
+    CSenRfileTxnState(MSenResponseObserver& aObserver);//,
+                 //RFileLogger* aLog);
+   
+    /**
+     * File logger.
+     *
+     */
+    //RFileLogger* Log() const; 
+private://data  
+     
+	RFile iFile;
+	CSenHttpChannelImpl *iHttpClient ;
+	TBool iMoreContent;
+	HBufC8* iReadData;
+	/**Message content data pointer for POSTs.Not own.*/
+//	const TDesC8* iContent;
+	TInt iSize;
+/**
+     * Return flag if more body to be send. Only in chunked mode.
+     * 
+     * @since S60 ?S60_version
+     * @return True if more body to be send.
+     */    
+    TBool MoreBody() const;	
+	
+	
+private:
+
+    /**
+     * 2nd phase constructor.
+     *
+     */
+    void ConstructL(const TDesC8* aUri,
+                    CSenHttpChannelImpl* aHttpClient,
+                    const TDesC8& aContentType,
+                    const RFile& aContent);
+
+
+    };
+
+#endif // WSF_TXN_STATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/inc/sentxnstate.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,289 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSF_TXN_STATE_H
+#define WSF_TXN_STATE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <http/mhttpdatasupplier.h>
+#include <flogger.h>
+#include "senresponseobserver.h"
+#include "senmultipartutils.h"
+
+// CONSTANTS
+namespace
+    {
+    // Panic texts
+    _LIT(KRequestUriNullPanicText,   "Req URI is NULL");
+    _LIT(KPostContTypeNullPanicText, "PostCntType NULL");
+    _LIT8(KDownloadFolder, "SenBlobResponses"); // folder where should be created Blobs from Response
+    }
+
+// FORWARD DECLARATIONS
+class CSenAsyncTimeOut;
+// CLASS DECLARATION
+/**
+ * Class for handling the transaction state in the http client class.
+ * Implements the MHTTPDataSupplier interface.
+ *
+ */
+class CSenTxnState : public CBase,
+                     public MHTTPDataSupplier
+    {
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenTxnState* NewLC(MSenResponseObserver& aObserver,
+                               //RFileLogger* aLog,
+                               const TDesC8* aUri,
+                               const TDesC8& aContentType,
+                               const TDesC8* aBody = NULL);
+
+    /**
+     * Two-phased constructor.
+     *
+     */
+    static CSenTxnState* NewL(MSenResponseObserver& aObserver,
+                              //RFileLogger* aLog,
+                              const TDesC8* aUri,
+                              const TDesC8& aContentType,
+                              const TDesC8* aBody = NULL);
+
+    /**
+     * Virtual destructor.
+     *
+     */
+    virtual ~CSenTxnState();
+
+        // New functions
+
+    /**
+     * Transaction state's identifier.
+     * @return Id of the transaction handled in this transaction state object.
+     */
+    TInt Id() const;
+    
+    RHTTPTransaction Transaction() const;
+
+    /**
+     * Set transaction state's identifier.
+     */
+    void SetId(TInt aId);
+    void SetTransaction(RHTTPTransaction aTransaction);
+
+    /**
+     * Collects incoming response's body.
+     * @param aDataPart data chunk from response body's GetNextDataPart
+     */
+    void CollectResponseBodyL(const TDesC8& aDataPart);
+
+    /**
+     * @return URI for the message to be posted.
+     */
+    const TDesC8& RequestUri() const;
+
+    /**
+     * @return content type for the message to be posted.
+     */
+    const TDesC8& PostContentType() const;
+
+    inline TBool HasRequestBody() { return iHasRequestBody; }
+    void ResponseReceivedL(const TDesC8& aContentType);
+    void ResponseErrorL(TInt aError);
+	void StateChanged(TInt aState); // In order to propagate http status codes
+
+    TInt Cancel();
+
+    /**
+    * This transformation method appends the current
+    * contents of body (if not NULL) into a tailing
+    * postfix of current Uri. Method is typically 
+    * called prior sending a GET transaction. Method
+    * appends the "body" string (GET query string, 
+    * DELETE argument) into the base URI, as it is.
+    * The responsibility of the correctness for this
+    * newly formed URI is on the caller SendL/SubmitL,
+    * who might also has set the transport properties, too.
+    * Since method temporarily allocates memory in order
+    * to make a copy of the body, it may leave if system
+    * runs out of heap.
+    *
+    * Note: this method deletes the current body owned
+    * by this class instance, and sets iHasRequestBody
+    * to EFalse.
+    */
+    void TransformBodyToUriL();
+
+    /**
+    * Returns the body (content) of this transaction
+    */
+    TPtrC8 Body();
+    
+    /**
+    * Sets Content-Type in HTTP header
+    * @param aSession
+    * @param aHeaders
+    */
+    virtual void SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders);
+
+    // Functions from base classes
+
+    /**
+     * From MHTTPDataSupplier::GetNextDataPart.
+     * Obtain a data part from the supplier.  The data is guaranteed
+     * to survive until a call is made to ReleaseData().
+     * @param aDataPart The data part.
+     * @return ETrue if this is the last part, EFalse otherwise.
+     */
+    virtual TBool GetNextDataPart(TPtrC8& aDataPart);
+
+    /**
+     * From MHTTPDataSupplier::ReleaseData.
+     * Release the current data part being held at the data
+     * supplier.  This call indicates to the supplier that the part
+     * is no longer needed, and another one can be supplied, if
+     * appropriate.
+     */
+    virtual void ReleaseData();
+
+    /**
+     * From MHTTPDataSupplier::OverallDataSize.
+     * Obtain the overall size of the data being supplied, if known
+     * to the supplier.  Where a body of data is supplied in several
+     * parts this size will be the sum of all the part sizes. If
+     * the size is not known, KErrNotFound is returned; in this case
+     * the client must use the return code of GetNextDataPart to find
+     * out when the data is complete.
+     *
+     * @return A size in bytes, or KErrNotFound if the size is not known.
+     */
+    virtual TInt OverallDataSize();
+
+    /**
+     * From MHTTPDataSupplier::Reset.
+     * Reset the data supplier.  This indicates to the data supplier
+     * that it should return to the first part of the data.
+     * This could be used in a situation where the data consumer has
+     * encountered an error and needs the data to be supplied afresh.
+     * Even if the last part has been supplied (i.e. GetNextDataPart
+     * has returned ETrue), the data supplier should reset to the
+     * first part. If the supplier cannot reset it should return an
+     * error code; otherwise it should return KErrNone, where the
+     * reset will be assumed to have succeeded.
+     *
+     * @return KErrNone if successful, otherwise another error code.
+     */
+    virtual TInt Reset();
+	void SetSession(RHTTPSession aSession); 	 
+    TInt CalculateHeadersSizeL(RHTTPHeaders aHeaders); 
+
+    void SetTP(CSenHttpTransportProperties* tp);
+    MSenProperties& HttpChannelPropertiesL();
+    void EnableTimeOutL(TInt aTimeOutSec);
+    void DisableTimeOutL();
+protected:
+    /**
+     * C++ default constructor.
+     *
+     */
+    CSenTxnState(MSenResponseObserver& aObserver);//,
+                 //RFileLogger* aLog);
+   
+    /**
+     * File logger.
+     *
+     */
+    //RFileLogger* Log() const;
+
+private:
+
+    /**
+     * 2nd phase constructor.
+     *
+     */
+    void ConstructL(const TDesC8* aUri,
+                    const TDesC8& aContentType,
+                    const TDesC8* aBody);
+
+protected: // Data
+    /**
+     * Pointer to the requester's observer. Not owned.
+     */
+    MSenResponseObserver* iObserver;
+    /**
+     * Pointer to the logger. Not owned.
+     */
+    //RFileLogger* iLog; // Not owned
+    /**
+     * Request has body.
+     */
+    TBool iHasRequestBody;
+	
+	TBool iPostBodyReleased;
+	/**
+     * URI of the request to be posted.
+     */
+    HBufC8* iRequestUri;
+
+    RHTTPTransaction ipTransaction; // NOT OWNED
+    /**
+     * Id of the transaction in question.
+     */
+    TInt iId;
+	/**
+     * Body of the incoming response.
+     */
+    HBufC8* iResponseBody;
+    /**
+     * Body of the request to be posted.
+     */
+    HBufC8* iPostBody;
+    /**
+     * Content type of the request to be posted.
+     */
+    HBufC8* iPostContentType;
+    
+    /**
+     * Pointer to the Session. Not owned.
+     */    
+    RHTTPSession iSession; // Not owned	
+    /**
+     * Contains DataTraffic Details.
+     */    
+    TSenDataTrafficDetails iDetails; 
+    CSenHttpTransportProperties* iTP;//owned
+    
+    CSenAsyncTimeOut* iTimeOut;
+    };
+
+#endif // WSF_TXN_STATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/rom/wshttpchanneltransportplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSHTTPCHANNELTRANSPORTPLUGIN_IBY__
+#define __WSHTTPCHANNELTRANSPORTPLUGIN_IBY__
+
+//HttpChannelTransportPlugin
+ECOM_PLUGIN(SenHttpChannelTransport.DLL, 10274C73.RSC)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senasynctimeout.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "senasynctimeout.h"
+#include <http.h>
+#include "sentxnstate.h"
+
+CSenAsyncTimeOut::CSenAsyncTimeOut(CSenTxnState* aTxnState) :
+    CTimer(EPriorityStandard),
+    iTxnState(aTxnState)
+    // Standard priority
+    {
+    }
+
+CSenAsyncTimeOut* CSenAsyncTimeOut::NewLC(CSenTxnState* aTxnState)
+    {
+    CSenAsyncTimeOut* self = new ( ELeave ) CSenAsyncTimeOut(aTxnState);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CSenAsyncTimeOut* CSenAsyncTimeOut::NewL(CSenTxnState* aTxnState)
+    {
+    CSenAsyncTimeOut* self = CSenAsyncTimeOut::NewLC(aTxnState);
+    CleanupStack::Pop(); // self;
+    return self;
+    }
+
+void CSenAsyncTimeOut::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add(this);
+    }
+
+CSenAsyncTimeOut::~CSenAsyncTimeOut()
+    {
+    Cancel(); // Cancel any request, if outstanding
+    }
+
+
+void CSenAsyncTimeOut::StartL(TInt aTimeOutSec)
+    {
+    Cancel(); // Cancel any request, just to be sure
+    After(aTimeOutSec * 1000000); // Set for later
+    }
+
+void CSenAsyncTimeOut::RunL()
+    {
+    //cancel trans
+    iTxnState->Cancel();
+    iTxnState->ResponseErrorL(KErrTimedOut);
+    }
+
+TInt CSenAsyncTimeOut::RunError(TInt aError)
+    {
+    return aError;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senatomtxnstate.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <http.h>
+
+#include "senatomtxnstate.h"
+#include "senhttpchannel.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+
+// =========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CSenAtomTxnState::CSenAtomTxnState
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CSenAtomTxnState::CSenAtomTxnState(MSenResponseObserver& aObserver)
+    : CSenMultiPartTxnState(aObserver)
+    {
+    }
+    
+CSenAtomTxnState* CSenAtomTxnState::NewL(MSenResponseObserver& aObserver,
+                          		         const TDesC8* aUri,
+                                   		 CSenAtomEntry& aAtomEntry)
+                                   		 
+    {
+    CSenAtomTxnState* pNew = NewLC( aObserver, aUri, 
+                                	aAtomEntry);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenAtomTxnState* CSenAtomTxnState::NewLC(MSenResponseObserver& aObserver,
+                                  		  const TDesC8* aUri,
+                                  		  CSenAtomEntry& aAtomEntry)
+   
+    {
+    CSenAtomTxnState* pNew = new (ELeave) CSenAtomTxnState(aObserver);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aUri, aAtomEntry);
+    return pNew;
+    }
+
+
+void CSenAtomTxnState::ConstructL(const TDesC8* aUri,
+                         	      CSenAtomEntry& aAtomEntry)
+    {
+    
+    __ASSERT_ALWAYS(aUri != NULL,
+                    User::Panic(KRequestUriNullPanicText,
+                                CSenHttpChannel::ERequestUriNull));
+    iRequestUri = aUri->AllocL();
+    
+    if(!&aAtomEntry)
+		{
+		iHasRequestBody = EFalse;
+		User::Panic(KMultiPartNoRequestMessagePanicText, SenMultiPartUtils::EMultiPartNoRequestMessage);
+		}
+   	TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenAtomTxnState::ConstructL")));  	
+   	iMessage = &(MSenMessage&)aAtomEntry; // not owned
+   	RSenDocument doc = aAtomEntry.AsDocumentL();
+ 	doc.GetDataContainerList(iBinaryDataList);
+
+ 	iCountDataParts = 3 + iBinaryDataList.Count()*2; //how many parts there are in MultiPart message 
+	iHasRequestBody = ETrue;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// creates HTTP content type header for Atom multipart message
+//
+// HTTP content type header should be the next:
+// Content-Type: Multipart/Related;boundary=MIME_boundary;type="application/atom+xml";
+// start="<>"; start-info="text/xml"
+//
+//
+// Note: 1.it's one line without return carrige
+//       2."boundary" is generated as <rundomNumber>
+//       3."start" is generated as <randomNumber>@<homeTime>
+// ---------------------------------------------------------------------------
+//
+void CSenAtomTxnState::SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders)
+	{
+	_LIT8(KMultipartRelated,"Multipart/Related");
+	_LIT8(KBoundry,"boundary");
+	_LIT8(KType,"type");
+	_LIT8(KStart,"start");
+	_LIT8(KStartInfo,"start-info");
+    _LIT8(KApplicationAtom,"\"application/atom+xml\"");
+    _LIT8(KTextXml,"\"text/xml\"");
+    _LIT8(KSlashLessthan,"\"<");
+	_LIT8(KSlashGreaterthan,">\"");
+	SenMultiPartUtils::GenerateRandomRootCidL(iRootCid);
+	RBuf8 rootCid(NULL);
+	rootCid.ReAllocL(4+iRootCid.Length());
+	CleanupClosePushL(rootCid);
+    rootCid.Append(KSlashLessthan);
+	rootCid.Append(iRootCid);
+	rootCid.Append(KSlashGreaterthan);
+	 
+	SenMultiPartUtils::GenerateRandomBoundaryL(iMimeBoundaryOut);
+
+	RStringF multipartRelated = aSession.StringPool().OpenFStringL(KMultipartRelated);
+	RStringF boundary         = aSession.StringPool().OpenFStringL(KBoundry);
+	RStringF boundaryVal      = aSession.StringPool().OpenFStringL(iMimeBoundaryOut);
+	RStringF type             = aSession.StringPool().OpenFStringL(KType);
+	RStringF typeVal          = aSession.StringPool().OpenFStringL(KApplicationAtom);
+	RStringF start            = aSession.StringPool().OpenFStringL(KStart);
+	RStringF startVal         = aSession.StringPool().OpenFStringL(rootCid);
+	RStringF startInfo        = aSession.StringPool().OpenFStringL(KStartInfo);
+	RStringF startInfoVal   = aSession.StringPool().OpenFStringL(KTextXml);
+	
+	CleanupStack::PopAndDestroy(&rootCid);
+	
+	THTTPHdrVal contentTypeVal(multipartRelated);
+	THTTPHdrVal boundVal(boundaryVal);
+	THTTPHdrVal tVal(typeVal);
+	THTTPHdrVal stVal(startVal);
+	
+	THTTPHdrVal stInfoVal;
+
+	stInfoVal = startInfoVal;
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+					   contentTypeVal, boundary, boundVal);
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+				       contentTypeVal, type, tVal);
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+					   contentTypeVal, start, stVal);
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+					   contentTypeVal, startInfo, stInfoVal);
+
+					   
+    multipartRelated.Close();
+	boundary.Close();         
+	boundaryVal.Close();      
+	type.Close();             
+	typeVal.Close();          
+	start.Close();            
+	startVal.Close();         
+	startInfo.Close();        
+	startInfoVal.Close();   
+	}
+
+// ---------------------------------------------------------------------
+// creates AtomEntry in Request
+// ---------------------------------------------------------------------
+//    
+void CSenAtomTxnState::MessageL()
+    {
+    SenMultiPartUtils::SerializeMessageL(*(CSenAtomEntry*)iMessage, iCurrentPart, ESerializerDefault);
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenAtomTxnState::GetNextDataPart - aDataPart (Atom Message):")));
+    iCurPart = ETrue; 
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senhttpchannelimpl.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1939 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <uri8.h>
+#include <es_sock.h>
+#include <in_sock.h>
+#include <http.h>
+
+#include "sendebug.h" // filelogging and debugging MACROS
+#include <SenServiceConnection.h> // KErrSenNoHttpResponseBody
+#include <SenElement.h>
+#include <SenXmlUtils.h>
+#include <SenHttpTransportProperties.h>
+#include "senhttpchannelimpl.h"
+#include "senhttpeventhandler.h"
+#include "sentxnstate.h"
+#include "senatomtxnstate.h"
+#include "senrfiletxnstate.h"
+#include "senhttpchannel.h"
+#include "senlayeredhttptransportproperties.h"
+#include "msenidentitymanager.h"
+#include "senlogger.h"
+
+#include "senhttpchanneltransportplugin.h"
+//For HTTPProxyFilter
+#include <HttpFilterProxyInterface.h>
+#include <HttpFilterAcceptHeaderInterface.h>
+#include <HttpFilterCommonStringsExt.h>
+#include <DeflateFilterInterface.h>
+
+// CONSTANTS
+namespace
+    {
+    _LIT(KTxnStateNullPanicText,            "TxnState is NULL");
+
+    // Minimum granularity for array initialization
+    const TInt KMinimumArrayGranularity =   1;
+
+#ifdef _SENDEBUG
+    // logging constants
+    //_LIT(KLogFileDir, "SenHttpChannel");
+   // _LIT(KLogFileName, "SenHttpChannel.log");
+    _LIT(KDateFormat,"%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S.%C%:3");
+    // Size of buffer used when submitting request bodies
+    const TInt KMaxHeaderNameLen = 16;
+    const TInt KMaxHeaderValueLen = 128;
+    const TInt KMaxFilterNameLen = 16;
+#endif
+    }
+
+//
+// Implementation of CSenHttpChannelImpl
+//
+CSenHttpChannelImpl::CSenHttpChannelImpl(MSenIdentityManager& aManager)
+:
+    iIapId(KErrNone),
+    iManager(aManager),
+    iSessionAuthentication(NULL),
+    iPasswordFromUser(EFalse),
+    iExplicitIapDefined(EFalse),
+    iProxyHostPort(NULL),
+    iXopResponse(EFalse),
+    iHasHttpContentType(ETrue)
+    {
+    }
+
+CSenHttpChannelImpl* CSenHttpChannelImpl::NewL(MSenIdentityManager& aManager)
+    {
+    CSenHttpChannelImpl* pNew = NewLC(aManager);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenHttpChannelImpl* CSenHttpChannelImpl::NewLC(MSenIdentityManager& aManager)
+    {
+    CSenHttpChannelImpl* pNew = new (ELeave) CSenHttpChannelImpl(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenHttpChannelImpl* CSenHttpChannelImpl::NewL(MSenIdentityManager& aManager,
+                                               TUint32 aIapId)
+    {
+    CSenHttpChannelImpl* pNew = NewLC(aManager, aIapId);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenHttpChannelImpl* CSenHttpChannelImpl::NewLC(MSenIdentityManager& aManager,
+                                                TUint32 aIapId)
+    {
+    CSenHttpChannelImpl* pNew = new (ELeave) CSenHttpChannelImpl(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aIapId); 
+    return pNew;
+    }
+
+// Ask IAP from user
+void CSenHttpChannelImpl::ConstructL()
+    {
+    // Open connection to the file logger server
+    TLSLOG_OPEN(KSenHttpChannelLogChannelBase, KSenHttpChannelLogLevel, KSenHttpChannelLogDir, KSenHttpChannelLogFile);
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenHttpChannelImpl::ConstructL - Log file opened")));
+
+    // Open the RHTTPSession
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("- Opening HTTP/TCP session.")));
+
+    iSess.OpenL();
+
+    // Store the string pool for this HTTP session
+    iStringPool = iSess.StringPool();
+
+    // Install this class as the callback for authentication requests
+    InstallAuthenticationL( iSess );
+    //Install Proxy Filter  
+    iDeflateFilter = EFalse;
+
+#ifdef EKA2
+  //#ifndef _DEBUG 
+    CHttpFilterProxyInterface::InstallFilterL( iSess );
+    iSess.StringPool().OpenL(HttpFilterCommonStringsExt::GetLanguageTable());
+    iSess.StringPool().OpenL(HttpFilterCommonStringsExt::GetTable());
+
+    CHttpFilterAcceptHeaderInterface::InstallFilterL(iSess);
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"HTTPProxyFilter installed for EKA2 build.");
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"HTTPAcceptFilter installed for EKA2 build.");
+  //#else
+  //  LOG_WRITE_L("HTTPProxyFilter is NOT in use with EKA2 debug builds.");
+  //#endif
+#else // __INSTALL_HTTP_PROXY_FILTER__ is not defined by macro in .mmp
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"HTTPProxyFilter is NOT in use with EKA1.");
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"HTTPAcceptProxyFilter is NOT in use with EKA1.");
+#endif // __INSTALL_HTTP_PROXY_FILTER__
+
+    iTransObs = CSenHttpEventHandler::NewL(this);//, &iLog);
+    iTxnStates =
+        new (ELeave) CArrayPtrFlat<CSenTxnState>(KMinimumArrayGranularity);
+
+    iBasicConnectionTries = 0;
+
+#ifdef _SENDEBUG
+    ListFilters();
+#endif // _SENDEBUG
+    }
+
+// Forces preselected IAP to be used!
+void CSenHttpChannelImpl::ConstructL( TUint32 aIapId )
+    {
+    // Initialize
+//    SetupConnectionWithIapPrefsL( aIapId, iConnection, iSockServ );
+        
+    ConstructL();
+
+//    AttachSocketServerAndConnectionWithHttpSession( aIapId, iConnection, iSockServ );
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::ConstructL - Setting IAP id");
+
+
+//    Use local variable (new RSocketServer each time; handle is given to RHTTPSession via RConnectionInfo..)
+//    RSocketServ server; // with "anon" (local) socket servers, should we keep array of open ones in case of pending txns?
+//    SetIapPrefsL(aIapId, iConnection, server);
+
+    const TInt result = SetIapPrefsL(aIapId, ETrue, iConnection, iSockServ);
+    User::LeaveIfError( result );
+    
+    }
+
+CSenHttpChannelImpl::~CSenHttpChannelImpl()
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::~CSenHttpChannelImpl()");
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"Closing http session.");
+    iSess.Close();
+    if (iTransObs) //might be NULL if constructor failed ---
+        {
+        delete iTransObs;   
+        iTransObs = NULL;
+        }
+    if (iTxnStates) //might be NULL if constructor failed--- 
+        {
+        iTxnStates->ResetAndDestroy();
+        delete iTxnStates;
+        iTxnStates = NULL;
+        }
+
+    if(iProxyHostPort)
+        {
+        delete iProxyHostPort;
+        iProxyHostPort = NULL;
+        }
+    
+    if(iMultiPartContentType.params.Count())
+        {
+        iMultiPartContentType.params.Close();
+        }
+    if(iDeflateFilter)
+        {
+        REComSession::DestroyedImplementation(KDeflateFilterUid); 	
+        }
+        
+    iConnection.Close();
+    iSockServ.Close();
+
+    // Close the log file and the connection to the server.
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("Log file closed.")));
+    TLSLOG_CLOSE(KSenHttpChannelLogChannelBase);
+    }
+
+// This function expects that RConnection has been connected
+// and that RConnection has already been opened!
+/*
+void CSenHttpChannelImpl::SetIapPrefsL(TUint32 aIapId, 
+                                       RConnection& aConnection, 
+                                       RSocketServ& aSocketServer)
+    {
+    // Check whether IAP ID is not equal with the one that is currently in effect:
+    if(iExplicitIapDefined && iIapId == aIapId )
+        {
+        return; // nothing to do
+        }
+        
+    LOG_WRITEFORMAT((_L8("- SetIapPrefsL: Re-setting IAP ID (%d)"), aIapId));
+
+    // Check if socket server (connection) is already open..
+    if( iExplicitIapDefined )
+        {
+         // Socket server opened once before for some other IAP
+        LOG_WRITE_L("- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop");
+        aConnection.Stop();
+        }
+    else
+        {
+        aConnection.Stop(); // prompted from user
+        iSess.DisconnectL();
+        iSess.ConnectL();
+
+        // Connect to a socket server    
+        LOG_WRITE_L("- SetIapPrefsL: Connecting to new socket server");    
+        User::LeaveIfError(aSocketServer.Connect());       
+
+        // Open new connection
+        LOG_WRITE_L("- SetIapPrefsL: Opening new RConnection using the socket server.");       
+        User::LeaveIfError(aConnection.Open(aSocketServer)); 
+        }
+        
+    // Set the IAP selection preferences (IAP ID, do not prompt)
+    TCommDbConnPref pref;
+    pref.SetIapId( aIapId );    
+
+    TCommDbDialogPref dialogPref;
+    dialogPref = ECommDbDialogPrefDoNotPrompt;
+    pref.SetDialogPreference(dialogPref);
+    
+    // Start the connection with the new preferences
+    LOG_WRITE_L("- SetIapPrefsL: Calling RConnection::Start with new IAP prefs");
+    aConnection.Start(pref);
+    
+    // Get the connection "handle" from the HTTP session    
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+     
+    // Attach socket server
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketServ,
+                                                RHTTPSession::GetTable()),
+                                                THTTPHdrVal(aSocketServer.Handle()));
+    
+    // Attach connection  
+    TInt connPtr = REINTERPRET_CAST(TInt, &aConnection);
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketConnection, 
+                                                RHTTPSession::GetTable()), 
+                                                THTTPHdrVal(connPtr));
+                                                
+    // Remember the IAP id that is being set; there is
+    // no direct API to query effective IAP ID from CommsDB.
+    iExplicitIapDefined = ETrue;
+    iIapId = aIapId;
+    }
+*/
+
+
+/*
+void CSenHttpChannelImpl::SetupConnectionWithIapPrefsL( TUint32 aIapId, 
+                                                        RConnection& aConnection, 
+                                                        RSocketServ& aSocketServer )
+    {
+    // Check whether IAP ID is not equal with the one that is currently in effect:
+    if(iExplicitIapDefined && iIapId == aIapId )
+        {
+        return; // nothing to do
+        }
+        
+    LOG_WRITEFORMAT((_L8("- SetIapPrefsL, IAP ID (%d)"), aIapId));
+
+    // Check if socket server (connection) is already open..
+    if( iExplicitIapDefined )
+        {
+         // Socket server opened once before for some other IAP
+        LOG_WRITE_L("- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop");
+        aConnection.Stop();
+        }
+    else
+        {
+        // Connect to a socket server    
+        LOG_WRITE_L("- SetIapPrefsL: Connecting to new socket server");    
+        User::LeaveIfError( aSocketServer.Connect() );       
+
+        // Open new connection
+        LOG_WRITE_L("- SetIapPrefsL: Opening new RConnection using the socket server.");       
+        User::LeaveIfError( aConnection.Open(aSocketServer) ); 
+        }
+        
+    // Set the IAP selection preferences (IAP ID, do not prompt)
+    TCommDbConnPref pref;
+    pref.SetIapId( aIapId );    
+
+    TCommDbDialogPref dialogPref;
+    dialogPref = ECommDbDialogPrefDoNotPrompt;
+    pref.SetDialogPreference(dialogPref);
+    
+    // Start the connection with the new preferences
+    LOG_WRITE_L("- SetIapPrefsL: Calling RConnection::Start with new IAP prefs");
+    aConnection.Start(pref);
+    }
+    
+
+void CSenHttpChannelImpl::AttachSocketServerAndConnectionWithHttpSession( TUint32 aIapId, 
+                                                                          RConnection& aConnection, 
+                                                                          RSocketServ& aSocketServer )
+    {
+    if(iExplicitIapDefined && iIapId == aIapId )
+        {
+        return; // nothing to do
+        }
+
+    // Get the connection "handle" from the HTTP session    
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+     
+    // Attach socket server
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketServ,
+                                                RHTTPSession::GetTable()),
+                                                THTTPHdrVal(aSocketServer.Handle()));
+    
+    // Attach connection  
+    TInt connPtr = REINTERPRET_CAST(TInt, &aConnection);
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketConnection, 
+                                                RHTTPSession::GetTable()), 
+                                                THTTPHdrVal(connPtr));
+                                                
+    // Remember the IAP id that is being set, because *at the moment*,
+    // there is NO direct API to query effective IAP ID from CommsDB.
+    iExplicitIapDefined = ETrue;
+    iIapId = aIapId;
+    }
+    
+
+void CSenHttpChannelImpl::SetIapPrefsL( TUint32 aIapId, RConnection& aConnection, RSocketServ& aSocketServer )
+    {
+    SetupConnectionWithIapPrefsL( aIapId, aConnection, aSocketServer );
+    AttachSocketServerAndConnectionWithHttpSession( aIapId, aConnection, aSocketServer );
+    }        
+*/
+
+
+TInt CSenHttpChannelImpl::SetIapPrefsL( TUint32 aIapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer )
+   	{
+   	TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("- SetIapPrefsL, IAP ID (%d)"), aIapId));
+   	
+    // Check whether IAP ID is not equal with the one that is currently in effect:
+    if(iExplicitIapDefined && iIapId == aIapId )
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Iap Id is same as currently in effect");
+        return KErrNone;
+        }
+		else
+				{
+				TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Iap Id different with the currently in effect");
+				}    
+    
+
+    // Check if socket server (connection) is already open..
+    if( iExplicitIapDefined )
+        {
+         // Socket server opened once before for some other IAP
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop");
+        aConnection.Stop();
+        }
+    else
+        {
+        // Connect to a socket server    
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Connecting to new socket server");    
+        User::LeaveIfError( aSocketServer.Connect() );       
+
+        // Open new connection
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Opening new RConnection using the socket server.");       
+        User::LeaveIfError( aConnection.Open(aSocketServer) ); 
+        }
+        
+    // Set the IAP selection preferences (IAP ID, do not prompt)
+    /*
+    /*Single click connectivity feature has been implemented by CSock (RConnection class).
+    /*According to this client no need to set the IAP ID. 
+    /*Automatically RConnection will use the suitable IAP
+    */
+    
+
+	    TCommDbConnPref pref;
+    #ifndef __SINGLE_CLICK_CONNECTIVITY_ENABLED__	    
+	    pref.SetIapId( aIapId );
+		#else
+			pref.SetIapId( 0 );	 //By default IAP ID is "0". IAP selection will take care by RConnection
+    #endif //__SINGLE_CLICK_CONNECTIVITY_ENABLED__	    
+	    TCommDbDialogPref dialogPref;
+	    
+	    if (aDialogPref)
+	        {
+	        dialogPref = ECommDbDialogPrefDoNotPrompt;
+	        }
+	    else
+	        {
+	        dialogPref = ECommDbDialogPrefPrompt;
+	        }     
+	    pref.SetDialogPreference(dialogPref);
+    
+  	// Start the connection with the new preferences
+	  TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Calling RConnection::Start with new IAP prefs");
+
+    TInt retVal =aConnection.Start(pref);
+    
+		TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("RConnection->Start retVal [%d]"), retVal));
+		        
+    // Get the connection "handle" from the HTTP session    
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+     
+    // Attach socket server
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketServ,
+                                                RHTTPSession::GetTable()),
+                                                THTTPHdrVal(aSocketServer.Handle()));
+    
+    // Attach connection  
+    TInt connPtr = REINTERPRET_CAST(TInt, &aConnection);
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketConnection, 
+                                                RHTTPSession::GetTable()), 
+                                                THTTPHdrVal(connPtr));
+                                                
+    // Remember the IAP id that is being set, because *at the moment*,
+    // there is NO direct API to query effective IAP ID from CommsDB.
+    if (!retVal)
+        {
+        iExplicitIapDefined = ETrue;
+        iIapId = aIapId;
+        }
+    return retVal;
+    }
+TInt CSenHttpChannelImpl::SetSnapPrefsL( TUint32 aSnapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer )
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- CSenHttpChannelImpl::SetSnapPrefsL, SNAP ID (%d)"), aSnapId));
+		// Check whether SNAP ID is not equal with the one that is currently in effect:
+    if(iExplicitIapDefined && iSnapId == aSnapId )
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Sanp is same as currently in effect");
+        return KErrNone;
+        }
+		else
+			{
+			TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Sanp is different with currently in effect");
+			}        
+
+    // Check if socket server (connection) is already open..
+    if( iExplicitIapDefined )
+        {
+         // Socket server opened once before for some other IAP
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Re-using existing RConnection => calling RConnection::Stop");
+        aConnection.Stop();
+        }
+    else
+        {
+        // Connect to a socket server    
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Connecting to new socket server");    
+        User::LeaveIfError( aSocketServer.Connect() );       
+
+        // Open new connection
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Opening new RConnection using the socket server.");       
+        User::LeaveIfError( aConnection.Open(aSocketServer) ); 
+        }
+        
+    // Set the SNAP selection preferences (SNAP ID)
+    TConnSnapPref pref;
+    pref.SetSnap(aSnapId);     
+    
+    // Start the connection with the new preferences
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Calling RConnection::Start with new SNAP prefs");
+    TInt retVal = aConnection.Start(pref);
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- SetSnapPrefsL, RConnection::Start returned: (%d)"), retVal));
+    
+    // Get the connection "handle" from the HTTP session    
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+     
+    // Attach socket server
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketServ,
+                                                RHTTPSession::GetTable()),
+                                                THTTPHdrVal(aSocketServer.Handle()));
+    
+    // Attach connection  
+    TInt connPtr = REINTERPRET_CAST(TInt, &aConnection);
+    connInfo.SetPropertyL(iStringPool.StringF(  HTTP::EHttpSocketConnection, 
+                                                RHTTPSession::GetTable()), 
+                                                THTTPHdrVal(connPtr));
+                                                
+    // Remember the SNAP id that is being set, because *at the moment*,
+    // there is NO direct API to query effective SNAP ID from CommsDB.
+    if (!retVal)
+        {
+        iExplicitIapDefined = ETrue;
+        iSnapId = aSnapId;
+        }
+    return retVal;
+    }
+
+TInt CSenHttpChannelImpl::SendL( MSenResponseObserver& aObserver,
+                                 const TDesC8& aUri,
+                                 const TDesC8& aContent,
+                                 CSenLayeredHttpTransportProperties& aProps )
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::SendL:");
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- Endpoint URI: %S"), &aUri));
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMaxLogLevel,"- Content(msg):");
+    TLSLOG_ALL(KSenHttpChannelLogChannelBase , KMaxLogLevel,(aContent));
+#endif
+
+    TPtrC8 contentType;
+    TInt retVal = aProps.ContentTypeL(contentType);
+    if(retVal!=KErrNone)
+        {
+        // Use the default
+        contentType.Set(KDefaultContentType);
+        }
+
+    CSenTxnState* pTxnState = CSenTxnState::NewL(aObserver,
+                                                 //Log(),
+                                                 &aUri,
+                                                 contentType,
+                                                 &aContent);
+
+    CleanupStack::PushL(pTxnState);
+    AppendNewTxnStateL(pTxnState);
+    CleanupStack::Pop(); // pTxnState
+
+    return InvokeHttpMethodL(pTxnState, aProps);
+    }
+    
+TInt CSenHttpChannelImpl::SendL( MSenResponseObserver& aObserver,
+                                 const TDesC8& aUri,
+                                 const RFile& aFile,
+                                 CSenLayeredHttpTransportProperties& aProps )
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::SendL:");
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- Endpoint URI: %S"), &aUri));
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMaxLogLevel,"- Content(msg):");
+#endif
+
+    TPtrC8 contentType;
+    TInt retVal = aProps.ContentTypeL(contentType);
+    if(retVal != KErrNone)
+        {
+        // Use the default
+        contentType.Set(KDefaultContentType);
+        }
+
+    CSenRfileTxnState* pTxnState = CSenRfileTxnState::NewL(aObserver,
+                                                 //Log(),
+                                                 &aUri,
+                                                 this,
+                                                 contentType,
+                                                 aFile);
+
+    CleanupStack::PushL(pTxnState);
+    AppendNewTxnStateL(pTxnState);
+    CleanupStack::Pop(); // pTxnState
+
+    return InvokeHttpMethodL(pTxnState, aProps);
+    }
+    
+    
+TInt CSenHttpChannelImpl::SendL(MSenResponseObserver& aObserver,
+                           	    const TDesC8& aUri,
+                               	CSenSoapEnvelope2& aContent, 
+                               	CSenLayeredHttpTransportProperties& aProps)
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::SendL:");
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- Endpoint URI: %S"), &aUri));
+    
+    TPtrC8 soapAction;
+    TInt retVal = aProps.SoapActionL(soapAction);
+    
+    CSenMtomTxnState* pMtomTxnState = CSenMtomTxnState::NewL(aObserver,
+                                             				 //Log(),
+                                             				 &aUri,
+                                             				 soapAction,
+                                             				 aContent);
+                                             				 
+    if (aContent.SoapVersion() == ESOAP12)
+      {
+    aProps.RemovePropertyL(KSoapActionLocalName, MSenLayeredProperties::ESenMessageLayer);
+      }
+
+	CleanupStack::PushL(pMtomTxnState);
+	AppendNewTxnStateL(pMtomTxnState);
+    CleanupStack::Pop(); // pMtomTxnState
+
+	return InvokeHttpMethodL(pMtomTxnState, aProps);
+    }
+TInt CSenHttpChannelImpl::SendL(MSenResponseObserver& aObserver,
+                           	    const TDesC8& aUri,
+                               	CSenAtomEntry& aContent, 
+                               	CSenLayeredHttpTransportProperties& aProps)
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::SendL:");
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- Endpoint URI: %S"), &aUri));
+    CSenAtomTxnState* pAtomTxnState = CSenAtomTxnState::NewL(aObserver,
+                                             				 &aUri,
+                                             				 aContent);
+                                             				 
+    CleanupStack::PushL(pAtomTxnState);
+	AppendNewTxnStateL(pAtomTxnState);
+    CleanupStack::Pop(); // pAtomTxnState
+
+	return InvokeHttpMethodL(pAtomTxnState, aProps);
+    }    
+/** Invoke the http method
+This actually creates the transaction,
+sets the headers and body and then starts the transaction
+*/
+TInt CSenHttpChannelImpl::InvokeHttpMethodL(CSenTxnState* aTxnState,
+                                            CSenLayeredHttpTransportProperties& aProps)
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::InvokeHttpMethodL");
+    TUriParser8 uri;
+    RStringF method;
+    TPtrC8 deflate;
+    // Set IAP preferences, if such exist in properties (and not already in effect):
+    TUint32 iapId(KErrNone);
+    TBool doNotPrompt(ETrue); 
+    
+    TInt retVal = aProps.IAPDialogL( doNotPrompt );
+    if ( retVal != KErrNone )
+        {
+        // by default, do not prompt (even if property does not exist!) 
+        // => only if property is set, and has value "FALSE", show PROMPT            
+        doNotPrompt = ETrue;
+        }
+
+    // Independent of dialog preference (property's existance), if IAP was predefined, it must be set        
+    if(((aProps.IapIdL(iapId)) == KErrNone))
+        {
+        retVal = SetIapPrefsL(iapId, doNotPrompt, iConnection, iSockServ);
+        }
+    else if(((aProps.SnapIdL(iapId)) == KErrNone))
+        {
+        retVal = SetSnapPrefsL(iapId, doNotPrompt, iConnection, iSockServ);
+        }
+    else//to better control RConnection, we have to call Start by ourselve
+        {
+        retVal = SetSnapPrefsL(0, EFalse, iConnection, iSockServ);
+        if(retVal == KErrNotFound)
+            {
+            retVal = SetIapPrefsL(0, EFalse, iConnection, iSockServ);
+            }
+        }
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Set Snap/IAP prefs retVal [%d]"), retVal));    
+    User::LeaveIfError(retVal);
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::InvokeHttpMethodL After User::Leave");
+    TInt ret=iConnection.GetIntSetting(_L("IAP\\Id"), iUsedIapId);
+    // Check transport properties
+    CSenLayeredHttpTransportProperties::TSenHttpMethod httpMethod;
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("IAP %d"), iapId));
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("DONT PROMPT %d"), doNotPrompt));
+    TInt retValHttpMethod = aProps.HttpMethodL(httpMethod);
+    
+    
+    /*Installing the deflate filter based on the property values */
+    /*Once installed, the filter will be alive for on session lifetime */   
+    if(KErrNone == aProps.PropertyL(KWsPropertyValueHttpFilterDeflate,deflate))
+       {
+        if(!iDeflateFilter)
+          {
+           TRAPD(err, CHttpDeflateFilter::InstallFilterL(iSess));
+           if(err == KErrNone) 
+           	{
+		     		iDeflateFilter = ETrue;  
+	          TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"HTTPDeflateFilter installed for EKA2 build.");	
+						}
+					else
+		     		{
+		      	TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"ERROR:HTTPDeflateFilter Not installed for EKA2 build.");
+		     		}
+          }
+       }
+
+
+    if(!aTxnState->HasRequestBody())
+        {
+        if (retValHttpMethod) httpMethod = CSenLayeredHttpTransportProperties::ESenHttpGet;
+        User::LeaveIfError( uri.Parse(aTxnState->RequestUri()) );
+        switch(httpMethod)
+            {
+            case CSenLayeredHttpTransportProperties::ESenHttpPost:
+                {
+                method = iStringPool.StringF(HTTP::EPOST, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EPOST");
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttpPut:
+                {
+                method = iStringPool.StringF(HTTP::EPUT, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EPUT");
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttpDelete:
+                {
+                method = iStringPool.StringF(HTTP::EDELETE, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EDELETE");
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttpGet:
+            default:
+                {
+                // Default to HTTP GET, if no body has been provided
+                method = iStringPool.StringF(HTTP::EGET, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EGET");
+                }
+            }
+        }
+    else 
+        {   
+        // Some request "body"; or a query string for GET or DELETE was provided
+        if (retValHttpMethod) httpMethod = CSenLayeredHttpTransportProperties::ESenHttpPost;
+        switch(httpMethod)
+            {
+            case CSenLayeredHttpTransportProperties::ESenHttpGet:
+                {
+                method = iStringPool.StringF(HTTP::EGET, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EGET");
+                // The responsibility of correct query string for GET URI 
+                // is on the shoulders of the original invoker (public API
+                // caller):
+                aTxnState->TransformBodyToUriL();
+
+                // NOTE: warning from Uri16.h:
+                // @warning The descriptor that is parsed by an object of this class will be referenced 
+                // by that object. If the original descriptor is no longer in scope there will be undefined 
+                // behaviour.
+                User::LeaveIfError( uri.Parse(aTxnState->RequestUri()) );
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttpPut:
+                {
+                method = iStringPool.StringF(HTTP::EPUT, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EPUT");
+                User::LeaveIfError( uri.Parse(aTxnState->RequestUri()) );
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttpDelete:
+                {
+                method = iStringPool.StringF(HTTP::EDELETE, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EDELETE");
+                // The responsibility of correct query string for DELETE URI 
+                // argument is on the shoulders of the original invoker 
+                // (public API caller):
+                aTxnState->TransformBodyToUriL();
+                User::LeaveIfError( uri.Parse(aTxnState->RequestUri()) );
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttpPost:
+            default:
+                {
+                // default to HttpPost
+                method = iStringPool.StringF(HTTP::EPOST, RHTTPSession::GetTable());
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- HTTP::EPOST");
+                User::LeaveIfError( uri.Parse(aTxnState->RequestUri()) );
+                }
+            }
+        }
+
+
+    RHTTPTransaction transaction = iSess.OpenTransactionL(uri, *iTransObs, method);
+    iHttpTransaction = transaction ;
+    aTxnState->SetId(transaction.Id());
+    aTxnState->SetTransaction(transaction);
+    aTxnState->SetSession(iSess); 
+    RHTTPHeaders hdr = transaction.Request().GetHeaderCollection();
+
+    // Add request headers: Accept, User-Agent, any other user defined ones
+    AddRequestHeadersL(hdr, aProps);
+
+    // Add Content type header and request body if available
+    if(aTxnState->HasRequestBody())
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- Adding content type header and request body");
+
+        // Set the "Content-Type" HTTP header here, and *only* here(!)
+        aTxnState->SetContentTypeHeaderL(iSess, hdr);
+
+        MHTTPDataSupplier* pDataSupplier = aTxnState;
+        transaction.Request().SetBody(*pDataSupplier);
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- This transaction does not carry a request body.");
+        }
+#endif
+
+    // Submit the transaction
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- Submitting the transaction.");
+    transaction.SubmitL();
+    return aTxnState->Id();
+    }
+
+void CSenHttpChannelImpl::NotifyMoreBodyL()    
+{
+	iHttpTransaction.NotifyNewRequestBodyPartL();
+}
+
+void CSenHttpChannelImpl::SetProxyL(const TDesC8& aProxyHostBaseAddr, 
+                                    TInt aProxyPort)
+    {
+    TBuf8<64> port;
+    port.AppendNum(aProxyPort);
+    HBufC8* pProxyHostPort = HBufC8::NewLC(aProxyHostBaseAddr.Length()
+                                           +KColon().Length()
+                                           +port.Length());
+
+    pProxyHostPort->Des().Append( aProxyHostBaseAddr );
+    pProxyHostPort->Des().Append( KColon );
+    pProxyHostPort->Des().AppendNum( aProxyPort );
+
+    TPtrC8 proxy = pProxyHostPort->Des();
+    SetProxyL( proxy );
+    CleanupStack::PopAndDestroy(pProxyHostPort);
+    }
+
+void CSenHttpChannelImpl::SetProxyL(const TDesC8& aProxyAddrStr)
+    {
+    if(iProxyHostPort && iProxyHostPort->Compare(aProxyAddrStr)==0)
+        {
+        // nothing to do, proxy address is already in use
+        return;
+        }
+
+    delete iProxyHostPort;
+    iProxyHostPort = NULL;
+
+    iProxyHostPort = aProxyAddrStr.AllocL();
+
+    RStringF proxyAddr = iSess.StringPool().OpenFStringL(*iProxyHostPort);
+
+    CleanupClosePushL(proxyAddr);
+
+    // Set the proxy here...
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+    THTTPHdrVal proxyUsage(
+        iSess.StringPool().StringF(HTTP::EUseProxy, RHTTPSession::GetTable()));
+    connInfo.SetPropertyL(
+        iSess.StringPool().StringF(HTTP::EProxyUsage, RHTTPSession::GetTable()),
+                                    proxyUsage);
+    connInfo.SetPropertyL(
+        iSess.StringPool().StringF(
+                    HTTP::EProxyAddress, RHTTPSession::GetTable()), proxyAddr);
+
+    CleanupStack::PopAndDestroy(); // proxyAddr
+    }
+
+void CSenHttpChannelImpl::SetHttpVersionL(TInt aVersion)
+    {
+    HTTP::TStrings httpVersion = HTTP::EHttp11;
+    if(0 == aVersion)
+        {
+        httpVersion = HTTP::EHttp10;
+        }
+
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+    RStringPool p=iSess.StringPool();
+    connInfo.SetPropertyL(p.StringF(
+                            HTTP::EHTTPVersion,RHTTPSession::GetTable()),
+                          THTTPHdrVal(
+                          p.StringF(httpVersion,RHTTPSession::GetTable())));
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("Http version is set to HTTP 1.%d"), aVersion));
+    }
+
+void CSenHttpChannelImpl::SetProxyUsageL(TBool aProxyUsage)
+    {
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+    RStringPool strPool=iSess.StringPool();
+    if ( aProxyUsage )
+        {
+        connInfo.SetPropertyL
+            ( 
+            strPool.StringF( HTTP::EProxyUsage, RHTTPSession::GetTable() ), 
+            THTTPHdrVal( strPool.StringF(HTTP::EUseProxy, RHTTPSession::GetTable() ) )
+            );    
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Http Proxy usage is set to TRUE")));
+        }
+    else
+        {
+        connInfo.SetPropertyL
+            ( 
+            strPool.StringF( HTTP::EProxyUsage, RHTTPSession::GetTable() ), 
+            THTTPHdrVal( strPool.StringF(HTTP::EDoNotUseProxy, RHTTPSession::GetTable() ) )
+            );    
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Http Proxy usage is set to FALSE")));
+        
+        }
+    }
+
+void CSenHttpChannelImpl::SetSecureDialogL(TBool aSecureDialog)
+    {
+    RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
+    RStringPool strPool=iSess.StringPool();
+    if ( aSecureDialog )
+        {
+        connInfo.SetPropertyL
+            ( 
+            strPool.StringF( HTTP::ESecureDialog, RHTTPSession::GetTable() ), 
+            THTTPHdrVal( strPool.StringF(HTTP::EDialogPrompt, RHTTPSession::GetTable() ) )
+            );    
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Http Secure dialog prompt is set to TRUE")));
+        }
+    else
+        {
+        connInfo.SetPropertyL
+            ( 
+            strPool.StringF( HTTP::ESecureDialog, RHTTPSession::GetTable() ), 
+            THTTPHdrVal( strPool.StringF(HTTP::EDialogNoPrompt, RHTTPSession::GetTable() ) )
+            );    
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Http Secure dialog prompt is set to FALSE")));
+        
+        }
+    }
+    
+// ----------------------------------------------------------------------------
+// CSenHttpChannelImpl::AddRequestHeadersL
+// Adds headers to the request.
+// ----------------------------------------------------------------------------
+void CSenHttpChannelImpl::AddRequestHeadersL(RHTTPHeaders& aHeaders,
+                                             CSenLayeredHttpTransportProperties& aProps)
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenHttpChannelImpl::AddRequestHeadersL")));
+
+
+    //TPtrC8 useragent;
+    TInt retVal;// = aProps.UserAgentL(useragent);
+
+    // It is MANDATORY, that User-Agent header exists:
+ //   if ( useragent.Length()== 0 )
+ //       {
+ //       //iProperties->SetPropertyL(KUserAgentLocalName, KSenHttpChannelUserAgentHeaderDefault, KHttpHeaderType);            
+ //       useragent.Set( KSenHttpChannelUserAgentHeaderDefault );
+ //       }
+
+    // Fetch the accepted content types:
+    MSenProperty* acceptHeaders = NULL;
+    retVal = aProps.AcceptL(acceptHeaders);
+    RPointerArray<TPtrC8> tokens;
+    CleanupClosePushL(tokens);
+
+    if(retVal == KErrNone)
+        {
+        if(acceptHeaders)
+            {
+            TInt retVal = acceptHeaders->ValueTokensL(KSenHttpAcceptHeaderDelimiter, tokens);
+            // Sanity check
+            if(retVal == KErrNone && tokens.Count()==0)
+                {
+                retVal = KErrNotFound; // should not happen
+                }
+            }
+        else
+            {
+            retVal = KErrNotFound; // should not happen
+            }
+        }
+
+    // It is MANDATORY, that at least one Accept header TOKEN exists:
+  if ( tokens.Count()==0 )
+        {
+        TPtrC8* pDefaultToken = new (ELeave) TPtrC8( KSenHttpChannelAcceptHeaderDefault );
+        TInt error = tokens.Append( pDefaultToken );
+        if ( error )
+            {
+            delete pDefaultToken;
+            }
+        }
+    // Http headers
+    TInt headerCount(0);
+    RPointerArray<MSenProperty> headersArray;
+    retVal = aProps.HttpHeadersL(headersArray);
+    if ( retVal == KErrNone )
+        {
+        CleanupClosePushL(headersArray);
+        headerCount = headersArray.Count();
+        for(TInt i=0; i<headerCount; i++)
+            {
+            MSenProperty* property = headersArray[i];
+            if(property)
+                {
+                TPtrC8 name = property->Name();
+
+                // Check if header name is "Content-Type"
+                if(!name.Compare(KContentTypeLocalName) ||
+                   !name.Compare(KAcceptLocalName))
+                    {
+                    // Skip Content-Type header(s) in here:
+                    // - otherwise HTTP GET might get confused
+
+                    // NOTE(!): Content-Type header is added separately
+                    // through CSenTxnState -object:
+                    // @InvokeHttpMethodL()
+                    continue;
+                    }
+
+                TPtrC8 value = property->Value();
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- Adding HTTP HEADER, name: (%S), value: (%S)"),
+                    &name, &value));
+
+                // Open stringpool strings
+                RStringF headerName = iStringPool.OpenFStringL(name);
+                CleanupClosePushL(headerName);
+                RStringF headerValue = iStringPool.OpenFStringL(value);
+                CleanupClosePushL(headerValue);
+                // Create header name field
+                THTTPHdrVal headerFieldVal;
+                headerFieldVal.SetStrF(headerValue);
+                // Check if the header field value already exists
+                TBool fieldValueExists = EFalse;
+                TInt fieldCount = aHeaders.FieldPartsL(headerName);
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Header < %S > field count: %d"), &name,
+                                        fieldCount));
+
+                for(TInt j=0; j<fieldCount; j++)
+                    {
+                    THTTPHdrVal hVal;
+                    TInt retCode = aHeaders.GetField(headerName, j, hVal);
+                    if(KErrNotFound != retCode)
+                        {
+                        if(hVal == headerFieldVal)
+                            {
+                            TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Header < %S: %S > already exists"),
+                                               &name, &value));
+
+                            fieldValueExists = ETrue;
+                            }
+                        }
+                    }
+
+                // Add header field
+                if(!fieldValueExists)
+                    {
+                    aHeaders.SetFieldL(headerName, headerFieldVal);
+                    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Header < %S: %S > added"),
+                                       &name, &value));
+                    }
+
+                // Close stringpool strings
+                CleanupStack::PopAndDestroy(2); // headerValue, headerName
+                }
+            }
+        headersArray.Reset();
+        CleanupStack::Pop(); // headersArray
+        }
+    else
+        {
+        // No HTTP headers were found(!)
+        User::Leave( retVal );
+        }
+
+    for (TInt k = 0; k < tokens.Count(); k++)
+        {
+        TPtrC8 token = *tokens[k]; // accept header value
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- Adding token to Accept header (%S)"), tokens[k]));
+
+        //const TDesC8& acceptHeaderValueStr
+        //        = iAcceptedContentTypes->MdcaPoint(k);
+
+        // Open stringpool string
+        RStringF acceptHeaderValue 
+            = iStringPool.OpenFStringL(token);
+
+        CleanupClosePushL(acceptHeaderValue);
+
+        // Create header name field
+        THTTPHdrVal headerFieldVal;
+        headerFieldVal.SetStrF(acceptHeaderValue);
+
+        // Check if the header field value already exists
+        TBool fieldValueExists = EFalse;
+
+        TInt fieldCount = aHeaders.FieldPartsL(
+            iStringPool.StringF(HTTP::EAccept, RHTTPSession::GetTable()));
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("Accept header field count: %d"), fieldCount));
+
+
+        for(TInt j = 0; j < fieldCount; j++)
+            {
+            THTTPHdrVal hVal;
+            TInt retCode = aHeaders.GetField(
+                iStringPool.StringF(HTTP::EAccept, 
+                                    RHTTPSession::GetTable()),
+                                    j, 
+                                    hVal);
+
+            if(KErrNotFound != retCode)
+                {
+#ifdef _SENDEBUG
+                const TDesC8& hValStr = hVal.StrF().DesC();
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Accept: %S"),
+                                   &hValStr));
+#endif // _SENDEBUG
+                if(hVal == headerFieldVal)
+                    {
+                    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Header < Accept: %S > already exists"), &token));
+                    fieldValueExists = ETrue;
+                    }
+                }
+            }
+
+        // Add header field
+        if(!fieldValueExists)
+            {
+            aHeaders.SetFieldL(
+                iStringPool.StringF(HTTP::EAccept, 
+                                    RHTTPSession::GetTable()),
+                                    headerFieldVal);
+            TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Header < Accept: %S > added"), &token));
+
+            }
+
+        // Close stringpool string
+        CleanupStack::PopAndDestroy(); // acceptHeaderValue
+        }
+    tokens.ResetAndDestroy(); // TPtrC8 is allocated with "new" keyword and thus owned by this array, eventhough
+                              // the actual descriptors inside TPtrC8 tokens are NOT owned, of course (NORMAL).
+    CleanupStack::PopAndDestroy(); // token array
+    }
+
+/** Called when a authenticated page is requested
+Asks the user for a username and password that would be appropriate for the
+url that was supplied.
+*/
+TBool CSenHttpChannelImpl::GetCredentialsL(const TUriC8& aURI,
+                                           RString aRealm,
+                                           RStringF /*aAuthenticationType*/,
+                                           RString& aUsername,
+                                           RString& aPassword)
+
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("GetCredentialsL(),  for URL (%S), realm (%S)"),
+                            &aURI.UriDes(), &aRealm.DesC()));
+
+    if (iBasicConnectionTries > 2)
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() max number of tries with auth-dialog reached (3)");
+        // In the next attempt start with a fresh identityprovider
+        iSessionAuthentication = NULL;
+        iPasswordFromUser = EFalse;
+        iBasicConnectionTries = 0;
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() returning EFalse");
+        return EFalse;  // Invalid login attempts have reached the defined 
+                        // maximum, abort this request
+        }
+
+    if (!iSessionAuthentication)
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() reading auth-pair from database (senidentites.xml)");
+        iSessionAuthentication = iManager.IdentityProviderL(aURI.UriDes());
+        if(!iSessionAuthentication)
+            {
+            // create and register new IDP
+            iSessionAuthentication = CSenIdentityProvider::NewL(aURI.UriDes(),
+                                                                KNullDesC8);
+            iSessionAuthentication->SetFrameworkIdL(KNullDesC8); 
+            TInt retVal = iManager.RegisterIdentityProviderL(iSessionAuthentication);
+            if(retVal!=KErrNone)
+                {
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("GetCredentials: Register IDP failed! Error code: (%d)"),
+                    retVal));
+                iSessionAuthentication = NULL;
+                TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() returning EFalse");
+                return EFalse; // decision: we could not save info into database, abort
+                }
+            TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"New IDP registeration OK. Proceeding.");
+            }
+        // we have credentials
+        TRAPD(err, aUsername = 
+            aRealm.Pool().OpenStringL(iSessionAuthentication->AuthzID()));
+        TRAP(err, aPassword = 
+            aRealm.Pool().OpenStringL(iSessionAuthentication->Password()));
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() returning ETrue");
+        return ETrue;
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() prompting auth-info from user via dialog.");
+        // Remove the old password before asking the new one.
+        CSenElement& element = iSessionAuthentication->AsElement();
+        delete element.RemoveElement(KSenIdpPasswordLocalname);
+        
+        TPckgBuf<TSenAuthentication> authInfo;
+        iManager.AuthenticationForL(*iSessionAuthentication, authInfo);
+        iPasswordFromUser = ETrue;
+
+        TRAPD(err, aUsername = 
+                aRealm.Pool().OpenStringL(authInfo().iUsername));
+        TRAP(err, aPassword = 
+                aRealm.Pool().OpenStringL(authInfo().iPassword));
+        iBasicConnectionTries++;
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"GetCredentialsL() returning ETrue");
+        return ETrue;
+        }
+    }
+
+// This is a debug logging method:
+void CSenHttpChannelImpl::ListFilters()
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMaxLogLevel,"List HTTP filters started.");
+    TLSLOG(KSenHttpChannelLogChannelBase , KMaxLogLevel,(_L(
+    "      Name       | Pos'n | Event  |      Header      | Status | Handle ")
+    ));
+    TLSLOG(KSenHttpChannelLogChannelBase , KMaxLogLevel,(_L(
+    "-----------------+-------+--------+------------------+--------+--------")
+    ));
+
+    RHTTPFilterCollection filtColl = iSess.FilterCollection();
+    THTTPFilterIterator iter = filtColl.Query();
+
+    THTTPFilterRegistration regInfo;
+    iter.First();
+    TBuf<KMaxFilterNameLen> earlierName;
+    while (!iter.AtEnd())
+        {
+        // Get next filter registration info
+        regInfo = iter();
+
+        TBuf<KMaxFilterNameLen> name;
+        name.Copy(iSess.StringPool().StringF(regInfo.iName).DesC().Left(
+                                                        KMaxFilterNameLen));
+        TBuf<KMaxHeaderNameLen> header;
+        header.Copy(iSess.StringPool().StringF(regInfo.iHeader).DesC().Left(
+                                                        KMaxHeaderNameLen));
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMaxLogLevel, _L8("%16S | %4d  | %4d   | %16S |   %3d  | %2d"),
+               &name, regInfo.iPosition, regInfo.iEvent.iStatus, &header,
+                regInfo.iStatus, regInfo.iHandle));
+
+        earlierName.Format(name);
+        ++iter;
+        }
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMaxLogLevel,"List HTTP filters done.");
+#endif    
+    }
+
+void CSenHttpChannelImpl::HandleResponseHeadersL(RHTTPTransaction aTransaction)
+    {
+    TInt txnId = aTransaction.Id();
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::HandleResponseHeadersL( %d )"),
+                        txnId));
+
+    RHTTPResponse resp = aTransaction.Response();
+    TInt status = resp.StatusCode();
+#ifdef _SENDEBUG
+    RStringF statusStr = resp.StatusText();
+    const TDesC8& statusStrDesC = statusStr.DesC();
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Response status: %d ( %S )"), status, &statusStrDesC));
+#endif // _SENDEBUG
+    CSenTxnState* pTxnState = FindTxnState(txnId);
+
+    __ASSERT_ALWAYS(pTxnState != NULL, User::Panic(KTxnStateNullPanicText, CSenHttpChannel::ETxnStateNull));
+
+    if (status == 401)  // basic authentication needed
+        {
+        CSenHttpTransportProperties* tp = CSenHttpTransportProperties::NewLC();
+        RHTTPHeaders responseHeaders = aTransaction.Response().GetHeaderCollection();
+        THTTPHdrFieldIter fields = responseHeaders.Fields();
+        while (!fields.AtEnd())
+             {
+             RStringTokenF fieldName = fields();
+             RStringF fieldNameStr = iStringPool.StringF(fieldName);
+             THTTPHdrVal fieldVal;
+             if (responseHeaders.GetField(fieldNameStr,0,fieldVal) == KErrNone)
+                 {
+                  TPtrC8 ptr(KNullDesC8);
+                  responseHeaders.GetRawField(fieldNameStr, ptr);
+                  TPtrC8 ptr2(fieldNameStr.DesC());
+                  if (fieldVal.Type() == THTTPHdrVal::KDateVal)
+                      {
+                      TDateTime date = fieldVal.DateTime();
+                      RStringF dateS = iStringPool.StringF(HTTP::EDate, RHTTPSession::GetTable());
+                      TTimeIntervalMinutes interval;
+                      TTime begin(0);
+                      TTime time(date);
+                      time.MinutesFrom(begin, interval);
+                      tp->SetIntPropertyL(dateS.DesC(), interval.Int());
+                      pTxnState->SetTP(tp);//ownership transfered
+                      pTxnState->HttpChannelPropertiesL().SetIntPropertyL(dateS.DesC(), interval.Int());
+                      }
+                  }
+              ++fields;
+             }
+        CleanupStack::Pop(tp);
+        return;
+        }
+        
+    else if (status == 200)
+        {
+        RHTTPHeaders responseHeaders = aTransaction.Response().GetHeaderCollection();
+
+        THTTPHdrVal fieldVal;
+        TPtrC8 fieldValPtr;
+        THTTPHdrVal paramVal;
+            
+        // get the Content-Type string
+        RStringF content = iStringPool.StringF(HTTP::EContentType,
+                                               RHTTPSession::GetTable());
+
+        if (responseHeaders.GetField(content,0,fieldVal) == KErrNone)
+            {
+            // get the field value
+            switch (fieldVal.Type())
+                {
+                case THTTPHdrVal::KStrFVal:
+                    {
+                    fieldValPtr.Set(iStringPool.StringF(fieldVal.StrF()).DesC());
+                    }
+                break;
+                case THTTPHdrVal::KStrVal:
+                    {
+                    fieldValPtr.Set(iStringPool.String(fieldVal.Str()).DesC());
+                    }
+                break;
+                default:
+                    {
+                    User::Panic(KUnrecognisedValueTypeOfContentTypePanicText,
+                                EContentTypeUnrecognisedValueType);
+                    }
+                }
+            _LIT8(KMultipartRelated,"Multipart/Related");	//CodeScannerWarning
+            _LIT8(KBoundry,"boundary");
+            _LIT8(KType,"type");
+            _LIT8(KStart,"start");
+            _LIT8(KStartInfo,"start-info");
+            _LIT8(KAction,"action");
+            _LIT8(KApplication,"application/xop+xml");
+            if (fieldValPtr == KMultipartRelated)
+                {
+                //SenMultiPartUtils::TMultiPartContentType MultiPartContentType;
+                iMultiPartContentType.fieldValue.Set(fieldValPtr);
+
+                // get the param values
+                TPtrC8 paramName(KBoundry);
+                if(KErrNone == ContentTypeParamValueL(responseHeaders, content, paramName,  iMultiPartContentType))     
+                    {
+                    paramName.Set(KType);
+                    if (KErrNone == ContentTypeParamValueL(responseHeaders, content, paramName,  iMultiPartContentType))     
+                        {
+                        paramName.Set(KStart);
+                        if (KErrNone == ContentTypeParamValueL(responseHeaders, content, paramName,  iMultiPartContentType))     
+                            {
+                            paramName.Set(KStartInfo);
+                            if (KErrNone == ContentTypeParamValueL(responseHeaders, content, paramName,  iMultiPartContentType))     
+                                {
+                                paramName.Set(KAction);
+                                if (KErrSenNoHttpContentType == ContentTypeParamValueL(responseHeaders, content, paramName,  iMultiPartContentType))     
+                                    {
+                                    SenMultiPartUtils::TMultiPartContentTypeParam contentTypeParam = {_L8("action"), _L8("")};
+                                    iMultiPartContentType.params.Append(contentTypeParam);
+                                    }
+                                TUint i(0);
+                                while (iMultiPartContentType.params[i].paramName != KType)
+                                    {
+                                     ++i;
+                                    }
+                                if (iMultiPartContentType.params[i].paramValue == KApplication)   
+                                    {
+                                    iXopResponse = ETrue;
+                                    content.Close();
+                                    return;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+           else 
+                {
+                iContentType.Set(fieldValPtr);
+                content.Close();
+                return;
+                }
+            }
+        iHasHttpContentType = EFalse;
+        content.Close();
+        }
+    }
+
+TInt CSenHttpChannelImpl::ContentTypeParamValueL(const RHTTPHeaders& aResponseHeaders,
+                                const RStringF& aContent, 
+                                const TPtrC8& aParamName,
+                                SenMultiPartUtils::TMultiPartContentType& aMultiPartContentType)
+    {
+    RStringF paramNameStr = iStringPool.OpenFStringL(aParamName);            
+    
+    THTTPHdrVal paramVal;
+    TPtrC8 paramValPtr;
+    if (aResponseHeaders.GetParam(aContent,paramNameStr,paramVal) == KErrNone)
+        {
+        switch (paramVal.Type())
+            {
+            case THTTPHdrVal::KStrFVal:
+                {
+                paramValPtr.Set(iStringPool.StringF(paramVal.StrF()).DesC());
+                }
+            break;
+            case THTTPHdrVal::KStrVal:
+                {
+                paramValPtr.Set(iStringPool.String(paramVal.Str()).DesC());
+                }
+            break;
+            default:
+                User::Panic(KUnrecognisedValueTypeOfContentTypePanicText,
+                            EContentTypeUnrecognisedValueType);
+            break;
+            }
+
+        SenMultiPartUtils::TMultiPartContentTypeParam contentTypeParam = {_L8(""), _L8("")};
+        contentTypeParam.paramName.Set(aParamName);
+        contentTypeParam.paramValue.Set(paramValPtr);
+        aMultiPartContentType.params.Append(contentTypeParam);
+        paramNameStr.Close();
+        return KErrNone;
+        }
+    else
+        {
+        paramNameStr.Close();
+        return KErrSenNoHttpContentType;
+        }
+    }
+
+void CSenHttpChannelImpl::HandleResponseBodyDataL(RHTTPTransaction aTransaction)
+    {
+    TInt txnId = aTransaction.Id();
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::HandleResponseBodyDataL( %d )"), txnId));
+
+    CSenTxnState* pTxnState = FindTxnState(txnId);
+    __ASSERT_ALWAYS(pTxnState != NULL,
+                    User::Panic(KTxnStateNullPanicText,
+                    CSenHttpChannel::ETxnStateNull));
+
+    // Get the body data supplier
+    MHTTPDataSupplier* pRespBody = aTransaction.Response().Body();
+
+    if(pRespBody)
+        {
+        TPtrC8 dataChunk;
+#ifdef _SENDEBUG
+        TBool isLast = pRespBody->GetNextDataPart(dataChunk);
+        if (isLast)
+            TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("Got last data chunk.")));
+#else
+        pRespBody->GetNextDataPart(dataChunk);
+#endif // _SENDEBUG
+        
+        if (!iXopResponse)
+            {
+            pTxnState->CollectResponseBodyL(dataChunk);
+            }
+        else
+            {
+            ((CSenMtomTxnState*)pTxnState)->ParseMultiPartResponseL(dataChunk);
+            }
+
+
+        // Done with that bit of body data
+        pRespBody->ReleaseData();
+        }
+    else
+        {
+        //pTxnState->ResponseError(-20000);
+        pTxnState->ResponseErrorL(KErrSenNoHttpResponseBody); //SenServiceConnection.h // was -20000
+        DeleteTxnState(txnId);
+        aTransaction.Close();
+        }
+    }
+
+void CSenHttpChannelImpl::HandleResponseL(RHTTPTransaction aTransaction)
+    {
+    TInt txnId = aTransaction.Id();
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::HandleResponseL( %d )"), txnId));
+    CSenTxnState* pTxnState = FindTxnState(txnId);
+    __ASSERT_ALWAYS(pTxnState != NULL,
+                    User::Panic(KTxnStateNullPanicText,
+                    CSenHttpChannel::ETxnStateNull));
+
+    // Propagate http status codes                                    
+    RHTTPResponse resp = aTransaction.Response();
+    TInt status = resp.StatusCode();
+    pTxnState->StateChanged(status);    
+                                           
+    if (iHasHttpContentType)
+        {
+         if (!iXopResponse)
+            {
+            pTxnState->ResponseReceivedL(iContentType);
+            }
+        else
+            {
+            ((CSenMtomTxnState*)pTxnState)->ResponseReceivedL(iMultiPartContentType);
+            }
+        }
+    else
+        {
+        pTxnState->ResponseErrorL(KErrSenNoHttpContentType); // was: -20001
+        }
+
+    DeleteTxnState(txnId);
+    aTransaction.Close();
+    }
+
+void CSenHttpChannelImpl::HandleRunErrorL(RHTTPTransaction aTransaction,
+                                          TInt aError)
+    {
+    TInt txnId = aTransaction.Id();
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::HandleRunErrorL( %d ): %d"),txnId, aError));
+    CSenTxnState* pTxnState = FindTxnState(txnId);
+    __ASSERT_ALWAYS(pTxnState != NULL,
+                    User::Panic(KTxnStateNullPanicText,
+                    CSenHttpChannel::ETxnStateNull));
+
+    pTxnState->ResponseErrorL(aError);
+    DeleteTxnState(txnId);
+    aTransaction.Close();
+    }
+
+void CSenHttpChannelImpl::HandleRedirectRequiresConfirmationL(
+                                                RHTTPTransaction aTransaction)
+    {
+    TInt txnId = aTransaction.Id();
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::HandleRedirectRequiresConfirmationL( %d )"),
+                txnId));
+    CSenTxnState* pTxnState = FindTxnState(txnId);
+    __ASSERT_ALWAYS(pTxnState != NULL,
+                    User::Panic(KTxnStateNullPanicText,
+                    CSenHttpChannel::ETxnStateNull));
+    pTxnState->ResponseErrorL(KErrSenHttpRedirectRequiresConfirmation); // was: -20002
+    DeleteTxnState(txnId);
+    aTransaction.Close();
+    }
+/*
+RFileLogger* CSenHttpChannelImpl::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+*/
+// This is a debug logging method
+#ifdef _SENDEBUG
+void CSenHttpChannelImpl::DumpRespHeadersL(RHTTPTransaction& aTrans)
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenHttpChannelImpl::DumpRespHeadersL")));
+    RHTTPResponse resp = aTrans.Response();
+    RHTTPHeaders hdr = resp.GetHeaderCollection();
+    THTTPHdrFieldIter it = hdr.Fields();
+
+    TBuf<KMaxHeaderNameLen>  fieldName16;
+    TBuf<KMaxHeaderValueLen> fieldVal16;
+    TBuf<KMaxHeaderNameLen>  paramName16;
+    TBuf<KMaxHeaderValueLen> paramVal16;
+
+    while (!it.AtEnd())
+        {
+        RStringTokenF fieldName = it();
+        RStringF fieldNameStr = iStringPool.StringF(fieldName);
+        THTTPHdrVal fieldVal;
+        THTTPHdrVal paramVal;
+        if (hdr.GetField(fieldNameStr,0,fieldVal) == KErrNone)
+            {
+            const TDesC8& fieldNameDesC = fieldNameStr.DesC();
+            fieldName16.Copy(fieldNameDesC.Left(KMaxHeaderNameLen));
+            switch (fieldVal.Type())
+                {
+            case THTTPHdrVal::KTIntVal:
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: %d"), &fieldName16, fieldVal.Int()));
+                break;
+            case THTTPHdrVal::KStrFVal:
+                {
+                RStringF fieldValStr = iStringPool.StringF(fieldVal.StrF());
+                const TDesC8& fieldValDesC = fieldValStr.DesC();
+                fieldVal16.Copy(fieldValDesC.Left(KMaxHeaderValueLen));
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: %S"), &fieldName16, &fieldVal16));
+                }
+                break;
+            case THTTPHdrVal::KStrVal:
+                {
+                RString fieldValStr = iStringPool.String(fieldVal.Str());
+                const TDesC8& fieldValDesC = fieldValStr.DesC();
+                fieldVal16.Copy(fieldValDesC.Left(KMaxHeaderValueLen));
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: %S"), &fieldName16, &fieldVal16));
+                }
+                break;
+            case THTTPHdrVal::KDateVal:
+                {
+                TDateTime date = fieldVal.DateTime();
+                TBuf<40> dateTimeString;
+                TTime t(date);
+                t.FormatL(dateTimeString,KDateFormat);
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: %S"), &fieldName16, &dateTimeString));
+
+                }
+                break;
+            default:
+                TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: <unrecognised value type>"), &fieldName16));
+            break;
+            }
+            
+        RStringF paramNameStr = iStringPool.OpenFStringL(_L8("type"));            
+        const TDesC8& paramNameDesC = paramNameStr.DesC();
+        paramName16.Copy(paramNameDesC.Left(KMaxHeaderNameLen));
+        if (hdr.GetParam(fieldNameStr,paramNameStr,paramVal) == KErrNone)
+            {
+            switch (paramVal.Type())
+                {
+                case THTTPHdrVal::KStrFVal:
+                    {
+                    RStringF paramValStr = iStringPool.StringF(paramVal.StrF());
+                    const TDesC8& paramValDesC = paramValStr.DesC();
+                    paramVal16.Copy(paramValDesC.Left(KMaxHeaderValueLen));
+                    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: %S"), &paramName16, &paramVal16));
+                    }
+                break;
+                case THTTPHdrVal::KStrVal:
+                    {
+                    RString paramValStr = iStringPool.String(paramVal.Str());
+                    const TDesC8& paramValDesC = paramValStr.DesC();
+                    paramVal16.Copy(paramValDesC.Left(KMaxHeaderValueLen));
+                    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: %S"), &paramName16, &paramVal16));
+                    }
+                break;
+                default:
+                    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("%S: <unrecognised value type>"), &paramName16));
+                break;
+                }
+            }
+		_LIT(KMultipartRelated,"Multipart/Related");
+		_LIT(KApplication,"application/xop+xml");
+        if ((fieldVal16 == KMultipartRelated) && (paramVal16 == KApplication))
+            {
+            iXopResponse = ETrue;    
+            }
+            
+            // Display realm for WWW-Authenticate header
+            RStringF wwwAuth =
+                iStringPool.StringF(
+                    HTTP::EWWWAuthenticate,RHTTPSession::GetTable());
+            if (fieldNameStr == wwwAuth)
+                {
+                // check the auth scheme is 'basic'
+                RStringF basic =
+                    iStringPool.StringF(HTTP::EBasic,RHTTPSession::GetTable());
+                RStringF realm =
+                    iStringPool.StringF(HTTP::ERealm,RHTTPSession::GetTable());
+                THTTPHdrVal realmVal;
+                if ((fieldVal.StrF() == basic) &&
+                    (!hdr.GetParam(wwwAuth, realm, realmVal)))
+                    {
+                    RStringF realmValStr =
+                        iStringPool.StringF(realmVal.StrF());
+                    const TDesC8& realmValDesC = realmValStr.DesC();
+                    fieldVal16.Copy(realmValDesC.Left(KMaxHeaderValueLen));
+                    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Realm is: %S"), &fieldVal16));
+                    }
+                }
+            paramNameStr.Close();
+            }
+        ++it;
+        }
+    }
+#else
+// do nothing
+void CSenHttpChannelImpl::DumpRespHeadersL(RHTTPTransaction& /* aTrans */) {  } 
+#endif
+
+
+// This is second debug logging method
+//Do a formatted dump of binary data
+#ifdef _SENDEBUG
+void CSenHttpChannelImpl::DumpBodyData(const TDesC8& aData)
+    {
+    // Iterate the supplied block of data in blocks of cols=80 bytes
+    const TInt cols=16;
+    TInt pos = 0;
+    TBuf<KMaxFileName - 2> logLine;
+    TBuf<KMaxFileName - 2> anEntry;
+    const TInt dataLength = aData.Length();
+    while (pos < dataLength)
+        {
+        //start-line hexadecimal( a 4 digit number)
+        anEntry.Format(TRefByValue<const TDesC>_L("%04x : "), pos);
+        logLine.Append(anEntry);
+
+        // Hex output
+        TInt offset;
+        for (offset = 0; offset < cols; ++offset)
+            {
+            if (pos + offset < aData.Length())
+                {
+                TInt nextByte = aData[pos + offset];
+                anEntry.Format(TRefByValue<const TDesC>_L("%02x "), nextByte);
+                logLine.Append(anEntry);
+                }
+            else
+                {
+                // fill the remaining spaces with
+                // blanks untill the cols-th Hex number
+                anEntry.Format(TRefByValue<const TDesC>_L("   "));
+                logLine.Append(anEntry);
+                }
+            }
+        anEntry.Format(TRefByValue<const TDesC>_L(": "));
+        logLine.Append(anEntry);
+
+        // Char output
+        for (offset = 0; offset < cols; ++offset)
+            {
+            if (pos + offset < aData.Length())
+                {
+                TInt nextByte = aData[pos + offset];
+                if ((nextByte >= ' ') && (nextByte <= '~'))
+                    {
+                    anEntry.Format(TRefByValue<const TDesC>_L("%c"), nextByte);
+                    logLine.Append(anEntry);
+                    }
+                else
+                    {
+                    anEntry.Format(TRefByValue<const TDesC>_L("."));
+                    logLine.Append(anEntry);
+                    }
+                }
+            else
+                {
+                anEntry.Format(TRefByValue<const TDesC>_L(" "));
+                logLine.Append(anEntry);
+                }
+            }
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, TRefByValue<const TDesC>_L("%S"), &logLine));
+            logLine.Zero();
+
+        // Advance to next  byte segment (1 seg= cols)
+        pos += cols;
+        }
+    }
+#else
+// do nothing
+void CSenHttpChannelImpl::DumpBodyData(const TDesC8& /* aData */) { } 
+#endif
+
+// ----------------------------------------------------------------------------
+// CSenHttpChannelImpl::AppendNewTxnStateL
+// ----------------------------------------------------------------------------
+//
+void CSenHttpChannelImpl::AppendNewTxnStateL(CSenTxnState* aTxnState)
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenHttpChannelImpl::AppendNewTxnStateL")));
+    iTxnStates->AppendL(aTxnState);
+    }
+
+// ----------------------------------------------------------------------------
+// CSenHttpChannelImpl::DeleteTxnState
+// ----------------------------------------------------------------------------
+void CSenHttpChannelImpl::DeleteTxnState(TInt aTxnId)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::DeleteTxnState( %d )"), aTxnId));
+    TInt index;
+    CSenTxnState* pTxnState = FindTxnState(aTxnId, &index);
+    if(pTxnState)
+        {
+        iTxnStates->Delete(index);
+        delete pTxnState;
+        pTxnState = NULL;
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("TxnState ( %d ) deleted"), aTxnId));
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CSenHttpChannelImpl::FindTxnState
+// ----------------------------------------------------------------------------
+CSenTxnState* CSenHttpChannelImpl::FindTxnState(TInt aTxnId, TInt* aIndex)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::FindTxnState( %d )"), aTxnId));
+    for(TInt i = 0; i < iTxnStates->Count(); ++i)
+        {
+        if((*iTxnStates)[i]->Id() == aTxnId)
+            {
+            if(aIndex)
+                {
+                *aIndex = i;
+                }
+            return (*iTxnStates)[i];
+            }
+        }
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("TxnState ( %d ) not found"), aTxnId));
+    return NULL;
+    }
+
+
+// @return KErrNone, if cancel was performed
+//        KErrNotFound if transaction was not found 
+TInt CSenHttpChannelImpl::CancelTransaction(const TInt aTxnId)
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KSenHttpChannelLogLevel,"");
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::CancelTransaction - TxnId: %d"),
+        aTxnId));
+
+    CSenTxnState* pTxnState = FindTxnState(aTxnId);
+    if(pTxnState)
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- Txn found, calling Cancel():");
+        return pTxnState->Cancel();
+        }
+    return KErrNotFound;
+    }
+
+void CSenHttpChannelImpl::CancelAllTransactions()
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::CancelAllTransaction");
+    
+    for(TInt i = 0; i < iTxnStates->Count(); ++i)
+        {
+        (*iTxnStates)[i]->Cancel();
+        }
+    }
+
+void CSenHttpChannelImpl::SetExplicitIapDefined(TBool aExplicitIapDefined)
+    {
+    iExplicitIapDefined = aExplicitIapDefined;
+    }
+
+
+TBool CSenHttpChannelImpl::EffectiveIapId( TUint32 &aIapId )
+    {
+	TInt handle = iConnection.SubSessionHandle();
+		if (handle>0)
+	    {
+        TUint connEnum(0);
+        TInt err = iConnection.EnumerateConnections(connEnum);
+        if (!err && !connEnum)
+            {
+            return EFalse;
+            }
+	    }
+
+	TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::EffectiveIapId(): Current RConnection's subsession handle(%d)"), iIapId ));
+#ifdef _SENDEBUG
+	if( iExplicitIapDefined )
+		{
+		TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8(" - IAP ID is known: %d"), iIapId ));
+		}
+	else
+		{
+		TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel," - IAP ID is not known.");
+		}
+		
+	if( handle < KErrNone )
+		{
+		TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel," -> RConnection has not been initialized.");
+		}
+#endif // _SENDEBUG    
+    
+    if( handle && !iExplicitIapDefined )
+    	{
+		// Eventhough IAP was not explicitely set (through Serene API), this
+		// code can check what IAP end-user provided via IAP selection dialog:
+		TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::EffectiveIapId: about to call RConnection::GetIntSetting()");
+		_LIT( KIapIdKey, "IAP\\Id" );
+	    iConnection.GetIntSetting( KIapIdKey, iIapId);
+	    if ( iIapId > 0 )
+	    	{
+			TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::EffectiveIapId(): end-user provided IAP(%d)"), iIapId ));
+	    	// Treat the end-user selection as "explicit" definition as well(!):
+	    	iExplicitIapDefined = ETrue; 
+	    	}
+	    }
+    if( iExplicitIapDefined )
+        {
+        aIapId = iIapId;
+        }
+    return iExplicitIapDefined;
+    }
+
+void CSenHttpChannelImpl::EnableTimeOutL(TInt aTxnId, TInt aTimeOutSec)
+    {
+    CSenTxnState* txn = FindTxnState(aTxnId);
+    if (txn)
+        txn->EnableTimeOutL(aTimeOutSec);
+    }
+void CSenHttpChannelImpl::DisableTimeOutL(TInt aTxnId)
+    {
+    CSenTxnState* txn = FindTxnState(aTxnId);
+    if (txn)
+        txn->DisableTimeOutL();
+    }
+
+TInt32 CSenHttpChannelImpl::UsedIap()
+    {
+    return iUsedIapId;
+    }
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,800 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenServiceConnection.h>
+#include "senhttpchanneltransportplugin.h"
+#include "senhttpchannelimpl.h"
+#include "senhttpsyncrequester.h"
+#include "SenXmlUtils.h"
+#include "SenIdentityProvider.h"
+#include "senwspattern.h"
+#include "SenFragment.h"
+#include "SenElement.h"
+#include "sendebug.h"
+#include "MSenProperty.h"
+#include "SenHttpTransportProperties.h" // Utils\inc
+#include "sentransportcontext.h"
+#include "senlayeredhttptransportproperties.h" // internal Framework\inc
+#include "msenmessagecontext.h"
+#include "MSenMessage.h"
+#include "SenSoapMessage2.h"
+#include "RSenDocument.h"
+#include "SenParser.h"
+#include "senservicesession.h"
+#include "senlogger.h"
+#include "senclientsession.h"
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+#include <xmlengserializer.h>
+
+
+
+namespace
+    {
+/* Fix for compiler warning  #177-D
+#ifdef _SENDEBUG 
+    // logging constants
+    _LIT(KLogDir,                   "SenHttpChannelObserver");
+    _LIT(KLogFile,                  "SenHttpChannelObserver.log");
+#endif*/
+
+    _LIT8(KContentType,             "text/xml; charset=UTF-8");
+    }
+
+
+
+// Create instance of concrete ECOM interface implementation
+//CSenHttpChannelTransportPlugin* CSenHttpChannelTransportPlugin::NewL(
+//                                    MSenCoreServiceManager& aServiceManager)
+//    {
+//    CSenHttpChannelTransportPlugin* pNew = CSenHttpChannelTransportPlugin::NewLC(aServiceManager);
+
+CSenHttpChannelTransportPlugin* CSenHttpChannelTransportPlugin::NewL(CSenTransportContext* apCtx)
+    {
+    CSenHttpChannelTransportPlugin* pNew = CSenHttpChannelTransportPlugin::NewLC(apCtx);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenHttpChannelTransportPlugin* CSenHttpChannelTransportPlugin::NewLC(CSenTransportContext* apCtx)
+    {
+    if(apCtx == NULL)
+        {
+        User::Leave( KErrArgument );
+        }
+
+    MSenCoreServiceManager& core = apCtx->GetCoreL();
+    CSenHttpChannelTransportPlugin* pNew = new (ELeave) CSenHttpChannelTransportPlugin(apCtx, core);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenHttpChannelTransportPlugin::CSenHttpChannelTransportPlugin(CSenTransportContext* apCtx,
+                                                               MSenCoreServiceManager& aCore)
+:   CSenTransport(apCtx),
+    iServiceManager(aCore),
+    iRequester(NULL),
+    iHttpChannel(NULL),
+    iProperties(NULL),
+    iConsumerMap(EFalse, ETrue), 
+    iSessionMap(EFalse, EFalse), // iConsumerMap deletes the txnIds (using same "new reserved" TInt here!)
+    iStatusCode(0)
+    {
+    }
+
+CSenHttpChannelTransportPlugin::~CSenHttpChannelTransportPlugin()
+    {
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::~CSenHttpChannelTransportPlugin()");
+    iConsumerMap.Reset(); // deletes the txnIds!
+    iSessionMap.Reset(); 
+
+    delete iHttpChannel;
+    delete iRequester;
+    delete iProperties;
+
+    delete ipCtx;
+    ipCtx = NULL;
+
+    TLSLOG(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,(_L("Got last data chunk.")));
+    TLSLOG_CLOSE(KSenHttpChannelObserverLogChannelBase);
+    }
+
+void CSenHttpChannelTransportPlugin::ConstructL()
+    {
+    TLSLOG_OPEN(KSenHttpChannelObserverLogChannelBase,KSenHttpChannelObserverLogLevel,KSenHttpChannelObserverLogDir,KSenHttpChannelObserverLogFile	);
+    // Open connection to the file logger server
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ConstructL(): log file opened.");
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ConstructL - Version 2 [2006-05-09]");
+
+    if( ipCtx )
+        {
+        // Attempt to find pre-defined IAP ID from transport context
+        CSenWSDescription& initializer = ipCtx->GetInitializerL();
+
+
+        TUint32 predefinedIapId;
+        if( initializer.DescriptionClassType() == MSenServiceDescription::EWSPattern )
+            {
+            // Check if <ConsumerPolicy/> was defined in SC initializer (constructor argument)
+            // and if IAP was predefined
+            TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- Initializer XML SD type is: EWSPattern.");
+            CSenWSPattern* pConsumerPolicy = (CSenWSPattern*)&initializer;
+
+            TInt retVal = pConsumerPolicy->ConsumerIapId( predefinedIapId );
+            if( retVal==KErrNone && predefinedIapId < (TUint)KErrNotFound ) // IAP ID must be 0...INT_MAX, since (TUInt)KErrNotFound == INT_MAX+1
+                {
+                iHttpChannel = CSenHttpChannelImpl::NewL(iServiceManager, predefinedIapId);
+                }
+            else
+                {
+                // Check if <ProviderPolicy/> was defined in SC initializer (constructor argument)
+                // and if IAP was predefined
+                retVal = initializer.IapId( predefinedIapId );
+                if( retVal==KErrNone && predefinedIapId < (TUint)KErrNotFound )
+                    {
+                    iHttpChannel = CSenHttpChannelImpl::NewL(iServiceManager, predefinedIapId);
+                    }
+                }
+            }
+        else if( initializer.DescriptionClassType() == MSenServiceDescription::EWSDescription )
+            {
+            TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- Initializer XML SD type is EWSDescription.");
+            TUint32 predefinedIapId(0);
+            TInt retVal = initializer.IapId( predefinedIapId );
+            if( retVal==KErrNone && predefinedIapId < (TUint)KErrNotFound ) // IAP ID must be 0...INT_MAX, since (TUInt)KErrNotFound == INT_MAX+1
+                {
+                iHttpChannel = CSenHttpChannelImpl::NewL(iServiceManager, predefinedIapId);
+                }
+            }
+            
+        if( !iHttpChannel )
+            {
+            // Check if **the service session** contains <ProviderPolicy/>
+            CSenServiceSession* pSession = (CSenServiceSession*)ipCtx->GetSession();
+            if( pSession )
+                {
+                // Check if IAP was predefined / try to figure out if IAP ID was
+                // set in <ProviderPolicy/> of this session (XML SD):
+                TInt retVal = pSession->IapId( predefinedIapId );
+                if( retVal == KErrNone && predefinedIapId < (TUint)KErrNotFound ) // IAP ID must be 0...INT_MAX, since (TUInt)KErrNotFound == INT_MAX+1
+                    {
+                    iHttpChannel = CSenHttpChannelImpl::NewL(iServiceManager, predefinedIapId);
+                    }
+                }
+            }
+        }
+    if( !iHttpChannel )
+        {
+        // IAP ID was not found from transport context
+        iHttpChannel = CSenHttpChannelImpl::NewL( iServiceManager );
+        }
+    
+    iRequester = CSenHttpSyncRequester::NewL( iHttpChannel, this );
+    }
+
+// Messaging methods start:
+TInt CSenHttpChannelTransportPlugin::SubmitL(const TDesC8& aEndpoint,
+                                      const TDesC8& aMessage,
+                                      const TDesC8& aTransportProperties,
+                                      HBufC8*& aResponse,
+                                      MSenRemoteServiceConsumer& aConsumer )
+    {
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::SubmitL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- No endpoint!");
+        return KErrSenNoEndpoint;
+        }
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMinLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,"- Message:");
+    TLSLOG_ALL(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,( aMessage ));
+
+    CSenLayeredHttpTransportProperties& properties = LayeredPropertiesL();
+    properties.ReadFromL(aTransportProperties, MSenLayeredProperties::ESenMessageLayer);
+    
+    ApplyPropertiesL();    
+
+    HBufC8* pRespContentType = NULL;
+
+    // Uses HttpSyncRequester class:
+
+    TInt statusCode(KErrNone);
+    TInt leaveCode(KErrNone);
+    TRAP( leaveCode, iRequester->SubmitL(aEndpoint,           // endpoint
+                                         properties,
+                                         aMessage,            // request body
+                                         pRespContentType,    // response content type
+                                         aResponse,           // response body
+                                         statusCode); )
+
+	// Propagate data traffic counters to consumer
+	
+    aConsumer.SetDataTrafficDetails(iDetails);  	
+
+    properties.ShrinkTo(MSenLayeredProperties::ESenConsumerSessionLayer);                                                                                
+    if(leaveCode!=KErrNone) 
+        {
+        // SubmitL leaved, return leave code instead of status code
+        statusCode = leaveCode;
+        }
+    delete pRespContentType; // not used currently
+    return statusCode;
+    }
+
+// async request
+TInt CSenHttpChannelTransportPlugin::SendL( const TDesC8& aEndpoint,
+                                            const TDesC8& aMessage,
+                                            const TDesC8& aTransportProperties,
+                                            MSenServiceSession& aReplyTo,
+                                            MSenRemoteServiceConsumer& aConsumer, // "adressee", could be CSenIdentifier
+                                            TInt& aTxnId )
+    {
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::SendL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- No endpoint!");
+        return KErrSenNoEndpoint;
+        }
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMinLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,"- Content:");
+    TLSLOG_ALL(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,(aMessage));
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,"- Properties:");
+    TLSLOG_ALL(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,(aTransportProperties));
+    
+    CSenLayeredHttpTransportProperties& properties = LayeredPropertiesL();
+    properties.ReadFromL(aTransportProperties, MSenLayeredProperties::ESenMessageLayer);
+    
+    ApplyPropertiesL();    
+
+    // Reset the status code to zero. Async callbacks may then later update iStatusCode.
+
+    iStatusCode = 0;
+    
+    // Note: regardless of name, SubmitL() is an async method in HttpChannel class
+    TInt* submitID = new (ELeave) TInt(KErrNone);
+    CleanupStack::PushL(submitID);
+    TInt leaveCode(KErrNone);
+    
+    
+    CSenSoapEnvelope2* pSoapEnvelope2 = NULL;
+    TInt err(KErrNone);
+    MSenMessageContext* pMsgCtx = aConsumer.MessageContextByTxnIdL(aTxnId, err);
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMinLogLevel, _L8("- aConsumer.MessageContextByTxnIdL(%d) returned: %d"), aTxnId, err));
+    if( pMsgCtx )
+        {
+        MSenMessage* pMessage = pMsgCtx->MessageL();
+        if( pMessage )
+            {
+            if( pMessage->IsSafeToCast(MSenMessage::ESoapEnvelope2 ))
+                {
+                pSoapEnvelope2 = (CSenSoapEnvelope2*)pMessage;
+                
+                properties.SetPropertyL(KAcceptLocalName, KMimeAccept);
+ 
+                TRAP( leaveCode, (*submitID) = iHttpChannel->SendL( *this, aEndpoint, *pSoapEnvelope2, properties ); ) 
+
+               }
+            else if( pMessage->IsSafeToCast(MSenMessage::EAtomMessage ))
+                {
+                CSenAtomEntry* pAtomEntry = (CSenAtomEntry*)pMessage;
+                
+                TRAP( leaveCode, (*submitID) = iHttpChannel->SendL( *this, aEndpoint, *pAtomEntry, properties ); ) 
+
+               }
+               
+            else
+                {
+                TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- MSenMessage type is: %d"), pMessage->Type()));
+                TRAP( leaveCode, (*submitID) = iHttpChannel->SendL(*this, aEndpoint, aMessage, properties); )
+                }
+            }
+        else
+            {
+            TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- MSenMessage arch. is not used.");            
+            
+			RFile &file = pMsgCtx->ChunkL()->RequestFileHandle() ; //pMsgCtx->ChunkL() must not be null !!
+			if (file.SubSessionHandle())
+				{
+				TRAP( leaveCode, (*submitID) = iHttpChannel->SendL(*this, aEndpoint, file, properties);)
+				}
+			else
+				{
+				TRAP( leaveCode, (*submitID) = iHttpChannel->SendL(*this, aEndpoint, aMessage, properties);)
+				}
+			}
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"Fatal(!): message context not found!");
+        }    
+    
+    TInt timeOutSec(0);
+    LayeredPropertiesL().MaxTimeToLiveL(timeOutSec);
+    properties.ShrinkTo(MSenLayeredProperties::ESenConsumerSessionLayer);
+
+                    
+    if(leaveCode==KErrNone)
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- iHttpChannel returned OK.");
+        // No leave occurred
+        aTxnId = *submitID;
+        if (timeOutSec)
+           {
+           iHttpChannel->EnableTimeOutL(aTxnId, timeOutSec);
+           }
+
+        TInt retVal = iSessionMap.Append(&aReplyTo, submitID);
+        if(retVal==KErrNone)
+            {
+            retVal = iConsumerMap.Append(&aConsumer, submitID);
+            if(retVal!=KErrNone)
+                {
+                TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMinLogLevel, _L8("- iConsumerMap.Append failed: %d"), retVal ));
+
+                // Last entry to iSessionMap must be removed
+                TInt removeRetVal = iSessionMap.Remove(*submitID);
+#ifdef _SENDEBUG
+                if(removeRetVal==KErrNotFound)
+                    {
+                    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMinLogLevel, _L8("- MAJOR: Could not remove session by txnId(%d)"), *submitID));
+                    }
+#endif // _SENDEBUG
+                removeRetVal = 0; // not used in release builds
+                }
+            }
+        else
+            {
+            TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMinLogLevel, _L8("- FATAL: iConsumerMap.Append failed: %d"), retVal ));
+            }
+        CleanupStack::Pop(submitID);
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(submitID);
+        }
+    return leaveCode;
+    }
+
+void CSenHttpChannelTransportPlugin::ResponseReceivedL(TInt aRequestId,
+                                                       const TAny* /* aContentType */,
+                                                       HBufC8* apContent, 
+                                                       CSenHttpTransportProperties* aHttpProperties)
+    {
+
+    iHttpChannel->DisableTimeOutL(aRequestId);
+    CleanupStack::PushL(apContent);
+    
+#ifdef _SENDEBUG    
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResponseReceivedL:");
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Request's txnID: %d"), aRequestId));
+    if ( apContent )
+        {
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMaxLogLevel, _L8("- apContent:")));
+        TLSLOG_ALL(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,(*apContent));
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"Fatal(!): - apContent == NULL.");
+        }
+#endif // _SENDEBUG
+
+    TInt index = iSessionMap.FindValue(aRequestId);
+    if(index != KErrNotFound)
+        {
+        // session found OK
+        MSenServiceSession* pSession =
+            iSessionMap.KeyAt(index);
+        iSessionMap.Remove(aRequestId); // does not delete anything
+
+        index = iConsumerMap.FindValue(aRequestId);
+
+        if(index != KErrNotFound)
+            {
+            // consumer found OK
+            MSenRemoteServiceConsumer* pConsumer =
+                iConsumerMap.KeyAt(index);
+
+            iConsumerMap.Remove(aRequestId); // deletes TxnId
+            
+            CleanupStack::Pop(apContent);
+            pSession->SendToConsumerL(apContent, aRequestId, *pConsumer, aHttpProperties);
+	        pConsumer->SetDataTrafficDetails(iDetails);                                              
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(apContent);
+#ifdef _SENDEBUG
+            TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResponseReceivedL:");
+            TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- pending consumer not found, txn cancelled?");
+#endif // _SENDEBUG
+            }
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(apContent);
+#ifdef _SENDEBUG
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResponseReceivedL:");
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- pending session not found, txn cancelled?");
+#endif // _SENDEBUG
+        }
+    }
+
+// Method to catch async error responses from httpchannel
+void CSenHttpChannelTransportPlugin::ResponseErrorL(TInt aRequestId, TInt aErrorCode, HBufC8* apErrorBody,CSenHttpTransportProperties* aHttpProperties)
+    {
+    CleanupStack::PushL(apErrorBody);
+    iHttpChannel->DisableTimeOutL(aRequestId);
+#ifdef _SENDEBUG    
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResponseErrorL:");
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Request's txnID: %d"), aRequestId));
+    if ( apErrorBody )
+        {
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMaxLogLevel, _L8("- apErrorBody:")));
+        TLSLOG_ALL(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,(*apErrorBody));
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"Fatal(!): - apErrorBody == NULL.");
+        }
+#endif // _SENDEBUG
+    
+    iStatusCode = aErrorCode;
+
+    TInt index = iSessionMap.FindValue(aRequestId);
+    if(index != KErrNotFound)
+        {
+        // session found OK
+        MSenServiceSession* pSession =
+            iSessionMap.KeyAt(index);
+        iSessionMap.Remove(aRequestId); // does not delete anything
+    
+        index = iConsumerMap.FindValue(aRequestId);
+        if(index != KErrNotFound)
+            {
+            // consumer found OK
+            MSenRemoteServiceConsumer* pConsumer =
+                iConsumerMap.KeyAt(index);
+
+            iConsumerMap.Remove(aRequestId); // deletes TxnId
+        
+            CleanupStack::Pop(apErrorBody);
+            pSession->SendErrorToConsumerL(aErrorCode, 
+                                          apErrorBody, 
+                                          aRequestId, 
+                                          *pConsumer,
+                                          aHttpProperties);
+            apErrorBody = NULL;
+            pConsumer->SetDataTrafficDetails(iDetails);                                                                                        
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(apErrorBody);
+#ifdef _SENDEBUG
+       		TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResponseErrorL:");
+            TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- pending consumer not found, txn cancelled?");
+#endif // _SENDEBUG
+            }
+        }
+    else
+        {
+        //CleanupStack::PopAndDestroy(apErrorBody);
+        CleanupStack::Pop(apErrorBody); // for EPSK-76XFAN
+#ifdef _SENDEBUG
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResponseErrorL:");
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- pending session not found, txn cancelled?");
+#endif // _SENDEBUG
+        }
+    }
+
+/*
+RFileLogger* CSenHttpChannelTransportPlugin::Log() const
+    {
+    return (RFileLogger*) &iLogger;
+    }
+*/
+
+TInt CSenHttpChannelTransportPlugin::SetPropertiesL(const TDesC8& aProperties,
+                                                    MSenLayeredProperties::TSenPropertiesLayer aTargetLayer,
+                                                    MSenRemoteServiceConsumer* /*aConsumer*/)
+    {
+    TInt retVal(KErrNone);
+    if ( aTargetLayer == MSenLayeredProperties::ESenTransportLayer )
+        {
+        retVal = KErrNotSupported;
+        }
+    else
+        {
+        LayeredPropertiesL().ReadFromL(aProperties, aTargetLayer);
+        retVal = ApplyPropertiesL();
+        }
+    return retVal;
+    }
+
+TInt CSenHttpChannelTransportPlugin::PropertiesL(HBufC8*& aProperties)
+    {
+    aProperties = PropertiesL().AsUtf8L();
+    return KErrNone;
+    }
+
+TInt CSenHttpChannelTransportPlugin::ApplyPropertiesL()
+    {
+    TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ApplyPropertiesL()");
+
+    TInt retVal(KErrNone);
+
+    // ALWAYS HANDLE IAP ID FIRST, SINCE IT *CAN RESET* HTTPCHANNEL!
+    
+    TUint32 iapId(KErrNone);
+
+    retVal = LayeredPropertiesL().IapIdL(iapId);
+    if(retVal==KErrNone)
+        {
+        TInt resetPerformed = ResetHttpChannelByIapIdL(iapId);
+#ifdef _SENDEBUG
+        if(resetPerformed == KErrNone)
+            {
+            TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- IAP re-set performed: (%d)"), iapId));
+            }
+#endif // _SENDEBUG
+        }
+
+    // Handle ProxyHost and ProxyPort
+    TPtrC8 proxyHost;
+    retVal = LayeredPropertiesL().ProxyHostL(proxyHost);
+    if ( retVal == KErrNone )
+        {
+        TInt proxyPort(KErrNotFound);
+        retVal = LayeredPropertiesL().ProxyPortL(proxyPort);
+        iHttpChannel->SetProxyL(proxyHost, proxyPort);
+        }
+
+
+    // HttpVersion
+    CSenLayeredHttpTransportProperties::TSenHttpVersion httpVersion;
+    retVal = LayeredPropertiesL().HttpVersionL(httpVersion);
+    if ( retVal == KErrNone )
+        {
+        switch ( httpVersion )
+            {
+            case CSenLayeredHttpTransportProperties::ESenHttp10:
+                {
+                TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- SetHttpVersionL(ESenHttp10)");
+                iHttpChannel->SetHttpVersionL(0);
+                }
+                break;
+            case CSenLayeredHttpTransportProperties::ESenHttp11:
+                {
+                TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- SetHttpVersionL(ESenHttp11)");
+                iHttpChannel->SetHttpVersionL(1);
+                }
+                break;
+            default:
+                // Not possible
+                break;
+            }            
+        }
+    return KErrNone; 
+    }
+
+TInt CSenHttpChannelTransportPlugin::ResetHttpChannelByIapIdL(TUint32 aIapId)
+    {
+    TUint32 effectiveIapId(KErrNone);
+    TBool explicitIapIdDefined(EFalse);
+    if(iHttpChannel)
+        {
+        explicitIapIdDefined = iHttpChannel->EffectiveIapId(effectiveIapId);
+        }
+
+    TInt retVal(KErrNone);
+    if(!explicitIapIdDefined || explicitIapIdDefined && effectiveIapId != aIapId)
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::ResetHttpChannel():");
+
+        delete iHttpChannel;
+        iHttpChannel = NULL;
+        delete iRequester;
+        iRequester = NULL;
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- New IAP ID: %d"), aIapId));
+        CSenHttpChannel* pHttpChannel = CSenHttpChannelImpl::NewL(iServiceManager, aIapId);
+        
+        CleanupStack::PushL(pHttpChannel);
+
+        CSenHttpSyncRequester* pRequester = CSenHttpSyncRequester::NewL(pHttpChannel, this);
+
+        iHttpChannel = pHttpChannel;
+        iRequester = pRequester;
+
+        CleanupStack::Pop(pHttpChannel);
+        }
+    else
+        {
+        retVal = KErrAlreadyExists;
+        }
+    return retVal;
+    }
+
+TInt CSenHttpChannelTransportPlugin::CompleteTransaction(const TInt aTxnId,
+                                                         const TInt /* aCompletionCode */)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("CSenHttpChannelTransportPlugin::CompleteTransaction(txn ID: %d)"), aTxnId /*, aCompletionCode */));
+
+    // Remove the session and consumer from arrays to prevent
+    // any unneccessary processing of completed transactions..
+
+    // Handle completed session
+    TInt index = iSessionMap.FindValue(aTxnId);
+    if(index != KErrNotFound)
+        {
+        // Session found
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Pending session found, removing it from list."), index));
+
+        //MSenServiceSession* pSession =
+        //    iSessionMap.KeyAt(index);
+
+        index = iSessionMap.Remove(aTxnId); // does not delete anything
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Remove() returned: %d"), index));
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- Cannot find pending session with given ID.");
+        }
+#endif
+    // Handle cancelled consumer
+    TInt index2 = iConsumerMap.FindValue(aTxnId);
+    if(index2 != KErrNotFound)
+        {
+        // Consumer found
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Pending consumer (%d) found, removing it from list."), 
+            index2));
+
+        //MSenRemoteServiceConsumer* pConsumer =
+        //    iConsumerMap.KeyAt(index2);
+
+        index2 = iConsumerMap.Remove(aTxnId); // deletes TxnId
+        TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Remove() returned: %d"), index2));
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- Cannot find pending consumer with given ID.");
+        }
+#endif
+    return index<index2?index:index2;
+    }
+
+TInt CSenHttpChannelTransportPlugin::CancelTransaction(const TInt aTxnId)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("CSenHttpChannelTransportPlugin::CancelTransaction(%d)"), aTxnId));
+    TInt index = CompleteTransaction(aTxnId, KErrSenCancelled);
+    if(iHttpChannel)
+        {
+        iHttpChannel->CancelTransaction(aTxnId);
+        }
+    return index;
+    }
+    
+TPtrC8 CSenHttpChannelTransportPlugin::UriSchemeL()
+    {
+    return KSenHttpChannelTransportUriScheme();
+    }
+   
+
+// Private helper
+CSenLayeredHttpTransportProperties& CSenHttpChannelTransportPlugin::LayeredPropertiesL()
+    {
+    if ( !iProperties )
+        {
+        iProperties = CSenLayeredHttpTransportProperties::NewL();
+        iProperties->SetPropertyL(KAcceptLocalName, KSenHttpChannelAcceptHeaderDefault, KHttpHeaderType);
+        iProperties->SetPropertyL(KUserAgentLocalName, KSenHttpChannelUserAgentHeaderDefault, KHttpHeaderType);
+        iProperties->SetPropertyL(KContentTypeLocalName, KContentType, KHttpHeaderType);
+        }
+    iProperties->SetReader(*iServiceManager.XMLReader());
+    return *iProperties;
+    }
+
+MSenProperties& CSenHttpChannelTransportPlugin::PropertiesL()
+    {
+    CSenLayeredHttpTransportProperties& properties = LayeredPropertiesL();
+    if( iHttpChannel )
+    	{
+    	TUint32 iapId(0);
+    	TInt error = properties.IapIdL( iapId );
+    	if ( error || iapId == 0 || iapId >=(TUint32)KErrNotFound ) // IAP is either not found from properties, or it is 0 or > MAX_INT (signed)
+	    	{
+		    TBool isIapSet = iHttpChannel->EffectiveIapId( iapId );
+		    if( isIapSet && iapId > 0 )
+		    	{
+			    TBuf8<128> buf;
+			    buf.AppendFormat(_L8("%u"), iapId);
+			    properties.SetPropertyL( KIapIdLocalName, buf );	    	
+		    	}
+            if( iHttpChannel->UsedIap() )
+                {
+                TBuf8<128> buf;
+                buf.AppendFormat(_L8("%u"), iHttpChannel->UsedIap());
+                properties.SetPropertyL( KIapIdLocalName, buf );            
+                }		    
+	    	}
+    	}
+    return properties;
+    }
+
+// Propagate http status code to remote service consumer
+void CSenHttpChannelTransportPlugin::StateChanged(TInt aRequestId, 
+													TInt aState)
+	{
+	TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMaxLogLevel,"CSenHttpChannelTransportPlugin::StateChanged:");
+    TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KMaxLogLevel, _L8("- request txnID: %d"), aRequestId));
+        
+    TInt index = iConsumerMap.FindValue(aRequestId);
+    if(index != KErrNotFound)
+        {
+		// propagate the Status code	
+		MSenRemoteServiceConsumer* pConsumer = iConsumerMap.KeyAt(index);
+		
+
+		TInt state = KSenTransportStatusCodeOffsetBaseHttp + aState;
+		pConsumer->StateChanged(state);
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"CSenHttpChannelTransportPlugin::StateChanged:");
+        TLSLOG_L(KSenHttpChannelObserverLogChannelBase,KMinLogLevel,"- pending consumer not found, txn cancelled?");
+        }
+#endif // _SENDEBUG
+	}
+
+void CSenHttpChannelTransportPlugin::FileProgress(TInt aTxnId, TBool aIncoming,
+        TBool aIsSoap, const TDesC8& aSoapOrCid, TInt aProgress)
+    {
+    TInt index = iConsumerMap.FindValue(aTxnId);
+    if (index != KErrNotFound)
+        {
+        iConsumerMap.KeyAt(index)->FileProgress(aTxnId, aIncoming, aIsSoap,
+                aSoapOrCid, aProgress);
+        }
+    }
+
+void CSenHttpChannelTransportPlugin::SetTrafficDetails(TSenDataTrafficDetails& aDetails)	
+	{
+	iDetails = aDetails;
+	}
+	
+void CSenHttpChannelTransportPlugin::DataTrafficDetails(TSenDataTrafficDetails& aDetails) 
+	{
+	aDetails = iDetails;
+	}
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportpluginmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportpluginproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+#include "senhttpchanneltransportplugin.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TInt32 KHttpChannelTransportPluginUid = 0x10274C74;
+#else
+    const TInt32 KHttpChannelTransportPluginUid = 0x101F974A;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY
+        IMPLEMENTATION_PROXY_ENTRY(KHttpChannelTransportPluginUid,  CSenHttpChannelTransportPlugin::NewL)
+#else
+        {{KHttpChannelTransportPluginUid},  CSenHttpChannelTransportPlugin::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senhttpeventhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <uri8.h>
+#include <e32base.h>
+#include <http.h>
+#include "senhttpchannelimpl.h"
+#include "senhttpeventhandler.h"
+#include <e32std.h>
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+//
+// Implementation of class CSenHttpEventHandler
+//
+
+void CSenHttpEventHandler::ConstructL()
+    {
+    }
+
+
+CSenHttpEventHandler::CSenHttpEventHandler(CSenHttpChannelImpl* aChannel)//,
+                                           //RFileLogger* aLog)
+    : iHttpChannel(aChannel),
+      //iLog(aLog),
+      iTries(0)
+    {
+    }
+
+CSenHttpEventHandler::~CSenHttpEventHandler()
+    {
+    }
+
+CSenHttpEventHandler* CSenHttpEventHandler::NewLC(
+                                                 CSenHttpChannelImpl* aChannel)//,
+                                                 //RFileLogger* aLog)
+    {
+    CSenHttpEventHandler* pNew =
+                    new (ELeave) CSenHttpEventHandler(aChannel);//, aLog);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenHttpEventHandler* CSenHttpEventHandler::NewL(CSenHttpChannelImpl* aChannel)//,
+                                                 //RFileLogger* aLog)
+    {
+    CSenHttpEventHandler* pNew = NewLC(aChannel);//, aLog);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenHttpEventHandler::MHFRunL
+// Handle Http stack events.
+// ----------------------------------------------------------------------------
+//
+void CSenHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction,
+                                   const THTTPEvent& aEvent)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("CSenHttpEventHandler::MHFRunL( %d )"), aEvent.iStatus));
+    if (aEvent.iStatus < 0)
+        {
+        if (aEvent.iStatus == KErrDisconnected)
+            {
+            aTransaction.Cancel();
+            TRAPD(err, aTransaction.SubmitL());
+            if (err != KErrNone)
+                {
+                iHttpChannel->HandleRunErrorL(aTransaction, err);
+                }
+            }
+        else
+            {
+            iHttpChannel->SetExplicitIapDefined(EFalse);
+            iHttpChannel->HandleRunErrorL(aTransaction, aEvent.iStatus);
+            }
+        return;
+        }
+
+    switch (aEvent.iStatus)
+        {
+        case THTTPEvent::EGotResponseHeaders:
+            TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("CSenHttpEventHandler::statuscode( %d )"),
+                                     aTransaction.Response().StatusCode()));
+            iHttpChannel->HandleResponseHeadersL(aTransaction);
+            break;
+        case THTTPEvent::EGotResponseBodyData:
+            iHttpChannel->HandleResponseBodyDataL(aTransaction);
+            iTries = 0;
+            break;
+        case THTTPEvent::EResponseComplete:
+            break;
+        case THTTPEvent::ESucceeded:
+            iHttpChannel->HandleResponseL(aTransaction);
+            break;
+        case THTTPEvent::EFailed:
+        case THTTPEvent::EMoreDataReceivedThanExpected:
+            iHttpChannel->HandleRunErrorL(aTransaction,
+                                    aTransaction.Response().StatusCode());
+            break;
+        case THTTPEvent::EUnrecoverableError:
+            iHttpChannel->HandleRunErrorL(aTransaction, KErrNoMemory);
+            break;
+        case THTTPEvent::ERedirectRequiresConfirmation:
+            iHttpChannel->HandleRedirectRequiresConfirmationL(aTransaction);
+            break;
+        case THTTPEvent::ERedirectedPermanently:
+        case THTTPEvent::ERedirectedTemporarily:
+        case THTTPEvent::EGotResponseTrailerHeaders:
+            break;// We don't process this event
+        default:
+            iHttpChannel->HandleRunErrorL(aTransaction, aEvent.iStatus);
+            break;
+        }
+    if (aTransaction.Response().StatusCode() == 401 && iTries < 4)
+        {
+        iTries++;
+        aTransaction.SubmitL(); 
+        }
+    }
+
+TInt CSenHttpEventHandler::MHFRunError(TInt aError,
+                                       RHTTPTransaction aTransaction,
+                                       const THTTPEvent& /*aEvent*/)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpEventHandler::MHFRunError( %d )"), aError));
+    TRAP_IGNORE( iHttpChannel->HandleRunErrorL(aTransaction, aError); ) 
+    return KErrNone;
+    }
+/*
+RFileLogger* CSenHttpEventHandler::Log() const
+    {
+    return iLog;
+    }
+*/
+// EOF
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senhttpsyncrequester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senhttpsyncrequester.h"
+#include "senhttpchannel.h"
+#include "senlayeredhttptransportproperties.h"
+
+// =========================== MEMBER FUNCTIONS ===============================
+
+CSenHttpSyncRequester* CSenHttpSyncRequester::NewL(CSenHttpChannel* aHttpChannel)
+    {
+    CSenHttpSyncRequester* pNew = CSenHttpSyncRequester::NewLC(aHttpChannel, NULL);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenHttpSyncRequester* CSenHttpSyncRequester::NewLC(CSenHttpChannel* aHttpChannel)
+    {
+    CSenHttpSyncRequester* pNew = CSenHttpSyncRequester::NewLC(aHttpChannel, NULL);
+    return pNew;
+    }
+
+
+CSenHttpSyncRequester* CSenHttpSyncRequester::NewL(CSenHttpChannel* aHttpChannel,
+                                                   MSenResponseObserver* aParent)
+    {
+    CSenHttpSyncRequester* pNew = CSenHttpSyncRequester::NewLC(aHttpChannel, aParent);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenHttpSyncRequester* CSenHttpSyncRequester::NewLC(CSenHttpChannel* aHttpChannel,
+                                                    MSenResponseObserver* aParent)
+    {
+    CSenHttpSyncRequester* pNew =
+            new (ELeave) CSenHttpSyncRequester(aHttpChannel, aParent);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+MSenProperties& CSenHttpSyncRequester::PropertiesL()
+    {
+    return iParentObserver->PropertiesL();
+    }
+
+CSenHttpSyncRequester::CSenHttpSyncRequester(CSenHttpChannel* aHttpChannel,
+                                             MSenResponseObserver* aParent)
+
+:   CTimer(EPriorityStandard),
+    iHttpChannel(aHttpChannel),
+    iStatusCode(KErrNone),
+    iParentObserver(aParent)
+    {
+    }
+
+void CSenHttpSyncRequester::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add(this);
+    isStopped = ETrue;
+    }
+
+CSenHttpSyncRequester::~CSenHttpSyncRequester()
+    {
+    delete iContentType;
+    delete iContent;
+    if (!isStopped)
+        {
+        iSchedulerWait.AsyncStop();
+        }
+    }
+void CSenHttpSyncRequester::DoCancel()
+    {
+    CTimer::DoCancel();
+    }
+void CSenHttpSyncRequester::RunL()
+    {
+    if (!isStopped)
+        {
+        iStatusCode = KErrTimedOut;
+        iSchedulerWait.AsyncStop();
+        }
+    isStopped = ETrue;
+    }
+TInt CSenHttpSyncRequester::RunError(TInt aError)
+    {
+    if (!isStopped)
+        {
+        iStatusCode = aError;
+        iSchedulerWait.AsyncStop();
+        }
+    isStopped = ETrue;
+    return aError;
+    }
+
+
+/*
+// GET
+TInt CSenHttpSyncRequester::SubmitL(const TDesC8& aRequestUri,
+                                             HBufC8*& aResponseContentType,
+                                             HBufC8*& aResponseContent,
+                                             TInt& aErrorCode)
+    {
+    iStatusCode = KErrNone;
+    TInt submitId = iHttpChannel->SendL(*this, aRequestUri);
+    iSchedulerWait.Start();
+    aResponseContentType = iContentType;
+    iContentType = NULL;
+    aResponseContent = iContent;
+    iContent = NULL;
+    aErrorCode = iStatusCode;
+    return submitId;
+    }
+*/
+
+// POST
+TInt CSenHttpSyncRequester::SubmitL(const TDesC8& aRequestUri,
+                                    CSenLayeredHttpTransportProperties& aProps,
+                                    const TDesC8& aRequestContent,
+                                    HBufC8*& aResponseContentType,
+                                    HBufC8*& aResponseContent,
+                                    TInt& aErrorCode)
+    {
+    if (!isStopped)
+        {
+        iHttpChannel->CancelAllTransactions();
+        iSchedulerWait.AsyncStop();
+        }
+    isStopped = ETrue;
+    iStatusCode = KErrNone;
+    this->Cancel();
+    TInt submitId = iHttpChannel->SendL(*this,
+                                        aRequestUri,
+                                        aRequestContent,
+                                        aProps);
+    
+    TInt timeOut(0);
+    if (aProps.MaxTimeToLiveL(timeOut) == KErrNone)
+        {
+        this->After(timeOut * 1000000);    
+        }
+    
+    isStopped = EFalse;
+    iSchedulerWait.Start();
+    this->Cancel();
+    aResponseContentType = iContentType;
+    iContentType = NULL;
+    aResponseContent = iContent;
+    iContent = NULL;
+    aErrorCode = iStatusCode;
+    return submitId;
+    }
+
+
+void CSenHttpSyncRequester::ResponseReceivedL( TInt /*aId*/, const TAny* aContentType, HBufC8* apContent, CSenHttpTransportProperties* /*aHttpProperties*/ )
+    {
+    iContent = apContent; // transfers ownership of content into _this_ class
+    iContentType = ((HBufC8*)aContentType)->AllocL();
+    if (!isStopped)
+        {
+        iSchedulerWait.AsyncStop();
+        }
+    isStopped = ETrue;
+    }
+
+void CSenHttpSyncRequester::ResponseErrorL( TInt aId, TInt aError, HBufC8* apErrorBody, CSenHttpTransportProperties* aHttpProperties  )
+    {
+    iStatusCode = aError;
+    iContentType = NULL;
+
+    if (iParentObserver)
+        {
+        //iContent = NULL;      To fix EPSK-76XFAN
+        iParentObserver->ResponseErrorL( aId, aError, apErrorBody,  aHttpProperties);
+        iContent = apErrorBody;  // To fix EPSK-76XFAN
+        }
+    else
+        {
+        iContent = apErrorBody;
+        }    
+        
+    if (!isStopped)
+        {
+        iSchedulerWait.AsyncStop();
+        }
+    isStopped = ETrue;
+    }
+
+// Propagate the http status code to remote service consumer
+void CSenHttpSyncRequester::StateChanged(TInt aRequestId, TInt aState)
+	{
+    if (iParentObserver)
+        {
+        iParentObserver->StateChanged(aRequestId, aState);
+        }	
+	}
+
+void CSenHttpSyncRequester::SetTrafficDetails(TSenDataTrafficDetails& aDetails) 
+	{
+    if (iParentObserver)
+        {
+        iParentObserver->SetTrafficDetails(aDetails);
+        }		
+	}
+
+
+//////////////////////////////////////////////////////////////////////////
+
+/*
+TInt CSenHttpSyncRequester::SubmitL(const TDesC8& aRequestUri,
+                                    const TDesC8* aRequestContentType,
+                                    MSenElement& aMessage, //SOAP envelope
+                                    HBufC8*& aResponseContentType,
+                                    HBufC8*& aResponseContent,
+                                    TInt& aErrorCode)
+    {
+    iStatusCode = KErrNone;
+
+
+    TInt submitId = iHttpChannel->SubmitL(*this,
+                                        aRequestUri,
+                                        aRequestContentType,
+                                        aMessage);
+    iSchedulerWait.Start();
+    aResponseContentType = iContentType;
+    iContentType = NULL;
+    aResponseContent = iContent;
+    iContent = NULL;
+    aErrorCode = iStatusCode;
+    return submitId;
+    }
+*/
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senmtomtxnstate.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <http.h>
+
+#include "senmtomtxnstate.h"
+#include "senhttpchannel.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+// =========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CSenMtomTxnState::CSenMtomTxnState
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CSenMtomTxnState::CSenMtomTxnState(MSenResponseObserver& aObserver)
+    : CSenMultiPartTxnState(aObserver)
+   	{
+    }
+    
+CSenMtomTxnState* CSenMtomTxnState::NewL(MSenResponseObserver& aObserver,
+                          		     	 const TDesC8* aUri,
+                                   		 const TDesC8& aSoapAction,
+                                   		 CSenSoapEnvelope2& aSoapEnvelope2)
+                                   		 
+    {
+    CSenMtomTxnState* pNew = NewLC( aObserver, aUri, aSoapAction,
+                                	aSoapEnvelope2);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenMtomTxnState* CSenMtomTxnState::NewLC(MSenResponseObserver& aObserver,
+                                  		  const TDesC8* aUri,
+                                  		  const TDesC8& aSoapAction,
+                                  		  CSenSoapEnvelope2& aSoapEnvelope2)
+   
+    {
+    CSenMtomTxnState* pNew = new (ELeave) CSenMtomTxnState(aObserver);;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aUri, aSoapAction, aSoapEnvelope2);
+    return pNew;
+    }
+
+
+void CSenMtomTxnState::ConstructL(const TDesC8* aUri,
+                         	      const TDesC8& aSoapAction,
+                         	      CSenSoapEnvelope2& aSoapEnvelope2)
+    {
+    
+    __ASSERT_ALWAYS(aUri != NULL,
+                    User::Panic(KRequestUriNullPanicText,
+                                CSenHttpChannel::ERequestUriNull));
+    iRequestUri = aUri->AllocL();
+    iSoapAction.CreateL(aSoapAction.Length());
+    iSoapAction.Copy(aSoapAction);
+    
+    if(!&aSoapEnvelope2)
+		{
+		iHasRequestBody = EFalse;
+		User::Panic(KMultiPartNoRequestMessagePanicText, SenMultiPartUtils::EMultiPartNoRequestMessage);
+		}
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMtomTxnState::ConstructL")));
+      	
+   	iMessage = &aSoapEnvelope2; // not owned
+   	RSenDocument doc = aSoapEnvelope2.AsDocumentL();
+ 	doc.GetDataContainerList(iBinaryDataList);
+
+ 	iCountDataParts = 3 + iBinaryDataList.Count()*2; //how many parts there are in XOP 
+	iHasRequestBody = ETrue;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// creates HTTP content type header for XOP message
+//
+// HTTP content type header for SOAP v1.1 should be the next:
+// Content-Type: Multipart/Related;boundary=MIME_boundary;type="application/xop+xml";
+// start="<>"; start-info="text/xml"
+//
+// HTTP content type header for SOAP v1.2 should be the next:
+// Content-Type: Multipart/Related;boundary=MIME_boundary;type="application/xop+xml";
+// start="<>";start-info="application/soap+xml"
+//
+// Note: 1.it's one line without return carrige
+//       2."boundary" is generated as <rundomNumber>
+//       3."start" is generated as <randomNumber>@<homeTime>
+//       4."actionVal12" = SoapAction from transport properties
+// ---------------------------------------------------------------------------
+//
+void CSenMtomTxnState::SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders)
+	{
+	_LIT8(KMultipartRelated,"Multipart/Related");	//CodeScannerWarning
+	_LIT8(KBoundry,"boundary");
+	_LIT8(KType,"type");
+	_LIT8(KStart,"start");
+	_LIT8(KStartInfo,"start-info");
+    _LIT8(KApplicationXop,"\"application/xop+xml\"");
+    _LIT8(KApplicationSoap,"\"application/soap+xml\"");
+    _LIT8(KTextXml,"\"text/xml\"");
+    _LIT8(KSlashLessthan,"\"<");
+	_LIT8(KSlashGreaterthan,">\"");
+	SenMultiPartUtils::GenerateRandomRootCidL(iRootCid);
+	RBuf8 rootCid(NULL);
+	rootCid.ReAllocL(4+iRootCid.Length());
+	CleanupClosePushL(rootCid);
+    rootCid.Append(KSlashLessthan);
+	rootCid.Append(iRootCid);
+	rootCid.Append(KSlashGreaterthan);
+	 
+	SenMultiPartUtils::GenerateRandomBoundaryL(iMimeBoundaryOut);
+
+	RStringF multipartRelated = aSession.StringPool().OpenFStringL(KMultipartRelated);
+	RStringF boundary         = aSession.StringPool().OpenFStringL(KBoundry);
+	RStringF boundaryVal      = aSession.StringPool().OpenFStringL(iMimeBoundaryOut);
+	RStringF type             = aSession.StringPool().OpenFStringL(KType);
+	RStringF typeVal          = aSession.StringPool().OpenFStringL(KApplicationXop);
+	RStringF start            = aSession.StringPool().OpenFStringL(KStart);
+	RStringF startVal         = aSession.StringPool().OpenFStringL(rootCid);
+	RStringF startInfo        = aSession.StringPool().OpenFStringL(KStartInfo);
+	RStringF startInfoVal11   = aSession.StringPool().OpenFStringL(KTextXml);
+	RStringF startInfoVal12   = aSession.StringPool().OpenFStringL(KApplicationSoap);
+	
+	CleanupStack::PopAndDestroy(&rootCid);
+	
+	THTTPHdrVal contentTypeVal(multipartRelated);
+	THTTPHdrVal boundVal(boundaryVal);
+	THTTPHdrVal tVal(typeVal);
+	THTTPHdrVal stVal(startVal);
+	
+	THTTPHdrVal stInfoVal;
+
+	switch (((CSenSoapEnvelope2*)iMessage)->SoapVersion())
+		{
+ 		case ESOAP11:
+			{
+			stInfoVal = startInfoVal11;
+			break;
+			}
+		case ESOAP12:
+			{
+			stInfoVal = startInfoVal12;	
+			break;
+			}
+		default:
+			{
+        	User::Panic(KMultiPartSoapVersionInvalidPanicText, SenMultiPartUtils::EMultiPartSoapVersionInvalid);			}			
+		    }
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+					   contentTypeVal, boundary, boundVal);
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+				       contentTypeVal, type, tVal);
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+					   contentTypeVal, start, stVal);
+	aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+					   contentTypeVal, startInfo, stInfoVal);
+
+					   
+    if (((CSenSoapEnvelope2*)iMessage)->SoapVersion() == ESOAP12)
+        {
+      	RStringF action           = aSession.StringPool().OpenFStringL(_L8("action"));
+    	RStringF actionVal12      = aSession.StringPool().OpenFStringL(iSoapAction);
+    	
+        aHeaders.SetFieldL(aSession.StringPool().StringF(HTTP::EContentType,RHTTPSession::GetTable()), 
+		    			   contentTypeVal, action, actionVal12);
+    	action.Close();
+	    actionVal12.Close();
+        }
+
+	multipartRelated.Close();
+	boundary.Close();         
+	boundaryVal.Close();      
+	type.Close();             
+	typeVal.Close();          
+	start.Close();            
+	startVal.Close();         
+	startInfo.Close();        
+	startInfoVal11.Close();   
+	startInfoVal12.Close();
+	}
+// ---------------------------------------------------------------------
+// creates SoapEnvelope in Request
+// ---------------------------------------------------------------------
+//    
+void CSenMtomTxnState::MessageL()
+    {
+    // iCurrentPart == XOP envelope:
+    SenMultiPartUtils::SerializeMessageL(*(CSenSoapEnvelope2*)iMessage, iCurrentPart);
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMtomTxnState::GetNextDataPart - aDataPart (XOP Envelope):")));
+    iCurPart = ETrue; 
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senmultiparttxnstate.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,559 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <http.h>
+
+#include "senmultiparttxnstate.h"
+#include "senhttpchannel.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+// =========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CSenMultiPartTxnState::CSenMultiPartTxnState
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CSenMultiPartTxnState::CSenMultiPartTxnState(MSenResponseObserver& aObserver)
+    : CSenTxnState(aObserver),
+   	  iRootCid(NULL),
+	  iMimeBoundaryOut(NULL),
+	  iMimeBoundaryIn(NULL),
+	  iMimeBoundaryEndIn(NULL),
+  	  iPartDataOut(1),
+ 	  iLastPartOut(EFalse),
+   	  iPartDataIn(1),
+ 	  iLastPartIn(EFalse),
+ 	  iCurPart(EFalse),
+ 	  iBinaryDataEnd(ETrue),
+ 	  iChecked(EFalse),
+ 	  iBinaryDataPart(NULL),
+ 	  iBinaryDataParts(NULL),
+ 	  iBinaryDataRest(NULL),
+ 	  iFirst(ETrue)
+    {
+    }
+    
+
+    
+CSenMultiPartTxnState::~CSenMultiPartTxnState()
+	{
+	iMessage = NULL;
+	iBinaryDataList.Close();
+	iRootCid.Close();
+	iMimeBoundaryOut.Close();
+	iMimeBoundaryIn.Close();
+	iMimeBoundaryEndIn.Close();
+    iCurrentPart.Close();
+    iSoapAction.Close();
+    iXopEnvelopeResponse.Close();
+    iBlobHeader.Close();
+    
+    for(TUint i(0); i < iFileNames.Count(); ++i) // iFileNames.Count() equals iCids.Count()
+        {
+        iFileNames[i].Close();
+        iCids[i].Close();
+        }
+    iFileNames.Close();
+    iCids.Close();
+	}
+
+
+
+// ---------------------------------------------------------------------
+// calculates number of parts in BLOB (every part = 10KB) 
+// and how many bytes there are in the last part
+//----------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::SizeBinaryData(TUint aIndex)
+    {
+    TUint size = iBinaryDataList[aIndex].Size();
+    iBinaryDataParts = size/KTenKBytes;
+    iBinaryDataRest = size%KTenKBytes;
+    if (iBinaryDataParts > 0)
+        {
+        iBinaryDataEnd = EFalse;
+        }
+    }
+
+// ---------------------------------------------------------------------
+// creates header for Blob in Request
+// ---------------------------------------------------------------------
+//    
+void CSenMultiPartTxnState::BlobHeaderL()
+	{
+	// iCurrentPart == header, binary part
+	RBuf8 boundaryStart;
+	boundaryStart.CleanupClosePushL();
+	SenMultiPartUtils::BoundaryLineStartL(iMimeBoundaryOut, boundaryStart);	
+
+	TUint index = (iPartDataOut - 3)/2;
+    			
+	RBuf8 headerBinaryData;
+	headerBinaryData.CleanupClosePushL();
+   	SenMultiPartUtils::HeaderBinaryDataL(index, iBinaryDataList, headerBinaryData);
+
+	iCurrentPart.ReAllocL(2*KNewLine().Length()+boundaryStart.Length()+headerBinaryData.Length());
+	iCurrentPart.Append(KNewLine);
+	iCurrentPart.Append(KNewLine);
+	iCurrentPart.Append(boundaryStart);
+	iCurrentPart.Append(headerBinaryData);
+	CleanupStack::PopAndDestroy(&headerBinaryData); 
+	CleanupStack::PopAndDestroy(&boundaryStart);  
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMultiPartTxnState::GetNextDataPart - aDataPart (header, binary part):")));
+	iCurPart = ETrue;
+	}
+
+// ---------------------------------------------------------------------
+// for case if Blob is kept in a file 
+// this function passes Blob from a file part by part (every part = 10KB)
+// in Request
+// ---------------------------------------------------------------------
+//    
+void CSenMultiPartTxnState::FileContainerL(TUint aIndex)
+    {
+    if (!iChecked)
+        {
+    	SizeBinaryData(aIndex);
+    	iChecked = ETrue;
+    	}
+    if (iBinaryDataPart < iBinaryDataParts) 
+        {
+        SenMultiPartUtils::FileDataPartL(iBinaryDataPart, aIndex, iBinaryDataList, iCurrentPart);
+        }
+    else if (iBinaryDataRest != 0)
+        {
+        SenMultiPartUtils::FileDataRestL(iBinaryDataParts, iBinaryDataRest, aIndex, iBinaryDataList, iCurrentPart);
+        iBinaryDataEnd = ETrue;
+        }
+    iCurPart = ETrue;    
+    }
+
+// ---------------------------------------------------------------------
+// creates the last part (MimeBoundaryEnd) in Request
+// ---------------------------------------------------------------------
+//    
+void CSenMultiPartTxnState::XopEndL()
+	{
+	// iCurrentPart == XOP end
+	SenMultiPartUtils::BoundaryLineEndL(iMimeBoundaryOut, iCurrentPart);	
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMultiPartTxnState::GetNextDataPart - aDataPart (boundary end):")));
+	iCurPart = ETrue;
+	iLastPartOut = ETrue;
+	}
+
+// ----------------------------------------------------------------------------
+// CSenMultiPartTxnState::GetNextDataPart
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TBool CSenMultiPartTxnState::GetNextDataPart(TPtrC8& aDataPart)
+    {
+    TBool lastPart(EFalse);
+    TRAP_IGNORE(lastPart = GetNextDataPartL(aDataPart));
+    return lastPart;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenMultiPartTxnState::ReleaseData
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::ReleaseData()
+	{
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMultiPartTxnState::ReleaseData")));
+    iCurPart = EFalse;
+    iCurrentPart.Close();
+	if (!iLastPartOut)
+		{
+		// Notify HTTP of more data available immediately
+		TRAP_IGNORE(Transaction().NotifyNewRequestBodyPartL());
+		if (iBinaryDataEnd)
+		    {
+    		iPartDataOut++;
+		    iChecked = EFalse;
+		    iBinaryDataPart = 0;
+		    }
+		else 
+		    {
+		    ++iBinaryDataPart;
+		    }    
+		}
+	}
+
+// ----------------------------------------------------------------------------
+// CSenMultiPartTxnState::OverallDataSize
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TInt CSenMultiPartTxnState::OverallDataSize()
+    {
+	return KErrNotFound;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CSenMultiPartTxnState::Reset
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TInt CSenMultiPartTxnState::Reset()
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMultiPartTxnState::Reset")));
+	return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// parses Response from server (MultiPart message) and extracts MimeBoundary part
+// and MimeBoundaryEnd part
+// ---------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::MimeBoundaryInL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1)
+    {
+    _LIT8(KDDash,"--");
+    aOffset = aDataPartPtr.Find(KDDash); 	//CodeScannerWarnings
+    if (aOffset == KErrNotFound)
+        {
+        User::Panic(KMultiPartResponseBodyInvalidPanicText, SenMultiPartUtils::EMultiPartResponseBodyInvalid);
+        }
+    aDataPartPtr.Set(aDataPartPtr.Right(aDataPartPtr.Length()-aOffset));
+    aOffset = aDataPartPtr.Find(_L8("\r\n")); 
+
+    iMimeBoundaryIn.ReAllocL(aOffset);
+    iMimeBoundaryIn.Copy(aDataPartPtr.Left(aOffset));
+
+    iMimeBoundaryEndIn.ReAllocL(aOffset+2);
+    iMimeBoundaryEndIn.Append(iMimeBoundaryIn);
+    iMimeBoundaryEndIn.Append(KDDash);
+        
+    aDataPartPtr.Set(aDataPartPtr.Right(aDataPartPtr.Length()-aOffset-2));
+
+    aOffset = aDataPartPtr.Find(_L8("\r\n\r\n"));
+    aOffset1 = aDataPartPtr.Find(iMimeBoundaryEndIn);
+    if (aOffset1 != KErrNotFound)
+        {
+        iLastPartIn = ETrue;
+        }
+    if (aOffset != KErrNotFound) 
+        {
+        aDataPartPtr.Set(aDataPartPtr.Right(aDataPartPtr.Length()-aOffset-4));
+        iPartDataIn++;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// parses Response from server (MultiPart message) and extracts XopEnvelope part
+// ---------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::XopEnvelopeResponseL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1)    
+    {
+    aOffset = aDataPartPtr.Find(iMimeBoundaryIn);
+    aOffset1 = aDataPartPtr.Find(iMimeBoundaryEndIn);
+    if (aOffset1 != KErrNotFound)
+        {
+        iLastPartIn = ETrue; 
+        }
+    if (aOffset == KErrNotFound) 
+        {
+        iXopEnvelopeResponse.ReAllocL(iXopEnvelopeResponse.Length()+aDataPartPtr.Length());
+        iXopEnvelopeResponse.Append(aDataPartPtr);
+        }
+    else
+        {
+        iXopEnvelopeResponse.ReAllocL(iXopEnvelopeResponse.Length()+aOffset-4);
+        iXopEnvelopeResponse.Append(aDataPartPtr.Left(aOffset-4));
+        aDataPartPtr.Set(aDataPartPtr.Right(aDataPartPtr.Length()-aOffset));
+        iPartDataIn++;
+        iObserver->FileProgress(iId, ETrue, ETrue,
+                    iXopEnvelopeResponse, iXopEnvelopeResponse.Length());    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// parses Response from server (MultiPart message) and extracts header of Blob part
+// ---------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::BlobHeaderResponseL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1) 
+    {
+    aOffset = aDataPartPtr.Find(_L8("\r\n\r\n"));
+    aOffset1 = aDataPartPtr.Find(iMimeBoundaryEndIn);
+    
+    if (aOffset1 != KErrNotFound)
+        {
+        iLastPartIn = ETrue;
+        }
+    if (aOffset == KErrNotFound)
+        {
+        iBlobHeader.ReAllocL(iBlobHeader.Length()+aDataPartPtr.Length());
+        iBlobHeader.Append(aDataPartPtr);
+        }
+    else
+        {
+        iBlobHeader.ReAllocL(iBlobHeader.Length()+aOffset);
+        iBlobHeader.Append(aDataPartPtr.Left(aOffset));
+
+        // extract cids
+        SenMultiPartUtils::CidL(iBlobHeader, iCids);
+
+        iBlobHeader.Close();
+        
+        aDataPartPtr.Set(aDataPartPtr.Right(aDataPartPtr.Length()-aOffset-4));
+        iPartDataIn++;
+        }
+    }  
+    
+// ---------------------------------------------------------------------------
+// parses Response from server (MultiPart message) and extracts Blob part
+// puts it in the file
+// ---------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::BlobResponseL(TPtrC8& aDataPartPtr, TInt& aOffset, TInt& aOffset1)
+    {
+    TInt size(0);
+    aOffset = aDataPartPtr.Find(iMimeBoundaryIn);
+    aOffset1 = aDataPartPtr.Find(iMimeBoundaryEndIn);
+    if (aOffset1 != KErrNotFound)
+        {
+        iLastPartIn = ETrue;
+        }
+    TUint index = (iPartDataIn-4)/2;
+
+    if (aOffset == KErrNotFound)
+        {
+        size = SenMultiPartUtils::SetFileL(index, iFirst, aDataPartPtr, iFileNames);
+        iFirst = EFalse;
+        }
+    else
+        {
+        TPtrC8 blobPartPtr;
+        blobPartPtr.Set(aDataPartPtr.Left(aOffset-4));
+        size = SenMultiPartUtils::SetFileL(index, iFirst, blobPartPtr, iFileNames);
+        aDataPartPtr.Set(aDataPartPtr.Right(aDataPartPtr.Length()-aOffset));
+        iFirst = ETrue;
+        iPartDataIn++;
+        }
+    iObserver->FileProgress(iId, ETrue, EFalse, iCids[index], size); 
+    }      
+
+// ---------------------------------------------------------------------------
+// parses Response from server (MultiPart message) 
+// ---------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::ParseMultiPartResponseL(TDesC8& aDataPart)
+    {
+    TPtrC8 dataPartPtr;
+	dataPartPtr.Set(aDataPart);
+
+    TInt offset(0);
+    TInt offset1(-1);
+    if (!iLastPartIn)
+        {
+        while ((dataPartPtr.Length()) && (offset != offset1))
+            {
+            if (iPartDataIn == 1)
+	            {
+	            MimeBoundaryInL(dataPartPtr, offset, offset1);
+	            }
+	        else if (iPartDataIn == 2)
+   		        {
+   		        XopEnvelopeResponseL(dataPartPtr, offset, offset1);
+	            }
+	        else if ((iPartDataIn > 2) && (iPartDataIn%2 != 0))
+	            {
+   		        BlobHeaderResponseL(dataPartPtr, offset, offset1);
+  		        }
+   	        else if ((iPartDataIn > 2) && (iPartDataIn%2 == 0))
+   		        {
+   		        BlobResponseL(dataPartPtr, offset, offset1);
+   		        }
+            }
+        }
+     }
+
+// -----------------------------------------------------------------------------
+// added HttpTransportProperties about Cids of Blobs and File namess, 
+// where Blobs are kept
+// and passes transport properties and XopEnvelope to an observer
+//------------------------------------------------------------------------------
+//
+void CSenMultiPartTxnState::ResponseReceivedL(const SenMultiPartUtils::TMultiPartContentType& aMultiPartContentType)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenMultiPartTxnState(%d)::ResponseReceivedL"), iId));
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMaxLogLevel,"iXopEnvelopeResponse:");
+    TLSLOG_ALL(KSenHttpChannelLogChannelBase , KMaxLogLevel,(iXopEnvelopeResponse));
+
+
+    if(iXopEnvelopeResponse.Length())
+        {
+		CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();
+															
+		pHttpProperties->SetDownloadFolderL(KDownloadFolder);
+		for (TUint i=0; i < iCids.Count(); ++i)
+			{
+			pHttpProperties->SetFileAttachmentL(iCids[i], iFileNames[i]);
+			}
+        HBufC8* pResponse = iXopEnvelopeResponse.AllocL();
+        // delete allocated body
+        iXopEnvelopeResponse.Close();  
+        iObserver->ResponseReceivedL(iId, &aMultiPartContentType, pResponse, pHttpProperties);
+       	CleanupStack::PopAndDestroy(pHttpProperties);
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"Fatal: NULL response received in MultiPartTxnState!");
+        // delete allocated body
+        iXopEnvelopeResponse.Close();  
+        }
+
+    }
+// ---------------------------------------------------------------------
+// creates header for SoapEnvelope in Request
+// ---------------------------------------------------------------------
+//    
+void CSenMultiPartTxnState::MessageHeaderL()
+    {
+    RBuf8 boundaryStart;
+    boundaryStart.CleanupClosePushL();
+
+    // Note: BoundaryLineStart re-allocates (and first de-allocates) boundaryStart
+    SenMultiPartUtils::BoundaryLineStartL(iMimeBoundaryOut, boundaryStart);	
+
+    RBuf8 headerRoot;
+    headerRoot.CleanupClosePushL();
+
+    // Note: HeaderRootL re-allocates (and first de-allocates) iRootCid
+    SenMultiPartUtils::HeaderRootL(iMessage, iRootCid, headerRoot);
+    		
+    // iCurrentPart == header root:
+    iCurrentPart.ReAllocL(boundaryStart.Length()+headerRoot.Length());
+    iCurrentPart.Append(boundaryStart);
+    iCurrentPart.Append(headerRoot);
+    CleanupStack::PopAndDestroy(&headerRoot); 
+    CleanupStack::PopAndDestroy(&boundaryStart); 
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMultiPartTxnState::MessageHeaderL")));
+    iCurPart = ETrue; 
+    }
+
+// ---------------------------------------------------------------------
+// creates SoapEnvelope in Request
+// ---------------------------------------------------------------------
+//    
+void CSenMultiPartTxnState::MessageL()
+    {
+    }
+
+
+// ----------------------------------------------------------------------------
+// creates Request for MultiPart message in MultiPart format 
+// should be used to send MultiPart message through HTTP Channel
+// ----------------------------------------------------------------------------
+//
+TBool CSenMultiPartTxnState::GetNextDataPartL(TPtrC8& aDataPart)
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMtomTxnState::GetNextDataPart")));
+
+	if(!HasRequestBody())
+		{
+		iLastPartOut = ETrue;
+		iPartDataOut = 0;
+		}	
+	else 
+	    {
+	    if(!iCurPart) // Note: this is zero only when new part is requested
+      		{
+    		if ((iPartDataOut == 1) && (iPartDataOut < iCountDataParts))
+    		    {
+    		    MessageHeaderL(); // First part of MultiPart message = header of SoapEnvelope
+    		    }
+    		else if ((iPartDataOut == 2) && (iPartDataOut < iCountDataParts))
+    		    {
+    		    MessageL(); // Second part of MultiPart message = SoapEnvelope
+    		    }
+    		else if ((iPartDataOut > 2) && (iPartDataOut%2 != 0) && (iPartDataOut < iCountDataParts))
+    		    {
+    		    BlobHeaderL(); // Third and then all odd parts = headers of Blobs 
+    		    }
+    		else if ((iPartDataOut > 2) && (iPartDataOut%2 == 0) && (iPartDataOut < iCountDataParts))
+    			{
+    			TUint index = (iPartDataOut - 4)/2;
+    			
+    			switch (iBinaryDataList[index].NodeType()) // Fourth and then all even parts = Blobs
+		            {
+     		        case TXmlEngNode::EChunkContainer: // blob is kept in Chunk
+    			        {
+    		            TInt offset = iBinaryDataList[index].AsChunkContainer().ChunkOffset();
+   			            aDataPart.Set(iBinaryDataList[index].AsChunkContainer().Chunk().Base()+offset,iBinaryDataList[index].Size());
+     		            TLSLOG_ALL(KSenHttpChannelLogChannelBase , KMaxLogLevel,aDataPart); 
+    		            iBinaryDataEnd = ETrue;
+     		            return iLastPartOut;
+    			        }
+ 	
+ 		            case TXmlEngNode::EFileContainer: // blob is kept in File
+   			            {
+                        FileContainerL(index);
+    			        break;
+    			        }
+      	
+ 	                case TXmlEngNode::EBinaryContainer: // blob is kept as binary data
+    			        {
+	     		        aDataPart.Set(iBinaryDataList[index].AsBinaryContainer().Contents()); 
+	     		        return iLastPartOut;
+    			        }
+    	
+ 	            	default:
+ 			            {
+                    	User::Panic(KMultiPartBlobContainerTypeInvalidPanicText, 
+                    	            SenMultiPartUtils::EMultiPartBlobContainerTypeInvalid); 			            }
+ 		                }
+
+     			TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenMtomTxnState::GetNextDataPart - aDataPart (binary data)"))); 
+                if (iBinaryDataPart)
+                    {
+                    iObserver->FileProgress(iId, EFalse, EFalse,
+                                iBinaryDataList[index].Cid(), iBinaryDataPart*KTenKBytes);
+                    }
+    			}
+    		else if (iPartDataOut == iCountDataParts)
+    		    {
+    		    TUint index = (iPartDataOut - 4)/2;
+    		    XopEndL(); // The last part of MultiPart message = MimeBoundaryEnd
+    		    if ((iPartDataOut > 2) && (iPartDataOut%2 == 0))
+    		        {
+    		        iObserver->FileProgress(iId, EFalse, EFalse,
+                                iBinaryDataList[index].Cid(), iBinaryDataList[index].Size());
+    		        }
+        		    
+    		    }
+    		} // on first call, allocate the current part
+	    aDataPart.Set(iCurrentPart); // .. otherwise, just re-use it
+        TLSLOG_ALL(KSenHttpChannelLogChannelBase , KMaxLogLevel,aDataPart); 
+        }
+	return iLastPartOut;	
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/senrfiletxnstate.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,220 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <http.h>
+#include "senrfiletxnstate.h"
+#include "senhttpchannel.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "senasynctimeout.h"
+
+
+// MACROS
+const TInt KDataPartLength = 1024;
+// =========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::CSenRfileTxnState
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+
+CSenRfileTxnState::CSenRfileTxnState(MSenResponseObserver& aObserver)//,
+                           //RFileLogger* aLog)
+    : CSenTxnState (aObserver/*, iLog(aLog)*/)
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::NewLC
+// ----------------------------------------------------------------------------
+//
+
+CSenRfileTxnState* CSenRfileTxnState::NewLC(MSenResponseObserver& aObserver,
+                                  //RFileLogger* aLog,
+                                  const TDesC8* aUri,
+                                  CSenHttpChannelImpl* aHttpClient,
+                                  const TDesC8& aContentType,
+                                  const RFile& aContent)
+    {
+    CSenRfileTxnState* pNew = new (ELeave) CSenRfileTxnState(aObserver);//, aLog);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aUri, aHttpClient,aContentType, aContent);
+    return pNew;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::NewL
+// ----------------------------------------------------------------------------
+//
+
+CSenRfileTxnState* CSenRfileTxnState::NewL(MSenResponseObserver& aObserver,
+                                 //RFileLogger* aLog,
+                                 const TDesC8* aUri,
+                                 CSenHttpChannelImpl* aHttpClient,
+                                 const TDesC8& aContentType,
+                                 const RFile& aContent)
+    {
+    CSenRfileTxnState* pNew = NewLC( aObserver, /*aLog,*/ aUri,
+                                aHttpClient,aContentType, aContent );
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::ConstructL
+// ----------------------------------------------------------------------------
+//
+
+void CSenRfileTxnState::ConstructL(const TDesC8* aUri,
+                              CSenHttpChannelImpl* aHttpClient,
+                              const TDesC8& aContentType,
+                              const RFile& aContent)
+    {
+    __ASSERT_ALWAYS(aUri != NULL,
+                    User::Panic(KRequestUriNullPanicText,
+                                CSenHttpChannel::ERequestUriNull));
+    iRequestUri = aUri->AllocL();
+    iFile = aContent;
+    iHttpClient = aHttpClient ;
+    iSize = 0 ;
+    TInt err = iFile.Size(iSize) ;
+    if(iSize >0)
+        {
+            iHasRequestBody = ETrue;
+            iPostContentType = aContentType.AllocL();
+        }    
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::~CSenRfileTxnState
+// ----------------------------------------------------------------------------
+//
+CSenRfileTxnState::~CSenRfileTxnState()
+    {
+    iFile.Close();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::GetNextDataPart
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TBool CSenRfileTxnState::GetNextDataPart(TPtrC8& aDataPart)
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenRfileTxnState::GetNextDataPart")));
+    TBool noMoreData = ETrue;   // No more data
+    
+    if ( iFile.SubSessionHandle() )    // Send in a chunked mode from file
+        {        
+        if ( !iReadData )
+            {
+            TRAPD(retVal,
+		            iReadData = HBufC8::NewL( KDataPartLength );  
+		            TPtr8 ptr = iReadData->Des();
+		            User::LeaveIfError( iFile.Read( ptr, KDataPartLength ) );
+            		);
+            
+            // More content remains if buffer is full
+            // If buffer is not full (!EOF) => no more data
+            if (iReadData->Length() == KDataPartLength)
+	            {
+	            iMoreContent = ETrue ;	
+	            }
+	            else
+	            {
+	            iMoreContent = EFalse ;
+	            }
+            }
+        
+        // Check if more content to be send (false = more data)  
+        noMoreData = !MoreBody();        
+        }
+    
+    aDataPart.Set( *iReadData );
+    return noMoreData;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::ReleaseData
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+void CSenRfileTxnState::ReleaseData()
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenRfileTxnState::ReleaseData")));
+    if ( MoreBody() )    // More data
+        {
+        TRAP_IGNORE( iHttpClient->NotifyMoreBodyL() );
+        }
+    
+    delete iReadData;
+    iReadData = NULL;   
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::OverallDataSize
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TInt CSenRfileTxnState::OverallDataSize()
+    {
+	// File is uploaded in chunked mode.
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("CSenRfileTxnState::OverallDataSize() [%d]"), iSize));	
+	    if(iFile.SubSessionHandle())
+		    {
+		    return iSize;	
+		    }
+	    else
+			{
+			return KErrNotFound;	
+			}
+    }
+
+// ----------------------------------------------------------------------------
+// CSenRfileTxnState::Reset
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TInt CSenRfileTxnState::Reset()
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenRfileTxnState::Reset")));
+    if ( iFile.SubSessionHandle() )
+        {
+        TInt pos;
+        return iFile.Seek( ESeekStart, pos );   // Go to
+        }
+    
+    return KErrNone;     // KErrNone if reset succeeded
+    }
+
+// ---------------------------------------------------------------------------
+// Return flag if more body exist to be send in chunked mode.
+// ---------------------------------------------------------------------------
+//
+TBool CSenRfileTxnState::MoreBody() const
+    {
+    // File == chunked mode
+    return ( iFile.SubSessionHandle() && iMoreContent );
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wshttpchanneltransportplugin/src/sentxnstate.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,468 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <http.h>
+
+#include "sentxnstate.h"
+#include "senhttpchannel.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "senasynctimeout.h"
+
+
+// MACROS
+
+// =========================== MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::CSenTxnState
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+//
+CSenTxnState::CSenTxnState(MSenResponseObserver& aObserver)//,
+                           //RFileLogger* aLog)
+    : iObserver(&aObserver),
+      //iLog(aLog),
+      iHasRequestBody(EFalse),
+      iPostBodyReleased(EFalse)
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::NewLC
+// ----------------------------------------------------------------------------
+//
+
+CSenTxnState* CSenTxnState::NewLC(MSenResponseObserver& aObserver,
+                                  //RFileLogger* aLog,
+                                  const TDesC8* aUri,
+                                  const TDesC8& aContentType,
+                                  const TDesC8* aBody)
+    {
+    CSenTxnState* pNew = new (ELeave) CSenTxnState(aObserver);//, aLog);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aUri, aContentType, aBody);
+    return pNew;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::NewL
+// ----------------------------------------------------------------------------
+//
+
+CSenTxnState* CSenTxnState::NewL(MSenResponseObserver& aObserver,
+                                 //RFileLogger* aLog,
+                                 const TDesC8* aUri,
+                                 const TDesC8& aContentType,
+                                 const TDesC8* aBody)
+    {
+    CSenTxnState* pNew = NewLC( aObserver, /*aLog,*/ aUri,
+                                aContentType, aBody );
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::ConstructL
+// ----------------------------------------------------------------------------
+//
+
+void CSenTxnState::ConstructL(const TDesC8* aUri,
+                              const TDesC8& aContentType,
+                              const TDesC8* aBody)
+    {
+    __ASSERT_ALWAYS(aUri != NULL,
+                    User::Panic(KRequestUriNullPanicText,
+                                CSenHttpChannel::ERequestUriNull));
+    iRequestUri = aUri->AllocL();
+
+    if(aContentType.Length()>0)
+        {
+        if(aBody && aBody->Length() > 0)
+            {
+            iPostBody = aBody->AllocL();
+            iPostContentType = aContentType.AllocL();
+            iHasRequestBody = ETrue;
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::~CSenTxnState
+// ----------------------------------------------------------------------------
+//
+CSenTxnState::~CSenTxnState()
+    {
+    delete iPostBody;
+    delete iRequestUri;
+    delete iPostContentType;
+    
+    // delete allocated body
+    delete iResponseBody; 
+    delete iTP;
+    delete iTimeOut;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::Id
+// ----------------------------------------------------------------------------
+//
+TInt CSenTxnState::Id() const
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenTxnState::Id")));
+    return iId;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::SetId
+// ----------------------------------------------------------------------------
+//
+void CSenTxnState::SetId(TInt aId)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenTxnState::SetId( %d )"),aId));
+    iId = aId;
+    }
+
+void CSenTxnState::SetTransaction(RHTTPTransaction aTransaction)
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenTxnState::SetTransaction");
+    ipTransaction = aTransaction;
+    }
+    
+RHTTPTransaction CSenTxnState::Transaction() const
+	{
+	TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenTxnState::Transaction")));
+    return ipTransaction;
+	}
+
+TInt CSenTxnState::Cancel()
+    {
+        if (iTimeOut)
+        iTimeOut->Cancel();
+        ipTransaction.Cancel();
+        return KErrNone;
+    }
+void CSenTxnState::SetSession(RHTTPSession aSession) 
+    {
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KSenHttpChannelLogLevel,"CSenTxnState::SetSession");
+    iSession = aSession;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::CollectResponseBodyL
+// ----------------------------------------------------------------------------
+//
+void CSenTxnState::CollectResponseBodyL(const TDesC8& aDataPart)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenTxnState(%d)::CollectResponseBodyL"),iId));
+    // Allocate memory for the data
+    if(!iResponseBody)
+        {
+        // this is the first call so create the buffer to retain response data
+        iResponseBody = HBufC8::NewMaxL(0);
+        }
+
+    iResponseBody = iResponseBody->ReAllocL(iResponseBody->Length() +
+                                            aDataPart.Length());
+
+    // Note: iResponseContent will be delete when this
+    // Transaction (txn) is oved (deleted)
+
+    // Append the new data to the buffer
+    TPtr8 ptrResponseBody = iResponseBody->Des();
+    ptrResponseBody.Append(aDataPart);
+    iDetails.iTotalBytesRecieved += iResponseBody->Size(); 
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::RequestUri
+// ----------------------------------------------------------------------------
+//
+const TDesC8& CSenTxnState::RequestUri() const
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KNormalLogLevel,(_L("CSenTxnState::RequestUri")));
+    __ASSERT_ALWAYS(iRequestUri != NULL,
+                    User::Panic(KRequestUriNullPanicText,
+                    CSenHttpChannel::ERequestUriNull));
+    return *iRequestUri;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::PostContentType
+// ----------------------------------------------------------------------------
+//
+const TDesC8& CSenTxnState::PostContentType() const
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenTxnState::PostContentType")));
+    __ASSERT_ALWAYS(iPostContentType != NULL,
+                    User::Panic(KPostContTypeNullPanicText,
+                    CSenHttpChannel::EPostContentTypeNull));
+    return *iPostContentType;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::SetContentTypeHeaderL
+// ----------------------------------------------------------------------------
+//
+void CSenTxnState::SetContentTypeHeaderL(const RHTTPSession aSession, RHTTPHeaders aHeaders)
+	{
+    RStringF contTypeStr = aSession.StringPool().OpenFStringL(PostContentType());
+    CleanupClosePushL(contTypeStr);
+    THTTPHdrVal contType(contTypeStr);
+    aHeaders.SetFieldL(aSession.StringPool().StringF(
+                       HTTP::EContentType, RHTTPSession::GetTable()), contType);
+    // Close stringpool string
+    CleanupStack::PopAndDestroy(); // contTypeStr
+	}
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::ResponseReceivedL
+// ----------------------------------------------------------------------------
+//
+void CSenTxnState::ResponseReceivedL( const TDesC8& aContentType )
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenTxnState(%d)::ResponseReceivedL"), iId));
+    // Find the header size for the response aswell
+    RHTTPHeaders responseHdr = ipTransaction.Response().GetHeaderCollection(); 
+    TInt responseHeaderSize = CalculateHeadersSizeL(responseHdr);
+    iDetails.iTotalBytesRecieved += responseHeaderSize ;
+	iObserver->SetTrafficDetails(iDetails) ;                
+
+    if( iResponseBody )
+        {
+        TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMaxLogLevel, _L8("- iResponseBody:")));
+        TLSLOG_ALL(KSenHttpChannelLogChannelBase , KMaxLogLevel,(iResponseBody->Des()));
+        HBufC8* pResponse = iResponseBody;
+        iResponseBody = NULL;
+        iObserver->ResponseReceivedL( iId, &aContentType, pResponse  );
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KNormalLogLevel,"CSenTxnState::ResponseReceivedL - NULL response received!");
+        iObserver->ResponseReceivedL( iId, &aContentType, NULL );
+        }
+    }
+MSenProperties& CSenTxnState::HttpChannelPropertiesL()
+    {
+    return iObserver->PropertiesL(); 
+    }
+
+void CSenTxnState::SetTP(CSenHttpTransportProperties* tp)
+    {
+    
+    delete iTP;
+    iTP = tp;
+    }
+TInt CSenTxnState::CalculateHeadersSizeL(RHTTPHeaders aHeaders) 
+    { 
+    TInt headersize(0); 
+    TBuf8<1024> buf; 
+    TPtrC8 fieldValue(buf.Ptr()); 
+  	TInt err(0);
+    _LIT8(KColon,": ");   
+    _LIT8(KNewLine,"\r\n"); 
+
+		RStringPool stringPool;
+    // Store the string pool for this HTTP session
+    stringPool = iSession.StringPool();
+
+    THTTPHdrFieldIter fields = aHeaders.Fields(); 
+    fields.First(); 
+    while (!fields.AtEnd()) 
+        { 
+        RStringF str = stringPool.StringF(fields()); 
+        
+        headersize += str.DesC().Size(); 
+ 
+        headersize += KColon().Size(); 
+        
+        err = aHeaders.GetRawField(str, fieldValue);          
+          
+        headersize += fieldValue.Size(); 
+        headersize += KNewLine().Size(); 
+          
+        ++fields; 
+        } 
+       
+    return headersize; 
+    } 
+// ----------------------------------------------------------------------------
+// CSenTxnState::ResponseErrorL
+// ----------------------------------------------------------------------------
+//
+void CSenTxnState::ResponseErrorL(TInt aError)
+    {
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenTxnState(%d)::ResponseErrorL( %d )"), iId, aError));
+    RHTTPHeaders ResponseHdr = ipTransaction.Response().GetHeaderCollection(); 
+    TInt ResponseHeaderSize = CalculateHeadersSizeL(ResponseHdr);
+    iDetails.iTotalBytesRecieved += ResponseHeaderSize ;
+	iObserver->SetTrafficDetails(iDetails) ;	                
+    if(iResponseBody)
+        {
+        HBufC8* pError = iResponseBody;
+        iResponseBody = NULL;
+        iObserver->ResponseErrorL(iId, aError, pError, iTP);
+        }
+    else
+        {
+        TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenTxnState::ResponseErrorL - NULL error response received!");
+        iObserver->ResponseErrorL(iId, aError, NULL);
+        }
+    }
+void CSenTxnState::StateChanged(TInt aState) // Propagate http status code to remote service consumer
+	{
+	TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenTxnState(%d)::StateChanged( %d )"), iId, aState));
+    iObserver->StateChanged(iId,aState);	
+	}
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::GetNextDataPart
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TBool CSenTxnState::GetNextDataPart(TPtrC8& aDataPart)
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenTxnState::GetNextDataPart")));
+    if(iPostBody && (!iPostBodyReleased))
+        {
+        aDataPart.Set(*iPostBody);
+        }
+    else
+        {
+        aDataPart.Set(NULL, 0);
+        }
+    iDetails.iTotalBytesSent += aDataPart.Size();
+
+    return ETrue;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::ReleaseData
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+void CSenTxnState::ReleaseData()
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenTxnState::ReleaseData")));
+    // Don't delete the submit buffer here because call to
+    // Reset always needs to start from the beginning of the buffer.
+    iPostBodyReleased = ETrue;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::OverallDataSize
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TInt CSenTxnState::OverallDataSize()
+    {
+    TInt size = 0;
+    if(iPostBody)
+        {
+        size = iPostBody->Length();
+        }
+    TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("CSenTxnState::OverallDataSize() [%d]"), size));
+    return size;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::Reset
+// Implementation of the pure virtual method from MHTTPDataSupplier
+// ----------------------------------------------------------------------------
+//
+TInt CSenTxnState::Reset()
+    {
+    TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("CSenTxnState::Reset")));
+    iPostBodyReleased = EFalse;
+    return KErrNone;
+    }
+
+// ----------------------------------------------------------------------------
+// CSenTxnState::Body
+// Returns reference to txn body, or KNullDesC8, if
+// body has not been set.
+// ----------------------------------------------------------------------------
+//
+TPtrC8 CSenTxnState::Body()
+    {
+    if(iPostBody)
+        {
+        return *iPostBody;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+void CSenTxnState::TransformBodyToUriL()
+    {
+    if(!iPostBody || iPostBody->Length()==0)
+        {
+        return; // nothing to do
+        }
+
+    TPtrC8 uri(KNullDesC8);
+    if(iRequestUri)
+        {
+        uri.Set(*iRequestUri);
+        }
+
+    HBufC8* pUri = HBufC8::NewLC(uri.Length()+iPostBody->Length());
+    TPtr8 ptrUri = pUri->Des();
+    ptrUri.Append(uri);
+    ptrUri.Append(*iPostBody);
+    
+    // replace current uri with the new one:
+    delete iRequestUri;
+    iRequestUri = pUri;
+    CleanupStack::Pop();
+
+    delete iPostBody;
+    iPostBody = NULL;
+    iHasRequestBody = EFalse;
+    TLSLOG_L(KSenHttpChannelLogChannelBase , KMaxLogLevel,"CSenTxnState::TransformBodyToUriL():");
+
+    TLSLOG_ALL(KSenHttpChannelLogChannelBase , KMaxLogLevel,(*iRequestUri));
+    }
+
+void CSenTxnState::EnableTimeOutL(TInt aTimeOutSec)
+    {
+    delete iTimeOut;
+    iTimeOut = NULL;
+    iTimeOut = CSenAsyncTimeOut::NewL(this);
+    iTimeOut->StartL(aTimeOutSec);
+    }
+
+void CSenTxnState::DisableTimeOutL()
+    {
+    delete iTimeOut;
+    iTimeOut = NULL;
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/data/10274c6d.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10274C6D;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96F9;
+            implementations = 
+                {
+                // Info for CSenWsiPlugin: frameworkID = "WS-I"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10274C6E;
+                    version_no         = 1;
+                    display_name       = "SenWsiBasicPlugin SIF";
+                    default_data       = "com.nokia.Sen.wsi.WSIBasicFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/data/10282c46.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10282C46;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9730;
+            implementations = 
+                {
+                // Info for CSenWsiPlugin: frameworkID = "WS-I"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C4C;
+                    version_no         = 1;
+                    display_name       = "SenWsiBasicPlugin SIF";
+                    default_data       = "com.nokia.Sen.wsi.WSIBasicFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*    This file provides the information required for building the 
+*        implementation collection.
+*
+*/
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsibasicplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsibasicplugin.iby)
+PRJ_MMPFILES
+../../wsibasicplugin/group/senwsibasicplugin.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/group/senwsibasicplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senwsibasicplugin    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenWsiBasicPlugin.dll
+UID 0x10009D8D 0x10274C6D
+#else
+TARGET wsWsiBasicPlugin.dll
+UID 0x10009D8D 0x10282C46
+#endif
+
+
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senwsipluginmain.cpp
+SOURCE          senwsipluginproxy.cpp
+SOURCE          senbasicwebservicesession.cpp
+SOURCE          senwsiplugin.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsframework/inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wsidentitymanager/inc
+USERINCLUDE     ../../wscredentialmanager/inc
+USERINCLUDE   ../../wslogger/inc              // for TLS based file logging
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  10274c6d.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenWsiBasicPlugin.rsc
+#endif 
+#else
+START RESOURCE  10282C46.RSS
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsWsiBasicPlugin.rsc
+#endif 
+
+#endif
+END
+
+// System libs
+LIBRARY ecom.lib
+LIBRARY euser.lib 
+LIBRARY flogger.lib
+LIBRARY estor.lib // RWriteStrem for REST session extensions
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY senlogger.lib   // for TLS based logging
+// Web Services Framework libs
+LIBRARY SenFramework.lib
+LIBRARY SenServDesc.lib
+LIBRARY SenXml.lib
+
+LIBRARY SenUtils.lib // for CSenTransportProperties: temporary
+#else
+LIBRARY wslogger.lib   // for TLS based logging
+// Web Services Framework libs
+LIBRARY wsframework.lib
+LIBRARY wsServDesc.lib
+LIBRARY wsXml.lib
+
+LIBRARY wsUtils.lib // for CSenTransportProperties: temporary
+
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/inc/senbasicwebservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_BASIC_WEB_SERVICE_SESSION_H
+#define SEN_BASIC_WEB_SERVICE_SESSION_H
+
+//  INCLUDES
+#include "senwebservicesession.h"
+#include "SenHttpTransportProperties.h"
+
+// FORWARD DECLARATIONS
+class MSenServiceConsumer;
+class MServiceDescription;
+class CSenCredential;
+class CSenSoapMessage;
+
+// CONSTANTS
+_LIT8(KConsumerIdLocalname, "ConsumerID");
+
+// CLASS DECLARATION
+class CSenBasicWebServiceSession : public CSenWebServiceSession
+    {
+    public: // Constructors and destructor
+        static CSenBasicWebServiceSession* NewL(MSIF& aFramework);
+        static CSenBasicWebServiceSession* NewLC(MSIF& aFramework);
+
+        virtual ~CSenBasicWebServiceSession();
+
+        virtual TInt InitializeFromL(MSenServiceDescription& aServiceDescription);
+        
+        virtual TInt SubmitL(const TDesC8& aMessage, 
+                             const TDesC8& aTransportProperties,
+                             MSenRemoteServiceConsumer& aConsumer,
+                             HBufC8*& aResponse);
+
+        virtual TInt SendL( const TDesC8& aMessage, 
+                            const TDesC8& aTransportProperties,
+                            MSenRemoteServiceConsumer& aConsumer,
+                            TInt& aTxnId,
+                            HBufC8*& aRevalidationError );
+        
+        virtual TInt SubmitSoapL(const TDesC8& aMessage, 
+                                 const TDesC8& aTransportProperties,
+                                 MSenRemoteServiceConsumer& aConsumer,
+                                 HBufC8*& aResponse);
+
+        virtual TInt SendSoapL( const TDesC8& aMessage, 
+                                const TDesC8& aTransportProperties,
+                                MSenRemoteServiceConsumer& aConsumer,
+                                TInt& aTxnId,
+                                HBufC8*& /*aRevalidationError */ );
+		virtual TInt HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                            const TInt aErrorCode,
+                                            const TInt aTxnId,
+                                            MSenRemoteServiceConsumer& aConsumer,
+                                            MSenProperties* aResponseTransportProperties) ;
+	 	virtual TInt HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                            HBufC8*& aResponse);
+
+        virtual TInt ComputeStatusL();
+        /**
+        * @see CSenWSDescription
+        */
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+    protected:
+        CSenBasicWebServiceSession(TDescriptionClassType aType, MSIF& aFramework);
+        void ConstructL();
+        
+    private:
+        // NOTE: this is temporary method which MUST be removed when message context is made available in SendL/SubmitL                                
+        TInt SetFrameworkPropertiesL(MSenTransport& aTransport);                                
+        
+        // Helper method, which allows sending of "unwrapped" descriptor (UTF-8 data)
+        // in case of HTTP GET or DELETE. Otherwise, for example http query string
+        // would be illegally "wrapped" inside SOAP body(!).
+        TInt HttpMethodFromPropertiesL( const TDesC8& aProperties, CSenHttpTransportProperties::TSenHttpMethod& aMethod );
+    };
+
+#endif // SEN_BASIC_WEB_SERVICE_SESSION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/inc/senwsiplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_WSI_PLUGIN_H
+#define SEN_WSI_PLUGIN_H
+
+#include <e32std.h>
+#include <flogger.h>
+#include "SenXmlUtils.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+class CSenBaseFragment;
+class MSenTransport;
+class CSenBasicWebServiceSession;
+
+// CONSTANTS
+
+_LIT8(KWsiFrameworkVersion,     "1.0");
+_LIT8(KWsiFrameworkXMLNS,       "urn:com.nokia.Sen.wsi.config.1.0");
+_LIT8(KWsiFrameworkCue,         "com.nokia.Sen.wsi.WSIBasicFramework");
+
+// INCLUDES
+#include "senserviceinvocationframework.h" // internal Framework\inc
+
+/**
+ * Class:       CSenIdWsfPlugin
+ *
+ * Description: An implementation of the CSIF definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CSenWsiPlugin : public CSIF
+    {
+public:
+    /**
+     * Function:    NewL
+     *
+     * Description: Create instance of concrete implementation. Note that ECOM
+     *              interface implementations can only have two signatures for
+     *              NewL:
+     *               - NewL without parameters (used here)
+     *               - NewL with TAny* pointer, which may provide some client
+     *                 data
+     *
+     * Returns:    Instance of this class.
+     *
+     * Note:       The interface, which is abstract base class of this
+     *             implementation, also provides NewL method. Normally abstract
+     *             classes do not provide NewL, because they cannot create
+     *             instances of themselves.
+     */
+    static CSenWsiPlugin* NewL(TAny* aManager);
+
+
+public: // Methods implementing CSIF ECOM interface
+    // For convenience of components classes
+    //RFileLogger* Log() const;
+
+    /**
+     * Return a system wide unique string to identify this framework
+     *
+     * @return TDesC8 that uniquely identifies this framework.
+     */
+    virtual const TDesC8& Id();
+
+    /**
+     * Try to find one or more services that match the given
+     * ServiceDescription.
+     * Register ServiceDescriptions for these to the owner of the framework,
+     * i.e. to the ServiceManager. Return the number of ServiceDescriptions
+     * that were added.
+     *
+     * @param   aPattern - A ServiceDescriptin that should be treated as a
+     *          pattern
+     *
+     * @param
+     *  return (TInt) count of matching ServiceDescriptions that were added
+     */
+    virtual TInt AddServiceDescriptionL( MSenServiceDescription& aPattern, 
+                                         MSenRemoteServiceConsumer& aRemoteConsumer,
+                                         HBufC8*& aErrorMsg ); 
+
+/*  virtual TInt AddServiceDescriptionL( */
+/*                              const TDesC8& aServiceTypeContract, */
+/*                              MSenRemoteServiceConsumer& aRemoteConsumer); */
+
+    /**
+     * Attempt to register the ServiceDescription to the ServiceManager that
+     * owns the framework.
+     * This is a callback used by the ServiceManager to give frameworks a
+     * chance to replace a generic ServiceDescription into something that is
+     * more specific, and more useful, to the ServiceInvocationFramework.
+     *
+     * @param aServiceDescription A ServiceDescription
+     *
+     *  return TInt aError - indicates the error or KErrNone if successful
+     */
+    virtual TInt RegisterServiceDescriptionL(
+                                MSenServiceDescription& aServiceDescription);
+
+
+    /**
+     * Attempt to unregister the ServiceDescription from the ServiceManager
+     * that owns the framework.
+     * This is a callback used by the ServiceManager.
+     *
+     * @param aServiceDescription A ServiceDescription
+     *
+     *  return TInt aError - indicates the error or KErrNone if successful
+     */
+    virtual TInt UnregisterServiceDescriptionL(
+                                MSenServiceDescription& aServiceDescription);
+
+    /**
+     * Create a ServiceSession based upon the given ServiceDescription.
+     * The ServiceSession is expected to be "valid", i.e. ready for use
+     * by a client.
+     *
+     * @param aServiceDescription A ServiceDescription
+     *
+     * @param aNewSession (CSenServiceSession)
+     *
+     * return TInt error or KErrNone if successful
+     */
+    virtual TInt CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                        MSenServiceDescription& aPattern,
+                                        CSenServiceSession*& aNewSession,
+                                        MSenRemoteServiceConsumer& aRemoteConsumer,
+                                        HBufC8*& aErrorMsg );
+
+    /**
+     * Return a new instance of a framework specific class that
+     * implements the ServiceDesccription interface.
+     *
+     * @param new service description 
+     *        (which typically derives from CSenServiceSession)
+     *
+     * return TInt error or KErrNone if successful
+     */
+    virtual CSenWSDescription* NewServiceDescriptionL();
+
+    /**
+     * Return the ServiceManager for which this instance is working.
+     * This is used by the ServiceSession instances created by this framework.
+     *
+     * Note, in Sen, MSenCoreServiceManager IS SINGLETON(!), so all Frameworks
+     * return their "owner" - that is - the only service manager in
+     * Sen Framework
+     *
+     * @return (MSenCoreServiceManager)
+     */
+    virtual MSenCoreServiceManager& Manager();
+
+
+    /**
+     * Set the ServiceManager to which this instance reports.
+     * The (singleton) ServiceManager calls this method when
+     * it instantiates a framework.
+     *
+     * @param aServiceManager The singleton ServiceManager in the system.
+     */
+    virtual void SetManager(MSenCoreServiceManager& aServiceManager);
+
+
+    /**
+     * Return an object that can do SAX based parsing of a XML fragment
+     * that contains framework specific configuration information.
+     * The ServiceManager asks for this BaseFragment upon startup
+     * in order to give this framework a chance to read its configuration
+     * information from the central ServiceManager configuration document.
+     *
+     * @return (CSenBaseFragment)
+     */
+    virtual CSenBaseFragment& ConfigParser();
+
+    /**
+     * Write the ServiceInvocationFramework configuration as XML to a HBufC8.
+     *
+     * This method is invoked by the ServiceManager when it saves
+     * its state and/or configuration.
+     *
+     * Upon startup the chunk of XML that is written will be passed back to
+     * the configuation parser of the framework.
+     *
+     * The "schema" that shall be adhered to is:
+     * <pre>
+     * &lt;element name="Framework"&gt;
+     *      &lt;any/&gt;&lt;!-- this is where implementations write additional
+     *      information --&gt;
+     *      &lt;attribute name="class" type="String"&gt;
+     *    &lt;!-- In Syimbian the class attribute is used as cue for the
+     *      ECOM Resolver --&gt;
+     * &lt;/element&gt;
+     * </pre>
+     *
+     * @param aTo - a HBufC8 to which the framework should write its
+     *              configuration
+     */
+
+    virtual HBufC8* AsXmlL();
+    virtual HBufC* AsXmlUnicodeL();
+    virtual void EndElementL(   const TDesC8& aNsUri,
+                                const TDesC8& aLocalName,
+                                const TDesC8& aQName);
+
+    virtual TInt OnEvent(const TInt aEvent,
+                        TAny* /* aArgument */);
+
+    virtual TAny* ExtendedInterface();
+
+    /**
+    * WS-I Basic Profile SIF specifies at least following, empty 
+    * SOAPAction HTTP header value:
+    * 
+    * KSenSoapActionHeaderValueEmpty ==  ""
+    * @return KErrNone on success, system-wide error code otherwise
+    */    
+    virtual TInt SetTransportPropertiesL(MSenTransport& aTransport);
+    
+public: // destructor
+    virtual ~CSenWsiPlugin();
+
+
+protected:
+    /**
+     * Function:   CSenWsiPlugin
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CSenWsiPlugin(MSenCoreServiceManager& aManager);
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private: // data
+    MSenCoreServiceManager& iManager;
+    };
+
+
+#endif // SEN_WSI_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/rom/wsibasicplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSIBASICPLUGIN_IBY__
+#define __WSIBASICPLUGIN_IBY__
+
+//WsiBasicPlugin
+ECOM_PLUGIN(SenWsiBasicPlugin.dll, 10274C6D.rsc)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/src/senbasicwebservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,529 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senbasicwebservicesession.h"
+#include "SenHttpTransportProperties.h" // could be system included (ADO task)
+#include "senservicesession.h"
+#include "SenSoapMessage.h"
+#include "SenSoapConstants.h"           // KSenSoapActionHeaderName
+#include "senwsdescription.h"
+#include "msencoreservicemanager.h"
+#include "msenremoteserviceconsumer.h"
+#include "SenXmlUtils.h"
+#include "SenDateUtils.h"
+#include "msentransport.h"
+#include "SenServiceConnection.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include <SenSoapFault.h>
+
+
+CSenBasicWebServiceSession* CSenBasicWebServiceSession::NewL(MSIF& aFramework)
+    {
+    CSenBasicWebServiceSession* pNew =
+        CSenBasicWebServiceSession::NewLC(aFramework);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenBasicWebServiceSession* CSenBasicWebServiceSession::NewLC(MSIF& aFramework)
+    {
+    CSenBasicWebServiceSession* pNew =
+        new (ELeave) CSenBasicWebServiceSession(EBasicWebServiceSession,
+                                                aFramework);
+    CleanupStack::PushL(pNew);
+    // bugfix 2004-09-08,
+    // removed faulty call to CSenServiceSession::BaseConstructL
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenBasicWebServiceSession::CSenBasicWebServiceSession(
+                                        TDescriptionClassType aType,
+                                        MSIF& aFramework)
+:
+CSenWebServiceSession(aType, aFramework)
+    {
+    }
+
+void CSenBasicWebServiceSession::ConstructL()
+    {
+    // Sets the local name to "ServiceDescription" and initiates the inner ipElement
+    CSenWebServiceSession::ConstructL();
+    }
+
+CSenBasicWebServiceSession::~CSenBasicWebServiceSession()
+    {
+    }
+
+// Override compute status to make BWS sessions to be ALWAYS valid (ready)
+TInt CSenBasicWebServiceSession::ComputeStatusL()
+    {
+    // session is ready, if an endpoint is defined
+    return CSenServiceSession::ComputeStatusL();
+    }
+    
+TInt CSenBasicWebServiceSession::InitializeFromL(MSenServiceDescription& aServiceDescription)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenWebServiceSession::InitializeFromL")));
+    
+    // Call superclass method to initialize facets, transport (endpoint) cue, etc..
+	TInt retVal = CSenWebServiceSession::InitializeFromL(aServiceDescription);
+    CSenWSDescription& xmlSD = (CSenWSDescription&)aServiceDescription;
+    TPtrC8 transportCue = xmlSD.TransportCue();
+    if( transportCue.Length() > 0 )
+        {
+        SetTransportCueL( transportCue );
+        }
+	return retVal;
+    }
+    
+
+TInt CSenBasicWebServiceSession::SubmitSoapL( const TDesC8& aSoapMessage, 
+                                              const TDesC8& aTransportProperties,
+                                              MSenRemoteServiceConsumer& aConsumer,
+                                              HBufC8*& aResponse )
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenWsiPlugin::RegisterServiceDescriptionL");
+    CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"CSenBasicWebServiceSession::SubmitSoapL(TDesC8&)");
+	TPtrC8 endpoint = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId()  , KMinLogLevel, _L8("- Endpoint: %S"), &endpoint));
+	CSLOG_FORMAT((aConsumer.ConnectionId()  , KMaxLogLevel, _L8("- Message (%d bytes):"), aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId() , KMaxLogLevel,( aSoapMessage ));
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL( transport );
+    TInt retVal = transport.SubmitL( endpoint, aSoapMessage, aTransportProperties, aResponse, aConsumer);
+    
+    if(!aResponse)
+        {
+        // response was NULL: probably either out
+        // of heap or some transport malfunction.
+        return retVal;
+        }
+    else if(aResponse->Length() < KSenSoapEnvelopeName().Length()*2)
+        {
+        // no use parsing, Envelope -root element not there
+        // deliver non-soap body to consumer
+        return retVal;
+        }
+
+    CleanupStack::PushL(aResponse);
+
+    CSenSoapMessage* pResponseSoapMsg = NULL;
+    TInt leaveCode(KErrNone);
+
+    // attempt to parse the response
+    // here. SOAP faults are to be
+    // searched after,
+
+    TInt parseRetCode(KErrNone);
+    TRAP( leaveCode, (parseRetCode =
+        ParseResponseL(*aResponse, pResponseSoapMsg)) );
+
+    if(leaveCode!=KErrNone)
+        {
+        // THE RESPONSE could not be parsed
+        delete pResponseSoapMsg;
+
+        // THE RESPONSE IS NOT SOAP
+        if(retVal==KErrNone)
+            {
+            // indicate with return value, that response is
+            // invalid - even though submit was ok, the
+            // response could NOT be parsed!
+            retVal = leaveCode;
+            }
+        CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"(NOK) Response is not a SOAP message");
+        }
+    else
+        {
+
+        if (parseRetCode != KErrNone)
+            {
+            CSLOG_FORMAT((aConsumer.ConnectionId()  , KMinLogLevel, _L8("(NOK) Parsing SOAP msg failed (%d)"),
+                    parseRetCode));
+
+            if(retVal==KErrNone) // submit was ok
+                {
+                // indicate with return value, that response is
+                // invalid - even though submit was ok, the
+                // response could NOT be parsed!
+                retVal = parseRetCode;
+                }
+
+            // THE RESPONSE could not be parsed
+            delete pResponseSoapMsg;
+            }
+        else
+            {
+            CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"WS-I: (OK) Response is a SOAP message");
+            CleanupStack::PushL(pResponseSoapMsg);
+
+            TBool completeServerMessages(ETrue);
+            HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+
+            // response is OK and in SOAP form.
+			if(pResponseSoapMsg)
+				{
+				if (pResponseSoapMsg->IsFault())
+					{
+					// response is SOAP fault
+					CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"WS-I: Response is a SOAP fault.");
+					retVal = KErrSenSoapFault;
+
+                if (!completeServerMessages)
+                    {
+                    CleanupStack::Pop(pResponseSoapMsg);
+                    // try to detach the SOAP fault
+                    HBufC8* pDetached = NULL;
+                    retVal = HandleSoapFaultL(pResponseSoapMsg, pDetached);
+                    if(retVal == KErrSenSoapFault || retVal == KErrNone)
+                        {
+                        // KErrNone means that original fault was handled
+                        // properly and we now have the wanted result 
+                        // and consumer may receive it (message body)
+
+                        // Note: currently we don't handle any SOAP faults
+                        // in WebServiceSession class, so KErrNone should
+                        // not be returned. The OR clause (||) here is 
+                        // only for future extensions.
+                        delete aResponse;
+                        aResponse = NULL;
+                        aResponse = pDetached;
+                        pDetached = NULL;
+                        }
+                    else if(retVal == KErrNotFound)
+                        {
+
+                        // SOAP fault element  could not be found
+                        CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"WS-I: Major; SOAP fault element not found \
+                                    even though assumed SOAP fault.");
+                        retVal = KErrSenInternal;
+                        }
+
+						}
+					else
+						{
+						CleanupStack::PopAndDestroy(pResponseSoapMsg);
+						}
+					}
+				else
+					{
+					// Check complete server messages on/off
+					if (!completeServerMessages)
+						{
+						HBufC8* pBody = pResponseSoapMsg->BodyAsStringL();
+						if(pBody)
+							{
+							delete aResponse;
+							aResponse = NULL;
+							aResponse = pBody;
+							pBody = NULL;
+							CSLOG_L(aConsumer.ConnectionId() , KNormalLogLevel,"- Detached SOAP message body.");
+							}
+						}
+					CleanupStack::PopAndDestroy(pResponseSoapMsg);
+					}
+				}
+			}
+		}
+#ifdef _SENDEBUG
+    if(aResponse)
+        {
+        CleanupStack::PushL(aResponse);
+        CSLOG_L(aConsumer.ConnectionId() , KNormalLogLevel,"- Detached SOAP message body.");
+        CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"CSenBasicWebServiceSession::SubmitSoapL:");
+        CSLOG_FORMAT((aConsumer.ConnectionId()  , KNormalLogLevel, _L8("- Response (%d bytes):"), 
+            aResponse->Length()));
+        CSLOG_ALL(aConsumer.ConnectionId() , KMaxLogLevel,(*aResponse));
+        CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"--------------------------------------------------");
+        CleanupStack::Pop(); // aResponse
+        }
+#endif
+    CleanupStack::Pop(); // aResponse
+    return retVal;
+    }
+
+TInt CSenBasicWebServiceSession::SendSoapL( const TDesC8& aSoapMessage, 
+                                            const TDesC8& aTransportProperties,
+                                            MSenRemoteServiceConsumer& aConsumer,
+                                            TInt& aTxnId,
+                                            HBufC8*& /*aRevalidationError*/ ) 
+    {
+	TPtrC8 endpoint = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+    CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"CSenBasicWebServiceSession::SendSoapL:");
+    CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"- Endpoint:");
+	TLSLOG(aConsumer.ConnectionId()  , KMinLogLevel,( endpoint ));
+	CSLOG_FORMAT((aConsumer.ConnectionId()  , KMaxLogLevel, _L8("- Message (%d bytes):"), aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId() , KMaxLogLevel,(aSoapMessage));
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL( transport );
+    TInt retVal = transport.SendL( endpoint, 
+                                   aSoapMessage, 
+                                   aTransportProperties, 
+                                   *this, 
+                                   aConsumer, 
+                                   aTxnId );
+    CSLOG_FORMAT((aConsumer.ConnectionId()  , KNormalLogLevel, _L8("- Transaction id: %d"), aTxnId));
+    return retVal;
+    }
+    
+TInt CSenBasicWebServiceSession::HttpMethodFromPropertiesL( const TDesC8& aProperties,
+                                                            CSenHttpTransportProperties::TSenHttpMethod& aMethod )
+    {
+    TInt retVal(KErrNotFound);
+    if ( aProperties.Length() > 0 && aProperties.Find(KHttpMethodLocalName)!= KErrNotFound && 
+        (aProperties.Find(KHttpGet)!= KErrNotFound || aProperties.Find(KHttpDelete)!= KErrNotFound) ) 
+        {
+        // Properties strings are found, now use CSenHttpProperties instance to validate that HTTP
+        // method really is either HTTP GET or HTTP DELETE:
+        CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC(); // push tp
+        
+        // Parse aProperties into HTTP transport properties object:
+        TInt leaveCode( KErrNone );
+        TRAP( leaveCode, pHttpProperties->ReadFromL( aProperties ); )
+        if ( leaveCode == KErrNone )
+            {
+            CSenHttpTransportProperties::TSenHttpMethod method;
+            retVal = pHttpProperties->HttpMethodL( method );
+            if ( retVal == KErrNone )
+                {
+                aMethod = method;
+                }
+#ifdef _SENDEBUG            
+            else 
+                {
+                // HttpMethodL failed:
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- HttpMethodL call failed. Error code: (%d)"), retVal));
+                }
+#endif // _SENDEBUG            
+            }
+#ifdef _SENDEBUG            
+        else 
+            {
+            // ReadFromL leaved:
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Reading (parsing) of HTTP properties failed. Leave code: (%d)"), leaveCode));
+            
+            }
+#endif // _SENDEBUG            
+        CleanupStack::PopAndDestroy( pHttpProperties ); // de-alloc tp
+        }
+    return retVal;
+    }
+    
+    
+
+/*
+* @param aMessage contains request which is parsed into a SoapEnvelope object using
+*                 CSenWebServiceSession::MessageForSendingL and then SendSoapL is called  
+*/
+TInt CSenBasicWebServiceSession::SendL( const TDesC8& aMessage, 
+                                        const TDesC8& aTransportProperties,
+                                        MSenRemoteServiceConsumer& aConsumer,
+                                        TInt& aTxnId,
+                                        HBufC8*& aRevalidationError )
+    {
+    CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"CSenBasicWebServiceSession::SendL(TDesC8&, ...)");
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+	TPtrC8 endpoint = Endpoint();
+	CSLOG_FORMAT((aConsumer.ConnectionId()  , KMinLogLevel, _L8("- Endpoint: %S"), &endpoint));
+	CSLOG_FORMAT((aConsumer.ConnectionId()  , KMaxLogLevel, _L8("- Message (%d bytes):"), aMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId() , KMaxLogLevel,( aMessage ));
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+    TInt retVal(KErrNone);
+
+    // First check if HTTP GET or DELETE has been spesified via transport properties:
+    // -- in such case, the raw descriptor should be sent "as it is", without wrapping
+    // it inside SOAP Body. This way WS-I can support HTTP GET and DELETE and still
+    // validate that response(s) are SOAP (unlike REST, which does no response validation).
+
+    CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+    TInt readHttpMethodRetVal = HttpMethodFromPropertiesL( aTransportProperties, httpMethod );
+
+    if ( readHttpMethodRetVal == KErrNone && 
+         httpMethod == CSenHttpTransportProperties::ESenHttpGet || 
+         httpMethod == CSenHttpTransportProperties::ESenHttpDelete )
+        {
+        // Perform direct call to service session (and not to web service session!)
+        retVal = CSenServiceSession::SendL( aMessage, aTransportProperties, aConsumer, aTxnId, aRevalidationError);
+        }
+    else
+        {
+        // The request data (UTF-8 descriptor) is expected to be serialized content
+        // for SOAP Body and HTTP GET/DELETE is not taking place. 
+        // Proceed in standard way and parse the request with SOAP-ENV:
+    	CSenSoapMessage* pMsg = NULL;
+        retVal = CSenWebServiceSession::MessageForSendingL( aMessage, aConsumer.Id(), pMsg );
+        CleanupStack::PushL( pMsg );
+        if ( retVal!=KErrNone )
+            {
+            CSLOG_FORMAT((aConsumer.ConnectionId()  , KMinLogLevel, _L8("- MessageForSendingL returned an error: %d"), retVal));
+            CleanupStack::PopAndDestroy( pMsg );
+            }
+        else // no error
+            {
+            HBufC8* pSoapMsg = pMsg->AsXmlL();
+            CleanupStack::PopAndDestroy( pMsg ); 
+            CleanupStack::PushL( pSoapMsg ); 
+            retVal = SendSoapL( *pSoapMsg, aTransportProperties, aConsumer, aTxnId, aRevalidationError);
+            CleanupStack::PopAndDestroy( pSoapMsg );
+            }
+        }
+    return retVal;
+    }
+
+/*
+* aMessage contains request which is parsed into a SoapEnvelope object using
+* CSenWebServiceSession::MessageForSendingL and then SubmitSoapL is called  
+*/
+TInt CSenBasicWebServiceSession::SubmitL( const TDesC8&  aMessage, 
+                                          const TDesC8&  aTransportProperties ,
+                                          MSenRemoteServiceConsumer&  aConsumer ,
+                                          HBufC8*& aResponse )
+    {
+    CSLOG_L(aConsumer.ConnectionId() , KMinLogLevel,"CSenBasicWebServiceSession::SubmitL(TDesC8&, ...)");
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+	TPtrC8 endpoint = Endpoint();
+	CSLOG_FORMAT((aConsumer.ConnectionId()  , KMinLogLevel, _L8("- Endpoint: %S"), &endpoint));
+	CSLOG_FORMAT((aConsumer.ConnectionId()  , KMaxLogLevel, _L8("- Message (%d bytes) about to submit:"), aMessage.Length()));
+	CSLOG_ALL(aConsumer.ConnectionId() , KMaxLogLevel,( aMessage ));
+	CSLOG_L(aConsumer.ConnectionId() , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+    TInt retVal(KErrNone);
+    CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+    TInt readHttpMethodRetVal = HttpMethodFromPropertiesL( aTransportProperties, httpMethod );
+
+    if ( readHttpMethodRetVal == KErrNone && 
+         httpMethod == CSenHttpTransportProperties::ESenHttpGet || 
+         httpMethod == CSenHttpTransportProperties::ESenHttpDelete )
+        {
+        // Perform direct call to service session (and not to web service session!)
+        retVal = CSenServiceSession::SubmitL( aMessage, aTransportProperties, aConsumer, aResponse);
+        }
+    else
+        {
+        CSenSoapMessage* pMsg = NULL;
+        retVal = CSenWebServiceSession::MessageForSendingL( aMessage, aConsumer.Id(), pMsg );
+        CleanupStack::PushL(pMsg);
+        if ( retVal!=KErrNone )
+            {
+            CSLOG_FORMAT((aConsumer.ConnectionId()  , KMinLogLevel, _L8("- MessageForSendingL returned an error: %d"), retVal));
+            CleanupStack::PopAndDestroy( pMsg );
+            }
+        else // no error
+            {
+            HBufC8* pSoapMsg = pMsg->AsXmlL();
+            CleanupStack::PopAndDestroy( pMsg ); // de-alloc SOAP object after de-serialization
+            CleanupStack::PushL( pSoapMsg );
+            retVal = SubmitSoapL( *pSoapMsg, aTransportProperties, aConsumer, aResponse );
+            CleanupStack::PopAndDestroy( pSoapMsg );
+            }
+        }
+	return retVal; 
+   }
+
+
+TBool CSenBasicWebServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWebServiceSession ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        { 
+        // Otherwise, ask from direct superclass (may invoke chain of recursive calls)
+        return CSenWebServiceSession::HasSuperClass( aType ); 
+        }
+    }
+
+
+// TEMPORARY: remove when "message context"- and "transport factory taking 
+// properties from all layers"- tasks are ready
+TInt CSenBasicWebServiceSession::SetFrameworkPropertiesL(MSenTransport& aTransport)
+    {
+    return iFramework.SetTransportPropertiesL(aTransport);
+    }
+TInt CSenBasicWebServiceSession::HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                            const TInt aErrorCode,
+                                            const TInt aTxnId,
+                                            MSenRemoteServiceConsumer& aConsumer,
+                                            MSenProperties* aResponseTransportProperties)
+	{
+    LOG_WRITE_L("CSenBasicWebServiceSession::HandleSoapFaultL ");
+
+    TInt retVal(KErrNone);
+    
+    if ( apSOAPMessage )
+        {
+        	CleanupStack::PushL( apSOAPMessage ); 
+	        CSenSoapFault* pDetached = apSOAPMessage->DetachFaultL();
+	        if(pDetached)
+	            {
+	            LOG_WRITE_L("Detached a SOAP fault");
+	            CleanupStack::PushL(pDetached);
+	            HBufC8* pAsXml = pDetached->AsXmlL();
+	            if(pAsXml)
+	                {
+	                aConsumer.HandleErrorL(pAsXml, KErrSenSoapFault, aTxnId, aResponseTransportProperties);
+	                }
+	            CleanupStack::PopAndDestroy();
+	            retVal = KErrNone; 
+	            }
+	        else
+	            {
+	            LOG_WRITE_L("No SOAP fault was received.");
+	            aConsumer.HandleErrorL(NULL, aErrorCode, aTxnId, aResponseTransportProperties);
+	            retVal = KErrSenInternal;
+	            }
+	   		CleanupStack::PopAndDestroy( apSOAPMessage ); 
+        }
+		
+		
+                
+    return retVal;
+    }
+TInt CSenBasicWebServiceSession::HandleSoapFaultL(CSenSoapMessage* apSOAPMessage,
+                                            HBufC8*& aResponse)
+{
+	return(CSenWebServiceSession::HandleSoapFaultL(apSOAPMessage,aResponse));
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/src/senwsiplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "senwsiplugin.h"
+#include "MSenServiceDescription.h"
+#include "SenServiceConnection.h" // framework IDs, error codes
+#include "msencoreservicemanager.h"
+#include "senbasicwebservicesession.h"
+#include "sendebug.h"
+#include "SenFacet.h" 
+#include "senlogger.h"
+
+#include <SenTransportProperties.h>
+#include <SenSoapConstants.h>
+
+namespace
+    {
+    _LIT8(KFrameworkLocalname,   "Framework");
+#ifdef _SENDEBUG
+        const TInt KFLATBUFSIZE = 64;
+#endif // _SENDEBUG
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenWsiPlugin* CSenWsiPlugin::NewL(TAny* aManager)
+    {
+    MSenCoreServiceManager* manager =
+        reinterpret_cast<MSenCoreServiceManager*>(aManager);
+    
+    CSenWsiPlugin* self = new (ELeave) CSenWsiPlugin(*manager);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Constructor
+CSenWsiPlugin::CSenWsiPlugin(MSenCoreServiceManager& aManager)
+    : iManager(aManager)
+    {
+    }
+
+CSenWsiPlugin::~CSenWsiPlugin()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenWsiPlugin::~CSenWsiPlugin()")));
+    }
+
+// Second phase construction.
+void CSenWsiPlugin::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenWsiPlugin::ConstructL")));
+    
+    BaseConstructL(KWsiFrameworkXMLNS, KFrameworkLocalname);
+    }
+/*
+RFileLogger* CSenWsiPlugin::Log() const
+    {
+    return iManager.Log();
+    }
+*/
+
+TInt CSenWsiPlugin::RegisterServiceDescriptionL( MSenServiceDescription& aServiceDescription )
+    {
+    TInt retVal(KErrNone);
+    
+#ifdef _SENDEBUG
+    TPtrC8 contract = aServiceDescription.Contract();
+    TPtrC8 endpoint = aServiceDescription.Endpoint();
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenWsiPlugin::RegisterServiceDescriptionL");
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - creating session from description.");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - Endpoint: '%S'"), &endpoint));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - Contract: '%S'"), &contract));
+#endif // _SENDEBUG
+
+    if( aServiceDescription.Endpoint().Length() == 0 )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Endpoint is zero-lenght(!), cannot register such SD.");
+        return KErrSenNoEndpoint;
+        }
+
+
+    // WS-I sessions are matched by consumer id.
+    // This way we can avoid session sharing/multiple consumers
+     
+    CSenBasicWebServiceSession* pSession = CSenBasicWebServiceSession::NewLC(*this);
+    retVal = pSession->InitializeFromL(aServiceDescription);
+    
+    if( retVal == KErrNone )
+        {
+        // Takes the ownership of this session
+        retVal = Manager().AddServiceDescriptionL(pSession);
+        CleanupStack::Pop(pSession);
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy( pSession );
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenWsiPlugin::RegisterServiceDescriptionL:");
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Session->InitializeFromL failed: %d"), retVal));
+        }
+    return retVal;
+    }
+
+TInt CSenWsiPlugin::UnregisterServiceDescriptionL( MSenServiceDescription& aServiceDescription )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenWsiPlugin::UnregisterServiceDescriptionL");
+    TInt retVal(KErrNone);
+    
+    if(aServiceDescription.DescriptionClassType() == MSenServiceDescription::EBasicWebServiceSession)
+        {
+        CSenBasicWebServiceSession* pSession = 
+            (CSenBasicWebServiceSession*) &aServiceDescription;
+        retVal = Manager().RemoveServiceDescriptionL(*pSession);
+        }
+        
+    return retVal;
+    }
+
+
+const TDesC8& CSenWsiPlugin::Id()
+    {   
+    return KDefaultBasicWebServicesFrameworkID(); // "WS-I"
+    }
+
+TInt CSenWsiPlugin::AddServiceDescriptionL(MSenServiceDescription& aPattern,
+                                           MSenRemoteServiceConsumer& /* aRemoteConsumer */,
+                                           HBufC8*& /* aErrorMsg */)
+    {
+    // Currently, accept only SDs, which explicitly declare WS-I framework ID.
+    if(aPattern.FrameworkId() != KDefaultBasicWebServicesFrameworkID)
+        {
+        return 0;
+        }
+        
+    TPtrC8 endpoint = aPattern.Endpoint();
+    if( endpoint.Length() > 0 )
+        {
+        CSenBasicWebServiceSession* pNewSession =
+            (CSenBasicWebServiceSession*) NewServiceDescriptionL();
+        CleanupStack::PushL(pNewSession);
+
+        // InitializeFromL call copies the contract and endpoint:
+        TInt retVal = pNewSession->InitializeFromL(aPattern);
+        if( retVal != KErrNone )
+            {
+            CleanupStack::PopAndDestroy();
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenWsiPlugin::AddServiceDescriptionL:");
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- New session->InitializeFromL failed: %d"), retVal));
+            return 0;
+            }
+        else // init ok
+            {
+            // Core / XML DAO takes ownership of new session:
+            // - if duplicate (equal primary keys) exists, it is deleted
+            Manager().AddServiceDescriptionL( pNewSession ); 
+            CleanupStack::Pop( pNewSession );
+            return 1; // one new session added
+            }
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - No endpoint; new session could not be added.");
+        return 0; // zero added
+        }
+    }
+
+TInt CSenWsiPlugin::CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                           MSenServiceDescription& /* aPattern */,
+                                           CSenServiceSession*& aNewSession,
+                                           MSenRemoteServiceConsumer& /* aRemoteConsumer */,
+                                           HBufC8*& /* pErrorMsg */ )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenWsiPlugin::CreateServiceSessionL");
+
+    CSenBasicWebServiceSession* pNewSession = NULL;
+    TInt retVal(KErrNone);
+    if(aServiceDescription.DescriptionClassType() == MSenServiceDescription::EBasicWebServiceSession)
+        {
+        pNewSession = (CSenBasicWebServiceSession*) &aServiceDescription;
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Service description is already a basic web service (WS-I) session");
+        //pNewSession->CopyFacetsFromL(aPattern); // not performed with WS-I
+        retVal = KErrNone;
+        }
+    else
+        {
+        TPtrC8 endpoint = aServiceDescription.Endpoint();
+        if(endpoint.Length()>0)
+            {
+            pNewSession = (CSenBasicWebServiceSession*) NewServiceDescriptionL();
+            CleanupStack::PushL(pNewSession);
+
+            // InitializeFromL call copies the contract and endpoint:
+            retVal = pNewSession->InitializeFromL(aServiceDescription);
+
+#ifdef _SENDEBUG
+            CBufFlat* pBuf = CBufFlat::NewL(KFLATBUFSIZE);
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream writeStream;
+            writeStream.Open(*pBuf);
+            CleanupClosePushL(writeStream);
+            pNewSession->WriteAsXMLToL(writeStream);
+            TPtr8 ptr = pBuf->Ptr(0);
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- New WS-I service session as XML:");
+            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,( ptr ));
+            CleanupStack::PopAndDestroy(2); // writeStream.Close(), pBuf
+#endif // _SENDEBUG        
+        
+            if( retVal == KErrNone ) // initialize from pattern OK
+                {
+                // NOTE: Core ALWAYS takes ownership of new session:
+                // - if some session with equal primary keys exists, it is deleted
+                TInt retVal = Manager().AddServiceDescriptionL(pNewSession);
+                CleanupStack::Pop(pNewSession);
+#ifdef _SENDEBUG
+                if(retVal!=KErrNone)
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBasicWsiPlugin::CreateServiceSessionL");
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8(" - CoreServiceMngr::AddServiceDescriptionL returned: %d"), retVal));
+                    }
+#endif // _SENDEBUG
+                }
+            else // initialize from pattern failed!
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenWsiPlugin::CreateServiceSessionL:");
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- New session->InitializeFromL failed: %d"), retVal));
+                CleanupStack::PopAndDestroy(pNewSession);
+                }
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - No endpoint; returning KErrSenNoEndpoint");
+            retVal = KErrSenNoEndpoint; // no endpoint for basic web service session
+            }
+        }
+    aNewSession = pNewSession; 
+    return retVal;
+    }
+
+TInt CSenWsiPlugin::OnEvent(const TInt /* aEvent */, TAny* /* apArgument */) 
+    {
+//    LOG_WRITE_L("CSenBasicWsiPlugin::OnEvent");
+//    LOG_WRITEFORMAT((_L8("-event code: %d"), aEvent));
+    TInt retVal(KErrNone);
+
+    return retVal;
+    }
+
+TAny* CSenWsiPlugin::ExtendedInterface()
+    {
+    // There is no extended interface in Basic WS framework at the moment
+    return NULL;
+    }
+
+CSenWSDescription* CSenWsiPlugin::NewServiceDescriptionL()
+    {
+    CSenBasicWebServiceSession* pSD =
+        CSenBasicWebServiceSession::NewLC(*this);
+    pSD->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    CSenFacet* pCompleteOn = CSenFacet::NewL();
+    CleanupStack::PushL(pCompleteOn);
+    pCompleteOn->SetNameL(KCompleteMessagesFacet);
+    pSD->SetFacetL(*pCompleteOn);
+    CleanupStack::PopAndDestroy(pCompleteOn);
+    CleanupStack::Pop(pSD);
+    return pSD;
+    }
+
+/**
+* Return the ServiceManager for which this instance is working.
+* This is used by the ServiceSession instances created by this framework.
+*
+* Note, in Sen, MSenCoreServiceManager so all Frameworks
+* return their "owner" - i.e. - the only service manager in Sen Framework
+*
+* @return (MSenCoreServiceManager)
+*/
+
+MSenCoreServiceManager& CSenWsiPlugin::Manager()
+    {
+    return iManager;
+    }
+
+/**
+* Set the ServiceManager to which this instance reports.
+* The (singleton) ServiceManager calls this method when
+* it instantiates a framework.
+*
+* @param aServiceManager The singleton ServiceManager in the system.
+*/
+void CSenWsiPlugin::SetManager(MSenCoreServiceManager& aServiceManager)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,_L("CSenWsiPlugin::SetManager(.)"));
+    iManager = aServiceManager;
+    }
+
+/**
+* Return an object that can do SAX based parsing of a XML fragment
+* that contains framework specific configuration information.
+* The ServiceManager asks for this BaseFragment upon startup
+* in order to give this framework a chance to read its configuration
+* information from the central ServiceManager configuration document.
+*
+* @return (CSenBaseFragment)
+*/
+CSenBaseFragment& CSenWsiPlugin::ConfigParser()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenWsiPlugin::ConfigParser()")));
+    return *this;
+    }
+
+/**
+* Write the ServiceInvocationFramework configuration as XML to a HBufC8.
+*
+* This method is invoked by the ServiceManager when it saves
+* its state and/or configuration.
+*
+* Upon startup the chunk of XML that is written will be passed back to
+* the configuation parser of the framework.
+*
+* The "schema" that shall be adhered to is:
+* <pre>
+* &lt;element name="Framework"&gt;
+*       &lt;any/&gt;&lt;!-- this is where implementations write additional
+*       information --&gt;
+*       &lt;attribute name="class" type="String"&gt;
+*    &lt;!-- In Symbian the class attribute is used as cue for
+*    the ECOM Resolver --&gt;
+* &lt;/element&gt;
+* </pre>
+*
+* @param aTo - a HBufC8 to which the framework should write its configuration
+*/
+
+
+void CSenWsiPlugin::EndElementL(const TDesC8& aNsUri,
+                                const TDesC8& aLocalName,
+                                const TDesC8& aQName)
+    {
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("WS-I plugin @ end of element: %S (xmlns='%S', localname='%S')"),
+        &aQName, &aNsUri, &aLocalName));
+    CSIF::EndElementL(aNsUri,aLocalName,aQName);
+    }
+
+// over-ride CSenBaseFragment
+HBufC* CSenWsiPlugin::AsXmlUnicodeL()
+    {
+    HBufC8* pUtf8 = AsXmlL();
+    CleanupStack::PushL(pUtf8);
+    HBufC* pAsXmlInUnicode = SenXmlUtils::ToUnicodeLC(*pUtf8);
+    CleanupStack::Pop(pAsXmlInUnicode);
+    CleanupStack::PopAndDestroy(pUtf8);
+    return pAsXmlInUnicode;
+    }
+
+HBufC8* CSenWsiPlugin::AsXmlL()
+    {
+    _LIT8(KLessFramework,"<Framework ");//CodeScannerWarning
+    _LIT8(KXmlns,"xmlns=\"");
+    _LIT8(KQuot,"\" ");
+    _LIT8(KClassQuot,"class=\"");
+    _LIT8(KQuotNewLine,"\"/>\n");
+    HBufC8* retVal = HBufC8::NewLC(256);
+    TPtr8 ptr = retVal->Des();
+    ptr.Append(KLessFramework);
+    ptr.Append(KXmlns);
+    ptr.Append(KWsiFrameworkXMLNS);
+    ptr.Append(KQuot);
+
+    ptr.Append(KClassQuot);
+    ptr.Append(KWsiFrameworkCue);
+    ptr.Append(KQuotNewLine);
+    CleanupStack::Pop(); // retVal
+    return retVal;
+    }
+
+// New methods
+
+TInt CSenWsiPlugin::SetTransportPropertiesL(MSenTransport& aTransport)
+    {
+    //CSenHttpTransportProperties* pProps = CSenHttpTransportProperties::NewLC();
+    CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+    pProps->SetPropertyL(KSenSoapActionHeaderName, KSenSoapActionHeaderValueEmpty, KHttpHeaderType);        
+    HBufC8* pPropsAsXml = pProps->AsUtf8L();
+    CleanupStack::PopAndDestroy(pProps);
+    CleanupStack::PushL( pPropsAsXml );
+    TInt retVal = aTransport.SetPropertiesL( *pPropsAsXml, MSenLayeredProperties::ESenFrameworkLayer, NULL );
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    return retVal;
+    }
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/src/senwsipluginmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsibasicplugin/src/senwsipluginproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "senwsiplugin.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TInt32 KSenWsiBasicPlugin = 0x10274C6E;
+#else
+const TInt32 KSenWsiBasicPlugin = 0x10282C4C;
+#endif
+
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+    IMPLEMENTATION_PROXY_ENTRY(KSenWsiBasicPlugin,  CSenWsiPlugin::NewL),
+#else
+    {{KSenWsiBasicPlugin},  CSenWsiPlugin::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/BMARM/SENIDENTITYMANAGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	"_._24CSenWiseIdentityProvider" @ 1 NONAME R3UNUSED ; CSenWiseIdentityProvider::~CSenWiseIdentityProvider(void)
+	NewLC__23CSenBaseIdentityManagerR22MSenCoreServiceManager @ 2 NONAME R3UNUSED ; CSenBaseIdentityManager::NewLC(MSenCoreServiceManager &)
+	NewLC__24CSenWiseIdentityProviderG6TPtrC8RC6TDesC8T2 @ 3 NONAME ; CSenWiseIdentityProvider::NewLC(TPtrC8, TDesC8 const &, TDesC8 const &)
+	NewL__16CSenBaseIdentityG6TPtrC8 @ 4 NONAME ; CSenBaseIdentity::NewL(TPtrC8)
+	NewL__23CSenBaseIdentityManagerR22MSenCoreServiceManager @ 5 NONAME R3UNUSED ; CSenBaseIdentityManager::NewL(MSenCoreServiceManager &)
+	NewL__24CSenWiseIdentityProviderG6TPtrC8RC6TDesC8T2 @ 6 NONAME ; CSenWiseIdentityProvider::NewL(TPtrC8, TDesC8 const &, TDesC8 const &)
+	"_._16CSenBaseIdentity" @ 7 NONAME R3UNUSED ; CSenBaseIdentity::~CSenBaseIdentity(void)
+	"_._23CSenBaseIdentityManager" @ 8 NONAME R3UNUSED ; CSenBaseIdentityManager::~CSenBaseIdentityManager(void)
+	NewLC__16CSenBaseIdentityG6TPtrC8 @ 9 NONAME ; CSenBaseIdentity::NewLC(TPtrC8)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/BWINS/SENIDENTITYMANAGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	??1CSenBaseIdentity@@UAE@XZ @ 1 NONAME ; public: virtual __thiscall CSenBaseIdentity::~CSenBaseIdentity(void)
+	??1CSenBaseIdentityManager@@UAE@XZ @ 2 NONAME ; public: virtual __thiscall CSenBaseIdentityManager::~CSenBaseIdentityManager(void)
+	??1CSenWiseIdentityProvider@@UAE@XZ @ 3 NONAME ; public: virtual __thiscall CSenWiseIdentityProvider::~CSenWiseIdentityProvider(void)
+	?NewL@CSenBaseIdentity@@SAPAV1@VTPtrC8@@@Z @ 4 NONAME ; public: static class CSenBaseIdentity * __cdecl CSenBaseIdentity::NewL(class TPtrC8)
+	?NewL@CSenBaseIdentityManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 5 NONAME ; public: static class CSenBaseIdentityManager * __cdecl CSenBaseIdentityManager::NewL(class MSenCoreServiceManager &)
+	?NewL@CSenWiseIdentityProvider@@SAPAV1@VTPtrC8@@ABVTDesC8@@1@Z @ 6 NONAME ; public: static class CSenWiseIdentityProvider * __cdecl CSenWiseIdentityProvider::NewL(class TPtrC8,class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenBaseIdentity@@SAPAV1@VTPtrC8@@@Z @ 7 NONAME ; public: static class CSenBaseIdentity * __cdecl CSenBaseIdentity::NewLC(class TPtrC8)
+	?NewLC@CSenBaseIdentityManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 8 NONAME ; public: static class CSenBaseIdentityManager * __cdecl CSenBaseIdentityManager::NewLC(class MSenCoreServiceManager &)
+	?NewLC@CSenWiseIdentityProvider@@SAPAV1@VTPtrC8@@ABVTDesC8@@1@Z @ 9 NONAME ; public: static class CSenWiseIdentityProvider * __cdecl CSenWiseIdentityProvider::NewLC(class TPtrC8,class TDesC8 const &,class TDesC8 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/BWINSCW/SENIDENTITYMANAGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,20 @@
+EXPORTS
+	?UserName@CSenUser@@QBEAAVTDesC8@@XZ @ 1 NONAME ; class TDesC8 & CSenUser::UserName(void) const
+	?PIN@CSenUser@@QBEAAVTDesC8@@XZ @ 2 NONAME ; class TDesC8 & CSenUser::PIN(void) const
+	?UpdateTouchIdentityDBL@CSenBaseIdentityManager@@QAEXAAVMSenServiceDescription@@@Z @ 3 NONAME ; void CSenBaseIdentityManager::UpdateTouchIdentityDBL(class MSenServiceDescription &)
+	?Active@CSenUser@@QBEHXZ @ 4 NONAME ; int CSenUser::Active(void) const
+	?NewL@CSenMultiUserIdentityManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 5 NONAME ; class CSenMultiUserIdentityManager * CSenMultiUserIdentityManager::NewL(class MSenCoreServiceManager &)
+	?NewLC@CSenMultiUserIdentityManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 6 NONAME ; class CSenMultiUserIdentityManager * CSenMultiUserIdentityManager::NewLC(class MSenCoreServiceManager &)
+	??1CSenWiseIdentityProvider@@UAE@XZ @ 7 NONAME ; CSenWiseIdentityProvider::~CSenWiseIdentityProvider(void)
+	?NewL@CSenBaseIdentity@@SAPAV1@VTPtrC8@@@Z @ 8 NONAME ; class CSenBaseIdentity * CSenBaseIdentity::NewL(class TPtrC8)
+	??1CSenBaseIdentityManager@@UAE@XZ @ 9 NONAME ; CSenBaseIdentityManager::~CSenBaseIdentityManager(void)
+	?NewLC@CSenBaseIdentityManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 10 NONAME ; class CSenBaseIdentityManager * CSenBaseIdentityManager::NewLC(class MSenCoreServiceManager &)
+	?NewL@CSenWiseIdentityProvider@@SAPAV1@VTPtrC8@@ABVTDesC8@@1@Z @ 11 NONAME ; class CSenWiseIdentityProvider * CSenWiseIdentityProvider::NewL(class TPtrC8, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenBaseIdentity@@SAPAV1@VTPtrC8@@@Z @ 12 NONAME ; class CSenBaseIdentity * CSenBaseIdentity::NewLC(class TPtrC8)
+	?NewLC@CSenWiseIdentityProvider@@SAPAV1@VTPtrC8@@ABVTDesC8@@1@Z @ 13 NONAME ; class CSenWiseIdentityProvider * CSenWiseIdentityProvider::NewLC(class TPtrC8, class TDesC8 const &, class TDesC8 const &)
+	?Identites@CSenUser@@QAEAAV?$RPointerArray@VCSenBaseIdentity@@@@XZ @ 14 NONAME ; class RPointerArray<class CSenBaseIdentity> & CSenUser::Identites(void)
+	??1CSenMultiUserIdentityManager@@UAE@XZ @ 15 NONAME ; CSenMultiUserIdentityManager::~CSenMultiUserIdentityManager(void)
+	??1CSenBaseIdentity@@UAE@XZ @ 16 NONAME ; CSenBaseIdentity::~CSenBaseIdentity(void)
+	?NewL@CSenBaseIdentityManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 17 NONAME ; class CSenBaseIdentityManager * CSenBaseIdentityManager::NewL(class MSenCoreServiceManager &)
+	?WriteDatabase@CSenBaseIdentityManager@@QAEHXZ @ 18 NONAME ; int CSenBaseIdentityManager::WriteDatabase(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/eabi/SENIDENTITYMANAGERu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,40 @@
+EXPORTS
+	_ZN16CSenBaseIdentity4NewLE6TPtrC8 @ 1 NONAME
+	_ZN16CSenBaseIdentity5NewLCE6TPtrC8 @ 2 NONAME
+	_ZN16CSenBaseIdentityD0Ev @ 3 NONAME
+	_ZN16CSenBaseIdentityD1Ev @ 4 NONAME
+	_ZN16CSenBaseIdentityD2Ev @ 5 NONAME
+	_ZN23CSenBaseIdentityManager13WriteDatabaseEv @ 6 NONAME
+	_ZN23CSenBaseIdentityManager22UpdateTouchIdentityDBLER22MSenServiceDescription @ 7 NONAME
+	_ZN23CSenBaseIdentityManager4NewLER22MSenCoreServiceManager @ 8 NONAME
+	_ZN23CSenBaseIdentityManager5NewLCER22MSenCoreServiceManager @ 9 NONAME
+	_ZN23CSenBaseIdentityManagerD0Ev @ 10 NONAME
+	_ZN23CSenBaseIdentityManagerD1Ev @ 11 NONAME
+	_ZN23CSenBaseIdentityManagerD2Ev @ 12 NONAME
+	_ZN24CSenWiseIdentityProvider4NewLE6TPtrC8RK6TDesC8S3_ @ 13 NONAME
+	_ZN24CSenWiseIdentityProvider5NewLCE6TPtrC8RK6TDesC8S3_ @ 14 NONAME
+	_ZN24CSenWiseIdentityProviderD0Ev @ 15 NONAME
+	_ZN24CSenWiseIdentityProviderD1Ev @ 16 NONAME
+	_ZN24CSenWiseIdentityProviderD2Ev @ 17 NONAME
+	_ZN28CSenMultiUserIdentityManager4NewLER22MSenCoreServiceManager @ 18 NONAME
+	_ZN28CSenMultiUserIdentityManager5NewLCER22MSenCoreServiceManager @ 19 NONAME
+	_ZN28CSenMultiUserIdentityManagerD0Ev @ 20 NONAME
+	_ZN28CSenMultiUserIdentityManagerD1Ev @ 21 NONAME
+	_ZN28CSenMultiUserIdentityManagerD2Ev @ 22 NONAME
+	_ZTI16CSenBaseIdentity @ 23 NONAME ; #<TI>#
+	_ZTI23CSenBaseIdentityManager @ 24 NONAME ; #<TI>#
+	_ZTI24CSenWiseIdentityProvider @ 25 NONAME ; #<TI>#
+	_ZTI28CSenMultiUserIdentityManager @ 26 NONAME ; #<TI>#
+	_ZTI32CSenSenSecurityMechanismObserver @ 27 NONAME ; #<TI>#
+	_ZTI8CSenUser @ 28 NONAME ; #<TI>#
+	_ZTV16CSenBaseIdentity @ 29 NONAME ; #<VT>#
+	_ZTV23CSenBaseIdentityManager @ 30 NONAME ; #<VT>#
+	_ZTV24CSenWiseIdentityProvider @ 31 NONAME ; #<VT>#
+	_ZTV28CSenMultiUserIdentityManager @ 32 NONAME ; #<VT>#
+	_ZTV32CSenSenSecurityMechanismObserver @ 33 NONAME ; #<VT>#
+	_ZTV8CSenUser @ 34 NONAME ; #<VT>#
+	_ZN8CSenUser9IdentitesEv @ 35 NONAME
+	_ZNK8CSenUser3PINEv @ 36 NONAME
+	_ZNK8CSenUser6ActiveEv @ 37 NONAME
+	_ZNK8CSenUser8UserNameEv @ 38 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsidentitymanager    
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsidentitymanager.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsidentitymanager.iby)
+PRJ_MMPFILES
+senidentitymanager.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/group/senidentitymanager.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senidentity manager    
+*
+*/
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenIdentityManager.dll
+UID             0x1000008d 0x101F96F7
+#else
+TARGET          wsidentitymanager.dll
+UID             0x1000008d 0x101F972E
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senidentitymanagerdll.cpp
+SOURCE          sensecuritymechanismobserver.cpp
+SOURCE          senbaseidentitymanager.cpp
+SOURCE          senmultiuseridentitymanager.cpp
+SOURCE          senuser.cpp
+SOURCE          senbaseidentity.cpp
+SOURCE          senwiseidentityprovider.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc // SenDebug.h - file logging MACROs
+USERINCLUDE     ../../wsnotifierplugins/inc // notifier client headers 
+
+USERINCLUDE     ../../wscore/inc  // MSenCoreServiceManager.h
+USERINCLUDE   ../../wsframework/inc // SenSecurityMechanism.h
+USERINCLUDE     ../../wslogger/inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+
+#ifdef __CRYPTO_HW__
+SYSTEMINCLUDE   /epoc32/include/internal
+#endif // __CRYPTO_HW__
+
+// System libs
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib   // for RFs
+LIBRARY         estor.lib   // for RFileWriteStream
+LIBRARY         sysutil.lib // sysutil.h
+LIBRARY         ecom.lib    // for ecoms
+LIBRARY         flogger.lib
+
+#ifdef __CRYPTO_HW__
+#ifndef WINSCW 
+LIBRARY         SecEnv.lib
+#endif //WINSCW
+#endif // __CRYPTO_HW__
+/*
+#if defined(ARMCC)
+LIBRARY PLPVARIANT.LIB
+#elif defined(WINSCW)
+#elif defined(WINS)
+#else  // MARM
+LIBRARY         PLPVARIANT.LIB // for reading IMEI (not in public Series 60 2.1b SDK)
+#endif
+*/
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// Serene libs
+LIBRARY         SenXml.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenNotDlg.lib
+LIBRARY         SenLogger.lib
+LIBRARY			SenFramework.lib
+LIBRARY         SenUtils.lib
+#else
+// Serene libs
+LIBRARY         wsXml.lib
+LIBRARY         wsServDesc.lib
+LIBRARY         wsNotDlg.lib
+LIBRARY         wsLogger.lib
+LIBRARY			wsFramework.lib
+LIBRARY         wsUtils.lib
+#endif
+
+#if defined(ARMCC)
+DEFFILE ../eabi/SENIDENTITYMANAGER.DEF
+#elif defined(WINSCW)
+DEFFILE ../BWINSCW/SENIDENTITYMANAGER.DEF
+#elif defined(WINS)
+  DEFFILE    ../BWINS/SENIDENTITYMANAGER.DEF
+#else 
+  DEFFILE     ../BMARM/SENIDENTITYMANAGER.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/msenidentity.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_IDENTITY_H
+#define M_SEN_IDENTITY_H
+
+
+#include <e32base.h>
+#include <e32des8.h>    // HBufC8
+
+#include <SenIdentityProvider.h>
+//TYPEDEFS
+typedef RPointerArray<CSenIdentityProvider> RIdentityProviderList;
+
+// CLASS DECLARATION
+class MSenIdentity
+    {
+    public: // New functions
+    
+        /**
+        * Getter for name.
+        * @return name of the identity
+        */
+        virtual const TDesC8& Name() = 0;
+
+        /**
+        * Getter for user name.
+        * @return user name of the identity
+        */
+        virtual const TDesC8& UserName() = 0;
+
+        /**
+        * Getter for type.
+        * @return type of the identity
+        */
+        virtual const TDesC8& Type() = 0;
+
+        /**
+        * @return the default IdentityProvider of the Identity.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL() = 0;
+
+        /**
+        * @param aService
+        * @return the IdentityProvider that has the ServiceID
+        * that best mathces the endpoint or providerID
+        * of the given ServiceDescription.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                    MSenServiceDescription& aService) = 0;
+        /**
+        * @param aURI
+        * @return the IdentityProvider that has the ServiceID
+        * that best mathces the given URI.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL( const TDesC8& aURI ) = 0;
+
+        /**
+        * @param aIdpList an array of ProviderIDs
+        * @param strict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to the
+        * current active Identity.
+        * @return the currently preferred IdentityProvider
+        * from within the given List with ProviderIDs.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                                const CDesC8Array& aIdpList,
+                                                TBool aStrict) = 0;
+        /**
+        * @param aService
+        * @param aIdpList an array of ProviderIDs
+        * @param strict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to the
+        * current active Identity.
+        * @return the currently preferred IdentityProvider
+        * from within the given List with ProviderIDs.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                            MSenServiceDescription& aService,
+                                            const CDesC8Array& aIdpList,
+                                            TBool aStrict) = 0;
+
+        /**
+        * Checks if Identity already has an identity provider with given data.
+        * Existing identity provider can still have more data than the pattern.
+        * @param    aContains   will contain the boolean value on return. ETrue if
+        *           contains, EFalse otherwise.
+        * @param    aIDP    the pattern identity provider.
+        * @return KErrNone or system-wide error code.
+        */
+        virtual TInt ContainsIdentityProviderL( TBool& aContains,
+                                                CSenIdentityProvider& aIDP) = 0;
+    
+        /**
+        * Register an IdentityProvider for the current active Identity.
+        * @param aIdp a registered IdentityProvider. Ownership of the
+        * argument is transferred into this class from the caller.
+        * @return KErrNone or system-wide error code.
+        */
+        virtual TInt RegisterIdentityProviderL( CSenIdentityProvider* aIdp ) = 0;
+        
+        virtual TInt UpdateIdentityProviderL(CSenIdentityProvider& aIdp) = 0;
+
+        /**
+        * Unregister an IdentityProvider for the current active Identity.
+        * @param aIdp an unregistered IdentityProvider
+        * @return   KErrNone        if everything goes OK.
+        *           KErrNotFound    if correct identity provider was not found
+        *           Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt UnregisterIdentityProviderL( CSenIdentityProvider& aIdp) = 0;
+
+        /**
+        * Associate a service to an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool AssociateServiceL( const TDesC8& aServiceID,
+                                         const TDesC8& aProviderID ) = 0;
+
+        /**
+        * Dissociate a service from an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool DissociateServiceL(const TDesC8& aServiceID,
+                                        const TDesC8& aProviderID ) = 0;
+                                        
+        virtual TInt FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
+                                                   CSenIdentityProvider*& apMatch) = 0;
+
+        /**
+        * Write the Identity as XML into a write stream.
+        * This method is invoked by the IdentityManager when it saves
+        * its state and/or configuration.
+        * Identities should serialize sufficient information
+        * to enabled re-instantiation from the same XML content.
+        */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+        * Write the Identity as XML into 8-bit (UTF-8) buffer
+        */
+        virtual HBufC8* AsXmlL() = 0;
+
+        /**
+        * Write the Identity as XML into 8-bit (Unicode) buffer
+        */
+        virtual HBufC* AsXmlUnicodeL() = 0;
+        
+        virtual const RIdentityProviderList& IdentityProvidersL() const = 0;
+    };
+
+#endif // M_SEN_IDENTITY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/msenidentitymanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,214 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_IDENTITY_MANAGER_H
+#define M_SEN_IDENTITY_MANAGER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <e32des8.h>    // HBufC8
+#include <badesca.h>    // CDesC8Array
+
+#include <SenIdentityProvider.h>
+#include <MSenServiceDescription.h>
+
+#include "msenidentity.h" 
+
+// FORWARD DECLARATIONS
+class CSenSecurityMechanism;
+
+/**
+* An MSenIdentityManager knows about  the various Identitities
+* of the user(s) of the system. Components use this interface
+* to register identities and query for identities in various
+* situations.
+*
+* An Identity can contain all kinds of information and is not
+* further specified here. For maximum flexibility an identity
+* is modelled as an XML Element that can have arbitrary children
+* elements.
+*
+* The IdentityManager can have a rather complex list of Identities,
+* the Identity that it returns is based upon:
+* - the currently active user identity (set)
+* - a URL (Endpoint) or ProviderID given in the request
+*
+* An IdentityManager can return a full Identity (which can contain a
+* lot of information); but also offer methods to only return an
+* IdentityProvider that can be used to obtain access to a particular service.
+*/
+class MSenIdentityManager
+    {
+    public: // New functions
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @return the currently active default identity.
+        */
+        virtual MSenIdentity& IdentityL() = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @param the (System) userName of the currently active user.
+        * @return KErrNone if no error, or some of the system wide error codes
+        */
+        virtual TInt UserNameL(HBufC8*& aUserName) = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @return the default IdentityProvider of the currently active Identity
+        *         or NULL if not found(!)
+        */
+        virtual CSenIdentityProvider* IdentityProviderL() = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @param aServiceDescription
+        * @return the IdentityProvider of the currently active
+        * Identity that has the ServiceID that best mathces the
+        * endpoint or providerID of the given ServiceDescription.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                            MSenServiceDescription& aServiceDescription ) = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @param aURI
+        * @return the IdentityProvider of the currently active
+        * Identity that has the ServiceID that best mathces the
+        * given URI or NULL if not found(!).
+        */
+        virtual CSenIdentityProvider* IdentityProviderL( const TDesC8& aURI ) = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @param aIdpList an array of ProviderIDs
+        * @param aStrict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to
+        * the current active Identity.
+        * @return the currently preferred IdentityProvider
+        * from within the given List with ProviderIDs.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                                const CDesC8Array& aIdpList,
+                                                TBool aStrict) = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * @param aServiceDescription
+        * @param aIdpList an array of ProviderIDs
+        * @param aStrict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to the
+        * current active Identity.
+        * @return the currently preferred IdentityProvider
+        * from within the given List with ProviderIDs.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                MSenServiceDescription& aServiceDescription,
+                                const CDesC8Array& aIdpList,
+                                TBool aStrict) = 0;
+
+        /**
+        * Register an IdentityProvider for the current active Identity.
+        * @param aIdp a registered IdentityProvider
+        * @return true if succesful.
+        */
+        virtual TInt RegisterIdentityProviderL( CSenIdentityProvider* aIdp ) = 0;
+
+        /**
+        * Unregister an IdentityProvider for the current active Identity.
+        * @param aIdp an unregistered IdentityProvider
+        * @return true if succesful.
+        */
+        virtual TInt UnregisterIdentityProviderL( CSenIdentityProvider& aIdp) = 0;
+
+        /**
+        * Associate a service to an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool AssociateServiceL(const TDesC8& aServiceID,
+                                        const TDesC8& providerID ) = 0;
+
+        /**
+        * Dissociate a service from an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool DissociateServiceL(const TDesC8& aServiceID,
+                                         const TDesC8& aProviderID ) = 0;
+
+        /**
+        * This method is not intended for the developer API and is for internal
+        * use only. It may be exposed the developers of
+        * ServiceInvocationFrameworks.
+        * Status codes:
+        *   KErrNone                        ok
+        *   KErrNotFound                    no identities
+        *   Other codes are system error codes
+        * @param aIdentitiesList an array where the identities can be inserted
+        * @return status/error code.
+        */
+        virtual TInt IdentitiesL( CDesC8Array& aIdentitiesList ) = 0;
+        
+        virtual TInt AuthenticationForL(CSenIdentityProvider& aAccount, TPckgBuf<TSenAuthentication>& aResponse) = 0;
+        virtual TPtrC8 SenSecurityMechanismNames8L() = 0;
+        virtual CSenSecurityMechanism* MechanismNamedL(const TDesC8& aName) = 0;
+
+        /**
+        * For encoding and decoding base 64:
+        */
+        virtual HBufC8* EncodeToBase64LC(const TDesC8& aSource) = 0;
+        virtual HBufC8* DecodeFromBase64LC(const TDesC8& aSource) = 0;
+
+        virtual void SetShowPasswordDialog(const TBool aState) = 0;
+        
+        virtual TInt FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
+                                                   CSenIdentityProvider*& apMatch) = 0;
+                                                   
+        virtual TInt UpdateIdentityProviderL(CSenIdentityProvider& aIdp) = 0;
+        virtual const RPointerArray<CSenIdentityProvider>& IdentityProvidersL() = 0;
+    };
+
+#endif // M_SEN_IDENTITY_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/senbaseidentity.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,249 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_BASE_IDENTITY_H
+#define SEN_BASE_IDENTITY_H
+
+//INCLUDES
+#include <SenBaseFragment.h>
+
+#include "msenidentity.h"
+
+
+// CONSTANTS
+_LIT8( KIdentityElementLocalName, "Identity" );
+_LIT8( KServiceIDElementLocalName, "ServiceID" );
+
+// FORWARD DECLARATIONS
+class CSenIdentityProvider;
+
+//TYPEDEFS
+typedef RPointerArray<CSenIdentityProvider> RIdentityProviderList;
+
+// CLASS DECLARATION
+class CSenBaseIdentity : public CSenBaseFragment,
+                         public MSenIdentity
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenBaseIdentity* NewL(TPtrC8 aIMEI);
+        IMPORT_C static CSenBaseIdentity* NewLC(TPtrC8 aIMEI);
+
+        /**
+        * Destructor
+        */
+        IMPORT_C ~CSenBaseIdentity();   
+        
+        // New functions
+        
+        /**
+        * A getter.
+        * @param aService the service description
+        * @return a pointer to IdentityProvider
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                            MSenServiceDescription& aService );
+
+        /**
+        * A getter.
+        * @param aIdentityProviderId an URI of the service (endpoint or contract)
+        * @return a pointer to IdentityProvider
+        */
+        virtual CSenIdentityProvider* IdentityProviderL( const TDesC8& aUri );
+
+        /**
+        * A getter.
+        * @param aIdpList an array of ProviderIDs
+        * @param strict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to the
+        * current active Identity.
+        * @return a pointer to IdentityProvider
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                                const CDesC8Array& aIdpList,
+                                                TBool aStrict);
+
+        /**
+        * A getter.
+        * @param aService the service description
+        * @param aIdpList an array of ProviderIDs
+        * @param strict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to the
+        * current active Identity.
+        * @return a pointer to IdentityProvider
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                        MSenServiceDescription& aService,
+                                        const CDesC8Array& aIdpList,
+                                        TBool aStrict);
+
+        /**
+        * A getter.
+        * @return a pointer to IdentityProvider
+        */
+        virtual CSenIdentityProvider* IdentityProviderL();
+
+        /**
+        * Register an IdentityProvider for the current active Identity.
+        * @param aIdp a registered IdentityProvider
+        * @return KErrNone or system-wide error code.
+        */
+        virtual TInt RegisterIdentityProviderL(CSenIdentityProvider* aIdp );
+        
+        virtual TInt UpdateIdentityProviderL(CSenIdentityProvider& aIdp);
+
+        /**
+        * Unregister an IdentityProvider for the current active Identity.
+        * @param aIdp an unregistered IdentityProvider
+        * @return true if successful.
+        */
+        virtual TInt UnregisterIdentityProviderL(CSenIdentityProvider& aIdp );
+
+        /**
+        * Associate a service to an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool AssociateServiceL( const TDesC8& aServiceID,
+                                         const TDesC8& aProviderID );
+
+        /**
+        * Dissociate a service from an IdentityProvider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool DissociateServiceL(const TDesC8& aServiceID,
+                                         const TDesC8& aProviderID );
+
+        /**
+        * Creates the element. Overrides CSenBaseFragment
+        * StartElementL-function
+        * @param aNsUri name space URI
+        * @param aLocalName local name
+        * @param aQName cue name
+        * @param apAttrs XML attributes
+        */
+        virtual void StartElementL(const TDesC8& aNsUri,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName,
+                                   const RAttributeArray& aAttributes);
+
+        void EndElementL(const TDesC8& aNsUri,
+                         const TDesC8& aLocalName,
+                         const TDesC8& aQName);
+
+        virtual HBufC8* AsXmlL();
+        virtual HBufC* AsXmlUnicodeL();
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+
+        /**
+        * A Type getter.
+        * @return a pointer to the type
+        */
+        virtual const TDesC8& Type();
+
+        /**
+        * A Name getter.
+        * @return a pointer to the name
+        */
+        virtual const TDesC8& Name();
+
+        /**
+        * A UserName getter.
+        * @return a pointer to the user name
+        */
+        virtual const TDesC8& UserName();
+
+        /**
+        * Checks if Identity already has an identity provider with given data.
+        * Existing identity provider can still have more data than the pattern.
+        * @param    aContains   will contain the boolean value on return. ETrue if
+        *           contains, EFalse otherwise.
+        * @param    aIDP    the pattern identity provider.
+        * @return KErrNone or system-wide error code.
+        */
+        virtual TInt ContainsIdentityProviderL( TBool& aContains,
+                                                CSenIdentityProvider& aIDP);
+
+
+        /**
+        * Method for finding an identity provider.
+        * @param aIdp       Identity provider to be searched
+        * @param apMatch    ref-to-pointer to the found identity provider or 
+        *                   NULL if not found. Ownership is NOT transferred.
+        * @return   KErrNotFound if no match was found.
+        *           or otherwise the iProviderList index of found IdP.
+        */
+        virtual TInt FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
+                                                   CSenIdentityProvider*& apMatch);
+
+        virtual const RIdentityProviderList& IdentityProvidersL() const;
+                                                  
+    private: 
+
+        /**
+        * C++ default constructor.
+        */
+        CSenBaseIdentity(TPtrC8 aIMEI);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */void ConstructL();
+
+        // New functions
+        
+        /**
+        * A getter.
+        * @param aProviderID the providers ID
+        * @return a pointer to IdentityProvider
+        */
+        CSenIdentityProvider* IdentityProviderNamed( const TDesC8& aProviderID );
+        TInt IdentityProviderNamed( const TDesC8& aProviderID,
+                                    CSenIdentityProvider*&  apMatch);
+
+#ifdef __CRYPTO_HW__									
+        void EncryptPasswordL(const TDesC8& aData, TDes8& aCipherText);
+		
+		void DecryptPasswordL(const TDesC8& aData, TDes8& aCipherText);
+
+#endif // __CRYPTO_HW__
+    private: //Data
+        RIdentityProviderList iProviderList;
+        CSenIdentityProvider* iProvider;
+        TPtrC8 iIMEI;
+    };
+
+#endif // SEN_BASE_IDENTITY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/senbaseidentitymanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,387 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_BASE_IDENTITY_MANAGER_H
+#define SEN_BASE_IDENTITY_MANAGER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <ecom.h>
+#include <flogger.h>    // RFileLogger
+#include <badesca.h>    // CDesC8Array
+
+#include <SenIdentityProvider.h>
+#include <SenBaseFragment.h>
+
+#include "senbaseidentity.h"
+#include "msenidentitymanager.h" 
+
+
+
+
+// CONSTANTS
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TUid KUidSechMech = {0x101F96FC};
+#else
+const TUid KUidSechMech = {0x101F9733};
+#endif
+// FORWARD DECLARATIONS
+class CSenSenSecurityMechanismObserver;
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class CSenBaseIdentityManager : public CSenBaseFragment,
+                                public MSenIdentityManager
+    {
+    public: // Constructors and destructor
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenBaseIdentityManager* NewL(
+                                            MSenCoreServiceManager& aManager);
+        IMPORT_C static CSenBaseIdentityManager* NewLC(
+                                            MSenCoreServiceManager& aManager);
+
+        IMPORT_C virtual ~CSenBaseIdentityManager();
+        
+        // New functions
+        
+        void ReloadSenSecurityMechanismsL();
+
+        // Functions from base classes
+        
+        // from MSenIdentityManager
+        TPtrC8 SenSecurityMechanismNames8L();
+        CSenSecurityMechanism* MechanismNamedL(const TDesC8& aName);
+
+        /**
+        * Initialize this SenBaseIdentityManager by parsing
+        * the given file with the given XMLReader.
+        * The file is expected to contain valid XML that
+        * follows the example given above.
+        * @param file
+        * @param reader
+        */
+        void LoadFromL(TDesC& aFile, CSenXmlReader& aReader);
+
+
+        /**
+        * Save the current state of the SenBaseIdentityManager as an XML
+        * document into a file.
+        * Statuscodes:
+        *   KErrNone                Ok
+        *  Other codes are system error codes.
+        * @return status code.
+        */
+        IMPORT_C TInt WriteDatabase();
+
+        /**
+        * Creates the element. Overrides CSenBaseFragment
+        * StartElementL-function
+        * @param aNsUri name space URI
+        * @param aLocalName local name
+        * @param aQName cue name
+        * @param apAttrs XML attributes
+        */
+        virtual void StartElementL( const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName,
+                                    const RAttributeArray& aAttributes);
+
+        /**
+        * Implements MSenIdentityManager
+        * @return the currently active default identity.
+        */
+        virtual MSenIdentity& IdentityL();
+
+        /**
+        * Implements MSenIdentityManager
+        * @param On the return, contains the (System) userName of the
+        *        currently active user.
+        * @return KErrNone if no error, or some of the system wide error codes
+        */
+        virtual TInt UserNameL(HBufC8*& aUserName);
+
+        /**
+        * Implements MSenIdentityManager
+        * @return the default IdentityProvider of the currently active
+        *         Identity.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL();
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aServiceDescription
+        * @return the IdentityProvider of the currently active Identity.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                MSenServiceDescription& aServiceDescription );
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aURI
+        * @return the IdentityProvider of the currently active Identity.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(const TDesC8& aURI );
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aIdpList an array of ProviderIDs
+        * @param aStrict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to
+        * the current active Identity.
+        * @return the currently preferred IdentityProvider.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                const CDesC8Array& aIdpList, TBool aStrict);
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aServiceDescription
+        * @param aIdpList an array of ProviderIDs
+        * @param aStrict if set to true only an IdentityProvider from the List
+        * will be returned, and null if none of the list entries is known to
+        * the current active Identity.
+        * @return the currently preferred IdentityProvider.
+        */
+        virtual CSenIdentityProvider* IdentityProviderL(
+                                MSenServiceDescription& aServiceDescription,
+                                const CDesC8Array& aIdpList,
+                                TBool aStrict);
+
+        /**
+        * Checks if there already is an identity provider with given data.
+        * Existing identity provider can still have more data than the pattern.
+        * @param    aContains   will contain the boolean value on return. ETrue if
+        *           contains, EFalse otherwise.
+        * @param    aIDP    the pattern identity provider.
+        * @return KErrNone or system-wide error code.
+        */
+        virtual TInt ContainsIdentityProviderL(
+                                       TBool& aContains,
+                                       CSenIdentityProvider& aIDP);
+
+        /**
+        * Implements MSenIdentityManager
+        * Ownerships is transferred
+        * @param aIdp a registered IdentityProvider
+        * @return KErrNone if successful.
+        */
+        virtual TInt RegisterIdentityProviderL(CSenIdentityProvider* apIdp );
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aIdp an unregistered IdentityProvider
+        * @return KErrNone if successful.
+        *         KErrNotFound if IdentityProvider was not found.
+        *         Other return values are symbian system-wide error codes.
+        */
+        virtual TInt UnregisterIdentityProviderL(CSenIdentityProvider& aIdp );
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool AssociateServiceL(const TDesC8& aServiceID,
+                                        const TDesC8& aProviderID );
+
+        /**
+        * Implements MSenIdentityManager
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an IdentityProvider
+        * @return true if successful. Failure may be caused by non-existence
+        * of the IdentityProvider for the current user.
+        */
+        virtual TBool DissociateServiceL(const TDesC8& aServiceID,
+                                         const TDesC8& aProviderID );
+
+        /**
+        * Implements MSenIdentityManager
+        * Status codes:
+        *   KErrNone                        ok
+        *   KErrNotFound                    no identities
+        *   Other codes are system error codes
+        * @param aIdentitiesList an array where the identities can be inserted
+        * @return status/error code.
+        */
+        virtual TInt IdentitiesL( CDesC8Array& aIdentitiesList );
+
+        /**
+        * NOTE! This code does not do as documentation states.
+        * Only second line text is shown and
+        * "Ok" button on the left side.
+        * @return the value of button pressed (OK or CANCEL)
+        */
+        virtual TInt YesNoQueryL(const TDesC& aLine1,
+                                 const TDesC& aLine2,
+                                 const TDesC& aButton1,
+                                 const TDesC& aButton2);
+
+        virtual TInt AuthenticationForL(CSenIdentityProvider& aAccount, TPckgBuf<TSenAuthentication>& aResponse);
+
+        /**
+        * For encoding and decoding base 64:
+        */
+        virtual HBufC8* EncodeToBase64LC(const TDesC8& aSource);
+        virtual HBufC8* DecodeFromBase64LC(const TDesC8& aSource);
+        
+        virtual TInt FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
+                                                   CSenIdentityProvider*& apMatch);
+        
+        virtual TInt UpdateIdentityProviderL(CSenIdentityProvider& aIdp);
+
+        /**
+        * "Enables/disables" -flag which determines if UI interaction with end-user is allowed or not
+        */
+        virtual void SetShowPasswordDialog(const TBool aState);
+
+        RFileLogger* Log();
+        /** Improved heuristics from Identity DB removal / cleanups
+		*
+		* It finds the matching IdentityProvider child elements of current Identity 
+		* element using the service description and add the touch attribute to all 
+		* matched IdentityProvider elements with current tick count value.
+		* If touch attribute already there it will be replaced with new current 
+		* tick count value.
+		*
+		* @param asd     is the new established session service description.
+		* Leave codes: Symbian system-wide error codes.  
+		*/
+        IMPORT_C void UpdateTouchIdentityDBL(MSenServiceDescription& asd);
+        
+        
+        /**
+        * Implements MSenIdentityManager
+        * @return the default IdentityProvider of the currently active
+        *         Identity.
+        */
+        const virtual RPointerArray<CSenIdentityProvider>& IdentityProvidersL();
+
+    protected: 
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenBaseIdentityManager(MSenCoreServiceManager& aManager);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+        // New functions
+        
+        /**
+        * Save the current state of the SenBaseIdentityManager as an XML
+        * document into a file.
+        * Status codes:
+        *   KErrNone                Ok
+        *   Other codes are system error codes.
+        * @return status code.
+        */
+        virtual TInt WriteConfigurationToL( const TDesC& aFile );
+        TBool AllowSavePasswordL();
+        /** Improved heuristics from Identity DB removal / cleanups : Naga
+	    *
+	    * Checks touch attribute value for all IdentityProvider child elements of 
+	    * current Identity element if that exceeds the the tick counts for two weeks 
+	    * (Max tick count) or if it is greater than current tick count value it removes 
+	    * the corresponding IdentityProvider child element from the Identity element 
+	    * child list.    
+	    * 
+	    * 1 millisec = 1 tick
+		* 86400 sec = 1 day
+		* 86400*1000 millisec = 1 day
+		* 86400*14*1000 = 1209600000 millisec = 2 weeks
+		* So if attr val >= 1209600000 or > current tick count.
+		* Note: always attr val should be <= current tick count.
+		*
+	    * eg;
+	    * Before call to CleanupUnusedIdentityDBL()
+	    * <Users>
+		* <User>
+		* <Identity>
+		* <IdentityProvider>
+  		* <Endpoint>http://10.21.32.20/WSStar/CredMan/STS.aspx</Endpoint> 
+  		* .........
+  		* ..........
+  		* </IdentityProvider>
+		* <IdentityProvider touch="1000">
+  		* <Endpoint>http://10.21.32.20/WSStar/CredMan/STS_001.aspx</Endpoint> 
+  		* ..........
+  		* ..........
+  		* </IdentityProvider>
+  		* <IdentityProvider touch="1309600000">
+  		* <Endpoint>http://10.21.32.20/WSStar/CredMan/Webservises.aspx</Endpoint> 
+  		* ..........
+  		* ............
+  		* </IdentityProvider>
+		* </Identity>
+  		* </User>
+  		* </Users>
+		* 
+		* After call to CleanupUnusedIdentityDBL()
+	    * <Users>
+		* <User>
+		* <Identity>
+		* <IdentityProvider>
+  		* <Endpoint>http://10.21.32.20/WSStar/CredMan/STS.aspx</Endpoint> 
+  		* .........
+  		* ..........
+  		* </IdentityProvider>
+		* <IdentityProvider touch="1000">
+  		* <Endpoint>http://10.21.32.20/WSStar/CredMan/STS_001.aspx</Endpoint> 
+  		* ..........
+  		* ..........
+  		* </IdentityProvider>
+  		* </Identity>
+  		* </User>
+  		* </Users>
+  		* 
+		* Leave codes: Symbian system-wide error codes.
+	    */
+        void CleanupUnusedIdentityDBL();
+
+    protected: // Data
+        CSenBaseIdentity* iIdentity;
+        CSenIdentityProvider* iProvider;
+        MSenCoreServiceManager& iManager;
+        TBool iConfigReadonly;
+        RFileLogger* iLog;   // not owned (no create/close)
+        CSenSenSecurityMechanismObserver* iObserver;
+        CBufFlat* ipMechanicsNames;
+        HBufC8* ipDeviceID;     // Owned
+        RImplInfoPtrArray       iEcomInfoArray;
+        RPointerArray<HBufC8>   iSechMechNames;
+        RPointerArray<HBufC8>   iSechMechCues;
+        TBool iShowPasswordDialog;
+    };
+
+#endif // SEN_BASE_IDENTITY_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/senmultiuseridentitymanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_MULTIUSER_IDENTITY_MANAGER_H
+#define SEN_MULTIUSER_IDENTITY_MANAGER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <ecom.h>
+#include <flogger.h>    // RFileLogger
+#include <badesca.h>    // CDesC8Array
+
+#include <SenIdentityProvider.h>
+#include <SenBaseFragment.h>
+
+#include "senbaseidentitymanager.h"
+#include "msenidentitymanager.h" 
+#include "senuser.h" 
+#include "senpointermap.h" 
+
+
+
+
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class CSenMultiUserIdentityManager : public CSenBaseIdentityManager
+    {
+    public: // Constructors and destructor
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenMultiUserIdentityManager* NewL(
+                                            MSenCoreServiceManager& aManager);
+        IMPORT_C static CSenMultiUserIdentityManager* NewLC(
+                                            MSenCoreServiceManager& aManager);
+
+        IMPORT_C virtual ~CSenMultiUserIdentityManager();
+        
+
+
+        /**
+        * Creates the element. Overrides CSenBaseFragment
+        * StartElementL-function
+        * @param aNsUri name space URI
+        * @param aLocalName local name
+        * @param aQName cue name
+        * @param apAttrs XML attributes
+        */
+        virtual void StartElementL( const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName,
+                                    const RAttributeArray& aAttributes);
+                                    
+        virtual void EndElementL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName);
+
+        /**
+        * Implements MSenIdentityManager
+        * @return the currently active default identity.
+        */
+        virtual MSenIdentity& IdentityL();
+
+        /**
+        * Implements MSenIdentityManager
+        * @param On the return, contains the (System) userName of the
+        *        currently active user.
+        * @return KErrNone if no error, or some of the system wide error codes
+        */
+        virtual TInt UserNameL(HBufC8*& aUserName);
+   
+     
+    private: 
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenMultiUserIdentityManager(MSenCoreServiceManager& aManager);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+        // New functions
+        
+        /**
+        * Save the current state of the SenMultiUserIdentityManager as an XML
+        * document into a file.
+        * Status codes:
+        *   KErrNone                Ok
+        *   Other codes are system error codes.
+        * @return status code.
+        */
+        TInt WriteConfigurationToL( const TDesC& aFile );
+        
+        
+        CSenBaseIdentity* iActiveIdentity;
+        CSenUser* iParsedUser;//used only while parsing
+        CSenUser* iActiveUser;
+        RPointerArray<CSenUser> iUsers;
+    };
+
+#endif // SEN_BASE_IDENTITY_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/sensecuritymechanismobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SECURITY_MECHANISMOBSERVER_H
+#define SEN_SECURITY_MECHANISMOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <ecom.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CSenBaseIdentityManager;
+class RFileLogger;
+
+// CLASS DECLARATION
+class CSenSenSecurityMechanismObserver :    public CActive
+{
+    public: // Constructors and destructor
+    
+        static CSenSenSecurityMechanismObserver* NewL(
+                                            CSenBaseIdentityManager& aOwner);
+        static CSenSenSecurityMechanismObserver* NewLC(
+                                            CSenBaseIdentityManager& aOwner);
+
+        virtual ~CSenSenSecurityMechanismObserver();
+
+        // New functions
+        
+        void Start();
+ 
+        // Functions from base classes
+        
+        virtual void RunL();
+        virtual TInt RunError(TInt aError);
+
+    protected: // New functions
+        
+        virtual void DoCancel();
+
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenSenSecurityMechanismObserver(CSenBaseIdentityManager& aOwner);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        RFileLogger* Log();
+
+    private: // Data
+        CSenBaseIdentityManager& iOwner;
+        REComSession iEcomSession;
+    };
+
+#endif // SEN_SECURITY_MECHANISMOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/senuser.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+#ifndef SENUSER_H
+#define SENUSER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include "senbaseidentity.h"
+
+// CLASS DECLARATION
+
+_LIT(KSenUser, "SenUser");
+
+/**
+*  CSenUser
+* 
+*/
+class CSenUser : public CBase
+{
+public: // Constructors and destructor
+
+	/**
+		* Destructor.
+		*/
+	~CSenUser();
+
+		/**
+		* Two-phased constructor.
+		*/
+	static CSenUser* NewL(const TDesC8& aUserName, const TDesC8& aPIN, TBool aActive = EFalse);
+
+		/**
+		* Two-phased constructor.
+		*/
+	static CSenUser* NewLC(const TDesC8& aUserName, const TDesC8& aPIN, TBool aActive = EFalse);
+    
+     IMPORT_C inline  TDesC8& UserName() const;
+	 IMPORT_C inline  TDesC8& PIN() const;
+     IMPORT_C inline  TBool Active() const;
+     IMPORT_C inline  RPointerArray<CSenBaseIdentity>& Identites();
+
+    
+
+private:
+
+	/**
+		* Constructor for performing 1st stage construction
+		*/
+	CSenUser(TBool aActive);
+
+	/**
+		* EPOC default constructor for performing 2nd stage construction
+		*/
+	void ConstructL(const TDesC8& aUserName, const TDesC8& aPIN);
+
+
+    RBuf8 iUserName;
+    RBuf8 iPIN;
+    TBool iActive;
+    RPointerArray<CSenBaseIdentity> iBaseIdentities;
+    
+};
+
+#include "senuser.inl"
+
+#endif // SENUSER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/senuser.inl	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef SENUSER_INL
+#define SENUSER_INL
+
+// INCLUDES
+#include "senuser.h"
+
+// CLASS DECLARATION
+
+// -----------------------------------------------------------------------------
+// CSenUser::UserName()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C inline TDesC8& CSenUser::UserName() const
+{
+        return (TDesC8&)iUserName;
+}
+
+// -----------------------------------------------------------------------------
+// CSenUser::PIN()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C inline TDesC8& CSenUser::PIN() const
+{
+        return (TDesC8&)iPIN;
+}
+
+// -----------------------------------------------------------------------------
+// CSenUser::Active()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C inline TBool CSenUser::Active() const
+{
+        return iActive;
+}
+
+
+// -----------------------------------------------------------------------------
+// CSenUser::Identites()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C inline RPointerArray<CSenBaseIdentity>& CSenUser::Identites()
+    {
+    return iBaseIdentities;
+    }
+
+
+	
+#endif // SENUSER_INL
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/inc/senwiseidentityprovider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_WISE_IDENTITY_PROVIDER_H
+#define SEN_WISE_IDENTITY_PROVIDER_H
+
+// INCLUDES
+#include <SenIdentityProvider.h>
+
+// CLASS DECLARATION
+class CSenWiseIdentityProvider : public CSenIdentityProvider
+    {
+    public: // Constructors and destructor
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenWiseIdentityProvider* NewL( TPtrC8 aIMEI,
+                                                        const TDesC8& aEndPoint,
+                                                        const TDesC8& aContract);
+
+        IMPORT_C static CSenWiseIdentityProvider* NewLC(TPtrC8 aIMEI,
+                                                        const TDesC8& aEndPoint,
+                                                        const TDesC8& aContract);
+        /**
+        * Default destructor.
+        */
+        IMPORT_C virtual ~CSenWiseIdentityProvider();
+
+        // New functions
+    
+        /**
+        * A getter.
+        * @return a pointer to authorization id
+        */
+        virtual TPtrC8 AuthzID();
+
+        /**
+        * A getter.
+        * @return a pointer to advisory authentication id
+        */
+        virtual TPtrC8 AdvisoryAuthnID();
+
+        /**
+        * A getter.
+        * @return a pointer to password
+        */
+        virtual TPtrC8 Password();
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenWiseIdentityProvider(   TDescriptionClassType aType,
+                                    TPtrC8 aIMEI);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(const TDesC8& aEndPoint,
+                        const TDesC8& aContract);
+
+    private: // Data
+        TPtrC8 iIMEI;
+    };
+
+#endif // BASE_IDENTITY_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/rom/wsidentitymanager.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSIDENTITYMANAGER_IBY__
+#define __WSIDENTITYMANAGER_IBY__
+
+//IdentityManager
+file=ABI_DIR\BUILD_DIR\SenIdentityManager.dll   PROGRAMS_DIR\SenIdentityManager.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/senbaseidentity.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,989 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlElement.h>
+#include <SenBaseFragment.h>
+#include <SenXmlUtils.h>
+#include <SenServiceConnection.h> // WSF error codes
+
+#include "senbaseidentity.h"
+#include "senwiseidentityprovider.h"
+#include "sendebug.h" // internal Utils\inc - filelogging MACROs
+#ifdef __CRYPTO_HW__
+#include "sencryptoutils.h"
+#include <SecEnv.h>
+#include <SecEnvDevice.h>
+#include <SecEnvType.h>
+#include <SecEnvMgr.h>
+const TInt KCryptoPADataLen     = 16;
+const TInt KCryptoPACipherLen   = 48;
+const TInt KPaCryptAuthLen     = 32;
+const TInt KEncryptNoSalt = 3;
+const TInt KDecrypt       = 2;
+const TUint KPadding = 0;
+const TUint KEncrypedLen = 128;
+_LIT8(KCryptoPA, "PA_CRYPT");
+
+#endif // __CRYPTO_HW__
+
+EXPORT_C CSenBaseIdentity* CSenBaseIdentity::NewL(TPtrC8 aIMEI)
+    {
+    CSenBaseIdentity* pNew = NewLC(aIMEI);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+EXPORT_C CSenBaseIdentity* CSenBaseIdentity::NewLC(TPtrC8 aIMEI)
+    {
+    CSenBaseIdentity* pNew = new (ELeave) CSenBaseIdentity(aIMEI);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+CSenBaseIdentity::CSenBaseIdentity(TPtrC8 aIMEI)
+:   iProvider(NULL),
+    iIMEI(aIMEI)
+    {
+    }
+
+void CSenBaseIdentity::ConstructL()
+    {
+    BaseConstructL( KIdentityElementLocalName() );
+    }
+
+
+CSenIdentityProvider* CSenBaseIdentity::IdentityProviderL(MSenServiceDescription& aService )
+    {
+
+    TInt idpCount(iProviderList.Count());
+
+    CSenIdentityProvider* pIdp = NULL;
+    CSenIdentityProvider* pCandidate = NULL;
+
+    for (TInt i=0; i<idpCount; i++)
+        {
+        pCandidate = (CSenIdentityProvider*)iProviderList[i];
+        if(pCandidate->IsTrustedByL(aService))
+            {
+            pIdp = pCandidate;
+            pCandidate = NULL;
+            }
+        if(pIdp == NULL && pCandidate->IsDefault()) 
+            {
+            pIdp = pCandidate;
+            }
+
+        if(pIdp)
+            {
+            break;
+            }
+        }
+    return pIdp;
+    }
+
+CSenIdentityProvider* CSenBaseIdentity::IdentityProviderL(const TDesC8& aURI )
+    {
+    TInt idpCount(iProviderList.Count());
+    CSenIdentityProvider* retVal = NULL;
+    for (TInt i=0; i<idpCount; i++)
+        {
+            retVal = (CSenIdentityProvider*)iProviderList[i];
+            if (retVal->Endpoint() == aURI)
+                {
+                break;
+                }
+            else
+                {
+                retVal = NULL;
+                }
+        }
+    return retVal;
+    }
+
+CSenIdentityProvider* CSenBaseIdentity::IdentityProviderL(const CDesC8Array& aIdpIdList,
+                                                          TBool aStrict )
+    {
+    TInt idpCount(iProviderList.Count());
+    TInt patternCount(aIdpIdList.Count());
+
+    if(patternCount==0)
+        {
+        if(aStrict)
+            {
+            return NULL;
+            }
+        else
+            {
+            return IdentityProviderL(); // return the default provider
+            }
+        }
+
+    // to optimize the search, store the default idp
+    CSenIdentityProvider* pDefault = NULL;
+
+    for (TInt i=0; i<idpCount; i++)
+        {
+        for(TInt j=0; j<patternCount; j++)
+            {
+            TPtrC8 providerID = ((CSenIdentityProvider*)iProviderList[i])->ProviderID();
+            if(providerID.Length()>0 && providerID == aIdpIdList[j])
+                {
+                return (CSenIdentityProvider*)iProviderList[i];
+                }
+            }
+        if(!aStrict)
+            {
+            // to optimize the search, store the default idp, if found
+            if(((CSenIdentityProvider*)iProviderList[i])->IsDefault())
+                {
+                pDefault = (CSenIdentityProvider*)iProviderList[i];
+                }
+            }
+        }
+    if(aStrict)
+        {
+        // default idp does not meet the search requirements
+        // (not in strict pattern list)
+        return NULL;
+        }
+    else
+        {
+        // if current item did not match with anything in the
+        // pattern list, check if it's ok in non-strict perspective
+        return pDefault;
+        }
+    }
+
+CSenIdentityProvider* CSenBaseIdentity::IdentityProviderL(MSenServiceDescription& aService,
+                                                          const CDesC8Array& aIdpIdList,
+                                                          TBool aStrict)
+    {
+    TInt idpCount(iProviderList.Count());
+    TInt patternCount(aIdpIdList.Count());
+
+    if(patternCount==0)
+        {
+        if(aStrict)
+            {
+            return NULL;
+            }
+        else
+            {
+            return IdentityProviderL(); // return the default provider
+            }
+        }
+
+    // to optimize the search, store the default idp
+    CSenIdentityProvider* pDefault = NULL;
+    CSenIdentityProvider* pTrusted = NULL;
+
+    for (TInt i=0; i<idpCount; i++)
+        {
+        for(TInt j=0; j<patternCount; j++)
+            {
+            TPtrC8 providerID = 
+                ((CSenIdentityProvider*)iProviderList[i])->ProviderID();
+            if(providerID.Length()>0 && providerID == aIdpIdList[j])
+                {
+                if (((CSenIdentityProvider*)iProviderList[i])->IsTrustedByL(aService))
+                    {
+                    return (CSenIdentityProvider*)iProviderList[i];
+                    }
+                }
+            }
+
+        if(!aStrict)
+            {
+            if (!pTrusted)
+                {
+                if (((CSenIdentityProvider*)iProviderList[i])->IsTrustedByL(aService))
+                    {
+                    pTrusted = (CSenIdentityProvider*)iProviderList[i];
+                    }
+                }
+
+            // to optimize the search, store the default IDP, if found
+            if(((CSenIdentityProvider*)iProviderList[i])->IsDefault())
+                {
+                pDefault = (CSenIdentityProvider*)iProviderList[i];
+                }
+            }
+        }
+
+
+    if(aStrict)
+        {
+        // default idp does not meet the search requirements
+        // (not in strict pattern list)
+        return NULL;
+        }
+    else
+        {
+        // if current item did not match with anything in the
+        // pattern list, check if it's ok in non-strict perspective
+        if (pTrusted)
+            {
+            return pTrusted;
+            }
+        else
+            {
+            return pDefault;
+            }
+        }
+    }
+
+CSenIdentityProvider* CSenBaseIdentity::IdentityProviderL()
+    {
+    TInt idpCount(iProviderList.Count());
+
+    CSenIdentityProvider* pDefaultIdp = NULL;
+
+    for (TInt i=0; i<idpCount && !pDefaultIdp; i++)
+        {
+        pDefaultIdp = (CSenIdentityProvider*)iProviderList[i];
+        if (!pDefaultIdp->IsDefault()) pDefaultIdp = NULL;
+        }
+
+    if (!pDefaultIdp && idpCount > 0)
+        {
+        // use the first IdentityProvider
+        pDefaultIdp = (CSenIdentityProvider*)iProviderList[0];
+        }
+
+    return pDefaultIdp;
+    }
+const RIdentityProviderList& CSenBaseIdentity::IdentityProvidersL() const
+    {
+    return iProviderList;
+    }
+
+// NOTE: takes ownership of the given apIdentityProvider
+TInt CSenBaseIdentity::RegisterIdentityProviderL(CSenIdentityProvider* apIdentityProvider )
+    {
+    //SENDEBUG_L("CSenBaseIdentity::RegisterIdentityProviderL(*)");
+
+    if(!apIdentityProvider)
+        {
+        SENDEBUG_L("RegisterIdentityProviderL(*) - Illegal argument: NULL");
+        return KErrArgument;
+        }
+        
+    if (apIdentityProvider->Endpoint() == KNullDesC8)
+        {
+        SENDEBUG_L("RegisterIdentityProviderL(*) - Error: no Endpoint in IDP");
+        //Delete the object since ownership is with us
+        delete apIdentityProvider;		
+        apIdentityProvider = NULL;        
+        return KErrSenNoEndpoint;
+        }
+
+    TInt retVal(KErrNone);
+
+    // Now check for duplicates:
+    CSenIdentityProvider* pDuplicate = NULL;
+
+    retVal = FindMatchingIdentityProviderL(*apIdentityProvider, pDuplicate);
+    if(pDuplicate)
+        {
+        //SENDEBUG((_L("  Duplicate(s) found, updating the IdP!.")));
+        RPointerArray<CSenElement> newElements =
+                            apIdentityProvider->AsElement().ElementsL();
+
+        TInt elemCount = newElements.Count();
+        TInt i(0);
+        // Checking the aIdp elements
+        while ( i < elemCount )
+            {
+            CSenElement* elem = newElements[i];
+            TPtrC8 localName = elem->LocalName();
+
+            RPointerArray<CSenElement> pDuplicateAsElems =
+                                    pDuplicate->AsElement().ElementsL();
+            TInt duplicateCount = pDuplicateAsElems.Count();
+            TBool found = EFalse;
+            TBool foundServiceID = EFalse;
+            TInt j(0);
+
+            // Checking if the duplicate has the element found from aIdp
+            // If found update it, if not found insert new element.
+            while ( j < duplicateCount )
+                {
+                CSenElement* dupElem = pDuplicateAsElems[j];
+                if ( localName == dupElem->LocalName() )
+                    {
+                    if ( localName == KServiceIDElementLocalName )
+                        {
+                        if ( elem->Content() == dupElem->Content() )
+                            {
+                            foundServiceID = ETrue;
+                            }
+                        }
+                    else
+                        {
+                        // note, this create the element if it
+                        // is not found
+                        if (elem->Content() != KNullDesC8)
+                            {
+                            dupElem->SetContentL( elem->Content() );
+                            }
+                        RPointerArray<CSenElement> nestedElems = elem->ElementsL();
+                        for (TInt k = 0; k < nestedElems.Count(); k++)
+                            {
+                            CSenElement* dupNestEl = dupElem->Element(nestedElems[k]->LocalName());
+                            if (dupNestEl)
+                                {
+                                dupNestEl->SetContentL(nestedElems[k]->Content());
+                                }
+                            else
+                                {
+                                CSenElement* newEl = dupElem->CreateElementL(nestedElems[k]->NsPrefix(),
+                                                        nestedElems[k]->LocalName());
+                                CleanupStack::PushL(newEl);
+                                dupElem->AddElementL(*newEl);
+                                CleanupStack::Pop(newEl);
+                                newEl->SetContentL(nestedElems[k]->Content());
+                                }
+                            }
+                        
+                        //cleaning, if sth has been removed on backend
+                        //nested duplicate - local
+                        //nested - backend
+                        RPointerArray<CSenElement> nestedDupElems = dupElem->ElementsL();
+                        for (TInt k = 0; k < nestedDupElems.Count(); k++)
+                            {
+                            CSenElement* nestEl = elem->Element(nestedDupElems[k]->LocalName());
+                            if (!nestEl)
+                                {
+                                nestedDupElems[k]->SetContentL(KNullDesC8);
+                                }
+                            }
+                                                
+                                                
+                        found = ETrue;
+                        break;
+                        }
+                    }
+                j++;
+                }
+            
+            if ( !found && !foundServiceID && elem)
+                {
+                // this is new kind of element, and not in original
+                // idp, thus it needs to be copied because it is 
+                // owned by idp being registered (which will be
+                // deleted inside this method)
+                CSenElement* pCopy = 
+                    CSenXmlElement::NewL( elem->LocalName() ); 
+                CleanupStack::PushL(pCopy);
+                // copy the contents of serviceid 
+                pCopy->CopyFromL(*elem);
+                // append the copy into original idp
+                pDuplicate->AsElement().AddElementL( *pCopy );
+                CleanupStack::Pop(); // pCopy
+                }
+            i++;
+            }
+        // NOTE: ownership of the given argument apIdentityProvider
+        // will NOT be TRANSFERRED to anywhere.
+        // So: free the memory, contents copied and thus updated
+        
+        delete apIdentityProvider;
+        apIdentityProvider = NULL;
+        if(retVal > 0)
+            retVal = KErrNone;
+        }
+    else if(retVal==KErrNotFound)
+        {
+        //SENDEBUG((_L("  No duplicate(s) found, will try to add..")));
+        // Append into both provider list and as child element
+        retVal = iProviderList.Append( apIdentityProvider );
+        if(retVal==KErrNone)
+            {
+            // OWNERSHIP of apIdentityProvider is now here
+            TInt leaveCode(KErrNone);
+            TRAP( leaveCode, AsElement().AddElementL(apIdentityProvider->AsElement() ) );
+            if(leaveCode!=KErrNone)
+                {
+                retVal = leaveCode;
+                // no need to free the apIdentityProvider, it will
+                // be destroyed in destructor as part of iProviderList
+                }                                    
+            }
+        else
+            {
+            // free the orphan apIdentityProvider
+            delete apIdentityProvider;
+            apIdentityProvider = NULL;
+            }
+        }
+    else // some other error occurred: free the orphan argument
+        {
+        //SENDEBUG((_L("An error occured  and no duplicate(s) were found.")));
+        delete apIdentityProvider;
+        apIdentityProvider = NULL;
+        }
+    return retVal;
+    }
+    
+TInt CSenBaseIdentity::UpdateIdentityProviderL(CSenIdentityProvider& aIdentityProvider)
+    {
+    if (aIdentityProvider.Endpoint() == KNullDesC8)
+        {
+        SENDEBUG_L("RegisterIdentityProviderL(*) - Error: no Endpoint in IDP");
+        return KErrSenNoEndpoint;
+        }
+
+    TInt retVal(KErrNone);
+
+    // Now check for duplicates:
+    CSenIdentityProvider* pDuplicate = NULL;
+
+    retVal = FindMatchingIdentityProviderL(aIdentityProvider, pDuplicate);
+    if(pDuplicate)
+        {
+        //SENDEBUG((_L("  Duplicate(s) found, updating the IdP!.")));
+        RPointerArray<CSenElement> newElements =
+                            aIdentityProvider.AsElement().ElementsL();
+
+        TInt elemCount = newElements.Count();
+        TInt i(0);
+        // Checking the aIdp elements
+        while ( i < elemCount )
+            {
+            CSenElement* elem = newElements[i];
+            TPtrC8 localName = elem->LocalName();
+
+            RPointerArray<CSenElement> pDuplicateAsElems =
+                                    pDuplicate->AsElement().ElementsL();
+            TInt duplicateCount = pDuplicateAsElems.Count();
+            TBool found = EFalse;
+            TBool foundServiceID = EFalse;
+            TInt j(0);
+
+            // Checking if the duplicate has the element found from aIdp
+            // If found update it, if not found insert new element.
+            while ( j < duplicateCount )
+                {
+                CSenElement* dupElem = pDuplicateAsElems[j];
+                if ( localName == dupElem->LocalName() )
+                    {
+                    if ( localName == KServiceIDElementLocalName )
+                        {
+                        if ( elem->Content() == dupElem->Content() )
+                            {
+                            foundServiceID = ETrue;
+                            }
+                        }
+                    else
+                        {
+                        // note, this create the element if it
+                        // is not found
+                        dupElem->SetContentL( elem->Content() );
+                        found = ETrue;
+                        break;
+                        }
+                    }
+                j++;
+                }
+            
+            if ( !found && !foundServiceID && elem)
+                {
+                // this is new kind of element, and not in original
+                // idp, thus it needs to be copied because it is 
+                // owned by idp being registered (which will be
+                // deleted inside this method)
+                CSenElement* pCopy = 
+                    CSenXmlElement::NewL( elem->LocalName() ); 
+                CleanupStack::PushL(pCopy);
+                // copy the contents of serviceid 
+                pCopy->CopyFromL(*elem);
+                // append the copy into original idp
+                pDuplicate->AsElement().AddElementL( *pCopy );
+                CleanupStack::Pop(); // pCopy
+                }
+            i++;
+            }
+        if(retVal > 0)
+            retVal = KErrNone;
+        }
+
+    return retVal;    
+    }
+
+// Note: non-strict search is used when unregistering: it must be possible
+// to unregister a provider using only provider Id in cases where someone
+// is unable to update and IDP (because provider id was *already *in use).
+// This "someone", cannot figure out the endpoint -> so, only way to unregister
+// blocking IDP is to call unregister(ProviderID) and then register the IDP
+// using different ProviderID & endpoint pair.
+
+// more about this "non strict" search used by unregistering: to get a MATCH
+// usingof plain endpoint must be accepted ONLY if providerid was NOT in use
+// with basic web services.
+//
+
+// FOR ID-WSF framework, mainly
+TInt CSenBaseIdentity::FindMatchingIdentityProviderL(CSenIdentityProvider& aIdp,
+                                                     CSenIdentityProvider*& apMatch)
+    {
+    //SENDEBUG((
+    //  _L("CSenBaseIdentity::FindMatchingIdentityProviderL() - Started ")));
+
+    TInt retVal(KErrNotFound);
+
+    TInt idpCount(iProviderList.Count());
+    apMatch = NULL;
+
+    for (TInt i=0; i<idpCount; i++)
+        {
+        TPtrC8 databaseProvID = 
+            ((CSenIdentityProvider*)iProviderList[i])->ProviderID();
+
+        TPtrC8 databaseEndpoint = 
+            ((CSenIdentityProvider*)iProviderList[i])->Endpoint();
+
+        
+
+        TPtrC8 addedProvID = aIdp.ProviderID();
+        TPtrC8 addedEndpoint = aIdp.Endpoint();
+
+        if(databaseProvID==KNullDesC8)
+            {
+            //  This is Basic Web Services IDP and only endpoint matters 
+            if( databaseEndpoint == addedEndpoint )
+                {
+                retVal = i; // match was found: return the index of found element
+                apMatch = iProviderList[i];
+                }
+            }
+        else if(databaseProvID == addedProvID) 
+            {
+             // This is an ID-WSF IDP, where providerIDs match
+
+            // We might have a match for non-strict ("provider id only" -type  search). 
+            // Now we must check that there was
+            if( databaseEndpoint == addedEndpoint )
+                {
+                apMatch = (CSenIdentityProvider*)iProviderList[i];
+                retVal = i; // match was found: return the index of found IDP
+                }
+            else
+                {
+                // we need to return an error code indicating that provider id
+                // is already mapped to different endpoint(!)
+                retVal = KErrSenProviderIdInUseByAnotherEndpoint;
+                }
+            }
+        }
+    return retVal;
+    }
+
+
+TInt CSenBaseIdentity::UnregisterIdentityProviderL(CSenIdentityProvider& aIdp )
+    {
+    TInt retVal(KErrNotFound);
+
+    CSenIdentityProvider* pMatch = NULL;
+    TInt index = FindMatchingIdentityProviderL(aIdp, pMatch);
+
+    if ( index==KErrNotFound ||
+         (aIdp.Endpoint()==KNullDesC8 &&
+            index==KErrSenProviderIdInUseByAnotherEndpoint)
+       )
+        {
+        // we need to make it possible to unregister an IDP using
+        // plain provider ID
+        TPtrC8 providerId = aIdp.ProviderID();
+        index = IdentityProviderNamed( providerId, pMatch );
+        }
+
+    //  index is either >= 0, OR: if nothing was removed,
+    // return KErrNotFound OR: provider id used by
+    // another endpoint (new error code)
+    if(index>=0 && pMatch)
+        {
+        // remove the match from database list, which allows us to
+        // delete the IdP from memory.
+        iProviderList.Remove(index);
+        TRAP( retVal, AsElement().RemoveElement(pMatch->AsElement()); ) 
+        delete pMatch;
+        retVal = KErrNone;
+        }
+
+    return retVal; // if nothing was removed, this will return KErrNotFound
+    }
+
+TBool CSenBaseIdentity::AssociateServiceL(const TDesC8& aServiceID,
+                                          const TDesC8& aProviderID)
+    {
+    TBool ret = EFalse;
+    CSenIdentityProvider* prov = IdentityProviderNamed( aProviderID );
+    if ( prov != NULL )
+        {
+        if ( !prov->IsTrustedByL( aServiceID ))
+            {
+            CSenElement& service =
+                prov->AsElement().AddElementL(KServiceIDElementLocalName);
+
+            service.SetContentL( aServiceID );
+            }
+        ret = ETrue;
+        }
+    return ret;
+    }
+
+TBool CSenBaseIdentity::DissociateServiceL(const TDesC8& aServiceID,
+                                           const TDesC8& aProviderID)
+    {
+    TBool ret = EFalse;
+    CSenIdentityProvider* prov = IdentityProviderNamed( aProviderID );
+    if ( prov != NULL )
+        {
+        if ( prov->IsTrustedByL( aServiceID ))
+            {
+            RPointerArray<CSenElement> services =
+                                    prov->AsElement().ElementsL();
+            TInt serviceCount = services.Count();
+            TInt i(0);
+            while (i < serviceCount)
+                {
+                if (services[i]->LocalName() == KServiceIDElementLocalName)
+                    {
+                    CSenElement* elem = services[i];
+                    if ( elem->Content() == aServiceID)
+                        {
+                        TInt retVal;
+                        TRAP(retVal, prov->AsElement().RemoveElement(*elem));
+                        if (retVal == KErrNone )
+                            {
+                            if ( elem )
+                                {
+                                delete elem;
+                                }
+                            ret = ETrue;
+                            }
+                        else
+                            {
+                            ret = EFalse;
+                            }
+                        break;
+                        }
+                    }
+                i++;
+                }
+            }
+        }
+    return ret;
+    }
+
+void CSenBaseIdentity::StartElementL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttributes)
+    {
+    if (aLocalName == KSenIdpLocalname)
+        {
+        // create CSenWiseIdentityProvider
+        iProvider =
+            CSenWiseIdentityProvider::NewL(iIMEI, KNullDesC8, KNullDesC8);
+
+        iProvider->SetOwner(*this);
+        iProvider->SetAttributesL(aAttributes);
+        iProvider->SetReader(*Reader());
+        DelegateParsingL(*iProvider);
+        }
+    else
+        {
+        DelegateParsingL(aNsUri, aLocalName, aQName, aAttributes);
+        }
+    }
+
+
+void CSenBaseIdentity::EndElementL(const TDesC8& aNsUri,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName)
+    {
+    if(aLocalName == KSenIdpLocalname)
+        {
+        if(iProvider)
+            {
+#ifdef __CRYPTO_HW__
+            TBuf8<KEncrypedLen> decPwd;
+            TInt leaveCode(KErrNone); 
+            TRAP(leaveCode, DecryptPasswordL(iProvider->Password(), decPwd));
+                if (leaveCode == KErrNone)
+                    {
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Identity ::DecryptPasswordL success")));
+                    }
+                else
+                    {
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Identity ::DecryptPasswordL Failed")));
+                    }
+            iProvider->SetUserInfoL(iProvider->UserName(),iProvider->UserName(), decPwd);
+			
+#endif // __CRYPTO_HW__
+            RegisterIdentityProviderL(iProvider);
+            iProvider=NULL;
+            }
+        }
+    else
+        {
+        CSenBaseFragment::EndElementL(aNsUri,aLocalName,aQName);
+        }
+    }
+
+const TDesC8& CSenBaseIdentity::Type()
+    {
+    return KNullDesC8;
+    }
+
+const TDesC8& CSenBaseIdentity::Name()
+    {
+    return KNullDesC8;
+    }
+
+const TDesC8& CSenBaseIdentity::UserName()
+    {
+    return KNullDesC8;
+    }
+
+
+HBufC8* CSenBaseIdentity::AsXmlL()
+    {
+    return this->AsElement().AsXmlL();
+    }
+
+HBufC* CSenBaseIdentity::AsXmlUnicodeL()
+    {
+    return this->AsElement().AsXmlUnicodeL();
+    }
+
+void CSenBaseIdentity::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+#ifdef __CRYPTO_HW__	
+    TInt idpCount(iProviderList.Count());
+    
+    RArray<RBuf8 *> password;
+    for(TInt i=0; i<idpCount; i++)
+        {
+        CSenIdentityProvider* idp = (CSenIdentityProvider*)iProviderList[i];
+        
+        TBuf8<KEncrypedLen> encPwd;
+        TInt leaveCode(KErrNone);            
+        //EncryptPasswordL(idp->Password(), encPwd);
+        TRAP(leaveCode, EncryptPasswordL(idp->Password(), encPwd));
+    if (leaveCode == KErrNone)
+        {
+        
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Identity ::EncryptPasswordL success")));
+        }
+    else
+        {
+        
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Identity ::EncryptPasswordL Failed")));
+        }
+        RBuf8 *tempPass = new RBuf8;
+        tempPass->Create(idp->Password());
+        password.Append(tempPass); 
+        idp->SetUserInfoL(idp->UserName(),idp->UserName(),encPwd);
+        }
+#endif // __CRYPTO_HW__
+    this->AsElement().WriteAsXMLToL(aWriteStream);
+#ifdef __CRYPTO_HW__
+    for(TInt i=0; i<idpCount; i++)
+        {
+        CSenIdentityProvider* idp = (CSenIdentityProvider*)iProviderList[i];
+        idp->SetUserInfoL(idp->UserName(),idp->UserName(),*password[i]);
+        password[i]->Close();
+        delete password[i];
+        }
+#endif // __CRYPTO_HW__		
+    }
+
+EXPORT_C CSenBaseIdentity::~CSenBaseIdentity()
+    {
+    if(iProvider)
+        {
+        CSenElement* removed =
+            CSenBaseIdentity::AsElement().RemoveElement(iProvider->AsElement());
+        // prevend impossible "duplicate delete"
+        if(removed)
+            {
+            delete iProvider; // a leave occured between
+                              // StartElementL and EndElementL...
+            }
+        iProvider = NULL; // to prevent accidental duplicate delete
+        }
+
+    TInt idpCount(iProviderList.Count());
+    for(TInt i=idpCount-1; i>=0; i--)
+        {
+        CSenElement* removed =
+            CSenBaseIdentity::AsElement().RemoveElement(
+                ((CSenIdentityProvider*)iProviderList[i])->AsElement());
+        // prevend impossible "duplicate delete"
+        if(removed)
+            {
+            delete iProviderList[i];
+            iProviderList.Remove(i);    // 6.11.2004
+            }
+        }
+        
+    iProviderList.ResetAndDestroy(); 
+    }
+
+CSenIdentityProvider* CSenBaseIdentity::IdentityProviderNamed(const TDesC8& aProviderId)
+    {
+    CSenIdentityProvider* pMatch = NULL;
+    IdentityProviderNamed( aProviderId, pMatch );
+    return pMatch;
+    }
+
+TInt CSenBaseIdentity::IdentityProviderNamed( const TDesC8& aProviderID,
+                                              CSenIdentityProvider*&  apMatch)
+    {
+    TInt idpCount(iProviderList.Count());
+    TInt retVal(KErrNotFound); // index, or an error
+    apMatch = NULL;
+    for(TInt i=0; i<idpCount; i++)
+        {
+        TPtrC8 providerId = 
+            ((CSenIdentityProvider*)iProviderList[i])->ProviderID();
+        if(providerId.Length()>0 && providerId == aProviderID)
+            {
+            retVal = i; // store the index
+            apMatch = (CSenIdentityProvider*)iProviderList[i]; // found a match
+            break;
+            }
+        }
+    return retVal;
+    }
+
+TInt CSenBaseIdentity::ContainsIdentityProviderL(TBool& aContains,
+                                                 CSenIdentityProvider& aIDP)
+    {
+    aContains = EFalse;
+    TInt idpCount(iProviderList.Count());
+    
+    for(TInt i=0; i<idpCount; i++)
+        {
+            if (iProviderList[i]->ConsistsOfL(aIDP)
+                )
+                {
+                aContains = ETrue;
+                break;  // No need to loop the rest of the providers, we are
+                        // happy with the first hit
+                }
+        }
+    return KErrNone;
+    }
+#ifdef __CRYPTO_HW__    
+void CSenBaseIdentity::EncryptPasswordL(const TDesC8& aData, TDes8& aCipherText)
+    {
+#ifndef __WINSCW__
+		  TUint cipherLen;
+		  TBuf8<KEncrypedLen> temp;
+		  
+		  // add padding if length is  less than 16
+		if (aData.Length() < KCryptoPADataLen) 
+			  {
+			  const TInt remainder = aData.Length() % KCryptoPADataLen;
+			  temp.Copy(aData);
+			  temp.AppendFill( KPadding, KCryptoPADataLen - remainder );
+			  cipherLen = temp.Length() + KPaCryptAuthLen ;
+			  aCipherText.SetLength(cipherLen);
+			  }
+		else
+			  {
+			  temp.Copy(aData);
+			  cipherLen = aData.Length() + KPaCryptAuthLen ;
+			  aCipherText.SetLength(cipherLen);
+			  }
+		    
+	    	TBuf8<20> paId;
+		    paId.Copy(KCryptoPA);
+		   
+		    CSecEnv* secEnv = CSecEnv::NewL();
+		    TInt err = secEnv->ProtectedApplicationExecute(paId, (TAny*)temp.Ptr(), temp.Length(), 
+		                                                     (TAny*)aCipherText.Ptr(), cipherLen, KEncryptNoSalt); 
+		    delete secEnv;
+	    
+	    // Encode data into Base64 format
+	    	HBufC8 *b64encPwd = SenCryptoUtils::EncodeBase64L(aCipherText);
+    	if(b64encPwd)
+	      {
+	      aCipherText = (*b64encPwd);
+	      delete b64encPwd;
+	      }
+	    	
+	          
+#else
+
+aCipherText = aData;
+//return KErrNotSupported;
+#endif
+    
+    }
+
+void CSenBaseIdentity::DecryptPasswordL(const TDesC8& aCipherText, TDes8& aData)
+    {
+#ifndef __WINSCW__    	
+    TUint dataLen = aCipherText.Length() - KPaCryptAuthLen ;
+    aData.SetLength(dataLen);
+    TBuf8<20> paId;
+    paId.Copy(KCryptoPA);
+   // Decode data from Base64 format
+    HBufC8 *b64decPwd = SenCryptoUtils::DecodeBase64L(aCipherText);
+    	TDesC8 aTmpTxt= (*b64decPwd);
+    // Decrypt using PA	
+    CSecEnv* secEnv = CSecEnv::NewL();
+    TInt err = secEnv->ProtectedApplicationExecute(paId, (TAny*)aTmpTxt.Ptr(), aTmpTxt.Length(), 
+                                                     (TAny*)aData.Ptr(), dataLen, KDecrypt);
+    // remove padding
+    if (aData.Length() == KCryptoPADataLen)
+        {
+        RBuf8 decPwd;
+        decPwd.Create(KCryptoPADataLen);
+        decPwd.Copy(aData);
+        TInt pos = decPwd.Locate(KPadding);
+        if(pos != KErrNotFound)
+          {
+          decPwd.SetLength(pos);
+          aData.SetLength(decPwd.Length());
+          aData = decPwd;
+          }
+        decPwd.Close();
+        }
+    delete secEnv;                                                  
+		if(b64decPwd)
+				{
+				delete b64decPwd;
+				}
+#else
+
+aData = aCipherText ;
+//return KErrNotSupported;
+#endif    
+}    
+#endif // __CRYPTO_HW__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/senbaseidentitymanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,945 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32mem.h>
+#include <s32file.h>
+#include <sysutil.h>
+
+#include <SenBaseFragment.h>
+#include <SenXmlUtils.h>
+
+#include "msenidentitymanager.h"
+#include "msenidentity.h"
+#include "senbaseidentitymanager.h"
+#include "sensecuritymechanismobserver.h"
+#include "senlogger.h"
+#include "sensecuritymechanism.h"  // internal  Framework\inc - ECOM interface
+
+#include "senservicemanagerdefines.h" // KMaxTicks (1209600000)
+                                      // 1 tick = 1 millisec
+                                      // 86400 sec = 1 day
+                                      // 86400*1000 millisec = 1 day
+                                      // 86400*14*1000 = 1209600000 millisec = 2 weeks
+
+#include "sendebug.h" // internal Utils\inc - filelogging MACROs
+#include "sennotplugindlg.h" // internal NotifierPlugin\inc, KSenNotifierPluginUID
+
+#include "senserviceinvocationframework.h"  // internal Framework\inc (framework event codes)
+
+#ifndef __WINS__ // only required in release builds
+// For reading IMEI. NOTE: not found from Series 60 2.1 public SDK
+//Since plpvariant.h is depricated in TB9.2 from wk48 2009 on words.
+//provided alternative solution  
+//#include <plpvariant.h>
+#endif
+#include<SenBaseAttribute.h>
+
+namespace
+    {
+    //_LIT8(KSenBaseIdentityManagerPanic, "SenBaseIdentityManager");
+
+#if !defined( EKA2 ) && !defined( RD_SECURE_PRIV_DATA )
+    _LIT(KIdentityFile, "C:\\system\\data\\senidentities.xml");
+#else
+    _LIT(KIdentityFile, "senidentities.xml");
+#endif
+
+    _LIT8(KSpace, " ");
+    _LIT8(KUserName, "User");
+    _LIT8(KUsersStart, "<Users><User>");
+    _LIT8(KUsersEnd, "</User></Users>");
+    _LIT8(KIdentityProvider, "IdentityProvider");
+    _LIT8(KTouch, "touch");
+
+    const TInt KFLATBUF_SIZE = 128;
+    }
+
+
+EXPORT_C CSenBaseIdentityManager* CSenBaseIdentityManager::NewL(
+                                            MSenCoreServiceManager& aManager)
+    {
+    CSenBaseIdentityManager* pNew = NewLC(aManager);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenBaseIdentityManager* CSenBaseIdentityManager::NewLC(
+                                            MSenCoreServiceManager& aManager)
+    {
+    CSenBaseIdentityManager* pNew =
+                        new (ELeave) CSenBaseIdentityManager(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenBaseIdentityManager::CSenBaseIdentityManager(
+                                            MSenCoreServiceManager& aManager)
+:   iIdentity(NULL),
+    iProvider(NULL),
+    iManager(aManager),
+    iConfigReadonly(EFalse),
+    iLog((RFileLogger*)aManager.Log()),
+    iObserver(NULL),
+    ipMechanicsNames(NULL),
+    ipDeviceID(NULL),
+    iShowPasswordDialog(EFalse)
+    {
+    }
+
+EXPORT_C CSenBaseIdentityManager::~CSenBaseIdentityManager()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBaseIdentityManager::~CSenBaseIdentityManager");        
+    iEcomInfoArray.ResetAndDestroy();
+    iSechMechNames.ResetAndDestroy();
+    iSechMechCues.ResetAndDestroy();
+    delete ipMechanicsNames;
+    delete iObserver;
+    
+    delete iProvider;
+    delete ipDeviceID;
+    }
+
+
+void CSenBaseIdentityManager::ConstructL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBaseIdentityManager::ConstructL - Version 2 [2006-05-09]");        
+    BaseConstructL(KIdentityElementLocalName);
+
+
+    delete ipDeviceID;
+    ipDeviceID=NULL;
+
+    #ifndef __WINS__
+	//Since plpvariant.h is depricated in TB9.2 from wk48 2009 on words.
+	//provided alternative solution  
+    /*
+    // This only works on target machine
+    TPlpVariantMachineId imei;
+    PlpVariant::GetMachineIdL(imei);
+
+
+    ipDeviceID = SenXmlUtils::ToUtf8LC(imei);
+    CleanupStack::Pop(); // ipDeviceID
+	*/
+	TPtrC8 imei ;
+	imei.Set(iManager.IMEI());
+	ipDeviceID = imei.AllocL();
+		
+    #else
+    // Return a fake IMEI when working on emulator
+    _LIT8(KEmulatorImei, "012345678901234");
+    ipDeviceID = KEmulatorImei().AllocL();
+    #endif
+
+    // Device ID is now resolved, fake or not
+    TPtr8 imeiTPtr = ipDeviceID->Des();
+    iIdentity = CSenBaseIdentity::NewL(imeiTPtr);
+
+    HBufC* file = KIdentityFile().AllocL();
+    CleanupStack::PushL(file);
+    LoadFromL(*file, *iManager.XMLReader());
+
+    // ValidateDefaultIdentity()
+    ReloadSenSecurityMechanismsL();
+    iObserver = CSenSenSecurityMechanismObserver::NewL(*this);
+    iObserver->Start();
+    CleanupStack::PopAndDestroy(); // file
+    }
+
+RFileLogger* CSenBaseIdentityManager::Log()
+    {
+    return iLog;
+    }
+
+void CSenBaseIdentityManager::LoadFromL(TDesC& aFile,
+                                                 CSenXmlReader& aReader)
+    {
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+    
+    aReader.SetContentHandler(*this);
+    SetReader(aReader);
+
+    TInt leaveCode(KErrNone);
+
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+    TBuf<KMaxPath> file;
+    fss.CreatePrivatePath(EDriveC);
+    fss.PrivatePath(file);
+    file.Append(aFile);
+    TRAP(leaveCode, aReader.ParseL(fss, file));
+#else
+    TRAP(leaveCode, aReader.ParseL(fss, aFile));
+#endif
+
+#ifdef _SENDEBUG
+    if(leaveCode == KErrNotFound)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- The senidentities.xml does not exist!");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- New file will be generated.");
+        }
+    else if(leaveCode != KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Parsing of senidentities.xml leaved: %d"), leaveCode));
+        }   
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Identity database (senidentities.xml) successfully read.");
+        }
+#else
+    leaveCode=0; // this is a decision: we are not interested 
+                 // of invalid input in read/parse phase
+#endif
+
+    WriteDatabase(); // Always validate by saving
+
+    CleanupStack::PopAndDestroy(); // fss
+    }
+
+EXPORT_C TInt CSenBaseIdentityManager::WriteDatabase()
+    {
+    TInt retVal(KErrNone);
+    TRAP(retVal, WriteConfigurationToL(KIdentityFile));
+
+    return retVal;
+    }
+
+void CSenBaseIdentityManager::StartElementL(
+                                          const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName,
+                                          const RAttributeArray& aAttributes
+                                                  )
+    {
+    if (aLocalName ==  KIdentityElementLocalName)
+        {
+        delete iIdentity;   // there can be only one at the moment
+        iIdentity = NULL;
+        TPtr8 imei = ipDeviceID->Des();
+        iIdentity = CSenBaseIdentity::NewL(imei);
+        iIdentity->SetAttributesL(aAttributes);
+        iIdentity->SetReader(*Reader());
+        DelegateParsingL(*iIdentity);
+        }
+//  else if (aLocalName == KUsers)
+//      {
+//      }
+    else
+        {
+        CSenBaseFragment::StartElementL(aNsUri, 
+                                    aLocalName, aQName, aAttributes);
+        }
+    }
+
+MSenIdentity& CSenBaseIdentityManager::IdentityL()
+    {
+    return (MSenIdentity&)*iIdentity;
+    }
+
+TInt CSenBaseIdentityManager::UserNameL(HBufC8*& aUserName)
+    {
+    delete aUserName;
+    aUserName = NULL;
+    aUserName = KUserName().AllocL();
+    return KErrNone;
+    }
+
+CSenIdentityProvider* CSenBaseIdentityManager::IdentityProviderL()
+    {
+    return IdentityL().IdentityProviderL();
+    }
+const RPointerArray<CSenIdentityProvider>& CSenBaseIdentityManager::IdentityProvidersL()
+    {
+    return IdentityL().IdentityProvidersL();
+    }
+
+CSenIdentityProvider* CSenBaseIdentityManager::IdentityProviderL(
+                            MSenServiceDescription& aServiceDescription )
+    {
+    return IdentityL().IdentityProviderL( aServiceDescription );
+    }
+
+CSenIdentityProvider* CSenBaseIdentityManager::IdentityProviderL(
+                                                        const TDesC8& aURI )
+    {
+    return IdentityL().IdentityProviderL(aURI);
+    }
+
+CSenIdentityProvider* CSenBaseIdentityManager::IdentityProviderL(
+                                                const CDesC8Array& aIdpList,
+                                                TBool aStrict)
+    {
+    return IdentityL().IdentityProviderL(aIdpList,aStrict);
+    }
+
+CSenIdentityProvider* CSenBaseIdentityManager::IdentityProviderL(
+                                MSenServiceDescription& aServiceDescription,
+                                const CDesC8Array& aIdpList,
+                                TBool aStrict)
+    {
+    return IdentityL().IdentityProviderL(aServiceDescription,aIdpList,aStrict);
+    }
+
+
+
+// Takes ownership of given IdentityProvider(!)
+TInt CSenBaseIdentityManager::RegisterIdentityProviderL( CSenIdentityProvider* apIdp )
+    {
+    if(!apIdp)
+        {
+        return KErrArgument; // NULL given!
+        }
+
+    CleanupStack::PushL(apIdp);
+
+    // try to register into default identity
+    // null check done, above
+    TInt retVal = IdentityL().RegisterIdentityProviderL(apIdp);
+    CleanupStack::Pop(); // apIdp, ownership elsewhere
+
+    // check success:
+    if ( retVal == KErrNone)
+        {
+        // ownership taken, pop from stack:
+        // try to serialize owned object
+        TInt notifyLeaveCode(KErrNone);
+        TRAP(notifyLeaveCode, iManager.NotifyFrameworksL(KSenEventRegisterIdentityProvider, apIdp));
+        if ( WriteDatabase() != KErrNone)
+            {
+            retVal = KErrWrite;
+            }
+        }
+    return retVal;
+    }
+
+TInt CSenBaseIdentityManager::UnregisterIdentityProviderL( CSenIdentityProvider& aIdp )
+    {
+    TInt retVal = IdentityL().UnregisterIdentityProviderL( aIdp );
+
+    if ( retVal == KErrNone )
+        {
+        TInt notifyLeaveCode(KErrNone);
+        TRAP(notifyLeaveCode, iManager.NotifyFrameworksL(KSenEventUnregisterIdentityProvider, &aIdp));
+        
+        
+//      if (KErrNone != WriteDatabase() )
+//          {
+//          retVal = EFalse;
+//          }
+
+        retVal = WriteDatabase();
+        }
+    return retVal;
+    }
+
+TBool CSenBaseIdentityManager::AssociateServiceL( const TDesC8& aServiceID,
+                                                  const TDesC8& aProviderID )
+    {
+    TBool retVal = IdentityL().AssociateServiceL(aServiceID, aProviderID);
+    if (retVal)
+        {
+        if (KErrNone != WriteDatabase())
+            {
+            retVal = EFalse;
+            }
+        }
+    return retVal;
+    }
+
+TBool CSenBaseIdentityManager::DissociateServiceL(
+                                                   const TDesC8& aServiceID,
+                                                   const TDesC8& aProviderID )
+    {
+    TBool retVal = IdentityL().DissociateServiceL(aServiceID, aProviderID);
+    if (retVal)
+        {
+        if (KErrNone != WriteDatabase())
+            {
+            retVal = EFalse;
+            }
+        }
+    return retVal;
+    }
+
+TInt CSenBaseIdentityManager::IdentitiesL(
+                                            CDesC8Array& /* aIdentitiesList */)
+    {
+    return KErrNotSupported; // not yet supported.
+    }
+
+
+// NOTE! This code does not do as documentation states.
+// Only second line text is shown and
+// "Ok" button on the left side.
+// return the value of button pressed (OK or CANCEL)
+TInt CSenBaseIdentityManager::YesNoQueryL(const TDesC& aLine1,
+                                          const TDesC& aLine2,
+                                          const TDesC& aButton1,
+                                          const TDesC& aButton2)
+    {
+    RNotifier notifier;
+    User::LeaveIfError(notifier.Connect());
+    CleanupClosePushL(notifier);
+
+    TRequestStatus status;
+    TInt buttonVal = -1;
+
+
+    // NOTE! This code does not do as documentation states.
+    // Only second line text is shown and
+    // "Ok" button on the left side.
+
+//    notifier.Notify(_L("Line 1 text"), _L("Line2 text"),
+//        _L("B1Txt"), _L("B2Txt"), buttonVal, status);
+
+    notifier.Notify(aLine1,
+                    aLine2,
+                    aButton1,
+                    aButton2,
+                    buttonVal,
+                    status);
+
+
+    User::WaitForRequest(status);
+    CleanupStack::PopAndDestroy(); // Close notifier
+
+#ifdef _SENDEBUG
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("User pressed button (%d)"), buttonVal));
+#endif
+
+    return buttonVal;
+    }
+
+TBool CSenBaseIdentityManager::AllowSavePasswordL()
+    {
+    TBool retVal = EFalse;
+
+    RNotifier notifier;
+    User::LeaveIfError(notifier.Connect());
+    CleanupClosePushL(notifier);
+
+    TPckgBuf<TAskSaveDlgRequest>* request = new(ELeave)TPckgBuf<TAskSaveDlgRequest>();
+    CleanupStack::PushL(request);
+
+    TPckgBuf<TAskSaveDlgResponse>* response = new(ELeave)TPckgBuf<TAskSaveDlgResponse>();
+    CleanupStack::PushL(response);
+
+    TRequestStatus reqStatus;
+    notifier.StartNotifierAndGetResponse(reqStatus, KSenNotifierPluginUID, *request, *response);
+
+    User::WaitForRequest(reqStatus);
+    notifier.Close();
+
+    if(reqStatus.Int() == KErrNone)
+        {
+        if((*response)().OkButtonPressed())
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("User pressed OK Button to allow password saving")));
+            retVal = ETrue;
+            }
+#ifdef _SENDEBUG
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("User pressed Cancel Button to deny password saving")));
+            }
+#endif
+        }
+#ifdef _SENDEBUG
+    else if(reqStatus.Int() == KErrNotFound)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Notifier plug-in for 'Save WS data?' -dialog was not found")));
+        }
+    else
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("'Save WS data?' -dialog returned an error: %d"), 
+                                                        reqStatus.Int()));
+        }
+#endif
+
+    CleanupStack::PopAndDestroy(2); // request, response;
+    //CleanupStack::PopAndDestroy(); // close the notifier
+    CleanupStack::Pop(); // notifier
+    return retVal;
+    }
+
+TInt CSenBaseIdentityManager::AuthenticationForL(
+                            CSenIdentityProvider& aProvider, 
+                            TPckgBuf<TSenAuthentication>& aResponse)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBaseIdentityManager::AuthenticationForL");
+
+    TPtrC8 user = aProvider.AuthzID();
+    if (user == KNullDesC8)
+        {
+        user.Set(aProvider.AdvisoryAuthnID());
+        }
+
+
+    if (!iShowPasswordDialog)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Not allowed to show password dialog");
+        HBufC8* pDecodedPassword = SenXmlUtils::DecodeHttpCharactersLC(aProvider.Password());
+        TPtrC8 decodedPassword = pDecodedPassword->Des();
+
+        aResponse().iUsername.Append((const TUint8*)user.Ptr(), user.Size());
+        aResponse().iPassword.Append((const TUint8*)decodedPassword.Ptr(), 
+                                        decodedPassword.Size());
+        CleanupStack::PopAndDestroy(); // delete pDecodedPassword
+        return KErrNone;
+        }
+
+
+    RNotifier notifier;
+    User::LeaveIfError(notifier.Connect());
+    CleanupClosePushL(notifier);
+
+    TPckgBuf<TAuthenticationDlgRequest>* request = 
+                            new(ELeave)TPckgBuf<TAuthenticationDlgRequest>();
+    CleanupStack::PushL(request);
+
+    // convert username to unicode
+    HBufC* pUserAsUnicode = SenXmlUtils::ToUnicodeLC(user); // push
+    TPtrC username = pUserAsUnicode->Des();
+
+    // decode password
+    HBufC8* pDecodedPassword = SenXmlUtils::DecodeHttpCharactersLC(aProvider.Password());
+    TPtrC8 decodedPassword = pDecodedPassword->Des();
+    // convert decoded password to unicode
+    HBufC* pPasswordAsUnicode = 
+                SenXmlUtils::ToUnicodeLC(decodedPassword); // push
+    TPtrC password = pPasswordAsUnicode->Des();
+
+    // set data to request
+    (*request)().SetData(username, password);
+
+    CleanupStack::PopAndDestroy(3); // delete pPasswordAsUnicode, pDecodedPassword, pUserAsUnicode
+
+
+    TPckgBuf<TAuthenticationDlgResponse>* response = 
+                        new(ELeave)TPckgBuf<TAuthenticationDlgResponse>();
+    CleanupStack::PushL(response);
+
+    TRequestStatus reqStatus;
+    notifier.StartNotifierAndGetResponse(reqStatus, 
+                            KSenNotifierPluginUID, *request, *response);
+
+    TBool illegalUsername = EFalse;
+
+    HBufC8* pUsernameUtf8 = NULL;
+    HBufC8* pPasswordUtf8 = NULL;
+    User::WaitForRequest(reqStatus);
+
+    notifier.Close();
+
+    if(reqStatus.Int() == KErrNone)
+        {
+        if((*response)().OkButtonPressed())
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("User pressed OK Button in Password dialog")));
+            pUsernameUtf8 = SenXmlUtils::ToUtf8LC((*response)().Username());
+            pPasswordUtf8 = SenXmlUtils::ToUtf8LC((*response)().Password());
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Username: %S"), pUsernameUtf8));
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Password: %S"), pPasswordUtf8 ));
+            HBufC8* pEncodedUsername = NULL;
+            illegalUsername = 
+                SenXmlUtils::EncodeHttpCharactersL(*pUsernameUtf8,
+                                                    pEncodedUsername);
+            if (illegalUsername) 
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Username included illegal characters.")));
+                delete pEncodedUsername;
+                pEncodedUsername = NULL;
+                }
+#ifdef _SENDEBUG
+            else
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Username did NOT include illegal characters.");
+                }
+#endif
+       		
+       		//Check if iilegal chars are there then return
+            if (!illegalUsername)
+                {
+                
+                if(user != *pUsernameUtf8)
+                {
+                	
+	                // User modified the username in the dialog prompt(!)
+	                // We have to save it right away, because there is
+	                // no in-memory/session based member variables in
+	                // components calling identity manager (sec mechs and
+	                // in ID-WSF AS client!
+	                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Username changed. Saving new username.");
+
+	                // Use Advisory only if AuthzID is not available
+	                if (aProvider.AuthzID() == KNullDesC8 
+	                    && aProvider.AdvisoryAuthnID() != KNullDesC8)
+	                    {
+	                    aProvider.SetUserInfoL(aProvider.AuthzID(),
+	                                            *pUsernameUtf8, 
+	                                            aProvider.Password());
+	                    }
+	                else 
+	                    {
+	                    // There was at least AuthzID available, and possibly
+	                    // also advisory value. Any way, if 
+
+	                    
+	                    // We have to NULL advisory value (set it to KNullDesC8), 
+	                    // because if both were available, then user was
+	                    // prompted to allow modification of AuthzID AND 
+	                    // if advisory was changed in service (is no longer
+	                    // valid), there would NOT be any way for end-user
+	                    // to change (remove) it(!)
+
+	                    CSenElement& element = aProvider.AsElement();
+	                    delete element.RemoveElement(KSenIdpAdvisoryAuthnIdLocalname);
+
+	                    aProvider.SetUserInfoL(*pUsernameUtf8, 
+	                                            KNullDesC8,
+	                                            aProvider.Password());
+	                    }
+	                // serialize changed username into sensessions.xml database immediately
+	                WriteDatabase();
+                }
+                
+	            if (AllowSavePasswordL())
+	                {
+	                HBufC8* pEncodedPassword = SenXmlUtils::EncodeHttpCharactersLC(*pPasswordUtf8);
+#ifdef _SENDEBUG
+                if(pEncodedPassword)
+                    {
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("Encoded password: %S"), pEncodedPassword));
+                    }
+#endif
+					if(pEncodedPassword)
+						{
+							aProvider.SetUserInfoL(aProvider.AuthzID(),
+	                                        aProvider.AdvisoryAuthnID(),
+	                                        *pEncodedPassword);
+						}
+	                WriteDatabase();
+	                CleanupStack::PopAndDestroy(1); // pEncodedPassword
+	                }
+                
+                }
+
+            aResponse().iUsername.Zero();
+            aResponse().iPassword.Zero();
+            if (!illegalUsername) 
+            {
+	            aResponse().iUsername.Copy(pUsernameUtf8->Des());
+	            aResponse().iPassword.Copy(pPasswordUtf8->Des());
+            }
+
+            CleanupStack::PopAndDestroy(2); // pPasswordUtf8, pUsernameUtf8
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("User pressed Cancel Button in Password dialog")));
+            }
+        }
+    else if(reqStatus.Int() == KErrNotFound)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Password dialog plugin notifier impl. was not found")));
+        }
+    else
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" Notifier plugin for 'Password' dialog returned an error: %d"), 
+                                                        reqStatus.Int()));
+        }
+
+    CleanupStack::PopAndDestroy(2); // request, response;
+    CleanupStack::Pop(); // notifier
+
+    if (illegalUsername) return KErrArgument;
+    return reqStatus.Int();
+    }
+
+
+TInt CSenBaseIdentityManager::WriteConfigurationToL( const TDesC& aFile )
+    {
+    // First, collect everything into MEMORY
+    CBufFlat *pBuf = CBufFlat::NewL(KFLATBUF_SIZE);
+    CleanupStack::PushL(pBuf);
+
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+
+    bufWs.WriteL(KUsersStart);
+
+    if(iIdentity)
+        {
+        iIdentity->WriteAsXMLToL(bufWs);
+        }
+
+    bufWs.WriteL(KUsersEnd);
+
+    TPtrC8 p8 = pBuf->Ptr(0);
+
+    CleanupStack::PopAndDestroy(1); // bufWs
+
+    // Everything in MEMORY ok, prepare to write into file
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    RFileWriteStream fileOutStream;
+    CleanupClosePushL(fileOutStream);
+
+
+    if(!SysUtil::FFSSpaceBelowCriticalLevelL(&fss, p8.Length()) )
+        {
+        // note, this will zero-length the file(!)
+        // it is better to require that 2xfilesize is available and not to
+        // dangerously zero the old file and find out
+        // that there is no space left..
+
+        //Data caging 2 implementation
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+        TBuf<KMaxPath> file;
+        fss.CreatePrivatePath(EDriveC);
+        fss.PrivatePath(file);
+        file.Append(aFile);
+        fileOutStream.Replace(fss, file, EFileWrite);
+#else
+        fileOutStream.Replace(fss, aFile, EFileWrite);
+#endif
+        // finally write the UTF-8 into the file. 
+        fileOutStream.WriteL(p8);
+        }
+
+    CleanupStack::PopAndDestroy(3); // fileOutStream, fss, pBuf
+
+    return KErrNone;
+    }
+
+
+void CSenBaseIdentityManager::ReloadSenSecurityMechanismsL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Entering CSenXMLDAO::ReloadSenSecurityMechanismsL()..")));
+
+    delete ipMechanicsNames;
+    ipMechanicsNames = NULL;
+    ipMechanicsNames = CBufFlat::NewL(KFLATBUF_SIZE);
+    RBufWriteStream bufWs(*ipMechanicsNames);
+    CleanupClosePushL(bufWs);
+
+    iSechMechNames.ResetAndDestroy();
+    iSechMechCues.ResetAndDestroy();
+
+    REComSession::ListImplementationsL(KUidSechMech, iEcomInfoArray);
+
+
+    TInt infoCount(iEcomInfoArray.Count());
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("%d Security Mechanism ECOM implementations found."),
+                        infoCount));
+
+    for (TInt i=0; i<infoCount; i++)
+        {
+        CImplementationInformation* pImplImfo = iEcomInfoArray[i];
+        CSenSecurityMechanism* pSechMech =
+            CSenSecurityMechanism::NewL(pImplImfo->DataType(),
+                                        iManager);
+        CleanupStack::PushL(pSechMech);
+        iSechMechNames.Append(pSechMech->Name().AllocL());
+        iSechMechCues.Append(pImplImfo->DataType().AllocL());
+        bufWs.WriteL(pSechMech->Name());
+        CleanupStack::PopAndDestroy(); // pSechMech
+        if (i < (infoCount-1))
+            {
+            bufWs.WriteL(KSpace);
+            }
+        }
+    iEcomInfoArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(1); // bufWs
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Leaving CSenXMLDAO::ReloadSenSecurityMechanismsL().. ")));
+
+    }
+
+
+TPtrC8 CSenBaseIdentityManager::SenSecurityMechanismNames8L()
+    {
+    TPtrC8 p8 = ipMechanicsNames->Ptr(0);
+    return p8;
+    }
+
+CSenSecurityMechanism* CSenBaseIdentityManager::MechanismNamedL(
+                                                        const TDesC8& aName)
+    {
+    CSenSecurityMechanism* pSaslMechanism = NULL;
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenIdWsfPlugin::MechanismNamedL");
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(aName));
+
+    for (TInt i=0; i<iSechMechNames.Count(); i++)
+        {
+        if (*iSechMechNames[i] == aName)
+            {
+            pSaslMechanism = CSenSecurityMechanism::NewL(*iSechMechCues[i], 
+                                                                iManager);
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBaseIdentityManager::MechanismNamedL - successful");
+            break;
+            }
+        }
+    if(!pSaslMechanism)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBaseIdentityManager::MechanismNamedL - lookup failed!");
+        }
+
+    return pSaslMechanism;
+    }
+
+HBufC8* CSenBaseIdentityManager::EncodeToBase64LC(const TDesC8& aSource)
+    {
+    return iManager.EncodeToBase64LC(aSource);
+    }
+
+HBufC8* CSenBaseIdentityManager::DecodeFromBase64LC(const TDesC8& aSource)
+    {
+    return iManager.DecodeFromBase64LC(aSource);
+    }
+
+void CSenBaseIdentityManager::SetShowPasswordDialog(const TBool aState)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenBaseIdentityManager::SetShowPasswordDialog");
+    iShowPasswordDialog = aState;
+    }
+
+TInt CSenBaseIdentityManager::ContainsIdentityProviderL(
+                                                   TBool& aContains,
+                                                   CSenIdentityProvider& aIDP)
+    {
+    return IdentityL().ContainsIdentityProviderL(aContains, aIDP);
+    }
+    
+TInt CSenBaseIdentityManager::FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
+                                                            CSenIdentityProvider*& apMatch)
+    {
+    return IdentityL().FindMatchingIdentityProviderL(aIdp, apMatch);
+    }
+        
+TInt CSenBaseIdentityManager::UpdateIdentityProviderL(CSenIdentityProvider& aIdp)
+    {
+    TInt retVal = IdentityL().UpdateIdentityProviderL(aIdp);
+
+    // check success:
+    if ( retVal == KErrNone)
+        {
+        // ownership taken, pop from stack:
+        // try to serialize owned object
+        if ( WriteDatabase() != KErrNone)
+            {
+            retVal = KErrWrite;
+            }
+        }
+
+    return retVal;
+    }
+    
+
+EXPORT_C void CSenBaseIdentityManager::UpdateTouchIdentityDBL(MSenServiceDescription& asd)
+	{
+	CSenIdentityProvider* Idp = NULL;
+	
+	Idp = iIdentity->IdentityProviderL(asd);
+	if(Idp != NULL)
+		{
+		TUint32 current_tick(0);
+		TBuf8<32> tickBuf;
+				
+		CSenElement& IdpElem = Idp->AsElement();
+		current_tick = User::NTickCount();
+		tickBuf.Num(current_tick);
+		IdpElem.AddAttrL(KTouch(), tickBuf);
+		}
+//	CleanupUnusedIdentityDBL();   
+                                  // (don't de-serialize old items). Serialized 
+	                              // objects cannot be de-allocated on the fly.
+	}
+	
+void CSenBaseIdentityManager::CleanupUnusedIdentityDBL()
+	{
+	TInt count(0);
+	
+	RPointerArray<CSenElement> elemList;
+	CleanupClosePushL(elemList);
+	
+	CSenElement& element = iIdentity->AsElement();
+	element.ElementsL(elemList, KIdentityProvider);
+	count = elemList.Count(); 
+	// There can be many Identity Provider elements within Identity element
+	for(TInt i = 0; i < count; i++)
+		{
+		CSenElement* elem = elemList[i];
+		
+		const TDesC8* attrValue = elem->AttrValue(KTouch());
+		if(attrValue != NULL)
+			{
+			TUint32 current_tick(0);
+			TUint32 db_ticks(0);
+			TUint32 diff_ticks(0);
+					
+			TLex8 lex;
+            lex.Assign(*attrValue);
+            lex.Val(db_ticks, EDecimal);
+            
+            current_tick = User::NTickCount();
+            diff_ticks = current_tick - db_ticks;
+            if(KMaxTicks <= diff_ticks || current_tick < db_ticks)
+				{
+				TInt endpointCount(0);
+				_LIT8(KEndpoint, "Endpoint");
+												
+				RPointerArray<CSenElement> endpointElemList;
+				CleanupClosePushL(endpointElemList);
+				
+				elem->ElementsL(endpointElemList, KEndpoint);
+				endpointCount = endpointElemList.Count();
+				
+				if(endpointCount > 0)
+					{
+					CSenIdentityProvider* pMatch = NULL;
+					
+					CSenElement* endpointElem = endpointElemList[0];
+					TPtrC8 endpoint = endpointElem->Content();
+					pMatch = IdentityProviderL(endpoint);
+					if(pMatch != NULL)
+						{
+						// Ownership ?
+						UnregisterIdentityProviderL(*pMatch);
+						}
+					}
+				CleanupStack::PopAndDestroy(&endpointElemList);
+				}
+			}
+		}
+	CleanupStack::PopAndDestroy(&elemList);
+	}
+			
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/senidentitymanagerdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return( KErrNone );
+    }
+#endif
+
+// End of Files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/senmultiuseridentitymanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+#include <s32mem.h>
+#include <s32file.h>
+#include <sysutil.h>
+
+#include "senmultiuseridentitymanager.h"
+
+#include "senlogger.h"
+#include "SenXmlUtils.h"
+
+namespace
+    {
+    _LIT8(KUser, "User");
+    _LIT8(KUsers, "Users");
+    _LIT8(KUserName, "username");
+    _LIT8(KPIN, "PIN");
+    _LIT8(KActive, "active");
+    _LIT8(KTrue, "1");
+    _LIT8(KFalse, "0");
+    _LIT8(KUsersStart, "<Users>");
+    _LIT8(KUsersEnd, "</Users>");
+    _LIT8(KUserStartFmt, "<User username=\"%S\" PIN=\"%S\" active=\"%d\">");
+    _LIT8(KUserEnd, "</User>");
+    const TInt KFLATBUF_SIZE = 128;
+    const TInt KActiveValueSize = 1;
+    
+    const TInt KStateParsingIdentity = 100;
+    }
+
+
+EXPORT_C CSenMultiUserIdentityManager* CSenMultiUserIdentityManager::NewL(
+                                            MSenCoreServiceManager& aManager)
+    {
+    CSenMultiUserIdentityManager* pNew = NewLC(aManager);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenMultiUserIdentityManager* CSenMultiUserIdentityManager::NewLC(
+                                            MSenCoreServiceManager& aManager)
+    {
+    CSenMultiUserIdentityManager* pNew =
+                        new (ELeave) CSenMultiUserIdentityManager(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+                              
+CSenMultiUserIdentityManager::CSenMultiUserIdentityManager(
+                                            MSenCoreServiceManager& aManager)
+    : CSenBaseIdentityManager(aManager)
+    {
+    }
+
+EXPORT_C CSenMultiUserIdentityManager::~CSenMultiUserIdentityManager()
+    {
+    iUsers.ResetAndDestroy();
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenMultiUserIdentityManager::~CSenMultiUserIdentityManager");        
+    }
+
+void CSenMultiUserIdentityManager::ConstructL()
+    {
+    CSenBaseIdentityManager::ConstructL();
+    //db was empty, take default one from Base class(loaded during Base::Contructl)
+    if (!iActiveIdentity)
+        {
+        iActiveIdentity = iIdentity;
+        iActiveUser = CSenUser::NewL(KNullDesC8, KNullDesC8, ETrue);    
+        iActiveUser->Identites().Append(iActiveIdentity);
+        iUsers.Append(iActiveUser);
+        }
+    else
+        {
+        //parsing from CSenBaseIdentityManager::ConstructL()
+        //  caused, that iActiveIdentity is already set (because has been set by below "StartElement" method).
+        //  So, orginal iIdentity should be replaced by iActiveIdentity (used by UpdateTouch functionality)
+        delete iIdentity;
+        iIdentity = NULL;
+        iIdentity = iActiveIdentity;
+        };
+        
+    }
+
+void CSenMultiUserIdentityManager::StartElementL(
+                                          const TDesC8& /*aNsUri*/,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& /*aQName*/,
+                                          const RAttributeArray& aAttributes
+                                          )
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            if (aLocalName == KUser)
+                {
+                TPtrC8 userName = SenXmlUtils::AttrValue(aAttributes, KUserName);
+                TPtrC8 pin = SenXmlUtils::AttrValue(aAttributes, KPIN);
+                TPtrC8 active = SenXmlUtils::AttrValue(aAttributes, KActive);
+                if (active == KTrue)
+                    {
+                    iParsedUser = CSenUser::NewL(userName, pin, ETrue);    
+                    }
+                else
+                    {
+                    iParsedUser = CSenUser::NewL(userName, pin);
+                    }
+                
+                if (active == KTrue)
+                    {
+                    //2nd time active user?? within db
+                    __ASSERT_ALWAYS(!iActiveUser, User::Panic(KSenUser, KErrAlreadyExists));
+                    iActiveUser = iParsedUser;
+                    }
+                iUsers.Append(iParsedUser);
+                iState = KStateParsingIdentity;
+                }
+            }
+            break;
+        
+        case KStateParsingIdentity:
+            {
+            if (aLocalName ==  KIdentityElementLocalName)
+                {
+                CSenBaseIdentity* identity = CSenBaseIdentity::NewLC(ipDeviceID->Des());
+                identity->SetAttributesL(aAttributes);
+                identity->SetReader(*Reader());
+                DelegateParsingL(*identity);
+                __ASSERT_ALWAYS(iParsedUser, User::Panic(KSenUser, KErrAlreadyExists));
+                iParsedUser->Identites().Append(identity);
+                
+                //current parsed user is active
+                if (iParsedUser == iActiveUser)
+                    {
+                    iActiveIdentity = identity;
+                    }
+                CleanupStack::Pop(identity);
+                }
+            }
+            break;
+            
+        default:
+            break;
+        }
+    }
+void CSenMultiUserIdentityManager::EndElementL(
+    const TDesC8& /*aNsUri*/,
+    const TDesC8& aLocalName,
+    const TDesC8& /*aQName*/)
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            if (aLocalName ==  KUsers)//end parsing
+                {
+                if (iUsers.Count() == 1)
+                    {
+                    CSenUser* user = iUsers[0];
+                    iActiveUser = user;
+                    iActiveIdentity = iActiveUser->Identites()[0];
+                    }
+                }
+            break;
+            }
+        case KStateParsingIdentity:
+            {
+            if (aLocalName ==  KUser)
+                {
+                iState = KStateIgnore;    
+                }
+            }
+            break;
+        }
+    }
+        
+
+MSenIdentity& CSenMultiUserIdentityManager::IdentityL()
+    {
+    return (MSenIdentity&)*iActiveIdentity;
+    }
+
+TInt CSenMultiUserIdentityManager::UserNameL(HBufC8*& aUserName)
+    {
+    delete aUserName;
+    aUserName = NULL;
+    aUserName = iActiveUser->UserName().AllocL();
+    return KErrNone;
+    }
+
+
+
+
+
+TInt CSenMultiUserIdentityManager::WriteConfigurationToL( const TDesC& aFile )
+    {
+    // First, collect everything into MEMORY
+    CBufFlat *pBuf = CBufFlat::NewL(KFLATBUF_SIZE);
+    CleanupStack::PushL(pBuf);
+
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+    bufWs.WriteL(KUsersStart);
+
+
+//############# main loop #########
+    TInt count = iUsers.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        RBuf8 userTag;
+        CSenUser* user = iUsers[i];
+        userTag.CreateL(KUserStartFmt().Length() + 
+                     user->PIN().Length() + 
+                     user->UserName().Length() + 
+                     KActiveValueSize //1
+                     );
+    
+        if (user->Active())
+            {
+            userTag.Format(KUserStartFmt, &(user->UserName()),  &(user->PIN()), KTrue); 
+            }
+        else
+            {
+            userTag.Format(KUserStartFmt, &(user->UserName()),  &(user->PIN()), KFalse);
+            }
+        
+                     
+        bufWs.WriteL(userTag);
+        TInt count2 = iUsers[i]->Identites().Count();
+        for (TInt j=0; j<count2; j++)
+            {
+            CSenBaseIdentity* identity = iUsers[i]->Identites()[j];
+            identity->WriteAsXMLToL(bufWs);
+            }
+        bufWs.WriteL(KUserEnd);
+        userTag.Close();
+        }
+
+//#############
+    bufWs.WriteL(KUsersEnd);
+
+    TPtrC8 p8 = pBuf->Ptr(0);
+
+    CleanupStack::PopAndDestroy(1); // bufWs
+
+    // Everything in MEMORY ok, prepare to write into file
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    RFileWriteStream fileOutStream;
+    CleanupClosePushL(fileOutStream);
+
+
+    if(!SysUtil::FFSSpaceBelowCriticalLevelL(&fss, p8.Length()) )
+        {
+        // note, this will zero-length the file(!)
+        // it is better to require that 2xfilesize is available and not to
+        // dangerously zero the old file and find out
+        // that there is no space left..
+
+        //Data caging 2 implementation
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+        TBuf<KMaxPath> file;
+        fss.CreatePrivatePath(EDriveC);
+        fss.PrivatePath(file);
+        file.Append(aFile);
+        fileOutStream.Replace(fss, file, EFileWrite);
+#else
+        fileOutStream.Replace(fss, aFile, EFileWrite);
+#endif
+        // finally write the UTF-8 into the file. 
+        fileOutStream.WriteL(p8);
+        }
+    CleanupStack::PopAndDestroy(3);
+    return KErrNone;
+    }
+
+	
+			
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/sensecuritymechanismobserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sensecuritymechanismobserver.h"
+#include "senbaseidentitymanager.h"
+
+#include <flogger.h>
+#include "sendebug.h"
+#include "senlogger.h"
+
+// CONSTANTS
+namespace
+    {
+    }
+
+CSenSenSecurityMechanismObserver* CSenSenSecurityMechanismObserver::NewL(
+                                            CSenBaseIdentityManager& aOwner)
+    {
+    CSenSenSecurityMechanismObserver* pNew =
+                        CSenSenSecurityMechanismObserver::NewLC(aOwner);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenSenSecurityMechanismObserver* CSenSenSecurityMechanismObserver::NewLC(
+                                            CSenBaseIdentityManager& aOwner)
+    {
+    CSenSenSecurityMechanismObserver* pNew =
+                    new (ELeave) CSenSenSecurityMechanismObserver(aOwner);
+    CleanupStack::PushL(pNew);
+
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenSenSecurityMechanismObserver::CSenSenSecurityMechanismObserver(
+                                            CSenBaseIdentityManager& aOwner)
+: CActive(EPriorityStandard),
+  iOwner(aOwner)
+    {
+    }
+
+void CSenSenSecurityMechanismObserver::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    iEcomSession = REComSession::OpenL();
+    }
+
+CSenSenSecurityMechanismObserver::~CSenSenSecurityMechanismObserver()
+    {
+    iEcomSession.CancelNotifyOnChange(iStatus);
+    Cancel();
+    iEcomSession.Close();
+    }
+
+void CSenSenSecurityMechanismObserver::RunL()
+    {
+    if (iStatus == KErrNone)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenSenSecurityMechanismObserver::RunL");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"..calling IdentityManager.ReloadSenSecurityMechanismsL");
+        iOwner.ReloadSenSecurityMechanismsL();
+        iEcomSession.NotifyOnChange(iStatus);
+        SetActive();
+        }
+    }
+TInt CSenSenSecurityMechanismObserver::RunError(TInt /* aError */)
+    {
+//    if (aError != KErrNone)
+    return KErrNone;
+    }
+
+void CSenSenSecurityMechanismObserver::DoCancel()
+    {
+    TRequestStatus status;
+    iEcomSession.CancelNotifyOnChange(status);
+    }
+
+void CSenSenSecurityMechanismObserver::Start()
+    {
+    SetActive();
+    iEcomSession.NotifyOnChange(iStatus);
+    }
+
+RFileLogger* CSenSenSecurityMechanismObserver::Log()
+    {
+    return iOwner.Log();
+    }
+
+namespace
+    {
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/senuser.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#include "senuser.h"
+
+CSenUser::CSenUser(TBool aActive)
+    : iActive(aActive)
+{
+}
+
+
+CSenUser::~CSenUser()
+{
+    iBaseIdentities.ResetAndDestroy();
+}
+
+CSenUser* CSenUser::NewLC(const TDesC8& aUserName, const TDesC8& aPIN, TBool aActive)
+{
+	CSenUser* self = new (ELeave)CSenUser(aActive);
+	CleanupStack::PushL(self);
+	self->ConstructL(aUserName, aPIN);
+	return self;
+}
+
+CSenUser* CSenUser::NewL(const TDesC8& aUserName, const TDesC8& aPIN, TBool aActive)
+{
+	CSenUser* self=CSenUser::NewLC(aUserName, aPIN, aActive);
+	CleanupStack::Pop(); // self;
+	return self;
+}
+
+void CSenUser::ConstructL(const TDesC8& aUserName, const TDesC8& aPIN)
+{
+    iUserName.Close();
+    iUserName.CreateL(aUserName);
+    iPIN.Close();
+    iPIN.CreateL(aPIN);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsidentitymanager/src/senwiseidentityprovider.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senwiseidentityprovider.h"
+
+namespace
+    {
+    _LIT8(KIMEI, "IMEI");
+    }
+
+
+EXPORT_C CSenWiseIdentityProvider* CSenWiseIdentityProvider::NewL(
+                                                    TPtrC8 aIMEI,
+                                                    const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract)
+    {
+    CSenWiseIdentityProvider* pNew = NewLC( aIMEI, aEndPoint, aContract );
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+EXPORT_C CSenWiseIdentityProvider* CSenWiseIdentityProvider::NewLC(
+                                                       TPtrC8 aIMEI,
+                                                       const TDesC8& aEndPoint,
+                                                       const TDesC8& aContract)
+    {
+    CSenWiseIdentityProvider* pNew =
+            new (ELeave) CSenWiseIdentityProvider(EIdentityProvider, aIMEI);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL( aEndPoint, aContract );
+    return pNew;
+    }
+
+void CSenWiseIdentityProvider::ConstructL(const TDesC8& aEndPoint,
+                                          const TDesC8& aContract)
+    {
+    CSenIdentityProvider::ConstructL(aEndPoint, aContract);
+    }
+
+CSenWiseIdentityProvider::CSenWiseIdentityProvider(TDescriptionClassType aType,
+                                                   TPtrC8 aIMEI)
+:   CSenIdentityProvider(aType),
+    iIMEI(aIMEI)
+    {
+    }
+
+EXPORT_C CSenWiseIdentityProvider::~CSenWiseIdentityProvider()
+    {
+    }
+
+TPtrC8 CSenWiseIdentityProvider::AuthzID()
+    {
+    TPtrC8 authzid = CSenIdentityProvider::AuthzID();
+    if (authzid == KIMEI) return iIMEI;
+    return authzid;
+    }
+
+TPtrC8 CSenWiseIdentityProvider::AdvisoryAuthnID()
+    {
+    TPtrC8 advisoryauthnid = CSenIdentityProvider::AdvisoryAuthnID();
+    if (advisoryauthnid == KIMEI) return iIMEI;
+    return advisoryauthnid;
+    }
+
+TPtrC8 CSenWiseIdentityProvider::Password()
+    {
+    TPtrC8 password = CSenIdentityProvider::Password();
+    if (password == KIMEI) return iIMEI;
+    return password;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/data/101f974e.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F974E;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9749;
+            implementations = 
+                {
+                // Info for HTTP Channel Transport plugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C4B;
+                    version_no         = 1;
+                    display_name       = "Sen Local Transport plug-in";
+                    default_data       = "com.nokia.wsf.transport.plugin.local";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/data/10274c75.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10274C75;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x10274C72;
+            implementations = 
+                {
+                // Info for HTTP Channel Transport plugin
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10274C76;
+                    version_no         = 1;
+                    display_name       = "Sen Local Transport plug-in";
+                    default_data       = "com.nokia.wsf.transport.plugin.local";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wslocaltransportplugin    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wslocaltransportplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wslocaltransportplugin.iby)
+
+PRJ_MMPFILES
+senlocaltransportplugin.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/group/senlocaltransportplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senlocaltransport plugin  
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET  SenLocalTransportPlugin.DLL
+UID 0x10009D8D 0x10274C75
+#else
+TARGET  wsLocalTransportPlugin.DLL
+UID 0x10009D8D 0x101F974E
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  10274c75.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenLocalTransportPlugin.rsc
+#endif
+
+#else
+START RESOURCE  101F974E.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsLocalTransportPlugin.rsc
+#endif
+
+#endif
+
+END
+
+SOURCEPATH      ../src
+SOURCE          senlocaltransportpluginmain.cpp
+SOURCE          senlocaltransportpluginproxy.cpp
+SOURCE          senlocaltransportplugin.cpp
+
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsframework/inc         // internal: MSenTransport.h, SenProvider.h, SenProvider.inl
+USERINCLUDE     ../../wsprovider/inc          // internal: MSenHostletRequest.h, MSenHostletResponse.h
+USERINCLUDE     ../../wsutils/inc             // internal: SenDebug.h
+USERINCLUDE     ../../wsidentitymanager/inc   // MSenIdentityManager.h
+USERINCLUDE     ../../wslogger/inc // for TLS based logging
+
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+
+LANG            SC
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY         ecom.lib
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenProvider.lib
+LIBRARY         SenUtils.lib     // CSenIdentifier
+LIBRARY         SenServDesc.lib  // CSenFacet
+LIBRARY         SenFramework.lib // CSenSyncRequester
+LIBRARY         SenFragment.lib
+LIBRARY         SenLogger.lib // for TLS based logging
+#else
+LIBRARY         wsProvider.lib
+LIBRARY         wsUtils.lib     // CSenIdentifier
+LIBRARY         wsServDesc.lib  // CSenFacet
+LIBRARY         wsFramework.lib // CSenSyncRequester
+LIBRARY         wsFragment.lib
+LIBRARY         wslogger.lib // for TLS based logging
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/inc/senlocaltransportplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_LOCAL_TRANSPORT_PLUGIN
+#define SEN_LOCAL_TRANSPORT_PLUGIN
+
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32std.h>
+#include <flogger.h>
+
+#include "sentransport.h"
+#include "senpointermap.h" // from Utils\inc
+#include "senlayeredxmlproperties.h"
+
+// CONSTANTS
+_LIT8(KSenLocalTransportUriScheme, "local");
+
+// FORWARD DECLARE
+class MSenProvider;
+class CSenProvider;
+class CSenLocalRequest;
+class CSenHostletRequest;
+class CSenHostletResponse;
+class CSenSyncRequester;
+
+// TYPEDEFS
+typedef RSenPointerMap<CSenLocalRequest, TInt> RLocalRequestMap;
+
+
+
+class CSenLocalTransportPlugin : public CSenTransport
+    {
+    public: 
+
+        // Constructors:
+        static CSenLocalTransportPlugin* NewL(CSenTransportContext* apCtx);
+
+        static CSenLocalTransportPlugin* NewLC(CSenTransportContext* apCtx);
+
+        // Destructor:
+        virtual ~CSenLocalTransportPlugin();
+
+         // from MSenTransport
+        virtual TInt SubmitL(const TDesC8& aEndpoint,
+                             const TDesC8& aMessage,
+                             const TDesC8& aTransportProperties,
+                             HBufC8*& aResponse,
+                             MSenRemoteServiceConsumer& aConsumer); 
+
+        virtual TInt SendL(const TDesC8& aEndpoint,
+                           const TDesC8& aMessage,
+                           const TDesC8& aTransportProperties,
+                           MSenServiceSession& aReplyTo,
+                           MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                           TInt& aTxnId);
+
+        virtual TInt SetPropertiesL(const TDesC8& aProperties, 
+                                    MSenLayeredProperties::TSenPropertiesLayer aTargetLayer,
+									MSenRemoteServiceConsumer* aConsumer);
+                                    
+        virtual TInt PropertiesL(HBufC8*& aProperties);
+        virtual TInt CompleteTransaction(const TInt aTxnId, const TInt aStatus);
+        virtual TInt CancelTransaction(const TInt aTxnId);
+        virtual TPtrC8 CSenLocalTransportPlugin::UriSchemeL();
+
+        virtual MSenProperties& PropertiesL();
+        
+
+    private:
+        void ConstructL();
+        CSenLocalTransportPlugin(CSenTransportContext* apCtx);
+        //RFileLogger* Log() const;
+
+        // Helper, to locally "proxy" the provider, which was invoked *last* time
+        MSenProvider& ProviderL(const TDesC8& aEndpoint);
+
+    private: // member data
+        CSenSyncRequester* ipRequester;
+        CSenProvider* iInvokedProvider;
+        //RFileLogger iLogger;    
+        TInt iStatusCode ;
+        TInt iTransactionID;
+        RLocalRequestMap iRequestMap;
+        CSenLayeredXmlProperties* ipTransportProperties;
+    } ;
+
+class CSenLocalRequest : public CActive
+    {
+    friend class CSenLocalTransportPlugin;
+
+    
+
+    public:
+
+        enum TLocalRequestState
+            {
+            EInvokeService = 1,
+            EDeliverResponse,
+            EDeliverComplete
+            };
+
+        // Standard 2 phased constructor
+        static CSenLocalRequest* NewLC(const TDesC8& aEndpoint, //MSenProvider& aRequestTo,
+                                       const TDesC8& aMessage,
+                                       const TDesC8& aTransportProperties,
+                                       MSenServiceSession& aReplyTo,
+                                       MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                                       MSenCoreServiceManager& aProviderProxy,
+                                       TInt aTxnId);
+
+        // C++ destructor
+        virtual ~CSenLocalRequest();
+
+        MSenServiceSession& Session() const;
+        MSenRemoteServiceConsumer& Consumer() const;
+        TInt TxnId() const;
+
+        TPtrC8 TransportProperties() const;
+
+        virtual void RunL(); 
+        virtual void DoCancel();
+
+        //void SetLogger(RFileLogger& aLogger);
+
+        void ExecuteL(); // called by thread
+
+        const TThreadId OwnerThreadId() const;
+
+        CSenHostletResponse& Response();
+
+        TBool Delivered() const;
+        
+		static void LocalRequestExceptionHandlerL(TExcType aType);
+        
+
+    private:
+        // 2nd phase constructor
+        void ConstructL(const TDesC8& aMessage, 
+                        const TDesC8& aTransportProperties);
+
+        // C++ constructor
+        CSenLocalRequest(const TDesC8& aEndpoint, //MSenProvider& aRequestTo,
+                         MSenServiceSession& aReplyTo,
+                         MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                         MSenCoreServiceManager& aProviderProxy,
+                         TInt aTxnId
+                         );
+        //RFileLogger* Log() const;
+
+        void DeliverL(); // Send the response back to the consumer, who invoked the service provider
+
+    private: // Data
+        MSenProvider*               ipProvider;  // not owned
+        const TDesC8&               iEndpoint;
+        MSenCoreServiceManager&     iProviderProxy;
+        CSenHostletRequest*         ipRequestImpl;
+        CSenHostletResponse*        ipResponseImpl;
+
+        HBufC8*                     ipTransportProperties;
+        MSenServiceSession&         iReplyTo;
+        MSenRemoteServiceConsumer&  iConsumer; // holds CSenIdentifier, the requester
+        TInt                        iTxnId;
+        //RFileLogger*                iLogger;
+        TThreadId                   iOwnerThreadId;
+        RThread                     iThread;
+        TInt                        iLeaveCode;    // place holder for leave code
+        TInt                        iRetVal;       // place holder for return code
+        TBool                       iDelivered;
+        // ownership is transferred if response is delivered otherwise to be cleaned up
+        HBufC8* 					ipResponse; 
+    };
+
+#endif // SEN_LOCAL_TRANSPORT_PLUGIN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/rom/wslocaltransportplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSLOCALTRANSPORTPLUGIN_IBY__
+#define __WSLOCALTRANSPORTPLUGIN_IBY__
+
+//LocalTransportPlugin
+ECOM_PLUGIN(SenLocalTransportPlugin.DLL, 10274C75.RSC)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/src/senlocaltransportplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,655 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "senlocaltransportplugin.h"
+
+#include <SenServiceConnection.h>   // errorcode constants, like KErrSenNoEndpoint
+
+#include "msenprovider.h"
+#include "senhostletrequest.h"      // internal Provider\inc
+#include "senhostletresponse.h"     // internal Provider\inc
+
+#include "senidentifier.h"          // internal Utils\inc
+#include "senidentifier.h"          // internal Utils\inc
+#include "sendebug.h"               // internal Utils\inc
+
+#include "senprovider.h"            // internal Framework\inc
+#include "sensyncrequester.h"       // internal Framework\inc
+#include <SenTransportProperties.h> // internal Framework\inc
+
+#include "msentransport.h"
+#include "msencoreservicemanager.h" // internal: Core\inc
+
+#include "senlayeredtransportproperties.h"
+#include "senhostletrequest.h"      // internal Provider\inc
+#include "senguidgen.h"
+#include "senlogger.h"
+
+#include <RSenDocument.h>
+namespace
+    {
+//Deleted to fix for compiler warning  #177-D
+
+    //const TInt maxThreadHeapSize(KMinHeapSize*256);
+
+    void threadMainL(TAny* aPtr)
+        {
+        CSenLocalRequest* pRequest = (CSenLocalRequest*) aPtr;
+        pRequest->ExecuteL();
+        TRequestStatus* status = &pRequest->iStatus;
+        RThread owner;
+        TInt error=owner.Open(pRequest->OwnerThreadId());	//CodeScannerWarnings
+        if(error != KErrNone)	//CodeScannerWarnings
+        {
+        }
+        owner.RequestComplete(status, CSenLocalRequest::EDeliverResponse ); //iTransactionID );
+        // Go safely out of scope (will destroy this thread)
+        }
+
+    TInt threadFunction(TAny* aPtr)
+        {
+        CTrapCleanup* pCleanup = CTrapCleanup::New();
+        CActiveScheduler::Install(NULL); // remove one
+        CActiveScheduler* pScheduler = new (ELeave) CActiveScheduler();
+        CActiveScheduler::Install(pScheduler);
+
+        RSenDocument::ManualXmlEngineTlsAttachL();
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, threadMainL(aPtr));
+
+        RSenDocument::ManualXmlEngineTlsCleanup();
+
+        CActiveScheduler::Install(NULL); // uninstall scheduler
+        delete pScheduler;
+        delete pCleanup;
+
+        return leaveCode;
+        }
+    }
+CSenLocalTransportPlugin* CSenLocalTransportPlugin::NewL(CSenTransportContext* apCtx)
+    {
+    CSenLocalTransportPlugin* pNew = NewLC(apCtx);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenLocalTransportPlugin* CSenLocalTransportPlugin::NewLC(CSenTransportContext* apCtx)
+    {
+    CSenLocalTransportPlugin* pNew =
+        new (ELeave) CSenLocalTransportPlugin(apCtx);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenLocalTransportPlugin::CSenLocalTransportPlugin(CSenTransportContext* apCtx)
+:   CSenTransport(apCtx),
+    ipRequester(NULL),
+    iInvokedProvider(NULL),
+    iStatusCode(0),
+    iTransactionID(0),
+    iRequestMap(ETrue, ETrue),
+    ipTransportProperties(NULL)
+    {
+    }
+
+CSenLocalTransportPlugin::~CSenLocalTransportPlugin()
+    {
+    TLSLOG(KSenLocalTransportLogChannelBase,KMinLogLevel,_L("Log file closed."));
+    TLSLOG_CLOSE(KSenLocalTransportLogChannelBase);
+    iRequestMap.Reset(); // Cleanup the request queue       
+    delete ipRequester;
+    delete iInvokedProvider;
+    delete ipTransportProperties;
+    }
+
+void CSenLocalTransportPlugin::ConstructL()
+    {
+    // Open connection to the file logger server
+    TLSLOG_OPEN(KSenLocalTransportLogChannelBase,KSenLocalTransportLogLevel,KSenLocalTransportLogDir,KSenLocalTransportLogFile);
+    TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"CSenLocalTransportPlugin::ConstructL - Log file opened.");
+    TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"CSenLocalTransportPlugin::ConstructL - Version 2 [2006-05-09]");    
+    MSenCoreServiceManager& core = Context().GetCoreL();
+    ipRequester = CSenSyncRequester::NewL(*this, core);
+    ipTransportProperties = CSenLayeredTransportProperties::NewL();
+    }
+
+TInt CSenLocalTransportPlugin::SubmitL(const TDesC8& aEndpoint,
+                                       const TDesC8& aMessage,
+                                       const TDesC8& aTransportProperties,
+                                       HBufC8*& apResponse,
+                                       MSenRemoteServiceConsumer& /*aConsumer*/) 
+    {
+    TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"CSenLocalTransportPlugin::SubmitL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"- No endpoint!");
+        return KErrSenNoEndpoint; // from SenServiceConnection.h (public API)
+        }
+    TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KMinLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+    
+    TLSLOG_L(KSenLocalTransportLogChannelBase,KMaxLogLevel,"- Message:");
+    TLSLOG_ALL(KSenLocalTransportLogChannelBase,KMaxLogLevel,( aMessage ));
+
+    TInt leaveCode(KErrNone);
+    TInt statusCode(KErrNone);
+
+    /*
+    statusCode = ipRequester->SubmitL(aEndpoint,            // endpoint
+                                      aMessage,             // request body
+                                      aTransportProperties, // request props
+                                      apResponse);
+    */
+    
+    TRAP( leaveCode, statusCode = ipRequester->SubmitL(aEndpoint,            // endpoint
+                                                       aMessage,             // request body
+                                                       aTransportProperties, // request props
+                                                       apResponse); )         // response body
+    TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KMinLogLevel, _L8("CSenLocalTransportPlugin::SubmitL returned: (%d)"), statusCode));
+    
+
+    if(leaveCode!=KErrNone)
+        {
+        TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KMinLogLevel, _L8("CSenLocalTransportPlugin::SubmitL leaved: (%d)"), leaveCode));
+        if(statusCode==KErrNone)
+            {
+            statusCode = leaveCode;
+            }
+        }
+    else // did not leave
+        {
+        if(!apResponse)
+            {
+            TLSLOG(KSenLocalTransportLogChannelBase,KMinLogLevel,(_L("After calling CSenLocalTransportPlugin::SubmitL => response==NULL => leaving!")));
+            User::Leave(KErrCorrupt);
+            }
+        TLSLOG_L(KSenLocalTransportLogChannelBase,KMaxLogLevel,"CSenLocalTransportPlugin::SubmitL response:");
+        TLSLOG_ALL(KSenLocalTransportLogChannelBase,KMaxLogLevel,(*apResponse));
+        }
+                                        
+    return statusCode;
+    }
+
+TInt CSenLocalTransportPlugin::SendL(const TDesC8& aEndpoint,
+                                     const TDesC8& aMessage,
+                                     const TDesC8& aTransportProperties,
+                                     MSenServiceSession& aReplyTo,
+                                     MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                                     TInt& aTxnId)
+    {
+    TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"CSenLocalTransportPlugin::SendL:");
+
+    // Sanity check the endpoint
+    if (aEndpoint.Length() <= 0)
+        {
+        TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"- No endpoint!");
+        return KErrSenNoEndpoint; // from SenServiceConnection.h (public API)
+        }
+    TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KMinLogLevel, _L8("- Endpoint: %S"), &aEndpoint));
+    
+    TLSLOG_L(KSenLocalTransportLogChannelBase,KMaxLogLevel,"- Message:");
+    TLSLOG_ALL(KSenLocalTransportLogChannelBase,KMaxLogLevel,( aMessage ));
+    
+    iTransactionID++;
+    TInt* txnID = new (ELeave) TInt(iTransactionID);
+    aTxnId = iTransactionID;
+
+	CleanupStack::PushL(txnID);	// memory leaks if CSenLocalRequest::NewLC leaves...
+	
+    // CSenLocalTransportPlugin::ProviderL method ("local proxy" for single consumer
+    // -- since each consumer always owns its own transport) has now been **replaced**
+    // with "provider factory" methods implemented to WSF **core**:
+
+    MSenCoreServiceManager& core = Context().GetCoreL();
+    CSenLocalRequest* pRequest = CSenLocalRequest::NewLC(aEndpoint,
+                                                         aMessage, 
+                                                         aTransportProperties,
+                                                         aReplyTo,
+                                                         aConsumer,
+                                                         core,
+                                                         *txnID);
+
+#ifdef _SENDEBUG
+    //pRequest->SetLogger(iLogger);
+#endif // _SENDEBUG
+
+    TInt retVal = iRequestMap.Append(pRequest, txnID);
+
+    if(retVal==KErrNone)
+        {
+        CleanupStack::Pop(pRequest);
+        CleanupStack::Pop(txnID);        
+        if(!pRequest->IsActive())
+            {
+            TLSLOG_L(KSenLocalTransportLogChannelBase,KNormalLogLevel,"- Activating request / async call to the provider.");
+            pRequest->SetActive();
+            }
+        pRequest->iStatus = KRequestPending;
+        TRequestStatus* status = &pRequest->iStatus;
+        User::RequestComplete( status, CSenLocalRequest::EInvokeService ); //iTransactionID );
+        TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KNormalLogLevel, _L8("- Request status: %d"), pRequest->iStatus.Int()));
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(pRequest); // orphanized request
+        CleanupStack::Pop(txnID);
+        }
+    return retVal; // status code
+    }
+
+
+TInt CSenLocalTransportPlugin::SetPropertiesL(const TDesC8& /* aProperties */,
+                                              MSenLayeredProperties::TSenPropertiesLayer /* aTargetLayer */,
+											  MSenRemoteServiceConsumer* /*aConsumer*/)
+    { 
+    return KErrNotSupported; // not implemented
+    }
+
+TInt CSenLocalTransportPlugin::PropertiesL(HBufC8*& /* aProperties */)
+    {
+    return KErrNotSupported; // not implemented
+    }
+
+TInt CSenLocalTransportPlugin::CompleteTransaction(const TInt /*aTxnId*/,
+                                                         const TInt /*aStatus*/)
+    {
+    return KErrNotSupported; // not supported by HTTP Channel
+    }
+
+TInt CSenLocalTransportPlugin::CancelTransaction(const TInt /* aTxnId */)
+    {
+    return KErrNotSupported; 
+    }
+
+TPtrC8 CSenLocalTransportPlugin::UriSchemeL()
+    {
+    return KSenLocalTransportUriScheme();
+    }
+
+
+MSenProperties& CSenLocalTransportPlugin::PropertiesL()
+    {
+    return *ipTransportProperties; 
+    }    
+
+/*
+RFileLogger* CSenLocalTransportPlugin::Log() const
+    {
+    return (RFileLogger*) &iLogger;
+    }
+*/
+CSenLocalRequest* CSenLocalRequest::NewLC(const TDesC8& aEndpoint, //MSenProvider& aRequestTo,
+                                          const TDesC8& aMessage,
+                                          const TDesC8& aTransportProperties,
+                                          MSenServiceSession& aReplyTo,
+                                          MSenRemoteServiceConsumer& aConsumer, // "addressee", could be CSenIdentifier
+                                          MSenCoreServiceManager& aProviderProxy,
+                                          TInt aTxnId)
+    {
+    //CSenLocalRequest* pNew = new (ELeave) CSenLocalRequest(aRequestTo, aReplyTo, aConsumer, aProviderProxy, aTxnId);
+    CSenLocalRequest* pNew = new (ELeave) CSenLocalRequest(aEndpoint, aReplyTo, aConsumer, aProviderProxy, aTxnId);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aMessage, aTransportProperties);
+    return pNew;
+    }
+
+
+CSenLocalRequest::CSenLocalRequest(const TDesC8& aEndpoint, //MSenProvider& aRequestTo, 
+                                   MSenServiceSession& aReplyTo,
+                                   MSenRemoteServiceConsumer& aConsumer,
+                                   MSenCoreServiceManager& aProviderProxy,
+                                   TInt aTxnId)
+: 
+    CActive(EPriorityStandard),
+    ipProvider(NULL),
+    iEndpoint(aEndpoint),
+    iProviderProxy(aProviderProxy),
+    ipRequestImpl(NULL),
+    ipResponseImpl(NULL),
+    ipTransportProperties(NULL),
+    iReplyTo(aReplyTo),
+    iConsumer(aConsumer),
+    iTxnId(aTxnId),
+    iLeaveCode(KErrNone),
+    iRetVal(KErrNone),
+    iDelivered(EFalse),
+    ipResponse(NULL)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+    
+CSenLocalRequest::~CSenLocalRequest()
+    {
+    DoCancel();
+    delete ipTransportProperties;
+    delete ipRequestImpl;
+    delete ipResponseImpl;
+    iThread.Close();
+    delete ipResponse;
+    //    delete ipReqIdentifier;
+    }
+    
+    
+// Called when local request thread crashes due to wrong local provider code
+// WS-Stack catches this crash
+// Stack still remain stable and communicates the failure to the request or consumer
+void CSenLocalRequest::LocalRequestExceptionHandlerL(TExcType aType)
+	{
+	// Crash is caused by local provider's ServiceL method 
+	// So nothing to be handled here and just return request thread
+	// died status or OOM
+	switch(aType) 
+		{
+		case EExcStackFault: //stack overflow
+		case EExcAccessViolation: //heap memory overflow
+			User::Leave(KErrNoMemory);//OOM
+			break;
+		default:
+			User::Leave(KErrDied);
+			break;
+		}
+	}
+
+void CSenLocalRequest::ExecuteL()
+    {
+    // Allow only single thread to run ServiceL at the same time,
+    // this is mandatory, since the provider might be sharable,
+    // and providers might then have some status (session data)
+    // which could be violated in multi-threaded execution.
+    // @see MSenProvider.h
+
+
+    if(ipProvider->Threadsafe())
+        {
+        // Only threadsafe providers block access from other threads.
+        // The non-threadsafe providers allow multiple threads to get
+        // inside ServiceL() - in such case the provider typically
+        // needs to implement critical section handling *itself*
+        ipProvider->iCriticalSection.Wait(); 
+        }
+        
+	User::SetExceptionHandler(CSenLocalRequest::LocalRequestExceptionHandlerL, KExceptionFault);
+        
+    // try processing the message through the provider - trap any leave
+    TRAP(iLeaveCode, iRetVal = ipProvider->ServiceL(*ipRequestImpl, *ipResponseImpl));
+    
+    // If no crashes or leaves during ServiceL
+    if (iLeaveCode == KErrNone) 
+    	{
+    	ipResponse = ipResponseImpl->ExtractResponseUtf8();    	
+    	}
+    
+   	// ipRequestImpl and ipResponseImpl are created within local provider thread
+   	// scope. Since these objects involve XmlEngineAttachL and XmlEngineCleanup 
+   	// calls, the cleanup is done within the threads scope otherwise XmlEngineCleanup
+   	// will happen in main thread's scope which move the xmlengine reference count
+   	// below 0, XmlEngine data structures will cleanup. This is unintended behaviour. So
+   	// to avoid this cleanup is done within local provider thread scope
+   	delete ipRequestImpl;
+   	ipRequestImpl = NULL;
+    delete ipResponseImpl;
+    ipResponseImpl = NULL;  
+
+    if(ipProvider->Threadsafe())
+        {
+        // Notify next thread that it can proceed and run 
+        // ServiceL (needed for sharable providers):
+        ipProvider->iCriticalSection.Signal();
+        }
+
+    iStatus = KRequestPending;
+    SetActive();
+    }
+
+const TThreadId CSenLocalRequest::OwnerThreadId() const
+    {
+    return iOwnerThreadId;
+    }
+
+void CSenLocalRequest::RunL() 
+    {
+    TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KMinLogLevel, _L8("CSenLocalRequest::RunL(), status: %d"), iStatus.Int()));
+
+    switch(iStatus.Int())
+        {
+        
+        case EInvokeService: // executed in "main", server thread by the ActiveScheduler
+            {
+            TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"EInvokeService -- ");
+
+#ifdef _SENDEBUG
+            TName fullThreadName = iThread.FullName();
+            TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KNormalLogLevel, _L8("'%S'"), &fullThreadName));
+#endif // _SENDEBUG
+            iThread.Resume(); // this will issue ExecuteL call from *another thread*!
+            }
+            break;
+
+        case EDeliverResponse: // executed in "main", server thread by the ActiveScheduler
+            {
+            TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"EDeliverResponse");
+            DeliverL();
+            }
+            break;
+            
+        default:
+            {
+            TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"- Unknown request. Processing not implemented.");
+            }
+            // unknown
+            break;
+        }
+    } 
+
+void CSenLocalRequest::DeliverL()
+    {
+    if(iLeaveCode)
+        {
+        // send error to consumer
+        iRetVal = iLeaveCode;
+        TLSLOG_FORMAT((KSenLocalTransportLogChannelBase,KMinLogLevel, _L8("CSenProvider::ExecuteL leaved: %d"), iLeaveCode));
+
+        Session().SendErrorToConsumerL(iRetVal, 
+                                       NULL, 
+                                       TxnId(),
+                                       Consumer());
+        }
+    else        
+        {
+//        TPtrC8 response = ipResponseImpl->ResponseUtf8();
+        //HBufC8* pResponse = ipResponseImpl->ExtractResponseUtf8();
+        TLSLOG_L(KSenLocalTransportLogChannelBase,KMaxLogLevel,"CSenLocalRequest::ExecuteL() hostlet response:");
+
+#ifdef _SENDEBUG        
+        if( ipResponse )
+            {
+            TLSLOG_ALL(KSenLocalTransportLogChannelBase,KMaxLogLevel,( *ipResponse ));
+            }
+        else
+            {
+            TLSLOG_L(KSenLocalTransportLogChannelBase,KMinLogLevel,"-Fatal(!): pResponse == NULL");
+            }
+#endif // _SENDEBUG
+
+        if( iRetVal!=KErrNone ) 
+            {
+            // send error to the consumer
+            Session().SendErrorToConsumerL(iRetVal, 
+                                           ipResponse, 
+                                           TxnId(),
+                                           Consumer());
+			// Ownership is transferred if response is delivered so no cleanup                                        
+            ipResponse = NULL;
+            }
+        else
+            {
+            // send message to consumer
+            Session().SendToConsumerL(ipResponse, 
+                                      TxnId(),
+                                      Consumer());
+			// Ownership is transferred if response is delivered so no cleanup                                           
+            ipResponse = NULL;
+            }
+        } 
+    iProviderProxy.ReleaseHostletL(ipProvider, iThread.FullName(), iConsumer.Id());
+    iThread.Close();
+    }
+
+void CSenLocalRequest::DoCancel() 
+    {
+    }
+
+void CSenLocalRequest::ConstructL(const TDesC8& aMessage, 
+                                  const TDesC8& aTransportProperties)
+
+    {
+
+    ipTransportProperties = aTransportProperties.AllocL();
+
+    TInt consumerIdLength(iConsumer.Id().Length());
+    
+    HBufC* pTemp = HBufC::NewLC(consumerIdLength);
+    // Consumer id (UCS8) does not contain any special,
+    // "UTF-8 to Unicode" -convertible characters, so 
+    // copying is OK.
+    TPtr temp = pTemp->Des();
+    temp.Copy(iConsumer.Id()); 
+    HBufC* pConsumerIdUnicode = HBufC::NewLC(consumerIdLength);
+    TPtr consumerIdUnicode = pConsumerIdUnicode->Des();
+    TLSLOG_ALL(KSenLocalTransportLogChannelBase,KMaxLogLevel,(consumerIdUnicode));
+
+    if(consumerIdLength>KSenUuidPrefixLength) 
+        {
+        consumerIdUnicode.Append(pTemp->Right(consumerIdLength-KSenUuidPrefixLength));
+        }
+
+    // Remove dashes
+    _LIT(KDash, "-");
+    TInt pos = consumerIdUnicode.Find(KDash);
+    while (pos != KErrNotFound)
+        {
+        consumerIdUnicode.Replace(pos, KDash().Length(), KNullDesC);
+        pos = consumerIdUnicode.Find(KDash);
+        }
+    
+    TName threadName;
+    _LIT(KNameFmt, "CSenLocalRequest%d.%S");
+    threadName.Format(KNameFmt, iTxnId, pConsumerIdUnicode);
+
+    CleanupStack::PopAndDestroy(2); // pConsumerIdUnicode, pTemp
+
+#ifdef EKA2
+    RAllocator& heap = User::Allocator(); // RHeap is deprecated in EKA2
+    iThread.Create(threadName, // name
+                   threadFunction,
+                   KDefaultStackSize,
+                   &heap,
+                   this);
+#else // EKA1
+    RHeap& heap = User::Heap();
+    iThread.Create(threadName, // name
+                   threadFunction,
+                   KDefaultStackSize,
+                   &heap,
+                   this);
+#endif // EKA
+
+    RThread thread;
+    iOwnerThreadId = thread.Id();
+
+
+    ipResponseImpl = CSenHostletResponse::NewL(iTxnId);
+
+    CSenChunk* pChunk = NULL;
+    
+/*    TInt getChunkRetCode(KErrNotFound);
+    getChunkRetCode = */
+    iConsumer.ChunkByTxnIdL(iTxnId, pChunk);
+
+
+    ipRequestImpl = CSenHostletRequest::NewL(iTxnId, aMessage, iThread, iConsumer.Identifier(), pChunk);
+    
+//    getChunkRetCode = 0; // not used atm (in release builds)
+    
+    //TBuf8<128> threadName;
+    //_LIT8(KNameFmt, "CSenLocalRequest-%d");
+    //threadName.Format(KNameFmt, iTxnId);
+    //ipReqIdentifier = CSenIdentifier::NewL(SenIdentifier::EThread, threadName);
+
+    ipProvider = & iProviderProxy.LookupHostletForL(iEndpoint, iThread.FullName(), iConsumer.Id());
+
+    }
+
+
+MSenServiceSession& CSenLocalRequest::Session() const
+    {
+    return iReplyTo;
+    }
+
+MSenRemoteServiceConsumer& CSenLocalRequest::Consumer() const
+    {
+    return iConsumer;
+    }
+
+
+TInt CSenLocalRequest::TxnId() const
+    {
+    return iTxnId;
+    }
+
+
+TBool CSenLocalRequest::Delivered() const
+    {
+    return iDelivered;
+    }
+
+CSenHostletResponse& CSenLocalRequest::Response()
+    {
+    return *ipResponseImpl;
+    }
+
+TPtrC8 CSenLocalRequest::TransportProperties() const
+    {
+    return *ipTransportProperties;
+    }
+
+/*void CSenLocalRequest::SetLogger(RFileLogger& aLogger)
+    {
+    iLogger = &aLogger;
+    }
+
+RFileLogger* CSenLocalRequest::Log() const
+    {
+    return (RFileLogger*) iLogger;
+    }
+*/    
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/src/senlocaltransportpluginmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslocaltransportplugin/src/senlocaltransportpluginproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "senlocaltransportplugin.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TInt32 KSenLocalTransportPlugin = 0x10274C76;
+#else
+const TInt32 KSenLocalTransportPlugin = 0x10282C4B;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+    IMPLEMENTATION_PROXY_ENTRY(KSenLocalTransportPlugin,  CSenLocalTransportPlugin::NewL)
+#else
+    {{KSenLocalTransportPlugin},  CSenLocalTransportPlugin::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/BMARM/SENLOGGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,13 @@
+EXPORTS
+	Write__10CSenLoggeriiRC7TDesC16 @ 1 NONAME R3UNUSED ; CSenLogger::Write(int, int, TDesC16 const &)
+	Destroy__10CSenLoggeri @ 2 NONAME R3UNUSED ; CSenLogger::Destroy(int)
+	WriteAll__10CSenLoggeriiRC6TDesC8 @ 3 NONAME R3UNUSED ; CSenLogger::WriteAll(int, int, TDesC8 const &)
+	WriteAll__10CSenLoggeriiRC7TDesC16 @ 4 NONAME R3UNUSED ; CSenLogger::WriteAll(int, int, TDesC16 const &)
+	WriteFormat__10CSenLoggeriiGt11TRefByValue1ZC6TDesC8RA0_PSc @ 5 NONAME ; CSenLogger::WriteFormat(int, int, TRefByValue<TDesC8 const>, signed char *(&)[0])
+	WriteFormat__10CSenLoggeriiGt11TRefByValue1ZC6TDesC8e @ 6 NONAME ; CSenLogger::WriteFormat(int, int, TRefByValue<TDesC8 const>,...)
+	WriteFormat__10CSenLoggeriiGt11TRefByValue1ZC7TDesC16RA0_PSc @ 7 NONAME ; CSenLogger::WriteFormat(int, int, TRefByValue<TDesC16 const>, signed char *(&)[0])
+	WriteFormat__10CSenLoggeriiGt11TRefByValue1ZC7TDesC16e @ 8 NONAME ; CSenLogger::WriteFormat(int, int, TRefByValue<TDesC16 const>,...)
+	Write__10CSenLoggeriiRC6TDesC8 @ 9 NONAME R3UNUSED ; CSenLogger::Write(int, int, TDesC8 const &)
+	CreateL__10CSenLoggeriiRC7TDesC16T3 @ 10 NONAME ; CSenLogger::CreateL(int, int, TDesC16 const &, TDesC16 const &)
+	__10CSenLogger @ 11 NONAME R3UNUSED ; CSenLogger::CSenLogger(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/BWINS/SENLOGGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,13 @@
+EXPORTS
+	?CreateL@CSenLogger@@SAHHHABVTDesC16@@0@Z @ 1 NONAME ; public: static int __cdecl CSenLogger::CreateL(int,int,class TDesC16 const &,class TDesC16 const &)
+	?Destroy@CSenLogger@@SAXH@Z @ 2 NONAME ; public: static void __cdecl CSenLogger::Destroy(int)
+	?Write@CSenLogger@@SAXHHABVTDesC16@@@Z @ 3 NONAME ; public: static void __cdecl CSenLogger::Write(int,int,class TDesC16 const &)
+	?Write@CSenLogger@@SAXHHABVTDesC8@@@Z @ 4 NONAME ; public: static void __cdecl CSenLogger::Write(int,int,class TDesC8 const &)
+	?WriteAll@CSenLogger@@SAXHHABVTDesC16@@@Z @ 5 NONAME ; public: static void __cdecl CSenLogger::WriteAll(int,int,class TDesC16 const &)
+	?WriteAll@CSenLogger@@SAXHHABVTDesC8@@@Z @ 6 NONAME ; public: static void __cdecl CSenLogger::WriteAll(int,int,class TDesC8 const &)
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC16@@@@AAY00PAC@Z @ 7 NONAME ; public: static void __cdecl CSenLogger::WriteFormat(int,int,class TRefByValue<class TDesC16 const >,signed char * (&)[1])
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 8 NONAME ; public: static void __cdecl CSenLogger::WriteFormat(int,int,class TRefByValue<class TDesC16 const >,...)
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC8@@@@AAY00PAC@Z @ 9 NONAME ; public: static void __cdecl CSenLogger::WriteFormat(int,int,class TRefByValue<class TDesC8 const >,signed char * (&)[1])
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 10 NONAME ; public: static void __cdecl CSenLogger::WriteFormat(int,int,class TRefByValue<class TDesC8 const >,...)
+	??0CSenLogger@@AAE@XZ @ 11 NONAME ; private: __thiscall CSenLogger::CSenLogger(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/BWINSCW/SENLOGGERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+EXPORTS
+	?CreateL@CSenLogger@@SAHHHABVTDesC16@@0@Z @ 1 NONAME ; int CSenLogger::CreateL(int, int, class TDesC16 const &, class TDesC16 const &)
+	?Destroy@CSenLogger@@SAXH@Z @ 2 NONAME ; void CSenLogger::Destroy(int)
+	?Write@CSenLogger@@SAXHHABVTDesC16@@@Z @ 3 NONAME ; void CSenLogger::Write(int, int, class TDesC16 const &)
+	?Write@CSenLogger@@SAXHHABVTDesC8@@@Z @ 4 NONAME ; void CSenLogger::Write(int, int, class TDesC8 const &)
+	?WriteAll@CSenLogger@@SAXHHABVTDesC16@@@Z @ 5 NONAME ; void CSenLogger::WriteAll(int, int, class TDesC16 const &)
+	?WriteAll@CSenLogger@@SAXHHABVTDesC8@@@Z @ 6 NONAME ; void CSenLogger::WriteAll(int, int, class TDesC8 const &)
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC16@@@@AAY00PAC@Z @ 7 NONAME ; void CSenLogger::WriteFormat(int, int, class TRefByValue<class TDesC16 const >, signed char * [1] &)
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 8 NONAME ; void CSenLogger::WriteFormat(int, int, class TRefByValue<class TDesC16 const >, ...)
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC8@@@@AAY00PAC@Z @ 9 NONAME ; void CSenLogger::WriteFormat(int, int, class TRefByValue<class TDesC8 const >, signed char * [1] &)
+	?WriteFormat@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 10 NONAME ; void CSenLogger::WriteFormat(int, int, class TRefByValue<class TDesC8 const >, ...)
+	??0CSenLogger@@AAE@XZ @ 11 NONAME ; CSenLogger::CSenLogger(void)
+	?WriteAllWithClientId@CSenLogger@@SAXHHHABVTDesC16@@@Z @ 12 NONAME ; void CSenLogger::WriteAllWithClientId(int, int, int, class TDesC16 const &)
+	?WriteAllWithClientId@CSenLogger@@SAXHHHABVTDesC8@@@Z @ 13 NONAME ; void CSenLogger::WriteAllWithClientId(int, int, int, class TDesC8 const &)
+	?WriteFormatWithClientId@CSenLogger@@SAXHHHV?$TRefByValue@$$CBVTDesC16@@@@AAY00PAC@Z @ 14 NONAME ; void CSenLogger::WriteFormatWithClientId(int, int, int, class TRefByValue<class TDesC16 const >, signed char * [1] &)
+	?WriteFormatWithClientId@CSenLogger@@SAXHHHV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 15 NONAME ; void CSenLogger::WriteFormatWithClientId(int, int, int, class TRefByValue<class TDesC16 const >, ...)
+	?WriteFormatWithClientId@CSenLogger@@SAXHHHV?$TRefByValue@$$CBVTDesC8@@@@AAY00PAC@Z @ 16 NONAME ; void CSenLogger::WriteFormatWithClientId(int, int, int, class TRefByValue<class TDesC8 const >, signed char * [1] &)
+	?WriteFormatWithClientId@CSenLogger@@SAXHHHV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 17 NONAME ; void CSenLogger::WriteFormatWithClientId(int, int, int, class TRefByValue<class TDesC8 const >, ...)
+	?WriteFormatWithClientIdToMainLogs@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC16@@@@AAY00PAC@Z @ 18 NONAME ; void CSenLogger::WriteFormatWithClientIdToMainLogs(int, int, class TRefByValue<class TDesC16 const >, signed char * [1] &)
+	?WriteFormatWithClientIdToMainLogs@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 19 NONAME ; void CSenLogger::WriteFormatWithClientIdToMainLogs(int, int, class TRefByValue<class TDesC16 const >, ...)
+	?WriteFormatWithClientIdToMainLogs@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC8@@@@AAY00PAC@Z @ 20 NONAME ; void CSenLogger::WriteFormatWithClientIdToMainLogs(int, int, class TRefByValue<class TDesC8 const >, signed char * [1] &)
+	?WriteFormatWithClientIdToMainLogs@CSenLogger@@SAXHHV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 21 NONAME ; void CSenLogger::WriteFormatWithClientIdToMainLogs(int, int, class TRefByValue<class TDesC8 const >, ...)
+	?WriteWithClientId@CSenLogger@@SAXHHHABVTDesC16@@@Z @ 22 NONAME ; void CSenLogger::WriteWithClientId(int, int, int, class TDesC16 const &)
+	?WriteWithClientId@CSenLogger@@SAXHHHABVTDesC8@@@Z @ 23 NONAME ; void CSenLogger::WriteWithClientId(int, int, int, class TDesC8 const &)
+	?CreateL@CSenLogger@@SAHHHABVTDesC16@@0W4TFileLoggingMode@@@Z @ 24 NONAME ; int CSenLogger::CreateL(int, int, class TDesC16 const &, class TDesC16 const &, enum TFileLoggingMode)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/eabi/SENLOGGERu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,29 @@
+EXPORTS
+	_ZN10CSenLogger11WriteFormatEii11TRefByValueIK6TDesC8ERSt9__va_list @ 1 NONAME
+	_ZN10CSenLogger11WriteFormatEii11TRefByValueIK6TDesC8Ez @ 2 NONAME
+	_ZN10CSenLogger11WriteFormatEii11TRefByValueIK7TDesC16ERSt9__va_list @ 3 NONAME
+	_ZN10CSenLogger11WriteFormatEii11TRefByValueIK7TDesC16Ez @ 4 NONAME
+	_ZN10CSenLogger5WriteEiiRK6TDesC8 @ 5 NONAME
+	_ZN10CSenLogger5WriteEiiRK7TDesC16 @ 6 NONAME
+	_ZN10CSenLogger7CreateLEiiRK7TDesC16S2_ @ 7 NONAME
+	_ZN10CSenLogger7DestroyEi @ 8 NONAME
+	_ZN10CSenLogger8WriteAllEiiRK6TDesC8 @ 9 NONAME
+	_ZN10CSenLogger8WriteAllEiiRK7TDesC16 @ 10 NONAME
+	_ZTI10CSenLogger @ 11 NONAME ; #<TI>#
+	_ZTV10CSenLogger @ 12 NONAME ; #<VT>#
+	_ZN10CSenLoggerC1Ev @ 13 NONAME
+	_ZN10CSenLoggerC2Ev @ 14 NONAME
+	_ZN10CSenLogger17WriteWithClientIdEiiiRK6TDesC8 @ 15 NONAME
+	_ZN10CSenLogger17WriteWithClientIdEiiiRK7TDesC16 @ 16 NONAME
+	_ZN10CSenLogger20WriteAllWithClientIdEiiiRK6TDesC8 @ 17 NONAME
+	_ZN10CSenLogger20WriteAllWithClientIdEiiiRK7TDesC16 @ 18 NONAME
+	_ZN10CSenLogger23WriteFormatWithClientIdEiii11TRefByValueIK6TDesC8ERSt9__va_list @ 19 NONAME
+	_ZN10CSenLogger23WriteFormatWithClientIdEiii11TRefByValueIK6TDesC8Ez @ 20 NONAME
+	_ZN10CSenLogger23WriteFormatWithClientIdEiii11TRefByValueIK7TDesC16ERSt9__va_list @ 21 NONAME
+	_ZN10CSenLogger23WriteFormatWithClientIdEiii11TRefByValueIK7TDesC16Ez @ 22 NONAME
+	_ZN10CSenLogger33WriteFormatWithClientIdToMainLogsEii11TRefByValueIK6TDesC8ERSt9__va_list @ 23 NONAME
+	_ZN10CSenLogger33WriteFormatWithClientIdToMainLogsEii11TRefByValueIK6TDesC8Ez @ 24 NONAME
+	_ZN10CSenLogger33WriteFormatWithClientIdToMainLogsEii11TRefByValueIK7TDesC16ERSt9__va_list @ 25 NONAME
+	_ZN10CSenLogger33WriteFormatWithClientIdToMainLogsEii11TRefByValueIK7TDesC16Ez @ 26 NONAME
+	_ZN10CSenLogger7CreateLEiiRK7TDesC16S2_16TFileLoggingMode @ 27 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wslogger   
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wslogger.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wslogger.iby)
+PRJ_MMPFILES
+senlogger.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/group/senlogger.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Project specification file for senlogger   
+*
+*/
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenLogger.DLL
+UID             0x1000008d 0x20000399
+#else
+TARGET          wslogger.DLL
+UID             0x1000008d 0x101F974F
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senlogger.cpp
+SOURCE          senloggerdll.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc
+
+SYSTEMINCLUDE   ../../inc
+MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+LIBRARY         efsrv.lib 
+LIBRARY         estor.lib 
+LIBRARY         versit.lib 
+
+//LIBRARY         hash.lib
+
+LANG            SC
+
+#if defined(ARMCC)
+  DEFFILE ../eabi/SENLOGGER.DEF
+#elif defined(WINSCW)
+  DEFFILE ../BWINSCW/SENLOGGER.DEF
+#elif defined(WINS)
+  DEFFILE    ../BWINS/SENLOGGER.DEF
+#else 
+  DEFFILE     ../BMARM/SENLOGGER.DEF
+#endif
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/inc/senlogger.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,363 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Central place for debug-type macros
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_LOGGER_H
+#define SEN_LOGGER_H
+
+// Note that _DEBUG is automatically defined for debug builds
+
+
+#include "sendebug.h"
+#include <senpointermap.h>
+//  INCLUDE
+#include <e32svr.h>
+#include <flogger.h>
+
+// CONSTANTS    
+
+// Utilized by TLS-loggers:
+
+const TInt KMaxLogLevel =2;
+const TInt KNormalLogLevel =1;
+const TInt KMinLogLevel =0;
+
+const TInt KSenServiceConnectionLogChannelBase            = 1000;
+const TInt KSenServiceConnectionLogChannel                =18000;
+const TInt KSenServiceConnectionLogLevel                  =0;
+const TInt KSenServiceConnectionStatusLogChannelBase      = 1100;
+const TInt KSenServiceConnectionStatusLogLevel            = 0;
+_LIT(KSenServiceConnectionLogDir,                         "WsLog");
+_LIT(KSenServiceConnectionLogFile,                        "SenServiceConn.log");
+_LIT(KSenServiceConnectionStatusLogFile,                  "SenServiceConnStatus.log");
+
+const TInt KSenServiceManagerLogChannelBase           = 2000;
+const TInt KSenServiceManagerLogChannel               = 19000;
+const TInt KSenServiceManagerLogLevel                 = 0;
+_LIT(KSenServiceManagerLogDir,                        "WsLog");
+_LIT(KSenServiceManagerLogFile,                       "SenServiceMgr.log");
+
+const TInt KSenHttpChannelLogChannelBase              = 3000;
+const TInt KSenHttpChannelLogLevel                    = 0;
+
+_LIT(KSenHttpChannelLogDir,                           "WsLog");
+_LIT(KSenHttpChannelLogFile,                          "SenHttpChannel.log");
+
+
+const TInt KSenHostletConnectionLogChannelBase              = 4000;
+const TInt KSenHostletConnectionLogLevel                    = 0;
+_LIT(KSenHostletConnectionLogDir,                           "WsLog");
+_LIT(KSenHostletConnectionLogFile,                          "SenHostletConnection.log");
+
+
+const TInt KSenCoreServiceManagerLogChannelBase            = 5000;
+const TInt KSenCoreServiceManagerStatusLogChannelBase      = 1200;
+const TInt KSenCoreServiceManagerLogLevel                  = 0;
+_LIT(KSenCoreServiceManagerLogDir,                         "WsLog");
+_LIT(KSenCoreServiceManagerLogFile,                        "SenCoreServiceManagerTLS.log");
+
+
+const TInt KSenFaultsLogChannel                 = 6000;
+const TInt KSenFaultsLogLevel                   = 0;
+_LIT(KSenFaults,                                "WsLog");
+_LIT(KSenFaultsLog,                             "SenFaults.log");
+
+
+const TInt KSenUtilsLogChannel     =7000;
+const TInt KSenUtilsLogLevel       = 0;
+_LIT(KSenUtils,                    "WsLog");
+_LIT(KSenUtilsLog,                 "SenUtils.log");
+
+
+const TInt KSenServConnLogChannelBase         = 8000;
+const TInt KSenServConnLogLevel               = 0;
+ _LIT(KSenServConn, "WsLog");
+ _LIT(KSenServConnLog, "SenServicePolicy.log");
+
+
+const TInt KSenHttpChannelObserverLogChannelBase         = 9000;
+const TInt KSenHttpChannelObserverLogLevel               = 0;
+_LIT(KSenHttpChannelObserverLogDir,                   "WsLog");
+_LIT(KSenHttpChannelObserverLogFile,                  "SenHttpChannelObserver.log");
+
+
+const TInt KSenLocalTransportLogChannelBase         = 10000;
+const TInt KSenLocalTransportLogLevel               = 0;
+_LIT(KSenLocalTransportLogDir,  "WsLog");
+_LIT(KSenLocalTransportLogFile, "SenLocalTransport.log");
+
+
+
+
+const TInt KSenPolicyLogChannelBase         = 11000;
+const TInt KSenPolicyLogLevel               = 0;
+ _LIT(KSenPolicyLogDir, " WsLog");
+ _LIT(KSenPolicyLogFile, "SenPolicy.log");
+ 
+ 
+ 
+const TInt KSenVtcpLogChannelBase         = 12000;
+const TInt KSenVtcpLogLevel               = 0;
+ _LIT(KSenVtcpLogFileDir, "WsLog");
+ _LIT(KSenVtcpLogFile, "SenVtcp.log");
+ 
+ 
+ 
+const TInt KSenVtcpObserverLogChannelBase         = 13000;
+const TInt KSenVtcpObserverLogLevel               = 0;
+ _LIT(KSenVtcpObserverLogDir,  "WsLog");
+ _LIT(KSenVtcpObserverLogFile, "SenVtcpObserver.log");
+ 
+
+
+const TInt KSenVtcpDispatcherLogChannel             = 13500;
+const TInt KSenVtcpDispatcherLogLevel               = 0;
+ _LIT(KSenVtcpDispatcherLogDir,  "WsLog");
+ _LIT(KSenVtcpDispatcherLogFile, "SenVtcpDispatcher.log");
+
+
+
+const TInt KSenMessagesLogChannel       = 14000;
+const TInt KSenMessagesLogLevel         = 0;
+_LIT(KSenMessages,                      "WsLog");
+_LIT(KSenMessagesLog,                   "SenMessages.log");
+
+
+const TInt KSenCredsLogChannel          = 15000;
+const TInt KSenCredsLogLevelMin         = 1;
+const TInt KSenCredsLogLevelNormal      = 2;
+const TInt KSenCredsLogLevelMax         = 3;
+_LIT(KSenCreds,                         "WsLog");
+_LIT(KSenCredsLog,                      "SenCreds.log");
+
+
+const TInt KSenXmlLogChannel       = 16000;
+const TInt KSenXmlLogLevel         = 0;
+_LIT(KSenXml,                      "WsLog");
+_LIT(KSenXmlLog,                   "SenXml.log");
+
+const TInt KSenClientSessionLogChannelBase              = 17000;
+const TInt KSenClientSessionLogLevel                    =0;
+
+const TInt KHostletTransportLogChannel = 20000;
+const TInt KHostletTransportLogLevel   = 0;    
+_LIT(KLogDir,  "WsLog");
+_LIT(KLogFile, "SenHostletTransport.log");
+
+const TInt KSenNcimLogChannelAsync          = 21000;
+const TInt KSenNcimLogChannelMsg            = 21001;
+const TInt KSenNcimLogChannelGeneral        = 21002;
+const TInt KSenNcimLogLevel               = 0;
+ _LIT(KSenNcimLogDir,  "WsLog");
+ _LIT(KSenNcimLogFileAsync, "SenNcimAsync.log");
+ _LIT(KSenNcimLogFileMsg, "SenNcimMsg.log");
+ _LIT(KSenNcimLogFileGen, "SenNcimGen.log");
+  
+const TInt KSenDispatcherLogChannel     = 22000;
+const TInt KSenDispatcherLogLevel       = 0;
+_LIT(KSenDispactherThread,                    "WsLog");
+_LIT(KSenDispactherThreadLog,                 "SenDispatcherThread.log");
+
+/*
+templates
+ Reqest
+_L8("                           | | | ---------->  Request(Invoke Public)"));
+
+Complet
+_L8("                           | | |                    ---<  Complete"));
+
+Runl
+_L8("                           | | |              <----  RunL          "));
+*/
+#ifdef __ENABLE_ALR__
+const TInt KSenSenMobilityLogChannelBase              = 27000;
+const TInt KSenSenMobilityLogLevel                    =0;
+_LIT(KSenMobilityDir,  "WsLog");
+_LIT(KSenMobilityLog, "SenMobility.log");
+#endif // __ENABLE_ALR__
+
+// WS PAOS HTTP filter
+const TInt KPoasFilterLogChannel        = 30000;
+const TInt KPoasFilterLogLevel          = 0;
+_LIT( KPoasLogFileDir,                  "WsLog" );
+_LIT( KPoasLogFileName,                 "WsPaosFilter.log" );    
+
+// WS HTTP filter (pairs with PAOS filter)
+const TInt KWsHttpFilterLogChannel      = 31000;
+const TInt KWsHttpFilterLogLevel        = 0;
+_LIT( KWsHttpFilterLogFileDir,          "WsLog" );
+_LIT( KWsHttpFilterLogFileName,         "WsHttpFilter.log" );
+
+class CSenLogger;
+class CWSConnectionProxy;
+
+typedef struct
+    {
+    RFileLogger iLog;
+    TInt        iCount;
+    TInt        iChannel;
+    TInt        iLevel;
+    } TLog;
+
+typedef struct 
+    {
+    CSenLogger* iLogger;
+    CWSConnectionProxy* iProxy;
+    } TWsTls;
+
+// CLASS DECLARATION
+class CSenLogger : public CBase
+    {
+    public: // New functions
+        /**
+        * Creates the global ESenDebug object.
+        */
+        IMPORT_C static TInt CreateL(TInt aChannel, TInt aLevel, const TDesC& aLogDir, const TDesC& aLogFileName);
+        IMPORT_C static TInt CreateL(TInt aChannel, TInt aLevel, const TDesC& aLogDir, const TDesC& aLogFileName, TFileLoggingMode aMode);
+
+        /**
+        * Destroys the global ESenDebug object.
+        */
+        IMPORT_C static void Destroy(TInt aChannel);
+        
+        // 8-bit UCS2 variants:
+      IMPORT_C static void Write(TInt aChannel, TInt aLevel, const TDesC8& aText);
+      IMPORT_C static void WriteAll(TInt aChannel, TInt aLevel, const TDesC8& aText);
+      IMPORT_C static void WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt,...);
+      IMPORT_C static void WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList);
+
+      IMPORT_C static void WriteWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC8& aText);
+      IMPORT_C static void WriteAllWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC8& aText);
+      IMPORT_C static void WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt,...);
+      IMPORT_C static void WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList);
+      IMPORT_C static void WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC8> aFmt,...);
+      IMPORT_C static void WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList);
+
+
+        // 16-bit Unicode variants:
+      IMPORT_C static void Write(TInt aChannel, TInt aLevel, const TDesC16& aText);
+      IMPORT_C static void WriteAll(TInt aChannel, TInt aLevel, const TDesC16& aText);
+      IMPORT_C static void WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt,...);
+      IMPORT_C static void WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList);
+
+        // 16-bit Unicode variants:      
+			IMPORT_C static void WriteWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC16& aText);
+	    IMPORT_C static void WriteAllWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC16& aText);
+
+    	IMPORT_C static void WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt,...);
+	    IMPORT_C static void WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList);
+    	IMPORT_C static void WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC16> aFmt,...);
+		IMPORT_C static void WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList);
+        
+    private: // Constructor and destructor
+        TInt ChannelIndex(TInt aChannel) const;
+        static RFileLogger* Logger(TInt aChannel, TInt aLevel);
+    
+        /**
+        * Constructor.
+        */
+        IMPORT_C CSenLogger();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenLogger();
+        
+    private: // Data
+        TInt                iCount;
+        RPointerArray<TLog> iLogs;
+        RSenPointerMap<TInt,TInt> iMap;
+        
+    };
+
+#ifdef _SENDEBUG
+    #define TLSLOG_OPEN(channel, level, logdir, logfile)    CSenLogger::CreateL(channel, level, logdir, logfile)
+    #define TLSLOG_OPEN_TO_MODE(channel, level, logdir, logfile, loggingmode)  CSenLogger::CreateL(channel, level, logdir, logfile, loggingmode)
+    #define TLSLOG(channel, level, string)                  CSenLogger::Write(channel, level, string)
+    #define TLSLOG_L(channel, level, string)                CSenLogger::Write(channel, level, _L(string))
+    #define TLSLOG_FORMAT(parameters)                       CSenLogger::WriteFormat parameters
+    #define TLSLOG_ALL(channel, level, string)              CSenLogger::WriteAll(channel, level, string)
+    #define TLSLOG_CLOSE(channel)                           CSenLogger::Destroy(channel)
+#else // _SENDEBUG not defined:
+    #define TLSLOG_OPEN(channel, level, logdir, logfile)
+    #define TLSLOG_OPEN_TO_MODE(channel, level, logdir, logfile, loggingmode)
+    #define TLSLOG_L(channel, level, string)
+    #define TLSLOG(channel, level, string)
+    #define TLSLOG_ALL(channel, level, string)
+    #define TLSLOG_FORMAT(parameters)
+    #define TLSLOG_CLOSE(channel)
+    #define CSLOG(clientid, level, string)
+    #define CSLOG_L(clientid, level, string)
+    #define CSLOG_FORMAT(parameters)
+    #define CSLOG_ALL(clientid, level, string)
+#endif // _DEBUG
+
+#ifdef _SENDEBUG
+//#ifndef TRUE // disabling CS logs (for testing purposes)
+    //  Core-side, Client Session logging methods:
+//    #define CSLOG_OPEN(clientid, level, logdir, logfile)    CSenLogger::CreateWithClientIdL(channel, level, logdir, logfile)
+    #define CSLOG(clientid, level, string)                  CSenLogger::WriteWithClientId(clientid, KSenClientSessionLogChannelBase+clientid, level, string);\
+                                                            CSenLogger::WriteWithClientId(clientid, KSenCoreServiceManagerLogChannelBase, level, string)
+                                                            
+    #define CSLOG_L(clientid, level, string)                CSenLogger::WriteWithClientId(clientid, KSenClientSessionLogChannelBase+clientid, level, _L(string));\
+                                                            CSenLogger::WriteWithClientId(clientid, KSenCoreServiceManagerLogChannelBase, level, _L(string))
+
+    // aClientId, TInt aLevel, <format_string>, ...
+    #define CSLOG_FORMAT(parameters)                        CSenLogger::WriteFormatWithClientIdToMainLogs parameters
+    
+    #define CSLOG_ALL(clientid, level, string)              CSenLogger::WriteAllWithClientId(clientid, KSenClientSessionLogChannelBase+clientid, level, string);\
+                                                            CSenLogger::WriteAllWithClientId(clientid, KSenCoreServiceManagerLogChannelBase, level, string)
+//    #define CSLOG_CLOSE(clientid)                           CSenLogger::DestroyWithClientId(channel)
+#else // _SENDEBUG not defined:
+//    #define CSLOG_OPEN(clientid, level, logdir, logfile)
+    #define CSLOG(clientid, level, string)
+    #define CSLOG_L(clientid, level, string)
+    #define CSLOG_FORMAT(parameters)
+    #define CSLOG_ALL(clientid, level, string)
+//    #define CSLOG_CLOSE(clientid)   
+#endif // _DEBUG
+
+
+
+#ifdef _SENDEBUG
+    #define CREDLOG_OPEN()                                   CSenLogger::CreateL(KSenCredsLogChannel, KSenCredsLogLevelMax, KSenCreds, KSenCredsLog)
+    #define CREDLOG_L(level, string)                         CSenLogger::Write(KSenCredsLogChannel, level, _L(string))
+    #define CREDLOG(level, string)                           CSenLogger::Write(KSenCredsLogChannel, level, string)
+    #define CREDLOG_ALL(level, string)                       CSenLogger::WriteAll(KSenCredsLogChannel, level, string)
+    #define CREDLOG_FORMAT(parameters)                       CSenLogger::WriteFormat parameters
+    #define CREDLOG_CLOSE()                                  CSenLogger::Destroy(KSenCredsLogChannel)
+#else // _SENDEBUG not defined in <codebase>inc\webservices.hrh file:
+    #define CREDLOG_OPEN()
+    #define CREDLOG_L(level, string)
+    #define CREDLOG(level, string)
+    #define CREDLOG_ALL(level, string)
+    #define CREDLOG_FORMAT(parameters)
+    #define CREDLOG_CLOSE()
+#endif // _DEBUG
+
+#endif // SEN_LOGGER_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/rom/wslogger.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSLOGGER_IBY__
+#define __WSLOGGER_IBY__
+
+// SenLogger
+file=ABI_DIR\BUILD_DIR\SenLogger.dll          PROGRAMS_DIR\SenLogger.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/src/senlogger.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,488 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "senlogger.h"
+//#include <flogger.h>
+#include <f32file.h>
+#include <s32file.h> 
+#include <versit.h>
+
+namespace
+    {
+    const TInt KColumnWidth = 100; // used in WriteAll() methods.
+     _LIT(KPath,"C:\\SenLogConfig.txt");
+     _LIT(  KClientIdFmt,  "- Client[%d] %S");
+     
+     _LIT(  KClientIdFmtNextLine,  "Client(%d):");
+     
+     _LIT8( KClientIdFmt8, "- Client[%d] %S");
+     _LIT8( KClientIdFmtNextLine8, "Client(%d):");
+    }
+
+EXPORT_C TInt CSenLogger::CreateL(TInt aChannel, TInt aLevel, const TDesC& aLogDir, const TDesC& aLogFileName)
+     {
+	 return CreateL( aChannel, aLevel, aLogDir, aLogFileName, EFileLoggingModeOverwrite );
+     }
+EXPORT_C TInt CSenLogger::CreateL(TInt aChannel, TInt aLevel, const TDesC& aLogDir, const TDesC& aLogFileName, TFileLoggingMode aMode)
+    {
+    TInt index(KErrNotFound);
+    //	  CSenLogger* pSenLogger = (CSenLogger*)Dll::Tls();
+    CSenLogger* pSenLogger = NULL;
+    TWsTls* tls = (TWsTls*)Dll::Tls();
+    if( !tls )
+        {
+        tls = new (ELeave) TWsTls();
+        tls->iLogger = NULL;
+        tls->iProxy = NULL;
+        Dll::SetTls( tls );
+        }
+    pSenLogger = tls->iLogger;    
+	if ( !pSenLogger )
+  		{
+  		pSenLogger = new (ELeave) CSenLogger();
+        if ( pSenLogger )
+            {
+            //      		  Dll::SetTls(pSenLogger);
+            tls->iLogger = pSenLogger;
+      		pSenLogger->iCount = 0;
+      		//reading the configuration file for the logging levels!!!
+      		
+      		/*the file has the  following format
+      		* ==============================================================================
+      		  * LogChannel LogLevel
+      		    1000 0
+      		    2000 1
+      		      .
+      		      .
+      		      .
+      		      .
+      		      .
+      		      ....
+      		    18000 2
+      		   this means first you need to write the channel followed by the corresponding logging level after a space
+      		 
+      		 the file has to be located under C:\Config.txt
+      		 * ==============================================================================*/
+      		 
+      
+      		TInt res;
+      	    RFs fs;
+      	    res=fs.Connect();
+      	      if(res==KErrNone)
+				{
+      	     
+                RFileReadStream readStream;
+      	        res=readStream.Open(fs,KPath,EFileRead|EFileStreamText);
+      	   		if(res==KErrNone)
+      	     		{
+      	      		TInt error;
+      	      		TBool result;
+      	      		TInt retVal;
+      	      		
+      	      		CLineReader *readLine = CLineReader::NewL(readStream);
+                    CleanupStack::PushL(readLine);
+      	    		
+                	do
+      	    		    {
+      	      		    result=readLine->ReadLineL(0,error);
+      	      		    
+      	       	        if(result==CLineReader::ELineHasContent)
+      	       			    {
+      	       			    
+              	      		TInt *key = new (ELeave) TInt;
+              	      	
+          	      		
+      	       			    TLex8 lexBuf(readLine->iBufPtr);
+      	     			    retVal = lexBuf.Val(*key);
+      	     			    
+      	     			    if(retVal!=0)
+      	     			        {
+      	     			        delete key;
+                             
+      	     			        continue;
+      	     			        }
+      	     			    else
+      	     			        {
+                  	      		TInt *value = new (ELeave) TInt;
+                  	      
+      	      		
+  	     			            lexBuf.SkipSpace();
+  	     			            retVal=lexBuf.Val(*value);
+  	     			            if(retVal==0)
+	  	     			            {
+  	     			    	        retVal = pSenLogger->iMap.Append(key,value);
+  	     			    	        if(retVal != KErrNone)
+  	     			    	            {
+  	     			    	            delete key;
+  	     			    	            delete value;
+      	    		                   
+  	     			    	            }
+  	     			    	   
+  		     			            }
+  		     			         else
+  		     			            {
+  		     			              delete key;
+  	     			    	          delete value;
+  		     			                
+  		     			            }
+      	     			    	
+      	     			        }
+      	       			    }
+      	       			 
+      	    		    }while(error!=KErrEof);
+      	    		 
+      	    		 CleanupStack::PopAndDestroy(readLine);
+      	      	     readStream.Close();
+      	     		}
+      	     
+      	      	fs.Close();
+      	      	}
+            }
+        else
+            {
+            return KErrGeneral;
+            }
+  		}
+  	else
+  	    {
+  	    index = pSenLogger->ChannelIndex(aChannel);
+  	    }	
+  	
+  	if (index == KErrNotFound)
+  	    {
+  	    TInt channelIndex;
+        TLog* pTLog = new (ELeave) TLog;
+        CleanupStack::PushL(pTLog);
+        pTLog->iChannel=aChannel;
+        channelIndex=pSenLogger->iMap.Find(aChannel);
+        if(channelIndex==KErrNotFound)
+        {
+        pTLog->iLevel=aLevel;
+        }
+        else
+        {
+        pTLog->iLevel=*(pSenLogger->iMap.ValueAt(channelIndex));
+        }
+        pTLog->iCount=1;
+        pTLog->iLog.Connect();
+        pTLog->iLog.CreateLog(aLogDir, aLogFileName, aMode);
+        pTLog->iLog.Write(_L("SenTLSLogger - Log file opened"));
+#ifdef EKA
+        pSenLogger->iLogs.AppendL(pTLog);
+#else
+        User::LeaveIfError(pSenLogger->iLogs.Append(pTLog));
+	  
+#endif
+        CleanupStack::Pop(pTLog);
+  	    }
+  	else
+  	    {
+  	    pSenLogger->iLogs[index]->iCount++;
+  	    }
+  	pSenLogger->iCount++;
+    
+    return KErrNone;
+    }
+
+EXPORT_C void CSenLogger::Destroy(TInt aChannel)
+    {
+    //	CSenLogger* pSenLogger = (CSenLogger*)Dll::Tls();
+    CSenLogger* pSenLogger = NULL;
+    TWsTls* tls = (TWsTls*)Dll::Tls();
+    if( tls )
+        {
+        pSenLogger = tls->iLogger;
+        }
+	if ( pSenLogger )
+	    {
+	    
+	    TInt index = pSenLogger->ChannelIndex(aChannel);
+	    if (index != KErrNotFound)
+	        {
+	        pSenLogger->iLogs[index]->iCount--;
+	        if (pSenLogger->iLogs[index]->iCount <= 0)
+	            {
+                pSenLogger->iLogs[index]->iLog.Write(_L("SenTLSLogger - Log file closed."));
+                pSenLogger->iLogs[index]->iLog.CloseLog();
+                pSenLogger->iLogs[index]->iLog.Close();
+                delete pSenLogger->iLogs[index];
+                pSenLogger->iLogs.Remove(index);
+	            }
+            }
+	        pSenLogger->iCount--;
+	        if (pSenLogger->iCount <= 0)
+	            {
+	            pSenLogger->iLogs.Close();
+	            delete pSenLogger;
+            tls->iLogger = NULL;
+            if( !tls->iLogger && !tls->iProxy )
+                {
+	            delete tls;
+                Dll::FreeTls();	            
+	            }
+	        }
+	    }
+    }
+
+// 16-bit variants    
+    
+EXPORT_C void CSenLogger::Write(TInt aChannel, TInt aLevel, const TDesC16& aText)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if ( pLogger )
+        {
+        pLogger->Write(aText);
+        }
+    }
+
+EXPORT_C void CSenLogger::WriteAll(TInt aChannel, TInt aLevel, const TDesC16& aText)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if ( pLogger )
+        {
+        TInt i = 0;
+        TInt lineAmount(KColumnWidth);
+        TInt length = aText.Length();
+        while(i<aText.Length())
+            {
+            if ( length - i < KColumnWidth )
+                {
+                lineAmount = length - i;    
+                }
+            pLogger->Write(aText.Mid(i, lineAmount));
+            i += KColumnWidth;
+            }
+        }
+    }
+
+EXPORT_C void CSenLogger::WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt,...)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if (pLogger)
+        {
+        VA_LIST list;
+        VA_START(list,aFmt);
+        pLogger->WriteFormat(aFmt, list);
+        }    
+    }
+    
+EXPORT_C void CSenLogger::WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if (pLogger)
+        {
+        pLogger->WriteFormat(aFmt, aList);
+        }    
+    }
+
+
+// Client ID spesific logging methods    
+EXPORT_C void CSenLogger::WriteWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC16& aText)
+    {
+    WriteFormat( aChannel, aLevel, KClientIdFmt, aClientId, &aText );
+    }
+
+EXPORT_C void CSenLogger::WriteAllWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC16& aText)
+    {
+    // Write client id on separate line, for clarity & simplicity
+    WriteFormat( aChannel, aLevel, KClientIdFmtNextLine, aClientId);
+    WriteAll( aChannel, aLevel, aText );
+    }
+
+EXPORT_C void CSenLogger::WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt, ...)
+    {
+    // Write client id on separate line, for clarity & simplicity
+    WriteFormat( aChannel, aLevel, KClientIdFmtNextLine, aClientId);
+    VA_LIST list;
+    VA_START(list,aFmt);
+    WriteFormat( aChannel, aLevel, aFmt, list);
+    }
+    
+EXPORT_C void CSenLogger::WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList)
+    {
+    WriteFormat( aChannel, aLevel, KClientIdFmtNextLine, aClientId);
+    WriteFormat( aChannel, aLevel, aFmt, aList);
+    }
+
+EXPORT_C void CSenLogger::WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC16> aFmt,...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    WriteFormatWithClientId( aClientId, KSenClientSessionLogChannelBase+aClientId, aLevel, aFmt, list );
+    WriteFormatWithClientId( aClientId, KSenCoreServiceManagerLogChannelBase, aLevel, aFmt, list );
+    }
+
+EXPORT_C void CSenLogger::WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList)
+    {
+    WriteFormatWithClientId( aClientId, KSenClientSessionLogChannelBase+aClientId, aLevel, aFmt, aList );
+    WriteFormatWithClientId( aClientId, KSenCoreServiceManagerLogChannelBase, aLevel, aFmt, aList );
+    }
+    
+// 8-bit variants    
+
+EXPORT_C void CSenLogger::Write(TInt aChannel, TInt aLevel, const TDesC8& aText)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if (pLogger)
+        {
+        pLogger->Write(aText);
+        }
+    }
+
+EXPORT_C void CSenLogger::WriteAll(TInt aChannel, TInt aLevel, const TDesC8& aText)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if ( pLogger )
+        {
+        TInt i = 0;
+        TInt lineAmount(KColumnWidth);
+        TInt length = aText.Length();
+        while(i<aText.Length())
+            {
+            if ( length - i < KColumnWidth )
+                {
+                lineAmount = length - i;    
+                }
+            pLogger->Write(aText.Mid(i, lineAmount));
+            i += KColumnWidth;
+            }
+        }
+    }
+
+
+EXPORT_C void CSenLogger::WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt,...)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if (pLogger)
+        {
+        VA_LIST list;
+        VA_START(list,aFmt);
+        pLogger->WriteFormat(aFmt, list);
+        }    
+    }
+
+EXPORT_C void CSenLogger::WriteFormat(TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
+    {
+    RFileLogger* pLogger = Logger(aChannel, aLevel);
+    if (pLogger)
+        {
+        pLogger->WriteFormat(aFmt, aList);
+        }    
+    }
+
+EXPORT_C void CSenLogger::WriteWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC8& aText)
+    {
+    WriteFormat( aChannel, aLevel, KClientIdFmt8, aClientId, &aText );    	
+    }
+
+EXPORT_C void CSenLogger::WriteAllWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, const TDesC8& aText)
+    {
+    // Write client id on separate line, for clarity & simplicity
+    WriteFormat( aChannel, aLevel, KClientIdFmtNextLine8, aClientId);
+    WriteAll( aChannel, aLevel, aText );
+    }
+
+EXPORT_C void CSenLogger::WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt,...)
+    {
+    // Write client id on separate line, for clarity & simplicity
+    WriteFormat( aChannel, aLevel, KClientIdFmtNextLine8, aClientId);
+    VA_LIST list;
+    VA_START(list,aFmt);
+    WriteFormat( aChannel, aLevel, aFmt, list);
+    }
+    
+EXPORT_C void CSenLogger::WriteFormatWithClientId(TInt aClientId, TInt aChannel, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
+    {
+    WriteFormat( aChannel, aLevel, KClientIdFmtNextLine8, aClientId);
+    WriteFormat( aChannel, aLevel, aFmt, aList);
+    }
+
+EXPORT_C void CSenLogger::WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC8> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    WriteFormatWithClientId( aClientId, KSenClientSessionLogChannelBase+aClientId, aLevel, aFmt, list );
+    WriteFormatWithClientId( aClientId, KSenCoreServiceManagerLogChannelBase, aLevel, aFmt, list );
+    }
+
+EXPORT_C void CSenLogger::WriteFormatWithClientIdToMainLogs(TInt aClientId, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
+    {
+    WriteFormatWithClientId( aClientId, KSenClientSessionLogChannelBase+aClientId, aLevel, aFmt, aList );
+    WriteFormatWithClientId( aClientId, KSenCoreServiceManagerLogChannelBase, aLevel, aFmt, aList );
+    }
+
+
+RFileLogger* CSenLogger::Logger(TInt aChannel, TInt aLevel)
+    {
+//    CSenLogger* pSenLogger = (CSenLogger*)Dll::Tls();
+    CSenLogger* pSenLogger = NULL;
+    TWsTls* tls = (TWsTls*)Dll::Tls();
+    if( tls )
+        {
+        pSenLogger = tls->iLogger;
+        }
+	if ( pSenLogger )
+	    {
+        TInt index = pSenLogger->ChannelIndex(aChannel);
+        if (index != KErrNotFound)
+            {
+            if (pSenLogger->iLogs[index]->iLevel >= aLevel)
+                {
+                return &pSenLogger->iLogs[index]->iLog;
+                }
+            }
+	    }
+	return NULL;
+    }
+
+TInt CSenLogger::ChannelIndex(TInt aChannel) const
+    {
+    TInt index(KErrNotFound);
+    TInt count=iLogs.Count();
+    for (TInt i=0; i<count; i++)      	    
+        {
+        if (iLogs[i]->iChannel == aChannel)
+            {
+            index = i;
+            break;
+            }
+        }
+    return index;    
+    }
+
+EXPORT_C CSenLogger::CSenLogger()
+    : iCount(0),iMap(1,1)
+    {
+    }
+
+CSenLogger::~CSenLogger()
+    {
+   
+    iMap.Reset();
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wslogger/src/senloggerdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/BMARM/SENSERVMGRU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	NewLC__18CSenServiceManager @ 1 NONAME R3UNUSED ; CSenServiceManager::NewLC(void)
+	NewL__18CSenServiceManager @ 2 NONAME R3UNUSED ; CSenServiceManager::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/BWINS/SENSERVMGRU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?NewL@CSenServiceManager@@SAPAV1@XZ @ 1 NONAME ; public: static class CSenServiceManager * __cdecl CSenServiceManager::NewL(void)
+	?NewLC@CSenServiceManager@@SAPAV1@XZ @ 2 NONAME ; public: static class CSenServiceManager * __cdecl CSenServiceManager::NewLC(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/BWINSCW/SENSERVMGRU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	?NewL@CSenServiceManager@@SAPAV1@XZ @ 1 NONAME ; class CSenServiceManager * CSenServiceManager::NewL(void)
+	?NewLC@CSenServiceManager@@SAPAV1@XZ @ 2 NONAME ; class CSenServiceManager * CSenServiceManager::NewLC(void)
+	?NewL@CSenServiceManager@@SAPAV1@AAVMSenAuthenticationProvider@@@Z @ 3 NONAME ; class CSenServiceManager * CSenServiceManager::NewL(class MSenAuthenticationProvider &)
+	?NewLC@CSenServiceManager@@SAPAV1@AAVMSenAuthenticationProvider@@@Z @ 4 NONAME ; class CSenServiceManager * CSenServiceManager::NewLC(class MSenAuthenticationProvider &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/eabi/SENSERVMGRu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN18CSenServiceManager4NewLEv @ 1 NONAME
+	_ZN18CSenServiceManager5NewLCEv @ 2 NONAME
+	_ZTI22CSenServiceManagerImpl @ 3 NONAME ; #<TI>#
+	_ZTV22CSenServiceManagerImpl @ 4 NONAME ; #<VT>#
+	_ZN18CSenServiceManager4NewLER26MSenAuthenticationProvider @ 5 NONAME
+	_ZN18CSenServiceManager5NewLCER26MSenAuthenticationProvider @ 6 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsmanager    
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsmanager.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsmanager.iby)
+PRJ_MMPFILES
+senservicemanager.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/group/senservicemanager.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Project definition file
+*
+*/
+
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenServMgr.dll
+UID             0x1000008d 0x101F9702
+#else
+TARGET          wsservmgr.dll
+UID             0x1000008d 0x101F9739
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_CLIENT_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_CLIENT_DLL
+    #endif
+#endif
+
+#if defined(ARMCC)
+DEFFILE ../eabi/SENSERVMGR.DEF
+#elif defined(WINSCW)
+DEFFILE ../BWINSCW/SENSERVMGR.DEF
+#elif defined(WINS)
+  DEFFILE    ../BWINS/SENSERVMGR.DEF
+#else 
+  DEFFILE     ../BMARM/SENSERVMGR.DEF
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senservicemanagerimpl.cpp
+SOURCE          rsenservicemanager.cpp
+SOURCE          senservicemanagerdll.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc // SenDebug.h - filelogging macros
+USERINCLUDE     ../../wslogger/inc // SenLogger.h - TLS based file logging
+USERINCLUDE     ../../wscore/inc  // SenServiceManagerDefines.h  - IPC enumerations
+USERINCLUDE 		../../wsxml/inc								//senxmldebug.h
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LANG        SC
+
+LIBRARY     euser.lib
+LIBRARY     flogger.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY     SenServDesc.lib
+LIBRARY     SenXml.lib
+LIBRARY     SenUtils.lib
+LIBRARY     SenFragment.lib
+LIBRARY     SenLogger.lib
+
+#else
+LIBRARY     wsServDesc.lib
+LIBRARY     wsXml.lib
+LIBRARY     wsUtils.lib
+LIBRARY     wsFragment.lib
+LIBRARY     wsLogger.lib
+
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/inc/rsenservicemanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef R_SEN_SERVICE_MANAGER_CLIENT_H
+#define R_SEN_SERVICE_MANAGER_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+
+#include "SenServiceManager.h" // typedef for RServiceDescriptionArray;
+
+// FORWARD DECLARATIONS
+class CSenXmlServiceDescription;
+class CSenChunk;
+
+// CLASS DECLARATION
+class RSenServiceManager : public RSessionBase
+    {
+    public: // New functions
+        
+        RSenServiceManager();//RFileLogger* aLog);
+        TInt Connect();
+        TVersion Version() const;
+        TInt InstallFramework(TDesC8& aMessage);
+        TInt AssociateService(TDesC8& aServiceID, TDesC8& aProviderID);
+        TInt DissociateService(TDesC8& aServiceID, TDesC8& aProviderID);
+        TInt RegisterIdentityProvider(TDesC8& aMessage);
+        TInt UnregisterIdentityProvider(TDesC8& aMessage);
+
+        /**
+        * Method returns list of matching servicedescriptions, as XML
+        * and delimetted by TAB char.
+        * @param aUri is the URI used as "search mask"
+        * @param aDescriptions if successful, this will be a 
+        *        descriptor pointing to RChunk allocated memory,
+        *        which contains list of returned service descriptions.
+        *        SM implementation should copy this data and then 
+        *        close the related RChunk.
+        * @param aHandle contains handle to newly allocated RChunk
+        *        if method was succesful.
+        * @return KErrNone or some system-wide error code otherwise
+        */
+        TInt ServiceDescriptionsByUriL(CSenChunk& aSenChunk);
+
+        /**
+        * Method returns list of matching servicedescriptions, as XML
+        * and delimetted by TAB char.
+        * @param aPatternAsXml is the XML representation of the
+        *        service description, which is used as "search 
+        *        mask".
+        * @param aDescriptions if successful, this will be a 
+        *        descriptor pointing to RChunk allocated memory,
+        *        which contains list of returned service descriptions.
+        *        SM implementation should copy this data and then 
+        *        close the related RChunk.
+        * @param aHandle contains handle to newly allocated RChunk
+        *        if method was succesful.
+        * @return KErrNone or some system-wide error code otherwise
+        */
+        TInt ServiceDescriptionsByPatternL(CSenChunk& aSenChunk);
+
+        TInt UnregisterServiceDescription(TDesC8& aMessage);
+        TInt RegisterServiceDescription(TDesC8& aMessage);
+        
+        TInt CredentialsL(CSenChunk& aSenChunk);
+        
+        TInt AddCredentialL(CSenChunk& aSenChunk);
+        
+        TInt RemoveCredentialsL(CSenChunk& aSenChunk);
+        
+        TInt IdentityProvidersL(CSenChunk& aSenChunk);
+        TInt ConnectionID();
+        
+        //void SetLog(RFileLogger* aLog);
+        //RFileLogger* Log() const;
+        void SetChannel(TInt aChannel);
+
+    private: // Data
+        //RFileLogger* iLog;
+        TInt         iTLSLogChannel;
+    };
+
+#endif //R_SEN_SERVICE_MANAGER_CLIENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/inc/senservicemanagerimpl.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_CONNECTION_IMPL_H
+#define SEN_SERVICE_CONNECTION_IMPL_H
+
+// INCLUDES
+#include <flogger.h>
+
+#include <SenXmlReader.h>
+#include <MSenServiceDescription.h>
+
+#include "SenServiceManager.h"
+#include "rsenservicemanager.h"
+#include "senservicemanagerinterfaces.h"
+
+// FORWARD DECLARATIONS
+class MSenIdentityManager;
+class CSenGuidGen;
+
+// CLASS DECLARATION
+class CSenServiceManagerImpl : public CSenServiceManager, MSenInternalServiceManager
+    {
+    public: // Constructors and destructor
+
+        static CSenServiceManagerImpl* NewL();
+        static CSenServiceManagerImpl* NewLC();
+        static CSenServiceManagerImpl* NewL(MSenAuthenticationProvider& aAuthProvider);
+        static CSenServiceManagerImpl* NewLC(MSenAuthenticationProvider& aAuthProvider);
+
+        virtual ~CSenServiceManagerImpl();
+
+        // New functions
+
+        /**
+        * Public API to Core Service Manager
+        */
+        virtual TInt ServiceDescriptionsL(  const TDesC8& aUri,
+                                            RServiceDescriptionArray& aList);
+
+        virtual TInt ServiceDescriptionsL(  MSenServiceDescription& aSD,
+                                            RServiceDescriptionArray& aList);
+    
+        virtual TInt RegisterServiceDescriptionL(MSenServiceDescription& aSD);
+
+        virtual TInt UnregisterServiceDescriptionL(MSenServiceDescription& aSD);
+
+        /**
+        * Public API to Identity Manager
+        */
+        virtual TInt RegisterIdentityProviderL(CSenIdentityProvider& aProvider);
+        virtual TInt UnregisterIdentityProviderL(CSenIdentityProvider& aProvider);
+        virtual TInt AssociateServiceL( const TDesC8& aServiceID,
+                                        const TDesC8& aProviderID);
+
+        virtual TInt DissociateServiceL(const TDesC8& aServiceID,
+                                        const TDesC8& aProviderID);
+                                        
+        /**
+        * Currently: available through private header only
+        * Install a ServiceInvocationFramework. The WSF checks if some
+        * custom ECOM exists and adds an entry (Framework element) into
+        * sensessions.xml database.
+        * @param aFrameworkId is the "cue" of the ECOM plug-in being installed
+        * (existing in ECOM default dir)
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrArgument                  The given framework ID was zero length or
+        *                               an invalid descriptor.
+        * KErrNotFound                  Framework with the given ID was not found
+        *                               and couldn't be installed.
+        */
+        virtual TInt InstallFrameworkL(const TDesC8& aFrameworkId);
+
+
+        TInt ExtractCredentialsL(TPtrC8& aCredentials, RCredentialArray& aList,
+                                 RCredentialPropertiesArray& aCredentialPropertiesList);
+                                        
+        virtual TInt CredentialsL(const TDesC8& aEndpoint,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties);
+        
+        virtual TInt CredentialsL(const TDesC8& aEndpoint,
+                                  const CSenIdentityProvider& aIdP,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties);
+        
+        virtual TInt CredentialsL(const TDesC8& aEndpoint,
+                                  const TDesC8& aUserName,
+                                  const TDesC8& aPassword,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties);
+
+        virtual TInt CredentialsL(const MSenServiceDescription& aPattern,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties);
+        
+        virtual TInt CredentialsL(const MSenServiceDescription& aPattern,
+                                  const CSenIdentityProvider& aIdP,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties);
+                                  
+        virtual TInt CredentialsL(const MSenServiceDescription& aPattern,
+                                  const TDesC8& aUserName,
+                                  const TDesC8& aPassword,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties);
+                                  
+        virtual TInt AddCredentialL(const TDesC8& aEndpoint,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential);
+
+        virtual TInt AddCredentialL(const MSenServiceDescription& aPattern,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential);
+                                    
+        virtual TInt AddCredentialL(const TDesC8& aEndpoint,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential,
+                                    const CSenXmlProperties& aCredentialProperties);
+                                        
+        virtual TInt AddCredentialL(const MSenServiceDescription& aPattern,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential,
+                                    const CSenXmlProperties& aCredentialProperties);
+
+        virtual TInt RemoveCredentialsL(const MSenServiceDescription& aPattern,
+                                        const CSenIdentityProvider& aIdP);
+
+        virtual TInt RemoveCredentialsL(const MSenServiceDescription& aPattern,
+                                        const TDesC8& aUserName,
+                                        const TDesC8& aPassword);
+
+        virtual TInt RemoveCredentialsL(const CSenIdentityProvider& aIdP);                                        
+                                        
+        virtual TInt Identifier();      
+        
+        virtual TInt IdentityProvidersL( RIdentityProviderArray& aList );
+        
+        virtual TAny* InterfaceByUid( TUid aUID );
+
+                                        
+    protected: // Functions from base classes
+        
+        // from CActive
+        void RunL();
+        void DoCancel();
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceManagerImpl(MSenAuthenticationProvider* apAuthProvider);
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+            
+        //RFileLogger* Log() const;
+
+        /**
+        * @return KErrNone if successful, and at least one service
+        *         description was extracted. 
+        *         KErrNotFound, if aSDs is a zero-length descriptor,
+        *         or not a single service description could be parsed.
+        */
+        TInt ExtractServiceDescriptionsL(TPtrC8& aSDs,
+                                          RServiceDescriptionArray& aList);
+        TInt ExtractIdentiyProvidersL(TPtrC8& aIdPs, 
+                                          RIdentityProviderArray& aList);
+        TPtrC NextChunkNameL();	//Codescannerwarnings
+
+    private: // Data
+        //RFileLogger iLog;
+        RSenServiceManager iConnection;
+        CSenXmlReader* iReader;
+        TPtr8 iInBuffer;
+        HBufC8* iOutBuf;
+        TPtr8 iOutBuffer;
+        TBool iInitialized;
+        CSenGuidGen* ipGenerator;
+        HBufC* ipChunkName;
+        TInt iChunkNameNumber;
+        MSenAuthenticationProvider* ipAuthProvider;
+        TInt iConnectionID;
+        //TInt iTlsLogChannel;
+        
+    };
+
+#endif //SEN_SERVICE_CONNECTION_IMPL_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/inc/senservicemanagerinterfaces.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        In case that Service Consumer (owner of SC instance) needs
+*                some special, even properietary interface, it can request
+*                an implementation of such interface by calling
+*                CSenServiceManager::InterfaceByUid(UID) and acquire
+*                on of the M-class interfaces defined in this file.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_SERVICE_CONNNECTION_INTERFACES_H
+#define M_SEN_SERVICE_CONNNECTION_INTERFACES_H
+
+// CONST
+// UIDs for the supported, new *service manager interfaces*:
+namespace
+    {
+    const TUid KSenInterfaceUidInternalServiceManager = { 0xE760F698 }; // MSenInternalServiceManager
+    }
+
+typedef RPointerArray<CSenIdentityProvider> RIdentityProviderArray;
+
+// CLASS DECLARATION
+/**
+ * Internal callback interfaces:
+ */
+class MSenInternalServiceManager
+    {
+    public: 
+        virtual TInt IdentityProvidersL( RIdentityProviderArray& aList ) = 0;
+    };
+    
+#endif //  M_SEN_SERVICE_CONNNECTION_INTERFACES_H   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/rom/wsmanager.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSMANAGER_IBY__
+#define __WSMANAGER_IBY__
+
+// ServiceManager
+file=ABI_DIR\BUILD_DIR\SenServMgr.dll           PROGRAMS_DIR\SenServMgr.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/src/rsenservicemanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,542 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <e32math.h>
+
+#include "rsenservicemanager.h"
+
+#include "senservicemanagerdefines.h" // IPC enumerations
+#include "sendebug.h" // internal Utils\inc - filelogging MACROs
+#include "senlogger.h"
+#include "senchunk.h"
+
+#if defined(__WINS__) && !defined(EKA2)
+    static const TUint KServerMinHeapSize =  0x1000;  //  4K
+    static const TUint KServerMaxHeapSize = 0x100000;  // 1000K
+#endif
+
+static TInt StartServerL();
+static TInt CreateServerProcessL();
+
+RSenServiceManager::RSenServiceManager()//(RFileLogger* aLog)
+    : RSessionBase()//,
+      //iLog(aLog)
+    {
+    // No implementation required
+    }
+
+/*
+void RSenServiceManager::SetLog(RFileLogger* aLog)
+    {
+    iLog = aLog;
+    }
+*/    
+void RSenServiceManager::SetChannel(TInt aChannel)
+{
+	iTLSLogChannel = aChannel;
+}
+TInt RSenServiceManager::Connect()
+    {
+    TLSLOG(KSenServiceManagerLogChannel, KMinLogLevel,(_L("RSenServiceManager::Connect")));
+    TInt error(KErrNone);
+    TRAPD (err, error = ::StartServerL();)
+    
+    if (err != KErrNone)
+        {
+        error = err;
+        }
+
+    if (KErrNone == error)
+        {
+        error = CreateSession(KSenServiceManager,
+                              Version(),
+                              KDefaultMessageSlots);
+
+#ifdef _SENDEBUG
+        if(error != KErrNone)
+            {
+            TLSLOG_L(KSenServiceManagerLogChannel, KMinLogLevel,"CSenServiceManagerImpl::DoCancel");
+            TLSLOG_FORMAT((KSenServiceManagerLogChannel, KMinLogLevel , _L8("- CreateSession returned error: (%d)"), error));
+            }
+        else
+            {
+            TLSLOG_L(KSenServiceManagerLogChannel, KMinLogLevel,"RSenServiceManager::Connect");
+            TLSLOG_L(KSenServiceManagerLogChannel, KMinLogLevel,"- CreateSession returned KErrNone");
+            }
+#endif // _SENDEBUG
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        TLSLOG_FORMAT((KSenServiceManagerLogChannel, KMinLogLevel , _L8("RSenServiceManager::Connect - StartServer failed, error: (%d)"),
+                    error));
+        }
+#endif // _SENDEBUG
+
+    return error;
+    }
+
+TVersion RSenServiceManager::Version() const
+    {
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceManager::Version")));
+    return(TVersion(KWsfServMajorVersionNumber,
+                    KWsfServMinorVersionNumber,
+                    KWsfServBuildVersionNumber));
+    }
+
+TInt RSenServiceManager::InstallFramework(TDesC8& aMessage)
+    {
+#ifdef _SENDEBUG
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceManager::InstallFramework")));
+
+    TPtrC8 outBufferLeft = aMessage.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+                        &outBufferLeft, aMessage.Length()));
+#endif // _SENDEBUG
+    TInt length = aMessage.Length();
+
+    TIpcArgs args;
+    args.Set(0,&aMessage);
+    args.Set(1, length);
+
+    return SendReceive(ESenServInstallFramework, args);
+    }
+
+// Note: cannot log here (without TLS), since flogger server session has not yet been opened(!)
+TInt RSenServiceManager::ConnectionID()
+    {
+    TInt connectionID = SendReceive( ESenServConnectionID );
+                   
+//    iTlsLogChannel = KSenHostletConnectionLogChannelBase + connectionID;
+//    TLSLOG_FORMAT((iTlsLogChannel, KSenServiceManagerLogLevel,
+//                   _L("- Connection ID: (%d)"), connectionID));
+    return connectionID;
+    }
+
+
+
+TInt RSenServiceManager::AssociateService( TDesC8& aServiceID, TDesC8& aProviderID )
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::AssociateService");
+
+    TPtrC8 outBufferLeft = aServiceID.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+                    &outBufferLeft, aServiceID.Length()));
+#endif // _SENDEBUG
+
+    TInt servIdLength = aServiceID.Length();
+    TInt provIdLength = aProviderID.Length();
+
+    TIpcArgs args;
+    args.Set(0, &aServiceID);
+    args.Set(1, servIdLength);
+    args.Set(2, &aProviderID);
+    args.Set(3, provIdLength);
+
+    return SendReceive(ESenServAssociateService, args);
+    }
+
+TInt RSenServiceManager::DissociateService(TDesC8& aServiceID,
+                                           TDesC8& aProviderID)
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::DissociateService");
+
+    TPtrC8 outBufferLeft = aServiceID.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+                    &outBufferLeft, aServiceID.Length()));
+#endif // _SENDEBUG
+
+    TInt servIdLength = aServiceID.Length();
+    TInt provIdLength = aProviderID.Length();
+
+    TIpcArgs args;
+    args.Set(0, &aServiceID);
+    args.Set(1, servIdLength);
+    args.Set(2, &aProviderID);
+    args.Set(3, provIdLength);
+
+    return SendReceive(ESenServDissociateService, args);
+    }
+
+TInt RSenServiceManager::RegisterIdentityProvider(TDesC8& aMessage)
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::RegisterIdentityProvider");
+
+    TPtrC8 outBufferLeft = aMessage.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+                        &outBufferLeft, aMessage.Length()));
+#endif // _SENDEBUG
+
+    TInt length = aMessage.Length();
+
+    TIpcArgs args;
+    args.Set(0, &aMessage);
+    args.Set(1, length);
+
+    return SendReceive(ESenServRegisterIdentityProvider, args);
+    }
+
+TInt RSenServiceManager::UnregisterIdentityProvider(TDesC8& aMessage)
+    {
+#ifdef _SENDEBUG
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::UnregisterIdentityProvider");
+
+    TPtrC8 outBufferLeft = aMessage.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+                    &outBufferLeft, aMessage.Length()));
+#endif // _SENDEBUG
+
+    TInt length = aMessage.Length();
+    TIpcArgs args;
+    args.Set(0, &aMessage);
+    args.Set(1, length);
+
+    return SendReceive(ESenServUnregisterIdentityProvider, args);
+    }
+
+
+TInt RSenServiceManager::UnregisterServiceDescription(TDesC8& aMessage)
+    {
+#ifdef _SENDEBUG
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceManager::UnregisterServiceDescription")));
+
+    TPtrC8 outBufferLeft = aMessage.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+                    &outBufferLeft, aMessage.Length()));
+#endif // _SENDEBUG
+
+    TInt length = aMessage.Length();
+    TIpcArgs args;
+    args.Set(0, &aMessage);
+    args.Set(1, length);
+
+    return SendReceive(ESenServUnregisterServiceDescription, args);
+    }
+
+TInt RSenServiceManager::RegisterServiceDescription(TDesC8& aMessage)
+    {
+#ifdef _SENDEBUG
+    TLSLOG(iTLSLogChannel, KMinLogLevel,(_L("RSenServiceManager::RegisterServiceDescription")));
+
+    TPtrC8 outBufferLeft = aMessage.Left(30);
+    TLSLOG_FORMAT((iTLSLogChannel, KNormalLogLevel , _L8("Out: %S ..., length: (%d)"),
+        &outBufferLeft, aMessage.Length()));
+#endif // _SENDEBUG
+
+    TInt length = aMessage.Length();
+    TIpcArgs args;
+    args.Set(0, &aMessage);
+    args.Set(1, length);
+
+    return SendReceive(ESenServRegisterServiceDescription, args);
+    }
+
+TInt RSenServiceManager::ServiceDescriptionsByUriL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::GetServiceDescriptionsByUri");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+
+    TInt retVal = SendReceive(ESenServGetLengthOfServiceDescriptionByUri, args);
+    
+    return retVal;
+    }
+
+TInt RSenServiceManager::IdentityProvidersL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::IdentityProvidersL");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+
+    TInt retVal = SendReceive(ESenServGetIdentityProviders, args);
+    
+    return retVal;
+    }
+
+TInt RSenServiceManager::ServiceDescriptionsByPatternL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::GetServiceDescriptionsByPattern");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+    
+    TInt retVal = SendReceive(ESenServGetLengthOfServiceDescriptionByPattern, args);
+    
+    return retVal;
+    }
+
+TInt RSenServiceManager::CredentialsL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::GetServiceDescriptionsByPattern");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+    
+    TInt retVal = SendReceive(ESenServGetGredentials, args);
+    
+    return retVal;
+    }
+    
+TInt RSenServiceManager::AddCredentialL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::GetServiceDescriptionsByPattern");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+    
+    TInt retVal = SendReceive(ESenServAddCredential, args);
+    
+    return retVal;
+    }
+
+TInt RSenServiceManager::RemoveCredentialsL(CSenChunk& aSenChunk)
+    {
+    TLSLOG_L(iTLSLogChannel, KMinLogLevel,"RSenServiceManager::GetServiceDescriptionsByPattern");
+
+    TIpcArgs args;
+    aSenChunk.ChunkToArgs(args, 0);
+    
+    TInt retVal = SendReceive(ESenServRemoveCredential, args);
+    
+    return retVal;
+    }
+/*
+RFileLogger* RSenServiceManager::Log() const
+    {
+    return iLog;
+    }
+*/
+static TInt StartServerL()
+    {
+    TInt result(KErrNotFound);
+
+#ifdef _SENDEBUG   
+    RFileLogger log;
+    CleanupClosePushL(log);
+    User::LeaveIfError( log.Connect() );
+    log.CreateLog( KSenServiceManagerLogDir, _L("SenStartServer.log"), EFileLoggingModeOverwrite );
+    log.Write(_L("- StartServerL() - Log file opened."));
+#endif // _SENDEBUG
+
+    TFindServer findSenServiceManager(KSenServiceManager);
+    TFullName name;
+
+    result = findSenServiceManager.Next(name);
+    if (result == KErrNone)
+        {
+        // Server already running
+#ifdef _SENDEBUG        
+        log.Write(_L8("- Server already running, KErrNone"));
+        log.CloseLog();
+        CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG        
+        return KErrNone;
+        }
+
+    RSemaphore semaphore;
+    CleanupClosePushL(semaphore);
+
+    // First, try to open the semaphore (if someone else created it already):
+    result = semaphore.OpenGlobal( KSenServiceManagerSemaphoreName );
+    if( result == KErrNone )
+        {
+        // If another client is starting up SEN.EXE, this client should return
+        // to re-connect loop (wait one sec, max 5 times)
+#ifdef _SENDEBUG        
+        log.Write(_L8("- OpenGlobal OK => Another client already starting up SEN.EXE. About to WAIT and RE-CONNECT."));
+#endif        
+        result = KErrServerBusy;
+        }
+    else // could not find any already opened global semaphore ==> it is safe to create new one
+        {   
+        // Semaphore has not yet been created, so instantiate it now(!)
+        result = semaphore.CreateGlobal( KSenServiceManagerSemaphoreName, 0 );
+#ifdef _SENDEBUG        
+        if( result != KErrNone )
+            {
+            log.Write(_L8("CreateGlobal failed"));
+            log.WriteFormat(_L8("- error: %d"), result);
+            }
+#endif        
+        }
+        
+    if (result != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // semaphore.Close()
+#ifdef _SENDEBUG        
+        log.CloseLog();
+#endif // _SENDEBUG        
+        if( result != KErrServerBusy )
+            {
+#ifdef _SENDEBUG        
+            log.Write(_L8("- CreateGlobal failed => Another client already starting up SEN.EXE. About to WAIT and RE-CONNECT."));
+            CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG        
+            result = KErrServerBusy; // again, this error will activate re-connect loop (max 5 times)
+            }
+        return result;
+        }
+
+    result = CreateServerProcessL();
+    if (result != KErrNone)
+        {
+        CleanupStack::PopAndDestroy(); // semaphore.Close()
+#ifdef _SENDEBUG        
+        log.Write(_L8("CreateServerProcessL failed"));
+        log.CloseLog();
+        CleanupStack::PopAndDestroy(); // log.Close()
+#endif // _SENDEBUG         
+        return result;
+        }
+
+    // Now start waiting for signal from server: it will release this semaphore from wait:
+    semaphore.Wait();  
+    CleanupStack::PopAndDestroy(); // semaphore.Close()
+
+#ifdef _SENDEBUG        
+    log.Write(_L("Log file closed."));
+    log.CloseLog();
+    CleanupStack::PopAndDestroy(); // log.Close()    
+#endif // _SENDEBUG
+    return  KErrNone;
+    }
+
+static TInt CreateServerProcessL()
+    {
+    TInt result(KErrNotFound);
+
+#ifdef _SENDEBUG
+    RFileLogger log;
+    CleanupClosePushL(log);
+    User::LeaveIfError( log.Connect() );
+    // Note: this appends to the log created in StartServer()
+    log.CreateLog(KSenServiceManagerLogDir, _L("SenStartServer.log"), EFileLoggingModeAppend);
+    log.Write(_L("- CreateServerProcessL() - invoked by SM."));
+#endif // _SENDEBUG
+
+    const TUidType serverUid(KNullUid, KNullUid, KServerUid3);
+
+#if defined(__WINS__) && !defined(EKA2)
+
+    RLibrary lib;
+    CleanupClosePushL(lib);
+
+    RThread server;
+    CleanupClosePushL(server);
+
+    result = lib.Load(KSenServiceManagerFileName, serverUid);
+
+    if ( result == KErrNone )
+        {
+#ifdef _SENDEB
+        log.Write(_L8("Library successfully loaded, KErrNone"));
+#endif // _SENDEBUG
+
+        //  Get the WinsMain function
+        TLibraryFunction functionWinsMain = lib.Lookup(1);
+
+        //  Call it and cast the result to a thread function
+        TThreadFunction serverThreadFunction = reinterpret_cast<TThreadFunction>(functionWinsMain());
+
+        TName threadName(KSenServiceManagerFileName);
+
+        // Append a random number to make it unique
+        threadName.AppendNum(Math::Random(), EHex);
+
+        result = server.Create( threadName,   // create new server thread
+                                serverThreadFunction, // thread's main function
+                                KDefaultStackSize,
+                                NULL,
+                                &lib,
+                                NULL,
+                                KServerMinHeapSize,
+                                KServerMaxHeapSize,
+                                EOwnerProcess );
+
+        if ( result == KErrNone )
+            {
+            server.SetPriority( EPriorityMore );
+            }
+#ifdef _SENDEBUG
+        else
+            {
+            log.Write(_L8("Failed to create server thread."));
+            }
+#endif // _SENDEBUG
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        log.Write(_L8("Could not load library"));
+        }
+#endif // _SENDEBUG
+
+
+    CleanupStack::Pop(); // server (thread)
+    CleanupStack::PopAndDestroy(); // lib
+    CleanupClosePushL(server);
+
+        
+#else // NON WINS TARGET(S):
+    RProcess server;
+    CleanupClosePushL(server);
+
+    result = server.Create(KSenServiceManagerFileName, KNullDesC, serverUid);	//CodeScannerWarnings
+#endif
+
+    if( result == KErrNone )
+        {
+#ifdef _SENDEBUG
+        log.Write(_L8("Server successfully created, KErrNone"));
+#endif // _SENDEBUG
+        server.Resume();
+        }
+#ifdef _SENDEBUG
+    else
+        {
+        log.Write(_L8("Could not create server"));
+        }
+#endif // _SENDEBUG
+
+    CleanupStack::PopAndDestroy(); // server.Close();
+
+#ifdef _SENDEBUG
+    CleanupStack::PopAndDestroy(); // log.Close();
+#endif
+
+    return result;
+    }
+
+// END OF FILE
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/src/senservicemanagerdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+
+#include "senservicemanagerimpl.h"
+
+// ============================ LOCAL FUNCTIONS ===============================
+
+EXPORT_C CSenServiceManager* CSenServiceManager::NewL()
+    {
+    return CSenServiceManagerImpl::NewL();
+    }
+
+EXPORT_C CSenServiceManager* CSenServiceManager::NewLC()
+    {
+    return CSenServiceManagerImpl::NewLC();
+    }
+
+EXPORT_C CSenServiceManager* CSenServiceManager::NewL(MSenAuthenticationProvider& aAuthProvider)
+    {
+    return CSenServiceManagerImpl::NewL(aAuthProvider);
+    }
+
+EXPORT_C CSenServiceManager* CSenServiceManager::NewLC(MSenAuthenticationProvider& aAuthProvider)
+    {
+    return CSenServiceManagerImpl::NewLC(aAuthProvider);
+    }
+
+CSenServiceManager::CSenServiceManager()
+    : CActive(EPriorityStandard)
+    {
+    }
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmanager/src/senservicemanagerimpl.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1293 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senservicemanagerimpl.h"
+
+#include <SenIdentityProvider.h>
+#include <SenXmlUtils.h>
+#include <SenServiceConnection.h>  // WSF error codes
+
+#include "senservicemanagerdefines.h" // IPC enumerations
+#include "sendebug.h" // filelogging MACROs
+#include "senlogger.h"
+#include "senguidgen.h"
+#include "senchunk.h"
+#include <SenCredential2.h>
+#include "senxmldebug.h"
+
+namespace
+    {
+    const TInt KMaxChunkNumDecimals = 64;
+    _LIT8(KIdentityProviderName, "IdentityProvider");
+    }
+
+
+CSenServiceManagerImpl* CSenServiceManagerImpl::NewL()
+    {
+    CSenServiceManagerImpl* pNew = NewLC();
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceManagerImpl* CSenServiceManagerImpl::NewLC()
+    {
+    CSenServiceManagerImpl* pNew = new (ELeave) CSenServiceManagerImpl(NULL);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenServiceManagerImpl* CSenServiceManagerImpl::NewL(MSenAuthenticationProvider& aAuthProvider)
+    {
+    CSenServiceManagerImpl* pNew = NewLC(aAuthProvider);
+    CleanupStack::Pop();
+    return(pNew) ;
+    }
+
+CSenServiceManagerImpl* CSenServiceManagerImpl::NewLC(MSenAuthenticationProvider& aAuthProvider)
+    {
+    CSenServiceManagerImpl* pNew = new (ELeave) CSenServiceManagerImpl(&aAuthProvider);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+void CSenServiceManagerImpl::ConstructL()
+    {
+    TInt connAttemp = 0;
+    TInt connErr = KErrGeneral;
+
+    ipGenerator = CSenGuidGen::NewL();
+    ipChunkName = HBufC::NewL(KSenUuidMaxLength+KMaxChunkNumDecimals);
+
+    TLSLOG_OPEN(KSenServiceManagerLogChannel, KSenServiceManagerLogLevel, KSenServiceManagerLogDir, KSenServiceManagerLogFile);
+    connErr = iConnection.Connect();
+
+    while ( (connErr == KErrServerBusy || connErr == KErrServerTerminated) 
+                     & connAttemp < KSenMaxClientConnectionOpeningAttempts )
+        {
+        User::After(1000000); // wait for a second if server has been shut down
+        connErr = iConnection.Connect();
+        connAttemp++;
+        }
+    if ( connErr != KErrNone )
+        {
+        User::Leave( connErr );
+        }
+
+    iConnectionID = iConnection.ConnectionID();
+    iConnection.SetChannel(KSenServiceManagerLogChannelBase+iConnectionID);   
+    //iTlsLogChannel = KSenServiceManagerLogChannelBase + iConnectionID;
+
+
+#ifdef _SENDEBUG
+    RThread thread;
+    RProcess process;
+    TFileName logFile;
+    logFile.Append( KSenServiceManagerLogFile().Left(KSenServiceManagerLogFile().Length()-4) ); // exclude ".log" file extension
+    logFile.AppendNum( iConnectionID );
+    logFile.Append( KSenUnderline );
+    logFile.Append( process.Name().Left(32));
+    logFile.Append( KSenUnderline );
+    logFile.Append( thread.Name().Left(20));
+    logFile.Append( KSenServiceManagerLogFile().Right(4) ); // postfix with ".log" file extension
+
+    // Open connection to the file logger server
+    TLSLOG_OPEN(KSenServiceManagerLogChannelBase+iConnectionID, KSenServiceManagerLogLevel, KSenServiceManagerLogDir, logFile);
+    TLSLOG_L(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,"CSenServiceManager::ConstructL - Log file opened");
+    TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Connection ID: (%d)"), iConnectionID));
+    TLSLOG_L(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,"- Service Manager client ready.");
+#endif
+
+    iReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+    }
+
+CSenServiceManagerImpl::CSenServiceManagerImpl(MSenAuthenticationProvider* apAuthProvider)
+:   iConnection(),//&iLog),
+    iReader(NULL),
+    iInBuffer(NULL,0),
+    iOutBuffer(NULL,0),
+    iInitialized(EFalse),
+    ipGenerator(NULL),
+    ipChunkName(NULL),
+    iChunkNameNumber(0),
+    ipAuthProvider(apAuthProvider),
+    iConnectionID(KErrNotReady) //,
+//    iTlsLogChannel(KSenServiceManagerLogChannelBase)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CSenServiceManagerImpl::~CSenServiceManagerImpl()
+    {
+    TLSLOG_L(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,"CSenServiceManagerImpl::~CSenServiceManagerImpl");
+    Cancel(); // Causes call to DoCancel()
+    iConnection.Close();
+
+    delete iReader;
+    delete iOutBuf;
+    delete ipGenerator;
+    delete ipChunkName;
+
+    // Close the log file and the connection to the server.
+    TLSLOG(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,(_L("Log file closed.")));
+    TLSLOG_CLOSE (KSenServiceManagerLogChannelBase+iConnectionID);
+    TLSLOG_CLOSE (KSenServiceManagerLogChannel);
+    }
+
+void CSenServiceManagerImpl::RunL()
+    {
+
+    }
+
+void CSenServiceManagerImpl::DoCancel()
+    {
+    TLSLOG(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceManagerImpl::DoCancel")));
+    }
+
+TInt CSenServiceManagerImpl::Identifier()
+    {
+    return iConnectionID;    
+    }
+
+/*
+RFileLogger* CSenServiceManagerImpl::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+*/
+TPtrC CSenServiceManagerImpl::NextChunkNameL()	//Codescannerwarnings
+    {
+    if(ipChunkName)
+        {
+        iChunkNameNumber++;
+        TPtr chunkname = ipChunkName->Des();
+        chunkname.Zero();
+
+        HBufC* pRandomGuid = ipGenerator->GetRandomGuidLC();
+        TPtr idBuffer = pRandomGuid->Des();
+        if(idBuffer.Length()>KSenUuidPrefixLength)
+            {
+            chunkname.Append(idBuffer.Right(idBuffer.Length()-KSenUuidPrefixLength));
+            }
+        CleanupStack::PopAndDestroy(); // pRandomGuid
+        chunkname.AppendNum(iChunkNameNumber);
+
+        // Remove dashes
+         _LIT(KDash, "-");
+        TInt pos = chunkname.Find(KDash);
+        while (pos != KErrNotFound)
+            {
+            chunkname.Replace(pos, KDash().Length(), KNullDesC);
+            pos = chunkname.Find(KDash);
+            }
+        TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KNormalLogLevel , _L("CSenServiceManagerImpl::NextChunkNameL(): %S"), &chunkname));
+
+        return chunkname;
+        }
+    else
+        {
+        return KNullDesC();
+        }  
+    }
+
+
+
+// Parameter aUri is contract of the service
+TInt CSenServiceManagerImpl::ServiceDescriptionsL(const TDesC8& aUri, 
+                                                  RServiceDescriptionArray& aList)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 descriptions;
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescToChunk(aUri);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.ServiceDescriptionsByUriL(*pSenChunk);
+            if (retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(descriptions);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractServiceDescriptionsL(descriptions, aList);
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk); // Close chunk
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::ServiceDescriptionsL(MSenServiceDescription& aSD,
+                                                  RServiceDescriptionArray& aList)
+    {
+    TInt retVal(KErrNone);
+    
+    HBufC8* pPattern = aSD.AsXmlL();
+    CleanupStack::PushL(pPattern);
+    
+    TPtrC8 descriptions;
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescToChunk(*pPattern);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.ServiceDescriptionsByPatternL(*pSenChunk);
+            if(retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(descriptions);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractServiceDescriptionsL(descriptions, aList);
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk); // Close chunk
+
+    // In any case, destroy the pattern as XML buffer:
+    CleanupStack::PopAndDestroy(); // pPattern
+
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::RegisterServiceDescriptionL(MSenServiceDescription& aSD)
+    {
+    // do not register if both endpoint and contract are 
+    // missing
+    if(aSD.Endpoint().Length()==0 && aSD.Contract().Length()==0)
+        {
+        return KErrSenNoContractNoEndPoint;
+        }
+    
+    else 
+        {
+        _LIT8(KProviderID,"ProviderID");
+        HBufC8* pAsXml = NULL;
+        if ( aSD.DescriptionClassType() ==
+                MSenServiceDescription::EIdentityProvider )
+            {
+            TLSLOG(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,(_L("RegisterServiceDescriptionL with EIdentityProvider ")));
+        
+            CSenIdentityProvider* pIdP = (CSenIdentityProvider*)&aSD;
+        
+            CSenXmlServiceDescription* pSD = CSenXmlServiceDescription::NewLC(
+                    pIdP->Endpoint(),
+                    pIdP->Contract()  );
+        
+            pSD->SetFrameworkIdL( pIdP->FrameworkId() );
+            pSD->AsElement().AddElementL(KProviderID).SetContentL(
+                                                            pIdP->ProviderID() );	//CodeScannerWarnings
+        
+            pAsXml = pSD->AsXmlL(); // leaves if no memory available
+            CleanupStack::PopAndDestroy(); // pSD
+            }
+        else    // ServiceDescription
+            {
+            pAsXml = aSD.AsXmlL(); // leaves if no memory available
+            }
+        
+        CleanupStack::PushL(pAsXml); // must be the first line after if-clause
+        TPtr8 ptr = pAsXml->Des();
+        // now register the XML string (descriptor) to WSF Symbian server:
+        TInt retVal(iConnection.RegisterServiceDescription(ptr));
+        CleanupStack::PopAndDestroy(); // pAsXml
+        
+        return retVal;
+        }
+    }
+
+TInt CSenServiceManagerImpl::UnregisterServiceDescriptionL(
+                                                MSenServiceDescription& aSD)
+    {
+    // do not unregister if both endpoint and contract are 
+    // missing
+    if(aSD.Endpoint().Length()==0 && aSD.Contract().Length()==0)
+        {
+        return KErrSenNoContractNoEndPoint;
+        }
+    else 
+        {
+        HBufC8* pAsXml = NULL;
+        if ( aSD.DescriptionClassType() ==
+            MSenServiceDescription::EIdentityProvider )
+            {
+            TLSLOG(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,(_L("UnregisterServiceDescriptionL with EIdentityProvider ")));
+            
+            CSenIdentityProvider* pIdP = (CSenIdentityProvider*)&aSD;
+            
+            CSenXmlServiceDescription* pSD = 
+                CSenXmlServiceDescription::NewLC(pIdP->Endpoint(),
+                                                 pIdP->Contract());
+            
+            pSD->SetFrameworkIdL( pIdP->FrameworkId() );
+            if(pIdP->ProviderID().Length()>0)
+                {
+		        _LIT8(KProviderID,"ProviderID");
+                CSenElement& providerIdElement = 
+                    pSD->AsElement().AddElementL(KProviderID);	//CodeScannerWarnings
+                providerIdElement.SetContentL(pIdP->ProviderID());
+                }
+            pAsXml = pSD->AsXmlL(); // leaves if no memory available
+            CleanupStack::PopAndDestroy(); // pSD
+            }
+        else    // ServiceDescription
+            {
+            pAsXml = aSD.AsXmlL(); // leaves if no memory available
+            }
+        
+        CleanupStack::PushL(pAsXml); // must be the first line after if-clause
+        TPtr8 ptr = pAsXml->Des();
+        TInt retVal(iConnection.UnregisterServiceDescription(ptr));
+        CleanupStack::PopAndDestroy(); // pAsXml
+        return retVal;
+        }
+    }
+// comment: remote developer interface to identity manager
+TInt CSenServiceManagerImpl::RegisterIdentityProviderL(
+                                            CSenIdentityProvider& aProvider)
+    {
+    HBufC8* provider = aProvider.AsXmlL();
+    TPtr8 ptr = provider->Des();
+    TInt retVal = iConnection.RegisterIdentityProvider(ptr);
+    delete provider;
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::UnregisterIdentityProviderL(
+                                            CSenIdentityProvider& aProvider)
+    {
+    HBufC8* provider = aProvider.AsXmlL();
+    TPtr8 ptr = provider->Des();
+    TInt retVal(iConnection.UnregisterIdentityProvider(ptr));
+    delete provider;
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::AssociateServiceL(const TDesC8& aServiceID,
+                                               const TDesC8& aProviderID)
+    {
+    if (aServiceID.Length() <= 0 || aProviderID.Length() <= 0)
+        {
+        return KErrArgument;
+        }
+    TInt retVal( iConnection.AssociateService(  (TDesC8&)aServiceID,
+                                                (TDesC8&)aProviderID) );
+    return retVal;
+    }
+
+
+TInt CSenServiceManagerImpl::DissociateServiceL(const TDesC8& aServiceID,
+                                                const TDesC8& aProviderID)
+    {
+    if (aServiceID.Length() <= 0 || aProviderID.Length() <= 0)
+        {
+        return KErrArgument;
+        }
+    TInt retVal( iConnection.DissociateService( (TDesC8&)aServiceID,
+                                                (TDesC8&)aProviderID) );
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::InstallFrameworkL(const TDesC8& aFrameworkId)
+    {
+    TLSLOG(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,(_L("CSenServiceManager::InstallFrameworkL")));
+    TLSLOG(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,(aFrameworkId));
+    if (aFrameworkId.Length() <= 0)
+        {
+        return KErrArgument;
+        }
+    TInt retVal( iConnection.InstallFramework((TDesC8&)aFrameworkId) );
+
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::ExtractServiceDescriptionsL(TPtrC8& aSDs, 
+                                                          RServiceDescriptionArray& aList)
+    {
+    TLSLOG_L(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,"CSenServiceManagerImpl::ExtractServiceDescriptionsL");
+    TInt retVal(KErrNotFound);
+
+    
+    if (aSDs.Length() > 0)
+        {
+        TPtrC8 single;
+        TPtrC8 rest;
+        _LIT8(KTab, "\t");
+        TBool loop(ETrue);
+        TInt pos(-1);
+        CSenXmlServiceDescription* desc = NULL;
+        rest.Set(aSDs);
+
+        while (loop)
+            {
+            pos = rest.Find(KTab());
+            if (pos > 0)
+                {
+                desc = CSenXmlServiceDescription::NewLC();
+                iReader->SetContentHandler(*desc);
+                desc->SetReader(*iReader);
+                single.Set(rest.Left(pos));
+
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, desc->ParseL(single));
+                if(leaveCode!=KErrNone)
+                    {
+                    TInt count(aList.Count());
+                    TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("-desc->ParseL(#%d): parsing failed: %d"), count+1, leaveCode));
+                        
+                    CleanupStack::PopAndDestroy(); // desc
+                    if(count == 0)
+                        {
+                        retVal = KErrNotFound; // could not parse single service description
+                        }
+
+                    break;
+                    }
+
+                rest.Set(rest.Mid(pos+1));  // Check
+                retVal = aList.Append(desc);
+                if(retVal == KErrNone)
+                    {
+                    CleanupStack::Pop(); // desc
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy();
+                    }
+                desc = NULL;
+                }
+            else
+                {
+                desc = CSenXmlServiceDescription::NewLC();
+                iReader->SetContentHandler(*desc);
+                desc->SetReader(*iReader);
+
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, desc->ParseL(rest));
+                if(leaveCode!=KErrNone)
+                    {
+                    TInt count(aList.Count());
+                    TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("-desc->ParseL(#%d): parsing failed: %d"), count+1, leaveCode));
+                        
+                    CleanupStack::PopAndDestroy(); // desc
+                    if(count == 0)
+                        {
+                        retVal = KErrNotFound; // could not parse single service description
+                        }
+
+                    break;
+                    }
+                retVal = aList.Append(desc);
+                if(retVal == KErrNone)
+                    {
+                    CleanupStack::Pop(); // desc
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy();
+                    }
+                desc = NULL;
+                break;
+                }
+
+            if (rest.Length() == 0 )
+                {
+                break;
+                }
+
+            }
+        } //  END OF: if aSD.Length() > 0
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::ExtractCredentialsL(TPtrC8& aCredentials, 
+                                                 RCredentialArray& aList,
+                                                 RCredentialPropertiesArray& aCredentialPropertiesList)
+    {
+    TLSLOG_L(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,"CSenServiceManagerImpl::ExtractCredentialsL");
+    TInt retVal(KErrNotFound);
+    
+    if ( aCredentials.Length() > 0 )
+        {
+        TPtrC8 single;
+        TPtrC8 rest;
+        _LIT8(KTab, "\t");
+        _LIT8(KNewline, "\n");
+        _LIT8(KNoProperties, "-");
+
+        TInt pos(KErrNone);
+        CSenCredential2* pCredential = NULL;
+        rest.Set(aCredentials);
+        CSenParser* pParser = CSenParser::NewLC();
+
+        while ( pos != KErrNotFound && rest.Length() > 0 )
+            {
+            pos = rest.Find(KTab());
+            if (pos > 0)
+                {
+                single.Set(rest.Left(pos));
+                }
+            else
+                {
+                single.Set(rest);
+                }
+
+            if ( single.Length() > 0 )
+                {
+                pCredential = CSenCredential2::NewLC();
+
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, pParser->ParseL(single, *pCredential));
+                if ( leaveCode != KErrNone )
+                    {
+                    TInt count(aList.Count());
+                    TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("- Credential(#%d): parsing failed: %d"), count+1, leaveCode));
+                       
+                    CleanupStack::PopAndDestroy(); // desc
+                    if ( count == 0 )
+                        {
+                        retVal = KErrNotFound; // could not parse single credential
+                        }
+
+                    break;
+                    }
+
+                retVal = aList.Append(pCredential);
+                if(retVal == KErrNone)
+                    {
+                    CleanupStack::Pop(); // desc
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy();
+                    }
+
+                rest.Set(rest.Mid(pos+1));  // Check
+
+                pos = rest.Find(KNewline());
+                if (pos > 0)
+                    {
+                    single.Set(rest.Left(pos));
+                    }
+                else
+                    {
+                    single.Set(rest);
+                    }
+                    
+                if ( single == KNoProperties )
+                    {
+                    aCredentialPropertiesList.Append(NULL);
+                    }
+                else
+                    {
+                    if ( single.Length() > 0 )
+                        {
+                        CSenXmlProperties* pCredentialProperties = CSenXmlProperties::NewLC();
+                        pCredentialProperties->SetReader(*iReader);
+                        leaveCode = KErrNone;
+                        TRAP(leaveCode, pCredentialProperties->ReadFromL(single));
+                        if ( leaveCode != KErrNone )
+                            {
+                            TInt count(aList.Count());
+                            TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("- CredentialProperties(#%d): parsing failed: %d"), count+1, leaveCode));
+                                
+                            CleanupStack::PopAndDestroy(pCredentialProperties);
+                            if ( count == 0 )
+                                {
+                                retVal = KErrNotFound; // could not parse single credential
+                                }
+                                
+                            retVal = aCredentialPropertiesList.Append(NULL);
+                            break;
+                            }
+                        
+                        retVal = aCredentialPropertiesList.Append(pCredentialProperties);
+                        if(retVal == KErrNone)
+                            {
+                            CleanupStack::Pop(pCredentialProperties);
+                            }
+                        else
+                            {
+                            CleanupStack::PopAndDestroy(pCredentialProperties);
+                            }
+                        }
+                    else
+                        {
+                        aCredentialPropertiesList.Append(NULL);
+                        }
+                    }
+                    
+                rest.Set(rest.Mid(pos+1));  // Check
+
+                pCredential = NULL;
+                }
+            else
+                {
+                pos = KErrNotFound;
+                }
+            }
+
+        CleanupStack::PopAndDestroy(pParser);
+        } //  END OF: if aCredentials.Length() > 0
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::CredentialsL(const TDesC8& aEndpoint,
+                                          RCredentialArray& aCredentials,
+                                          RCredentialPropertiesArray& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    
+    CSenXmlServiceDescription* pServDesc = CSenXmlServiceDescription::NewLC();
+    pServDesc->SetEndPointL(aEndpoint);
+    
+    retVal = CredentialsL(*pServDesc, aCredentials, aCredentialProperties);
+    
+    CleanupStack::PopAndDestroy(pServDesc);
+    
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::CredentialsL(const TDesC8& aEndpoint,
+                                          const CSenIdentityProvider& aIdP,
+                                          RCredentialArray& aCredentials,
+                                          RCredentialPropertiesArray& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 credentials;
+    
+    CSenXmlServiceDescription* pServDesc = CSenXmlServiceDescription::NewLC();
+    pServDesc->SetEndPointL(aEndpoint);
+    HBufC8* pPatternAsXml = pServDesc->AsXmlL();
+    CleanupStack::PopAndDestroy(pServDesc);
+    CleanupStack::PushL(pPatternAsXml);
+    if( &aIdP == NULL )
+    {
+      return KErrArgument;  
+    }
+
+    HBufC8* pIdPAsXml = ((CSenIdentityProvider&)aIdP).AsXmlL();
+    CleanupStack::PushL(pIdPAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.CredentialsL(*pSenChunk);
+            if (retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(credentials);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractCredentialsL(credentials, aCredentials, aCredentialProperties);
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+    
+    return retVal;    
+    }
+
+TInt CSenServiceManagerImpl::CredentialsL(const TDesC8& aEndpoint,
+                                          const TDesC8& aUserName,
+                                          const TDesC8& aPassword,
+                                          RCredentialArray& aCredentials,
+                                          RCredentialPropertiesArray& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 credentials;
+    
+    CSenXmlServiceDescription* pServDesc = CSenXmlServiceDescription::NewLC();
+    pServDesc->SetEndPointL(aEndpoint);
+    HBufC8* pPatternAsXml = pServDesc->AsXmlL();
+    CleanupStack::PopAndDestroy(pServDesc);
+    CleanupStack::PushL(pPatternAsXml);
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KIdentityProviderName);
+    pIdP->SetUserInfoL(aUserName, aUserName, aPassword);
+    HBufC8* pIdPAsXml = pIdP->AsXmlL();
+    CleanupStack::PopAndDestroy(pIdP);
+    CleanupStack::PushL(pIdPAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.CredentialsL(*pSenChunk);
+            if (retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(credentials);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractCredentialsL(credentials, aCredentials, aCredentialProperties);
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+    
+    return retVal;    
+    }
+
+TInt CSenServiceManagerImpl::CredentialsL(const MSenServiceDescription& aPattern,
+                                          RCredentialArray& aCredentials,
+                                          RCredentialPropertiesArray& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 credentials;
+    
+    if(&aPattern == NULL)
+    {
+      return KErrArgument;  
+    }
+    HBufC8* pPatternAsXml = ((MSenServiceDescription&)aPattern).AsXmlL();
+    CleanupStack::PushL(pPatternAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, KNullDesC8);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.CredentialsL(*pSenChunk);
+            if (retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(credentials);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractCredentialsL(credentials, aCredentials, aCredentialProperties);
+                    }
+                }
+            else if ( retVal == KErrSenNoPermission )
+                {
+                if ( ipAuthProvider )
+                    {
+                    TBool identityProviderCreated = EFalse;
+                    CSenIdentityProvider* pIdP = NULL;
+                    pIdP = (CSenIdentityProvider*)ipAuthProvider->IdentityProviderL();
+                    if ( !pIdP )
+                        {
+                        const TPtrC8 userName = ipAuthProvider->UsernameL();
+                        const TPtrC8 password = ipAuthProvider->PasswordL();
+                        if ( userName != KNullDesC8 &&
+                        	 password != KNullDesC8 )
+                            {
+                            pIdP = CSenIdentityProvider::NewLC(KIdentityProviderName);
+                            pIdP->SetUserInfoL( userName ,
+                            					userName ,
+                            					password );
+                            identityProviderCreated = ETrue;
+                            }
+                        }
+                    
+                    if ( pIdP )
+                        {
+                        HBufC8* pIdPAsXml = pIdP->AsXmlL();
+                        CleanupStack::PushL(pIdPAsXml);
+
+                        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+                        if (retVal == KErrNone)
+                            {
+                            retVal = iConnection.CredentialsL(*pSenChunk);
+                            if (retVal == KErrNone)
+                                {
+                                retVal = pSenChunk->DescFromChunk(credentials);
+                                if(retVal == KErrNone)
+                                    {
+                                    retVal = ExtractCredentialsL(credentials, aCredentials, aCredentialProperties);
+                                    }
+                                }
+                            }
+                        CleanupStack::PopAndDestroy(pIdPAsXml);
+                        if ( identityProviderCreated )
+                            {
+                            CleanupStack::PopAndDestroy(pIdP);
+                            }
+                        //CleanupStack::PopAndDestroy(pIdPAsXml);
+                        }
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+    
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::CredentialsL(const MSenServiceDescription& aPattern,
+                                          const CSenIdentityProvider& aIdP,
+                                          RCredentialArray& aCredentials,
+                                          RCredentialPropertiesArray& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 credentials;
+    
+    if(&aPattern == NULL || &aIdP == NULL)
+    {
+     return KErrArgument;
+    }
+    HBufC8* pPatternAsXml = ((MSenServiceDescription&)aPattern).AsXmlL();
+    CleanupStack::PushL(pPatternAsXml);
+
+    HBufC8* pIdPAsXml = ((CSenIdentityProvider&)aIdP).AsXmlL();
+    CleanupStack::PushL(pIdPAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.CredentialsL(*pSenChunk);
+            if (retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(credentials);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractCredentialsL(credentials, aCredentials, aCredentialProperties);
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+    
+    return retVal;
+    }
+                                  
+TInt CSenServiceManagerImpl::CredentialsL(const MSenServiceDescription& aPattern,
+                                          const TDesC8& aUserName,
+                                          const TDesC8& aPassword,
+                                          RCredentialArray& aCredentials,
+                                          RCredentialPropertiesArray& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 credentials;
+
+    if(&aPattern == NULL) 
+    {
+     return KErrArgument;   
+    }
+    HBufC8* pPatternAsXml = ((MSenServiceDescription&)aPattern).AsXmlL();
+    CleanupStack::PushL(pPatternAsXml);
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KIdentityProviderName);
+    pIdP->SetUserInfoL(aUserName, aUserName, aPassword);
+    HBufC8* pIdPAsXml = pIdP->AsXmlL();
+    CleanupStack::PopAndDestroy(pIdP);
+    CleanupStack::PushL(pIdPAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.CredentialsL(*pSenChunk);
+            if (retVal == KErrNone)
+                {
+                retVal = pSenChunk->DescFromChunk(credentials);
+                if(retVal == KErrNone)
+                    {
+                    retVal = ExtractCredentialsL(credentials, aCredentials, aCredentialProperties);
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+    
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+    
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::AddCredentialL(const MSenServiceDescription& aPattern,
+                                            const CSenIdentityProvider& aIdP,
+                                            const CSenCredential2& aCredential)
+    {
+    TInt retVal(KErrNone);
+    
+    if(&aPattern == NULL || &aIdP == NULL || &aCredential== NULL)
+    {
+      return KErrArgument;  
+    }
+    HBufC8* pPatternAsXml = ((MSenServiceDescription&)aPattern).AsXmlL();
+    CleanupStack::PushL(pPatternAsXml);
+
+    HBufC8* pIdPAsXml = ((CSenIdentityProvider&)aIdP).AsXmlL();
+    CleanupStack::PushL(pIdPAsXml);
+
+    HBufC8* pCredentialAsXml = ((CSenCredential2&)aCredential).AsXmlL();
+    CleanupStack::PushL(pCredentialAsXml);
+    
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        retVal = pSenChunk->DescToChunk(*pCredentialAsXml,  2);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.AddCredentialL(*pSenChunk);
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+
+    CleanupStack::PopAndDestroy(pCredentialAsXml);
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::AddCredentialL(const TDesC8& aEndpoint,
+                                            const CSenIdentityProvider& aIdP,
+                                            const CSenCredential2& aCredential)
+    {
+    CSenXmlServiceDescription* pServDesc = CSenXmlServiceDescription::NewLC();
+    pServDesc->SetEndPointL(aEndpoint);
+    
+    TInt retVal = AddCredentialL(*pServDesc, aIdP, aCredential);
+    
+    CleanupStack::PopAndDestroy(pServDesc);
+
+    return retVal;   
+    }
+
+TInt CSenServiceManagerImpl::AddCredentialL(const MSenServiceDescription& aPattern,
+                                            const CSenIdentityProvider& aIdP,
+                                            const CSenCredential2& aCredential,
+                                            const CSenXmlProperties& aCredentialProperties)
+    {
+    TInt retVal(KErrNone);
+    
+    if(&aPattern == NULL || &aIdP == NULL || &aCredential== NULL || &aCredentialProperties == NULL )
+    {
+      return KErrArgument;  
+    }
+    HBufC8* pPatternAsXml = ((MSenServiceDescription&)aPattern).AsXmlL();
+    CleanupStack::PushL(pPatternAsXml);
+
+    HBufC8* pIdPAsXml = ((CSenIdentityProvider&)aIdP).AsXmlL();
+    CleanupStack::PushL(pIdPAsXml);
+
+    HBufC8* pCredentialAsXml = ((CSenCredential2&)aCredential).AsXmlL();
+    CleanupStack::PushL(pCredentialAsXml);
+
+    HBufC8* pCredentialPropertiesAsXml = ((CSenXmlProperties&)aCredentialProperties).AsUtf8L();
+    CleanupStack::PushL(pCredentialPropertiesAsXml);
+    
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        retVal = pSenChunk->DescToChunk(*pCredentialAsXml,  2);
+        retVal = pSenChunk->DescToChunk(*pCredentialPropertiesAsXml,  3);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.AddCredentialL(*pSenChunk);
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+
+
+    CleanupStack::PopAndDestroy(pCredentialPropertiesAsXml);
+    CleanupStack::PopAndDestroy(pCredentialAsXml);
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::AddCredentialL(const TDesC8& aEndpoint,
+                                            const CSenIdentityProvider& aIdP,
+                                            const CSenCredential2& aCredential,
+                                            const CSenXmlProperties& aCredentialProperties)
+    {
+    CSenXmlServiceDescription* pServDesc = CSenXmlServiceDescription::NewLC();
+    pServDesc->SetEndPointL(aEndpoint);
+    
+    TInt retVal = AddCredentialL(*pServDesc, aIdP, aCredential, aCredentialProperties);
+    
+    CleanupStack::PopAndDestroy(pServDesc);
+
+    return retVal;   
+    }
+
+TInt CSenServiceManagerImpl::RemoveCredentialsL(const CSenIdentityProvider& aIdP)
+    {
+    TInt retVal(KErrNone);
+        
+    if(&aIdP == NULL)
+        {
+        return  KErrArgument; 
+        }
+    
+    HBufC8* pIdPAsXml = ((CSenIdentityProvider&)aIdP).AsXmlL();
+    CleanupStack::PushL(pIdPAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());  //Codescannerwarnings
+    retVal = pSenChunk->CreateChunk();
+    
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(KNullDesC8(), *pIdPAsXml);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.RemoveCredentialsL(*pSenChunk);
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    
+    return retVal;
+
+    }
+TInt CSenServiceManagerImpl::RemoveCredentialsL(const MSenServiceDescription& aPattern,
+                                                const CSenIdentityProvider& aIdP)
+    {
+    TInt retVal(KErrNone);
+    
+    if(&aPattern == NULL || &aIdP == NULL)
+    {
+      return  KErrArgument; 
+    }
+    HBufC8* pPatternAsXml = ((MSenServiceDescription&)aPattern).AsXmlL();
+    CleanupStack::PushL(pPatternAsXml);
+
+    HBufC8* pIdPAsXml = ((CSenIdentityProvider&)aIdP).AsXmlL();
+    CleanupStack::PushL(pIdPAsXml);
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());	//Codescannerwarnings
+    //pSenChunk->SetLogger(Log());
+    retVal = pSenChunk->CreateChunk();
+    
+    if (retVal == KErrNone)
+        {
+        retVal = pSenChunk->DescsToChunk(*pPatternAsXml, *pIdPAsXml);
+        if (retVal == KErrNone)
+            {
+            retVal = iConnection.RemoveCredentialsL(*pSenChunk);
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk);
+
+    CleanupStack::PopAndDestroy(pIdPAsXml);
+    CleanupStack::PopAndDestroy(pPatternAsXml);
+
+    return retVal;
+    }
+
+TInt CSenServiceManagerImpl::RemoveCredentialsL(const MSenServiceDescription& aPattern,
+                                                const TDesC8& aUserName,
+                                                const TDesC8& aPassword)
+    {
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KIdentityProviderName);
+    pIdP->SetUserInfoL(aUserName, aUserName, aPassword);
+    
+    TInt retVal = RemoveCredentialsL(aPattern, *pIdP);
+    
+    CleanupStack::PopAndDestroy(pIdP);
+
+    return retVal;
+    }
+
+
+TInt CSenServiceManagerImpl::IdentityProvidersL( RIdentityProviderArray& aList )
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 descriptions;
+
+    CSenChunk* pSenChunk = CSenChunk::NewLC(NextChunkNameL());
+    retVal = pSenChunk->CreateChunk();
+    if (retVal == KErrNone)
+        {
+        retVal = iConnection.IdentityProvidersL(*pSenChunk);
+        if (retVal == KErrNone)
+            {
+            retVal = pSenChunk->DescFromChunk(descriptions);
+            if(retVal == KErrNone)
+                {
+                retVal = ExtractIdentiyProvidersL(descriptions, aList);
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(pSenChunk); // Close chunk
+    return retVal;
+    }
+TInt CSenServiceManagerImpl::ExtractIdentiyProvidersL(TPtrC8& aIdPs, 
+                                                      RIdentityProviderArray& aList)
+    {
+    TLSLOG_L(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel,"CSenServiceManagerImpl::ExtractIdentiyProvidersL");
+    TInt retVal(KErrNotFound);
+
+    
+    if (aIdPs.Length() > 0)
+        {
+        TPtrC8 single;
+        TPtrC8 rest;
+        _LIT8(KTab, "\t");
+        TBool loop(ETrue);
+        TInt pos(-1);
+        CSenIdentityProvider* idp = NULL;
+        rest.Set(aIdPs);
+
+        while (loop)
+            {
+            pos = rest.Find(KTab());
+            if (pos > 0)
+                {
+                idp = CSenIdentityProvider::NewLC(KNullDesC8);
+                iReader->SetContentHandler(*idp);
+                idp->SetReader(*iReader);
+                single.Set(rest.Left(pos));
+
+                TInt leaveCode(KErrNone);
+                TLSLOG_ALL(KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel, single);
+                TRAP(leaveCode, idp->ParseL(single));
+                if(leaveCode!=KErrNone)
+                    {
+                    TInt count(aList.Count());
+                    TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("-idp->ParseL(#%d): parsing failed: %d"), count+1, leaveCode));
+                        
+                    CleanupStack::PopAndDestroy(); // desc
+                    if(count == 0)
+                        {
+                        retVal = KErrNotFound; // could not parse single service description
+                        }
+
+                    break;
+                    }
+
+                rest.Set(rest.Mid(pos+1));  // Check
+                retVal = aList.Append(idp);
+                if(retVal == KErrNone)
+                    {
+                    CleanupStack::Pop(); // desc
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy();
+                    }
+                idp = NULL;
+                }
+            else
+                {
+                idp = CSenIdentityProvider::NewLC(KNullDesC8);
+                iReader->SetContentHandler(*idp);
+                idp->SetReader(*iReader);
+
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, idp->ParseL(rest));
+                if(leaveCode!=KErrNone)
+                    {
+                    TInt count(aList.Count());
+                    TLSLOG_FORMAT((KSenServiceManagerLogChannelBase+iConnectionID, KMinLogLevel , _L8("-idp->ParseL(#%d): parsing failed: %d"), count+1, leaveCode));
+                        
+                    CleanupStack::PopAndDestroy(); // desc
+                    if(count == 0)
+                        {
+                        retVal = KErrNotFound; // could not parse single service description
+                        }
+
+                    break;
+                    }
+                retVal = aList.Append(idp);
+                if(retVal == KErrNone)
+                    {
+                    CleanupStack::Pop(); // desc
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy();
+                    }
+                idp = NULL;
+                break;
+                }
+
+            if (rest.Length() == 0 )
+                {
+                break;
+                }
+
+            }
+        } //  END OF: if idp.Length() > 0
+    return retVal;
+    }
+TAny* CSenServiceManagerImpl::InterfaceByUid( TUid aUID )
+    {
+    if ( aUID == KSenInterfaceUidInternalServiceManager )
+		{
+		TLSLOG_FORMAT(( KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel , _L8("CSenServiceConnectionImpl::InterfaceByUid(%d) == KSenInterfaceUidInternalServiceManager" ), aUID.iUid ));
+		// Must be cast to M-class  (as the same C-class implements multiple M-classes):
+		MSenInternalServiceManager* manager = (MSenInternalServiceManager*) this;
+		return manager; 
+		}
+    return NULL;
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/BWINSCW/SenMessagesU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,196 @@
+EXPORTS
+	??0CSenMessageBase@@AAE@AAVCSenChunk@@@Z @ 1 NONAME ; CSenMessageBase::CSenMessageBase(class CSenChunk &)
+	??0CSenSoapFault2@@IAE@XZ @ 2 NONAME ; CSenSoapFault2::CSenSoapFault2(void)
+	??0CSenSoapMessage2@@IAE@XZ @ 3 NONAME ; CSenSoapMessage2::CSenSoapMessage2(void)
+	??0CSenSoapMessageDom2@@IAE@XZ @ 4 NONAME ; CSenSoapMessageDom2::CSenSoapMessageDom2(void)
+	??0CSenWsSecurityHeader2@@IAE@XZ @ 5 NONAME ; CSenWsSecurityHeader2::CSenWsSecurityHeader2(void)
+	??1CSenMessageBase@@UAE@XZ @ 6 NONAME ; CSenMessageBase::~CSenMessageBase(void)
+	??1CSenSoapEnvelope2@@UAE@XZ @ 7 NONAME ; CSenSoapEnvelope2::~CSenSoapEnvelope2(void)
+	??1CSenSoapFault2@@UAE@XZ @ 8 NONAME ; CSenSoapFault2::~CSenSoapFault2(void)
+	??1CSenSoapMessage2@@UAE@XZ @ 9 NONAME ; CSenSoapMessage2::~CSenSoapMessage2(void)
+	??1CSenSoapMessageDom2@@UAE@XZ @ 10 NONAME ; CSenSoapMessageDom2::~CSenSoapMessageDom2(void)
+	??1CSenWsSecurityHeader2@@UAE@XZ @ 11 NONAME ; CSenWsSecurityHeader2::~CSenWsSecurityHeader2(void)
+	?AddHeaderL@CSenSoapEnvelope2@@UAE?AVTXmlEngElement@@V2@@Z @ 12 NONAME ; class TXmlEngElement CSenSoapEnvelope2::AddHeaderL(class TXmlEngElement)
+	?AddSecurityTokenL@CSenSoapMessage2@@QAEHABVTDesC8@@@Z @ 13 NONAME ; int CSenSoapMessage2::AddSecurityTokenL(class TDesC8 const &)
+	?BaseConstructL@CSenMessageBase@@IAEXXZ @ 14 NONAME ; void CSenMessageBase::BaseConstructL(void)
+	?BaseConstructL@CSenSoapEnvelope2@@IAEXAAVMSenMessageContext@@@Z @ 15 NONAME ; void CSenSoapEnvelope2::BaseConstructL(class MSenMessageContext &)
+	?BaseConstructL@CSenSoapEnvelope2@@IAEXAAVMSenMessageContext@@W4TSOAPVersion@@@Z @ 16 NONAME ; void CSenSoapEnvelope2::BaseConstructL(class MSenMessageContext &, enum TSOAPVersion)
+	?BaseConstructL@CSenSoapEnvelope2@@IAEXW4TSOAPVersion@@@Z @ 17 NONAME ; void CSenSoapEnvelope2::BaseConstructL(enum TSOAPVersion)
+	?BaseConstructL@CSenSoapEnvelope2@@IAEXXZ @ 18 NONAME ; void CSenSoapEnvelope2::BaseConstructL(void)
+	?BaseConstructL@CSenSoapMessage2@@IAEXAAVMSenMessageContext@@@Z @ 19 NONAME ; void CSenSoapMessage2::BaseConstructL(class MSenMessageContext &)
+	?BaseConstructL@CSenSoapMessage2@@IAEXAAVMSenMessageContext@@W4TSOAPVersion@@@Z @ 20 NONAME ; void CSenSoapMessage2::BaseConstructL(class MSenMessageContext &, enum TSOAPVersion)
+	?BaseConstructL@CSenSoapMessage2@@IAEXAAVMSenMessageContext@@W4TSOAPVersion@@ABVTDesC8@@@Z @ 21 NONAME ; void CSenSoapMessage2::BaseConstructL(class MSenMessageContext &, enum TSOAPVersion, class TDesC8 const &)
+	?BaseConstructL@CSenSoapMessage2@@IAEXW4TSOAPVersion@@@Z @ 22 NONAME ; void CSenSoapMessage2::BaseConstructL(enum TSOAPVersion)
+	?BaseConstructL@CSenSoapMessage2@@IAEXW4TSOAPVersion@@ABVTDesC8@@@Z @ 23 NONAME ; void CSenSoapMessage2::BaseConstructL(enum TSOAPVersion, class TDesC8 const &)
+	?BaseConstructL@CSenSoapMessage2@@IAEXXZ @ 24 NONAME ; void CSenSoapMessage2::BaseConstructL(void)
+	?BaseConstructL@CSenWsSecurityHeader2@@IAEXABVTDesC8@@0VRSenDocument@@VTXmlEngElement@@@Z @ 25 NONAME ; void CSenWsSecurityHeader2::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class RSenDocument, class TXmlEngElement)
+	?BaseConstructL@CSenWsSecurityHeader2@@IAEXABVTDesC8@@VRSenDocument@@VTXmlEngElement@@@Z @ 26 NONAME ; void CSenWsSecurityHeader2::BaseConstructL(class TDesC8 const &, class RSenDocument, class TXmlEngElement)
+	?BaseConstructL@CSenWsSecurityHeader2@@IAEXVRSenDocument@@VTXmlEngElement@@@Z @ 27 NONAME ; void CSenWsSecurityHeader2::BaseConstructL(class RSenDocument, class TXmlEngElement)
+	?BodyAsStringL@CSenSoapEnvelope2@@UAEPAVHBufC8@@XZ @ 28 NONAME ; class HBufC8 * CSenSoapEnvelope2::BodyAsStringL(void)
+	?BodyL@CSenSoapEnvelope2@@UAE?AVTXmlEngElement@@XZ @ 29 NONAME ; class TXmlEngElement CSenSoapEnvelope2::BodyL(void)
+	?ConstructL@CSenSoapFault2@@IAEXAAVTXmlEngElement@@@Z @ 30 NONAME ; void CSenSoapFault2::ConstructL(class TXmlEngElement &)
+	?ConstructL@CSenSoapFault2@@IAEXAAVTXmlEngElement@@AAVRSenDocument@@@Z @ 31 NONAME ; void CSenSoapFault2::ConstructL(class TXmlEngElement &, class RSenDocument &)
+	?ConstructL@CSenSoapFault2@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 32 NONAME ; void CSenSoapFault2::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?Context@CSenSoapEnvelope2@@UAEPAVMSenMessageContext@@XZ @ 33 NONAME ; class MSenMessageContext * CSenSoapEnvelope2::Context(void)
+	?CreateBodyFragmentL@CSenSoapEnvelope2@@MAEPAVCSenFragmentBase@@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 34 NONAME ; class CSenFragmentBase * CSenSoapEnvelope2::CreateBodyFragmentL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?CreateBodyFragmentL@CSenSoapMessageDom2@@MAEPAVCSenFragmentBase@@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 35 NONAME ; class CSenFragmentBase * CSenSoapMessageDom2::CreateBodyFragmentL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?DetachFaultL@CSenSoapEnvelope2@@UAEPAVCSenSoapFault2@@XZ @ 36 NONAME ; class CSenSoapFault2 * CSenSoapEnvelope2::DetachFaultL(void)
+	?Detail@CSenSoapFault2@@QAE?AVTPtrC8@@XZ @ 37 NONAME ; class TPtrC8 CSenSoapFault2::Detail(void)
+	?Direction@CSenSoapEnvelope2@@UAE?AW4TDirection@MSenMessage@@XZ @ 38 NONAME ; enum MSenMessage::TDirection CSenSoapEnvelope2::Direction(void)
+	?FaultActor@CSenSoapFault2@@QAE?AVTPtrC8@@XZ @ 39 NONAME ; class TPtrC8 CSenSoapFault2::FaultActor(void)
+	?FaultCode@CSenSoapFault2@@QAE?AVTPtrC8@@XZ @ 40 NONAME ; class TPtrC8 CSenSoapFault2::FaultCode(void)
+	?FaultL@CSenSoapEnvelope2@@UAEPAVCSenSoapFault2@@XZ @ 41 NONAME ; class CSenSoapFault2 * CSenSoapEnvelope2::FaultL(void)
+	?FaultString@CSenSoapFault2@@QAE?AVTPtrC8@@XZ @ 42 NONAME ; class TPtrC8 CSenSoapFault2::FaultString(void)
+	?FaultSubcode@CSenSoapFault2@@QAE?AVTPtrC8@@XZ @ 43 NONAME ; class TPtrC8 CSenSoapFault2::FaultSubcode(void)
+	?HasBody@CSenSoapEnvelope2@@QAEHXZ @ 44 NONAME ; int CSenSoapEnvelope2::HasBody(void)
+	?HasHeader@CSenSoapEnvelope2@@QAEHXZ @ 45 NONAME ; int CSenSoapEnvelope2::HasHeader(void)
+	?HeaderL@CSenSoapEnvelope2@@UAE?AVTXmlEngElement@@XZ @ 46 NONAME ; class TXmlEngElement CSenSoapEnvelope2::HeaderL(void)
+	?IsFault@CSenSoapEnvelope2@@UAEHXZ @ 47 NONAME ; int CSenSoapEnvelope2::IsFault(void)
+	?IsSafeToCast@CSenSoapEnvelope2@@UAEHW4TClass@MSenMessage@@@Z @ 48 NONAME ; int CSenSoapEnvelope2::IsSafeToCast(enum MSenMessage::TClass)
+	?NewL@CSenMessageBase@@SAPAV1@AAVCSenChunk@@@Z @ 49 NONAME ; class CSenMessageBase * CSenMessageBase::NewL(class CSenChunk &)
+	?NewL@CSenSoapEnvelope2@@SAPAV1@AAVMSenMessageContext@@@Z @ 50 NONAME ; class CSenSoapEnvelope2 * CSenSoapEnvelope2::NewL(class MSenMessageContext &)
+	?NewL@CSenSoapEnvelope2@@SAPAV1@XZ @ 51 NONAME ; class CSenSoapEnvelope2 * CSenSoapEnvelope2::NewL(void)
+	?NewL@CSenSoapFault2@@SAPAV1@AAVTXmlEngElement@@@Z @ 52 NONAME ; class CSenSoapFault2 * CSenSoapFault2::NewL(class TXmlEngElement &)
+	?NewL@CSenSoapFault2@@SAPAV1@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 53 NONAME ; class CSenSoapFault2 * CSenSoapFault2::NewL(class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenSoapFault2@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 54 NONAME ; class CSenSoapFault2 * CSenSoapFault2::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?NewL@CSenSoapMessage2@@SAPAV1@AAVMSenMessageContext@@@Z @ 55 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(class MSenMessageContext &)
+	?NewL@CSenSoapMessage2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@@Z @ 56 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(class MSenMessageContext &, enum TSOAPVersion)
+	?NewL@CSenSoapMessage2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@ABVTDesC8@@@Z @ 57 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(class MSenMessageContext &, enum TSOAPVersion, class TDesC8 const &)
+	?NewL@CSenSoapMessage2@@SAPAV1@W4TSOAPVersion@@@Z @ 58 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(enum TSOAPVersion)
+	?NewL@CSenSoapMessage2@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 59 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(enum TSOAPVersion, class TDesC8 const &)
+	?NewL@CSenSoapMessage2@@SAPAV1@XZ @ 60 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(void)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@AAVMSenMessageContext@@@Z @ 61 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(class MSenMessageContext &)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@@Z @ 62 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(class MSenMessageContext &, enum TSOAPVersion)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@ABVTDesC8@@@Z @ 63 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(class MSenMessageContext &, enum TSOAPVersion, class TDesC8 const &)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@W4TSOAPVersion@@@Z @ 64 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(enum TSOAPVersion)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 65 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(enum TSOAPVersion, class TDesC8 const &)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@XZ @ 66 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(void)
+	?NewL@CSenWsSecurityHeader2@@SAPAV1@ABVTDesC8@@0VRSenDocument@@VTXmlEngElement@@@Z @ 67 NONAME ; class CSenWsSecurityHeader2 * CSenWsSecurityHeader2::NewL(class TDesC8 const &, class TDesC8 const &, class RSenDocument, class TXmlEngElement)
+	?NewL@CSenWsSecurityHeader2@@SAPAV1@ABVTDesC8@@VRSenDocument@@VTXmlEngElement@@@Z @ 68 NONAME ; class CSenWsSecurityHeader2 * CSenWsSecurityHeader2::NewL(class TDesC8 const &, class RSenDocument, class TXmlEngElement)
+	?NewL@CSenWsSecurityHeader2@@SAPAV1@VRSenDocument@@VTXmlEngElement@@@Z @ 69 NONAME ; class CSenWsSecurityHeader2 * CSenWsSecurityHeader2::NewL(class RSenDocument, class TXmlEngElement)
+	?NewLC@CSenMessageBase@@SAPAV1@AAVCSenChunk@@@Z @ 70 NONAME ; class CSenMessageBase * CSenMessageBase::NewLC(class CSenChunk &)
+	?NewLC@CSenSoapEnvelope2@@SAPAV1@AAVMSenMessageContext@@@Z @ 71 NONAME ; class CSenSoapEnvelope2 * CSenSoapEnvelope2::NewLC(class MSenMessageContext &)
+	?NewLC@CSenSoapEnvelope2@@SAPAV1@XZ @ 72 NONAME ; class CSenSoapEnvelope2 * CSenSoapEnvelope2::NewLC(void)
+	?NewLC@CSenSoapMessage2@@SAPAV1@AAVMSenMessageContext@@@Z @ 73 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(class MSenMessageContext &)
+	?NewLC@CSenSoapMessage2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@@Z @ 74 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(class MSenMessageContext &, enum TSOAPVersion)
+	?NewLC@CSenSoapMessage2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@ABVTDesC8@@@Z @ 75 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(class MSenMessageContext &, enum TSOAPVersion, class TDesC8 const &)
+	?NewLC@CSenSoapMessage2@@SAPAV1@W4TSOAPVersion@@@Z @ 76 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(enum TSOAPVersion)
+	?NewLC@CSenSoapMessage2@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 77 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(enum TSOAPVersion, class TDesC8 const &)
+	?NewLC@CSenSoapMessage2@@SAPAV1@XZ @ 78 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(void)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@AAVMSenMessageContext@@@Z @ 79 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(class MSenMessageContext &)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@@Z @ 80 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(class MSenMessageContext &, enum TSOAPVersion)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@AAVMSenMessageContext@@W4TSOAPVersion@@ABVTDesC8@@@Z @ 81 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(class MSenMessageContext &, enum TSOAPVersion, class TDesC8 const &)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@W4TSOAPVersion@@@Z @ 82 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(enum TSOAPVersion)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 83 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(enum TSOAPVersion, class TDesC8 const &)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@XZ @ 84 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(void)
+	?NewLC@CSenWsSecurityHeader2@@SAPAV1@ABVTDesC8@@0VRSenDocument@@VTXmlEngElement@@@Z @ 85 NONAME ; class CSenWsSecurityHeader2 * CSenWsSecurityHeader2::NewLC(class TDesC8 const &, class TDesC8 const &, class RSenDocument, class TXmlEngElement)
+	?NewLC@CSenWsSecurityHeader2@@SAPAV1@ABVTDesC8@@VRSenDocument@@VTXmlEngElement@@@Z @ 86 NONAME ; class CSenWsSecurityHeader2 * CSenWsSecurityHeader2::NewLC(class TDesC8 const &, class RSenDocument, class TXmlEngElement)
+	?NewLC@CSenWsSecurityHeader2@@SAPAV1@VRSenDocument@@VTXmlEngElement@@@Z @ 87 NONAME ; class CSenWsSecurityHeader2 * CSenWsSecurityHeader2::NewLC(class RSenDocument, class TXmlEngElement)
+	?NewSecurityHeaderLC@CSenSoapMessage2@@MAEPAVCSenWsSecurityHeader2@@PBVTDesC8@@VRSenDocument@@VTXmlEngElement@@@Z @ 88 NONAME ; class CSenWsSecurityHeader2 * CSenSoapMessage2::NewSecurityHeaderLC(class TDesC8 const *, class RSenDocument, class TXmlEngElement)
+	?OnEndElementL@CSenSoapEnvelope2@@MAEXABVRTagInfo@Xml@@H@Z @ 89 NONAME ; void CSenSoapEnvelope2::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnStartElementL@CSenSoapEnvelope2@@MAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 90 NONAME ; void CSenSoapEnvelope2::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?ParseHeaderL@CSenSoapEnvelope2@@MAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 91 NONAME ; void CSenSoapEnvelope2::ParseHeaderL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?ParseHeaderL@CSenSoapMessage2@@MAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 92 NONAME ; void CSenSoapMessage2::ParseHeaderL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?Properties@CSenSoapEnvelope2@@UAEPAVMSenProperties@@XZ @ 93 NONAME ; class MSenProperties * CSenSoapEnvelope2::Properties(void)
+	?SetBodyL@CSenSoapEnvelope2@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 94 NONAME ; class TPtrC8 CSenSoapEnvelope2::SetBodyL(class TDesC8 const &)
+	?SetBodyL@CSenSoapEnvelope2@@UAE?AVTXmlEngElement@@V2@@Z @ 95 NONAME ; class TXmlEngElement CSenSoapEnvelope2::SetBodyL(class TXmlEngElement)
+	?SetContext@CSenSoapEnvelope2@@UAEHPAVMSenMessageContext@@@Z @ 96 NONAME ; int CSenSoapEnvelope2::SetContext(class MSenMessageContext *)
+	?SetProperties@CSenSoapEnvelope2@@UAEHPAVMSenProperties@@@Z @ 97 NONAME ; int CSenSoapEnvelope2::SetProperties(class MSenProperties *)
+	?SetSecurityHeaderL@CSenSoapMessage2@@QAEXABVTDesC8@@@Z @ 98 NONAME ; void CSenSoapMessage2::SetSecurityHeaderL(class TDesC8 const &)
+	?SetSoapActionL@CSenSoapEnvelope2@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 99 NONAME ; class TPtrC8 CSenSoapEnvelope2::SetSoapActionL(class TDesC8 const &)
+	?SoapAction@CSenSoapEnvelope2@@UAE?AVTPtrC8@@XZ @ 100 NONAME ; class TPtrC8 CSenSoapEnvelope2::SoapAction(void)
+	?SoapVersion@CSenSoapEnvelope2@@UAE?AW4TSOAPVersion@@XZ @ 101 NONAME ; enum TSOAPVersion CSenSoapEnvelope2::SoapVersion(void)
+	?TimestampL@CSenWsSecurityHeader2@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 102 NONAME ; int CSenWsSecurityHeader2::TimestampL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?TimestampL@CSenWsSecurityHeader2@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 103 NONAME ; int CSenWsSecurityHeader2::TimestampL(class TDesC8 const &, class HBufC8 * &)
+	?TxnId@CSenSoapEnvelope2@@UAEHXZ @ 104 NONAME ; int CSenSoapEnvelope2::TxnId(void)
+	?Type@CSenSoapEnvelope2@@UAE?AW4TClass@MSenMessage@@XZ @ 105 NONAME ; enum MSenMessage::TClass CSenSoapEnvelope2::Type(void)
+	?Type@CSenSoapMessage2@@UAE?AW4TClass@MSenMessage@@XZ @ 106 NONAME ; enum MSenMessage::TClass CSenSoapMessage2::Type(void)
+	?Type@CSenSoapMessageDom2@@UAE?AW4TClass@MSenMessage@@XZ @ 107 NONAME ; enum MSenMessage::TClass CSenSoapMessageDom2::Type(void)
+	?UsernameTokenL@CSenWsSecurityHeader2@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@@Z @ 108 NONAME ; class HBufC8 * CSenWsSecurityHeader2::UsernameTokenL(class CSenIdentityProvider &)
+	?UsernameTokenL@CSenWsSecurityHeader2@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@W4TPasswordType@1@@Z @ 109 NONAME ; class HBufC8 * CSenWsSecurityHeader2::UsernameTokenL(class CSenIdentityProvider &, enum CSenWsSecurityHeader2::TPasswordType)
+	?UsernameTokenL@CSenWsSecurityHeader2@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 110 NONAME ; int CSenWsSecurityHeader2::UsernameTokenL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader2@@SAHABVTDesC8@@0W4TPasswordType@1@AAPAVHBufC8@@@Z @ 111 NONAME ; int CSenWsSecurityHeader2::UsernameTokenL(class TDesC8 const &, class TDesC8 const &, enum CSenWsSecurityHeader2::TPasswordType, class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader2@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 112 NONAME ; int CSenWsSecurityHeader2::UsernameTokenL(class TDesC8 const &, class HBufC8 * &)
+	?XmlNs@CSenWsSecurityHeader2@@UAE?AVTPtrC8@@XZ @ 113 NONAME ; class TPtrC8 CSenWsSecurityHeader2::XmlNs(void)
+	?XmlNsPrefix@CSenWsSecurityHeader2@@UAE?AVTPtrC8@@XZ @ 114 NONAME ; class TPtrC8 CSenWsSecurityHeader2::XmlNsPrefix(void)
+	?BaseConstructL@CSenSoapEnvelope2@@IAEXAAV1@@Z @ 115 NONAME ; void CSenSoapEnvelope2::BaseConstructL(class CSenSoapEnvelope2 &)
+	?CloneL@CSenSoapEnvelope2@@UAEPAVMSenMessage@@XZ @ 116 NONAME ; class MSenMessage * CSenSoapEnvelope2::CloneL(void)
+	?NewL@CSenSoapEnvelope2@@SAPAV1@AAV1@@Z @ 117 NONAME ; class CSenSoapEnvelope2 * CSenSoapEnvelope2::NewL(class CSenSoapEnvelope2 &)
+	?NewLC@CSenSoapEnvelope2@@SAPAV1@AAV1@@Z @ 118 NONAME ; class CSenSoapEnvelope2 * CSenSoapEnvelope2::NewLC(class CSenSoapEnvelope2 &)
+	?BaseConstructL@CSenSoapMessage2@@IAEXAAV1@@Z @ 119 NONAME ; void CSenSoapMessage2::BaseConstructL(class CSenSoapMessage2 &)
+	?CloneL@CSenSoapMessage2@@UAEPAVMSenMessage@@XZ @ 120 NONAME ; class MSenMessage * CSenSoapMessage2::CloneL(void)
+	?CloneL@CSenSoapMessageDom2@@UAEPAVMSenMessage@@XZ @ 121 NONAME ; class MSenMessage * CSenSoapMessageDom2::CloneL(void)
+	?NewL@CSenSoapMessage2@@SAPAV1@AAV1@@Z @ 122 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewL(class CSenSoapMessage2 &)
+	?NewL@CSenSoapMessageDom2@@SAPAV1@AAV1@@Z @ 123 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewL(class CSenSoapMessageDom2 &)
+	?NewLC@CSenSoapMessage2@@SAPAV1@AAV1@@Z @ 124 NONAME ; class CSenSoapMessage2 * CSenSoapMessage2::NewLC(class CSenSoapMessage2 &)
+	?NewLC@CSenSoapMessageDom2@@SAPAV1@AAV1@@Z @ 125 NONAME ; class CSenSoapMessageDom2 * CSenSoapMessageDom2::NewLC(class CSenSoapMessageDom2 &)
+	??0CSenAtomEntry@@IAE@XZ @ 126 NONAME ; CSenAtomEntry::CSenAtomEntry(void)
+	??0CSenAtomFeed@@IAE@XZ @ 127 NONAME ; CSenAtomFeed::CSenAtomFeed(void)
+	??1CSenAtomEntry@@UAE@XZ @ 128 NONAME ; CSenAtomEntry::~CSenAtomEntry(void)
+	??1CSenAtomFeed@@UAE@XZ @ 129 NONAME ; CSenAtomFeed::~CSenAtomFeed(void)
+	??1CSenAtomMessage@@UAE@XZ @ 130 NONAME ; CSenAtomMessage::~CSenAtomMessage(void)
+	?AddCategoryL@CSenAtomMessage@@QAEXABVTDesC8@@00@Z @ 131 NONAME ; void CSenAtomMessage::AddCategoryL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddContributorL@CSenAtomMessage@@QAEXABVTDesC8@@00@Z @ 132 NONAME ; void CSenAtomMessage::AddContributorL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddEntryL@CSenAtomFeed@@QAEHAAVCSenAtomEntry@@@Z @ 133 NONAME ; int CSenAtomFeed::AddEntryL(class CSenAtomEntry &)
+	?AddLinkL@CSenAtomMessage@@QAEXABVTDesC8@@00000@Z @ 134 NONAME ; void CSenAtomMessage::AddLinkL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AttributeCountL@CSenAtomMessage@@QAEHABVTDesC8@@0@Z @ 135 NONAME ; int CSenAtomMessage::AttributeCountL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenAtomEntry@@IAEXXZ @ 136 NONAME ; void CSenAtomEntry::BaseConstructL(void)
+	?BaseConstructL@CSenAtomFeed@@IAEXXZ @ 137 NONAME ; void CSenAtomFeed::BaseConstructL(void)
+	?CategoryCountL@CSenAtomMessage@@QAEHXZ @ 138 NONAME ; int CSenAtomMessage::CategoryCountL(void)
+	?CloneL@CSenAtomMessage@@UAEPAVMSenMessage@@XZ @ 139 NONAME ; class MSenMessage * CSenAtomMessage::CloneL(void)
+	?Context@CSenAtomMessage@@UAEPAVMSenMessageContext@@XZ @ 140 NONAME ; class MSenMessageContext * CSenAtomMessage::Context(void)
+	?ContributorCountL@CSenAtomMessage@@QAEHXZ @ 141 NONAME ; int CSenAtomMessage::ContributorCountL(void)
+	?CreateBodyFragmentL@CSenAtomMessage@@UAEPAVCSenFragmentBase@@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVTXmlEngElement@@AAVRSenDocument@@@Z @ 142 NONAME ; class CSenFragmentBase * CSenAtomMessage::CreateBodyFragmentL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class TXmlEngElement &, class RSenDocument &)
+	?Direction@CSenAtomMessage@@UAE?AW4TDirection@MSenMessage@@XZ @ 143 NONAME ; enum MSenMessage::TDirection CSenAtomMessage::Direction(void)
+	?Entry@CSenAtomFeed@@QBEPAVCSenAtomEntry@@H@Z @ 144 NONAME ; class CSenAtomEntry * CSenAtomFeed::Entry(int) const
+	?EntryCount@CSenAtomFeed@@QAEHXZ @ 145 NONAME ; int CSenAtomFeed::EntryCount(void)
+	?GetGeneratorL@CSenAtomFeed@@QAE?AVTXmlEngElement@@XZ @ 146 NONAME ; class TXmlEngElement CSenAtomFeed::GetGeneratorL(void)
+	?IconL@CSenAtomFeed@@QAEABVTDesC8@@XZ @ 147 NONAME ; class TDesC8 const & CSenAtomFeed::IconL(void)
+	?Id@CSenAtomMessage@@QBE_JXZ @ 148 NONAME ; long long CSenAtomMessage::Id(void) const
+	?IdTag@CSenAtomMessage@@QBEABVTDesC8@@XZ @ 149 NONAME ; class TDesC8 const & CSenAtomMessage::IdTag(void) const
+	?IsSafeToCast@CSenAtomMessage@@UAEHW4TClass@MSenMessage@@@Z @ 150 NONAME ; int CSenAtomMessage::IsSafeToCast(enum MSenMessage::TClass)
+	?LinkCountL@CSenAtomMessage@@QAEHXZ @ 151 NONAME ; int CSenAtomMessage::LinkCountL(void)
+	?LogoL@CSenAtomFeed@@QAEABVTDesC8@@XZ @ 152 NONAME ; class TDesC8 const & CSenAtomFeed::LogoL(void)
+	?NewL@CSenAtomEntry@@SAPAV1@XZ @ 153 NONAME ; class CSenAtomEntry * CSenAtomEntry::NewL(void)
+	?NewL@CSenAtomFeed@@SAPAV1@_J@Z @ 154 NONAME ; class CSenAtomFeed * CSenAtomFeed::NewL(long long)
+	?NewLC@CSenAtomEntry@@SAPAV1@XZ @ 155 NONAME ; class CSenAtomEntry * CSenAtomEntry::NewLC(void)
+	?NewLC@CSenAtomFeed@@SAPAV1@_J@Z @ 156 NONAME ; class CSenAtomFeed * CSenAtomFeed::NewLC(long long)
+	?OnContentL@CSenAtomEntry@@UAEXABVTDesC8@@H@Z @ 157 NONAME ; void CSenAtomEntry::OnContentL(class TDesC8 const &, int)
+	?OnContentL@CSenAtomFeed@@UAEXABVTDesC8@@H@Z @ 158 NONAME ; void CSenAtomFeed::OnContentL(class TDesC8 const &, int)
+	?OnEndElementL@CSenAtomEntry@@UAEXABVRTagInfo@Xml@@H@Z @ 159 NONAME ; void CSenAtomEntry::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnEndElementL@CSenAtomFeed@@UAEXABVRTagInfo@Xml@@H@Z @ 160 NONAME ; void CSenAtomFeed::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnEndElementL@CSenAtomMessage@@UAEXABVRTagInfo@Xml@@H@Z @ 161 NONAME ; void CSenAtomMessage::OnEndElementL(class Xml::RTagInfo const &, int)
+	?OnStartElementL@CSenAtomEntry@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 162 NONAME ; void CSenAtomEntry::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnStartElementL@CSenAtomFeed@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 163 NONAME ; void CSenAtomFeed::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?OnStartElementL@CSenAtomMessage@@UAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@H@Z @ 164 NONAME ; void CSenAtomMessage::OnStartElementL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &, int)
+	?ParseEntryL@CSenAtomFeed@@IAEXABVRTagInfo@Xml@@ABV?$RArray@VRAttribute@Xml@@@@@Z @ 165 NONAME ; void CSenAtomFeed::ParseEntryL(class Xml::RTagInfo const &, class RArray<class Xml::RAttribute> const &)
+	?Properties@CSenAtomMessage@@UAEPAVMSenProperties@@XZ @ 166 NONAME ; class MSenProperties * CSenAtomMessage::Properties(void)
+	?Published@CSenAtomMessage@@QBEABVTDesC8@@XZ @ 167 NONAME ; class TDesC8 const & CSenAtomMessage::Published(void) const
+	?RemoveAuthorL@CSenAtomMessage@@QAEXXZ @ 168 NONAME ; void CSenAtomMessage::RemoveAuthorL(void)
+	?RemoveByAttributeL@CSenAtomMessage@@QAEXABVTDesC8@@000@Z @ 169 NONAME ; void CSenAtomMessage::RemoveByAttributeL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?RemoveBySubtagL@CSenAtomMessage@@QAEXABVTDesC8@@000@Z @ 170 NONAME ; void CSenAtomMessage::RemoveBySubtagL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?RemoveCategoryL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 171 NONAME ; void CSenAtomMessage::RemoveCategoryL(class TDesC8 const &)
+	?RemoveContributorL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 172 NONAME ; void CSenAtomMessage::RemoveContributorL(class TDesC8 const &)
+	?RemoveEntryL@CSenAtomFeed@@QAEXAAVCSenAtomEntry@@@Z @ 173 NONAME ; void CSenAtomFeed::RemoveEntryL(class CSenAtomEntry &)
+	?RemoveEntryL@CSenAtomFeed@@QAEXABVTDesC8@@@Z @ 174 NONAME ; void CSenAtomFeed::RemoveEntryL(class TDesC8 const &)
+	?RemoveLinkL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 175 NONAME ; void CSenAtomMessage::RemoveLinkL(class TDesC8 const &)
+	?RemoveLinkL@CSenAtomMessage@@QAEXH@Z @ 176 NONAME ; void CSenAtomMessage::RemoveLinkL(int)
+	?RightsL@CSenAtomMessage@@QAEABVTDesC8@@XZ @ 177 NONAME ; class TDesC8 const & CSenAtomMessage::RightsL(void)
+	?SetAuthorL@CSenAtomMessage@@QAEXABVTDesC8@@00@Z @ 178 NONAME ; void CSenAtomMessage::SetAuthorL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetContext@CSenAtomMessage@@UAEHPAVMSenMessageContext@@@Z @ 179 NONAME ; int CSenAtomMessage::SetContext(class MSenMessageContext *)
+	?SetGeneratorL@CSenAtomFeed@@QAEXABVTDesC8@@00@Z @ 180 NONAME ; void CSenAtomFeed::SetGeneratorL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetIconL@CSenAtomFeed@@QAEXABVTDesC8@@@Z @ 181 NONAME ; void CSenAtomFeed::SetIconL(class TDesC8 const &)
+	?SetIdTagL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 182 NONAME ; void CSenAtomMessage::SetIdTagL(class TDesC8 const &)
+	?SetLogoL@CSenAtomFeed@@QAEXABVTDesC8@@@Z @ 183 NONAME ; void CSenAtomFeed::SetLogoL(class TDesC8 const &)
+	?SetProperties@CSenAtomMessage@@UAEHPAVMSenProperties@@@Z @ 184 NONAME ; int CSenAtomMessage::SetProperties(class MSenProperties *)
+	?SetPublishedL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 185 NONAME ; void CSenAtomMessage::SetPublishedL(class TDesC8 const &)
+	?SetRightsL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 186 NONAME ; void CSenAtomMessage::SetRightsL(class TDesC8 const &)
+	?SetSubtitleL@CSenAtomFeed@@QAEXABVTDesC8@@@Z @ 187 NONAME ; void CSenAtomFeed::SetSubtitleL(class TDesC8 const &)
+	?SetTitleL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 188 NONAME ; void CSenAtomMessage::SetTitleL(class TDesC8 const &)
+	?SetUpdatedL@CSenAtomMessage@@QAEXABVTDesC8@@@Z @ 189 NONAME ; void CSenAtomMessage::SetUpdatedL(class TDesC8 const &)
+	?SubtitleL@CSenAtomFeed@@QAEABVTDesC8@@XZ @ 190 NONAME ; class TDesC8 const & CSenAtomFeed::SubtitleL(void)
+	?Title@CSenAtomMessage@@QBEABVTDesC8@@XZ @ 191 NONAME ; class TDesC8 const & CSenAtomMessage::Title(void) const
+	?TxnId@CSenAtomMessage@@UAEHXZ @ 192 NONAME ; int CSenAtomMessage::TxnId(void)
+	?Type@CSenAtomMessage@@UAE?AW4TClass@MSenMessage@@XZ @ 193 NONAME ; enum MSenMessage::TClass CSenAtomMessage::Type(void)
+	?Updated@CSenAtomMessage@@QBEABVTDesC8@@XZ @ 194 NONAME ; class TDesC8 const & CSenAtomMessage::Updated(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/eabi/SenMessagesu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,294 @@
+EXPORTS
+	_ZN14CSenSoapFault210ConstructLER14TXmlEngElement @ 1 NONAME
+	_ZN14CSenSoapFault210ConstructLER14TXmlEngElementR12RSenDocument @ 2 NONAME
+	_ZN14CSenSoapFault210ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 3 NONAME
+	_ZN14CSenSoapFault210FaultActorEv @ 4 NONAME
+	_ZN14CSenSoapFault211FaultStringEv @ 5 NONAME
+	_ZN14CSenSoapFault212FaultSubcodeEv @ 6 NONAME
+	_ZN14CSenSoapFault24NewLER14TXmlEngElement @ 7 NONAME
+	_ZN14CSenSoapFault24NewLER14TXmlEngElementR12RSenDocument @ 8 NONAME
+	_ZN14CSenSoapFault24NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 9 NONAME
+	_ZN14CSenSoapFault26DetailEv @ 10 NONAME
+	_ZN14CSenSoapFault29FaultCodeEv @ 11 NONAME
+	_ZN14CSenSoapFault2C1Ev @ 12 NONAME
+	_ZN14CSenSoapFault2C2Ev @ 13 NONAME
+	_ZN14CSenSoapFault2D0Ev @ 14 NONAME
+	_ZN14CSenSoapFault2D1Ev @ 15 NONAME
+	_ZN14CSenSoapFault2D2Ev @ 16 NONAME
+	_ZN15CSenMessageBase14BaseConstructLEv @ 17 NONAME
+	_ZN15CSenMessageBase4NewLER9CSenChunk @ 18 NONAME
+	_ZN15CSenMessageBase5NewLCER9CSenChunk @ 19 NONAME
+	_ZN15CSenMessageBaseC1ER9CSenChunk @ 20 NONAME
+	_ZN15CSenMessageBaseC2ER9CSenChunk @ 21 NONAME
+	_ZN15CSenMessageBaseD0Ev @ 22 NONAME
+	_ZN15CSenMessageBaseD1Ev @ 23 NONAME
+	_ZN15CSenMessageBaseD2Ev @ 24 NONAME
+	_ZN16CSenSoapMessage212ParseHeaderLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 25 NONAME
+	_ZN16CSenSoapMessage214BaseConstructLE12TSOAPVersion @ 26 NONAME
+	_ZN16CSenSoapMessage214BaseConstructLE12TSOAPVersionRK6TDesC8 @ 27 NONAME
+	_ZN16CSenSoapMessage214BaseConstructLER18MSenMessageContext @ 28 NONAME
+	_ZN16CSenSoapMessage214BaseConstructLER18MSenMessageContext12TSOAPVersion @ 29 NONAME
+	_ZN16CSenSoapMessage214BaseConstructLER18MSenMessageContext12TSOAPVersionRK6TDesC8 @ 30 NONAME
+	_ZN16CSenSoapMessage214BaseConstructLEv @ 31 NONAME
+	_ZN16CSenSoapMessage217AddSecurityTokenLERK6TDesC8 @ 32 NONAME
+	_ZN16CSenSoapMessage218SetSecurityHeaderLERK6TDesC8 @ 33 NONAME
+	_ZN16CSenSoapMessage219NewSecurityHeaderLCEPK6TDesC812RSenDocument14TXmlEngElement @ 34 NONAME
+	_ZN16CSenSoapMessage24NewLE12TSOAPVersion @ 35 NONAME
+	_ZN16CSenSoapMessage24NewLE12TSOAPVersionRK6TDesC8 @ 36 NONAME
+	_ZN16CSenSoapMessage24NewLER18MSenMessageContext @ 37 NONAME
+	_ZN16CSenSoapMessage24NewLER18MSenMessageContext12TSOAPVersion @ 38 NONAME
+	_ZN16CSenSoapMessage24NewLER18MSenMessageContext12TSOAPVersionRK6TDesC8 @ 39 NONAME
+	_ZN16CSenSoapMessage24NewLEv @ 40 NONAME
+	_ZN16CSenSoapMessage24TypeEv @ 41 NONAME
+	_ZN16CSenSoapMessage25NewLCE12TSOAPVersion @ 42 NONAME
+	_ZN16CSenSoapMessage25NewLCE12TSOAPVersionRK6TDesC8 @ 43 NONAME
+	_ZN16CSenSoapMessage25NewLCER18MSenMessageContext @ 44 NONAME
+	_ZN16CSenSoapMessage25NewLCER18MSenMessageContext12TSOAPVersion @ 45 NONAME
+	_ZN16CSenSoapMessage25NewLCER18MSenMessageContext12TSOAPVersionRK6TDesC8 @ 46 NONAME
+	_ZN16CSenSoapMessage25NewLCEv @ 47 NONAME
+	_ZN16CSenSoapMessage2C1Ev @ 48 NONAME
+	_ZN16CSenSoapMessage2C2Ev @ 49 NONAME
+	_ZN16CSenSoapMessage2D0Ev @ 50 NONAME
+	_ZN16CSenSoapMessage2D1Ev @ 51 NONAME
+	_ZN16CSenSoapMessage2D2Ev @ 52 NONAME
+	_ZN17CSenSoapEnvelope210AddHeaderLE14TXmlEngElement @ 53 NONAME
+	_ZN17CSenSoapEnvelope210PropertiesEv @ 54 NONAME
+	_ZN17CSenSoapEnvelope210SetContextEP18MSenMessageContext @ 55 NONAME
+	_ZN17CSenSoapEnvelope210SoapActionEv @ 56 NONAME
+	_ZN17CSenSoapEnvelope211SoapVersionEv @ 57 NONAME
+	_ZN17CSenSoapEnvelope212DetachFaultLEv @ 58 NONAME
+	_ZN17CSenSoapEnvelope212IsSafeToCastEN11MSenMessage6TClassE @ 59 NONAME
+	_ZN17CSenSoapEnvelope212ParseHeaderLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 60 NONAME
+	_ZN17CSenSoapEnvelope213BodyAsStringLEv @ 61 NONAME
+	_ZN17CSenSoapEnvelope213OnEndElementLERKN3Xml8RTagInfoEi @ 62 NONAME
+	_ZN17CSenSoapEnvelope213SetPropertiesEP14MSenProperties @ 63 NONAME
+	_ZN17CSenSoapEnvelope214BaseConstructLE12TSOAPVersion @ 64 NONAME
+	_ZN17CSenSoapEnvelope214BaseConstructLER18MSenMessageContext @ 65 NONAME
+	_ZN17CSenSoapEnvelope214BaseConstructLER18MSenMessageContext12TSOAPVersion @ 66 NONAME
+	_ZN17CSenSoapEnvelope214BaseConstructLEv @ 67 NONAME
+	_ZN17CSenSoapEnvelope214SetSoapActionLERK6TDesC8 @ 68 NONAME
+	_ZN17CSenSoapEnvelope215OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 69 NONAME
+	_ZN17CSenSoapEnvelope219CreateBodyFragmentLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 70 NONAME
+	_ZN17CSenSoapEnvelope24NewLER18MSenMessageContext @ 71 NONAME
+	_ZN17CSenSoapEnvelope24NewLEv @ 72 NONAME
+	_ZN17CSenSoapEnvelope24TypeEv @ 73 NONAME
+	_ZN17CSenSoapEnvelope25BodyLEv @ 74 NONAME
+	_ZN17CSenSoapEnvelope25NewLCER18MSenMessageContext @ 75 NONAME
+	_ZN17CSenSoapEnvelope25NewLCEv @ 76 NONAME
+	_ZN17CSenSoapEnvelope25TxnIdEv @ 77 NONAME
+	_ZN17CSenSoapEnvelope26FaultLEv @ 78 NONAME
+	_ZN17CSenSoapEnvelope27ContextEv @ 79 NONAME
+	_ZN17CSenSoapEnvelope27HasBodyEv @ 80 NONAME
+	_ZN17CSenSoapEnvelope27HeaderLEv @ 81 NONAME
+	_ZN17CSenSoapEnvelope27IsFaultEv @ 82 NONAME
+	_ZN17CSenSoapEnvelope28SetBodyLE14TXmlEngElement @ 83 NONAME
+	_ZN17CSenSoapEnvelope28SetBodyLERK6TDesC8 @ 84 NONAME
+	_ZN17CSenSoapEnvelope29DirectionEv @ 85 NONAME
+	_ZN17CSenSoapEnvelope29HasHeaderEv @ 86 NONAME
+	_ZN17CSenSoapEnvelope2D0Ev @ 87 NONAME
+	_ZN17CSenSoapEnvelope2D1Ev @ 88 NONAME
+	_ZN17CSenSoapEnvelope2D2Ev @ 89 NONAME
+	_ZN19CSenSoapMessageDom219CreateBodyFragmentLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 90 NONAME
+	_ZN19CSenSoapMessageDom24NewLE12TSOAPVersion @ 91 NONAME
+	_ZN19CSenSoapMessageDom24NewLE12TSOAPVersionRK6TDesC8 @ 92 NONAME
+	_ZN19CSenSoapMessageDom24NewLER18MSenMessageContext @ 93 NONAME
+	_ZN19CSenSoapMessageDom24NewLER18MSenMessageContext12TSOAPVersion @ 94 NONAME
+	_ZN19CSenSoapMessageDom24NewLER18MSenMessageContext12TSOAPVersionRK6TDesC8 @ 95 NONAME
+	_ZN19CSenSoapMessageDom24NewLEv @ 96 NONAME
+	_ZN19CSenSoapMessageDom24TypeEv @ 97 NONAME
+	_ZN19CSenSoapMessageDom25NewLCE12TSOAPVersion @ 98 NONAME
+	_ZN19CSenSoapMessageDom25NewLCE12TSOAPVersionRK6TDesC8 @ 99 NONAME
+	_ZN19CSenSoapMessageDom25NewLCER18MSenMessageContext @ 100 NONAME
+	_ZN19CSenSoapMessageDom25NewLCER18MSenMessageContext12TSOAPVersion @ 101 NONAME
+	_ZN19CSenSoapMessageDom25NewLCER18MSenMessageContext12TSOAPVersionRK6TDesC8 @ 102 NONAME
+	_ZN19CSenSoapMessageDom25NewLCEv @ 103 NONAME
+	_ZN19CSenSoapMessageDom2C1Ev @ 104 NONAME
+	_ZN19CSenSoapMessageDom2C2Ev @ 105 NONAME
+	_ZN19CSenSoapMessageDom2D0Ev @ 106 NONAME
+	_ZN19CSenSoapMessageDom2D1Ev @ 107 NONAME
+	_ZN19CSenSoapMessageDom2D2Ev @ 108 NONAME
+	_ZN21CSenWsSecurityHeader210TimestampLERK6TDesC8RP6HBufC8 @ 109 NONAME
+	_ZN21CSenWsSecurityHeader210TimestampLERK6TDesC8S2_RP6HBufC8 @ 110 NONAME
+	_ZN21CSenWsSecurityHeader211XmlNsPrefixEv @ 111 NONAME
+	_ZN21CSenWsSecurityHeader214BaseConstructLE12RSenDocument14TXmlEngElement @ 112 NONAME
+	_ZN21CSenWsSecurityHeader214BaseConstructLERK6TDesC812RSenDocument14TXmlEngElement @ 113 NONAME
+	_ZN21CSenWsSecurityHeader214BaseConstructLERK6TDesC8S2_12RSenDocument14TXmlEngElement @ 114 NONAME
+	_ZN21CSenWsSecurityHeader214UsernameTokenLER20CSenIdentityProvider @ 115 NONAME
+	_ZN21CSenWsSecurityHeader214UsernameTokenLER20CSenIdentityProviderNS_13TPasswordTypeE @ 116 NONAME
+	_ZN21CSenWsSecurityHeader214UsernameTokenLERK6TDesC8RP6HBufC8 @ 117 NONAME
+	_ZN21CSenWsSecurityHeader214UsernameTokenLERK6TDesC8S2_NS_13TPasswordTypeERP6HBufC8 @ 118 NONAME
+	_ZN21CSenWsSecurityHeader214UsernameTokenLERK6TDesC8S2_RP6HBufC8 @ 119 NONAME
+	_ZN21CSenWsSecurityHeader24NewLE12RSenDocument14TXmlEngElement @ 120 NONAME
+	_ZN21CSenWsSecurityHeader24NewLERK6TDesC812RSenDocument14TXmlEngElement @ 121 NONAME
+	_ZN21CSenWsSecurityHeader24NewLERK6TDesC8S2_12RSenDocument14TXmlEngElement @ 122 NONAME
+	_ZN21CSenWsSecurityHeader25NewLCE12RSenDocument14TXmlEngElement @ 123 NONAME
+	_ZN21CSenWsSecurityHeader25NewLCERK6TDesC812RSenDocument14TXmlEngElement @ 124 NONAME
+	_ZN21CSenWsSecurityHeader25NewLCERK6TDesC8S2_12RSenDocument14TXmlEngElement @ 125 NONAME
+	_ZN21CSenWsSecurityHeader25XmlNsEv @ 126 NONAME
+	_ZN21CSenWsSecurityHeader2C1Ev @ 127 NONAME
+	_ZN21CSenWsSecurityHeader2C2Ev @ 128 NONAME
+	_ZN21CSenWsSecurityHeader2D0Ev @ 129 NONAME
+	_ZN21CSenWsSecurityHeader2D1Ev @ 130 NONAME
+	_ZN21CSenWsSecurityHeader2D2Ev @ 131 NONAME
+	_ZTI14CSenSoapFault2 @ 132 NONAME ; #<TI>#
+	_ZTI15CSenMessageBase @ 133 NONAME ; #<TI>#
+	_ZTI16CSenSoapMessage2 @ 134 NONAME ; #<TI>#
+	_ZTI17CSenSoapEnvelope2 @ 135 NONAME ; #<TI>#
+	_ZTI19CSenSoapMessageDom2 @ 136 NONAME ; #<TI>#
+	_ZTI21CSenWsSecurityHeader2 @ 137 NONAME ; #<TI>#
+	_ZTV14CSenSoapFault2 @ 138 NONAME ; #<VT>#
+	_ZTV15CSenMessageBase @ 139 NONAME ; #<VT>#
+	_ZTV16CSenSoapMessage2 @ 140 NONAME ; #<VT>#
+	_ZTV17CSenSoapEnvelope2 @ 141 NONAME ; #<VT>#
+	_ZTV19CSenSoapMessageDom2 @ 142 NONAME ; #<VT>#
+	_ZTV21CSenWsSecurityHeader2 @ 143 NONAME ; #<VT>#
+	_ZThn4_N17CSenSoapEnvelope213OnEndElementLERKN3Xml8RTagInfoEi @ 144 NONAME ; #<thunk>#
+	_ZThn4_N17CSenSoapEnvelope215OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 145 NONAME ; #<thunk>#
+	_ZThn52_N16CSenSoapMessage24TypeEv @ 146 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope210PropertiesEv @ 147 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope210SetContextEP18MSenMessageContext @ 148 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope212IsSafeToCastEN11MSenMessage6TClassE @ 149 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope213SetPropertiesEP14MSenProperties @ 150 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope24TypeEv @ 151 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope25TxnIdEv @ 152 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope27ContextEv @ 153 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope29DirectionEv @ 154 NONAME ; #<thunk>#
+	_ZThn52_N19CSenSoapMessageDom24TypeEv @ 155 NONAME ; #<thunk>#
+	_ZN16CSenSoapMessage214BaseConstructLERS_ @ 156 NONAME
+	_ZN16CSenSoapMessage24NewLERS_ @ 157 NONAME
+	_ZN16CSenSoapMessage25NewLCERS_ @ 158 NONAME
+	_ZN16CSenSoapMessage26CloneLEv @ 159 NONAME
+	_ZN17CSenSoapEnvelope214BaseConstructLERS_ @ 160 NONAME
+	_ZN17CSenSoapEnvelope24NewLERS_ @ 161 NONAME
+	_ZN17CSenSoapEnvelope25NewLCERS_ @ 162 NONAME
+	_ZN17CSenSoapEnvelope26CloneLEv @ 163 NONAME
+	_ZN19CSenSoapMessageDom24NewLERS_ @ 164 NONAME
+	_ZN19CSenSoapMessageDom25NewLCERS_ @ 165 NONAME
+	_ZN19CSenSoapMessageDom26CloneLEv @ 166 NONAME
+	_ZThn52_N16CSenSoapMessage26CloneLEv @ 167 NONAME ; #<thunk>#
+	_ZThn52_N17CSenSoapEnvelope26CloneLEv @ 168 NONAME ; #<thunk>#
+	_ZThn52_N19CSenSoapMessageDom26CloneLEv @ 169 NONAME ; #<thunk>#
+	_ZN12CSenAtomFeed11RemoveEntryEi @ 170 NONAME ABSENT
+	_ZN12CSenAtomFeed14BaseConstructLEv @ 171 NONAME
+	_ZN12CSenAtomFeed4NewLEx @ 172 NONAME
+	_ZN12CSenAtomFeed5NewLCEx @ 173 NONAME
+	_ZN12CSenAtomFeedD0Ev @ 174 NONAME
+	_ZN12CSenAtomFeedD1Ev @ 175 NONAME
+	_ZN12CSenAtomFeedD2Ev @ 176 NONAME
+	_ZN13CSenAtomEntry11MediaGroupLEv @ 177 NONAME ABSENT
+	_ZN13CSenAtomEntry13OnEndElementLERKN3Xml8RTagInfoEi @ 178 NONAME
+	_ZN13CSenAtomEntry14BaseConstructLEv @ 179 NONAME
+	_ZN13CSenAtomEntry14SetMediaTitleLERK6TDesC8 @ 180 NONAME ABSENT
+	_ZN13CSenAtomEntry15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 181 NONAME
+	_ZN13CSenAtomEntry16ParseMediaGroupLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 182 NONAME ABSENT
+	_ZN13CSenAtomEntry17SetMediaCategoryLERK6TDesC8 @ 183 NONAME ABSENT
+	_ZN13CSenAtomEntry17SetMediaKeyWordsLERK6TDesC8 @ 184 NONAME ABSENT
+	_ZN13CSenAtomEntry20SetMediaDescriptionLERK6TDesC8 @ 185 NONAME ABSENT
+	_ZN13CSenAtomEntry4NewLEv @ 186 NONAME
+	_ZN13CSenAtomEntry5NewLCEv @ 187 NONAME
+	_ZN13CSenAtomEntry9CategoryLEv @ 188 NONAME ABSENT
+	_ZN13CSenAtomEntryD0Ev @ 189 NONAME
+	_ZN13CSenAtomEntryD1Ev @ 190 NONAME
+	_ZN13CSenAtomEntryD2Ev @ 191 NONAME
+	_ZN15CSenAtomMessage10PropertiesEv @ 192 NONAME
+	_ZN15CSenAtomMessage10SetContextEP18MSenMessageContext @ 193 NONAME
+	_ZN15CSenAtomMessage12IsSafeToCastEN11MSenMessage6TClassE @ 194 NONAME
+	_ZN15CSenAtomMessage13OnEndElementLERKN3Xml8RTagInfoEi @ 195 NONAME
+	_ZN15CSenAtomMessage13SetPropertiesEP14MSenProperties @ 196 NONAME
+	_ZN15CSenAtomMessage15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 197 NONAME
+	_ZN15CSenAtomMessage19CreateBodyFragmentLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER14TXmlEngElementR12RSenDocument @ 198 NONAME
+	_ZN15CSenAtomMessage4TypeEv @ 199 NONAME
+	_ZN15CSenAtomMessage5TxnIdEv @ 200 NONAME
+	_ZN15CSenAtomMessage6CloneLEv @ 201 NONAME
+	_ZN15CSenAtomMessage7ContextEv @ 202 NONAME
+	_ZN15CSenAtomMessage9DirectionEv @ 203 NONAME
+	_ZN15CSenAtomMessageD0Ev @ 204 NONAME
+	_ZN15CSenAtomMessageD1Ev @ 205 NONAME
+	_ZN15CSenAtomMessageD2Ev @ 206 NONAME
+	_ZNK12CSenAtomFeed10EntryCountEv @ 207 NONAME ABSENT
+	_ZNK12CSenAtomFeed14EntryIdToIndexE12TFeedEntryId @ 208 NONAME ABSENT
+	_ZNK12CSenAtomFeed5EntryE12TFeedEntryId @ 209 NONAME ABSENT
+	_ZNK12CSenAtomFeed5EntryEi @ 210 NONAME
+	_ZNK13CSenAtomEntry10MediaTitleEv @ 211 NONAME ABSENT
+	_ZNK13CSenAtomEntry13MediaCategoryEv @ 212 NONAME ABSENT
+	_ZNK13CSenAtomEntry13MediaKeyWordsEv @ 213 NONAME ABSENT
+	_ZNK13CSenAtomEntry16MediaDescriptionEv @ 214 NONAME ABSENT
+	_ZNK15CSenAtomMessage2IdEv @ 215 NONAME
+	_ZTI12CSenAtomFeed @ 216 NONAME ; #<TI>#
+	_ZTI13CSenAtomEntry @ 217 NONAME ; #<TI>#
+	_ZTI15CSenAtomMessage @ 218 NONAME ; #<TI>#
+	_ZTV12CSenAtomFeed @ 219 NONAME ; #<VT>#
+	_ZTV13CSenAtomEntry @ 220 NONAME ; #<VT>#
+	_ZTV15CSenAtomMessage @ 221 NONAME ; #<VT>#
+	_ZThn4_N13CSenAtomEntry13OnEndElementLERKN3Xml8RTagInfoEi @ 222 NONAME ; #<thunk>#
+	_ZThn4_N13CSenAtomEntry15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 223 NONAME ; #<thunk>#
+	_ZThn4_N15CSenAtomMessage13OnEndElementLERKN3Xml8RTagInfoEi @ 224 NONAME ; #<thunk>#
+	_ZThn4_N15CSenAtomMessage15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 225 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage10PropertiesEv @ 226 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage10SetContextEP18MSenMessageContext @ 227 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage12IsSafeToCastEN11MSenMessage6TClassE @ 228 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage13SetPropertiesEP14MSenProperties @ 229 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage4TypeEv @ 230 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage5TxnIdEv @ 231 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage6CloneLEv @ 232 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage7ContextEv @ 233 NONAME ; #<thunk>#
+	_ZThn52_N15CSenAtomMessage9DirectionEv @ 234 NONAME ; #<thunk>#
+	_ZN12CSenAtomFeed10EntryCountEv @ 235 NONAME
+	_ZN12CSenAtomFeed10OnContentLERK6TDesC8i @ 236 NONAME
+	_ZN12CSenAtomFeed11ParseEntryLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEE @ 237 NONAME
+	_ZN12CSenAtomFeed11RemoveEntryER13CSenAtomEntry @ 238 NONAME ABSENT
+	_ZN12CSenAtomFeed12SetSubtitleLERK6TDesC8 @ 239 NONAME
+	_ZN12CSenAtomFeed13OnEndElementLERKN3Xml8RTagInfoEi @ 240 NONAME
+	_ZN12CSenAtomFeed13SetGeneratorLERK6TDesC8S2_S2_ @ 241 NONAME
+	_ZN12CSenAtomFeed15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 242 NONAME
+	_ZN12CSenAtomFeed5IconLEv @ 243 NONAME
+	_ZN12CSenAtomFeed5LogoLEv @ 244 NONAME
+	_ZN12CSenAtomFeed8SetIconLERK6TDesC8 @ 245 NONAME
+	_ZN12CSenAtomFeed8SetLogoLERK6TDesC8 @ 246 NONAME
+	_ZN12CSenAtomFeed9AddEntryLER13CSenAtomEntry @ 247 NONAME
+	_ZN12CSenAtomFeed9SubtitleLEv @ 248 NONAME
+	_ZN13CSenAtomEntry10OnContentLERK6TDesC8i @ 249 NONAME
+	_ZN13CSenAtomEntry10SetAuthorLERK6TDesC8S2_S2_ @ 250 NONAME ABSENT
+	_ZN13CSenAtomEntry11SetUpdatedLERK6TDesC8 @ 251 NONAME ABSENT
+	_ZN13CSenAtomEntry13SetPublishedLERK6TDesC8 @ 252 NONAME ABSENT
+	_ZN13CSenAtomEntry15AddContributorLERK6TDesC8S2_S2_ @ 253 NONAME ABSENT
+	_ZN13CSenAtomEntry8AddLinkLERK6TDesC8S2_S2_S2_S2_S2_ @ 254 NONAME ABSENT
+	_ZN13CSenAtomEntry9SetIdTagLERK6TDesC8 @ 255 NONAME ABSENT
+	_ZN13CSenAtomEntry9SetTitleLERK6TDesC8 @ 256 NONAME ABSENT
+	_ZNK13CSenAtomEntry5IdTagEv @ 257 NONAME ABSENT
+	_ZNK13CSenAtomEntry5TitleEv @ 258 NONAME ABSENT
+	_ZNK13CSenAtomEntry7UpdatedEv @ 259 NONAME ABSENT
+	_ZNK13CSenAtomEntry9PublishedEv @ 260 NONAME ABSENT
+	_ZThn4_N12CSenAtomFeed10OnContentLERK6TDesC8i @ 261 NONAME ; #<thunk>#
+	_ZThn4_N12CSenAtomFeed13OnEndElementLERKN3Xml8RTagInfoEi @ 262 NONAME ; #<thunk>#
+	_ZThn4_N12CSenAtomFeed15OnStartElementLERKN3Xml8RTagInfoERK6RArrayINS0_10RAttributeEEi @ 263 NONAME ; #<thunk>#
+	_ZThn4_N13CSenAtomEntry10OnContentLERK6TDesC8i @ 264 NONAME ; #<thunk>#
+	_ZN12CSenAtomFeed12RemoveEntryLER13CSenAtomEntry @ 265 NONAME
+	_ZN12CSenAtomFeed12RemoveEntryLERK6TDesC8 @ 266 NONAME
+	_ZN12CSenAtomFeed13GetGeneratorLEv @ 267 NONAME
+	_ZN15CSenAtomMessage10SetAuthorLERK6TDesC8S2_S2_ @ 268 NONAME
+	_ZN15CSenAtomMessage10SetRightsLERK6TDesC8 @ 269 NONAME
+	_ZN15CSenAtomMessage11RemoveLinkLERK6TDesC8 @ 270 NONAME
+	_ZN15CSenAtomMessage11RemoveLinkLEi @ 271 NONAME
+	_ZN15CSenAtomMessage11SetUpdatedLERK6TDesC8 @ 272 NONAME
+	_ZN15CSenAtomMessage12AddCategoryLERK6TDesC8S2_S2_ @ 273 NONAME
+	_ZN15CSenAtomMessage14CategoryCountLEv @ 274 NONAME
+	_ZN15CSenAtomMessage13RemoveAuthorLEv @ 275 NONAME
+	_ZN15CSenAtomMessage13SetPublishedLERK6TDesC8 @ 276 NONAME
+	_ZN15CSenAtomMessage15AttributeCountLERK6TDesC8S2_ @ 277 NONAME
+	_ZN15CSenAtomMessage15AddContributorLERK6TDesC8S2_S2_ @ 278 NONAME
+	_ZN15CSenAtomMessage15RemoveBySubtagLERK6TDesC8S2_S2_S2_ @ 279 NONAME
+	_ZN15CSenAtomMessage15RemoveCategoryLERK6TDesC8 @ 280 NONAME
+	_ZN15CSenAtomMessage17ContributorCountLEv @ 281 NONAME
+	_ZN15CSenAtomMessage18RemoveByAttributeLERK6TDesC8S2_S2_S2_ @ 282 NONAME
+	_ZN15CSenAtomMessage18RemoveContributorLERK6TDesC8 @ 283 NONAME
+	_ZN15CSenAtomMessage7RightsLEv @ 284 NONAME
+	_ZN15CSenAtomMessage8AddLinkLERK6TDesC8S2_S2_S2_S2_S2_ @ 285 NONAME
+	_ZN15CSenAtomMessage10LinkCountLEv @ 286 NONAME
+	_ZN15CSenAtomMessage9SetIdTagLERK6TDesC8 @ 287 NONAME
+	_ZN15CSenAtomMessage9SetTitleLERK6TDesC8 @ 288 NONAME
+	_ZNK15CSenAtomMessage5IdTagEv @ 289 NONAME
+	_ZNK15CSenAtomMessage5TitleEv @ 290 NONAME
+	_ZNK15CSenAtomMessage7UpdatedEv @ 291 NONAME
+	_ZNK15CSenAtomMessage9PublishedEv @ 292 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsmesssages    
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsmessages.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsmessages.iby)
+
+PRJ_MMPFILES
+senmessages.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/group/senmessages.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senmessages    
+*
+*/
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenMessages.DLL
+UID             0x1000008d 0x2000039B
+#else
+TARGET          wsmessages.DLL
+UID             0x1000008d 0x10282C40
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+VENDORID 0x101FB657
+    #else
+VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+CAPABILITY ALL -TCB
+    #else
+CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+
+//SOURCE          SenMessageContext.cpp
+SOURCE          sensoapenvelope2.cpp
+SOURCE          sensoapmessage2.cpp
+SOURCE          sensoapmessagedom2.cpp
+SOURCE          sensoapfault2.cpp
+SOURCE          senwssecurityheader2.cpp
+
+SOURCE          senmessagebase.cpp 
+SOURCE          senatomentry.cpp
+SOURCE			senatomfeed.cpp 
+SOURCE			senatommessage.cpp
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wslogger/inc
+USERINCLUDE     ../../wsframework/inc // MessageContext
+USERINCLUDE     ../../wsfragment/inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY         charconv.lib
+LIBRARY         estor.lib
+LIBRARY         euser.lib
+LIBRARY         bafl.lib    // RStringbase
+// Symbian XML framework is used since S60 3rd edition (3.0)
+LIBRARY         XMLFRAMEWORK.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenFragment.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenFramework.lib // CSenMessageContext (temporary: create SenContext.lib!)
+
+LIBRARY         SenXml.lib // temporarily: when WSF is fully libxml2 based, XmlUtils:: -methods need to be refactored (moved to other lib)
+
+LIBRARY         SenLogger.lib
+#else
+LIBRARY         wsFragment.lib
+LIBRARY         wsUtils.lib
+LIBRARY         wsFramework.lib 
+LIBRARY         wsXml.lib 
+LIBRARY         wsLogger.lib
+#endif
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+LIBRARY         XmlEngineDOM.lib
+LIBRARY         XmlEngine.lib
+#else
+LIBRARY         WsStarXmlEngineDOM.lib
+LIBRARY         WsStarXmlEngine.lib
+#endif
+
+LIBRARY estlib.lib // strlen 
+
+#if defined(ARMCC)
+DEFFILE ../eabi/SenMessages.DEF
+#elif defined(WINSCW)
+DEFFILE ../BWINSCW/SenMessages.DEF
+#elif defined(WINS)
+DEFFILE ../BWINS/SenMessages.DEF
+#else 
+DEFFILE ../BMARM/SenMessages.DEF
+#endif
+
+SMPSAFE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/inc/senatomentry.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef SENATOMENTRY_H_
+#define SENATOMENTRY_H_
+
+
+/**
+*     Provides object and methods to manipulate <entry> tag from atom-pub API.
+* 
+*   @lib SenMessages.DLL
+*   @since 5.0
+*/
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32cmn.h>
+
+#include "senatommessage.h"
+
+
+
+// CLASS DECLARATION
+class CSenFragmentBase;
+
+class CSenAtomEntry : public CSenAtomMessage
+    {
+    public:
+        // Constructors and destructor
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CSenAtomEntry* NewL();
+
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CSenAtomEntry* NewLC();
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C virtual ~CSenAtomEntry();
+
+        
+        /*
+        *        Callback funtions. Not a part of API.
+        */
+        IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
+                                              const RAttributeArray& aAttributes,
+                                              TInt aErrorCode);                                            
+        IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement,
+                                            TInt aErrorCode);
+        IMPORT_C virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+        
+    protected:
+    
+    // Internal functions
+        IMPORT_C CSenAtomEntry();
+        IMPORT_C void BaseConstructL();
+
+    protected: // Data
+        
+        TInt localState;
+        RBuf8 iBuffer;
+
+        
+    private:
+    RAttributeArray* CreateLinkAttribs( const TDesC8& href, const TDesC8& rel, const TDesC8& type, const TDesC8& hrefLang, const TDesC8& title, const TDesC8& lenght);
+    };
+
+#endif /*SENATOMENTRY_H*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/inc/senatomfeed.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef SENATOMFEED_H_
+#define SENATOMFEED_H_
+
+/**
+* 	Provides object and methods to manipulate <feed> tag from atom-pub API.
+* 
+*   @lib SenMessages.DLL
+*   @since 5.0
+*/
+
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32cmn.h>
+
+#include "senatommessage.h"
+
+
+class CSenAtomEntry;
+class CDesC16ArrayFlat;
+
+
+// CLASS DECLARATION
+
+
+class CSenAtomFeed : public CSenAtomMessage
+    {
+    public:
+        // Constructors and destructor
+    
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CSenAtomFeed* NewL(TInt64 aId = 0);
+
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CSenAtomFeed* NewLC(TInt64 aId = 0);
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C ~CSenAtomFeed();   
+        
+        /*
+        *		Method returns count of entries in the feed.
+        *    	@return - number of tries
+        * 
+        */   
+        IMPORT_C TInt EntryCount() ;//const;
+        
+        /*
+        *		Method returns an entry at specified index from the feed. Index is made from inserting order or from order in the feed xml 
+        * 		in case of parsing.
+        * 		@param  aIndex - index of returned entry
+        * 		@return - entry at index position
+        */        
+        IMPORT_C CSenAtomEntry* Entry( TInt aIndex ) const;
+        
+        /*
+        *		Method adds the entry to the feed.
+        * 		@param aEntry -  entry to insert
+        * 		@return - error code
+        */        
+        IMPORT_C TInt AddEntryL(CSenAtomEntry& aEntry);
+        
+        /*
+        *		Method removes from the feed an entry with 'id' tag specified as @aEntryId parameter.
+        * 		@param aEntryId - id of an entry to remove
+        */        
+        IMPORT_C void RemoveEntryL( const TDesC8& aEntryId );
+        
+        /*
+        *		Method removes from the feed first entry specified as @aEntry parameter. Distincion is made basing on 'id' tag of an entry.
+        * 		@param aEntry - entry to remove  
+        */        
+        IMPORT_C void RemoveEntryL( CSenAtomEntry& aEntry);
+        
+        /*
+        *		Method returns content of "subtitle" tag.
+        * 		@return - descriptor containing value of subtitle.
+        */
+        IMPORT_C const TDesC8& SubtitleL();
+        
+        /*
+        *		Method sets content of "subtitle" tag
+        * 		@param aSubtitle - descriptor that contains value of subtitle. 
+        */
+        IMPORT_C void SetSubtitleL( const TDesC8& aTitle );
+        
+        /*
+        *		Method sets content of "icon" tag
+        * 		@param aUri - descriptor that contains value of icon's uri.
+        */
+        IMPORT_C void SetIconL( const TDesC8& aUri);
+        
+        /*
+        *		Method returns content of "icon" tag.
+        * 		@return - descriptor containing value of icon's uri.
+        */
+        IMPORT_C const TDesC8& IconL();
+        
+        /*
+        *		Method sets content of "logo" tag
+        * 		@param aUri - descriptor that contains value of logo tag.
+        */
+        IMPORT_C void SetLogoL( const TDesC8& logo);
+        
+        /*
+        *		Method returns content of "logo" tag.
+        *         @return - descriptor containing value of logo.        
+        */
+        IMPORT_C const TDesC8& LogoL();
+        
+        /*
+        *        Method returns whole content of "generator" tag as TXmlEngElement.
+        *         @return - generator tag as TXmlEngElement 
+        */
+        IMPORT_C TXmlEngElement GetGeneratorL();
+        
+        /*
+        *        Method sets content of "generator" tag. Provided parameters correspond in name with subtags of the tag.
+        *         @param aUri - uri value
+        *          @param aVersion - version value
+        *          @param aText - text value
+        */
+        IMPORT_C void SetGeneratorL( const TDesC8& aUri, const TDesC8& aVersion, const TDesC8& aText);
+            
+
+        //CALLBACK
+        IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
+                                              const RAttributeArray& aAttributes,
+                                              TInt aErrorCode);
+        //CALLBACK
+        IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement,
+                                            TInt aErrorCode);
+        //CALLBACK
+        IMPORT_C virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+
+       
+    protected:
+    
+        IMPORT_C CSenAtomFeed();
+        IMPORT_C void BaseConstructL();
+        IMPORT_C void ParseEntryL(const RTagInfo& aElement, const RAttributeArray& aAttributes);
+
+    protected: // Data
+        CSenFragmentBase*            ipEntryFragment;
+        RPointerArray<CSenAtomEntry> iEntries;
+        CSenAtomEntry* iEntry;
+        TXmlEngElement*    ipGroupFragment;
+
+    };
+#endif /*SENATOMFEED_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/inc/senatommessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,327 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef CSENATOMMESSAGE_H_
+#define CSENATOMMESSAGE_H_
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32cmn.h>
+
+#include <SenDomFragmentBase.h>
+#include <MSenMessage.h>
+
+// CONSTANTS
+_LIT8(KSenAtomEntryXmlns,                 "http://www.w3.org/2005/Atom");
+_LIT8(KSenAtomFeedName,                   "feed");
+_LIT8(KSenAtomEntryName,                  "entry");
+
+_LIT8(KSenAtomCategoryName,               "category");
+_LIT8(KSenAtomGroupName,                  "group");
+_LIT8(KSenAtomTitleName,                     "title");
+_LIT8(KSenAtomUpdatedName,                "updated");
+_LIT8(KSenAtomPublishedName,                "published");
+_LIT8(KSenAtomIdName,                    "id");
+_LIT8(KSenAtomLinkName,                    "link");
+_LIT8(KSenAtomSubtitleName,                "subtitle");
+_LIT8(KSenAtomGeneratorName,                "generator");
+_LIT8(KSenAtomIconName,                      "icon");
+_LIT8(KSenAtomLogoName,                      "logo");
+_LIT8(KSenAtomRightsName,                 "rights");
+_LIT8(KSenAtomContributorName,           "contributor");
+_LIT8(KSenAtomContentName,                "content");
+_LIT8(KSenAtomAuthorName,                "author");
+
+_LIT8(KSenAtomName,                         "name"); 
+_LIT8(KSenAtomURI,                          "URI");
+_LIT8(KSenAtomEmail,                      "email");
+_LIT8(KSenAtomVersion,                      "version");
+_LIT8(KSenAtomHref,                        "href");
+_LIT8(KSenAtomRel,                        "rel");
+_LIT8(KSenAtomType,                        "type");
+_LIT8(KSenAtomHrefLang,                     "hrefLang");
+_LIT8(KSenAtomTitle,                        "title");
+_LIT8(KSenAtomLength,                       "length");
+_LIT8(KSenAtomPrefix,                        " ");
+_LIT8(KSenAtomTerm,                        "term");
+_LIT8(KSenAtomScheme,                        "scheme");
+_LIT8(KSenAtomLabel,                        "label");
+
+_LIT8(KSenAtomSpace,                      "");
+
+
+
+/// id for data class instances
+typedef TInt64 TAtomDataId;
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*     Provides generic object to keep and manipulate tags of atom-pub API.
+* 
+*   @lib SenMessages.DLL
+*   @since 5.0
+*/
+
+class CSenAtomMessage : public CSenFragmentBase, public MSenMessage
+    {
+    public:  // Constructors and destructor
+                      
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenAtomMessage();   
+        
+    public:
+        IMPORT_C TAtomDataId Id() const;
+        
+    public: // From MSenMessage
+        IMPORT_C virtual TClass Type();
+        IMPORT_C virtual TDirection Direction();
+        IMPORT_C virtual TInt SetContext(MSenMessageContext* apOwnedContext);
+        IMPORT_C virtual MSenMessageContext* Context();
+        IMPORT_C virtual TInt SetProperties(MSenProperties* apOwnedProperties);
+        IMPORT_C virtual MSenProperties* Properties();
+        IMPORT_C virtual TBool IsSafeToCast(TClass aType);
+        IMPORT_C virtual TInt TxnId();
+        IMPORT_C virtual MSenMessage* CloneL();
+        
+        // From CSenFragmentBase
+        IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
+                                              const RAttributeArray& aAttributes,
+                                              TInt aErrorCode);                                            
+
+        IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement,
+                                            TInt aErrorCode);
+        IMPORT_C virtual CSenFragmentBase* CreateBodyFragmentL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aPrefix,
+                                                       const RAttributeArray& aAttributes,
+                                                       TXmlEngElement& aParent,
+                                                       RSenDocument& aOwnerDocument);
+        
+        // Own functions
+        
+        /*
+        *        Method returns content of "title" tag
+        *         @return - descriptor containing value of title.
+        */        
+        IMPORT_C const TDesC8& Title() const;
+        
+        /*
+        *        Method sets content of "title" tag
+        *         @param aTitle - descriptor that contains value of subtitle. 
+        */
+        IMPORT_C void SetTitleL( const TDesC8& aTitle );
+        
+        /*
+        *        Method returns content of "updated" tag
+        *         @return - descriptor containing value of updated tag.
+        */        
+        IMPORT_C const TDesC8& Updated() const;
+        
+        /*
+        *        Method sets content of "updated" tag
+        *         @param aUpdated - descriptor that contains value of updated tag.
+        */        
+        IMPORT_C void SetUpdatedL( const TDesC8& aUpdated );
+        
+        /*
+        *        Method returns content of "published" tag
+        *         @return - descriptor containing value of published tag.
+        */        
+        IMPORT_C const TDesC8& Published() const;
+        
+        /*
+        *        Method sets content of "published" tag
+        *         @param aPublished - descriptor that contains value of published tag.
+        */        
+        IMPORT_C void SetPublishedL( const TDesC8& aPublished );
+        
+        /*
+        *        Method returns content of "id" tag. Content of this tag usually identifies underlying entry or feed. 
+        *         @return - descriptor containing value of id tag.
+        */        
+        IMPORT_C const TDesC8& IdTag() const;
+        
+        /*
+        *        Method sets content of "id" tag. Content of this tag usually identifies underlying entry or feed.
+        *         @param aId - descriptor that contains value of 'id' tag.
+        */        
+        IMPORT_C void SetIdTagL( const TDesC8& aId );
+        
+        /*
+        *        Adds a "link" tag to the message. Parameters describe subtags with a corresponding name.
+        *         In case of subtag's value of KNullDesC8, it is ommited. Allows adding multiple links.
+        *         @param aHref - set the content of 'href' attribute
+        *         @param aRel - set the content of 'rel' attribute 
+        *         @param aType - set the content of 'type' attribute 
+        *         @param aHreflang - set the content of 'hrefLang' attribute
+        *         @param aTitle - set the content of 'title' attribute
+        *         @param aLenght - set the content of 'length' attribute
+        * 
+        */
+        IMPORT_C void AddLinkL( const TDesC8& aHref, const TDesC8& aRel, const TDesC8& aType, const TDesC8& aHreflang, const TDesC8& aTitle, const TDesC8& aLength);
+        
+        /*
+        *        Removes "link" tag. 
+        *       @param aLenght - it's an order of a link in an xml document(or element) containing atom message. 
+        */
+        IMPORT_C void RemoveLinkL( TInt aIndex);
+        
+        /*
+        *        Removes first "link" tag from the message with a "href" described with @href parameter (href is a must be in a link)
+        *         @param aHref - href of a link to delete.
+        */
+        IMPORT_C void RemoveLinkL(const TDesC8& aHref);
+        
+        /*
+        *        Returns a total count of "link" tags in the message.
+        *         @return - count of links
+        */
+        IMPORT_C TInt LinkCountL();
+        
+        /*
+        *        Returns a total count of "category" tags in the entry.
+        *         @return - count of category
+        */
+        IMPORT_C TInt CategoryCountL();
+        
+        /*
+        *        Method adds a "category" tag to the entry. Parameters describe subtags with a corresponding name. If param is KNullDesC8
+        *         it is ommited.
+        *         @param aTerm - content of  'term' tag
+        *         @param aScheme - content of  'scheme' tag
+        *         @param aLabel- content of  'label' tag
+        */
+        IMPORT_C void AddCategoryL( const TDesC8& aTerm, const TDesC8& aScheme, const TDesC8& aLabel);
+        
+        /*
+        *        Removes first "category" tag from the entry with a "term" described with @term parameter.
+        *         @param aTerm - value of 'term' tag of category to remove
+        */
+        IMPORT_C void RemoveCategoryL(const TDesC8& aTerm);   
+        
+        /*
+        *        Removes all "author" tags from the entry, as there is only one author tag allowed, 
+        */
+        IMPORT_C void RemoveAuthorL();
+        
+        /*
+        *        Sets "author" tag to the entry. Parameters describe subtags with a corresponding name.
+        *         In case of subtag's value of KNullDesC8, it is ommited. Allows adding multiple authors.
+        *         @param aName - author's name 
+        *         @param aUri - author's uri 
+        *         @param aEmail - author's email 
+        */        
+        IMPORT_C void SetAuthorL( const TDesC8& aName, const TDesC8& aUri, const TDesC8& aEmail);
+        
+        /*
+        *        Removes first "contributor" tag from the entry with 'name' specified by @name .
+        *         @param aName - name of a contributor to remove 
+        */
+        IMPORT_C void RemoveContributorL( const TDesC8& aName);
+        
+        /*
+        *        Adds "contributor" tag to the entry. Parameters describe subtags with a corresponding name.
+        *         In case of subtag's value of KNullDesC8, it is ommited. 
+        *        @param aName - contributor's name 
+        *         @param aUri - contributor's uri 
+        *         @param aEmail - - contributor's email 
+        */
+        IMPORT_C void AddContributorL( const TDesC8& aName, const TDesC8& aUri, const TDesC8& aEmail);
+        
+        /*
+        *        Returns a total count of "contributor" tags in the entry.
+        *         @return - count of contributor's
+        */
+        IMPORT_C TInt ContributorCountL();
+        
+        /*
+        *        @return content of the "righst" tag.
+        */
+        IMPORT_C const TDesC8& RightsL();
+        
+        /*
+        *        Method sets content of "rights" tag
+        *         @param aRights - value of a "rights" tag
+        */
+        IMPORT_C void SetRightsL( const TDesC8& aRights);
+        
+        /*
+        *        This method return count of any tag with a name specified by @name and namespace specified by @nameSpaceURI
+        *         @param aName - value of a "name" tag
+        *         @param aNameSpaceURI - value of a "NameSpaceURI" tag
+        */
+        IMPORT_C TInt AttributeCountL(const TDesC8& aName, const TDesC8& aNameSpaceURI);
+        
+        /*
+        *        This method allows any tag removal. It removes first tag within the entry with parameters specified. 
+        *         Paramteres are:
+        *             @aAtomtag - name of tag to remove
+        *             @aNameSpaceUri - tag to remove namespace
+        *             @aAttributeName - name attribute specifing a tag
+        *             @aValue - value of attribute specifing a tag
+        *     for example:
+        *         removes a tag 
+        *        <atomtag xmlns=nameSpaceURI attributeName=value>  ... </atomtag>     
+        */
+        IMPORT_C void RemoveByAttributeL(const TDesC8& aAtomtag, const TDesC8& aNameSpaceUri, const TDesC8& aAttributeName, const TDesC8& aValue);
+        
+        /*
+        *        This method allows any tag removal. It removes first tag within the entry with parameters specified. 
+        *         Paramteres are:
+        *             @aAtomtag - name of tag to remove
+        *             @aNameSpaceUri - tag to remove namespace
+        *             @aSubTagName - name attribute specifing a tag
+        *             @aValue - value of attribute specifing a tag
+        *     for example:
+        *         removes a tag 
+        *        
+        *         <atomtag xmlns=nameSpaceURI>
+        *                 ..
+        *                 <subtagName>value</subtagName>
+        *          </atomtag>     
+        */
+        IMPORT_C void RemoveBySubtagL(const TDesC8& aAtomtag, const TDesC8& aNameSpaceUri, const TDesC8& aSubTagName, const TDesC8& aValue);
+        
+
+    protected:
+
+        /**
+         *  Constructor.
+         */
+        CSenAtomMessage();
+        
+    protected: // Data
+        TInt64 iId;
+        
+        // part of content information is contained as hbufs
+        HBufC8* iTitle;
+        HBufC8* iIdTag;
+        HBufC8* iUpdated;
+        HBufC8* iPublished;
+    
+    };
+
+#endif /*CSENATOMMESSAGE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/inc/senmessagebase.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Simplest concrete base class in WSF message class hierarchy.
+*                This is not a public class.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_MESSAGE_BASE_H
+#define SEN_MESSAGE_BASE_H
+
+#include <e32std.h>
+
+#include <MSenMessage.h>
+
+// FORWARD DECLARATIONS
+class CSenChunk;
+class CSenXmlReader;
+class MSenProperties;
+class MSenMessageContext;
+
+// CLASS DECLARATION
+/**
+* This is abstract interface defines set of WSF message classes, providing 
+* convenience for other components, which typically cast this to some 
+* subclass via IsSafeToCast() method.
+* @lib SenMessages.lib
+* @since Series60 4.0
+*/
+class CSenMessageBase : public CBase, public MSenMessage
+    {
+    public:
+        IMPORT_C static CSenMessageBase* NewL(CSenChunk& aChunk);
+        IMPORT_C static CSenMessageBase* NewLC(CSenChunk& aChunk);
+        
+        // Destructor 
+        IMPORT_C virtual ~CSenMessageBase();
+        
+        // New methods
+        virtual TClass Type();
+        virtual TDirection Direction();
+        virtual TInt SetContext(MSenMessageContext* apOwnedContext);
+        virtual MSenMessageContext* Context();
+        virtual TInt SetProperties(MSenProperties* apOwnedProperties);
+        virtual MSenProperties* Properties();
+        
+        virtual TBool IsSafeToCast(TClass aType);
+        virtual TInt TxnId();
+        virtual MSenMessage* CloneL();
+        
+      
+    protected:
+        IMPORT_C void BaseConstructL();
+    private:
+        // C++ constructor
+        IMPORT_C CSenMessageBase(CSenChunk& aChunk);
+        
+    protected: // Data
+        CSenChunk& iChunk;
+        MSenProperties* ipProperties; // owned
+        TInt iTxnId;
+        TPtrC8 iSerializedMessage;
+        TPtrC8 iSerializedProperties;
+        MSenMessageContext* ipContext; // NOT owned
+    };
+
+#endif // SEN_MESSAGE_BASE_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/inc/sensoapmessagedom2.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenSoapMessageDom is an utility class offering capability to
+*                parse XML SOAP envelope and manipulation methods to alter its
+*                contents.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_MESSAGE_DOM2_H
+#define SEN_SOAP_MESSAGE_DOM2_H
+
+//  INCLUDES
+#include <SenWsSecurityHeader2.h>
+#include <SenSoapMessage2.h>
+
+// CLASS DECLARATION
+
+/**
+* CSenSoapMessage extends basic SOAP envelope functionality by
+* offering methods to set the security header and security token.
+* @lib SenUtils.lib
+* @since Series60 4.0
+*/
+class CSenSoapMessageDom2 : public CSenSoapMessage2
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewL();
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewLC();
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessageDom2* NewL(TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessageDom2* NewLC(TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewL(TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewLC(TSOAPVersion aVersion,
+                                                   const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewL(MSenMessageContext& aContext);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewLC(MSenMessageContext& aContext);
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessageDom2* NewL(MSenMessageContext& aContext,
+	                                              TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessageDom2* NewLC(MSenMessageContext& aContext,
+	                                               TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewL(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewLC(MSenMessageContext& aContext,
+                                                   TSOAPVersion aVersion,
+                                                   const TDesC8& aSecurityNs);
+        /**
+        * Two-phased copy constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewL(CSenSoapMessageDom2& aMessage);
+
+        /**
+        * Two-phased copy constructor.
+        */
+        IMPORT_C static CSenSoapMessageDom2* NewLC(CSenSoapMessageDom2& aMessage);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapMessageDom2();
+
+    public: // From MSenMessage
+        IMPORT_C virtual TClass Type();
+        IMPORT_C virtual MSenMessage* CloneL();       
+
+    protected:
+
+        /**
+         *  C++ default constructor.
+         */
+        IMPORT_C CSenSoapMessageDom2::CSenSoapMessageDom2();
+
+        IMPORT_C CSenFragmentBase* CreateBodyFragmentL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aPrefix,
+                                                       const RAttributeArray& aAttributes,
+                                                       TXmlEngElement& aParent,
+                                                       RSenDocument& aOwnerDocument);
+    };
+
+#endif // SEN_SOAP_MESSAGE_DOM2_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/rom/wsmessages.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSMESSAGES_IBY__
+#define __WSMESSAGES_IBY__
+
+// SenMessages
+file=ABI_DIR\BUILD_DIR\SenMessages.dll          PROGRAMS_DIR\SenMessages.dll//
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/senatomentry.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,204 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+ *
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <badesca.h>
+
+#include <SenDomFragmentBase.h>
+#include <xmlengnodelist.h>
+
+#include "senatomentry.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+const TInt KStateParsingMediaGroup       = 19;  // save state     (odd number)
+
+EXPORT_C CSenAtomEntry* CSenAtomEntry::NewL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomEntry::NewL()");
+    CSenAtomEntry* pNew = CSenAtomEntry::NewLC();
+    CleanupStack::Pop( pNew ); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenAtomEntry* CSenAtomEntry::NewLC()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomEntry::NewLC()");
+    CSenAtomEntry* pNew = new (ELeave) CSenAtomEntry();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+CSenAtomEntry::CSenAtomEntry () :
+    CSenAtomMessage(),localState(KSenStateSave)
+    {
+    }
+
+EXPORT_C CSenAtomEntry::~CSenAtomEntry()
+    {
+    iBuffer.Close();
+    }
+
+EXPORT_C void CSenAtomEntry::BaseConstructL()
+    {
+    CSenFragmentBase::BaseConstructL(KSenAtomEntryXmlns, KSenAtomEntryName);
+
+    }
+
+//                     CALLBACKS
+
+EXPORT_C void CSenAtomEntry::OnStartElementL(const RTagInfo& aElement,
+        const RAttributeArray& aAttributes,
+        TInt /*aErrorCode*/)
+    {
+    
+    
+    const TPtrC8 saxLocalName = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix = aElement.Prefix().DesC();
+
+    if(saxLocalName==KSenAtomGroupName){
+        localState=KStateParsingMediaGroup;
+    }
+    if(saxLocalName==KSenAtomEntryName){
+            iState=KSenStateIgnore;
+        } 
+    CSenFragmentBase::OnStartElementL(aElement,aAttributes,TInt(KErrNone));
+
+    }
+
+EXPORT_C void CSenAtomEntry::OnContentL(const TDesC8& aBytes, TInt /*aErrorCode*/)
+    {
+    iBuffer.Close();
+    iBuffer.Create(aBytes);
+    CSenFragmentBase::OnContentL(aBytes, TInt(KErrNone));
+    }
+
+EXPORT_C void CSenAtomEntry::OnEndElementL(
+        const RTagInfo& aElement,
+        TInt /*aErrorCode*/)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomEntry::OnEndElementL");
+
+    const TPtrC8 saxLocalName = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix = aElement.Prefix().DesC();
+    
+    const TPtrC8 tLocalName = LocalName();
+    const TPtrC8 tNsUri = NsUri();
+    const TPtrC8 tPrefix = NsPrefix();
+
+    switch (localState)
+        {
+        case KStateParsingMediaGroup:
+            {
+                if(saxLocalName == KSenAtomGroupName)
+                    localState = KSenStateSave;
+                CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+            }
+            break;
+
+        case KSenStateSave:
+            {
+            if(saxLocalName == KSenAtomTitleName  && localState != KStateParsingMediaGroup)
+                {
+
+                if ( iTitle )
+                    {
+                    delete iTitle;
+                    iTitle = 0;
+                    }
+                if ( iBuffer.Length()> 0 )
+                    {
+                    iTitle = iBuffer.AllocL();
+
+                    CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+                    }
+                }else
+            if(saxLocalName == KSenAtomIdName  && localState != KStateParsingMediaGroup)
+                {
+
+                if ( iIdTag )
+                    {
+                    delete iIdTag;
+                    iIdTag = 0;
+                    }
+                if ( iBuffer.Length()> 0 )
+                    {
+                    iIdTag = iBuffer.AllocL();
+
+                    CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+                    }
+                }else
+            if(saxLocalName == KSenAtomPublishedName  && localState != KStateParsingMediaGroup)
+                {
+
+                if ( iPublished )
+                    {
+                    delete iPublished;
+                    iPublished = 0;
+                    }
+                if ( iBuffer.Length()> 0 )
+                    {
+                    iPublished = iBuffer.AllocL();
+
+                    CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+                    }
+                }else
+            if(saxLocalName == KSenAtomUpdatedName  && localState != KStateParsingMediaGroup)
+                {
+
+                if ( iUpdated )
+                    {
+                    delete iUpdated;
+                    iUpdated = 0;
+                    }
+                if ( iBuffer.Length()> 0 )
+                    {
+                    iUpdated = iBuffer.AllocL();
+
+                    CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+                    }
+                }
+                else {
+                    CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+                }
+            }
+        break;
+    
+        default:
+        CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+        break;
+        }
+
+    iBuffer.Close();
+    
+    }
+
+// SET         GET       COUNT          REMOVE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/senatomfeed.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,364 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        feed data class
+*
+*/
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <badesca.h>
+
+#include <SenDomFragmentBase.h>
+#include <xmlengnodelist.h>
+
+#include "senatomfeed.h"
+#include "senatomentry.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+EXPORT_C CSenAtomFeed* CSenAtomFeed::NewL( TInt64 aId )
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomFeed::NewL( TInt64 aId )");    
+    CSenAtomFeed* self = NewLC( aId );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+EXPORT_C CSenAtomFeed* CSenAtomFeed::NewLC( TInt64 aId )
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomFeed::NewLC( TInt64 aId )");     
+    CSenAtomFeed* self = new (ELeave) CSenAtomFeed;
+    CleanupStack::PushL( self );
+    self->BaseConstructL();
+    if ( aId != 0 )
+        {
+        self->iId = aId;
+        }
+    return self;
+    }
+
+CSenAtomFeed::CSenAtomFeed(): CSenAtomMessage()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomFeed()");     
+    }
+
+EXPORT_C void CSenAtomFeed::BaseConstructL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomFeed::BaseConstructL()");      
+    CSenFragmentBase::BaseConstructL(_L8("http://www.w3.org/2005/Atom"),_L8("feed"));
+    }
+
+EXPORT_C CSenAtomFeed::~CSenAtomFeed()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomFeed::~CSenAtomFeed()");
+    iEntries.ResetAndDestroy();
+    iEntries.Close();
+    }
+
+
+
+EXPORT_C TInt CSenAtomFeed::EntryCount() //const
+    {
+    /*/testing
+            TXmlEngElement feed = AsElementL();
+            RXmlEngNodeList<TXmlEngElement> list;
+            const TPtrC8 tNsUri = NsUri();
+            CleanupClosePushL(list);
+            feed.GetElementsByTagNameL(list, KSenAtomEntryName, tNsUri);
+            TInt a = list.Count();
+            CleanupStack::PopAndDestroy(&list);
+            TInt b = iEntries.Count();
+    //testing*/
+    return iEntries.Count();
+    }
+
+EXPORT_C TInt CSenAtomFeed::AddEntryL(CSenAtomEntry& aEntry)
+    {
+     TXmlEngElement feed = AsElementL();
+     RSenDocument doc = AsDocumentL();
+     feed.AppendChildL(aEntry.AsElementL());
+     CSenAtomEntry* ptrEnt = &aEntry;
+     TInt err = iEntries.Append(ptrEnt);
+     return err;
+    }
+
+EXPORT_C CSenAtomEntry* CSenAtomFeed::Entry( TInt aIndex ) const
+    {
+    if ( aIndex >= 0 && aIndex < iEntries.Count() )
+        return iEntries[aIndex];
+    else
+        return 0;
+    }
+
+EXPORT_C void CSenAtomFeed::RemoveEntryL(const TDesC8& aEntryId )
+    {
+
+    //from table
+    for (TInt aIndex = 0; aIndex < iEntries.Count(); aIndex++ )
+        {
+        const TDesC8& tmp = iEntries[aIndex]->IdTag();//delete this
+        if(aEntryId.Compare(iEntries[aIndex]->IdTag())==0)
+            {
+            delete iEntries[aIndex];
+            iEntries.Remove( aIndex );
+            }
+        }
+    
+    //from element
+    TXmlEngElement feed = AsElementL();
+    TXmlEngElement entry;
+    TXmlEngElement id;
+    RXmlEngNodeList<TXmlEngElement> list;
+    RXmlEngNodeList<TXmlEngElement> listIn;
+    const TPtrC8 tNsUri = NsUri();
+    CleanupClosePushL(list);
+    CleanupClosePushL(listIn);    
+    feed.GetElementsByTagNameL(list, KSenAtomEntryName, tNsUri);
+    while(list.HasNext()){
+        entry = list.Next();
+        entry.GetElementsByTagNameL(listIn, KSenAtomIdName, KSenAtomSpace);
+        while(listIn.HasNext()){
+            id = listIn.Next();
+            TPtrC8 idBuf = id.Text();
+            if(aEntryId.Compare(idBuf)==0){
+                entry.Remove();
+                break;
+            }
+        }
+    }
+    CleanupStack::PopAndDestroy(&listIn);
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+
+EXPORT_C void CSenAtomFeed::RemoveEntryL( CSenAtomEntry& aEntryToRemove )
+    {
+    const TDesC8& iEntryId = aEntryToRemove.IdTag();
+    RemoveEntryL(iEntryId);
+    }
+
+
+EXPORT_C const TDesC8& CSenAtomFeed::SubtitleL(){
+
+        TXmlEngElement feed = AsElementL();
+        RXmlEngNodeList<TXmlEngElement> list;
+        
+        CleanupClosePushL(list);
+
+        feed.GetElementsByTagNameL(list, KSenAtomSubtitleName, KSenAtomSpace);
+        if(list.Count()>0) {
+            TXmlEngElement subtitle = list.Next();
+            TPtrC8 icPtr = subtitle.Text();
+            CleanupStack::PopAndDestroy(&list);
+            HBufC8* out = icPtr.Alloc();
+            return *out;
+        }else{
+            CleanupStack::PopAndDestroy(&list);
+            return KNullDesC8();
+            };
+}
+
+EXPORT_C void CSenAtomFeed::SetSubtitleL( const TDesC8& aSubtitle){
+
+        TXmlEngElement feed = AsElementL();
+        TXmlEngElement logo = feed.AddNewElementL(KSenAtomSubtitleName);
+        if(aSubtitle!=KNullDesC8){
+         logo.SetTextNoEncL(aSubtitle);
+        }
+}
+
+EXPORT_C void CSenAtomFeed::SetGeneratorL( const TDesC8& aUri, const TDesC8& aVersion, const TDesC8& aText){
+
+        TXmlEngElement entry = AsElementL();
+        TXmlEngElement generator = entry.AddNewElementL(KSenAtomGeneratorName);
+        if(aUri!=KNullDesC8)
+            generator.AddNewAttributeSameNsL(KSenAtomURI,aUri);
+        if(aVersion!=KNullDesC8)
+            generator.AddNewAttributeSameNsL(KSenAtomVersion,aUri);
+        generator.SetTextNoEncL(aText);
+}
+
+EXPORT_C TXmlEngElement CSenAtomFeed::GetGeneratorL(){
+
+TXmlEngElement feed = AsElementL();
+RXmlEngNodeList<TXmlEngElement> list;
+
+CleanupClosePushL(list);
+
+feed.GetElementsByTagNameL(list, KSenAtomGeneratorName, KSenAtomSpace);
+if(list.Count()>0) {
+    TXmlEngElement generator = list.Next();
+    return generator;
+}else{
+    CleanupStack::PopAndDestroy(&list);
+    return TXmlEngElement(0);
+    }
+}
+
+/*EXPORT_C const TDesC8& CSenAtomFeed::GeneratorL(){
+
+        TXmlEngElement feed = AsElementL();
+        RXmlEngNodeList<TXmlEngElement> list;
+        
+        CleanupClosePushL(list);
+
+        feed.GetElementsByTagNameL(list, KSenAtomGeneratorName, KSenAtomSpace);
+        if(list.Count()>0) {
+            TXmlEngElement logo = list.Next();
+            TPtrC8 icPtr = logo.AttributeValueL(KSenAtomURI, KSenAtomSpace);
+            CleanupStack::PopAndDestroy(&list);
+            HBufC8* out = icPtr.Alloc();
+            return *out;
+        }else{
+            CleanupStack::PopAndDestroy(&list);
+            return KNullDesC8();
+            };
+}
+*/    
+EXPORT_C const TDesC8& CSenAtomFeed::LogoL(){
+
+        TXmlEngElement feed = AsElementL();
+        RXmlEngNodeList<TXmlEngElement> list;
+        
+        CleanupClosePushL(list);
+
+        feed.GetElementsByTagNameL(list, KSenAtomLogoName, KSenAtomSpace);
+        if(list.Count()>0) {
+            TXmlEngElement logo = list.Next();
+            TPtrC8 icPtr = logo.AttributeValueL(KSenAtomURI, KSenAtomSpace);
+            CleanupStack::PopAndDestroy(&list);
+            HBufC8* out = icPtr.Alloc();
+            return *out;
+        }else{
+            CleanupStack::PopAndDestroy(&list);
+            return KNullDesC8();
+            }
+}
+
+EXPORT_C void CSenAtomFeed::SetLogoL( const TDesC8& aUri){
+
+        TXmlEngElement entry = AsElementL();
+        TXmlEngElement logo = entry.AddNewElementL(KSenAtomLogoName);
+        if(aUri!=KNullDesC8)
+            logo.AddNewAttributeSameNsL(KSenAtomURI,aUri);
+
+}
+
+EXPORT_C void CSenAtomFeed::SetIconL( const TDesC8& aUri){
+
+        TXmlEngElement feed = AsElementL();
+        TXmlEngElement icon = feed.AddNewElementL(KSenAtomIconName);
+        if(aUri!=KNullDesC8)
+            icon.AddNewAttributeSameNsL(KSenAtomURI,aUri);
+
+}
+
+EXPORT_C const TDesC8& CSenAtomFeed::IconL(){
+
+        TXmlEngElement feed = AsElementL();
+        RXmlEngNodeList<TXmlEngElement> list;
+        
+        CleanupClosePushL(list);
+
+        feed.GetElementsByTagNameL(list, KSenAtomIconName, KSenAtomSpace);
+        if(list.Count()>0) {
+            TXmlEngElement icon = list.Next();
+            TPtrC8 icPtr = icon.AttributeValueL(KSenAtomURI, KSenAtomSpace);
+            CleanupStack::PopAndDestroy(&list);
+            HBufC8* out = icPtr.Alloc();
+            return *out;
+        }else{
+            CleanupStack::PopAndDestroy(&list);
+            return KNullDesC8();
+            };
+}
+
+        //*********************************************** CALLBACKS ***************/////
+
+
+EXPORT_C void CSenAtomFeed::OnStartElementL(const RTagInfo& aElement,
+        const RAttributeArray& aAttributes,    TInt /*aErrorCode*/)
+    {
+    
+    
+    const TPtrC8 saxLocalName = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix = aElement.Prefix().DesC();
+    
+    if(saxLocalName==KSenAtomFeedName){
+        iState= KSenStateIgnore;
+    } else{
+        iState= KSenStateSave;
+    }
+    if(saxLocalName==KSenAtomEntryName){
+        ParseEntryL(aElement, aAttributes);
+        CSenFragmentBase::OnStartElementL(aElement,aAttributes,TInt(KErrNone));
+    }else
+    {
+        CSenFragmentBase::OnStartElementL(aElement,aAttributes,TInt(KErrNone));
+    }
+    }
+
+EXPORT_C void CSenAtomFeed::OnContentL(const TDesC8& aBytes, TInt /*aErrorCode*/)
+    {
+    CSenFragmentBase::OnContentL(aBytes, TInt(KErrNone));
+    }
+
+EXPORT_C void CSenAtomFeed::OnEndElementL(const RTagInfo& aElement,TInt /*aErrorCode*/)
+    {
+
+    const TPtrC8 saxLocalName = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix = aElement.Prefix().DesC();
+    
+    const TPtrC8 tLocalName = LocalName();
+    const TPtrC8 tNsUri = NsUri();
+    const TPtrC8 tPrefix = NsPrefix();
+    //const TPtrC8 tmp = AsXmlL()->Des();
+    
+    if(saxLocalName==KSenAtomFeedName){
+        iState= KSenStateIgnore;
+    } else{
+        iState= KSenStateSave;
+    }
+    if(saxLocalName==KSenAtomEntryName)
+        {
+        RSenDocument& feed = AsDocumentL();
+        iEntries.Append(iEntry);
+        iEntry->AsElementL().CopyToL(feed);
+        delete iEntry;
+        iEntry = NULL;
+        CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+        }
+    else
+    CSenFragmentBase::OnEndElementL(aElement, TInt(KErrNone));
+
+    }
+
+EXPORT_C void CSenAtomFeed::ParseEntryL(const RTagInfo& aElement, const RAttributeArray& /*aAttributes*/)
+    {
+    
+    const TPtrC8 saxLocalName = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix = aElement.Prefix().DesC();
+    
+    iEntry = CSenAtomEntry::NewL();
+    OnDelegateParsingL(*iEntry);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/senatommessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,585 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <badesca.h>
+
+#include <SenDomFragmentBase.h>
+
+#include "senatommessage.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+#include <xmlengnodelist.h>
+
+CSenAtomMessage::CSenAtomMessage() 
+//:iTitle(NULL), iId(NULL), iUpdated(NULL), iPublished(NULL)
+// Automatically all members will be zeroed in  CBase derived classes, so initialization list is required only when to initializ other than zero
+// This fixes the RVCT Compiler warning #1299-D
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomMessage::CSenAtomMessage()");     
+    }
+
+EXPORT_C CSenAtomMessage::~CSenAtomMessage()
+    {
+    if(iTitle)
+        {
+        delete iTitle;
+        }
+    if(iIdTag)
+        {
+        delete iIdTag;
+        }
+    if(iUpdated)
+        {
+        delete iUpdated;
+        }
+    if(iPublished)
+        {
+        delete iPublished;
+        }
+    
+    }
+
+EXPORT_C TInt64 CSenAtomMessage::Id() const
+    {
+    return iId;
+    }
+
+EXPORT_C void CSenAtomMessage::OnStartElementL(const RTagInfo& aElement,
+                                                 const RAttributeArray& /* aAttributes*/,
+                                                 TInt /*aErrorCode*/)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomMessage::OnStartElementL");
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+    }
+
+EXPORT_C void CSenAtomMessage::OnEndElementL(
+                                            const RTagInfo& aElement,
+                                            TInt /*aErrorCode*/)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomMessage::OnEndElementL");
+    
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+    }
+
+
+EXPORT_C CSenFragmentBase* CSenAtomMessage::CreateBodyFragmentL(const TDesC8& aNsUri,
+                                                                  const TDesC8& aLocalName,
+                                                                  const TDesC8& aPrefix,
+                                                                  const RAttributeArray& aAttributes,
+                                                                  TXmlEngElement& aParent,
+                                                                  RSenDocument& aOwnerDocument)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomMessage::CreateBodyFragmentL");
+    return CSenDomFragmentBase::NewL(aNsUri, aLocalName, aPrefix, aAttributes, aParent, aOwnerDocument);    
+    }
+    
+EXPORT_C TBool CSenAtomMessage::IsSafeToCast(MSenMessage::TClass aType)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KSenMessagesLogLevel, "CSenAtomMessage::IsSafeToCast(aType)");
+    if ( aType == MSenMessage::EAtomMessage )
+        {
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+EXPORT_C MSenMessage::TClass CSenAtomMessage::Type()
+    {
+    return MSenMessage::EAtomMessage;
+    }   
+    
+EXPORT_C MSenMessage::TDirection CSenAtomMessage::Direction()
+    {
+    return MSenMessage::EOutbound;
+    }
+EXPORT_C TInt CSenAtomMessage::SetContext(MSenMessageContext* /*apNotOwnedContext*/)
+    {
+    return KErrNotSupported;
+    }
+EXPORT_C MSenMessageContext* CSenAtomMessage::Context()
+    {
+    return NULL;
+    }    
+EXPORT_C TInt CSenAtomMessage::SetProperties(MSenProperties* /*apOwnedProperties*/)
+    {
+    return KErrNotSupported;
+    }
+EXPORT_C MSenProperties* CSenAtomMessage::Properties()
+    {
+    return NULL;
+    }
+EXPORT_C TInt CSenAtomMessage::TxnId()
+    {
+    return KErrNotSupported;
+    }
+
+EXPORT_C MSenMessage* CSenAtomMessage::CloneL()
+    {
+    return NULL;
+    }
+
+
+EXPORT_C const TDesC8& CSenAtomMessage::Title() const
+    {
+    if ( iTitle )
+    return *iTitle;
+    else
+    return KNullDesC8();
+    }
+
+EXPORT_C void CSenAtomMessage::SetTitleL( const TDesC8& aTitle )
+    {
+    if ( iTitle )
+        {
+        delete iTitle;
+        iTitle = 0;
+        }
+    if ( aTitle.Length()> 0 )
+        {
+
+        iTitle = aTitle.AllocL();
+        TXmlEngElement message = AsElementL();
+        TXmlEngElement title;
+        title = message.AddNewElementL(KSenAtomTitleName);
+        title.SetTextNoEncL(aTitle);
+        }
+    }
+
+
+EXPORT_C TInt CSenAtomMessage::LinkCountL()
+    {
+    TXmlEngElement message = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    //const TPtrC8 tNsUri = NsUri();
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomLinkName, KSenAtomSpace);
+    TInt a = list.Count();
+    CleanupStack::PopAndDestroy(&list);
+    return a;
+    }
+
+EXPORT_C void CSenAtomMessage::AddLinkL( const TDesC8& aHref, const TDesC8& aRel, const TDesC8& aType, const TDesC8& aHrefLang, const TDesC8& aTitle, const TDesC8& aLength)
+    {
+
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement link;
+    link = message.AddNewElementL(KSenAtomLinkName);
+
+    if(aHref!=KNullDesC8)
+        {
+        link.AddNewAttributeSameNsL(KSenAtomHref,aHref);
+        }
+    if(aRel!=KNullDesC8)
+        {
+        link.AddNewAttributeSameNsL(KSenAtomRel,aRel);
+        }
+    if(aType!=KNullDesC8)
+        {
+        link.AddNewAttributeSameNsL(KSenAtomType,aType);
+        }
+    if(aHrefLang!=KNullDesC8)
+        {
+        link.AddNewAttributeSameNsL(KSenAtomHrefLang,aHrefLang);
+        }
+    if(aLength!=KNullDesC8)
+        {
+        link.AddNewAttributeSameNsL(KSenAtomLength,aLength);
+        }
+    if(aTitle!=KNullDesC8)
+        {
+        link.AddNewAttributeSameNsL(KSenAtomTitle,aTitle);
+        }
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveLinkL(TInt aIndex )
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement link;
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomLinkName, KSenAtomSpace);
+    TInt count =0;
+    while(list.HasNext()){
+        link = list.Next();
+        if(count == aIndex){
+            link.Remove();
+            break;
+        }
+        count++;
+    }
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveLinkL(const TDesC8& aHref )
+    {
+
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement link;
+    RXmlEngNodeList<TXmlEngElement> list;
+    
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomLinkName, KSenAtomSpace);
+    while(list.HasNext()){
+        link = list.Next();
+        TPtrC8 icPtr = link.AttributeValueL(KSenAtomHref, KSenAtomSpace);
+        if(aHref.Compare(icPtr)==0){
+            link.Remove();
+            break;
+        }
+    }
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+
+
+EXPORT_C void CSenAtomMessage:: AddCategoryL( const TDesC8& aTerm, const TDesC8& aScheme, const TDesC8& aLabel)
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement category;
+    category = message.AddNewElementL(KSenAtomCategoryName);
+
+    if(aTerm!=KNullDesC8)
+        {
+        category.AddNewAttributeSameNsL(KSenAtomTerm,aTerm);
+        }
+    if(aScheme!=KNullDesC8)
+        {
+        category.AddNewAttributeSameNsL(KSenAtomScheme,aScheme);
+        }
+    if(aLabel!=KNullDesC8)
+        {
+        category.AddNewAttributeSameNsL(KSenAtomLabel,aLabel);
+        }
+    }
+
+EXPORT_C TInt CSenAtomMessage::CategoryCountL()
+    {
+    TXmlEngElement message = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomCategoryName, KSenAtomSpace);
+    TInt a = list.Count();
+    CleanupStack::PopAndDestroy(&list);
+    return a;
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveCategoryL(const TDesC8& aTerm )
+    {
+
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement category;
+    RXmlEngNodeList<TXmlEngElement> list;
+    
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomCategoryName, KSenAtomSpace);
+    while(list.HasNext()){
+        category = list.Next();
+        TPtrC8 icPtr = category.AttributeValueL(KSenAtomTerm, KSenAtomSpace);
+        if(aTerm.Compare(icPtr)==0){
+            category.Remove();
+            break;
+        }
+    }
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+
+
+EXPORT_C const TDesC8& CSenAtomMessage::Updated() const
+    {
+    if ( iUpdated )
+    return *iUpdated;
+    else
+    return KNullDesC8;
+    }
+
+EXPORT_C void CSenAtomMessage::SetUpdatedL( const TDesC8& aUpdated )
+    {
+    if ( iUpdated )
+        {
+        delete iUpdated;
+        iUpdated = 0;
+        }
+    if ( aUpdated.Length()> 0 )
+        {
+        iUpdated = aUpdated.AllocL();
+        TXmlEngElement message = AsElementL();
+        TXmlEngElement updated;
+        updated = message.AddNewElementL(KSenAtomUpdatedName);
+        updated.SetTextNoEncL(aUpdated);
+        }
+    }
+
+EXPORT_C const TDesC8& CSenAtomMessage::Published() const
+    {
+    if ( iPublished )
+    return *iPublished;
+    else
+    return KNullDesC8;
+    }
+
+EXPORT_C void CSenAtomMessage::SetPublishedL( const TDesC8& aPublished )
+    {
+    if ( iPublished )
+        {
+        delete iPublished;
+        iPublished = 0;
+        }
+    if ( aPublished.Length()> 0 )
+        {
+        iPublished = aPublished.AllocL();
+        TXmlEngElement message = AsElementL();
+        TXmlEngElement published;
+        published = message.AddNewElementL(KSenAtomPublishedName);
+        published.SetTextNoEncL(aPublished);
+        }
+    }
+
+EXPORT_C const TDesC8& CSenAtomMessage::IdTag() const
+    {
+    if ( iIdTag )
+    return *iIdTag;
+    else
+    return KNullDesC8;
+    }
+
+EXPORT_C void CSenAtomMessage::SetIdTagL( const TDesC8& aId )
+    {
+    if ( iIdTag )
+        {
+        delete iIdTag;
+        iIdTag = 0;
+        }
+    if ( aId.Length()> 0 )
+        {
+        iIdTag = aId.AllocL();
+        TXmlEngElement message = AsElementL();
+        TXmlEngElement id;
+        id = message.AddNewElementL(KSenAtomIdName);
+        id.SetTextNoEncL(aId);
+        }
+    }
+
+
+EXPORT_C void CSenAtomMessage::SetAuthorL( const TDesC8& aName, const TDesC8& aUri, const TDesC8& aEmail )
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement auth;
+
+    auth = message.AddNewElementL(KSenAtomAuthorName);
+
+    if(aName!=KNullDesC8)
+        {
+        TXmlEngElement nameEl;
+        nameEl = auth.AddNewElementL(KSenAtomName);
+        nameEl.SetTextNoEncL(aName);
+        }
+    if(aUri!=KNullDesC8)
+        {
+        TXmlEngElement uriEl;
+        uriEl = auth.AddNewElementL(KSenAtomURI);
+        uriEl.SetTextNoEncL(aUri);
+        }
+    if(aEmail!=KNullDesC8)
+        {
+        TXmlEngElement emailEl;
+        emailEl = auth.AddNewElementL(KSenAtomEmail);
+        emailEl.SetTextNoEncL(aEmail);
+        }
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveAuthorL()
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement author;
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomAuthorName, KSenAtomSpace);
+    while(list.HasNext()){
+        author = list.Next();
+        author.Remove();
+    }
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+EXPORT_C TInt CSenAtomMessage::ContributorCountL()
+    {
+    TXmlEngElement message = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    //const TPtrC8 tNsUri = NsUri();
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, KSenAtomContributorName, KSenAtomSpace);
+    TInt a = list.Count();
+    CleanupStack::PopAndDestroy(&list);
+    return a;
+    }
+
+EXPORT_C void CSenAtomMessage::AddContributorL( const TDesC8& aName, const TDesC8& aUri, const TDesC8& aEmail )
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement contributor;
+    contributor = message.AddNewElementL(KSenAtomContributorName);
+
+    if(aName!=KNullDesC8)
+        {
+        TXmlEngElement nameEl;
+        nameEl = contributor.AddNewElementL(KSenAtomName);
+        nameEl.SetTextNoEncL(aName);
+        }
+    if(aUri!=KNullDesC8)
+        {
+        TXmlEngElement uriEl;
+        uriEl = contributor.AddNewElementL(KSenAtomURI);
+        uriEl.SetTextNoEncL(aUri);
+        }
+    if(aEmail!=KNullDesC8)
+        {
+        TXmlEngElement emailEl;
+        emailEl = contributor.AddNewElementL(KSenAtomEmail);
+        emailEl.SetTextNoEncL(aEmail);
+        }
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveContributorL(const TDesC8& aName )
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement contributor;
+    TXmlEngElement nameTag;
+    RXmlEngNodeList<TXmlEngElement> list;
+    RXmlEngNodeList<TXmlEngElement> listIn;
+    
+    CleanupClosePushL(list);
+    CleanupClosePushL(listIn);
+    
+    message.GetElementsByTagNameL(list, KSenAtomContributorName, KSenAtomSpace);
+    while(list.HasNext()){
+        contributor = list.Next();
+        contributor.GetElementsByTagNameL(listIn, KSenAtomName, KSenAtomSpace);
+        while(listIn.HasNext()){
+            nameTag = listIn.Next();
+            TPtrC8 idBuf = nameTag.Text();
+            if(aName.Compare(idBuf)==0){
+                contributor.Remove();
+                break;
+            }
+        }
+    }
+    CleanupStack::PopAndDestroy(&listIn);
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+
+EXPORT_C void CSenAtomMessage::SetRightsL( const TDesC8& aRights)
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement rightsEl;
+    rightsEl = message.AddNewElementL(KSenAtomRightsName);
+    rightsEl.SetTextNoEncL(aRights);
+    }
+
+EXPORT_C const TDesC8& CSenAtomMessage::RightsL()
+    {
+        TXmlEngElement message = AsElementL();
+        RXmlEngNodeList<TXmlEngElement> list;
+        CleanupClosePushL(list);
+
+        message.GetElementsByTagNameL(list, KSenAtomRightsName, KSenAtomSpace);
+        if(list.Count()>0) {
+            TXmlEngElement rights = list.Next();
+            TPtrC8 icPtr = rights.Text();
+            CleanupStack::PopAndDestroy(&list);
+            HBufC8* out = icPtr.Alloc();
+            return *out;
+        }else{
+            CleanupStack::PopAndDestroy(&list);
+            return KNullDesC8();
+            }
+    }
+
+EXPORT_C TInt CSenAtomMessage::AttributeCountL(const TDesC8& aName, const TDesC8& aNameSpaceURI)
+    {
+    TXmlEngElement message = AsElementL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    //const TPtrC8 tNsUri = NsUri();
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, aName, aNameSpaceURI);
+    TInt a = list.Count();
+    CleanupStack::PopAndDestroy(&list);
+    return a;
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveByAttributeL(const TDesC8& atomtag, const TDesC8& aNameSpaceUri, const TDesC8& attributeName, const TDesC8& aValue)
+    {
+
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement tagToRemove;
+    RXmlEngNodeList<TXmlEngElement> list;
+    
+    CleanupClosePushL(list);
+    message.GetElementsByTagNameL(list, atomtag, aNameSpaceUri);
+    while(list.HasNext()){
+        tagToRemove = list.Next();
+        TPtrC8 icPtr = tagToRemove.AttributeValueL(attributeName, KSenAtomSpace);
+        if(aValue.Compare(icPtr)==0){
+            tagToRemove.Remove();
+            break;
+        }
+    }
+    CleanupStack::PopAndDestroy(&list);
+    }
+
+EXPORT_C void CSenAtomMessage::RemoveBySubtagL(const TDesC8& aAtomtag, const TDesC8& aNameSpaceUri, const TDesC8& aSubtagName, const TDesC8& aValue)
+    {
+    TXmlEngElement message = AsElementL();
+    TXmlEngElement tagToRemove;
+    TXmlEngElement name;
+    RXmlEngNodeList<TXmlEngElement> list;
+    RXmlEngNodeList<TXmlEngElement> listIn;
+    CleanupClosePushL(list);
+    CleanupClosePushL(listIn);
+    message.GetElementsByTagNameL(list, aAtomtag, aNameSpaceUri);
+    while(list.HasNext()){
+        tagToRemove = list.Next();
+        tagToRemove.GetElementsByTagNameL(listIn, aSubtagName, aNameSpaceUri);
+        while(listIn.HasNext()){
+                name = listIn.Next();
+                TPtrC8 idBuf = name.Text();
+                if(aValue.Compare(idBuf)==0){
+                    tagToRemove.Remove();
+                    break;
+                }
+        }
+    }
+    CleanupStack::PopAndDestroy(&listIn);
+    CleanupStack::PopAndDestroy(&list);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/senmessagebase.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,264 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <s32strm.h>
+#include "senmessagebase.h"
+#include <MSenProperties.h>
+#include <SenHttpTransportProperties.h>
+#include "senvtcptransportproperties.h"
+//#include "SenLayeredHttpTransportProperties.h"
+//#include "SenLayeredVtcpTransportProperties.h"
+
+#include "senchunk.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+//#include <SenXmlReader.h>
+
+#include "msenmessagecontext.h"
+#include "senmessagecontext.h"
+#include "senlayeredtransportproperties.h" // private
+
+#include <SenServiceConnection.h>
+
+EXPORT_C CSenMessageBase* CSenMessageBase::NewL(CSenChunk& aChunk)
+    {
+    CSenMessageBase* pNew = CSenMessageBase::NewLC(aChunk);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenMessageBase* CSenMessageBase::NewLC(CSenChunk& aChunk)
+    {
+    CSenMessageBase* pNew = new (ELeave) CSenMessageBase(aChunk);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+EXPORT_C void CSenMessageBase::BaseConstructL()
+    {
+    TLSLOG_L( KSenMessagesLogChannel, KMinLogLevel, "CSenMessageBase::BaseConstructL" );
+    MSenProperties::TSenPropertiesClassType type = iChunk.ChunkHeader().PropertiesType();
+    TLSLOG_FORMAT(( KSenMessagesLogChannel, KNormalLogLevel, 
+                    _L("- Message type: (%d)"), type ));
+    
+    TInt error = iChunk.DescFromChunk( iSerializedMessage, 0 );
+#ifdef _SENDEBUG
+    if( error )
+        {
+        TLSLOG_FORMAT(( KSenMessagesLogChannel, KMinLogLevel, 
+                        _L("- Fatal(!): cannot find message (descriptor) from chunk, error: (%d)"), error ));
+        }
+#endif // _SENDEBUG        
+    User::LeaveIfError ( error );
+    
+    if( type != MSenProperties::ENotInUse )
+        {
+        //User::LeaveIfError( iChunk.DescsFromChunk(iSerializedMessage, iSerializedProperties) );
+        error = iChunk.DescFromChunk( iSerializedProperties, 1 );
+#ifdef _SENDEBUG        
+        if ( error )
+            {
+            TLSLOG_FORMAT(( KSenMessagesLogChannel, KMinLogLevel, 
+                _L("CSenMessageBase::BaseConstructL, MAJOR: properties type != MSenProperties::ENotInUse, but desc not in chunk, error: (%d)"), error ));
+            }
+#endif // _SENDEBUG
+        }
+    
+    switch( type )
+        {
+        case MSenProperties::ENotInUse:
+            {
+            
+            break;
+            }
+        case MSenProperties::ESenXmlProperties:
+        case MSenProperties::ESenLayeredXmlProperties: // flatten the props
+            {
+            ipProperties = CSenXmlProperties::NewL(); // iSerializedMessage, *pReader);
+            break;
+            }
+        case MSenProperties::ESenTransportProperties:
+        case MSenProperties::ESenLayeredTransportProperties: // flatten the props
+            {
+            ipProperties = CSenTransportProperties::NewL();
+            break;
+            }
+        case MSenProperties::ESenHttpTransportProperties:
+        case MSenProperties::ESenLayeredHttpTransportProperties: // flatten the props
+            {
+            ipProperties = CSenHttpTransportProperties::NewL();
+            break;
+            }
+        case MSenProperties::ESenVtcpTransportProperties:
+        case MSenProperties::ESenLayeredVtcpTransportProperties: // flatten the props
+            {
+            ipProperties = CSenVtcpTransportProperties::NewL();
+            break;
+            }
+            /*
+        case MSenProperties::ESenLayeredXmlProperties:
+            {
+            ipProperties = CSenLayeredXmlProperties::NewL(iSerializedMessage, *pReader);
+            break;
+            }
+        case MSenProperties::ESenLayeredTransportProperties:
+            {
+            ipProperties = CSenLayeredTransportProperties::NewL(iSerializedMessage, *pReader);
+            break;
+            }
+        case MSenProperties::ESenLayeredHttpTransportProperties:
+            {
+            ipProperties = CSenLayeredHttpTransportProperties::NewL(iSerializedMessage, *pReader);
+            break;
+            }
+        case MSenProperties::ESenLayeredVtcpTransportProperties:
+            {
+            ipProperties = CSenLayeredVtcpTransportProperties::NewL(iSerializedMessage, *pReader);
+            break;
+            }
+            */
+        default: 
+            {
+            break;
+            }
+        }
+        
+    if ( ipProperties && iSerializedProperties.Length() > 0 )
+        {
+        ipProperties->ReadFromL( iSerializedProperties );
+        }
+    }
+
+EXPORT_C CSenMessageBase::CSenMessageBase(CSenChunk& aChunk)
+:   iChunk( aChunk ),
+    ipProperties( NULL ),
+    iTxnId( KErrNotFound ),
+    iSerializedMessage( KNullDesC8 ),
+    iSerializedProperties( KNullDesC8 )
+    {
+    }
+
+EXPORT_C CSenMessageBase::~CSenMessageBase()
+    {
+    if( ipProperties )
+        {
+        if( ipProperties->IsSafeToCast( MSenProperties::ESenXmlProperties) )
+            {
+            CSenXmlProperties* pFlatProps = (CSenXmlProperties*)ipProperties;
+            delete pFlatProps;
+            }
+        else if( ipProperties->IsSafeToCast( MSenProperties::ESenLayeredXmlProperties) )
+            {
+            CSenLayeredXmlProperties* pLayeredProps = (CSenLayeredXmlProperties*)ipProperties;
+            delete pLayeredProps;
+            }
+#ifdef _SENDEBUG            
+        else 
+            { 
+            // TLS log as fatal(!) 
+            TLSLOG_L( KSenMessagesLogChannel, KMinLogLevel, 
+                "CSenMessageBase::~CSenMessageBase():" );            
+            TLSLOG_L( KSenMessagesLogChannel, KMinLogLevel, 
+                "- Fatal(!): ipProperties != NULL, but cannot be cast to XML properties(!)" );            
+            }
+#endif // _SENDEBUG            
+        }
+    }
+
+
+MSenMessage::TClass CSenMessageBase::Type()
+    {
+    return iChunk.ChunkHeader().MessageType();
+    }
+    
+MSenMessage::TDirection CSenMessageBase::Direction()
+    {
+    return iChunk.ChunkHeader().MessageDirection();
+    }
+
+MSenMessageContext* CSenMessageBase::Context() 
+    {
+    return ipContext; 
+    }
+
+MSenProperties* CSenMessageBase::Properties()
+    {
+    return ipProperties;    
+    }
+    
+TInt CSenMessageBase::SetContext(MSenMessageContext* apNotOwnedContext)
+    {
+    if( !apNotOwnedContext )
+        {
+        return KErrArgument;
+        }
+    // ipContext is NOT owned(!)
+    delete ipProperties;
+    ipProperties = NULL;
+    ipContext = apNotOwnedContext;
+    return KErrNone;
+    }
+    
+TInt CSenMessageBase::SetProperties(MSenProperties* apOwnedProperties)
+    {
+    if( !apOwnedProperties )
+        {
+        return KErrArgument;
+        }
+    delete ipProperties;
+    ipProperties = apOwnedProperties;
+    return KErrNone;
+    }
+    
+    
+TBool CSenMessageBase::IsSafeToCast(TClass aType)
+    {
+    if ( aType == MSenMessage::EMessageBase )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }        
+    }
+    
+TInt CSenMessageBase::TxnId()
+    {
+    return iChunk.ChunkHeader().TransactionId();
+    }
+
+MSenMessage* CSenMessageBase::CloneL()
+    {
+    return NULL;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/sensoapenvelope2.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,946 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <s32strm.h>
+
+#include <SenXmlUtils.h>
+#include <SenDomFragmentBase.h>
+#include <xmlengnodelist.h>
+
+
+#include "SenSoapEnvelope2.h"
+#include "SenSoapFault2.h"
+#include "senlayeredtransportproperties.h"
+#include "senmessagecontext.h"
+#include "msenmessagecontext.h"
+
+#include "SenXmlProperties.h" // for de-alloc
+#include "senlayeredxmlproperties.h" // for de-alloc
+
+#include "sendebug.h"
+#include "senlogger.h"
+#include "wslibxml2utils.h"
+
+EXPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::NewL()");    
+    CSenSoapEnvelope2* pNew = CSenSoapEnvelope2::NewLC();
+    CleanupStack::Pop( pNew ); // pNew
+    return pNew;    
+    }
+    
+EXPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewLC()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::NewLC()");    
+    CSenSoapEnvelope2* pNew = new (ELeave) CSenSoapEnvelope2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewL(MSenMessageContext& aContext)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::NewL(aContext)");    
+    CSenSoapEnvelope2* pNew = CSenSoapEnvelope2::NewLC(aContext);
+    CleanupStack::Pop(pNew); // pNew
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewLC(MSenMessageContext& aContext)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::NewLC(aContext)");    
+    CSenSoapEnvelope2* pNew = new (ELeave) CSenSoapEnvelope2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewL(CSenSoapEnvelope2& aEnvelope)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::NewLC(aEnvelope)");    
+    CSenSoapEnvelope2* pNew = CSenSoapEnvelope2::NewLC(aEnvelope);
+    CleanupStack::Pop(pNew); // pNew
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewLC(CSenSoapEnvelope2& aEnvelope)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::NewLC(aEnvelope)");    
+    CSenSoapEnvelope2* pNew = new (ELeave) CSenSoapEnvelope2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aEnvelope);
+    return pNew;
+    }
+
+EXPORT_C void CSenSoapEnvelope2::BaseConstructL(TSOAPVersion aVersion)
+    {
+    if (aVersion != ESOAP12)
+        {
+        CSenFragmentBase::BaseConstructL(KSenSoapEnvelopeXmlns,
+                                         KSenSoapEnvelopeName,
+                                         KSenSoapEnvelopePrefix);
+        }
+    else
+        {
+        CSenFragmentBase::BaseConstructL(KSenSoap12EnvelopeXmlns,
+                                         KSenSoapEnvelopeName,
+                                         KSenSoapEnvelopePrefix);
+
+        }
+    }
+
+EXPORT_C void CSenSoapEnvelope2::BaseConstructL(MSenMessageContext& aContext)
+    {
+    ipNotOwnedContext = &aContext;
+    BaseConstructL(ESOAP11);
+    }
+
+EXPORT_C void CSenSoapEnvelope2::BaseConstructL(MSenMessageContext& aContext, TSOAPVersion aVersion)
+    {
+    ipNotOwnedContext = &aContext;
+    BaseConstructL(aVersion);
+    }
+
+EXPORT_C void CSenSoapEnvelope2::BaseConstructL()
+    {
+    BaseConstructL(ESOAP11);
+    }
+
+EXPORT_C void CSenSoapEnvelope2::BaseConstructL(CSenSoapEnvelope2& aEnvelope)
+    {
+    CSenFragmentBase::BaseConstructL(aEnvelope.AsElementL());
+    
+    iTransactionId       = aEnvelope.iTransactionId;
+    ipNotOwnedContext    = aEnvelope.ipNotOwnedContext;
+    iFault               = aEnvelope.iFault;
+    iDirection           = aEnvelope.iDirection;
+    ipNotOwnedContext    = aEnvelope.ipNotOwnedContext;
+    
+    if ( aEnvelope.ipSoapAction )
+        {
+        ipSoapAction = aEnvelope.ipSoapAction->AllocL();
+        }
+        
+    if ( aEnvelope.ipBodyFragment )
+        {
+        TXmlEngElement envelope = AsElementL();
+        TXmlEngElement body;
+
+        RXmlEngNodeList<TXmlEngElement> list;
+        CleanupClosePushL(list);
+        envelope.GetElementsByTagNameL(list, KSenSoapEnvelopeBodyName,
+                                             NsUri());
+        if ( list.Count() > 0 )
+            {
+            body = list.Next();
+            ipBodyFragment = CSenFragmentBase::NewL(body, AsDocumentL());
+            }
+        
+        CleanupStack::PopAndDestroy(&list);
+        }
+        
+    if ( aEnvelope.ipHeaderFragment )
+        {
+        TXmlEngElement envelope = AsElementL();
+        TXmlEngElement header;
+        
+        RXmlEngNodeList<TXmlEngElement> list;
+        CleanupClosePushL(list);
+        envelope.GetElementsByTagNameL(list, KSenSoapEnvelopeHeaderName,
+                                             NsUri());
+        if ( list.Count() > 0 )
+            {
+            ipHeaderFragment = CSenFragmentBase::NewL(header, AsDocumentL());
+            }
+        
+        CleanupStack::PopAndDestroy(&list);
+        }
+        
+    if ( aEnvelope.ipProperties )
+        {
+        ipProperties = aEnvelope.ipProperties->CloneL();
+        }    
+    }
+
+CSenSoapEnvelope2::CSenSoapEnvelope2()
+:   ipBodyFragment(NULL),
+    ipHeaderFragment(NULL),
+    ipSoapAction(NULL),
+    iFault(EFalse)
+    {
+    }
+
+EXPORT_C CSenSoapEnvelope2::~CSenSoapEnvelope2()
+    {
+    if(ipBodyFragment)
+        {
+        ipBodyFragment->ExtractElement();
+        delete ipBodyFragment;
+        }
+    if(ipHeaderFragment)
+        {
+        ipHeaderFragment->ExtractElement(); // // delegate's element is owned by us
+        delete ipHeaderFragment;
+        }
+    delete ipSoapAction;
+
+    if( ipProperties )
+        {
+        
+        if ( ipProperties->IsSafeToCast( MSenProperties::ESenXmlProperties ) )
+            {
+            CSenXmlProperties* pFlatProps = (CSenXmlProperties*)ipProperties;
+            delete pFlatProps;
+            ipProperties = NULL;
+            }
+        else if ( ipProperties->IsSafeToCast( MSenProperties::ESenLayeredXmlProperties ) )
+            {
+            CSenLayeredXmlProperties* pLayeredProps = (CSenLayeredXmlProperties*)ipProperties;
+            delete pLayeredProps;
+            ipProperties = NULL;
+            }
+        // else // TLS log as fatal..
+        }
+    }
+    
+
+EXPORT_C void CSenSoapEnvelope2::OnStartElementL(const RTagInfo& aElement,
+    	                                         const RAttributeArray& aAttributes,
+                                                 TInt /*aErrorCode*/)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::OnStartElementL");    
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+        
+    switch (iState)
+        {
+        case KSenStateIgnore:
+            {
+            // check if we encounter the start of a soap:Envelope...
+            if ( iElement.IsNull() && saxNsUri == NsUri() &&
+                 saxLocalName == KSenSoapEnvelopeName )
+                {
+                if ( saxNsUri == KNullDesC8 && saxPrefix == KNullDesC8 )
+                    {
+                    iDocument.CreateDocumentElementL(saxLocalName);
+                    }
+                else
+                    {
+                    if ( saxPrefix == KNullDesC8 )
+                        {
+                        iDocument.CreateDocumentElementL(saxLocalName,
+                                                         saxNsUri,
+                                                         KNullDesC8);
+                        }
+                    else
+                        {
+                        iDocument.CreateDocumentElementL(saxLocalName,
+                                                         saxNsUri,
+                                                         saxPrefix);
+                        }
+                    }
+                iElement = iDocument.DocumentElement();        
+                }
+                
+            if ( iElement.NotNull() && saxLocalName == KSenSoapEnvelopeName && saxNsUri != NsUri() )
+                {
+                iElement.Remove();
+                if ( saxNsUri == KNullDesC8 && saxPrefix == KNullDesC8 )
+                    {
+                    iDocument.CreateDocumentElementL(saxLocalName);
+                    }
+                else
+                    {
+                    if ( saxPrefix == KNullDesC8 )
+                        {
+                        iDocument.CreateDocumentElementL(saxLocalName,
+                                                         saxNsUri,
+                                                         KNullDesC8);
+                        }
+                    else
+                        {
+                        iDocument.CreateDocumentElementL(saxLocalName,
+                                                         saxNsUri,
+                                                         saxPrefix);
+                        }
+                    }
+                iElement = iDocument.DocumentElement();        
+                }
+                
+
+            if ( iElement.NotNull() && LocalName() == saxLocalName &&
+                 NsUri() == saxNsUri )
+                {
+                TXmlEngElement element = AsElementL();
+                WsXmlUtils domUtils;       
+                domUtils.XmlEngRenameElementL(element, saxLocalName, saxNsUri, saxPrefix);
+                AddAttributesToElementL(element, aAttributes);
+                }
+
+            else if ( saxNsUri == NsUri() )
+                {
+                // we are interested in SOAP Header
+                if ( saxLocalName == KSenSoapEnvelopeHeaderName )
+                    {
+                    iState = KStateParsingSoapHeader;
+
+                    // Make sure that header element exists:
+                    // == this ensures that we add a "Header"
+                    // element to the children:
+                    TXmlEngElement header = HeaderL();
+                    
+                    WsXmlUtils domUtils;       
+                    domUtils.XmlEngRenameElementL(header, saxLocalName, saxNsUri, saxPrefix);
+                    AddAttributesToElementL(header, aAttributes);
+                    }
+                else if( saxLocalName == KSenSoapEnvelopeBodyName )
+                    {
+                    iState = KStateParsingSoapBody;
+
+                    TXmlEngElement body = BodyL();
+                    WsXmlUtils domUtils;
+                    domUtils.XmlEngRenameElementL(body, saxLocalName, saxNsUri, saxPrefix);
+                    AddAttributesToElementL(body, aAttributes);
+                    }
+                //ESLI-6WEN9V
+                //This case is to handle fault which lies outside the body or without body
+                else if( saxLocalName == KSenSoapFaultName)
+	                 	{
+	                 	iFault = ETrue;
+	                	RSenDocument document = AsDocumentL();
+	                	TXmlEngElement element = BodyL();
+	                                
+	                	// delegate parsing to a SOAPFaultFragment to keep
+	                	// a structured representation.
+	                	ipBodyFragment = CSenSoapFault2::NewL(saxNsUri,
+	                                                      saxLocalName,
+	                                                      saxPrefix,
+	                                                      aAttributes,
+	                                                      element,
+	                                                      document);
+	                                                      
+	                	OnDelegateParsingL(*ipBodyFragment);	
+	                 	
+	                 	}
+                //ESLI-6WEN9V
+                }
+            break;
+            }
+        case KStateParsingSoapHeader:
+            {
+            ParseHeaderL(aElement, aAttributes);
+            }
+            break;
+        case KStateParsingSoapBody:
+            {
+            if ( ipBodyFragment )
+                {
+                ipBodyFragment->ExtractElement();
+                delete ipBodyFragment;
+                ipBodyFragment = NULL;
+                }
+
+            // check if we encounter a Fault
+            if ( saxLocalName == KSenSoapFaultName )
+                {
+                iFault = ETrue;
+                RSenDocument document = AsDocumentL();
+                TXmlEngElement element = BodyL();
+                                
+                // delegate parsing to a SOAPFaultFragment to keep
+                // a structured representation.
+                ipBodyFragment = CSenSoapFault2::NewL(saxNsUri,
+                                                      saxLocalName,
+                                                      saxPrefix,
+                                                      aAttributes,
+                                                      element,
+                                                      document);
+                                                      
+                OnDelegateParsingL(*ipBodyFragment);
+                }
+            else
+                {
+                RSenDocument document = AsDocumentL();
+                TXmlEngElement element = BodyL();
+                
+                // Delegate uses same document
+                // Parent for delegate will be body
+                
+				ipBodyFragment = CreateBodyFragmentL(saxNsUri, 
+				                                     saxLocalName,
+					                                 saxPrefix, 
+					                                 aAttributes,
+					                                 element, 
+					                                 document);
+				
+				
+                OnDelegateParsingL(*ipBodyFragment);
+                }
+            }
+            break;
+        default:
+            break;
+        }
+    }
+
+EXPORT_C void CSenSoapEnvelope2::OnEndElementL(
+                                            const RTagInfo& aElement,
+                                            TInt /*aErrorCode*/)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::OnEndElementL");    
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+    
+    switch (iState)
+        {
+        case KSenStateIgnore:
+            {
+            break;
+            }
+        case KStateParsingSoapHeader:
+            {
+            if (saxNsUri == NsUri() && saxLocalName == KSenSoapEnvelopeHeaderName)
+                {
+                iState = KSenStateIgnore;
+                }
+            break;
+            }
+        case KStateParsingSoapBody:
+            {
+            if (saxNsUri == NsUri() && saxLocalName == KSenSoapEnvelopeBodyName)
+                {
+                iState = KSenStateIgnore;
+                }
+/*            else
+                {
+                if(ipBodyFragment)
+                    {
+                    //ipBodyFragment->EnsureNamespacesL();
+                    }
+                }*/
+            }
+            break;
+        default:
+            break;
+        }
+    }
+
+EXPORT_C TXmlEngElement CSenSoapEnvelope2::SetBodyL(TXmlEngElement aBodyElement)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::SetBodyL(aBodyElement)");    
+    if ( aBodyElement.Name() == KSenSoapFaultName &&  aBodyElement.NamespaceUri() == NsUri() )
+        {
+        iFault = ETrue;
+        }
+    
+    TXmlEngElement body = BodyL();
+    body.RemoveChildren();
+    aBodyElement.MoveTo(body);
+    return aBodyElement;
+    }
+    
+EXPORT_C TPtrC8 CSenSoapEnvelope2::SetBodyL(const TDesC8& aBody)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::SetBodyL(aBody)");
+    TLSLOG_ALL(KSenMessagesLogChannel, KMaxLogLevel, aBody);
+    TXmlEngElement body = BodyL();
+    body.SetTextNoEncL(aBody);
+    return TPtrC8(aBody);
+    }
+    
+
+EXPORT_C TXmlEngElement CSenSoapEnvelope2::BodyL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::BodyL()");
+    TXmlEngElement envelope = AsElementL();
+    TXmlEngElement body;
+
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    envelope.GetElementsByTagNameL(list, KSenSoapEnvelopeBodyName,
+                                         NsUri());
+    if ( list.Count() > 0 )
+        {
+        body = list.Next();
+        }
+    else
+        {
+        body = envelope.AddNewElementL(KSenSoapEnvelopeBodyName);
+
+        // Check if namespace declaration
+        // is already defined in envelope.
+        // => Should be!
+        TXmlEngNamespace ns = envelope.LookupNamespaceByUriL(NsUri());
+        if ( ns.IsUndefined() )
+            {
+            // Namespace declaration will be added
+            body.AddNamespaceDeclarationL(NsUri(), KNullDesC8);
+            }
+        
+        WsXmlUtils domUtils;       
+        domUtils.XmlEngRenameElementL(body, KSenSoapEnvelopeBodyName, NsUri(), KNullDesC8);
+        }    
+    
+    CleanupStack::PopAndDestroy(&list);
+    return body;
+    }
+
+EXPORT_C TXmlEngElement CSenSoapEnvelope2::HeaderL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::HeaderL()");
+    TXmlEngElement envelope = AsElementL();
+    TXmlEngElement header;
+
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    envelope.GetElementsByTagNameL(list, KSenSoapEnvelopeHeaderName,
+                                         NsUri());
+    if ( list.Count() > 0 )
+        {
+        header = list.Next();
+        }
+    else
+        {
+        header = envelope.AddNewElementL(KSenSoapEnvelopeHeaderName);
+
+        // Check if namespace declaration
+        // is already defined in envelope.
+        // => Should be!
+        TXmlEngNamespace ns = envelope.LookupNamespaceByPrefixL(NsPrefix());
+        WsXmlUtils domUtils;       
+        domUtils.XmlEngRenameElementL(header, KSenSoapEnvelopeHeaderName, ns.Uri(), ns.Prefix() );
+
+        TXmlEngElement body = BodyL();
+        if ( body.NotNull() )
+            {
+            header.SetAsFirstSibling();
+            }
+        }
+    CleanupStack::PopAndDestroy(&list);
+        
+    return header;
+    }
+
+EXPORT_C TXmlEngElement CSenSoapEnvelope2::AddHeaderL(TXmlEngElement aHeaderElement)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::AddHeaderL(aHeaderElement)");
+    aHeaderElement.MoveTo(HeaderL());
+    return aHeaderElement;
+    }
+
+EXPORT_C void CSenSoapEnvelope2::ParseHeaderL(
+                                        const RTagInfo& aElement,
+                                        const RAttributeArray& aAttributes)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::ParseHeaderL");
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+    
+    if ( ipHeaderFragment )
+        {
+        delete ipHeaderFragment;
+        ipHeaderFragment = NULL;
+        }
+        
+    TXmlEngElement header = HeaderL();
+    RSenDocument document = AsDocumentL();
+        
+    ipHeaderFragment = CSenDomFragmentBase::NewL(saxNsUri,
+                                                 saxLocalName,
+                                                 saxPrefix,
+                                                 aAttributes,
+                                                 header,
+                                                 document
+                                                 );
+
+    OnDelegateParsingL(*ipHeaderFragment);
+    }
+
+
+EXPORT_C HBufC8* CSenSoapEnvelope2::BodyAsStringL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::BodyAsStringL");
+    TXmlEngElement body = BodyL();
+    
+    HBufC8* bodyAsXML = NULL;
+
+    // Note, that difference to Jave ref-implementation here is,
+    // that in *EVERY* case, no matter if SOAP BODY has no child 
+    // element at all OR if it has one or more children, the whole
+    // <S:Body> element is ALWAYS returned -- [never just the only
+    // child, and never a of zero-length string, even if no children]
+
+    body.Unlink(); // According to documentation RDocument which
+                   // was holding the body TXmlEngElement remains owner
+                   // until body is linked elsewhere or destroyed.
+                   // => CleanupStack usage is not needed.
+    body.ReconcileNamespacesL();
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    body.OuterXmlL(buffer);
+    bodyAsXML = buffer.AllocL();
+    CleanupStack::PopAndDestroy(&buffer);
+    body.Remove(); // Destroy Body
+        
+    return bodyAsXML;
+    }
+
+EXPORT_C TBool CSenSoapEnvelope2::IsFault()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::IsFault()");
+    return iFault;
+    }
+
+// NOTE: caller takes ownership of the NEW fault element
+EXPORT_C CSenSoapFault2* CSenSoapEnvelope2::DetachFaultL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::DetachFaultL()");
+    TXmlEngElement body = BodyL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    
+    TXmlEngElement fault;
+    body.GetElementsByTagNameL(list, KSenSoapFaultName, NsUri());
+
+    if ( list.Count() > 0 )
+        {
+        fault = list.Next();
+            
+        fault.Unlink();
+
+        fault.ReconcileNamespacesL();
+
+        CSenSoapFault2* pAnswer = CSenSoapFault2::NewL(fault);
+        CleanupStack::PopAndDestroy(&list);
+        return pAnswer;
+        }
+        
+    CleanupStack::PopAndDestroy(&list);
+    return NULL;
+    }
+
+EXPORT_C CSenSoapFault2* CSenSoapEnvelope2::FaultL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::FaultL()");
+    TXmlEngElement body = BodyL();
+    TXmlEngElement fault;
+
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    body.GetElementsByTagNameL(list, KSenSoapFaultName,  NsUri());
+    if ( list.Count() > 0 )
+        {
+        fault = list.Next();
+
+        CSenSoapFault2* pAnswer = CSenSoapFault2::NewL(fault,
+                                                       AsDocumentL());
+        CleanupStack::PopAndDestroy(&list);
+        return pAnswer;
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    return NULL;
+    }
+
+EXPORT_C TPtrC8 CSenSoapEnvelope2::SetSoapActionL(const TDesC8& aSoapAction)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::SetSoapActionL(aSoapAction)");
+
+    _LIT8(KQuote, "\"");
+    HBufC8* pTemp = HBufC8::NewLC(aSoapAction.Length()+(2*KQuote().Length()));
+
+    TPtr8 temp = pTemp->Des();
+
+    if(!SenXmlUtils::StartsWith(aSoapAction, KQuote))
+        {
+        temp.Append(KQuote);
+        }
+    temp.Append(aSoapAction);
+
+    if(!SenXmlUtils::EndsWith(*pTemp, KQuote))
+        {
+        temp.Append(KQuote);
+        }
+
+    if(ipSoapAction)
+        {
+        delete ipSoapAction;
+        ipSoapAction = NULL;
+        }
+    ipSoapAction = pTemp;
+    CleanupStack::Pop(); // pTemp is now safe
+    return SoapAction();
+    }
+
+
+EXPORT_C TPtrC8 CSenSoapEnvelope2::SoapAction()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::SoapAction()");
+    if(ipSoapAction)
+        {
+        return ipSoapAction->Des();
+        }
+    else
+        {
+        // Note, that zero-length descriptor must be returned
+        // if SetSoapActionL() has not been called. Otherwise,
+        // when passing transport properties over IPC boundary,
+        // code cannot determine whether the caller, who utilizes
+        // CSenSoapEnvelope wishes to override any underlying
+        // value of SOAPAction with "empty" value (== "").
+        // If SOAPAction is set in CSenSoapEnvelope, it is stronger
+        // than message level (SendL/SubmitL in CSenServiceConnection)
+        // or session level (SetTransportPropertiesL) definitions.
+        return KNullDesC8(); 
+        }        
+    }
+
+EXPORT_C TBool CSenSoapEnvelope2::HasHeader()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::HasHeader()");
+    TInt err( KErrNone );
+    TInt count( 0 );
+    RXmlEngNodeList<TXmlEngElement> list;
+    TRAP(   
+        err, 
+        TXmlEngElement envelope = AsElementL(); 
+        envelope.GetElementsByTagNameL(list, KSenSoapEnvelopeHeaderName, NsUri() );    
+         )
+    if( !err ) 
+        {
+        count = list.Count();
+        }
+    list.Close();
+    if ( count > 0 )
+        {
+        return ETrue;
+        }
+    else
+        {
+        // actually, there could be some header(s), but it could not be checked, if a leave occured.       
+        return EFalse;
+        }
+    }
+
+EXPORT_C TBool CSenSoapEnvelope2::HasBody()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::HasBody()");
+    TInt err( KErrNone );
+    TInt count( 0 );
+    RXmlEngNodeList<TXmlEngElement> list;
+    
+    TRAP( 
+        err, 
+        TXmlEngElement envelope = AsElementL(); 
+        envelope.GetElementsByTagNameL(list, KSenSoapEnvelopeBodyName, NsUri());
+        )
+    if( !err )
+        {
+        count = list.Count();
+        }
+    list.Close();            
+    if ( count > 0 )
+        {
+        return ETrue;
+        }
+    else
+        {
+        // actually, there could be body, but it could not be checked, if a leave occured.                   
+        return EFalse;
+        }
+    }
+    
+EXPORT_C TSOAPVersion CSenSoapEnvelope2::SoapVersion()
+    {
+    if( NsUri() == KSenSoap12EnvelopeXmlns )
+        {
+        return ESOAP12;
+        }
+    else 
+        {
+        return ESOAP11;
+        }
+    }
+    
+EXPORT_C MSenMessage::TClass CSenSoapEnvelope2::Type()
+    {
+    return MSenMessage::ESoapEnvelope2;
+    }
+
+EXPORT_C MSenMessage::TDirection CSenSoapEnvelope2::Direction()
+    {
+    return iDirection;
+    }
+
+/*
+EXPORT_C MSenProperties& CSenSoapEnvelope2::Properties()
+    {
+    if ( ipContext == NULL )
+        {
+        return *ipNotOwnedContext->TransportProperties();
+        }
+
+    return *ipContext->TransportProperties();
+    }
+    
+EXPORT_C MSenMessageContext& CSenSoapEnvelope2::Context()    
+    {
+    if ( ipContext == NULL )
+        {
+        return *ipNotOwnedContext;
+        }
+
+    return *ipContext;
+    }
+*/
+
+EXPORT_C TInt CSenSoapEnvelope2::SetContext(MSenMessageContext* apNotOwnedContext)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::SetContext(MSenMessageContext)");
+    if( !apNotOwnedContext )
+        {
+        return KErrArgument;
+        }
+
+    // switching to NEW context always resets any existing properties(!)
+    if(ipProperties)
+    	{
+        if ( ipProperties->IsSafeToCast(MSenProperties::ESenXmlProperties) )
+            {
+            CSenXmlProperties* pFlatProps = (CSenXmlProperties*)ipProperties;
+            delete pFlatProps;
+            ipProperties = NULL;
+            }
+        else if ( ipProperties->IsSafeToCast(MSenProperties::ESenLayeredXmlProperties) )
+            {
+            CSenLayeredXmlProperties* pLayeredProps = (CSenLayeredXmlProperties*)ipProperties;
+            delete pLayeredProps;
+            ipProperties = NULL;
+	        }
+        }
+    // else {  // TLS log as fatal  }
+    ipNotOwnedContext = apNotOwnedContext;
+    return KErrNone;
+    }
+    
+EXPORT_C MSenMessageContext* CSenSoapEnvelope2::Context()
+    {
+    return ipNotOwnedContext;
+    }
+
+EXPORT_C TInt CSenSoapEnvelope2::SetProperties(MSenProperties* apOwnedProperties)
+    {
+    if( !apOwnedProperties ) 
+        {
+        return KErrArgument;
+        }
+    if( ipProperties )
+        {
+        // De-allocate existing, self-owned properties
+        if ( ipProperties->IsSafeToCast(MSenProperties::ESenXmlProperties) )
+            {
+            CSenXmlProperties* pFlatProps = (CSenXmlProperties*)ipProperties;
+            delete pFlatProps;
+            ipProperties = NULL;
+            }
+        else if ( ipProperties->IsSafeToCast(MSenProperties::ESenLayeredXmlProperties) )
+            {
+            CSenLayeredXmlProperties* pLayeredProps = (CSenLayeredXmlProperties*)ipProperties;
+            delete pLayeredProps;
+            ipProperties = NULL;
+            }
+        // else { // Log as fatal }
+        }
+
+    if( ipNotOwnedContext )
+        {
+        // Store properties into context
+        ipNotOwnedContext->SetProperties( apOwnedProperties, ETrue );
+        }
+    else
+        {
+        // Own the properties directly inside this message
+        ipProperties = apOwnedProperties;
+        }
+    return KErrNone;
+    }
+    
+EXPORT_C MSenProperties* CSenSoapEnvelope2::Properties()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::Properties()");
+    if( ipNotOwnedContext )
+        {
+        return ipNotOwnedContext->Properties();
+        }
+    else if ( ipProperties )
+        {
+        return ipProperties;
+        }
+    else
+        {
+        return NULL;
+        }        
+    }
+
+
+EXPORT_C TBool CSenSoapEnvelope2::IsSafeToCast(MSenMessage::TClass aType)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::IsSafeToCast(aType)");
+    if ( aType == MSenMessage::ESoapEnvelope2 )
+        {
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+
+EXPORT_C TInt CSenSoapEnvelope2::TxnId()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::TxnId()");
+    return iTransactionId;
+    }
+    
+EXPORT_C CSenFragmentBase* CSenSoapEnvelope2::CreateBodyFragmentL(const TDesC8& aNsUri,
+                                                                  const TDesC8& aLocalName,
+                                                                  const TDesC8& aPrefix,
+                                                                  const RAttributeArray& aAttributes,
+                                                                  TXmlEngElement& aParent,
+                                                                  RSenDocument& aOwnerDocument)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::CreateBodyFragmentL");
+	return CSenDomFragmentBase::NewL(aNsUri, aLocalName, aPrefix, aAttributes, aParent, aOwnerDocument);    
+    }
+    
+EXPORT_C MSenMessage* CSenSoapEnvelope2::CloneL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapEnvelope2::CloneL()");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL(*this);
+    return pEnvelope;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/sensoapfault2.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,399 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+/*******************************************************
+ *     SOAP 1.1    |             SOAP 1.2              *
+ *-----------------------------------------------------*
+ *  env:Fault      | env:Fault                         *
+ *-----------------------------------------------------*
+ *  faultcode      | env:Code, env:Subcode, env:Value  *
+ *-----------------------------------------------------*
+ *  faultstring    | env:Reason, env:Text              *
+ *-----------------------------------------------------*
+ *  faultactor     | env:Node, (env:Role)              *
+ *-----------------------------------------------------*
+ *  detail         | env:Detail                        *
+ *******************************************************/
+ 
+/****************************************************************************
+ *                            SOAP 1.2 Example                              *
+ ****************************************************************************
+ *                                                                          *
+ * <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"        *
+ *               xmlns:m="http://www.example.org/timeouts"                  *
+ *               xmlns:xml="http://www.w3.org/XML/1998/namespace">          *
+ *  <env:Body>                                                              *
+ *   <env:Fault>                                                            *
+ *    <env:Code>                                                            *
+ *      <env:Value>env:Sender</env:Value>                                   *
+ *      <env:Subcode>                                                       *
+ *       <env:Value>m:MessageTimeout</env:Value>                            *
+ *      </env:Subcode>                                                      *
+ *    </env:Code>                                                           *
+ *    <env:Reason>                                                          *
+ *      <env:Text xml:lang="en">Sender Timeout</env:Text>                   *
+ *    </env:Reason>                                                         *
+ *    <env:Node>http://MyServer:80/sql</env:Node>                           *
+ *    <env:Role>http://schemas.microsoft.com/sqlserver/2004/SOAP</env:Role> *
+ *    <env:Detail>                                                          *
+ *      <m:MaxTime>P5M</m:MaxTime>                                          *
+ *    </env:Detail>                                                         *
+ *   </env:Fault>                                                           *
+ *  </env:Body>                                                             *
+ * </env:Envelope>                                                          *
+ *                                                                          *
+ ****************************************************************************/ 
+
+/****************************************************************************
+ *                   SOAP (older than 1.2) Example                          *
+ ****************************************************************************
+ *                                                                          *
+ * <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"      *
+ *       env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">     *
+ *  <env:Body>                                                              *
+ *   <env:Fault>                                                            *
+ *    <faultcode>env:MustUnderstand</faultcode>                             *
+ *    <faultstring>Mandatory Header error.</faultstring>                    *
+ *    <faultactor>http://www.wrox.com/heroes/endpoint.asp</faultactor>      *
+ *    <detail>                                                              *
+ *     <w:source xmlns:w="http://www.wrox.com/">                            *
+ *      <module>endpoint.asp</module>                                       *
+ *      <line>203</line>                                                    *
+ *     </w:source>                                                          *
+ *    </detail>                                                             *
+ *   </env:Fault>                                                           *
+ *  </env:Body>                                                             *
+ * </env:Envelope>                                                          *
+ *                                                                          *
+ ****************************************************************************/ 
+
+// INCLUDE FILES
+#include "SenSoapFault2.h"
+#include "SenSoapEnvelope2.h"
+
+#include <xmlengnodelist.h>
+
+EXPORT_C CSenSoapFault2* CSenSoapFault2::NewL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aPrefix,
+                                        const RAttributeArray& aAttributes,
+                                        TXmlEngElement& aElement,
+                                        RSenDocument& aDocument)
+    {
+    CSenSoapFault2* pNew = new (ELeave) CSenSoapFault2;
+    CleanupStack::PushL(pNew);
+	pNew->ConstructL(aNsUri, aLocalName, aPrefix, aAttributes,
+	                 aElement, aDocument);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapFault2* CSenSoapFault2::NewL(TXmlEngElement& aElement)
+    {
+    CSenSoapFault2* pNew = new (ELeave) CSenSoapFault2;
+    CleanupStack::PushL(pNew);
+	pNew->ConstructL(aElement);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapFault2* CSenSoapFault2::NewL(TXmlEngElement& aElement,
+                                              RSenDocument& aDocument)
+    {
+    CSenSoapFault2* pNew = new (ELeave) CSenSoapFault2;
+    CleanupStack::PushL(pNew);
+	pNew->ConstructL(aElement, aDocument);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapFault2::~CSenSoapFault2()
+    {
+    }
+
+EXPORT_C CSenSoapFault2::CSenSoapFault2()
+	{
+	}
+
+EXPORT_C void CSenSoapFault2::ConstructL(TXmlEngElement& aElement)
+	{
+	BaseConstructL(aElement);
+	}
+
+EXPORT_C void CSenSoapFault2::ConstructL(TXmlEngElement& aElement,
+                                         RSenDocument& aDocument)
+	{
+    iDocument = aDocument.Copy();
+    iElement = aElement;
+	}
+
+EXPORT_C void CSenSoapFault2::ConstructL(const TDesC8& aNsUri,
+							 const TDesC8& aLocalName,
+							 const TDesC8& aPrefix,
+							 const RAttributeArray& aAttributes,
+							 TXmlEngElement& aElement,
+							 RSenDocument& aDocument)
+	{
+	BaseConstructL(aNsUri, aLocalName, aPrefix, aAttributes,
+	               aElement, aDocument);
+	}
+	
+EXPORT_C TPtrC8 CSenSoapFault2::FaultCode()
+	{
+	TInt err(KErrNone);
+	TXmlEngElement element;
+	TXmlEngElement* pElement = NULL;
+	TRAP( 
+	    err, 
+	    element = AsElementL();
+	    pElement = &(element);
+	    )
+    if( !err && pElement )
+        {
+    	TXmlEngNamespace ns = pElement->NamespaceDeclaration();
+        if ( ns.Uri() != KSenSoap12EnvelopeXmlns)
+    		{
+            RXmlEngNodeList<TXmlEngElement> list;
+            TRAP( err, pElement->GetElementsByTagNameL(list, KFaultCodeLocalname); )
+            if ( !err && list.HasNext() )
+                {
+                TXmlEngElement child = list.Next();
+   	            list.Close();
+                return child.Text();
+                }
+            list.Close();
+    		}
+            
+        else
+    		{
+            RXmlEngNodeList<TXmlEngElement> list1;
+            TRAP( err, pElement->GetElementsByTagNameL( list1, KFault12CodeLocalname, NsUri() ); )
+            if ( !err && list1.HasNext() )
+                {
+                TXmlEngElement child = list1.Next();
+                RXmlEngNodeList<TXmlEngElement> list2;
+                TRAP( err, child.GetElementsByTagNameL( list2, KFault12ValueLocalname, NsUri()); )
+                if ( !err && list2.HasNext() )
+                    {
+                    TXmlEngElement value = list2.Next();
+                    list2.Close();
+                    list1.Close();
+                    return value.Text();
+                    }
+                list2.Close();
+    			}
+    	    list1.Close();
+    		}
+        }		
+        
+    return KNullDesC8();
+
+	}
+
+EXPORT_C TPtrC8 CSenSoapFault2::FaultSubcode()
+	{
+	TInt err( KErrNone );
+	TXmlEngElement element;
+	TXmlEngElement* pElement = NULL;
+	TRAP( 
+	    err, 
+	    element = AsElementL();
+	    pElement = &(element);
+	    )
+	if( !err && pElement)
+	    {
+    	TXmlEngNamespace ns = pElement->NamespaceDeclaration();
+        if ( ns.Uri() == KSenSoap12EnvelopeXmlns)
+            {
+            RXmlEngNodeList<TXmlEngElement> list1;
+            TRAP( err, pElement->GetElementsByTagNameL( list1, KFault12CodeLocalname, NsUri()); )
+            if ( !err && list1.HasNext() )
+                {
+                TXmlEngElement child = list1.Next();
+                RXmlEngNodeList<TXmlEngElement> list2;
+                TRAP( err, child.GetElementsByTagNameL(list2, KFault12SubcodeLocalname, NsUri()); )
+                if ( !err && list2.HasNext() )
+                    {
+                    TXmlEngElement subcode = list2.Next();
+                    RXmlEngNodeList<TXmlEngElement> list3;
+                    TRAP( err, subcode.GetElementsByTagNameL(list3, KFault12ValueLocalname, NsUri()); )
+                    if ( !err && list3.HasNext() )
+                        {
+                        TXmlEngElement value = list3.Next();
+                        list3.Close();
+                        list2.Close();
+                        list1.Close();
+                        return value.Text();
+                        }
+                    list3.Close();
+                    }
+                list2.Close();
+                }
+            list1.Close();
+            }
+        }   
+    // else { // AsElementL() -method leaved(!) }
+    return KNullDesC8();
+	}
+
+
+EXPORT_C TPtrC8 CSenSoapFault2::FaultString()
+	{
+	TInt err( KErrNone );
+	TXmlEngElement element;
+	TXmlEngElement* pElement = NULL;
+	TRAP( 
+	    err, 
+	    element = AsElementL(); 
+	    pElement = &(element); 
+	    )
+	if( !err && pElement ) 
+	    {
+    	TXmlEngNamespace ns = pElement->NamespaceDeclaration();
+        if ( ns.Uri() != KSenSoap12EnvelopeXmlns)
+            {
+            RXmlEngNodeList<TXmlEngElement> list;
+            TRAP( err, pElement->GetElementsByTagNameL(list, KFaultStringLocalname); )
+            if ( !err && list.HasNext() )
+                {
+                TXmlEngElement child = list.Next();
+                list.Close();
+                return child.Text();
+                }
+            list.Close();
+            }
+        else
+            {
+            RXmlEngNodeList<TXmlEngElement> list1;
+            TRAP( err, pElement->GetElementsByTagNameL( list1, KFault12ReasonLocalname, NsUri()); )
+            if ( !err && list1.HasNext() )
+                {
+                TXmlEngElement child = list1.Next();
+                RXmlEngNodeList<TXmlEngElement> list2;
+                TRAP( err, child.GetElementsByTagNameL( list2, KFault12TextLocalname, NsUri()); )
+                if ( !err && list2.HasNext() )
+                    {
+                    TXmlEngElement value = list2.Next();
+                    list2.Close();
+                    list1.Close();
+                    return value.Text();
+                    }
+                list2.Close();
+    			}
+            list1.Close();
+            }
+        }  
+    // else { // AsElementL -method leaved(!) }      
+	return KNullDesC8();
+	}
+
+EXPORT_C TPtrC8 CSenSoapFault2::FaultActor()
+	{
+	TInt err( KErrNone );
+	TXmlEngElement element;
+	TXmlEngElement* pElement = NULL;
+	TRAP( 
+	    err, 
+	    element = AsElementL(); 
+	    pElement = &(element);
+	    )
+    if( !err && pElement ) 
+        {
+    	TXmlEngNamespace ns = pElement->NamespaceDeclaration();
+        if ( ns.Uri() != KSenSoap12EnvelopeXmlns)
+            {
+            RXmlEngNodeList<TXmlEngElement> list;
+            TRAP( err, pElement->GetElementsByTagNameL(list, KFaultActorLocalname); )
+            if ( !err && list.HasNext() )
+                {
+                TXmlEngElement child = list.Next();
+                list.Close();
+                return child.Text();
+                }
+            list.Close();
+            }
+        else
+            {
+            RXmlEngNodeList<TXmlEngElement> list;
+            TRAP( err, pElement->GetElementsByTagNameL(list, KFault12NodeLocalname, NsUri()); )
+            if ( !err && list.HasNext() )
+                {
+                TXmlEngElement value = list.Next();
+                list.Close();
+                return value.Text();
+                }
+            list.Close();
+            }
+        }
+    // else { // AsElementL -method leaved(!) }            
+	return KNullDesC8();
+	}
+
+EXPORT_C TPtrC8 CSenSoapFault2::Detail()
+	{
+    TInt err( KErrNone );
+    TXmlEngElement element;
+    TXmlEngElement* pElement = NULL;
+	TRAP( 
+	    err, 
+	    element = AsElementL(); 
+	    pElement = &(element);
+	    )
+	if( !err && pElement )
+	    {
+    	TXmlEngNamespace ns = pElement->NamespaceDeclaration();
+        if ( ns.Uri() != KSenSoap12EnvelopeXmlns)
+            {
+            RXmlEngNodeList<TXmlEngElement> list;
+            TRAP( err, pElement->GetElementsByTagNameL(list, KDetailLocalname); )
+            if ( !err && list.HasNext() )
+                {
+                TXmlEngElement child = list.Next();
+                list.Close();
+                return child.Text();
+                }
+            list.Close();
+            }
+        else
+            {
+            RXmlEngNodeList<TXmlEngElement> list;
+            TRAP( err, pElement->GetElementsByTagNameL( list, KFault12DetailLocalname, NsUri() ); )
+            if ( !err && list.HasNext() )
+                {
+                TXmlEngElement child = list.Next();
+                list.Close();
+                return child.Text();
+                }
+            list.Close();
+            }
+        }  
+    // else { // AsElementL -method leaved(!) }                          
+	return KNullDesC8();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/sensoapmessage2.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,436 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <xmlengnodelist.h>
+#include <badesca.h>
+#include <SenXmlReader.h>
+#include <s32mem.h>
+#include <utf.h>
+
+#include "SenWsSecurityHeader2.h"
+#include "SenSoapMessage2.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL()");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC();
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC()");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL(TSOAPVersion aVersion)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL(aVersion)");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC(aVersion);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC(TSOAPVersion aVersion)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC(aVersion)");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aVersion);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL(TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL(aVersion,aSecurityNs)");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC(aVersion, aSecurityNs);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC(TSOAPVersion aVersion,
+                                                   const TDesC8& aSecurityNs)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC(aVersion,aSecurityNs)");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aVersion, aSecurityNs);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL(MSenMessageContext& aContext)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL(aContext)");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC(aContext);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC(MSenMessageContext& aContext)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC(aContext)");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL(aContext,aVersion)");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC(aContext, aVersion);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC(MSenMessageContext& aContext,
+                                                   TSOAPVersion aVersion)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC(aContext,aVersion)");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext, aVersion);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL(aContext,aVersion,aSecurityNs)");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC(aContext,
+                                                      aVersion,
+                                                      aSecurityNs);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC(aContext,aVersion,aSecurityNs)");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext, aVersion, aSecurityNs);
+    return pNew;
+    }
+    
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewL(CSenSoapMessage2& aMessage)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewL(aMessage)");
+    CSenSoapMessage2* pNew = CSenSoapMessage2::NewLC(aMessage);
+    CleanupStack::Pop(pNew); // pNew
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessage2* CSenSoapMessage2::NewLC(CSenSoapMessage2& aMessage)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewLC(aMessage)");
+    CSenSoapMessage2* pNew = new (ELeave) CSenSoapMessage2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aMessage);
+    return pNew;
+    }
+    
+EXPORT_C CSenSoapMessage2::~CSenSoapMessage2()
+    {
+    if (ipSecurityHeader)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipSecurityHeader->ExtractElement();
+        delete ipSecurityHeader;
+        }
+    }
+    
+EXPORT_C CSenSoapMessage2::CSenSoapMessage2()
+: ipSecurityHeader(NULL)
+    {
+    }
+
+EXPORT_C void CSenSoapMessage2::BaseConstructL()
+    {
+    CSenSoapEnvelope2::BaseConstructL();
+    }
+
+EXPORT_C void CSenSoapMessage2::BaseConstructL(TSOAPVersion aVersion)
+    {
+    CSenSoapEnvelope2::BaseConstructL(aVersion);
+    }
+
+EXPORT_C void CSenSoapMessage2::BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs)
+    {
+    BaseConstructL(aVersion);
+    if ( ( aSecurityNs == KSecuritySchemeXmlNs ) || ( aSecurityNs == KSecurityXmlNs ) )
+        {
+        TXmlEngElement element = AsElementL();
+        RSenDocument document = AsDocumentL();
+        ipSecurityHeader = CSenWsSecurityHeader2::NewL(KNullDesC8,
+                                                       aSecurityNs,
+                                                       document,
+                                                       element);
+        this->AddHeaderL(ipSecurityHeader->AsElementL());
+        }
+    }
+
+EXPORT_C void CSenSoapMessage2::BaseConstructL(MSenMessageContext& aContext)
+    {
+    CSenSoapEnvelope2::BaseConstructL(aContext);
+    }
+
+EXPORT_C void CSenSoapMessage2::BaseConstructL(MSenMessageContext& aContext,
+                                               TSOAPVersion aVersion)
+    {
+    CSenSoapEnvelope2::BaseConstructL(aContext, aVersion);
+    }
+
+EXPORT_C void CSenSoapMessage2::BaseConstructL(MSenMessageContext& aContext,
+                                               TSOAPVersion aVersion,
+                                               const TDesC8& aSecurityNs)
+    {
+    BaseConstructL(aContext, aVersion);
+    if ( ( aSecurityNs == KSecuritySchemeXmlNs ) || ( aSecurityNs == KSecurityXmlNs ) )
+        {
+        TXmlEngElement element = AsElementL();
+        RSenDocument document = AsDocumentL();
+        ipSecurityHeader = CSenWsSecurityHeader2::NewL(KNullDesC8,
+                                                       aSecurityNs,
+                                                       document,
+                                                       element);
+        this->AddHeaderL(ipSecurityHeader->AsElementL());
+        }
+    }
+    
+EXPORT_C void CSenSoapMessage2::BaseConstructL(CSenSoapMessage2& aMessage)
+    {
+    CSenSoapEnvelope2::BaseConstructL(aMessage);
+    }
+
+EXPORT_C void CSenSoapMessage2::SetSecurityHeaderL(const TDesC8& aData)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::SetSecurityHeaderL(aData)");
+    CSenWsSecurityHeader2* pTemp = NULL;
+    TXmlEngElement element = AsElementL();
+    RSenDocument document = AsDocumentL();
+
+    if ( aData == KNullDesC8 )
+        {
+        // we don't have credential
+        pTemp = NewSecurityHeaderLC(NULL, document, element);
+        }
+    else
+        {
+        // there is a credential to add..
+        pTemp = NewSecurityHeaderLC(&aData, document, element);
+        }
+
+    TXmlEngElement header = HeaderL();
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    header.GetElementsByTagNameL(list, KSecurityName,
+                                       pTemp->XmlNs());
+    while ( list.HasNext() )
+        {
+        TXmlEngElement element = list.Next();
+        element.Remove();
+        }
+
+    if ( ipSecurityHeader )
+        {
+        delete ipSecurityHeader;
+        ipSecurityHeader = NULL;
+        }
+    
+    CleanupStack::PopAndDestroy(&list);
+        
+    ipSecurityHeader = pTemp;
+    CleanupStack::Pop(); // pTemp
+    this->AddHeaderL(ipSecurityHeader->AsElementL());
+    }
+
+EXPORT_C void CSenSoapMessage2::ParseHeaderL( const RTagInfo& aElement,
+                                              const RAttributeArray& aAttributes)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::ParseHeaderL");
+    const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+    const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+    const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+    
+    TXmlEngElement element = AsElementL();
+    RSenDocument document = AsDocumentL();
+    
+    CSenWsSecurityHeader2* pTemp = NewSecurityHeaderLC(NULL, document, element);
+
+    if ((pTemp->XmlNs() == saxNsUri) && (KSecurityName() == saxLocalName))
+        {
+        // Remove existing <Security> header
+        TXmlEngElement header = HeaderL();
+        RXmlEngNodeList<TXmlEngElement> list;
+        CleanupClosePushL(list);
+        header.GetElementsByTagNameL(list, KSecurityName, pTemp->XmlNs());
+        while ( list.HasNext() )
+            {
+            TXmlEngElement element = list.Next();
+            element.Remove();
+            }
+            
+        CleanupStack::PopAndDestroy(&list);
+
+        if ( ipSecurityHeader )
+            {
+            delete ipSecurityHeader;
+            ipSecurityHeader = NULL;
+            }
+            
+        ipSecurityHeader = pTemp;
+        CleanupStack::Pop(); // pTemp
+        
+        TXmlEngElement wsSecurityHeader = ipSecurityHeader->AsElementL();
+        wsSecurityHeader.MoveTo(header);
+        OnDelegateParsingL(*ipSecurityHeader);        
+        }
+    else
+        {
+        TXmlEngElement rootElement = pTemp->AsElementL();
+        rootElement.Remove();
+        CleanupStack::PopAndDestroy(); // pTemp
+        CSenSoapEnvelope2::ParseHeaderL(aElement, aAttributes);
+        }
+    }
+
+EXPORT_C TInt CSenSoapMessage2::AddSecurityTokenL(const TDesC8& aNewToken)
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::AddSecurityTokenL(aNewToken)");
+    TXmlEngElement element = AsElementL();
+    RSenDocument document = AsDocumentL();
+    TXmlEngElement soapHeader = HeaderL();
+    TXmlEngElement wsSecurityHeader;
+
+    // Create <wsse:Security> element into wrong place
+    // <=> into a root element = Envelope.
+    // <S:Envelope>
+    //   ...
+    //   <wsse:Security>
+    // That's because we don't want following search to find
+    // this new header inside <S:Header> element.
+    CSenWsSecurityHeader2* pHeader = NewSecurityHeaderLC(NULL, document, element);
+    RXmlEngNodeList<TXmlEngElement> list;
+    CleanupClosePushL(list);
+    soapHeader.GetElementsByTagNameL(list, KSecurityName,
+                                           pHeader->XmlNs());
+                                          
+    if ( !list.HasNext() )
+        {
+        // <wsse:Security> element was not found from <S:Header> element.
+        // => Add new header by moving header from (root) <S:Envelope>
+        //    element into <S:Header> element.
+        wsSecurityHeader = pHeader->ExtractElement();
+        wsSecurityHeader.MoveTo(soapHeader);
+        }
+    else
+        {
+        // <wsse:Security> element was found from <S:Header> element.
+        // => Delete new header element from SoapMessage DOM tree by
+        //    removing header from (root) <S:Envelope> element.
+        wsSecurityHeader = pHeader->ExtractElement();
+        wsSecurityHeader.Remove();
+        
+        // Select found <wsse:Security> element to be edited
+        wsSecurityHeader = list.Next();
+        }
+        
+    CleanupStack::PopAndDestroy(&list);
+
+    CleanupStack::PopAndDestroy(); // pHeader // safe to delete
+
+    TPtrC8 content = wsSecurityHeader.Text();
+    HBufC8* pContent = HBufC8::NewLC( content.Length() + aNewToken.Length() );
+    TPtr8 ptrContent = pContent->Des();
+    ptrContent.Append(content);
+    ptrContent.Append(aNewToken);
+    wsSecurityHeader.SetTextNoEncL(*pContent);
+    CleanupStack::PopAndDestroy(pContent);    
+
+    return KErrNone;
+    }
+
+EXPORT_C CSenWsSecurityHeader2* CSenSoapMessage2::NewSecurityHeaderLC( const TDesC8* aData,
+                                                                       RSenDocument aDocument,
+                                                                       TXmlEngElement element )
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::NewSecurityHeaderLC");
+    CSenWsSecurityHeader2* pNew = NULL;
+
+    if ( aData )
+        {
+        if ( ipSecurityHeader )
+            {
+            pNew = CSenWsSecurityHeader2::NewL(*aData, ipSecurityHeader->XmlNs(), aDocument, element);
+            }
+        else
+            {
+            pNew = CSenWsSecurityHeader2::NewL(*aData, aDocument, element);
+            }
+        }
+    else
+        {
+        if ( ipSecurityHeader )
+            {
+            pNew = CSenWsSecurityHeader2::NewL(KNullDesC8, ipSecurityHeader->XmlNs(), aDocument, element);
+            }
+        else
+            {
+            pNew = CSenWsSecurityHeader2::NewL(aDocument, element);
+            }
+        }
+
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+    
+EXPORT_C MSenMessage::TClass CSenSoapMessage2::Type()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::Type");
+    return MSenMessage::ESoapMessage2;
+    }
+    
+EXPORT_C MSenMessage* CSenSoapMessage2::CloneL()
+    {
+    TLSLOG_L(KSenMessagesLogChannel, KMinLogLevel, "CSenSoapMessage2::CloneL");
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewL(*this);
+    return pMessage;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/sensoapmessagedom2.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <badesca.h>
+#include <SenXmlReader.h>
+#include <s32mem.h>
+#include <utf.h>
+#include <xmlengbinarycontainer.h>
+
+#include "SenWsSecurityHeader2.h"
+#include "sensoapmessagedom2.h"
+
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL()
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC();
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC()
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL(TSOAPVersion aVersion)
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC(aVersion);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC(TSOAPVersion aVersion)
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aVersion);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL(TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs)
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC(aVersion, aSecurityNs);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC(TSOAPVersion aVersion,
+                                                   const TDesC8& aSecurityNs)
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aVersion, aSecurityNs);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL(MSenMessageContext& aContext)
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC(aContext);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC(MSenMessageContext& aContext)
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion)
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC(aContext, aVersion);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC(MSenMessageContext& aContext,
+                                                   TSOAPVersion aVersion)
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext, aVersion);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs)
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC(aContext,
+                                                      aVersion,
+                                                      aSecurityNs);
+    CleanupStack::Pop(pNew);
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC(MSenMessageContext& aContext,
+                                                  TSOAPVersion aVersion,
+                                                  const TDesC8& aSecurityNs)
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aContext, aVersion, aSecurityNs);
+    return pNew;
+    }
+    
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewL(CSenSoapMessageDom2& aMessage)
+    {
+    CSenSoapMessageDom2* pNew = CSenSoapMessageDom2::NewLC(aMessage);
+    CleanupStack::Pop(pNew); // pNew
+    return pNew;    
+    }
+
+EXPORT_C CSenSoapMessageDom2* CSenSoapMessageDom2::NewLC(CSenSoapMessageDom2& aMessage)
+    {
+    CSenSoapMessageDom2* pNew = new (ELeave) CSenSoapMessageDom2();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aMessage);
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessageDom2::~CSenSoapMessageDom2()
+    {
+    }
+
+EXPORT_C CSenSoapMessageDom2::CSenSoapMessageDom2()
+    {
+    }
+
+EXPORT_C MSenMessage::TClass CSenSoapMessageDom2::Type()
+    {
+    return MSenMessage::ESoapMessageDom2;
+    }
+
+EXPORT_C CSenFragmentBase* CSenSoapMessageDom2::CreateBodyFragmentL(
+                                                    const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aPrefix,
+                                                    const RAttributeArray& aAttributes,
+                                                    TXmlEngElement& aParent,
+                                                    RSenDocument& aOwnerDocument)
+    {
+	return CSenDomFragmentBase::NewL(aNsUri, aLocalName,
+		                             aPrefix, aAttributes,
+		                             aParent, aOwnerDocument
+		                            );
+    }
+
+EXPORT_C MSenMessage* CSenSoapMessageDom2::CloneL()
+    {
+    CSenSoapMessageDom2* pMessage = CSenSoapMessageDom2::NewL(*this);
+    return pMessage;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsmessages/src/senwssecurityheader2.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,386 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenIdentityProvider.h>
+#include <xmlengbinarycontainer.h>
+
+#include "SenWsSecurityHeader2.h"
+#include "sendebug.h"
+
+namespace
+    {
+    _LIT8(KUsernameTokenStartTagFmt,    "<%S:UsernameToken>");
+    _LIT8(KUsernameFmt,                 "<%S:Username>%S</%S:Username>");
+    _LIT8(KPasswordStartTagDefaultFmt,  "<%S:Password>%S");
+    _LIT8(KPasswordStartTagTypeFmt,     "<%S:Password Type=\"%S:%S\">%S");
+    _LIT8(KPasswordEndTagFmt,           "</%S:Password>");
+    _LIT8(KUsernameTokenEndTag,         "</%S:UsernameToken>");
+    _LIT8(KTimestampExpiresFormatString8,
+        "<%S:Timestamp xmlns:%S=\"%S\"><%S:Created>%S</%S:Created><%S:Expires>%S</%S:Expires></%S:Timestamp>");
+    _LIT8(KTimestampFormatString8,
+        "<%S:Timestamp xmlns:%S=\"%S\"><%S:Created>%S</%S:Created></%S:Timestamp>");
+    /*
+    TInt TokenL(const TDesC8& aSecurityNsPrefix, const TDesC8& aUsername, HBufC8*& aToken)
+        {
+        aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                                KUsernameFmt().Length() +
+                                KUsernameTokenEndTag().Length() +
+                                aUsername.Length() +
+                                aSecurityNsPrefix.Length() * 4 );
+
+        TPtr8 ptr = aToken->Des();
+        ptr.Format(KUsernameTokenStartTagFmt, &aSecurityNsPrefix);
+        ptr.AppendFormat(KUsernameFmt, &aSecurityNsPrefix, &aUsername, &aSecurityNsPrefix);
+        ptr.AppendFormat(KUsernameTokenEndTag, &aSecurityNsPrefix);
+        CleanupStack::Pop();    // aToken
+        return KErrNone;
+        }
+    */
+
+    }
+
+EXPORT_C CSenWsSecurityHeader2* CSenWsSecurityHeader2::NewL(
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    CSenWsSecurityHeader2* pNew = CSenWsSecurityHeader2::NewLC(aDocument,
+                                                               aElement);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader2* CSenWsSecurityHeader2::NewLC(
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    CSenWsSecurityHeader2* pNew = new (ELeave) CSenWsSecurityHeader2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aDocument, aElement);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader2* CSenWsSecurityHeader2::NewL(
+                                                    const TDesC8& aData,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    CSenWsSecurityHeader2* pNew = CSenWsSecurityHeader2::NewLC(aData,
+                                                               aDocument,
+                                                               aElement);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader2* CSenWsSecurityHeader2::NewLC(
+                                                    const TDesC8& aData,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    CSenWsSecurityHeader2* pNew = new (ELeave) CSenWsSecurityHeader2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aData, aDocument, aElement);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader2* CSenWsSecurityHeader2::NewL(
+                                                    const TDesC8& aData,
+                                                    const TDesC8& aSecurityNs,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    CSenWsSecurityHeader2* pNew = CSenWsSecurityHeader2::NewLC(aData,
+                                                               aSecurityNs,
+                                                               aDocument,
+                                                               aElement);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+    
+EXPORT_C CSenWsSecurityHeader2* CSenWsSecurityHeader2::NewLC(
+                                                    const TDesC8& aData,
+                                                    const TDesC8& aSecurityNs,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    CSenWsSecurityHeader2* pNew = new (ELeave) CSenWsSecurityHeader2;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aData, aSecurityNs, aDocument, aElement);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader2::CSenWsSecurityHeader2()
+    {
+    }
+
+EXPORT_C void CSenWsSecurityHeader2::BaseConstructL(RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    RAttributeArray attrArray;
+    CSenFragmentBase::BaseConstructL(XmlNs(), KSecurityName, XmlNsPrefix(),
+                                     attrArray, aElement, aDocument);
+    }
+
+EXPORT_C void CSenWsSecurityHeader2::BaseConstructL(const TDesC8& aData,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    BaseConstructL(aDocument, aElement);
+    if ( aData.Length() )
+        {
+        TXmlEngElement element = AsElementL();
+        TPtrC8 content = element.Text();
+        if ( content.Length() > 0 )
+            {
+            HBufC8* pContent = HBufC8::NewLC( content.Length() + aData.Length() );
+            TXmlEngElement element = AsElementL();
+            TPtr8 ptrContent = pContent->Des();
+            ptrContent.Append(content);
+            ptrContent.Append(aData);
+            element.SetTextNoEncL(*pContent);
+            CleanupStack::PopAndDestroy(pContent);    
+            }
+        else
+            {
+            element.SetTextNoEncL(aData);
+            }        
+        }
+    }
+    
+EXPORT_C void CSenWsSecurityHeader2::BaseConstructL(const TDesC8& aData,
+                                                    const TDesC8& aSecurityNs,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement)
+    {
+    RAttributeArray attrArray;
+    CSenFragmentBase::BaseConstructL(aSecurityNs, KSecurityName, XmlNsPrefix(),
+                                     attrArray, aElement, aDocument);
+    if ( aData.Length() )
+        {
+        TXmlEngElement element = AsElementL();
+        TPtrC8 content = element.Text();
+        if ( content.Length() > 0 )
+            {
+            HBufC8* pContent = HBufC8::NewLC( content.Length() + aData.Length() );
+            TXmlEngElement element = AsElementL();
+            TPtr8 ptrContent = pContent->Des();
+            ptrContent.Append(content);
+            ptrContent.Append(aData);
+            element.SetTextNoEncL(*pContent);
+            CleanupStack::PopAndDestroy(pContent);    
+            }
+        else
+            {
+            element.SetTextNoEncL(aData);
+            }        
+        }
+    }
+
+EXPORT_C CSenWsSecurityHeader2::~CSenWsSecurityHeader2()
+    {
+    }
+
+EXPORT_C HBufC8* CSenWsSecurityHeader2::UsernameTokenL(CSenIdentityProvider &aIdentityProvider)
+    {
+    TPtrC8 username = aIdentityProvider.AuthzID();
+    HBufC8* pToken = NULL;
+    User::LeaveIfError(UsernameTokenL(username, pToken));
+    return pToken;
+    }
+
+
+EXPORT_C TPtrC8 CSenWsSecurityHeader2::XmlNs()
+    {
+    if ( iElement.NotNull() )
+        {
+        if ( iElement.NamespaceUri() != KNullDesC8 )
+            {
+            return iElement.NamespaceUri();
+            }
+        }
+
+    return KSecurityXmlNs();
+    }
+
+EXPORT_C TPtrC8 CSenWsSecurityHeader2::XmlNsPrefix()
+    {
+    if ( iElement.NotNull() )
+        {
+        if ( iElement.Prefix() != KNullDesC8 )
+            {
+            return iElement.Prefix();
+            }
+        }
+        
+    return KSecurityXmlNsPrefix();
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader2::UsernameTokenL(const TDesC8& aUsername, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+    aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                            KUsernameFmt().Length() +
+                            KUsernameTokenEndTag().Length() +
+                            aUsername.Length() +
+                            nsPrefix.Length() * 4 );
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameFmt, &nsPrefix, &aUsername, &nsPrefix);
+    ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+    CleanupStack::Pop();    // aToken
+    return KErrNone;
+    }
+
+
+EXPORT_C HBufC8* CSenWsSecurityHeader2::UsernameTokenL(CSenIdentityProvider &aIdentityProvider,
+                                                      CSenWsSecurityHeader2::TPasswordType aType)
+    {
+    TPtrC8 username = aIdentityProvider.AuthzID();
+    TPtrC8 password = aIdentityProvider.Password();
+    HBufC8* pToken = NULL;
+    User::LeaveIfError(UsernameTokenL(username, password, aType, pToken));
+    return pToken;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader2::UsernameTokenL(const TDesC8& aUsername,
+                                    const TDesC8& aPassword,
+                                    HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+    aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                            KUsernameFmt().Length() +
+                            KUsernameTokenEndTag().Length() +
+                            KPasswordStartTagDefaultFmt().Length() +
+                            KPasswordEndTagFmt().Length() +
+                            aPassword.Length() +
+                            aUsername.Length() +
+                            nsPrefix.Length() * 6 );
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameFmt, &nsPrefix, &aUsername, &nsPrefix);
+    ptr.AppendFormat(KPasswordStartTagDefaultFmt,
+                     &nsPrefix, &aPassword); // no Type -attribute used
+    ptr.AppendFormat(KPasswordEndTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+    CleanupStack::Pop();    // aToken
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader2::UsernameTokenL(const TDesC8& aUsername,
+                                    const TDesC8& aPassword,
+                                    CSenWsSecurityHeader2::TPasswordType aType,
+                                    HBufC8*& aToken)
+    {
+    switch(aType)
+        {
+        case EText:
+            {
+            return UsernameTokenL(aUsername, aPassword, aToken);
+            }
+        case EDigest:
+            {
+            TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+            TPtrC8 typeAttr(KSecurityAttrTypeDigest);
+
+            aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                                    KUsernameFmt().Length() +
+                                    KUsernameTokenEndTag().Length() +
+                                    KPasswordStartTagTypeFmt().Length() +
+                                    KPasswordEndTagFmt().Length() +
+                                    aUsername.Length() +
+                                    aPassword.Length() +
+                                    typeAttr.Length() +
+                                    nsPrefix.Length() * 7 );
+            TPtr8 ptr = aToken->Des();
+            ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+            ptr.AppendFormat(KUsernameFmt, &nsPrefix, &aUsername, &nsPrefix);
+            ptr.AppendFormat(KPasswordStartTagTypeFmt, &nsPrefix, &nsPrefix,
+                             &typeAttr, &aPassword); // Type = wsse:PasswordDigest
+            ptr.AppendFormat(KPasswordEndTagFmt, &nsPrefix);
+            ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+            CleanupStack::Pop();    // aToken
+            return KErrNone;
+            }
+        default:
+            {
+            return KErrNotSupported;
+            }
+        }
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader2::TimestampL(const TDesC8& aCreated, const TDesC8& aExpires, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityUtilityXmlNsPrefix();
+    aToken = HBufC8::NewLC(KTimestampExpiresFormatString8().Length()
+                            + aCreated.Length()
+                            + aExpires.Length()
+                            + nsPrefix.Length()*7
+                            + KSecurityUtilityXmlNs().Length());
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KTimestampExpiresFormatString8,
+               &nsPrefix,
+               &nsPrefix,
+               &KSecurityUtilityXmlNs(),
+               &nsPrefix,
+               &aCreated,
+               &nsPrefix,
+               &nsPrefix,
+               &aExpires,
+               &nsPrefix,
+               &nsPrefix);
+    CleanupStack::Pop(aToken);
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader2::TimestampL(const TDesC8& aCreated, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityUtilityXmlNsPrefix();
+    aToken = HBufC8::NewLC(KTimestampFormatString8().Length()
+                            + aCreated.Length()
+                            + nsPrefix.Length()*5
+                            + KSecurityUtilityXmlNs().Length());
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KTimestampFormatString8,
+               &nsPrefix,
+               &nsPrefix,
+               &KSecurityUtilityXmlNs(),
+               &nsPrefix,
+               &aCreated,
+               &nsPrefix,
+               &nsPrefix);
+    CleanupStack::Pop(aToken);
+    return KErrNone;
+    }
+
+//EXPORT_C TInt CSenWsSecurityHeader2::SecurityTokenReferenceL(const TDesC8& aURI, HBufC8*& aToken)
+//    {
+//    //to do
+//    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BMARM/SENNOTIFIERPLUGINU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	NotifierArray__Fv @ 1 NONAME R3UNUSED ; NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BMARM/SENNOTPLUGINDLGCLIENT_2.6U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+EXPORTS
+	__27TAllowUnRegisterDlgResponse @ 1 NONAME R3UNUSED ; TAllowUnRegisterDlgResponse::TAllowUnRegisterDlgResponse(void)
+	OkButtonPressed__C19TAskSaveDlgResponse @ 2 NONAME R3UNUSED ; TAskSaveDlgResponse::OkButtonPressed(void) const
+	OkButtonPressed__C25TAllowRegisterDlgResponse @ 3 NONAME R3UNUSED ; TAllowRegisterDlgResponse::OkButtonPressed(void) const
+	OkButtonPressed__C26TAuthenticationDlgResponse @ 4 NONAME R3UNUSED ; TAuthenticationDlgResponse::OkButtonPressed(void) const
+	OkButtonPressed__C27TAllowUnRegisterDlgResponse @ 5 NONAME R3UNUSED ; TAllowUnRegisterDlgResponse::OkButtonPressed(void) const
+	Password__C25TAuthenticationDlgRequest @ 6 NONAME R3UNUSED ; TAuthenticationDlgRequest::Password(void) const
+	Password__C26TAuthenticationDlgResponse @ 7 NONAME R3UNUSED ; TAuthenticationDlgResponse::Password(void) const
+	SetData__25TAuthenticationDlgRequestRC7TDesC16T1 @ 8 NONAME R3UNUSED ; TAuthenticationDlgRequest::SetData(TDesC16 const &, TDesC16 const &)
+	SetData__26TAuthenticationDlgResponseRC7TDesC16T1i @ 9 NONAME ; TAuthenticationDlgResponse::SetData(TDesC16 const &, TDesC16 const &, int)
+	SetOkButton__19TAskSaveDlgResponsei @ 10 NONAME R3UNUSED ; TAskSaveDlgResponse::SetOkButton(int)
+	SetOkButton__25TAllowRegisterDlgResponsei @ 11 NONAME R3UNUSED ; TAllowRegisterDlgResponse::SetOkButton(int)
+	SetOkButton__27TAllowUnRegisterDlgResponsei @ 12 NONAME R3UNUSED ; TAllowUnRegisterDlgResponse::SetOkButton(int)
+	Username__C25TAuthenticationDlgRequest @ 13 NONAME R3UNUSED ; TAuthenticationDlgRequest::Username(void) const
+	Username__C26TAuthenticationDlgResponse @ 14 NONAME R3UNUSED ; TAuthenticationDlgResponse::Username(void) const
+	__18TAskSaveDlgRequest @ 15 NONAME R3UNUSED ; TAskSaveDlgRequest::TAskSaveDlgRequest(void)
+	__19TAskSaveDlgResponse @ 16 NONAME R3UNUSED ; TAskSaveDlgResponse::TAskSaveDlgResponse(void)
+	__20TSenNotPluginRequest @ 17 NONAME R3UNUSED ; TSenNotPluginRequest::TSenNotPluginRequest(void)
+	__20TSenNotPluginRequesti @ 18 NONAME R3UNUSED ; TSenNotPluginRequest::TSenNotPluginRequest(int)
+	__24TAllowRegisterDlgRequest @ 19 NONAME R3UNUSED ; TAllowRegisterDlgRequest::TAllowRegisterDlgRequest(void)
+	__25TAllowRegisterDlgResponse @ 20 NONAME R3UNUSED ; TAllowRegisterDlgResponse::TAllowRegisterDlgResponse(void)
+	__25TAuthenticationDlgRequest @ 21 NONAME R3UNUSED ; TAuthenticationDlgRequest::TAuthenticationDlgRequest(void)
+	__26TAllowUnRegisterDlgRequest @ 22 NONAME R3UNUSED ; TAllowUnRegisterDlgRequest::TAllowUnRegisterDlgRequest(void)
+	__26TAuthenticationDlgResponse @ 23 NONAME R3UNUSED ; TAuthenticationDlgResponse::TAuthenticationDlgResponse(void)
+	Method__20TSenNotPluginRequest @ 24 NONAME R3UNUSED ; TSenNotPluginRequest::Method(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINS/SENNOTDLGU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+EXPORTS
+	??0TAllowRegisterDlgRequest@@QAE@XZ @ 1 NONAME ; public: __thiscall TAllowRegisterDlgRequest::TAllowRegisterDlgRequest(void)
+	??0TAllowRegisterDlgResponse@@QAE@XZ @ 2 NONAME ; public: __thiscall TAllowRegisterDlgResponse::TAllowRegisterDlgResponse(void)
+	??0TAllowUnRegisterDlgRequest@@QAE@XZ @ 3 NONAME ; public: __thiscall TAllowUnRegisterDlgRequest::TAllowUnRegisterDlgRequest(void)
+	??0TAllowUnRegisterDlgResponse@@QAE@XZ @ 4 NONAME ; public: __thiscall TAllowUnRegisterDlgResponse::TAllowUnRegisterDlgResponse(void)
+	??0TAskSaveDlgRequest@@QAE@XZ @ 5 NONAME ; public: __thiscall TAskSaveDlgRequest::TAskSaveDlgRequest(void)
+	??0TAskSaveDlgResponse@@QAE@XZ @ 6 NONAME ; public: __thiscall TAskSaveDlgResponse::TAskSaveDlgResponse(void)
+	??0TAuthenticationDlgRequest@@QAE@XZ @ 7 NONAME ; public: __thiscall TAuthenticationDlgRequest::TAuthenticationDlgRequest(void)
+	??0TAuthenticationDlgResponse@@QAE@XZ @ 8 NONAME ; public: __thiscall TAuthenticationDlgResponse::TAuthenticationDlgResponse(void)
+	??0TSenNotPluginRequest@@QAE@H@Z @ 9 NONAME ; public: __thiscall TSenNotPluginRequest::TSenNotPluginRequest(int)
+	??0TSenNotPluginRequest@@QAE@XZ @ 10 NONAME ; public: __thiscall TSenNotPluginRequest::TSenNotPluginRequest(void)
+	?Method@TSenNotPluginRequest@@QAEHXZ @ 11 NONAME ; public: int __thiscall TSenNotPluginRequest::Method(void)
+	?OkButtonPressed@TAllowRegisterDlgResponse@@QBEHXZ @ 12 NONAME ; public: int __thiscall TAllowRegisterDlgResponse::OkButtonPressed(void)const 
+	?OkButtonPressed@TAllowUnRegisterDlgResponse@@QBEHXZ @ 13 NONAME ; public: int __thiscall TAllowUnRegisterDlgResponse::OkButtonPressed(void)const 
+	?OkButtonPressed@TAskSaveDlgResponse@@QBEHXZ @ 14 NONAME ; public: int __thiscall TAskSaveDlgResponse::OkButtonPressed(void)const 
+	?OkButtonPressed@TAuthenticationDlgResponse@@QBEHXZ @ 15 NONAME ; public: int __thiscall TAuthenticationDlgResponse::OkButtonPressed(void)const 
+	?Password@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 16 NONAME ; public: class TPtrC16  __thiscall TAuthenticationDlgRequest::Password(void)const 
+	?Password@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 17 NONAME ; public: class TPtrC16  __thiscall TAuthenticationDlgResponse::Password(void)const 
+	?SetData@TAuthenticationDlgRequest@@QAEHABVTDesC16@@0@Z @ 18 NONAME ; public: int __thiscall TAuthenticationDlgRequest::SetData(class TDesC16 const &,class TDesC16 const &)
+	?SetData@TAuthenticationDlgResponse@@QAEHABVTDesC16@@0H@Z @ 19 NONAME ; public: int __thiscall TAuthenticationDlgResponse::SetData(class TDesC16 const &,class TDesC16 const &,int)
+	?SetOkButton@TAllowRegisterDlgResponse@@QAEXH@Z @ 20 NONAME ; public: void __thiscall TAllowRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAllowUnRegisterDlgResponse@@QAEXH@Z @ 21 NONAME ; public: void __thiscall TAllowUnRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAskSaveDlgResponse@@QAEXH@Z @ 22 NONAME ; public: void __thiscall TAskSaveDlgResponse::SetOkButton(int)
+	?Username@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 23 NONAME ; public: class TPtrC16  __thiscall TAuthenticationDlgRequest::Username(void)const 
+	?Username@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 24 NONAME ; public: class TPtrC16  __thiscall TAuthenticationDlgResponse::Username(void)const 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINS/SENNOTIFIERPLUGINU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase> * __cdecl NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINS/SENNOTIFIERPLUGIN_2.6U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase> * __cdecl NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINS/SENNOTPLUGINDLGCLIENT_2.6U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+EXPORTS
+	??0TAllowRegisterDlgRequest@@QAE@XZ @ 1 NONAME ; public: __thiscall TAllowRegisterDlgRequest::TAllowRegisterDlgRequest(void)
+	??0TAllowRegisterDlgResponse@@QAE@XZ @ 2 NONAME ; public: __thiscall TAllowRegisterDlgResponse::TAllowRegisterDlgResponse(void)
+	??0TAllowUnRegisterDlgRequest@@QAE@XZ @ 3 NONAME ; public: __thiscall TAllowUnRegisterDlgRequest::TAllowUnRegisterDlgRequest(void)
+	??0TAllowUnRegisterDlgResponse@@QAE@XZ @ 4 NONAME ; public: __thiscall TAllowUnRegisterDlgResponse::TAllowUnRegisterDlgResponse(void)
+	??0TAskSaveDlgRequest@@QAE@XZ @ 5 NONAME ; public: __thiscall TAskSaveDlgRequest::TAskSaveDlgRequest(void)
+	??0TAskSaveDlgResponse@@QAE@XZ @ 6 NONAME ; public: __thiscall TAskSaveDlgResponse::TAskSaveDlgResponse(void)
+	??0TAuthenticationDlgRequest@@QAE@XZ @ 7 NONAME ; public: __thiscall TAuthenticationDlgRequest::TAuthenticationDlgRequest(void)
+	??0TAuthenticationDlgResponse@@QAE@XZ @ 8 NONAME ; public: __thiscall TAuthenticationDlgResponse::TAuthenticationDlgResponse(void)
+	??0TSenNotPluginRequest@@QAE@H@Z @ 9 NONAME ; public: __thiscall TSenNotPluginRequest::TSenNotPluginRequest(int)
+	??0TSenNotPluginRequest@@QAE@XZ @ 10 NONAME ; public: __thiscall TSenNotPluginRequest::TSenNotPluginRequest(void)
+	?Method@TSenNotPluginRequest@@QAEHXZ @ 11 NONAME ; public: int __thiscall TSenNotPluginRequest::Method(void)
+	?OkButtonPressed@TAllowRegisterDlgResponse@@QBEHXZ @ 12 NONAME ; public: int __thiscall TAllowRegisterDlgResponse::OkButtonPressed(void)const 
+	?OkButtonPressed@TAllowUnRegisterDlgResponse@@QBEHXZ @ 13 NONAME ; public: int __thiscall TAllowUnRegisterDlgResponse::OkButtonPressed(void)const 
+	?OkButtonPressed@TAskSaveDlgResponse@@QBEHXZ @ 14 NONAME ; public: int __thiscall TAskSaveDlgResponse::OkButtonPressed(void)const 
+	?OkButtonPressed@TAuthenticationDlgResponse@@QBEHXZ @ 15 NONAME ; public: int __thiscall TAuthenticationDlgResponse::OkButtonPressed(void)const 
+	?Password@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 16 NONAME ; public: class TPtrC16 __thiscall TAuthenticationDlgRequest::Password(void)const 
+	?Password@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 17 NONAME ; public: class TPtrC16 __thiscall TAuthenticationDlgResponse::Password(void)const 
+	?SetData@TAuthenticationDlgRequest@@QAEHABVTDesC16@@0@Z @ 18 NONAME ; public: int __thiscall TAuthenticationDlgRequest::SetData(class TDesC16 const &,class TDesC16 const &)
+	?SetData@TAuthenticationDlgResponse@@QAEHABVTDesC16@@0H@Z @ 19 NONAME ; public: int __thiscall TAuthenticationDlgResponse::SetData(class TDesC16 const &,class TDesC16 const &,int)
+	?SetOkButton@TAllowRegisterDlgResponse@@QAEXH@Z @ 20 NONAME ; public: void __thiscall TAllowRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAllowUnRegisterDlgResponse@@QAEXH@Z @ 21 NONAME ; public: void __thiscall TAllowUnRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAskSaveDlgResponse@@QAEXH@Z @ 22 NONAME ; public: void __thiscall TAskSaveDlgResponse::SetOkButton(int)
+	?Username@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 23 NONAME ; public: class TPtrC16 __thiscall TAuthenticationDlgRequest::Username(void)const 
+	?Username@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 24 NONAME ; public: class TPtrC16 __thiscall TAuthenticationDlgResponse::Username(void)const 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINSCW/SENNOTDLGIMPLU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase2> * NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINSCW/SENNOTIFIERPLUGINU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 2 NONAME ; class CArrayPtr<class MEikSrvNotifierBase2> * NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINSCW/SENNOTIFIERPLUGIN_2.6U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase@@@@XZ @ 1 NONAME ; class CArrayPtr<class MEikSrvNotifierBase> * NotifierArray(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINSCW/SENNOTPLUGINDLGCLIENTU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+EXPORTS
+	??0TAllowRegisterDlgRequest@@QAE@XZ @ 1 NONAME ; TAllowRegisterDlgRequest::TAllowRegisterDlgRequest(void)
+	??0TAllowRegisterDlgResponse@@QAE@XZ @ 2 NONAME ; TAllowRegisterDlgResponse::TAllowRegisterDlgResponse(void)
+	??0TAllowUnRegisterDlgRequest@@QAE@XZ @ 3 NONAME ; TAllowUnRegisterDlgRequest::TAllowUnRegisterDlgRequest(void)
+	??0TAllowUnRegisterDlgResponse@@QAE@XZ @ 4 NONAME ; TAllowUnRegisterDlgResponse::TAllowUnRegisterDlgResponse(void)
+	??0TAskSaveDlgRequest@@QAE@XZ @ 5 NONAME ; TAskSaveDlgRequest::TAskSaveDlgRequest(void)
+	??0TAskSaveDlgResponse@@QAE@XZ @ 6 NONAME ; TAskSaveDlgResponse::TAskSaveDlgResponse(void)
+	??0TAuthenticationDlgRequest@@QAE@XZ @ 7 NONAME ; TAuthenticationDlgRequest::TAuthenticationDlgRequest(void)
+	??0TAuthenticationDlgResponse@@QAE@XZ @ 8 NONAME ; TAuthenticationDlgResponse::TAuthenticationDlgResponse(void)
+	??0TSenNotPluginRequest@@QAE@H@Z @ 9 NONAME ; TSenNotPluginRequest::TSenNotPluginRequest(int)
+	??0TSenNotPluginRequest@@QAE@XZ @ 10 NONAME ; TSenNotPluginRequest::TSenNotPluginRequest(void)
+	?Method@TSenNotPluginRequest@@QAEHXZ @ 11 NONAME ; int TSenNotPluginRequest::Method(void)
+	?OkButtonPressed@TAllowRegisterDlgResponse@@QBEHXZ @ 12 NONAME ; int TAllowRegisterDlgResponse::OkButtonPressed(void) const
+	?OkButtonPressed@TAllowUnRegisterDlgResponse@@QBEHXZ @ 13 NONAME ; int TAllowUnRegisterDlgResponse::OkButtonPressed(void) const
+	?OkButtonPressed@TAskSaveDlgResponse@@QBEHXZ @ 14 NONAME ; int TAskSaveDlgResponse::OkButtonPressed(void) const
+	?OkButtonPressed@TAuthenticationDlgResponse@@QBEHXZ @ 15 NONAME ; int TAuthenticationDlgResponse::OkButtonPressed(void) const
+	?Password@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 16 NONAME ; class TPtrC16 TAuthenticationDlgRequest::Password(void) const
+	?Password@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 17 NONAME ; class TPtrC16 TAuthenticationDlgResponse::Password(void) const
+	?SetData@TAuthenticationDlgRequest@@QAEHABVTDesC16@@0@Z @ 18 NONAME ; int TAuthenticationDlgRequest::SetData(class TDesC16 const &, class TDesC16 const &)
+	?SetData@TAuthenticationDlgResponse@@QAEHABVTDesC16@@0H@Z @ 19 NONAME ; int TAuthenticationDlgResponse::SetData(class TDesC16 const &, class TDesC16 const &, int)
+	?SetOkButton@TAllowRegisterDlgResponse@@QAEXH@Z @ 20 NONAME ; void TAllowRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAllowUnRegisterDlgResponse@@QAEXH@Z @ 21 NONAME ; void TAllowUnRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAskSaveDlgResponse@@QAEXH@Z @ 22 NONAME ; void TAskSaveDlgResponse::SetOkButton(int)
+	?Username@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 23 NONAME ; class TPtrC16 TAuthenticationDlgRequest::Username(void) const
+	?Username@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 24 NONAME ; class TPtrC16 TAuthenticationDlgResponse::Username(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/BWINSCW/SENNOTPLUGINDLGCLIENT_2.6U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,26 @@
+EXPORTS
+	??0TAllowRegisterDlgRequest@@QAE@XZ @ 1 NONAME ; TAllowRegisterDlgRequest::TAllowRegisterDlgRequest(void)
+	??0TAllowRegisterDlgResponse@@QAE@XZ @ 2 NONAME ; TAllowRegisterDlgResponse::TAllowRegisterDlgResponse(void)
+	??0TAllowUnRegisterDlgRequest@@QAE@XZ @ 3 NONAME ; TAllowUnRegisterDlgRequest::TAllowUnRegisterDlgRequest(void)
+	??0TAllowUnRegisterDlgResponse@@QAE@XZ @ 4 NONAME ; TAllowUnRegisterDlgResponse::TAllowUnRegisterDlgResponse(void)
+	??0TAskSaveDlgRequest@@QAE@XZ @ 5 NONAME ; TAskSaveDlgRequest::TAskSaveDlgRequest(void)
+	??0TAskSaveDlgResponse@@QAE@XZ @ 6 NONAME ; TAskSaveDlgResponse::TAskSaveDlgResponse(void)
+	??0TAuthenticationDlgRequest@@QAE@XZ @ 7 NONAME ; TAuthenticationDlgRequest::TAuthenticationDlgRequest(void)
+	??0TAuthenticationDlgResponse@@QAE@XZ @ 8 NONAME ; TAuthenticationDlgResponse::TAuthenticationDlgResponse(void)
+	??0TSenNotPluginRequest@@QAE@H@Z @ 9 NONAME ; TSenNotPluginRequest::TSenNotPluginRequest(int)
+	??0TSenNotPluginRequest@@QAE@XZ @ 10 NONAME ; TSenNotPluginRequest::TSenNotPluginRequest(void)
+	?Method@TSenNotPluginRequest@@QAEHXZ @ 11 NONAME ; int TSenNotPluginRequest::Method(void)
+	?OkButtonPressed@TAllowRegisterDlgResponse@@QBEHXZ @ 12 NONAME ; int TAllowRegisterDlgResponse::OkButtonPressed(void) const
+	?OkButtonPressed@TAllowUnRegisterDlgResponse@@QBEHXZ @ 13 NONAME ; int TAllowUnRegisterDlgResponse::OkButtonPressed(void) const
+	?OkButtonPressed@TAskSaveDlgResponse@@QBEHXZ @ 14 NONAME ; int TAskSaveDlgResponse::OkButtonPressed(void) const
+	?OkButtonPressed@TAuthenticationDlgResponse@@QBEHXZ @ 15 NONAME ; int TAuthenticationDlgResponse::OkButtonPressed(void) const
+	?Password@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 16 NONAME ; class TPtrC16 TAuthenticationDlgRequest::Password(void) const
+	?Password@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 17 NONAME ; class TPtrC16 TAuthenticationDlgResponse::Password(void) const
+	?SetData@TAuthenticationDlgRequest@@QAEHABVTDesC16@@0@Z @ 18 NONAME ; int TAuthenticationDlgRequest::SetData(class TDesC16 const &, class TDesC16 const &)
+	?SetData@TAuthenticationDlgResponse@@QAEHABVTDesC16@@0H@Z @ 19 NONAME ; int TAuthenticationDlgResponse::SetData(class TDesC16 const &, class TDesC16 const &, int)
+	?SetOkButton@TAllowRegisterDlgResponse@@QAEXH@Z @ 20 NONAME ; void TAllowRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAllowUnRegisterDlgResponse@@QAEXH@Z @ 21 NONAME ; void TAllowUnRegisterDlgResponse::SetOkButton(int)
+	?SetOkButton@TAskSaveDlgResponse@@QAEXH@Z @ 22 NONAME ; void TAskSaveDlgResponse::SetOkButton(int)
+	?Username@TAuthenticationDlgRequest@@QBE?AVTPtrC16@@XZ @ 23 NONAME ; class TPtrC16 TAuthenticationDlgRequest::Username(void) const
+	?Username@TAuthenticationDlgResponse@@QBE?AVTPtrC16@@XZ @ 24 NONAME ; class TPtrC16 TAuthenticationDlgResponse::Username(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/data/1005f8d1.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 1005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include "RegistryInfo.rh"
+#include "Uikon.hrh"
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+{
+	dll_uid = 0x1005F8D1;
+	interfaces =
+	{
+	INTERFACE_INFO
+		{
+		interface_uid = KUikonUidPluginInterfaceNotifiers;
+		implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x1005F8D2;
+					version_no = 1;
+					display_name = "Sen Notifier Plugin";
+					default_data = "SenNotifierPlugin";
+					opaque_data = "0";
+					}
+				};
+		}
+	};
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/data/101f9743.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 9764 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include "RegistryInfo.rh"
+#include "Uikon.hrh"
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+{
+    dll_uid = 0x101F9743;
+    interfaces =
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = KUikonUidPluginInterfaceNotifiers;
+        implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9744;
+                    version_no = 1;
+                    display_name = "Sen Notifier Plugin";
+                    default_data = "SenNotifierPlugin";
+                    opaque_data = "0";
+                    }
+                };
+        }
+    };
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/data/101f9764.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 9764 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include "registryinfo.rh"
+#include "uikon.hrh"
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+{
+    dll_uid = 0x101F9764;
+    interfaces =
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = KUikonUidPluginInterfaceNotifiers;
+        implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9765;
+                    version_no = 1;
+                    display_name = "Sen Notifier Plugin";
+                    default_data = "SenNotifierPlugin";
+                    opaque_data = "0";
+                    }
+                };
+        }
+    };
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/data/sennotifierplugin_reg.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Registration resource file for RAM based notifier
+*
+*/
+
+
+
+
+
+
+
+
+#include <uikon.rh>
+
+RESOURCE NOTIFIER_LIST
+	{
+	dll_uid = 0x101F9764; // equal to MMP's DLL UID definition
+	notifier_list=
+		{
+		NOTIFIER_DATA
+			{
+			notifier_uid = 0x101F9764; // Same as returned in RegisterL and used by RNotifier client.
+		 	}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/data/sennotifierplugindlgimpl.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// RESOURCE IDENTIFIER
+NAME TMPL 
+
+// INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.rsg>
+
+#include "sennotplugindlgimpl.hrh"
+#include <sennotplugindlgimpl.loc>
+//#if (defined LANGUAGE_SC) // default (U.K. English)
+  //  #include "SenNotPluginDlgImpl.loc"
+//#endif
+
+// RESOURCE DEFINITIONS
+// ---------------------------------------------------------
+//   
+//    Define the resource file signature 
+//    This resource should be empty.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE 
+    { 
+    }
+
+// ---------------------------------------------------------
+//   
+//    Default Document Name
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF 
+    { 
+    buf=""; 
+    }
+
+//----------------------------------------------------
+//    r_common_yes_no_query
+//
+// This is used to show user simple yes/no query.
+// This resource is used by CAknQueryDialog.
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_common_yes_no_query
+{
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL; // EAknSoftkeyOk & EAknSoftkeyCancel
+    items = 
+    {
+        DLG_LINE
+        {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+            {
+                layout = EConfirmationQueryLayout;
+            };
+        }
+    };
+}
+
+//----------------------------------------------------
+//    r_custom_usernamepasswd_dialog
+//
+// This is used to show user custom authentication 
+// dialog. 
+//
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_custom_usernamepasswd_dialog
+{
+        flags = EGeneralQueryFlags;
+    buttons=R_AVKON_SOFTKEYS_OK_CANCEL;
+    items = {
+        DLG_LINE {
+            type = EAknCtMultilineQuery;
+            id = EMultilineFirstLine;
+            control = AVERELL_DATA_QUERY {
+                layout = EMultiDataFirstEdwin;
+                label = qtn_sen_notdlg_auth_username;
+                control = EDWIN {
+                    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+                    width = 25;
+                    maxlength = 32;//KSenMaxUsernameLength
+                };
+            };
+        },
+        DLG_LINE {
+            type = EAknCtMultilineQuery;
+            id = EMultilineSecondLine;
+            control = AVERELL_DATA_QUERY {
+                layout = EMultiDataSecondSecEd;
+                label = qtn_sen_notdlg_auth_password;
+                control = SECRETED {
+                    num_letters = 16;//KSenMaxPasswordLength
+                };
+            };
+        }
+    };
+}
+
+//----------------------------------------------------
+//    STRING RESOURCES
+//
+// This is used to show user custom authentication 
+// dialog. 
+//----------------------------------------------------
+//    
+RESOURCE TBUF r_sennotdlg_auth_title                { buf = qtn_sen_notdlg_auth_title; }
+RESOURCE TBUF r_sennotdlg_auth_username             { buf = qtn_sen_notdlg_auth_username; }
+RESOURCE TBUF r_sennotdlg_auth_password             { buf = qtn_sen_notdlg_auth_password; }
+RESOURCE TBUF r_sennotdlg_ask_save_query            { buf = qtn_sen_notdlg_ask_save; }
+RESOURCE TBUF r_sennotdlg_allow_register_query      { buf = qtn_sen_notdlg_allow_register; }
+RESOURCE TBUF r_sennotdlg_allow_unregister_query    { buf = qtn_sen_notdlg_allow_unregister; }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/data/wsnotifierplugin_reg.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Registration resource file for RAM based notifier
+*
+*/
+
+
+
+
+
+
+
+
+#include <uikon.rh>
+
+RESOURCE NOTIFIER_LIST
+	{
+	dll_uid = 0x101F9743; // equal to MMP's DLL UID definition
+	notifier_list=
+		{
+		NOTIFIER_DATA
+			{
+			notifier_uid = 0x101F9743; // Same as returned in RegisterL (iInfo.iUid = KSenNotifierPluginUID;) and used by RNotifier client (CSenBaseIdentityManager)
+		 	}
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/eabi/SENNOTIFIERPLUGINu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	_Z24ImplementationGroupProxyRi @ 1 NONAME
+	_Z13NotifierArrayv @ 2 NONAME
+	_ZTI20CSenNotPluginDlgImpl @ 3 NONAME ; #<TI>#
+	_ZTV20CSenNotPluginDlgImpl @ 4 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/eabi/SENNOTPLUGINDLGCLIENTu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+EXPORTS
+	_ZN18TAskSaveDlgRequestC1Ev @ 1 NONAME
+	_ZN18TAskSaveDlgRequestC2Ev @ 2 NONAME
+	_ZN19TAskSaveDlgResponse11SetOkButtonEi @ 3 NONAME
+	_ZN19TAskSaveDlgResponseC1Ev @ 4 NONAME
+	_ZN19TAskSaveDlgResponseC2Ev @ 5 NONAME
+	_ZN20TSenNotPluginRequest6MethodEv @ 6 NONAME
+	_ZN20TSenNotPluginRequestC1Ei @ 7 NONAME
+	_ZN20TSenNotPluginRequestC1Ev @ 8 NONAME
+	_ZN20TSenNotPluginRequestC2Ei @ 9 NONAME
+	_ZN20TSenNotPluginRequestC2Ev @ 10 NONAME
+	_ZN24TAllowRegisterDlgRequestC1Ev @ 11 NONAME
+	_ZN24TAllowRegisterDlgRequestC2Ev @ 12 NONAME
+	_ZN25TAllowRegisterDlgResponse11SetOkButtonEi @ 13 NONAME
+	_ZN25TAllowRegisterDlgResponseC1Ev @ 14 NONAME
+	_ZN25TAllowRegisterDlgResponseC2Ev @ 15 NONAME
+	_ZN25TAuthenticationDlgRequest7SetDataERK7TDesC16S2_ @ 16 NONAME
+	_ZN25TAuthenticationDlgRequestC1Ev @ 17 NONAME
+	_ZN25TAuthenticationDlgRequestC2Ev @ 18 NONAME
+	_ZN26TAllowUnRegisterDlgRequestC1Ev @ 19 NONAME
+	_ZN26TAllowUnRegisterDlgRequestC2Ev @ 20 NONAME
+	_ZN26TAuthenticationDlgResponse7SetDataERK7TDesC16S2_i @ 21 NONAME
+	_ZN26TAuthenticationDlgResponseC1Ev @ 22 NONAME
+	_ZN26TAuthenticationDlgResponseC2Ev @ 23 NONAME
+	_ZN27TAllowUnRegisterDlgResponse11SetOkButtonEi @ 24 NONAME
+	_ZN27TAllowUnRegisterDlgResponseC1Ev @ 25 NONAME
+	_ZN27TAllowUnRegisterDlgResponseC2Ev @ 26 NONAME
+	_ZNK19TAskSaveDlgResponse15OkButtonPressedEv @ 27 NONAME
+	_ZNK25TAllowRegisterDlgResponse15OkButtonPressedEv @ 28 NONAME
+	_ZNK25TAuthenticationDlgRequest8PasswordEv @ 29 NONAME
+	_ZNK25TAuthenticationDlgRequest8UsernameEv @ 30 NONAME
+	_ZNK26TAuthenticationDlgResponse15OkButtonPressedEv @ 31 NONAME
+	_ZNK26TAuthenticationDlgResponse8PasswordEv @ 32 NONAME
+	_ZNK26TAuthenticationDlgResponse8UsernameEv @ 33 NONAME
+	_ZNK27TAllowUnRegisterDlgResponse15OkButtonPressedEv @ 34 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Build information file for wsnotifierplugins   
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+ 
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsnotifierplugindlg.iby     				CORE_MW_LAYER_IBY_EXPORT_PATH(wsnotifierplugindlg.iby)
+../rom/wsnotifierplugins.iby       				CORE_MW_LAYER_IBY_EXPORT_PATH(wsnotifierplugins.iby)
+../rom/wsnotifierplugindlg_resources.iby	LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(wsnotifierplugindlg_resources.iby)
+
+../loc/sennotplugindlgimpl.loc        		MW_LAYER_LOC_EXPORT_PATH(sennotplugindlgimpl.loc)
+
+PRJ_MMPFILES
+sennotplugindlgclient.mmp
+sennotifierplugin.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/group/sennotifierplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Project specification file for sennotifierplugin   
+*
+*/
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+#ifdef EKA2
+    #include <data_caging_paths.hrh>
+#endif
+
+#ifdef _DEBUG
+    // Define application specific log macro flag for debug builds only:
+    //MACRO __CUSTOM_LOG_ENABLED__
+#endif    
+
+
+#ifdef EKA2
+
+TARGETTYPE PLUGIN
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    TARGET sennotifierplugin.dll
+    UID 0x10009D8D 0x101F9764
+#else
+    TARGET wsnotifierplugin.dll
+    UID 0x10009D8D 0x101F9743
+#endif
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#else 
+    // EKA1
+    TARGET sennotifierplugin.dll    
+    TARGETTYPE NOTIFIER
+    UID 0x10005522 0x101F9764
+#endif
+
+SOURCEPATH      .
+SOURCEPATH      ../src
+
+SOURCE sennotplugindlgmain.cpp
+SOURCE sennotplugindlgimpl.cpp
+SOURCE logger.cpp
+
+#ifdef SYMBIAN_SECURE_ECOM
+    // ECom resource file
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    START RESOURCE ../data/101f9764.rss
+    #ifdef SYMBIAN_SECURE_ECOM
+    TARGET  sennotifierplugin.rsc 
+    #endif
+#else
+    START RESOURCE ../data/101F9743.rss
+    #ifdef SYMBIAN_SECURE_ECOM
+    TARGET  wsnotifierplugin.rsc 
+    #endif
+#endif    
+        
+    END // ECom resource file 
+MW_LAYER_SYSTEMINCLUDE    
+    // Notifier resource file
+    START RESOURCE  ../data/sennotifierplugindlgimpl.rss
+        HEADER
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+        TARGET SenNotifierPluginDlgImpl.rsc
+#else
+        TARGET WsNotifierPluginDlgImpl.rsc
+#endif        
+    
+        #ifdef SYMBIAN_SECURE_ECOM
+            TARGETPATH /private/10003a4a // 3.0
+        #endif
+    LANGUAGE_IDS
+    END // RESOURCE
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES    
+    RESOURCE ../data/sennotifierplugin_reg.rss
+#else
+    RESOURCE ../data/wsnotifierplugin_REG.rss
+#endif        
+#else 
+    TARGETPATH      /system/notifiers
+    RESOURCE ../data/SenNotifierPluginDlgImpl.rss
+    #ifdef __SERIES60_26__
+    	RESOURCE ../data/sennotifierplugin_REG.rss
+    #endif
+    LANGUAGE_IDS
+#endif
+
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+
+SYSTEMINCLUDE   ../../inc
+SYSTEMINCLUDE   /epoc32/include/libc
+SYSTEMINCLUDE   /epoc32/include/uikon 
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY avkon.lib
+LIBRARY commonengine.lib 
+LIBRARY cone.lib
+//LIBRARY egul.lib 
+//LIBRARY eikcoctl.lib
+//LIBRARY eikcore.lib 
+//LIBRARY eikctl.lib
+//LIBRARY eikdlg.lib 
+LIBRARY eiksrv.lib
+LIBRARY euser.lib 
+LIBRARY efsrv.lib  // for logging
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY sennotdlg.lib
+#else
+LIBRARY wsnotdlg.lib
+#endif
+#ifndef EKA2
+   EXPORTUNFROZEN
+#endif
+
+#ifdef EKA2
+  #if defined(ARMCC)
+    DEFFILE ../eabi/SENNOTIFIERPLUGIN.DEF
+  #elif defined(WINSCW)
+    DEFFILE ../BWINSCW/SENNOTIFIERPLUGIN.DEF
+  #elif defined(WINS)
+    DEFFILE ../BWINS/SENNOTIFIERPLUGIN.DEF
+  #else 
+    DEFFILE ../BMARM/SENNOTIFIERPLUGIN.DEF
+  #endif
+#endif
+
+SMPSAFE
+
+//#ifdef SYMBIAN_SECURE_ECOM 
+//#else // not SYMBIAN_SECURE_ECOM 
+//  #if defined(ARMCC)
+//    DEFFILE ../EABI/SENNOTIFIERPLUGIN_2.6.DEF
+//  #elif defined(WINSCW)
+//    DEFFILE ../BWINSCW/SENNOTIFIERPLUGIN_2.6.DEF
+//  #elif defined(WINS)
+//    DEFFILE ../BWINS/SENNOTIFIERPLUGIN_2.6.DEF
+//  #else 
+//    DEFFILE ../BMARM/SENNOTIFIERPLUGIN_2.6.DEF
+//  #endif
+//#endif // SYMBIAN_SECURE_ECOM 
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/group/sennotplugindlgclient.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Project specification file for sennotplugindlgclient   
+*
+*/
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+TARGETTYPE        dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET            sennotdlg.dll
+UID               0x1000008d 0x101F9766
+#else
+TARGET            wsnotdlg.dll
+UID               0x1000008d 0x101F9745
+#endif
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+
+SOURCEPATH        ../src
+SOURCE            sennotplugindlg.cpp 
+
+USERINCLUDE       ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+
+LIBRARY           euser.lib 
+
+#ifdef SYMBIAN_SECURE_ECOM 
+  #if defined(ARMCC)
+    DEFFILE ../eabi/SENNOTPLUGINDLGCLIENT.DEF
+  #elif defined(WINSCW)
+    DEFFILE ../BWINSCW/SENNOTPLUGINDLGCLIENT.DEF
+  #elif defined(WINS)
+    DEFFILE ../BWINS/SENNOTPLUGINDLGCLIENT.DEF
+  #else 
+    DEFFILE ../BMARM/SENNOTPLUGINDLGCLIENT.DEF
+  #endif
+#else // not SYMBIAN_SECURE_ECOM 
+  #if defined(ARMCC)
+    DEFFILE ../EABI/SENNOTPLUGINDLGCLIENT_2.6.DEF
+  #elif defined(WINSCW)
+    DEFFILE ../BWINSCW/SENNOTPLUGINDLGCLIENT_2.6.DEF
+  #elif defined(WINS)
+    DEFFILE ../BWINS/SENNOTPLUGINDLGCLIENT_2.6.DEF
+  #else 
+    DEFFILE ../BMARM/SENNOTPLUGINDLGCLIENT_2.6.DEF
+  #endif
+#endif // SYMBIAN_SECURE_ECOM 
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/inc/logger.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __LOGGER_H_____
+#define __LOGGER_H_____
+
+#ifdef __CUSTOM_LOG_ENABLED__
+
+    #define DOLOG(a) DoLog(a)
+
+    // INCLUDES
+    #include <e32std.h>
+
+    // CONSTANTS
+    _LIT(KLogFileName, "c:\\SenNotPluginDlgImpl.txt");
+
+    // panics
+    _LIT(KLogPanicCategory, "CustNotifyLog");
+    const TInt KPanicFsConnectFailed = 1;
+    const TInt KPanicFileCreateFailed = 2;
+    const TInt KPanicFileWriteFailed = 3;
+
+    void DoLog(const TDesC& aText);
+
+#else  //__CUSTOM_LOG_ENABLED__
+    #define DOLOG(a)
+#endif //__CUSTOM_LOG_ENABLED__
+
+#endif //__LOGGER_H_____
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/inc/sennotplugindlg.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,448 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This is common interface for notifier plug-in, which supports
+*                UI dialogs for WSF. This interface is used by clients 
+*                and plug-in implementation.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __SENNOTIFIERPLUGINDIALOG_H__
+#define __SENNOTIFIERPLUGINDIALOG_H__
+
+// INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TUid KSenNotifierPluginUID     = { 0x101F9764 };
+#else
+const TUid KSenNotifierPluginUID     = { 0x101F9743 };
+#endif
+
+const TInt KSenMaxUsernameLength = 32;
+const TInt KSenMaxPasswordLength = 16;
+const TInt KSenPluginMsgDataMaxSize = 1024;
+
+// CLASS DECLARATION
+
+/**
+* Class TSenNotPluginMessage
+* Base class for fixed sized messages transferred between client and plug-in
+* notifier implementation.
+* This owns container buffer, which holds simple object types
+* This is used internally.
+*/
+class TSenNotPluginMessage
+    {
+    protected:
+
+        /**
+        * Types of objects, which this container can hold
+        */
+        enum TObjectType
+        {
+        E8BitDescriptor = 0, // Not currently supported
+        E16BitDescriptor,
+        EInt32
+        };
+        
+        // New functions
+        
+        /**
+        *  Serialize 16-bit buffer in the format <E16BitDescriptor><length><data>
+        *  The data is appended to iData.
+        *  Caller is responsible for making sure iData has enough space.
+        */
+        void AppendBuf16(const TDesC& aBuf);
+
+        /**
+        *  Serialize 32 bit integer in the format <EInt32><value>
+        *  The data is appended to iData;
+        *  Caller is responsible for making sure iData has enough space.
+        */
+        void AppendInt32(TInt32 aInt32);
+
+        /**
+        *  Get 16-bit descriptor from known index. It is callers responsibility to
+        *  know that given index contains 16-bit buffer object.
+        */
+        TPtrC16 GetBuf16(TInt aIndex) const;
+
+        /**
+        *  Get 32-bit integer object from known index. It is callers
+        *  responsibility to know that given index contains 32-bit integer object.
+        */
+        TInt32 GetInt32(TInt aIndex) const;
+
+    private: // New functions
+
+        /**
+        *  Calculate byte size of 32-bit integer object in this container.
+        */
+        TInt Int32ObjectSize() const;
+
+        /**
+        *  Calculate byte size of 16-bit descriptor object in this container.
+        *  The aObjectStart must point to valid area within iData.
+        */
+        TInt Buf16ObjectSize(TUint8 *aObjectStart) const;
+
+        /**
+        *  Find pointer to next object within iData. The aObjectStart must point
+        *  to a valid object within iData.
+        */
+        TUint8* NavigatePointerToNextObjext(TUint8* aObjectStart) const;
+
+    protected: // Data
+        TBuf8<KSenPluginMsgDataMaxSize> iData;
+    };
+
+/**
+* Class TSenNotPluginRequest
+* Base class for fixed sized requests transferred between client and plug-in
+* notifier implementation.
+* This is used internally. This should not be instantiated by the clients.
+*/
+class TSenNotPluginRequest : public TSenNotPluginMessage
+    {
+    public:
+
+        /**
+        *  List of supported functionalities in plug-in implementation
+        */
+        enum TSenNotPluginMethod
+        {
+        ENoMethod,
+        EAuthenticationDlg,
+        EAllowRegisterDlg,
+        EAllowUnRegisterDlg,
+        EAskSaveDlg
+        };
+            
+        // New functions
+
+        IMPORT_C TSenNotPluginRequest();
+
+        /**
+        *  Request method (TSenPluginMethod)
+        */
+        IMPORT_C TInt Method();
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TSenNotPluginRequest(TInt aMethod);
+
+    protected: // Data
+        TInt iMethod; // see TSenPluginMethod
+    };
+
+/**
+* Class TSenNotPluginResponse
+* Base class for fixed sized responses transferred between client and plug-in
+* notifier implementation.
+* This is used internally. This should not be instantiated by the clients.
+*/
+class TSenNotPluginResponse : public TSenNotPluginMessage
+    {
+    };
+
+/**
+* Class TAuthenticationDlgRequest
+* Concrete public class for sending authentication dialog request to notifier
+* plug-in.
+* Notifier will show username/password dialog supporting also Save password
+* check box.
+* This is typically packaged to TPckgBuf and used as follows:
+*      RNotifier iNotifier;
+*      TPckgBuf<TAuthenticationDlgRequest> iRequest;
+*      TPckgBuf<TAuthenticationDlgResponse> iResponse;
+*      ...
+*      iNotifier.Connect();
+*      ...
+*      TRequestStatus status; // typically iStatus of CActive
+*      iNotifier.StartNotifierAndGetResponse(status, KSenNotifierPluginUID,
+*          request, response);
+*      User::WaitForRequest(status);
+*      if(status == KErrNone && iResponse().OkButtonPressed())
+*          ...
+*      ...
+*      iNotifier.Close();
+*
+* See also TAuthenticationDlgResponse
+*/
+class TAuthenticationDlgRequest : public TSenNotPluginRequest
+    {
+    public: // New functions
+
+        /**
+        *  Default constructor.
+        *  Username and password fields will be empty and Save password checkbox
+        *  will be unchecked.
+        */
+        IMPORT_C TAuthenticationDlgRequest();
+
+        /**
+        *  Set request data.
+        *  Username and password must not exceed KSenMaxUsernameLength and
+        *  KSenMaxPasswordLength respectively.
+        *  This will fill the iData in base class.
+        */
+        IMPORT_C TInt SetData(const TDesC& aUsername, const TDesC& aPassword);
+
+        /**
+        *  Get view to username value.
+        */
+        IMPORT_C TPtrC16 Username() const;
+
+        /**
+        *  Get view to password value
+        */
+        IMPORT_C TPtrC16 Password() const;
+    };
+
+/**
+* Class TAuthenticationDlgResponse
+* Concrete public class for receiving authentication dialog response from
+* notifier plug-in.
+* See also usage in documentation of TAuthenticationDlgRequest
+*/
+class TAuthenticationDlgResponse : public TSenNotPluginResponse
+    {
+    public: // New functions
+
+        /**
+        *  Default constructor.
+        *  Username and password fields will be empty and Save password checkbox
+        *  will be unchecked.
+        */
+        IMPORT_C TAuthenticationDlgResponse();
+
+        /**
+        *  Set response data. This is typically used by plug-in implemetation.
+        *  Username and password must not exceed KSenMaxUsernameLength and
+        *  KSenMaxPasswordLength respectively.
+        *  This will fill the iData in base class.
+        */
+        IMPORT_C TInt SetData(const TDesC& aUsername, const TDesC& aPassword,
+                              TBool aOkButtonPressed);
+
+        /**
+        *  Get view to username value.
+        */
+        IMPORT_C TPtrC16 Username() const;
+
+        /**
+        *  Get view to password value.
+        */
+        IMPORT_C TPtrC16 Password() const;
+
+        /**
+        *  Get info whether user pressed Ok or Cancel command button in the
+        *  dialog.
+        */
+        IMPORT_C TBool OkButtonPressed() const;
+    };
+
+
+/**
+* Class TAllowRegisterDlgRequest
+* Concrete public class for sending Yes/No query request to notifier
+* plug-in. Implementation will query user, if he/she will allow an application
+* to register as a web service.
+* This is typically packaged to TPckgBuf and used as follows:
+*      RNotifier iNotifier;
+*      TPckgBuf<TAllowRegisterDlgRequest> iRequest;
+*      TPckgBuf<TAllowRegisterDlgResponse> iResponse;
+*      ...
+*      iNotifier.Connect();
+*      ...
+*      TRequestStatus status; // typically iStatus of CActive
+*      iNotifier.StartNotifierAndGetResponse(status, KSenNotifierPluginUID,
+*          request, response);
+*      User::WaitForRequest(status);
+*      if(status == KErrNone && iResponse().OkButtonPressed())
+*          ...
+*      ...
+*      iNotifier.Close();
+*/
+class TAllowRegisterDlgRequest: public TSenNotPluginRequest
+    {
+    public:
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TAllowRegisterDlgRequest();
+    };
+
+/**
+* Class TAllowRegisterDlgResponse
+* Concrete public class for receiving Yes/No query result.
+* See also usage in documentation of TAllowRegisterDlgRequest
+*/
+class TAllowRegisterDlgResponse : public TSenNotPluginResponse
+    {
+    public:
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TAllowRegisterDlgResponse();
+
+        // New functions
+        
+        /**
+        *  Set response data. This is typically used by plug-in implemetation.
+        *  This will fill the iData in base class.
+        */
+        IMPORT_C void SetOkButton(TBool aValue);
+
+        /**
+        *  Get info whether user pressed Ok or Cancel command button in the
+        *  dialog.
+        */
+        IMPORT_C TBool OkButtonPressed() const;
+    };
+
+/**
+* Class TAllowUnRegisterDlgRequest
+* Concrete public class for sending Yes/No query request to notifier
+* plug-in. Implementation will query user, if he/she will allow an application
+* to unregister as a web service.
+* This is typically packaged to TPckgBuf and used as follows:
+*      RNotifier iNotifier;
+*      TPckgBuf<TAllowUnRegisterDlgRequest> iRequest;
+*      TPckgBuf<TAllowUnRegisterDlgResponse> iResponse;
+*      ...
+*      iNotifier.Connect();
+*      ...
+*      TRequestStatus status; // typically iStatus of CActive
+*      iNotifier.StartNotifierAndGetResponse(status, KSenNotifierPluginUID,
+*          request, response);
+*      User::WaitForRequest(status);
+*      if(status == KErrNone && iResponse().OkButtonPressed())
+*          ...
+*      ...
+*      iNotifier.Close();
+*/
+class TAllowUnRegisterDlgRequest: public TSenNotPluginRequest
+    {
+    public:
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TAllowUnRegisterDlgRequest();
+    };
+
+/**
+* Class TAllowUnRegisterDlgResponse
+* Concrete public class for receiving Yes/No query result.
+* See also usage in documentation of TAllowUnRegisterDlgRequest
+*/
+class TAllowUnRegisterDlgResponse : public TSenNotPluginResponse
+    {
+    public:
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TAllowUnRegisterDlgResponse();
+
+        // New functions
+    
+        /**
+        *  Set response data. This is typically used by plug-in implemetation.
+        *  This will fill the iData in base class.
+        */
+        IMPORT_C void SetOkButton(TBool aValue);
+
+        /**
+        *  Get info whether user pressed Ok or Cancel command button in the
+        *  dialog.
+        */
+        IMPORT_C TBool OkButtonPressed() const;
+    };
+
+/**
+* Class TAskSaveDlgRequest
+* Concrete public class for sending Yes/No query request to notifier
+* plug-in. Implementation will query user, if he/she will allow an application
+* to save username and password.
+* This is typically packaged to TPckgBuf and used as follows:
+*      RNotifier iNotifier;
+*      TPckgBuf<TAskSaveDlgRequest> iRequest;
+*      TPckgBuf<TAskSaveDlgResponse> iResponse;
+*      ...
+*      iNotifier.Connect();
+*      ...
+*      TRequestStatus status; // typically iStatus of CActive
+*      iNotifier.StartNotifierAndGetResponse(status, KSenNotifierPluginUID,
+*          request, response);
+*      User::WaitForRequest(status);
+*      if(status == KErrNone && iResponse().OkButtonPressed())
+*          ...
+*      ...
+*      iNotifier.Close();
+*/
+class TAskSaveDlgRequest: public TSenNotPluginRequest
+    {
+    public:
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TAskSaveDlgRequest();
+    };
+
+/**
+* Class TAskSaveDlgResponse
+* Concrete public class for receiving Yes/No query result.
+* See also usage in documentation of TAskSaveDlgRequest
+*/
+class TAskSaveDlgResponse : public TSenNotPluginResponse
+    {
+    public:
+
+        /**
+        *  Default constructor.
+        */
+        IMPORT_C TAskSaveDlgResponse();
+
+        // New functions
+
+        /**
+        *  Set response data. This is typically used by plug-in implemetation.
+        *  This will fill the iData in base class.
+        */
+        IMPORT_C void SetOkButton(TBool aValue);
+
+        /**
+        *  Get info whether user pressed Ok or Cancel command button in the
+        *  dialog.
+        */
+        IMPORT_C TBool OkButtonPressed() const;
+    };
+
+#endif // __SENNOTIFIERPLUGINDIALOG_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/inc/sennotplugindlgimpl.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __SENNOTPLUGINDLGIMPL__
+#define __SENNOTPLUGINDLGIMPL__
+
+// INCLUDES
+#include <eiknotapi.h> // MEikSrvNotifierBase
+
+#include "sennotplugindlg.h"
+
+// FORWARD DECLARATIONS
+class CAknDialog;
+class TAuthenticationDlgRequest;
+class TAuthenticationDlgResponse;
+class TAllowRegisterDlgRequest;
+class TAllowRegisterDlgResponse;
+class TAllowUnRegisterDlgRequest;
+class TAllowUnRegisterDlgResponse;
+
+// CLASS DECLARATION
+#ifdef EKA2
+IMPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray();
+class CSenNotPluginDlgImpl : public CActive, public MEikSrvNotifierBase2
+#else
+IMPORT_C CArrayPtr<MEikSrvNotifierBase>* NotifierArray();
+class CSenNotPluginDlgImpl : public CActive, public MEikSrvNotifierBase
+#endif
+    {
+    public: // Constructors and destructor
+
+        static CSenNotPluginDlgImpl* NewL();
+
+        ~CSenNotPluginDlgImpl();
+
+        // Functions from base classes
+
+        // From CActive
+        void RunL();
+        TInt RunError(TInt aError);
+        void DoCancel();
+
+        // From MEikSrvNotifierBase
+        /**
+        * Called when all resources allocated by notifiers shoudl be freed.
+        */
+        virtual void Release();
+    
+        /**
+        * Called when a notifier is first loaded to allow any initial construction that is required.
+        */
+        #ifdef EKA2
+            virtual MEikSrvNotifierBase2::TNotifierInfo RegisterL();
+        #else
+            virtual MEikSrvNotifierBase::TNotifierInfo RegisterL();
+        #endif
+        
+        /**
+        * @return the priority a notifier takes and the channels it acts on.  The return value may be varied
+        * at run-time.
+        */
+        #ifdef EKA2
+            virtual MEikSrvNotifierBase2::TNotifierInfo Info() const;
+        #else
+            virtual MEikSrvNotifierBase::TNotifierInfo Info() const;
+        #endif
+    
+        /**
+        * Start the notifier with data aBuffer and return an initial response.
+        */
+        virtual TPtrC8 StartL(const TDesC8& aBuffer);
+    
+        /**
+        * Start the notifier with data aBuffer.  aMessage should be completed when the notifier is deactivated.
+        * May be called multiple times if more than one client starts the notifier.  The notifier is immediately
+        * responsible for completing aMessage.
+        */
+        #ifdef EKA2
+            virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
+        #else
+            virtual void StartL(const TDesC8& aBuffer, const TAny* aReturnVal, RMessage aMessage);
+        #endif
+    
+        /**
+        * The notifier has been deactivated so resources can be freed and outstanding messages completed.
+        */
+        virtual void Cancel();
+
+        /**
+        * Update a currently active notifier with data aBuffer.
+        */
+        virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
+
+    private: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenNotPluginDlgImpl();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+
+        // Helpers
+        void HandleAsyncRequestL();
+        TInt ShowAuthenticationDialogL(TAuthenticationDlgRequest* aRequest,
+                                       TAuthenticationDlgResponse* aResponse);
+
+        TInt ShowAllowRegisterDialogL(TAllowRegisterDlgRequest* aRequest,
+                                     TAllowRegisterDlgResponse* aResponse);
+
+        TInt ShowAllowUnRegisterDialogL(TAllowUnRegisterDlgRequest* aRequest,
+                                        TAllowUnRegisterDlgResponse* aResponse);
+
+        TInt ShowAskSaveDialogL(TAskSaveDlgRequest* aRequest,
+                                TAskSaveDlgResponse* aResponse);
+
+        void Cleanup();
+
+    private: // Data
+        TInt iMethod; // See TSenNotPluginRequest::TSenNotPluginMethod
+        #ifdef EKA2
+            RMessagePtr2    iMessage;
+            TInt            iReplySlot;
+            MEikSrvNotifierBase2::TNotifierInfo  iInfo;
+        #else
+            RMessage        iMessage;
+            const TAny*     iReplyPtr;
+            MEikSrvNotifierBase::TNotifierInfo  iInfo;
+        #endif
+        TPckgBuf<TSenNotPluginRequest>* iRequest;
+        TPckgBuf<TSenNotPluginResponse>* iResponse;
+        // Valid during showing a dialog
+        CAknDialog* iDialog; 
+        TBool iCancelled;
+    };
+
+#endif // __SENNOTPLUGINDLGIMPL__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/inc/sennotplugindlgimpl.hrh	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SENNOTPLUGINDLGIMPL_HRH
+#define SENNOTPLUGINDLGIMPL_HRH
+
+// INCLUDES
+#include <avkon.hrh> // KAknCtLastControlId
+
+// DATA TYPES    
+// Control ids
+// Identify all controls defined and used by this application.
+enum {
+    EMultilineUserLine = KAknCtLastControlId + 1,
+    EMultilinePasswordLine
+    };
+
+#endif // SENNOTPLUGINDLGIMPL_HRH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/loc/sennotplugindlgimpl.loc	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// LOCALISATION STRINGS
+
+//d:Title pane text in Web sevices username/password dialog.
+//l:title_pane_1
+//w:
+//r:3.0
+//
+//#define qtn_sen_notdlg_auth_title		"Web services"
+
+//d:Prompt text for username in Web sevices username/password dialog.
+//l:popup_query_data_window
+//w:
+//r:3.0
+//
+#define qtn_sen_notdlg_auth_username		"WS Username"
+
+//d:Prompt text for password in Web sevices username/password dialog.
+//l:popup_query_data_window
+//w:
+//r:3.0
+//
+#define qtn_sen_notdlg_auth_password		"WS Password"
+
+//d:Query text for confirmation query dialog.
+//l:popup_note_window
+//w:
+//r:3.0
+//
+#define qtn_sen_notdlg_ask_save			"Save password?"
+
+//d:Query text for confirmation query dialog.
+//l:popup_note_window
+//w:
+//r:3.0
+//
+#define qtn_sen_notdlg_allow_register		"Allow this application to register a web service?"
+
+//d:Query text for confirmation query dialog.
+//l:popup_note_window
+//w:
+//r:3.0
+//
+#define qtn_sen_notdlg_allow_unregister		"Allow this application to unregister a web service?"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/rom/wsnotifierplugindlg.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __NOTIFIERPLUGINDLG_IBY__
+#define __NOTIFIERPLUGINDLG_IBY__
+
+//NotifierPluginDlg
+file=ABI_DIR\BUILD_DIR\sennotdlg.dll            PROGRAMS_DIR\sennotdlg.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/rom/wsnotifierplugindlg_resources.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        The resource iby file contains resource that needs to be localized for 
+*                notifierpluginDlg
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef NOTIFIERPLUGINDLGRESOURCES_IBY
+#define NOTIFIERPLUGINDLGRESOURCES_IBY
+
+#ifdef __SERIES60_NATIVE_BROWSER
+
+data=DATAZ_\private\10003a4a\SenNotifierPluginDlgImpl.rsc   private\10003a4a\SenNotifierPluginDlgImpl.rsc 
+
+#endif // __SERIES60_NATIVE_BROWSER
+
+#endif // NOTIFIERPLUGINDLGRESOURCES_IBY
+
+//  End of File  
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/rom/wsnotifierplugins.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __NOTIFIERPLUGINS_IBY__
+#define __NOTIFIERPLUGINS_IBY__
+
+//NotifierPlugin
+ECOM_PLUGIN(sennotifierplugin.dll, 101F9764.rss) 
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/src/logger.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifdef __CUSTOM_LOG_ENABLED__
+
+// INCLUDE FILES
+#include "Logger.h"
+
+#include <f32file.h>
+
+void DoLog(const TDesC& aText)
+    {
+    static const TInt KLogEntryMaxLength = 128;
+    _LIT(KLineFeed, "\n");
+
+
+
+    /**
+     *  Log time format (see TTime) is
+     *  Day-Month-Year Hours:Minutes:Seconds:Milliseconds
+     *
+     *  Example: 30-12-2004 23:00:55:990
+     */
+    _LIT(KLogTimeFormat, "%F%D-%M-%Y %H:%T:%S:%*C3");
+
+    TBuf8<KLogEntryMaxLength> writeBuffer;
+    RFs FileServer;
+    RFile File;
+
+    if(FileServer.Connect() != KErrNone)
+        {
+        FileServer.Close(); // just in case
+        User::Panic(KLogPanicCategory(), KPanicFsConnectFailed);
+        return;
+        }
+
+    // Open file for writing, if exists. Othervise create new file.
+    if(File.Open(FileServer, KLogFileName(), EFileWrite) != KErrNone)
+        {
+        if(File.Create(FileServer, KLogFileName(), EFileWrite) != KErrNone)
+            {
+            FileServer.Close();
+            User::Panic(KLogPanicCategory(), KPanicFileCreateFailed);
+            }
+        }
+
+    TTime currentTime;
+    currentTime.UniversalTime();
+    TBuf<32> timeString;
+
+    // currentTime is now in universal time. Convert it to home time.
+    TLocale locale;
+    TTimeIntervalSeconds universalTimeOffset(locale.UniversalTimeOffset());
+    TTimeIntervalHours daylightSaving(0);
+    if(locale.QueryHomeHasDaylightSavingOn())
+        {
+        daylightSaving = 1;
+        }
+    currentTime = currentTime + universalTimeOffset + daylightSaving;
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, currentTime.FormatL(timeString, KLogTimeFormat));
+    leaveCode = 0; // not used
+    // Add LogString to the end of file and close the file
+    TInt currentSize = 0, returnCode;
+    writeBuffer.Append(timeString);
+    writeBuffer.Append(_L(": "));
+    writeBuffer.Append(aText.Left(KLogEntryMaxLength-timeString.Length()));
+    writeBuffer.Append(KLineFeed);
+    File.Size(currentSize);
+    returnCode = File.Write(currentSize,
+                            writeBuffer,
+                            writeBuffer.Length());
+    File.Close();
+    // Close file server session
+    FileServer.Close();
+
+    if(returnCode != KErrNone)
+        {
+        User::Panic(KLogPanicCategory(), KPanicFileWriteFailed);
+        }
+    }
+
+#endif //__CUSTOM_LOG_ENABLED__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/src/sennotplugindlg.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,326 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sennotplugindlg.h"
+
+// Epoc DLL entry point, return that everything is ok
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason)
+    {
+    return(KErrNone);
+    }
+#endif
+    
+
+/******************************************************************************
+ *              TSenNotPluginMessage implementation
+ *****************************************************************************/
+
+// Serialize 16-bit buffer in the format <E16BitDescriptor><length><data>
+void TSenNotPluginMessage::AppendBuf16(const TDesC& aBuf)
+    {
+    TObjectType descType(E16BitDescriptor);
+    TInt32 length = aBuf.Length();
+    iData.Append((const TUint8*)&descType, sizeof(TObjectType));
+    iData.Append((const TUint8*)&length, sizeof(TInt32));
+    iData.Append((const TUint8*)aBuf.Ptr(), aBuf.Size());
+    }
+
+// Serialize 32 bit integer in the format <EInt32><value>
+void TSenNotPluginMessage::AppendInt32(TInt32 aInt32)
+    {
+    TObjectType intType(EInt32); //
+    iData.Append((const TUint8*)&intType, sizeof(TObjectType));
+    iData.Append((const TUint8*)&aInt32, sizeof(TInt32));
+    }
+
+TPtrC16 TSenNotPluginMessage::GetBuf16(TInt aIndex) const
+    {
+    TPtr16 result(NULL, 0);
+    TUint8* ptr = (TUint8*)iData.Ptr();
+    for(TInt i=0; i<aIndex; i++)
+        {
+        ptr = NavigatePointerToNextObjext(ptr);
+        }
+    ptr += sizeof(TObjectType);
+    TInt32 length = *((TInt32*)ptr);
+    ptr += sizeof(TInt32);
+    result.Set((TUint16*)ptr, length, length); // Note: length == max length
+    return result;
+    }
+
+TInt32 TSenNotPluginMessage::GetInt32(TInt aIndex) const
+    {
+    TUint8* ptr = (TUint8*)iData.Ptr();
+    for(TInt i=0; i<aIndex; i++)
+        {
+        ptr = NavigatePointerToNextObjext(ptr);
+        }
+    ptr += sizeof(TObjectType);
+    TInt32 result = *((TInt32*)ptr);
+    return result;
+    }
+
+TInt TSenNotPluginMessage::Int32ObjectSize() const
+    {
+    return sizeof(TObjectType) + sizeof(TInt32);
+    }
+
+TInt TSenNotPluginMessage::Buf16ObjectSize(TUint8 *aObjectStart) const
+    {
+    TUint8 *ptr = aObjectStart;
+    ptr += sizeof(TObjectType);
+    TInt32 length = *((TInt32*)ptr);
+    return sizeof(TObjectType) + sizeof(TInt32) + length * 2; // 2x : 16 bytes per one character
+    }
+
+TUint8* TSenNotPluginMessage::NavigatePointerToNextObjext(TUint8* aObjectStart) const
+    {
+    TUint8* ptr = aObjectStart;
+    TObjectType objectType = *((TObjectType*)ptr);
+    if(objectType == E16BitDescriptor)
+        ptr += Buf16ObjectSize(ptr);
+    else if(objectType == EInt32)
+        ptr += Int32ObjectSize();
+    // else this should panic
+    return ptr;
+    }
+
+/******************************************************************************
+ *              TSenNotPluginRequest implementation
+ *****************************************************************************/
+
+EXPORT_C TSenNotPluginRequest::TSenNotPluginRequest()
+: iMethod(ENoMethod)
+    {
+    }
+
+EXPORT_C TInt TSenNotPluginRequest::Method()
+    {
+    return iMethod;
+    }
+
+EXPORT_C TSenNotPluginRequest::TSenNotPluginRequest(TInt aMethod)
+: iMethod(aMethod)
+    {
+    }
+
+/******************************************************************************
+ *              TAuthenticationDlgRequest implementation
+ *****************************************************************************/
+
+
+EXPORT_C TAuthenticationDlgRequest::TAuthenticationDlgRequest()
+    : TSenNotPluginRequest(EAuthenticationDlg)
+    {
+    SetData(KNullDesC, KNullDesC);
+    }
+
+EXPORT_C TInt TAuthenticationDlgRequest::SetData(const TDesC& aUsername,
+                                                    const TDesC& aPassword)
+    {
+    iData.Zero();
+    if(aUsername.Length() > KSenMaxUsernameLength ||
+       aPassword.Length() > KSenMaxPasswordLength)
+        return KErrBadDescriptor;
+    AppendBuf16(aUsername);
+    AppendBuf16(aPassword);
+    return KErrNone;
+    }
+
+EXPORT_C TPtrC16 TAuthenticationDlgRequest::Username() const
+    {
+    return GetBuf16(0);
+    }
+
+EXPORT_C TPtrC16 TAuthenticationDlgRequest::Password() const
+    {
+    return GetBuf16(1);
+    }
+
+/******************************************************************************
+ *              TAuthenticationDlgResponse implementation
+ *****************************************************************************/
+
+EXPORT_C TAuthenticationDlgResponse::TAuthenticationDlgResponse()
+    {
+    SetData(KNullDesC, KNullDesC, EFalse);
+    }
+
+EXPORT_C TInt TAuthenticationDlgResponse::SetData(const TDesC& aUsername, 
+    const TDesC& aPassword, TBool aOkButtonPressed) 
+    { 
+    iData.Zero(); 
+    if(aUsername.Length() > KSenMaxUsernameLength || 
+       aPassword.Length() > KSenMaxPasswordLength) 
+        return KErrBadDescriptor; 
+
+    //TUint8* ptr = (TUint8*)iData.Ptr();  // ptr not used atm
+
+    TUint16 value16; 
+    if (aOkButtonPressed) value16 = 1; 
+    else value16 = 0; 
+    iData.Append((const TUint8*)&value16, sizeof(TUint16)); 
+    iData.Append((const TUint8*)aUsername.Ptr(), aUsername.Size()); 
+    if (aUsername.Size() < KSenMaxUsernameLength*2) 
+            { 
+                iData.AppendFill(0,KSenMaxUsernameLength*2-aUsername.Size()); 
+            } 
+    iData.Append((const TUint8*)aPassword.Ptr(), aPassword.Size()); 
+    if (aPassword.Size() < KSenMaxPasswordLength*2) 
+            { 
+                iData.AppendFill(0,KSenMaxPasswordLength*2-aPassword.Size()); 
+            } 
+    return KErrNone; 
+    } 
+
+EXPORT_C TPtrC16 TAuthenticationDlgResponse::Username() const 
+    { 
+    TUint16* ptr = (TUint16*)iData.Ptr(); 
+    TInt size = sizeof(TUint16)/2; 
+    ptr += size; 
+    TUint16* start = ptr; 
+    while (*ptr != 0) 
+            { 
+            ptr += size; 
+            } 
+        TInt length = (ptr-start)/size; 
+    TPtr16 result(NULL, 0); 
+    result.Set((TUint16*)start, length, length); // Note: length == max length 
+    return result; 
+    } 
+
+EXPORT_C TPtrC16 TAuthenticationDlgResponse::Password() const 
+    { 
+    TUint16* ptr = (TUint16*)iData.Ptr(); 
+    TInt size = sizeof(TUint16)/2; 
+    ptr += size*(1+KSenMaxUsernameLength); 
+    TUint16* start = ptr; 
+    while (*ptr != 0) 
+            { 
+            ptr += size; 
+            } 
+        TInt length = (ptr-start)/size; 
+    TPtr16 result(NULL, 0); 
+    result.Set((TUint16*)start, length, length); // Note: length == max length 
+    return result; 
+    } 
+
+EXPORT_C TBool TAuthenticationDlgResponse::OkButtonPressed() const 
+    { 
+    if (*(TUint16*)iData.Ptr() == 1) return ETrue; 
+    else return EFalse; 
+    }
+
+/******************************************************************************
+ *              TAllowRegisterDlgRequest implementation
+ *****************************************************************************/
+
+EXPORT_C TAllowRegisterDlgRequest::TAllowRegisterDlgRequest()
+    : TSenNotPluginRequest(EAllowRegisterDlg)
+    {
+    }
+
+
+/******************************************************************************
+ *              TAllowRegisterDlgResponse implementation
+ *****************************************************************************/
+
+EXPORT_C TAllowRegisterDlgResponse::TAllowRegisterDlgResponse()
+    {
+    SetOkButton(EFalse);
+    }
+
+EXPORT_C void TAllowRegisterDlgResponse::SetOkButton(TBool aValue)
+    {
+    AppendInt32((TInt32)aValue);
+    }
+
+EXPORT_C TBool TAllowRegisterDlgResponse::OkButtonPressed() const
+    {
+    return (TBool)GetInt32(0);
+    }
+
+/******************************************************************************
+ *              TAllowUnRegisterDlgRequest implementation
+ *****************************************************************************/
+
+EXPORT_C TAllowUnRegisterDlgRequest::TAllowUnRegisterDlgRequest()
+    : TSenNotPluginRequest(EAllowUnRegisterDlg)
+    {
+    }
+
+
+/******************************************************************************
+ *              TAllowUnRegisterDlgResponse implementation
+ *****************************************************************************/
+
+EXPORT_C TAllowUnRegisterDlgResponse::TAllowUnRegisterDlgResponse()
+    {
+    SetOkButton(EFalse); // False by default
+    }
+
+EXPORT_C void TAllowUnRegisterDlgResponse::SetOkButton(TBool aValue)
+    {
+    AppendInt32((TInt32)aValue);
+    }
+
+EXPORT_C TBool TAllowUnRegisterDlgResponse::OkButtonPressed() const
+    {
+    return (TBool)GetInt32(0);
+    }
+
+/******************************************************************************
+ *              TAskSaveDlgRequest implementation
+ *****************************************************************************/
+
+EXPORT_C TAskSaveDlgRequest::TAskSaveDlgRequest()
+    : TSenNotPluginRequest(EAskSaveDlg)
+    {
+    }
+
+/******************************************************************************
+ *              TAskSaveDlgResponse implementation
+ *****************************************************************************/
+
+EXPORT_C TAskSaveDlgResponse::TAskSaveDlgResponse()
+    {
+    SetOkButton(EFalse); // False by default
+    }
+
+EXPORT_C void TAskSaveDlgResponse::SetOkButton(TBool aValue)
+    {
+    AppendInt32((TInt32)aValue);
+    }
+
+EXPORT_C TBool TAskSaveDlgResponse::OkButtonPressed() const
+    {
+    return (TBool)GetInt32(0);
+    }
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/src/sennotplugindlgimpl.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,567 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <aknnotewrappers.h>
+#include <AknNotifyStd.h>
+#include <ConeResLoader.h>
+#include <StringLoader.h>
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    #include <SenNotifierPluginDlgImpl.rsg>
+#else
+    #include <WsNotifierPluginDlgImpl.rsg>
+#endif
+
+// This may be angle bracketed later..
+#include "logger.h"
+#include "sennotplugindlg.h" // client api
+#include "sennotplugindlgimpl.h"
+
+#include <implementationproxy.h>
+
+
+#ifdef EKA2 // 3.0
+  #ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    _LIT(KResourceFilePath, "\\private\\10003a4a\\SenNotifierPluginDlgImpl.RSC");
+  #else
+    _LIT(KResourceFilePath, "\\private\\10003a4a\\WsNotifierPluginDlgImpl.RSC");
+  #endif
+#else // not EKA2 (2.0, 2.1, 2.6, 2.8)
+  #ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    _LIT(KResourceFilePath, "\\system\\notifiers\\SenNotifierPluginDlgImpl.RSC");
+  #else
+    _LIT(KResourceFilePath, "\\system\\notifiers\\WsNotifierPluginDlgImpl.RSC");
+  #endif
+#endif // EKA2
+
+#ifdef EKA2
+void CreateNotifierL(CArrayPtr<MEikSrvNotifierBase2>* aNotifiers)
+    {
+    MEikSrvNotifierBase2* notifier;
+    notifier = CSenNotPluginDlgImpl::NewL();
+    CleanupStack::PushL(notifier);
+    aNotifiers->AppendL(notifier);
+    CleanupStack::Pop(notifier);
+    }
+#else
+void CreateNotifierL(CArrayPtr<MEikSrvNotifierBase>* aNotifiers)
+    {
+    MEikSrvNotifierBase* notifier;
+    notifier = CSenNotPluginDlgImpl::NewL();
+    CleanupStack::PushL(notifier);
+    aNotifiers->AppendL(notifier);
+    CleanupStack::Pop(notifier);
+    }
+#endif
+
+#ifdef EKA2
+EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+    {
+    DOLOG(_L("\n\n\n\n"));
+    DOLOG(_L("[ Creating notifier array ]"));
+    CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers
+        = new CArrayPtrFlat<MEikSrvNotifierBase2>(1);
+    if (notifiers)
+        {
+        TRAPD(err, CreateNotifierL(notifiers));
+        if(err)
+            {
+            notifiers->ResetAndDestroy();
+            delete notifiers;
+            notifiers = NULL;
+            DOLOG(_L("[ Creating notifier array: Error. Returning NULL ]"));
+            }
+        }
+    DOLOG(_L("[ Creating notifier array: Done ]"));
+    return(notifiers);
+    }
+#else
+EXPORT_C CArrayPtr<MEikSrvNotifierBase>* NotifierArray()
+    {
+    DOLOG(_L("\n\n\n\n"));
+    DOLOG(_L("[ Creating notifier array ]"));
+    CArrayPtrFlat<MEikSrvNotifierBase>* notifiers
+        = new CArrayPtrFlat<MEikSrvNotifierBase>(1);
+    if (notifiers)
+        {
+        TRAPD(err, CreateNotifierL(notifiers));
+        if(err)
+            {
+            notifiers->ResetAndDestroy();
+            delete notifiers;
+            notifiers = NULL;
+            DOLOG(_L("[ Creating notifier array: Error. Returning NULL ]"));
+            }
+        }
+    DOLOG(_L("[ Creating notifier array: Done ]"));
+    return(notifiers);
+    }
+#endif
+
+CSenNotPluginDlgImpl* CSenNotPluginDlgImpl::NewL()
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::NewL: Starting ]"));
+    CSenNotPluginDlgImpl* dlg = new(ELeave)CSenNotPluginDlgImpl();
+    CleanupStack::PushL(dlg);
+    dlg->ConstructL();
+    CleanupStack::Pop(dlg);
+    DOLOG(_L("[ CSenNotPluginDlgImpl::NewL: Done ]"));
+    return dlg;
+    }
+
+CSenNotPluginDlgImpl::~CSenNotPluginDlgImpl()
+    {
+    Cancel();
+    Cleanup();
+    }
+
+CSenNotPluginDlgImpl::CSenNotPluginDlgImpl() : CActive(EPriorityStandard),
+    iMethod(TSenNotPluginRequest::ENoMethod)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+void CSenNotPluginDlgImpl::ConstructL()
+    {
+    }
+
+void CSenNotPluginDlgImpl::RunL()
+    {
+    if(iMethod == TSenNotPluginRequest::ENoMethod)
+        return; // Notifier canceled or request signaled by other means
+
+    HandleAsyncRequestL(); // show dialog
+    Cleanup();
+    }
+
+TInt CSenNotPluginDlgImpl::RunError(TInt aError)
+    {
+    iMessage.Complete(aError);
+    Cleanup();
+    return KErrNone;
+    }
+
+void CSenNotPluginDlgImpl::DoCancel()
+    {
+    }
+
+/**
+ * Called when all resources allocated by notifiers shoudl be freed.
+ */
+void CSenNotPluginDlgImpl::Release()
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::Release: Deleting this ]"));
+    delete this;
+    }
+
+/**
+ * Called when a notifier is first loaded to allow any initial construction that is required.
+ */
+#ifdef EKA2
+MEikSrvNotifierBase2::TNotifierInfo CSenNotPluginDlgImpl::RegisterL()
+#else
+MEikSrvNotifierBase::TNotifierInfo CSenNotPluginDlgImpl::RegisterL()
+#endif
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::RegisterL ]"));
+    iInfo.iUid = KSenNotifierPluginUID;
+    //iInfo.iChannel = EAknNotifierChannelConfirmationQuery; //KNotifierOutputChannelScreen;
+    iInfo.iChannel = TUid::Uid(7641863);
+    iInfo.iPriority = ENotifierPriorityLow; //ENotifierPriorityVHigh;
+    DOLOG(_L("[ CSenNotPluginDlgImpl::RegisterL: Done ]"));
+    return iInfo;
+    }
+
+/**
+ * Return the priority a notifier takes and the channels it acts on.  The return value may be varied
+ * at run-time.
+ */
+#ifdef EKA2
+MEikSrvNotifierBase2::TNotifierInfo CSenNotPluginDlgImpl::Info() const
+#else
+MEikSrvNotifierBase::TNotifierInfo CSenNotPluginDlgImpl::Info() const
+#endif
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::Info ]"));
+    return iInfo;
+    }
+
+/**
+ * Start the notifier with data aBuffer and return an initial response.
+ */
+TPtrC8 CSenNotPluginDlgImpl::StartL(const TDesC8& /*aBuffer*/)
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::StartL(aBuffer): Not implemented ]"));
+    //Create and launch confirmation dialog using static function.
+    //The function returns True when the OK button is pressed.
+    DOLOG(_L("[ CSenNotPluginDlgImpl::StartL(aBuffer): Done ]"));
+    return TPtrC8(NULL, 0);
+    }
+
+void CSenNotPluginDlgImpl::HandleAsyncRequestL()
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: Starting ]"));
+
+    // Load resource file
+    CEikonEnv* eikEnv = CEikonEnv::Static();
+    if(!eikEnv)
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: EikEnv is NULL ]"));
+        }
+    else
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: EikEnv is valid ]"));
+        }
+
+    // Figure out the resource file drive trusting that 
+    // it must be the same drive from which the DLL was loaded.
+
+    TParse parse;
+    TFileName tempFileName;
+
+    Dll::FileName(tempFileName);
+    parse.SetNoWild(tempFileName, NULL, NULL);
+    // We need to set the default path to be used for future file access, because
+    // it is always initialised to c: and the voice control files may be stored
+    // on the d: drive.
+
+    TFileName filename;
+    filename.Append(parse.Drive());
+    filename.Append(KResourceFilePath);
+
+//    TFileName filename(KResourceFile);
+
+
+    DOLOG(filename);
+
+    RConeResourceLoader resLoader(*eikEnv);
+    if(resLoader.Open(filename) != KErrNone)
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: Failed to open resource file ]"));
+        }
+    else
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: Resource file opened OK. ]"));
+        }
+
+    CleanupClosePushL(resLoader);
+    
+    TInt result = KErrGeneral;
+    switch(iMethod)
+        {
+        case TSenNotPluginRequest::EAuthenticationDlg:
+            result = ShowAuthenticationDialogL((TAuthenticationDlgRequest*)&((*iRequest)()),
+                (TAuthenticationDlgResponse*)&((*iResponse)()));
+            break;
+        case TSenNotPluginRequest::EAllowRegisterDlg:
+            result = ShowAllowRegisterDialogL((TAllowRegisterDlgRequest*)&((*iRequest)()),
+                (TAllowRegisterDlgResponse*)&((*iResponse)()));
+            break;
+        case TSenNotPluginRequest::EAllowUnRegisterDlg:
+            result = ShowAllowUnRegisterDialogL((TAllowUnRegisterDlgRequest*)&((*iRequest)()),
+                (TAllowUnRegisterDlgResponse*)&((*iResponse)()));
+            break;
+        case TSenNotPluginRequest::EAskSaveDlg:
+            result = ShowAskSaveDialogL((TAskSaveDlgRequest*)&((*iRequest)()),
+               (TAskSaveDlgResponse*)&((*iResponse)()));
+            break;
+        default:
+            break;
+        }
+        
+    if(iCancelled)
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: Operation had been cancelled. Completing with KErrCancel ]"));
+        iMessage.Complete(KErrCancel);
+        }
+    else
+        {
+        if(result == KErrNone)
+#ifdef EKA2
+            iMessage.WriteL(iReplySlot, *iResponse);
+#else
+            iMessage.WriteL(iReplyPtr, *iResponse);
+#endif            
+        iMessage.Complete(result);
+        }
+
+    CleanupStack::PopAndDestroy(); // resLoader
+    DOLOG(_L("[ CSenNotPluginDlgImpl::HandleAsyncRequestL: Done ]"));
+
+    }
+
+/**
+ * Start the notifier with data aBuffer.  aMessage should be completed when the notifier is deactivated.
+ * May be called multiple times if more than one client starts the notifier.  The notifier is immediately
+ * responsible for completing aMessage.
+ */
+#ifdef EKA2
+void CSenNotPluginDlgImpl::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
+#else
+void CSenNotPluginDlgImpl::StartL(const TDesC8& aBuffer, const TAny* aReturnVal, RMessage aMessage)
+#endif
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::StartL(aBuffer, aReturnVal, aMessage): Starting ]"));
+
+    if(iMethod != TSenNotPluginRequest::ENoMethod)
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::StartL(aBuffer, aReturnVal, aMessage): Busy. Returning KErrInUse ]"));
+        aMessage.Complete(KErrInUse);
+        return;
+        }
+
+    Cleanup();
+
+    iRequest = new(ELeave)TPckgBuf<TSenNotPluginRequest>();
+    iRequest->Copy(aBuffer.Ptr(), sizeof(TSenNotPluginRequest));
+    iResponse = new(ELeave)TPckgBuf<TSenNotPluginResponse>();
+
+    iMethod = (*iRequest)().Method();
+    iMessage = aMessage;    
+#ifdef EKA2
+    iReplySlot = aReplySlot;
+#else
+    iReplyPtr = aReturnVal;
+#endif
+
+    iStatus = KRequestPending;
+    TRequestStatus* status = &iStatus;
+    SetActive();
+    User::RequestComplete(status, KErrNone);
+
+    DOLOG(_L("[ CSenNotPluginDlgImpl::StartL(aBuffer, aReturnVal, aMessage): Done ]"));
+    }
+
+
+TInt CSenNotPluginDlgImpl::ShowAuthenticationDialogL(TAuthenticationDlgRequest* aRequest,
+    TAuthenticationDlgResponse* aResponse)
+    {
+    // Note: default password is currently unsupported!
+    DOLOG(_L("[ CSenNotPluginDlgImpl::ShowAuthenticationDialogL: Starting ]"));
+
+    TBuf<KSenMaxUsernameLength> username(aRequest->Username());
+    TBuf<KSenMaxPasswordLength> password; // Empty
+
+    DOLOG(_L("[ CSenNotPluginDlgImpl::ShowAuthenticationDialogL: Creating dialog ]"));
+    CAknMultiLineDataQueryDialog* dlg = CAknMultiLineDataQueryDialog::NewL(username, password);
+    iDialog = dlg;
+    TRAPD(err,
+        DOLOG(_L("[ CSenNotPluginDlgImpl::ShowAuthenticationDialogL: Showing dialog ]"));
+        TBool okButtonSelected = iDialog->ExecuteLD(R_CUSTOM_USERNAMEPASSWD_DIALOG);
+        if(okButtonSelected)
+            {
+            DOLOG(_L("[ CSenNotPluginDlgImpl::ShowAuthenticationDialogL: Ok button was selected ]"));
+            aResponse->SetData(username, password, okButtonSelected);
+            }
+        else
+            {
+            DOLOG(_L("[ CSenNotPluginDlgImpl::ShowAuthenticationDialogL: Cancel button was selected ]"));
+            aResponse->SetData(KNullDesC, KNullDesC, okButtonSelected);
+            }
+        )
+    dlg = NULL;
+
+#ifdef __CUSTOM_LOG_ENABLED__
+    TBuf<128> errorBuf(_L("CSenNotPluginDlgImpl::ShowAuthenticationDialogL: Done with error code = "));
+    errorBuf.AppendNum(err);
+    DOLOG(errorBuf);
+#endif
+
+    return err;
+    }
+
+TInt CSenNotPluginDlgImpl::ShowAllowRegisterDialogL(TAllowRegisterDlgRequest* /*aRequest*/,
+    TAllowRegisterDlgResponse* aResponse)
+    {
+    HBufC* prompt = StringLoader::LoadL(R_SENNOTDLG_ALLOW_REGISTER_QUERY);
+    CleanupStack::PushL(prompt);
+    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+    CleanupStack::PushL( dlg ); 
+    dlg->SetPromptL(*prompt);
+    CleanupStack::Pop( dlg );  
+    CleanupStack::PopAndDestroy(prompt);
+    iDialog = dlg;
+    TRAPD(err,
+        if(dlg->ExecuteLD(R_COMMON_YES_NO_QUERY))
+            {
+            aResponse->SetOkButton(ETrue);
+            }
+        else
+            {
+            aResponse->SetOkButton(EFalse);
+            }
+        )
+    iDialog = NULL;
+
+    return err;
+    }
+
+TInt CSenNotPluginDlgImpl::ShowAllowUnRegisterDialogL(TAllowUnRegisterDlgRequest* /*aRequest*/,
+    TAllowUnRegisterDlgResponse* aResponse)
+    {
+    HBufC* prompt = StringLoader::LoadL(R_SENNOTDLG_ALLOW_UNREGISTER_QUERY);
+    CleanupStack::PushL(prompt);
+    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+    CleanupStack::PushL( dlg ); 
+    dlg->SetPromptL(*prompt);
+    CleanupStack::Pop( dlg ); 
+    CleanupStack::PopAndDestroy(prompt);
+    iDialog = dlg;
+    TRAPD(err,
+        if(dlg->ExecuteLD(R_COMMON_YES_NO_QUERY))
+            {
+            aResponse->SetOkButton(ETrue);
+            }
+        else
+            {
+            aResponse->SetOkButton(EFalse);
+            }
+        )
+    iDialog = NULL;
+    return err;
+    }
+    
+TInt CSenNotPluginDlgImpl::ShowAskSaveDialogL(TAskSaveDlgRequest* /*aRequest*/,
+    TAskSaveDlgResponse* aResponse)
+    {
+    HBufC* prompt = StringLoader::LoadL(R_SENNOTDLG_ASK_SAVE_QUERY);
+    CleanupStack::PushL(prompt);
+    CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+    CleanupStack::PushL( dlg ); 
+    dlg->SetPromptL(*prompt);
+    CleanupStack::Pop( dlg ); 
+    CleanupStack::PopAndDestroy(prompt);
+    iDialog = dlg;
+    TRAPD(err,
+        if(dlg->ExecuteLD(R_COMMON_YES_NO_QUERY))
+            {
+            aResponse->SetOkButton(ETrue);
+            }
+        else
+            {
+            aResponse->SetOkButton(EFalse);
+            }
+        )
+    iDialog = NULL;
+    return err;
+    }
+
+
+void CSenNotPluginDlgImpl::Cleanup()
+    {
+    iMethod = TSenNotPluginRequest::ENoMethod;
+    iCancelled = EFalse;
+#ifdef EKA2    
+    iReplySlot = NULL;
+#else
+    iReplyPtr = NULL;
+#endif    
+    delete iRequest;
+    iRequest = NULL;
+    delete iResponse;
+    iResponse = NULL;
+    }
+
+
+/**
+ * The notifier has been deactivated so resources can be freed and outstanding messages completed.
+ */
+void CSenNotPluginDlgImpl::Cancel()
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::Cancel: Starting ]"));
+
+    if(iMethod == TSenNotPluginRequest::ENoMethod)
+        {
+        DOLOG(_L("[ CSenNotPluginDlgImpl::Cancel: No outstanding request. Freeing resources ]"));
+        Cleanup();
+        }
+    else
+        {
+        if(iDialog)
+            {
+            DOLOG(_L("[ CSenNotPluginDlgImpl::Cancel: dialog is being displayed. Cancelling it ]"));
+/*            if(iMethod == TSenNotPluginRequest::EAuthenticationDlg)
+                {
+                ((CUsernamePasswdDialog*)iDialog)->CancelDialogL(); // Will delete dialog
+                iDialog = NULL; //
+                }
+            else*/
+                {
+                TKeyEvent keyEvent;
+                keyEvent.iCode = EKeyEscape;
+                keyEvent.iScanCode = EStdKeyEscape;
+                keyEvent.iModifiers = EModifierAutorepeatable;
+                keyEvent.iRepeats = 50;
+                TInt leaveCode(KErrNone);
+                TRAP(leaveCode, iDialog->OfferKeyEventL(keyEvent, EEventKey));
+                if (leaveCode != KErrNone) iCancelled = EFalse;
+                }
+
+            DOLOG(_L("[ CSenNotPluginDlgImpl::Cancel: dialog cancel initiated ]"));
+                // Note: Execution will continue in RunL, where cleanup must be performed
+            iCancelled = ETrue;
+            }
+        else
+            {
+            DOLOG(_L("[ CSenNotPluginDlgImpl::Cancel: Pending request, but not executing it. Freeing resource ]"));
+            Cleanup(); // This will effectively cancel asynchronous operation
+            }
+        }
+    }
+
+/**
+ * Update a currently active notifier with data aBuffer.
+ */
+TPtrC8 CSenNotPluginDlgImpl::UpdateL(const TDesC8& /*aBuffer*/)
+    {
+    DOLOG(_L("[ CSenNotPluginDlgImpl::UpdateL ]"));
+    return TPtrC8(NULL, 0);
+    }
+
+#ifdef EKA2
+// ----------------------------------------------------------
+//
+// ECOM 
+//
+// -----------------------------------------------------------
+
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    IMPLEMENTATION_PROXY_ENTRY(0x101F9765,NotifierArray)
+#else
+    IMPLEMENTATION_PROXY_ENTRY(0x101F9744,NotifierArray)
+#endif    
+
+    };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+    return ImplementationTable;
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsnotifierplugins/src/sennotplugindlgmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+//#include <ImplementationProxy.h>
+//#include "SenNotPluginDlgImpl.h"
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/data/101F9759.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 1028 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource definitions for project WSOviPlugin
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9759;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES            
+            interface_uid = 0x101F96F9;
+#else
+	    interface_uid = 0x101F9730;
+#endif
+            implementations = 
+                {
+                // frameworkID = "WS-Ovi"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x2001950F;
+                    version_no         = 1;
+                    display_name       = "Ovi SIF";
+                    default_data       = "com.nokia.ws.ovi.OviFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            },
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Session Handler Interface)
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES  
+            interface_uid = 0x20000392;
+#else
+            interface_uid = 0x10282C5B;
+#endif
+            implementations = 
+                {
+                // Validate Handler
+                IMPLEMENTATION_INFO
+                        {
+                        implementation_uid = 0x20019510;
+                        version_no         = 1;
+                        display_name       = "Ovi Session Handler - Validate";
+                        default_data       = "urn:com.nokia.ws.ovi.handler.validate";
+                        opaque_data        = "";
+                        },
+                // register Handler
+                IMPLEMENTATION_INFO
+                        {
+                        implementation_uid = 0x20019511;
+                        version_no         = 1;
+                        display_name       = "Ovi Session Handler - Register";
+                        default_data       = "urn:com.nokia.ws.ovi.handler.register";
+                        opaque_data        = "";
+                        },
+                // service update Handler
+                IMPLEMENTATION_INFO
+                        {
+                        implementation_uid = 0x20019516;
+                        version_no         = 1;
+                        display_name       = "Ovi Session Handler - Service Update";
+                        default_data       = "urn:com.nokia.ws.ovi.handler.serviceUpdate";
+                        opaque_data        = "";
+                        }
+                };
+            },
+         INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Message Handler Interface)
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES  
+            interface_uid = 0x20000393;
+#else
+	    interface_uid = 0x10282C5C;
+#endif
+            implementations = 
+                {
+                // device handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x20019512;
+                    version_no         = 1;
+                    display_name       = "Ovi Message Handler - Device";
+                    default_data       = "urn:com.nokia.ws.ovi.handler.device";
+                    opaque_data        = "";
+                    },
+                // security handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x20019513;
+                    version_no         = 1;
+                    display_name       = "Ovi Message Handler - Security";
+                    default_data       = "urn:com.nokia.ws.ovi.handler.security";
+                    opaque_data        = "";
+                    },
+                // credential collector handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x20019514;
+                    version_no         = 1;
+                    display_name       = "Ovi Message Handler - Credential Collector";
+                    default_data       = "urn:com.nokia.ws.ovi.handler.credentialCollector";
+                    opaque_data        = "";
+                    },
+                // encoder handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x20019515;
+                    version_no         = 1;
+                    display_name       = "Ovi Message Handler - Encoder";
+                    default_data       = "urn:com.nokia.ws.ovi.handler.encoder";
+                    opaque_data        = "";
+                    }
+                };
+             }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsoviplugin   
+*
+*/
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsoviplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsoviplugin.iby)
+PRJ_MMPFILES
+wsovi.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/group/wsovi.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for wsovi    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      PLUGIN
+
+TARGET          wsovi.dll
+UID             0x10009D8D 0x101F9759
+
+#if !defined ( VID_DEFAULT ) 
+    VENDORID 0x101FB657
+#else
+    VENDORID VID_DEFAULT
+#endif 
+  
+#if !defined ( CAP_ECOM_PLUGIN )
+    CAPABILITY ALL -TCB
+#else
+    CAPABILITY CAP_ECOM_PLUGIN
+#endif
+
+
+SOURCEPATH      ../src
+SOURCE          wsovihandlercontext.cpp
+SOURCE          wsovimessagecontext.cpp
+SOURCE          wsoviplugin.cpp
+SOURCE          wsoviproxy.cpp
+SOURCE          wsoviregisterhandler.cpp
+SOURCE          wsoviservicesession.cpp
+SOURCE          wsovisessionconsumer.cpp
+SOURCE          wsovisessioncontext.cpp
+SOURCE          wsovioauthclient.cpp
+SOURCE          wsovivalidatehandler.cpp
+SOURCE          wsovidevicehandler.cpp
+SOURCE          wsovisecurityhandler.cpp
+SOURCE          wsovicredentialcollectorhandler.cpp
+SOURCE          wsoviencoderhandler.cpp
+SOURCE          wsovitokencreationresponse.cpp
+SOURCE          wsovicredentialobserver.cpp
+SOURCE          wsoviutils.cpp
+SOURCE          wsoviserviceupdatehandler.cpp
+SOURCE 			wsovierrorresponse.cpp
+
+
+SOURCEPATH      ../data
+START RESOURCE    101F9759.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsovi.rsc
+#endif 
+END
+
+MW_LAYER_SYSTEMINCLUDE
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wscore/inc  // SenServiceManagerDefines.h  - IPC enumerations
+USERINCLUDE     ../../wsfragment/inc
+USERINCLUDE     ../../wsframework/inc
+USERINCLUDE     ../../wsmessages/inc
+USERINCLUDE     ../../wsidentitymanager/inc
+USERINCLUDE     ../../wscredentialmanager/inc
+USERINCLUDE     ../../wsdescription/inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wslogger/inc
+
+
+// System libs
+LIBRARY bafl.lib
+LIBRARY charconv.lib
+LIBRARY ecom.lib
+LIBRARY efsrv.lib       //for saving dictionaries
+LIBRARY euser.lib 
+LIBRARY estor.lib 
+LIBRARY ezlib.lib
+LIBRARY flogger.lib
+LIBRARY sysutil.lib
+LIBRARY imut.lib 
+LIBRARY inetprotutil.lib
+LIBRARY hash.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+LIBRARY SenLogger.lib // for TLS based logging
+LIBRARY SenFragment.lib
+LIBRARY SenMessages.lib
+LIBRARY SenXml.lib
+LIBRARY SenUtils.lib
+LIBRARY SenServDesc.lib
+LIBRARY SenServMgr.lib
+LIBRARY SenServConn.lib
+LIBRARY SenFramework.lib
+LIBRARY SenCredentialManager.lib
+#else
+LIBRARY wsLogger.lib // for TLS based logging
+LIBRARY wsFragment.lib
+LIBRARY wsMessages.lib
+LIBRARY wsXml.lib
+LIBRARY wsUtils.lib
+LIBRARY wsServDesc.lib
+LIBRARY wsServMgr.lib
+LIBRARY wsServConn.lib
+LIBRARY wsFramework.lib
+LIBRARY wsCredentialManager.lib
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovicons.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Keep all constanece within WSTar Plugin
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef CONSPLUGIN_H
+#define CONSPLUGIN_H
+
+#include "senpointermap.h"
+#include "SenXmlElement.h"
+
+typedef RSenPointerMap<TDesC8, TInt> RMapInt;
+typedef RSenPointerMap<TDesC8, TDesC8> RMapDescriptors;
+
+namespace WSOviConfig
+    {
+    _LIT8(KFrameworkVersion,      "1.0");
+    _LIT8(KFrameworkXMLNS,        "urn:com.nokia.ws.ovi.config.1.0");
+    _LIT8(KFrameworkCue,          "com.nokia.ws.ovi.OviFramework");
+    _LIT8(KFrameworkLocalName,    "Framework");
+    _LIT8(KHandlerLocalName,      "Handler");
+    _LIT8(KNameAttr,              "name");
+    
+    _LIT8(KClassAttr,              "class");
+    _LIT8(KIMSILocalName,              "IMSI");
+    _LIT8(KIMSIDigestAttr,              "digest");
+    _LIT8(KVersionAttr,              "version");    
+    _LIT8(KRegisterValue,              "urn:com.nokia.ws.ovi.handler.register");
+    _LIT8(KValidateValue,              "urn:com.nokia.ws.ovi.handler.validate");    
+    _LIT8(KDeviceValue,                "urn:com.nokia.ws.ovi.handler.device");
+    _LIT8(KCredentialCollectorValue,   "urn:com.nokia.ws.ovi.handler.credentialCollector");
+    _LIT8(KSecurityValue,              "urn:com.nokia.ws.ovi.handler.security");
+    _LIT8(KEncoderValue,               "urn:com.nokia.ws.ovi.handler.encoder"); 
+    _LIT8(KServiceUpdateValue,         "urn:com.nokia.ws.ovi.handler.serviceUpdate");
+
+    _LIT8(KValidateHandlerVersion,     "http://account.nokia.com/schemas/rest/v1_0");    
+
+    }
+   
+namespace WSOviSession
+    {
+    //in seconds
+    const TInt KCounterMax    = 3;
+    const TInt KMaxHttpTimeOut   = 60;
+        
+    const TInt KSubmitStateOK                         = 1;
+    const TInt KSubmitStateInvalidCredentials        = 2;
+    const TInt KSubmitStateRevalidationAttempted    = 3;
+    _LIT8(KDateHttpHeader, "Date");
+
+
+    _LIT8(KTokenEndpointSuffix, "tokens");
+    }
+namespace OAuth
+    {
+    _LIT8(KUnReserveChars, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~");
+
+    //header
+    _LIT8(KAuthHttpHeader, "Authorization");
+    _LIT8(KComma, ",");
+    _LIT8(KSpace, " ");
+    _LIT8(KQtMark, "\"");
+    _LIT8(KEqual, "=");
+    _LIT8(KAmpMark, "&");
+    _LIT8(KPercent, "%");
+
+    _LIT8(KFormUrlEncoded, "application/x-www-form-urlencoded");
+
+
+    _LIT8(KXmlContentEqual, "XMLContent=");
+
+
+    
+    //##### parameter names
+    //device
+    _LIT8(KParNokiaAuth, "OAuth");      
+    _LIT8(KParVersion, "oauth_version");      
+    _LIT8(KParConsumerKey, "oauth_consumer_key");
+    
+    
+    //credential collector
+    _LIT8(KParToken, "oauth_token");
+    
+    //security
+    _LIT8(KParRealm, "realm");
+    _LIT8(KParSignMethod, "oauth_signature_method");
+    _LIT8(KParTimestamp, "oauth_timestamp");
+    _LIT8(KParSignature, "oauth_signature");
+    _LIT8(KParNonce, "oauth_nonce");
+    _LIT8(KParHttpMethodPost, "POST");
+    _LIT8(KParHttpMethodGet, "GET");
+    _LIT8(KParHttpMethodPut, "PUT");
+    _LIT8(KParHttpMethodDelete, "DELETE");
+    
+    _LIT8(KEndpointKey, "endpoint");
+    
+    _LIT8(KNeedSecurity,"NeedSecurity");
+    //parameter values
+    
+    _LIT8(KParValVersion, "1.0");      
+    _LIT8(KParValHMACSHA, "HMAC-SHA1");
+    _LIT8(KParValRealm, "https://account.nokia.com");
+    
+    
+    //body
+    _LIT8(KCreationRequestFormat8,
+//            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+    		"<tokenCreationRequest xmlns=\"%S\">"
+    		"<digestAuth>"
+    		"<username>%S</username>"
+    		"<nonce>%S</nonce>"
+    		"<created>%S</created>"
+    		"<digest>%S</digest>"
+    		"</digestAuth>"
+/*            "    <scope>\n"
+            "        <resource>\n"
+            "            <type>path</type>\n"
+            "            <id>/accounts/%S/</id>\n"
+            "        </resource>\n"
+            "    </scope>\n"
+*/    		"</tokenCreationRequest>");
+    }    
+namespace WSOviContextKeys
+    {
+    //SESSION KEYS
+    //--keys for discovery phase
+    //-----register handler
+    _LIT8(KRegisterAction,       "action");
+    _LIT8(KServiceDescription,   "serviceDescription");
+    
+    //--keys for validation phase (handler)
+    _LIT8(KServiceSession,       "serviceSession");
+    _LIT8(KRemoteConsumer,       "RemoteConsumer");
+    _LIT8(KReAuthNeeded, "ReAuthNeeded");
+    _LIT8(KRetryNeeded, "Retry");
+
+    _LIT8(KErrMessage, "ErrorMessage");
+ 
+    
+    _LIT8(KMessageBody,"messageBody");
+    _LIT8(KTP,"TP");
+    
+    
+    _LIT8(KTTL,"TTL");
+    _LIT8(KTokenCreationTime,"TokenCreationTime");
+    _LIT8( KTokenSecret, "TokenSecret");
+    _LIT8( KToken, "Token");
+    _LIT8(KOnlySharing,       "OnlySharing");
+    _LIT8(KErrCode,       "ErrorCode");
+    
+   
+    //MARKERS
+    }
+
+namespace WSOviContextValues
+    {
+    //--values for discovery phase
+    //-----register handler
+    _LIT8(KActionRegister,       "register");
+    _LIT8(KActionUnregister,       "unregister");
+    }
+
+namespace WSOviResponse
+	{
+    _LIT8(KTokenTag, "<token>");
+    _LIT8(KTokenTagEnd, "</token>");
+    _LIT8(KTokenLocalName, "token");
+    _LIT8(KTokenSecretTag, "<tokenSecret>");
+    _LIT8(KTokenSecretTagEnd, "</tokenSecret>");
+	_LIT8(KTokenCreationResponseLocalName, "tokenCreationResponse");
+	_LIT8(KTokenSecretLocalName, "tokenSecret");
+	_LIT8(KTTLLocalName, "ttl");
+	_LIT8(KTokenInfoLocalName,"tokenInfo");
+    _LIT8(KErrorNode,                    "error");
+    _LIT8(KErrorCode,                    "errorCode");
+    _LIT8(KErrorText,                    "errorText");
+    _LIT8(KErrorCodeInvalidAccessToken, "invalidAccessToken");
+    _LIT8(KErrorCodeUnauthorized,       "notAuthorized");
+
+    _LIT8(KUserInfoLocalName,"userInfo");
+    _LIT8(KUserNameLocalName,"username");
+	
+	}
+
+#endif // CONSPLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovicredentialcollectorhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOVI_CREDENTIAL_COLLECTOR_HANDLER_H
+#define WSOVI_CREDENTIAL_COLLECTOR_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "wsovimessagecontext.h"
+#include "wsovihandlercontext.h"
+#include "senmessagehandler.h"
+#include "SenSoapMessage.h"
+#include "sendebug.h"
+#include "senserviceinvocationframework.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSOviHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler set mobile ticket in security section in header.
+ */
+class CWSOviCredentialCollectorHandler : public CSenMessageHandler
+    {
+
+public:
+    static CWSOviCredentialCollectorHandler* NewL(TAny* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    virtual TInt InitL(MSenHandlerContext& aCtx);    
+    ~CWSOviCredentialCollectorHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    
+protected:
+    /**
+     * Function:   CWSOviCredentialCollectorHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSOviCredentialCollectorHandler(MSenHandlerContext& aCtx);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+    };
+
+
+#endif // WSOVI_CREDENTIAL_COLLECTOR_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovicredentialobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+#ifndef WSOVICREDENTIALOBSERVER_H
+#define WSOVICREDENTIALOBSERVER_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+#include "wsoviservicesession.h"
+
+class CWSOviCredentialObserver : public CTimer
+{
+public:
+	// Cancel and destroy
+	~CWSOviCredentialObserver();
+
+	// Two-phased constructor.
+	static CWSOviCredentialObserver* NewL(CWSOviServiceSession* aSession, RFileLogger* aLogger);
+
+	// Two-phased constructor.
+	static CWSOviCredentialObserver* NewLC(CWSOviServiceSession* aSession, RFileLogger* aLogger);
+	
+
+	void RunL();
+public: // New functions
+	// Function for making the initial request
+	void Start( const TTimeIntervalSeconds& aDiff);//const TTime &aTime);
+	RFileLogger* Log() const;
+private:
+	// C++ constructor
+	CWSOviCredentialObserver(CWSOviServiceSession* aSession, RFileLogger* aLogger);
+	void StartCount();
+
+	// Second-phase constructor
+	void ConstructL();
+
+
+private:
+	TBool	iRunned;		// State of the active object
+         CWSOviServiceSession* iSession;//not owned
+         RFileLogger* iLogger; //not owned
+         TInt64 iRestTime;
+};
+
+#endif // WSOVICREDENTIALOBSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovidevicehandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef WSOVI_ENVELOPER_HANDLER_H
+#define WSOVI_ENVELOPER_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "wsovimessagecontext.h"
+#include "wsovihandlercontext.h"
+#include "senmessagehandler.h"
+#include "sendebug.h"
+#include "senserviceinvocationframework.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSOviHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler creates proper Envelope based on provided policy (by message context)
+ */
+class CWSOviDeviceHandler : public CSenMessageHandler
+    {
+
+public:
+    static CWSOviDeviceHandler* NewL(TAny* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    ~CWSOviDeviceHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+    
+        
+protected:
+    /**
+     * Function:   CWSOviDeviceHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSOviDeviceHandler(MSenHandlerContext& aCtx);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private:
+
+    HBufC8* iNAuthVersion;
+    };
+
+#endif // WSOVI_ENVELOPER_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsoviencoderhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOVI_ENCODER_HANDLER_H
+#define WSOVI_ENCODER_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "wsovimessagecontext.h"
+#include "wsovihandlercontext.h"
+#include "senmessagehandler.h"
+#include "SenSoapMessage.h"
+#include "sendebug.h"
+#include "senserviceinvocationframework.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSOviHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler set mobile ticket in security section in header.
+ */
+class CWSOviEncoderHandler : public CSenMessageHandler
+    {
+
+public:
+    static CWSOviEncoderHandler* NewL(TAny* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    virtual TInt InitL(MSenHandlerContext& aCtx);    
+    ~CWSOviEncoderHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    
+protected:
+    /**
+     * Function:   CWSOviEncoderHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSOviEncoderHandler(MSenHandlerContext& aCtx);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+    };
+
+
+#endif // WSOVI_ENCODER_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovierrorresponse.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOVIERRORRESPONSE_H_
+#define WSOVIERRORRESPONSE_H_
+
+#include <SenBaseFragment.h>
+
+
+
+class CWSOviErrorResponse : public CSenBaseFragment
+{
+public:
+    static CWSOviErrorResponse* NewL();
+    static CWSOviErrorResponse* NewLC();
+    
+    TPtrC8 Code();
+    
+    TPtrC8 Text();
+
+private:
+// From CBaseFragment
+virtual void StartElementL(const TDesC8& aNsUri,
+                           const TDesC8& aLocalName,
+                           const TDesC8& aQName,
+                           const RAttributeArray& aAttributes);
+
+virtual void EndElementL(const TDesC8& aNsUri,
+                         const TDesC8& aLocalName,
+                         const TDesC8& aQName);
+public:
+	virtual ~CWSOviErrorResponse();
+	
+protected:
+	CWSOviErrorResponse();
+
+	void ConstructL();
+private:
+	HBufC8* iCode;
+    HBufC8* iText;
+
+};
+
+#endif /*WSOVIErrorRESPONSE_H_*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovihandlercontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSOvi_HANDLER_VALIDATE_CONTEXT_H
+#define WSOvi_HANDLER_VALIDATE_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "msenhandlercontext.h"
+
+// CONSTANTS
+namespace HandlerContextKey
+    {
+    _LIT8(KSIF,         "SIF");
+    _LIT8(KLogger,      "Logger");
+    _LIT8(KVersion,     "version");
+    _LIT8(KDiff,		"diff");
+    }
+
+// FORWARD DECLARATIONS
+class CWSOviPlugin;
+
+/**
+ * Class:       
+ */
+class CWSOviHandlerContext : public CBase, public MSenHandlerContext
+    {
+    public:
+        static CWSOviHandlerContext* NewL();
+        ~CWSOviHandlerContext();
+
+        //from HandlerContext    
+        virtual TInt Add(MSenCoreServiceManager& aValue);
+        virtual MSenCoreServiceManager* GetSenCoreServiceManager();
+            
+        //from MContext    
+        virtual SenContext::TContextType Type() const;        
+        virtual SenContext::TContextDirection Direction() const;
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) ;
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) ;
+        virtual TAny* GetAnyL(const TDesC8& aKey);		//codescannerwarnings
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Remove(const TDesC8& aKey);         
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset() ;
+        
+        inline virtual TInt SetDirection( SenContext::TContextDirection /* aDirection */ ) { return KErrNotSupported; } // not implemented
+
+            
+    protected:
+        /**
+         * Function:   CWSOviHandlerContext
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSOviHandlerContext();
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+            
+    private://data
+        MSenCoreServiceManager* iCoreServiceManager;
+        CWSOviPlugin* iWSOviPlugin;
+        RFileLogger* iLogger;
+        HBufC8* iVersion;//owned
+        TInt* iDiff;     //owned
+    };
+
+
+#endif // WSOvi_HANDLER_VALIDATE_CONTEXT_H
+
+
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovimessagecontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+ 
+
+#ifndef WSOvi_HANDLER_MESSAGE_CONTEXT_H
+#define WSOvi_HANDLER_MESSAGE_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "msenmessagecontext.h"
+#include "wsovicons.h"
+#include <SenTransportProperties.h>
+
+
+// FORWARD DECLARATIONS
+class CWSOviSessionContext;
+class CSenChunk;
+
+/**
+ * Class:       
+ */
+class CWSOviMessageContext : public CBase, public MSenMessageContext
+    {
+
+    public:
+        static CWSOviMessageContext* NewL(SenContext::TContextDirection aDirection);
+        static CWSOviMessageContext* NewLC(SenContext::TContextDirection aDirection);
+        static CWSOviMessageContext* NewLC(SenContext::TContextDirection aDirection,
+                CWSOviSessionContext& aSessionContext);
+        ~CWSOviMessageContext();
+
+
+        
+        //From MessageContext
+        virtual CSenSoapMessage* GetCurrentSoapMessage();
+        virtual TPtrC8 GetMessageL();
+        virtual TInt Add(const TDesC8& aKey, CSenSoapEnvelope* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenSoapEnvelope* aValue);
+        virtual const CSenSoapEnvelope* GetSenSoapEnvelopeL(const TDesC8& aKey);
+            
+            
+        //From MContext    
+        virtual SenContext::TContextType Type() const;        
+        virtual SenContext::TContextDirection Direction() const;
+
+        //Desc handling methods do not take ownership. but create new object from passed value
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Remove(const TDesC8& aKey);
+
+        //Int handling methods do not take ownership. but create new object from passed value
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+
+
+        //Element handling methods - ownership is transfered
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) ;
+
+        //These are NOT supported:
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) ;
+        virtual TAny* GetAnyL(const TDesC8& aKey);
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset();
+        virtual MSenMessage* MessageL();
+        virtual TInt SetMessage(MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual TInt SetProperties(MSenProperties* apOwnedTransportProperties, TBool aOwned = ETrue);
+        virtual MSenProperties* Properties();
+        virtual TInt Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual TInt Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual MSenMessage* GetMessageL(const TDesC8& aKey);
+        virtual CSenChunk* CWSOviMessageContext::ChunkL();
+        virtual TInt SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned = ETrue);
+        virtual TInt SetDirection(SenContext::TContextDirection aDirection);
+        
+        
+        
+
+        /**
+         * Update message context from session context.
+         *  If resending occurs we need copy again already cached info.
+         *
+         * @since S60 5.0
+         */
+        void UpdateFromSessionContextL(CWSOviSessionContext& aSessionContext);
+
+        
+        /**
+        *   no onwership taken
+        *   no copy is maked
+        */
+        TInt UpdateTP(CSenTransportProperties*& aTP);
+        
+        
+        /**
+        *   no onwership returned
+        *   no copy is maked
+        */
+        
+        CSenTransportProperties* TP();
+        
+        /**
+        *   no onwership returned
+        *   no copy is maked
+        */
+        RMapDescriptors& OAuthProperies();
+        
+    protected:
+        /**
+         * Function:   CWSOviMessageContext
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSOviMessageContext(SenContext::TContextDirection aDirection);
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        void ConstructL(CWSOviSessionContext& aSessionContext);
+        
+    private:
+        void UpdateIntL(CWSOviSessionContext& aSessionContext, const TDesC8& aKey);
+        void UpdateDesC8L(CWSOviSessionContext& aSessionContext, const TDesC8& aKey);
+
+        SenContext::TContextDirection iDirection;
+        RMapDescriptors iDescs;
+        RMapDescriptors iOAuthProperties;
+        RMapInt         iInts;
+        CSenTransportProperties* iTP;//not owned
+    };
+
+
+#endif // WSOvi_HANDLER_MESSAGE_CONTEXT_H
+
+
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovioauthclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef Authentication_CLIENT_H
+#define Authentication_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include <e32math.h>
+
+#include "seninternalserviceconsumer.h"
+#include "SenXmlElement.h"
+#include "sentransportbase.h"
+#include "wsovihandlercontext.h"
+
+// FORWARD DECLARATIONS
+class CWSOviServiceSession;
+
+/**
+ * Class: CWSOviOAuthClient
+ *
+ * Description: Consumer which communicate with real NAUTH.
+ * Client will try obtain credentail based on WS-Authentication specification.
+ */
+class CWSOviOAuthClient : public CSenInternalServiceConsumer
+    {
+public: // Constructors and destructor
+
+    /**
+    * Standard 2 phase constructor
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of Authentication client
+    */
+    static CWSOviOAuthClient* NewL(    CSIF& aSIF);
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of Authentication client which is pushed into CleanupStack
+    */
+    static CWSOviOAuthClient* NewLC(CSIF& aSIF);
+
+    /**
+    * Normal destructor. Destroy NAUTH session.
+    */
+    ~CWSOviOAuthClient();
+    
+    
+    /**
+    * The most siginificant method of this class. Make validation of session, 
+    *   credentails obtained if needed.
+    * @param aSession session which is validated
+    * @param aRemoteConsumer consumer of validated session, holds transport entryPoint
+    */
+    TInt ValidateL(CWSOviServiceSession& aSession, 
+                   HBufC8*& aErrorMessage,
+                   TBool aOnlySharing );
+    
+
+    void SetStatus(TInt aStatus);
+    /**
+    * Sets identyProvider for Authentication client
+    * @param aIdentityProvider identity provider representation of NAUTH
+    */
+    void SetAccount(CSenIdentityProvider* aIdentityProvicer);
+    
+//-----derived from CSenWSDescription, 
+    //in fact we expose info from NAUTHsession which is holded by that client.
+    // Method have to overwrited becouse of core, which use those methods during registering
+    TPtrC8 Endpoint();
+    TPtrC8 Contract();
+    TPtrC8 ProviderID();
+    TPtrC8 FrameworkId();
+    MSenServicePolicy* ServicePolicy();
+    TInt IapId(TUint32& aCurrentIapId);
+    void WriteAsXMLToL(RWriteStream& aWriteStream);
+    
+    /**
+    * Getter for validate session (not NAUTH session)
+    */
+    virtual CSenServiceSession* ServiceSession();
+    
+    /**
+    * Getter for transport (used coreManger as Factory for transport)
+    */
+    virtual MSenTransport& TransportL();
+    
+    /**
+    *   Sets NAUTH session, used during registering NAUTH which is not initiated. 
+    *   Clear NAUTHsession will be created and assign during registering.
+    * @param aSession - clear NAUTH session assign to this Authentication clint
+    */
+    void SetAuthSessionL(CWSOviServiceSession* aSession);                    
+    
+    void SetHandlerCtx(MSenHandlerContext* aHndCtx);
+    
+    TBool HasSuperClass( TDescriptionClassType aType );
+    void CreateBodyL(const TDesC8& aXmlNs, const TDesC8& aUsername, const TDesC8& aPassword, const TDesC8& aCreated);
+        
+protected://methods
+    
+    /**
+    * C++ default constructor.
+    */
+    CWSOviOAuthClient(    CSIF& aSIF,
+                                    TDescriptionClassType aType);
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void BaseConstructL();
+    // from MSenServiceDescription
+    virtual TBool Matches(MSenServiceDescription& aPattern);
+
+    
+    
+
+private: //methods
+    
+    // Add ProviderID to primary keys (in addition to Endpoint, Contract and FrameworkID):
+    TBool HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate); 
+    
+private: // Data
+    CWSOviServiceSession* iWSOviServiceSession;   // Not owned, session which we validate
+    CWSOviServiceSession* iAuthSession;             //auth session, owned
+    
+    CSenIdentityProvider* iIdentityProvider; // Not owned, comes from validation phase
+    
+    CSenTransportBase* ipTransport;//now owned, ownership moved to validated session
+    MSenHandlerContext* iHndCtx; //not owned
+    HBufC8* iBody;
+    TTime iDiff;
+
+};
+
+#endif // Authentication_CLIENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsoviplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,305 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef WSOvi_PLUGIN_H
+#define WSOvi_PLUGIN_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+
+#include "senserviceinvocationframework.h" // internal Framework\inc
+
+#include "wsovicons.h"
+#include "sensessionhandler.h"
+#include "senmessagehandler.h"
+#include "wsovihandlercontext.h"
+#include "wsovisessioncontext.h"
+#include "wsovimessagecontext.h"
+#include "SenSoapMessage.h"
+#include "SenXmlConstants.h"    
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, TDesC8> RMapHandlers;
+/**
+ * WSOvi Plugin framework.
+ * An implementation of the CSIF definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSOviPlugin : public CSIF
+    {
+    public:
+        /**
+         * Function:    NewL
+         *
+         * Description: Create instance of concrete implementation. Note that ECOM
+         *              interface implementations can only have two signatures for
+         *              NewL:
+         *               - NewL without parameters (used here)
+         *               - NewL with TAny* pointer, which may provide some client
+         *                 data
+         *
+         * @return    Instance of this class.
+         *
+         * Note:       The interface, which is abstract base class of this
+         *             implementation, also provides NewL method. Normally abstract
+         *             classes do not provide NewL, because they cannot create
+         *             instances of themselves.
+         * @since S60 5.0
+         */
+        static CWSOviPlugin* NewL(TAny* aManager);
+
+
+    public: 
+
+        /**
+         * Return a system wide unique string to identify this framework
+         *
+         * @return TDesC8 that uniquely identifies this framework.
+         * @since S60 5.0
+         */
+        virtual const TDesC8& Id();
+
+        /**
+         * Try to find one or more session services that match the given
+         * ServiceDescription.If not finded new session is created and added into
+         * coreManager
+         * Return the number of ServiceDescriptions that were added.
+         *
+         * @param   aPattern - A ServiceDescriptin that should be treated as a
+         *          pattern
+         * @param    aRemoteConsumer - the consumer sending the request
+         * @param    aErrorMsg - in case that return value is negative, this may contain
+         *           error as descriptor (SOAP Fault etc)
+         * @return (TInt) count of matching ServiceDescriptions that were added or error
+         * @since S60 5.0
+         */
+        virtual TInt AddServiceDescriptionL( MSenServiceDescription& aPattern, 
+                                             MSenRemoteServiceConsumer& aRemoteConsumer,
+                                             HBufC8*& aErrorMsg ); 
+
+        /**
+         * Attempt to register the ServiceDescription. 
+         *   In fact session is created but not vaidated and added into CoreManager.
+         *   So registering different to adding that it doesnt validate, just register.
+         *   Common issue is increase core database by one session (validated or not)
+         * @param aServiceDescription A ServiceDescription
+         *
+         * @return TInt aError - indicates the error or KErrNone if successful
+         * @since S60 5.0
+         */
+        virtual TInt RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription);
+
+
+        /**
+         * Attempt to unregister the ServiceDescription from the ServiceManager
+         * that owns the framework.
+         * This is a callback used by the ServiceManager.
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         * @return TInt aError - indicates the error or KErrNone if successful
+         * @since S60 5.0
+         */
+        virtual TInt UnregisterServiceDescriptionL(
+                                    MSenServiceDescription& aServiceDescription);
+
+        /**
+         * Create a ServiceSession based upon the given ServiceDescription.
+         * The ServiceSession is expected to be "valid", i.e. ready for use
+         * by a client.
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         * @param aNewSession (CSenServiceSession)
+         *
+         * @return TInt error or KErrNone if successful
+         * @since S60 5.0
+         */
+        virtual TInt CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                            MSenServiceDescription& aPattern,
+                                            CSenServiceSession*& aNewSession,
+                                            MSenRemoteServiceConsumer& aRemoteConsumer,
+                                            HBufC8*& /* aErrorMsg */ );
+
+        /**
+         * Return a new instance of a framework specific class that
+         * implements the ServiceDesccription interface.
+         *
+         * @param new service description 
+         *        (which typically derives from CSenServiceSession)
+         *
+         * @return TInt error or KErrNone if successful
+         * @since S60 5.0
+         */
+        virtual CSenWSDescription* NewServiceDescriptionL();
+
+        /**
+         * Return the ServiceManager for which this instance is working.
+         * This is used by the ServiceSession instances created by this framework.
+         *
+         * Note, in Sen, MSenCoreServiceManager IS SINGLETON(!), so all Frameworks
+         * return their "owner" - that is - the only service manager in
+         * Sen Framework
+         *
+         * @return (MSenCoreServiceManager)
+         * @since S60 5.0
+         */
+        virtual MSenCoreServiceManager& Manager();
+
+
+        /**
+         * Set the ServiceManager to which this instance reports.
+         * The (singleton) ServiceManager calls this method when
+         * it instantiates a framework.
+         *
+         * @param aServiceManager The singleton ServiceManager in the system.
+         * @since S60 5.0
+         */
+        virtual void SetManager(MSenCoreServiceManager& aServiceManager);
+
+
+        /**
+         * Return an object that can do SAX based parsing of a XML fragment
+         * that contains framework specific configuration information.
+         * The ServiceManager asks for this BaseFragment upon startup
+         * in order to give this framework a chance to read its configuration
+         * information from the central ServiceManager configuration document.
+         *
+         * @return (CSenBaseFragment)
+         * @since S60 5.0
+         */
+        virtual CSenBaseFragment& ConfigParser();
+
+        /**
+         * Read the ServiceInvocationFramework configuration.
+         * This method is invoked by the ServiceManager when it read config.
+         * @since S60 5.0
+         */
+        virtual void StartElementL(const TDesC8& aNsUri,
+                              const TDesC8& aLocalName,
+                              const TDesC8& aQName,
+                              const RAttributeArray& aAttrs);
+
+        /**
+         * Read the ServiceInvocationFramework configuration.
+         * This method is invoked by the ServiceManager when it read config.
+         * @since S60 5.0
+         */
+        virtual void EndElementL(const TDesC8& aNsUri,
+                              const TDesC8& aLocalName,
+                              const TDesC8& aQName);
+
+    //derived from SenBaseFragment
+        virtual HBufC8* AsXmlL();
+        virtual HBufC* AsXmlUnicodeL();
+
+    //derived from SIF
+        virtual TInt OnEvent(const TInt aEvent,
+                            TAny* /* aArgument */);
+        virtual TAny* ExtendedInterface();
+
+        virtual TInt SetTransportPropertiesL(MSenTransport& /* aTransport */);
+
+
+    //----------------------Outbound direction
+        /**
+        * Function:   temporary. Call in proper order session handlers during validation phase
+        * @return number of added descriptions into coreManager or error
+        * @since S60 5.0
+        */
+        TInt ProcessOutboundValidationL( MSenServiceDescription& aPattern, 
+                                         MSenRemoteServiceSession* aRemoteServiceSession,
+                                         HBufC8*& aErrorMessage );
+        /**
+        * Function:   temporary. Call in proper order message handlers during outbound message phase
+        * @return symbian error
+        * @since S60 5.0
+        */
+        TInt ProcessOutboundMessageL( CWSOviMessageContext*& aMsgCtx);
+
+    //----------------------Inbound direction    
+        /**
+        * Function:   temporary. Call in proper order message handlers during inbound message phase
+        * @return symbian error
+        * @since S60 5.0
+        */
+        TInt ProcessInboundMessageL( );
+
+        /**
+        * Function:   temporary. Call in proper order session handlers during inbound dispatch phase
+        * @return symbian error
+        * @since S60 5.0
+        */
+        TInt ProcessInboundDispatchL( MSenRemoteServiceSession* aRemoteServiceSession,
+                                      const TInt aErrorCode,
+                                      HBufC8* aMessage,
+                                      MSenProperties* aResponseTransportProperties);
+
+        //----------------------temporary methods 
+        //  (till moment when engine with handlers will be available)
+        
+        MSenHandler* Handler(const TDesC8& aCue);
+        TBool IsTrustedClient(MSenRemoteServiceConsumer& aRemoteConsumer);
+        
+    public: // destructor
+        virtual ~CWSOviPlugin();
+
+    protected:
+        /**
+         * Function:   CSenWsiPlugin
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSOviPlugin(MSenCoreServiceManager& aManager);
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        
+    private:
+        void AddHandlerTag(TPtr8& aXml, const TDesC8& aHandlerClassName);
+        void AddHandlerL(const TDesC8& aHandlerClassName, const TDesC8& aVersion, SenHandler::THandlerType aType);
+        void RemoveHandler(const TDesC8& aCue);
+        void VerifyPermissionOnEachSessionL();
+                
+    private: // data
+        MSenCoreServiceManager& iManager;
+        //mesg handlers has to be separate to session handlers (separate table) becouse common handlerBase 
+        //  doesnt have name method
+        RPointerArray<CSenMessageHandler> iMsgHandlers;
+        RPointerArray<CSenSessionHandler> iSessionHandlers;
+        RSenPointerMap<TDesC8, TDesC8> iVersions;
+        RPointerArray<CWSOviHandlerContext> iHandlerContexts;
+        RBuf8 iIMSI;
+    };
+
+
+#endif // WSOvi_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsoviregisterhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOvi_REGISTER_HANDLER_H
+#define WSOvi_REGISTER_HANDLER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsovihandlercontext.h"
+#include "wsovisessioncontext.h"
+#include "wsovicons.h"
+#include "wsoviservicesession.h"
+#include "SenServiceConnection.h"
+
+
+/**
+ * Class:CWSOviRegisterHandler
+ *
+ * An implementation of the CWSOviSessionHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ *
+ * Class represent phase related to session, before discovering and validation.
+ *      Main goal is to indirectly implement (by passing session context) SIF method:
+ *          -registegr/unregister service description
+ */
+class CWSOviRegisterHandler : public CSenSessionHandler
+    {
+
+    public:
+        /**
+         * Function:    NewL
+         *
+         * Description: Create instance of concrete implementation. Note that ECOM
+         *              interface implementations can only have two signatures for
+         *              NewL:
+         *               - NewL without parameters (used here)
+         *               - NewL with TAny* pointer, which may provide some client
+         *                 data
+         *
+         * Returns:    Instance of this class.
+         *
+         * Note:       The interface, which is abstract base class of this
+         *             implementation, also provides NewL method. Normally abstract
+         *             classes do not provide NewL, because they cannot create
+         *             instances of themselves.
+         */
+
+        static CWSOviRegisterHandler* NewL(TAny* aHandlerCtx);
+        virtual TInt InvokeL(MSenSessionContext& aCtx);
+        ~CWSOviRegisterHandler();
+        
+        virtual SenHandler::THandlerDirection Direction() const;
+        virtual SenHandler::THandlerPhase Phase();
+        virtual TInt InitL(MSenHandlerContext& aCtx);
+        
+            
+    protected:
+        /**
+         * Function:   CWSOviRegisterHandler
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSOviRegisterHandler(MSenHandlerContext& aCtx);
+        
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+
+
+    private:
+        /**
+         * Attempt to register the ServiceDescription. 
+         *   In fact session is created but not vaidated and added into CoreManager.
+         *   So registering different to adding that it doesnt validate, just register.
+         *   Common issue is increase core database by one session (validated or not)
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         *  return TInt aError - indicates the error or KErrNone if successful
+         */
+        virtual TInt RegisterServiceDescriptionL(
+                                    MSenServiceDescription& aServiceDescription);
+
+
+        /**
+         * Attempt to unregister the ServiceDescription from the ServiceManager
+         * that owns the framework.
+         * This is a callback used by the ServiceManager.
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         *  return TInt aError - indicates the error or KErrNone if successful
+         */
+        virtual TInt UnregisterServiceDescriptionL(
+                                    MSenServiceDescription& aServiceDescription);
+
+        /**
+         * Register specific description (NAUTH contract)
+         */
+        TInt RegisterAuthClientL(MSenServiceDescription *aServiceDescription);
+        
+        /**
+         * Unregister specific description (NAUTH contract)
+         */
+        TInt UnRegisterAuthClientL(MSenServiceDescription* aServiceDescription);
+    };
+
+
+#endif // WSOvi_HANDLER_REGISTER_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovisecurityhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOVI_SECURITY_HANDLER_H
+#define WSOVI_SECURITY_HANDLER_H
+
+#include <e32std.h>
+
+#include "senmessagehandler.h"
+#include "senserviceinvocationframework.h"
+
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSOviHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler sign NAuth message.
+ */
+ 
+class CWSOviSecurityHandler : public CSenMessageHandler
+    {
+
+typedef RArray<TXmlEngElement> RArrayElements;
+
+public:
+    static CWSOviSecurityHandler* NewL(MSenHandlerContext* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    virtual TInt InitL(MSenHandlerContext& aCtx);    
+    ~CWSOviSecurityHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+private:
+    /**
+     * Function:   CWSOviSecurityHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSOviSecurityHandler(MSenHandlerContext& aCtx);
+    TTime iDiff;
+    };
+
+
+#endif // WSOVI_SECURITY_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsoviservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,253 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOVI_SERVICE_SESSION_H
+#define WSOVI_SERVICE_SESSION_H
+
+// INCLUDES
+#include "msenremoteserviceconsumer.h"
+#include "msenserviceinvocationframework.h"
+
+#include "wsoviplugin.h"
+#include "senwebservicesession.h"
+#include "wsovisessionconsumer.h"
+#include <xmlengfilecontainer.h>
+#include <xmlengchunkcontainer.h>
+#include <xmlengelement.h>
+
+class CWSOviCredentialObserver;
+class CSenHttpTransportProperties;
+
+// CONSTANTS
+namespace WSOviSession
+    {
+    _LIT8(KProviderIDTag,                  "<ProviderID>");
+    _LIT8(KProviderIDEndTag,               "</ProviderID>");
+    _LIT8(KTrustAnchorTag,                 "<TrustAnchor>");
+    _LIT8(KTrustAnchorEndTag,              "</TrustAnchor>");
+    _LIT8(KTrustAnchorElementLocalName,  "TrustAnchor");
+    _LIT8(KTokenCreationTimeTag,         "<TokenCreationTime>");
+    _LIT8(KTokenCreationTimeEndTag,      "</TokenCreationTime>");
+    _LIT8(KTokenCreationTimeLocalName,   "TokenCreationTime");
+    _LIT8(KTTLTag,                 		 "<TTL>");
+    _LIT8(KTTLEndTag,                    "</TTL>");
+    _LIT8(KTTLLocalName,                 "TTL");
+    _LIT8(KTokenSecretTag,               "<TokenSecret>");
+    _LIT8(KTokenSecretEndTag,            "</TokenSecret>");
+    _LIT8(KTokenSecretLocalName,         "TokenSecret");
+    
+    }
+
+
+
+// CLASS DECLARATION
+/**
+ * WSOvi Service Session.
+ * Represent session between client and service in ws* framework.
+ */
+class CWSOviServiceSession : public CSenWebServiceSession
+    {
+
+friend class CWSOviPlugin;
+
+public: // Constructors and destructor
+
+    static CWSOviServiceSession* NewL(MSIF& aFramework);
+    static CWSOviServiceSession* NewLC(MSIF& aFramework);
+
+    virtual ~CWSOviServiceSession();
+
+    // From SenServiceSession
+    virtual MSenRemoteServiceConsumer* RemoteConsumerL(
+                                                const TDesC8& aSenderID);
+    
+    virtual TBool Matches(MSenServiceDescription& aPattern);
+    virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
+    
+    virtual void WriteExtensionsAsXMLToL(RWriteStream& aWriteStream);
+
+
+    //From SenWebServiceSession
+    virtual TInt SendL( const TDesC8& aMessage, 
+                        const TDesC8& aTransportProperties,
+                        MSenRemoteServiceConsumer& aConsumer,
+                        TInt& aTxnId,
+                        HBufC8*& aRevalidationError );
+                        
+    virtual TInt SubmitL(const TDesC8& aMessage, 
+                         const TDesC8& aTransportProperties,
+                         MSenRemoteServiceConsumer& aConsumer,
+                         HBufC8*& aResponse);
+
+    virtual TInt SubmitSoapL(const TDesC8& aSoapMessage, 
+                             const TDesC8& aTransportProperties,
+                             MSenRemoteServiceConsumer& aConsumer,
+                             HBufC8*& aResponse);
+
+    virtual TInt SendSoapL( const TDesC8& aSoapMessage, 
+                            const TDesC8& aTransportProperties,
+                            MSenRemoteServiceConsumer& aConsumer,
+                            TInt& aTxnId,
+                            HBufC8*& aRevalidationError );
+    
+    
+    virtual TInt SendErrorToConsumerL( const TInt aErrorCode,
+                                       HBufC8* apError,
+                                       const TInt aTxnId,
+                                       MSenRemoteServiceConsumer& aConsumer,
+                                       MSenProperties* aResponseTransportProperties );
+    virtual TInt SendToConsumerL(HBufC8* aMessage,
+                              const TInt aTxnId,
+                              MSenRemoteServiceConsumer& aConsumer,
+                              MSenProperties* aResponseTransportProperties = NULL);
+                              
+    virtual TInt InitializeFromL(MSenServiceDescription& aDescription);
+
+
+    
+    /**
+    add consumer. Eeach session has multiple consumers.From 3rd parties point of view
+    its mean 2 connection per the same service description.
+    */
+    virtual TInt AddConsumerL(MSenRemoteServiceConsumer& aConsumer);
+    
+    /**
+    remove consumer
+    */
+    virtual TInt RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer);
+    
+    /**
+    Framework specific method. Process message before sending to network
+            In other words add specific headers, and store correlation info in proper consumer
+    */
+    virtual TInt MessageForSendingL( CSenHttpTransportProperties*& aTP,
+                                     const TDesC8& aSenderID);
+
+    virtual TInt SetTransportPropertiesL( const TDesC8& aProperties,
+                                          MSenRemoteServiceConsumer& aConsumer );
+    virtual TBool IsExpiredL();
+    /**
+     * Clear credential for current session , make it invalid.
+     * @since S60 5.0
+     */
+    void ClearCredentialL();
+    
+    //GData token has undefined life time, threfore default FOREVER life time is set
+    void SetMaxValidUntil();
+    
+    
+    
+    
+    /**
+    * Overload addcredential from WebServiceSession. Calucate also state, 
+    * @since S60 4.0
+    */
+    void AddCredentialL(const TDesC8& aSecurity, TTime aValidUntil);
+    void AddCredentialL(RSenCredentialPtr aCredentialPtr, TTime aValidUntil);
+    void SetProviderIDL(const TDesC8& aProviderId);
+    TPtrC8 ProviderID();
+    void SetTrustAnchorL(const TDesC8& aURI);
+    TPtrC8 TrustAnchor();
+    TInt ComputeStatusL();
+    void SetSessionContext(CWSOviSessionContext* aContext);
+    CWSOviSessionContext* SessionContext();
+    
+    void AddSecurityTokenToContextL();
+
+    void AddPropertiesFromSessionContextToCredentialL();
+    
+    virtual void CredentialChanged(TSenCredentialChange aChange, TAny* aPointer);
+    TInt RevalidateMobileTicketIfExpiredL(HBufC8*& aErrorMessage);
+    TBool ExistConsumerL();
+
+    // Add ProviderID to primary keys (in addition to Endpoint, Contract and FrameworkID):
+    TBool HasEqualPrimaryKeysL( MSenServiceDescription& aCandidate ); 
+    
+    void ActiveTicketObserverL();
+    TInt ShareTokenWithL( CWSOviServiceSession* aWSStarSessionDst);
+
+private: 
+       
+    /**
+    * C++ default constructor.
+    */
+    CWSOviServiceSession(TDescriptionClassType aType, MSIF& aFramework);
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+    
+    // New functions
+    
+    
+    /**
+    * To obtain consumer during processing INBOUND. We have to dispatch using wsa:RelatesTo
+    */
+    TInt SessionConsumerL(CWSOviMessageContext*& aMessage,
+                          CWSOviSessionConsumer*& aSessionConsumer);
+    
+    /**
+    * To obtain consumer during processing OUTBOUND.
+    */
+    TInt SessionConsumerL( const TDesC8& aSenderID, CWSOviSessionConsumer*& aSessionConsumer);
+    void CreateAndParseSoapMessageL(const TDesC8& aSoapMessage, CSenSoapMessage*& aMessage, HBufC8*& aBody);
+    CSenHttpTransportProperties* ApplyTransportPropertiesLC(const TDesC8& aTransportProperties);
+    void PrepareOutCtxL(const TDesC8& aMessageBody);
+    void DestroyOutCtx();
+    TBool HasSuperClass( TDescriptionClassType aType );
+    TBool AmIHostletSession();
+    virtual void FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier);
+    
+    CSenIdentityProvider* LookupIdentityProviderL();
+    void VerifyPermissionL();
+    void ClearCredentialPropertiesFromContext();
+    TInt CanHandleErrorL();
+    void AdaptEndpointL(TBool aToOrginal);
+    CSenIdentityProvider* IdentityProviderFromCoreL(const TDesC8& aProviderID);
+    
+//Data
+    
+    CWSOviMessageContext* iOutContext;//owned, live only within one sending
+    CWSOviMessageContext* iInContext;//owned, live only within one sending
+    CWSOviSessionContext* iSessionContext;//owned
+
+    CWSOviCredentialObserver* iTokenObs;
+    
+    //trust anchor is a pointer to providerID.
+    HBufC8* iTrustAnchor;
+    TInt iSubmitState;
+    TInt iRenewCounter;
+    TInt iRetryCounter;
+    HBufC8* iProviderID;
+    HBufC8* iTransProp;
+    TTime iClientTime; 
+    TTime iServerTime;
+    HBufC8* iOrginalEndpoint;
+    };
+    
+#endif // WSOvi_SERVICE_SESSION_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsoviserviceupdatehandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOvi_SU_HANDLER_H
+#define WSOvi_SU_HANDLER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsovihandlercontext.h"
+#include "wsovisessioncontext.h"
+#include "wsovicons.h"
+#include "wsoviservicesession.h"
+
+
+/**
+ * Class:CWSOviServiceUpdateHandler
+ *
+ * An implementation of the CWSOviSessionHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ *
+ * Class represent phase related to session, before discovering and validation.
+ *      Main goal is to indirectly implement (by passing session context) SIF method:
+ *          -registegr/unregister service description
+ */
+class CWSOviServiceUpdateHandler : public CSenSessionHandler
+    {
+
+    public:
+        /**
+         * Function:    NewL
+         *
+         * Description: Create instance of concrete implementation. Note that ECOM
+         *              interface implementations can only have two signatures for
+         *              NewL:
+         *               - NewL without parameters (used here)
+         *               - NewL with TAny* pointer, which may provide some client
+         *                 data
+         *
+         * Returns:    Instance of this class.
+         *
+         * Note:       The interface, which is abstract base class of this
+         *             implementation, also provides NewL method. Normally abstract
+         *             classes do not provide NewL, because they cannot create
+         *             instances of themselves.
+         */
+
+        static CWSOviServiceUpdateHandler* NewL(TAny* aHandlerCtx);
+        virtual TInt InvokeL(MSenSessionContext& aCtx);
+        ~CWSOviServiceUpdateHandler();
+        
+        virtual SenHandler::THandlerDirection Direction() const;
+        virtual SenHandler::THandlerPhase Phase();
+        virtual TInt InitL(MSenHandlerContext& aCtx);
+        
+            
+    protected:
+        /**
+         * Function:   CWSOviServiceUpdateHandler
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSOviServiceUpdateHandler(MSenHandlerContext& aCtx);
+        
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+
+
+    private:
+    };
+
+
+#endif // WSOvi_SU_HANDLER_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovisessionconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSOvi_SESSION_CONSUMER_H
+#define WSOvi_SESSION_CONSUMER_H
+
+// INCLUDES
+#include <e32base.h>
+#include "msenremoteserviceconsumer.h"
+#include "senpointermap.h"
+#include "SenSoapMessage.h"
+#include "wsovimessagecontext.h"
+
+
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, HBufC8> RSentMessagesPointerMap;
+
+
+// FORWARD DECLARATIONS
+class RFileLogger;
+class CSenHttpTransportProperties;
+
+
+// CLASS DECLARATION
+/*
+    Its wrapper for remote consumer. In the same time it inherits from remote consumer. Why?
+    Because we can not cast inside framework pluging to our WSOvi session a remote consumer, 
+    which was created in core
+    
+    Object can ot be extended to more complex class. Can be cast to narrow class, but not in other way
+*/
+class CWSOviSessionConsumer : public CBase, public MSenRemoteServiceConsumer
+    {
+public: // Constructors and destructor
+    
+    static CWSOviSessionConsumer* NewL(MSenRemoteServiceConsumer& aServiceConsumer);
+
+    static CWSOviSessionConsumer* NewLC(MSenRemoteServiceConsumer& aServiceConsumer);
+
+    virtual ~CWSOviSessionConsumer();
+ // From MSenRemoteServiceConsumer:
+    TInt HandleMessageL(HBufC8* aMessage,
+                        const TInt aTxnId,
+                        MSenProperties* aResponseTransportProperties);
+
+    TInt HandleErrorL(HBufC8* aError,
+                      const TInt aErrorCode,
+                      const TInt aTxnId,
+                      MSenProperties* aResponseTransportProperties);
+
+    void SetStatusL(const TInt status);
+
+
+
+    TInt MessageForSendingL(CSenHttpTransportProperties*& aTP,
+                            CWSOviMessageContext*& aCtx);
+// New functions
+
+    const TDesC8& Id() const;
+    TInt SetSessionL(MSenRemoteServiceSession& iServiceSession);
+
+    CSenIdentifier& Identifier() const;
+    const TDesC8& TransportProperties(const TDesC8& aMessageID) const;
+    MSenTransport& TransportL();
+    virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
+    virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress);    
+    TBool HasAuthenticationCallback();
+	TInt ReauthenticationNeededL(CSenIdentityProvider*& aIdp);
+
+	virtual void SetDataTrafficDetails(TSenDataTrafficDetails& aDetails) ;
+
+private: 
+
+    /**
+    * C++ default constructor.
+    */
+    CWSOviSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer);
+    
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+
+
+
+private: // Data
+    MSenRemoteServiceConsumer& iConsumer;
+    RSentMessagesPointerMap iSentMessages; // owned
+    RMapDescriptors         iSendReplyTo; // owned
+    RMapDescriptors iTranspProp;
+    };
+    
+#endif // WSOvi_SESSION_CONSUMER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovisessioncontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSOvi_HANDLER_SESSION_CONTEXT_H
+#define WSOvi_HANDLER_SESSION_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "msensessioncontext.h"
+#include "MSenServiceDescription.h"
+#include "msenmessagecontext.h"
+#include "msenremoteserviceconsumer.h"
+#include "wsovicons.h"
+#include "wsovimessagecontext.h"
+
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, CSenWSDescription> RContextMapDescription;
+
+
+// FORWARD DECLARATIONS
+class MSenRemoteServiceSession;
+class CSenWSDescription;
+class CWSOviServiceSession;
+
+/**
+ * Implement Session Context.       
+ */
+class CWSOviSessionContext : public CBase, public MSenSessionContext
+    {
+
+    public:
+        static CWSOviSessionContext* NewL();
+        static CWSOviSessionContext* NewLC();
+        ~CWSOviSessionContext();
+
+        //from SessionContext    
+        virtual const CSenWSDescription* GetSession();
+        virtual const CSenWSDescription* GetInitializer();
+        
+        virtual TInt                             Add(const TDesC8& aKey, CSenWSDescription* aValue);
+        virtual TInt                             Update(const TDesC8& aKey, CSenWSDescription* aValue);
+        virtual const CSenWSDescription* GetSenWSDescriptionL(const TDesC8& aKey);
+
+        //in fact, now relation between session and sessionCtx is 1 to 1, so no need for map & keys    
+        virtual TInt                            Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue); // protected context    
+        virtual TInt                            Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue);
+        virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey);    
+        
+        //from MContext    
+        virtual SenContext::TContextType Type() const;        
+        virtual SenContext::TContextDirection Direction() const;
+        //desc - ownership transfered
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Remove(const TDesC8& aKey);
+
+        //Int handling methods doesnt take ownership. but create new object from passed value
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) ;
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) ;
+        virtual TAny* GetAnyL(const TDesC8& aKey);
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset() ;
+        
+        inline virtual TInt SetDirection( SenContext::TContextDirection /* aDirection */ ) { return KErrNotSupported; } // not implemented
+
+        // New methods
+        TInt SetTokenKeysL(const TDesC8& aToken);
+        /**
+         * Update session context after incoming message
+         *
+         * @since S60 5.0
+         */
+        void UpdateFromMessageInContextL(CWSOviMessageContext& aMessageContext);
+        
+        /**
+         * Update session context after outgoing message has been prepared, 
+         *  to check which elements has been consumed.
+         *
+         * @since S60 5.0
+         */
+        void UpdateFromMessageOutContextL(CWSOviMessageContext& aMessageContext);
+        
+        TInt ShareTokenWithL(CWSOviSessionContext* aWSOviSessionCtxDst);        
+    private:
+        void UpdateDesC8L(CWSOviMessageContext& aMessageContext, const TDesC8& aKey);
+        
+        
+    protected:
+        /**
+         * Function:   CWSOviSessionContext
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSOviSessionContext();
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        
+    private:
+        MSenRemoteServiceConsumer* iRemoteServiceConsumer;
+        MSenRemoteServiceSession* iSession;//nbot owned, session keeped by DAO
+        RContextMapDescription iDescriptions;
+        RMapInt                iInts;
+        RMapDescriptors         iDescs;
+        TAny*                       ipConsumer; // not owned
+        TAny*                       iTP; // not owned
+    };
+
+#endif // WSOvi_HANDLER_SESSION_CONTEXT_H
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovitokencreationresponse.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOVITOKENCREATIONRESPONSE_H_
+#define WSOVITOKENCREATIONRESPONSE_H_
+
+#include <SenBaseFragment.h>
+#include "uri8.h"
+
+
+const TInt KStateParsingTokenInfo = 100;
+const TInt KStateParsingUserInfo = 102;
+
+class CWSOviTokenCreationResponse : public CSenBaseFragment
+{
+public:
+/**
+ * Function:    NewL
+ *
+ * Description: Create instance of concrete implementation. Note that ECOM
+ *              interface implementations can only have two signatures for
+ *              NewL:
+ *               - NewL without parameters (used here)
+ *               - NewL with TAny* pointer, which may provide some client
+ *                 data
+ *
+ * Returns:    Instance of this class.
+ *
+ * Note:       The interface, which is abstract base class of this
+ *             implementation, also provides NewL method. Normally abstract
+ *             classes do not provide NewL, because they cannot create
+ *             instances of themselves.
+ */
+static CWSOviTokenCreationResponse* NewL();
+static CWSOviTokenCreationResponse* NewLC();
+
+/**
+* Getter for token
+* @return token
+*/
+TPtrC8 Token();
+
+/**
+* Getter for tokenSecret
+* @return tokenSecret
+*/
+TPtrC8 TokenSecret();
+
+/**
+* Getter for ttl
+* @return ttl
+*/
+TPtrC8 TTL();
+
+/**
+* Getter for username
+* @return username
+*/
+TPtrC8 Username();
+
+
+TBool IsTokenUpdate();
+private:
+// From CBaseFragment
+virtual void StartElementL(const TDesC8& aNsUri,
+                           const TDesC8& aLocalName,
+                           const TDesC8& aQName,
+                           const RAttributeArray& aAttributes);
+
+virtual void EndElementL(const TDesC8& aNsUri,
+                         const TDesC8& aLocalName,
+                         const TDesC8& aQName);
+public:
+	virtual ~CWSOviTokenCreationResponse();
+	
+protected:
+	CWSOviTokenCreationResponse();
+
+	void ConstructL();
+private:
+	HBufC8* iToken;
+    HBufC8* iTokenSecret;
+	HBufC8* iTTL;
+	HBufC8* iUsername;
+	TBool iIsTokenUpdate;
+
+};
+
+#endif /*WSOVITOKENCREATIONRESPONSE_H_*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsoviutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef WSOVIUTILS_H
+#define WSOVIUTILS_H
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+// CONSTANTS
+const TInt KHexWidth = 2;
+const TInt KCharWidth = 1;
+const TInt KSpaceChar = 32;
+
+// FORWARD DECLARATIONS
+class CMD5;
+//class RMapDescriptors;
+
+// CLASS DECLARATION
+class CWSOviUtils : public CBase
+    {
+    public:
+                
+        // New functions
+		static HBufC8* NormalizeStringLC(const TDesC8& aMethod, const TDesC8& aUrl, const TDesC8& aHeader );
+		static HBufC8* DigestAuthStringL(const TDesC8& aNonce, const TDesC8& aTimestamp, const TDesC8& aUser, const TDesC8& aPassword);
+        static HBufC8* EncodeCharsLC(const TDesC8& aString);
+        static HBufC8* FormEncodeCharsLC(const TDesC8& aString);
+
+    private:
+
+		~CWSOviUtils();       
+        // New functions
+        static TInt CountCharsToEncode(const TDesC8& aString);
+        
+    private: // Data
+    
+
+    };
+
+#endif // WSOVIUTILS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/inc/wsovivalidatehandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSOviPub_VALIDATE_HANDLER_H
+#define WSOviPub_VALIDATE_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsovihandlercontext.h"
+#include "wsovisessioncontext.h"
+#include "SenIdentityProvider.h"
+#include "wsovioauthclient.h"
+#include "wsovicons.h"
+#include "wsoviservicesession.h"
+
+
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSOviHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSOviValidateHandler : public CSenSessionHandler
+    {
+
+public:
+
+
+   /**
+    * Function:    NewL
+    *
+    * Description: Create instance of concrete implementation. Note that ECOM
+    *              interface implementations can only have two signatures for
+    *              NewL:
+    *               - NewL without parameters (used here)
+    *               - NewL with TAny* pointer, which may provide some client
+    *                 data
+    *
+    * Returns:    Instance of this class.
+    *
+    * Note:       The interface, which is abstract base class of this
+    *             implementation, also provides NewL method. Normally abstract
+    *             classes do not provide NewL, because they cannot create
+    *             instances of themselves.
+    */
+    static CWSOviValidateHandler* NewL(TAny* aHandlerCtx);
+
+    /**
+    * InvokeL is the most emergent method in message handler interface.
+    * Each sub-class must implement this method thus providing message
+    * processing routine.
+    * @param aCtx is the session context that will be accessed and 
+    * typically altered by implemented handler, in order to provide
+    * modifications on the layer of the session construction, validation,
+    * or some other, focused area that the handler was intended to take
+    * responsibility for. For example, certain handler can itself create
+    * a session of its own, send message(s) to (authentication) service
+    * (invoking other handlers), and finally access session context in 
+    * order to update credentials. 
+    */
+    virtual TInt InvokeL(MSenSessionContext& aCtx);
+    ~CWSOviValidateHandler();
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+    RFileLogger* Log() const;
+    MSenHandlerContext& HandlerContext();    
+protected:
+    /**
+     * Function:   CWSOviValidateHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSOviValidateHandler(MSenHandlerContext& aCtx);
+    
+    /**
+    * Obtain or construct a valid SecurityTokenServiceClient. Ask
+    * owned ServiceManager for ServiceDescriptions that match
+    * Authentication server contract & ProviderID.
+    *
+    * @param providerID
+    * @return SecurityTokenServiceClient
+    */
+    CWSOviOAuthClient* AuthClientL(CSenIdentityProvider*& aIdentityProvider);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private:
+    /**
+     * Function:   IdentityProviderFromCoreL
+     *
+     * Discussion: copmplex getter. It asking core for IdentitProvider by using a pattern.
+     */
+    
+    CSenIdentityProvider* IdentityProviderFromCoreL(const TDesC8& aProviderID);
+    const TDesC8* iVersion;
+    };
+
+
+#endif // WSOvi_VALIDATE_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/rom/wsoviplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSOVIPLUGIN_IBY__
+#define __WSOVIPLUGIN_IBY__
+
+//WSOVI.DLL
+#ifdef FF_WS_NCIM 
+ECOM_PLUGIN(wsovi.dll, wsovi.rsc)
+#endif //FF_WS_NCIM
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovicredentialcollectorhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "wsovicredentialcollectorhandler.h"
+#include "senlogger.h"
+#include <SenDateUtils.h>
+using namespace OAuth;
+using namespace WSOviResponse;
+// Create instance of concrete ECOM interface implementation
+CWSOviCredentialCollectorHandler* CWSOviCredentialCollectorHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSOviCredentialCollectorHandler* self = 
+            new(ELeave)CWSOviCredentialCollectorHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSOviCredentialCollectorHandler::CWSOviCredentialCollectorHandler(MSenHandlerContext& aCtx)
+:CSenMessageHandler(aCtx)
+    {
+    }
+
+// Destructor
+CWSOviCredentialCollectorHandler::~CWSOviCredentialCollectorHandler()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviCredentialCollectorHandler::\
+                         ~CWSOviCredentialCollectorHandler()")));
+    }
+
+// Second phase construction.
+void CWSOviCredentialCollectorHandler::ConstructL()
+    {
+    }
+    
+TInt CWSOviCredentialCollectorHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviCredentialCollectorHandler::InvokeL(MSenMessageContext& aCtx)")));
+    
+    const TDesC8* token = aCtx.GetDesC8L(WSOviContextKeys::KToken());
+    if (token && aCtx.Direction()==SenContext::EOutgoing)
+        {
+        TPtrC8 tokenPtr(token->Mid(KTokenTag().Length()));
+        tokenPtr.Set(tokenPtr.Left(tokenPtr.Length() - KTokenTagEnd().Length()));
+        
+        RMapDescriptors& headerProperties = ((CWSOviMessageContext&)aCtx).OAuthProperies();
+        headerProperties.Insert(&KParToken, tokenPtr.AllocL());    
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviCredentialCollectorHandler::InvokeL\
+                                (MSenMessageContext& aCtx) -  \
+                                Token added to OAuth parameters")));
+        ((CWSOviMessageContext&)aCtx).Update(WSOviContextKeys::KToken(), tokenPtr);
+        return KErrNone;                                
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviCredentialCollectorHandler::InvokeL\
+                                (MSenMessageContext& aCtx) -  \
+                                Token in message context not exists")));
+        return KErrNotFound;
+        }
+    }
+
+TInt CWSOviCredentialCollectorHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+    
+SenHandler::THandlerDirection CWSOviCredentialCollectorHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviCredentialCollectorHandler::Direction()")));
+    return SenHandler::EOutgoing;
+    };
+SenHandler::THandlerPhase CWSOviCredentialCollectorHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviCredentialCollectorHandler::Phase()")));
+    return SenHandler::EMessage;
+    };    
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovicredentialobserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "sendebug.h"
+#include "senlogger.h"
+#include "wsovicredentialobserver.h"
+
+
+const TInt64 KHalfHour = 1000000 *60*30; //2;//30;  2 minutes instead 30
+const TInt64 KSecond = 1000000;
+CWSOviCredentialObserver::CWSOviCredentialObserver(CWSOviServiceSession* aSession, RFileLogger* aLogger) : CTimer( EPriorityStandard )// Standard priority
+	{
+    iSession = aSession;
+    iLogger = aLogger; 
+	}
+
+CWSOviCredentialObserver* CWSOviCredentialObserver::NewLC(CWSOviServiceSession* aSession, RFileLogger* aLogger)
+	{
+	CWSOviCredentialObserver* self = new ( ELeave ) CWSOviCredentialObserver(aSession, aLogger);
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+
+CWSOviCredentialObserver* CWSOviCredentialObserver::NewL(CWSOviServiceSession* aSession, RFileLogger* aLogger)
+	{
+	CWSOviCredentialObserver* self = CWSOviCredentialObserver::NewLC(aSession, aLogger);
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+
+void CWSOviCredentialObserver::ConstructL()
+{
+	CTimer::ConstructL() ;	// Initialize timer
+	CActiveScheduler::Add( this );				// Add to scheduler
+    iRunned = EFalse;
+}
+
+CWSOviCredentialObserver::~CWSOviCredentialObserver()
+{
+    //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CWSStarCredentialObserver::~ - ");   
+	Cancel(); // Cancel any request, if outstanding
+	//TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"                        - cancelled");   
+	
+}
+
+//void CWSStarCredentialObserver::Start(const TTime &aTime)
+void CWSOviCredentialObserver::Start(const TTimeIntervalSeconds& aDiff) 
+{
+    if (iRunned)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCredentialObserver::Start - cancelled");
+        //TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CWSStarCredentialObserver::Start - cancelled");   
+        Cancel();
+        }
+        
+    iRestTime = aDiff.Int()*KSecond;
+    StartCount();
+    iRunned = ETrue;
+}
+void CWSOviCredentialObserver::StartCount() 
+{
+    if (iRestTime > KHalfHour) 
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCredentialObserver::start - START only half hour");
+        //TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel, _L8("CWSStarCredentialObserver::start - START only half hour  = %Ld microsec"), KHalfHour));
+        After((TInt)KHalfHour);
+        iRestTime = iRestTime - KHalfHour;
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCredentialObserver::start - START rest");
+        //TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel, _L8("CWSStarCredentialObserver::start - START rest = %Ld microsec"), iRestTime));
+        After((TInt)iRestTime);
+        iRestTime = 0;
+        }
+}
+
+
+void CWSOviCredentialObserver::RunL()
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCredentialObserver::RunL");
+    if (!iRestTime )
+        {
+        iRunned = EFalse;
+        HBufC8* error(NULL);
+        iSession->SessionContext()->Update(WSOviContextKeys::KOnlySharing, EFalse); 
+        //iSession->SessionContext()->Update(WSStarContextKeys::KReAuthNeededFromCredObserv, ETrue);
+        TInt retVal = iSession->RevalidateMobileTicketIfExpiredL( error );
+        //iSession->SessionContext()->Update(WSStarContextKeys::KReAuthNeededFromCredObserv, EFalse);
+        delete error;
+        error = NULL;    
+        }
+    else
+        {
+        StartCount();
+        }
+}
+
+RFileLogger* CWSOviCredentialObserver::Log() const
+    {
+    return iLogger;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovidevicehandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "wsovidevicehandler.h"
+#include "senlogger.h"
+#include <SenTransportProperties.h>
+using namespace OAuth;
+// Create instance of concrete ECOM interface implementation
+CWSOviDeviceHandler* CWSOviDeviceHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSOviDeviceHandler* self   = new (ELeave) CWSOviDeviceHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSOviDeviceHandler::CWSOviDeviceHandler(MSenHandlerContext& aCtx):CSenMessageHandler(aCtx)
+    {
+    }
+
+// Destructor
+CWSOviDeviceHandler::~CWSOviDeviceHandler()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviDeviceHandler::~CWSOviDeviceHandler()")));
+    delete iNAuthVersion;
+    }
+
+// Second phase construction.
+void CWSOviDeviceHandler::ConstructL()
+    {
+    }
+    
+TInt CWSOviDeviceHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+        TInt error(KErrNone);
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviDeviceHandler::InvokeL(MSenMessageContext& aCtx)")));
+        CSenTransportProperties* tp = ((CWSOviMessageContext&)aCtx).TP();
+        if (!tp) return KErrNotFound;
+        TPtrC8 consumerKey;
+        error = tp->PropertyL(KNCIMConsumerKeyId, consumerKey);		
+        
+        const TDesC8* nAuthVersion = iHandlerContext.GetDesC8L(HandlerContextKey::KVersion);
+        
+        if (!iNAuthVersion)
+            {
+            if ( !nAuthVersion || *nAuthVersion == KNullDesC8() )
+                {
+                iNAuthVersion = KParValVersion().AllocL();
+                }
+            else
+                {
+                iNAuthVersion = nAuthVersion->AllocL();
+                }
+            }
+        
+        HBufC8* value = HBufC8::NewLC(KParNokiaAuth().Length() +
+        							  KSpace().Length() +
+        							  
+        							  KParRealm().Length() +
+ 				                      KEqual().Length() + KQtMark().Length() +
+ 				                      KParValRealm().Length() +
+				                      KQtMark().Length() + KComma().Length() +
+                                      
+                                      KParVersion().Length() + 
+                                      KEqual().Length() + 2*KQtMark().Length() + 
+                                      iNAuthVersion->Length() + KComma().Length() +
+                                        
+                                      KParConsumerKey().Length() + 
+                                      KEqual().Length() + 2*KQtMark().Length() + 
+                                      consumerKey.Length()
+                                        
+                                        
+                                      );
+        
+        
+        //Authorization: OAuth,oauth_version="1.0"
+        value->Des().Append(KParNokiaAuth());
+        value->Des().Append(KSpace());
+       
+        value->Des().Append(KParRealm());
+        value->Des().Append(KEqual());
+        value->Des().Append(KQtMark());
+        value->Des().Append(KParValRealm);
+        value->Des().Append(KQtMark());
+        value->Des().Append(KComma());
+
+        value->Des().Append(KParConsumerKey());
+        value->Des().Append(KEqual());
+        value->Des().Append(KQtMark());
+        value->Des().Append(consumerKey);
+        value->Des().Append(KQtMark());
+        value->Des().Append(KComma());
+        
+        
+        value->Des().Append(KParVersion());
+        value->Des().Append(KEqual());
+        value->Des().Append(KQtMark());
+        value->Des().Append(*iNAuthVersion);
+        value->Des().Append(KQtMark());
+     
+        tp->SetPropertyL(KAuthHttpHeader, *value, KHttpHeaderType);
+        CleanupStack::PopAndDestroy(value);
+
+        RMapDescriptors& headerProperties = ((CWSOviMessageContext&)aCtx).OAuthProperies();
+        HBufC8* newValue = NULL;
+		newValue = iNAuthVersion->AllocL();
+        headerProperties.Insert(&KParVersion, newValue);
+
+        //msg context keeps same tp, so we dont have to update msg context
+        return KErrNone;
+    }
+    
+SenHandler::THandlerDirection CWSOviDeviceHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviDeviceHandler::Direction()")));
+    return SenHandler::EOutgoing;
+    };
+SenHandler::THandlerPhase CWSOviDeviceHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviDeviceHandler::Phase()")));
+    return SenHandler::EMessage;
+    };    
+    
+TInt CWSOviDeviceHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviencoderhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "wsoviencoderhandler.h"
+#include "senlogger.h"
+#include "wsoviutils.h"
+#include <SenHttpTransportProperties.h>
+using namespace OAuth;
+using namespace WSOviResponse;
+// Create instance of concrete ECOM interface implementation
+CWSOviEncoderHandler* CWSOviEncoderHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSOviEncoderHandler* self = 
+            new(ELeave)CWSOviEncoderHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSOviEncoderHandler::CWSOviEncoderHandler(MSenHandlerContext& aCtx)
+:CSenMessageHandler(aCtx)
+    {
+    }
+
+// Destructor
+CWSOviEncoderHandler::~CWSOviEncoderHandler()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviEncoderHandler::\
+                         ~CWSOviEncoderHandler()")));
+    }
+
+// Second phase construction.
+void CWSOviEncoderHandler::ConstructL()
+    {
+    }
+    
+TInt CWSOviEncoderHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviEncoderHandler::InvokeL(MSenMessageContext& aCtx)")));
+    
+    const TDesC8* bodyMessage = ((CWSOviMessageContext&)aCtx).GetDesC8L(WSOviContextKeys::KMessageBody);
+
+    if (bodyMessage)
+        {
+        CSenTransportProperties* transProp = ((CWSOviMessageContext&)aCtx).TP();
+        CSenHttpTransportProperties::TSenHttpMethod httpMethod = CSenHttpTransportProperties::ESenHttpPost;
+        TInt retVal = ((CSenHttpTransportProperties*)transProp)->HttpMethodL(httpMethod);
+        if (httpMethod == CSenHttpTransportProperties::ESenHttpGet)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviEncoderHandler::InvokeL\
+                                    (MSenMessageContext& aCtx) -  \
+                                    body is not encoding with GET method for http")));
+            return KErrNone;
+            }
+
+        HBufC8* bodyEncodedUrl = CWSOviUtils::FormEncodeCharsLC(*bodyMessage);
+        HBufC8* allBody = HBufC8::NewL(KXmlContentEqual().Length()+bodyEncodedUrl->Length());
+        allBody->Des().Append(KXmlContentEqual());
+        allBody->Des().Append(*bodyEncodedUrl);
+        CleanupStack::PushL(allBody);
+        
+        ((CWSOviMessageContext&)aCtx).Update(WSOviContextKeys::KMessageBody, *allBody);
+        
+        CleanupStack::PopAndDestroy(allBody);
+        CleanupStack::PopAndDestroy(bodyEncodedUrl);
+        return KErrNone;
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviEncoderHandler::InvokeL\
+                                (MSenMessageContext& aCtx) -  \
+                                body message context not exists")));
+        return KErrNotFound;
+        }
+    }
+
+TInt CWSOviEncoderHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+    
+SenHandler::THandlerDirection CWSOviEncoderHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviEncoderHandler::Direction()")));
+    return SenHandler::EOutgoing;
+    };
+SenHandler::THandlerPhase CWSOviEncoderHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviEncoderHandler::Phase()")));
+    return SenHandler::EMessage;
+    };    
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovierrorresponse.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsovierrorresponse.h"
+#include "wsovicons.h"
+
+using namespace WSOviResponse;
+CWSOviErrorResponse* CWSOviErrorResponse::NewL()
+    {
+    CWSOviErrorResponse* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSOviErrorResponse* CWSOviErrorResponse::NewLC()
+    {
+    CWSOviErrorResponse* self = new (ELeave) CWSOviErrorResponse();
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    return self;
+    }
+// Second phase construction.
+void CWSOviErrorResponse::ConstructL()
+    {
+        CSenBaseFragment::BaseConstructL(TPtrC8(NULL,0),
+                KErrorNode);
+    }
+
+void CWSOviErrorResponse::StartElementL(const TDesC8& /*aNsUri*/,
+                               const TDesC8& aLocalName,
+                               const TDesC8& /*aQName*/,
+                               const RAttributeArray& /*aAttributes*/)
+    {
+       if ((aLocalName == KErrorCode) ||
+           (aLocalName == KErrorText))
+        	{
+        	iState = KStateSave;
+        	}
+    }                       
+    
+void CWSOviErrorResponse::EndElementL(const TDesC8& /*aNsUri*/,
+                             const TDesC8& aLocalName,
+                             const TDesC8& /*aQName*/)
+    {
+    TPtrC8 content = Content();
+    if (iState == KStateSave)
+        {
+    	if (aLocalName == KErrorCode)
+            {
+            iCode = HBufC8::NewL(content.Length());
+            iCode->Des().Append(content);
+            ResetContentL();
+            iState = KStateIgnore;
+            }
+    	else if (aLocalName == KErrorText)
+            {
+            iText = HBufC8::NewL(content.Length());
+            iText->Des().Append(content);
+            ResetContentL();
+            iState = KStateIgnore;
+            }
+        }
+    }
+
+
+CWSOviErrorResponse::CWSOviErrorResponse()
+	{
+	}
+
+CWSOviErrorResponse::~CWSOviErrorResponse()
+	{
+	delete iCode;
+	delete iText;
+	}
+
+TPtrC8 CWSOviErrorResponse::Code()
+    {
+    if (iCode)
+        {
+        return *iCode;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+
+TPtrC8 CWSOviErrorResponse::Text()
+    {
+    if (iText)
+        {
+        return *iText;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovihandlercontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsovihandlercontext.h"
+CWSOviHandlerContext* CWSOviHandlerContext::NewL()
+    {
+    CWSOviHandlerContext* self = new (ELeave) CWSOviHandlerContext();
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSOviHandlerContext::CWSOviHandlerContext():
+    iCoreServiceManager(NULL),
+    iWSOviPlugin(NULL),
+    iLogger(NULL)
+    {
+    }
+
+// Constructor
+void CWSOviHandlerContext::ConstructL()
+    {
+    }
+
+
+// Destructor
+CWSOviHandlerContext::~CWSOviHandlerContext()
+    {
+    delete iVersion;
+    delete iDiff;
+    }
+
+//from HandlerContext        
+TInt CWSOviHandlerContext::Add(MSenCoreServiceManager& aValue)
+    {
+    iCoreServiceManager = &aValue;
+    return KErrNone;
+    }
+
+MSenCoreServiceManager* CWSOviHandlerContext::GetSenCoreServiceManager()
+    {
+    return iCoreServiceManager;
+    }
+
+
+
+//from MContext      
+SenContext::TContextType CWSOviHandlerContext::Type() const
+    {
+    return SenContext::EHandlerContext;
+    }
+SenContext::TContextDirection CWSOviHandlerContext::Direction() const
+    {
+    return SenContext::EBoth;
+    }
+TInt CWSOviHandlerContext::Add(const TDesC8& /*aKey*/, const TDesC8& /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSOviHandlerContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    TInt retVal(KErrNone);
+    //version with makeing of copy
+    if (aKey == HandlerContextKey::KVersion)
+        {
+        delete iVersion;
+        iVersion = NULL;
+        TRAP(retVal,iVersion = aValue.AllocL());
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+    return retVal;    
+    }
+const TDesC8* CWSOviHandlerContext::GetDesC8L(const TDesC8& aKey)
+    {
+    if (aKey == HandlerContextKey::KVersion)
+        {
+        return iVersion;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+TInt CWSOviHandlerContext::Add(const TDesC8& /*aKey*/, TInt /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSOviHandlerContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    TInt retVal(KErrNone);
+    //version with makeing of copy
+    if (aKey == HandlerContextKey::KDiff)
+        {
+        delete iDiff;
+        iDiff = new TInt(aValue);
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+    return retVal;    
+    }
+const TInt* CWSOviHandlerContext::GetIntL(const TDesC8& aKey)
+    {
+    if (aKey == HandlerContextKey::KDiff)
+        {
+        return iDiff;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+TInt CWSOviHandlerContext::Add(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSOviHandlerContext::Update(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+const CSenElement* CWSOviHandlerContext::GetSenElementL(const TDesC8& /*aKey*/)
+    {
+    return NULL;
+    }
+TInt CWSOviHandlerContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    if (aKey == HandlerContextKey::KSIF())
+        {
+        iWSOviPlugin = (CWSOviPlugin*)aValue;
+        return KErrNone;
+        }
+    else if (aKey == HandlerContextKey::KLogger())
+        {
+        iLogger = (RFileLogger*)aValue;
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+TInt CWSOviHandlerContext::Update(const TDesC8& /*aKey*/, TAny* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TAny* CWSOviHandlerContext::GetAnyL(const TDesC8& aKey)
+    {
+     if (aKey == HandlerContextKey::KSIF())
+        {
+        return (TAny*)iWSOviPlugin;
+        }
+     else if (aKey == HandlerContextKey::KLogger())
+        {
+        return (TAny*)iLogger;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+const CSenXmlReader* CWSOviHandlerContext::GetParser()
+    {
+    return NULL;
+    }
+TInt CWSOviHandlerContext::Remove(const TDesC8& /*aKey*/)  
+    {
+    return KErrNotSupported;
+    }
+TInt CWSOviHandlerContext::Count() const
+    {
+    return KErrNotSupported;
+    }
+TPtrC8 CWSOviHandlerContext::KeyAtL(TInt /*aIndex*/)   
+    {
+    return KNullDesC8();
+    }
+void CWSOviHandlerContext::Reset() 
+    {
+    }
+    
+   
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovimessagecontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,361 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "SenSoapEnvelope.h"
+#include "wsovimessagecontext.h"
+#include "wsovisessioncontext.h"
+#include "SenXmlReader.h"
+
+
+CWSOviMessageContext* CWSOviMessageContext::NewL(SenContext::TContextDirection aDirection)
+    {
+    CWSOviMessageContext* self = NewLC(aDirection);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSOviMessageContext* CWSOviMessageContext::NewLC(SenContext::TContextDirection aDirection)
+    {
+    CWSOviMessageContext* self = new (ELeave) CWSOviMessageContext(aDirection);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    return self;
+    }
+
+CWSOviMessageContext* CWSOviMessageContext::NewLC(
+        SenContext::TContextDirection aDirection,
+        CWSOviSessionContext& aSessionContext)
+    {
+    CWSOviMessageContext* self =
+            new (ELeave) CWSOviMessageContext(aDirection);
+    CleanupStack::PushL (self);
+    self->ConstructL(aSessionContext);
+    return self;
+    }
+
+// Constructor
+CWSOviMessageContext::CWSOviMessageContext(SenContext::TContextDirection aDirection)
+    :iDirection(aDirection),
+    iDescs(EFalse, ETrue),
+    iOAuthProperties(EFalse, ETrue),
+    iInts(EFalse, ETrue)
+    {
+    }
+
+// Constructor
+void CWSOviMessageContext::ConstructL()
+    {
+    }
+
+void CWSOviMessageContext::ConstructL(CWSOviSessionContext& aSessionContext)
+    {
+    UpdateFromSessionContextL(aSessionContext);
+    }
+
+// Destructor
+CWSOviMessageContext::~CWSOviMessageContext()
+    {
+    iDescs.Reset();
+    iInts.Reset();
+    iOAuthProperties.Reset();
+    }
+    
+//from SessionContext 
+
+CSenSoapMessage* CWSOviMessageContext::GetCurrentSoapMessage()
+    {
+    return NULL;
+    };
+TPtrC8 CWSOviMessageContext::GetMessageL()
+    {
+    return KNullDesC8();
+    };
+void CWSOviMessageContext::UpdateDesC8L(CWSOviSessionContext& aSessionContext, const TDesC8& aKey)
+    {
+    const TDesC8* ptr =
+            aSessionContext.GetDesC8L(aKey);
+    if (ptr && !GetDesC8L(aKey))
+        {
+        User::LeaveIfError(Update(aKey, *ptr));
+        }
+    }
+void CWSOviMessageContext::UpdateIntL(CWSOviSessionContext& aSessionContext, const TDesC8& aKey)
+    {
+    const TInt* ptr =
+            aSessionContext.GetIntL(aKey);
+    if (ptr &&!GetIntL(aKey))
+        {
+        User::LeaveIfError(Update(aKey, *ptr));    
+        } 
+    }
+    
+void CWSOviMessageContext::UpdateFromSessionContextL(
+        CWSOviSessionContext& aSessionContext)
+    {
+    //because of resending, we need keep message specific info within session ctx
+    // (see ASYNC handleerror)
+    if (Direction() == SenContext::EOutgoing)
+        {
+        UpdateDesC8L(aSessionContext, WSOviContextKeys::KToken);
+        UpdateDesC8L(aSessionContext, WSOviContextKeys::KTokenSecret);
+        UpdateIntL(aSessionContext, WSOviContextKeys::KRetryNeeded);
+        }
+    }
+
+TInt CWSOviMessageContext::Add(const TDesC8& /*aKey*/, CSenSoapEnvelope* /*aValue*/)
+    {
+    return KErrNotSupported;
+    };
+TInt CWSOviMessageContext::Update(const TDesC8& /*aKey*/, CSenSoapEnvelope* /*aValue*/)
+    {
+    return KErrNotSupported;
+    };
+const CSenSoapEnvelope* CWSOviMessageContext::GetSenSoapEnvelopeL(const TDesC8& /*aKey*/)
+    {
+    return NULL;
+    };
+
+
+
+//from MContext       
+SenContext::TContextType CWSOviMessageContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+    
+SenContext::TContextDirection CWSOviMessageContext::Direction() const
+    {
+    return iDirection;
+    }
+const CSenXmlReader* CWSOviMessageContext::GetParser()
+    {
+    return NULL;
+    }
+
+//-----------------descs        
+TInt CWSOviMessageContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    if (!aValue.Length()) return KErrUnderflow;
+    HBufC8* newValue = NULL;
+    TInt error(KErrNone);
+    TRAP(error, newValue = aValue.AllocL());
+    if (!error)
+        {
+        error = iDescs.Append(&aKey,newValue);
+        }            
+    return error;
+    }
+
+//it add(if not exist) or update. So , it is like Set
+TInt CWSOviMessageContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    TInt error(KErrNone);
+    if (!aValue.Length()) 
+        {
+        error = Remove(aKey);
+        if (error == KErrNotFound)
+                return KErrNone;
+            else
+                return error;
+        }
+    HBufC8* newValue = NULL;
+    TRAP(error, newValue = aValue.AllocL());
+    
+    if (!error)
+        {
+        error = iDescs.UpdateValue(&aKey,newValue);
+        }
+    return error;
+    }
+
+const TDesC8* CWSOviMessageContext::GetDesC8L(const TDesC8& aKey)
+    {
+    TInt index = iDescs.Find(aKey);
+    if (index != KErrNotFound)
+        {
+        return iDescs.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+TInt CWSOviMessageContext::Remove(const TDesC8& aKey)
+    {
+    return iDescs.RemoveByKey(aKey);
+    }
+//-------------Ints
+TInt CWSOviMessageContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a)
+        {
+        return iInts.Append(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+    }
+
+TInt CWSOviMessageContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a)
+        {
+        return iInts.UpdateValue(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+    }
+
+const TInt* CWSOviMessageContext::GetIntL(const TDesC8& aKey)
+    {
+    TInt index = iInts.Find(aKey);
+    if (index!=KErrNotFound)
+        {
+        return iInts.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        };        
+    }
+
+//-----------------elements
+TInt CWSOviMessageContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return Update(aKey,aValue);
+    }
+
+TInt CWSOviMessageContext::Update(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+
+const CSenElement* CWSOviMessageContext::GetSenElementL(const TDesC8& /*aKey*/)
+    {
+    return NULL;
+    }
+//-----------------TAnys
+TInt CWSOviMessageContext::Add(const TDesC8& /*aKey*/, TAny* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+
+TInt CWSOviMessageContext::Update(const TDesC8& /*aKey*/, TAny* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+
+TAny* CWSOviMessageContext::GetAnyL(const TDesC8& /*aKey*/)	//codescannerwarnings
+    {
+    return NULL;
+    }
+
+TInt CWSOviMessageContext::Count() const
+    {
+    return KErrNotSupported;
+    }
+
+TPtrC8 CWSOviMessageContext::KeyAtL(TInt /*aIndex*/)
+    {
+    return KNullDesC8();
+    }
+        
+void CWSOviMessageContext::Reset() 
+    {
+    }
+    
+MSenMessage* CWSOviMessageContext::MessageL()	//codescannerwarnigs
+    {
+    return NULL;
+    }
+    
+TInt CWSOviMessageContext::SetMessage(MSenMessage* /* apMessage */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+TInt CWSOviMessageContext::SetProperties(MSenProperties* /* apTransportProperties */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+MSenProperties* CWSOviMessageContext::Properties()
+    {
+    return NULL;    
+    }
+    
+TInt CWSOviMessageContext::Add(const TDesC8& /* aKey */, MSenMessage* /* apMessage */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+TInt CWSOviMessageContext::Update(const TDesC8& /* aKey */, MSenMessage* /* apMessage */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSOviMessageContext::UpdateTP(CSenTransportProperties*& aTP)
+    {
+    iTP = aTP;
+    return KErrNone;
+    }
+RMapDescriptors& CWSOviMessageContext::OAuthProperies()
+    {
+    return iOAuthProperties;
+    }
+CSenTransportProperties* CWSOviMessageContext::TP()
+    {
+    return iTP;
+    }   
+MSenMessage* CWSOviMessageContext::GetMessageL(const TDesC8& /* aKey */)	// codescannerwarnings
+    {
+    return NULL;
+    }
+    
+    
+CSenChunk* CWSOviMessageContext::ChunkL()	//codescannerwarnings
+    {
+    return NULL;
+    }
+    
+TInt CWSOviMessageContext::SetChunk(CSenChunk* /* apMsgAsChunk */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+TInt CWSOviMessageContext::SetDirection( SenContext::TContextDirection /* aDirection */ ) 
+    {
+    return KErrNotSupported; 
+    }
+    
+   
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovioauthclient.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,753 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+// INCLUDE FILES
+#include "wsovioauthclient.h"
+
+#include <s32mem.h>
+#include <f32file.h>
+#include <s32file.h>
+#include <SenXmlUtils.h>
+#include "sencryptoutils.h"
+
+#include "wsoviservicesession.h"
+#include "SenXmlUtils.h"
+#include "msencoreservicemanager.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "MSenServiceDescription.h"
+#include "SenServiceConnection.h"
+#include "seninternalserviceconsumer.h"
+#include <SenCredential.h>
+#include "wsoviplugin.h"
+#include "SenHttpTransportProperties.h"
+#include "senwspattern.h"
+#include "wsovicons.h"
+#include "wsovitokencreationresponse.h"
+#include "sencryptoutils.h"
+#include "wsoviutils.h"
+
+namespace 
+    {
+    _LIT8(KRemoteConsumer,       "RemoteConsumer");
+    }
+
+
+using namespace OAuth;
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class.
+//---------------------------------------------------------------------------
+//
+CWSOviOAuthClient* CWSOviOAuthClient::NewL(
+                                                        CSIF& aSIF)
+    {
+    CWSOviOAuthClient* pNew = NewLC(aSIF);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class and leaves the object on the cleanup stack
+//---------------------------------------------------------------------------
+//
+CWSOviOAuthClient* CWSOviOAuthClient::NewLC(
+                                                        CSIF& aSIF)
+    {
+    CWSOviOAuthClient* pNew =
+        new (ELeave) CWSOviOAuthClient(
+                    aSIF,
+                    MSenServiceDescription::EOviOAuthClient);
+
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSOviOAuthClient::CWSOviOAuthClient(
+                                                CSIF& aSIF,
+                                                TDescriptionClassType aType)
+    : CSenInternalServiceConsumer(aType, aSIF)
+    {
+    }
+
+void CWSOviOAuthClient::BaseConstructL()
+    {
+    CSenInternalServiceConsumer::ConstructL();
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviOAuthClient::ConstructL()")));
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSOviOAuthClient::~CWSOviOAuthClient()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::~CWSOviTrustClient");
+    delete iAuthSession;
+    delete iBody;
+    }
+
+
+//---------------------------------------------------------------------------
+// The most siginificant method of this class. Make validation of session, 
+//    credentails obtained if needed.
+//    Sequential logic, synchronized, 
+//---------------------------------------------------------------------------
+//
+TInt CWSOviOAuthClient::ValidateL( CWSOviServiceSession& aSession,
+                                    HBufC8*& aErrorMessage,
+                                    TBool aOnlySharing )
+
+    {
+//    iAuthSession->CompleteServerMessagesOnOffL(ETrue);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL(..)");
+    TInt retVal(KErrNone);            // for returning error codes
+    iWSOviServiceSession = &aSession;            // save session
+    
+//----------------------
+//0  token sharing, only if scope of token is not applied
+//----------------------
+    TBool sharingSucceed = EFalse;
+    RPointerArray<CSenWSDescription> oviSDs;
+    CleanupClosePushL(oviSDs);
+    CSenWSPattern* pattern = CSenWSPattern::NewLC();
+ 
+    //select * from session_of_SD where session is (ovi framework, and has same provideId && No scope of token)
+    
+    pattern->SetFrameworkIdL(KDefaultOviFrameworkID);
+    pattern->AsElement().AddElementL(KSenIdpProviderIdLocalname).SetContentL(iIdentityProvider->ProviderID());
+    //if (iWSOviServiceSession->ScopeToken() == EFalse) then pattern->SetScopeToken(EFalse) 
+    CWSOviServiceSession* oviSession = NULL;
+    TRAP(retVal, retVal = Framework().Manager().ServiceDescriptionsL(oviSDs, *pattern));
+
+    if(!retVal)
+        {
+        TInt count = oviSDs.Count();
+        for(TInt i = 0; i < oviSDs.Count(); i++)
+            {
+            //all sessions, to eliminate client, just for case we check type
+            TDescriptionClassType dt = oviSDs[i]->DescriptionClassType();
+            if (dt == MSenServiceDescription::EOviServiceSession)
+                {
+                oviSession = (CWSOviServiceSession*)oviSDs[i];
+                //dont share to itself
+                if (oviSession != iWSOviServiceSession)
+                    {
+                    TRAPD(err, retVal = oviSession->ShareTokenWithL(
+                            iWSOviServiceSession));
+                    if ((retVal == KErrNone) && (err == KErrNone))
+                        {
+                        sharingSucceed = ETrue;
+                        break;
+                        }    
+                    }
+                }
+            }
+        if ( !sharingSucceed )
+            {
+            // Did not find valid token      (<=> sharingSucceed     == EFalse)
+            // 
+            // Try to search valid toeken directly from CredentialManager
+            // (This is needed especially in case when token is imported
+            //  through Public API
+            //  => There is not yet Session which holds imported token)
+            if ( iWSOviServiceSession->TryToSearchValidCredentialL() == KErrNone )	//codescannerwarnings
+                {
+                iWSOviServiceSession->SetStatusL();
+                iWSOviServiceSession->AddSecurityTokenToContextL();
+                sharingSucceed = ETrue;
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(2, &oviSDs);
+        
+    
+    if (sharingSucceed)
+        {
+        iWSOviServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL(..) - sharing succed, we don't need more validation");
+        return KErrNone;
+        }
+    if (aOnlySharing)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL(..) - only sharing was allowed so NO continuation");
+        return KErrNone;
+        }
+    
+//-----------------
+//1 Init session
+//-----------------
+
+    if (!iAuthSession)// if AuthenticationClient has NOT been registered earlier
+        {
+        iAuthSession = CWSOviServiceSession::NewL(Framework());
+        iAuthSession->InitializeFromL(*this);
+        iAuthSession->SetEndPointL(iIdentityProvider->Endpoint());
+        iAuthSession->SetContractL(KWSOviAuthenticationServiceContract);
+        iAuthSession->AddConsumerL(*this);
+        }
+    CSenXmlReader* reader = Framework().Manager().XMLReader();
+    CWSOviSessionContext* NAUTHSsnContext = iAuthSession->SessionContext();
+    
+    
+
+//-----------------
+//2.preparing context    
+//-----------------------
+    TInt retryCounter(0);
+    TBool retry(ETrue);
+    TBool authenticationInfoPromptedFromUser(EFalse);
+    TPckgBuf<TSenAuthentication> authInfo;
+    HBufC8* response = NULL;
+    MSenRemoteServiceConsumer* pConsumer = NULL;
+                
+    while ( retry ) // Authentication loop starts
+        {
+        retry = EFalse;
+        //building body
+        CWSOviPlugin& frmWSOvi = (CWSOviPlugin&)Framework();
+        const TDesC8* version  = iHndCtx->GetDesC8L(HandlerContextKey::KVersion);
+        TTime time;
+        time.UniversalTime();
+        
+        TPtrC8 userName(KNullDesC8);
+        TPtrC8 password(KNullDesC8);
+        if ( authenticationInfoPromptedFromUser )
+            {
+            userName.Set(authInfo().iUsername);
+            password.Set(authInfo().iPassword);
+            }
+        else
+            {
+            userName.Set(iIdentityProvider->UserName());
+            password.Set(iIdentityProvider->Password());
+            }
+        HBufC8* created(NULL);
+        CWSOviSessionContext* sessioncontext = iWSOviServiceSession->SessionContext();
+        const TInt* diffHandlerContext = iHndCtx->GetIntL(HandlerContextKey::KDiff);
+        if( diffHandlerContext && *diffHandlerContext > 0 )
+            {
+            TTimeIntervalMinutes minutes(*diffHandlerContext);
+            TTime diff = time - minutes;
+            time -= TTimeIntervalMicroSeconds(diff.Int64());
+            created = SenCryptoUtils::GetTimestampL(time);
+            }
+        else
+            {
+            created = SenCryptoUtils::GetTimestampL();
+            }
+        CleanupStack::PushL(created);
+        CreateBodyL(*version,
+                    userName,
+                    password,
+					*created);
+        CleanupStack::PopAndDestroy(created);
+
+        
+        //-----------------    
+        //_____________________________________SYNC Sending____________________________________________
+
+        CSenHttpTransportProperties* transProp = CSenHttpTransportProperties::NewLC();
+        
+        // IAP dialog used to appear though IAP id is provided as a part of Service Description
+        // Get the IAP setting and accordingly set the transport properties
+    	TUint32 id = 0;
+    	TInt getIapRetCode = IapId(id);
+    	
+    	// Check whether IAP ID is pre-defined, and copy it only if such property value is found
+    	//if ( getIapRetCode == KErrNone && id < 4294967295) // unsigned 4294967295 == -1 signed
+    	if ( getIapRetCode == KErrNone && id < (TUint32)KErrNotFound) // unsigned 4294967295 == -1 signed
+    	    {
+    	    transProp->SetIapIdL(id); 
+    	    }
+    	// ETMI-6WAGDB end
+    	
+    	//limit http timeout, 
+    	//  if NAUTH hangs and can not send any response, then we block every async client method.
+    	//  Possibel revalidation during sendL can take too long time therefore we create new limit
+    	transProp->SetMaxTimeToLiveL(WSOviSession::KMaxHttpTimeOut);
+		transProp->SetBoolPropertyL(OAuth::KNeedSecurity(), EFalse);
+		transProp->SetEndpointResourceL(WSOviSession::KTokenEndpointSuffix());
+//    	transProp->SetContentTypeL(KFormUrlEncoded());
+		
+//set consumer keys for proper DB		
+		HBufC8* providerTP(NULL); 
+		iIdentityProvider->TransportPropertiesL(providerTP);
+		if (providerTP)
+		    {
+        	CleanupStack::PushL(providerTP);
+        	CSenHttpTransportProperties* httpProviderTP = CSenHttpTransportProperties::NewLC(*providerTP, *reader);
+        	if (httpProviderTP)
+        		{
+        		TPtrC8 content(KNullDesC8);
+        		httpProviderTP->PropertyL(KNCIMConsumerKeyId , content);
+        		if (content.Length())
+        			{
+        			transProp->SetPropertyL(KNCIMConsumerKeyId, content);
+        			}
+        		httpProviderTP->PropertyL(KNCIMConsumerSecret , content);
+        		if (content.Length())
+        			{
+        			transProp->SetPropertyL(KNCIMConsumerSecret, content);
+        			}
+        		httpProviderTP->PropertyL(KNCIMConsumerServiceId , content);
+        		if (content.Length())
+        			{
+        			transProp->SetPropertyL(KNCIMConsumerServiceId, content);
+        			}
+        		/*TUint32 id = 0;
+                if (! httpProviderTP->SnapIdL(id))
+                      {
+                      transProp->SetSnapIdL(id);
+                      }*/
+                CleanupStack::PopAndDestroy(httpProviderTP);
+        		}
+            CleanupStack::PopAndDestroy(providerTP);
+		    }
+		
+		// setting SNAP/IAP 
+            if(!iAuthSession->IapId(id) )
+                {
+                transProp->SetIapIdL(id);
+                transProp->SetSnapIdL(0);
+                }
+            else if(!iAuthSession->SnapId(id) )
+                {
+                transProp->SetSnapIdL(id);
+                transProp->SetIapIdL(0);
+                }
+	      
+
+        HBufC8* transPropAsXml = transProp->AsUtf8LC();
+//        HBufC8* bodyEncodedUrl = CWSOviUtils::FormEncodeCharsLC(*pBody);
+//        _LIT8(KXmlContent, "XMLContent=");
+//        HBufC8* allBody = HBufC8::NewL(KXmlContent().Length()+bodyEncodedUrl->Length());
+//        allBody->Des().Append(KXmlContent());
+//        allBody->Des().Append(*bodyEncodedUrl);
+//        CleanupStack::PushL(allBody);
+//-----------------
+//3.submitting
+//-------------------        
+        retVal = iAuthSession->SubmitL(*iBody, *transPropAsXml, *this, response);
+
+        aSession.SetTransportL(ipTransport);//ownership moved
+        ipTransport = NULL;
+        
+        if (!response)
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - Response is empty - 1");
+            CleanupStack::PopAndDestroy(transPropAsXml);
+            CleanupStack::PopAndDestroy(transProp);
+            return retVal;
+            }
+
+        const TInt* diffContext = iHndCtx->GetIntL(HandlerContextKey::KDiff);
+        if (diffContext && *diffContext > 0)
+            {
+            delete response;
+            response = NULL;
+            TTime time;
+            time.UniversalTime();
+            TTimeIntervalMinutes minutes(*diffContext);
+            TTime diff = time-minutes;
+            time -= TTimeIntervalMicroSeconds(diff.Int64());
+            HBufC8* created = SenCryptoUtils::GetTimestampL(time);
+            CleanupStack::PushL(created);
+            CreateBodyL(*version,
+                        userName,
+                        password,
+                        *created);
+            CleanupStack::PopAndDestroy(created);
+            retVal = iAuthSession->SubmitL(*iBody, *transPropAsXml, *this, response);
+            aSession.SetTransportL(ipTransport);//ownership moved
+            ipTransport = NULL;
+            }
+        
+        CleanupStack::PopAndDestroy(transPropAsXml);
+        CleanupStack::PopAndDestroy(transProp);
+        CleanupStack::PushL(response);
+
+        if ( retVal )
+            {
+            CWSOviSessionContext* pSessionContext = iWSOviServiceSession->SessionContext();
+            TAny* ptr = pSessionContext->GetAnyL(KRemoteConsumer());	//codescannerwarnings
+            if ( ptr )
+                {
+                pConsumer = REINTERPRET_CAST(MSenRemoteServiceConsumer*, ptr);
+                }
+            else
+                {
+                pConsumer = iWSOviServiceSession->Consumer();
+                }
+            
+            if ( pConsumer && !pConsumer->HasAuthenticationCallback() &&
+                 retryCounter < 3 )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - Consumer does not have AuthenticationCallback");
+                
+                const TDesC8* pValue = iIdentityProvider->AsElement().AttrValue( KSenAttrPromptUserInfo );
+                
+#ifdef _RD_SEN_WS_STAR_DO_NOT_PROMPT_AUTHINFO_BY_DEFAULT
+                if ( pValue && *pValue != _L8("false") )
+                // attribute has to exist, otherwise logic defaults to: DO NOT PROMPT
+#else
+                if ( !pValue || *pValue != _L8("false") )
+                // even when attribute does NOT exist, or when it does and has any other value but "false", default to: PROMPT
+#endif                
+                    {
+                    const TBool* renewingPtr = NAUTHSsnContext->GetIntL(WSOviContextKeys::KReAuthNeeded);
+					if ( renewingPtr && *renewingPtr )
+                     	{
+                        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"- Prompt is used to get AuthenticationInfo");
+                        TInt ret = (Framework().Manager()).AuthenticationForL(*iIdentityProvider,
+                                                                              authInfo);
+                        if ( ret == KErrNone )
+                            {
+                            retryCounter++;
+                            retry = ETrue;
+                            authenticationInfoPromptedFromUser = ETrue;
+                            }
+                     	}
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSOviOAuthClient::ValidateL - promptUserInfo = false");
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel," => prompt is not used.");
+                    }
+                }
+            if ( pConsumer && pConsumer->HasAuthenticationCallback() &&
+                             retryCounter < 3 )
+            	{
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSOviOAuthClient::ValidateL - Consumer has AuthenticationCallback");
+                
+                const TDesC8* pValue = iIdentityProvider->AsElement().AttrValue( KSenAttrPromptUserInfo );
+                
+                if ( !pValue || *pValue != _L8("false") )
+                    {
+                    const TBool* renewingPtr = NAUTHSsnContext->GetIntL(WSOviContextKeys::KReAuthNeeded);
+                    if ( renewingPtr && *renewingPtr )
+                        {
+                        retVal = KErrSenFailedAuthentication;
+                        }
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSOviOAuthClient::ValidateL - UserInfoPrompt = false");
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel," => AuthenticationCallback is not used.");
+                    }
+                
+            	}
+            }
+            
+        if ( retry )
+            {
+            CleanupStack::PopAndDestroy(response);
+            }
+        }  // Authentication loop ends
+
+    HBufC8* ttlCreated = SenCryptoUtils::GetTimestampL();
+    CleanupStack::PushL(ttlCreated);
+    User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTokenCreationTime,*ttlCreated));
+    CleanupStack::PopAndDestroy(ttlCreated);
+    
+    
+    if (retVal != KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSOviOAuthClient::ValidateL - error when submit to NAUTH %d"), retVal));
+        iWSOviServiceSession->SessionContext()->Remove(WSOviContextKeys::KTokenCreationTime);
+
+        if (response)
+            {
+            aErrorMessage = response;
+            }
+        
+        CleanupStack::Pop(response);
+        return retVal;
+        }
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - response from NAUTH is a valid SOAP");
+//-----------------
+//4 building response    
+//-----------------
+    CWSOviTokenCreationResponse* responseFragment = CWSOviTokenCreationResponse::NewLC();
+    responseFragment->SetReader(*Framework().Manager().XMLReader());
+    responseFragment->BuildFrom(*response);
+
+    TPtrC8 ttl = responseFragment->TTL();
+    TBool ttlInfinitive = EFalse;
+//        _LIT8(KTempTTL,"1000");
+    if (ttl.Length())
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,ttl);
+        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTTL,ttl));
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - ttl is missing");
+        const TInt KMaxTTLLength = 20;
+        TBuf8<KMaxTTLLength> ttlMaxInt;
+        ttlMaxInt.AppendNum(KMaxTInt);
+        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTTL,ttlMaxInt));
+        ttlInfinitive = ETrue;
+        }
+    TPtrC8 tokenSecret = responseFragment->TokenSecret();
+    if (tokenSecret.Length())
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,tokenSecret);
+        User::LeaveIfError(iWSOviServiceSession->SessionContext()->Update(WSOviContextKeys::KTokenSecret,tokenSecret));
+        }
+    TPtrC8 token = responseFragment->Token();
+    if (!token.Length())
+        {
+        iWSOviServiceSession->SessionContext()->Remove(WSOviContextKeys::KTokenCreationTime);
+        retVal = KErrNotFound;
+        }
+    else
+    	{    
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,token);
+	    if (!iWSOviServiceSession->ExistConsumerL())
+	        {
+	        iWSOviServiceSession->SessionContext()->Remove(WSOviContextKeys::KTokenCreationTime);
+	        retVal = KErrNotFound;
+	        }
+	    else
+	        {
+	        iWSOviServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::ValidateL - set ctx basing on response");
+	        retVal = iWSOviServiceSession->SessionContext()->SetTokenKeysL(token);
+	        if (retVal)
+	            {
+	            aErrorMessage = response;
+	            }
+	        }
+    	}
+    CleanupStack::PopAndDestroy(responseFragment);
+    
+    if (!aErrorMessage)
+        {
+        if (!ttlInfinitive)
+            {
+            iWSOviServiceSession->ActiveTicketObserverL();
+            }
+        CleanupStack::PopAndDestroy(response);
+        }
+    else
+        {
+        CleanupStack::Pop(response);
+        }
+    return retVal;
+    }
+
+
+
+//---------------------------------------------------------------------------
+// SetStatus
+//---------------------------------------------------------------------------
+//
+
+void CWSOviOAuthClient::SetStatus(TInt /*aStatus */)
+    {
+    // No implementation in Java
+     }
+
+//---------------------------------------------------------------------------
+// SetAccount
+//---------------------------------------------------------------------------
+//
+void CWSOviOAuthClient::SetAccount(
+                                    CSenIdentityProvider* aIdentityProvicer)
+    {
+    iIdentityProvider = aIdentityProvicer;
+    }
+
+
+//---------------------------------------------------------------------------
+// ServiceSession
+//---------------------------------------------------------------------------
+//
+CSenServiceSession* CWSOviOAuthClient::ServiceSession()
+    {
+    return iWSOviServiceSession;
+    }
+
+//---------------------------------------------------------------------------
+// Obtain Transport using a factory from Core Manager
+//---------------------------------------------------------------------------
+//
+MSenTransport& CWSOviOAuthClient::TransportL()
+    {
+    if(!ipTransport)
+        {
+        // Core is capable of working as transport factory, too.
+        // The returned transport instancies may or may not be
+        // ECOM plugins:
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::Instantiating new transport");
+        ipTransport = Framework().Manager().CreateL(*iAuthSession, iAuthSession); 
+        }
+    return *ipTransport;
+    }
+//---------------------------------------------------------------------------
+// SetNAUTHSessionL
+//---------------------------------------------------------------------------
+//
+void CWSOviOAuthClient::SetAuthSessionL(
+                                                CWSOviServiceSession* aSession)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviOAuthClient::SetServiceSessionL");
+    _LIT8(KTouch, "touch");
+    // free memory
+    //delete iAuthSession;
+    const TDesC8* attrValue = aSession->AsElement().AttrValue(KTouch);
+    if(attrValue != NULL)
+    	{
+    	AsElement().AddAttrL(KTouch, *attrValue);
+    	}
+    iAuthSession = aSession;
+    if(iAuthSession)
+        {
+        iAuthSession->AddConsumerL(*this);
+        }
+    }
+
+
+//---------------------------------------------------------------------------
+// Getter for endpoint
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSOviOAuthClient::Endpoint()
+    {
+    return iAuthSession->Endpoint();
+    }
+//---------------------------------------------------------------------------
+// Getter for contract
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSOviOAuthClient::Contract()
+    {
+    return iAuthSession->Contract();
+    }
+//---------------------------------------------------------------------------
+// Getter for providerId
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSOviOAuthClient::ProviderID()
+    {
+    return iAuthSession->ProviderID();
+    }
+
+//---------------------------------------------------------------------------
+// Getter for framework
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSOviOAuthClient::FrameworkId()
+    {
+    return iAuthSession->FrameworkId();
+    }
+//---------------------------------------------------------------------------
+// serialie to xml
+//---------------------------------------------------------------------------
+//
+void CWSOviOAuthClient::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    iAuthSession->WriteAsXMLToL(aWriteStream);
+    }
+
+MSenServicePolicy* CWSOviOAuthClient::ServicePolicy()
+    {
+    return iAuthSession->ServicePolicy();
+    }
+TInt CWSOviOAuthClient::IapId(TUint32& aCurrentIapId)
+    {
+    return iAuthSession->IapId(aCurrentIapId);
+    }
+    
+
+
+TBool CWSOviOAuthClient::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::ESenInternalServiceConsumer ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenInternalServiceConsumer::HasSuperClass( aType ); 
+        }
+    }
+
+void CWSOviOAuthClient::SetHandlerCtx(MSenHandlerContext* aHndCtx)
+    {
+    iHndCtx = aHndCtx;
+    }
+TBool CWSOviOAuthClient::HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate)
+    {
+    TBool retVal(EFalse);
+    if ( CSenWSDescription::HasEqualPrimaryKeysL(aCandidate) )
+        {
+        // Endpoint, Contract and FrameworkID match, all of them.
+        // Now, in WS-Ovi, also check ProviderID
+        if (aCandidate.DescriptionClassType() == DescriptionClassType())
+            {
+            CWSOviOAuthClient& AuthenticationCandidate = (CWSOviOAuthClient&)aCandidate;
+            if (AuthenticationCandidate.ProviderID() == ProviderID())
+                {
+                retVal = ETrue;
+                }
+            }
+        }
+    return retVal; 
+    }
+
+void CWSOviOAuthClient::CreateBodyL(const TDesC8& aXmlNs, const TDesC8& aUsername, const TDesC8& aPassword, const TDesC8& aCreated)
+    {
+    delete iBody;
+    iBody = NULL;
+    HBufC8* nonce = SenCryptoUtils::GetRandomNonceL();
+    CleanupStack::PushL(nonce);
+    HBufC8* passDec = SenXmlUtils::DecodeHttpCharactersLC( aPassword );
+    HBufC8* digest = CWSOviUtils::DigestAuthStringL(*nonce, aCreated, aUsername, *passDec);
+    CleanupStack::PopAndDestroy(passDec);
+    CleanupStack::PushL(digest);
+                    
+    iBody = HBufC8::NewL(KCreationRequestFormat8().Length()
+    						+ aXmlNs.Length()
+                            + aUsername.Length()
+                            + nonce->Length()
+                            + aCreated.Length()
+                            + digest->Length());
+    TPtr8 ptr = iBody->Des();
+    ptr.Format(KCreationRequestFormat8,
+    		   &aXmlNs,
+               &aUsername,
+               &(nonce->Des()),
+               &aCreated,
+               &(digest->Des()));
+    CleanupStack::PopAndDestroy(digest);
+    CleanupStack::PopAndDestroy(nonce);
+    }
+
+TBool CWSOviOAuthClient::Matches(MSenServiceDescription& aOtherServiceDescription)
+    {
+    return iAuthSession->Matches(aOtherServiceDescription);
+    }
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,892 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#include "wsoviplugin.h"
+#include "SenServiceConnection.h" // framework IDs, error codes
+#include "sendebug.h"
+#include "senlogger.h"
+#include "MSenServiceDescription.h"
+#include "wsoviservicesession.h"
+#include "SenXmlUtils.h"
+#include "senguidgen.h"
+#include "wsovitokencreationresponse.h"
+#include <SenHttpTransportProperties.h>
+#include "sencryptoutils.h"
+#include "wsoviserviceupdatehandler.h"
+#include "wsovivalidatehandler.h"
+using namespace WSOviConfig;
+using namespace OAuth;
+// Local CONSTANTS
+const TInt KMaxLengthXml  = 1280; 
+
+// ---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+// ---------------------------------------------------------------------------
+//
+CWSOviPlugin* CWSOviPlugin::NewL(TAny* aManager)
+    {
+    MSenCoreServiceManager* manager =
+        reinterpret_cast<MSenCoreServiceManager*>(aManager);
+
+    CWSOviPlugin* self = new (ELeave) CWSOviPlugin(*manager);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CWSOviPlugin::CWSOviPlugin(MSenCoreServiceManager& aManager)
+    : iManager(aManager),
+      iVersions(ETrue, ETrue)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CWSOviPlugin::~CWSOviPlugin()
+    {
+    iMsgHandlers.ResetAndDestroy();
+    iSessionHandlers.ResetAndDestroy();
+    iHandlerContexts.ResetAndDestroy();
+    iVersions.Reset();
+    iIMSI.Close();
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::~CWSOviPlugin()")));
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CWSOviPlugin::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ConstructL")));
+
+    BaseConstructL(KFrameworkXMLNS, KFrameworkLocalName);
+    //load default setup of handlers
+    AddHandlerL(KValidateValue, KValidateHandlerVersion, SenHandler::ESessionHandler);
+    AddHandlerL(KRegisterValue, KNullDesC8, SenHandler::ESessionHandler);
+    
+    AddHandlerL(KCredentialCollectorValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KDeviceValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KSecurityValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KEncoderValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KServiceUpdateValue, KNullDesC8, SenHandler::ESessionHandler);
+    }
+
+//========================================================
+//                MSIF SPecific
+//========================================================
+
+//---------------------------------------------------------------------------
+// Attempt to register the ServiceDescription to the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSOviPlugin::RegisterServiceDescriptionL(
+    MSenServiceDescription& aServiceDescription )
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::RegisterServiceDescriptionL(.)")));
+    TInt error(KErrNone);
+
+    CWSOviSessionContext* pSessionRegisterCtx = CWSOviSessionContext::NewLC();
+    pSessionRegisterCtx->Add(WSOviContextKeys::KServiceDescription(),
+            (CSenWSDescription*)&aServiceDescription);
+    pSessionRegisterCtx->Add(WSOviContextKeys::KRegisterAction(),
+            WSOviContextValues::KActionRegister());
+
+//SOA for S60 Composable Handler Framework v0.1 - 7.5.3.1 point 1)            
+    CSenSessionHandler* pregisterHandler = 
+                (CSenSessionHandler*)Handler(KRegisterValue());
+        
+    TRAPD(errorL,error= pregisterHandler->InvokeL(*pSessionRegisterCtx));
+    if (errorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::RegisterServiceDescriptionL() !!!!leave from RegisterHandler")));
+        error = errorL;
+        }
+    CleanupStack::PopAndDestroy(pSessionRegisterCtx);
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// Attempt to unregister the ServiceDescription from the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSOviPlugin::UnregisterServiceDescriptionL(
+    MSenServiceDescription& aServiceDescription)
+    {
+    
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::UnRegisterServiceDescriptionL(.)")));
+//SOA for S60 Composable Handler Framework v0.1  - 7.5.3.1 point 1)            
+    TInt error(KErrNone);
+    CSenSessionHandler* pregisterHandler = 
+                (CSenSessionHandler*)Handler(KRegisterValue());
+        
+    CWSOviSessionContext* pSessionRegisterCtx = CWSOviSessionContext::NewLC();
+    pSessionRegisterCtx->Add(WSOviContextKeys::KServiceDescription(),
+            (CSenWSDescription*)&aServiceDescription);
+    pSessionRegisterCtx->Add(WSOviContextKeys::KRegisterAction(),
+            WSOviContextValues::KActionUnregister());
+    TRAPD(errorL,error = pregisterHandler->InvokeL(*pSessionRegisterCtx));
+    if (errorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::UnregisterServiceDescriptionL() !!!!leave from RegisterHandler")));
+        error = errorL;
+        }
+    CleanupStack::PopAndDestroy(pSessionRegisterCtx);
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// Getter of framework ("WS-Ovi")
+//---------------------------------------------------------------------------
+//
+const TDesC8& CWSOviPlugin::Id()
+    {
+    return KDefaultOviFrameworkID();
+    }
+
+//---------------------------------------------------------------------------
+// Try to find one or more services that match the given ServiceDescription.
+//    Adding is only invoked if NO! session in cache. 
+//    Its mean that we have create new one.
+//---------------------------------------------------------------------------
+//
+TInt CWSOviPlugin::AddServiceDescriptionL( MSenServiceDescription& aPattern,
+                                            MSenRemoteServiceConsumer& aRemoteConsumer,
+                                            HBufC8*& aErrorMessage )
+    {
+    TInt addedSD(0);
+    //-----1.no disco phase
+    //-----2.establish credential and put to session
+    //-----3.set validator. Enables re-auth for cases when credential is expired between init and send
+    if(aPattern.FrameworkId() != KDefaultOviFrameworkID)
+        {
+        TLSLOG_L(KSenClientSessionLogChannelBase+aRemoteConsumer.ConnectionId(),KNormalLogLevel ,"CWSOviPlugin::AddServiceDescriptionL - this is not KDefaultWSOviFrameworkID");
+        addedSD = 0; // zero added
+        }
+    else if( aPattern.Endpoint().Length() > 0 && aPattern.Contract().Length() > 0 )
+        {
+        CWSOviServiceSession* pNewSession = CWSOviServiceSession::NewL(*this);
+        CleanupStack::PushL(pNewSession);
+
+        // InitializeFromL copies the contract and endpoint of concrete service
+        //  also context will be set
+        pNewSession->InitializeFromL(aPattern);
+        pNewSession->AddConsumerL(aRemoteConsumer);
+        pNewSession->SessionContext()->Update(WSOviContextKeys::KOnlySharing, EFalse);
+//SOA for S60 Composable Handler Framework v0.1  - 7.5.3.1 point 3)        
+        TInt error = ProcessOutboundValidationL( aPattern, 
+                                                (MSenRemoteServiceSession*)pNewSession,
+                                                aErrorMessage );
+        TLSLOG_FORMAT((KSenClientSessionLogChannelBase+aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("CWSOviPlugin::AddServiceDescriptionL - ProcessOutboundValidation returned: %d"), error));
+
+        if ( error )
+            {
+            if (error>KErrNone)
+                {
+                addedSD = KErrSenAuthenticationFault;
+                }
+            else
+                {
+                addedSD = error;
+                }
+            CleanupStack::PopAndDestroy(pNewSession);
+            }
+        else // BOTH outbound validation and policy handler invokation OK(!):
+            {
+            Manager().AddServiceDescriptionL((CSenWSDescription*)pNewSession);
+            addedSD = 1;
+            CleanupStack::Pop(pNewSession); //now session is owned by Core / XML DAO
+            }
+        }
+    else
+        {
+        TLSLOG_L(KSenClientSessionLogChannelBase+aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSOviPlugin::AddServiceDescriptionL - No endpoint AND no contract; new session could not be added.");
+        addedSD = 0; // zero added
+        }
+    return addedSD;
+    }
+
+TBool CWSOviPlugin::IsTrustedClient(MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    TSecureId sid = aRemoteConsumer.SecureId();    
+    //_LIT_SECURE_ID(nokia_chateventmonitorserver, 0x2001B2C5 );
+    
+    TVendorId vendor = aRemoteConsumer.VendorId();
+	_LIT_VENDOR_ID(trustedVendor,VID_DEFAULT);
+    
+    if (vendor.iId == trustedVendor.iId )
+        return ETrue;
+    else
+        return EFalse;
+    }
+
+//---------------------------------------------------------------------------
+// Create a ServiceSession based upon the given ServiceDescription.
+//---------------------------------------------------------------------------
+//
+TInt CWSOviPlugin::CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                           MSenServiceDescription& aPattern,
+                                           CSenServiceSession*& aNewSession,
+                                           MSenRemoteServiceConsumer& aRemoteConsumer,
+                                           HBufC8*& aErrorMessage )
+    {
+    if (!IsTrustedClient(aRemoteConsumer)) return KErrPermissionDenied;
+    TInt error(KErrNone);
+    if( aServiceDescription.DescriptionClassType() == MSenServiceDescription::EOviServiceSession )
+        {
+        //usecase:  when init connection with not registered description, nothing in db
+        //usecase:  when bootup and description was already in db (registered during parsing db.file)
+        aNewSession = (CWSOviServiceSession*) &aServiceDescription;
+        aNewSession->SetStatusL();
+        TLSLOG_L(KSenClientSessionLogChannelBase+aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSOviPlugin::ServiceDescription is already a ServiceSession");
+        }
+    else
+        {
+        aNewSession = (CWSOviServiceSession*) NewServiceDescriptionL();
+        error = ((CWSOviServiceSession*)aNewSession)->InitializeFromL( aServiceDescription );
+        }
+    if(aNewSession && !error)//if session was just created, its possible that its not validate
+        {
+        if(!aNewSession->IsReadyL())
+            {
+            TLSLOG_L(KSenClientSessionLogChannelBase+aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSOviPlugin::ServiceSession is not ready");
+            //usecase: when credential was parsed(exiNAUTH) and additionally expired.
+            //         We don't need revalidate if credentials doesnt exist at all
+            
+            
+            CWSOviSessionContext* pSessionValidateCtx = ((CWSOviServiceSession*)aNewSession)->SessionContext();
+            if (!pSessionValidateCtx) //sessionCts exist if revalidation is processing
+                {
+                pSessionValidateCtx = CWSOviSessionContext::NewLC();
+                pSessionValidateCtx->Add(WSOviContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aNewSession);
+                ((CWSOviServiceSession*)aNewSession)->SetSessionContext(pSessionValidateCtx);
+                CleanupStack::Pop(pSessionValidateCtx);
+                }
+                
+            pSessionValidateCtx->Update(WSOviContextKeys::KRemoteConsumer(),
+                                        &aRemoteConsumer);
+            aNewSession->AddConsumerL(aRemoteConsumer);
+            pSessionValidateCtx->Update(WSOviContextKeys::KOnlySharing, EFalse);   
+            error = ProcessOutboundValidationL( aPattern, 
+                                               (MSenRemoteServiceSession*)aNewSession,
+                                               aErrorMessage );
+            if (error) aNewSession->RemoveConsumerL(aRemoteConsumer);
+            if (error>KErrNone)
+                {
+                error = KErrSenAuthenticationFault;
+                }
+            }
+        else
+            {
+            //usecase: when credential was parsed(exiNAUTH) and credential is valid.
+            // We start credential monitor and revalidation is start when credential expired. 
+            TLSLOG_L(KSenClientSessionLogChannelBase+aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSOviPlugin::Call ActiveTicketObserverL()");
+            ((CWSOviServiceSession*)aNewSession)->ActiveTicketObserverL();
+            }
+        }
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+//
+TInt CWSOviPlugin::OnEvent( const TInt aEvent, TAny* apArgument )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviPlugin::OnEvent");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("  -event code: %d"), aEvent));
+    TInt retCode( KErrNone );
+
+    switch( aEvent)
+        {
+        
+        case KSenEventWsfReady:
+            {
+            TPtrC8 imsi = iManager.IMSI();
+            if (iIMSI.Compare(imsi))
+            	{
+            	const RPointerArray<CSenIdentityProvider> list = iManager.IdentityProvidersL();
+        	    for (TInt i = 0; i<list.Count(); i++)
+    	            {
+    	            CSenElement* el(NULL);
+    	            list[i]->AccountExtensions(el);
+    	            if (el)
+    	            	{
+    	            	delete (el->RemoveElement(KSenAccAutoSignIn));
+    	            	((MSenCredentialManager&)iManager).RemoveCredentialsL(list[i]->ProviderID());
+    	            	}
+    	            //((MSenCredentialManager&)iManager).RemoveCredentialsL(list[i]->ProviderID());
+    	            }
+        	    iIMSI.Close();
+        	    iIMSI.Create(imsi);
+        	    }
+            }
+            break;
+        case KSenEventRegisterIdentityProvider:
+        case KSenEventUnregisterIdentityProvider:
+            {
+            TInt policyLeave(KErrNone);
+            TRAP(policyLeave, VerifyPermissionOnEachSessionL(); )
+            if ( policyLeave & !retCode )
+                {
+                retCode = policyLeave;
+                }
+            }
+            break;
+            
+        default:
+            {
+            // do nothing
+            }
+        }
+    return retCode;
+    }
+
+
+void CWSOviPlugin::VerifyPermissionOnEachSessionL()
+    {
+
+    CSenWSDescription* pOpenMask = CSenWSDescription::NewLC( KNullDesC8, KNullDesC8 );
+    pOpenMask->SetFrameworkIdL(KDefaultOviFrameworkID); // now it matches with any WS-Ovi session
+    
+    RWSDescriptionArray all;
+    iManager.ServiceDescriptionsL(all, *pOpenMask);
+    CleanupStack::PopAndDestroy(pOpenMask);
+    CleanupClosePushL(all);
+
+    TInt count(all.Count());
+
+    for(TInt i=0; i<count; i++)
+        {   
+        CSenWSDescription* pSD = (CSenWSDescription*)all[i];
+
+        if(pSD->DescriptionClassType() == MSenServiceDescription::EOviServiceSession)
+            {
+            CWSOviServiceSession* pSession = (CWSOviServiceSession*)pSD;
+            pSession->VerifyPermissionL(); // accessible through friendship
+            }
+        }
+    CleanupStack::PopAndDestroy(&all);
+    }
+
+//---------------------------------------------------------------------------
+// There is no extended interface in WSOvi framework at the moment.
+//---------------------------------------------------------------------------
+//
+TAny* CWSOviPlugin::ExtendedInterface()
+    {
+    return NULL;
+    }
+
+//---------------------------------------------------------------------------
+// Return a new instance of a framework specific class that
+//     implements the ServiceDesccription interface.
+//---------------------------------------------------------------------------
+//
+CSenWSDescription* CWSOviPlugin::NewServiceDescriptionL()
+    {
+    CWSOviServiceSession* pSD =
+        CWSOviServiceSession::NewL(*this);
+    CleanupStack::PushL(pSD);    
+    pSD->SetFrameworkIdL(KDefaultOviFrameworkID);
+    CleanupStack::Pop(pSD);
+    return pSD;
+    }
+
+//---------------------------------------------------------------------------
+// Getter for manager
+//---------------------------------------------------------------------------
+//
+MSenCoreServiceManager& CWSOviPlugin::Manager()
+    {
+    return iManager;
+    }
+//---------------------------------------------------------------------------
+// Setter for manager
+//---------------------------------------------------------------------------
+//
+void CWSOviPlugin::SetManager(MSenCoreServiceManager& aServiceManager)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::SetManager(.)")));
+    iManager = aServiceManager;
+    }
+//---------------------------------------------------------------------------
+// Getter for configParser
+//---------------------------------------------------------------------------
+//
+CSenBaseFragment& CWSOviPlugin::ConfigParser()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ConfigParser()")));
+    return *this;
+    //return callbacks which will be invoked during parsing rest of config
+    //this callbacks will be responsible for loading features
+    }
+
+//---------------------------------------------------------------------------
+// UCS2 serializer
+//---------------------------------------------------------------------------
+HBufC* CWSOviPlugin::AsXmlUnicodeL()
+    {
+    HBufC8* pUtf8 = AsXmlL();
+    CleanupStack::PushL(pUtf8);
+    HBufC* pAsAxlInUnicode = SenXmlUtils::ToUnicodeLC(*pUtf8);
+    CleanupStack::Pop(pAsAxlInUnicode);
+    CleanupStack::PopAndDestroy(pUtf8); 
+    return pAsAxlInUnicode;
+    }
+
+//---------------------------------------------------------------------------
+// UTF8 serializer
+//---------------------------------------------------------------------------
+HBufC8* CWSOviPlugin::AsXmlL()
+    {
+    HBufC8* retVal = HBufC8::NewLC(KMaxLengthXml);
+    TPtr8 ptr = retVal->Des();
+    ptr.Append(KSenLessThan);
+    ptr.Append(KFrameworkLocalName);
+    ptr.Append(KSenSpace);
+    ptr.Append(KSenSpaceXmlns);
+    ptr.Append(KSenEqualsDblQuot);
+    ptr.Append(KFrameworkXMLNS);
+    ptr.Append(KSenDblQuot);
+    
+    ptr.Append(KSenSpace);
+    ptr.Append(KClassAttr);
+    ptr.Append(KSenEqualsDblQuot);
+    ptr.Append(KFrameworkCue);
+    ptr.Append(KSenDblQuot);
+    ptr.Append(KSenGreaterThan);
+    
+//--message handlers    
+    for (TInt i=0; i < iMsgHandlers.Count(); i++)
+        {
+        AddHandlerTag(ptr, iMsgHandlers[i]->Name());
+        }
+//--session handlers    
+   for (TInt i=0; i < iSessionHandlers.Count(); i++)
+        {
+        AddHandlerTag(ptr, iSessionHandlers[i]->Name());
+        }  
+//add IMIS digest
+   	ptr.Append(KSenLessThan);
+   	ptr.Append(KIMSILocalName);
+   	ptr.Append(KSenSpace);
+      //class attr
+   	ptr.Append(KIMSIDigestAttr);
+   	ptr.Append(KSenEqualsDblQuot);
+   	ptr.Append(iIMSI);
+   	ptr.Append(KSenDblQuot);
+   	ptr.Append(KSenSlashGreaterThan);
+    
+   
+   
+    ptr.Append(KSenLessThanSlash);
+    ptr.Append(KFrameworkLocalName);
+    ptr.Append(KSenGreaterThan);
+    CleanupStack::Pop(retVal);
+    return retVal;
+    }
+
+
+
+//---------------------------------------------------------------------------
+//  used during reading configuration of WSOvi framework in order to load 
+//  proper handlers.
+//---------------------------------------------------------------------------
+//
+void CWSOviPlugin::StartElementL(const TDesC8& /*aNsUri*/,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& /*aQName*/,
+                                    const RAttributeArray& aAttrs)
+    {
+    if(aLocalName.Compare(KHandlerLocalName) == 0)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::Found handler")));
+        TPtrC8 pClass = SenXmlUtils::AttrValue(aAttrs, KClassAttr);
+        TPtrC8 pVersion = SenXmlUtils::AttrValue(aAttrs, KVersionAttr);
+        
+        //message handlers
+        if ((pClass == KDeviceValue ) || 
+            (pClass == KSecurityValue ))
+            {
+            AddHandlerL(pClass, pVersion, SenHandler::EMessageHandler);
+            }
+        //session handlers
+        else if((pClass == KValidateValue) ||
+                (pClass == KRegisterValue)
+                )
+            {
+            AddHandlerL(pClass, pVersion, SenHandler::ESessionHandler);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("Found unknown handler!")));
+            }
+             
+        }
+    else if (! aLocalName.Compare(KIMSILocalName))
+    	{
+    	iIMSI.Close();
+    	iIMSI.Create(SenXmlUtils::AttrValue(aAttrs, KIMSIDigestAttr));
+    	}
+    }
+//---------------------------------------------------------------------------
+//  used during reading configuration of WSOvi framework 
+//---------------------------------------------------------------------------
+//
+void CWSOviPlugin::EndElementL(const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName)
+    {
+    CSenBaseFragment::EndElementL(aNsUri,aLocalName,aQName);
+    }
+    
+//---------------------------------------------------------------------------
+// getter of handler, using its cue
+//---------------------------------------------------------------------------
+//    
+
+MSenHandler* CWSOviPlugin::Handler(const TDesC8& aCue)
+    {
+    TInt count = iMsgHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iMsgHandlers[i]->Name() == aCue)
+            {
+            return iMsgHandlers[i];
+            }
+        }
+    count = iSessionHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iSessionHandlers[i]->Name() == aCue)
+            {
+            return iSessionHandlers[i];
+            }
+        }
+    return NULL;
+    }
+//---------------------------------------------------------------------------
+// remove handler by cue, used during reloading (another version of handler is 
+//      used than deafault setup)
+//---------------------------------------------------------------------------
+//    
+void CWSOviPlugin::RemoveHandler(const TDesC8& aCue)
+    {
+    TInt count = iMsgHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iMsgHandlers[i]->Name() == aCue)
+            {
+            delete iMsgHandlers[i];
+            iMsgHandlers.Remove(i);
+            return;
+            }
+        }
+    count = iSessionHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iSessionHandlers[i]->Name() == aCue)
+            {
+            delete iSessionHandlers[i];
+            iSessionHandlers.Remove(i);
+            return;
+            }
+        }
+    }
+
+
+
+//---------------------------------------------------------------------------
+// Process Outbound validation phase
+//---------------------------------------------------------------------------
+//     
+TInt CWSOviPlugin::ProcessOutboundValidationL( MSenServiceDescription& /*aPattern*/, 
+                                                MSenRemoteServiceSession* aRemoteServiceSession,
+                                                HBufC8*& aErrorMessage )
+    {
+    TInt error(KErrNone);
+    CSenSessionHandler* pValidatehandler = (CSenSessionHandler*)Handler(KValidateValue);
+    CWSOviSessionContext* pSessionValidateCtx = ((CWSOviServiceSession*)aRemoteServiceSession)->SessionContext();
+    if (!pSessionValidateCtx) //sessionCts exist if revalidation is processing
+        {
+        pSessionValidateCtx = CWSOviSessionContext::NewLC();
+        pSessionValidateCtx->Add(WSOviContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        ((CWSOviServiceSession*)aRemoteServiceSession)->SetSessionContext(pSessionValidateCtx);
+        CleanupStack::Pop(pSessionValidateCtx);
+        }
+    else
+        {
+        pSessionValidateCtx->Update(WSOviContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        }
+    TRAPD(errorL, error = pValidatehandler->InvokeL(*pSessionValidateCtx));
+    if ( error )
+        {
+        const TDesC8* pNotOwnedErrorMsg = pSessionValidateCtx->GetDesC8L(WSOviContextKeys::KErrMessage);
+        if ( pNotOwnedErrorMsg )
+            {
+            aErrorMessage = pNotOwnedErrorMsg->AllocL();
+            }
+        }
+    if (errorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessOutboundValidationL() !!!!leave from validate handler")));
+        error = errorL;
+        }
+    return error;
+    }
+    
+    
+    
+//---------------------------------------------------------------------------
+// Process Outbound message phase
+//---------------------------------------------------------------------------
+//                                          
+TInt CWSOviPlugin::ProcessOutboundMessageL( CWSOviMessageContext*& aMsgCtx)
+    {
+
+//--------------------device handler
+    TInt error(KErrNone);
+    CSenMessageHandler* pHandler = NULL;
+    pHandler = (CSenMessageHandler*)Handler(KDeviceValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessOutboundMessageL() !!!!leave from device handler")));
+            error = errorL;
+            }
+        }
+
+
+//--------------------security handler
+    pHandler = (CSenMessageHandler*)Handler(KSecurityValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessOutboundMessageL() !!!!leave from security handler")));
+            error = errorL;
+            }
+        }
+
+//--------------------credential collector handler
+    pHandler = (CSenMessageHandler*)Handler(KCredentialCollectorValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessOutboundMessageL() !!!!leave from Credential Collector handler")));
+            error = errorL;
+            }
+        }
+
+    //--------------------encoder handler
+        pHandler = (CSenMessageHandler*)Handler(KEncoderValue);
+        if (pHandler)
+            {
+            TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+            if (errorL!=KErrNone)
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessOutboundMessageL() !!!!leave from Encoder handler")));
+                error = errorL;
+                }
+            }
+
+    return error;
+    }
+
+
+
+
+//---------------------------------------------------------------------------
+// Process Ibound message phase (body as element)
+//---------------------------------------------------------------------------
+//   
+TInt CWSOviPlugin::ProcessInboundMessageL()
+    {
+    return KErrNotSupported;
+    }
+        
+        
+//---------------------------------------------------------------------------
+// Process Ibound dispatch phase (in fact updatinf session)
+//---------------------------------------------------------------------------
+//        
+TInt CWSOviPlugin::ProcessInboundDispatchL( MSenRemoteServiceSession* aRemoteServiceSession,
+                                               const TInt aErrorCode,
+                                               HBufC8* aMessage,
+                                               MSenProperties* aResponseTransportProperties)
+    {
+    TInt error(KErrNone);
+    CSenSessionHandler* pHandler = NULL;
+    CWSOviSessionContext* pSessionCtx = ((CWSOviServiceSession*)aRemoteServiceSession)->SessionContext();
+    pSessionCtx->Update(WSOviContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+    TLSLOG_FORMAT((KSenClientSessionLogChannelBase, KMinLogLevel , _L8("CWSOviPlugin::ProcessInboundDispatchL - aErrorCode: %d"), aErrorCode));
+    if ( aMessage ) 
+        {
+        pSessionCtx->Update( WSOviContextKeys::KMessageBody, *aMessage );
+        TLSLOG_ALL(KSenClientSessionLogChannelBase, KMinLogLevel , *aMessage);
+        }
+    if ( aResponseTransportProperties ) 
+        {
+        pSessionCtx->Update( WSOviContextKeys::KTP, (TAny*)aResponseTransportProperties );
+        }
+        
+    pSessionCtx->Update(WSOviContextKeys::KErrCode, aErrorCode);
+    
+    //--------------------encoder handler
+    pHandler = (CSenSessionHandler*)Handler(KServiceUpdateValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*pSessionCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessOutboundMessageL() !!!!leave from Service Update handler")));
+            error = errorL;
+            }
+        const TInt* diff = pSessionCtx->GetIntL(WSOviContextKeys::KRetryNeeded);
+        if (diff && *diff > 0)
+        	{
+        	CWSOviValidateHandler* validateHandler = (CWSOviValidateHandler*)Handler(KValidateValue);
+        	validateHandler->HandlerContext().Update(HandlerContextKey::KDiff, *diff);
+        	}
+        }
+    return error;
+    }
+
+
+//---------------------------------------------------------------------------
+// Add handler tag into session.xml
+//---------------------------------------------------------------------------
+//        
+void CWSOviPlugin::AddHandlerTag(TPtr8& aXml, const TDesC8& aHandlerClassName)
+    {
+    aXml.Append(KSenLessThan);
+    aXml.Append(KHandlerLocalName);
+    aXml.Append(KSenSpace);
+    //class attr
+    aXml.Append(KClassAttr);
+    aXml.Append(KSenEqualsDblQuot);
+    aXml.Append(aHandlerClassName);
+    aXml.Append(KSenDblQuot);
+    TInt index = iVersions.Find(aHandlerClassName);
+    if (index != KErrNotFound)
+        {
+        HBufC8* value = (HBufC8*)iVersions.ValueAt(index);
+        if (value->Length())
+            {
+            aXml.Append(KSenSpace);
+            aXml.Append(KVersionAttr);
+            aXml.Append(KSenEqualsDblQuot);
+            aXml.Append(*value);
+            aXml.Append(KSenDblQuot);    
+            }
+        }   
+    aXml.Append(KSenSlashGreaterThan);
+    }
+    
+//---------------------------------------------------------------------------
+// Add handler into array, WSOvi SIF implementation keep handlers after loading
+//---------------------------------------------------------------------------
+//        
+void CWSOviPlugin::AddHandlerL(const TDesC8& aHandlerClassName, const TDesC8& aVersion, SenHandler::THandlerType aType)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::AddHandlerL")));
+    TInt index = iVersions.Find(aHandlerClassName);
+    if (index == KErrNotFound)
+        {
+        MSenHandler* handler  = NULL;
+        CWSOviHandlerContext* ctx = NULL;
+        ctx = CWSOviHandlerContext::NewL();
+        CleanupStack::PushL(ctx);
+        ctx->Add(iManager);
+        ctx->Update(HandlerContextKey::KVersion, aVersion);
+        iVersions.Append(aHandlerClassName.AllocL(), aVersion.AllocL());
+        if(aType == SenHandler::EMessageHandler)
+            {
+            TRAPD(loadError, handler = CSenMessageHandler::NewL(aHandlerClassName, *ctx));    
+            if (loadError != KErrNone)
+                {
+                User::Leave(loadError);
+                }
+            else
+                {
+                iMsgHandlers.Append((CSenMessageHandler*)handler);    
+                }    
+            }
+        else if (aType == SenHandler::ESessionHandler)
+            {
+            ctx->Add(HandlerContextKey::KSIF, this);
+            TRAPD(loadError, handler = CSenSessionHandler::NewL(aHandlerClassName, *ctx));
+            if (loadError != KErrNone)
+                {
+                User::Leave(loadError);
+                }
+            else
+                {
+                iSessionHandlers.Append((CSenSessionHandler*)handler);
+                }        
+            }
+        CleanupStack::Pop(ctx);
+        iHandlerContexts.Append(ctx);
+        }
+    else
+    //reload handler.
+    //user info from session.xml (in fact this is only for testing , nobody can have access to session.xml)
+        {
+        HBufC8* value = (HBufC8*)iVersions.ValueAt(index);
+        if (*value != aVersion)
+            {//reload
+            iVersions.RemoveByKey(aHandlerClassName);
+            RemoveHandler(aHandlerClassName);
+            //potentail infinitve reccurence!
+            AddHandlerL(aHandlerClassName, aVersion, aType);    
+            }
+        }
+    }
+//---------------------------------------------------------------------------
+// SetTransportPropertiesL
+//---------------------------------------------------------------------------
+//        
+TInt CWSOviPlugin::SetTransportPropertiesL(MSenTransport& /* aTransport */)
+    {
+    return KErrNotSupported;
+    }
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "wsoviplugin.h"
+#include "wsovivalidatehandler.h"
+#include "wsoviregisterhandler.h"
+#include "wsovidevicehandler.h"
+#include "wsovisecurityhandler.h"
+#include "wsovicredentialcollectorhandler.h"
+#include "wsoviencoderhandler.h"
+#include "wsoviserviceupdatehandler.h"
+          
+const TInt32 KWSOviPlugin = 0x2001950F;
+const TInt32 KWSOviValidateHandler = 0x20019510;
+const TInt32 KWSOviRegisterHandler  = 0x20019511;
+const TInt32 KWSOviDeviceHandler  = 0x20019512;
+const TInt32 KWSOviSecurityHandler  = 0x20019513;
+const TInt32 KWSOviCredentialCollectorHandler  = 0x20019514;
+const TInt32 KWSOviEncoderHandler  = 0x20019515;
+const TInt32 KWSOviServiceUpdateHandler  = 0x20019516;
+
+// ---------------------------------------------------------------------------
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviPlugin,  CWSOviPlugin::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviValidateHandler,  CWSOviValidateHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviRegisterHandler,  CWSOviRegisterHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviDeviceHandler,  CWSOviDeviceHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviSecurityHandler,  CWSOviSecurityHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviCredentialCollectorHandler,  CWSOviCredentialCollectorHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviEncoderHandler,  CWSOviEncoderHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSOviServiceUpdateHandler,  CWSOviServiceUpdateHandler::NewL)
+    };
+
+// ---------------------------------------------------------------------------
+// Function used to return an instance of the proxy table.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviregisterhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsoviregisterhandler.h"
+#include "wsovioauthclient.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+class CWSOviHandlerContext;
+// Create instance of concrete ECOM interface implementation
+CWSOviRegisterHandler* CWSOviRegisterHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSOviRegisterHandler* self   = new (ELeave) CWSOviRegisterHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSOviRegisterHandler::CWSOviRegisterHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    
+    }
+
+// Destructor
+CWSOviRegisterHandler::~CWSOviRegisterHandler()
+    {
+    }
+
+// Second phase construction.
+void CWSOviRegisterHandler::ConstructL()
+    {
+    }
+    
+TInt CWSOviRegisterHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+    MSenServiceDescription& pServiceDescription = *(MSenServiceDescription*)aCtx.GetSenWSDescriptionL(WSOviContextKeys::KServiceDescription());
+    const TDesC8* action = aCtx.GetDesC8L(WSOviContextKeys::KRegisterAction());
+    TInt result(KErrNone);
+    if (*action == WSOviContextValues::KActionRegister())
+        {
+        result = RegisterServiceDescriptionL(pServiceDescription);
+        }
+    else if (*action == WSOviContextValues::KActionUnregister())
+        {
+        result = UnregisterServiceDescriptionL(pServiceDescription);
+        };
+    return result;  
+    }
+    
+SenHandler::THandlerDirection CWSOviRegisterHandler::Direction() const
+    {
+        return SenHandler::EBoth;
+    };
+SenHandler::THandlerPhase CWSOviRegisterHandler::Phase()
+    {
+        return SenHandler::EDiscovery;
+    };
+
+//---------------------------------------------------------------------------
+// Attempt to register the ServiceDescription to the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSOviRegisterHandler::RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription )
+    {
+    TInt retval(KErrNone);
+    CWSOviServiceSession* pSession = NULL;
+    TPtrC8 contract = aServiceDescription.Contract();
+    TPtrC8 endpoint = aServiceDescription.Endpoint();
+
+    if (contract == KNullDesC8) 
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::RegisterServiceDescriptionL failed - KErrSenNoContract");
+        retval = KErrSenNoContract;
+        }
+    else if(endpoint == KNullDesC8)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::RegisterServiceDescriptionL failed - KErrSenNoEndpoint");
+        retval = KErrSenNoEndpoint;
+        }
+    else
+        {
+        if(contract == KWSOviAuthenticationServiceContract)
+            {
+            retval = RegisterAuthClientL(&aServiceDescription);
+            }
+        else if (aServiceDescription.DescriptionClassType() ==
+                        MSenServiceDescription::EOviServiceSession)
+            {
+            //  description already is a session so we just add to core-DAO
+            //  usecase:    when connection has been made, and service is registered 
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::RegisterServiceDescriptionL - session is already so just adding")));
+                pSession = (CWSOviServiceSession*) &aServiceDescription;
+                retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pSession);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::RegisterServiceDescriptionL - Creating session from description...")));
+            pSession = CWSOviServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+            //usecase:  when description has been read from db during bootup
+            //          session has to be initialized (set validity time for example)
+            retval = pSession->InitializeFromL(aServiceDescription);
+            if (retval == KErrNone)
+                {
+                retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pSession);
+                CleanupStack::Pop(pSession);
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(pSession);
+                }
+            }
+        }
+    return retval;
+    }
+    
+    
+//---------------------------------------------------------------------------
+// Attempt to unregister the ServiceDescription from the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSOviRegisterHandler::UnregisterServiceDescriptionL(
+    MSenServiceDescription& aServiceDescription)
+    {
+    TInt retval(KErrNone);
+    CWSOviServiceSession *pSession = NULL;
+    TPtrC8 contract = aServiceDescription.Contract();
+
+    if(contract == KWSOviAuthenticationServiceContract)
+        {
+        retval = UnRegisterAuthClientL(&aServiceDescription);
+        }
+    else
+        {
+        if(aServiceDescription.DescriptionClassType() ==
+                MSenServiceDescription::EOviServiceSession)
+            {
+            pSession = (CWSOviServiceSession*) &aServiceDescription;
+            retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pSession);
+            }
+        else
+            {
+
+            pSession = CWSOviServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+            retval = pSession->InitializeFromL(aServiceDescription);
+            if (retval == KErrNone)
+                {
+                RWSDescriptionArray sessions;
+                retval = iHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(sessions,aServiceDescription);
+                if (!retval && sessions.Count())
+                    {
+                    RServiceConsumerArray consumers;
+                    ((CWSOviServiceSession*)sessions[0])->Consumers(consumers);
+                    TInt count = consumers.Count();
+                    consumers.Reset();
+                    consumers.Close();
+                    sessions.Reset();
+                    sessions.Close();
+                    if (count)
+                        {
+                        CleanupStack::PopAndDestroy(pSession);
+                        return KErrInUse;
+                        }
+                    }
+                retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pSession);
+                }
+            CleanupStack::PopAndDestroy(pSession);
+            }
+        }
+
+    return retval;
+    }    
+
+//---------------------------------------------------------------------------
+// Register specific description (Auth contract)
+//---------------------------------------------------------------------------
+//    
+TInt CWSOviRegisterHandler::RegisterAuthClientL(
+                                MSenServiceDescription *aServiceDescription)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviRegisterHandler::RegisterNAUTHClientL");
+    
+    TPtrC8 endpoint = aServiceDescription->Endpoint();
+    TInt retval = KErrNone;
+    CWSOviServiceSession* pSession = NULL;
+    CWSOviOAuthClient* pAuthClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                MSenServiceDescription::EOviOAuthClient)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::RegisterNAUTHClient - This ServiceDescription is already an NAUTH Client")));
+        pAuthClient = (CWSOviOAuthClient*)aServiceDescription;
+        retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pAuthClient);
+        }
+    else
+        {
+        // Create new auth client and initialize
+        // it from given description
+        pSession = CWSOviServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));
+        retval = pSession->InitializeFromL(*aServiceDescription);
+
+        if(retval != KErrNone)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSOviRegisterHandler::RegisterNAUTHClientL failed %d"), retval));
+            CleanupStack::PopAndDestroy(pSession);
+            return retval;
+            }
+        TPtrC8 sessionEndpoint = pSession->Endpoint();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSOviRegisterHandler::RegisterNAUTHClientL created NAUTH using endpoint:'%S'"), &sessionEndpoint));
+
+        pAuthClient = CWSOviOAuthClient::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+        pAuthClient->SetAuthSessionL(pSession);    // pSession will be owned by Auth Client
+        CleanupStack::Pop(pAuthClient);
+        CleanupStack::Pop(pSession);
+        CleanupStack::PushL(pAuthClient);
+
+        retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pAuthClient);
+        if(retval != KErrNone)
+            {
+            delete pAuthClient;
+            }
+        CleanupStack::Pop(pAuthClient); 
+        pAuthClient = NULL;
+        }
+    return retval;
+    }
+
+//---------------------------------------------------------------------------
+// Unregister specific description (Auth contract)
+//---------------------------------------------------------------------------
+//    
+
+TInt CWSOviRegisterHandler::UnRegisterAuthClientL(
+                                MSenServiceDescription *aServiceDescription)
+    {
+    TInt retval = KErrNone;
+
+    CWSOviServiceSession* pSession = NULL;
+    CWSOviOAuthClient* pAuthClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                MSenServiceDescription::EOviOAuthClient)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviRegisterHandler::CWSOviRegisterHandler - This ServiceDescription is already an NAUTH Client")));
+        pAuthClient = (CWSOviOAuthClient*)aServiceDescription;
+        retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pAuthClient);
+        }
+    else
+        {
+        
+        pSession = CWSOviServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));
+        retval = pSession->InitializeFromL(*aServiceDescription);
+        if(retval != KErrNone)
+            {
+            CleanupStack::PopAndDestroy(pSession);
+            return retval;
+            }
+        pAuthClient = CWSOviOAuthClient::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF));	
+        pAuthClient->SetAuthSessionL(pSession);    // pSession will be owned by Auth Client
+        CleanupStack::Pop(pAuthClient);
+        CleanupStack::Pop(pSession);
+        CleanupStack::PushL(pAuthClient);
+
+        retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pAuthClient);
+        CleanupStack::PopAndDestroy(pAuthClient);
+        }
+
+    return retval;
+    }    
+    
+//---------------------------------------------------------------------------
+// Logger using during DEBUG mode
+//---------------------------------------------------------------------------
+//    
+
+TInt CWSOviRegisterHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovisecurityhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,418 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+#include <e32std.h>
+#include "wsovisecurityhandler.h"
+#include "wsovicons.h"
+#include "wsovihandlercontext.h"
+#include "senlogger.h"
+#include "wsovimessagecontext.h"
+#include <SenTransportProperties.h>
+#include <SenHttpTransportProperties.h>
+
+#include "wsoviutils.h"
+#include "sencryptoutils.h"
+
+
+using namespace OAuth;
+namespace
+    {
+    const TInt KSHA1OutputSize = 20;// see http://en.wikipedia.org/wiki/SHA_hash_functions
+    }
+// Create instance of concrete ECOM interface implementation
+CWSOviSecurityHandler* CWSOviSecurityHandler::NewL(
+        MSenHandlerContext* aHandlerCtx)
+    {
+    
+    CWSOviSecurityHandler* self =
+            new (ELeave) CWSOviSecurityHandler(*aHandlerCtx);
+    return self;
+    }
+
+// Constructor
+CWSOviSecurityHandler::CWSOviSecurityHandler(MSenHandlerContext& aCtx):
+        CSenMessageHandler(aCtx), iDiff(0)
+    {
+    }
+
+// Destructor
+CWSOviSecurityHandler::~CWSOviSecurityHandler()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::~CWSOviSecurityHandler()")));
+    }
+
+TInt CWSOviSecurityHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TInt error(KErrNone);
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::InvokeL(MSenMessageContext& aCtx)")));
+    CSenTransportProperties* tp = ((CWSOviMessageContext&)aCtx).TP();
+    const TInt* servertime = ((CWSOviMessageContext&)aCtx).GetIntL(WSOviContextKeys::KRetryNeeded);
+    const TDesC8* bodyMessage = ((CWSOviMessageContext&)aCtx).GetDesC8L(WSOviContextKeys::KMessageBody);
+    
+    
+    TPtrC8 oldValue;
+    if (!tp) return KErrNotFound;
+    error = tp->PropertyL(KAuthHttpHeader, oldValue);
+    if (error) return error;//device handler missed
+    
+    
+    TPtrC8 consumerKey;
+    error = tp->PropertyL(KNCIMConsumerKeyId, consumerKey);
+        
+    TPtrC8 consumerSecret;
+    error = tp->PropertyL(KNCIMConsumerSecret, consumerSecret);
+    
+    TBool needSecurity(ETrue);
+    error = tp->BoolPropertyL(KNeedSecurity,needSecurity);
+    
+    
+    const TDesC8* endpoint = ((CWSOviMessageContext&)aCtx).GetDesC8L(KEndpointKey);
+    if (!endpoint)
+        {
+        endpoint = &KParValRealm();
+        }
+    
+    CSenHttpTransportProperties::TSenHttpMethod httpMethod;
+    error = ((CSenHttpTransportProperties*)tp)->HttpMethodL(httpMethod);
+    if (error)
+        {
+        httpMethod = CSenHttpTransportProperties::ESenHttpPost;
+        }
+//====================NAuth message encoding + signing (algorithm)
+
+//____1____ generate random(NONCE)
+
+    HBufC8* nonce(SenCryptoUtils::GetRandomNonceL());
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,_L("CWSOviSecurityHandler::   ____1____ generate random(NONCE %S)"), nonce));
+    
+    
+//____2____ generate timestamp
+    TTime time;
+    time.UniversalTime();
+    if (servertime && *servertime > 0/*&& iDiff==0*/)
+        {
+        TTimeIntervalMinutes minutes(*servertime);
+        iDiff = time-minutes;
+        ((CWSOviMessageContext&)aCtx).Update(WSOviContextKeys::KRetryNeeded, 0);
+        }
+    time -= TTimeIntervalMicroSeconds(iDiff.Int64());
+    HBufC8* timestamp = SenCryptoUtils::GetTimestampL(time);
+    
+        
+    
+    
+    
+    
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,_L("CWSOviSecurityHandler::   ____2____ generate (timestamp %S)"), timestamp));
+
+//____3____ create request without signature
+
+    const TDesC8* token = aCtx.GetDesC8L(WSOviContextKeys::KToken());
+    TPtrC8 clearToken = KNullDesC8();
+    TInt tokenLength(0);
+    if (token && needSecurity)
+        {
+        TInt left = token->Locate('>') + 1;
+        TInt right = token->LocateReverse('<');
+        clearToken.Set(token->Mid(left, right - left));
+        tokenLength = clearToken.Length();
+        tokenLength += KParToken().Length();
+        tokenLength += KEqual().Length() + KQtMark().Length() +                    
+                    KQtMark().Length() + KComma().Length();
+        }
+    
+    RBuf8 newValue;
+    newValue.Create(oldValue.Length() +
+                    KComma().Length() +
+                   
+                    KParSignMethod().Length() +
+                    KEqual().Length() + KQtMark().Length() +
+                    KParValHMACSHA().Length() +
+                    KQtMark().Length() + KComma().Length() +
+
+                    KParTimestamp().Length() +
+                    KEqual().Length() + KQtMark().Length() +
+                    timestamp->Length() +
+                    KQtMark().Length() + KComma().Length() +
+
+                    KParNonce().Length() +
+                    KEqual().Length() + KQtMark().Length() +
+                    nonce->Length() +
+                    KQtMark().Length() + KComma().Length() +
+
+                    tokenLength +
+                    
+                    KParSignature().Length() +
+                    KEqual().Length() + KQtMark().Length() +
+                    KSHA1OutputSize*3  +
+                    KParSignature().Length()
+
+                    );
+    CleanupClosePushL(newValue);
+  
+    TPtrC8 country;
+    tp->PropertyL(KNCIMCountry(), country);
+    
+  	RMapDescriptors& headerProperties = ((CWSOviMessageContext&)aCtx).OAuthProperies();
+    HBufC8* property = KParValHMACSHA().AllocL();
+    headerProperties.Insert(&KParSignMethod, property);
+    headerProperties.Insert(&KParTimestamp, timestamp);
+    headerProperties.Insert(&KParNonce, nonce);
+    if (country.Length())
+        {
+        headerProperties.Insert(&KNCIMCountry, country.AllocL());
+        }
+    headerProperties.Insert(&KParConsumerKey, consumerKey.AllocL());
+    if (token && needSecurity)
+    	{
+    	headerProperties.Insert(&KParToken, clearToken.AllocL());
+    	}
+
+    newValue.Append(oldValue);
+    newValue.Append(KComma());
+    
+   
+
+    newValue.Append(KParSignMethod());
+    newValue.Append(KEqual());
+    newValue.Append(KQtMark());
+    newValue.Append(KParValHMACSHA);
+    newValue.Append(KQtMark());
+    newValue.Append(KComma());
+
+
+    newValue.Append(KParTimestamp());
+    newValue.Append(KEqual());
+    newValue.Append(KQtMark());
+    newValue.Append(*timestamp);
+    newValue.Append(KQtMark());
+    newValue.Append(KComma());
+
+
+    newValue.Append(KParNonce());
+    newValue.Append(KEqual());
+    newValue.Append(KQtMark());
+    newValue.Append(*nonce);
+    newValue.Append(KQtMark());
+    newValue.Append(KComma());
+    
+    if (token && needSecurity)
+        {
+        newValue.Append(KParToken());
+        newValue.Append(KEqual());
+        newValue.Append(KQtMark());
+        newValue.Append(clearToken);
+        newValue.Append(KQtMark());
+        newValue.Append(KComma());
+        }
+    
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::   ____3____ create request without signature")));
+
+//____4____ normalize request
+
+    HBufC8* body = NULL;
+    if (bodyMessage)
+        {
+        HBufC8* bodyEncoded = CWSOviUtils::EncodeCharsLC(*bodyMessage);
+        body = HBufC8::NewL(OAuth::KXmlContentEqual().Length()+bodyEncoded->Length());
+        body->Des().Append(OAuth::KXmlContentEqual());
+        body->Des().Append(*bodyEncoded);
+        CleanupStack::PopAndDestroy(bodyEncoded);
+        CleanupStack::PushL(body);
+        }
+    
+	TInt length=0;
+	if (body)
+	    {
+	    length+=body->Length();
+	    length+=KAmpMark().Length();
+	    }
+	for(TInt i=0; i<headerProperties.Count(); i++)
+	{
+		length+=(*headerProperties.KeyAt(i)).Length();
+		length+=(*headerProperties.ValueAt(i)).Length();
+		length+=KEqual().Length();
+		if(i)
+		length+=KAmpMark().Length();
+	}
+
+	RBuf8 headerToNormalize;
+	CleanupClosePushL(headerToNormalize);
+	headerToNormalize.Create(length);
+	if (body)
+	    {
+	    headerToNormalize.Append(*body);
+	    headerToNormalize.Append(KAmpMark());
+	    }
+	for(TInt i=0; i<headerProperties.Count(); i++)
+	{
+		headerToNormalize.Append(*headerProperties.KeyAt(i));
+		headerToNormalize.Append(KEqual());
+		headerToNormalize.Append(*headerProperties.ValueAt(i));
+		if(i<headerProperties.Count()-1)
+		headerToNormalize.Append(KAmpMark());
+	}
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, headerToNormalize);
+
+	HBufC8* strToSign = NULL;
+	if (httpMethod == CSenHttpTransportProperties::ESenHttpPost)
+	    {
+	    strToSign = CWSOviUtils::NormalizeStringLC( KParHttpMethodPost, *endpoint/*KParValRealm*/, headerToNormalize );
+	    }
+	else if (httpMethod == CSenHttpTransportProperties::ESenHttpGet)
+	    {
+        strToSign = CWSOviUtils::NormalizeStringLC( KParHttpMethodGet, *endpoint/*KParValRealm*/, headerToNormalize );
+	    }
+	else if(httpMethod == CSenHttpTransportProperties::ESenHttpPut)
+		{
+		strToSign = CWSOviUtils::NormalizeStringLC( KParHttpMethodPut, *endpoint/*KParValRealm*/, headerToNormalize );
+		}
+    else if(httpMethod == CSenHttpTransportProperties::ESenHttpDelete)
+        {
+        strToSign = CWSOviUtils::NormalizeStringLC( KParHttpMethodDelete, *endpoint/*KParValRealm*/, headerToNormalize );
+        }
+#ifdef _SENDEBUG
+
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::   ____4____ normalize request")));
+	if(strToSign)
+		{
+			TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, *strToSign);
+		}
+#endif // _SENDEBUG
+    
+//____5____ calculate hash
+
+    CSHA1* sha1 = CSHA1::NewL();    
+    CleanupStack::PushL(sha1);
+    
+    TBuf8<KSHA1OutputSize> hash; 
+    hash.Copy(sha1->Final(*strToSign));
+
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::   ____5____ calculate hash & Key")));
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, hash);
+
+//____6____ sign (with HC client secret)
+
+
+    /*
+    See http://oauth.net/core/1.0/#anchor16
+    "...key is the concatenated values (each first encoded per Parameter Encoding (Parameter Encoding)) 
+    of the Consumer Secret and Token Secret, separated by an ‘&’ character (ASCII code 38) even if empty..."
+    */
+    
+    const TDesC8* tokenSecretCtx = aCtx.GetDesC8L(WSOviContextKeys::KTokenSecret());
+    HBufC8* tokenSecret = NULL;
+    if (tokenSecretCtx && needSecurity)
+    	{
+        tokenSecret = CWSOviUtils::EncodeCharsLC(*tokenSecretCtx);
+    	}
+    HBufC8* encodedConsumerSecret = CWSOviUtils::EncodeCharsLC(consumerSecret); 
+    RBuf8 key;
+    CleanupClosePushL(key);
+    if (tokenSecret && needSecurity)
+        {
+        key.Create(KAmpMark().Length() +
+        		encodedConsumerSecret->Length() +
+               tokenSecret->Length()    );
+        }
+    else
+        {
+        key.Create(KAmpMark().Length() +
+        		encodedConsumerSecret->Length());
+        }
+    
+    key.Append(*encodedConsumerSecret);
+    key.Append(KAmpMark());
+    if (tokenSecret && needSecurity)
+        {
+        key.Append(*tokenSecret);
+        }
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, key);        
+    //CleanupStack::PopAndDestroy(encodedSignatureSecret);
+    CHMAC* hmac = CHMAC::NewL(key, sha1);//sha1 is consumed
+
+    CleanupStack::PopAndDestroy(&key);
+    CleanupStack::PopAndDestroy(encodedConsumerSecret);
+    if (tokenSecretCtx && needSecurity)
+    	{
+    	CleanupStack::PopAndDestroy(tokenSecret);
+    	}
+    CleanupStack::Pop(sha1);
+    CleanupStack::PushL(hmac);    
+    TPtrC8 signatureValue = hmac->Final(*strToSign); //(hash);
+
+    
+    
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,_L("CWSOviSecurityHandler::   ____6____ sign (with HC client secret %S)"), &signatureValue));    
+//____7____ append signature to http header
+
+    newValue.Append(KParSignature());
+    newValue.Append(KEqual());
+    newValue.Append(KQtMark());
+    HBufC8* base64Signature = SenCryptoUtils::EncodeBase64L(signatureValue);
+    CleanupStack::PopAndDestroy(hmac);      
+    CleanupStack::PushL(base64Signature);
+    
+//____8____  URL-encoded 
+    HBufC8* encodedSignature = CWSOviUtils::EncodeCharsLC(*base64Signature);
+    
+    newValue.Append(*encodedSignature);
+    newValue.Append(KQtMark());        
+        
+        
+        
+    tp->SetPropertyL(KAuthHttpHeader, newValue, KHttpHeaderType);
+    
+    
+    CleanupStack::PopAndDestroy(encodedSignature);
+    CleanupStack::PopAndDestroy(base64Signature);
+    CleanupStack::PopAndDestroy(strToSign);
+    CleanupStack::PopAndDestroy(&headerToNormalize);
+    if (body)
+        {
+        CleanupStack::PopAndDestroy(body);
+        }
+    CleanupStack::PopAndDestroy(&newValue);
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::   ____7____ append signature to http header")));
+    
+    //msg context keeps same tp, so we dont have to update msg context
+    return KErrNone;
+    }
+
+    
+SenHandler::THandlerDirection CWSOviSecurityHandler::Direction() const
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::Direction()")));
+        return SenHandler::EOutgoing;
+    };
+SenHandler::THandlerPhase CWSOviSecurityHandler::Phase()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviSecurityHandler::Phase()")));
+        return SenHandler::EMessage;
+    };    
+TInt CWSOviSecurityHandler::InitL(MSenHandlerContext& /*aCtx*/)
+    {
+    return KErrNone;
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1417 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+// INCLUDE
+#include "wsoviservicesession.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "senservicemanagerdefines.h"
+#include "SenServiceConnection.h" // err code definitions
+#include "senserviceinvocationframework.h"
+#include "SenHttpTransportProperties.h"
+#include "SenDateUtils.h"
+#include "sendebug.h"
+#include "senwspattern.h"
+#include "SenXmlUtils.h"
+#include <xmlengnodelist.h> 
+#include <SenHttpTransportProperties.h>
+#include <SenIdentityProvider.h>
+#include "wsovicredentialobserver.h"
+#include "sencryptoutils.h"
+
+const TInt64 KClockSlipSeconds = 60*15;
+
+
+CWSOviServiceSession* CWSOviServiceSession::NewL(MSIF& aFramework)
+    {
+    CWSOviServiceSession* self = CWSOviServiceSession::NewLC(aFramework);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSOviServiceSession* CWSOviServiceSession::NewLC(MSIF& aFramework)
+    {
+    CWSOviServiceSession* self = new (ELeave) CWSOviServiceSession(
+        MSenServiceDescription::EOviServiceSession, aFramework);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CWSOviServiceSession::CWSOviServiceSession(TDescriptionClassType aType,
+                                           MSIF& aSIF)
+    : CSenWebServiceSession(aType, aSIF)
+    {
+    }
+
+CWSOviServiceSession::~CWSOviServiceSession()
+    {
+    delete iSessionContext;
+    delete iProviderID;
+    delete iTrustAnchor;
+    delete iOutContext;
+    delete iInContext;
+    delete iTransProp;
+    delete iOrginalEndpoint;
+    
+    TInt count(iConsumerList.Count());
+    for(TInt i=0; i<count; i++)
+        {
+        // we can assume that every remote consumer
+        // has been wrapped inside WSOviSessionConsumer
+        // -wrapperclass. Cast and destroy:
+        CWSOviSessionConsumer* pConsumer
+            = (CWSOviSessionConsumer*) iConsumerList[i];
+
+        // this destroys the wrapper, but the remote
+        // consumer objects ownership remains in either
+        // XMLDao or ClientSession (etc)
+        delete pConsumer;
+        }
+    delete iTokenObs;
+    }
+
+void CWSOviServiceSession::ConstructL()
+    {
+    CSenWebServiceSession::ConstructL();
+    iTokenObs = CWSOviCredentialObserver::NewL(this,iFramework.Manager().Log());
+    }
+
+TInt CWSOviServiceSession::AddConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KMinLogLevel ,"CWSOviServiceSession::AddConsumerL");            
+    const TInt consumerCount(iConsumerList.Count());
+    for(TInt i=0; i<consumerCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aConsumer.Id())
+            {
+            return KErrAlreadyExists; // already added, nothing to do
+            }
+        }
+
+    CWSOviSessionConsumer* pSessionConsumer =
+                                    CWSOviSessionConsumer::NewL(aConsumer);
+
+    return iConsumerList.Append(pSessionConsumer);
+    }
+
+TBool CWSOviServiceSession::ExistConsumerL()
+    {
+    const TInt consumerCount(iConsumerList.Count());
+    if( consumerCount == 0 )
+        {
+        return EFalse;
+        }
+    else
+        {
+        return ETrue;
+        }
+    }
+
+TInt CWSOviServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KMinLogLevel ,"CWSOviServiceSession::RemoveConsumerL:");    
+    const TInt consumerCount(iConsumerList.Count());
+    for(TInt i=0; i<consumerCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aConsumer.Id())
+            {
+            CWSOviSessionConsumer* pConsumer
+                            = (CWSOviSessionConsumer*) iConsumerList[i];
+            delete pConsumer;
+            iConsumerList.Remove(i);
+            if( (consumerCount-1) == 0 )
+                {
+                iTokenObs->Cancel();
+                }
+            break;
+            }
+        }
+    // If this session has no consumers, we can hold our grip to the credential
+    // (note: this does NOT mean that credential is removed, not at all(!), but
+    //  that new search for the credential has to be performed).
+    if( consumerCount == 0 )
+        {
+        TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KNormalLogLevel ,"- Consumer count == 0");
+        TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KNormalLogLevel ,"-> Closing the handle to the credential owned by the Credential Manager.");
+        SetSecurityL(KNullDesC8); 
+        }           
+    return CSenServiceSession::RemoveConsumerL(aConsumer);
+    }
+
+TInt CWSOviServiceSession::MessageForSendingL( CSenHttpTransportProperties*& aTP,
+                                                const TDesC8& aSenderID)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::MessageForSendingL");    
+    TInt error(KErrNone);
+    if (AmIHostletSession())
+        {
+        return KErrNotSupported;
+        }
+    else
+        {
+        CWSOviSessionConsumer* pConsumer = NULL;
+        //senderID is internal id of consumer
+        error = SessionConsumerL(aSenderID, pConsumer);
+        if (error)
+            {
+            return error; 
+            }
+        
+        CWSOviSessionContext* ssCtx = (CWSOviSessionContext*)SessionContext();
+        
+        iOutContext->UpdateFromSessionContextL(*ssCtx);
+        iOutContext->UpdateTP((CSenTransportProperties*&)aTP);
+        AdaptEndpointL(EFalse);
+        iOutContext->Update(OAuth::KEndpointKey,Endpoint());
+        AdaptEndpointL(ETrue);
+
+        error = ((CWSOviPlugin&)iFramework).ProcessOutboundMessageL(
+                iOutContext);
+        
+        iSessionContext->UpdateFromMessageOutContextL(*iOutContext);
+        error = pConsumer->MessageForSendingL(aTP, iOutContext);
+        }
+    return error;
+    }
+
+
+
+
+MSenRemoteServiceConsumer* CWSOviServiceSession::RemoteConsumerL( const TDesC8& aSenderID )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::RemoteConsumerL");        
+    TInt consumersCount(iConsumerList.Count());
+
+    for(TInt i=0; i<consumersCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aSenderID)
+            {
+            return iConsumerList[i];
+            }
+        }
+    return NULL; // not found
+    }
+
+//---------------------------------------------------------------------------
+// To obtain consumer during processing INBOUND.
+//---------------------------------------------------------------------------
+//   
+
+TInt CWSOviServiceSession::SessionConsumerL( CWSOviMessageContext*& /*aMsgCtx*/,
+                                              CWSOviSessionConsumer*& aSessionConsumer )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::SessionConsumerL");                
+    TInt consumersCount(iConsumerList.Count());
+    TInt error(KErrNotFound);
+    if (error && consumersCount)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSOviServiceSession::SessionConsumerL - consumer was not found - using the 1st one (as default)");
+        aSessionConsumer = (CWSOviSessionConsumer*)iConsumerList[0];
+        error = KErrNone;
+        }
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// To obtain consumer during processing OUTBOUND.
+//---------------------------------------------------------------------------
+//   
+        
+TInt CWSOviServiceSession::SessionConsumerL( const TDesC8& aSenderID,
+                                              CWSOviSessionConsumer*& aSessionConsumer )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::SessionConsumerL");                        
+    aSessionConsumer = (CWSOviSessionConsumer*) RemoteConsumerL(aSenderID);
+    if(aSessionConsumer)
+        {
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+TBool CWSOviServiceSession::Matches(MSenServiceDescription& aPattern)
+    {
+    TBool matches = CSenWebServiceSession::Matches(aPattern);
+    if (!matches) return EFalse;
+    
+    MSenElement& xmlPatternAsElement = ((CSenWSDescription&)aPattern).AsElement();
+    MSenElement* pElement = xmlPatternAsElement.Element( KSenIdpProviderIdLocalname );
+    if(pElement)
+        {
+        TPtrC8 patternProviderID = pElement->Content();
+        TPtrC8 thisProviderID = ProviderID();
+        if(patternProviderID.Length()>0)
+            {
+            if(!(thisProviderID.Length()>0 && patternProviderID == thisProviderID))
+                {
+                return EFalse;
+                }
+            }
+        }
+        
+    if (aPattern.DescriptionClassType() == MSenServiceDescription::EWSDescription)
+        {
+        TPtrC8 patternTransportCue = ((CSenWSDescription&)aPattern).TransportCue();
+        if (patternTransportCue.Length() > 0)
+            {
+            if(!iTransportCue || (patternTransportCue != *iTransportCue))
+                {
+                return EFalse;
+                }
+            }
+        }
+    return matches;
+    }
+
+TInt CWSOviServiceSession::ScoreMatchL(MSenServiceDescription& aPattern)
+    {
+    TInt score = CSenWebServiceSession::ScoreMatchL(aPattern);
+    
+    MSenElement& xmlPatternAsElement = ((CSenWSDescription&)aPattern).AsElement();
+    MSenElement* pElement = xmlPatternAsElement.Element(KSenIdpProviderIdLocalname);
+    if(pElement)
+        {
+        TPtrC8 patternProviderID = pElement->Content();
+        TPtrC8 thisProviderID = ProviderID();
+        if(patternProviderID.Length()>0)
+            {
+            if ( thisProviderID.Length()>0 && patternProviderID == thisProviderID )
+                {
+                score++;
+                }
+            }
+        }
+        
+    if (aPattern.DescriptionClassType() == MSenServiceDescription::EWSDescription)
+        {
+        TPtrC8 patternTransportCue = ((CSenWSDescription&)aPattern).TransportCue();
+        if (patternTransportCue.Length() > 0)
+            {
+            if ( iTransportCue && (patternTransportCue == *iTransportCue) )
+                {
+                score++;
+                }
+            }
+        }
+        
+    return score;
+    }
+
+TInt CWSOviServiceSession::SetTransportPropertiesL(const TDesC8& aProperties,
+                                             MSenRemoteServiceConsumer& aConsumer)
+    {
+        if(iTransProp)
+            {
+            delete iTransProp;
+            iTransProp = NULL;
+            }
+        iTransProp = HBufC8::NewL(aProperties.Length());
+        TPtr8 ptr = iTransProp->Des();
+        ptr.Append(aProperties);
+        CWSOviSessionConsumer* pConsumer = NULL;
+        //senderID is internal id of consumer
+        TInt error = SessionConsumerL(aConsumer.Id(), pConsumer);
+        if (!error && pConsumer)
+            {
+            MSenTransport& tp = pConsumer->TransportL();
+            CSenHttpTransportProperties* transProp = ApplyTransportPropertiesLC(aProperties);
+            HBufC8* utfTP = transProp->AsUtf8L();
+            CleanupStack::PushL(utfTP);
+            tp.SetPropertiesL(*utfTP, MSenLayeredProperties::ESenTransportLayer, &aConsumer);
+            CleanupStack::PopAndDestroy(utfTP);
+            CleanupStack::PopAndDestroy(transProp);
+            }
+        return KErrNone;
+    }
+
+CSenHttpTransportProperties* CWSOviServiceSession::ApplyTransportPropertiesLC(const TDesC8& aTransportProperties)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ApplyTransportPropertiesL():");
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aTransportProperties));
+    CSenXmlReader* reader = XmlReader();
+   TPtrC8 value;
+    CSenHttpTransportProperties* httpTransProp = NULL;
+    if (aTransportProperties.Length() <= KSenXmlPropertiesLocalname().Length()*2 
+                                                                    + KSenLessThanSlash().Length()
+                                                                    + KSenLessThan().Length()
+                                                                    + KSenGreaterThan().Length()*2)
+        {
+        if (iTransProp && iTransProp->Length())
+            {
+            httpTransProp = CSenHttpTransportProperties::NewLC(*iTransProp, *reader);
+            }
+        else
+            {
+            httpTransProp = CSenHttpTransportProperties::NewLC();
+            }
+        }
+    else
+        {
+        httpTransProp = CSenHttpTransportProperties::NewLC(aTransportProperties, *reader);
+        if (iTransProp) 
+            {
+            //1 merge session and message layer transport properties
+            CSenHttpTransportProperties* conHttpTransProp = CSenHttpTransportProperties::NewLC(*iTransProp, *reader);
+            
+            if (httpTransProp->ProxyHostL(value) == KErrNotFound)
+                {
+                if (conHttpTransProp->ProxyHostL(value) != KErrNotFound)
+                    {
+                    httpTransProp->SetProxyHostL(value);
+                    }
+                }
+            if (httpTransProp->PropertyL(KNCIMEndpoint, value) == KErrNotFound)
+                {
+                if (conHttpTransProp->PropertyL(KNCIMEndpoint, value) != KErrNotFound)
+                    {
+                    httpTransProp->SetPropertyL(KNCIMEndpoint, value);
+                    }
+                }
+            if (httpTransProp->PropertyL(KNCIMConsumerKeyId, value) == KErrNotFound)
+                {
+                if (conHttpTransProp->PropertyL(KNCIMConsumerKeyId, value) != KErrNotFound)
+                    {
+                    httpTransProp->SetPropertyL(KNCIMConsumerKeyId, value);
+                    }
+                }
+            if (httpTransProp->PropertyL(KNCIMConsumerSecret, value) == KErrNotFound)
+                {
+                if (conHttpTransProp->PropertyL(KNCIMConsumerSecret, value) != KErrNotFound)
+                    {
+                    httpTransProp->SetPropertyL(KNCIMConsumerSecret, value);
+                    }
+                }
+            if (httpTransProp->PropertyL(KNCIMConsumerServiceId, value) == KErrNotFound)
+                {
+                if (conHttpTransProp->PropertyL(KNCIMConsumerServiceId, value) != KErrNotFound)
+                    {
+                    httpTransProp->SetPropertyL(KNCIMConsumerServiceId, value);
+                    }
+                }
+            
+            TBool boolValue;
+            if (httpTransProp->OnewayMessageOnOffL(boolValue) == KErrNotFound)
+                {
+                if (conHttpTransProp->OnewayMessageOnOffL(boolValue) != KErrNotFound)
+                    {
+                    httpTransProp->SetOnewayMessageOnOffL(boolValue);
+                    }
+                }
+            if (httpTransProp->BoolPropertyL(KSenIAPDoNotPrompt, boolValue) == KErrNotFound)
+                {
+                if (conHttpTransProp->BoolPropertyL(KSenIAPDoNotPrompt, boolValue) != KErrNotFound)
+                    {
+                    httpTransProp->SetBoolPropertyL(KSenIAPDoNotPrompt, boolValue);
+                    }
+                }
+            if (httpTransProp->UserAgentL(value) == KErrNotFound)
+                {
+                if (conHttpTransProp->UserAgentL(value) != KErrNotFound)
+                    {
+                    httpTransProp->SetUserAgentL(value);
+                    }
+                }
+            TUint32 uint32value;
+            if (httpTransProp->IapIdL(uint32value) == KErrNotFound)
+                {
+                if (conHttpTransProp->IapIdL(uint32value) != KErrNotFound)
+                    {
+                    httpTransProp->SetIapIdL(uint32value);
+                    httpTransProp->SetSnapIdL(0);
+                    }
+                }
+            if (httpTransProp->SnapIdL(uint32value) == KErrNotFound)
+                {
+                if (conHttpTransProp->SnapIdL(uint32value) != KErrNotFound)
+                    {
+                    httpTransProp->SetSnapIdL(uint32value);
+                    httpTransProp->SetIapIdL(0);
+                    }
+                }
+            
+            TInt intValue;
+            if (httpTransProp->MaxTimeToLiveL(intValue) == KErrNotFound)
+                {
+                if (conHttpTransProp->MaxTimeToLiveL(intValue) != KErrNotFound)
+                    {
+                    httpTransProp->SetMaxTimeToLiveL(intValue);
+                    }
+                }
+
+            CleanupStack::PopAndDestroy(conHttpTransProp);    
+            }
+        }
+    
+    return httpTransProp;
+    }
+
+TInt CWSOviServiceSession::SendL( const TDesC8& aMessage, 
+                                   const TDesC8& aTransportProperties,
+                                   MSenRemoteServiceConsumer& aConsumer,
+                                   TInt& aTxnId,
+                                   HBufC8*& aRevalidationError )
+    {
+    TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KMinLogLevel ,"CWSOviServiceSession::SendL(TDesC8&, ...)");
+    TInt retVal(KErrNone);
+    if ( AmIHostletSession() )
+        {
+        TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KMinLogLevel ,"- This is a session for a hostlet.");
+        retVal  = CSenWebServiceSession::SendL( aMessage, aTransportProperties, aConsumer, aTxnId, aRevalidationError );
+        TLSLOG_FORMAT((KSenClientSessionLogChannelBase+aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Return value from CSenWebServiceSession::SendL: %d"), retVal ));
+        TLSLOG_FORMAT((KSenClientSessionLogChannelBase+aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Transaction ID from transport: %d"), aTxnId ));
+        }
+    else
+        {
+        TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KMinLogLevel ,"- This is a session for a consumer.");
+        PrepareOutCtxL(aMessage);
+        VerifyPermissionL();
+        //we still have to check if validUntil is not expired.
+        retVal = RevalidateMobileTicketIfExpiredL( aRevalidationError );
+        iSessionContext->Update(WSOviContextKeys::KOnlySharing, ETrue);
+
+        if( retVal == KErrNone )
+            {
+            delete aRevalidationError; 
+            aRevalidationError = NULL;
+            CSenHttpTransportProperties* transProp = ApplyTransportPropertiesLC(aTransportProperties);
+            retVal = MessageForSendingL(transProp, aConsumer.Id());
+            if (aMessage.Length())
+                {
+                transProp->SetContentTypeL(OAuth::KFormUrlEncoded());
+                }
+            
+            HBufC8* utfTP = transProp->AsUtf8L();
+            CleanupStack::PushL(utfTP);
+            MSenTransport& transport = aConsumer.TransportL();
+            AdaptEndpointL(EFalse);
+            const TDesC8* message = iOutContext->GetDesC8L(WSOviContextKeys::KMessageBody);
+            if (message)
+                {
+                retVal = transport.SendL(Endpoint(), *message, *utfTP, *this, aConsumer, aTxnId );
+                }
+            else
+                {
+                retVal = transport.SendL(Endpoint(), aMessage, *utfTP, *this, aConsumer, aTxnId );
+                }
+            AdaptEndpointL(ETrue);
+            CleanupStack::PopAndDestroy(utfTP);    
+            CleanupStack::PopAndDestroy(transProp);    
+            DestroyOutCtx();
+            }
+        }
+    return retVal;
+    }
+
+
+TInt CWSOviServiceSession::SubmitL( const TDesC8& aMessage, 
+                                     const TDesC8& aTransportProperties,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     HBufC8*& aResponse )
+    {
+    TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId() ,KMinLogLevel ,"CWSOviServiceSession::SubmitL(TDesC8&, ...)");
+    TInt retVal(KErrNone);
+    if (!AmIHostletSession())
+        {
+        PrepareOutCtxL(aMessage);
+        CSenHttpTransportProperties* transProp = ApplyTransportPropertiesLC(aTransportProperties);
+        retVal = MessageForSendingL(transProp, aConsumer.Id());
+        if (aMessage.Length())
+            {
+            transProp->SetContentTypeL(OAuth::KFormUrlEncoded());
+            }
+
+        
+        HBufC8* utfTP = transProp->AsUtf8L();
+        CleanupStack::PushL(utfTP);
+        MSenTransport& transport = aConsumer.TransportL();
+        AdaptEndpointL(EFalse);
+
+        const TDesC8* message = iOutContext->GetDesC8L(WSOviContextKeys::KMessageBody);
+        if (message)
+            {
+            retVal = transport.SubmitL(Endpoint(), *message, *utfTP, aResponse, aConsumer);
+            }
+        else
+            {
+            retVal = transport.SubmitL(Endpoint(), aMessage, *utfTP, aResponse, aConsumer);
+            }   
+        
+        MSenProperties& prop = transport.PropertiesL();
+        ((CWSOviPlugin&)iFramework).ProcessInboundDispatchL(this, retVal, aResponse, &prop );
+        
+        AdaptEndpointL(ETrue);
+        CleanupStack::PopAndDestroy(utfTP);
+        CleanupStack::PopAndDestroy(transProp);
+        DestroyOutCtx();
+
+        if (retVal == KErrNone)
+            {
+            iSubmitState = WSOviSession::KSubmitStateOK;
+            }
+
+    //becouse of lack phase (dispatch to proprr consumer). 
+    //It is SUBMIT nature, only used internally between Client and NAUTH
+    //we have to make validation here
+        CWSOviSessionConsumer* consumer = NULL;
+        if (iInContext)
+            {
+            SessionConsumerL(iInContext, consumer);    
+            if (!(consumer && consumer->Id() == aConsumer.Id()))
+                {
+                retVal = KErrNotFound;
+                }
+            }
+        }
+    return retVal;
+    }
+
+void CWSOviServiceSession::AdaptEndpointL(TBool aToOrginal)
+    {
+    TPtrC8 oldEndpoint = Endpoint();
+    if (aToOrginal)
+        {
+        SetEndPointL(*iOrginalEndpoint);
+        return;
+        }
+    
+    delete iOrginalEndpoint;
+    iOrginalEndpoint = NULL;
+    iOrginalEndpoint = oldEndpoint.AllocL();
+    
+    HBufC8* newEp(NULL);
+/*    CSenIdentityProvider* pIdentityProvider = IdentityProviderFromCoreL(ProviderID());
+    if (pIdentityProvider)
+        {
+        TPtrC8 advAuth = pIdentityProvider->AdvisoryAuthnID();
+        
+        newEp = HBufC8::NewLC(oldEndpoint.Length()
+                                + advAuth.Length());
+        TPtr8 ptr = newEp->Des();
+        _LIT8(KMask, "%S");
+        TInt pos = oldEndpoint.Find(KMask());
+        if (pos != KErrNotFound)
+            {
+            ptr.Append(oldEndpoint.Left(pos));
+            ptr.Append(advAuth);
+            ptr.Append(oldEndpoint.Right(oldEndpoint.Length() - pos - KMask().Length()));
+            SetEndPointL(ptr);
+            }
+        
+        CleanupStack::PopAndDestroy(newEp);    
+        }
+*/  
+    CSenTransportProperties* tp = iOutContext->TP();
+    if (tp)
+        {
+        TInt err(KErrNone);
+        TPtrC8 suffixEndpoint;
+        err = tp->EndpointResourceL(suffixEndpoint);
+        if (!err)
+            {
+            newEp = HBufC8::NewLC(suffixEndpoint.Length()
+                                  +oldEndpoint.Length());
+            TPtr8 ptrNewEp = newEp->Des();
+            ptrNewEp.Append(oldEndpoint);
+            ptrNewEp.Append(suffixEndpoint);
+            SetEndPointL(*newEp);
+            CleanupStack::PopAndDestroy(newEp);
+            }
+        }
+    }
+CSenIdentityProvider* CWSOviServiceSession::IdentityProviderFromCoreL(
+                                            const TDesC8& aProviderID)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::IdentityProviderLFromCore");
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if(aProviderID.Length() > 0)
+        {
+        CDesC8ArrayFlat* array = new (ELeave) CDesC8ArrayFlat(1);
+        CleanupStack::PushL(array);
+        array->AppendL(aProviderID);
+        pIdentityProvider = ((CWSOviPlugin&)iFramework).Manager().IdentityProviderL(*array, ETrue);
+        CleanupStack::PopAndDestroy(array);
+        }
+    return pIdentityProvider;
+    }
+TInt CWSOviServiceSession::CanHandleErrorL()
+    {
+    TInt answer(KErrNone);
+    const TInt* renewNeeded(NULL);
+    const TInt* retry = iSessionContext->GetIntL(WSOviContextKeys::KRetryNeeded());
+
+    
+    
+    
+    if (iSessionContext)
+        {
+        renewNeeded = iSessionContext->GetIntL(WSOviContextKeys::KReAuthNeeded());
+        }
+    //retry in milisecunds
+    if (retry && *retry > 0 &&
+        iRetryCounter < WSOviSession::KCounterMax)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::CanHandleErrorL - RETRY request (new timestamp needed)");
+        iRetryCounter++;
+        answer = KErrSenResendRequired;  
+        }
+    else if((renewNeeded && *renewNeeded &&
+           iRenewCounter < WSOviSession::KCounterMax)
+           )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::CanHandleErrorL - RENEW request (new ticket is needed)");
+        iRenewCounter++;
+        answer = KErrSenReinitRequired;                    
+        }
+    else
+        {
+        iRenewCounter = 0;
+        iRetryCounter = 0;
+        }
+    return answer;
+    }
+TInt CWSOviServiceSession::SendToConsumerL(HBufC8* aMessage,
+                              const TInt aTxnId,
+                              MSenRemoteServiceConsumer& aConsumer,
+                              MSenProperties* aResponseTransportProperties)
+    {
+    ((CWSOviPlugin&)iFramework).ProcessInboundDispatchL(this, KErrNone, aMessage, aResponseTransportProperties);
+    TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId()  , KMinLogLevel,"CWSOviServiceSession::ParseMessageL(CSenSoapMessage& )");
+    iRenewCounter = 0;
+    iRetryCounter = 0;
+    return aConsumer.HandleMessageL( aMessage, aTxnId, aResponseTransportProperties );
+    }
+    
+TInt CWSOviServiceSession::SendErrorToConsumerL( const TInt aErrorCode,
+                                                     HBufC8* apError,
+                                                     const TInt aTxnId,
+                                                     MSenRemoteServiceConsumer& aConsumer,
+                                                     MSenProperties* aResponseTransportProperties )
+    {
+    TLSLOG_L(KSenClientSessionLogChannelBase+aConsumer.ConnectionId()  , KMinLogLevel,"CWSOviServiceSession::SendErrorToConsumerL");
+    TLSLOG_FORMAT((KSenClientSessionLogChannelBase+aConsumer.ConnectionId(), KNormalLogLevel , _L8("- ErrorCode: %d"), aErrorCode ));
+    ((CWSOviPlugin&)iFramework).ProcessInboundDispatchL(this, aErrorCode, apError, aResponseTransportProperties);
+    TInt answer = CanHandleErrorL();
+    if (answer)
+        {
+        delete apError;
+        return aConsumer.HandleErrorL(NULL, answer, aTxnId, aResponseTransportProperties);
+        }
+    else
+        {
+        return HandleErrorL(aErrorCode, apError, aTxnId, aConsumer, aResponseTransportProperties);
+        }
+    }
+    
+    
+    
+TInt CWSOviServiceSession::SubmitSoapL( const TDesC8& /*aSoapMessage*/, 
+                                         const TDesC8& /*aTransportProperties*/,
+                                         MSenRemoteServiceConsumer& /*aConsumer*/,
+                                         HBufC8*& /*aResponse*/ )
+    {
+    return KErrNotSupported;
+    }
+
+TInt CWSOviServiceSession::SendSoapL( const TDesC8& /*aSoapMessage*/, 
+                                       const TDesC8& /*aTransportProperties*/,
+                                       MSenRemoteServiceConsumer& /*aConsumer*/,
+                                       TInt& /*aTxnId*/,
+                                       HBufC8*& /*aRevalidationError*/ )
+    {
+    return KErrNotSupported;
+    }
+
+  
+TBool CWSOviServiceSession::IsExpiredL()
+    {
+    CSenServiceSession::SetStatusL();
+    return (CSenServiceSession::StatusL() == KSenConnectionStatusExpired);
+    }
+    
+        
+void CWSOviServiceSession::SetSessionContext(CWSOviSessionContext* aContext)
+    {
+    delete iSessionContext;
+    iSessionContext = aContext;
+    }
+CWSOviSessionContext* CWSOviServiceSession::SessionContext()
+    {
+    return iSessionContext;
+    }
+    
+void CWSOviServiceSession::ClearCredentialL()
+    {
+    // Before removing the credential, checkt that
+    // iCredentialPtr.Credential() != NULL
+    if ( HasSecurity() ) // this performs the NULL check for credential
+    	{
+	    // Remove Invalid Credential from Credentials DB
+	    TInt credentialId = iCredentialPtr.Credential()->IdentifierL().IdL();
+	    ((MSenServiceManager&)iFramework.Manager()).RemoveCredentialL(credentialId);
+    	}
+
+    // Remove Credential usage from Session
+    SetSecurityL(KNullDesC8);
+    iValidUntil.Set(_L("18000101:"));
+    }
+    
+TInt CWSOviServiceSession::InitializeFromL( MSenServiceDescription& aDescription)
+    {
+    CSenWebServiceSession::SetSecurityL(KNullDesC8);
+    iValidUntil.Set(_L("19000101:"));
+    
+    TDescriptionClassType classType = aDescription.DescriptionClassType();
+    if( classType == MSenServiceDescription::EWSDescription
+                                            ||
+        classType == MSenServiceDescription::EWSPattern
+                                            ||
+        classType == MSenServiceDescription::EIdentityProvider
+        )
+        {
+        MSenElement& xmlSdAsElement = (
+            (CSenWSDescription*)&aDescription)->AsElement();
+
+
+        MSenElement* pElement = xmlSdAsElement.Element(KSenIdpProviderIdLocalname);
+        delete iProviderID;
+        iProviderID = NULL;
+        if(pElement)
+            {
+            iProviderID = pElement->Content().AllocL();
+            }
+        else
+            {
+            CSenIdentityProvider* provider = ((CWSOviPlugin&)iFramework).
+                    Manager().IdentityProviderL(aDescription);
+            if (provider)
+                {
+                iProviderID = provider->ProviderID().AllocL();
+                }
+            }
+        pElement = xmlSdAsElement.Element(WSOviSession::KTrustAnchorElementLocalName);
+        if(pElement)
+            {
+            delete iTrustAnchor;
+            iTrustAnchor = NULL;
+            iTrustAnchor = pElement->Content().AllocL();
+            }
+        
+        CSenXmlReader* reader = XmlReader();
+        if (!iSessionContext) 
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::InitializeFromL");
+            iSessionContext = CWSOviSessionContext::NewL();
+            
+            //calling higher class load such things like iClientServerInterval
+            CSenWebServiceSession::InitializeFromL(aDescription);
+            if ( StatusL() != KSenConnectionStatusReady )
+                {
+                // Try to search Credential directly from CredentialManager
+                // if Connection/Credential is not ready
+                if ( TryToSearchValidCredentialL() == KErrNone )	//codescannerwarnings
+                    {
+                    SetStatusL();
+                    }
+                }
+            if (!iCredentialPtr.Credential())
+                {
+                pElement = xmlSdAsElement.Element(WSOviSession::KTokenCreationTimeLocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSOviContextKeys::KTokenCreationTime, pElement->Content()));    
+                    }
+                pElement = xmlSdAsElement.Element(WSOviSession::KTTLLocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSOviContextKeys::KTTL, pElement->Content()));    
+                    }
+                pElement = xmlSdAsElement.Element(WSOviSession::KTokenSecretLocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSOviContextKeys::KTokenSecret, pElement->Content()));    
+                    }
+                }
+            AddSecurityTokenToContextL();
+            }
+        }
+    else
+        {
+        CSenWebServiceSession::InitializeFromL(aDescription);
+        }
+        
+    return KErrNone;
+    }
+    
+void CWSOviServiceSession::AddSecurityTokenToContextL()
+    {
+    if ( HasSecurity() )
+        {
+        CSenCredentialProperties& properties = iCredentialPtr.Credential()->PropertiesL();  //codescannerwarnings
+        TInt retVal;
+        TPtrC8 value;
+        if ( iSessionContext )
+            {
+            retVal = properties.PropertyL(WSOviSession::KTokenCreationTimeLocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSOviContextKeys::KTokenCreationTime, value));    
+                }
+            retVal = properties.PropertyL(WSOviSession::KTTLLocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSOviContextKeys::KTTL, value));    
+                }
+            retVal = properties.PropertyL(WSOviSession::KTokenSecretLocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSOviContextKeys::KTokenSecret, value));    
+                }
+        
+	        HBufC8* pSecurity = SecurityL();
+	        if (pSecurity)
+	            {
+	            CleanupStack::PushL(pSecurity);
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::InitializeFromL - adding token to ctx");
+
+	            User::LeaveIfError(iSessionContext->Add(
+	                    WSOviContextKeys::KToken,
+	                    *pSecurity));  
+	            CleanupStack::PopAndDestroy(pSecurity);
+	            } 
+			}		
+        }
+    }
+
+void CWSOviServiceSession::AddPropertiesFromSessionContextToCredentialL()
+    {
+    if (iSessionContext)
+        {
+        if ( iCredentialPtr.Credential() )
+            {
+            CSenCredentialProperties& properties = iCredentialPtr.Credential()->PropertiesL();  //codescannerwarnings
+            const TDesC8* pValue = iSessionContext->GetDesC8L(WSOviContextKeys::KTokenCreationTime);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSOviSession::KTokenCreationTimeLocalName(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSOviContextKeys::KTTL);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSOviSession::KTTLLocalName(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSOviContextKeys::KTokenSecret);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSOviSession::KTokenSecretLocalName(), *pValue);
+                }        
+
+            // Now, serialize this session (and all it's updated credentials) into database(s)
+            iFramework.Manager().SaveL( *this ); // this will currently *also* serialize associated credential (new/updated MT)                
+            }
+        }
+    }
+
+
+void CWSOviServiceSession::WriteExtensionsAsXMLToL(RWriteStream& aWriteStream)
+    {
+    CSenWebServiceSession::WriteExtensionsAsXMLToL(aWriteStream);
+
+    if(iProviderID)
+        {
+        aWriteStream.WriteL(WSOviSession::KProviderIDTag);
+        aWriteStream.WriteL(*iProviderID);
+        aWriteStream.WriteL(WSOviSession::KProviderIDEndTag);
+        }
+
+    if(iTrustAnchor)
+        {
+        aWriteStream.WriteL(WSOviSession::KTrustAnchorTag);
+        aWriteStream.WriteL(*iTrustAnchor);
+        aWriteStream.WriteL(WSOviSession::KTrustAnchorEndTag);
+        }
+    if (iSessionContext)
+    	{
+        if (!iCredentialPtr.Credential() )
+            {
+            const TDesC8* value = iSessionContext->GetDesC8L(WSOviContextKeys::KTokenCreationTime);
+            if (value)
+                {
+                aWriteStream.WriteL(WSOviSession::KTokenCreationTimeTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSOviSession::KTokenCreationTimeEndTag);
+                }
+            value = iSessionContext->GetDesC8L(WSOviContextKeys::KTTL);
+            if (value)
+                {
+                aWriteStream.WriteL(WSOviSession::KTTLTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSOviSession::KTTLEndTag);
+                }
+            value = iSessionContext->GetDesC8L(WSOviContextKeys::KTokenSecret);
+            if (value)
+                {
+                aWriteStream.WriteL(WSOviSession::KTokenSecretTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSOviSession::KTokenSecretEndTag);
+                }
+            }
+    	}
+    }
+    
+TPtrC8 CWSOviServiceSession::ProviderID()
+    {
+    if(iProviderID)
+        return *iProviderID;
+    else
+        return KNullDesC8();
+   
+    }
+
+void CWSOviServiceSession::SetProviderIDL(const TDesC8& aProviderId)
+    {
+    if (iProviderID)
+        {
+        delete iProviderID;
+        iProviderID = NULL;
+        }
+    iProviderID = aProviderId.AllocL();
+    }
+
+
+void CWSOviServiceSession::SetTrustAnchorL(const TDesC8& aURI)
+    {
+    delete iTrustAnchor;
+    iTrustAnchor = NULL;
+    iTrustAnchor = aURI.AllocL();
+    }
+TPtrC8 CWSOviServiceSession::TrustAnchor()
+    {
+    if(iTrustAnchor)
+        return *iTrustAnchor;
+    else
+        return KNullDesC8();
+    }
+
+TInt CWSOviServiceSession::ComputeStatusL()
+    {
+    
+    TInt retVal = CSenServiceSession::ComputeStatusL();
+    //we copy logic from CSenWebServiceSession and add :1) IProviderID condition
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSOviServiceSession::ComputeStatusL() - retval: %d"), retVal));
+    if ((retVal == KSenConnectionStatusReady) && iProviderID)
+        {
+        const TDesC8*  tokenCreatedTimeDes = NULL;
+        const TDesC8*  ttlDes = NULL;
+        TPtrC8 tokenCreationTimePtr;
+        TPtrC8 ttlPtr;
+        
+        if ( HasSecurity() )
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ComputeStatusL() - HasSecurity true");
+            
+            CSenCredentialProperties& properties = iCredentialPtr.Credential()->PropertiesL();  //codescannerwarnings
+            TInt retVal(KErrNone);
+            retVal = properties.PropertyL(WSOviSession::KTokenCreationTimeLocalName(), tokenCreationTimePtr);
+            if (!retVal)
+                {
+                tokenCreatedTimeDes = &tokenCreationTimePtr;    
+                }
+            retVal = properties.PropertyL(WSOviSession::KTTLLocalName(), ttlPtr);
+            if (!retVal)
+                {
+                ttlDes = &ttlPtr;
+                }
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ComputeStatusL() - HasSecurity false");
+            if (iSessionContext)
+                {
+                tokenCreatedTimeDes = iSessionContext->GetDesC8L(WSOviContextKeys::KTokenCreationTime);
+                ttlDes = iSessionContext->GetDesC8L(WSOviContextKeys::KTTL);
+                }
+            }
+        if (tokenCreatedTimeDes && ttlDes)
+	        {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSOviServiceSession::ComputeStatusL() - ttlDes: %S & tokencreationDes: %S"), ttlDes, tokenCreatedTimeDes));
+			TInt64 tokenCreatedTime(0);
+			TInt64 ttl(0);
+			TLex8 temp;
+			  
+			temp= *tokenCreatedTimeDes;
+			temp.Val(tokenCreatedTime);
+			  
+			temp = *ttlDes;
+			temp.Val(ttl);
+               
+			if (tokenCreatedTime && ttl) 
+				{
+				HBufC8* nowTimeDes = SenCryptoUtils::GetTimestampL();
+				TInt64 nowTime(0);
+				temp = *nowTimeDes;
+				temp.Val(nowTime);
+				delete nowTimeDes;
+               	
+				if (nowTime) 
+					{
+					TTimeIntervalSeconds margin(KClockSlipSeconds);
+					TTimeIntervalSeconds diff = tokenCreatedTime + ttl -margin.Int() - nowTime;
+	                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSOviServiceSession::ComputeStatusL() - diff: %d "), diff.Int()));
+					if (diff.Int()<0) 
+						{
+						retVal = KSenConnectionStatusExpired;
+						}
+					}
+               }
+	        }
+        else
+            {
+            retVal = KSenConnectionStatusExpired;
+            }
+        }
+    return retVal;
+
+    } 
+    
+void CWSOviServiceSession::PrepareOutCtxL(const TDesC8& aMessageBody)
+    {
+    iClientTime.UniversalTime();
+    
+    CSenXmlReader* reader = XmlReader();
+    if (iOutContext)
+        {
+        delete iOutContext;
+        iOutContext = NULL;
+        }
+    iOutContext = CWSOviMessageContext::NewL(SenContext::EOutgoing);
+    if (aMessageBody != KNullDesC8)
+        {
+        iOutContext->Update(WSOviContextKeys::KMessageBody, aMessageBody);
+        }
+    }
+
+void CWSOviServiceSession::DestroyOutCtx()
+    {
+    delete iOutContext;
+    iOutContext = NULL;
+    }
+
+TInt CWSOviServiceSession::RevalidateMobileTicketIfExpiredL( HBufC8*& aErrorMessage ) 
+    {
+    TInt result(KErrNone);
+    if (IsExpiredL())
+        {
+        //we need revalidate
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviServiceSession::RevalidateMobileTicketIfExpiredL - revalidation is required.")));
+        iTokenObs->Cancel();
+        result = ((CWSOviPlugin&)iFramework).ProcessOutboundValidationL( *this, this, aErrorMessage );
+        if ( result == KErrNone )
+            {
+            // validation succeeded => serialize this session (and its credentials immediately)
+            iFramework.Manager().SaveL( *this ); // this will currently *also* serialize associated credential (new/updated MT)
+            }
+        if (result > KErrNone)
+            {
+            result = KErrSenAuthenticationFault;
+            }
+        return result;
+        }
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviServiceSession::RevalidateMobileTicketIfExpiredL - ticket is still valid.")));        
+    return KErrNone;
+    }
+    
+TBool CWSOviServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWebServiceSession ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWebServiceSession::HasSuperClass( aType ); 
+        }
+    }
+
+TInt CWSOviServiceSession::ShareTokenWithL( CWSOviServiceSession* aWSOviSessionDst)
+    {
+    TInt error(KErrNone);
+    if ( !HasSecurity() )
+        {
+        return KErrNotFound;
+        }
+    //share token (only not expired), otherway it is sensless
+    //dont call SetStatus/IsExpired becouse it will infornm consumer/Core about chnge. 
+    //Session will not be able to revalidate by itself in next sending
+    if (ComputeStatusL() != KSenConnectionStatusExpired)
+        {
+
+        error = iSessionContext->ShareTokenWithL(
+                aWSOviSessionDst->SessionContext());        
+                
+        aWSOviSessionDst->AddCredentialL(iCredentialPtr, iValidUntil);
+        return error;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+    
+void CWSOviServiceSession::AddCredentialL( const TDesC8& aSecurity, TTime aValidUntil )
+    {
+    iValidUntil = aValidUntil;
+    SetSecurityL(aSecurity);
+    SetStatusL();
+    }
+    
+void CWSOviServiceSession::AddCredentialL(RSenCredentialPtr aCredentialPtr, TTime aValidUntil)
+    {
+    iValidUntil = aValidUntil;
+    SetCredentialPtrL(aCredentialPtr); // Share same Credential between multiple Sessions	//codescannerwarnings
+    SetStatusL();
+    }
+    
+TBool CWSOviServiceSession::AmIHostletSession()
+    {
+    if(iTransportCue && (KSenTransportCueHostletConnection() == *iTransportCue))
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+    
+
+void CWSOviServiceSession::FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::FillCredentialIdentifierL:");
+    CSenWebServiceSession::FillCredentialIdentifierL(aIdentifier);
+    //_LIT8(KProviderIdElementLocalName,  "ProviderID");
+    //aIdentifier.SetPropertyL(KProviderIdElementLocalName, ProviderID());
+
+    TPtrC8 providerId = ProviderID();
+    aIdentifier.SetPropertyL(KSenIdpProviderIdLocalname, providerId);
+    
+    // Add information about the account that is priviledged to consume this credential
+    
+    // (a) find matching IDP description (which represents the account / userinfo)
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- About to call LookupIdentityProviderL");
+    CSenIdentityProvider* pIdentityProvider = LookupIdentityProviderL();
+//    CSenIdentityProvider* pIdentityProvider = NULL;
+//    if ( providerId != KNullDesC8 )
+//        {
+//        LOG_WRITEFORMAT((_L8("- Searching for IdentityProvider using ProviderId : %S"), &providerId));
+//        CSenWSDescription* pIdpPattern = CSenWSDescription::NewLC();
+//        pIdpPattern->SetEndPointL(providerId);
+//        pIdentityProvider = iFramework.Manager().IdentityProviderL(*pIdpPattern);
+//        CleanupStack::PopAndDestroy(pIdpPattern);
+//        }
+
+    if ( pIdentityProvider )
+        {
+        TPtrC8 username = pIdentityProvider->UserName();
+        if( username.Length() > 0 )
+            {
+            aIdentifier.SetPropertyL(KSenIdpAuthzIDLocalname, username);
+            }
+        TPtrC8 password = pIdentityProvider->Password();
+        if( password.Length() > 0 )
+            {
+            aIdentifier.SetPropertyL(KSenIdpPasswordLocalname, password);
+            }
+        }
+    }
+    
+void CWSOviServiceSession::VerifyPermissionL()
+    {
+    if( HasSecurity() )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::VerifyPermissionL:");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Making call to LookupIdentityProviderL");
+        CSenIdentityProvider* pProvider = LookupIdentityProviderL();
+        if ( pProvider )
+            {
+            CSenCredentialIdentifier& identifier = iCredentialPtr.Credential()->IdentifierL();
+            TPtrC8 username; // that was used to acquire this credential
+            TInt retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, username);
+            
+            TPtrC8 password; // that was used to acquire this credential
+            retVal = identifier.PropertyL(KSenIdpPasswordLocalname, password);
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("=> Credential properties: username = '%S', password = '%S'"), &username, &password));
+
+            TPtrC8 accountUsername = pProvider->UserName();
+            TPtrC8 accountPassword = pProvider->Password();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("=> Candidate IDP details: username = '%S', password = '%S'"), &accountUsername, &accountPassword));
+            
+            if( ( username.Length() > 0 && username != accountUsername ) ||
+                ( password.Length() > 0 && password != accountPassword ) )
+                {
+                // either username or password DOES NOT MATCH (and the mismatching
+                // one is not zero-length string)
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"-> Will not grant permission to consume current credential,");
+
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"   clearing credential & it's properties from context.");
+                SetSecurityL(KNullDesC8);
+                ClearCredentialPropertiesFromContext();
+                }
+             else 
+                { 
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"--> Permission to consume current credential is granted.");
+                // => Permission to consume this credential is granted(!) 
+                }
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- There is no IDP (account), clearing credential & it's properties from context.");
+            // It is not possible to consumer WS-* service(s) without IDP (account)
+            SetSecurityL(KNullDesC8);
+            ClearCredentialPropertiesFromContext();
+            }
+        }
+    else
+        {
+        // If session has no credential (neither MT or SCT), neither should it have any 
+        // related data in context(!)
+        //--> LOG_WRITE_L("- There is no credential, clearing credential properties from context.");
+        //--> SetSecurityL(KNullDesC8);
+        ClearCredentialPropertiesFromContext();
+        }        
+    }
+    
+CSenIdentityProvider* CWSOviServiceSession::LookupIdentityProviderL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::LookupIdpL()");
+    TPtrC8 providerId = ProviderID();
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if ( providerId != KNullDesC8 )
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Searching for IdentityProvider using ProviderId : %S"), &providerId));
+        CSenWSDescription* pIdpPattern = CSenWSDescription::NewLC();
+        pIdpPattern->SetEndPointL(providerId);
+        pIdentityProvider = iFramework.Manager().IdentityProviderL(*pIdpPattern);
+        CleanupStack::PopAndDestroy(pIdpPattern);
+        }
+    return pIdentityProvider;
+    }
+     
+    
+  
+TBool CWSOviServiceSession::HasEqualPrimaryKeysL( MSenServiceDescription& aCandidate )
+    {
+    TBool retVal(EFalse);
+    if ( CSenWSDescription::HasEqualPrimaryKeysL(aCandidate) )
+        {
+        // Endpoint, Contract and FrameworkID match, all of them.
+        // Now, in WS-Ovi, also check ProviderID
+        if (aCandidate.DescriptionClassType() == DescriptionClassType())
+            {
+            CWSOviServiceSession& sessionCandidate = (CWSOviServiceSession&)aCandidate;
+            if (sessionCandidate.ProviderID() == ProviderID())
+                {
+                retVal = ETrue;
+                }
+            }
+        }
+    return retVal; 
+    }
+    
+void CWSOviServiceSession::CredentialChanged( TSenCredentialChange aChange,
+		                                       TAny* apPointer )
+    {
+    if ( aChange == MSenCredentialObserver::EDestroyed && iSessionContext )
+        {
+        ClearCredentialPropertiesFromContext();
+        }
+    else if ( aChange == MSenCredentialObserver::EAdded && iSessionContext)
+    	{
+    	AddSecurityTokenToContextL();
+    	}
+    CSenWebServiceSession::CredentialChanged( aChange, apPointer );
+    }
+
+
+void CWSOviServiceSession::ClearCredentialPropertiesFromContext()
+    {
+    if( iSessionContext )
+        {
+        iSessionContext->Remove(WSOviContextKeys::KToken);    
+        iSessionContext->Remove(WSOviContextKeys::KTokenCreationTime);
+        iSessionContext->Remove(WSOviContextKeys::KTTL);
+        iSessionContext->Remove(WSOviContextKeys::KTokenSecret);
+        }
+    }
+void CWSOviServiceSession::SetMaxValidUntil()
+    {
+    iValidUntil = Time::MaxTTime();
+    }
+
+void CWSOviServiceSession::ActiveTicketObserverL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ActiveTicketObserverL()");
+    if (iSessionContext)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ActiveTicketObserverL()- SessionContext exists");
+        const TDesC8*  tokenCreatedTimeDes = iSessionContext->GetDesC8L(WSOviContextKeys::KTokenCreationTime);
+        const TDesC8*  ttlDes = iSessionContext->GetDesC8L(WSOviContextKeys::KTTL);
+        if (tokenCreatedTimeDes && ttlDes)
+        	{
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ActiveTicketObserverL() - ttl & time creation exists");
+            TInt64 tokenCreatedTime(0);
+            TInt64 ttl(0);
+            TLex8 temp;
+            temp.Assign(*tokenCreatedTimeDes);
+            temp.Val(tokenCreatedTime);
+            
+            temp = *ttlDes;
+            temp.Val(ttl);
+            
+            if (tokenCreatedTime && ttl)
+            	{
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ActiveTicketObserverL() - ttl & time creation is valid");
+            	HBufC8* nowTimeDes = SenCryptoUtils::GetTimestampL();
+            	TInt64 nowTime(0);
+            	temp = *nowTimeDes;
+            	temp.Val(nowTime);
+            	delete nowTimeDes;
+            	if (nowTime)
+            		{
+            	    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ActiveTicketObserverL() - now time exists");
+            	    TInt marginForComputeStatus(10);
+                	TTimeIntervalSeconds margin(KClockSlipSeconds-marginForComputeStatus);
+                    TTimeIntervalSeconds diff = tokenCreatedTime + ttl -margin.Int() - nowTime;
+            		if (diff.Int()>=0)
+            			{
+            		    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviServiceSession::ActiveTicketObserverL() - start observer");
+            			iTokenObs->Start(diff);
+            			}
+            		}
+            	}
+        	}
+        }
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviserviceupdatehandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,221 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsoviserviceupdatehandler.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "wsovitokencreationresponse.h"
+#include "sencryptoutils.h"
+#include "wsovicons.h"
+#include "wsovierrorresponse.h"
+#include <httpstd.h>
+#include <SenHttpTransportProperties.h>
+#include "senlayeredhttptransportproperties.h"
+using namespace OAuth;
+
+
+
+class CWSOviHandlerContext;
+// Create instance of concrete ECOM interface implementation
+CWSOviServiceUpdateHandler* CWSOviServiceUpdateHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSOviServiceUpdateHandler* self   = new (ELeave) CWSOviServiceUpdateHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSOviServiceUpdateHandler::CWSOviServiceUpdateHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    
+    }
+
+// Destructor
+CWSOviServiceUpdateHandler::~CWSOviServiceUpdateHandler()
+    {
+    }
+
+// Second phase construction.
+void CWSOviServiceUpdateHandler::ConstructL()
+    {
+    }
+    
+TInt CWSOviServiceUpdateHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+    CWSOviServiceSession* remoteServiceSession =
+                               (CWSOviServiceSession*)aCtx.GetSenRemoteServiceSessionL(
+                                                           WSOviContextKeys::KServiceSession());                       
+    const TDesC8* message = ((CWSOviSessionContext&)aCtx).GetDesC8L(WSOviContextKeys::KMessageBody);
+    const TInt* errorCode = ((CWSOviSessionContext&)aCtx).GetIntL(WSOviContextKeys::KErrCode);
+    
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSOviPlugin::ProcessInboundDispatch")));
+    CWSOviServiceSession* oviServiceSession = ((CWSOviServiceSession*)remoteServiceSession);
+    CWSOviSessionContext& pCtx = (CWSOviSessionContext&)aCtx;
+    //fault scenarios
+    if (message && errorCode)
+    	{
+	    if (*errorCode == EHttp_401_Unauthorized-KHttpPluginStatusBase)
+	        {
+	        CWSOviErrorResponse* errFragment = CWSOviErrorResponse::NewLC();
+	        errFragment->SetReader(*iHandlerContext.GetSenCoreServiceManager()->XMLReader());
+	        errFragment->BuildFrom(*message);
+	        if (! errFragment->Code().Compare(WSOviResponse::KErrorCodeInvalidAccessToken()))
+	            {
+	            if (!pCtx.GetSenRemoteServiceSessionL(WSOviContextKeys::KServiceSession))
+	                {
+	                pCtx.Add(WSOviContextKeys::KServiceSession, *(MSenRemoteServiceSession*)remoteServiceSession);
+	                }
+	            pCtx.Update(WSOviContextKeys::KReAuthNeeded, ETrue);
+	            oviServiceSession->ClearCredentialL();
+	            oviServiceSession->SetStatusL();//in order to compute state
+	            }
+	        else if(! errFragment->Code().Compare(WSOviResponse::KErrorCodeUnauthorized()))
+	            {
+	            MSenProperties* tp = (MSenProperties*)pCtx.GetAnyL(WSOviContextKeys::KTP());
+	            if (tp) 
+	                {
+	                switch (tp->PropertiesClassType())
+	                    {
+	                    case MSenProperties::ESenHttpTransportProperties:
+	                        {
+	                        TInt minutes;
+	                        ((CSenHttpTransportProperties*)tp)->IntPropertyL(WSOviSession::KDateHttpHeader(), minutes);
+	                        pCtx.Update(WSOviContextKeys::KRetryNeeded, minutes);
+	                        }    
+	                    break;
+	                    case MSenProperties::ESenLayeredHttpTransportProperties:
+	                        {
+	                        TInt minutes;
+	                        ((CSenLayeredHttpTransportProperties*)tp)->IntPropertyL(WSOviSession::KDateHttpHeader(), minutes);
+	                        pCtx.Update(WSOviContextKeys::KRetryNeeded, minutes);
+	                        }    
+	                    default:
+	                    break;
+	                    }
+	                }
+	            }
+	        CleanupStack::PopAndDestroy(errFragment);
+	        }
+	    //positive scenario, for example: signup proces already returns token
+	    else if (*errorCode == KErrNone)
+	        {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviPlugin::ProcessInboundDispatch - token exists");
+            CWSOviTokenCreationResponse* responseFragment = CWSOviTokenCreationResponse::NewLC();
+            responseFragment->SetReader(*iHandlerContext.GetSenCoreServiceManager()->XMLReader());
+            responseFragment->BuildFrom(*message);
+            if (responseFragment->IsTokenUpdate())
+                {
+                TPtrC8 ttl = responseFragment->TTL();
+                TBool ttlInfinitive = EFalse;
+                if (ttl.Length())
+                    {
+                    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,ttl);
+                    User::LeaveIfError(pCtx.Update(WSOviContextKeys::KTTL,ttl));
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviPlugin::ProcessInboundDispatch - ttl is missing");
+                    const TInt KMaxTTLLength = 20;
+                    TBuf8<KMaxTTLLength> ttlMaxInt;
+                    ttlMaxInt.AppendNum(KMaxTInt);
+                    User::LeaveIfError(pCtx.Update(WSOviContextKeys::KTTL, ttlMaxInt));
+                    ttlInfinitive = ETrue;
+                    }
+                TPtrC8 tokenSecret = responseFragment->TokenSecret();
+                if (tokenSecret.Length())
+                    {
+                    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,tokenSecret);
+                    User::LeaveIfError(pCtx.Update(WSOviContextKeys::KTokenSecret,tokenSecret));
+                    }
+                HBufC8* created = SenCryptoUtils::GetTimestampL();
+                CleanupStack::PushL(created);
+                User::LeaveIfError(pCtx.Update(WSOviContextKeys::KTokenCreationTime,*created));        
+                CleanupStack::PopAndDestroy(created);
+                
+                TPtrC8 token = responseFragment->Token();
+                if (!token.Length())
+                    {
+                    pCtx.Remove(WSOviContextKeys::KTokenCreationTime);
+                    }
+                else
+                    {    
+                    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,token);
+                    if (!oviServiceSession->ExistConsumerL())
+                        {
+                        pCtx.Remove(WSOviContextKeys::KTokenCreationTime);
+                        }
+                    else
+                        {
+                        pCtx.SetTokenKeysL(token);
+                        }
+                    }
+                if (!ttlInfinitive)
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviPlugin::ProcessInboundDispatch - Call ActiveTicketObserverL()");
+                    oviServiceSession->ActiveTicketObserverL();
+                    }
+
+                TPtrC8 username = responseFragment->Username();
+                if (username.Length())
+                    {
+                    oviServiceSession->SetTrustAnchorL(username);
+                    oviServiceSession->SetProviderIDL(username);
+                    }
+                }
+            CleanupStack::PopAndDestroy(responseFragment);
+            pCtx.Update(WSOviContextKeys::KRetryNeeded, 0);
+	        }
+    	}
+    return KErrNone;
+    }
+    
+SenHandler::THandlerDirection CWSOviServiceUpdateHandler::Direction() const
+    {
+        return SenHandler::EIncoming;
+    };
+SenHandler::THandlerPhase CWSOviServiceUpdateHandler::Phase()
+    {
+        return SenHandler::EMessage;
+    };
+
+
+    
+//---------------------------------------------------------------------------
+// Logger using during DEBUG mode
+//---------------------------------------------------------------------------
+//    
+
+TInt CWSOviServiceUpdateHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovisessionconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+
+#include "wsovisessionconsumer.h"
+#include "sendebug.h"
+#include <SenServiceConnection.h>
+#include "senlogger.h"
+#include "wsovicons.h"
+#include "SenHttpTransportProperties.h"
+
+CWSOviSessionConsumer* CWSOviSessionConsumer::NewL( MSenRemoteServiceConsumer& aServiceConsumer)
+    {
+    CWSOviSessionConsumer* pSelf =
+        CWSOviSessionConsumer::NewLC(aServiceConsumer);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CWSOviSessionConsumer* CWSOviSessionConsumer::NewLC( MSenRemoteServiceConsumer& aServiceConsumer)
+    {
+    CWSOviSessionConsumer* pSelf =
+                        new (ELeave) CWSOviSessionConsumer( aServiceConsumer);
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+    }
+
+CWSOviSessionConsumer::~CWSOviSessionConsumer()
+    {
+    iSentMessages.Reset();
+    iSendReplyTo.Reset();
+    iTranspProp.Reset();
+    }
+
+CWSOviSessionConsumer::CWSOviSessionConsumer( MSenRemoteServiceConsumer& aServiceConsumer)
+:   iConsumer(aServiceConsumer),
+    iSentMessages(ETrue, ETrue),
+    iSendReplyTo(ETrue, ETrue),
+    iTranspProp(ETrue, ETrue)
+    {
+    }
+
+
+const TDesC8& CWSOviSessionConsumer::Id() const
+    {
+    return iConsumer.Id();
+    }
+
+TInt CWSOviSessionConsumer::SetSessionL(MSenRemoteServiceSession& aServiceSession)
+    {
+    iConsumer.SetSessionL(aServiceSession);
+    return KErrNone;
+    }
+
+
+TInt CWSOviSessionConsumer::HandleMessageL( HBufC8* apMessage,
+                                             const TInt aTxnId,
+                                             MSenProperties* aResponseTransportProperties )
+    {
+    return iConsumer.HandleMessageL(apMessage, aTxnId, aResponseTransportProperties);
+    }
+
+TInt CWSOviSessionConsumer::HandleErrorL( HBufC8* apError,
+                                           const TInt aErrorCode,
+                                           const TInt aTxnId,
+                                           MSenProperties* aResponseTransportProperties )
+    {
+    return iConsumer.HandleErrorL(apError, aErrorCode, aTxnId, aResponseTransportProperties);
+    }
+
+void CWSOviSessionConsumer::SetStatusL(const TInt status)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviSessionConsumer::SetStatusL");
+    iConsumer.SetStatusL(status);
+    }
+
+TInt CWSOviSessionConsumer::MessageForSendingL(CSenHttpTransportProperties*& /*aTP*/,
+                                           CWSOviMessageContext*& /*aCtx*/)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSOviSessionConsumer::MessageForSendingL");
+    return KErrNone;
+    }
+
+void CWSOviSessionConsumer::ConstructL()
+    {
+    }
+
+
+const TDesC8& CWSOviSessionConsumer::TransportProperties(
+        const TDesC8& aMessageID) const
+    {
+    TInt index = iTranspProp.Find(aMessageID);
+    if (index != KErrNotFound)
+        {
+        const TDesC8* tp = iTranspProp.ValueAt(index);
+        if (tp)
+            {
+            return *tp;
+            }
+        }
+    return KNullDesC8;
+    }
+
+MSenTransport& CWSOviSessionConsumer::TransportL()
+    {
+    return iConsumer.TransportL();
+    }
+    
+TInt CWSOviSessionConsumer::ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk)
+    {
+    return iConsumer.ChunkByTxnIdL(aTxnId, aChunk);
+    }
+
+void CWSOviSessionConsumer::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
+                const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
+    {
+    }
+
+CSenIdentifier& CWSOviSessionConsumer::Identifier() const
+    {
+    return iConsumer.Identifier();
+    }
+
+    
+TBool CWSOviSessionConsumer::HasAuthenticationCallback()
+    {
+    return iConsumer.HasAuthenticationCallback();
+    }
+
+TInt CWSOviSessionConsumer::ReauthenticationNeededL(CSenIdentityProvider*& aIdp)
+	{
+	return iConsumer.ReauthenticationNeededL(aIdp);
+	}
+
+void CWSOviSessionConsumer::SetDataTrafficDetails( TSenDataTrafficDetails&  aDetails)  
+	{
+	iConsumer.SetDataTrafficDetails(aDetails);
+	}
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovisessioncontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,410 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsovisessioncontext.h"
+#include "senwsdescription.h"
+#include <SenServiceConnection.h>
+#include <SenCredential.h>
+#include <SenDateUtils.h>
+#include "senlogger.h"
+#include "wsoviservicesession.h"
+#include "msenremoteservicesession.h"  
+
+using namespace WSOviContextKeys;
+using namespace WSOviContextValues;
+
+CWSOviSessionContext* CWSOviSessionContext::NewL()
+    {
+    CWSOviSessionContext* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+CWSOviSessionContext* CWSOviSessionContext::NewLC()
+    {
+    CWSOviSessionContext* self = new (ELeave) CWSOviSessionContext();
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    return self;
+    }
+
+// Constructor
+CWSOviSessionContext::CWSOviSessionContext():
+    iDescriptions(EFalse,EFalse),
+    iInts(EFalse,ETrue),
+    iDescs(EFalse,ETrue)
+    {
+    }
+
+// Constructor
+void CWSOviSessionContext::ConstructL()
+    {
+    }
+
+// Destructor
+CWSOviSessionContext::~CWSOviSessionContext()
+    {
+    iDescriptions.Reset();
+    iInts.Reset();
+    iDescs.Reset();
+    }
+// -----------------------------------------------------------------------------
+// Sets token context keys based on RST response.
+// -----------------------------------------------------------------------------
+//
+TInt CWSOviSessionContext::SetTokenKeysL(const TDesC8& aToken)
+    {
+
+//1)TOKEN
+    CWSOviServiceSession* session = (CWSOviServiceSession*)
+                                            GetSenRemoteServiceSessionL(KServiceSession);
+    session->SetMaxValidUntil();
+    ((CSenWebServiceSession*)session)->SetSecurityL(aToken);
+    session->AddPropertiesFromSessionContextToCredentialL();
+    session->SetStatusL();
+    if (((CSenServiceSession*)session)->StatusL() == KSenConnectionStatusExpired)
+        {
+        return KErrNotReady;
+        }
+    User::LeaveIfError(Update(WSOviContextKeys::KToken,
+           aToken));
+    return KErrNone;
+    }
+
+//-----------------------------------------------------
+//              from MSessionContext
+//-----------------------------------------------------
+const CSenWSDescription* CWSOviSessionContext::GetSession()
+    {
+    return NULL;
+    };
+const CSenWSDescription* CWSOviSessionContext::GetInitializer()
+    {
+    return NULL;
+    };
+
+//descriptions    
+TInt CWSOviSessionContext::Add(const TDesC8& aKey, CSenWSDescription* aValue)
+    {
+    return iDescriptions.Append(&aKey,aValue);
+    };
+
+TInt CWSOviSessionContext::Update(const TDesC8& aKey, CSenWSDescription* aValue)
+    {
+    iDescriptions.RemoveByKey(aKey);
+    return iDescriptions.Append(&aKey,aValue);
+    };
+
+const CSenWSDescription* CWSOviSessionContext::GetSenWSDescriptionL(const TDesC8& aKey)
+    {
+    TInt index = iDescriptions.Find(aKey);
+    if (index!=KErrNotFound)
+        {
+        return iDescriptions.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        };        
+    };
+
+
+//sessions    
+TInt CWSOviSessionContext::Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue)
+    {
+    return Update(aKey, aValue);
+    };
+TInt CWSOviSessionContext::Update(const TDesC8& /*aKey*/, MSenRemoteServiceSession& aValue)
+    {
+    iSession = &aValue;
+    return KErrNone;
+    };
+const MSenRemoteServiceSession* CWSOviSessionContext::GetSenRemoteServiceSessionL(const TDesC8& /*aKey*/)
+    {
+    return iSession;
+    };    
+
+
+
+//-----------------------------------------------------
+//              from MContext
+//-----------------------------------------------------
+
+SenContext::TContextType CWSOviSessionContext::Type() const  
+    {
+    return SenContext::ESessionContext;
+    }
+
+SenContext::TContextDirection CWSOviSessionContext::Direction() const 
+    {
+    return SenContext::EBoth;
+    }
+
+
+
+//-----------------descs
+TInt CWSOviSessionContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {   
+        if (!aValue.Length()) return KErrUnderflow;
+        HBufC8* newValue = NULL;
+        TInt error(KErrNone);
+        TRAP(error, newValue = aValue.AllocL());
+        if (!error)
+            {
+            error = iDescs.Append(&aKey,newValue);
+            }
+        return 
+            error;
+    }
+TInt CWSOviSessionContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+        TInt error(KErrNone);
+        if (!aValue.Length())
+            {
+            error = Remove(aKey);
+            if (error == KErrNotFound)
+                return KErrNone;
+            else
+                return error;
+            }
+        HBufC8* newValue = NULL;
+        
+        TRAP(error, newValue = aValue.AllocL());
+        
+        if (!error)
+            {
+            error = iDescs.UpdateValue(&aKey,newValue);
+            }
+        return 
+            error;
+    }
+const TDesC8* CWSOviSessionContext::GetDesC8L(const TDesC8& aKey)
+    {
+    TInt index = iDescs.Find(aKey);
+    if (index != KErrNotFound)
+        {
+        return iDescs.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        };        
+    }
+TInt CWSOviSessionContext::Remove(const TDesC8& aKey)
+    {
+    return iDescs.RemoveByKey(aKey);
+    }
+
+
+//-----------------TInts
+TInt CWSOviSessionContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a) 
+        {
+        return iInts.Append(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+        
+    }
+TInt CWSOviSessionContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a) 
+        {
+        return iInts.UpdateValue(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+    }
+const TInt* CWSOviSessionContext::GetIntL(const TDesC8& aKey)
+    {
+    TInt index = iInts.Find(aKey);
+    if (index!=KErrNotFound)
+        {
+        return iInts.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+//-----------------elements
+TInt CWSOviSessionContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return Update(aKey,aValue);
+    }
+TInt CWSOviSessionContext::Update(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+const CSenElement* CWSOviSessionContext::GetSenElementL(const TDesC8& /*aKey*/)
+    {
+    return NULL;
+    }
+
+//-----------------TAnys
+TInt CWSOviSessionContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    TInt err(KErrNone);
+    if ( aKey == SenContext::KRemoteConsumer() )
+        {
+        if ( !ipConsumer )
+            {
+            ipConsumer = aValue;
+            }
+         else
+            {
+            err = KErrAlreadyExists;
+            }
+        }
+    else 
+        {
+        err = KErrNotFound;
+        }        
+    return err;
+    }
+TInt CWSOviSessionContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    TInt err(KErrNone);
+    if ( aKey == SenContext::KRemoteConsumer() )
+        {
+        ipConsumer = aValue;
+        }
+    else if ( aKey == WSOviContextKeys::KTP() )
+        {
+        iTP = aValue;
+        }
+    else
+        {
+        err = KErrNotFound;
+        }
+    return err;
+    }
+TAny* CWSOviSessionContext::GetAnyL(const TDesC8& aKey)
+    {
+    if ( aKey == WSOviContextKeys::KRemoteConsumer )
+        {
+        return ipConsumer;
+        }
+    else if ( aKey == WSOviContextKeys::KTP() )
+        {
+        return iTP;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+
+//-----------------Rest
+const CSenXmlReader* CWSOviSessionContext::GetParser()
+    {
+    return NULL;
+    }
+TInt CWSOviSessionContext::Count() const
+    { 
+    return 0;
+    }
+TPtrC8 CWSOviSessionContext::KeyAtL(TInt /*aIndex*/)
+    { 
+    return KNullDesC8();
+    }        
+void CWSOviSessionContext::Reset()
+    {
+    }
+//-----------------------new    
+void CWSOviSessionContext::UpdateDesC8L(CWSOviMessageContext& aMessageContext, const TDesC8& aKey)
+    {
+    const TDesC8* ptr =
+            aMessageContext.GetDesC8L(aKey);
+    if (ptr)
+        {
+        User::LeaveIfError(Update(aKey, *ptr));
+        }
+    else
+        {
+        Remove(aKey);
+        }
+    
+    }
+    
+void CWSOviSessionContext::UpdateFromMessageInContextL(
+        CWSOviMessageContext& /*aMessageContext*/)
+    {
+    
+    }
+
+void CWSOviSessionContext::UpdateFromMessageOutContextL(
+        CWSOviMessageContext& /*aMessageContext*/)
+    {
+    }
+TInt CWSOviSessionContext::ShareTokenWithL(CWSOviSessionContext* aWSOviSessionCtxDst)
+    {
+    TInt error = KErrNone;
+    const TDesC8* desc = NULL;
+
+    desc = GetDesC8L(KTokenCreationTime);
+    if (desc)
+        {
+        error = aWSOviSessionCtxDst->Update(KTokenCreationTime, *desc);
+        if (error) return error;
+        }
+    desc = GetDesC8L(KTTL);
+    if (desc)
+        {
+        error = aWSOviSessionCtxDst->Update(KTTL, *desc);    
+        if (error) return error;
+        }    
+    desc = GetDesC8L(KTokenSecret);
+        if (desc)
+            {
+            error = aWSOviSessionCtxDst->Update(KTokenSecret, *desc);    
+            if (error) return error;
+            }
+    desc = GetDesC8L(KToken);
+        if (desc)
+            {
+            error = aWSOviSessionCtxDst->Update(KToken, *desc);    
+            if (error) return error;
+            }
+            
+    /*desc = GetDesC8L(KSecurityTokenBackup);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KSecurityTokenBackup, *desc);    
+        if (error) return error;
+        }*/
+    return error;    
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovitokencreationresponse.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,258 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsovitokencreationresponse.h"
+#include "wsovicons.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+using namespace WSOviResponse;
+CWSOviTokenCreationResponse* CWSOviTokenCreationResponse::NewL()
+    {
+    CWSOviTokenCreationResponse* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSOviTokenCreationResponse* CWSOviTokenCreationResponse::NewLC()
+    {
+    CWSOviTokenCreationResponse* self = new (ELeave) CWSOviTokenCreationResponse();
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    return self;
+    }
+// Second phase construction.
+void CWSOviTokenCreationResponse::ConstructL()
+    {
+        CSenBaseFragment::BaseConstructL(TPtrC8(NULL,0),
+        		KTokenCreationResponseLocalName);
+    }
+
+void CWSOviTokenCreationResponse::StartElementL(const TDesC8& /*aNsUri*/,
+                               const TDesC8& aLocalName,
+                               const TDesC8& /*aQName*/,
+                               const RAttributeArray& /*aAttributes*/)
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            if (aLocalName == KTokenInfoLocalName)
+            	{
+            	iState = KStateParsingTokenInfo;
+            	}
+            else if (aLocalName == KTokenCreationResponseLocalName)
+                {
+                iIsTokenUpdate = EFalse;
+                }
+            else if (aLocalName == KUserInfoLocalName)
+                {
+                iState = KStateParsingUserInfo;
+                }
+                break;
+            }
+        case KStateParsingTokenInfo:
+        	{
+        	if (aLocalName == KTokenSecretLocalName)
+        		{
+        		iState = KStateSave;
+        		}
+            else if (aLocalName == KTokenLocalName)
+                {
+                iState = KStateSave;
+                }
+        	else if (aLocalName == KTTLLocalName)
+        		{
+        		iState = KStateSave;
+        		}
+        	break;
+        	}
+        case KStateParsingUserInfo:
+            {
+            if (aLocalName == KUserNameLocalName)
+                {
+                iState = KStateSave;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    }                       
+    
+void CWSOviTokenCreationResponse::EndElementL(const TDesC8& /*aNsUri*/,
+                             const TDesC8& aLocalName,
+                             const TDesC8& /*aQName*/)
+    {
+    TPtrC8 content = Content();
+    switch (iState)
+        {
+        case KStateSave:
+            {
+        	if (aLocalName == KTokenLocalName)
+                {
+                if (iToken)
+                	{
+                	delete iToken;
+                	iToken = NULL;
+                	}
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"WSOviTokenCreationResponse::token parsing");
+                TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, content);
+                	
+                iToken = HBufC8::NewL(content.Length()+KTokenTag().Length()+KTokenTagEnd().Length());
+                iToken->Des().Append(KTokenTag);
+                iToken->Des().Append(content);
+                iToken->Des().Append(KTokenTagEnd);
+                ResetContentL();
+                iState = KStateParsingTokenInfo;
+                }
+            if (aLocalName == KTokenSecretLocalName)
+                {
+                if (iTokenSecret)
+                    {
+                    delete iTokenSecret;
+                    iTokenSecret = NULL;
+                    }
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"WSOviTokenCreationResponse::tokenSecret parsing");
+                TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, content);
+                    
+                iTokenSecret = content.AllocL();
+                ResetContentL();
+                iState = KStateParsingTokenInfo;
+                }
+            else if (aLocalName == KTTLLocalName)
+                {
+                if (iTTL)
+                	{
+                	delete iTTL;
+                	iTTL = NULL;
+                	}
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"WSOviTokenCreationResponse::ttl parsing");
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, content);
+                iTTL = content.AllocL();
+                ResetContentL();
+                iState = KStateParsingTokenInfo;
+                }
+            else if ( aLocalName == KUserNameLocalName)
+                {
+                if (iUsername)
+                    {
+                    delete iUsername;
+                    iUsername = NULL;
+                    }
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"WSOviTokenCreationResponse::username parsing");
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, content);
+                iUsername = content.AllocL();
+                ResetContentL();
+                iState = KStateParsingUserInfo;
+                }
+            break;
+            }
+        case KStateParsingTokenInfo:
+        	{
+        	if (aLocalName == KTokenInfoLocalName)
+        		{
+            	iState = KStateIgnore;
+        		}
+        	break;
+        	}
+        case KStateParsingUserInfo:
+            {
+            if (aLocalName == KUserInfoLocalName)
+                {
+                iState = KStateIgnore;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+
+CWSOviTokenCreationResponse::CWSOviTokenCreationResponse():
+iIsTokenUpdate(ETrue)
+	{
+	}
+
+CWSOviTokenCreationResponse::~CWSOviTokenCreationResponse()
+	{
+	delete iToken;
+	delete iTokenSecret;
+	delete iTTL;
+	delete iUsername;
+	}
+
+TPtrC8 CWSOviTokenCreationResponse::Token()
+    {
+    if (iToken)
+        {
+        return *iToken;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+
+TPtrC8 CWSOviTokenCreationResponse::TokenSecret()
+    {
+    if (iTokenSecret)
+        {
+        return *iTokenSecret;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+
+TPtrC8 CWSOviTokenCreationResponse::TTL()
+    {
+    if (iTTL)
+        {
+        return *iTTL;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+
+TPtrC8 CWSOviTokenCreationResponse::Username()
+    {
+    if (iUsername)
+        {
+        return *iUsername;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+
+TBool CWSOviTokenCreationResponse::IsTokenUpdate()
+    {
+    return iIsTokenUpdate;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsoviutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <hash.h> 
+#include <e32math.h>
+#include "wsoviutils.h"
+#include "wsovicons.h"
+#include "sencryptoutils.h"
+
+HBufC8* CWSOviUtils::NormalizeStringLC(const TDesC8& aMethod, const TDesC8& aUrl, const TDesC8& aHeader )
+	{
+
+	
+	TInt methodLen = aMethod.Length();
+	TInt urlLen = aUrl.Length() + KHexWidth*CountCharsToEncode(aUrl);
+	TInt headerLen = aHeader.Length() + KHexWidth*CountCharsToEncode(aHeader);
+	TInt normalizedStringLen = methodLen + OAuth::KAmpMark().Length() + urlLen + OAuth::KAmpMark().Length() + headerLen;
+		
+	HBufC8* pNormalizedString = HBufC8::NewLC(normalizedStringLen);
+	
+	HBufC8* method = aMethod.AllocLC();
+	method->Des().UpperCase();
+	pNormalizedString->Des().Append(*method);
+	pNormalizedString->Des().Append(OAuth::KAmpMark());
+
+	HBufC8* urlLowercase = aUrl.AllocLC();
+	_LIT8(KSlash,"/");
+	_LIT8(KDoubleSlash,"//");
+	_LIT8(KQuestionMark,"?");
+	TInt posStart = urlLowercase->Find(KDoubleSlash) + KDoubleSlash().Length();
+	TInt posEnd = urlLowercase->Mid(posStart).Find(KSlash);
+	if(posEnd == KErrNotFound)
+		{
+		urlLowercase->Des().LowerCase();
+		}
+	else 
+		{
+		urlLowercase->Des().LeftTPtr(posEnd).LowerCase();
+		}
+	TPtr8 urlLowercaseBase(urlLowercase->Des());
+		
+	//cut query & fragment, see http://oauth.net/core/1.0/ (9.1.2.  Construct Request URL)
+	posEnd = urlLowercase->Find(KQuestionMark);
+	if(posEnd != KErrNotFound)
+		{
+		urlLowercaseBase.Set(urlLowercase->Des().LeftTPtr(posEnd));
+		}
+	
+	
+	HBufC8* url = EncodeCharsLC(urlLowercaseBase);
+	pNormalizedString->Des().Append(*url);
+	CleanupStack::PopAndDestroy(url);
+	CleanupStack::PopAndDestroy(urlLowercase);
+	pNormalizedString->Des().Append(OAuth::KAmpMark());
+	
+	HBufC8* header = EncodeCharsLC(aHeader);
+	pNormalizedString->Des().Append(*header);
+	CleanupStack::PopAndDestroy(header);
+	CleanupStack::PopAndDestroy(method);
+			
+	return pNormalizedString;
+	}
+
+HBufC8* CWSOviUtils::DigestAuthStringL(const TDesC8& aNonce, const TDesC8& aTimestamp, const TDesC8& aUser, const TDesC8& aPassword)
+	{
+	_LIT8(KFormatUser, "/accounts/%S/");
+	HBufC8* validatorString = HBufC8::NewLC(KFormatUser().Length()+aUser.Length());
+	TPtr8 validatorPtr = validatorString->Des();
+	validatorPtr.Format(KFormatUser,&aUser);
+	CSHA1* sha1 = CSHA1::NewL();
+	sha1->Update(*validatorString);
+	TPtrC8 validator = sha1->Final(aPassword);
+	CleanupStack::PopAndDestroy(validatorString);
+	CleanupStack::PushL(sha1);
+	HBufC8* base64validator = SenCryptoUtils::EncodeBase64L(validator);
+	sha1->Reset();
+	sha1->Update(aNonce);
+	sha1->Update(aTimestamp);
+	TPtrC8 digest = sha1->Final(*base64validator);
+	delete base64validator;
+	HBufC8* digestBase64 = SenCryptoUtils::EncodeBase64L(digest);
+	CleanupStack::PopAndDestroy(sha1);
+	return digestBase64;
+	}
+
+
+TInt CWSOviUtils::CountCharsToEncode(const TDesC8& aString)
+	{
+	const TUint8* ref=NULL;
+	const TUint8 charLen = 1;
+	TUint count(0);
+	TPtrC8 unreserveChars(OAuth::KUnReserveChars);
+	TUint strLen = aString.Length();
+	
+	ref=aString.Ptr();
+	for(TInt i=0; i<strLen; i++)
+		{
+		if(unreserveChars.Find(ref, charLen) < 0)
+		count++;
+		ref+=1;
+		}
+	
+	return count;	
+	}
+	
+HBufC8* CWSOviUtils::EncodeCharsLC(const TDesC8& aString)
+	{
+	TInt len = aString.Length();
+	TInt encodedLength = aString.Length() + KHexWidth*CountCharsToEncode(aString);
+	const TUint8* ref=NULL;
+	TPtrC8 unreserveChars(OAuth::KUnReserveChars);
+	ref=aString.Ptr();
+			
+	HBufC8* pEncoded = HBufC8::NewLC(encodedLength);
+	TPtr8 buf = pEncoded->Des();
+	
+    for (TInt i = 0; i < len; i++)
+        {
+		if(unreserveChars.Find(ref, KCharWidth) < 0)
+			{
+			TBuf8<2> charcode;
+			buf.Append(OAuth::KPercent);
+			charcode.AppendNumFixedWidth(aString[i], EHex, KHexWidth);
+			charcode.UpperCase();
+			buf.Append(charcode);			
+			}
+			else
+			{
+			buf.Append(&aString[i], KCharWidth);				
+			}
+		ref+=1;
+        }
+		
+	return pEncoded;
+	}
+
+HBufC8* CWSOviUtils::FormEncodeCharsLC(const TDesC8& aString)
+    {
+    TInt len = aString.Length();
+    TInt encodedLength = aString.Length() + KHexWidth*CountCharsToEncode(aString);
+    const TUint8* ref=NULL;
+    TPtrC8 unreserveChars(OAuth::KUnReserveChars);
+    ref=aString.Ptr();
+            
+    HBufC8* pEncoded = HBufC8::NewLC(encodedLength);
+    TPtr8 buf = pEncoded->Des();
+    
+    for (TInt i = 0; i < len; i++)
+        {
+        if(unreserveChars.Find(ref, KCharWidth) < 0)
+            {
+            if (*ref == KSpaceChar)
+                {
+                buf.Append('+');
+                }
+            else{
+                TBuf8<2> charcode;
+                buf.Append(OAuth::KPercent);
+                charcode.AppendNumFixedWidth(aString[i], EHex, KHexWidth);
+                charcode.UpperCase();
+                buf.Append(charcode);
+                }
+            }
+            else
+            {
+            buf.Append(&aString[i], KCharWidth);                
+            }
+        ref+=1;
+        }
+        
+    return pEncoded;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsoviplugin/src/wsovivalidatehandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsovivalidatehandler.h"
+#include "wsovioauthclient.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+class CWSOviHandlerContext;
+
+//---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+//---------------------------------------------------------------------------
+//
+CWSOviValidateHandler* CWSOviValidateHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSOviValidateHandler* self   = new (ELeave) CWSOviValidateHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSOviValidateHandler::CWSOviValidateHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSOviValidateHandler::~CWSOviValidateHandler()
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Second phase construction.
+//---------------------------------------------------------------------------
+//
+void CWSOviValidateHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSOviValidateHandler::ConstructL()")));
+    }
+    
+
+//---------------------------------------------------------------------------
+// the most emergent method in message handler interface.
+// Each sub-class must implement this method thus providing message processing routine.
+//---------------------------------------------------------------------------
+//
+TInt CWSOviValidateHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+
+//getting data from input
+    CWSOviServiceSession* pNewSession =
+            (CWSOviServiceSession*)aCtx.GetSenRemoteServiceSessionL(
+            WSOviContextKeys::KServiceSession());
+    if (pNewSession->ProviderID() == KNullDesC8)
+        {
+        return KErrNone;
+        }
+//try to find identity provider for curennt webService using its ProviderId
+    CSenIdentityProvider* pIdentityProvider = IdentityProviderFromCoreL(
+            pNewSession->ProviderID());
+    if (!pIdentityProvider)
+        {
+        return KErrNotFound;
+        }
+    
+    const TBool* onlySharingPtr = ((MSenContext&)aCtx).GetIntL(WSOviContextKeys::KOnlySharing);
+    TBool onlySharing;
+    if (onlySharingPtr)
+        {
+        onlySharing = *onlySharingPtr;
+        }
+    else
+        {
+        onlySharing = ETrue;
+        }
+    
+    CWSOviOAuthClient* pAuthClient = AuthClientL(pIdentityProvider);
+    if (pAuthClient)
+            {
+            TInt error(KErrNone);
+            pAuthClient->SetHandlerCtx(&iHandlerContext);
+            //validate session of concrete WebService
+            HBufC8* errorMessage = NULL;
+            TRAPD(lerror, error = pAuthClient->ValidateL(*pNewSession, errorMessage, onlySharing);)    
+            ((MSenContext&)aCtx).Update(WSOviContextKeys::KReAuthNeeded, EFalse);
+            if (errorMessage)
+                {
+                ((MSenContext&)aCtx).Update(WSOviContextKeys::KErrMessage,  *errorMessage);
+                }
+            delete errorMessage;
+            errorMessage = NULL;
+            if (lerror) return lerror;
+            //if credential expired session will use validator to obtain new
+            
+            // Core / XML DAO takes ownership of new session (will keep in array of SD):
+            // - new session HAS
+            //      - credential
+            // - if duplicate (equal primary keys) exiAuth, it is deleted
+            return error;
+            }
+       else
+            {
+            return KErrNotFound;
+            }
+    
+    }
+    
+SenHandler::THandlerDirection CWSOviValidateHandler::Direction() const
+    {
+        return SenHandler::EBoth;
+    };
+SenHandler::THandlerPhase CWSOviValidateHandler::Phase()
+    {
+        return SenHandler::EValidate;
+    };
+    
+//---------------------------------------------------------------------------
+// Obtain or construct Auth client
+//---------------------------------------------------------------------------
+//
+  
+CWSOviOAuthClient* CWSOviValidateHandler::AuthClientL(CSenIdentityProvider*& aIdentityProvider)
+{
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSOviValidateHandler::AuthClientL")));
+
+    CWSOviOAuthClient* pAuthClient = NULL;
+    //providerId from Identities.xml
+    TPtrC8 providerId(KNullDesC8);
+    if(aIdentityProvider)
+        {
+        providerId.Set(aIdentityProvider->ProviderID());
+        }
+
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    CleanupClosePushL(serviceDescriptions);
+        
+    //try to find Auth session in cache,some Auth can be registered
+    TInt retVal(KErrNone);
+    
+    TRAPD(error, retVal = iHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, KWSOviAuthenticationServiceContract()));
+    if(!retVal&&!error)
+        {
+        RPointerArray<CSenWSDescription> matches;
+        CleanupClosePushL(matches);
+        
+        for(TInt i = 0; i < serviceDescriptions.Count(); i++)
+            {
+            //select XMLDescription from DAO where contract = Auth, so we can cast
+            if (serviceDescriptions[i]->DescriptionClassType() == MSenServiceDescription::EOviOAuthClient)
+                {
+                pAuthClient = (CWSOviOAuthClient*)serviceDescriptions[i];
+                if(providerId.Length()>0)
+                    {
+                    TPtrC8 providerIDFromDescription = pAuthClient->ProviderID();
+                    if(providerIDFromDescription == providerId)
+                        {
+                        matches.AppendL(pAuthClient);
+                        }
+                    }
+                else
+                    {
+                    matches.AppendL(pAuthClient);
+                    }                
+                }
+            }
+        if(matches.Count())
+            {
+            pAuthClient =
+                reinterpret_cast<CWSOviOAuthClient*>(matches[0]);
+            pAuthClient->SetAccount(aIdentityProvider);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSOviValidateHandler::AuthClient - No matching AuthClient  description available!")));
+            pAuthClient = NULL;
+            }
+    
+        //if we find multi Auth client (different only with lifetime, probably Secure Context Token lifetime)
+        if(matches.Count() > 1)
+            {
+            // search for a instance with longest validity
+            for(TInt i = matches.Count()-1; i > 0 ; i--)
+                {
+                CWSOviOAuthClient* pNewerAuthClient =
+                  reinterpret_cast<CWSOviOAuthClient*>(matches[i]);
+                CWSOviServiceSession* newerSession = (CWSOviServiceSession*)pNewerAuthClient->ServiceSession();
+                CWSOviServiceSession* session = (CWSOviServiceSession*)pAuthClient->ServiceSession();
+                
+				if(newerSession && session) // AuthClient Session was not set, if not validated 
+					{
+					if(newerSession->ValidUntilL() > session->ValidUntilL())
+					  	{
+					    pAuthClient = pNewerAuthClient;
+					    pAuthClient->SetAccount(aIdentityProvider);
+					    }
+					}
+                }
+            }
+            CleanupStack::PopAndDestroy(2, &serviceDescriptions);
+        }
+    else
+        {
+          CleanupStack::PopAndDestroy(&serviceDescriptions);
+        }
+    return pAuthClient;
+}
+
+//---------------------------------------------------------------------------
+// Create IdentityProvider from CoreManager
+//---------------------------------------------------------------------------
+//
+CSenIdentityProvider* CWSOviValidateHandler::IdentityProviderFromCoreL(
+                                            const TDesC8& aProviderID)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSOviValidateHandler::IdentityProviderLFromCore");
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if(aProviderID.Length() > 0)
+        {
+        CDesC8ArrayFlat* array = new (ELeave) CDesC8ArrayFlat(1);
+        CleanupStack::PushL(array);
+        array->AppendL(aProviderID);
+        pIdentityProvider = iHandlerContext.GetSenCoreServiceManager()->
+                IdentityProviderL(*array, ETrue);
+        CleanupStack::PopAndDestroy(array);
+        }
+    return pIdentityProvider;
+    }
+
+//---------------------------------------------------------------------------
+// Init implementation
+//---------------------------------------------------------------------------
+//
+TInt CWSOviValidateHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+RFileLogger* CWSOviValidateHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+MSenHandlerContext& CWSOviValidateHandler::HandlerContext()
+	{
+	return iHandlerContext;
+	}
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/data/101f9706.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 9706 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9706;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9707;
+            implementations = 
+                {
+                // Info for TruncateTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9708;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Anonymous SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:truncate";
+                    opaque_data        = "";
+                    },
+                // Info for LowercaseTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9709;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Plain SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:lowercase";
+                    opaque_data        = "";
+                    },
+                // Info for UppercaseTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F970A;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:uppercase";
+                    opaque_data        = "";
+                    },
+                // Info for SelectTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F970B;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:select";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/data/101f973c.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 9706 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F973C;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F973D;
+            implementations = 
+                {
+                // Info for TruncateTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F973E;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Anonymous SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:truncate";
+                    opaque_data        = "";
+                    },
+                // Info for LowercaseTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F973F;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf Plain SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:lowercase";
+                    opaque_data        = "";
+                    },
+                // Info for UppercaseTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9740;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:uppercase";
+                    opaque_data        = "";
+                    },
+                // Info for SelectTransform
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9741;
+                    version_no         = 1;
+                    display_name       = "Sen IdWsf CramMD5 SASL Mechanism plugin";
+                    default_data       = "urn:liberty:sa:pw:select";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wspasswordtransforms    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wspasswordtransforms.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wspasswordtransforms.iby)
+PRJ_MMPFILES
+../../wspasswordtransforms/group/senpasswordtransforms.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/group/senpasswordtransforms.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senpasswordtransforms    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenPasswordTransforms.dll
+UID 0x10009D8D 0x101F9706 
+#else
+TARGET wsPasswordTransforms.dll
+UID 0x10009D8D 0x101F973C 
+#endif
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senpasswordtransformmain.cpp
+SOURCE          senpasswordtransformproxy.cpp
+SOURCE          sentruncatetransform.cpp
+SOURCE          senlowercasetransform.cpp
+SOURCE          senuppercasetransform.cpp
+SOURCE          senselecttransform.cpp
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  101f9706.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenPasswordTransforms.rsc
+#endif
+
+#else
+START RESOURCE  101F973C.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsPasswordTransforms.rsc
+#endif
+
+#endif
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wscore/inc
+USERINCLUDE     ../../wsframework/inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wsidentitymanager/inc
+
+//USERINCLUDE     ../../ServiceDescription/inc // now system included
+//USERINCLUDE     ../../ServiceConnection/inc  // now system included
+//USERINCLUDE     ../../XML/inc                // now system included
+//SYSTEMINCLUDE   ../../Framework/inc  // SenPasswordTransform.h & SenPasswordTransform.inl
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+LIBRARY ECom.lib
+LIBRARY euser.lib 
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/inc/senlowercasetransform.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_LOWERCASE_PASSWORDTRANSFORM_H
+#define SEN_LOWERCASE_PASSWORDTRANSFORM_H
+
+// INCLUDES
+#include "senpasswordtransform.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class CSenLowercaseTransform : public CSenPasswordTransform
+    {
+    public: // Constructors and destructor
+    
+        static CSenLowercaseTransform* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenLowercaseTransform* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        
+        virtual ~CSenLowercaseTransform();
+
+        // Functions from base classes
+        
+        // From CSenPasswordTransform
+        
+        /**
+        * method does nothing
+        */
+        virtual TInt SetParameterL(TPtrC8 aName, TPtrC8 aValue);
+        
+        virtual HBufC8* TransformL(TPtrC8 aPassphrase) const;
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenLowercaseTransform(MSenCoreServiceManager& aServiceManager);
+    };
+
+#endif // SEN_LOWERCASE_PASSWORDTRANSFORM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/inc/senselecttransform.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SELECT_PASSWORDTRANSFORM_H
+#define SEN_SELECT_PASSWORDTRANSFORM_H
+
+// INCLUDES
+#include "senpasswordtransform.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+
+// CLAS DECLARATION
+class CSenSelectTransform :  public CSenPasswordTransform
+    {
+    public: // Constructors and destructor
+        
+        static CSenSelectTransform* NewL(MSenCoreServiceManager& aServiceManager);
+        static CSenSelectTransform* NewLC(MSenCoreServiceManager& aServiceManager);
+        
+        virtual ~CSenSelectTransform();
+
+        // Functions from base classes
+        
+        // From CSenPasswordTransform
+    
+        /**
+        * @return KErrNotSupported, if parameter name is unknown
+        */
+        virtual TInt SetParameterL(TPtrC8 aName, TPtrC8 aValue);
+        
+        virtual HBufC8* TransformL(TPtrC8 aPassphrase) const;
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenSelectTransform(MSenCoreServiceManager& aServiceManager);
+    
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        virtual void ConstructL();
+
+    private: // Data
+        HBufC8* ipSelect;
+    };
+
+#endif // SEN_SELECT_PASSWORDTRANSFORM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/inc/sentruncatetransform.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_TRUNCATE_TRANSFORM_H
+#define SEN_TRUNCATE_TRANSFORM_H
+
+// INCLUDES
+#include "senpasswordtransform.h"
+#include "msencoreservicemanager.h"
+
+// FORWARD DECLARATIONS
+class MSenSaslMessage;
+
+// CLASS DECLARATION
+class CSenTruncateTransform : public CSenPasswordTransform
+    {
+    public: // Constructors and destructor
+    
+        static CSenTruncateTransform* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenTruncateTransform* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        
+        virtual ~CSenTruncateTransform();
+
+        // Functions from base classes
+        
+        // From CSenPasswordTransform
+        virtual TInt SetParameterL(TPtrC8 aName, TPtrC8 aValue);
+        virtual HBufC8* TransformL(TPtrC8 aPassphrase) const;
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenTruncateTransform(MSenCoreServiceManager& aServiceManager);
+
+    private: // Data
+        TInt iLength;
+    };
+
+#endif // SEN_TRUNCATE_TRANSFORM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/inc/senuppercasetransform.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_UPPERCASE_PASSWORDTRANSFORM_H
+#define SEN_UPPERCASE_PASSWORDTRANSFORM_H
+
+// INCLUDES
+#include "senpasswordtransform.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+
+// CLASS DECLARATION
+class CSenUppercaseTransform : public CSenPasswordTransform
+    {
+    public: // Constructors and destructor
+        
+        static CSenUppercaseTransform* NewL(
+                                    MSenCoreServiceManager& aServiceManager);
+        static CSenUppercaseTransform* NewLC(
+                                    MSenCoreServiceManager& aServiceManager);
+        
+        virtual ~CSenUppercaseTransform();
+
+        // Functions from base classes
+    
+        // From CSenPasswordTransform
+        
+        /**
+        * method does nothing
+        */
+        virtual TInt SetParameterL(TPtrC8 aName, TPtrC8 aValue);
+        virtual HBufC8* TransformL(TPtrC8 aPassphrase) const;
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CSenUppercaseTransform(MSenCoreServiceManager& aServiceManager);
+    };
+
+#endif // SEN_UPPERCASE_PASSWORDTRANSFORM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/rom/wspasswordtransforms.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSPASSWORDTRANSFORMS_IBY__
+#define __WSPASSWORDTRANSFORMS_IBY__
+
+//PasswordTransforms
+ECOM_PLUGIN(SenPasswordTransforms.dll, 101F9706.rsc)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/src/senlowercasetransform.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senlowercasetransform.h"
+#include "msencoreservicemanager.h"
+
+
+// Create instance of concrete ECOM interface implementation
+CSenLowercaseTransform* CSenLowercaseTransform::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenLowercaseTransform* pNew =
+                                CSenLowercaseTransform::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+
+CSenLowercaseTransform* CSenLowercaseTransform::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenLowercaseTransform* pNew =
+                        new (ELeave) CSenLowercaseTransform(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenLowercaseTransform::CSenLowercaseTransform(
+                                    MSenCoreServiceManager& aServiceManager)
+: CSenPasswordTransform(aServiceManager)
+    {
+    }
+
+CSenLowercaseTransform::~CSenLowercaseTransform()
+    {
+    }
+
+// method does nothing
+TInt CSenLowercaseTransform::SetParameterL(TPtrC8 /* aName */,
+                                           TPtrC8 /* aValue */)
+    {
+    // default does nothing
+    return KErrNone;
+    }
+
+HBufC8* CSenLowercaseTransform::TransformL(TPtrC8 aPassphrase) const
+    {
+    // NOTE: Conversion is implemented as appropriate to the current locale.
+    HBufC8* pLower = aPassphrase.AllocL();
+    TPtr8 lower = pLower->Des();
+    lower.LowerCase();
+    return pLower;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/src/senpasswordtransformmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/src/senpasswordtransformproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+#include "sentruncatetransform.h"
+#include "senlowercasetransform.h"
+#include "senuppercasetransform.h"
+#include "senselecttransform.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TInt32 KTruncateTransformPluginUid = 0x101F9708;
+const TInt32 KLowercaseTransformPluginUid = 0x101F9709;
+const TInt32 KUppercaseTransformPluginUid = 0x101F970A;
+const TInt32 KSelectTransformPluginUid = 0x101F970B;
+
+#else
+
+const TInt32 KTruncateTransformPluginUid = 0x101F973E;
+const TInt32 KLowercaseTransformPluginUid = 0x101F973F;
+const TInt32 KUppercaseTransformPluginUid = 0x101F9740;
+const TInt32 KSelectTransformPluginUid = 0x101F9741;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+        IMPLEMENTATION_PROXY_ENTRY(KTruncateTransformPluginUid,  CSenTruncateTransform::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KLowercaseTransformPluginUid,  CSenLowercaseTransform::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KUppercaseTransformPluginUid,  CSenUppercaseTransform::NewL),
+        IMPLEMENTATION_PROXY_ENTRY(KSelectTransformPluginUid,  CSenSelectTransform::NewL)
+#else
+        {{KTruncateTransformPluginUid},  CSenTruncateTransform::NewL},
+        {{KLowercaseTransformPluginUid},  CSenLowercaseTransform::NewL},
+        {{KUppercaseTransformPluginUid},  CSenUppercaseTransform::NewL},
+        {{KSelectTransformPluginUid},  CSenSelectTransform::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                             TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/src/senselecttransform.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senselecttransform.h"
+#include "msencoreservicemanager.h"
+
+namespace
+    {
+    _LIT8(KSelectParamDefVal,
+        "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!*-+?");
+    _LIT8(KSelectParamName, "allowed");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenSelectTransform* CSenSelectTransform::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenSelectTransform* pNew = CSenSelectTransform::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+
+CSenSelectTransform* CSenSelectTransform::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenSelectTransform* pNew =
+                            new (ELeave) CSenSelectTransform(aServiceManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+void CSenSelectTransform::ConstructL()
+    {
+    ipSelect = HBufC8::NewL(124); // 68 chars in default select-string..
+    TPtr8 select = ipSelect->Des();
+    select.Append(KSelectParamDefVal);
+    }
+
+CSenSelectTransform::CSenSelectTransform(
+                                    MSenCoreServiceManager& aServiceManager)
+:   CSenPasswordTransform(aServiceManager),
+    ipSelect(NULL)
+    {
+    }
+
+CSenSelectTransform::~CSenSelectTransform()
+    {
+    delete ipSelect;
+    }
+
+// NOTE: returns KErrNotSupported, if parameter name is unknown!
+TInt CSenSelectTransform::SetParameterL(TPtrC8 aName,
+                                        TPtrC8 aValue)
+    {
+    if(aName == KSelectParamName)
+        {
+        delete ipSelect;
+        ipSelect = aValue.AllocL();
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    }
+
+HBufC8* CSenSelectTransform::TransformL(TPtrC8 aPassphrase) const
+    {
+    // no need to use stack, this is the only leaving method here:
+    HBufC8* pResult = HBufC8::NewL(aPassphrase.Length());
+    TPtr8 result = pResult->Des();
+
+    for(TInt i=0; i < aPassphrase.Length(); i++)
+        {
+        TChar ch(aPassphrase[i]);
+        if(ipSelect->Locate(ch) != KErrNotFound)
+            {
+            result.Append(ch);
+            }
+        }
+    return pResult;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/src/sentruncatetransform.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sentruncatetransform.h"
+#include "msensaslmessage.h"
+
+
+namespace
+    {
+    const TInt KTruncateParamDefVal = 256;
+    _LIT8(KTruncateParamName, "length");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenTruncateTransform* CSenTruncateTransform::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenTruncateTransform* pNew =
+                            CSenTruncateTransform::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenTruncateTransform* CSenTruncateTransform::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenTruncateTransform* pNew =
+                        new (ELeave) CSenTruncateTransform(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenTruncateTransform::CSenTruncateTransform(
+                                    MSenCoreServiceManager& aServiceManager)
+:   CSenPasswordTransform(aServiceManager),
+    iLength(KTruncateParamDefVal)
+    {
+    }
+
+CSenTruncateTransform::~CSenTruncateTransform()
+    {
+    }
+
+TInt CSenTruncateTransform::SetParameterL(TPtrC8 aName,
+                                          TPtrC8 aValue)
+    {
+    if(aName == KTruncateParamName)
+        {
+        TLex8 value(aValue);
+        return value.Val(iLength);
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    }
+
+HBufC8* CSenTruncateTransform::TransformL(TPtrC8 aPassphrase) const
+    {
+    TInt max =
+        (iLength > aPassphrase.Length()) ? aPassphrase.Length() : iLength;
+    return aPassphrase.Left(max).AllocL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wspasswordtransforms/src/senuppercasetransform.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senuppercasetransform.h"
+#include "msencoreservicemanager.h"
+
+
+// Create instance of concrete ECOM interface implementation
+CSenUppercaseTransform* CSenUppercaseTransform::NewL(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenUppercaseTransform* pNew =
+                                CSenUppercaseTransform::NewLC(aServiceManager);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+
+CSenUppercaseTransform* CSenUppercaseTransform::NewLC(
+                                    MSenCoreServiceManager& aServiceManager)
+    {
+    CSenUppercaseTransform* pNew =
+                        new (ELeave) CSenUppercaseTransform(aServiceManager);
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+CSenUppercaseTransform::CSenUppercaseTransform(
+                                    MSenCoreServiceManager& aServiceManager)
+: CSenPasswordTransform(aServiceManager)
+    {
+    }
+
+CSenUppercaseTransform::~CSenUppercaseTransform()
+    {
+    }
+
+// method does nothing
+TInt CSenUppercaseTransform::SetParameterL(TPtrC8 /* aName */,
+                                           TPtrC8 /* aValue */)
+    {
+    // default does nothing
+    return KErrNone;
+    }
+
+HBufC8* CSenUppercaseTransform::TransformL(TPtrC8 aPassphrase) const
+    {
+    // NOTE: Conversion is implemented as appropriate to the current locale.
+    HBufC8* pUpper = aPassphrase.AllocL();
+    TPtr8 upper = pUpper->Des();
+    upper.UpperCase();
+    return pUpper;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/BMARM/SENPROVIDERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,17 @@
+EXPORTS
+	"_._19CSenHostletResponse" @ 1 NONAME R3UNUSED ; CSenHostletResponse::~CSenHostletResponse(void)
+	ExtractResponseUtf8__19CSenHostletResponse @ 2 NONAME R3UNUSED ; CSenHostletResponse::ExtractResponseUtf8(void)
+	NewLC__18CSenHostletRequestiRC6TDesC8G7RThreadRC14CSenIdentifier @ 3 NONAME ; CSenHostletRequest::NewLC(int, TDesC8 const &, RThread, CSenIdentifier const &)
+	NewLC__19CSenHostletResponsei @ 4 NONAME R3UNUSED ; CSenHostletResponse::NewLC(int)
+	NewL__18CSenHostletRequestiRC6TDesC8G7RThreadRC14CSenIdentifier @ 5 NONAME ; CSenHostletRequest::NewL(int, TDesC8 const &, RThread, CSenIdentifier const &)
+	NewL__19CSenHostletResponsei @ 6 NONAME R3UNUSED ; CSenHostletResponse::NewL(int)
+	RequestId__C18CSenHostletRequest @ 7 NONAME R3UNUSED ; CSenHostletRequest::RequestId(void) const
+	RequestId__C19CSenHostletResponse @ 8 NONAME R3UNUSED ; CSenHostletResponse::RequestId(void) const
+	RequestUtf8__C18CSenHostletRequest @ 9 NONAME R3UNUSED ; CSenHostletRequest::RequestUtf8(void) const
+	ResponseCode__C19CSenHostletResponse @ 10 NONAME R3UNUSED ; CSenHostletResponse::ResponseCode(void) const
+	ResponseUtf8__19CSenHostletResponse @ 11 NONAME R3UNUSED ; CSenHostletResponse::ResponseUtf8(void)
+	SetResponseUtf8L__19CSenHostletResponseRC6TDesC8i @ 12 NONAME R3UNUSED ; CSenHostletResponse::SetResponseUtf8L(TDesC8 const &, int)
+	ThreadId__C18CSenHostletRequest @ 13 NONAME R3UNUSED ; CSenHostletRequest::ThreadId(void) const
+	"_._18CSenHostletRequest" @ 14 NONAME R3UNUSED ; CSenHostletRequest::~CSenHostletRequest(void)
+	ConsumerId__C18CSenHostletRequest @ 15 NONAME R3UNUSED ; CSenHostletRequest::ConsumerId(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/BWINS/SENPROVIDERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,17 @@
+EXPORTS
+	??1CSenHostletRequest@@UAE@XZ @ 1 NONAME ; public: virtual __thiscall CSenHostletRequest::~CSenHostletRequest(void)
+	??1CSenHostletResponse@@UAE@XZ @ 2 NONAME ; public: virtual __thiscall CSenHostletResponse::~CSenHostletResponse(void)
+	?ConsumerId@CSenHostletRequest@@UBE?AVTPtrC8@@XZ @ 3 NONAME ; public: virtual class TPtrC8 __thiscall CSenHostletRequest::ConsumerId(void)const 
+	?ExtractResponseUtf8@CSenHostletResponse@@QAEPAVHBufC8@@XZ @ 4 NONAME ; public: class HBufC8 * __thiscall CSenHostletResponse::ExtractResponseUtf8(void)
+	?NewL@CSenHostletRequest@@SAPAV1@HABVTDesC8@@VRThread@@ABVCSenIdentifier@@@Z @ 5 NONAME ; public: static class CSenHostletRequest * __cdecl CSenHostletRequest::NewL(int,class TDesC8 const &,class RThread,class CSenIdentifier const &)
+	?NewL@CSenHostletResponse@@SAPAV1@H@Z @ 6 NONAME ; public: static class CSenHostletResponse * __cdecl CSenHostletResponse::NewL(int)
+	?NewLC@CSenHostletRequest@@SAPAV1@HABVTDesC8@@VRThread@@ABVCSenIdentifier@@@Z @ 7 NONAME ; public: static class CSenHostletRequest * __cdecl CSenHostletRequest::NewLC(int,class TDesC8 const &,class RThread,class CSenIdentifier const &)
+	?NewLC@CSenHostletResponse@@SAPAV1@H@Z @ 8 NONAME ; public: static class CSenHostletResponse * __cdecl CSenHostletResponse::NewLC(int)
+	?RequestId@CSenHostletRequest@@UBEHXZ @ 9 NONAME ; public: virtual int __thiscall CSenHostletRequest::RequestId(void)const 
+	?RequestId@CSenHostletResponse@@UBEHXZ @ 10 NONAME ; public: virtual int __thiscall CSenHostletResponse::RequestId(void)const 
+	?RequestUtf8@CSenHostletRequest@@UBE?AVTPtrC8@@XZ @ 11 NONAME ; public: virtual class TPtrC8 __thiscall CSenHostletRequest::RequestUtf8(void)const 
+	?ResponseCode@CSenHostletResponse@@UBEHXZ @ 12 NONAME ; public: virtual int __thiscall CSenHostletResponse::ResponseCode(void)const 
+	?ResponseUtf8@CSenHostletResponse@@UAE?AVTPtrC8@@XZ @ 13 NONAME ; public: virtual class TPtrC8 __thiscall CSenHostletResponse::ResponseUtf8(void)
+	?SetResponseUtf8L@CSenHostletResponse@@UAEXABVTDesC8@@H@Z @ 14 NONAME ; public: virtual void __thiscall CSenHostletResponse::SetResponseUtf8L(class TDesC8 const &,int)
+	?ThreadId@CSenHostletRequest@@UBE?AVTPtrC16@@XZ @ 15 NONAME ; public: virtual class TPtrC16 __thiscall CSenHostletRequest::ThreadId(void)const 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/BWINSCW/SENPROVIDERU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,20 @@
+EXPORTS
+	??1CSenHostletRequest@@UAE@XZ @ 1 NONAME ; CSenHostletRequest::~CSenHostletRequest(void)
+	??1CSenHostletResponse@@UAE@XZ @ 2 NONAME ; CSenHostletResponse::~CSenHostletResponse(void)
+	?ConsumerId@CSenHostletRequest@@UBE?AVTPtrC8@@XZ @ 3 NONAME ; class TPtrC8 CSenHostletRequest::ConsumerId(void) const
+	?ExtractResponseUtf8@CSenHostletResponse@@QAEPAVHBufC8@@XZ @ 4 NONAME ; class HBufC8 * CSenHostletResponse::ExtractResponseUtf8(void)
+	?NewL@CSenHostletRequest@@SAPAV1@HABVTDesC8@@VRThread@@ABVCSenIdentifier@@PAVCSenChunk@@@Z @ 5 NONAME ; class CSenHostletRequest * CSenHostletRequest::NewL(int, class TDesC8 const &, class RThread, class CSenIdentifier const &, class CSenChunk *)
+	?NewL@CSenHostletResponse@@SAPAV1@H@Z @ 6 NONAME ; class CSenHostletResponse * CSenHostletResponse::NewL(int)
+	?NewLC@CSenHostletRequest@@SAPAV1@HABVTDesC8@@VRThread@@ABVCSenIdentifier@@PAVCSenChunk@@@Z @ 7 NONAME ; class CSenHostletRequest * CSenHostletRequest::NewLC(int, class TDesC8 const &, class RThread, class CSenIdentifier const &, class CSenChunk *)
+	?NewLC@CSenHostletResponse@@SAPAV1@H@Z @ 8 NONAME ; class CSenHostletResponse * CSenHostletResponse::NewLC(int)
+	?Properties@CSenHostletRequest@@UBE?AVTPtrC8@@AAW4TSenPropertiesClassType@MSenProperties@@@Z @ 9 NONAME ; class TPtrC8 CSenHostletRequest::Properties(enum MSenProperties::TSenPropertiesClassType &) const
+	?RequestId@CSenHostletRequest@@UBEHXZ @ 10 NONAME ; int CSenHostletRequest::RequestId(void) const
+	?RequestId@CSenHostletResponse@@UBEHXZ @ 11 NONAME ; int CSenHostletResponse::RequestId(void) const
+	?RequestUtf8@CSenHostletRequest@@UBE?AVTPtrC8@@XZ @ 12 NONAME ; class TPtrC8 CSenHostletRequest::RequestUtf8(void) const
+	?ResponseCode@CSenHostletResponse@@UBEHXZ @ 13 NONAME ; int CSenHostletResponse::ResponseCode(void) const
+	?ResponseMessageL@CSenHostletResponse@@UAEPAVMSenMessage@@XZ @ 14 NONAME ; class MSenMessage * CSenHostletResponse::ResponseMessageL(void)
+	?ResponseProperties@CSenHostletResponse@@UAEPAVMSenProperties@@XZ @ 15 NONAME ; class MSenProperties * CSenHostletResponse::ResponseProperties(void)
+	?ResponseUtf8@CSenHostletResponse@@UAE?AVTPtrC8@@XZ @ 16 NONAME ; class TPtrC8 CSenHostletResponse::ResponseUtf8(void)
+	?SetResponseUtf8L@CSenHostletResponse@@UAEXABVTDesC8@@HPAVMSenProperties@@PAVMSenMessage@@@Z @ 17 NONAME ; void CSenHostletResponse::SetResponseUtf8L(class TDesC8 const &, int, class MSenProperties *, class MSenMessage *)
+	?ThreadId@CSenHostletRequest@@UBE?AVTPtrC16@@XZ @ 18 NONAME ; class TPtrC16 CSenHostletRequest::ThreadId(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/eabi/SENPROVIDERu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,38 @@
+EXPORTS
+	_ZN18CSenHostletRequest4NewLEiRK6TDesC87RThreadRK14CSenIdentifierP9CSenChunk @ 1 NONAME
+	_ZN18CSenHostletRequest5NewLCEiRK6TDesC87RThreadRK14CSenIdentifierP9CSenChunk @ 2 NONAME
+	_ZN18CSenHostletRequestD0Ev @ 3 NONAME
+	_ZN18CSenHostletRequestD1Ev @ 4 NONAME
+	_ZN18CSenHostletRequestD2Ev @ 5 NONAME
+	_ZN19CSenHostletResponse12ResponseUtf8Ev @ 6 NONAME
+	_ZN19CSenHostletResponse16ResponseMessageLEv @ 7 NONAME
+	_ZN19CSenHostletResponse16SetResponseUtf8LERK6TDesC8iP14MSenPropertiesP11MSenMessage @ 8 NONAME
+	_ZN19CSenHostletResponse18ResponsePropertiesEv @ 9 NONAME
+	_ZN19CSenHostletResponse19ExtractResponseUtf8Ev @ 10 NONAME
+	_ZN19CSenHostletResponse4NewLEi @ 11 NONAME
+	_ZN19CSenHostletResponse5NewLCEi @ 12 NONAME
+	_ZN19CSenHostletResponseD0Ev @ 13 NONAME
+	_ZN19CSenHostletResponseD1Ev @ 14 NONAME
+	_ZN19CSenHostletResponseD2Ev @ 15 NONAME
+	_ZNK18CSenHostletRequest10ConsumerIdEv @ 16 NONAME
+	_ZNK18CSenHostletRequest10PropertiesERN14MSenProperties23TSenPropertiesClassTypeE @ 17 NONAME
+	_ZNK18CSenHostletRequest11RequestUtf8Ev @ 18 NONAME
+	_ZNK18CSenHostletRequest8ThreadIdEv @ 19 NONAME
+	_ZNK18CSenHostletRequest9RequestIdEv @ 20 NONAME
+	_ZNK19CSenHostletResponse12ResponseCodeEv @ 21 NONAME
+	_ZNK19CSenHostletResponse9RequestIdEv @ 22 NONAME
+	_ZTI18CSenHostletRequest @ 23 NONAME ; #<TI>#
+	_ZTI19CSenHostletResponse @ 24 NONAME ; #<TI>#
+	_ZTV18CSenHostletRequest @ 25 NONAME ; #<VT>#
+	_ZTV19CSenHostletResponse @ 26 NONAME ; #<VT>#
+	_ZThn4_N19CSenHostletResponse12ResponseUtf8Ev @ 27 NONAME ; #<thunk>#
+	_ZThn4_N19CSenHostletResponse16SetResponseUtf8LERK6TDesC8iP14MSenPropertiesP11MSenMessage @ 28 NONAME ; #<thunk>#
+	_ZThn4_N19CSenHostletResponse18ResponsePropertiesEv @ 29 NONAME ; #<thunk>#
+	_ZThn4_NK18CSenHostletRequest10ConsumerIdEv @ 30 NONAME ; #<thunk>#
+	_ZThn4_NK18CSenHostletRequest10PropertiesERN14MSenProperties23TSenPropertiesClassTypeE @ 31 NONAME ; #<thunk>#
+	_ZThn4_NK18CSenHostletRequest11RequestUtf8Ev @ 32 NONAME ; #<thunk>#
+	_ZThn4_NK18CSenHostletRequest8ThreadIdEv @ 33 NONAME ; #<thunk>#
+	_ZThn4_NK18CSenHostletRequest9RequestIdEv @ 34 NONAME ; #<thunk>#
+	_ZThn4_NK19CSenHostletResponse12ResponseCodeEv @ 35 NONAME ; #<thunk>#
+	_ZThn4_NK19CSenHostletResponse9RequestIdEv @ 36 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsprovider  
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsprovider.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsprovider.iby)
+
+PRJ_MMPFILES
+senprovider.mmp
+
+//PRJ_TESTMMPFILES
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/group/senprovider.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senprovider    
+*
+*/
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenProvider.DLL
+TARGETTYPE      dll
+UID             0x1000008d 0x2000038D
+#else
+TARGET          wsprovider.DLL
+TARGETTYPE      dll
+UID             0x1000008d 0x10282C42
+#endif
+
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+#if defined(ARMCC)
+  DEFFILE     ../eabi/SENPROVIDER.DEF
+#elif defined(WINSCW)
+  DEFFILE     ../BWINSCW/SENPROVIDER.DEF
+#elif defined(WINS)
+  DEFFILE     ../BWINS/SENPROVIDER.DEF
+#else 
+  DEFFILE     ../BMARM/SENPROVIDER.DEF
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senproviderdll.cpp
+SOURCE          senhostletrequest.cpp
+SOURCE          senhostletresponse.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wshostletconnection/inc
+USERINCLUDE     ../../wsutils/inc // SenIdentifier.h
+USERINCLUDE     ../../wsmessages/inc 
+USERINCLUDE     ../../wsframework/inc
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LANG    SC
+
+LIBRARY         euser.lib
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenUtils.lib
+LIBRARY         SenMessages.lib
+LIBRARY         SenFramework.lib
+#else
+LIBRARY         wsUtils.lib
+LIBRARY         wsMessages.lib
+LIBRARY         wsFramework.lib
+#endif
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/inc/senhostletrequest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_HOSTLET_REQUEST_H
+#define SEN_HOSTLET_REQUEST_H
+
+#include <e32base.h>
+
+#include "MSenHostletRequest.h"
+#include "MSenProperties.h"
+
+// FORWARD DECLARATIONS
+class CSenIdentifier;
+class CSenChunk;
+
+class CSenHostletRequest : public CBase, public MSenHostletRequest
+    {
+    
+    public:
+        /**
+        * Static 2-phased constructor
+        *
+        * Descriptors are not copied, it will only be referenced
+        * by the provider processing this request.
+        * @param aRequestUtf8 must contains reference to the actual
+        * request message (body, or complete message with one or more
+        * headers, depending on whether or not the hostlet wishes to
+        * receive complete client messages). Note that the caller of
+        * this static constructor needs to keep this reference alive
+        * as long as hostlet request object exists, since *no* copy
+        * of original descriptor is made, but direct reference is 
+        * stored instead.
+        * @param aThreadId pointing to requester thread (typically full
+        * name of that thread). Note that descriptor is not copied, but
+        * it needs to be kept alive by the caller instead (mandatory).
+        * @param aConsumerId pointing to requester service consumer 
+        * (typically some URN). Note that descriptor is not copied, but
+        * it needs to be kept alive by the caller instead (mandatory).
+        * @return pointer to new hostler request instance
+        */
+        IMPORT_C static CSenHostletRequest* NewL(const TInt aRequestId,
+                                                 const TDesC8& aRequestUtf8,
+                                                 RThread aThread,
+                                                 const CSenIdentifier& aConsumerId,
+                                                 CSenChunk* apChunk);
+        /**
+        * Static 2-phased constructor
+        *
+        * Descriptor are not copied, it will only be referenced
+        * by the provider processing this request.
+        * @param aRequestUtf8 must contains reference to the actual
+        * request message (body, or complete message with one or more
+        * headers, depending on whether or not the hostlet wishes to
+        * receive complete client messages). Note that the caller of
+        * this static constructor needs to keep this reference alive
+        * as long as hostlet request object exists, since *no* copy
+        * of original descriptor is made, but direct reference is 
+        * stored instead.
+        * @param aThreadId pointing to requester thread (typically full
+        * name of that thread). Note that descriptor is not copied, but
+        * it needs to be kept alive by the caller instead (mandatory).
+        * @param aConsumerId pointing to requester service consumer 
+        * (typically some URN). Note that descriptor is not copied, but
+        * it needs to be kept alive by the caller instead (mandatory).
+        * @param apChunk
+        * @return pointer to new hostler request instance, which
+        * has been left on cleanup stack.
+        */
+        IMPORT_C static CSenHostletRequest* NewLC(const TInt aRequestId,
+                                                  const TDesC8& aRequestUtf8,
+                                                  RThread aThread,
+                                                  const CSenIdentifier& aConsumerId,
+                                                  CSenChunk* apChunk);
+        
+    public:
+        // From MSenHostletRequest
+        IMPORT_C virtual TPtrC8 RequestUtf8() const;
+
+        // Destructor
+        IMPORT_C virtual ~CSenHostletRequest();
+
+        /**
+        * Getter for requester thread id
+        */
+        IMPORT_C virtual TPtrC ThreadId() const;
+
+        /** 
+        * Getter for requester consumer id
+        */
+        IMPORT_C virtual TPtrC8 ConsumerId() const;
+        
+        /** 
+        * Getter for request id
+        */
+        IMPORT_C virtual TInt RequestId() const;
+        
+        /**
+        * Getter for request properties and type
+        */
+        IMPORT_C virtual TPtrC8 Properties(MSenProperties::TSenPropertiesClassType& aType) const;
+                
+
+    private:
+        // C++ constructor
+        CSenHostletRequest(const TInt aRequestId,
+                           const TDesC8& aRequestUtf8, 
+                           RThread aThread,
+                           const CSenIdentifier& aConsumerId,
+                           CSenChunk* apChunk);
+                           
+        void ConstructL();
+        
+    private: // Data
+        TInt iRequestId;
+        TPtrC8 iRequestUtf8;                        // not owned reference to the request
+        RThread iThread;            
+        const CSenIdentifier& iConsumerIdentifier;  // not owned reference to service consumer
+        CSenChunk* ipChunk;                          // not owned
+        
+        TAny* ipReserved;                           // not used currently
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/inc/senhostletresponse.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_HOSTLET_RESPONSE_H
+#define SEN_HOSTLET_RESPONSE_H
+
+#include <e32base.h>
+
+#include "MSenHostletResponse.h"
+#include "msenmessagecontext.h"
+
+// FORWARD DECLARES
+class CSenMessageContext;
+
+class CSenHostletResponse :public CBase, public MSenHostletResponse
+    {
+    
+    public:
+        IMPORT_C static CSenHostletResponse* NewL(const TInt aRequestId);
+        IMPORT_C static CSenHostletResponse* NewLC(const TInt aRequestId);
+        IMPORT_C virtual ~CSenHostletResponse();
+        
+    public:
+        /** 
+        * From MSenHostletResponse
+        */
+        IMPORT_C virtual void SetResponseUtf8L(const TDesC8& aResponseBodyUtf8,
+                                               const TInt aResponseCode = KErrNone,
+                                               MSenProperties* apResponseProperties = NULL,
+                                               MSenMessage* apMessage = NULL);
+        
+    public:
+        /**
+        *  Extraction getter for response data set by the hostlet application
+        *  @return reference to response body. Caller takes ownership of the returned object.
+        */
+        IMPORT_C HBufC8* ExtractResponseUtf8();
+        
+        /**
+        *  Getter for response data set by the hostlet application
+        *  @return reference to response body. Ownership is not transferred.
+        */
+        IMPORT_C virtual TPtrC8 ResponseUtf8();
+
+        /** 
+        * Getter for request id
+        */
+        IMPORT_C virtual TInt RequestId() const;
+
+        /** 
+        * Getter for response code set by the hostlet application
+        */
+        IMPORT_C virtual TInt ResponseCode() const;
+        
+        /**
+        * Getter for response properties
+        */
+        IMPORT_C virtual MSenProperties* ResponseProperties();
+
+        /**
+        * Getter for response as a message object. Note that this message
+        * can be safely class-cast further to a concrete subclass via the
+        * MSenMessage::IsSafeToCast() helper function.
+        * @return message or NULL if the response data is not available
+        */
+        IMPORT_C virtual MSenMessage* ResponseMessageL();	//codescannerwarnings
+        
+    protected:
+        void BaseConstructL();
+    
+    private:
+        CSenHostletResponse(const TInt aRequestId);
+        
+        MSenMessageContext& MessageContextL(MSenProperties* apProperties = NULL);
+        
+    private:
+        TInt iRequestId;
+        TInt iResponseCode;
+        HBufC8* ipOwnedResponseUtf8;
+        TAny* iReserved; // not used currently
+        CSenMessageContext* ipMessageContext;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/rom/wsprovider.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSPROVIDER_IBY__
+#define __WSPROVIDER_IBY__
+
+//Provider
+file=ABI_DIR\BUILD_DIR\SenProvider.dll          PROGRAMS_DIR\SenProvider.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/src/senhostletrequest.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "senhostletrequest.h"
+
+#include "senidentifier.h"  // internal, Utils\inc
+#include "senchunk.h"       // internal, Utils\inc
+
+EXPORT_C CSenHostletRequest* CSenHostletRequest::NewL(const TInt aRequestId,
+                                                      const TDesC8& aRequestUtf8,
+                                                      RThread aThread,
+                                                      const CSenIdentifier& aConsumerId,
+                                                      CSenChunk* apChunk)
+    {
+    CSenHostletRequest* pNew = CSenHostletRequest::NewLC(aRequestId,
+                                                         aRequestUtf8, 
+                                                         aThread, 
+                                                         aConsumerId,
+                                                         apChunk);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenHostletRequest* CSenHostletRequest::NewLC(const TInt aRequestId,
+                                                       const TDesC8& aRequestUtf8,
+                                                       RThread aThread,
+                                                       const CSenIdentifier& aConsumerId,
+                                                       CSenChunk* apChunk)
+    {
+    CSenHostletRequest* pNew = 
+        new(ELeave) CSenHostletRequest(aRequestId, aRequestUtf8, aThread, aConsumerId, apChunk);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenHostletRequest::CSenHostletRequest(const TInt aRequestId,
+                                       const TDesC8& aRequestUtf8,
+                                       RThread aThread,
+                                       const CSenIdentifier& aConsumerId,
+                                       CSenChunk* apChunk)
+: iRequestId(aRequestId),
+  iRequestUtf8(aRequestUtf8),
+  iThread(aThread),
+  iConsumerIdentifier(aConsumerId),
+  ipChunk(apChunk)
+        {
+        }
+  
+EXPORT_C CSenHostletRequest::~CSenHostletRequest()
+    {
+    }
+
+void CSenHostletRequest::ConstructL()
+    {
+    
+    }
+
+EXPORT_C TPtrC8 CSenHostletRequest::RequestUtf8() const
+    {
+    return iRequestUtf8;
+    }
+
+
+EXPORT_C TPtrC CSenHostletRequest::ThreadId() const
+    {
+    return iThread.FullName();
+    }
+
+EXPORT_C TPtrC8 CSenHostletRequest::ConsumerId() const
+    {
+    return iConsumerIdentifier.Value();
+    }
+
+EXPORT_C TInt CSenHostletRequest::RequestId() const
+    {
+    return iRequestId;
+    }
+
+
+EXPORT_C TPtrC8 CSenHostletRequest::Properties(MSenProperties::TSenPropertiesClassType& aType) const
+    {
+    
+    if(!ipChunk)
+        {
+        aType = MSenProperties::ENotInUse;
+        return KNullDesC8();
+        }
+        
+    aType = ipChunk->ChunkHeader().PropertiesType();
+    TPtrC8 properties;
+    ipChunk->DescFromChunk(properties, 1);
+    return properties;
+    }
+
+
+// END OF FILE
+
+
+
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/src/senhostletresponse.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "senhostletresponse.h"
+
+#include <SenHttpTransportProperties.h>
+#include "senvtcptransportproperties.h"
+#include <SenParser.h>
+
+#include <MSenProperties.h>
+#include <MSenMessage.h>
+#include "senmessagecontext.h"
+#include "SenSoapMessage2.h"
+
+//using namespace SenContext;
+
+EXPORT_C CSenHostletResponse* CSenHostletResponse::NewL(const TInt aRequestId)
+    {
+    CSenHostletResponse* pNew = CSenHostletResponse::NewLC(aRequestId);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenHostletResponse* CSenHostletResponse::NewLC(const TInt aRequestId)
+    {
+    CSenHostletResponse* pNew = new(ELeave) CSenHostletResponse(aRequestId);
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+void CSenHostletResponse::BaseConstructL()
+    {
+    }
+
+CSenHostletResponse::CSenHostletResponse(const TInt aRequestId)
+: iRequestId(aRequestId),
+  iResponseCode(KErrNone),
+  ipOwnedResponseUtf8(NULL),
+  ipMessageContext(NULL)
+    {
+    }
+    
+EXPORT_C CSenHostletResponse::~CSenHostletResponse()
+    {
+    delete ipOwnedResponseUtf8;
+    ipOwnedResponseUtf8 = NULL;
+    delete ipMessageContext;
+    ipMessageContext = NULL;
+    }
+
+EXPORT_C void CSenHostletResponse::SetResponseUtf8L(const TDesC8& aResponseBodyUtf8,
+                                                    const TInt aResponseCode,
+                                                    MSenProperties* apResponseProperties,
+                                                    MSenMessage* apMessage)
+    {
+    HBufC8* pTemp = aResponseBodyUtf8.AllocL();
+    iResponseCode = aResponseCode;
+    delete ipOwnedResponseUtf8;
+    ipOwnedResponseUtf8 = NULL;
+    ipOwnedResponseUtf8 = pTemp;
+    
+
+    TInt error(KErrNone);
+    MSenProperties* p = NULL;
+    if( apResponseProperties && apResponseProperties->PropertiesClassType() != MSenProperties::ENotInUse )
+        {
+        p = apResponseProperties->Clone(error);
+        }
+
+    if( p )
+        {
+        // Create new message context
+        delete ipMessageContext;  
+        ipMessageContext = NULL;
+        MessageContextL( p );
+        }
+    else
+        {
+        MessageContextL();
+        }
+        
+    MSenMessageContext& ctx = MessageContextL();
+    MSenMessage* pMessage = NULL;
+    if( !apMessage ) 
+        {
+        pMessage = CSenSoapMessage2::NewL( ctx ); // ctx holds the transport properties, if such exist
+        ctx.SetMessage(pMessage, ETrue);
+        }
+    else
+        {
+        pMessage = apMessage->CloneL();
+        ctx.SetMessage(pMessage, ETrue);
+        }        
+    
+    // Set the message into context, with possible properties..
+    error = 0; // not used in release builds
+    
+/*
+    MSenProperties* pResponseProperties = NULL;
+    
+    if( apResponseProperties && apResponseProperties->PropertiesClassType() != MSenProperties::ENotInUse )
+        {
+        switch(apResponseProperties->PropertiesClassType())
+            {
+            case MSenProperties::ENotInUse:
+                {
+                break;
+                }
+                
+            
+            case MSenProperties::ESenXmlProperties:
+            case MSenProperties::ESenLayeredXmlProperties: // flatten the props
+                {
+                pResponseProperties = CSenXmlProperties::NewL(); // iSerializedMessage, *pReader);
+                break;
+                }
+            case MSenProperties::ESenTransportProperties:
+            case MSenProperties::ESenLayeredTransportProperties: // flatten the props
+                {
+                pResponseProperties = CSenTransportProperties::NewL();
+                break;
+                }
+            case MSenProperties::ESenHttpTransportProperties:
+            case MSenProperties::ESenLayeredHttpTransportProperties: // flatten the props
+                {
+                pResponseProperties = CSenHttpTransportProperties::NewL();
+                break;
+                }
+            case MSenProperties::ESenVtcpTransportProperties:
+            case MSenProperties::ESenLayeredVtcpTransportProperties: // flatten the props
+                {
+                pResponseProperties = CSenVtcpTransportProperties::NewL();
+                break;
+                }
+            default: 
+                {
+                break;
+                }
+            }
+            
+        if( ipResponseProperties )  
+            {
+            HBufC8* pSerializedProperties = apResponseProperties->AsUtf8LC();
+            if (pSerializedProperties && pSerializedProperties->Length()>0)
+                {
+                TRAPD( err, ipResponseProperties->ReadFromL(*pSerializedProperties); ) // suppress any parsing leave
+                TInt unused(err);
+                err = unused;
+                }
+            CleanupStack::PopAndDestroy(pSerializedProperties);
+            }
+        }
+*/
+    }
+
+
+EXPORT_C MSenProperties* CSenHostletResponse::ResponseProperties()
+    {
+    TInt leaveCode(KErrNone);
+    MSenMessageContext* pCtx = NULL;
+    MSenMessage* pMessage = NULL;
+    TRAP( leaveCode, pCtx = &(MessageContextL()); )
+    if( !leaveCode && pCtx )
+        {
+        TRAP( leaveCode, pMessage = pCtx->MessageL(); )
+        //pMessage = pCtx->Message();
+        if( !leaveCode && pMessage )
+            {
+            return pMessage->Properties();
+            }
+        }
+    return NULL; // not found
+    }
+    
+EXPORT_C MSenMessage* CSenHostletResponse::ResponseMessageL()
+    {
+    TInt leaveCode(KErrNone);
+    MSenMessage* pMsg = NULL;
+    TRAP( leaveCode,  pMsg = MessageContextL().MessageL(); )
+    if( leaveCode == KErrNone )
+        {
+        return pMsg;
+        }
+    leaveCode = 0; // ignored
+    return NULL;        
+    }
+    
+
+EXPORT_C HBufC8* CSenHostletResponse::ExtractResponseUtf8()
+    {
+    HBufC8* pResult = ipOwnedResponseUtf8;
+    ipOwnedResponseUtf8 = NULL;
+    return pResult;
+    }
+
+
+EXPORT_C TPtrC8 CSenHostletResponse::ResponseUtf8()
+    {
+    if(ipOwnedResponseUtf8)
+        {
+        return *ipOwnedResponseUtf8;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+EXPORT_C TInt CSenHostletResponse::RequestId() const
+    {
+    return iRequestId;
+    }
+
+EXPORT_C TInt CSenHostletResponse::ResponseCode() const
+    {
+    return iResponseCode;
+    }
+
+
+MSenMessageContext& CSenHostletResponse::MessageContextL(MSenProperties* apProperties)
+    {
+    if( !ipMessageContext )
+        {
+        if( apProperties )
+            ipMessageContext = CSenMessageContext::NewL(SenContext::EOutgoing, apProperties);
+        else
+            {
+            CSenXmlProperties* p = CSenXmlProperties::NewL();
+            CleanupStack::PushL(p);
+            ipMessageContext = CSenMessageContext::NewL(SenContext::EOutgoing, p);
+            CleanupStack::Pop(p);
+            }
+        }
+    return *ipMessageContext;
+    }
+    
+    
+// END OF FILE
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsprovider/src/senproviderdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+
+// ============================= LOCAL FUNCTIONS ===============================
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    } 
+#endif // not EKA2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/data/10274c6f.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource file
+*
+*/
+
+
+
+
+
+
+
+
+ 
+ #include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10274C6F;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96F9;
+            implementations = 
+                {
+                // Info for CSenWsiPlugin: frameworkID = "REST"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10274C70;
+                    version_no         = 1;
+                    display_name       = "SenRestPlugin SIF";
+                    default_data       = "com.nokia.Sen.rest.RestServiceFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/data/10282c43.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 1027 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource file
+*
+*/
+
+
+
+
+
+
+
+
+ 
+ #include <ecom/RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10282C43;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9730;
+            implementations = 
+                {
+                // Info for CSenWsiPlugin: frameworkID = "REST"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C4A;
+                    version_no         = 1;
+                    display_name       = "SenRestPlugin SIF";
+                    default_data       = "com.nokia.Sen.rest.RestServiceFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*    This file provides the information required for building the 
+*        implementation collection.
+*
+*/
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsrestplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsrestplugin.iby)
+PRJ_MMPFILES
+../../wsrestplugin/group/senrestplugin.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/group/senrestplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senrestplugin    
+*
+*/
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+// ECOM plug-in DLL recognition UID followed by the unique UID for this DLL
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET SenRestPlugin.dll
+UID 0x10009D8D 0x10274C6F
+#else
+TARGET wsrestplugin.dll
+UID 0x10009D8D 0x10282C43
+#endif
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senrestpluginmain.cpp
+SOURCE          senrestpluginproxy.cpp
+SOURCE          senrestservicesession.cpp
+SOURCE          senrestplugin.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsframework/inc
+USERINCLUDE     ../../wsutils/inc
+USERINCLUDE     ../../wsidentitymanager/inc
+USERINCLUDE     ../../wscredentialmanager/inc
+USERINCLUDE   ../../wslogger/inc              // for TLS based file logging
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+
+SYSTEMINCLUDE   ../../wsframework/inc  // SenServiceInvocationFramework.h
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE  10274c6f.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET SenRestPlugin.rsc
+#endif
+#else
+START RESOURCE  10282C43.RSS
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsrestplugin.rsc
+#endif
+
+#endif
+
+END
+
+// System libs
+LIBRARY ecom.lib
+LIBRARY euser.lib 
+LIBRARY flogger.lib
+
+
+LIBRARY estor.lib // RWriteStrem for REST session extensions
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY senlogger.lib   // for TLS based logging
+// Web Services Framework libs
+LIBRARY SenFramework.lib
+LIBRARY SenServDesc.lib
+LIBRARY SenXml.lib
+LIBRARY SenUtils.lib
+#else
+LIBRARY wslogger.lib   // for TLS based logging
+LIBRARY wsFramework.lib
+LIBRARY wsServDesc.lib
+LIBRARY wsXml.lib
+LIBRARY wsUtils.lib
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/inc/senrestplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,258 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_REST_PLUGIN_H
+#define SEN_REST_PLUGIN_H
+
+#include <e32std.h>
+#include <flogger.h>
+#include "SenXmlUtils.h"
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+class CSenBaseFragment;
+class MSenTransport;
+class CSenRestServiceSession;
+
+// CONSTANTS
+
+_LIT8(KRestFrameworkVersion,     "1.0");
+_LIT8(KRestFrameworkXMLNS,       "urn:com.nokia.Sen.rest.config.1.0");
+_LIT8(KRestFrameworkCue,         "com.nokia.Sen.rest.RestServiceFramework");
+                                 
+// INCLUDES
+#include "senserviceinvocationframework.h" // internal Framework\inc
+
+/**
+ * Class:       CSenIdWsfPlugin
+ *
+ * Description: An implementation of the CSIF definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CSenRestPlugin : public CSIF
+    {
+public:
+    /**
+     * Function:    NewL
+     *
+     * Description: Create instance of concrete implementation. Note that ECOM
+     *              interface implementations can only have two signatures for
+     *              NewL:
+     *               - NewL without parameters (used here)
+     *               - NewL with TAny* pointer, which may provide some client
+     *                 data
+     *
+     * Returns:    Instance of this class.
+     *
+     * Note:       The interface, which is abstract base class of this
+     *             implementation, also provides NewL method. Normally abstract
+     *             classes do not provide NewL, because they cannot create
+     *             instances of themselves.
+     */
+    static CSenRestPlugin* NewL(TAny* aManager);
+
+
+public: // Methods implementing CSIF ECOM interface
+    // For convenience of components classes
+    //RFileLogger* Log() const;
+
+    /**
+     * Return a system wide unique string to identify this framework
+     *
+     * @return TDesC8 that uniquely identifies this framework.
+     */
+    virtual const TDesC8& Id();
+
+    /**
+     * Try to find one or more services that match the given
+     * ServiceDescription.
+     * Register ServiceDescriptions for these to the owner of the framework,
+     * i.e. to the ServiceManager. Return the number of ServiceDescriptions
+     * that were added.
+     *
+     * @param   aPattern - A ServiceDescriptin that should be treated as a
+     *          pattern
+     *
+     * @param
+     *  return (TInt) count of matching ServiceDescriptions that were added
+     */
+    virtual TInt AddServiceDescriptionL( MSenServiceDescription& aPattern, 
+                                         MSenRemoteServiceConsumer& aRemoteConsumer,
+                                         HBufC8*& aErrorMsg ); 
+
+    /**
+     * Attempt to register the ServiceDescription to the ServiceManager that
+     * owns the framework.
+     * This is a callback used by the ServiceManager to give frameworks a
+     * chance to replace a generic ServiceDescription into something that is
+     * more specific, and more useful, to the ServiceInvocationFramework.
+     *
+     * @param aServiceDescription A ServiceDescription
+     *
+     *  return TInt aError - indicates the error or KErrNone if successful
+     */
+    virtual TInt RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription);
+
+
+    /**
+     * Attempt to unregister the ServiceDescription from the ServiceManager
+     * that owns the framework.
+     * This is a callback used by the ServiceManager.
+     *
+     * @param aServiceDescription A ServiceDescription
+     *
+     *  return TInt aError - indicates the error or KErrNone if successful
+     */
+    virtual TInt UnregisterServiceDescriptionL(MSenServiceDescription& aServiceDescription);
+
+    /**
+     * Create a ServiceSession based upon the given ServiceDescription.
+     * The ServiceSession is expected to be "valid", i.e. ready for use
+     * by a client.
+     *
+     * @param aServiceDescription A ServiceDescription
+     *
+     * @param aNewSession (CSenServiceSession)
+     *
+     * return TInt error or KErrNone if successful
+     */
+    virtual TInt CreateServiceSessionL(MSenServiceDescription& aServiceDescription,
+                                       MSenServiceDescription& aPattern,
+                                       CSenServiceSession*& aNewSession,
+                                       MSenRemoteServiceConsumer& aRemoteConsumer,
+                                       HBufC8*& aErrMsg);
+
+    /**
+     * Return a new instance of a framework specific class that
+     * implements the ServiceDesccription interface.
+     *
+     * @param new service description 
+     *        (which typically derives from CSenServiceSession)
+     *
+     * return TInt error or KErrNone if successful
+     */
+    virtual CSenWSDescription* NewServiceDescriptionL();
+
+    /**
+     * Return the ServiceManager for which this instance is working.
+     * This is used by the ServiceSession instances created by this framework.
+     *
+     * Note, in Sen, MSenCoreServiceManager IS SINGLETON(!), so all Frameworks
+     * return their "owner" - that is - the only service manager in
+     * Sen Framework
+     *
+     * @return (MSenCoreServiceManager)
+     */
+    virtual MSenCoreServiceManager& Manager();
+
+
+    /**
+     * Set the ServiceManager to which this instance reports.
+     * The (singleton) ServiceManager calls this method when
+     * it instantiates a framework.
+     *
+     * @param aServiceManager The singleton ServiceManager in the system.
+     */
+    virtual void SetManager(MSenCoreServiceManager& aServiceManager);
+
+
+    /**
+     * Return an object that can do SAX based parsing of a XML fragment
+     * that contains framework specific configuration information.
+     * The ServiceManager asks for this BaseFragment upon startup
+     * in order to give this framework a chance to read its configuration
+     * information from the central ServiceManager configuration document.
+     *
+     * @return (CSenBaseFragment)
+     */
+    virtual CSenBaseFragment& ConfigParser();
+
+    /**
+     * Write the ServiceInvocationFramework configuration as XML to a HBufC8.
+     *
+     * This method is invoked by the ServiceManager when it saves
+     * its state and/or configuration.
+     *
+     * Upon startup the chunk of XML that is written will be passed back to
+     * the configuation parser of the framework.
+     *
+     * The "schema" that shall be adhered to is:
+     * <pre>
+     * &lt;element name="Framework"&gt;
+     *      &lt;any/&gt;&lt;!-- this is where implementations write additional
+     *      information --&gt;
+     *      &lt;attribute name="class" type="String"&gt;
+     *    &lt;!-- In Syimbian the class attribute is used as cue for the
+     *      ECOM Resolver --&gt;
+     * &lt;/element&gt;
+     * </pre>
+     *
+     * @param aTo - a HBufC8 to which the framework should write its
+     *              configuration
+     */
+
+    virtual HBufC8* AsXmlL();
+    virtual HBufC* AsXmlUnicodeL();
+    virtual void EndElementL(const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName);
+
+    TInt OnEvent(const TInt aEvent, TAny* aArgument);
+
+    virtual TAny* ExtendedInterface();
+
+    // New methods
+
+    /**
+    * REST framework specifies at least following text/xml content type:
+    * KTextWwwFormContentType ==  "application/x-www-form-urlencoded; charset=UTF-8"
+    * @return KErrNone on success, system-wide error code otherwise
+    */    
+    virtual TInt SetTransportPropertiesL(MSenTransport& aTransport);
+
+public: // destructor
+    virtual ~CSenRestPlugin();
+
+
+protected:
+    /**
+     * Function:   CSenRestPlugin
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CSenRestPlugin(MSenCoreServiceManager& aManager);
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private: // data
+    MSenCoreServiceManager& iManager;
+    };
+
+
+#endif // SEN_REST_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/inc/senrestservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_REST_SERVICE_SESSION_H
+#define SEN_REST_SERVICE_SESSION_H
+
+//  INCLUDES
+#include "senwebservicesession.h"
+
+// FORWARD DECLARATIONS
+class MSenServiceConsumer;
+class MServiceDescription;
+class CSenCredential;
+class CSenSoapMessage;
+
+// CONSTANTS
+_LIT8(KConsumerIdLocalname, "ConsumerID");
+
+// CLASS DECLARATION
+class CSenRestServiceSession : public CSenWebServiceSession
+    {
+    public:
+        /**
+        * Constructors and destructor
+        */
+        static CSenRestServiceSession* NewL(MSIF& aFramework);
+        static CSenRestServiceSession* NewLC(MSIF& aFramework);
+        virtual ~CSenRestServiceSession();
+
+
+        // Functions from base classes:
+
+        // From WebServiceSession
+        TInt ComputeStatusL();         // In REST service session: nothing to do
+
+        virtual TInt CompleteServerMessagesOnOffL(const TBool& aCompleteOnOff);
+
+        // Complete superclass implementations:
+        virtual TInt SubmitL(const TDesC8& aMessage, 
+                             const TDesC8& aTransportProperties,
+                             MSenRemoteServiceConsumer& aConsumer,
+                             HBufC8*& aResponse);
+
+        virtual TInt SendL(const TDesC8& aMessage, 
+                           const TDesC8& aTransportProperties,
+                           MSenRemoteServiceConsumer& aConsumer,
+                           TInt& aTxnId,
+                           HBufC8*& aRevalidationError);
+        
+        virtual TInt SubmitSoapL(const TDesC8& aMessage, 
+                                 const TDesC8& aTransportProperties,
+                                 MSenRemoteServiceConsumer& aConsumer,
+                                 HBufC8*& aResponse);
+
+        virtual TInt SendSoapL( const TDesC8& aMessage, 
+                                const TDesC8& aTransportProperties,
+                                MSenRemoteServiceConsumer& aConsumer,
+                                TInt& aTxnId,
+                                HBufC8*& aRevalidationError );
+
+        TInt SendToConsumerL(HBufC8* apMessage,
+                             const TInt aTxnId,
+                             MSenRemoteServiceConsumer& aConsumer,
+                             MSenProperties* aResponseTransportProperties = NULL); 
+
+        TInt SendErrorToConsumerL(const TInt aErrorCode,
+                                  HBufC8* apError,
+                                  const TInt aTxnId,
+                                  MSenRemoteServiceConsumer& aConsumer,
+                                  MSenProperties* aResponseTransportProperties = NULL); 
+
+        TInt HandleErrorL(const TInt aErrorCode,
+                          HBufC8* apError,
+                          const TInt aTxnId,
+                          MSenRemoteServiceConsumer& aConsumer,
+                          MSenProperties* aResponseTransportProperties = NULL); 
+
+
+        /**
+        * @see CSenWSDescription
+        */
+        virtual TBool HasSuperClass( TDescriptionClassType aType );
+
+    protected:
+        CSenRestServiceSession(TDescriptionClassType aType, MSIF& aFramework);
+        void ConstructL();
+        
+    private:
+        // NOTE: this is temporary method which MUST be removed when message context is made available in SendL/SubmitL                                
+        TInt SetFrameworkPropertiesL(MSenTransport& aTransport); // Temporary
+    };
+
+
+
+#endif // SEN_REST_SERVICE_SESSION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/rom/wsrestplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSRESTPLUGIN_IBY__
+#define __WSRESTPLUGIN_IBY__
+
+//RestPlugin
+ECOM_PLUGIN(SenRestPlugin.dll, 10274C6F.rsc)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/src/senrestplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,454 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "senrestplugin.h"
+#include "MSenServiceDescription.h"
+#include "SenServiceConnection.h" // framework IDs, error codes..
+#include "msencoreservicemanager.h"
+#include "senrestservicesession.h"
+#include "sendebug.h"
+#include "SenFacet.h" 
+#include "senlogger.h" 
+
+#include <SenHttpTransportProperties.h>
+
+
+namespace
+    {
+    _LIT8(KFrameworkLocalname,   "Framework");
+#ifdef _SENDEBUG
+        const TInt KFLATBUFSIZE = 64;
+#endif // _SENDEBUG
+    _LIT8(KTextWwwFormContentType,  "application/x-www-form-urlencoded; charset=UTF-8");
+    }
+
+// Create instance of concrete ECOM interface implementation
+CSenRestPlugin* CSenRestPlugin::NewL(TAny* aManager)
+    {
+    MSenCoreServiceManager* manager =
+        reinterpret_cast<MSenCoreServiceManager*>(aManager);
+    
+    CSenRestPlugin* self = new (ELeave) CSenRestPlugin(*manager);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Constructor
+CSenRestPlugin::CSenRestPlugin(MSenCoreServiceManager& aManager)
+    : iManager(aManager)
+    {
+    }
+
+CSenRestPlugin::~CSenRestPlugin()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenRestPlugin::~CSenRestPlugin()")));
+    }
+
+// Second phase construction.
+void CSenRestPlugin::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenRestPlugin::ConstructL")));
+    
+    BaseConstructL(KRestFrameworkXMLNS, KFrameworkLocalname);
+    }
+
+/*RFileLogger* CSenRestPlugin::Log() const
+    {
+    return iManager.Log();
+    }
+*/
+
+
+TInt CSenRestPlugin::RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription)
+    {
+    TInt retVal(KErrNone);
+
+#ifdef _SENDEBUG
+    TPtrC8 contract = aServiceDescription.Contract();
+    TPtrC8 endpoint = aServiceDescription.Endpoint();
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::RegisterServiceDescriptionL");
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - creating session from description.");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - Endpoint: '%S'"), &endpoint));
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - Contract: '%S'"), &contract));
+#endif
+
+    if( aServiceDescription.Endpoint().Length() == 0 )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - Endpoint is zero-lenght(!), cannot register such SD.");
+        return KErrSenNoEndpoint;
+        }
+
+
+    // REST sessions are matched by consumer id.
+    // This way we can avoid session sharing/multiple consumers
+     
+    CSenRestServiceSession* pSession = CSenRestServiceSession::NewLC(*this);
+    retVal = pSession->InitializeFromL(aServiceDescription);
+
+
+    if(retVal == KErrNone)
+        {
+        // Takes the ownership of this session
+        retVal = Manager().AddServiceDescriptionL(pSession);
+        CleanupStack::Pop(pSession);
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(pSession);
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::RegisterServiceDescriptionL:");
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Session->InitializeFromL failed: %d"), retVal));
+        }
+    return retVal;
+    }
+
+TInt CSenRestPlugin::UnregisterServiceDescriptionL(MSenServiceDescription& aServiceDescription )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::UnregisterServiceDescriptionL");
+    TInt retVal(KErrNone);
+    CSenRestServiceSession *pSession = NULL;
+        
+    if(aServiceDescription.DescriptionClassType() == MSenServiceDescription::ERestServiceSession)
+        {
+        pSession = (CSenRestServiceSession*) &aServiceDescription;
+        retVal = Manager().RemoveServiceDescriptionL(*pSession);
+        }
+     else
+     {
+#ifdef _SENDEBUG
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Creating session from description...");
+            TPtrC8 con = aServiceDescription.Contract();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("-contract: '%S'"), &con));
+#endif // _SENDEBUG
+
+            pSession = CSenRestServiceSession::NewLC(*this);
+            retVal = pSession->InitializeFromL(aServiceDescription);
+            if (retVal == KErrNone)
+                {
+                retVal = Manager().RemoveServiceDescriptionL(*pSession);
+                }
+            CleanupStack::PopAndDestroy(pSession);     	
+     }
+    return retVal;
+    }
+    
+
+
+const TDesC8& CSenRestPlugin::Id()
+    {   
+    return KDefaultRestServicesFrameworkID(); // "REST"
+    }
+
+TInt CSenRestPlugin::AddServiceDescriptionL( MSenServiceDescription& aPattern,
+                                             MSenRemoteServiceConsumer& /* aRemoteConsumer */,
+                                             HBufC8*& /* aErrorMsg */ )
+    {
+
+    // Currently, accept only SDs, which explicitly declare REST framework ID.
+    if(aPattern.FrameworkId() != KDefaultRestServicesFrameworkID)
+        {
+        return 0;
+        }
+
+    TPtrC8 endpoint = aPattern.Endpoint();
+    if( endpoint.Length() > 0 )
+        {
+        CSenRestServiceSession* pNewSession =
+            (CSenRestServiceSession*) NewServiceDescriptionL();
+        CleanupStack::PushL(pNewSession);
+
+        // InitializeFromL call copies the contract and endpoint, 
+        // and possibly any facets set by Service Management API:
+        TInt retVal = pNewSession->InitializeFromL( aPattern );
+        if( retVal != KErrNone )
+            {
+            CleanupStack::PopAndDestroy();
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::AddServiceDescriptionL:");
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- New session->InitializeFromL failed: %d"), retVal));
+            return 0;
+            }
+        else // init ok
+            {
+            // Core / XML DAO takes ownership of new session:
+            // - if duplicate (equal primary keys) exists, it is deleted
+            Manager().AddServiceDescriptionL(pNewSession); 
+            CleanupStack::Pop(pNewSession);
+            return 1; // one new session added
+            }
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - No endpoint; new session could not be added.");
+        return 0; // zero added
+        }
+
+
+
+    // alternative version:
+    /*
+    CSenServiceSession* pNewSession = NULL;
+    HBufC8* pErrMsg = NULL;
+    TInt retVal = CreateServiceSessionL(aPattern, aPattern, 
+                      pNewSession, aRemoteConsumer, pErrMsg);
+    delete pErrMsg; 
+
+    if(retVal==KErrNone)
+        {
+        return 1; // one added;
+        }
+    else
+        {
+        return 0; // zero added;  // no endpoint for REST service session
+        }
+    */
+    }
+
+TInt CSenRestPlugin::CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                            MSenServiceDescription& /* aPattern */,
+                                            CSenServiceSession*& aNewSession,
+                                            MSenRemoteServiceConsumer& /* aRemoteConsumer */,
+                                            HBufC8*& /* aErrorMsg */ )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::CreateServiceSessionL");
+    CSenRestServiceSession* pNewSession = NULL;
+
+    TInt retVal(KErrNone);
+    if(aServiceDescription.DescriptionClassType() == MSenServiceDescription::ERestServiceSession)
+        {
+        pNewSession = (CSenRestServiceSession*) &aServiceDescription;
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Service description is already a REST service session");
+        //pNewSession->CopyFacetsFromL(aPattern); // not performed with REST
+        retVal = KErrNone;
+        }
+    else
+        {
+        TPtrC8 endpoint = aServiceDescription.Endpoint();
+        if( endpoint.Length() > 0 )
+            {
+            pNewSession = (CSenRestServiceSession*) NewServiceDescriptionL();
+            CleanupStack::PushL(pNewSession);
+
+            // InitializeFromL call copies the contract and endpoint:
+            retVal = pNewSession->InitializeFromL(aServiceDescription);
+
+#ifdef _SENDEBUG
+            CBufFlat* pBuf = CBufFlat::NewL( KFLATBUFSIZE );
+            CleanupStack::PushL(pBuf);
+            RBufWriteStream writeStream;
+            writeStream.Open(*pBuf);
+            CleanupClosePushL(writeStream);
+            pNewSession->WriteAsXMLToL(writeStream);
+            TPtr8 ptr = pBuf->Ptr(0);
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- New REST service session as XML:");
+            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,( ptr ));
+            CleanupStack::PopAndDestroy(2); // writeStream.Close(), pBuf
+#endif // _SENDEBUG        
+            
+            if( retVal == KErrNone ) // initialize from pattern OK
+                {
+                // NOTE: Core ALWAYS takes ownership of new session:
+                // - if some session with equal primary keys exists, it is deleted
+                retVal = Manager().AddServiceDescriptionL(pNewSession); // 2006-07-06: now retVal is taken in use in here(!)
+                CleanupStack::Pop(pNewSession);
+#ifdef _SENDEBUG
+                if(retVal!=KErrNone)
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::CreateServiceSessionL:");
+                    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8(" - CoreServiceMngr::AddServiceDescriptionL returned: %d"), retVal));
+                    }
+#endif
+                }
+            else // initialize from pattern failed!
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenRestPlugin::CreateServiceSessionL:");
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- New session->InitializeFromL failed: %d"), retVal));
+                CleanupStack::PopAndDestroy(pNewSession);
+                }
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," - No endpoint - ; returning KErrSenNoEndpoint");
+            retVal = KErrSenNoEndpoint; // no endpoint for REST web service session
+            }
+        }
+    aNewSession = pNewSession; 
+    return retVal;
+    }
+
+TInt CSenRestPlugin::OnEvent(const TInt /* aEvent */,
+                            TAny* /* apArgument */)
+    {
+    //LOG_WRITE_L("CSenRestPlugin::OnEvent");
+    //LOG_WRITEFORMAT((_L8("-event code: %d"), aEvent));
+    TInt retVal(KErrNone);
+
+    return retVal;
+    }
+
+TAny* CSenRestPlugin::ExtendedInterface()
+    {
+    // There is no extended interface in REST framework at the moment
+    return NULL;
+    }
+
+CSenWSDescription* CSenRestPlugin::NewServiceDescriptionL()
+    {
+    CSenRestServiceSession* pSD =
+        CSenRestServiceSession::NewLC(*this);
+    pSD->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    CSenFacet* pCompleteOn = CSenFacet::NewL();
+    CleanupStack::PushL(pCompleteOn);
+    pCompleteOn->SetNameL(KCompleteMessagesFacet);
+    pSD->SetFacetL(*pCompleteOn);
+    CleanupStack::PopAndDestroy(pCompleteOn);
+    CleanupStack::Pop(pSD);
+    return pSD;
+    }
+
+/**
+* Return the ServiceManager for which this instance is working.
+* This is used by the ServiceSession instances created by this framework.
+*
+* Note, in Sen, MSenCoreServiceManager so all Frameworks
+* return their "owner" - i.e. - the only service manager in Sen Framework
+*
+* @return (MSenCoreServiceManager)
+*/
+
+MSenCoreServiceManager& CSenRestPlugin::Manager()
+    {
+    return iManager;  
+    }
+
+/**
+* Set the ServiceManager to which this instance reports.
+* The (singleton) ServiceManager calls this method when
+* it instantiates a framework.
+*
+* @param aServiceManager The singleton ServiceManager in the system.
+*/
+void CSenRestPlugin::SetManager(MSenCoreServiceManager& aServiceManager)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenRestPlugin::SetManager(.)")));
+    iManager = aServiceManager;
+    }
+
+/**
+* Return an object that can do SAX based parsing of a XML fragment
+* that contains framework specific configuration information.
+* The ServiceManager asks for this BaseFragment upon startup
+* in order to give this framework a chance to read its configuration
+* information from the central ServiceManager configuration document.
+*
+* @return (CSenBaseFragment)
+*/
+CSenBaseFragment& CSenRestPlugin::ConfigParser()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CSenRestPlugin::ConfigParser()")));
+    return *this;
+    }
+
+/**
+* Write the ServiceInvocationFramework configuration as XML to a HBufC8.
+*
+* This method is invoked by the ServiceManager when it saves
+* its state and/or configuration.
+*
+* Upon startup the chunk of XML that is written will be passed back to
+* the configuation parser of the framework.
+*
+* The "schema" that shall be adhered to is:
+* <pre>
+* &lt;element name="Framework"&gt;
+*       &lt;any/&gt;&lt;!-- this is where implementations write additional
+*       information --&gt;
+*       &lt;attribute name="class" type="String"&gt;
+*    &lt;!-- In Symbian the class attribute is used as cue for
+*    the ECOM Resolver --&gt;
+* &lt;/element&gt;
+* </pre>
+*
+* @param aTo - a HBufC8 to which the framework should write its configuration
+*/
+
+
+void CSenRestPlugin::EndElementL(const TDesC8& aNsUri,
+                                const TDesC8& aLocalName,
+                                const TDesC8& aQName)
+    {
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("REST plugin @ end of element: %S (xmlns='%S', localname='%S')"),
+        &aQName, &aNsUri, &aLocalName));
+    CSIF::EndElementL(aNsUri,aLocalName,aQName);
+    }
+
+// over-ride CSenBaseFragment
+HBufC* CSenRestPlugin::AsXmlUnicodeL()
+    {
+    HBufC8* pUtf8 = AsXmlL();
+    CleanupStack::PushL(pUtf8);
+    HBufC* pAsXmlInUnicode = SenXmlUtils::ToUnicodeLC(*pUtf8);
+    CleanupStack::Pop(pAsXmlInUnicode);
+    CleanupStack::PopAndDestroy(pUtf8);
+    return pAsXmlInUnicode;
+    }
+
+HBufC8* CSenRestPlugin::AsXmlL()
+    {
+    _LIT8(KLessFramework,"<Framework ");//CodeScannerWarning
+    _LIT8(KXmlns,"xmlns=\"");
+    _LIT8(KQuot,"\" ");
+    _LIT8(KClassQuot,"class=\"");
+    _LIT8(KQuotNewLine,"\"/>\n");
+    HBufC8* pAsXml = HBufC8::NewLC(256);
+    TPtr8 ptr = pAsXml->Des();
+    ptr.Append(KLessFramework);
+    ptr.Append(KXmlns);
+    ptr.Append(KRestFrameworkXMLNS);
+    ptr.Append(KQuot);
+    
+    ptr.Append(KClassQuot);
+    ptr.Append(KRestFrameworkCue);
+    ptr.Append(KQuotNewLine);
+    CleanupStack::Pop(pAsXml);
+    return pAsXml;
+    }
+
+TInt CSenRestPlugin::SetTransportPropertiesL(MSenTransport& aTransport)
+    {
+    // Set default REST transport properties
+    CSenHttpTransportProperties* pProps = CSenHttpTransportProperties::NewLC();
+    pProps->SetContentTypeL(KTextWwwFormContentType);
+    HBufC8* pPropsAsXml = pProps->AsUtf8L();
+    CleanupStack::PopAndDestroy(pProps);
+
+    CleanupStack::PushL( pPropsAsXml );
+    TInt retVal = aTransport.SetPropertiesL( *pPropsAsXml, MSenLayeredProperties::ESenFrameworkLayer, NULL );
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    return retVal;    
+    }
+    
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/src/senrestpluginmain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// DLL Entry point
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/src/senrestpluginproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "senrestplugin.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+const TInt32 KSenRestPluginSIF = 0x10274C70;	//CodeScannerWarnings
+#else
+const TInt32 KSenRestPluginSIF = 0x10282C4A;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef IMPLEMENTATION_PROXY_ENTRY       
+    IMPLEMENTATION_PROXY_ENTRY(KSenRestPluginSIF,  CSenRestPlugin::NewL),
+#else
+    {{KSenRestPluginSIF},  CSenRestPlugin::NewL}
+#endif
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsrestplugin/src/senrestservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,419 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "senrestservicesession.h"
+#include "senservicesession.h"
+#include "SenSoapMessage.h"
+#include "senwsdescription.h"
+#include "msencoreservicemanager.h"
+#include "msenremoteserviceconsumer.h"
+#include "SenXmlUtils.h"
+#include "SenDateUtils.h"
+#include "msentransport.h"
+#include "SenServiceConnection.h"
+#include "sendebug.h"
+#include "senlogger.h"
+// #include "SenHttpTransportProperties.h"
+
+CSenRestServiceSession* CSenRestServiceSession::NewL(MSIF& aFramework)
+    {
+    CSenRestServiceSession* pNew =
+        CSenRestServiceSession::NewLC(aFramework);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CSenRestServiceSession* CSenRestServiceSession::NewLC(MSIF& aFramework)
+    {
+    CSenRestServiceSession* pNew =
+        new (ELeave) CSenRestServiceSession(ERestServiceSession,
+                                                aFramework);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenRestServiceSession::CSenRestServiceSession(TDescriptionClassType aType, MSIF& aFramework)
+: CSenWebServiceSession(aType, aFramework)
+    {
+    }
+
+void CSenRestServiceSession::ConstructL()
+    {
+    // sets the local name to "ServiceDescription" and
+    // initiates the inner ipElement
+    CSenWebServiceSession::ConstructL();
+    }
+
+CSenRestServiceSession::~CSenRestServiceSession()
+    {
+    }
+
+// Override compute status to make REST sessions to be ALWAYS valid (ready)
+TInt CSenRestServiceSession::ComputeStatusL()
+    {
+    // session is ready, if an endpoint is defined
+    return CSenServiceSession::ComputeStatusL();
+    }
+
+TInt CSenRestServiceSession::SendSoapL( const TDesC8& aSoapMessage, 
+                                        const TDesC8& aTransportProperties,
+                                        MSenRemoteServiceConsumer& aConsumer,
+                                        TInt& aTxnId,
+                                        HBufC8*& /*aRevalidationError*/ ) 
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenRestServiceSession::SendSoapL");
+    TPtrC8 endpoint = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMinLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Request (%d bytes):"), aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,(aSoapMessage));
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+
+
+
+    TInt retVal( aConsumer.TransportL().SendL( endpoint, 
+                                               aSoapMessage,
+                                               aTransportProperties, 
+                                               *this, 
+                                               aConsumer, 
+                                               aTxnId) );
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KNormalLogLevel, _L8("- Transaction ID: %d"), aTxnId));
+    return retVal;
+    }
+
+TInt CSenRestServiceSession::SubmitSoapL(const TDesC8& aSoapMessage, 
+                                         const TDesC8& aTransportProperties,
+                                         MSenRemoteServiceConsumer& aConsumer,
+                                         HBufC8*& aResponse)
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenRestServiceSession::SubmitSoapL");
+    TPtrC8 endpoint = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMinLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Request (%d bytes):"), aSoapMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,(aSoapMessage));
+   	CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL(transport);
+    TInt retVal = transport.SubmitL( endpoint,
+                                     aSoapMessage, 
+                                     aTransportProperties, 
+                                     aResponse,
+									 aConsumer);
+    if ( !aResponse )
+        {
+        // response was NULL: probably either out
+        // of heap or some transport malfunction.
+        return retVal;
+        }
+    else if ( aResponse->Length() < KSenSoapEnvelopeName().Length()*2 )
+        {
+        // no use parsing, Envelope -root element not there
+        // deliver non-soap body to consumer
+        return retVal;
+        }
+
+    CleanupStack::PushL(aResponse);
+
+    CSenSoapMessage* pResponseSoapMsg = NULL;
+    TInt leaveCode(KErrNone);
+
+    // attempt to parse the response
+    // here. SOAP faults are to be
+    // searched after,
+
+    TInt parseRetCode(KErrNone);
+    TRAP( leaveCode, (parseRetCode =
+        ParseResponseL(*aResponse, pResponseSoapMsg)) );
+
+    if(leaveCode!=KErrNone)
+        {
+        // THE RESPONSE could not be parsed
+        delete pResponseSoapMsg;
+
+        // THE RESPONSE IS NOT SOAP
+        if(retVal==KErrNone)
+            {
+            // indicate with return value, that response is
+            // invalid - even though submit was ok, the
+            // response could NOT be parsed!
+            retVal = leaveCode;
+            }
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"(NOK) Response is not a SOAP message");
+        }
+    else
+        {
+
+        if (parseRetCode != KErrNone)
+            {
+            CSLOG_FORMAT((aConsumer.ConnectionId()   , KMinLogLevel, _L8("(NOK) Parsing SOAP msg failed (%d)"),
+                    parseRetCode));
+
+            if(retVal==KErrNone) // submit was ok
+                {
+                // indicate with return value, that response is
+                // invalid - even though submit was ok, the
+                // response could NOT be parsed!
+                retVal = parseRetCode;
+                }
+
+            // THE RESPONSE could not be parsed
+            delete pResponseSoapMsg;
+            }
+        else
+            {
+            CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"REST: (OK) Response is a SOAP message");
+            CleanupStack::PushL(pResponseSoapMsg);
+
+            TBool completeServerMessages(ETrue);
+            HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+
+            // response is OK and in SOAP form.
+			if(pResponseSoapMsg)
+			   {
+			   if (pResponseSoapMsg->IsFault())
+                   {
+                	// response is SOAP fault
+                	CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"REST: Response is a SOAP fault.");
+                	retVal = KErrSenSoapFault;
+
+                if (!completeServerMessages)
+                    {
+                    // try to detach the SOAP fault
+                    HBufC8* pDetached = NULL;
+                    CleanupStack::Pop(pResponseSoapMsg);
+                    retVal = CSenWebServiceSession::HandleSoapFaultL(pResponseSoapMsg, pDetached);
+                    if(retVal == KErrSenSoapFault || retVal == KErrNone)
+                        {
+                        // KErrNone means that original fault was handled
+                        // properly and we now have the wanted result 
+                        // and consumer may receive it (message body)
+
+                        // Note: currently we don't handle any SOAP faults
+                        // in WebServiceSession class, so KErrNone should
+                        // not be returned. The OR clause (||) here is 
+                        // only for future extensions.
+                        delete aResponse;
+                        aResponse = NULL;
+                        aResponse = pDetached;
+                        pDetached = NULL;
+                        }
+                    else if(retVal == KErrNotFound)
+                        {
+                        // SOAP fault element  could not be found
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"REST: Major; SOAP fault element not found \
+                                    even though assumed SOAP fault.");
+                        retVal = KErrSenInternal;
+                        }
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy(pResponseSoapMsg);
+                    }
+                }
+            else
+                {
+                // Check complete server messages on/off
+                if (!completeServerMessages)
+                    {
+                    HBufC8* pBody = pResponseSoapMsg->BodyAsStringL();
+                    if(pBody)
+                        {
+                        delete aResponse;
+                        aResponse = NULL;
+                        aResponse = pBody;
+                        pBody = NULL;
+                        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"- Detached SOAP message body.");
+                        }
+                    }
+                CleanupStack::PopAndDestroy(pResponseSoapMsg);
+				}
+              }
+            }
+        }
+
+#ifdef _SENDEBUG
+    if(aResponse)
+        {
+        CleanupStack::PushL(aResponse);
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"--------------------------------------------------");
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"CSenRestServiceSession::SubmitSoapL:");
+        CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Response (%d bytes):"), 
+            aResponse->Length()));
+        CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,(*aResponse));
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"--------------------------------------------------");
+        CleanupStack::Pop(); // aResponse
+        }
+#endif
+    CleanupStack::Pop(); // aResponse
+    return retVal;
+    }
+
+TInt CSenRestServiceSession::CompleteServerMessagesOnOffL(const TBool& aCompleteOnOff)
+    {
+    // Now REST SIF supports CompleteServerMessagesOnOff
+    return CSenServiceSession::CompleteServerMessagesOnOffL(aCompleteOnOff);
+    }
+
+
+TInt CSenRestServiceSession::SubmitL( const TDesC8& aMessage, 
+                                      const TDesC8& aTransportProperties,
+                                      MSenRemoteServiceConsumer& aConsumer,
+                                      HBufC8*& aResponse )
+    {
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenRestServiceSession::SubmitL(TDesC8&)");
+    TPtrC8 endpoint = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Request (%d bytes):"), aMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,(aMessage));
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL( transport );
+    TInt retVal( transport.SubmitL( endpoint, 
+                                    aMessage, 
+                                    aTransportProperties, 
+                                    aResponse,
+									aConsumer) );
+
+#ifdef _SENDEBUG
+    if(aResponse)
+        {
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"---------------------------------------------------");
+        CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenRestServiceSession::SubmitL:");
+        CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Response (%d bytes):"), aResponse->Length()));
+        CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( *aResponse ));
+        CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"---------------------------------------------------");
+        }
+#endif
+
+    return retVal;
+    }
+
+
+TInt CSenRestServiceSession::SendL( const TDesC8& aMessage, 
+                                    const TDesC8& aTransportProperties,
+                                    MSenRemoteServiceConsumer& aConsumer,
+                                    TInt& aTxnId,
+                                    HBufC8*& /* aRevalidationError*/ )
+    {
+    // One could call the base class implementation in CSenServiceSession as well...
+    CSLOG_L(aConsumer.ConnectionId()  , KMinLogLevel,"CSenRestServiceSession::SendL");
+    TPtrC8 endpoint = Endpoint();
+#ifdef _SENDEBUG
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Endpoint: %S"), &endpoint));
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KMaxLogLevel, _L8("- Request (%d bytes):"), aMessage.Length()));
+    CSLOG_ALL(aConsumer.ConnectionId()  , KMaxLogLevel,( aMessage ));
+    CSLOG_L(aConsumer.ConnectionId()  , KMaxLogLevel,"///////////////////////////////////////////////////////");
+#endif
+    
+    MSenTransport& transport = aConsumer.TransportL();
+    SetFrameworkPropertiesL(transport);
+
+    TInt retVal ( transport.SendL( endpoint, 
+                                   aMessage,
+                                   aTransportProperties,
+                                   *this, 
+                                   aConsumer, 
+                                   aTxnId) );
+    CSLOG_FORMAT((aConsumer.ConnectionId()   , KNormalLogLevel, _L8("- Transaction id: %d"), aTxnId));
+    return retVal;
+    }
+
+
+
+
+TInt CSenRestServiceSession::SendToConsumerL(HBufC8* apMessage,
+                                             const TInt aTxnId,
+                                             MSenRemoteServiceConsumer& aConsumer,
+                                             MSenProperties* aResponseTransportProperties)
+    {
+    TInt retVal(KErrNone);
+
+    aConsumer.HandleMessageL(apMessage, aTxnId, aResponseTransportProperties);
+
+    return retVal;
+    }
+
+// THIS IS WHAT TRANSPORT SEES:
+TInt CSenRestServiceSession::SendErrorToConsumerL(const TInt aErrorCode,
+                                                  HBufC8* apError,
+                                                  const TInt aTxnId,
+                                                  MSenRemoteServiceConsumer& aConsumer,
+                                                  MSenProperties* aResponseTransportProperties)
+    {
+    TInt retVal(KErrNone);
+
+    retVal = HandleErrorL(aErrorCode, apError, aTxnId, aConsumer, aResponseTransportProperties);
+    return retVal;
+    }
+
+TInt CSenRestServiceSession::HandleErrorL(const TInt aErrorCode,
+                                          HBufC8* apError,
+                                          const TInt aTxnId,
+                                          MSenRemoteServiceConsumer& aConsumer,
+                                          MSenProperties* aResponseTransportProperties)
+    {
+    TInt retVal(KErrNone);
+    // Implementation does not handle non-SOAP errors.
+    retVal = aConsumer.HandleErrorL(apError, aErrorCode, aTxnId, aResponseTransportProperties); 
+    return retVal;
+    }
+
+TBool CSenRestServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWebServiceSession ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWebServiceSession::HasSuperClass( aType ); 
+        }
+    }
+
+// TEMPORARY: remove when "message context"- and "transport factory taking 
+// properties from all layers"- tasks are ready
+TInt CSenRestServiceSession::SetFrameworkPropertiesL(MSenTransport& aTransport)
+    {
+    return iFramework.SetTransportPropertiesL(aTransport);
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Build info for the WS-* stack subsystem
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+#include "../WSStarPolicy/group/bld.inf"
+#include "../WSStarMessageHandlers/group/bld.inf"
+#include "../WSStarPlugin/group/bld.inf"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/data/101f971c.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource definitions for project WSStarMessageHandlers
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include <ecom/registryinfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F971C;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Message Handler Interface)
+            interface_uid = 0x20000393;
+            implementations = 
+                {
+                // Enveloper handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F971D;
+                    version_no         = 1;
+                       display_name       = "WSStar Message Handler - Enveloper";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.enveloper:1.0";
+                    opaque_data        = "";
+                    }
+                ,
+                // Addressing handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F971E;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Passport";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.passport:1.0";
+                    opaque_data        = "";
+                    }
+                ,    
+                // Addressing handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F971F;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Addressing";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.addressing:1.0";
+                    opaque_data        = "";
+                    }
+                ,    
+                //credential collector handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9720;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Credential Collector";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.credentialCollector:1.0";
+                    opaque_data        = "";
+                    }
+                ,    
+                //signature handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9721;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Security";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.security:1.0";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/data/10282c48.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource definitions for project WSStarMessageHandlers
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10282C48;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Message Handler Interface)
+            interface_uid = 0x10282C5C;
+            implementations = 
+                {
+                // Enveloper handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C56;
+                    version_no         = 1;
+                       display_name       = "WSStar Message Handler - Enveloper";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.enveloper:1.0";
+                    opaque_data        = "";
+                    }
+                ,
+                // Addressing handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C57;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Passport";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.passport:1.0";
+                    opaque_data        = "";
+                    }
+                ,    
+                // Addressing handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C58;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Addressing";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.addressing:1.0";
+                    opaque_data        = "";
+                    }
+                ,    
+                //credential collector handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C59;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Credential Collector";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.credentialCollector:1.0";
+                    opaque_data        = "";
+                    }
+                ,    
+                //signature handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C5A;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Security";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.security:1.0";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsstarmessagehandlers    
+*
+*/
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsstarmessagehandlers.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsstarmessagehandlers.iby)
+PRJ_MMPFILES
+wsstarmessagehandlers.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/group/wsstarmessagehandlers.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       Project specification file for wsstarmessagehandlers    
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "../../../inc/webservices.hrh"
+
+
+// ECOM DLL recognition UID followed by the unique UID for this dll
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET WSStarMessageHandlers.dll
+UID 0x10009D8D 0x101F971C
+#else
+TARGET wsWSStarMessageHandlers.dll
+UID 0x10009D8D 0x10282C48
+#endif
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE            wsstarmessagehandlersproxy.cpp
+SOURCE            wsstarmessageutils.cpp
+
+//enveloper handler
+SOURCE            wsstarenveloperhandler.cpp
+
+//passport handler
+SOURCE            wsstarpassporthandler.cpp
+
+#ifdef RD_SEN_VTCP_SUPPORT
+SOURCE            wsstarpassportheaderinbound.cpp
+#endif//RD_SEN_VTCP_SUPPORT
+
+//addressing handler
+SOURCE            wsstaraddressinghandler.cpp
+SOURCE            wsstaraddressingheaderinbound.cpp
+SOURCE            wsstaraddressingepr.cpp
+
+//credential collector handler
+SOURCE            wsstarcredentialcollectorhandler.cpp
+
+//signature handler
+SOURCE            wsstarsecurityhandler.cpp
+
+SOURCEPATH      ../data
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+START RESOURCE    101f971c.rss
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET WSStarMessageHandlers.rsc
+#endif 
+
+#else
+START RESOURCE    10282C48.RSS
+#ifdef SYMBIAN_SECURE_ECOM 
+   TARGET wsWSStarMessageHandlers.rsc
+#endif 
+
+#endif
+
+END
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../../inc
+
+
+USERINCLUDE      ../inc
+USERINCLUDE     ../../wsstarplugin/inc
+USERINCLUDE     ../../../wsutils/inc
+USERINCLUDE     ../../../wsframework/inc
+USERINCLUDE     ../../../wsfragment/inc
+USERINCLUDE     ../../../wslogger/inc // for TLS based file logging
+
+USERINCLUDE    ../../../wscore/inc
+USERINCLUDE     ../../../wsidentitymanager/inc
+USERINCLUDE    ../../../wsxml/inc
+
+SYSTEMINCLUDE     /epoc32/include/xml
+SYSTEMINCLUDE    /epoc32/include/libc
+
+SOURCEPATH      ../data
+
+// System libs
+LIBRARY ecom.lib
+LIBRARY efsrv.lib
+LIBRARY euser.lib 
+LIBRARY estlib.lib
+LIBRARY flogger.lib
+LIBRARY hash.lib
+LIBRARY imut.lib    //base64 encoding
+LIBRARY inetprotutil.lib
+LIBRARY xmlframework.lib // Symbian XML framework (SAX) - for CMatchData during creating Parser
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// Web Services Framework libs
+LIBRARY SenFragment.lib
+LIBRARY SenFramework.lib
+LIBRARY SenUtils.lib
+LIBRARY SenXml.lib
+LIBRARY SenLogger.lib // for TLS based logging
+#else
+// Web Services Framework libs
+LIBRARY wsFragment.lib
+LIBRARY wsFramework.lib
+LIBRARY wsUtils.lib
+LIBRARY wsXml.lib
+LIBRARY wsLogger.lib // for TLS based logging
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+    LIBRARY         XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LIBRARY XmlSecWrapper.lib
+
+SMPSAFE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstaraddressingepr.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_ADDRESSING_EPR_H
+#define WSSTAR_ADDRESSING_EPR_H
+
+
+
+// INCLUDES
+#include <e32std.h>
+#include <SenXmlElement.h>
+#include "wsstarmessagehandlerscons.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+
+/**
+ * Class:       
+ *
+ */
+class CWSStarAddressingEPR : public CSenXmlElement
+    {
+public:
+    /**
+     * Function:    NewL
+     *
+     * Description: Create instance of concrete implementation. Note that ECOM
+     *              interface implementations can only have two signatures for
+     *              NewL:
+     *
+     * Returns:    Instance of this class.
+     *
+     * Note:       The interface, which is abstract base class of this
+     *             implementation, also provides NewL method. Normally abstract
+     *             classes do not provide NewL, because they cannot create
+     *             instances of themselves.
+     */
+    static CWSStarAddressingEPR* NewL(CSenElement& aParent, const TDesC8& aLocalName, 
+                                        const TDesC8& aContent, const TDesC8& aVersion);
+    static CWSStarAddressingEPR* NewLC(CSenElement& aParent, const TDesC8& aLocalName, 
+                                        const TDesC8& aContent, const TDesC8& aVersion);
+
+
+private:
+
+    
+public: // destructor
+    virtual ~CWSStarAddressingEPR();
+
+
+protected:
+    /**
+     * Function:   CWSStarHandlerAddressingInbound
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarAddressingEPR();
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL(CSenElement& aParent, const TDesC8& aLocalName, const TDesC8& aContent, 
+                        const TDesC8& aVersion);
+
+public:
+    void AddDeviceAddressL(const TDesC8& aMwsNamespace, const TDesC8& aContent);
+private:
+
+//data
+    };
+
+#endif // WSSTAR_ADDRESSING_ERP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstaraddressinghandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_ADDRESSING_HANDLER_H
+#define WSSTAR_ADDRESSING_HANDLER_H
+
+#include <e32std.h>
+#include <flogger.h>
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+
+#include "senmessagehandler.h"
+#include "wsstarmessagehandlerscons.h"
+#include "senguidgen.h"
+#include "wsstarmessagecontext.h"
+#include "SenSoapMessage.h"
+#include "wsstaraddressingheaderinbound.h"
+#include "SenSoapFault.h"
+#include "sendebug.h"
+#include "senserviceinvocationframework.h"
+#include "wsstarhandlercontext.h"
+#include "wsstaraddressingepr.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler is responsible for ws-addressing layes in ws* framework.
+ *  Works in both direction:
+ *       - in inbound case fill porperly message context, or recognize addressing faults
+ *       - in outbound case create specific headers in envelope
+ */
+class CWSStarAddressingHandler : public CSenMessageHandler
+    {
+public:
+    static CWSStarAddressingHandler* NewL(TAny* aHandlerCtx);
+
+
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+    virtual ~CWSStarAddressingHandler();
+    
+protected:
+    /**
+     * Function:   CWSStarAddressingHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarAddressingHandler(MSenHandlerContext& aCtx);
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+    CSenElement* CreateElementAddressingL(CSenElement& aParentElement, const TDesC8& aLocalName,
+                                  const TDesC8& aContent, TBool aUseAddress); 
+    void SetMessageIDL(MSenMessageContext& aCtx);
+    void ShareMyLiterals(MSenMessageContext& aCtx);
+    void AddAppInfoHeaderL(  MSenMessageContext& aCtx, 
+                            CSenElement& aHeader);
+private:
+//methods
+    virtual TInt HandleInboundL(MSenMessageContext& aCtx, CSenSoapEnvelope* aMessage);
+    virtual TInt HandleOutboundL(MSenMessageContext& aCtx, CSenSoapEnvelope* aMessage);
+    void InitVersionL(const TDesC8* aVersion);
+    RFileLogger* Log() const;    
+    HBufC8* iVersion;//owned
+    };
+
+#endif // WSSTAR_ADDRESSING_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstaraddressingheaderinbound.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_ADDRESSING_HEADER_INBOUND_H
+#define WSSTAR_ADDRESSING_HEADER_INBOUND_H
+
+#include <e32std.h>
+
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include "SenBaseFragment.h"
+
+#include "senmessagehandler.h"
+#include "wsstarmessagehandlerscons.h"
+#include "wsstarmessagecontext.h"
+#include "SenSoapEnvelope.h"
+#include "uri8.h"
+
+
+const TInt KStateParsingReplyTo = 501;
+const TInt KStateParsingFaultTo = 503;
+const TInt KStateParsingFrom = 505;
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarAddressingHeaderInbound : public CSenBaseFragment//, public MWSStarHandlerAddressingHeader
+    {
+public:
+    /**
+     * Function:    NewL
+     *
+     * Description: Create instance of concrete implementation. Note that ECOM
+     *              interface implementations can only have two signatures for
+     *              NewL:
+     *               - NewL without parameters (used here)
+     *               - NewL with TAny* pointer, which may provide some client
+     *                 data
+     *
+     * Returns:    Instance of this class.
+     *
+     * Note:       The interface, which is abstract base class of this
+     *             implementation, also provides NewL method. Normally abstract
+     *             classes do not provide NewL, because they cannot create
+     *             instances of themselves.
+     */
+    static CWSStarAddressingHeaderInbound* NewL(const TDesC8* aVersion);
+    static CWSStarAddressingHeaderInbound* NewLC(const TDesC8* aVersion);
+
+
+private:
+    // From CBaseFragment
+    virtual void StartElementL(const TDesC8& aNsUri,
+                               const TDesC8& aLocalName,
+                               const TDesC8& aQName,
+                               const RAttributeArray& aAttributes);
+    
+    virtual void EndElementL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aQName);
+
+    
+public: // destructor
+    virtual ~CWSStarAddressingHeaderInbound();
+
+
+protected:
+    /**
+     * Function:   CWSStarHandlerAddressingInbound
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarAddressingHeaderInbound();
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL(const TDesC8* aVersion);
+
+public:
+    TInt SetMessageContext(MSenMessageContext& aCtx);
+    const TDesC8* Version() const;
+
+private:
+
+//data
+    MSenMessageContext* iMessageContext; //not owned    
+    const TDesC8* iVersion;
+    HBufC8* iVersionBuf;
+    TBool iDeviceAddress;
+    };
+
+#endif // WSSTAR_ADDRESSING_HEADER_INBOUND_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarcredentialcollectorhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_CREDENTIAL_COLLECTOR_HANDLER_H
+#define WSSTAR_CREDENTIAL_COLLECTOR_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "wsstarmessagehandlerscons.h"
+#include "wsstarmessagecontext.h"
+#include "wsstarhandlercontext.h"
+#include "senmessagehandler.h"
+#include "SenSoapMessage.h"
+#include "sendebug.h"
+#include "senserviceinvocationframework.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler set mobile ticket in security section in header.
+ */
+class CWSStarCredentialCollectorHandler : public CSenMessageHandler
+    {
+
+public:
+    static CWSStarCredentialCollectorHandler* NewL(TAny* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    virtual TInt InitL(MSenHandlerContext& aCtx);    
+    ~CWSStarCredentialCollectorHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    
+protected:
+    /**
+     * Function:   CWSStarCredentialCollectorHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarCredentialCollectorHandler(MSenHandlerContext& aCtx);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private:
+
+    RFileLogger* Log() const; 
+    };
+
+
+#endif // WSSTAR_CREDENTIAL_COLLECTOR_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarenveloperhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_ENVELOPER_HANDLER_H
+#define WSSTAR_ENVELOPER_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "wsstarmessagecontext.h"
+#include "wsstarhandlercontext.h"
+#include "senmessagehandler.h"
+#include "SenSoapMessage.h"
+#include "sendebug.h"
+#include "senserviceinvocationframework.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler creates proper Envelope based on provided policy (by message context)
+ */
+class CWSStarEnveloperHandler : public CSenMessageHandler
+    {
+
+public:
+    static CWSStarEnveloperHandler* NewL(TAny* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    ~CWSStarEnveloperHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+    
+        
+protected:
+    /**
+     * Function:   CWSStarEnveloperHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarEnveloperHandler(MSenHandlerContext& aCtx);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private:
+
+    RFileLogger* Log() const; 
+    };
+
+#endif // WSSTAR_ENVELOPER_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarmessagehandlerscons.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_MESSAGE_HANDLERS_CONS_H
+#define WSSTAR_MESSAGE_HANDLERS_CONS_H
+
+namespace WSStarAddressingConfig
+    {
+    _LIT8(KHandlerAddressingVersion,      "1.0");
+    _LIT8(KHandlerAddressingXMLNS,        "urn:com.nokia.ws.wsstar.handler.addressing:1.0");
+    _LIT8(KHandlerAddressingCue,          "com.nokia.ws.wsstar.handler.addressing");
+    _LIT8(KHandlerAddressingLocalName,      "Handler");
+    }
+
+namespace WSStarAddressing
+    {
+    _LIT8(KAddressingXmlns200403,    "http://schemas.xmlsoap.org/ws/2004/03/addressing");
+    _LIT8(KAddressingXmlns200408,    "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    _LIT8(KAddressingXmlns200412,    "http://www.w3.org/2004/12/addressing");
+    _LIT8(KAddressingXmlns200502,    "http://www.w3.org/2005/02/addressing");
+    _LIT8(KAddressingXmlns200503,    "http://www.w3.org/2005/03/addressing");
+    _LIT8(KAddressingXmlns200508,    "http://www.w3.org/2005/08/addressing");
+
+    _LIT8(KAddressingFaultActionXmlns,    "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault");
+    _LIT8(KAddressingPrefix,"wsa");
+
+
+    _LIT8(KReplyToAnonymous200403, "http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous");
+    _LIT8(KReplyToAnonymous200408, "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous");
+    _LIT8(KReplyToAnonymous200412, "http://www.w3.org/2004/12/addressing/role/anonymous");
+    _LIT8(KReplyToAnonymous200502, "http://www.w3.org/2005/02/addressing/role/anonymous");
+    _LIT8(KReplyToAnonymous200503, "http://www.w3.org/2005/03/addressing/role/anonymous");
+    _LIT8(KReplyToAnonymous200508, "http://www.w3.org/2005/08/addressing/role/anonymous");
+    
+
+    
+    _LIT8(KActionName,"Action");
+    _LIT8(KActionQName,"wsa:Action");
+    _LIT8(KMessageIDName,"MessageID");
+    _LIT8(KMessageIDQName,"wsa:MessageID");
+    _LIT8(KToName,"To");
+    _LIT8(KToQName,"wsa:To");
+    _LIT8(KReplyToName,"ReplyTo");
+    _LIT8(KReplyToQName,"wsa:ReplyTo");
+    _LIT8(KFromName,"From");
+    _LIT8(KFromQName,"wsa:From");
+    _LIT8(KRelatesToName,"RelatesTo");
+    _LIT8(KRelatesToQName,"wsa:RelatesTo");
+    _LIT8(KAddressName,"Address");
+    _LIT8(KAddressQName,"wsa:Address");
+    _LIT8(KFaultToName, "FaultTo");
+    _LIT8(KFaultToQName, "wsa:FaultTo");
+    _LIT8(KEndpointReferenceName, "EndpointReference");
+    _LIT8(KEndpointReferenceQName, "wsa:EndpointReference");
+    _LIT8(KReferencePropertiesName, "ReferenceProperties");
+    _LIT8(KReferencePropertiesQName, "wsa:ReferenceProperties");
+
+    _LIT8(KRetryAfterName, "RetryAfter");
+    _LIT8(KRetryAfterQName, "wsa:RetryAfter");
+    }
+namespace WSStarAddressingFault
+    {
+    _LIT8(KInvalidHeader,    "InvalidMessageInformationHeader");
+    _LIT8(KRequiredHeader,    "MessageInformationHeaderRequired");
+    _LIT8(KDestinationUnreachable,    "DestinationUnreachable");
+    _LIT8(KActionNotSupported,    "ActionNotSupported");
+    _LIT8(KEndpointUnavailable,    "EndpointUnavailable");
+
+    _LIT8(KInvalidHeaderFormatString8,
+    "Fault.WS-Addressing : InvalidMessageInformationHeader in %S Detail: %S");
+    _LIT8(KRequiredHeaderFormatString8,
+    "Fault.WS-Addressing : MessageInformationHeaderRequired : %S ");
+    _LIT8(KMissingTag, "Tag is missing");
+    _LIT8(KInvalidUri, "EUriUtilsParserErrInvalidUri");
+    }
+
+namespace WSStarSecurityFault
+    {
+    _LIT8(KUnsupportedAlgorithm, "Fault.WS-Security : UnsupportedAlgorithm");
+    }
+
+namespace WSStarCredentialCollector
+    {
+    _LIT8(KSecurityUtilsPrefix,"wsu");
+    _LIT8(KSecurityUtilsIdQName,"wsu:Id");
+    _LIT8(KSecurityUtilsXmlns, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");        
+    _LIT8(KSecurityUtilsTimestampName, "Timestamp");
+    _LIT8(KSecurityUtilsCreatedName, "Created");
+    }
+
+namespace WSPassport32
+    {
+    //tags
+    _LIT8(KPassportXmlns,    "http://schemas.microsoft.com/Passport/SoapServices/PPCRL");
+    _LIT8(KPassportPrefix,"ps");
+    
+    
+    _LIT8(KAuthInfoTag,"AuthInfo");
+    _LIT8(KAuthInfoQTag,"ps:AuthInfo");
+    _LIT8(KHostingAppTag,"HostingApp");
+    _LIT8(KHostingAppQTag,"ps:HostingApp");
+    _LIT8(KBinaryVersionTag,"BinaryVersion");
+    _LIT8(KBinaryVersionQTag,"ps:BinaryVersion");
+    _LIT8(KUIVersionTag,"UIVersion");
+    _LIT8(KUIVersionQTag,"ps:UIVersion");
+    _LIT8(KCookiesTag,"Cookies");
+    _LIT8(KCookiesQTag,"ps:Cookies");
+    _LIT8(KRequestParamsTag,"RequestParams");
+    _LIT8(KRequestParamsQTag,"ps:RequestParams");
+    _LIT8(KRequestMultipleSecurityTokensTag , "RequestMultipleSecurityTokens");
+    _LIT8(KRequestMultipleSecurityTokensQTag, "ps:RequestMultipleSecurityTokens");
+    
+    _LIT8(KPPAuthInfoAttrValue, "PPAuthInfo");
+    
+    //values
+    _LIT8(KHostingAppTagValue,"{DF60E2DF-88AD-4526-AE21-83D130EF0F68}");
+    _LIT8(KBinaryVersionTagValue,"3");
+    _LIT8(KUIVersionTagValue,"1");
+    _LIT8(KCookiesTagValue,"");
+    _LIT8(KRequestParamsTagValue,"AQAAAAIAAABsYwQAAAAxMDMz");
+    
+    //passport faults
+    _LIT8(KRedirectUrlTag,"redirectUrl");
+    _LIT8(KPassportFaultNamespaceXmlns, "http://schemas.microsoft.com/Passport/SoapServices/SOAPFault");
+    _LIT8(KCredProperty, "credProperty");
+    _LIT8(KCredProperties, "credProperties");
+    _LIT8(KName, "Name");
+    _LIT8(KMainBrandID, "MainBrandID");
+    _LIT8(KBrandIDList, "BrandIDList");
+    _LIT8(KIsWinLiveUser, "IsWinLiveUser");
+    _LIT8(KCID, "CID");
+    }
+
+namespace WSStarAddressingEPR
+    {
+    _LIT8(KMwsPrefix,   "mws");
+    _LIT8(KDeviceAddressName,   "DeviceAddress");
+    _LIT8(KDeviceAddressQName,  "mws:DeviceAddress");
+    }
+    
+#endif // WSSTAR_MESSAGE_HANDLERS_CONS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarmessageutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_MESSAGE_UTILS_H
+#define WSSTAR_MESSAGE_UTILS_H
+
+
+#include "SenElement.h"
+#include "SenDomFragmentBase.h"
+
+
+/**
+ * Set of static convenience methods to help in message exploring
+ */
+class CWSStarMessageUtils : public CBase
+    {
+    typedef RArray<TXmlEngElement> RArrayElements;
+    
+    public:
+    typedef RPointerArray<CSenElement> RArraySenElements;
+        /*
+        * Encode data into Base64 format
+        * @param aParent
+        * @param aValue - name of element or attribute
+        * @param aAttribute = determine if we want find tag name or attribute name
+        * @return 
+        */
+        static CSenElement* GetMarkedElementL(CSenElement& aParent, const TDesC8& aValue, 
+                                                TBool aAttribute = ETrue);
+        
+        /*
+        * Find an Element in XML tree
+        * @param aElementName -seeking element name
+        * @param aNamespace - seeking element  namespace
+        * @param aParent - node where the seeking is starting
+        * @param aElements - find elements' array
+        */
+        static void FindElementL(const TDesC8& aElementName, const TDesC8& aNamespace, 
+                                const TXmlEngElement& aParent, RArrayElements* aElements);
+        /*
+        * Find an Element in XML tree
+        * @param aLocalName -seeking element name
+        * @param aParent - node where the seeking is starting
+        * @param aElements - find elements' array
+        */
+        static CSenElement* FindElementL(const TDesC8& aLocalName, CSenElement& aParent);
+        
+        static void FindElementL(const TDesC8& aLocalName,CSenElement& aParent,RArraySenElements& aElements);
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        CWSStarMessageUtils();
+        
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        CWSStarMessageUtils( const CWSStarMessageUtils& );
+
+        /**
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        CWSStarMessageUtils& operator=( const CWSStarMessageUtils& );        
+    };
+
+#endif // WSSTAR_MESSAGE_UTILS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarpassporthandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_PASSPORT_HANDLER_H
+#define WSSTAR_PASSPORT_HANDLER_H
+
+#include <e32std.h>
+#include <flogger.h>
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+
+#include "senmessagehandler.h"
+#include "wsstarmessagecontext.h"
+#include "SenSoapMessage.h"
+#include "sendebug.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarmessagehandlerscons.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler creates add passport speciifc headers.
+ *  Also create multi batched request.
+ */
+
+class CWSStarPassportHandler : public CSenMessageHandler
+    {
+public:
+   static CWSStarPassportHandler* NewL(TAny* aHandlerCtx);
+
+
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+ 
+public: // destructor
+    virtual ~CWSStarPassportHandler();
+
+
+protected:
+    /**
+     * Function:   CWSStarPassportHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarPassportHandler(MSenHandlerContext& aCtx);
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private:
+    TInt HandleInboundL(MSenMessageContext& aCtx, CSenSoapEnvelope* aMessage);
+
+private:
+    RFileLogger* Log() const;    
+    };
+
+#endif // WSSTAR_PASSPORT_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarpassportheaderinbound.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+//Co-Branding CR
+#ifndef WSSTAR_PASSPORT_HEADER_INBOUND_H
+#define WSSTAR_PASSPORT_HEADER_INBOUND_H
+
+#include <e32std.h>
+
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include "SenBaseFragment.h"
+
+#include "senmessagehandler.h"
+#include "wsstarmessagehandlerscons.h"
+#include "wsstarmessagecontext.h"
+#include "SenSoapEnvelope.h"
+
+
+const TInt KStateParsingMainBrandID = 601;
+const TInt KStateParsingBrandIDList = 603;
+const TInt KStateParsingIsWinLiveUser = 605;
+const TInt KStateParsingCID = 607;
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarPassportHeaderInbound : public CSenBaseFragment
+    {
+public:
+    /**
+     * Function:    NewL
+     *
+     * Description: Create instance of concrete implementation. Note that ECOM
+     *              interface implementations can only have two signatures for
+     *              NewL:
+     *               - NewL without parameters (used here)
+     *               - NewL with TAny* pointer, which may provide some client
+     *                 data
+     *
+     * Returns:    Instance of this class.
+     *
+     * Note:       The interface, which is abstract base class of this
+     *             implementation, also provides NewL method. Normally abstract
+     *             classes do not provide NewL, because they cannot create
+     *             instances of themselves.
+     */
+    static CWSStarPassportHeaderInbound* NewL();
+    static CWSStarPassportHeaderInbound* NewLC();
+
+
+private:
+    // From CBaseFragment
+    virtual void StartElementL(const TDesC8& aNsUri,
+                               const TDesC8& aLocalName,
+                               const TDesC8& aQName,
+                               const RAttributeArray& aAttributes);
+    
+    virtual void EndElementL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aQName);
+
+    
+public: // destructor
+    virtual ~CWSStarPassportHeaderInbound();
+
+
+protected:
+    /**
+     * Function:   CWSStarHandlerAddressingInbound
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarPassportHeaderInbound();
+
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+public:
+    TInt SetMessageContext(MSenMessageContext& aCtx);
+
+private:
+
+//data
+    MSenMessageContext* iMessageContext; //not owned   
+    CSenElement* ipBrandIdListElem; //owned
+    };
+
+#endif // WSSTAR_PASSPORT_HEADER_INBOUND_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/inc/wsstarsecurityhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_SECURITY_HANDLER_H
+#define WSSTAR_SECURITY_HANDLER_H
+
+#include <e32std.h>
+
+#include "SenDomFragmentBase.h"
+#include "senmessagehandler.h"
+#include "SenElement.h"
+
+
+class RFileLogger;
+
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler sign elemetns in Envelope according to policy which is delivered.
+ */
+ 
+class CWSStarSecurityHandler : public CSenMessageHandler
+    {
+
+typedef RArray<TXmlEngElement> RArrayElements;
+
+public:
+    static CWSStarSecurityHandler* NewL(MSenHandlerContext* aHandlerCtx);
+    virtual TInt InvokeL(MSenMessageContext& aCtx);
+    virtual TInt InitL(MSenHandlerContext& aCtx);    
+    ~CWSStarSecurityHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    
+private:
+    CSenDomFragmentBase* GetElementsToSignL(MSenMessageContext& aCtx,
+            RArrayElements* aElements);
+    void AttachElementL(MSenMessageContext& aCtx, TXmlEngElement& aSignature);
+
+private:
+    /**
+     * Function:   CWSStarSecurityHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarSecurityHandler(MSenHandlerContext& aCtx);
+    
+private:
+
+    RFileLogger* Log() const;
+    };
+
+
+#endif // WSSTAR_SECURITY_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/rom/wsstarmessagehandlers.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSSTARMESSAGEHANDLERS_IBY__
+#define __WSSTARMESSAGEHANDLERS_IBY__
+
+ECOM_PLUGIN(WSStarMessageHandlers.dll, 01234581.RSC)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressingepr.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsstaraddressingepr.h"
+
+using namespace WSStarAddressing;
+
+CWSStarAddressingEPR* CWSStarAddressingEPR::NewL(CSenElement& aParent, const TDesC8& aLocalName, 
+                                                 const TDesC8& aContent, const TDesC8& aVersion)
+    {
+    CWSStarAddressingEPR* self = NewLC(aParent, aLocalName, aContent, aVersion);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSStarAddressingEPR* CWSStarAddressingEPR::NewLC(CSenElement& aParent, const TDesC8& aLocalName, 
+                                                  const TDesC8& aContent, const TDesC8& aVersion)
+    {
+    CWSStarAddressingEPR* self = new (ELeave) CWSStarAddressingEPR();
+    CleanupStack::PushL (self);
+    self->ConstructL(aParent, aLocalName, aContent, aVersion);
+    return self;
+    }
+
+
+// Constructor
+CWSStarAddressingEPR::CWSStarAddressingEPR()
+    {
+    }
+
+// Destructor
+CWSStarAddressingEPR::~CWSStarAddressingEPR()
+    {
+    }
+
+// Second phase construction.
+void CWSStarAddressingEPR::ConstructL(CSenElement& aParent, const TDesC8& aLocalName, 
+                                        const TDesC8& aContent, const TDesC8& aVersion)
+    {
+    CSenXmlElement::BaseConstructL(aLocalName);
+    SetNamespaceL(KAddressingPrefix(), aVersion);
+    SetParent(&aParent);
+    CSenElement* elemAddress = CreateElementL(KAddressingPrefix(), KAddressName);
+    CleanupStack::PushL(elemAddress);
+    elemAddress->SetContentL(aContent);
+    AddElementL(*elemAddress);
+    CleanupStack::Pop(elemAddress);
+    }
+
+void CWSStarAddressingEPR::AddDeviceAddressL(const TDesC8& aMwsNamespace, const TDesC8& aContent)
+    {
+    CSenElement* elemRefProp = CreateElementL(KAddressingPrefix(),KReferencePropertiesName);
+    CleanupStack::PushL(elemRefProp);
+    AddElementL(*elemRefProp);
+    CleanupStack::Pop(elemRefProp);
+    CSenElement& elemDeviceAddress = 
+        elemRefProp->AddElementL(aMwsNamespace,WSStarAddressingEPR::KDeviceAddressName, 
+                                    WSStarAddressingEPR::KDeviceAddressQName);
+    elemDeviceAddress.SetContentL(aContent);
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressinghandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,802 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "wsstaraddressinghandler.h"
+#include "wsstarmessageutils.h"
+#include "SenXmlUtils.h"
+#include "sensaxutils.h"
+#include "senlogger.h" // private Utils\inc
+
+using namespace WSStarAddressing;
+using namespace WSStarAddressingFault;
+
+// Create instance of concrete ECOM interface implementation
+CWSStarAddressingHandler* CWSStarAddressingHandler::NewL(TAny* aHandlerCtx)
+    {
+    MSenHandlerContext* ctx =
+        reinterpret_cast<MSenHandlerContext*>( aHandlerCtx);
+    CWSStarAddressingHandler* self = new (ELeave) CWSStarAddressingHandler(*ctx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+TInt CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx)")));
+    CSenSoapEnvelope* message = 
+        const_cast<CSenSoapEnvelope*>(aCtx.GetSenSoapEnvelopeL(
+                                    SenContext::KSenCurrentSoapMessageCtxKey)
+                                    );
+    TPtrC8 txtMessage = aCtx.GetMessageL();
+    InitVersionL(aCtx.GetDesC8L(WSStarContextKeys::KAddressingVersion));
+    if (message)
+        {
+        const CSenNamespace* nmSpace = message->Namespace(KAddressingPrefix);
+        if (nmSpace)
+            {
+            InitVersionL(&nmSpace->URI());
+            }
+        if (aCtx.Direction() == SenContext::EOutgoing)
+            {
+            return HandleOutboundL(aCtx, message);
+            }
+        else if (aCtx.Direction()==SenContext::EIncoming)
+            {
+            return HandleInboundL(aCtx, message);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx) - \
+                                strange direction")));
+            return KErrNotFound;
+            }
+        }
+    else if (txtMessage.Length())
+        {
+//---------------idea based on method
+/*    
+TInt CSenWebServiceSession::HandleBodyWithoutParsingL(CSenSoapMessage& aMessage,
+                                                      const TDesC8& aResponse)
+*/
+        TInt ret(KErrNone);
+        TInt endTagStart;
+        TInt endTagEnd;
+        TInt startTagStart;
+        TInt startTagEnd;
+        TPtrC8 prefix;
+
+        ret = SenSaxUtils::SearchEndTagL(txtMessage,KSenSoapEnvelopeBodyName,
+                                         endTagStart, endTagEnd, prefix);
+        if ( ret != KErrNotFound )
+            {
+            ret = SenSaxUtils::SearchStartTagL(txtMessage,prefix,KSenSoapEnvelopeBodyName,
+                                               startTagStart, startTagEnd);
+            if ( ret != KErrNotFound )
+                {
+                TPtrC8 startPart(txtMessage.Ptr(),startTagEnd+1);
+                TPtrC8 endPart(txtMessage.Ptr()+endTagStart,txtMessage.Size()-endTagStart);
+                HBufC8* pXmlWithoutBody = HBufC8::NewLC(startPart.Length()+endPart.Length());
+                pXmlWithoutBody->Des().Append(startPart);
+                pXmlWithoutBody->Des().Append(endPart);
+        
+                CWSStarAddressingHeaderInbound* inbound =
+                        CWSStarAddressingHeaderInbound::NewLC(iVersion);
+                inbound->SetMessageContext(aCtx);
+                CSenXmlReader& reader = const_cast<CSenXmlReader&>(*aCtx.GetParser());
+                inbound->SetReader(reader);
+                inbound->BuildFrom(*pXmlWithoutBody);
+                CleanupStack::PopAndDestroy(inbound);
+                
+                
+                CleanupStack::PopAndDestroy(pXmlWithoutBody);
+                
+                }
+            }
+        else//case with empty body - <S:Body/>, so we can parse all
+            {
+             CWSStarAddressingHeaderInbound* inbound =
+                    CWSStarAddressingHeaderInbound::NewLC(iVersion);
+            inbound->SetMessageContext(aCtx);
+            CSenXmlReader& reader = const_cast<CSenXmlReader&>(*aCtx.GetParser());
+            inbound->SetReader(reader);
+            inbound->BuildFrom(txtMessage);
+            CleanupStack::PopAndDestroy(inbound);
+            }
+        
+        return ret;
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx) - \
+                            Soap message in message context not exists")));
+        return KErrNotFound;
+        }
+    }    
+TInt CWSStarAddressingHandler::HandleInboundL(MSenMessageContext& aCtx, CSenSoapEnvelope* aMessage)
+    {
+/*
+    CWSStarAddressingHeaderInbound* inbound =  CWSStarAddressingHeaderInbound::NewLC(iVersion);
+    inbound->SetMessageContext(aCtx);
+    CSenXmlReader& reader = const_cast<CSenXmlReader&>(*aCtx.GetParser());
+    inbound->SetReader(reader);
+    HBufC8* buf = aMessage->AsXmlL();
+    CleanupStack::PushL(buf);
+    inbound->BuildFrom(*buf);
+*/
+    CSenElement& header = aMessage->HeaderL();
+
+    CSenElement* elem = NULL;
+    CSenElement* addressElem = NULL;    
+
+    elem = CWSStarMessageUtils::FindElementL(KToName, header);
+    if (elem)
+        {
+        const TDesC8& nsUri = elem->NamespaceURI();
+        if (!iVersion && (nsUri == KAddressingXmlns200408 ||
+            nsUri == KAddressingXmlns200403 ||
+            nsUri == KAddressingXmlns200412 ||
+            nsUri == KAddressingXmlns200502 ||
+            nsUri == KAddressingXmlns200503 ||
+            nsUri == KAddressingXmlns200508))
+            {
+            iVersion = nsUri.AllocL();
+            }
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KTo, elem->Content());
+        }
+    elem = CWSStarMessageUtils::FindElementL(KRelatesToName, header);
+    if (elem)
+        {
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KRelatesTo, elem->Content());
+        }
+    elem = CWSStarMessageUtils::FindElementL(KMessageIDName, header);
+    if (elem)
+        {
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KMessageID, elem->Content());
+        }
+    elem = CWSStarMessageUtils::FindElementL(KActionName, header);
+    if (elem)
+        {
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KAction, elem->Content());
+        }
+    elem = CWSStarMessageUtils::FindElementL(WSStarAddressingEPR::KDeviceAddressName, header);
+    if (elem)
+        {
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KReplyToDeviceAddress, elem->Content());
+        }
+    
+    elem = CWSStarMessageUtils::FindElementL(KReplyToName, header);
+    if (elem)
+        {
+        addressElem = CWSStarMessageUtils::FindElementL(KAddressName, *elem);
+        if (addressElem)
+            {
+            ((MSenContext&)aCtx).Update(WSStarContextKeys::KReplyTo, addressElem->Content());
+            }
+        }
+    elem = CWSStarMessageUtils::FindElementL(KFaultToName, header);
+    if (elem)
+        {
+        addressElem = CWSStarMessageUtils::FindElementL(KAddressName, *elem);
+        if (addressElem)
+            {
+            ((MSenContext&)aCtx).Update(WSStarContextKeys::KFaultTo, addressElem->Content());
+            }
+        }
+    elem = CWSStarMessageUtils::FindElementL(KFromName, header);
+    if (elem)
+        {
+        addressElem = CWSStarMessageUtils::FindElementL(KAddressName, *elem);
+        if (addressElem)
+            {
+            ((MSenContext&)aCtx).Update(WSStarContextKeys::KFrom, addressElem->Content());
+            }
+        }
+    _LIT8(Kpp, "pp");
+    _LIT8(KCredProperties, "credProperties");
+    _LIT8(KCredProperty, "credProperty");
+    _LIT8(KName, "Name");
+    CWSStarMessageUtils::RArraySenElements credPropertiesElements;
+    CSenElement* ppElem = CWSStarMessageUtils::FindElementL(Kpp, header);
+    if(ppElem)
+        {
+        CSenElement* credPropertiesElem = CWSStarMessageUtils::FindElementL(KCredProperties, *ppElem);//Naga
+        if(credPropertiesElem)
+            {
+            CWSStarMessageUtils::FindElementL(KCredProperty, *credPropertiesElem, credPropertiesElements);
+            TInt count = credPropertiesElements.Count();
+            for(TInt i=0; i<count; i++)
+                {
+                elem = credPropertiesElements[i];
+                const TDesC8* ptr = elem->AttrValue(WSStarContextKeys::KName);
+                if ( *ptr == WSStarContextKeys::KMainBrandID )
+                    {
+                    ((MSenContext&)aCtx).Update(WSStarContextKeys::KMainBrandID, elem->Content());
+                    }
+                if (*ptr == WSStarContextKeys::KBrandIDList)
+                    {
+                    ((MSenContext&)aCtx).Update(WSStarContextKeys::KBrandIDList, elem->Content());
+                    }            
+                }
+            }        
+        }
+
+/*
+    if (!iVersion && inbound->Version())
+        {
+        iVersion = inbound->Version()->AllocL();
+        }
+*/    
+    if (!aCtx.GetDesC8L(WSStarContextKeys::KRelatesTo))
+        {
+        TLSLOG_FORMAT((KSenFaultsLogChannel, KSenFaultsLogLevel, 
+                        WSStarAddressingFault::KInvalidHeaderFormatString8,
+                        &KRelatesToQName(),&WSStarAddressingFault::KMissingTag()));   
+        
+        }
+    if (!aCtx.GetDesC8L(WSStarContextKeys::KTo))
+        {
+        TLSLOG_FORMAT((KSenFaultsLogChannel, KSenFaultsLogLevel, KRequiredHeaderFormatString8,
+                        &KToQName()));   
+        
+        }
+    if (!aCtx.GetDesC8L(WSStarContextKeys::KAction))
+        {
+        TLSLOG_FORMAT((KSenFaultsLogChannel, KSenFaultsLogLevel, KRequiredHeaderFormatString8,
+                        &KActionQName()));   
+        
+        }
+    if (aCtx.GetDesC8L(WSStarContextKeys::KReplyTo) || aCtx.GetDesC8L(WSStarContextKeys::KFaultTo))
+        {
+        if (!aCtx.GetDesC8L(WSStarContextKeys::KMessageID))
+            {
+            TLSLOG_FORMAT((KSenFaultsLogChannel, KSenFaultsLogLevel, KRequiredHeaderFormatString8,
+                            &KMessageIDQName()));   
+            
+            }
+        }
+
+    //    CleanupStack::PopAndDestroy(buf);
+//    CleanupStack::PopAndDestroy(inbound);
+    CSenElement& body = aMessage->BodyL();
+    ShareMyLiterals(aCtx);
+    if (aMessage->IsFault())
+        {
+        TPtrC8 errorCode(KNullDesC8);
+        CSenSoapFault* faultElement = aMessage->FaultL();
+        if (faultElement)
+            {
+            TPtrC8 code;
+            if (aMessage->NsUri() == KSenSoapEnvelopeXmlns)
+                {
+                TPtrC8 code = faultElement->FaultCode();                            
+                const CSenNamespace* nmSpace = faultElement->Namespace(SenXmlUtils::NsPrefix(code),
+                                                                       ETrue);
+                code.Set(SenXmlUtils::LocalName(code));
+                if (nmSpace)
+                    {
+                    if (!iVersion)
+                        {
+                        InitVersionL(&nmSpace->URI());
+                        }
+                    if (iVersion && 
+                        nmSpace->URI() == *iVersion)
+                        {
+                        errorCode.Set(code);
+                        }    
+                    }
+                }
+            else if (aMessage->NsUri() == KSenSoap12EnvelopeXmlns)
+                {
+                code.Set(faultElement->FaultCode());
+                const CSenNamespace* nmSpaceCode = 
+                        faultElement->Namespace(SenXmlUtils::NsPrefix(code), ETrue);
+                code.Set(SenXmlUtils::LocalName(code));
+                if ((nmSpaceCode && 
+                    nmSpaceCode->URI() == KSenSoap12EnvelopeXmlns) &&
+                    (code == KSender || code == KReceiver))
+                    {
+                    TPtrC8 subcode = faultElement->FaultSubcode();
+                    const CSenNamespace* nmSpace = 
+                        faultElement->Namespace(SenXmlUtils::NsPrefix(subcode), ETrue);
+                    subcode.Set(SenXmlUtils::LocalName(subcode));
+                if (nmSpace)
+                    {
+                    if (!iVersion)
+                        {
+                        InitVersionL(&nmSpace->URI());
+                        }
+                    if (iVersion && 
+                        nmSpace->URI() == *iVersion)
+                        {
+                        errorCode.Set(subcode);
+                        }    
+                    }
+                    }
+                }
+            if (errorCode.Length()>0)
+                {
+                if (errorCode == WSStarAddressingFault::KInvalidHeader ||
+                    errorCode == WSStarAddressingFault::KRequiredHeader ||
+                    errorCode == WSStarAddressingFault::KDestinationUnreachable ||
+                    errorCode == WSStarAddressingFault::KActionNotSupported )
+                    {
+                    ((MSenContext&)aCtx).Update(WSStarSession::KErrorLayer,
+                                                WSStarSession::EAddressing);
+                    }
+                if ((errorCode == WSStarAddressingFault::KEndpointUnavailable)
+                    && (code == KReceiver))
+                    {
+                    ((MSenContext&)aCtx).Update(WSStarSession::KErrorLayer,
+                                                WSStarSession::EAddressing);
+                    CSenElement* detailElement = faultElement->Element(KFault12DetailLocalname);
+                    if (detailElement)
+                        {
+                        CSenElement* retryElement = detailElement->Element(*iVersion,
+                                                                           KRetryAfterName); 
+                        if (retryElement)
+                            {
+                            TPtrC8 retryAfter = retryElement->Content();
+                            TLex8 num;
+                            TInt retryInt;
+                            num.Assign(retryAfter);
+                            TInt ret = num.Val(retryInt);
+                            if (ret == KErrNone)
+                                ((MSenContext&)aCtx).Update(WSStarContextKeys::KRetryAfter,
+                                                            retryInt);
+                            }
+                        }
+                    }
+                }
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx) - \
+                            Fault element not exists")));
+            return KErrNotFound;
+            }
+        }
+    return KErrNone;
+    }
+TInt CWSStarAddressingHandler::HandleOutboundL(MSenMessageContext& aCtx, 
+                                                CSenSoapEnvelope* aMessage)
+    {
+    if (!iVersion)
+        {
+        iVersion = KAddressingXmlns200508().AllocL();
+        }
+    TPtrC8 anonymous(KNullDesC8);
+    if (!iVersion->Compare(KAddressingXmlns200403()))
+        {
+        anonymous.Set(KReplyToAnonymous200403());
+        }
+     else if(!iVersion->Compare(KAddressingXmlns200408()))
+        {
+        anonymous.Set(KReplyToAnonymous200408());
+        }
+     else if(!iVersion->Compare(KAddressingXmlns200412()))
+        {
+        anonymous.Set(KReplyToAnonymous200412());
+        }
+     else if(!iVersion->Compare(KAddressingXmlns200502()))
+        {
+        anonymous.Set(KReplyToAnonymous200502());
+        }
+     else if(!iVersion->Compare(KAddressingXmlns200503()))
+        {
+        anonymous.Set(KReplyToAnonymous200503());
+        }
+     else if(!iVersion->Compare(KAddressingXmlns200508()))
+        {
+        anonymous.Set(KReplyToAnonymous200508());
+        }
+    CSenElement& element = aMessage->AsElement();
+    element.AddNamespaceL(KAddressingPrefix, *iVersion);
+    ((MSenContext&)aCtx).Update(WSStarContextKeys::KAddressingNsHolder, *iVersion);
+///////////////    
+    const TDesC8* value = NULL;
+    const TInt* isPassportEnabled = aCtx.GetIntL(WSStarContextKeys::KPassportEnabled);
+    value = aCtx.GetDesC8L(WSStarContextKeys::KMessageID);
+    if (!value)
+        {
+        SetMessageIDL(aCtx);
+        }
+        
+    if (!isPassportEnabled || (isPassportEnabled && *isPassportEnabled == FALSE))
+        {
+        CSenElement& header = aMessage->HeaderL();
+        value = aCtx.GetDesC8L(WSStarContextKeys::KMessageID);
+        if (value)
+            {
+            CreateElementAddressingL(header, KMessageIDName, *value, EFalse);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx) - \
+                            MessageId in message context not exists")));
+            return KErrNotFound;
+            }
+        value = aCtx.GetDesC8L(WSStarContextKeys::KTo);
+        if (value)
+            {
+            CreateElementAddressingL(header, KToName, *value, EFalse);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx) - \
+                            Endpoint in message context not exists")));
+            return KErrNotFound;
+            }
+        value = aCtx.GetDesC8L(WSStarContextKeys::KAction);
+        if (value)
+            {
+            CreateElementAddressingL(header, KActionName, *value, EFalse);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InvokeL(MSenMessageContext& aCtx) - \
+                            Action in message context not exists")));
+            return KErrNotFound;
+            }
+        value = aCtx.GetDesC8L(WSStarContextKeys::KRelatesTo);
+        if (value)
+            {
+            CreateElementAddressingL(header, KRelatesToName, *value, EFalse);
+            }
+        value = aCtx.GetDesC8L(WSStarContextKeys::KFrom);
+        if (value)
+            {
+            CreateElementAddressingL(header, KFromName, *value, ETrue);
+            }
+        value = aCtx.GetDesC8L(WSStarContextKeys::KReplyTo);
+        if (value)
+            {
+            CSenElement* element = CreateElementAddressingL(header, KReplyToName, *value, ETrue);
+            const TDesC8* mwsNs = NULL;
+            mwsNs = aCtx.GetDesC8L(WSStarContextKeys::KMwsNamespace);
+            if (mwsNs)
+                {
+                const TDesC8* deviceId = NULL;
+                deviceId = aCtx.GetDesC8L(WSStarContextKeys::KReplyToDeviceAddress);
+                if (deviceId && element)
+                    {
+                    ((CWSStarAddressingEPR*)element)->AddDeviceAddressL(*mwsNs,*deviceId);
+                    }
+                }
+            }
+        else
+            {
+            CSenElement* element = CreateElementAddressingL(header, KReplyToName, 
+                                                            anonymous, ETrue);
+            ((MSenContext&)aCtx).Update(WSStarContextKeys::KReplyTo, anonymous);
+            const TDesC8* mwsNs = NULL;
+            mwsNs = aCtx.GetDesC8L(WSStarContextKeys::KMwsNamespace);
+            if (mwsNs)
+                {
+                const TDesC8* deviceId = NULL;
+                deviceId = aCtx.GetDesC8L(WSStarContextKeys::KReplyToDeviceAddress);
+                if (deviceId && element)
+                    {
+                    ((CWSStarAddressingEPR*)element)->AddDeviceAddressL(*mwsNs,*deviceId);
+                    }
+                }
+            }
+            
+        value = aCtx.GetDesC8L(WSStarContextKeys::KFaultTo);
+        if (value)
+            {
+            CreateElementAddressingL(header, KFaultToName, *value, ETrue);
+            }    
+        if(aCtx.GetIntL(WSStarContextKeys::KAppInfoPresent))
+            {
+            AddAppInfoHeaderL(aCtx,header);
+            }
+        }
+    
+    CSenElement& body = aMessage->BodyL();
+    CSenElement* addressHolderEl = NULL;
+    do
+        {
+        addressHolderEl = 
+            CWSStarMessageUtils::GetMarkedElementL(body,  WSStarContextKeys::KAddressAttrMark);
+        if (addressHolderEl)
+            {
+            value = addressHolderEl->AttrValue(WSStarContextKeys::KAddressAttrMark);
+            CreateElementAddressingL(*addressHolderEl, KEndpointReferenceName,
+                                     *value, ETrue);
+            //removing marker
+            CSenBaseAttribute* marker = 
+                SenXmlUtils::RemoveAttributeL(*addressHolderEl, WSStarContextKeys::KAddressAttrMark);
+            delete marker;
+            marker = NULL;
+            }
+            
+        }while(addressHolderEl);
+    HBufC8* bodyString = body.AsXmlL();
+    ((MSenContext&)aCtx).Update(WSStarContextKeys::KBody, *bodyString);
+    ((MSenContext&)aCtx).Remove(WSStarContextKeys::KBodyElement);
+    delete bodyString;
+    bodyString = NULL;
+    return KErrNone;    
+    }
+void CWSStarAddressingHandler::AddAppInfoHeaderL(MSenMessageContext& aCtx, 
+                                                CSenElement& aHeader)
+{
+    const TDesC8* value = NULL;
+
+    const TDesC8* mwsNs = NULL;
+    mwsNs = aCtx.GetDesC8L(WSStarContextKeys::KMwsNamespace);
+    if (mwsNs)
+        {
+            //CreateElementAddressingL(header, WSStarContextKeys::KApplication, *value,EFalse);
+            CSenElement& aaplication = aHeader.AddElementL(*mwsNs,
+                                   WSStarContextKeys::KApplication,
+                                   WSStarContextKeys::KNsPApplication);
+
+            value = aCtx.GetDesC8L(WSStarContextKeys::KApplicationName);
+            if(value)
+            {
+                CSenElement& name = aaplication.AddElementL(*mwsNs,
+                                            WSStarContextKeys::KName,
+                                            WSStarContextKeys::KNsPName);                       
+                 name.SetContentL(*value);
+            }
+
+            value = aCtx.GetDesC8L(WSStarContextKeys::KApplicationVendor);
+            if(value)
+            {
+                CSenElement& vendor = aaplication.AddElementL(*mwsNs,
+                                        WSStarContextKeys::KVendor,
+                                        WSStarContextKeys::KNsPVendor);                       
+                 vendor.SetContentL(*value);
+            }
+            value = aCtx.GetDesC8L(WSStarContextKeys::KApplicationVersion);
+            if(value)
+            {
+                CSenElement& version = aaplication.AddElementL(*mwsNs,
+                                       WSStarContextKeys::KVersion,
+                                       WSStarContextKeys::KNsPVersion);                       
+                 version.SetContentL(*value);
+            }
+            
+            CSenElement& deviceoption = aHeader.AddElementL(*mwsNs,
+                                   WSStarContextKeys::KDeviceOptions,
+                                   WSStarContextKeys::KNsPDeviceOptions);
+            
+            value = aCtx.GetDesC8L(WSStarContextKeys::KLocale);
+            if(value)
+            {
+                CSenElement& local = deviceoption.AddElementL(*mwsNs,
+                                       WSStarContextKeys::KLocale,
+                                       WSStarContextKeys::KNsPLocale);                       
+                 local.SetContentL(*value);
+            }
+            
+            CSenElement& useragent = deviceoption.AddElementL(*mwsNs,
+                                     WSStarContextKeys::KUserAgent,
+                                     WSStarContextKeys::KNsPUserAgent);
+            
+            value = aCtx.GetDesC8L(WSStarContextKeys::KManufacturer);
+            if(value)
+            {
+                CSenElement& manufacturer = useragent.AddElementL(*mwsNs,
+                                             WSStarContextKeys::KManufacturer,
+                                             WSStarContextKeys::KNsPManufacturer);                       
+                 manufacturer.SetContentL(*value);
+            }
+            value = aCtx.GetDesC8L(WSStarContextKeys::KModel);
+            if(value)
+            {
+                CSenElement& model = useragent.AddElementL(*mwsNs,
+                                       WSStarContextKeys::KModel,
+                                       WSStarContextKeys::KNsPModel);                       
+                 model.SetContentL(*value);
+            }
+            
+            CSenElement& os = useragent.AddElementL(*mwsNs,
+                                     WSStarContextKeys::KOS,
+                                     WSStarContextKeys::KNsPOS);
+         
+           value = aCtx.GetDesC8L(WSStarContextKeys::KDeviceName);
+            if(value)
+            {
+                CSenElement& name = os.AddElementL(*mwsNs,
+                                    WSStarContextKeys::KName,
+                                    WSStarContextKeys::KNsPName);                       
+                 name.SetContentL(*value);
+            }
+           value = aCtx.GetDesC8L(WSStarContextKeys::KDeviceVersion);
+            if(value)
+            {
+                CSenElement& version = os.AddElementL(*mwsNs,
+                                        WSStarContextKeys::KVersion,
+                                        WSStarContextKeys::KNsPVersion);                       
+                version.SetContentL(*value);
+            }
+
+                                                 
+            value = aCtx.GetDesC8L(WSStarContextKeys::KIMSI);
+            if(value)
+            {
+                CSenElement& imsi = useragent.AddElementL(*mwsNs,
+                                        WSStarContextKeys::KIMSI,
+                                        WSStarContextKeys::KNsPIMSI);                       
+                 imsi.SetContentL(*value);
+            }
+        }    
+    return;
+    }
+    
+SenHandler::THandlerDirection CWSStarAddressingHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::Direction()")));
+    return SenHandler::EBoth;
+    }
+SenHandler::THandlerPhase CWSStarAddressingHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::Phase()")));
+    return SenHandler::EMessage;
+    }
+
+// Constructor
+CWSStarAddressingHandler::CWSStarAddressingHandler(MSenHandlerContext& aCtx)
+:CSenMessageHandler(aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::\
+                        CWSStarAddressingHandler(MSenHandlerContext& aCtx)")));
+    }
+
+// Destructor
+CWSStarAddressingHandler::~CWSStarAddressingHandler()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::~CWSStarAddressingHandler()")));
+    delete iVersion;
+    }
+
+// Second phase construction.
+void CWSStarAddressingHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::ConstructL()")));
+    
+    InitVersionL(NULL);
+    }
+void CWSStarAddressingHandler::InitVersionL(const TDesC8* aVersion)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InitVersion()")));
+    const TDesC8* version = iHandlerContext.GetDesC8L(HandlerContextKey::KVersion);
+    if (aVersion && 
+        (*aVersion == KAddressingXmlns200408 || 
+         *aVersion == KAddressingXmlns200403 ||
+         *aVersion == KAddressingXmlns200412 ||
+         *aVersion == KAddressingXmlns200502 ||
+         *aVersion == KAddressingXmlns200503 ||
+         *aVersion == KAddressingXmlns200508))
+        {
+        delete iVersion;
+        iVersion = NULL;
+        iVersion = aVersion->AllocL();
+        }
+    else if(version && 
+        (*version == KAddressingXmlns200408 || 
+         *version == KAddressingXmlns200403 ||
+         *version == KAddressingXmlns200412 ||
+         *version == KAddressingXmlns200502 ||
+         *version == KAddressingXmlns200503 ||
+         *version == KAddressingXmlns200508))
+        {
+        delete iVersion;
+        iVersion = NULL;
+        iVersion = version->AllocL();
+        }
+    else
+        {//no version from handler config
+        //no version from user
+        //so it means some default behavior (new addressing), 
+        //only allocate if differen (to safe time)
+        if ((!iVersion) || (*iVersion != KAddressingXmlns200508()))
+            {
+            delete iVersion;
+            iVersion = NULL;
+            //iVersion = KAddressingXmlns200508().AllocL();
+            }
+        //else - just leave ai it is
+        }
+    }
+CSenElement* CWSStarAddressingHandler::CreateElementAddressingL(CSenElement& aParentElement, const TDesC8& aLocalName,
+                                                        const TDesC8& aContent, TBool aUseAddress)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::CreateElementAddressing(CSenElement& aParentElement,\
+                     const TDesC8& aLocalName, const TDesC8& aContent, TBool aUseAddress)")));
+
+    CSenElement* newelement = NULL;
+    if (!aUseAddress)
+        {
+        newelement = aParentElement.CreateElementL(KAddressingPrefix(),
+                                                                aLocalName);
+        CleanupStack::PushL(newelement);
+        newelement->SetContentL(aContent);
+        }
+    else
+        {
+        newelement = CWSStarAddressingEPR::NewL(aParentElement, aLocalName, aContent, *iVersion);
+        CleanupStack::PushL(newelement);
+        }
+    if (newelement)
+        {
+        aParentElement.AddElementL(*newelement);
+        CleanupStack::Pop(newelement);
+        }
+/*
+    if (aUseAddress)
+        {
+        CSenElement& element = *newelement;
+        CreateElementAddressingL(element,KAddressName,aContent,EFalse);
+        }
+    else
+        {
+        newelement->SetContentL(aContent);                
+        }*/
+    return newelement;    
+    }
+
+void CWSStarAddressingHandler::SetMessageIDL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::SetMessageID(MSenMessageContext& aCtx)")));
+    CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
+    HBufC8* messageId = pGuidGenerator->GetRandomGuid8LC();
+    TPtr8 messageIdDes = messageId->Des();
+    messageIdDes.LowerCase();
+    ((MSenContext&)aCtx).Update(WSStarContextKeys::KMessageID,*messageId);
+    CleanupStack::PopAndDestroy(messageId);
+    CleanupStack::PopAndDestroy(pGuidGenerator);
+    }
+void CWSStarAddressingHandler::ShareMyLiterals(MSenMessageContext& aCtx)
+    {
+    if (iVersion)
+        {
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KAddressingNsHolder,
+                *iVersion);
+        ((MSenContext&)aCtx).Update(WSStarContextKeys::KAddressingEndpointTagHolder, KAddressName);
+        }
+    }
+TInt CWSStarAddressingHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarAddressingHandler::InitL(MSenHandlerContext& aCtx)")));
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+
+RFileLogger* CWSStarAddressingHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressingheaderinbound.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsstaraddressingheaderinbound.h"
+#include "senlogger.h"
+
+using namespace WSStarAddressing;
+
+CWSStarAddressingHeaderInbound* CWSStarAddressingHeaderInbound::NewL(const TDesC8* aVersion)
+    {
+    CWSStarAddressingHeaderInbound* self = NewLC(aVersion);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSStarAddressingHeaderInbound* CWSStarAddressingHeaderInbound::NewLC(const TDesC8* aVersion)
+    {
+    CWSStarAddressingHeaderInbound* self = new (ELeave) CWSStarAddressingHeaderInbound();
+    CleanupStack::PushL (self);
+    self->ConstructL(aVersion);
+    return self;
+    }
+
+
+void CWSStarAddressingHeaderInbound::StartElementL(const TDesC8& aNsUri,
+                               const TDesC8& aLocalName,
+                               const TDesC8& /*aQName*/,
+                               const RAttributeArray& /*aAttributes*/)
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            if (!iVersion && (aNsUri == KAddressingXmlns200408 ||
+                aNsUri == KAddressingXmlns200403 ||
+                aNsUri == KAddressingXmlns200412 ||
+                aNsUri == KAddressingXmlns200502 ||
+                aNsUri == KAddressingXmlns200503 ||
+                aNsUri == KAddressingXmlns200508))
+                {
+                delete iVersionBuf;
+                iVersionBuf = NULL;
+                iVersionBuf = aNsUri.AllocL();
+                iVersion = iVersionBuf;
+                }
+            if (iVersion && (aNsUri == *iVersion))
+                {
+                iState = KStateSave;
+                if  (aLocalName == KReplyToName )
+                    {
+                    iState = KStateParsingReplyTo;
+                    }
+                else if  (aLocalName == KFaultToName )
+                    {
+                    iState = KStateParsingFaultTo;
+                    }
+                else if  (aLocalName == KFromName )
+                    {
+                    iState = KStateParsingFrom;
+                    }
+                break;
+                }
+            if (aLocalName == WSStarAddressingEPR::KDeviceAddressName)
+                {
+                iState = KStateSave;
+                }
+            }
+        default:
+            break;
+        }
+    }                       
+    
+void CWSStarAddressingHeaderInbound::EndElementL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& /*aQName*/)
+    {
+    TPtrC8 content = Content();
+    TUriParser8 uriParser;
+    TInt error = uriParser.Parse(content);
+    if (error != KErrNone)
+        {
+        TLSLOG_FORMAT((KSenFaultsLogChannel, KSenFaultsLogLevel, 
+                        WSStarAddressingFault::KInvalidHeaderFormatString8, 
+                        &aLocalName,&WSStarAddressingFault::KInvalidUri()));   
+        }
+        
+    switch (iState)
+        {
+        case KStateSave:
+            {
+            if (aNsUri == *iVersion)
+                {
+                if (aLocalName == KMessageIDName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KMessageID, 
+                                                            content);
+                    }
+                else if (aLocalName == KRelatesToName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KRelatesTo, 
+                                                            content);
+                    }
+                else if (aLocalName == KToName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KTo, content);
+                    }
+                else if (aLocalName == KActionName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KAction, content);
+                    }
+                }
+            if (aLocalName == WSStarAddressingEPR::KDeviceAddressName)
+                {
+                ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KReplyToDeviceAddress,
+                                                        content);
+                iDeviceAddress = ETrue;                                                            
+                }
+            ResetContentL();
+            iState = KStateIgnore;
+            break;
+            }
+        case KStateParsingReplyTo:
+            {
+            if (aNsUri == *iVersion )
+                {
+                if (aLocalName == KAddressName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KReplyTo,content);
+                    }
+                ResetContentL();
+                break;
+                }
+            if (aLocalName == WSStarAddressingEPR::KDeviceAddressName)
+                {
+                if (!iDeviceAddress)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KReplyToDeviceAddress,
+                                                            content);
+                    }
+                }
+
+            ResetContentL();
+            iState = KStateIgnore;
+            break;
+            }            
+        case KStateParsingFaultTo:
+            {
+            if (aNsUri == *iVersion )
+                {
+                if (aLocalName == KAddressName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KFaultTo,content);
+                    ResetContentL();
+                    iState = KStateIgnore;
+                    }
+                }
+            break;
+            }            
+        case KStateParsingFrom:
+            {
+            if (aNsUri == *iVersion )
+                {
+                if (aLocalName == KAddressName)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KFrom,content);
+                    ResetContentL();
+                    iState = KStateIgnore;
+                    }
+                }
+            break;
+            }            
+        default:
+            break;
+        }
+    }
+
+
+// Constructor
+CWSStarAddressingHeaderInbound::CWSStarAddressingHeaderInbound()
+    {
+    }
+
+// Destructor
+CWSStarAddressingHeaderInbound::~CWSStarAddressingHeaderInbound()
+    {
+    delete iVersionBuf;
+    }
+
+// Second phase construction.
+void CWSStarAddressingHeaderInbound::ConstructL(const TDesC8* aVersion)
+    {
+    if (aVersion)
+        {
+        CSenBaseFragment::BaseConstructL(*aVersion,
+                KSenSoapEnvelopeHeaderName);
+        }
+    else
+        {
+        CSenBaseFragment::BaseConstructL(TPtrC8(NULL,0),
+                KSenSoapEnvelopeHeaderName);
+        }
+    iVersion = aVersion;
+    iDeviceAddress = EFalse;
+    }
+
+
+TInt CWSStarAddressingHeaderInbound::SetMessageContext(MSenMessageContext& aCtx)
+    {
+    iMessageContext = &aCtx;
+    return KErrNone;
+    }
+
+const TDesC8* CWSStarAddressingHeaderInbound::Version() const
+    {
+    return iVersion;
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarcredentialcollectorhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "wsstarcredentialcollectorhandler.h"
+#include "senlogger.h"
+#include <SenDateUtils.h>
+
+// Create instance of concrete ECOM interface implementation
+CWSStarCredentialCollectorHandler* CWSStarCredentialCollectorHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarCredentialCollectorHandler* self = 
+            new(ELeave)CWSStarCredentialCollectorHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSStarCredentialCollectorHandler::CWSStarCredentialCollectorHandler(MSenHandlerContext& aCtx)
+:CSenMessageHandler(aCtx)
+    {
+    }
+
+// Destructor
+CWSStarCredentialCollectorHandler::~CWSStarCredentialCollectorHandler()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCredentialCollectorHandler::\
+                         ~CWSStarCredentialCollectorHandler()")));
+    }
+
+// Second phase construction.
+void CWSStarCredentialCollectorHandler::ConstructL()
+    {
+    }
+    
+TInt CWSStarCredentialCollectorHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCredentialCollectorHandler::InvokeL(MSenMessageContext& aCtx)")));
+    TInt result = KErrNone;
+    CSenSoapMessage* message = 
+        (CSenSoapMessage*)(aCtx.GetSenSoapEnvelopeL(SenContext::KSenCurrentSoapMessageCtxKey));
+    if (message)
+        {   
+        if (aCtx.Direction()==SenContext::EOutgoing)
+            {
+            //1. first put timestamp in security section. 
+            //Propably 1st tag processed by servers
+
+
+            HBufC8* timestamp = NULL;
+            const TDesC8*  createdValue = aCtx.GetDesC8L(WSStarContextKeys::KTimestampCreated);
+            const TDesC8*  expiredValue = aCtx.GetDesC8L(WSStarContextKeys::KTimestampExpires);
+                 
+            if (createdValue)
+                {
+                TTime clientTime;
+                TTime mtTime;
+                const TDesC8* mtTimetd = aCtx.GetDesC8L(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+                mtTime = SenDateUtils::FromXmlDateTimeL(*mtTimetd);
+                clientTime.UniversalTime();
+                if (clientTime != Time::NullTTime())
+                    {
+                    TTimeIntervalMicroSeconds  diff  = clientTime.MicroSecondsFrom(mtTime);
+                    if (diff > 0)
+                        {
+                        TTime createTime = SenDateUtils::FromXmlDateTimeL(*createdValue);
+                        TBuf8<SenDateUtils::KXmlDateTimeMaxLength> newCreateTime;
+                        TInt leaveCode(KErrNone);
+                        TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(newCreateTime, createTime + diff);)
+                        if (!leaveCode)
+                            {
+                            User::LeaveIfError(
+                                        ((MSenContext&)aCtx).Update(WSStarContextKeys::KTimestampCreated, 
+                                        newCreateTime));
+                            createdValue = &newCreateTime;
+                            }
+                        }
+                 }
+            //problem with signing if "expired" tag exists. 
+            //Presently wssecurity is turned-off, so we can include this tag.
+            if (expiredValue)  
+                {
+                CSenWsSecurityHeader::TimestampL(*createdValue, *expiredValue, timestamp);
+                CleanupStack::PushL(timestamp);
+                }
+            else
+                {
+                CSenWsSecurityHeader::TimestampL(*createdValue, timestamp);
+                CleanupStack::PushL(timestamp);
+                }
+            message->AddSecurityTokenL(*timestamp);
+            CleanupStack::PopAndDestroy(timestamp);
+                }
+//2.after timestamp put else stuff like MT            
+            const TDesC8* securityToken = aCtx.GetDesC8L(WSStarContextKeys::KSecurityToken);
+            if (securityToken)
+                {
+                message->AddSecurityTokenL(*securityToken);
+                }
+            else
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCredentialCollectorHandler::InvokeL\
+                                (MSenMessageContext& aCtx) -  \
+                                Security token in message context not exists")));
+                return KErrNone;
+                }            
+            }
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCredentialCollectorHandler::InvokeL(MSenMessageContext& aCtx)\
+                         - SOAP message in message context not exists")));
+        result = KErrNotFound;
+        }
+    return result;
+    }
+
+TInt CWSStarCredentialCollectorHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+    
+SenHandler::THandlerDirection CWSStarCredentialCollectorHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCredentialCollectorHandler::Direction()")));
+    return SenHandler::EOutgoing;
+    };
+SenHandler::THandlerPhase CWSStarCredentialCollectorHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCredentialCollectorHandler::Phase()")));
+    return SenHandler::EMessage;
+    };    
+RFileLogger* CWSStarCredentialCollectorHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarenveloperhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include "wsstarenveloperhandler.h"
+#include "senlogger.h"
+
+// Create instance of concrete ECOM interface implementation
+CWSStarEnveloperHandler* CWSStarEnveloperHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarEnveloperHandler* self   = new (ELeave) CWSStarEnveloperHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSStarEnveloperHandler::CWSStarEnveloperHandler(MSenHandlerContext& aCtx):CSenMessageHandler(aCtx)
+    {
+    }
+
+// Destructor
+CWSStarEnveloperHandler::~CWSStarEnveloperHandler()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarEnveloperHandler::~CWSStarEnveloperHandler()")));
+    }
+
+// Second phase construction.
+void CWSStarEnveloperHandler::ConstructL()
+    {
+    }
+    
+TInt CWSStarEnveloperHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarEnveloperHandler::InvokeL(MSenMessageContext& aCtx)")));
+        const TInt* soapVersion = aCtx.GetIntL(WSStarContextKeys::KSoapVersion);
+        const TDesC8* securityVersion = iHandlerContext.GetDesC8L(HandlerContextKey::KVersion);
+        CSenSoapMessage* message;
+        TPtrC8 secVersion(KSecurityXmlNs);
+        if (securityVersion
+            && (*securityVersion == KSecuritySchemeXmlNs || *securityVersion == KSecurityXmlNs))
+            {
+            secVersion.Set(*securityVersion);
+            }
+        if (soapVersion)
+            {
+            //old SOAP version force to use old sec spec
+            if ((TSOAPVersion)*soapVersion == ESOAP11)
+                {
+                secVersion.Set(KSecuritySchemeXmlNs);
+                }
+            message = CSenSoapMessage::NewL((TSOAPVersion)*soapVersion, secVersion);
+            }
+        else
+            {
+            message = CSenSoapMessage::NewL(ESOAP12, secVersion);
+            ((MSenContext&)aCtx).Add(WSStarContextKeys::KSoapVersion,ESOAP12);        
+            }
+        CleanupStack::PushL(message);    
+        CSenElement* elemBody = 
+            const_cast<CSenElement*>(aCtx.GetSenElementL(WSStarContextKeys::KBodyElement));
+        if (elemBody)
+            {
+            message->BodyL().AddElementL(*elemBody);
+            aCtx.Remove(WSStarContextKeys::KBodyElement);
+            }
+        else
+            {
+            const TDesC8* content = aCtx.GetDesC8L(WSStarContextKeys::KBody);
+            if (content)
+                {
+                message->SetBodyL(*content);
+                }
+            }
+        CleanupStack::Pop(message);
+        aCtx.Update(SenContext::KSenCurrentSoapMessageCtxKey, message);
+        return KErrNone;
+    }
+    
+SenHandler::THandlerDirection CWSStarEnveloperHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarEnveloperHandler::Direction()")));
+    return SenHandler::EOutgoing;
+    };
+SenHandler::THandlerPhase CWSStarEnveloperHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarEnveloperHandler::Phase()")));
+    return SenHandler::EMessage;
+    };    
+    
+TInt CWSStarEnveloperHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+RFileLogger* CWSStarEnveloperHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarmessagehandlersproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "wsstarenveloperhandler.h"
+#include "wsstaraddressinghandler.h"
+#include "wsstarcredentialcollectorhandler.h"
+#include "wsstarsecurityhandler.h"
+#include "wsstarpassporthandler.h"
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TInt32 KWSStarEnveloperHandler = 0x101F971D;
+    const TInt32 KWSStarPassportHandler = 0x101F971E;
+    const TInt32 KWSStarAddressingHandler = 0x101F971F;
+    const TInt32 KWSStarCredentialCollectorHandler = 0x101F9720;
+    const TInt32 KWSStarSecurityHandler = 0x101F9721;
+#else
+    const TInt32 KWSStarEnveloperHandler = 0x10282C56;
+    const TInt32 KWSStarPassportHandler = 0x10282C57;
+    const TInt32 KWSStarAddressingHandler = 0x10282C58;
+    const TInt32 KWSStarCredentialCollectorHandler = 0x10282C59;
+    const TInt32 KWSStarSecurityHandler = 0x10282C5A;
+#endif
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarEnveloperHandler,  CWSStarEnveloperHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarPassportHandler,  CWSStarPassportHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarAddressingHandler,  CWSStarAddressingHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarCredentialCollectorHandler,  CWSStarCredentialCollectorHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarSecurityHandler,  CWSStarSecurityHandler::NewL)
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarmessageutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "wsstarmessageutils.h"
+#include <xmlengnodelist.h> 
+
+CSenElement* CWSStarMessageUtils::GetMarkedElementL(CSenElement& aParent, 
+                                                    const TDesC8& aValue, TBool aAttribute)
+    {
+     CSenElement* markedEl = NULL;
+
+//1.flat choose 
+    RPointerArray<CSenElement>& elements = aParent.ElementsL();
+    TInt count(elements.Count());
+    TInt i=0;
+    while (i<count && !markedEl)
+        {
+        markedEl = elements[i];
+        if (aAttribute)
+            {
+            if (!markedEl->AttrValue(aValue))
+                {
+                markedEl = NULL;
+                }    
+            }
+        else
+            {
+            if (markedEl->LocalName() != aValue)
+                {
+                markedEl = NULL;
+                }    
+            }
+        
+        i++;
+        }
+
+//2.go deeper 
+    if (!markedEl)
+        {
+        elements = aParent.ElementsL();
+        TInt count(elements.Count());
+        TInt i=0;
+        while (i<count && !markedEl)
+            {
+            markedEl = CWSStarMessageUtils::GetMarkedElementL(*elements[i], aValue, aAttribute);
+            i++;
+            }
+        }
+    return markedEl;
+    }
+
+void CWSStarMessageUtils::FindElementL(const TDesC8& aElementName, 
+                                        const TDesC8& aNamespace, 
+                                        const TXmlEngElement& aParent, 
+                                        RArrayElements* aElements)
+{
+    RXmlEngNodeList<TXmlEngElement> nodeList;
+    TXmlEngElement parent;
+    aParent.GetElementsByTagNameL( nodeList, aElementName , aNamespace );
+    if( nodeList.Count() )
+    {
+        parent = nodeList.Next();
+        aElements->AppendL(parent);
+    }
+    
+    RXmlEngNodeList<TXmlEngElement> nodeChildList;
+    aParent.GetChildElements(nodeChildList);
+    
+    TInt count( nodeChildList.Count() );
+    for(TInt i(0) ; i<count ; i++)
+    {
+        if( nodeChildList.HasNext() )
+        {
+            CWSStarMessageUtils::FindElementL(aElementName , 
+                                                aNamespace , 
+                                                nodeChildList.Next() ,
+                                                aElements);
+        }
+    }
+    nodeList.Close();
+    nodeChildList.Close(); 
+}
+
+CSenElement* CWSStarMessageUtils::FindElementL(const TDesC8& aLocalName, CSenElement& aParent)
+    {
+     CSenElement* elem = NULL;
+
+    RPointerArray<CSenElement>& elements = aParent.ElementsL();
+    TInt count(elements.Count());
+    TInt i=0;
+    while (i<count && !elem)
+        {
+        elem = elements[i];
+        if (elem->LocalName() != aLocalName)
+            {
+            elem = NULL;
+            }    
+        i++;
+        }
+
+    if (!elem)
+        {
+        elements = aParent.ElementsL();
+        TInt count(elements.Count());
+        TInt i=0;
+        while (i<count && !elem)
+            {
+            elem = CWSStarMessageUtils::FindElementL(aLocalName, *elements[i]);
+            i++;
+            }
+        }
+    return elem;
+    
+    }
+void CWSStarMessageUtils::FindElementL(
+                                const TDesC8& aLocalName,
+                                CSenElement& aParent,
+                                RArraySenElements& aElements)
+    {
+    CSenElement* elem = NULL;
+
+    RPointerArray<CSenElement>& elements = aParent.ElementsL();
+    TInt count(elements.Count());
+    TInt i=0;
+    while (i<count)
+        {
+        elem = elements[i];
+        if (elem->LocalName() == aLocalName)
+        {
+            aElements.Append(elem);
+        }
+        CWSStarMessageUtils::FindElementL(aLocalName, *elem,aElements);
+        elem = NULL;
+        i++;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarpassporthandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "wsstarpassporthandler.h"
+#include "SenXmlUtils.h"
+#include "wsstarmessageutils.h"
+#include "wsstartrustclient.h"
+#include "SenSoapFault.h"
+#include "senlogger.h"
+#include "sensaxutils.h"
+
+#ifdef RD_SEN_VTCP_SUPPORT
+#include "wsstarpassportheaderinbound.h"
+#endif//RD_SEN_VTCP_SUPPORT
+
+
+using namespace WSPassport32;
+
+// Create instance of concrete ECOM interface implementation
+CWSStarPassportHandler* CWSStarPassportHandler::NewL(TAny* aHandlerCtx)
+    {
+    MSenHandlerContext* ctx =
+        reinterpret_cast<MSenHandlerContext*>( aHandlerCtx);
+    CWSStarPassportHandler* self = new (ELeave) CWSStarPassportHandler(*ctx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+TInt CWSStarPassportHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::InvokeL(MSenMessageContext& aCtx)")));
+    CSenSoapEnvelope* message = 
+        const_cast<CSenSoapEnvelope*>(aCtx.GetSenSoapEnvelopeL(
+                                                SenContext::KSenCurrentSoapMessageCtxKey));
+    const TBool* boolValue = NULL;
+    if (message)
+        {
+        _LIT8(KId,"Id");
+        boolValue = aCtx.GetIntL(WSStarContextKeys::KPassportEnabled);
+        if ((boolValue && *boolValue == (TBool)ETrue))
+            {
+            if (aCtx.Direction() == SenContext::EOutgoing)
+                {//------------------OUTGOING
+                CSenElement& header = message->HeaderL();
+                CSenElement& authInfo = header.AddElementL(KPassportXmlns,
+                                                           KAuthInfoTag,
+                                                           KAuthInfoQTag);
+                SenXmlUtils::AddAttributeL(authInfo, KId ,KPPAuthInfoAttrValue);
+                authInfo.AddElementL(KPassportXmlns, 
+                                        KHostingAppTag, 
+                                        KHostingAppQTag).SetContentL(KHostingAppTagValue);
+                authInfo.AddElementL(KPassportXmlns, 
+                                        KBinaryVersionTag, 
+                                        KBinaryVersionQTag).SetContentL(KBinaryVersionTagValue);
+                authInfo.AddElementL(KPassportXmlns, 
+                                        KUIVersionTag, 
+                                        KUIVersionQTag).SetContentL(KUIVersionTagValue);
+                authInfo.AddElementL(KPassportXmlns, 
+                                        KCookiesTag, 
+                                        KCookiesQTag).SetContentL(KCookiesTagValue);
+                authInfo.AddElementL(KPassportXmlns, 
+                                        KRequestParamsTag, 
+                                        KRequestParamsQTag).SetContentL(KRequestParamsTagValue);
+                CSenElement& body = message->BodyL();
+                CSenElement* multiEl = 
+                    CWSStarMessageUtils::GetMarkedElementL(body, WSStarContextKeys::KMultiReqTagMark, 
+                                                            EFalse);
+                if (multiEl)
+                    {
+                    multiEl->Set(KPassportXmlns, KRequestMultipleSecurityTokensTag, 
+                                    KRequestMultipleSecurityTokensQTag);
+                    }
+                        
+                }
+            else if(aCtx.Direction() == SenContext::EIncoming)
+                {//------------------INCOMING
+                TPtrC8 problem(KNullDesC8);
+                if (message->IsFault())
+                    {
+                    CSenSoapFault* faultElement = message->FaultL();
+                    if (faultElement)
+                        {
+                        if (message->NsUri() == KSenSoap12EnvelopeXmlns)
+                            {
+    //----------------SOAP1.2
+                            TPtrC8 code = faultElement->FaultCode();
+                            const CSenNamespace* nmSpaceCode = faultElement->Namespace(SenXmlUtils::NsPrefix(code), ETrue);
+                            code.Set(SenXmlUtils::LocalName(code));
+                            
+                            if ((
+                                (nmSpaceCode && 
+                                nmSpaceCode->URI() == KSenSoap12EnvelopeXmlns) 
+                                ||
+                                !nmSpaceCode)
+                                &&
+                                code == KSender)
+                                {
+                                TPtrC8 subcode = faultElement->FaultSubcode();
+                                const CSenNamespace* nmSpace = faultElement->Namespace(SenXmlUtils::NsPrefix(subcode), ETrue);
+                                subcode.Set(SenXmlUtils::LocalName(subcode));
+                                
+                                if (nmSpace && 
+                                    nmSpace->URI() == WSTrust::KTrustNamespace200502())
+                                    {
+                                    problem.Set(subcode);
+                                    }    
+                                }
+                            else if (nmSpaceCode && nmSpaceCode->URI() == KSecurityXmlNs)
+                                {
+                                problem.Set(code);
+                                }
+                            }
+                        else if (message->NsUri() == KSenSoapEnvelopeXmlns)
+                            {
+    //----------------SOAP1.1
+                            TPtrC8 code = faultElement->FaultCode();
+                            const CSenNamespace* nmSpace = faultElement->Namespace(SenXmlUtils::NsPrefix(code), ETrue);
+                            code.Set(SenXmlUtils::LocalName(code));
+                            if ((nmSpace && 
+                                nmSpace->URI() == WSTrust::KTrustNamespace200502()))
+                                {
+                                problem.Set(code);
+                                }    
+                            }
+    //------------------real logic                        
+                        if (problem.Length()>0 && problem == WSTrust::KFailedAuthentication)
+                            {
+                            CSenElement* elem = NULL;
+                            CSenElement& env = message->AsElement();
+                            elem = CWSStarMessageUtils::FindElementL(KRedirectUrlTag, env);
+                            if (elem)
+                                {
+                                const CSenNamespace* ns = elem->Namespace();
+                                if (ns && ns->URI() == KPassportFaultNamespaceXmlns)
+                                    {
+                                    ((MSenContext&)aCtx).Update(WSStarSession::KErrorLayer, WSStarSession::ETrust);
+                                    ((MSenContext&)aCtx).Update(WSStarContextKeys::KReAuthNeeded, EFalse);
+                                    ((MSenContext&)aCtx).Update(WSStarContextKeys::KRedirect, elem->Content());        
+                                    }
+                                }
+                            }
+                        }
+                    }
+		#ifdef RD_SEN_VTCP_SUPPORT					
+                else
+                    {
+                        TPtrC8 txtMessage = aCtx.GetMessageL();
+                        if(message)
+                        {
+                            return HandleInboundL(aCtx, message);
+                        }
+                        else if(txtMessage.Length())
+                        {
+                            TInt ret(KErrNone);
+                            TInt endTagStart;
+                            TInt endTagEnd;
+                            TInt startTagStart;
+                            TInt startTagEnd;
+                            TPtrC8 prefix;
+
+                            ret = SenSaxUtils::SearchEndTagL(txtMessage,KSenSoapEnvelopeBodyName,
+                                                             endTagStart, endTagEnd, prefix);
+                            if ( ret != KErrNotFound )
+                                {
+                                ret = SenSaxUtils::SearchStartTagL(txtMessage,prefix,KSenSoapEnvelopeBodyName,
+                                                                   startTagStart, startTagEnd);
+                                }
+                            if ( ret != KErrNotFound )
+                                {
+                                    TPtrC8 startPart(txtMessage.Ptr(),startTagEnd+1);
+                                    TPtrC8 endPart(txtMessage.Ptr()+endTagStart,txtMessage.Size()-endTagStart);
+                                    HBufC8* pXmlWithoutBody = HBufC8::NewLC(startPart.Length()+endPart.Length());
+                                    pXmlWithoutBody->Des().Append(startPart);
+                                    pXmlWithoutBody->Des().Append(endPart);
+
+                                    CWSStarPassportHeaderInbound* inbound =
+                                            CWSStarPassportHeaderInbound::NewLC();
+                                    inbound->SetMessageContext(aCtx);
+                                    CSenXmlReader& reader = const_cast<CSenXmlReader&>(*aCtx.GetParser());
+                                    inbound->SetReader(reader);
+                                    inbound->BuildFrom(*pXmlWithoutBody);
+                                    CleanupStack::PopAndDestroy(inbound);
+
+
+                                    CleanupStack::PopAndDestroy(pXmlWithoutBody);
+        
+                                
+                                }
+                            else//case with empty body - <S:Body/>, so we can parse all
+                                {
+                                CWSStarPassportHeaderInbound* inbound =
+                                        CWSStarPassportHeaderInbound::NewLC();
+                                inbound->SetMessageContext(aCtx);
+                                CSenXmlReader& reader = const_cast<CSenXmlReader&>(*aCtx.GetParser());
+                                inbound->SetReader(reader);
+                                inbound->BuildFrom(txtMessage);
+                                CleanupStack::PopAndDestroy(inbound);                        
+                                }
+                        }
+					}                        
+		#endif//RD_SEN_VTCP_SUPPORT
+				
+                }
+            }
+        }
+    else
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::InvokeL(MSenMessageContext& aCtx) - \
+                        Soap message in message context not exists")));
+        return KErrNotFound;
+        }
+    return KErrNone;    
+    }    
+
+TInt CWSStarPassportHandler::HandleInboundL(MSenMessageContext& aCtx, CSenSoapEnvelope* aMessage)
+    {
+
+    CSenElement& header = aMessage->HeaderL();
+
+    CWSStarMessageUtils::RArraySenElements elements;
+    CWSStarMessageUtils::FindElementL(KCredProperty, header,elements);
+    CSenElement* elem = NULL;
+    TInt count(elements.Count());
+    TInt i=0;
+    while (i<count)
+        {
+        elem = elements[i];
+        if (elem->LocalName() == WSPassport32::KCredProperty)
+            {
+            const TDesC8& nsUri = elem->NamespaceURI();
+            if ((nsUri == WSPassport32::KPassportFaultNamespaceXmlns))
+                {
+                    const TDesC8* ptr= elem->AttrValue(WSPassport32::KName);
+                    if(*ptr == WSPassport32::KMainBrandID)
+                    {
+                        ((MSenContext&)aCtx).Update(WSStarContextKeys::KMainBrandID, elem->Content());
+                    }
+                 }
+            }
+        i++;
+        }
+    elements.Reset();
+    
+    CWSStarMessageUtils::RArraySenElements credProperties;
+    CWSStarMessageUtils::FindElementL(KCredProperties, header,credProperties);
+    elem = NULL;
+    count = 0;
+    count = credProperties.Count();
+	if(count == 1)
+	{
+		elem = credProperties[0];	
+		HBufC8* xmlSnippet = elem->AsXmlL();
+		CleanupStack::PushL(xmlSnippet);
+		((MSenContext&)aCtx).Update(WSStarContextKeys::KBrandIDList,xmlSnippet->Des() );		
+ 		CleanupStack::PopAndDestroy(xmlSnippet);
+     		
+	}
+    credProperties.Reset();
+    
+    return KErrNone;
+            
+    }
+SenHandler::THandlerDirection CWSStarPassportHandler::Direction() const
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::Direction()")));
+    return SenHandler::EOutgoing;
+    }
+SenHandler::THandlerPhase CWSStarPassportHandler::Phase()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::Phase()")));
+    return SenHandler::EMessage;
+    }
+
+// Constructor
+CWSStarPassportHandler::CWSStarPassportHandler(MSenHandlerContext& aCtx)
+:CSenMessageHandler(aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::CWSStarPassportHandler(MSenHandlerContext& aCtx)")));
+    }
+
+// Destructor
+CWSStarPassportHandler::~CWSStarPassportHandler()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::~CWSStarPassportHandler()")));
+    }
+
+// Second phase construction.
+void CWSStarPassportHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::ConstructL()")));
+    }
+
+TInt CWSStarPassportHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPassportHandler::InitL(MSenHandlerContext& aCtx)")));
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+
+RFileLogger* CWSStarPassportHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarpassportheaderinbound.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+//Co-Branding CR
+#include "wsstarpassportheaderinbound.h"
+#include "senlogger.h"
+#include "SenXmlUtils.h"
+#include "SenBaseElement.h"
+
+
+CWSStarPassportHeaderInbound* CWSStarPassportHeaderInbound::NewL()
+    {
+    CWSStarPassportHeaderInbound* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSStarPassportHeaderInbound* CWSStarPassportHeaderInbound::NewLC()
+    {
+    CWSStarPassportHeaderInbound* self = new (ELeave) CWSStarPassportHeaderInbound();
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    return self;
+    }
+
+
+void CWSStarPassportHeaderInbound::StartElementL(const TDesC8& aNsUri,
+                               const TDesC8& aLocalName,
+                               const TDesC8& aQName,
+                               const RAttributeArray& aAttributes)
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            if (aNsUri == WSPassport32::KPassportFaultNamespaceXmlns)
+                {
+                iState = KStateSave;
+                if  (aLocalName == WSPassport32::KCredProperty )
+                    {
+                    TPtrC8 value =
+                        SenXmlUtils::AttrValue(aAttributes, WSPassport32::KName);
+                    if(value == WSPassport32::KMainBrandID)
+                        {
+                            iState = KStateParsingMainBrandID;
+                        }
+                    
+                    }
+                 else if  (aLocalName == WSPassport32::KCredProperties )
+                    {
+                    iState = KStateParsingBrandIDList;
+                    if(ipBrandIdListElem)
+                        {
+                            delete ipBrandIdListElem;
+                            ipBrandIdListElem = NULL;
+                        }  
+                    ipBrandIdListElem = CSenBaseElement::NewL(aNsUri,aLocalName,aQName,aAttributes);
+                  	}
+                break;
+                }
+            }
+        default:
+            break;
+        }
+    }                       
+    
+void CWSStarPassportHeaderInbound::EndElementL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aQName)
+    {
+    TPtrC8 content = Content();
+    switch (iState)
+        {
+        case KStateSave:
+            {
+            ResetContentL();
+            iState = KStateIgnore;
+            break;
+            }
+        case KStateParsingMainBrandID:
+            {
+            if (aNsUri == WSPassport32::KPassportFaultNamespaceXmlns)
+                {
+                if (aLocalName == WSPassport32::KCredProperty)
+                    {
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KMainBrandID,content);
+                    ResetContentL();
+                    iState = KStateParsingBrandIDList;
+                    }
+                }
+            break;
+            }            
+        case KStateParsingBrandIDList:
+            {
+            if (aNsUri == WSPassport32::KPassportFaultNamespaceXmlns)
+                {
+                if (aLocalName == WSPassport32::KCredProperties)
+                    {
+                    ipBrandIdListElem->SetContentL(content);
+                    HBufC8* xmlSnippet = ipBrandIdListElem->AsXmlL();
+                    CleanupStack::PushL(xmlSnippet);
+                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KBrandIDList,xmlSnippet);
+                    CleanupStack::PopAndDestroy(xmlSnippet);
+                    
+                    ResetContentL();
+                    iState = KStateIgnore;
+                    }
+                }
+            break;
+            }            
+        default:
+            break;
+        }
+    }
+
+
+// Constructor
+CWSStarPassportHeaderInbound::CWSStarPassportHeaderInbound()
+    {
+    }
+
+// Destructor
+CWSStarPassportHeaderInbound::~CWSStarPassportHeaderInbound()
+    {
+    if(ipBrandIdListElem)
+        {
+            delete ipBrandIdListElem;
+            ipBrandIdListElem = NULL;
+        }      
+    }
+
+// Second phase construction.
+void CWSStarPassportHeaderInbound::ConstructL()
+    {
+    CSenBaseFragment::BaseConstructL(TPtrC8(NULL,0),
+            KSenSoapEnvelopeHeaderName);
+    }
+
+
+TInt CWSStarPassportHeaderInbound::SetMessageContext(MSenMessageContext& aCtx)
+    {
+    iMessageContext = &aCtx;
+    return KErrNone;
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarsecurityhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,326 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <xmlsecwinit.h>
+#include <xmlsecwsign.h>
+#include "sencryptoutils.h"
+#include "sendebug.h"
+#include "SenSoapMessage.h"
+#include "SenParser.h"
+#include "wsstarsecurityhandler.h"
+#include "wsstarcons.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarmessagehandlerscons.h"
+#include "senlogger.h" // private Utils\inc
+#include "wsstarmessageutils.h"
+using namespace WSStarSecurityFault;
+
+//_LIT8(KSecurityIdPrefix, "SEC_");
+_LIT8(KSecurityPrefix, "ds");
+
+// Create instance of concrete ECOM interface implementation
+CWSStarSecurityHandler* CWSStarSecurityHandler::NewL(
+        MSenHandlerContext* aHandlerCtx)
+    {
+    
+    CWSStarSecurityHandler* self =
+            new (ELeave) CWSStarSecurityHandler(*aHandlerCtx);
+    return self;
+    }
+
+// Constructor
+CWSStarSecurityHandler::CWSStarSecurityHandler(MSenHandlerContext& aCtx):
+        CSenMessageHandler(aCtx)
+    {
+    }
+
+// Destructor
+CWSStarSecurityHandler::~CWSStarSecurityHandler()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarSecurityHandler::~CWSStarSecurityHandler()")));
+    }
+
+TInt CWSStarSecurityHandler::InvokeL(MSenMessageContext& aCtx)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarSecurityHandler::InvokeL(MSenMessageContext& aCtx)")));
+
+    if (aCtx.Direction() == SenContext::EOutgoing)
+        {
+        const TDesC8* keyB64 = aCtx.GetDesC8L(WSStarContextKeys::KPOPBase64);        
+        const TDesC8* keyType = aCtx.GetDesC8L(WSStarContextKeys::KBinaryType);
+        if (!keyB64)
+            {
+            return KErrNone;
+            }
+        HBufC8* key = SenCryptoUtils::DecodeBase64L(*keyB64);
+        if (!key)
+            {
+            return KErrArgument;
+            }
+        CleanupStack::PushL(key);
+
+        RArrayElements elements;
+        CleanupClosePushL(elements);
+        
+        CSenDomFragmentBase* base = GetElementsToSignL(aCtx, &elements);
+        if (!base)
+            {
+            CleanupStack::PopAndDestroy(2, key);
+            return KErrNone;
+            }
+        CleanupStack::PushL(base);
+        
+        base->AsDocumentL().RegisterXmlIdL(KSecurityUtilityId, KSecurityUtilityXmlNs);
+        
+        if (elements.Count())
+            {
+            XmlSecPushL();
+            //TUint id = 0;
+            for (TInt i = 0; i < elements.Count(); i++)
+                {
+                TXmlEngElement& el = elements[i];
+                TXmlEngNamespace ns = el.LookupNamespaceByPrefixL(KSecurityUtilityXmlNsPrefix);
+                if (ns.IsUndefined())
+                    {
+                        ns = el.AddNamespaceDeclarationL(KSecurityUtilityXmlNs, 
+                                                            KSecurityUtilityXmlNsPrefix);    
+                    }
+                else if (ns.Uri() != KSecurityUtilityXmlNs)
+                    {
+                    User::Leave(KErrCorrupt);
+                    }
+                    
+                 //!!!atention, current id value is absed upn tag name. Below commented code 
+                 //generate more uniq name (similar to sequencer)
+                //while (!el.HasAttributeL(KSecurityUtilityId, KSecurityUtilityXmlNs))
+                    {
+                    //TBuf8<12> idStr = KSecurityIdPrefix();
+                    //idStr.AppendNumFixedWidth(++id, EHex, 8);
+                    //el.AddXmlIdL(KSecurityUtilityId, idStr, ns);
+                    el.AddXmlIdL(KSecurityUtilityId, elements[i].Name(), ns);
+                    }
+                }
+            
+            CXmlSecSign* sign = CXmlSecSign::NewLC();
+            TXmlEngElement signature;
+            if (!keyType || //only 4 possible case null, nonce, asymmetric, symmetric.
+                (keyType && 
+                *keyType == WSStarContextValues::KPOPTypeAsimmetric))
+                {
+                TLSLOG(KSenFaultsLogChannel, KSenFaultsLogLevel, KUnsupportedAlgorithm);  
+                CleanupStack::PopAndDestroy(sign); 
+                XmlSecPopAndDestroy();
+                CleanupStack::PopAndDestroy(base); 
+                CleanupStack::PopAndDestroy(); //elements, it is R class
+                CleanupStack::PopAndDestroy(key); 
+                return KErrNone;
+                }
+            else //if nonce , then key is computed and also is simettric
+                {
+                sign->CreateTemplateL(CXmlSecSign::EHMAC, 
+                                        elements, 
+                                        KSecurityUtilityWsuId,
+                                        EFalse,
+                                        CXmlSecSign::KExclusiveC14N,
+                                        KSecurityPrefix,
+                                        EFalse
+                                        );
+                sign->SetKeyFromBufferL(*key, KNullDesC8, CXmlSecSign::EHMAC);
+                //const TDesC8* str = aCtx.GetDesC8L(WSStarContextKeys::KSTR);
+                _LIT8(KSTRstr,"<wsse:SecurityTokenReference \
+xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/\
+oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<wsse:Reference wsse:URI=\"token\" />\
+</wsse:SecurityTokenReference>");
+                const TDesC8* str = &KSTRstr();
+                if (str)
+                    {
+                    CSenDomFragmentBase* strFr = CSenDomFragmentBase::NewL();
+                    CleanupStack::PushL(strFr);
+                    CSenParser* parser = CSenParser::NewLC();
+                    parser->ParseL(*str, *strFr); 
+                    sign->SetKeyInfoL(strFr->AsElementL().CopyL());
+                    CleanupStack::PopAndDestroy(2, strFr);
+                    }
+                signature = sign->SignXmlNodesL(elements);
+                }
+        
+            HBufC8* messageXml = base->AsXmlL();
+            CleanupStack::PushL(messageXml);
+            
+            CSenSoapMessage* message=NULL;
+            CSenSoapMessage* msg = 
+                (CSenSoapMessage*)aCtx.GetSenSoapEnvelopeL(
+                                            SenContext::KSenCurrentSoapMessageCtxKey);
+            if(msg->SoapVersion() == ESOAP12)
+            {
+                message = CSenSoapMessage::NewL( ESOAP12, KSecurityXmlNs);
+            }
+            else
+            {
+                message = CSenSoapMessage::NewL(ESOAP11, KSecuritySchemeXmlNs );
+            }
+            CleanupStack::PushL(message);
+            CSenXmlReader& reader =   const_cast<CSenXmlReader&>(*aCtx.GetParser());
+
+            message->ParseWithL( reader );
+            message->ParseL(*messageXml);
+            aCtx.Update(SenContext::KSenCurrentSoapMessageCtxKey, message);
+            CleanupStack::Pop(message);
+            AttachElementL(aCtx, signature);
+            CleanupStack::PopAndDestroy(2, sign);//messagexml, sign
+            
+            
+            XmlSecPopAndDestroy();
+            }
+
+        CleanupStack::PopAndDestroy(3, key);//base, elements, key
+        }
+       return KErrNone;
+    }
+
+    
+SenHandler::THandlerDirection CWSStarSecurityHandler::Direction() const
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarSecurityHandler::Direction()")));
+        return SenHandler::EBoth;
+    };
+SenHandler::THandlerPhase CWSStarSecurityHandler::Phase()
+    {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarSecurityHandler::Phase()")));
+        return SenHandler::EMessage;
+    };    
+TInt CWSStarSecurityHandler::InitL(MSenHandlerContext& /*aCtx*/)
+    {
+    return KErrNone;
+    }
+    
+    
+RFileLogger* CWSStarSecurityHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+    
+//------------------------------------------------------------------------------
+// Add signature element to security header
+//------------------------------------------------------------------------------
+//
+void CWSStarSecurityHandler::AttachElementL(MSenMessageContext& aCtx,
+        TXmlEngElement& aSignature)
+    {
+    CSenSoapMessage* message = (CSenSoapMessage*)
+            (aCtx.GetSenSoapEnvelopeL(
+            SenContext::KSenCurrentSoapMessageCtxKey));
+    RBuf8 buffer;
+    aSignature.OuterXmlL(buffer);
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(_L("Siganture from buffer")));
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(buffer));
+    message->AddSecurityTokenL(buffer);
+    buffer.Close();
+    }
+    
+//------------------------------------------------------------------------------
+// Returns collection of elements which has to be signed. Depenend on policy 
+// which determine what to sign
+//------------------------------------------------------------------------------
+//
+
+CSenDomFragmentBase* CWSStarSecurityHandler::GetElementsToSignL( MSenMessageContext& aCtx, RArrayElements* aElements )
+    {
+    CSenSoapMessage* msg = (CSenSoapMessage*)aCtx.GetSenSoapEnvelopeL(
+            SenContext::KSenCurrentSoapMessageCtxKey);
+    if (!msg)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("There is no message in message context")));
+        return NULL;
+        }
+    
+    CSenDomFragmentBase* base = CSenDomFragmentBase::NewL();
+    CleanupStack::PushL(base);
+
+    HBufC8* xmlMsg = msg->AsXmlL();
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(_L("____parse message in order to find elements____")));
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*xmlMsg));
+    
+    CleanupStack::PushL(xmlMsg);
+    
+    
+    CSenParser* parser = CSenParser::NewLC();
+    parser->ParseL(*xmlMsg, *base); 
+    CleanupStack::PopAndDestroy(2, xmlMsg);//parser, xmlMsg
+    
+    TXmlEngElement parent = base->AsElementL();
+    
+       
+    TPtrC8 verDes = KSenSoapEnvelopeXmlns();
+    const TInt* ver = aCtx.GetIntL(WSStarContextKeys::KSoapVersion);
+    if (!ver || (*ver != ESOAP11))
+        {
+        verDes.Set(KSenSoap12EnvelopeXmlns());
+        }
+        
+    //determine using global policy        
+    RPointerArray<HBufC8>* pTags = (RPointerArray<HBufC8>*)aCtx.GetAnyL(WSStarContextKeys::KSignedPartsArray);
+    
+    if( pTags )
+        {
+        TInt count(pTags->Count());
+        for (TInt i = 0; i<count; i+=2 )
+            {
+            TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMaxLogLevel, "____looking for elements____" );
+            HBufC8* tagg = (*pTags)[i];
+            HBufC8* taggNs = (*pTags)[i+1];
+            TPtrC8 name = tagg->Des();
+            TPtrC8 pNs = taggNs->Des();
+            TLSLOG( KSenCoreServiceManagerLogChannelBase, KMaxLogLevel, ( *((*pTags)[i]) ) );
+            TLSLOG( KSenCoreServiceManagerLogChannelBase, KMaxLogLevel, ( *((*pTags)[i+1]) ) );
+            if ( pNs == KNullDesC8() ) // assumption is that this is some soap namespace (like Body)
+                {
+                pNs.Set( verDes );
+                }
+            CWSStarMessageUtils::FindElementL( name, pNs, parent, aElements );    
+            }
+        }
+#ifdef _SENDEBUG        
+    else // pTags == NULL
+        {
+        TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "CWSStarSecurityHandler::GetElementsToSignL(MSenMessageContext):" );
+        TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "- aCtx.GetAnyL(WSStarContextKeys::KSignedPartsArray) returned NULL(!)" );
+        }
+#endif // _SENDEBUG        
+    CleanupStack::Pop( base );
+    return base;
+    }
+
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/data/101f9717.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 9717 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource definitions for project WSStarPlugin
+*
+*/
+
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9717;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96F9;
+            implementations = 
+                {
+                // frameworkID = "WS-STAR"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9718;
+                    version_no         = 1;
+                    display_name       = "WSStarPlugin SIF";
+                    default_data       = "com.nokia.ws.wsstar.WSStarFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            },
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Session Handler Interface)
+            interface_uid = 0x20000392;
+            implementations = 
+                {
+                // Validate Handler "http://schemas.xmlsoap.org/ws/2005/02/trust/ws-trust.xsd";
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F9719;
+                version_no         = 1;
+                display_name       = "WSStarHandlerValidatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.validate:1.0";
+                opaque_data        = "";
+                },
+                // register Handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F971A;
+                version_no         = 1;
+                display_name       = "WSStarHandlerRegisterPlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.register:1.0";
+                opaque_data        = "";
+                },
+                // Service Update handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F971B;
+                version_no         = 1;
+                display_name       = "WSStarHandlerServiceUpdatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.serviceUpdate:1.0";
+                opaque_data        = "";
+                },
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9796;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Policy";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.policy:1.0";
+                    opaque_data        = "";
+                    }                                
+                };
+            }
+        };
+    }
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/data/101f9717_vtcp.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 9717 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Resource definitions for project WSStarPlugin
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9717;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F96F9;
+            implementations = 
+                {
+                // frameworkID = "WS-STAR"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9718;
+                    version_no         = 1;
+                    display_name       = "WSStarPlugin SIF";
+                    default_data       = "com.nokia.ws.wsstar.WSStarFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            },
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Session Handler Interface)
+            interface_uid = 0x20000392;
+            implementations = 
+                {
+                // Validate Handler "http://schemas.xmlsoap.org/ws/2005/02/trust/ws-trust.xsd";
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F9719;
+                version_no         = 1;
+                display_name       = "WSStarHandlerValidatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.validate:1.0";
+                opaque_data        = "";
+                },
+                // register Handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F971A;
+                version_no         = 1;
+                display_name       = "WSStarHandlerRegisterPlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.register:1.0";
+                opaque_data        = "";
+                },
+                // Service Update handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F971B;
+                version_no         = 1;
+                display_name       = "WSStarHandlerServiceUpdatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.serviceUpdate:1.0";
+                opaque_data        = "";
+                },
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9796;
+                    version_no         = 1;
+                    display_name       = "WSStar Message Handler - Policy";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.policy:1.0";
+                    opaque_data        = "";
+                    },                                
+               IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9798;
+                    version_no         = 1;
+                    display_name       = "WSStarHandlercobrandingPlugin";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.cobranding:1.0";
+                    opaque_data        = "";
+                    }                                                          
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/data/10282c49.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 9717 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource definitions for project WSStarPlugin
+*
+*/
+
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10282C49;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9730;
+            implementations = 
+                {
+                // frameworkID = "WS-STAR"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C50;
+                    version_no         = 1;
+                    display_name       = "WSStarPlugin SIF";
+                    default_data       = "com.nokia.ws.wsstar.WSStarFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            },
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Session Handler Interface)
+            interface_uid = 0x10282C5B;
+            implementations = 
+                {
+                // Validate Handler "http://schemas.xmlsoap.org/ws/2005/02/trust/ws-trust.xsd";
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x10282C51;
+                version_no         = 1;
+                display_name       = "WSStarHandlerValidatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.validate:1.0";
+                opaque_data        = "";
+                },
+                // register Handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x10282C52;
+                version_no         = 1;
+                display_name       = "WSStarHandlerRegisterPlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.register:1.0";
+                opaque_data        = "";
+                },
+                // Service Update handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x10282C53;
+                version_no         = 1;
+                display_name       = "WSStarHandlerServiceUpdatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.serviceUpdate:1.0";
+                opaque_data        = "";
+                },
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C54;
+                    version_no         = 1;
+                    display_name       = "WSStarHandlerPolicyPlugin";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.policy:1.0";
+                    opaque_data        = "";
+                    }                                
+                };
+            }
+        };
+    }
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/data/10282c49_vtcp.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 9717 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Resource definitions for project WSStarPlugin
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#include <ecom/RegistryInfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x10282C49;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x101F9730;
+            implementations = 
+                {
+                // frameworkID = "WS-STAR"
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C50;
+                    version_no         = 1;
+                    display_name       = "WSStarPlugin SIF";
+                    default_data       = "com.nokia.ws.wsstar.WSStarFramework";
+                    opaque_data        = "";
+                    }
+                
+                };
+            },
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Session Handler Interface)
+            interface_uid = 0x10282C5B;
+            implementations = 
+                {
+                // Validate Handler "http://schemas.xmlsoap.org/ws/2005/02/trust/ws-trust.xsd";
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x10282C51;
+                version_no         = 1;
+                display_name       = "WSStarHandlerValidatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.validate:1.0";
+                opaque_data        = "";
+                },
+                // register Handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x10282C52;
+                version_no         = 1;
+                display_name       = "WSStarHandlerRegisterPlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.register:1.0";
+                opaque_data        = "";
+                },
+                // Service Update handler
+                IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x10282C53;
+                version_no         = 1;
+                display_name       = "WSStarHandlerServiceUpdatePlugin";
+                default_data       = "urn:com.nokia.ws.wsstar.handler.serviceUpdate:1.0";
+                opaque_data        = "";
+                },
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C54;
+                    version_no         = 1;
+                    display_name       = "WSStarHandlerPolicyPlugin";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.policy:1.0";
+                    opaque_data        = "";
+                    },  
+               IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282C6D;
+                    version_no         = 1;
+                    display_name       = "WSStarHandlercobrandingPlugin";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.cobranding:1.0";
+                    opaque_data        = "";
+	                  }                                
+                };
+	           }
+        };
+    }
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsstarplugin   
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsstarplugin.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsstarplugin.iby)
+PRJ_MMPFILES
+wsstarplugin.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/group/wsstarplugin.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       Project specification file for wsstarplugin    
+*
+*/
+
+
+
+
+
+
+
+
+#include <data_caging_paths.hrh> 
+
+#include "../../../inc/webservices.hrh"
+
+//MACRO _DISABLE_DICTIONARY_FETCHING
+//#if !defined( _DISABLE_DICTIONARY_FETCHING )
+//	#define _DISABLE_DICTIONARY_FETCHING 1
+//#endif    
+#ifdef RD_SEN_WS_STAR__WBXML
+	EPOCALLOWDLLDATA 
+#endif
+
+// ECOM DLL recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET WSStarPlugin.dll
+UID 0x10009D8D 0x101F9717
+#else
+TARGET wswsstarplugin.dll
+UID 0x10009D8D 0x10282C49
+#endif
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    TARGETTYPE PLUGIN
+#else
+    TARGETTYPE ECOMIIC
+#endif
+
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_ECOM_PLUGIN )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_ECOM_PLUGIN
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE            wsstarproxy.cpp
+SOURCE            wsstarplugin.cpp
+SOURCE            wsstarservicesession.cpp
+SOURCE            wsstarsessionconsumer.cpp
+SOURCE            wsstarhandlercontext.cpp
+SOURCE            wsstarsessioncontext.cpp
+SOURCE            wsstarmessagecontext.cpp
+SOURCE            wsstarcredentialobserver.cpp
+//handler Validate
+SOURCE            wsstarvalidatehandler.cpp
+SOURCE            wsstartrustclient.cpp
+SOURCE            wsstarrstresponse.cpp
+
+//handler Register
+SOURCE            wsstarregisterhandler.cpp
+
+//handler ServiceUpdate
+SOURCE            wsstarserviceupdatehandler.cpp
+
+//Policy handler
+SOURCE						wsstarhttpclient.cpp
+SOURCE						wsstarpolicyhandler.cpp
+SOURCE            wsstarpolicy.cpp
+SOURCE						wsstarpolicymanager.cpp
+SOURCE						wsstarpolicyrequest.cpp
+
+//VTCP handler // wsstarvtcphandler plugin is moved from wsstarplugin to vtcptransportplugin
+//#ifdef RD_SEN_VTCP_SUPPORT
+//SOURCE            WSStarVtcpHandler.cpp 
+//#endif
+//dictionary providers
+SOURCE 						wsstardictionary.cpp
+#ifdef RD_SEN_VTCP_SUPPORT
+SOURCE 						wsstarcobrandinghandler.cpp
+SOURCE 						wsstarcobrandingclient.cpp
+#endif//RD_SEN_VTCP_SUPPORT
+
+
+#ifdef RD_SEN_WS_STAR__WBXML 
+    SOURCEPATH      ../msrc
+    SOURCE            SAXAttributes.cpp
+    SOURCE            SAXConfigContentHandler.cpp
+    SOURCE            SAXMsgContentHandler.cpp
+    SOURCE            SAXStringContentHandler.cpp
+    SOURCE            WBXMLCompressor.cpp
+    SOURCE            WBXMLToken.cpp
+    SOURCE            StringBuilder.cpp
+    SOURCE            WBXMLPlugin.cpp
+#endif 
+
+
+#ifdef RD_SEN_WS_STAR__WBXML
+
+	SOURCEPATH      ../mdata
+	
+	#ifndef RD_SEN_VTCP_SUPPORT
+		START RESOURCE    101F9717.RSS
+	#else
+		START RESOURCE    101F9717_vtcp.RSS
+	#endif //RD_SEN_VTCP_SUPPORT
+	
+#else
+
+	SOURCEPATH      ../data
+	
+	#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+	
+		#ifndef RD_SEN_VTCP_SUPPORT
+			START RESOURCE    101F9717.RSS
+		#else
+			START RESOURCE    101f9717_vtcp.rss
+		#endif //RD_SEN_VTCP_SUPPORT
+		
+		#ifdef SYMBIAN_SECURE_ECOM 
+   			TARGET WSStarPlugin.rsc
+		#endif //SYMBIAN_SECURE_ECOM
+		
+	#else
+	
+		#ifndef RD_SEN_VTCP_SUPPORT
+			START RESOURCE    10282C49.RSS
+		#else
+			START RESOURCE    10282C49_vtcp.RSS
+		#endif //RD_SEN_VTCP_SUPPORT
+		
+		#ifdef SYMBIAN_SECURE_ECOM 
+   		TARGET wswsstarplugin.rsc
+		#endif //SYMBIAN_SECURE_ECOM
+		
+	#endif //RD_SEN_COMPILE_SIS_PACKAGE_FILES
+	
+#endif //RD_SEN_WS_STAR__WBXML
+
+
+
+END
+
+USERINCLUDE      ../inc
+USERINCLUDE     ../../../wsfragment/inc
+USERINCLUDE     ../../../wsframework/inc
+USERINCLUDE     ../../../wsmessages/inc
+USERINCLUDE     ../../../wsidentitymanager/inc
+USERINCLUDE     ../../../wscredentialmanager/inc
+USERINCLUDE    ../../../wsdescription/inc
+USERINCLUDE    ../../../wsutils/inc
+USERINCLUDE    ../../../wslogger/inc
+USERINCLUDE    ../../../wscore/inc
+USERINCLUDE    ../../wsstarpolicy/inc
+
+//for validate plugin
+USERINCLUDE    ../../../wsxml/inc
+
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../../inc
+
+
+#ifdef RD_SEN_WS_STAR__WBXML 
+    USERINCLUDE        ../minc
+#endif 
+
+SYSTEMINCLUDE   /epoc32/include/xml
+SYSTEMINCLUDE   /epoc32/include/libc
+
+// System libs
+LIBRARY bafl.lib
+LIBRARY charconv.lib
+LIBRARY ecom.lib
+LIBRARY efsrv.lib       //for saving dictionaries
+LIBRARY euser.lib 
+LIBRARY estor.lib 
+LIBRARY ezlib.lib
+LIBRARY flogger.lib
+LIBRARY sysutil.lib
+
+
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+LIBRARY SenLogger.lib // for TLS based logging
+LIBRARY SenFragment.lib
+LIBRARY SenMessages.lib
+LIBRARY SenXml.lib
+LIBRARY SenUtils.lib
+LIBRARY SenServDesc.lib
+LIBRARY SenServMgr.lib
+LIBRARY SenServConn.lib
+LIBRARY SenFramework.lib
+LIBRARY WsPolicy.lib
+LIBRARY SenCredentialManager.lib
+#else
+LIBRARY wsLogger.lib // for TLS based logging
+LIBRARY wsFragment.lib
+LIBRARY wsMessages.lib
+LIBRARY wsXml.lib
+LIBRARY wsUtils.lib
+LIBRARY wsServDesc.lib
+LIBRARY wsServMgr.lib
+LIBRARY wsServConn.lib
+LIBRARY wsFramework.lib
+LIBRARY wsstarpolicy.lib
+LIBRARY wsCredentialManager.lib
+#endif
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib        // needed for XOP serializing
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib  // needed for XOP serializing
+#endif
+
+
+#ifdef RD_SEN_WS_STAR__WBXML 
+    LIBRARY xmlframework.lib
+    LIBRARY apparc.lib
+    LIBRARY cone.lib
+    LIBRARY eikcore.lib
+    LIBRARY avkon.lib
+    LIBRARY commonengine.lib
+    LIBRARY estlib.lib
+#endif 
+
+SMPSAFE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarcobrandingclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#ifndef CO_BRANDING_CLIENT_H
+#define CO_BRANDING_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include <e32math.h>
+
+#include "wsstarsessionvalidator.h"
+#include "seninternalserviceconsumer.h"
+#include "SenXmlElement.h"
+#include "sentransportbase.h"
+#include "wsstarhandlercontext.h"
+
+
+
+/**
+ * Class: CWSStarCoBrandingClient
+ *
+ * Description: Consumer which communicate with real STS.
+ * Client will try obtain credentail based on WS-Trust specification.
+ */
+class CWSStarCoBrandingClient : public CSenInternalServiceConsumer
+    {
+public: // Constructors and destructor
+
+    /**
+    * Standard 2 phase constructor
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client
+    */
+    static CWSStarCoBrandingClient* NewL(    CSIF& aSIF,
+                                                    RFileLogger& aLogger);
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client which is pushed into CleanupStack
+    */
+    static CWSStarCoBrandingClient* NewLC(CSIF& aSIF,
+                                                    RFileLogger& aLogger);
+
+    /**
+    * Normal destructor. Destroy STS session.
+    */
+    ~CWSStarCoBrandingClient();
+    
+    
+    void SetStatus(TInt aStatus);
+    /**
+    * Sets identyProvider for trust client
+    * @param aIdentityProvider identity provider representation of STS
+    */
+    void SetAccount(CSenIdentityProvider* aIdentityProvicer);
+    
+//-----derived from CSenWSDescription, 
+    //in fact we expose info from stssession which is holded by that client.
+    // Method have to overwrited becouse of core, which use those methods during registering
+    TPtrC8 Endpoint();
+    TPtrC8 Contract();
+    TPtrC8 ProviderID();
+    TPtrC8 FrameworkId();
+    MSenServicePolicy* ServicePolicy();
+    TInt IapId(TUint32& aCurrentIapId);
+    void WriteAsXMLToL(RWriteStream& aWriteStream);
+    
+    /**
+    * Getter for validate session (not STS session)
+    */
+    virtual CSenServiceSession* ServiceSession();
+    
+    /**
+    * Getter for transport (used coreManger as Factory for transport)
+    */
+    virtual MSenTransport& TransportL();
+    
+    /**
+    *   Sets STS session, used during registering STS which is not initiated. 
+    *   Clear STSsession will be created and assign during registering.
+    * @param aSession - clear sts session assign to this trust clint
+    */
+    void SetCoBrandingSessionL(CWSStarServiceSession* aSession);                    
+    
+    /**
+    *   Sets version (mode) for trust client. Old or new trust
+    * @param aVersion - old or new trust version 
+    *   _LIT8( KTrustNamespace200502, "http://schemas.xmlsoap.org/ws/2005/02/trust");
+    *   _LIT8( KTrustNamespace200404, "http://schemas.xmlsoap.org/ws/2004/04/trust");
+    *
+    */
+    void SetHandlerCtx(MSenHandlerContext* aHndCtx);
+    
+    //TBool HasSuperClass( TDescriptionClassType aType );
+
+    TInt FetchSCTL(CWSStarServiceSession& aSession,
+                   HBufC8*& aErrorMessage);
+        
+protected://methods
+    
+    /**
+    * C++ default constructor.
+    */
+    CWSStarCoBrandingClient(    CSIF& aSIF,
+                                    TDescriptionClassType aType,
+                                    RFileLogger& aLogger);
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void BaseConstructL();
+    virtual TBool Matches(MSenServiceDescription& aPattern);
+    
+
+private: //methods
+    //Co-Branding CR
+    CSenElement* CreateFSTL();
+    //Co-Branding CR
+    TInt AdaptCoBrandEndpointL(TBool aToOrginal = EFalse);
+    void AddAppInfoHeaderL();
+private: // Data
+    CWSStarServiceSession* iWSStarServiceSession;   // Not owned, session which we validate
+    CWSStarServiceSession* iCoBrandingSession;             //STS session, not owned
+    HBufC8* iCoBrandingOrginalEndpoint;             //STS session, owned
+    
+    CSenIdentityProvider* iIdentityProvider; // Not owned, comes from validation phase
+    RFileLogger& iLog;                      //not owned
+    
+    CSenTransportBase* ipTransport;//owned
+    MSenHandlerContext* iHndCtx; //not owned
+    TInt iTpCounter;    
+};
+
+#endif // CO_BRANDING_CLIENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarcobrandinghandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+//co-branding CR
+#ifndef WSSTAR_COBRANDING_HANDLER_H
+#define WSSTAR_COBRANDING_HANDLER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstartrustclient.h"
+#include "wsstarcons.h"
+#include "wsstarservicesession.h"
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarCoBrandingHandler : public CSenSessionHandler
+    {
+
+    public:
+
+
+       /**
+        * Function:    NewL
+        *
+        * Description: Create instance of concrete implementation. Note that ECOM
+        *              interface implementations can only have two signatures for
+        *              NewL:
+        *               - NewL without parameters (used here)
+        *               - NewL with TAny* pointer, which may provide some client
+        *                 data
+        *
+        * Returns:    Instance of this class.
+        *
+        * Note:       The interface, which is abstract base class of this
+        *             implementation, also provides NewL method. Normally abstract
+        *             classes do not provide NewL, because they cannot create
+        *             instances of themselves.
+        */
+        static CWSStarCoBrandingHandler* NewL(TAny* aHandlerCtx);
+
+        /**
+        * InvokeL is the most emergent method in message handler interface.
+        * Each sub-class must implement this method thus providing message
+        * processing routine.
+        * @param aCtx is the session context that will be accessed and 
+        * typically altered by implemented handler, in order to provide
+        * modifications on the layer of the session construction, validation,
+        * or some other, focused area that the handler was intended to take
+        * responsibility for. For example, certain handler can itself create
+        * a session of its own, send message(s) to (authentication) service
+        * (invoking other handlers), and finally access session context in 
+        * order to update credentials. One example of such session handler
+        * could be WS-TRUST client type handler, an "internal service consumer".
+        */
+        virtual TInt InvokeL(MSenSessionContext& aCtx);
+        
+        ~CWSStarCoBrandingHandler();
+        virtual SenHandler::THandlerDirection Direction() const;
+        virtual SenHandler::THandlerPhase Phase();
+        virtual TInt InitL(MSenHandlerContext& aCtx);
+        RFileLogger* Log() const;
+            
+        CSenIdentityProvider* IdentityProviderFromCoreL(const TDesC8& aProviderID);
+        CWSStarTrustClient* STSClientL(CSenIdentityProvider*& aIdentityProvider);
+        
+    protected:
+        /**
+         * Function:   CWSStarCoBrandingHandler
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarCoBrandingHandler(MSenHandlerContext& aCtx);
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        
+    private: // Data
+    };
+#endif // WSSTAR_COBRANDING_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarcons.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Keep all constanece within WSTar Plugin
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef CONSPLUGIN_H
+#define CONSPLUGIN_H
+
+#include "senpointermap.h"
+#include "SenXmlElement.h"
+
+typedef RSenPointerMap<TDesC8, TInt> RMapInt;
+typedef RSenPointerMap<TDesC8, TDesC8> RMapDescriptors;
+
+
+//global
+const TInt KSizeOfMD5        = 16;
+const TInt KBase64SizeOfMD5 = 24;//16 * 1,5
+
+
+
+namespace WSStarConfig
+    {
+    _LIT8(KFrameworkVersion,      "1.0");
+    _LIT8(KFrameworkXMLNS,        "urn:com.nokia.ws.wsstar.config.1.0");
+    _LIT8(KFrameworkCue,          "com.nokia.ws.wsstar.WSStarFramework");
+    _LIT8(KFrameworkLocalName,    "Framework");
+    _LIT8(KHandlerLocalName,      "Handler");
+    _LIT8(KNameAttr,              "name");
+    _LIT8(KDeviceIdLocalName,     "DeviceId");
+    
+    _LIT8(KClassAttr,              "class");
+    _LIT8(KVersionAttr,              "version");    
+    _LIT8(KEnveloperValue,              "urn:com.nokia.ws.wsstar.handler.enveloper:1.0");
+    _LIT8(KRegisterValue,              "urn:com.nokia.ws.wsstar.handler.register:1.0");
+    _LIT8(KServiceUpdateValue,              "urn:com.nokia.ws.wsstar.handler.serviceUpdate:1.0");
+    _LIT8(KCredentialCollectorValue,              "urn:com.nokia.ws.wsstar.handler.credentialCollector:1.0");    
+    _LIT8(KAddressingValue,              "urn:com.nokia.ws.wsstar.handler.addressing:1.0");    
+    _LIT8(KValidateValue,              "urn:com.nokia.ws.wsstar.handler.validate:1.0");    
+    _LIT8(KSecurityValue,              "urn:com.nokia.ws.wsstar.handler.security:1.0");    
+    _LIT8(KPassportValue,              "urn:com.nokia.ws.wsstar.handler.passport:1.0"); 
+    _LIT8(KPolicyValue,                "urn:com.nokia.ws.wsstar.handler.policy:1.0");        
+    _LIT8(KCoBrandingValue,            "urn:com.nokia.ws.wsstar.handler.cobranding:1.0");//co-branding
+    }
+    
+namespace WSStarSession
+    {
+    
+    //FAULTS
+    _LIT8( KErrorLayer, "KErrorLayer");
+     enum TFaultLayer
+        {
+        EAddressing,
+        ETrust
+        };
+        
+        
+        
+    const TInt KSubmitStateOK                         = 1;
+    const TInt KSubmitStateInvalidCredentials        = 2;
+    const TInt KSubmitStateRevalidationAttempted    = 3;
+    
+    //in seconds
+    const TInt KMaxTimeForRetry    = 5;
+    const TInt KCounterMax    = 3;
+    const TInt KMaxHttpTimeOut   = 60;
+    
+    }
+namespace WSStarSessionConsumer
+    {
+    _LIT8(KFaultInvalidRelatesToTag, "Fault.WS-Addressing : InvalidMessageInformationHeader in wsa:RelatesTo Detail: Invalid value");
+    _LIT8(KFaultInvalidToTag, "Fault.WS-Addressing : InvalidMessageInformationHeader in wsa:To Detail: Invalid value");
+    }
+
+namespace WSStarContextKeys
+    {
+    //MESSAGE KEYS
+     //--keys for enveloper handler
+    _LIT8( KSoapVersion, "SOAPver");
+    _LIT8( KBody, "Body");
+    _LIT8( KBodyElement, "BodyElement");
+    
+    //--keys for enveloper handler
+    //passort is enabled only berween C and STS
+    _LIT8( KPassportEnabled, "PassportEnabled");
+    
+    //--keys for addressing handler
+    _LIT8( KAddressingVersion, "AddressingVer");
+    _LIT8( KTo, "To");
+    _LIT8( KMessageID, "MessageID");
+    _LIT8( KRelatesTo, "RelatesTo");
+    _LIT8( KAction, "Action");
+    _LIT8( KResponseAction, "ResponseAction");
+    _LIT8( KReplyTo, "ReplyTo");
+    _LIT8( KReplyToDeviceAddress, "ReplyToDeviceAddress");
+    _LIT8( KFrom, "From");
+    _LIT8( KFaultTo, "FaultTo");
+    _LIT8( KMwsNamespace, "MwsNamespace");
+      
+    
+    //--keys for credential handler
+    _LIT8( KSecurityToken, "SecurityToken");
+    _LIT8( KSecurityTokenBackup, "SecurityTokenBackup");
+    _LIT8( KMTIsReplacedBySCT, "MTIsReplacedBySCT");
+    _LIT8( KTimestampCreated, "Created");
+    _LIT8( KTimestampExpires, "Expires");
+    _LIT8( KPhoneTimeWhenMTResolved, "PhoneTimeWhenMTResolved");
+    
+    //--keys  for signing handler
+    _LIT8( KPOPBase64, "POPBase64");
+    _LIT8( KBinaryType, "BinaryType");
+    _LIT8( KSTR, "STR");
+    _LIT8( KSignedPartsArray, "SignedPartsArray");
+    
+   
+    _LIT8( KRetryAfter, "RetryAfter");
+    _LIT8( KTokenType, "TokenType");
+    //--keys  for passport handler
+    _LIT8( KRedirect, "Redirect");
+    _LIT8( KMainBrandID, "MainBrandID");
+    _LIT8( KBrandIDList, "BrandIDList");
+    _LIT8( KBrandIDEnabled,"BrandIDEnabled");
+    _LIT8( KAppInfo,"AppInfo" );
+    _LIT8( KApplication,"Application" );
+    _LIT8( KNsPApplication,"mws:Application" );
+    _LIT8( KApplicationName,"ApplicationName" );
+    _LIT8( KApplicationVendor,"ApplicationVendor" );
+    _LIT8( KApplicationVersion,"ApplicationVersion" );
+    _LIT8( KDeviceOptions,"DeviceOptions" );
+    _LIT8( KNsPDeviceOptions,"mws:DeviceOptions" );
+    _LIT8( KLocale,"Locale" );
+    _LIT8( KNsPLocale,"mws:Locale" );
+    _LIT8( KUserAgent,"UserAgent" );
+    _LIT8( KNsPUserAgent,"mws:UserAgent" );
+    _LIT8( KManufacturer,"Manufacturer" );
+    _LIT8( KNsPManufacturer,"mws:Manufacturer" );
+    _LIT8( KModel,"Model" );
+    _LIT8( KNsPModel,"mws:Model" );
+    _LIT8( KOS,"OS" );
+    _LIT8( KNsPOS,"mws:OS" );
+    _LIT8( KIMSI,"IMSI" );
+    _LIT8( KNsPIMSI,"mws:IMSI" );
+    _LIT8( KDeviceName,"DeviceName" );
+    _LIT8( KDeviceVersion,"DeviceVersion" );
+    _LIT8( KWAPGW,"WAPGW" );
+    _LIT8( KName,"Name" );
+    _LIT8( KNsPName,"mws:Name" );
+    _LIT8( KVendor,"Vendor" );
+    _LIT8( KNsPVendor,"mws:Vendor" );
+    _LIT8( KVersion,"Version" );
+    _LIT8( KNsPVersion,"mwsVersion" );
+    _LIT8( KAppInfoPresent,"AppInfoPresent" );
+    
+    //SESSION KEYS
+    //--keys for discovery phase
+    //-----register handler
+    _LIT8(KRegisterAction,       "action");
+    _LIT8(KServiceDescription,   "serviceDescription");
+    
+    //--keys for validation phase (handler)
+    _LIT8(KServiceSession,       "serviceSession");
+    _LIT8(KRemoteConsumer,       "RemoteConsumer");
+    _LIT8(KOnlySharing,       "OnlySharing");
+    
+    //--keys for faults
+    _LIT8(KReAuthNeeded, "ReAuthNeeded");
+	_LIT8(KReAuthNeededFromCredObserv, "ReAuthNeededFromCredObserv");
+    _LIT8(KErrMessage, "ErrorMessage");
+    
+    
+    //MARKERS
+    _LIT8( KAddressAttrMark, "mark_address");
+    _LIT8( KMultiReqTagMark, "mark_multiReq");
+    
+    //holder for shared inforamtiom.Keep handler version specific information
+    _LIT8( KAddressingNsHolder, "addressingNsHolder");
+    _LIT8( KAddressingEndpointTagHolder, "addressingEndpointHolder");
+        //holder for Policy
+    _LIT8( KWSStarPolicyHolder, "PolicyHolder");
+
+    _LIT8( KWSStarTranspProp, "TransportPropertiesForResend");
+    }
+
+namespace WSStarContextValues
+    {
+    _LIT8( KPOPTypeSimmetric, "simmetric");
+    _LIT8( KPOPTypeAsimmetric, "asimmetric");   
+    _LIT8( KPOPTypeNonce, "nonce");   
+    
+    //--values for discovery phase
+    //-----register handler
+    _LIT8(KActionRegister,       "register");
+    _LIT8(KActionUnregister,       "unregister");
+    }
+
+#endif // CONSPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarcredentialobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+#ifndef WSSTARCREDENTIALOBSERVER_H
+#define WSSTARCREDENTIALOBSERVER_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+#include "wsstarservicesession.h"
+
+class CWSStarCredentialObserver : public CTimer
+{
+public:
+	// Cancel and destroy
+	~CWSStarCredentialObserver();
+
+	// Two-phased constructor.
+	static CWSStarCredentialObserver* NewL(CWSStarServiceSession* aSession, RFileLogger* aLogger);
+
+	// Two-phased constructor.
+	static CWSStarCredentialObserver* NewLC(CWSStarServiceSession* aSession, RFileLogger* aLogger);
+	
+
+	void RunL();
+public: // New functions
+	// Function for making the initial request
+	void Start( const TTimeIntervalMicroSeconds& aDiff);//const TTime &aTime);
+	RFileLogger* Log() const;
+private:
+	// C++ constructor
+	CWSStarCredentialObserver(CWSStarServiceSession* aSession, RFileLogger* aLogger);
+	void StartCount();
+
+	// Second-phase constructor
+	void ConstructL();
+
+
+private:
+	TBool	iRunned;		// State of the active object
+         CWSStarServiceSession* iSession;//not owned
+         RFileLogger* iLogger; //not owned
+         TInt64 iRestTime;
+};
+
+#endif // WSSTARCREDENTIALOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstardicthttpclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef WSSTAR_DICT_HTTP_CLIENT_H
+#define WSSTAR_DICT_HTTP_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include <e32math.h>
+
+#include "WSStarServiceSession.h"
+#include "SenInternalServiceConsumer.h"
+#include "SenXmlElement.h"
+#include "SenTransportBase.h"
+/*
+// FORWARD DECLARATIONS
+
+/**
+ * Class: CWSStarPolicyHttpClient
+ *
+ * Description: Consumer which communicate with real STS.
+ * Client will try obtain credentail based on WS-Trust specification.
+ */
+class CWSStarDictHttpClient : public CSenInternalServiceConsumer
+//                           public MWSStarSessionValidator
+    {
+public: // Constructors and destructor
+
+    /**
+    * Standard 2 phase constructor
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client
+    */
+    static CWSStarDictHttpClient* NewL(CSIF& aSIF,
+                                        CSenWSDescription* aInitializer,
+                                        RFileLogger& aLogger);
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client which is pushed into CleanupStack
+    */
+    static CWSStarDictHttpClient* NewLC(CSIF& aSIF,
+                                          CSenWSDescription* aInitializer,
+                                                    RFileLogger& aLogger);
+
+    /**
+    * Normal destructor. 
+    */
+    ~CWSStarDictHttpClient();
+    
+    
+    /**
+    * The most siginificant method of this class. Gets the policy from URi via HTTPS
+    * @param aSession session which is validated
+    */
+    HBufC8* GetDictionaryL(CWSStarServiceSession& aSession,
+                        TDesC8& aRequest, TDesC8& aResponse);
+
+    
+
+    void SetStatus(TInt aStatus);
+    /**
+    * Sets identyProvider for trust client
+    * @param aIdentityProvider identity provider representation of STS
+    */
+    void SetAccount(CSenIdentityProvider* aIdentityProvicer);
+    
+//-----derived from CSenWSDescription, 
+    //in fact we expose info from stssession which is holded by that client.
+    // Method have to overwrited becouse of core, which use those methods during registering
+    TPtrC8 Endpoint();
+    TPtrC8 Contract();
+    TPtrC8 ProviderID();
+    void WriteAsXMLToL(RWriteStream& aWriteStream);
+    
+    /**
+    * Getter for validate session
+    */
+    virtual CSenServiceSession* ServiceSession();
+    
+    /**
+    * Getter for transport (taken from remote consumer of validated session)
+    */
+    virtual MSenTransport& TransportL();
+    
+    /**
+    *   Sets session, 
+    *   
+    * @param aSession - clear session assign
+    */
+    void SetClientSessionL(CWSStarServiceSession* aSession);                    
+    
+    void SetVersion(const TDesC8* aVersion);
+    
+    TBool HasSuperClass( TDescriptionClassType aType );
+    
+protected://methods
+    
+    /**
+    * C++ default constructor.
+    */
+    CWSStarDictHttpClient(    CSIF& aSIF,
+                                    TDescriptionClassType aType,
+                                    CSenWSDescription* aInitializer,
+                                    RFileLogger& aLogger);
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void BaseConstructL();
+    
+    
+
+    
+private: // Data
+    CWSStarServiceSession* iWSStarServiceSession;   // Not owned, session which we validate
+    CWSStarServiceSession* iSession;             //Policy session, owned
+    const TDesC8* iVersion;
+    CSenTransportBase* ipTransport;//owned
+    CSenWSDescription* iInitializer;
+    RFileLogger& iLog;                      //not owned
+    
+
+};
+
+#endif // WSSTAR_DICT_HTTP_CLIENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstardictionary.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,185 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_DICTIONARY_H
+#define WSSTAR_DICTIONARY_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarservicesession.h"
+
+#include "seninternalserviceconsumer.h"
+#include "SenXmlElement.h"
+#include "sentransportbase.h"
+
+
+class CWSStarDictHttpClient;
+class CZlibDictionary;
+class CDictXml;
+
+#if !defined( EKA2 ) && !defined( RD_SECURE_PRIV_DATA )
+    _LIT(KPrivateFolder,        "C:\\system\\data\\");
+#endif
+
+/**
+ * Class:       
+ *
+ */
+class CWSStarDictionary : public CBase
+    {
+
+    public:
+
+
+       /**
+        * Function:    NewL
+        *
+        * Description: Create instance of concrete implementation. Note that ECOM
+        * Returns:    Instance of this class.
+        */
+        static CWSStarDictionary* NewL(CSIF& aSIF, RFileLogger& aLogger);
+
+        /**
+        */
+        TInt InvokeL(MSenHandlerContext* iHndlrCtx, CSenWSDescription* aSD);
+        TInt LoadDictionariesL();
+//        TInt LoadDictionariesL(CSenElement*  aPolicy);
+  		void DataTrafficDetails( TSenDataTrafficDetails& aDetails); 		      
+        ~CWSStarDictionary();
+        RFileLogger* Log() const;
+            
+    protected:
+        /**
+         * Function:   CWSStarDictionary
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarDictionary(CSIF& aSIF, RFileLogger& aLogger);
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+
+    private:
+        void CreateZlibL(const TDesC8* name, CSenElement* aDict);
+        TInt GetHttpDictionaryL(const TDesC8& aEndpoint, MSenHandlerContext* iHndlrCtx);
+        void SaveFileL(const TDesC8& aUri, const TDesC8& aContents);
+        TInt SaveL(TFileName aFileName, const TDesC8& aContents);
+        TInt LoadDictionariesL(CSenElement*  aPolicy);
+        void LoadFileL(CZlibDictionary* aDict);
+        TInt SaveConfigurationL();
+        TBool IfDictionaryExist(CZlibDictionary* aDict);
+        void CreateMSZlibL(const TDesC8* name, CSenElement* aDict);
+        CZlibDictionary* Dictionary(const TDesC8& aName);
+        
+        TPtrC8 WriteToBufL(CBufBase& aBuf);
+        HBufC8* WriteAllAsXMlL();
+        TInt WriteL(RWriteStream& aWriteStream);
+        
+
+
+        RPointerArray<CZlibDictionary> iDictionaires;
+        CSIF* iSIF;
+        HBufC* iSavePath;
+        TUint32 iIapId;
+        RFileLogger& iLog;                      //not owned
+	    TSenDataTrafficDetails iDictDetails;    
+    };
+    
+class CZlibDictionary : public CBase
+{
+    public:
+    static CZlibDictionary* NewL( const TDesC8& aDictUri, 
+                                  const TDesC8* aDictName, 
+                                  const TDesC8* aDictType, 
+                                  const TDesC8* aDictCheckSum );
+                                
+     static CZlibDictionary* NewLC( const TDesC8& aDictUri, 
+                                    const TDesC8* aDictName, 
+                                    const TDesC8* aDictType, 
+                                    const TDesC8* aDictCheckSum );
+    
+    virtual ~CZlibDictionary();
+    
+    TBool  Verified();
+    TPtrC8  DictUri();
+    TPtrC8  DictName();
+    TPtrC8  DictType();
+    TPtrC8  DictContents();    
+    TUint32 DictCheckSum();
+    TPtrC8 DictCheckSumPtr();
+    
+    TInt ResetL(CZlibDictionary* aDict);
+    
+    TInt SetDictContentsL(const TDesC8& aDictContents);
+    TInt DeleteDictContents();
+    
+private:
+    TInt VerifyContentsL(const TDesC8& aDictContents);
+    CZlibDictionary();
+    void ConstructL( const TDesC8& aDictUri, 
+                     const TDesC8* aDictName, 
+                     const TDesC8* aDictType, 
+                     const TDesC8* aDictCheckSum );
+private:
+    
+    HBufC8* iDictUri; //uri to download
+    HBufC8* iDictName; //name or mws:Id tag
+    HBufC8* iDictType; //zlib or mws:type
+    HBufC8* iDictContents; //contents
+    HBufC8* iDictCheckSum; //provided checksum
+    TUint32 iChkSum; //chksum in integer form
+    
+    TBool iVerfied;
+}; 
+
+class CDictXml :public CSenDomFragment
+{
+public:    
+    static CDictXml* NewL();
+    static CDictXml* NewLC();
+    ~CDictXml();
+    
+    TInt ReadFileL(TFileName aPath);
+    CSenElement* XMLDocL();
+private:
+
+    CDictXml();
+    void ConstructL();
+    TInt count;
+    TBool iParsed;
+};   
+#endif // WSSTAR_DICTIONARY_H
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarhandlercontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_HANDLER_VALIDATE_CONTEXT_H
+#define WSSTAR_HANDLER_VALIDATE_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "msenhandlercontext.h"
+
+// CONSTANTS
+namespace HandlerContextKey
+    {
+    _LIT8(KSIF,         "SIF");
+    _LIT8(KLogger,      "Logger");
+    _LIT8(KVersion,     "version");
+    }
+
+// FORWARD DECLARATIONS
+class CWSStarPlugin;
+
+/**
+ * Class:       
+ */
+class CWSStarHandlerContext : public CBase, public MSenHandlerContext
+    {
+    public:
+        static CWSStarHandlerContext* NewL();
+        ~CWSStarHandlerContext();
+
+        //from HandlerContext    
+        virtual TInt Add(MSenCoreServiceManager& aValue);
+        virtual MSenCoreServiceManager* GetSenCoreServiceManager();
+            
+        //from MContext    
+        virtual SenContext::TContextType Type() const;        
+        virtual SenContext::TContextDirection Direction() const;
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) ;
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) ;
+        virtual TAny* GetAnyL(const TDesC8& aKey);		//codescannerwarnings
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Remove(const TDesC8& aKey);         
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset() ;
+        
+        inline virtual TInt SetDirection( SenContext::TContextDirection /* aDirection */ ) { return KErrNotSupported; } // not implemented
+
+            
+    protected:
+        /**
+         * Function:   CWSStarHandlerContext
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarHandlerContext();
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+            
+    private://data
+        MSenCoreServiceManager* iCoreServiceManager;
+        CWSStarPlugin* iWSStarPlugin;
+        RFileLogger* iLogger;
+        HBufC8* iVersion;//owned
+    };
+
+
+#endif // WSSTAR_HANDLER_VALIDATE_CONTEXT_H
+
+
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarhttpclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_HTTP_CLIENT_H
+#define WSSTAR_HTTP_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include <e32math.h>
+
+#include "wsstarservicesession.h"
+#include "seninternalserviceconsumer.h"
+#include "SenXmlElement.h"
+#include "sentransportbase.h"
+/*
+// FORWARD DECLARATIONS
+
+/**
+ * Class: CWSStarHttpClient
+ *
+ * Description: Consumer which communicate with real STS.
+ * Client will try obtain credentail based on WS-Trust specification.
+ */
+class CWSStarHttpClient : public CSenInternalServiceConsumer
+    {
+public: // Constructors and destructor
+
+    /**
+    * Standard 2 phase constructor
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client
+    */
+    static CWSStarHttpClient* NewL( CSIF& aSIF,
+                                          CSenWSDescription* aInitializer,
+                                          RFileLogger& aLogger );
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client which is pushed into CleanupStack
+    */
+    static CWSStarHttpClient* NewLC( CSIF& aSIF,
+                                           CSenWSDescription* aInitializer,
+                                           RFileLogger& aLogger );
+
+    /**
+    * Normal destructor. Destroy STS session.
+    */
+    ~CWSStarHttpClient();
+    
+    
+    /**
+    * The most siginificant method of this class. Gets the policy from URi via HTTPS
+    * @param aSession session which is validated
+    */
+    TInt GetHttpL( const TDesC8& aRequest, HBufC8*& apPolicyResponse, CSenWSDescription* apSD );
+
+    void SetStatus(TInt aStatus);
+    /**
+    * Sets identyProvider for trust client
+    * @param aIdentityProvider identity provider representation of STS
+    */
+    void SetAccount(CSenIdentityProvider* aIdentityProvicer);
+    
+//-----derived from CSenWSDescription, 
+    //in fact we expose info from stssession which is holded by that client.
+    // Method have to overwrited becouse of core, which use those methods during registering
+    TPtrC8 Endpoint();
+    TPtrC8 Contract();
+    TPtrC8 ProviderID();
+    void WriteAsXMLToL(RWriteStream& aWriteStream);
+    
+    /**
+    * Getter for validate session
+    */
+    virtual CSenServiceSession* ServiceSession();
+    
+    /**
+    * Getter for transport (taken from remote consumer of validated session)
+    */
+    virtual MSenTransport& TransportL();
+    
+    /**
+    *   Sets session, 
+    *   
+    * @param aSession - clear session assign
+    */
+    void SetClientSessionL(CWSStarServiceSession* aSession);                    
+    
+    void SetVersion(const TDesC8* aVersion);
+    
+    TBool HasSuperClass( TDescriptionClassType aType );
+    
+	virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; 			
+    void DataTrafficDetails( TSenDataTrafficDetails& aDetails); 		
+protected://methods
+    
+    /**
+    * C++ default constructor.
+    */
+    CWSStarHttpClient(    CSIF& aSIF,
+                                    TDescriptionClassType aType,
+                                    CSenWSDescription* aInitializer,
+                                    RFileLogger& aLogger);
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void BaseConstructL();
+    
+    
+
+    
+private: // Data
+    CWSStarServiceSession* iPolicySession;             //Policy session, owned
+    const TDesC8* iVersion;
+    CSenTransportBase* ipTransport;//owned
+    CSenWSDescription* iInitializer;
+   RFileLogger& iLog;                      //not owned
+    TSenDataTrafficDetails iHttpDetails;    
+
+};
+
+#endif // WSSTAR_POLICY_HTTP_CLIENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarmessagecontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_HANDLER_MESSAGE_CONTEXT_H
+#define WSSTAR_HANDLER_MESSAGE_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "msenmessagecontext.h"
+#include "wsstarcons.h"
+#include "MSenProperties.h"
+
+
+// FORWARD DECLARATIONS
+class CWSStarSessionContext;
+class CSenChunk;
+
+/**
+ * Class:       
+ */
+class CWSStarMessageContext : public CBase, public MSenMessageContext
+    {
+
+    public:
+        static CWSStarMessageContext* NewL(SenContext::TContextDirection aDirection, CSenXmlReader*& aParser);
+        static CWSStarMessageContext* NewLC(SenContext::TContextDirection aDirection, CSenXmlReader*& aParser);
+        static CWSStarMessageContext* NewLC(SenContext::TContextDirection aDirection,
+                CSenXmlReader*& aParser, CWSStarSessionContext& aSessionContext);
+        ~CWSStarMessageContext();
+
+
+        void SetOwnedEnvelope(TBool aOwned = ETrue) 
+            {
+            iOwnedEnvelope = aOwned;
+            }
+        
+        //From MessageContext
+        virtual CSenSoapMessage* GetCurrentSoapMessage();
+        virtual TPtrC8 GetMessageL();
+
+
+
+        //Implementation in these is in fact is equal to GetCurrentSoapMessae. 
+        //In current shape, message context keep only one CSenSoapMessage
+        virtual TInt Add(const TDesC8& aKey, CSenSoapEnvelope* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenSoapEnvelope* aValue);
+        virtual const CSenSoapEnvelope* GetSenSoapEnvelopeL(const TDesC8& aKey);
+            
+            
+        //From MContext    
+        virtual SenContext::TContextType Type() const;        
+        virtual SenContext::TContextDirection Direction() const;
+
+        //Desc handling methods do not take ownership. but create new object from passed value
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Remove(const TDesC8& aKey);
+
+        //Int handling methods do not take ownership. but create new object from passed value
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+
+
+        //Element handling methods - ownership is transfered
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) ;
+
+        //These are NOT supported:
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) ;
+        virtual TAny* GetAnyL(const TDesC8& aKey);	//codescannerwarnings
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset();
+        virtual MSenMessage* MessageL();	//codescannerwarnigs
+        virtual TInt SetMessage(MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual TInt SetProperties(MSenProperties* apOwnedTransportProperties, TBool aOwned = ETrue);
+        virtual MSenProperties* Properties();
+        virtual TInt Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual TInt Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
+        virtual MSenMessage* GetMessageL(const TDesC8& aKey);// codescannerwarnings
+        virtual CSenChunk* CWSStarMessageContext::ChunkL(); // codescannerwarnings
+        virtual TInt SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned = ETrue); // not implemented
+        virtual TInt SetDirection(SenContext::TContextDirection aDirection); // not implemented
+        
+        
+        
+
+
+    //new
+        /**
+         * Update message context from session context.
+         *  If resending occurs we need copy again already cached info.
+         *
+         * @since S60 4.0
+         */
+        void UpdateFromSessionContextL(CWSStarSessionContext& aSessionContext);
+
+    private:
+        void UpdateIntL(CWSStarSessionContext& aSessionContext, const TDesC8& aKey);
+        void UpdateDesC8L(CWSStarSessionContext& aSessionContext, const TDesC8& aKey);
+
+    protected:
+        /**
+         * Function:   CWSStarMessageContext
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarMessageContext(SenContext::TContextDirection aDirection, CSenXmlReader*& aParser);
+        
+        
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        void ConstructL(CWSStarSessionContext& aSessionContext);
+        
+    private:
+        SenContext::TContextDirection iDirection;
+        TBool iOwnedEnvelope;
+        CSenSoapEnvelope* iCurrentEnvelope; //depends on iOwnedEnvelope
+        TPtrC8            iCurrentEnvelopeTxt; //depends on iOwnedEnvelope
+        const CSenElement* iBody;                 //not owned, session Ctx own
+    	const CSenXmlReader* iParser;
+        RMapDescriptors iDescs;
+        RMapInt         iInts;
+        RPointerArray<HBufC8>*  ipSignedParts;           //not owned (both elements and array)
+    };
+
+
+#endif // WSSTAR_HANDLER_MESSAGE_CONTEXT_H
+
+
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarplugin.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_PLUGIN_H
+#define WSSTAR_PLUGIN_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+
+#include "senserviceinvocationframework.h" // internal Framework\inc
+
+#include "wsstarcons.h"
+#include "sensessionhandler.h"
+#include "senmessagehandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstarmessagecontext.h"
+#include "SenSoapMessage.h"
+#include "SenXmlConstants.h"    
+#include "SenSoapConstants.h"
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, TDesC8> RMapHandlers;
+/**
+ * WSStar Plugin framework.
+ * An implementation of the CSIF definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarPlugin : public CSIF
+    {
+    public:
+        /**
+         * Function:    NewL
+         *
+         * Description: Create instance of concrete implementation. Note that ECOM
+         *              interface implementations can only have two signatures for
+         *              NewL:
+         *               - NewL without parameters (used here)
+         *               - NewL with TAny* pointer, which may provide some client
+         *                 data
+         *
+         * @return    Instance of this class.
+         *
+         * Note:       The interface, which is abstract base class of this
+         *             implementation, also provides NewL method. Normally abstract
+         *             classes do not provide NewL, because they cannot create
+         *             instances of themselves.
+         * @since S60 4.0
+         */
+        static CWSStarPlugin* NewL(TAny* aManager);
+
+
+    public: 
+
+            
+        /**
+        * Methods implementing CSIF ECOM interface
+        * For convenience of components classes
+        * @since S60 4.0
+        */
+        //RFileLogger* Log() const;
+
+        /**
+         * Return a system wide unique string to identify this framework
+         *
+         * @return TDesC8 that uniquely identifies this framework.
+         * @since S60 4.0
+         */
+        virtual const TDesC8& Id();
+
+        /**
+         * Try to find one or more session services that match the given
+         * ServiceDescription.If not finded new session is created and added into
+         * coreManager
+         * Return the number of ServiceDescriptions that were added.
+         *
+         * @param   aPattern - A ServiceDescriptin that should be treated as a
+         *          pattern
+         * @param    aRemoteConsumer - the consumer sending the request
+         * @param    aErrorMsg - in case that return value is negative, this may contain
+         *           error as descriptor (SOAP Fault etc)
+         * @return (TInt) count of matching ServiceDescriptions that were added or error
+         * @since S60 4.0
+         */
+        virtual TInt AddServiceDescriptionL( MSenServiceDescription& aPattern, 
+                                             MSenRemoteServiceConsumer& aRemoteConsumer,
+                                             HBufC8*& aErrorMsg ); 
+
+        /**
+         * Attempt to register the ServiceDescription. 
+         *   In fact session is created but not vaidated and added into CoreManager.
+         *   So registering different to adding that it doesnt validate, just register.
+         *   Common issue is increase core database by one session (validated or not)
+         * @param aServiceDescription A ServiceDescription
+         *
+         * @return TInt aError - indicates the error or KErrNone if successful
+         * @since S60 4.0
+         */
+        virtual TInt RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription);
+
+
+        /**
+         * Attempt to unregister the ServiceDescription from the ServiceManager
+         * that owns the framework.
+         * This is a callback used by the ServiceManager.
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         * @return TInt aError - indicates the error or KErrNone if successful
+         * @since S60 4.0
+         */
+        virtual TInt UnregisterServiceDescriptionL(
+                                    MSenServiceDescription& aServiceDescription);
+
+        /**
+         * Create a ServiceSession based upon the given ServiceDescription.
+         * The ServiceSession is expected to be "valid", i.e. ready for use
+         * by a client.
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         * @param aNewSession (CSenServiceSession)
+         *
+         * @return TInt error or KErrNone if successful
+         * @since S60 4.0
+         */
+        virtual TInt CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                            MSenServiceDescription& aPattern,
+                                            CSenServiceSession*& aNewSession,
+                                            MSenRemoteServiceConsumer& aRemoteConsumer,
+                                            HBufC8*& /* aErrorMsg */ );
+
+        /**
+         * Return a new instance of a framework specific class that
+         * implements the ServiceDesccription interface.
+         *
+         * @param new service description 
+         *        (which typically derives from CSenServiceSession)
+         *
+         * @return TInt error or KErrNone if successful
+         * @since S60 4.0
+         */
+        virtual CSenWSDescription* NewServiceDescriptionL();
+
+        /**
+         * Return the ServiceManager for which this instance is working.
+         * This is used by the ServiceSession instances created by this framework.
+         *
+         * Note, in Sen, MSenCoreServiceManager IS SINGLETON(!), so all Frameworks
+         * return their "owner" - that is - the only service manager in
+         * Sen Framework
+         *
+         * @return (MSenCoreServiceManager)
+         * @since S60 4.0
+         */
+        virtual MSenCoreServiceManager& Manager();
+
+
+        /**
+         * Set the ServiceManager to which this instance reports.
+         * The (singleton) ServiceManager calls this method when
+         * it instantiates a framework.
+         *
+         * @param aServiceManager The singleton ServiceManager in the system.
+         * @since S60 4.0
+         */
+        virtual void SetManager(MSenCoreServiceManager& aServiceManager);
+
+
+        /**
+         * Return an object that can do SAX based parsing of a XML fragment
+         * that contains framework specific configuration information.
+         * The ServiceManager asks for this BaseFragment upon startup
+         * in order to give this framework a chance to read its configuration
+         * information from the central ServiceManager configuration document.
+         *
+         * @return (CSenBaseFragment)
+         * @since S60 4.0
+         */
+        virtual CSenBaseFragment& ConfigParser();
+
+        /**
+         * Read the ServiceInvocationFramework configuration.
+         * This method is invoked by the ServiceManager when it read config.
+         * @since S60 4.0
+         */
+        virtual void StartElementL(const TDesC8& aNsUri,
+                              const TDesC8& aLocalName,
+                              const TDesC8& aQName,
+                              const RAttributeArray& aAttrs);
+
+        /**
+         * Read the ServiceInvocationFramework configuration.
+         * This method is invoked by the ServiceManager when it read config.
+         * @since S60 4.0
+         */
+        virtual void EndElementL(const TDesC8& aNsUri,
+                              const TDesC8& aLocalName,
+                              const TDesC8& aQName);
+
+    //derived from SenBaseFragment
+        virtual HBufC8* AsXmlL();
+        virtual HBufC* AsXmlUnicodeL();
+
+    //derived from SIF
+        virtual TInt OnEvent(const TInt aEvent,
+                            TAny* /* aArgument */);
+        virtual TAny* ExtendedInterface();
+
+        virtual TInt SetTransportPropertiesL(MSenTransport& /* aTransport */);
+
+
+    //----------------------Outbound direction
+        /**
+        * Function:   temporary. Call in proper order session handlers during validation phase
+        * @return number of added descriptions into coreManager or error
+        * @since S60 4.0
+        */
+        TInt ProcessOutboundValidationL( MSenServiceDescription& aPattern, 
+                                         MSenRemoteServiceSession* aRemoteServiceSession,
+                                         HBufC8*& aErrorMessage );
+        /**
+        * Function:   temporary. Call in proper order message handlers during outbound message phase
+        * @return symbian error
+        * @since S60 4.0
+        */
+        TInt ProcessOutboundMessageL( CWSStarMessageContext*& aMsgCtx,
+                                      const TDesC8* aBody,
+                                      CSenSoapMessage*& aReadyMsg );
+
+    //----------------------Inbound direction    
+        /**
+        * Function:   temporary. Call in proper order message handlers during inbound message phase
+        * @return symbian error
+        * @since S60 4.0
+        */
+        TInt ProcessInboundMessageL( CWSStarMessageContext*& aMsgCtx,
+                                     CSenSoapMessage*& aMsg );
+
+        /**
+        * Function:   temporary. Call in proper order session handlers during inbound dispatch phase
+        * @return symbian error
+        * @since S60 4.0
+        */
+        TInt ProcessInboundDispatchL( MSenRemoteServiceSession* aRemoteServiceSession,
+                                      CSenSoapMessage*& aMsg );
+
+        //----------------------temporary methods 
+        //  (till moment when engine with handlers will be available)
+        
+        MSenHandler* Handler(const TDesC8& aCue);
+        TInt DeviceId(TPtrC8& aValue);
+        MSenHandler* PolicyHandler(); 
+        TInt PolicyConsumerAddedL(CSenServiceSession* aNewSession, MSenRemoteServiceConsumer& aRemoteConsumer);       
+        
+    public: // destructor
+        virtual ~CWSStarPlugin();
+
+    protected:
+        /**
+         * Function:   CSenWsiPlugin
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarPlugin(MSenCoreServiceManager& aManager);
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        
+    private:
+        void AddHandlerTag(TPtr8& aXml, const TDesC8& aHandlerClassName);
+        void AddHandlerL(const TDesC8& aHandlerClassName, const TDesC8& aVersion, SenHandler::THandlerType aType);
+        void RemoveHandler(const TDesC8& aCue);
+        void GenerateDeviceIdL();
+        TInt IssuePolicyDownloadL( CSenWSDescription* aSession );
+        void VerifyPermissionOnEachSessionL();
+                
+    private: // data
+        MSenCoreServiceManager& iManager;
+        //mesg handlers has to be separate to session handlers (separate table) becouse common handlerBase 
+        //  doesnt have name method
+        RPointerArray<CSenMessageHandler> iMsgHandlers;
+        RPointerArray<CSenSessionHandler> iSessionHandlers;
+        RSenPointerMap<TDesC8, TDesC8> iVersions;
+        RPointerArray<CWSStarHandlerContext> iHandlerContexts;
+        HBufC8* iDeviceId;
+        TBool iDbReadDone;
+        TInt iConsumerCount;
+    };
+
+
+#endif // WSSTAR_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarpolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+ 
+
+#ifndef WS_STAR_POLICY_H
+#define WS_STAR_POLICY_H
+
+// INCLUDES
+#include <e32std.h>
+#include "MSenServiceDescription.h"
+#include "wsstarservicesession.h"
+#include "MSenServicePolicy.h"
+// CONSTANTS
+namespace WSPolicy
+    {
+    // Common
+    
+    // Enveloper layer
+    _LIT8( KSoap12, "SOAP12");
+    
+    // Addressing layer
+    _LIT8( KAddressing, "Addressing");
+
+    // Trust layer
+    _LIT8( KClientEntropy , "ClientEntropy");
+    _LIT8( KTokenType,          "TokenType");
+    _LIT8( KPassportExtensions , "PassportExtensions");
+    // Way of authentication with STS
+    _LIT8( KUsernameTokenOverTLS , "UsernameTokenOverTLS");
+    _LIT8( KSAMLTokenTypeValue, "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1");
+    
+    // Serializer layer
+    _LIT8( KMTOM , "MTOM");
+    _LIT8( KCluster, "Cluster");
+    
+    _LIT8(KIssuedToken, "IssuedToken");
+    _LIT8( KRPSCluster, "RPSCluster");
+    _LIT8(KRequestSecurityTokenTemplate, "RequestSecurityTokenTemplate");
+    _LIT8(KAddress, "Address");
+    
+    _LIT8(KSignedParts, "SignedParts");
+    _LIT8(KName, "Name");
+    _LIT8(KDictionaries, "Dictionaries");
+    _LIT8(KDictionary, "Dictionary");
+    _LIT8(KMobileService, "MobileService");
+    _LIT8(KMwsType, "mws:Type");
+    _LIT8(KMwsId, "mws:Id");
+    _LIT8( KAppInfo,"AppInfo" );
+    _LIT8( KClientPolicy,"ClientPolicy" );
+    }
+
+
+/**
+ * Class:       
+ */
+class CWSStarPolicy : public CBase
+    {
+    public:
+        /*
+        static CWSStarPolicy* NewL();
+        static CWSStarPolicy* NewLC();
+        ~CWSStarPolicy();
+        void SetPolicy(CSenElement* aPolicy);
+        */
+
+        /**
+        *   static TBool CheckL(const TDesC8& aKey, MSenServiceDescription* aSD);
+        *   
+        *   This method can be used to find the Client policy elements.
+        *   it simply try to find an element in the policy and if the element is found
+        *   then return the ETrue else EFalse.
+        *   @param: aKey is the name of property/element 
+        *   @param: aSD, The ServiceDescription from which this element should be checked
+
+        *   @return TBool
+        */
+        static TBool CheckPolicyValueL(const TDesC8& aKey, MSenServiceDescription* aSD);
+
+            
+        /**
+        *   static HBufC8* GetValueL(const TDesC8& aKey, MSenServiceDescription* aSD);
+        *   
+        *   This method can be used to find the Client policy elements and their properties.
+        *   It simply try to find an element in the policy and if the element is found
+        *   then return the Element's contents.
+        *   
+        *   @param: aKey is the name of property/element 
+        *   @param: aSD, The ServiceDescription from which this element should be checked
+        *   
+        *   @return HBufC*: Ownership is transferred
+        */
+
+
+        static HBufC8* GetPolicyValueL(const TDesC8& aKey, MSenServiceDescription* aSD);
+        /**
+        *   static HBufC8* GetValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx);
+        *   
+        *   This method can be used to find the "Service Policy" assertions and their properties.
+        *   It simply try to find an element in the Policy and if the element is found
+        *   then return the Element's contents. If element has no contents then return the whole Element
+        *   excluding the element name 
+        *   
+        *   @param: aKey is the name of property/element 
+        *   @param: aSubKey is the name of property/element present in "aKey" Element
+        *   @param: aCtx, The Context of PolicyHanlder which owns the Policy
+        *   
+        *   @return HBufC*: Ownership is transferred
+        */    
+        static HBufC8* GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD);
+        static HBufC8* GetPolicyValueL(const TDesC8& aTokenType, const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD, RPointerArray<CSenElement>& aElements);
+        static HBufC8* GetPolicyValueL(const TDesC8& aTokenType, const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD);
+        static HBufC8* GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD, RPointerArray<CSenElement>& aElements);
+        static HBufC8* GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, CWSStarPlugin& aWSStarPlugin, MSenServiceDescription* aSD);
+        /**
+        *   static void GetValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, RArray<TPtrC8>& aList);
+        *   
+        *   This method can be used to find the "Service Policy" assertions and their properties.
+        *   It simply try to find an element in the Policy and if the element is found
+        *   then return the Element's contents in form of list
+        *   
+        *   @param: aKey is the name of property/element 
+        *   @param: aSubKey is the name of property/element present in "aKey" Element
+        *   @param: aCtx, The Context of PolicyHanlder which owns the Policy
+        *   @param: aList, The list of properties for which the Elements will be searched
+        *   one example of this method is to get the list of SignedElements/EncryptedElements  
+        */    
+
+
+        static void GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD, RPointerArray<HBufC8>& aList);
+        
+        
+        /**
+        *   static void GetValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, RArray<TPtrC8>& aList);
+        *   
+        *   This method can be used to find the "Service Policy" assertions and their properties.
+        *   It simply try to find an element in the Policy and if the element is found
+        *   then return the Element's contents in form of list
+        *   
+        *   @param: aKey is the name of property/element 
+        *   @param: aSubKey is the name of property/element present in "aKey" Element
+        *   @param: aPolicyHandler, PolicyHanlder which owns the Policy
+        *   @param: aList, The list of properties for which the Elements will be searched
+        *
+        *   one example of this method is to get the list of SignedElements/EncryptedElements  
+        *   Attetntion: in case (signed/encrypted elements) array is list of pairs [localname, namespace]
+        */    
+        
+        static void GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD, RPointerArray<HBufC8>& aList);
+        
+        
+        /**
+        *   static TPtrC8 GetAttributeValueL(const TDesC8& aAttribute, CSenElement* aElement);
+        *   
+        *   This method can be used to find the attribute value of an Attibute from any Elements
+        *   It simply try to find the attribute in an element and then return the value of the Attirbute
+        *   
+        *   @param: aAttribute is the name of property
+        *   @param: aElement is the element where the attribute will eb searched
+        *   
+        *   @return TPtrC8: return pointer to the Value of attribute
+        *                    KNullDesC8() if no value is found   
+        */    
+
+
+        static TPtrC8 GetAttributeValueL(const TDesC8& aAttribute, CSenElement* aElement);
+        /**
+        *   static TPtrC8 GetNSPrefixL(const TDesC8& aNamespaceUri, CSenElement* aElement);
+        *   
+        *   This method can be used to find the namespace prefix for a namespace URi from the element
+        *   
+        *   @param: aNamespaceUri is the nameSpace URI
+        *   @param: aElement is the element where the NsURI will be searched
+        *   
+        *   @return TPtrC8: return pointer to the Prefix of namespace URI
+        *                    KNullDesC8() if no value is found   
+        */    
+
+        static TPtrC8 GetNSPrefixL(const TDesC8& aNamespaceUri, CSenElement* aElement);
+        static CSenElement* SearchForElementL(CSenElement* aPolicy, TPtrC8 aKey);	//codescannerwarnings
+        static TInt SearchForElementsL(CSenElement* aPolicy, TPtrC8 aKey, RPointerArray<CSenElement>& aElements);
+        static CSenElement* GetElementL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD);
+        static void GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey,MSenServiceDescription* aSD,RPointerArray<CSenElement>& aElements);
+
+        
+    protected:
+        static TInt ChildCountL(CSenElement* aTerm);	//codescannerwarnings
+        
+        
+        static CSenElement* GetPolicyL(MSenHandlerContext& aCtx, MSenServiceDescription* aSD);	//codescannerwarnings
+
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        CWSStarPolicy() { }
+
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        CWSStarPolicy( const CWSStarPolicy& );
+
+        /**
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        CWSStarPolicy& operator=( const CWSStarPolicy& );
+        
+        static void GetValueL(const TDesC8& aKey, const TDesC8& aSubKey, CSenElement* aPolicy, RPointerArray<HBufC8>& aList);
+
+    };
+    
+    
+struct SoapHeader
+    {
+	TPtrC8 iName;
+	TPtrC8 iNsUri;
+	TPtrC8 iNsPrefix;
+    };
+
+class CEncryptedSignedPartsI : public CBase
+    {
+    public:
+        static CEncryptedSignedPartsI* NewL(CSenElement* aAssertion);
+        static CEncryptedSignedPartsI* NewLC(CSenElement*  aAssertion);
+        virtual ~CEncryptedSignedPartsI();
+
+        TBool IsEqualEncryptedSignedParts(CEncryptedSignedPartsI* aAssertion);
+        
+        void  ElementsL(RPointerArray<HBufC8>& aElements);	//codescannerwarnings
+        TBool Header();
+        TBool Body();
+    private:
+        void ConstructL(CSenElement*  aAssertion);
+        CEncryptedSignedPartsI(); 
+
+    private: // Data
+        TBool iHeader;
+        TBool iBody;
+        RArray<SoapHeader> iHeaders;  
+        
+    };
+#endif // WS_STAR_POLICY_H
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarpolicyhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_POLICY_HANDLER_H
+#define WSSTAR_POLICY_HANDLER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstartrustclient.h"
+#include "wsstarcons.h"
+#include "wsstarservicesession.h"
+#include "wspolicyregistry.h"
+
+class CWSStarDictionary;
+class CWSStarPolicyManager;
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarPolicyHandler : public CSenSessionHandler
+    {
+
+    public:
+
+
+       /**
+        * Function:    NewL
+        *
+        * Description: Create instance of concrete implementation. Note that ECOM
+        *              interface implementations can only have two signatures for
+        *              NewL:
+        *               - NewL without parameters (used here)
+        *               - NewL with TAny* pointer, which may provide some client
+        *                 data
+        *
+        * Returns:    Instance of this class.
+        *
+        * Note:       The interface, which is abstract base class of this
+        *             implementation, also provides NewL method. Normally abstract
+        *             classes do not provide NewL, because they cannot create
+        *             instances of themselves.
+        */
+        static CWSStarPolicyHandler* NewL(TAny* aHandlerCtx);
+
+        /**
+        * InvokeL is the most emergent method in message handler interface.
+        * Each sub-class must implement this method thus providing message
+        * processing routine.
+        * @param aCtx is the session context that will be accessed and 
+        * typically altered by implemented handler, in order to provide
+        * modifications on the layer of the session construction, validation,
+        * or some other, focused area that the handler was intended to take
+        * responsibility for. For example, certain handler can itself create
+        * a session of its own, send message(s) to (authentication) service
+        * (invoking other handlers), and finally access session context in 
+        * order to update credentials. One example of such session handler
+        * could be WS-TRUST client type handler, an "internal service consumer".
+        */
+        virtual TInt InvokeL(MSenSessionContext& aCtx);
+        
+        ~CWSStarPolicyHandler();
+        virtual SenHandler::THandlerDirection Direction() const;
+        virtual SenHandler::THandlerPhase Phase();
+        virtual TInt InitL(MSenHandlerContext& aCtx);
+        CSenElement* PolicyL(MSenServiceDescription* aSD);	//codescannerwarnings
+        CSenElement* PolicyL(const TDesC8& aUri);	//codescannerwarnings
+        TInt InvokeL(const TDesC8& aContract);
+        TInt DownloadPolicyL(CSenWSDescription* apArgument);
+        TInt UpdatePolicyL();
+        TInt UnRegisterWsPolicyL(MSenServiceDescription& aServiceDescription);        
+        TInt PolicyConsumerAddedL(CSenServiceSession* aNewSession, MSenRemoteServiceConsumer& aRemoteConsumer);
+        RFileLogger* Log() const;
+        void DataTrafficDetails(TSenDataTrafficDetails& aDetails); 		      
+            
+    protected:
+        /**
+         * Function:   CWSStarPolicyHandler
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarPolicyHandler(MSenHandlerContext& aCtx);
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+        
+    private: // Data
+        CWSStarPolicyManager* iPolicyManager;
+        
+    };
+#endif // WSSTAR_POLICY_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarpolicymanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_POLICY_MANAGER_H
+#define WSSTAR_POLICY_MANAGER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstartrustclient.h"
+#include "wsstarcons.h"
+#include "wsstarservicesession.h"
+#include "wspolicyregistry.h"
+#include "sendebug.h"
+#include "msenwspolicymanager.h"
+#include "senwspolicymanager.h"
+class CWSStarPolicyHandler;
+class CWSStarDictionary;
+class CPolicyRequest;
+class CPolicyReq;
+class CPolicyReqMap;
+class CSenWSPolicyManager;
+
+typedef RPointerArray<CPolicyReqMap> RPolicyRequestMap;
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarPolicyManager : public CBase, public MSenWsPolicyManager
+    {
+
+    public:
+
+        static CWSStarPolicyManager* NewL(TAny* aHandlerCtx);
+
+        TInt InvokeL(const TDesC8& aContract);
+        ~CWSStarPolicyManager();
+        CSenElement* PolicyL(MSenServiceDescription* aSD);	//codescannerwarnings
+        CSenElement* PolicyL(const TDesC8& aUri);	//codescannerwarnings
+        TInt DownloadPolicyL( CSenWSDescription* apSD );
+        TInt UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler);
+        TInt UnRegisterWsPolicyL(MSenServiceDescription& aServiceDescription, TInt& aErrorTo);
+        TInt PolicyConsumerAddedL(CSenServiceSession* aNewSession, MSenRemoteServiceConsumer& aRemoteConsumer);        
+        
+        RFileLogger* Log() const;
+		void DataTrafficDetails(TSenDataTrafficDetails& aDetails); 		      
+    private:
+        /**
+         * Function:   CWSStarPolicyManager
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarPolicyManager(MSenHandlerContext& aCtx);
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction
+         *
+         */
+        void ConstructL();
+        TInt GetHttpPolicyL( const TDesC8& aEndpoint, RExpiredPolicyArray& aRequestMap, CSenWSDescription* apSD );
+        TInt IsContractExist(const TDesC8& aContract);
+//new methods        
+        TInt RegisterWsPolicyL(const TDesC8& aContract);        
+        
+
+        virtual TInt AddWsPolicy1L(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo);
+
+        virtual TInt RemoveWsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo);
+                                                                                                                                                                                               
+        virtual TInt RegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+
+        virtual TInt UnRegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+                                                    
+        virtual CSenElement*  WsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo);
+
+        virtual CSenElement*  WsPolicy1L( CSenWSDescription* aPattern, 
+                                                TInt& aErrorTo);                    
+        
+        virtual CSenElement*  WsPolicy1L( const TDesC8& aProviderId, 
+                                            TInt& aErrorTo);
+
+        virtual TInt AddPolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId);
+
+        virtual TInt RemovePolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId);
+            
+        TInt GetPolicyFromFileL( RExpiredPolicyArray& aRequestMap );
+        
+    private:
+    
+        MSenHandlerContext& iSenHandlerContext; //Not owned
+        CPolicyRegistry* iRegistry;
+        CWSStarDictionary* iDictionary;
+        CSenWSPolicyManager* iPolicyManager;
+        RPointerArray<HBufC8> iContracts;
+        TSenDataTrafficDetails iPolicyDetails; 
+        
+    };
+
+#endif // WSSTAR_POLICY_MANAGER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarpolicyrequest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstartrustclient.h"
+#include "wsstarcons.h"
+#include "wspolicy.h"
+#include "wspolicyregistry.h"
+
+class CPolicyReq;
+
+class CPolicyRequest : public CBase
+{
+
+public:
+
+    static CPolicyRequest* NewL(const TDesC8& aContract);
+     static CPolicyRequest* NewLC(const TDesC8& aContract);
+    virtual ~CPolicyRequest();
+
+    TPtrC8  Contract();
+    CSenWSDescription* ServiceDescription();
+    CSenElement* PolicyL();	//codescannerwarnings
+    CSenElement* PolicyL(const TDesC8& aUri);	//codescannerwarnings
+    CSenElement* OriginalPolicyL(const TDesC8& aUri);	//codescannerwarnings
+    
+    TInt AddMetadataUriL(const TDesC8& aUri);
+    TInt AddMetadataUriL(const TDesC8& aUri, const TDesC8& aName);
+    TInt AddMetadataUriL(const TDesC8& aUri, const TDesC8& aName, const TDesC8& aContents );
+    
+    TInt SetContentsL(const TDesC8& aUri, const TDesC8& aContent);
+    TInt SetPolicyL(const TDesC8& aUri, CWSPolicy* aPolicy);
+    void URIs(RArray<TPtrC8>& aURI);
+        
+    TInt SetSD(CSenWSDescription* aSD);    
+    
+private:
+    TInt LookForUri(const TDesC8& aUri);
+
+    CPolicyRequest();
+    void ConstructL(const TDesC8& aContract);
+
+    CSenWSDescription* iSD; //not owned        
+    HBufC8* iContract; //service contract representing the policy    
+    RPointerArray<CPolicyReq> iPolicies;
+};  
+  
+class CPolicyReq : public CBase
+{
+    public:
+    
+    static CPolicyReq* NewL(const TDesC8& aUri);
+    static CPolicyReq* NewLC(const TDesC8& aUri);
+    virtual ~CPolicyReq();
+
+
+    TPtrC8  Name();
+    TPtrC8  URI();
+    TPtrC8  Contents();
+    CWSPolicy* Policy();
+
+    TInt    SetNameL(const TDesC8& aName);
+    TInt    SetContentsL(const TDesC8& aContent);
+    TInt    SetPolicy(CWSPolicy* aPolicy);
+    
+    private:
+    CPolicyReq();
+    void ConstructL(const TDesC8& aUri);
+    
+    private:
+    CWSPolicy* iPolicy;
+    HBufC8* iName; //policy name
+    HBufC8* iURI; //uri to download
+    HBufC8* iContents; //contents
+    
+    
+    
+};    
+class CPolicyReqMap : public CBase
+{
+
+public:
+    static CPolicyReqMap* NewL(const TDesC8& aContract);
+    static CPolicyReqMap* NewLC(const TDesC8& aContract);
+    virtual ~CPolicyReqMap();
+
+
+    TPtrC8  Contract();
+    TPtrC8  Uri();
+    TPtrC8  Contents();
+    CSenWSDescription*    ServiceDescription();
+
+    TInt    SetUriL(const TDesC8& aUri);
+    TInt    SetContentsL(const TDesC8& aContent);
+    TInt    SetSD(CSenWSDescription* aSD);
+    
+private:
+    CPolicyReqMap();
+    void ConstructL(const TDesC8& aUri);
+    
+private:
+    HBufC8* iContract; //service contract
+    HBufC8* iURI; //uri to download
+    HBufC8* iContents; //contents
+    CSenWSDescription* iSD; //not owned
+};    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarpolicyvalidator.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_POLICY_VALIDATER_H
+#define WSSTAR_POLICY_VALIDATER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+
+typedef RSenPointerMap<TDesC8, TDesC8> RPolicyRequestMap2;
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the Validation of policy from ServicePolicy
+ * differenet methods validates Clinet and Service poplicy
+ */
+class CWSStarPolicyValidator : public CBase
+    {
+    public:
+        static CWSStarPolicyValidator* NewL(RFileLogger& aLogger);
+        static CWSStarPolicyValidator* NewLC(RFileLogger& aLogger);
+        ~CWSStarPolicyValidator();
+
+        TInt ValidatePolicyArrayL(CSenElement* aPolicyArray, CPolicyRegistry* aRegistry, RPolicyRequestMap2& aRequestMap);
+        TInt ValidateClientPolicyL(CSenElement* aClientPolicy, CPolicyRegistry* aRegistry, RPolicyRequestMap2& aRequestMap);
+        TPtrC8 PolicyNameL(CSenElement* aPolicy);
+        RFileLogger* Log() const;
+        	
+    private:       
+        
+        TPtrC8 PolicyIdL(CSenElement* aPolicy);
+        TInt IsUriAlreadyExist(TPtrC8 aUriName, RPolicyRequestMap& aRequestMap);
+        TBool ValidateExpiryL(CSenElement* aExpiry);
+        CSenElement* GetExpiryTagL();
+        TBool IsExpiredPolicyL(CSenElement* aExpiry);
+        
+        CWSStarPolicyValidator();
+        void ConstructL(RFileLogger& aLogger);
+        RFileLogger* iLog;
+    }; 
+#endif // WSSTAR_POLICY_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarregisterhandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_REGISTER_HANDLER_H
+#define WSSTAR_REGISTER_HANDLER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstarcons.h"
+#include "wsstarservicesession.h"
+#include "SenServiceConnection.h"
+
+
+/**
+ * Class:CWSStarRegisterHandler
+ *
+ * An implementation of the CWSStarSessionHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ *
+ * Class represent phase related to session, before discovering and validation.
+ *      Main goal is to indirectly implement (by passing session context) SIF method:
+ *          -registegr/unregister service description
+ */
+class CWSStarRegisterHandler : public CSenSessionHandler
+    {
+
+    public:
+        /**
+         * Function:    NewL
+         *
+         * Description: Create instance of concrete implementation. Note that ECOM
+         *              interface implementations can only have two signatures for
+         *              NewL:
+         *               - NewL without parameters (used here)
+         *               - NewL with TAny* pointer, which may provide some client
+         *                 data
+         *
+         * Returns:    Instance of this class.
+         *
+         * Note:       The interface, which is abstract base class of this
+         *             implementation, also provides NewL method. Normally abstract
+         *             classes do not provide NewL, because they cannot create
+         *             instances of themselves.
+         */
+
+        static CWSStarRegisterHandler* NewL(TAny* aHandlerCtx);
+        virtual TInt InvokeL(MSenSessionContext& aCtx);
+        ~CWSStarRegisterHandler();
+        
+        virtual SenHandler::THandlerDirection Direction() const;
+        virtual SenHandler::THandlerPhase Phase();
+        virtual TInt InitL(MSenHandlerContext& aCtx);
+        
+            
+    protected:
+        /**
+         * Function:   CWSStarRegisterHandler
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarRegisterHandler(MSenHandlerContext& aCtx);
+        
+        
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL();
+
+
+    private:
+        /**
+         * Attempt to register the ServiceDescription. 
+         *   In fact session is created but not vaidated and added into CoreManager.
+         *   So registering different to adding that it doesnt validate, just register.
+         *   Common issue is increase core database by one session (validated or not)
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         *  return TInt aError - indicates the error or KErrNone if successful
+         */
+        virtual TInt RegisterServiceDescriptionL(
+                                    MSenServiceDescription& aServiceDescription);
+
+
+        /**
+         * Attempt to unregister the ServiceDescription from the ServiceManager
+         * that owns the framework.
+         * This is a callback used by the ServiceManager.
+         *
+         * @param aServiceDescription A ServiceDescription
+         *
+         *  return TInt aError - indicates the error or KErrNone if successful
+         */
+        virtual TInt UnregisterServiceDescriptionL(
+                                    MSenServiceDescription& aServiceDescription);
+
+        /**
+         * Register specific description (STS contract)
+         */
+        TInt RegisterSTSClientL(MSenServiceDescription *aServiceDescription);
+        
+        /**
+         * Unregister specific description (STS contract)
+         */
+        TInt UnRegisterSTSClientL(MSenServiceDescription* aServiceDescription);
+        RFileLogger* Log() const;
+    };
+
+
+#endif // WSSTAR_HANDLER_REGISTER_PLUGIN_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarrstresponse.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_RST_RESPONSE_MESSAGE_H
+#define WSSTAR_RST_RESPONSE_MESSAGE_H
+
+// INCLUDES
+#include "SenBaseFragment.h"
+#include "wsstarplugin.h"
+#include "wsstarvalidatehandler.h"
+#include "SenCredential.h"
+#include "senwsdescription.h" //credential const
+
+
+// FORWARD DECLARATIONS
+
+    
+// CLASS DECLARATION
+/**
+ * Class: CWSStarRSTResponse
+ *
+ * Description: Structure which is self parsing. Holds information about
+ *              RST response. See WS-Trust specification
+ */
+class CWSStarRSTResponse :  public CSenBaseFragment
+    {
+public: // Constructors and destructor
+    
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aParseIssuedTokens determine if token will searched only in header under issuedToken tag
+    * @param aAppliedTo precise which token in response collection is used after sts negotation.
+    *               If null passed 1st token from collection is taken
+    * @return new instance of rst response
+    */
+    static CWSStarRSTResponse* NewL(TBool aParseIssuedTokens, const TDesC8& aAppliedTo, const TDesC8* aVersion);
+    
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aParseIssuedTokens determine if token will searched only in header under issuedToken tag
+    * @param aAppliedTo precise which token in response collection is used after sts negotation
+    *               If null passed 1st token from collection is taken
+    * @return new instance of rst response (also pushed on cleanupStack)
+    */
+    static CWSStarRSTResponse* NewLC(TBool aParseIssuedTokens, const TDesC8& aAppliedTo, const TDesC8* aVersion);
+    
+    /**
+    * Normal destructor
+    */
+    virtual ~CWSStarRSTResponse();
+
+    // New functions
+    
+    /**
+    * Getter for credential
+    * @return credential
+    */
+    CSenCredential* Credential();
+    
+    /**
+    * Getter for POP encoded as Base64
+    * @return credential
+    */
+    TPtrC8 POPBase64();
+    
+    /**
+    * Getter for TokenType
+    * @return credential
+    */
+    TPtrC8 TokenType();
+    
+    /**
+    * Getter for type of binary
+    * @return type of binary
+    */
+    TPtrC8 BinaryType();
+    
+    /**
+    * Getter for entropy of STS
+    * @return entropy of STS
+    */
+    TPtrC8 EntropySTS();
+    
+    /**
+    * Getter for computed key
+    * @return computed key
+    */
+    TPtrC8 ComputedKey();
+    
+    /**
+    * Getter for time of credential expired time
+    * @return expired time in XSD time-date format
+    */
+    TPtrC8 CredentialExpires();
+    
+    /**
+    * Getter for time of credential creation time
+    * @return creation time in XSD time-date format
+    */
+    TPtrC8 CredentialCreated();
+    
+    /**
+    * Getter for security token referenve
+    * @return security token reference
+    */
+    TPtrC8 STR();
+    
+    /**
+    * Determine type of token (binary token or SCT)
+    * @return Etrue if token is SCT (security Context Token).
+    *        See WS-SecureConversation specification.
+    */
+    TBool IsContextToken();
+    
+    /**
+    * Deteremine if this really is a response (RST)
+    * @return ETrue if reponse is RST
+    */
+    TBool IsResponse();
+    
+    /**
+    * Getter for KeySize (used during calculating computed Key in PSHA1 algorithm).
+    * @return Size in bites.
+    */
+    TInt KeySize();
+    
+    /**
+    * Set addressing holders for endpoint.In message phase 
+    *  addressing handler shuld set values for addressing holders.
+    */
+    void UpdateAddressingHoldersL(MSenSessionContext& aCtx);
+    void SetPolicyVersion(const TDesC8* aVersion);
+
+
+private:
+
+    /**
+    * C++ default constructor.
+    */
+    CWSStarRSTResponse(TBool aParseIssuedTokens, const TDesC8& aAppliedTo);
+    
+    /**
+    * By default Symbian 2nd phase constructors is private.
+    */
+    void ConstructL(const TDesC8* aVersion);
+    
+    // From CBaseFragment
+    virtual void StartElementL(const TDesC8& aNsUri,
+                               const TDesC8& aLocalName,
+                               const TDesC8& aQName,
+                               const RAttributeArray& aAttributes);
+    
+    virtual void EndElementL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aQName);
+    
+    //reset state machine
+    void Reset();
+    
+
+private: // Data
+    
+    TBool iIsResponse;
+    /**
+     * Should be set to ETrue when parsing header for issued tokens
+     */
+    TBool iParseIssuedTokens;
+    
+    //now this flag is not used anywhere. How to use it, any idea?
+    TBool iCollection;
+    TBool iContextToken;
+    
+    //This bool determine if token appliedTo has been found.
+    //Next RSTRs are not processing if iTokenEstablished == TRUE
+    //Set to true only in positive case (when NO reset of machine state)
+    TBool iTokenEstablished;
+    TBool iParsingApliedTo;
+    TBool iDefTokenEstablished;
+    
+    CSenCredential* iCredential;
+    CSenCredential* iCredentialDef;
+    CSenBaseFragment* iSTRFr;
+    HBufC8* iSTR;
+    HBufC8* iSTRDef;                   
+    HBufC8* iPOPencodedAsBase64;
+    HBufC8* iPOPencodedAsBase64Def;
+    HBufC8* iTokenType;
+    HBufC8* iTokenTypeDef;
+    HBufC8* iTypeOfBinary;
+    HBufC8* iTypeOfBinaryDef;
+    HBufC8* iEntropySTS;
+    HBufC8* iEntropySTSDef;
+    const TDesC8* iActiveXmlns;
+    TTime iNotOnOrAfter;
+    HBufC8* iComputedKey;
+    TInt* iKeySize;
+    TInt* iKeySizeDef;
+    HBufC8* iComputedKeyDef;
+    HBufC8* iCredentialExpires;
+    HBufC8* iCredentialExpiresDef;
+    HBufC8* iCredentialCreated;
+    HBufC8* iCredentialCreatedDef;
+    TPtrC8 iAppliedTo;
+    const TDesC8* iAddressingNs;            //not owned    
+    const TDesC8* iAddressingEndpointTag;  //not owned    
+    const TDesC8* iPolicyVersion;//not owned
+};
+
+#endif // WSSTAR_RST_RESPONSE_MESSAGE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarservicesession.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,337 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_SERVICE_SESSION_H
+#define WSSTAR_SERVICE_SESSION_H
+
+// INCLUDES
+#include "msenremoteserviceconsumer.h"
+#include "msenserviceinvocationframework.h"
+
+#include "wsstarplugin.h"
+#include "senwebservicesession.h"
+#include "wsstarsessionconsumer.h"
+#include <xmlengfilecontainer.h>
+#include <xmlengchunkcontainer.h>
+#include <xmlengelement.h>
+#include "sensoapmessagedom2.h"
+
+class CWSStarCredentialObserver;
+// CONSTANTS
+namespace WSStarSession
+    {
+    _LIT8(KProviderIDTag,                  "<ProviderID>");
+    _LIT8(KProviderIDEndTag,               "</ProviderID>");
+    _LIT8(KTrustAnchorTag,                 "<TrustAnchor>");
+    _LIT8(KTrustAnchorEndTag,              "</TrustAnchor>");
+    _LIT8(KPOPBase64Tag,                   "<POP>");
+    _LIT8(KPOPBase64EndTag,                "</POP>");
+    _LIT8(KTokenTypeTag,                   "<TokenType>");
+    _LIT8(KTokenTypeEndTag,                "</TokenType>");
+    _LIT8(KSTRTag,                          "<STR>");
+    _LIT8(KSTREndTag,                       "</STR>");
+    _LIT8(KBinaryTypeTag,                   "<BinaryType>");
+    _LIT8(KBinaryTypeEndTag,                "</BinaryType>");
+    
+    _LIT8(KClusterTypeTag,                   "<Cluster>");
+    _LIT8(KClusterEndTypeTag,                "</Cluster>");
+    
+    _LIT8(KServiceInterval,             "<ServiceInterval>");
+    _LIT8(KServiceIntervalEnd,          "</ServiceInterval>");
+
+    
+    //related to ticket
+    _LIT8(KPhoneTimeWhenMTResolvedTag,        "<PhoneTimeWhenMTResolved>");
+    _LIT8(KPhoneTimeWhenMTResolvedEndTag,        "</PhoneTimeWhenMTResolved>");
+    _LIT8(KCreatedTag,        "<Created>");
+    _LIT8(KCreatedEndTag,        "</Created>");  
+    //_LIT8(KProviderIdElementLocalName,  "ProviderID");
+    _LIT8(KPOPBase64LocalName,  "POP");
+    _LIT8(KSTRLocalName,  "STR");
+    _LIT8(KBinaryTypeLocalName,  "BinaryType");
+    _LIT8(KTrustAnchorElementLocalName,  "TrustAnchor");
+    _LIT8(KClusterLocalName,        "Cluster");
+    _LIT8(KPhoneTimeWhenMTResolvedLocalName,        "PhoneTimeWhenMTResolved");
+    _LIT8(KCreatedLocalName,        "Created");
+    _LIT8(KTokenType,        "TokenType");
+    }
+
+
+
+// CLASS DECLARATION
+/**
+ * WSStar Service Session.
+ * Represent session between client and service in ws* framework.
+ */
+class CWSStarServiceSession : public CSenWebServiceSession
+    {
+
+friend class CWSStarPlugin;
+
+public: // Constructors and destructor
+
+    static CWSStarServiceSession* NewL(MSIF& aFramework);
+    static CWSStarServiceSession* NewLC(MSIF& aFramework);
+
+    virtual ~CWSStarServiceSession();
+
+    // From SenServiceSession
+    virtual MSenRemoteServiceConsumer* RemoteConsumerL(
+                                                const TDesC8& aSenderID);
+    
+    virtual TBool Matches(MSenServiceDescription& aPattern);
+    virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
+    
+    virtual void WriteExtensionsAsXMLToL(RWriteStream& aWriteStream);
+
+
+    //From SenWebServiceSession
+    virtual TInt SendL( const TDesC8& aMessage, 
+                        const TDesC8& aTransportProperties,
+                        MSenRemoteServiceConsumer& aConsumer,
+                        TInt& aTxnId,
+                        HBufC8*& aRevalidationError );
+                        
+    virtual TInt SubmitL(const TDesC8& aMessage, 
+                         const TDesC8& aTransportProperties,
+                         MSenRemoteServiceConsumer& aConsumer,
+                         HBufC8*& aResponse);
+
+    virtual TInt SubmitSoapL(const TDesC8& aSoapMessage, 
+                             const TDesC8& aTransportProperties,
+                             MSenRemoteServiceConsumer& aConsumer,
+                             HBufC8*& aResponse);
+
+    virtual TInt SendSoapL( const TDesC8& aSoapMessage, 
+                            const TDesC8& aTransportProperties,
+                            MSenRemoteServiceConsumer& aConsumer,
+                            TInt& aTxnId,
+                            HBufC8*& aRevalidationError );
+    
+    virtual void StartTransaction();                             
+    virtual void TransactionCompleted();
+    virtual TInt InitializeFromL(MSenServiceDescription& aDescription, CWSStarPolicyHandler* aPolicyHandler = NULL);
+
+
+    
+    /**
+    add consumer. Eeach session has multiple consumers.From 3rd parties point of view
+    its mean 2 connection per the same service description.Consumers are distinguished by addressing id (MessagesID and RelatesTo)
+    */
+    virtual TInt AddConsumerL(MSenRemoteServiceConsumer& aConsumer);
+    
+    /**
+    remove consumer
+    */
+    virtual TInt RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer);
+    
+    /**
+    Framework specific method. Process message before sending to network
+            In other words add specific headers, and store correlation info in proper consumer
+    */
+    virtual TInt MessageForSendingL( const TDesC8& aBody,
+                                     const TDesC8& aSenderID,
+                                     CSenSoapMessage*& aMessage ); //out param
+
+    /**
+    During parsing Inbound new SoapMessage is created, based on active soap version.
+    Method is called by framework
+    */
+    virtual TInt NewMessageL( CSenSoapMessage*& aMessage );
+    
+    
+    //virtual TInt ParseResponseL(const TDesC8& aResponse,CSenSoapMessage*& aMessage);
+    
+    virtual TInt ParseMessageL( CSenSoapMessage& aSOAPMessage );
+
+
+    //aConsumer is not used, becouse session holds many consumers, and first has to establish correct one
+    virtual TInt SendSoapMessageToConsumerL( CSenSoapMessage* apMessage, 
+                                             const TInt aTxnId,
+                                             MSenRemoteServiceConsumer& aConsumer,
+                                             MSenProperties* aResponseTransportProperties );
+    
+
+    virtual TInt SetTransportPropertiesL( const TDesC8& aProperties,
+                                          MSenRemoteServiceConsumer& aConsumer );
+
+    //in WS* and SCHarF methiod disabled.
+    //virtual void SetFrameworkHeadersL(CSenSoapMessage& aMsg);
+    
+    
+    virtual TInt HandleSoapFaultL( CSenSoapMessage* apSOAPMessage,
+                                   HBufC8*& aResponse);
+
+    virtual TInt HandleSoapFaultL( CSenSoapMessage* apSOAPMessage,
+                                   const TInt aErrorCode,
+                                   const TInt aTxnId,
+                                   MSenRemoteServiceConsumer& aConsumer,
+                                   MSenProperties* aTransportProperties );
+
+    virtual TBool IsExpiredL();
+    /**
+     * Clear credential for current session , make it invalid.
+     * @since S60 5.0
+     */
+    void ClearCredentialL();
+    
+    
+    /**
+     * Share token. Copy SCT and MT into new star session
+     * @since S60 5.0
+     */
+    TInt ShareTokenWithL(CWSStarServiceSession* aWSStarSessionDst, TBool& aMTwasReplaceBySCT, TBool aSeekSCT);
+    
+    
+    /**
+     * Getter of Provider ID (STS which represents this session)
+     *
+     * @return TDesC8 id of provider
+     * @since S60 5.0
+     */
+    
+    /**
+    * Overload addcredential from WebServiceSession. Calucate also state, 
+    * @since S60 5.0
+    */
+    void AddCredentialL(const TDesC8& aSecurity, TTime aValidUntil);
+    void AddCredentialL(RSenCredentialPtr aCredentialPtr, TTime aValidUntil);
+    TPtrC8 ProviderID();
+    void SetTrustAnchorL(const TDesC8& aURI);
+    TPtrC8 TrustAnchor();
+    TInt ComputeStatusL();
+    void SetSessionContext(CWSStarSessionContext* aContext);
+    CWSStarSessionContext* SessionContext();
+    TInt UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD);
+    
+    void AddSecurityTokenToContextL();
+
+    void AddPropertiesFromSessionContextToCredentialL();
+    
+    virtual void CredentialChanged(TSenCredentialChange aChange, TAny* aPointer);
+    void ActiveTicketObserverL();
+    //virtual TInt RefreshMTL(HBufC8*& aErrorMessage);
+    TInt RevalidateMobileTicketIfExpiredL(HBufC8*& aErrorMessage);
+    TBool ExistConsumerL();
+
+    // Add ProviderID to primary keys (in addition to Endpoint, Contract and FrameworkID):
+    TBool HasEqualPrimaryKeysL( MSenServiceDescription& aCandidate ); 
+
+	/**
+	 * DetachCredentialL
+	 *
+	 * This function  invalidates the session by deleting the credential
+	 * This also call setStatusL to recompute the status
+	 */
+	void DetachCredentialsL() ;	
+	TBool AmIHostletSession();
+
+private: 
+       
+    /**
+    * C++ default constructor.
+    */
+    CWSStarServiceSession(TDescriptionClassType aType, MSIF& aFramework);
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+    
+    // New functions
+    
+    
+    /**
+    * To obtain consumer during processing INBOUND. We have to dispatch using wsa:RelatesTo
+    */
+    TInt SessionConsumerL(CWSStarMessageContext*& aMessage,
+                          CWSStarSessionConsumer*& aSessionConsumer);
+    
+    /**
+    * To obtain consumer during processing OUTBOUND.
+    */
+    TInt SessionConsumerL( const TDesC8& aSenderID, CWSStarSessionConsumer*& aSessionConsumer);
+    TInt CanHandleErrorL();
+    void CreateAndParseSoapMessageL(const TDesC8& aSoapMessage, CSenSoapMessage*& aMessage, HBufC8*& aBody);
+    HBufC8* ApplyTransportPropertiesL(const TDesC8& aTransportProperties);
+    void PrepareOutCtxL(const TDesC8& aTransportProperties);
+    TBool HasSuperClass( TDescriptionClassType aType );
+   // TBool AmIHostletSession();
+    void FindAndShareSCTL();
+    
+    
+    
+    
+    void ParseToSoapMessage2L( const TDesC8& aSoapMessage, MSenRemoteServiceConsumer& aConsumer, TInt& aTxnId );
+    
+    TInt ListBinaryElementsL( RArray<TXmlEngElement>& aElementArray, TXmlEngElement& aElement );
+    
+    virtual void FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier);
+    
+    CSenIdentityProvider* LookupIdentityProviderL();
+    void VerifyPermissionL();
+    void ClearCredentialPropertiesFromContext();
+    // Add ProviderID to primary keys (in addition to Endpoint, Contract and FrameworkID):
+    //TBool HasEqualPrimaryKeysL( MSenServiceDescription& aCandidate ); 
+
+		void ReattachCredentialsL() ;
+    
+private: // Data
+    
+    CWSStarMessageContext* iOutContext;//owned, live only within one sending
+    CWSStarMessageContext* iInContext;//owned, live only within one sending
+    
+    CWSStarSessionContext* iSessionContext;//owned
+    
+    
+    
+    //trust anchor is a pointer to providerID.
+    //ProviderId identify SD which represent STS, and in order to distinguis who validate whom;
+    //  STS has providerID which is pointed by trustAnchor in validatet WebService
+    //  Unfortuantely webService inherits same classes as STS (it is still XmlSD) so webservice has both TrustAnchor 
+    //  and ProviderId which are equal
+    HBufC8* iTrustAnchor;
+    
+    //to keep transaction chain
+    HBufC8* ipReceivedMessageIdInTrans;//owned
+    
+    TBool  iMessageThread;
+    TInt iSubmitState;
+    TInt iRetryCounter;
+    TInt iRenewCounter;
+    TInt iRedirectCounter;
+    HBufC8* iProviderID;
+    HBufC8* iTransProp;
+    TTime iClientTime; 
+    TTime iServerTime;
+    CWSStarCredentialObserver* iTicketObs;
+    };
+    
+#endif // WSSTAR_SERVICE_SESSION_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarserviceupdatehandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_SERVICEUPDATE_HANDLER_H
+#define WSSTAR_SERVICEUPDATE_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "wsstarcons.h"
+
+
+/**
+ * Class:CWSStarServiceUpdateHandler
+ *
+ * An implementation of the CWSStarSessionHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ * This handler is responsible to updated mobile ticket and use session context token.
+ *
+ */
+class CWSStarServiceUpdateHandler : public CSenSessionHandler
+    {
+
+public:
+    /**
+     * Function:    NewL
+     *
+     * Description: Create instance of concrete implementation. Note that ECOM
+     *              interface implementations can only have two signatures for
+     *              NewL:
+     *               - NewL without parameters (used here)
+     *               - NewL with TAny* pointer, which may provide some client
+     *                 data
+     *
+     * Returns:    Instance of this class.
+     *
+     * Note:       The interface, which is abstract base class of this
+     *             implementation, also provides NewL method. Normally abstract
+     *             classes do not provide NewL, because they cannot create
+     *             instances of themselves.
+     */
+
+    static CWSStarServiceUpdateHandler* NewL(TAny* aHandlerCtx);
+    virtual TInt InvokeL(MSenSessionContext& aCtx);
+    ~CWSStarServiceUpdateHandler();
+    
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+        
+protected:
+    /**
+     * Function:   CWSStarServiceUpdateHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarServiceUpdateHandler(MSenHandlerContext& aCtx);
+    
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+    CSenElement* GetSCTElementL(CSenElement& aParent);
+
+
+private:
+    RFileLogger* Log() const;
+    const TDesC8* iVersion;
+    };
+
+
+#endif // WSSTAR_SERVICEUPDATE_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarsessionconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_SESSION_CONSUMER_H
+#define WSSTAR_SESSION_CONSUMER_H
+
+// INCLUDES
+#include <e32base.h>
+#include "msenremoteserviceconsumer.h"
+#include "senpointermap.h"
+#include "SenSoapMessage.h"
+#include "wsstarmessagecontext.h"
+
+
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, HBufC8> RSentMessagesPointerMap;
+
+
+// FORWARD DECLARATIONS
+class RFileLogger;
+
+
+// CLASS DECLARATION
+/*
+    Its wrapper for remote consumer. In the same time it inherits from remote consumer. Why?
+    Because we can not cast inside framework pluging to our wsstar session a remote consumer, 
+    which was created in core
+    
+    Object can ot be extended to more complex class. Can be cast to narrow class, but not in other way
+*/
+class CWSStarSessionConsumer : public CBase, public MSenRemoteServiceConsumer
+    {
+public: // Constructors and destructor
+    
+    static CWSStarSessionConsumer* NewL(MSenRemoteServiceConsumer& aServiceConsumer,
+                                       RFileLogger& aLogger);
+
+    static CWSStarSessionConsumer* NewLC(MSenRemoteServiceConsumer& aServiceConsumer,
+                                        RFileLogger& aLogger);
+
+    virtual ~CWSStarSessionConsumer();
+ // From MSenRemoteServiceConsumer:
+    TInt HandleMessageL(HBufC8* aMessage,
+                        const TInt aTxnId,
+                        MSenProperties* aResponseTransportProperties);
+
+    TInt HandleErrorL(HBufC8* aError,
+                      const TInt aErrorCode,
+                      const TInt aTxnId,
+                      MSenProperties* aResponseTransportProperties);
+
+    void SetStatusL(const TInt status);
+
+
+
+    TInt MessageForSendingL(const TDesC8& aBody,
+                            CWSStarMessageContext*& aCtx);
+// New functions
+
+    /**
+    * Expects() is called by CWSStarServiceSession to check
+    * whether or not this consumer expects certain response
+    */
+    virtual TBool Expects(const TDesC8& aRelatesTo, const TDesC8* aTo);
+
+    const TDesC8& Id() const;
+    TInt SetSessionL(MSenRemoteServiceSession& iServiceSession);
+
+    void HandleSoapMessageL( CSenSoapMessage* apMessage,
+                             const TInt aTxnId,
+                             MSenProperties* aResponseTransportProperties,
+                             TBool aCompleteMessage );
+
+   
+
+/*
+    void SetSentMessageIdL(const TDesC8& aSentMessageId);
+    TPtrC8 SentMessageId();
+    void SetReceivedMessageIdL(const TDesC8& aReceivedMessageId);
+    TPtrC8 ReceivedMessageId();
+*/
+    CSenIdentifier& Identifier() const;
+    TDesC8* BodyL(const TDesC8& aMessageID) const;
+    const TDesC8& TransportProperties(const TDesC8& aMessageID) const;
+    MSenTransport& TransportL();
+    virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
+    virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
+                const TDesC8& aSoapOrCid, TInt aProgress);    
+    TBool HasAuthenticationCallback();
+    TInt ReauthenticationNeededL(CSenIdentityProvider*& aIdp);
+	virtual void SetDataTrafficDetails(TSenDataTrafficDetails& aDetails) ; 
+    TBool HasCoBrandingCallback();
+    TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId);
+
+protected:
+    RFileLogger* Log() const;
+
+
+private: 
+
+    /**
+    * C++ default constructor.
+    */
+    CWSStarSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer,
+                          RFileLogger& aLogger);
+    
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+
+
+
+private: // Data
+    MSenRemoteServiceConsumer& iConsumer;
+    RFileLogger& iLogger;
+    //HBufC8* iSentMessageId;     // owned
+    //HBufC8* iReceivedMessageId; // owned
+    RSentMessagesPointerMap iSentMessages; // owned
+    RMapDescriptors         iSendReplyTo; // owned
+    RMapDescriptors iTranspProp;
+    };
+    
+#endif // WSSTAR_SESSION_CONSUMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarsessioncontext.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_HANDLER_SESSION_CONTEXT_H
+#define WSSTAR_HANDLER_SESSION_CONTEXT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "msensessioncontext.h"
+#include "MSenServiceDescription.h"
+#include "msenmessagecontext.h"
+#include "msenremoteserviceconsumer.h"
+#include "wsstarcons.h"
+#include "wsstarmessagecontext.h"
+
+
+// DATA TYPES
+typedef RSenPointerMap<TDesC8, CSenWSDescription> RContextMapDescription;
+
+
+// FORWARD DECLARATIONS
+class MSenRemoteServiceSession;
+class CSenWSDescription;
+class CWSStarRSTResponse;
+class CWSStarServiceSession;
+class CWSStarPolicyHandler;
+
+/**
+ * Implement Session Context.       
+ */
+class CWSStarSessionContext : public CBase, public MSenSessionContext
+    {
+
+    public:
+        static CWSStarSessionContext* NewL(CSenXmlReader* aParser, MSenServiceDescription* aSD, CWSStarPolicyHandler* aPolicyHandler = NULL);
+        static CWSStarSessionContext* NewLC(CSenXmlReader* aParser, MSenServiceDescription* aSD, CWSStarPolicyHandler* aPolicyHandler = NULL);
+        ~CWSStarSessionContext();
+
+        /**
+         * Sets token context keys based on RST response.
+         *
+         * @param aRSTResponse parsed information about token.
+         * @param aEntropy Entropy if provided by our plugin.
+         * @return KErrNone if no error, one of system wide error codes otherwise
+         */
+         TInt SetTokenKeysL(CWSStarRSTResponse& aRSTResponse, HBufC8* aClientEntropy, TBool aSignalConsumers,TBool aSCT = EFalse);
+
+        //from SessionContext    
+        virtual const CSenWSDescription* GetSession();
+        virtual const CSenWSDescription* GetInitializer();
+        
+        virtual TInt                             Add(const TDesC8& aKey, CSenWSDescription* aValue);
+        virtual TInt                             Update(const TDesC8& aKey, CSenWSDescription* aValue);
+        virtual const CSenWSDescription* GetSenWSDescriptionL(const TDesC8& aKey);
+
+        //in fact, now relation between session and sessionCtx is 1 to 1, so no need for map & keys    
+        virtual TInt                            Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue); // protected context    
+        virtual TInt                            Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue);
+        virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey);    
+        
+        //from MContext    
+        virtual SenContext::TContextType Type() const;        
+        virtual SenContext::TContextDirection Direction() const;
+        //desc - ownership transfered
+        virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
+        virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
+        virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
+        virtual TInt Remove(const TDesC8& aKey);
+
+        //Int handling methods doesnt take ownership. but create new object from passed value
+        virtual TInt Add(const TDesC8& aKey, TInt aValue);
+        virtual TInt Update(const TDesC8& aKey, TInt aValue);
+        virtual const TInt* GetIntL(const TDesC8& aKey);
+        virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
+        virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
+        virtual const CSenElement* GetSenElementL(const TDesC8& aKey) ;
+        virtual TInt Add(const TDesC8& aKey, TAny* aValue);
+        virtual TInt Update(const TDesC8& aKey, TAny* aValue) ;
+        virtual TAny* GetAnyL(const TDesC8& aKey);	//codescannerwarnings
+        virtual const CSenXmlReader* GetParser();
+        virtual TInt Count() const;
+        virtual TPtrC8 KeyAtL(TInt aIndex);
+        virtual void Reset() ;
+        
+        inline virtual TInt SetDirection( SenContext::TContextDirection /* aDirection */ ) { return KErrNotSupported; } // not implemented
+
+        // New methods
+        
+        /**
+         * Update session context after incoming message
+         *
+         * @since S60 4.0
+         */
+        void UpdateFromMessageInContextL(CWSStarMessageContext& aMessageContext);
+        
+        /**
+         * Update session context after outgoing message has been prepared, 
+         *  to check which elements has been consumed.
+         *
+         * @since S60 4.0
+         */
+        void UpdateFromMessageOutContextL(CWSStarMessageContext& aMessageContext);
+        
+        /**
+         * Share token. Copy SCT and MT into new star session
+         *
+         * @since S60 4.0
+         */
+        TInt ShareTokenWithL(CWSStarSessionContext* aWSStarSessionCtxDst, TBool& aMTwasReplaceBySCT);
+
+        TInt UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD);
+        
+    private:
+        void UpdateDesC8L(CWSStarMessageContext& aMessageContext, const TDesC8& aKey);
+        
+        
+    protected:
+        /**
+         * Function:   CWSStarSessionContext
+         *
+         * Discussion: Perform the first phase of two phase construction
+         */
+        CWSStarSessionContext(CSenXmlReader* aParser);
+
+        /**
+         * Function:   ConstructL
+         *
+         * Discussion: Perform the second phase construction of a
+         *             CImplementationClassPlus object.
+         */
+        void ConstructL(MSenServiceDescription* aSD, CWSStarPolicyHandler* aPolicyHandler = NULL);
+        
+    private:
+        MSenRemoteServiceConsumer* iRemoteServiceConsumer;
+        CSenSoapEnvelope*      iCurrentEnvelope;
+        MSenRemoteServiceSession* iSession;//nbot owned, session keeped by DAO
+        RContextMapDescription iDescriptions;
+        RMapInt                iInts;
+        RMapDescriptors         iDescs;
+        CSenXmlReader* iParser;//not owned
+        CSenElement* iBody;                 //owned, but handlers can consume it
+        RPointerArray<HBufC8>*  ipSignedParts;           //owned array, Also elements
+        TAny*                       ipConsumer; // not owned
+    };
+
+#endif // WSSTAR_HANDLER_SESSION_CONTEXT_H
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarsessionvalidator.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_SESSION_VALIDATOR_H
+#define WSSTAR_SESSION_VALIDATOR_H
+
+// INCLUDES
+#include <e32base.h>
+
+#include "msenremoteserviceconsumer.h"
+
+// FORWARD DECLARAtions
+class CWSStarServiceSession;
+
+// CLASS DECLARATION
+class MWSStarSessionValidator
+    {
+    public:
+    
+        /**
+        * @return KErrNotFound, if no known security mechanism was found
+        *         KErrNotReady, if no service session has been initialized
+        */
+        virtual TInt ValidateL(CWSStarServiceSession& aSession,
+                               TBool aRenewing,
+                               HBufC8*& aErrorMessage,
+                               TBool aOnlySharing) = 0;
+
+    };
+
+#endif //WSSTAR_SESSION_VALIDATOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstartrustclient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TRUST_CLIENT_H
+#define TRUST_CLIENT_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include <e32math.h>
+
+#include "wsstarsessionvalidator.h"
+#include "seninternalserviceconsumer.h"
+#include "SenXmlElement.h"
+#include "sentransportbase.h"
+#include "wsstarhandlercontext.h"
+
+// FORWARD DECLARATIONS
+class CWSStarPolicyHandler;
+namespace WSPolicy
+    {
+   _LIT8( KPolicyNamespace200409, "http://schemas.xmlsoap.org/ws/2004/09/policy");
+   _LIT8( KPolicyNamespace200212, "http://schemas.xmlsoap.org/ws/2002/12/policy");
+   
+   _LIT8( KPolicyPrefix, "wsp");
+   _LIT8( KAppliesToTag, "AppliesTo");
+   _LIT8( KAppliesToQTag, "wsp:AppliesTo"); 
+   _LIT8( KPolicyReference, "PolicyReference"); 
+    }
+
+namespace WSTrust
+    {    
+    //---------namespaces
+    _LIT8( KTrustNamespace200502, "http://schemas.xmlsoap.org/ws/2005/02/trust");
+    _LIT8( KTrustNamespace200404, "http://schemas.xmlsoap.org/ws/2004/04/trust");
+    
+    _LIT8( KTrustPrefix,    "wst");
+    _LIT8( KWsuNamespace, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
+    
+    
+    //=================================Request specific
+    //-------tags
+    _LIT8( KRSTTag, "RequestSecurityToken");
+    _LIT8( KRSTQTag, "wst:RequestSecurityToken");
+    _LIT8( KRequestTypeTag, "RequestType");
+    _LIT8( KRenewingTag, "Renewing");
+    _LIT8( KRenewTargetTag, "RenewTarget");
+    _LIT8( KEntropyTag, "Entropy");
+    _LIT8( KTokenTypeTag, "TokenType");
+    
+    _LIT8( KFSTTag, "FetchSCTRequest");
+    //-------value
+    //---addressing layer - actions
+    _LIT8( KActionIssueRST200502, "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue");
+    _LIT8( KActionRenewRST200502, "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Renew");    
+    _LIT8( KActionIssueRST200404, "http://schemas.xmlsoap.org/ws/2004/04/trust/RST/Issue");
+    _LIT8( KActionRenewRST200404, "http://schemas.xmlsoap.org/ws/2004/04/trust/RST/Renew");
+    
+    _LIT8( KActionIssueRSTR200502, "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue");
+    _LIT8( KActionRenewRSTR200502, "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Renew");    
+    _LIT8( KActionIssueRSTR200404, "http://schemas.xmlsoap.org/ws/2004/04/trust/RSTR/Issue");
+    _LIT8( KActionRenewRSTR200404, "http://schemas.xmlsoap.org/ws/2004/04/trust/RSTR/Renew");
+    
+    _LIT8( KActionIssueFST200610, "http://schemas.live.com/mws/2006/10/proxy/FetchSCT");
+    //---trust layer - requestType
+    _LIT8( KRequestTypeIssueRST200502, "http://schemas.xmlsoap.org/ws/2005/02/trust/Issue");
+    _LIT8( KRequestTypeRenewRST200502, "http://schemas.xmlsoap.org/ws/2005/02/trust/Renew");
+    _LIT8( KRequestTypeIssueRST200404, "http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue");
+    _LIT8( KRequestTypeRenewRST200404, "http://schemas.xmlsoap.org/ws/2004/04/security/trust/Renew");
+    
+
+    //-------computed Keys values
+    _LIT8( KComputedKeyPSHA1Value,  "http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1");
+    const TInt KSizeOfComputedKey        = 256;
+    
+    //=================================Response specific
+    _LIT8( KRSTResponseTag,             "RequestSecurityTokenResponse");
+    _LIT8( KRSTResponseCollectionTag,   "RequestSecurityTokenResponseCollection");
+    _LIT8( KRequestedSecurityTokenTag,  "RequestedSecurityToken");
+    _LIT8( KLifetimeTag,                "Lifetime");
+    _LIT8( KLifeTimeTag,                "LifeTime");//Wrong one, passport use this
+    _LIT8( KTokenType,                  "TokenType");
+    _LIT8( KKeySize,                    "KeySize");
+    _LIT8( KBinarySecretTag,            "BinarySecret");
+    _LIT8( KProofTokenTag,              "RequestedProofToken");
+    _LIT8( KRequestedAttachedReferenceTag, "RequestedAttachedReference");
+    _LIT8( KRequestedTokenReferenceTag, "RequestedTokenReference");
+    _LIT8( KBinaryTypeAttr,             "Type");
+    _LIT8( KComputedKeyTag,                "ComputedKey");
+    //--lifetime
+    _LIT8( KCreatedTag,             "Created");
+    _LIT8( KExpiresTag,             "Expires");
+    //--other
+    _LIT8( KIssuedTokens, "IssuedTokens");
+    
+    
+    _LIT8( KBinaryTypeSimmetricValue,   "http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey");
+    _LIT8( KBinaryTypeAsimmetricValue,  "http://schemas.xmlsoap.org/ws/2005/02/trust/AsymmetricKey");
+    _LIT8( KBinaryTypeNonceValue,       "http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce");
+    //---------Faults data
+    
+    _LIT8( KInvalidRequest,"InvalidRequest");
+    _LIT8( KFailedAuthentication,"FailedAuthentication");
+    _LIT8( KRequestFailed,"RequestFailed");
+    _LIT8( KInvalidSecurityToken,"InvalidSecurityToken");
+    _LIT8( KAuthenticationBadElements,"AuthenticationBadElements");
+    
+    _LIT8( KBadRequest,"BadRequest");
+    _LIT8( KExpiredData,"ExpiredData");
+    _LIT8( KInvalidTimeRange,"InvalidTimeRange");
+    _LIT8( KInvalidScope,"InvalidScope");
+    _LIT8( KRenewNeeded, "RenewNeeded");
+    
+    _LIT8( KUnableToRenew,"UnableToRenew");
+    }
+namespace WSStarTrustFault
+    {
+    _LIT8(KBadSCT, "Fault.WS-Trust : Bad STR in RSTR");
+    _LIT8(KBadKeySize, "Fault.WS-Security : KeySize not specified during calculating entropy in PSHA1");
+    }
+namespace WSSecureConversation
+    {
+    _LIT8(KSecureConversationNamespaceMS,
+            "http://schemas.xmlsoap.org/ws/2005/02/sc/ws-secureconversation.xsd");
+    _LIT8(KSecureConversationNamespace,
+            "http://schemas.xmlsoap.org/ws/2005/02/sc");
+    _LIT8(KSecurityContextToken, "SecurityContextToken");
+    }
+namespace WSPassport32
+    {
+    _LIT8(KPassportAppliesTo,    "http://Passport.NET/tb");
+    //_LIT8(KDefaultTokenType,     "urn:oasis:names:tc:SAML:1.0");
+    _LIT8(KDefaultTokenType,     "urn:passport:compact");
+    }
+
+
+/**
+ * Class: CWSStarTrustClient
+ *
+ * Description: Consumer which communicate with real STS.
+ * Client will try obtain credentail based on WS-Trust specification.
+ */
+class CWSStarTrustClient : public CSenInternalServiceConsumer,
+                           public MWSStarSessionValidator
+    {
+public: // Constructors and destructor
+
+    /**
+    * Standard 2 phase constructor
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client
+    */
+    static CWSStarTrustClient* NewL(    CSIF& aSIF,
+                                                    RFileLogger& aLogger);
+    /**
+    * Standard 2 phase constructor
+    * @since Series60 4.0
+    * @param aSIF SIF implementation used in contructor of internal consumer
+    * @param aLogger logger used for logs in debug mode
+    * @return new instance of trust client which is pushed into CleanupStack
+    */
+    static CWSStarTrustClient* NewLC(CSIF& aSIF,
+                                                    RFileLogger& aLogger);
+
+    /**
+    * Normal destructor. Destroy STS session.
+    */
+    ~CWSStarTrustClient();
+    
+    
+    /**
+    * The most siginificant method of this class. Make validation of session, 
+    *   credentails obtained if needed.
+    * @param aSession session which is validated
+    * @param aRemoteConsumer consumer of validated session, holds transport entryPoint
+    * @param aRenewing define mode of requesting for credential. See into WS-Trust specification,
+    *       renewal and issuance binding
+    */
+    TInt ValidateL(CWSStarServiceSession& aSession, 
+                   TBool aRenewing,
+                   HBufC8*& aErrorMessage,
+                   TBool aOnlySharing);
+    
+
+    void SetStatus(TInt aStatus);
+    /**
+    * Sets identyProvider for trust client
+    * @param aIdentityProvider identity provider representation of STS
+    */
+    void SetAccount(CSenIdentityProvider* aIdentityProvicer);
+    
+//-----derived from CSenWSDescription, 
+    //in fact we expose info from stssession which is holded by that client.
+    // Method have to overwrited becouse of core, which use those methods during registering
+    TPtrC8 Endpoint();
+    TPtrC8 Contract();
+    TPtrC8 ProviderID();
+    TPtrC8 FrameworkId();
+    MSenServicePolicy* ServicePolicy();
+    TInt IapId(TUint32& aCurrentIapId);
+    TInt UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD);
+    void WriteAsXMLToL(RWriteStream& aWriteStream);
+    
+    /**
+    * Getter for validate session (not STS session)
+    */
+    virtual CSenServiceSession* ServiceSession();
+    
+    /**
+    * Getter for transport (used coreManger as Factory for transport)
+    */
+    virtual MSenTransport& TransportL();
+    
+    /**
+    *   Sets STS session, used during registering STS which is not initiated. 
+    *   Clear STSsession will be created and assign during registering.
+    * @param aSession - clear sts session assign to this trust clint
+    */
+    void SetSTSSessionL(CWSStarServiceSession* aSession);                    
+    
+    CWSStarServiceSession* GetSTSSessionL();                    
+    /**
+    *   Sets version (mode) for trust client. Old or new trust
+    * @param aVersion - old or new trust version 
+    *   _LIT8( KTrustNamespace200502, "http://schemas.xmlsoap.org/ws/2005/02/trust");
+    *   _LIT8( KTrustNamespace200404, "http://schemas.xmlsoap.org/ws/2004/04/trust");
+    *
+    */
+    void SetVersion(const TDesC8* aVersion);
+    void SetHandlerCtx(MSenHandlerContext* aHndCtx);
+    
+    TBool HasSuperClass( TDescriptionClassType aType );
+        
+protected://methods
+    
+    /**
+    * C++ default constructor.
+    */
+    CWSStarTrustClient(    CSIF& aSIF,
+                                    TDescriptionClassType aType,
+                                    RFileLogger& aLogger);
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void BaseConstructL();
+    virtual TBool Matches(MSenServiceDescription& aPattern);
+    
+	virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; 			    
+
+private: //methods
+    void RandomEntropyClientL();
+    
+    /**
+    *   Create RST body skeleton.
+    */
+    CSenElement* CreateRSTL(TBool aRenewing, TPtrC8 aAppliesTo);
+    CSenElement* CreateBodyL();
+    
+    const TDesC8& GetAction();
+    const TDesC8& GetActionResponse();
+    const TDesC8& GetRequestType();
+    const TDesC8& GetPolicyNs();
+    
+    // Add ProviderID to primary keys (in addition to Endpoint, Contract and FrameworkID):
+    TBool HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate); 
+    void AdaptStsEndpointL(TBool aToOrginal = EFalse);
+private: // Data
+    CWSStarServiceSession* iWSStarServiceSession;   // Not owned, session which we validate
+    CWSStarServiceSession* iSTSSession;             //STS session, owned
+    HBufC8* iSTSOrginalEndpoint;             //STS session, owned
+    
+    CSenIdentityProvider* iIdentityProvider; // Not owned, comes from validation phase
+    RFileLogger& iLog;                      //not owned
+    
+    HBufC8* iEntropyClient;
+    TBool iPassportMode;
+    TBool iRenewingMode;
+    const TDesC8* iVersion;
+    HBufC8* iAppliesTo;//owned
+    CSenTransportBase* ipTransport;//owned
+    MSenHandlerContext* iHndCtx; //not owned
+    HBufC8* iTokenType;
+    TInt iTpCounter;
+	TSenDataTrafficDetails iTrustDetails;
+};
+
+#endif // TRUST_CLIENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/inc/wsstarvalidatehandler.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef WSSTAR_VALIDATE_HANDLER_H
+#define WSSTAR_VALIDATE_HANDLER_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+
+// INCLUDES
+#include <e32std.h>
+#include <flogger.h>
+#include "sensessionhandler.h"
+#include "wsstarhandlercontext.h"
+#include "wsstarsessioncontext.h"
+#include "SenIdentityProvider.h"
+#include "wsstartrustclient.h"
+#include "wsstarcons.h"
+#include "wsstarservicesession.h"
+
+
+
+/**
+ * Class:       
+ *
+ * Description: An implementation of the CWSStarHandler definition. This is concrete
+ * class, instance of which ECOM framework gives to ECOM clients.
+ */
+class CWSStarValidateHandler : public CSenSessionHandler
+    {
+
+public:
+
+
+   /**
+    * Function:    NewL
+    *
+    * Description: Create instance of concrete implementation. Note that ECOM
+    *              interface implementations can only have two signatures for
+    *              NewL:
+    *               - NewL without parameters (used here)
+    *               - NewL with TAny* pointer, which may provide some client
+    *                 data
+    *
+    * Returns:    Instance of this class.
+    *
+    * Note:       The interface, which is abstract base class of this
+    *             implementation, also provides NewL method. Normally abstract
+    *             classes do not provide NewL, because they cannot create
+    *             instances of themselves.
+    */
+    static CWSStarValidateHandler* NewL(TAny* aHandlerCtx);
+
+    /**
+    * InvokeL is the most emergent method in message handler interface.
+    * Each sub-class must implement this method thus providing message
+    * processing routine.
+    * @param aCtx is the session context that will be accessed and 
+    * typically altered by implemented handler, in order to provide
+    * modifications on the layer of the session construction, validation,
+    * or some other, focused area that the handler was intended to take
+    * responsibility for. For example, certain handler can itself create
+    * a session of its own, send message(s) to (authentication) service
+    * (invoking other handlers), and finally access session context in 
+    * order to update credentials. One example of such session handler
+    * could be WS-TRUST client type handler, an "internal service consumer".
+    */
+    virtual TInt InvokeL(MSenSessionContext& aCtx);
+    ~CWSStarValidateHandler();
+    virtual SenHandler::THandlerDirection Direction() const;
+    virtual SenHandler::THandlerPhase Phase();
+    virtual TInt InitL(MSenHandlerContext& aCtx);
+    RFileLogger* Log() const;
+        
+protected:
+    /**
+     * Function:   CWSStarValidateHandler
+     *
+     * Discussion: Perform the first phase of two phase construction
+     */
+    CWSStarValidateHandler(MSenHandlerContext& aCtx);
+    
+    /**
+    * Obtain or construct a valid SecurityTokenServiceClient. Ask
+    * owned ServiceManager for ServiceDescriptions that match
+    * STS contract & ProviderID.
+    *
+    * @param providerID
+    * @return SecurityTokenServiceClient
+    */
+    CWSStarTrustClient* STSClientL(CSenIdentityProvider*& aIdentityProvider);
+    
+    /**
+     * Function:   ConstructL
+     *
+     * Discussion: Perform the second phase construction of a
+     *             CImplementationClassPlus object.
+     */
+    void ConstructL();
+
+private:
+    /**
+     * Function:   IdentityProviderFromCoreL
+     *
+     * Discussion: copmplex getter. It asking core for IdentitProvider by using a pattern.
+     */
+    
+    CSenIdentityProvider* IdentityProviderFromCoreL(const TDesC8& aProviderID);
+    const TDesC8* iVersion;
+    };
+
+
+#endif // WSSTAR_VALIDATE_HANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/rom/wsstarplugin.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSSTARPLUGIN_IBY__
+#define __WSSTARPLUGIN_IBY__
+
+//WSStarPlugin & MessageHandlers
+ECOM_PLUGIN(WSStarPlugin.dll, 01234571.RSC)
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarcobrandingclient.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,546 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include "wsstarcobrandingclient.h"
+
+#include <s32mem.h>
+#include <f32file.h>
+#include <s32file.h>
+#include <SenXmlUtils.h>
+#include "sencryptoutils.h"
+
+#include "wsstarservicesession.h"
+#include "SenXmlUtils.h"
+#include "msencoreservicemanager.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "MSenServiceDescription.h"
+#include "senlogger.h"
+#include "SenServiceConnection.h"
+#include "seninternalserviceconsumer.h"
+#include "wsstarrstresponse.h"
+#include <SenCredential.h>
+#include "wsstarpolicy.h"
+#include "wsstarplugin.h"
+#include <SenTransportProperties.h>
+#include "senwspattern.h"
+
+using namespace WSTrust;
+using namespace WSPolicy;
+
+//namespace
+//    {
+//    _LIT8(KRemoteConsumer,       "RemoteConsumer");
+//    }
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class.
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingClient* CWSStarCoBrandingClient::NewL(
+                                                        CSIF& aSIF,
+                                                        RFileLogger& aLogger)
+    {
+    CWSStarCoBrandingClient* pNew = NewLC(aSIF, aLogger);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class and leaves the object on the cleanup stack
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingClient* CWSStarCoBrandingClient::NewLC(
+                                                        CSIF& aSIF,
+                                                        RFileLogger& aLogger)
+    {
+    CWSStarCoBrandingClient* pNew =
+        new (ELeave) CWSStarCoBrandingClient(
+                    aSIF,
+                    MSenServiceDescription::EWSStarSTSClient,
+                    aLogger);
+
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingClient::CWSStarCoBrandingClient(
+                                                CSIF& aSIF,
+                                                TDescriptionClassType aType,
+                                                RFileLogger& aLogger)
+    : CSenInternalServiceConsumer(aType, aSIF),
+    iLog(aLogger)
+    {
+    }
+
+void CWSStarCoBrandingClient::BaseConstructL()
+    {
+    CSenInternalServiceConsumer::ConstructL();
+    iTpCounter = 0;
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCoBrandingClient::ConstructL()")));
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingClient::~CWSStarCoBrandingClient()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCoBrandingClient::~CWSStarCoBrandingClient");
+    delete ipTransport;
+    delete iCoBrandingOrginalEndpoint;
+    }
+
+
+//---------------------------------------------------------------------------
+// SetStatus
+//---------------------------------------------------------------------------
+//
+
+void CWSStarCoBrandingClient::SetStatus(TInt /*aStatus */)
+    {
+    // No implementation in Java
+     }
+
+//---------------------------------------------------------------------------
+// SetSTSSessionL
+//---------------------------------------------------------------------------
+//
+void CWSStarCoBrandingClient::SetCoBrandingSessionL(
+                                                CWSStarServiceSession* aSession)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCoBrandingClient::SetCoBrandingSessionL");
+    _LIT8(KTouch, "touch");
+    const TDesC8* attrValue = aSession->AsElement().AttrValue(KTouch);
+    if(attrValue != NULL)
+    	{
+    	AsElement().AddAttrL(KTouch, *attrValue);
+    	}
+    iCoBrandingSession = aSession;
+    }
+    
+//---------------------------------------------------------------------------
+// Fetch SCT request
+//---------------------------------------------------------------------------
+//Co-Branding CR
+TInt CWSStarCoBrandingClient::FetchSCTL(
+                                    CWSStarServiceSession& aSession,
+                                    HBufC8*& aErrorMessage)
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCoBrandingClient::FetchSCTL(..)");
+    TInt retVal(KErrNone);            // for returning error codes
+    iWSStarServiceSession = &aSession;            // save session
+    iWSStarServiceSession->AddConsumerL(*this);
+            
+    CWSStarSessionContext* coBrandingSsnContext = iCoBrandingSession->SessionContext();
+    CWSStarSessionContext* valSsnContext = iWSStarServiceSession->SessionContext();
+
+    //PART 2 ::
+    
+    HBufC8* pBodyXML = NULL;
+    HBufC8* coBrandResponseXML = NULL;
+
+    const TBool* brandID = coBrandingSsnContext->GetIntL(WSStarContextKeys::KBrandIDEnabled);
+    if(brandID && *brandID)
+        {
+            
+        //Create a Fetch SCt body and update
+        CWSStarPlugin& frmWSStar = (CWSStarPlugin&)Framework();
+        CSenElement* pBody = CreateFSTL();
+        
+        if(pBody)
+	    {
+	       
+	        //Update application info attribute
+	        if (CWSStarPolicy::CheckPolicyValueL(WSStarContextKeys::KMwsNamespace, iCoBrandingSession))
+	            {
+	                HBufC8* mwsNameSapce = CWSStarPolicy::GetPolicyValueL(WSStarContextKeys::KMwsNamespace,iCoBrandingSession);
+	                CleanupStack::PushL(mwsNameSapce);
+	                valSsnContext->Update(WSStarContextKeys::KMwsNamespace, mwsNameSapce->Des());    
+	                CleanupStack::PopAndDestroy(mwsNameSapce);
+
+	             }
+
+	        AddAppInfoHeaderL();
+	        
+	        //Update action
+	        valSsnContext->Update(WSStarContextKeys::KAction, KActionIssueFST200610);
+	        
+	        HBufC8* address = NULL;
+
+	        address = CWSStarPolicy::GetPolicyValueL(WSStarContextKeys::KWAPGW,iCoBrandingSession);    
+
+	        if (address)
+	            {
+	            valSsnContext->Update(WSStarContextKeys::KTo, *address);
+	            
+	            delete address;
+	            address = NULL;        
+	            }
+
+
+	        valSsnContext->Update(WSStarContextKeys::KBodyElement, pBody);
+	        pBodyXML = pBody->AsXmlL();
+	        CleanupStack::PushL(pBodyXML);
+	         
+
+	        //Set transport properties    
+	        CSenTransportProperties* transProp = CSenTransportProperties::NewLC();
+	        TPtrC8 value;
+	        value.Set(*valSsnContext->GetDesC8L(WSStarContextKeys::KAction));
+	        transProp->SetSoapActionL(value);
+	        
+	        // Get the IAP setting and accordingly set the transport properties
+	    	TUint32 id = 0;
+	    	TInt getIapRetCode = IapId(id);
+	    	
+	    	    ;
+	    	// Check whether IAP ID is pre-defined, and copy it only if such property value is found
+	    	//if ( getIapRetCode == KErrNone && id < 4294967295) // unsigned 4294967295 == -1 signed
+	    	if ( getIapRetCode == KErrNone && id < (TUint32)KErrNotFound) // unsigned 4294967295 == -1 signed
+	    	    {
+	    	    transProp->SetIapIdL(id); 
+	    	    }
+	    	// ETMI-6WAGDB end
+	    	
+	    	//limit http timeout, 
+	    	//  if sts hangs and can not send any response, then we block every async client method.
+	    	//  Possibel revalidation during sendL can take too long time therefore we create new limit
+	    	transProp->SetMaxTimeToLiveL(WSStarSession::KMaxHttpTimeOut);
+	    	 	    
+	    	const TDesC8* pMwsNamespace = valSsnContext->GetDesC8L(WSStarContextKeys::KMwsNamespace);
+	    	
+	    	if(pMwsNamespace)
+	    	    transProp->SetMwsNamespaceL(*pMwsNamespace);
+
+	        HBufC8* transPropAsXml = transProp->AsUtf8LC();
+
+	        //overwrite passport endpoint (provided by GUI)  by endpoint provided by policy
+	        AdaptCoBrandEndpointL();
+
+	        iTpCounter++;
+	        retVal = iWSStarServiceSession->SubmitL(*pBodyXML, *transPropAsXml, *this, coBrandResponseXML);
+	        iTpCounter--;
+	        CleanupStack::PushL(coBrandResponseXML);
+	        AdaptCoBrandEndpointL(ETrue);
+	        valSsnContext->Remove(WSStarContextKeys::KTo);    
+	        valSsnContext->Remove(WSStarContextKeys::KAppInfoPresent);    
+	        
+	        
+	        if(coBrandResponseXML)
+	            {
+	            //Parse the response
+	            CSenParser* pParser = CSenParser::NewLC();
+	            CSenSoapEnvelope2* pResponseFragment = CSenSoapEnvelope2::NewL();
+	            CleanupStack::PushL(pResponseFragment);
+		        TRAPD(errorL,pParser->ParseL(*coBrandResponseXML, *pResponseFragment));
+
+	            if ( retVal!= KErrNone || errorL!= KErrNone)
+	                {
+	                    aErrorMessage = coBrandResponseXML;
+	                }
+	            
+	            CleanupStack::PopAndDestroy(2);  // pParser, pResponseFragment            
+	                
+	            }
+	            
+	        if (!aErrorMessage)
+	            {
+	            CleanupStack::PopAndDestroy(coBrandResponseXML);               
+	            }
+	        else
+	            {
+	            CleanupStack::Pop(coBrandResponseXML);
+	            }
+	        
+	        CleanupStack::PopAndDestroy(transPropAsXml);
+	        CleanupStack::PopAndDestroy(transProp);
+	        CleanupStack::PopAndDestroy(pBodyXML); 
+	        
+	    }
+    }
+
+    if (! iTpCounter)
+        {
+        delete ipTransport;
+        ipTransport = NULL;
+        }
+        
+    
+    iWSStarServiceSession->RemoveConsumerL(*this);
+
+    return retVal;
+    
+}
+//End Of Co-Branding
+void CWSStarCoBrandingClient::AddAppInfoHeaderL()
+{
+    CWSStarSessionContext* valSsnContext = iWSStarServiceSession->SessionContext();
+
+    //Update application info attribute
+    if (CWSStarPolicy::CheckPolicyValueL(WSStarContextKeys::KAppInfo, iCoBrandingSession))
+        {
+            valSsnContext->Update(WSStarContextKeys::KAppInfoPresent, ETrue);
+
+            RPointerArray<CSenElement> aAppElements;
+            CWSStarPolicy::GetPolicyValueL(WSStarContextKeys::KAppInfo,WSStarContextKeys::KApplication,iCoBrandingSession,aAppElements);
+            
+            for(TInt i=0;i<aAppElements.Count();i++)
+                {
+                  CSenElement* element = aAppElements[i];
+                  if(element->LocalName() == KName)
+                  {
+                    valSsnContext->Update(WSStarContextKeys::KApplicationName, element->Content());    
+                  }
+                  if(element->LocalName() == WSStarContextKeys::KVendor)
+                  {
+                    valSsnContext->Update(WSStarContextKeys::KApplicationVendor, element->Content());    
+                  }
+                  if(element->LocalName() == WSStarContextKeys::KVersion)
+                  {
+                    valSsnContext->Update(WSStarContextKeys::KApplicationVersion, element->Content());    
+                  }
+                }
+           
+            RPointerArray<CSenElement> aDeOpElements;
+            CWSStarPolicy::GetPolicyValueL(WSStarContextKeys::KAppInfo,WSStarContextKeys::KDeviceOptions,iCoBrandingSession,aDeOpElements);
+            for(TInt i=0;i<aDeOpElements.Count();i++)
+                {
+                  CSenElement* element = aDeOpElements[i];
+                  if(element->LocalName() == WSStarContextKeys::KLocale)
+                  {
+                    valSsnContext->Update(WSStarContextKeys::KLocale, element->Content());    
+                  }
+                  if(element->LocalName() == WSStarContextKeys::KUserAgent)
+                  {
+                    RPointerArray<CSenElement> childElements1 = element->ElementsL();
+                    for(TInt j=0;j<childElements1.Count();j++)
+                    {
+                      CSenElement* childElement1 = childElements1[j];
+                      if(childElement1->LocalName() == WSStarContextKeys::KManufacturer)
+                          {
+                            valSsnContext->Update(WSStarContextKeys::KManufacturer, childElement1->Content());    
+                          }
+                      if(childElement1->LocalName() == WSStarContextKeys::KModel)
+                          {
+                            valSsnContext->Update(WSStarContextKeys::KModel, childElement1->Content());    
+                          }
+                      if(childElement1->LocalName() == WSStarContextKeys::KIMSI)
+                          {
+                            valSsnContext->Update(WSStarContextKeys::KIMSI, childElement1->Content());    
+                          }
+                      if(childElement1->LocalName() == WSStarContextKeys::KOS)
+                          {
+                          
+                                RPointerArray<CSenElement> childElements2 = childElement1->ElementsL();
+                                for(TInt k=0;k<childElements2.Count();k++)
+                                {
+                                  CSenElement* childElement2 = childElements2[k];
+                                  if(childElement2->LocalName() == WSStarContextKeys::KName)
+                                      {
+                                        valSsnContext->Update(WSStarContextKeys::KDeviceName, childElement2->Content());    
+                                      }
+                                  if(childElement2->LocalName() == WSStarContextKeys::KVersion)
+                                      {
+                                        valSsnContext->Update(WSStarContextKeys::KDeviceVersion, childElement2->Content());    
+                                      }
+                                }
+                          }
+                      }
+                  }
+               }
+        }
+}
+CSenServiceSession* CWSStarCoBrandingClient::ServiceSession()
+    {
+    return iWSStarServiceSession;
+    }
+
+//---------------------------------------------------------------------------
+// Create body for Fetch SCT request
+//---------------------------------------------------------------------------
+//Co-Branding CR
+CSenElement* CWSStarCoBrandingClient::CreateFSTL()
+{
+
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::CreateFSTL");
+
+//-----------------
+//1 Proxy
+//-----------------
+
+    if (CWSStarPolicy::CheckPolicyValueL(WSStarContextKeys::KWAPGW, iCoBrandingSession))
+        {
+        
+        HBufC8* wapGW = CWSStarPolicy::GetPolicyValueL(WSStarContextKeys::KWAPGW, iCoBrandingSession);
+        if (wapGW)
+            {
+             CleanupStack::PushL(wapGW);
+            }  
+        else
+            {
+                //Hard Coded Value    
+            }
+        
+        CSenDomFragment* domFrg = CSenDomFragment::NewL(KFSTTag);
+        CSenElement* elementRst = domFrg->ExtractElement();
+        
+        CleanupStack::PushL(elementRst);
+        
+        delete domFrg;
+        domFrg = NULL;
+                
+        elementRst->AddNamespaceL(KNullDesC8,*wapGW);
+        
+
+        CleanupStack::Pop(elementRst);
+        
+        if (wapGW)
+            {
+             CleanupStack::PopAndDestroy(wapGW);
+            }  
+                    
+        return elementRst;
+        }
+    
+    return NULL;        
+
+}
+
+//End Of Co-Branding
+MSenTransport& CWSStarCoBrandingClient::TransportL()
+    {
+    if(!ipTransport)
+        {
+        // Core is capable of working as transport factory, too.
+        // The returned transport instancies may or may not be
+        // ECOM plugins:
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::Instantiating new transport");
+        ipTransport = Framework().Manager().CreateL(*iWSStarServiceSession, iWSStarServiceSession); 
+        }
+    return *ipTransport;
+    }    
+//---------------------------------------------------------------------------
+// Getter for endpoint
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarCoBrandingClient::Endpoint()
+    {
+    return iWSStarServiceSession->Endpoint();
+    }
+//---------------------------------------------------------------------------
+// Getter for contract
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarCoBrandingClient::Contract()
+    {
+    return iWSStarServiceSession->Contract();
+    }
+//---------------------------------------------------------------------------
+// Getter for providerId
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarCoBrandingClient::ProviderID()
+    {
+    return iWSStarServiceSession->ProviderID();
+    }
+
+//---------------------------------------------------------------------------
+// Getter for framework
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarCoBrandingClient::FrameworkId()
+    {
+    return iWSStarServiceSession->FrameworkId();
+    }
+//---------------------------------------------------------------------------
+// serialie to xml
+//---------------------------------------------------------------------------
+//
+void CWSStarCoBrandingClient::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    iWSStarServiceSession->WriteAsXMLToL(aWriteStream);
+    }
+MSenServicePolicy* CWSStarCoBrandingClient::ServicePolicy()
+    {
+    return iWSStarServiceSession->ServicePolicy();
+    }
+TInt CWSStarCoBrandingClient::IapId(TUint32& aCurrentIapId)
+    {
+    return iWSStarServiceSession->IapId(aCurrentIapId);
+    }
+
+//---------------------------------------------------------------------------
+// setter for ws-trust version
+//---------------------------------------------------------------------------
+//
+void CWSStarCoBrandingClient::SetHandlerCtx(MSenHandlerContext* aHndCtx)
+    {
+    iHndCtx = aHndCtx;
+    }
+
+//Co-branding CR    
+TInt CWSStarCoBrandingClient::AdaptCoBrandEndpointL(TBool aToOrginal)	//codescannerwarnings
+    {
+
+    TInt returnValue( KErrNone );
+    if (aToOrginal)
+        {
+        iWSStarServiceSession->SetEndPointL(*iCoBrandingOrginalEndpoint);
+        return returnValue;
+        }
+    delete iCoBrandingOrginalEndpoint;
+    iCoBrandingOrginalEndpoint = NULL;
+    iCoBrandingOrginalEndpoint = iWSStarServiceSession->Endpoint().AllocL();        
+    HBufC8* address = NULL;
+    
+    address = CWSStarPolicy::GetPolicyValueL(WSStarContextKeys::KWAPGW,iCoBrandingSession);    
+    
+    if (address)
+        {
+        iWSStarServiceSession->SetEndPointL(*address);
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::AdaptCoBrandEndpointL() - endpoint replaced by value from policy");
+        
+        delete address;
+        address = NULL;        
+        }
+    else
+        {
+        returnValue = KErrNotFound;
+        }
+
+    return returnValue;
+    }    
+    
+TBool CWSStarCoBrandingClient::Matches(MSenServiceDescription& aOtherServiceDescription)
+    {
+    return iWSStarServiceSession->Matches(aOtherServiceDescription);
+
+    }
+    
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarcobrandinghandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,330 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+//co-branding CR
+#include <e32std.h>
+#include "wsstarcobrandinghandler.h"
+#include "wsstarcobrandingclient.h"
+#include "senpointermap.h"
+#include "wspolicy.h"
+#include "sendebug.h"
+#include "wsstardictionary.h"
+#include "MSenServicePolicy.h"
+#include "wsstarpolicymanager.h"
+#include "senlogger.h"
+
+//---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingHandler* CWSStarCoBrandingHandler::NewL(TAny* aHandlerCtx)
+    {    
+    MSenHandlerContext* handlerCtx = reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarCoBrandingHandler* self   = new (ELeave) CWSStarCoBrandingHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingHandler::CWSStarCoBrandingHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarCoBrandingHandler::~CWSStarCoBrandingHandler()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("~CWSStarCoBrandingHandler::~CWSStarCoBrandingHandler()")));
+    }
+
+//---------------------------------------------------------------------------
+// Second phase construction.
+//---------------------------------------------------------------------------
+//
+void CWSStarCoBrandingHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarCoBrandingHandler::ConstructL()")));
+    }
+
+//---------------------------------------------------------------------------
+// the most emergent method in message handler interface.
+// Each sub-class must implement this method thus providing message processing routine.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarCoBrandingHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+    TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "CWSStarCoBrandingHandler::InvokeL(MSenMessageContext& aCtx)" );
+
+//getting data from input
+    CWSStarServiceSession* pNewSession =
+            (CWSStarServiceSession*)aCtx.GetSenRemoteServiceSessionL(
+            WSStarContextKeys::KServiceSession());
+    if (pNewSession->ProviderID() == KNullDesC8)
+        {
+        return KErrNone;
+        }
+
+//try to find identity provider for curennt webService using its ProviderId
+    CSenIdentityProvider* pIdentityProvider = IdentityProviderFromCoreL(
+            pNewSession->ProviderID());
+    if (!pIdentityProvider)
+        {
+        return KErrNotFound;
+        }
+        
+    
+    CWSStarTrustClient* pSTSClient = STSClientL(pIdentityProvider);
+    if (pSTSClient)
+            {
+ 
+ 
+            CSIF* sif = (CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF());
+        
+        
+            CWSStarServiceSession* wsSTSSession =   
+                                            pSTSClient->GetSTSSessionL();                           
+ 
+            CWSStarCoBrandingClient* wsStarCoBrandingClient = 
+                                CWSStarCoBrandingClient::NewL(*sif,*Log());
+            
+            if (wsStarCoBrandingClient)
+                    {
+                    
+                    CleanupStack:: PushL(wsStarCoBrandingClient);
+                    
+                    TInt error(KErrNone);
+                    wsStarCoBrandingClient->SetHandlerCtx(&iHandlerContext);
+                    //wsStarCoBrandingClient->SetVersion(iVersion);
+                    
+                    wsStarCoBrandingClient->SetCoBrandingSessionL(wsSTSSession);
+
+                    //validate session of concrete WebService
+                    HBufC8* errorMessage = NULL;
+                    TInt leaveCode( KErrNone );
+                    TRAP( leaveCode, error = wsStarCoBrandingClient->FetchSCTL( *pNewSession, errorMessage ); )    
+#ifdef _SENDEBUG
+                    if( leaveCode )
+                        {
+                        TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "CWSStarCoBrandingHandler::InvokeL(MSenMessageContext& aCtx):" );
+                        TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "- wsStarCoBrandingClient->FetchSCTL() leaved!" );
+                        }
+#endif // _SENDEBUG                    
+                    leaveCode = 0; // not used in release builds
+                    //((MSenContext&)aCtx).Update(WSStarContextKeys::KReAuthNeeded, EFalse);
+                    if (errorMessage)
+                        {
+                       ((MSenContext&)aCtx).Update(WSStarContextKeys:: KErrMessage,  *errorMessage);
+                        }
+                    delete errorMessage;
+                    errorMessage = NULL;
+                    //if credential expired session will use validator to obtain new
+                    
+                    // Core / XML DAO takes ownership of new session (will keep in array of SD):
+                    // - new session HAS
+                    //      - credential
+                    //      - context which keep for example key for signing message        
+                    // - if duplicate (equal primary keys) exists, it is deleted
+                    
+                    CleanupStack:: PopAndDestroy(wsStarCoBrandingClient);
+                     
+                    return error;
+                    }
+               else
+                    {
+                    return KErrNotFound;
+                    }
+                     
+            }
+       else
+            {
+            return KErrNotFound;
+            }
+            
+                                
+     }
+
+//---------------------------------------------------------------------------
+// Obtain or construct STS client
+//---------------------------------------------------------------------------
+//
+  
+CWSStarTrustClient* CWSStarCoBrandingHandler::STSClientL(CSenIdentityProvider*& aIdentityProvider)
+{
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSStarPlugin::STSClientL")));
+
+    CWSStarTrustClient* pSTSClient = NULL;
+    //providerId from Identities.xml
+    TPtrC8 providerId(KNullDesC8);
+    if(aIdentityProvider)
+        {
+        providerId.Set(aIdentityProvider->ProviderID());
+        }
+
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    CleanupClosePushL(serviceDescriptions);
+        
+    //try to find STS session in cache,some STS can be registered
+    TInt retVal(KErrNone);
+    
+    TRAPD(error, retVal = iHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, KWSStarSTSContract()));
+    if(!retVal&&!error)
+        {
+        RPointerArray<CSenWSDescription> matches;
+        CleanupClosePushL(matches);
+        
+        for(TInt i = 0; i < serviceDescriptions.Count(); i++)
+            {
+            //select XMLDescription from DAO where contract = STS, so we can cast
+            pSTSClient = (CWSStarTrustClient*)serviceDescriptions[i];
+            if(providerId.Length()>0)
+                {
+                TPtrC8 providerIDFromDescription = pSTSClient->ProviderID();
+                if(providerIDFromDescription == providerId)
+                    {
+                    matches.AppendL(pSTSClient);
+                    }
+                }
+            else
+                {
+                matches.AppendL(pSTSClient);
+                }
+            }
+        if(matches.Count())
+            {
+            pSTSClient =
+                reinterpret_cast<CWSStarTrustClient*>(matches[0]);
+            pSTSClient->SetAccount(aIdentityProvider);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSStarValidateHandler::STSClient - No matching STS description available!")));
+            pSTSClient = NULL;
+            }
+    
+        //if we find multi sts client (different only with lifetime, probably Secure Context Token lifetime)
+        if(matches.Count() > 1)
+            {
+            // search for a instance with longest validity
+            for(TInt i = matches.Count()-1; i > 0 ; i--)
+                {
+                CWSStarTrustClient* pNewerSTSClient =
+                  reinterpret_cast<CWSStarTrustClient*>(matches[i]);
+                CWSStarServiceSession* newerSession = (CWSStarServiceSession*)pNewerSTSClient->ServiceSession();
+                CWSStarServiceSession* session = (CWSStarServiceSession*)pSTSClient->ServiceSession();
+                
+				if(newerSession && session) // STSClient Session was not set, if not validated 
+					{
+					if(newerSession->ValidUntilL() > session->ValidUntilL())
+					  	{
+					    pSTSClient = pNewerSTSClient;
+					    pSTSClient->SetAccount(aIdentityProvider);
+					    }
+					}
+                }
+            }
+            CleanupStack::PopAndDestroy(2, &serviceDescriptions);
+        }
+    else
+        {
+          CleanupStack::PopAndDestroy(&serviceDescriptions);
+        }
+    
+    
+    //no session, so we have create new STS client, temporary code 
+
+    //- if (!pSTSClient)
+    //-    {
+    //-    CSIF* sif = (CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF());
+    //-    pSTSClient = CWSStarTrustClient::NewL(*sif,*Log());
+    //-    }
+    return pSTSClient;
+}
+
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+SenHandler::THandlerDirection CWSStarCoBrandingHandler::Direction() const
+    {
+    return SenHandler::EBoth;
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+SenHandler::THandlerPhase CWSStarCoBrandingHandler::Phase()
+    {
+    return SenHandler::EValidate;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//   
+CSenIdentityProvider* CWSStarCoBrandingHandler::IdentityProviderFromCoreL(
+                                            const TDesC8& aProviderID)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarCoBrandingHandler::IdentityProviderLFromCore");
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if(aProviderID.Length() > 0)
+        {
+        CDesC8ArrayFlat* array = new (ELeave) CDesC8ArrayFlat(1);
+        CleanupStack::PushL(array);
+        array->AppendL(aProviderID);
+        pIdentityProvider = iHandlerContext.GetSenCoreServiceManager()->
+                IdentityProviderL(*array, ETrue);
+        CleanupStack::PopAndDestroy(array);
+        }
+    return pIdentityProvider;
+    }
+
+//---------------------------------------------------------------------------
+// Init implementation
+//---------------------------------------------------------------------------
+//
+TInt CWSStarCoBrandingHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+RFileLogger* CWSStarCoBrandingHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+    
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarcredentialobserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     
+*
+*/
+
+
+
+
+
+#include "sendebug.h"
+#include "senlogger.h"
+#include "wsstarcredentialobserver.h"
+const TInt64 KHalfHour = 1000000 *60*30; //2;//30;  2 minutes instead 30
+CWSStarCredentialObserver::CWSStarCredentialObserver(CWSStarServiceSession* aSession, RFileLogger* aLogger) : CTimer( EPriorityStandard )// Standard priority
+{
+    iSession = aSession;
+    iLogger = aLogger; 
+}
+
+CWSStarCredentialObserver* CWSStarCredentialObserver::NewLC(CWSStarServiceSession* aSession, RFileLogger* aLogger)
+{
+	CWSStarCredentialObserver* self = new ( ELeave ) CWSStarCredentialObserver(aSession, aLogger);
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+}
+
+CWSStarCredentialObserver* CWSStarCredentialObserver::NewL(CWSStarServiceSession* aSession, RFileLogger* aLogger)
+{
+	CWSStarCredentialObserver* self = CWSStarCredentialObserver::NewLC(aSession, aLogger);
+	CleanupStack::Pop(); // self;
+	return self;
+}
+
+void CWSStarCredentialObserver::ConstructL()
+{
+	CTimer::ConstructL() ;	// Initialize timer
+	CActiveScheduler::Add( this );				// Add to scheduler
+          iRunned = EFalse;
+}
+
+CWSStarCredentialObserver::~CWSStarCredentialObserver()
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCredentialObserver::~ - ");   
+	Cancel(); // Cancel any request, if outstanding
+	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"                        - cancelled");   
+	
+}
+
+//void CWSStarCredentialObserver::Start(const TTime &aTime)
+void CWSStarCredentialObserver::Start(const TTimeIntervalMicroSeconds& aDiff) 
+{
+    if (iRunned)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarCredentialObserver::Start - cancelled");   
+        Cancel();
+        }
+        
+    iRestTime = aDiff.Int64();
+    StartCount();
+    iRunned = ETrue;
+}
+void CWSStarCredentialObserver::StartCount() 
+{
+    if (iRestTime > KHalfHour) 
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarCredentialObserver::start - START only half hour  = %Ld microsec"), KHalfHour));
+        After((TInt)KHalfHour);
+        iRestTime = iRestTime - KHalfHour;
+        }
+    else
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarCredentialObserver::start - START rest = %Ld microsec"), iRestTime));
+        After((TInt)iRestTime);
+        iRestTime = 0;
+        }
+}
+
+
+void CWSStarCredentialObserver::RunL()
+{
+    if (!iRestTime )
+        {
+        iRunned = EFalse;
+        HBufC8* error(NULL);
+        iSession->SessionContext()->Update(WSStarContextKeys::KOnlySharing, EFalse); 
+        iSession->SessionContext()->Update(WSStarContextKeys::KReAuthNeededFromCredObserv, ETrue);
+        TInt retVal = iSession->RevalidateMobileTicketIfExpiredL( error );
+        iSession->SessionContext()->Update(WSStarContextKeys::KReAuthNeededFromCredObserv, EFalse);
+        delete error;
+        error = NULL;    
+        }
+    else
+        {
+        StartCount();
+        }
+}
+
+RFileLogger* CWSStarCredentialObserver::Log() const
+    {
+    return iLogger;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstardictionary.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,944 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <utf.h>
+#include <sysutil.h>
+#include <ezcompressor.h>
+#include "wsstardictionary.h"
+#include "wsstarhttpclient.h"
+#include "wsstarpolicy.h"
+#include "sendebug.h"
+#include "senxmldebug.h"
+#include "senlogger.h"
+
+using namespace WSPolicy;
+namespace
+{
+    _LIT8(KHttp, "http");
+    _LIT(KDictionaryFile, "dictionary.xml");
+    _LIT8(KDictionaryType, "Type");
+    _LIT8(KDictionaryId, "Id");
+    _LIT8(KDictionaryChkSum, "Chksum");
+    // helper methods          
+    /*
+    void TUint32ToDes(TDes8& aResult, TUint32 aData)
+        {
+        TUint32 part1= aData & 0xff000000 ;
+        part1 = part1 >> 24;
+        TUint32 part2= aData & 0x00ff0000;
+        part2 = part2 >> 16;
+        TUint16 part3= aData & 0x0000ff00;
+        part3 = part3 >> 8;
+        TUint16 part4= aData & 0x000000ff;
+        
+        TUint8 p1(part1);
+        TUint8 p2(part2);
+        TUint8 p3(part3);
+        TUint8 p4(part4);
+        
+        aResult.Append(p1);
+        aResult.Append(p2);
+        aResult.Append(p3);
+        aResult.Append(p4);
+        }
+    */
+    
+    /*
+    TUint32 DesToTUint32(const TDesC8& aData)
+        {
+        TUint32 part1 = aData[0];
+        part1 = part1-48;
+        part1 = part1 << 24;
+        TUint32 part2 = aData[1];
+        part2 = part2-48;
+        part2 = part2 << 16;
+        TUint32 part3 = aData[2];
+        part3 = part3-48;
+        part3 = part3 << 8;
+        TUint32 part4 = aData[3];
+        part4 = part4-48;
+       
+        TUint32 ret = part1+part2+part3+part4;
+        return ret;
+        }
+    */      
+}
+//---------------------------------------------------------------------------
+// Create instance of this class
+//---------------------------------------------------------------------------
+//
+CWSStarDictionary* CWSStarDictionary::NewL(CSIF& aSIF, RFileLogger& aLogger)
+    {
+    
+    CWSStarDictionary* self   = new (ELeave) CWSStarDictionary(aSIF, aLogger);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarDictionary::CWSStarDictionary(CSIF& aSIF, RFileLogger& aLogger) 
+:iSIF(&aSIF), iLog(aLogger)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarDictionary::~CWSStarDictionary()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarDictionary::~CWSStarDictionary()")));
+    iDictionaires.ResetAndDestroy();
+    delete iSavePath;
+    }
+
+//---------------------------------------------------------------------------
+// void CWSStarDictionary::ConstructL()
+//---------------------------------------------------------------------------
+//
+void CWSStarDictionary::ConstructL()
+    {   
+     TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarDictionary::ConstructL()")));
+
+#if !defined( EKA2 ) && !defined( RD_SECURE_PRIV_DATA )
+        iSavePath = KPrivateFolder().AllocL();
+#else
+        TBuf<KMaxPath> privatePath;
+        RFs fss;
+            User::LeaveIfError(fss.Connect());
+            CleanupClosePushL(fss);
+        fss.CreatePrivatePath(EDriveC);
+        fss.PrivatePath(privatePath);
+        iSavePath = privatePath.AllocL();
+        CleanupStack::PopAndDestroy(1);
+#endif
+    }
+CZlibDictionary* CWSStarDictionary::Dictionary(const TDesC8& aName)
+{
+ 
+    TInt count(iDictionaires.Count());
+    for (TInt i = 0; i< count; i++)
+    {
+        CZlibDictionary* tempDict = iDictionaires[i];
+        if(tempDict->DictName() == aName)
+        {
+          return tempDict;  
+        }
+    }
+
+    return NULL;
+}    
+
+TBool CWSStarDictionary::IfDictionaryExist(CZlibDictionary* aDict)
+{
+ 
+    TInt count(iDictionaires.Count());
+    for (TInt i = 0; i< count; i++)
+    {
+        CZlibDictionary* tempDict = iDictionaires[i];
+        if(tempDict->DictName() == aDict->DictName() &&  
+        tempDict->DictCheckSumPtr() == aDict->DictCheckSumPtr()
+        ) //Id and checksum is same, its same dictionary
+        {
+          return ETrue;  
+        }
+    }
+    
+    return EFalse;
+}
+
+//---------------------------------------------------------------------------
+// void CWSStarDictionary::CreateZlibL
+// create a CZlibDictionary object from given dictionary inforamtion
+//---------------------------------------------------------------------------
+//
+void CWSStarDictionary::CreateMSZlibL(const TDesC8* name, CSenElement* aDict)
+{
+
+    const TDesC8* type = aDict->AttrValue(KMwsType);
+    const TDesC8* checksum = aDict->AttrValue(KMwsId);
+
+   if(aDict->HasContent())
+    {
+        TPtrC8 uri = aDict->Content();
+            
+        if(name && type && checksum && uri!= KNullDesC8())
+        {
+
+            CZlibDictionary* dict = CZlibDictionary::NewLC(uri, name, type, checksum);
+            if(dict)
+            {
+                if(!IfDictionaryExist(dict))
+                {
+                    iDictionaires.Append(dict);    
+                    CleanupStack::Pop( dict );                    
+                }
+                else //exist
+                {
+//                Reset only when we know that the uri has been changed
+               
+                    CZlibDictionary* tempDict = Dictionary(dict->DictName());
+                    if(tempDict)                     
+                    {
+                        if( tempDict->DictUri() == dict->DictUri()
+//                         && tempDict->DictType() == dict->DictType()
+                            )
+                        {
+                            //do nuthhing
+                        }
+                        else
+                        {
+                            tempDict->ResetL(dict);
+                        }
+                    }
+                    CleanupStack::PopAndDestroy( dict );
+                }
+            }
+            else
+            {
+                CleanupStack::PopAndDestroy( dict );
+            }
+        }
+        
+    }    
+    
+}
+
+void CWSStarDictionary::CreateZlibL(const TDesC8* name, CSenElement* aDict)
+{
+    if(!name || ! aDict)
+        return;
+
+    const TDesC8* type = aDict->AttrValue(KDictionaryType);
+    const TDesC8* checksum = aDict->AttrValue(KDictionaryChkSum);
+
+   if(aDict->HasContent())
+    {
+        TPtrC8 uri = aDict->Content();
+            
+        if(name && type && checksum && uri!= KNullDesC8())
+        {
+
+            CZlibDictionary* dict = CZlibDictionary::NewLC(uri, name, type, checksum);
+            if(dict && !IfDictionaryExist(dict))
+            {
+                iDictionaires.Append(dict);
+                CleanupStack::Pop( dict );
+                
+            }
+            else
+            {
+                CleanupStack::PopAndDestroy( dict );
+            }
+        }
+        
+    }    
+    
+}
+
+//---------------------------------------------------------------------------
+// TInt CWSStarDictionary::InvokeL
+// This method invoke the Http download of dictionaries. The dictionaries will 
+// be downloaded adn saves to private folder of the serene
+//---------------------------------------------------------------------------
+//
+TInt CWSStarDictionary::InvokeL(MSenHandlerContext* iHndlrCtx, CSenWSDescription* aSD)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarDictionary::InvokeL(MSenMessageContext& aCtx)")));
+    TInt error(KErrNotFound);
+//1..load dictionary.xml file
+//2..load all of dictionaries and verify it
+    LoadDictionariesL();
+
+
+//3..get dictionary element from policy
+//only sts policy will be considered at this point
+   CSenElement* ret = CWSStarPolicy::GetElementL(KDictionaries, KNullDesC8(), *iHndlrCtx, aSD);
+    if(ret)
+    {
+        RPointerArray<CSenElement>& children = ret->ElementsL();
+        TInt count = children.Count();
+        for (TInt i =0; i < count; i++)
+        {
+            CSenElement* ele = children[i];
+            if(ele)
+            {
+                const TDesC8* name = ele->AttrValue(KMwsId);
+                RPointerArray<CSenElement> dicts;
+                CleanupClosePushL(dicts);
+                ele->ElementsL(dicts, KDictionary);
+
+                TInt count2 = dicts.Count();
+                for (TInt j =0; j < count2; j++)
+                {
+                    CSenElement* dictEle = dicts[j];
+                    if(dictEle)
+                    {
+                       CreateMSZlibL(name,dictEle);
+                       
+                    }
+                    
+                }
+                CleanupStack::PopAndDestroy(); //dicts
+                    
+             }
+
+        }
+
+    }
+//4..start putting dictionaries in xml file
+
+        
+ //5.. now use http to get all invalid dictionaries from iDictionaries
+   
+    TInt count(iDictionaires.Count());
+    TPtrC8 finalUri(KHttp);
+    if(finalUri != KNullDesC8)
+        {
+        TRAP(error, GetHttpDictionaryL(finalUri, iHndlrCtx));
+        }
+    else 
+        {
+        error = KErrPathNotFound;
+        }
+
+//6..write iDictionaries to xml file
+    SaveConfigurationL();
+    iDictionaires.ResetAndDestroy(); //we dont need it any more
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// TInt CWSStarDictionary::SaveL
+// Saves a dictionary to a file
+//---------------------------------------------------------------------------
+//
+TInt CWSStarDictionary::SaveL(TFileName aFileName, const TDesC8& aContents)
+{
+    if (aFileName.Length() < 1 || aContents.Length() < 1)
+        return KErrArgument;
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    TInt size = aContents.Length();
+
+    TInt retVal(SysUtil::FFSSpaceBelowCriticalLevelL(&fss, size));
+    if(retVal == KErrNone)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"File system check: OK, there is enough space available.");
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"File system check: FAILED, NOT enough space available.");
+        CleanupStack::PopAndDestroy(); //fss
+        User::Leave(retVal);
+        }
+        
+        RFile  dictFile;
+        CleanupClosePushL(dictFile);
+
+        retVal = dictFile.Replace(fss , aFileName, EFileWrite );
+        if(retVal == KErrNone)
+            {
+            retVal = dictFile.Write(aContents);        
+            }
+
+       
+       CleanupStack::PopAndDestroy(2); //fss, dictFile
+       return retVal;
+
+}
+//---------------------------------------------------------------------------
+// CWSStarDictionary::SaveFileL
+// Saves a dictionary to a file
+//---------------------------------------------------------------------------
+//
+
+void CWSStarDictionary::SaveFileL(const TDesC8& aUri, const TDesC8& aContents)
+{
+    TFileName filepath(iSavePath->Des());
+
+    TInt loc = aUri.LocateReverse('/');
+    if(loc != KErrNotFound)
+    {
+        TPtrC8 name = aUri.Right(aUri.Length() - loc - 1);
+        HBufC* nameBuf = HBufC::NewLC(name.Length());
+        TPtr nameBufPtr(nameBuf->Des());
+        TInt ret = CnvUtfConverter::ConvertToUnicodeFromUtf8(nameBufPtr, name);        
+        if(ret == KErrNone)
+        {
+            TFileName filename; 
+            filename.Append(nameBufPtr);
+            filepath.Append(filename);
+            ret = SaveL(filepath, aContents);
+        }
+        CleanupStack::PopAndDestroy(nameBuf);
+    }
+}
+//---------------------------------------------------------------------------
+// TInt CWSStarDictionary::GetHttpDictionaryL
+//Method to download the dictionaries by HTTP
+//---------------------------------------------------------------------------
+//
+
+TInt CWSStarDictionary::GetHttpDictionaryL( const TDesC8& aEndpoint, MSenHandlerContext* aHndlrCtx )
+    {
+    if( !aHndlrCtx )
+        {
+        return KErrArgument;
+        }    
+//find the service description from handlercontext i.e. STS service        
+    TPtrC8 contract(KWSStarSTSContract);
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    CleanupClosePushL(serviceDescriptions);
+    TInt retVal(KErrNone);
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, retVal = aHndlrCtx->GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, contract));
+    CSenWSDescription* pSD = NULL;   
+    
+    if(leaveCode == KErrNone && retVal == KErrNone && serviceDescriptions.Count() > 0)
+        {
+         
+        TUint32 iap(0);
+        for(TInt j = 0; j < serviceDescriptions.Count(); j++)
+            {
+            pSD = serviceDescriptions[j];
+            if( pSD )
+                {
+                TInt getIapRetCode = pSD->IapId(iap);    
+                if( getIapRetCode == KErrNone )
+                    {
+                    pSD = serviceDescriptions[j]; // value IAP property over others (temp solution)
+                    break;
+                    }
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy( );  // serviceDescriptions.Close()
+
+    CSenWSDescription* pInitializer = CSenWSDescription::NewLC();
+    pInitializer->SetEndPointL(aEndpoint);
+
+    CWSStarHttpClient* pHttpClient = CWSStarHttpClient::NewLC(*(CSIF*)aHndlrCtx->GetAnyL(HandlerContextKey::KSIF()), pInitializer, *Log()); //*(CSIF*)iSenHandlerContext.GetAny(HandlerContextKey::KSIF()), pInitializer, *Log());//codescannerwarnings
+        
+    // Fix the first URI and request part of the request
+    TInt count( iDictionaires.Count() );
+    for (TInt i = 0; i< count; i++)
+        {
+        CZlibDictionary* tempDict = iDictionaires[i];   
+        if(!tempDict->Verified())
+            {
+        
+            TPtrC8 endpoint(tempDict->DictUri());        
+            TPtrC8 request(endpoint.Right(endpoint.Length() - aEndpoint.Length()));        
+
+            HBufC8* pResponse = NULL;
+            TInt leaveCode(KErrNone);
+            TInt submitRetCode(KErrNone);
+
+            TRAP( leaveCode, submitRetCode = pHttpClient->GetHttpL( request, pResponse, pSD ); )
+            pHttpClient->DataTrafficDetails(iDictDetails);
+            if( submitRetCode && retVal == KErrNone )
+                {
+                // Store the error code from the 1st failing request 
+                retVal = submitRetCode;
+                }    
+            if( leaveCode && retVal == KErrNone )
+                {
+                retVal = leaveCode;
+                }    
+            if(pResponse && pResponse->Length() > 0)
+                {
+                CleanupStack::PushL(pResponse);            
+                TPtrC8 resPtr(pResponse->Des());
+                if(tempDict->SetDictContentsL(resPtr) == KErrNone)
+                {
+                    SaveFileL(endpoint, resPtr);
+                    
+                }
+                CleanupStack::PopAndDestroy();
+                }    
+            else // if(retVal == 404)    
+                {
+                delete pResponse;
+                }
+            }
+        } // for each request
+    CleanupStack::PopAndDestroy(pHttpClient); 
+    CleanupStack::PopAndDestroy(pInitializer);  
+    return retVal;
+}
+
+TInt CWSStarDictionary::LoadDictionariesL()
+{
+    
+    TFileName dictXml(iSavePath->Des());
+    dictXml.Append(KDictionaryFile);
+    
+    CDictXml* dict= CDictXml::NewL();
+    CleanupStack::PushL(dict);
+    TInt fileError = dict->ReadFileL(dictXml);
+    if(fileError == KErrNone)
+    {
+        CSenElement* dictEle = dict->XMLDocL();
+        if(dictEle)
+        {
+            LoadDictionariesL(dictEle);
+        }
+    
+    }
+    CleanupStack::PopAndDestroy(dict);
+    return fileError;    
+}
+//---------------------------------------------------------------------------
+// void CWSStarDictionary::LoadFileL
+// This method Loads the dictionaries from the files present in private folder.
+//---------------------------------------------------------------------------
+//
+void CWSStarDictionary::LoadFileL(CZlibDictionary* aDict)
+{
+    TFileName filepath(iSavePath->Des());
+    
+    TPtrC8 uri = aDict->DictUri();
+    TInt loc = uri.LocateReverse('/');
+    
+    if(loc != KErrNotFound)
+    {
+        TPtrC8 name = uri.Right(uri.Length() - loc - 1);
+        HBufC* nameBuf = HBufC::NewLC(name.Length());
+        TPtr nameBufPtr(nameBuf->Des());
+        TInt ret = CnvUtfConverter::ConvertToUnicodeFromUtf8(nameBufPtr, name);        
+        if(ret == KErrNone)
+        {
+            TFileName filename; 
+            filename.Append(nameBufPtr);
+            filepath.Append(filename);
+            {
+                RFs fss;
+                User::LeaveIfError(fss.Connect());
+                CleanupClosePushL(fss);
+                
+                RFile  dictFile;
+                TInt error = dictFile.Open(fss , filepath, EFileRead );
+                CleanupClosePushL(dictFile);                
+                if(error == KErrNone)
+                {
+                    TInt size;
+                    dictFile.Size(size);
+                    if(size > 0)
+                    {
+                        HBufC8 *iBuf=HBufC8::NewLC(size);
+                        TPtr8 buf8ptr(iBuf->Des());
+                        dictFile.Read(buf8ptr,size);
+                        aDict->SetDictContentsL(buf8ptr);
+                        aDict->DeleteDictContents();
+                        CleanupStack::PopAndDestroy(iBuf);
+                        
+                    }
+                }
+                CleanupStack::PopAndDestroy(2); //fss, dictFile
+            }
+        }
+        CleanupStack::PopAndDestroy(nameBuf);
+    }
+}
+
+//---------------------------------------------------------------------------
+// void CWSStarDictionary::LoadDictionariesLs
+// This method Loads the dictionaries from the private folder. It reads the 
+// policy file for the possible dictionaries and load those dictionaries from 
+// priavte folder.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarDictionary::LoadDictionariesL(CSenElement*  aPolicy)
+{
+    if(aPolicy)
+    {
+        RPointerArray<CSenElement>& children = aPolicy->ElementsL();
+        TInt count = children.Count();
+        for (TInt i =0; i < count; i++)
+        {
+            CSenElement* ele = children[i];
+            if(ele)
+            {
+                const TDesC8* name = ele->AttrValue(KDictionaryId);
+                CreateZlibL(name,ele);
+                       
+            }
+        }
+        
+    }
+
+    TInt count(iDictionaires.Count());
+    for (TInt i = 0; i< count; i++)
+    {
+        CZlibDictionary* tempDict = iDictionaires[i];
+        if(tempDict)
+            LoadFileL(tempDict);
+    }
+
+    return KErrNone;
+}
+TInt CWSStarDictionary::SaveConfigurationL()
+{
+    TInt error(KErrNone);
+    HBufC8* ret = WriteAllAsXMlL();
+    CleanupStack::PushL(ret);
+    if(ret)
+    {
+        TPtrC filename(KDictionaryFile);
+        TPtrC8 dataptr(ret->Des());
+        error = SaveL(filename, dataptr);
+    }
+    CleanupStack::PopAndDestroy(ret);
+    return error;   
+}
+
+TPtrC8 CWSStarDictionary::WriteToBufL(CBufBase& aBuf)
+    {
+    RBufWriteStream bufWs(aBuf);
+    CleanupClosePushL(bufWs);
+    WriteL(bufWs);
+    CleanupStack::PopAndDestroy(); // bufWs.Close();
+    return aBuf.Ptr(0);
+    }
+HBufC8* CWSStarDictionary::WriteAllAsXMlL()
+{
+    CBufFlat *pBuf = CBufFlat::NewL(128);
+    CleanupStack::PushL(pBuf);
+    TPtrC8 p = WriteToBufL(*pBuf);
+    HBufC8* pRet = p.AllocL();
+    CleanupStack::PopAndDestroy(); // pBuf;
+    return pRet;    
+}
+         
+TInt CWSStarDictionary::WriteL(RWriteStream& aWriteStream)
+{
+    aWriteStream.WriteL(KSenLessThan);
+    aWriteStream.WriteL(KDictionaries);
+    aWriteStream.WriteL(KSenGreaterThan);
+    
+    TInt count(iDictionaires.Count());
+    for (TInt i = 0; i< count; i++)
+    {
+        CZlibDictionary* tempDict = iDictionaires[i];
+        TPtrC8 endpoint(tempDict->DictUri());
+        TPtrC8 type(tempDict->DictType());
+        TPtrC8 id(tempDict->DictName());
+        TPtrC8 chksum(tempDict->DictCheckSumPtr());
+          
+        if(id != KNullDesC8() && endpoint != KNullDesC8() && type != KNullDesC8() && chksum != KNullDesC8)
+        {
+            aWriteStream.WriteL(KSenLessThan);
+            aWriteStream.WriteL(KDictionary);
+            aWriteStream.WriteL(KSenSpace);
+            aWriteStream.WriteL(KDictionaryId);
+            aWriteStream.WriteL(KSenEqualsDblQuot);
+            aWriteStream.WriteL(id);
+            aWriteStream.WriteL(KSenDblQuot);
+            aWriteStream.WriteL(KSenSpace);            
+            aWriteStream.WriteL(KDictionaryType);
+            aWriteStream.WriteL(KSenEqualsDblQuot);
+            aWriteStream.WriteL(type);
+            aWriteStream.WriteL(KSenDblQuot);
+            aWriteStream.WriteL(KSenSpace);
+            aWriteStream.WriteL(KDictionaryChkSum);
+            aWriteStream.WriteL(KSenEqualsDblQuot);
+            aWriteStream.WriteL(chksum);
+            aWriteStream.WriteL(KSenDblQuot);
+            aWriteStream.WriteL(KSenSpace);
+            aWriteStream.WriteL(KSenGreaterThan);
+            aWriteStream.WriteL(endpoint);
+            
+            aWriteStream.WriteL(KSenLessThanSlash);
+            aWriteStream.WriteL(KDictionary);
+            aWriteStream.WriteL(KSenGreaterThan);
+
+        }
+    }
+
+    aWriteStream.WriteL(KSenLessThanSlash);
+    aWriteStream.WriteL(KDictionaries);
+	aWriteStream.WriteL(KSenGreaterThan);
+
+return KErrNone;    
+}
+void CWSStarDictionary::DataTrafficDetails(TSenDataTrafficDetails& aDetails) 		
+	{
+		aDetails = iDictDetails;
+	}
+//---------------------------------------------------------------------------
+// CWSStarDictionary::Log()
+//---------------------------------------------------------------------------
+//    
+RFileLogger* CWSStarDictionary::Log() const
+    {
+    return &iLog;
+//        return ((RFileLogger*)iHandlerContext.GetAny(HandlerContextKey::KLogger));
+    }
+
+
+//---------------------------------------------------------------------------
+// A simple Dictionary Object and its implementation
+//---------------------------------------------------------------------------
+//
+CZlibDictionary* CZlibDictionary::NewL( const TDesC8& aDictUri, 
+                                        const TDesC8* aDictName, 
+                                        const TDesC8* aDictType, 
+                                        const TDesC8* aDictCheckSum )
+{
+    CZlibDictionary* zlib   = CZlibDictionary::NewLC(aDictUri, aDictName, aDictType, aDictCheckSum);
+    CleanupStack::Pop();
+    return zlib;
+}
+                                
+CZlibDictionary* CZlibDictionary::NewLC( const TDesC8& aDictUri, 
+                                         const TDesC8* aDictName, 
+                                         const TDesC8* aDictType, 
+                                         const TDesC8* aDictCheckSum )
+{
+
+    CZlibDictionary* zlib   = new (ELeave) CZlibDictionary();
+    CleanupStack::PushL (zlib);
+    zlib->ConstructL(aDictUri, aDictName, aDictType, aDictCheckSum);
+    return zlib;
+    
+}
+
+CZlibDictionary::~CZlibDictionary()
+{
+    delete iDictUri; //uri to download
+    delete iDictName; //name or mws:Id tag
+    delete iDictType; //zlib or mws:type
+    delete iDictContents; //contents
+    delete iDictCheckSum; //provided checksum  
+}
+CZlibDictionary::CZlibDictionary()
+:iVerfied(EFalse)
+{
+}
+
+void CZlibDictionary::ConstructL( const TDesC8& aDictUri, 
+                                  const TDesC8* aDictName,
+                                  const TDesC8* aDictType, 
+                                  const TDesC8* aDictCheckSum )
+    {
+    iDictUri = aDictUri.AllocL();
+    iDictName = aDictName->AllocL(); 
+    iDictType = aDictType->AllocL();
+    iDictCheckSum = aDictCheckSum->AllocL();
+    }
+    
+TBool  CZlibDictionary::Verified()
+{
+    return iVerfied;
+}
+TPtrC8  CZlibDictionary::DictUri()
+{
+    return iDictUri->Des();    
+}
+TPtrC8  CZlibDictionary::DictName()
+{
+    return iDictName->Des();
+}
+TPtrC8  CZlibDictionary::DictType()
+{
+    return iDictType->Des();
+}
+TPtrC8  CZlibDictionary::DictContents()
+{
+    return iDictContents->Des();
+}
+
+TUint32 CZlibDictionary::DictCheckSum()
+    {
+    return iChkSum;
+    }
+
+TPtrC8 CZlibDictionary::DictCheckSumPtr()
+    {
+    return iDictCheckSum->Des();
+    }
+
+TInt CZlibDictionary::VerifyContentsL(const TDesC8& aDictContents)
+{
+    TPtrC8 dictChk(iDictCheckSum->Des());
+    
+    TLex8 lex(dictChk);
+    TUint32 givenChkSum = 0;
+    TInt error = lex.Val(givenChkSum, EDecimal);
+
+    if(error == KErrNone)
+    {
+        if(givenChkSum == 0)
+            return KErrArgument;
+        
+        iChkSum = givenChkSum;
+        TUint32 calc_chksum(0);
+        calc_chksum = adler32(calc_chksum,0,0);		// init Adler32 checksum
+        calc_chksum = adler32(calc_chksum,aDictContents.Ptr(),aDictContents.Length()); // compute Adler32 checksum
+        if(givenChkSum == calc_chksum) 
+        {
+            return KErrNone;
+        }        
+    }
+    return error;
+}
+TInt CZlibDictionary::DeleteDictContents()
+{
+    if(iDictContents)
+    {
+        delete iDictContents;
+        iDictContents = NULL;
+    }
+    return KErrNone;      
+}
+TInt CZlibDictionary::SetDictContentsL(const TDesC8& aDictContents)
+{
+    if(aDictContents == KNullDesC8())    
+        return KErrArgument;
+
+    if (VerifyContentsL(aDictContents) == KErrNone)
+    {
+        iVerfied = ETrue;
+        if(iDictContents)
+        {
+            delete iDictContents;
+            iDictContents = NULL;
+        }
+        
+        iDictContents = aDictContents.AllocL();
+        return KErrNone;
+    }
+    
+    return KErrGeneral;
+}
+
+TInt CZlibDictionary::ResetL(CZlibDictionary* aDict)
+{
+    delete iDictUri; 
+    iDictUri = NULL;
+    delete iDictName; 
+    iDictName = NULL;
+    delete iDictType; 
+    iDictType = NULL;
+    delete iDictContents;
+	iDictContents = NULL;
+    delete iDictCheckSum;
+    iDictCheckSum = NULL;
+    iDictUri = aDict->DictUri().AllocL();
+    iDictName = aDict->DictName().AllocL();
+    iDictType = aDict->DictType().AllocL();
+    iDictCheckSum = aDict->DictCheckSumPtr().AllocL();
+    iVerfied = EFalse;
+    iChkSum = 0;
+    return KErrNone;
+}
+
+CDictXml* CDictXml::NewL()
+{
+     CDictXml* pSelf = CDictXml::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CDictXml* CDictXml::NewLC()
+{
+       CDictXml* pSelf = new (ELeave) CDictXml();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+  
+}
+CDictXml::~CDictXml()
+{
+  delete iXmlReader;
+}
+CDictXml::CDictXml() :iParsed(EFalse)
+{
+    
+}
+void CDictXml::ConstructL()
+{
+  iXmlReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+}
+
+CSenElement* CDictXml::XMLDocL()
+{
+    if(iParsed)
+    {
+        CSenElement* ele = &AsElement();
+        if(ele)
+            return ele;
+    }
+    
+    return NULL;
+}
+TInt CDictXml::ReadFileL(TFileName aPath)
+{
+      RFs fss;
+       User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+
+    TFileName iFileName1(aPath);
+    RFile  xmlFile;
+    TInt error = xmlFile.Open(fss , iFileName1, EFileRead );
+    CleanupClosePushL(xmlFile);    
+
+    if(error == KErrNone)
+    {
+        error = KErrGeneral;
+                
+        TInt size;
+        xmlFile.Size(size);
+
+        HBufC8 *pBuf=HBufC8::NewL(size);	//CodeScannerWarnings
+        CleanupStack::PushL(pBuf);
+        TPtr8 buf8ptr(pBuf->Des());
+        xmlFile.Read(buf8ptr,size);
+        size = pBuf->Length();
+        if(size > 0)
+            {
+            TPtr8 buf8ptr(pBuf->Des());            
+            TRAP( error, ParseL(buf8ptr);)
+            if (error == KErrNone)
+                iParsed = ETrue;
+            }
+        CleanupStack::PopAndDestroy(pBuf);
+    }
+    CleanupStack::PopAndDestroy(2); // fss  , xmlFile  
+    return error;    
+} 
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarhandlercontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsstarhandlercontext.h"
+CWSStarHandlerContext* CWSStarHandlerContext::NewL()
+    {
+    CWSStarHandlerContext* self = new (ELeave) CWSStarHandlerContext();
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSStarHandlerContext::CWSStarHandlerContext():
+    iCoreServiceManager(NULL),
+    iWSStarPlugin(NULL),
+    iLogger(NULL)
+    {
+    }
+
+// Constructor
+void CWSStarHandlerContext::ConstructL()
+    {
+    }
+
+
+// Destructor
+CWSStarHandlerContext::~CWSStarHandlerContext()
+    {
+    delete iVersion;
+    }
+
+//from HandlerContext        
+TInt CWSStarHandlerContext::Add(MSenCoreServiceManager& aValue)
+    {
+    iCoreServiceManager = &aValue;
+    return KErrNone;
+    }
+
+MSenCoreServiceManager* CWSStarHandlerContext::GetSenCoreServiceManager()
+    {
+    return iCoreServiceManager;
+    }
+
+
+
+//from MContext      
+SenContext::TContextType CWSStarHandlerContext::Type() const
+    {
+    return SenContext::EHandlerContext;
+    }
+SenContext::TContextDirection CWSStarHandlerContext::Direction() const
+    {
+    return SenContext::EBoth;
+    }
+TInt CWSStarHandlerContext::Add(const TDesC8& /*aKey*/, const TDesC8& /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSStarHandlerContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    TInt retVal(KErrNone);
+    //version with makeing of copy
+    if (aKey == HandlerContextKey::KVersion)
+        {
+        delete iVersion;
+        iVersion = NULL;
+        TRAP(retVal,iVersion = aValue.AllocL());
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+    return retVal;    
+    }
+const TDesC8* CWSStarHandlerContext::GetDesC8L(const TDesC8& aKey)
+    {
+    if (aKey == HandlerContextKey::KVersion)
+        {
+        return iVersion;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+TInt CWSStarHandlerContext::Add(const TDesC8& /*aKey*/, TInt /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSStarHandlerContext::Update(const TDesC8& /*aKey*/, TInt /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+const TInt* CWSStarHandlerContext::GetIntL(const TDesC8& /*aKey*/)
+    {
+    return NULL;
+    }
+TInt CWSStarHandlerContext::Add(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TInt CWSStarHandlerContext::Update(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+const CSenElement* CWSStarHandlerContext::GetSenElementL(const TDesC8& /*aKey*/)
+    {
+    return NULL;
+    }
+TInt CWSStarHandlerContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    if (aKey == HandlerContextKey::KSIF())
+        {
+        iWSStarPlugin = (CWSStarPlugin*)aValue;
+        return KErrNone;
+        }
+    else if (aKey == HandlerContextKey::KLogger())
+        {
+        iLogger = (RFileLogger*)aValue;
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+TInt CWSStarHandlerContext::Update(const TDesC8& /*aKey*/, TAny* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+TAny* CWSStarHandlerContext::GetAnyL(const TDesC8& aKey)	//codescannerwarnings
+    {
+     if (aKey == HandlerContextKey::KSIF())
+        {
+        return (TAny*)iWSStarPlugin;
+        }
+     else if (aKey == HandlerContextKey::KLogger())
+        {
+        return (TAny*)iLogger;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+const CSenXmlReader* CWSStarHandlerContext::GetParser()
+    {
+    return NULL;
+    }
+TInt CWSStarHandlerContext::Remove(const TDesC8& /*aKey*/)  
+    {
+    return KErrNotSupported;
+    }
+TInt CWSStarHandlerContext::Count() const
+    {
+    return KErrNotSupported;
+    }
+TPtrC8 CWSStarHandlerContext::KeyAtL(TInt /*aIndex*/)   
+    {
+    return KNullDesC8();
+    }
+void CWSStarHandlerContext::Reset() 
+    {
+    }
+    
+   
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarhttpclient.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "wsstarhttpclient.h"
+#include "SenHttpTransportProperties.h"
+#include "SenServiceConnection.h" // public error codes
+#include "sendebug.h"
+#include "senlogger.h"
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class.
+//---------------------------------------------------------------------------
+//
+CWSStarHttpClient* CWSStarHttpClient::NewL(
+                                            CSIF& aSIF,
+                                            CSenWSDescription* aInitializer,
+                                            RFileLogger& aLogger)
+    {
+    CWSStarHttpClient* pNew = NewLC(aSIF, aInitializer, aLogger);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class and leaves the object on the cleanup stack
+//---------------------------------------------------------------------------
+//
+CWSStarHttpClient* CWSStarHttpClient::NewLC(
+                                                        CSIF& aSIF,
+                                                        CSenWSDescription* aInitializer,
+                                                        RFileLogger& aLogger)
+    {
+    CWSStarHttpClient* pNew =
+        new (ELeave) CWSStarHttpClient(
+                    aSIF,
+                    MSenServiceDescription::EWSStarPolicyClient,
+                    aInitializer,
+                    aLogger);
+
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarHttpClient::CWSStarHttpClient( CSIF& aSIF,
+                                      TDescriptionClassType aType,
+                                      CSenWSDescription* aInitializer,
+                                      RFileLogger& aLogger )
+    : CSenInternalServiceConsumer(aType, aSIF),
+    iInitializer(aInitializer),
+    iLog(aLogger)
+    {
+    }
+
+void CWSStarHttpClient::BaseConstructL()
+    {
+    CSenInternalServiceConsumer::ConstructL();
+    iPolicySession = CWSStarServiceSession::NewL(Framework());
+    iPolicySession->AddConsumerL(*this);
+    iPolicySession->SetEndPointL(iInitializer->Endpoint());
+    iPolicySession->InitializeFromL(*iInitializer);
+    ipTransport = Framework().Manager().CreateL(*iPolicySession, NULL);        
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarHttpClient::ConstructL");
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarHttpClient::~CWSStarHttpClient()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarHttpClient::~CWSStarHttpClient");
+    if( iPolicySession )
+	    {
+        TRAP_IGNORE( iPolicySession->RemoveConsumerL(*this); )
+    	}
+    delete ipTransport;
+    delete iPolicySession;
+    }
+
+
+//---------------------------------------------------------------------------
+// The most siginificant method of this class. 
+//---------------------------------------------------------------------------
+//
+TInt CWSStarHttpClient::GetHttpL( const TDesC8& aRequest,
+                                  HBufC8*& apResponse,
+                                  CSenWSDescription* apSD )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarHttpClient::GetHttpL");
+    TInt retVal(KErrNone);             // for returning error codes
+    if( !iInitializer )
+        {
+        return KErrSenInternal;
+        }
+    TPtrC8 endpoint(iInitializer->Endpoint());    
+
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    _LIT8(KAcceptedHeader, "text/xml,text/plain");    
+    pHttpProperties->SetAcceptL(KAcceptedHeader);
+    TUint32 desiredIapId(0);
+   
+    if( apSD )
+        {
+        TInt getIapRetVal = apSD->IapId( desiredIapId );
+        if ( getIapRetVal == KErrNone )
+            {
+            pHttpProperties->SetIapIdL( desiredIapId );
+            }
+        }
+     //limit http timeout, 
+	pHttpProperties->SetMaxTimeToLiveL(WSStarSession::KMaxHttpTimeOut);
+	TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarHttpClient::GetHttpL - with IAP ID (%d):"), desiredIapId));    
+    HBufC8* pSerializedProperties  = pHttpProperties->AsUtf8L();
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PushL(pSerializedProperties);
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,( pSerializedProperties->Des() ));
+    retVal = ipTransport->SubmitL(endpoint, aRequest, *pSerializedProperties, apResponse, *this);	
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarHttpClient::GetHttpL - SubmitL returned: %d"), retVal));    
+
+    CleanupStack::PopAndDestroy( pSerializedProperties );
+
+#ifdef _SENDEBUG
+    if( apResponse )
+        {
+        TPtrC8 response = apResponse->Des();
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"* * * * * * * * * * * * *");
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("CWSStarHttpClient::GetHttpL - response (%d bytes):"), response.Length()));    
+        TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,( response ));
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CSenCoreServiceManager::CreateL:");
+        }
+#endif // _SENDEBUG        
+
+    if( retVal != KErrNone )
+        {
+        delete apResponse; 
+        apResponse = NULL;
+        }
+    return retVal;
+    }
+
+//---------------------------------------------------------------------------
+// SetStatus
+//---------------------------------------------------------------------------
+//
+
+void CWSStarHttpClient::SetStatus(TInt /*aStatus */)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// ServiceSession
+//---------------------------------------------------------------------------
+//
+CSenServiceSession* CWSStarHttpClient::ServiceSession()
+    {
+    return iPolicySession;
+    }
+
+//---------------------------------------------------------------------------
+// Obtain Transport using a factory from Core Manager
+//---------------------------------------------------------------------------
+//
+MSenTransport& CWSStarHttpClient::TransportL()
+    {
+    if(!ipTransport)
+        {
+        // Core is capable of working as transport factory, too.
+        // The returned transport instancies may or may not be
+        // ECOM plugins:
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarHttpClient::Instantiating new transport");
+        ipTransport = Framework().Manager().CreateL(*iPolicySession, iPolicySession); 
+        }
+    return *ipTransport;
+    }
+void CWSStarHttpClient::SetClientSessionL(
+                                                CWSStarServiceSession* aSession)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarHttpClient::SetServiceSessionL");
+    // free memory
+    //delete iPolicySession;
+    iPolicySession = aSession;
+    if(iPolicySession)
+        {
+        iPolicySession->AddConsumerL(*this);
+        }
+    }
+
+//---------------------------------------------------------------------------
+// Getter for endpoint
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarHttpClient::Endpoint()
+    {
+    return iPolicySession->Endpoint();
+    }
+//---------------------------------------------------------------------------
+// Getter for contract
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarHttpClient::Contract()
+    {
+    return iPolicySession->Contract();
+    }
+
+//---------------------------------------------------------------------------
+// serialie to xml
+//---------------------------------------------------------------------------
+//
+void CWSStarHttpClient::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    iPolicySession->WriteAsXMLToL(aWriteStream);
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+void CWSStarHttpClient::SetVersion(const TDesC8* aVersion)
+    {
+    iVersion = aVersion;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+TBool CWSStarHttpClient::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::ESenInternalServiceConsumer ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenInternalServiceConsumer::HasSuperClass( aType ); 
+        }
+    }
+void CWSStarHttpClient::SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) 		
+	{
+		iHttpDetails = aDetails;
+	}
+void CWSStarHttpClient::DataTrafficDetails( TSenDataTrafficDetails& aDetails) 			
+	{
+		aDetails = iHttpDetails;
+	}
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarmessagecontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,491 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "SenSoapEnvelope.h"
+#include "wsstarmessagecontext.h"
+#include "wsstarsessioncontext.h"
+#include "SenXmlReader.h"
+
+#include "senlogger.h"
+
+
+CWSStarMessageContext* CWSStarMessageContext::NewL(SenContext::TContextDirection aDirection, CSenXmlReader*& aParser)
+    {
+    CWSStarMessageContext* self = NewLC(aDirection, aParser);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSStarMessageContext* CWSStarMessageContext::NewLC(SenContext::TContextDirection aDirection, CSenXmlReader*& aParser)
+    {
+    CWSStarMessageContext* self = new (ELeave) CWSStarMessageContext(aDirection, aParser);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    return self;
+    }
+
+CWSStarMessageContext* CWSStarMessageContext::NewLC(
+        SenContext::TContextDirection aDirection, CSenXmlReader*& aParser,
+        CWSStarSessionContext& aSessionContext)
+    {
+    CWSStarMessageContext* self =
+            new (ELeave) CWSStarMessageContext(aDirection, aParser);
+    CleanupStack::PushL (self);
+    self->ConstructL(aSessionContext);
+    return self;
+    }
+
+// Constructor
+CWSStarMessageContext::CWSStarMessageContext(SenContext::TContextDirection aDirection, CSenXmlReader*& aParser)
+    :iDirection(aDirection),
+    iOwnedEnvelope(EFalse),
+    iParser(aParser),
+    iDescs(EFalse, ETrue),
+    iInts(EFalse, ETrue)
+    {
+    }
+
+// Constructor
+void CWSStarMessageContext::ConstructL()
+    {
+    }
+
+void CWSStarMessageContext::ConstructL(CWSStarSessionContext& aSessionContext)
+    {
+    UpdateFromSessionContextL(aSessionContext);
+    }
+
+// Destructor
+CWSStarMessageContext::~CWSStarMessageContext()
+    {
+    if (iOwnedEnvelope)
+        {
+        delete iCurrentEnvelope;
+        }
+    iDescs.Reset();
+    iInts.Reset();
+    }
+    
+//from SessionContext 
+
+CSenSoapMessage* CWSStarMessageContext::GetCurrentSoapMessage()
+    {
+    if (iCurrentEnvelope)
+        {
+        return (CSenSoapMessage*)iCurrentEnvelope;
+        }
+    else
+        {
+        return NULL;
+        }
+};
+TPtrC8 CWSStarMessageContext::GetMessageL()
+    {
+    return iCurrentEnvelopeTxt;
+    };
+void CWSStarMessageContext::UpdateDesC8L(CWSStarSessionContext& aSessionContext, const TDesC8& aKey)
+    {
+    const TDesC8* ptr =
+            aSessionContext.GetDesC8L(aKey);
+    if (ptr && !GetDesC8L(aKey))
+        {
+        User::LeaveIfError(Update(aKey, *ptr));
+        }
+    }
+void CWSStarMessageContext::UpdateIntL(CWSStarSessionContext& aSessionContext, const TDesC8& aKey)
+    {
+    const TInt* ptr =
+            aSessionContext.GetIntL(aKey);
+    if (ptr &&!GetIntL(aKey))
+        {
+        User::LeaveIfError(Update(aKey, *ptr));    
+        } 
+    }
+    
+void CWSStarMessageContext::UpdateFromSessionContextL( CWSStarSessionContext& aSessionContext )
+    {
+    //becouse of resending we need keep veen message specific stuff inside session ctx
+    // (see ASYNC handkleerror)
+    if (Direction() == SenContext::EOutgoing)
+        {
+        const TDesC8* ptr =
+        aSessionContext.GetDesC8L( WSStarContextKeys::KTo );
+        if ( ptr )
+            {
+            TInt error = Remove( WSStarContextKeys::KTo );
+            if( error )
+                {
+                TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "CWSStarMessageContext::UpdateFromSessionContextL( CWSStarSessionContext& aSessionContext ):" );
+                TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, _L8("- Remove( WSStarContextKeys::KTo ) returned an error(!): %d => going to 'throw a LEAVE'"), error ));
+                User::LeaveIfError( error );
+                }
+            }        
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KTo);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KAction);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KAddressingVersion);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KTimestampExpires);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KTimestampCreated);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KPhoneTimeWhenMTResolved);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KPOPBase64);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KBinaryType);
+        UpdateIntL(aSessionContext, WSStarContextKeys::KSoapVersion);
+        UpdateIntL(aSessionContext, WSStarContextKeys::KPassportEnabled);
+        UpdateIntL(aSessionContext, WSStarContextKeys::KMTIsReplacedBySCT);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KSecurityToken);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KBody);
+        iBody = aSessionContext.GetSenElementL(WSStarContextKeys::KBodyElement);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KSTR);
+        ipSignedParts = (RPointerArray<HBufC8>*)aSessionContext.GetAnyL( WSStarContextKeys::KSignedPartsArray );
+              
+#ifdef _SENDEBUG                
+        if( !ipSignedParts ) // ipSignedParts == NULL!
+            {
+            TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "CWSStarMessageContext::UpdateFromSessionContextL( CWSStarSessionContext& aSessionContext ):" );
+            TLSLOG_L( KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "- aSessionContext.GetAnyL( WSStarContextKeys::KSignedPartsArray ) returned NULL(!)" );
+            }
+#endif // _SENDEBUG            
+        
+        UpdateIntL(aSessionContext, WSStarContextKeys::KAppInfoPresent);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KApplicationName);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KApplicationVendor);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KApplicationVersion);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KLocale);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KManufacturer);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KModel);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KDeviceName);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KDeviceVersion);
+        UpdateDesC8L(aSessionContext, WSStarContextKeys::KIMSI);
+        }
+    else
+        {
+        UpdateIntL(aSessionContext, WSStarContextKeys::KPassportEnabled);
+        }
+    }
+
+TInt CWSStarMessageContext::Add(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    TInt results = KErrNone;
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        if (!iCurrentEnvelope)
+            {
+            iCurrentEnvelope = aValue;
+            }
+        else
+            {
+            results = KErrAlreadyExists;
+            }
+        
+        }
+    return results;
+    };
+TInt CWSStarMessageContext::Update(const TDesC8& aKey, CSenSoapEnvelope* aValue)
+    {
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        if (iOwnedEnvelope)
+            {
+            delete iCurrentEnvelope;
+            }
+        iCurrentEnvelope = aValue;
+        }
+    return KErrNone;
+    };
+const CSenSoapEnvelope* CWSStarMessageContext::GetSenSoapEnvelopeL(const TDesC8& aKey)
+    {
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey)
+        {
+        return iCurrentEnvelope;
+        }
+    else
+        {
+        return NULL;
+        }
+    };
+
+
+
+//from MContext       
+SenContext::TContextType CWSStarMessageContext::Type() const
+    {
+    return SenContext::EMessageContext;
+    }
+    
+SenContext::TContextDirection CWSStarMessageContext::Direction() const
+    {
+    return iDirection;
+    }
+//-----------------descs        
+TInt CWSStarMessageContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        if (! iCurrentEnvelopeTxt.Length())
+            {
+            iCurrentEnvelopeTxt.Set(aValue);
+            return KErrNone;
+            }
+        else
+            {
+            return KErrAlreadyExists;
+            }
+        }
+        //version without copy
+        //return iDescs.Append(&aKey,&aValue);
+        
+        //version with making of copy
+        if (!aValue.Length()) return KErrUnderflow;
+        HBufC8* newValue = NULL;
+        TInt error(KErrNone);
+        TRAP(error, newValue = aValue.AllocL());
+        if (!error)
+            {
+            error = iDescs.Append(&aKey,newValue);
+            }            
+        return error;
+    }
+
+//it add(if not exist) or update. So , it is like Set
+TInt CWSStarMessageContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        iCurrentEnvelopeTxt.Set(aValue);
+        return KErrNone;
+        }
+    
+    //version with makeing of copy
+    TInt error(KErrNone);
+    if (!aValue.Length()) 
+        {
+        error = Remove(aKey);
+        if (error == KErrNotFound)
+                return KErrNone;
+            else
+                return error;
+        }
+    HBufC8* newValue = NULL;
+    TRAP(error, newValue = aValue.AllocL());
+    
+    if (!error)
+        {
+        error = iDescs.UpdateValue(&aKey,newValue);
+        }
+    return error;
+    }
+
+const TDesC8* CWSStarMessageContext::GetDesC8L(const TDesC8& aKey)
+    {
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        return NULL;
+        }
+    TInt index = iDescs.Find(aKey);
+    if (index != KErrNotFound)
+        {
+        return iDescs.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+TInt CWSStarMessageContext::Remove(const TDesC8& aKey)
+    {
+    if (aKey == WSStarContextKeys::KBodyElement)
+        {
+        iBody = NULL;
+        return KErrNone;
+        }
+    else
+        {
+        return iDescs.RemoveByKey(aKey);
+        }
+    }
+//-------------Ints
+TInt CWSStarMessageContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a)
+        {
+        return iInts.Append(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+    }
+
+TInt CWSStarMessageContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a)
+        {
+        return iInts.UpdateValue(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+    }
+
+const TInt* CWSStarMessageContext::GetIntL(const TDesC8& aKey)
+    {
+    TInt index = iInts.Find(aKey);
+    if (index!=KErrNotFound)
+        {
+        return iInts.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        };        
+    }
+
+//-----------------elements
+TInt CWSStarMessageContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return Update(aKey,aValue);
+    }
+
+TInt CWSStarMessageContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    if (aKey == WSStarContextKeys::KBodyElement)
+        {
+        iBody = aValue;
+        return KErrNone;
+        }
+    return KErrNotFound;
+    }
+
+const CSenElement* CWSStarMessageContext::GetSenElementL(const TDesC8& aKey)
+    {
+    if (aKey == WSStarContextKeys::KBodyElement)
+        {
+        return iBody;
+        }
+    return NULL;
+    }
+//-----------------TAnys
+TInt CWSStarMessageContext::Add(const TDesC8& /*aKey*/, TAny* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+
+TInt CWSStarMessageContext::Update(const TDesC8& /*aKey*/, TAny* /*aValue*/)
+    {
+    return KErrNotSupported;
+    }
+
+TAny* CWSStarMessageContext::GetAnyL(const TDesC8& aKey)	//codescannerwarnings
+    {
+    if(aKey == WSStarContextKeys::KSignedPartsArray)
+        {
+        return ipSignedParts;
+        }
+     else
+        {
+        return NULL;
+        }
+    }
+
+const CSenXmlReader* CWSStarMessageContext::GetParser()
+    {
+    return iParser;
+    }
+
+TInt CWSStarMessageContext::Count() const
+    {
+    return KErrNotSupported;
+    }
+
+TPtrC8 CWSStarMessageContext::KeyAtL(TInt /*aIndex*/)
+    {
+    return KNullDesC8();
+    }
+        
+void CWSStarMessageContext::Reset() 
+    {
+    }
+    
+MSenMessage* CWSStarMessageContext::MessageL()	//codescannerwarnigs
+    {
+    return NULL;
+    }
+    
+TInt CWSStarMessageContext::SetMessage(MSenMessage* /* apMessage */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+TInt CWSStarMessageContext::SetProperties(MSenProperties* /* apTransportProperties */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+MSenProperties* CWSStarMessageContext::Properties()
+    {
+    return NULL;    
+    }
+    
+TInt CWSStarMessageContext::Add(const TDesC8& /* aKey */, MSenMessage* /* apMessage */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+TInt CWSStarMessageContext::Update(const TDesC8& /* aKey */, MSenMessage* /* apMessage */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+MSenMessage* CWSStarMessageContext::GetMessageL(const TDesC8& /* aKey */)	// codescannerwarnings
+    {
+    return NULL;
+    }
+    
+    
+CSenChunk* CWSStarMessageContext::ChunkL()	//codescannerwarnings
+    {
+    return NULL;
+    }
+    
+TInt CWSStarMessageContext::SetChunk(CSenChunk* /* apMsgAsChunk */, TBool /* aOwned */)
+    {
+    return KErrNotSupported;
+    }
+    
+TInt CWSStarMessageContext::SetDirection( SenContext::TContextDirection /* aDirection */ ) 
+    {
+    return KErrNotSupported; 
+    }
+    
+   
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarplugin.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1174 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#include "wsstarplugin.h"
+#include "SenServiceConnection.h" // framework IDs, error codes
+#include "sendebug.h"
+#include "senlogger.h"
+#include "MSenServiceDescription.h"
+#include "wsstarservicesession.h"
+#include "SenXmlUtils.h"
+#include "wsstarpolicy.h"
+#include "senguidgen.h"
+
+#include "wsstarpolicyhandler.h"
+using namespace WSStarConfig;
+
+// Local CONSTANTS
+const TInt KMaxLengthXml  = 1280; 
+
+// ---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+// ---------------------------------------------------------------------------
+//
+CWSStarPlugin* CWSStarPlugin::NewL(TAny* aManager)
+    {
+    MSenCoreServiceManager* manager =
+        reinterpret_cast<MSenCoreServiceManager*>(aManager);
+
+    CWSStarPlugin* self = new (ELeave) CWSStarPlugin(*manager);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CWSStarPlugin::CWSStarPlugin(MSenCoreServiceManager& aManager)
+    : iManager(aManager),
+      iVersions(ETrue, ETrue),
+      iDbReadDone(EFalse)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CWSStarPlugin::~CWSStarPlugin()
+    {
+    iMsgHandlers.ResetAndDestroy();
+    iSessionHandlers.ResetAndDestroy();
+    iHandlerContexts.ResetAndDestroy();
+    iVersions.Reset();
+    delete iDeviceId;
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::~CWSStarPlugin()")));
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CWSStarPlugin::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ConstructL")));
+
+    BaseConstructL(KFrameworkXMLNS, KFrameworkLocalName);
+    GenerateDeviceIdL();
+    //load default setup of handlers
+    AddHandlerL(KValidateValue, KNullDesC8, SenHandler::ESessionHandler);//old http://schemas.xmlsoap.org/ws/2004/04/trust
+    AddHandlerL(KRegisterValue, KNullDesC8, SenHandler::ESessionHandler);
+    AddHandlerL(KServiceUpdateValue, KNullDesC8, SenHandler::ESessionHandler);//new http://schemas.xmlsoap.org/ws/2004/08/addressing
+    
+    AddHandlerL(KEnveloperValue, KNullDesC8, SenHandler::EMessageHandler);//old http://schemas.xmlsoap.org/soap/envelope
+    AddHandlerL(KCredentialCollectorValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KAddressingValue, KNullDesC8, SenHandler::EMessageHandler);//new http://schemas.xmlsoap.org/ws/2004/08/addressing
+    AddHandlerL(KPassportValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KSecurityValue, KNullDesC8, SenHandler::EMessageHandler);
+    AddHandlerL(KPolicyValue, KNullDesC8, SenHandler::ESessionHandler); //Initalize policy
+#ifdef RD_SEN_VTCP_SUPPORT        
+    AddHandlerL(KCoBrandingValue, KNullDesC8, SenHandler::ESessionHandler); //Initalize co-branding
+#endif//RD_SEN_VTCP_SUPPORT	
+    }
+
+// ---------------------------------------------------------------------------
+// Getter for logger. Works only in debug mode.
+// ---------------------------------------------------------------------------
+//
+/*RFileLogger* CWSStarPlugin::Log() const
+    {
+    return iManager.Log();
+    }
+*/
+
+//========================================================
+//                MSIF SPecific
+//========================================================
+
+//---------------------------------------------------------------------------
+// Attempt to register the ServiceDescription to the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPlugin::RegisterServiceDescriptionL(
+    MSenServiceDescription& aServiceDescription )
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::RegisterServiceDescriptionL(.)")));
+    TInt error(KErrNone);
+
+    CWSStarPolicyHandler* pPolicyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);    
+    CWSStarSessionContext* pSessionRegisterCtx = CWSStarSessionContext::NewLC(Manager().XMLReader(), &aServiceDescription, pPolicyHandler);
+    pSessionRegisterCtx->Add(WSStarContextKeys::KServiceDescription(),
+            (CSenWSDescription*)&aServiceDescription);
+    pSessionRegisterCtx->Add(WSStarContextKeys::KRegisterAction(),
+            WSStarContextValues::KActionRegister());
+//policy initalization    
+    TPtrC8 contract = aServiceDescription.Contract();
+    TRAPD(policyError, pPolicyHandler->InvokeL(contract));
+    if (policyError!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::RegisterServiceDescriptionL() !!!!leave from PolicyHandler")));
+        }
+
+//SOA for S60 Composable Handler Framework v0.1 - 7.5.3.1 point 1)            
+    CSenSessionHandler* pregisterHandler = 
+                (CSenSessionHandler*)Handler(KRegisterValue());
+        
+    TRAPD(errorL,error= pregisterHandler->InvokeL(*pSessionRegisterCtx));
+    if (errorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::RegisterServiceDescriptionL() !!!!leave from RegisterHandler")));
+        error = errorL;
+        }
+    CleanupStack::PopAndDestroy(pSessionRegisterCtx);
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// Attempt to unregister the ServiceDescription from the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPlugin::UnregisterServiceDescriptionL(
+    MSenServiceDescription& aServiceDescription)
+    {
+    
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::UnRegisterServiceDescriptionL(.)")));
+//SOA for S60 Composable Handler Framework v0.1  - 7.5.3.1 point 1)            
+    TInt error(KErrNone);
+    CSenSessionHandler* pregisterHandler = 
+                (CSenSessionHandler*)Handler(KRegisterValue());
+        
+    CWSStarSessionContext* pSessionRegisterCtx = CWSStarSessionContext::NewLC(Manager().XMLReader(), &aServiceDescription);
+    pSessionRegisterCtx->Add(WSStarContextKeys::KServiceDescription(),
+            (CSenWSDescription*)&aServiceDescription);
+    pSessionRegisterCtx->Add(WSStarContextKeys::KRegisterAction(),
+            WSStarContextValues::KActionUnregister());
+    CWSStarPolicyHandler* pPolicyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);    
+    TRAPD(policyError, pPolicyHandler->UnRegisterWsPolicyL(aServiceDescription));
+    if (policyError!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::UnRegisterServiceDescriptionL() !!!!leave from PolicyHandler")));
+        }
+        
+    TRAPD(errorL,error = pregisterHandler->InvokeL(*pSessionRegisterCtx));
+    if (errorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::UnregisterServiceDescriptionL() !!!!leave from RegisterHandler")));
+        error = errorL;
+        }
+    CleanupStack::PopAndDestroy(pSessionRegisterCtx);
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// Getter of framework (like "WS-STAR")
+//---------------------------------------------------------------------------
+//
+const TDesC8& CWSStarPlugin::Id()
+    {
+    return KDefaultWSStarFrameworkID();
+    }
+
+//---------------------------------------------------------------------------
+// Try to find one or more services that match the given ServiceDescription.
+//    Adding is only invoked if NO! session in cache. 
+//    Its mean that we have create new one.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPlugin::AddServiceDescriptionL( MSenServiceDescription& aPattern,
+                                            MSenRemoteServiceConsumer& aRemoteConsumer,
+                                            HBufC8*& aErrorMessage )
+    {
+    TInt addedSD(0);
+    //-----1.no disco phase
+    //-----2.establish credential and put to session
+    //-----3.set validator. Enables re-auth for cases when credential is expired between init and send
+    if(aPattern.FrameworkId() != KDefaultWSStarFrameworkID)
+        {
+        CSLOG_L(aRemoteConsumer.ConnectionId(),KNormalLogLevel ,"CWSStarPlugin::AddServiceDescriptionL - this is not KDefaultWSStarFrameworkID");
+        addedSD = 0; // zero added
+        }
+    else if( aPattern.Endpoint().Length() > 0 && aPattern.Contract().Length() > 0 )
+        {
+        CWSStarServiceSession* pNewSession = CWSStarServiceSession::NewL(*this);
+        CleanupStack::PushL(pNewSession);
+
+        // InitializeFromL copies the contract and endpoint of concrete service
+        //  also context will be set
+        CWSStarPolicyHandler* policyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);
+        pNewSession->InitializeFromL(aPattern, policyHandler);
+        pNewSession->AddConsumerL(aRemoteConsumer);
+        TSenDataTrafficDetails policyDetails; 
+        policyHandler->DataTrafficDetails(policyDetails);
+        aRemoteConsumer.SetDataTrafficDetails(policyDetails);
+        pNewSession->SessionContext()->Update(WSStarContextKeys::KOnlySharing, EFalse);
+//SOA for S60 Composable Handler Framework v0.1  - 7.5.3.1 point 3)        
+        TInt error = ProcessOutboundValidationL( aPattern, 
+                                                (MSenRemoteServiceSession*)pNewSession,
+                                                aErrorMessage );
+        CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("CWSStarPlugin::AddServiceDescriptionL - ProcessOutboundValidation returned: %d"), error));
+        if ( !error )
+            {
+            CWSStarSessionContext* pSessionRegisterCtx = pNewSession->SessionContext();            
+            TPtrC8 cont = aPattern.Contract();
+            TInt policyLeaveCode(KErrNone);
+            TRAP( policyLeaveCode, error = policyHandler->InvokeL(cont); )
+            if ( policyLeaveCode )
+                {
+                CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("CWSStarPlugin::AddServiceDescriptionL - PolicyHandler->Invoke() leaved: %d"), policyLeaveCode));
+                CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::AddServiceDescriptionL() - FATAL: leave from PolicyHandler->Invoke()");
+                error = policyLeaveCode;
+                }
+#ifdef _SENDEBUG
+            else
+                {
+                CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("CWSStarPlugin::AddServiceDescriptionL - PolicyHandler->Invoke() returned: %d"), error));
+                }
+#endif // _SENDEBUG
+            }
+        if ( error )
+            {
+            addedSD = error;
+            CleanupStack::PopAndDestroy(pNewSession);
+            }
+        else // BOTH outbound validation and policy handler invokation OK(!):
+            {
+            Manager().AddServiceDescriptionL((CSenWSDescription*)pNewSession);
+            addedSD = 1;
+            CleanupStack::Pop(pNewSession); //now session is owned by Core / XML DAO
+            }
+        }
+    else
+        {
+        CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::AddServiceDescriptionL - No endpoint AND no contract; new session could not be added.");
+        addedSD = 0; // zero added
+        }
+    return addedSD;
+    }
+
+//---------------------------------------------------------------------------
+// Create a ServiceSession based upon the given ServiceDescription.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPlugin::CreateServiceSessionL( MSenServiceDescription& aServiceDescription,
+                                           MSenServiceDescription& aPattern,
+                                           CSenServiceSession*& aNewSession,
+                                           MSenRemoteServiceConsumer& aRemoteConsumer,
+                                           HBufC8*& aErrorMessage )
+    {
+    TInt error(KErrNone);
+    if( aServiceDescription.DescriptionClassType() == MSenServiceDescription::EWSStarServiceSession )
+        {
+        //example:  when init connection with not registered description, nothing in db
+        //example:  when bootup and description was already in db (registered during parsing db.file)
+        aNewSession = (CWSStarServiceSession*) &aServiceDescription;
+        CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::ServiceDescription is already a ServiceSession");
+        }
+    else
+        {
+        aNewSession = (CWSStarServiceSession*) NewServiceDescriptionL();
+        error = ((CWSStarServiceSession*)aNewSession)->InitializeFromL( aServiceDescription );
+        CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("CWSStarPlugin::ServiceDescription is not a ServiceSession, creating new one returned: %d"), error));
+        }
+    if(aNewSession && !error)//if session was just created, its possible that its not validate
+        {
+        //((CWSStarServiceSession*)aNewSession)->DetachCredentialsL() ; //invalidating session to recompute the status
+        TBool isHostlet = ((CWSStarServiceSession*)aNewSession)->AmIHostletSession() ;
+		TInt credentialValidityError = KErrNone ;
+		TBool delegateToSTS = EFalse ;
+        if (!isHostlet)
+            {
+			credentialValidityError = ((CWSStarServiceSession*)aNewSession)->TryToSearchValidCredentialL() ;
+			if (KErrNone == credentialValidityError)
+				{
+				CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::CreateServiceSessionL() Valid credential found");
+				}
+			else
+				{
+				delegateToSTS = ETrue ;
+				CSLOG_FORMAT((aRemoteConsumer.ConnectionId(), KMinLogLevel , _L8("CWSStarPlugin::CreateServiceSessionL() No Valid credential found credentialValidityError = [%d]"), credentialValidityError));
+				}
+			}      
+		if(!aNewSession->IsReadyL())
+			{
+			delegateToSTS = ETrue ;
+			CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::CreateServiceSessionL() ServiceSession is not ready !!");
+			}
+		else
+			{
+			CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::CreateServiceSessionL() ServiceSession is ready");
+			}
+
+//        if(!aNewSession->IsReadyL())
+        if(delegateToSTS)
+            {
+//            CSLOG_L(aRemoteConsumer.ConnectionId(),KMinLogLevel ,"CWSStarPlugin::ServiceSession is not ready");
+            //example: when credentail was parsed(exist) and additionally expired.
+            //         We dont need revalidate if credentials doesnt exist at all
+            
+            
+            CWSStarSessionContext* pSessionValidateCtx = ((CWSStarServiceSession*)aNewSession)->SessionContext();
+            if (!pSessionValidateCtx) //sessionCts exist if revalidation is processing
+                {
+                CWSStarPolicyHandler* policyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);
+                pSessionValidateCtx = CWSStarSessionContext::NewLC(Manager().XMLReader(), &aPattern, policyHandler);
+                pSessionValidateCtx->Add(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aNewSession);
+                ((CWSStarServiceSession*)aNewSession)->SetSessionContext(pSessionValidateCtx);
+                CleanupStack::Pop(pSessionValidateCtx);
+                }
+                
+            pSessionValidateCtx->Update(WSStarContextKeys::KRemoteConsumer(),
+                                        &aRemoteConsumer);
+            aNewSession->AddConsumerL(aRemoteConsumer);
+            pSessionValidateCtx->Update(WSStarContextKeys::KOnlySharing, EFalse);    
+            error = ProcessOutboundValidationL( aPattern, 
+                                               (MSenRemoteServiceSession*)aNewSession,
+                                               aErrorMessage );
+            if (error) aNewSession->RemoveConsumerL(aRemoteConsumer);
+            }
+        }
+    return error;
+    }
+
+TInt CWSStarPlugin::IssuePolicyDownloadL( CSenWSDescription* apSession )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::IssuePolicyDownloadL");
+    TInt retCode(KErrNone);
+    CWSStarPolicyHandler* pPolicyHandler =  (CWSStarPolicyHandler*)Handler(KPolicyValue());
+    TInt policyLeave(KErrNone);
+    TRAP(policyLeave, retCode = pPolicyHandler->DownloadPolicyL( apSession ));
+    if (policyLeave!=KErrNone)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::IssuePolicyDownloadL - FATAL: leave from PolicyHandler");
+        retCode = policyLeave;
+        }
+    retCode = pPolicyHandler->UpdatePolicyL(); 
+    return retCode;
+    }
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPlugin::OnEvent( const TInt aEvent, TAny* apArgument )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::OnEvent");
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("  -event code: %d"), aEvent));
+    TInt retCode(KErrNone);
+    TInt leaveCode( KErrNone );
+    
+    switch( aEvent)
+        {
+        
+        case KSenEventConsumerAdded:
+            {
+            ++iConsumerCount;
+            CSenWSDescription* pSD = NULL; // not required
+            TRAP( leaveCode, retCode = IssuePolicyDownloadL( pSD ); )
+            if( leaveCode )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::OnEvent( KSenEventConsumerAdded ) - leave from IssuePolicyDownloadL");
+                if( !retCode )
+                    {
+                    retCode = leaveCode;
+                    }
+                }
+            break;
+            }
+            
+        case KSenEventConsumerRemoved:
+            {
+            --iConsumerCount;
+            break;
+            }
+        
+        case KSenEventWsfReady:
+            {
+            iDbReadDone = ETrue;
+            }
+            break;
+            
+        case KSenEventRegisterNewServiceDescription:
+            {
+            if( iDbReadDone/* && iConsumerCount > 0*/ )
+                {
+                CSenWSDescription* pSD = (CSenWSDescription*)apArgument;
+                TInt policyLeave(KErrNone);
+                TRAP(policyLeave, retCode = IssuePolicyDownloadL( pSD ); )
+                if ( policyLeave & !retCode )
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::OnEvent( KSenEventSessionsDbReadComplete ) - leave from IssuePolicyDownloadL");
+                    retCode = policyLeave;
+                    }
+                }
+            }        
+            break;
+            
+        case KSenEventSessionsDbReadComplete:
+            {
+            // Current implementation downloads policy independent of (whether or not)
+            // the session database has been read or not
+            if( iConsumerCount > 0 )
+               {
+            CSenWSDescription* pSD = (CSenWSDescription*)apArgument;
+            TInt policyLeave(KErrNone);
+            TRAP(policyLeave, retCode = IssuePolicyDownloadL( pSD ); )
+            if ( policyLeave & !retCode )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::OnEvent( KSenEventSessionsDbReadComplete ) - leave from IssuePolicyDownloadL");
+                    if( !retCode )
+                        {
+                retCode = policyLeave;
+                        }
+                 }
+               }
+            }
+            break;
+            
+        case KSenEventRegisterIdentityProvider:
+        case KSenEventUnregisterIdentityProvider:
+            {
+            TInt policyLeave(KErrNone);
+            TRAP(policyLeave, VerifyPermissionOnEachSessionL(); )
+            if ( policyLeave & !retCode )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPlugin::OnEvent( KSenEventSessionsDbReadComplete ) - leave from VerifyPermissionOnEachSessionL");
+                if( !retCode )
+                    {
+                retCode = policyLeave;
+                    }
+                }
+            }
+            break;
+            
+        default:
+            {
+            // do nothing
+            }
+        }
+    return retCode;
+    }
+
+
+void CWSStarPlugin::VerifyPermissionOnEachSessionL()
+    {
+//--    LOG_WRITE_L("CWSStarPlugin::VerifyPermissionOnEachSessionL");
+
+    CSenWSDescription* pOpenMask = CSenWSDescription::NewLC( KNullDesC8, KNullDesC8 ); // this matches with *any* ServDescription
+    pOpenMask->SetFrameworkIdL(KDefaultWSStarFrameworkID); // now it matches with any WS-* session
+    
+    RWSDescriptionArray all;
+    iManager.ServiceDescriptionsL(all, *pOpenMask);
+    CleanupStack::PopAndDestroy(pOpenMask);
+    CleanupClosePushL(all);
+
+    TInt count(all.Count());
+    
+//--    LOG_WRITEFORMAT((_L("- %d WS-* service session(s) found."), count));
+
+#ifdef _SENDEBUG
+//--    TInt verified = 0;
+#endif // _SENDEBUG    
+
+    for(TInt i=0; i<count; i++)
+        {   
+        CSenWSDescription* pSD = (CSenWSDescription*)all[i];
+
+        if(pSD->DescriptionClassType() == MSenServiceDescription::EWSStarServiceSession)
+            {
+            CWSStarServiceSession* pSession = (CWSStarServiceSession*)pSD;
+            pSession->VerifyPermissionL(); // accessible through friendship
+#ifdef _SENDEBUG            
+//--            verified++;
+//--            LOG_WRITEFORMAT((_L("- Verified a session (#%d)"), verified));
+#endif // _SENDEBUG              
+            }
+        }
+    CleanupStack::PopAndDestroy(&all);
+    }
+
+//---------------------------------------------------------------------------
+// There is no extended interface in WSStar framework at the moment.
+//---------------------------------------------------------------------------
+//
+TAny* CWSStarPlugin::ExtendedInterface()
+    {
+    return NULL;
+    }
+
+//---------------------------------------------------------------------------
+// Return a new instance of a framework specific class that
+//     implements the ServiceDesccription interface.
+//---------------------------------------------------------------------------
+//
+CSenWSDescription* CWSStarPlugin::NewServiceDescriptionL()
+    {
+    CWSStarServiceSession* pSD =
+        CWSStarServiceSession::NewL(*this);
+    CleanupStack::PushL(pSD);    
+    pSD->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    CleanupStack::Pop(pSD);
+    return pSD;
+    }
+
+//---------------------------------------------------------------------------
+// Getter for manager
+//---------------------------------------------------------------------------
+//
+MSenCoreServiceManager& CWSStarPlugin::Manager()
+    {
+    return iManager;
+    }
+//---------------------------------------------------------------------------
+// Setter for manager
+//---------------------------------------------------------------------------
+//
+void CWSStarPlugin::SetManager(MSenCoreServiceManager& aServiceManager)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::SetManager(.)")));
+    iManager = aServiceManager;
+    }
+//---------------------------------------------------------------------------
+// Getter for configParser
+//---------------------------------------------------------------------------
+//
+CSenBaseFragment& CWSStarPlugin::ConfigParser()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ConfigParser()")));
+    return *this;
+    //return callbacks which will be invoked during parsing rest of config
+    //this callbacks will be responsible for loading features
+    }
+
+//---------------------------------------------------------------------------
+// UCS2 serializer
+//---------------------------------------------------------------------------
+HBufC* CWSStarPlugin::AsXmlUnicodeL()
+    {
+    HBufC8* pUtf8 = AsXmlL();
+    CleanupStack::PushL(pUtf8);
+    HBufC* pAsAxlInUnicode = SenXmlUtils::ToUnicodeLC(*pUtf8);
+    CleanupStack::Pop(pAsAxlInUnicode);
+    CleanupStack::PopAndDestroy(pUtf8); 
+    return pAsAxlInUnicode;
+    }
+
+//---------------------------------------------------------------------------
+// UTF8 serializer
+//---------------------------------------------------------------------------
+HBufC8* CWSStarPlugin::AsXmlL()
+    {
+    HBufC8* retVal = HBufC8::NewLC(KMaxLengthXml);
+    TPtr8 ptr = retVal->Des();
+    ptr.Append(KSenLessThan);
+    ptr.Append(KFrameworkLocalName);
+    ptr.Append(KSenSpace);
+    ptr.Append(KSenSpaceXmlns);
+    ptr.Append(KSenEqualsDblQuot);
+    ptr.Append(KFrameworkXMLNS);
+    ptr.Append(KSenDblQuot);
+    
+    ptr.Append(KSenSpace);
+    ptr.Append(KClassAttr);
+    ptr.Append(KSenEqualsDblQuot);
+    ptr.Append(KFrameworkCue);
+    ptr.Append(KSenDblQuot);
+    ptr.Append(KSenGreaterThan);
+
+   
+//deviceId
+    ptr.Append(KSenLessThan);
+    ptr.Append(KDeviceIdLocalName);
+    ptr.Append(KSenGreaterThan);
+    if (iDeviceId)
+        {
+        ptr.Append(*iDeviceId);
+        }
+    ptr.Append(KSenLessThanSlash);	
+    ptr.Append(KDeviceIdLocalName);
+    ptr.Append(KSenGreaterThan);
+    
+//--message handlers    
+    for (TInt i=0; i < iMsgHandlers.Count(); i++)
+        {
+        AddHandlerTag(ptr, iMsgHandlers[i]->Name());
+        }
+//--session handlers    
+   for (TInt i=0; i < iSessionHandlers.Count(); i++)
+        {
+        AddHandlerTag(ptr, iSessionHandlers[i]->Name());
+        }  
+
+    ptr.Append(KSenLessThanSlash);
+    ptr.Append(KFrameworkLocalName);
+    ptr.Append(KSenGreaterThan);
+    CleanupStack::Pop(retVal);
+    return retVal;
+    }
+
+
+
+//---------------------------------------------------------------------------
+//  used during reading configuration of WSStar framework in order to load 
+//  proper handlers.
+//---------------------------------------------------------------------------
+//
+void CWSStarPlugin::StartElementL(const TDesC8& /*aNsUri*/,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& /*aQName*/,
+                                    const RAttributeArray& aAttrs)
+    {
+    if(aLocalName.Compare(KDeviceIdLocalName)==0)
+        {
+            ResetContentL();
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::Found deviceId tag")));
+        }
+    else if(aLocalName.Compare(KHandlerLocalName) == 0)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::Found handler")));
+        TPtrC8 pClass = SenXmlUtils::AttrValue(aAttrs, KClassAttr);
+        TPtrC8 pVersion = SenXmlUtils::AttrValue(aAttrs, KVersionAttr);
+        
+        //message handlers
+        if ((pClass == KAddressingValue) ||
+            (pClass == KEnveloperValue) ||
+            (pClass == KCredentialCollectorValue )||
+            (pClass == KSecurityValue) ||
+            (pClass == KPassportValue))
+            {
+            AddHandlerL(pClass, pVersion, SenHandler::EMessageHandler);
+            }
+        //session handlers
+        else if((pClass == KValidateValue) ||
+                (pClass == KServiceUpdateValue) ||
+                (pClass == KRegisterValue) || 
+                (pClass == KPolicyValue) )
+            {
+            AddHandlerL(pClass, pVersion, SenHandler::ESessionHandler);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin but can not load it")));
+            }
+             
+        }
+    }
+//---------------------------------------------------------------------------
+//  used during reading configuration of WSStar framework 
+//---------------------------------------------------------------------------
+//
+void CWSStarPlugin::EndElementL(const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName)
+    {
+    if(aLocalName.Compare(KDeviceIdLocalName)==0)
+        {
+        TPtrC8 content = Content();
+        if (content.Length()>0)
+            {
+            delete iDeviceId;
+            iDeviceId = NULL;
+            iDeviceId = HBufC8::NewL(content.Length());
+            TPtr8 deviceIdDes = iDeviceId->Des();
+            deviceIdDes.Copy(content);
+            }
+        else
+            {
+            GenerateDeviceIdL();
+            }
+        }
+    else
+        {
+        CSenBaseFragment::EndElementL(aNsUri,aLocalName,aQName);
+        }
+    }
+    
+//---------------------------------------------------------------------------
+// getter of handler, using its cue
+//---------------------------------------------------------------------------
+//    
+
+MSenHandler* CWSStarPlugin::Handler(const TDesC8& aCue)
+    {
+    TInt count = iMsgHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iMsgHandlers[i]->Name() == aCue)
+            {
+            return iMsgHandlers[i];
+            }
+        }
+    count = iSessionHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iSessionHandlers[i]->Name() == aCue)
+            {
+            return iSessionHandlers[i];
+            }
+        }
+    return NULL;
+    }
+//---------------------------------------------------------------------------
+// remove handler by cue, used during reloading (another version of handler is 
+//      used than deafault setup)
+//---------------------------------------------------------------------------
+//    
+void CWSStarPlugin::RemoveHandler(const TDesC8& aCue)
+    {
+    TInt count = iMsgHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iMsgHandlers[i]->Name() == aCue)
+            {
+            delete iMsgHandlers[i];
+            iMsgHandlers.Remove(i);
+            return;
+            }
+        }
+    count = iSessionHandlers.Count();
+    for(TInt i=0;i<count; i++)
+        {
+        if (iSessionHandlers[i]->Name() == aCue)
+            {
+            delete iSessionHandlers[i];
+            iSessionHandlers.Remove(i);
+            return;
+            }
+        }
+    }
+
+
+
+//---------------------------------------------------------------------------
+// Process Outbound validation phase
+//---------------------------------------------------------------------------
+//     
+TInt CWSStarPlugin::ProcessOutboundValidationL( MSenServiceDescription& aPattern, 
+                                                MSenRemoteServiceSession* aRemoteServiceSession,
+                                                HBufC8*& aErrorMessage )
+    {
+    CSenSessionHandler* pSTShandler = (CSenSessionHandler*)Handler(KValidateValue);
+    CWSStarSessionContext* pSessionValidateCtx = ((CWSStarServiceSession*)aRemoteServiceSession)->SessionContext();
+    if (!pSessionValidateCtx) //sessionCts exist if revalidation is processing
+        {
+        CWSStarPolicyHandler* policyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);
+        pSessionValidateCtx = CWSStarSessionContext::NewLC(Manager().XMLReader(), &aPattern, policyHandler);
+        pSessionValidateCtx->Add(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        ((CWSStarServiceSession*)aRemoteServiceSession)->SetSessionContext(pSessionValidateCtx);
+        CleanupStack::Pop(pSessionValidateCtx);
+        }
+    else
+        {
+        pSessionValidateCtx->Update(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        }
+    TInt error(KErrNone);
+    TRAPD(errorL, error = pSTShandler->InvokeL(*pSessionValidateCtx));
+    if ( error )
+        {
+        const TDesC8* pNotOwnedErrorMsg = pSessionValidateCtx->GetDesC8L(WSStarContextKeys::KErrMessage);
+        if ( pNotOwnedErrorMsg )
+            {
+            aErrorMessage = pNotOwnedErrorMsg->AllocL();
+            }
+        }
+    if (errorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundValidationL() !!!!leave from validate handler")));
+        error = errorL;
+        }
+#ifdef RD_SEN_VTCP_SUPPORT		
+	if(error)         
+       {
+        return error;        
+       }
+    CSenSessionHandler* pCoBrandinghandler = (CSenSessionHandler*)Handler(KCoBrandingValue);
+    CWSStarSessionContext* pSessionCoBrandingCtx = ((CWSStarServiceSession*)aRemoteServiceSession)->SessionContext();
+    if (!pSessionCoBrandingCtx) //sessionCts exist if revalidation is processing
+        {
+        CWSStarPolicyHandler* policyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);
+        pSessionCoBrandingCtx = CWSStarSessionContext::NewLC(Manager().XMLReader(), &aPattern, policyHandler);
+        pSessionCoBrandingCtx->Add(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        ((CWSStarServiceSession*)aRemoteServiceSession)->SetSessionContext(pSessionCoBrandingCtx);
+        CleanupStack::Pop(pSessionCoBrandingCtx);
+        }
+    else
+        {
+        pSessionCoBrandingCtx->Update(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        }
+
+    TRAPD(cberrorL, error = pCoBrandinghandler->InvokeL(*pSessionCoBrandingCtx));
+    if ( error )
+        {
+        const TDesC8* pNotOwnedErrorMsg = pSessionCoBrandingCtx->GetDesC8L(WSStarContextKeys::KErrMessage);
+        if ( pNotOwnedErrorMsg )
+            {
+            aErrorMessage = pNotOwnedErrorMsg->AllocL();
+            }
+        }
+    
+    
+    
+    if (cberrorL!=KErrNone)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundValidationL() !!!!leave from validate handler")));
+        error = cberrorL;
+        }
+#endif//RD_SEN_VTCP_SUPPORT		
+    return error;
+    }
+    
+    
+    
+//---------------------------------------------------------------------------
+// Process Outbound message phase
+//---------------------------------------------------------------------------
+//                                          
+TInt CWSStarPlugin::ProcessOutboundMessageL( CWSStarMessageContext*& aMsgCtx,
+                                             const TDesC8* aBody,
+                                             CSenSoapMessage*& aReadyMsg )
+    {
+//----------------enveloper
+    TInt error(KErrNone);
+    CSenMessageHandler* pHandler = NULL;
+    aMsgCtx->Update(WSStarContextKeys::KBody, *aBody);
+    if (aReadyMsg)
+        {
+        aMsgCtx->Update(SenContext::KSenCurrentSoapMessageCtxKey, aReadyMsg);
+        }
+    else
+        {
+        pHandler = (CSenMessageHandler*)Handler(KEnveloperValue);
+        if (pHandler)
+            {
+            TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+            if (errorL!=KErrNone)
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundMessageL() !!!!leave from enveloper handler")));
+                error = errorL;
+                }
+            }
+        aReadyMsg = aMsgCtx->GetCurrentSoapMessage();
+        }
+
+//----------------passport
+    if (error) return error;
+    pHandler = (CSenMessageHandler*)Handler(KPassportValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundMessageL() !!!!leave from passport handler")));
+            error = errorL;
+            }
+        }
+    if (error) return error;
+//----------------addresing 
+//some  logic which will load oall hanlders and in iteration will produce whole messge
+//      see axis2\axis2-M2-src\modules\core\src\org\apache\axis\engine\Phase.java
+//      now just addressing
+    pHandler = (CSenMessageHandler*)Handler(KAddressingValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundMessageL() !!!!leave from addressing handler")));
+            error = errorL;
+            }
+        }
+    if (error) return error;
+//--------------------credential collector handler
+//adding credentials
+    pHandler = (CSenMessageHandler*)Handler(KCredentialCollectorValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundMessageL() !!!!leave from credentail collector handler")));
+            error = errorL;
+            }
+        }
+    if (error) return error;
+ 
+//--------------------signatureContext handler
+//getting pop and sign
+    pHandler = (CSenMessageHandler*)Handler(KSecurityValue);
+    if (pHandler)
+        {
+        TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundMessageL() !!!!leave from security handler")));
+            error = errorL;
+            }
+        }
+    return error;
+    }
+
+
+
+
+//---------------------------------------------------------------------------
+// Process Ibound message phase (body as element)
+//---------------------------------------------------------------------------
+//   
+TInt CWSStarPlugin::ProcessInboundMessageL(CWSStarMessageContext*& aMsgCtx,
+                             CSenSoapMessage*& aMsg)
+    {
+        TInt error(KErrNone);
+        aMsgCtx->Add(SenContext::KSenCurrentSoapMessageCtxKey, aMsg);
+        CSenMessageHandler* pHandler(NULL);
+        
+//----------------addresing 
+//some  logic which will load oall hanlders and in iteration will produce whole messge
+//      see axis2\axis2-M2-src\modules\core\src\org\apache\axis\engine\Phase.java
+//      now just addressing
+        pHandler = (CSenMessageHandler*)Handler(KAddressingValue);
+        if (pHandler)
+            {
+            TRAPD(errorL, error = pHandler ->InvokeL(*aMsgCtx));            
+            if (errorL!=KErrNone)
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessInboundMessageL() !!!!leave from addressing handler")));
+                error = errorL;
+                }
+            }
+        //----------------passport
+        if (error) return error;
+        pHandler = (CSenMessageHandler*)Handler(KPassportValue);
+        if (pHandler)
+            {
+            TRAPD(errorL, error = pHandler->InvokeL(*aMsgCtx));
+            if (errorL!=KErrNone)
+                {
+                TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessInboundMessageL() !!!!leave from passport handler")));
+                error = errorL;
+                }
+            }
+        return error;
+    }
+        
+        
+//---------------------------------------------------------------------------
+// Process Ibound dispatch phase (in fact updatinf session)
+//---------------------------------------------------------------------------
+//        
+TInt CWSStarPlugin::ProcessInboundDispatchL(MSenRemoteServiceSession* aRemoteServiceSession,
+                                           CSenSoapMessage*& aMsg)
+    {
+    CSenSessionHandler* pServiceUpdate = 
+                    (CSenSessionHandler*)Handler(KServiceUpdateValue);
+    CWSStarSessionContext* pSessionCtx = ((CWSStarServiceSession*)aRemoteServiceSession)->SessionContext();
+    if (pSessionCtx)
+        {
+        if (!pSessionCtx->GetSenRemoteServiceSessionL(WSStarContextKeys::KServiceSession))
+            {
+            pSessionCtx->Add(WSStarContextKeys::KServiceSession, *(MSenRemoteServiceSession*)aRemoteServiceSession);
+            }
+        pSessionCtx->Update(SenContext::KSenCurrentSoapMessageCtxKey, aMsg);
+        TInt error(KErrNone);
+        TRAPD(errorL, error = pServiceUpdate->InvokeL(*pSessionCtx));
+        if (errorL!=KErrNone)
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessInboundDispatchL() !!!!leave from Servide Update handler")));
+            error = errorL;
+            }
+        return error;
+        }
+    else
+        {
+        //in STS session , sessionContext is not set, no dispatching yet in STS session
+        return KErrNotFound;
+        }
+    /*
+    handle error will know after that revalidateNeeded=ETrue and make ValidateOutboud again
+        this call Create session in WS*Plugin which checking credential*/
+
+    }
+
+
+//---------------------------------------------------------------------------
+// Getter for Device Id.
+//---------------------------------------------------------------------------
+//        
+TInt CWSStarPlugin::DeviceId(TPtrC8& aValue)
+    {
+    if (iDeviceId)
+	    {
+        aValue.Set(*iDeviceId);
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+//---------------------------------------------------------------------------
+// Generate Device Id
+//---------------------------------------------------------------------------
+//        
+void CWSStarPlugin::GenerateDeviceIdL()
+    {
+    CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
+    delete iDeviceId;
+    iDeviceId = NULL;
+    iDeviceId = pGuidGenerator->GetRandomGuid8LC();
+    TPtr8 deviceIdDes = iDeviceId->Des();
+    deviceIdDes.LowerCase();
+    CleanupStack::Pop(iDeviceId);
+    CleanupStack::PopAndDestroy(pGuidGenerator);
+    }
+//---------------------------------------------------------------------------
+// Add handler tag into session.xml
+//---------------------------------------------------------------------------
+//        
+void CWSStarPlugin::AddHandlerTag(TPtr8& aXml, const TDesC8& aHandlerClassName)
+    {
+    aXml.Append(KSenLessThan);
+    aXml.Append(KHandlerLocalName);
+    aXml.Append(KSenSpace);
+    //class attr
+    aXml.Append(KClassAttr);
+    aXml.Append(KSenEqualsDblQuot);
+    aXml.Append(aHandlerClassName);
+    aXml.Append(KSenDblQuot);
+    TInt index = iVersions.Find(aHandlerClassName);
+    if (index != KErrNotFound)
+        {
+        HBufC8* value = (HBufC8*)iVersions.ValueAt(index);
+        if (value->Length())
+            {
+            aXml.Append(KSenSpace);
+            aXml.Append(KVersionAttr);
+            aXml.Append(KSenEqualsDblQuot);
+            aXml.Append(*value);
+            aXml.Append(KSenDblQuot);    
+            }
+        }   
+    aXml.Append(KSenSlashGreaterThan);
+    }
+    
+//---------------------------------------------------------------------------
+// Add handler into array, WS* SIF implementation keep handlers after loading
+//---------------------------------------------------------------------------
+//        
+void CWSStarPlugin::AddHandlerL(const TDesC8& aHandlerClassName, const TDesC8& aVersion, SenHandler::THandlerType aType)
+    {
+    TInt index = iVersions.Find(aHandlerClassName);
+    if (index == KErrNotFound)
+        {
+        MSenHandler* handler  = NULL;
+        CWSStarHandlerContext* ctx = NULL;
+        ctx = CWSStarHandlerContext::NewL();
+        CleanupStack::PushL(ctx);
+        //ctx->Add(HandlerContextKey::KLogger, Log());
+        ctx->Add(iManager);
+        ctx->Update(HandlerContextKey::KVersion, aVersion);
+        iVersions.Append(aHandlerClassName.AllocL(), aVersion.AllocL());
+        if(aType == SenHandler::EMessageHandler)
+            {
+            TRAPD(loadError, handler = CSenMessageHandler::NewL(aHandlerClassName, *ctx));    
+            if (loadError != KErrNone)
+                {
+                User::Leave(loadError);
+                }
+            else
+                {
+                iMsgHandlers.Append((CSenMessageHandler*)handler);    
+                }    
+            }
+        else if (aType == SenHandler::ESessionHandler)
+            {
+            ctx->Add(HandlerContextKey::KSIF, this);
+            TRAPD(loadError, handler = CSenSessionHandler::NewL(aHandlerClassName, *ctx));
+            if (loadError != KErrNone)
+                {
+                User::Leave(loadError);
+                }
+            else
+                {
+                iSessionHandlers.Append((CSenSessionHandler*)handler);
+                }        
+            }
+        CleanupStack::Pop(ctx);
+        iHandlerContexts.Append(ctx);
+        }
+    else
+    //reload handler.
+    //user info from session.xml (in fact this is only for testing , nobody can have access to session.xml)
+        {
+        HBufC8* value = (HBufC8*)iVersions.ValueAt(index);
+        if (*value != aVersion)
+            {//reload
+            iVersions.RemoveByKey(aHandlerClassName);
+            RemoveHandler(aHandlerClassName);
+            //potentail infinitve reccurence!
+            AddHandlerL(aHandlerClassName, aVersion, aType);    
+            }
+        }
+    }
+
+//---------------------------------------------------------------------------
+// SetTransportPropertiesL
+//---------------------------------------------------------------------------
+//        
+TInt CWSStarPlugin::SetTransportPropertiesL(MSenTransport& /* aTransport */)
+    {
+    return KErrNotSupported; 
+    }
+    
+MSenHandler* CWSStarPlugin::PolicyHandler()
+{
+    MSenHandler* pPolicyHandler =  Handler(KPolicyValue());
+    if(pPolicyHandler)
+    return pPolicyHandler;
+    else
+    return NULL;
+}
+TInt CWSStarPlugin::PolicyConsumerAddedL(CSenServiceSession* aNewSession, MSenRemoteServiceConsumer& aRemoteConsumer)
+{
+    CWSStarPolicyHandler* policyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);
+    return policyHandler->PolicyConsumerAddedL(aNewSession,aRemoteConsumer);
+    
+}
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarpolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,689 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "wsstarpolicy.h"
+#include "wsstarpolicyhandler.h" 
+#include "wsstarcons.h"
+
+namespace
+{   
+    _LIT8(KServicePolicyLocalName, "ServicePolicy");
+    _LIT8(KClientServicePolicyLocalName, "ClientPolicy");
+    _LIT8(KSenNsUri, "urn:com.nokia.Sen.config.1.0");
+    
+    _LIT8(KHeader, "Header");
+    _LIT8(KBody, "Body");
+    _LIT8(KNamespace, "Namespace");
+}
+/*
+
+CWSStarPolicy* CWSStarPolicy::NewL()
+{
+    CWSStarPolicy* pSelf =
+    CWSStarPolicy::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;   
+}
+CWSStarPolicy* CWSStarPolicy::NewLC()
+{
+    CWSStarPolicy* pSelf =
+    new (ELeave) CWSStarPolicy();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf; 
+}
+CWSStarPolicy::~CWSStarPolicy()
+{
+    
+}
+CWSStarPolicy::CWSStarPolicy()
+{
+    
+}
+void CWSStarPolicy::ConstructL()
+{
+}
+
+
+void CWSStarPolicy::SetPolicy(CSenElement* aPolicy)
+{
+}
+
+*/
+CSenElement* CWSStarPolicy::GetPolicyL(MSenHandlerContext& aCtx, MSenServiceDescription* aSD)	//codescannerwarnings
+{
+
+    CWSStarPlugin* SIF = (CWSStarPlugin*)aCtx.GetAnyL(HandlerContextKey::KSIF());//codescannerwarnings
+    if(SIF)
+    {
+        CSenSessionHandler* pPolicyHandler =  (CSenSessionHandler*)SIF->Handler(WSStarConfig::KPolicyValue);
+        if(pPolicyHandler)
+        {
+            CWSStarPolicyHandler* pHandler = (CWSStarPolicyHandler*)pPolicyHandler;
+            if( pHandler )
+            {
+                TPtrC8 contract(KWSStarSTSContract());
+                return pHandler->PolicyL(aSD);	//codescannerwarnings
+            }
+        }
+    }
+    return NULL;
+}
+
+TPtrC8 CWSStarPolicy::GetAttributeValueL(const TDesC8& aAttribute, CSenElement* aElement)
+{
+    RPointerArray<CSenBaseAttribute>& attrs = aElement->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name().Compare(aAttribute) == 0)
+            {
+             return bs->Value();
+            }
+         }
+    return KNullDesC8();
+}
+
+TPtrC8 CWSStarPolicy::GetNSPrefixL(const TDesC8& aNamespaceUri, CSenElement* aElement)
+{
+    RPointerArray<CSenNamespace> sourceNamespaces = aElement->NamespacesL();
+    if (sourceNamespaces.Count() > 0)
+    {
+        for (TInt i=0;i<sourceNamespaces.Count(); i++)
+        {
+            CSenNamespace* pNamespace = sourceNamespaces[i];
+            if(pNamespace->URI().Compare(aNamespaceUri) == 0)
+            {
+                return pNamespace->Prefix();
+            }
+        }
+    }
+    
+    return KNullDesC8();        
+}
+TInt CWSStarPolicy::ChildCountL(CSenElement* aTerm)	//codescannerwarnings
+{
+    RPointerArray<CSenElement>& children = aTerm->ElementsL();
+    
+    TInt childCount = children.Count();
+    return childCount;
+    
+}
+TBool CWSStarPolicy::CheckPolicyValueL(const TDesC8& aKey, MSenServiceDescription* aSD)
+    {
+
+    CSenWSDescription* pSD = (CSenWSDescription*)aSD;
+//    CSenElement* pServicePolicy = pSD->AsElement().Element(KServicePolicyLocalName);
+    MSenServicePolicy* pServicePolicy = pSD->ServicePolicy(); 
+    // Cant be possible :p
+    if(!pServicePolicy)
+        return EFalse;
+   
+//    CSenElement* pClientPolicy = pServicePolicy->Element(KClientServicePolicyLocalName);
+    CSenElement* pClientPolicy = pServicePolicy->ClientPolicy();
+/*    
+    if(!pClientPolicy)
+        {
+        pClientPolicy = pServicePolicy->Element(KSenNsUri, KClientServicePolicyLocalName);
+        }
+  */	
+    //now start worrying
+    if(!pClientPolicy)
+    return EFalse;
+    
+    if(pClientPolicy)
+    {
+        CSenElement* result = NULL;
+        result = pClientPolicy->Element(aKey);
+        if(result)
+            return ETrue;
+        else
+            return EFalse;
+    }                    
+
+    return EFalse;
+    }
+HBufC8* CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, MSenServiceDescription* aSD)
+    {
+
+    CSenWSDescription* pSD = (CSenWSDescription*)aSD;
+    CSenElement* pServicePolicy = pSD->AsElement().Element(KServicePolicyLocalName);
+    HBufC8* value = NULL;
+    // Cant be possible :p
+    if(!pServicePolicy)
+        return value;
+    CSenElement* pClientPolicy = pServicePolicy->Element(KClientServicePolicyLocalName);
+    if(!pClientPolicy)
+        {
+        pClientPolicy = pServicePolicy->Element(KSenNsUri, KClientServicePolicyLocalName);
+        }
+    //now start worrying
+    if(!pClientPolicy)
+        return value;
+    
+    if(pClientPolicy)
+    {
+        CSenElement* result = NULL;
+        result = pClientPolicy->Element(aKey);
+        if(result && result->HasContent())
+        {
+            value = result->Content().AllocL();
+        }
+    }
+      return value;
+    }
+TInt CWSStarPolicy::SearchForElementsL(CSenElement* aPolicy, TPtrC8 aKey, RPointerArray<CSenElement>& aElements)
+{
+    RPointerArray<CSenElement>& children = aPolicy->ElementsL();
+    TInt count(children.Count());
+    CSenElement* req = NULL;
+    CSenElement* result = NULL;
+    for (TInt i = 0; i < count; i++)
+     {
+        req = children[i];
+        TPtrC8 nimi = req->LocalName();
+        if(nimi.Compare(aKey) == 0)
+        {
+                result =  req;
+                aElements.Append(result);
+        }
+
+        if(!result)
+            SearchForElementsL(req, aKey, aElements);
+//        if (result)
+//           break;
+     }
+     
+    return aElements.Count();
+    
+}
+CSenElement* CWSStarPolicy::SearchForElementL(CSenElement* aPolicy, TPtrC8 aKey)	//codescannerwarnings
+{
+
+    RPointerArray<CSenElement>& children = aPolicy->ElementsL();
+    TInt count(children.Count());
+    CSenElement* req = NULL;
+    CSenElement* result = NULL;
+    for (TInt i = 0; i < count; i++)
+     {
+        req = children[i];
+        TPtrC8 nimi = req->LocalName();
+        if(nimi.Compare(aKey) == 0)
+        {
+                result =  req;
+        }
+        if(!result)
+            result = SearchForElementL(req, aKey);	//codescannerwarnings
+        if (result)
+           break;
+     }
+     
+    return result;
+}
+
+HBufC8* CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, CWSStarPlugin& aWSStarPlugin, MSenServiceDescription* aSD)
+    {
+    HBufC8* result = NULL;
+    CSenElement* policy = NULL;
+    
+    CSenSessionHandler* pPolicyHandler =  (CSenSessionHandler*)(aWSStarPlugin.Handler(WSStarConfig::KPolicyValue()));
+    if(pPolicyHandler)
+    {
+        CWSStarPolicyHandler* phand = (CWSStarPolicyHandler*)pPolicyHandler;
+        if(phand)
+        {
+                TPtrC8 contract(KWSStarSTSContract());
+                policy =  phand->PolicyL(aSD); //Policy(aSD);	//codescannerwarnings
+  
+        }
+           
+    }
+    if(policy)
+    {
+        CSenElement* token = SearchForElementL(policy, aKey);	//codescannerwarnings
+        CSenElement* subValue = NULL;
+        if(token)                
+        {
+            if(aSubKey.Length() > 0)
+                subValue =  SearchForElementL(token, aSubKey);   	//codescannerwarnings
+            else
+                subValue = token;
+            
+                if(subValue)
+                {
+                    if(ChildCountL(subValue) > 0)	//codescannerwarnings
+                        {
+                        //not supprted now
+                        }
+                    if(subValue->HasContent())
+                        {
+                        result = subValue->Content().AllocL();
+                        }
+                }
+            }
+        }
+    return result;
+    }
+HBufC8* CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD)
+    {
+    RPointerArray<CSenElement> aElements;
+    return GetPolicyValueL(aKey, aSubKey, aCtx, aSD, aElements);
+    }
+HBufC8* CWSStarPolicy::GetPolicyValueL(const TDesC8& aTokenType, const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD)
+    {
+    RPointerArray<CSenElement> aElements;
+    return GetPolicyValueL(aTokenType, aKey, aSubKey, aCtx, aSD, aElements);
+    }
+HBufC8* CWSStarPolicy::GetPolicyValueL(const TDesC8& aTokenType, const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD, RPointerArray<CSenElement>& aElements)
+{
+    HBufC8* result = NULL;
+    CSenElement* policy = GetPolicyL(aCtx, aSD);	//codescannerwarnings
+    if(policy)
+    {
+        RPointerArray<CSenElement> elements;
+        CleanupClosePushL(elements);
+        
+        TInt count = SearchForElementsL(policy, aKey, elements);
+
+        for (TInt i = 0; i< count; i++)
+            {
+            
+            CSenElement* token = elements[i];
+            CSenElement* ele = SearchForElementL(token, _L8("TokenType"));	//codescannerwarnings
+            if(ele)            
+            {
+                if(ele->HasContent())
+                {
+                    TPtrC8 contents = ele->Content();
+                    if(contents == aTokenType)
+                        {
+                        CSenElement* subValue = NULL;
+                        if(token)
+                            {
+                                if(aSubKey.Length() > 0)
+                                    subValue =  SearchForElementL(token, aSubKey);   	//codescannerwarnings
+                                else
+                                    subValue = token;
+                                
+                                    if(subValue)
+                                    {
+                                        if(ChildCountL(subValue) > 0)	//codescannerwarnings
+                                        {
+                                            //                    All of the elements
+                                            aElements =  subValue->ElementsL();
+                                            //OuterXML
+                                            HBufC8* data = subValue->AsXmlL();
+                                            if(data && data->Length() > 0)
+                                            {//parse the tag name and return the child tags only
+                                                TInt start = data->Locate('>');
+                                                TInt end = data->LocateReverse('<');
+                                                if(start+1 < end-1 && start != KErrNotFound && end != KErrNotFound)
+                                                {
+                                                    TInt length = end-1-start;
+                                                    TPtrC8 dataq(data->Mid(start+1,length));
+                                                    result = HBufC8::NewL(dataq.Length());
+                                                    TPtr8 id16 = result->Des();
+                                                    id16.Copy(dataq); 
+                                                }
+                                                
+                                            }
+                                            delete data;
+                                        }
+                                        else if(subValue->HasContent())
+                                        {
+                                            result = subValue->Content().AllocL();
+                                        }
+                                        
+                                    }
+                            }
+                        
+                        
+                        
+                        }
+                }
+            }
+            
+            }
+        CleanupStack::Pop(&elements);
+        elements.Close();
+    }   
+            
+    return result;
+    
+}
+HBufC8* CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD, RPointerArray<CSenElement>& aElements)
+{
+    HBufC8* result = NULL;
+    CSenElement* policy = GetPolicyL(aCtx, aSD);	//codescannerwarnings
+    if(policy)
+    {
+        CSenElement* token = SearchForElementL(policy, aKey);	//codescannerwarnings
+        CSenElement* subValue = NULL;
+        if(token)                
+        {
+            if(aSubKey.Length() > 0)
+                subValue =  SearchForElementL(token, aSubKey);   	//codescannerwarnings
+            else
+                subValue = token;
+            
+                if(subValue)
+                {
+                    if(ChildCountL(subValue) > 0)	//codescannerwarnings
+                    {
+                        //                    All of the elements
+                        aElements =  subValue->ElementsL();
+                        //OuterXML
+                        HBufC8* data = subValue->AsXmlL();
+                        if(data && data->Length() > 0)
+                        {//parse the tag name and return the child tags only
+                            TInt start = data->Locate('>');
+                            TInt end = data->LocateReverse('<');
+                            if(start+1 < end-1 && start != KErrNotFound && end != KErrNotFound)
+                            {
+                                TInt length = end-1-start;
+                                TPtrC8 dataq(data->Mid(start+1,length));
+                                result = HBufC8::NewL(dataq.Length());
+                                TPtr8 id16 = result->Des();
+                                id16.Copy(dataq); 
+                            }
+                            
+                        }
+                        delete data;
+                    }
+                    else if(subValue->HasContent())
+                    {
+                        result = subValue->Content().AllocL();
+                    }
+                    
+                }
+        }
+        
+    }   
+            
+    return result;
+}
+
+void CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey,MSenServiceDescription* aSD,RPointerArray<CSenElement>& aElements)
+    {
+
+    CSenWSDescription* pSD = (CSenWSDescription*)aSD;
+    CSenElement* pServicePolicy = pSD->AsElement().Element(KServicePolicyLocalName);
+
+    // Cant be possible :p
+    if(!pServicePolicy)
+        return;
+    CSenElement* pClientPolicy = pServicePolicy->Element(KClientServicePolicyLocalName);
+    if(!pClientPolicy)
+        {
+        pClientPolicy = pServicePolicy->Element(KSenNsUri, KClientServicePolicyLocalName);
+        }
+    //now start worrying
+    if(!pClientPolicy)
+        return;
+    
+    if(pClientPolicy)
+        {
+        CSenElement* resultKey = NULL;
+        resultKey = pClientPolicy->Element(aKey);
+        if(resultKey)
+            {
+            CSenElement* resultSubKey = NULL;
+            resultSubKey = resultKey->Element(aSubKey);
+            
+            if(resultSubKey)
+                {
+                 aElements = resultSubKey->ElementsL();
+                
+                     }
+            
+                 } 
+         
+            }
+      return;
+    }
+void CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD, RPointerArray<HBufC8>& aList)
+    {
+    CSenElement* policy = GetPolicyL(aCtx, aSD);	//codescannerwarnings
+    if (policy)
+        {
+        GetValueL(aKey, aSubKey, policy, aList);
+        }
+    }
+void CWSStarPolicy::GetPolicyValueL(const TDesC8& aKey, const TDesC8& aSubKey, CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD, RPointerArray<HBufC8>& aList)
+    {
+    CSenElement* policy = aPolicyHandler->PolicyL(aSD);	//codescannerwarnings
+    if (policy)
+        {
+        GetValueL(aKey, aSubKey, policy, aList);
+        }
+    /*if (aList.Count() == 0 && aKey == WSPolicy::KSignedParts)
+        {
+        aList.ResetAndDestroy();
+        aList.Append(_L8("MessageID").AllocL());
+        aList.Append(_L8("http://schemas.xmlsoap.org/ws/2004/08/addressing").AllocL());
+        aList.Append(_L8("ReplyTo").AllocL());
+        aList.Append(_L8("http://schemas.xmlsoap.org/ws/2004/08/addressing").AllocL());
+        aList.Append(_L8("To").AllocL());
+        aList.Append(_L8("http://schemas.xmlsoap.org/ws/2004/08/addressing").AllocL());
+        aList.Append(_L8("Action").AllocL());
+        aList.Append(_L8("http://schemas.xmlsoap.org/ws/2004/08/addressing").AllocL());
+        aList.Append(_L8("Timestamp").AllocL());
+        aList.Append(_L8("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd").AllocL());
+        }*/
+    }
+
+void CWSStarPolicy::GetValueL(const TDesC8& aKey, const TDesC8& aSubKey, CSenElement* aPolicy, RPointerArray<HBufC8>& aList)
+    {
+    CSenElement* token = SearchForElementL(aPolicy, aKey);	//codescannerwarnings
+    CSenElement* subValue = NULL;
+    if(token)
+    {
+        if(aSubKey.Length() > 0)
+            subValue =  SearchForElementL(token, aSubKey);   	//codescannerwarnings
+        else
+            subValue = token;
+        
+        if(subValue)
+        {
+            if(aKey == WSPolicy::KSignedParts || aSubKey == WSPolicy::KSignedParts)
+            {
+                CEncryptedSignedPartsI* signedParts = CEncryptedSignedPartsI::NewL(subValue);    
+                if(signedParts->Header() || signedParts->Body())
+                {
+                //return the list of elements to be signed or Enrypted
+                //If Body element is found in list then whole body should be signed/encrypted
+                //If Header Element is found then All headers should be signed/encrypted
+                //If individual elements are found then only those elements 
+                // in Header should be signed/encrypted
+                    signedParts->ElementsL(aList);	//codescannerwarnings
+                    
+                }
+                delete  signedParts;                   
+            }
+        }
+    }
+    }
+CSenElement* CWSStarPolicy::GetElementL(const TDesC8& aKey, const TDesC8& aSubKey, MSenHandlerContext& aCtx, MSenServiceDescription* aSD)
+{
+    CSenElement* policy = GetPolicyL(aCtx, aSD);	//codescannerwarnings
+    if(policy)
+    {
+        CSenElement* token = SearchForElementL(policy, aKey);	//codescannerwarnings
+        CSenElement* subValue = NULL;
+        if(token)
+        {
+            if(aSubKey.Length() > 0)
+                subValue =  SearchForElementL(token, aSubKey);   	//codescannerwarnings
+            else
+                subValue = token;
+            
+            if(subValue)
+            {
+                if(aKey == WSPolicy::KDictionaries || aSubKey == WSPolicy::KDictionary)
+                {
+                return subValue;
+                }
+            }
+        }
+        
+    }   
+    return NULL;
+}
+
+    
+///////////////////////////////////////////////////////////////////////
+//////    CEncryptedSignedPartsI                                              
+///////////////////////////////////////////////////////////////////////
+CEncryptedSignedPartsI* CEncryptedSignedPartsI::NewL(CSenElement* aAssertion)
+{
+     CEncryptedSignedPartsI* pSelf = CEncryptedSignedPartsI::NewLC(aAssertion);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+}  
+
+CEncryptedSignedPartsI* CEncryptedSignedPartsI::NewLC(CSenElement* aAssertion)
+{
+  
+    CEncryptedSignedPartsI* pSelf = new (ELeave) CEncryptedSignedPartsI();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAssertion);
+    return pSelf;  
+}
+CEncryptedSignedPartsI::~CEncryptedSignedPartsI()
+{
+    iHeaders.Close();
+}
+
+TBool CEncryptedSignedPartsI::IsEqualEncryptedSignedParts(CEncryptedSignedPartsI* aAssertion)
+{
+    if(Body() == aAssertion->Body() && Header() == aAssertion->Header())
+    {
+        return ETrue;    
+    }
+    
+    return EFalse;
+}
+
+TBool CEncryptedSignedPartsI::Header()
+{
+    return iHeader;    
+}
+TBool CEncryptedSignedPartsI::Body()
+{
+    return iBody;
+}
+void CEncryptedSignedPartsI::ElementsL(RPointerArray<HBufC8>& aElements)	//codescannerwarnings
+{
+    if(iBody)
+        {
+        aElements.Append(KBody().AllocL());
+        aElements.Append(KNullDesC8().AllocL());
+        }
+        
+    if(iHeader && iHeaders.Count() == 0)
+    {
+        aElements.Append(KHeader().AllocL());
+    }
+    else if(iHeader && iHeaders.Count() > 0)
+    {
+        for(TInt i = 0; i< iHeaders.Count(); i++)
+        {
+            SoapHeader header(iHeaders[i]);
+            TPtrC8 name(header.iName);
+            if(name != KNullDesC8())
+            {
+               aElements.Append(name.AllocL());
+               aElements.Append(header.iNsUri.AllocL());
+            }
+            
+        }
+    }
+}
+void CEncryptedSignedPartsI::ConstructL(CSenElement* aAssertion)
+{
+//No need to rip off caz there wont be any policy elements here
+
+    RPointerArray<CSenElement>& tokenChildren = aAssertion->ElementsL(); //find the policy element
+    
+    if(tokenChildren.Count() < 0)
+    {
+        iHeader = ETrue;
+        iBody = ETrue;
+        return;
+    }
+   
+    CSenElement* child = NULL;
+    SoapHeader header;
+    for (TInt i = 0; i< tokenChildren.Count(); i++) //while (tokenChildren.HasNext()) // Get all the elements
+    { 
+        child = tokenChildren[i];
+
+        TPtrC8 localName = child->LocalName();
+                
+        if(localName.Compare(KBody) == 0)
+        {
+           iBody = ETrue;
+        }
+        else if(localName.Compare(KHeader) == 0)
+        {
+            iHeader = ETrue;
+            //get header attributes
+            
+           TPtrC8 headerName = CWSStarPolicy::GetAttributeValueL(WSPolicy::KName, child);            
+           if(headerName != KNullDesC8())
+           {
+
+               header.iName.Set(headerName);
+           }
+           
+           TPtrC8 nsUri = CWSStarPolicy::GetAttributeValueL(KNamespace, child);            
+           //if(nsUri != KNullDesC8())
+           //{
+           header.iNsUri.Set(nsUri);             
+           //               header.iNsPrefix.Set(CWSStarPolicy::GetNSPrefixL(nsUri, child));
+           //}           
+           iHeaders.Append(header);
+
+        }
+    }
+}
+CEncryptedSignedPartsI::CEncryptedSignedPartsI()
+:
+    iHeader(EFalse),
+    iBody(EFalse)
+{
+    
+}
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarpolicyhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,200 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include "wsstarpolicyhandler.h"
+
+#include "senpointermap.h"
+#include "wspolicy.h"
+#include "sendebug.h"
+#include "wsstardictionary.h"
+#include "MSenServicePolicy.h"
+#include "wsstarpolicymanager.h"
+#include "senlogger.h"
+
+//---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+//---------------------------------------------------------------------------
+//
+CWSStarPolicyHandler* CWSStarPolicyHandler::NewL(TAny* aHandlerCtx)
+    {    
+    MSenHandlerContext* handlerCtx = reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarPolicyHandler* self   = new (ELeave) CWSStarPolicyHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarPolicyHandler::CWSStarPolicyHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarPolicyHandler::~CWSStarPolicyHandler()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("~CWSStarPolicyHandler::~CWSStarPolicyHandler()")));
+    delete iPolicyManager;
+    }
+
+//---------------------------------------------------------------------------
+// Second phase construction.
+//---------------------------------------------------------------------------
+//
+void CWSStarPolicyHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyHandler::ConstructL()")));
+    iPolicyManager = CWSStarPolicyManager::NewL((TAny*)&iHandlerContext);
+    }
+
+//---------------------------------------------------------------------------
+// the most emergent method in message handler interface.
+// Each sub-class must implement this method thus providing message processing routine.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPolicyHandler::InvokeL(MSenSessionContext& /*aCtx*/)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyHandler::InvokeL(MSenMessageContext& aCtx)")));
+//This method will be impelented when we want to apply some particular policy on some session
+//right now we wil just use the InvokeL(const TDesC8& aContract) method to register a contract for Policy
+    return KErrNone;
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+TInt CWSStarPolicyHandler::InvokeL(const TDesC8& aContract)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyHandler::InvokeL(MSenMessageContext& aCtx)")));
+    return iPolicyManager->InvokeL(aContract);
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//           
+TInt CWSStarPolicyHandler::UnRegisterWsPolicyL(MSenServiceDescription& aServiceDescription)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyHandler::UnRegisterWsPolicyL")));
+    TInt error(KErrGeneral);
+    return iPolicyManager->UnRegisterWsPolicyL(aServiceDescription, error);
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//           
+TInt CWSStarPolicyHandler::PolicyConsumerAddedL(CSenServiceSession* aNewSession, MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyHandler::PolicyConsumerAddedL")));
+    return iPolicyManager->PolicyConsumerAddedL(aNewSession,aRemoteConsumer);
+    }    
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//       
+TInt CWSStarPolicyHandler::DownloadPolicyL(CSenWSDescription* apArgument)
+    {
+    return iPolicyManager->DownloadPolicyL( apArgument );
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+CSenElement* CWSStarPolicyHandler::PolicyL(MSenServiceDescription* aSD)	//codescannerwarnings
+    {
+        return iPolicyManager->PolicyL(aSD);	//codescannerwarnings
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//      
+CSenElement* CWSStarPolicyHandler::PolicyL(const TDesC8& aUri)	//codescannerwarnings
+    {
+        return iPolicyManager->PolicyL(aUri);	//codescannerwarnings
+    }        
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//       
+TInt CWSStarPolicyHandler::UpdatePolicyL()
+    {
+    return iPolicyManager->UpdatePolicyL(this);
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//       
+SenHandler::THandlerDirection CWSStarPolicyHandler::Direction() const
+    {
+    return SenHandler::EBoth;
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+SenHandler::THandlerPhase CWSStarPolicyHandler::Phase()
+    {
+    return SenHandler::EValidate;
+    }
+
+//---------------------------------------------------------------------------
+// Init implementation
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPolicyHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+RFileLogger* CWSStarPolicyHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+void CWSStarPolicyHandler::DataTrafficDetails(TSenDataTrafficDetails& aDetails) 		          
+	{
+	iPolicyManager->DataTrafficDetails(aDetails);
+	}
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarpolicymanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,702 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <utf.h> // for reading policy from file (utf-8 conversion)
+
+#include <SenServiceConnection.h> // public error codes
+
+#include "senwspolicymanager.h"
+#include "seninternalwspolicy.h"
+
+#include "wsstarpolicymanager.h"
+
+#include "senpointermap.h"
+#include "wsstarhttpclient.h"
+#include "wspolicy.h"
+#include "sendebug.h"
+#include "wsstardictionary.h"
+#include "MSenServicePolicy.h"
+#include "wsstarpolicyrequest.h"
+#include "senlogger.h"
+
+class CWSStarHandlerContext;
+class CWSStarPolicyHandler;
+using namespace MSWSPolicy;
+
+namespace
+    {
+    _LIT8(KHttp, "http");
+/*    
+    TInt IsUriAlreadyExist(const TDesC8& aContract, const TDesC8 aUriName, RPolicyRequestMap& aRequestMap)
+        {
+        TInt uriCount(aRequestMap.Count());
+        // check this if it is already in aRequestMap                
+        for (TInt j = 0; j< uriCount; j++)
+            {
+            CPolicyReqMap* req = aRequestMap[j];
+            TPtrC8 contract = req->Contract();
+            TPtrC8 uri = req->Uri();
+            if(contract.Compare(aContract) == 0 && uri.Compare(aUriName) == 0)
+                {
+                return KErrNone;
+                }
+            }
+        return KErrNotFound;
+        }
+  */  
+    }
+    
+//---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+//---------------------------------------------------------------------------
+//
+CWSStarPolicyManager* CWSStarPolicyManager::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarPolicyManager* self   = new (ELeave) CWSStarPolicyManager(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarPolicyManager::CWSStarPolicyManager(MSenHandlerContext& aCtx): iSenHandlerContext(aCtx)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarPolicyManager::~CWSStarPolicyManager()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("~CWSStarPolicyManager::~CWSStarPolicyManager()")));
+    delete iRegistry;
+    delete iPolicyManager;
+//    iPolicyMap.ResetAndDestroy();
+    iContracts.ResetAndDestroy();
+    delete iDictionary;
+    
+    }
+
+//---------------------------------------------------------------------------
+// Second phase construction.
+//---------------------------------------------------------------------------
+//
+void CWSStarPolicyManager::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyManager::ConstructL()")));
+    iRegistry = CPolicyRegistry::NewL();
+    iDictionary = CWSStarDictionary::NewL(*(CSIF*)iSenHandlerContext.GetAnyL(HandlerContextKey::KSIF()), *Log());//codescannerwarnings
+    iPolicyManager = CSenWSPolicyManager::NewL(*iSenHandlerContext.GetSenCoreServiceManager());
+    }
+ 
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//     
+TInt CWSStarPolicyManager::InvokeL(const TDesC8& aContract)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPolicyManager::InvokeL(const TDesC8& aContract)");
+    
+    
+    if( aContract.Length() < 1 )
+        {
+        return KErrArgument;
+        }
+    if(!IsContractExist(aContract))
+        {
+        HBufC8* cont = aContract.AllocL();
+        iContracts.Append(cont);
+        }
+
+    return KErrNone;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+// 
+TInt CWSStarPolicyManager::IsContractExist(const TDesC8& aContract)    
+    {
+    
+    TInt count(iContracts.Count());
+    for(TInt i = 0; i< count; i++)
+        {
+        
+        TPtrC8 contract = iContracts[i]->Des();
+        if(contract.Compare(aContract) == 0)
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+//---------------------------------------------------------------------------
+// 
+#if !defined( RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET )
+TInt CWSStarPolicyManager::DownloadPolicyL( CSenWSDescription* apSD ) 
+#else // RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET == TRUE
+TInt CWSStarPolicyManager::DownloadPolicyL( CSenWSDescription* /* apSD */ ) 
+#endif  // RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyManager::DownloadPolicyL()")));
+    TInt contCount = iContracts.Count();
+    for(TInt j = 0; j< contCount; j++)    
+    {
+        TPtrC8 ptr = iContracts[j]->Des();
+        RegisterWsPolicyL(ptr);            
+    }
+
+
+    TInt error(KErrNone);
+    TInt leaveCode(KErrNone);
+    
+    RExpiredPolicyArray list;
+    CleanupClosePushL(list);    
+    TInt retVal = iPolicyManager->ExpiredPoliciesL(list, error);
+    if(retVal == KErrNone)
+    {
+        TPtrC8 finalUri(KHttp);
+        if( finalUri != KNullDesC8 )
+            {
+            error = KErrNotFound; // testing
+            TInt leaveCode(KErrNone);
+    #if !defined( RD_SEN_WS_STAR_DISABLE_POLICY_HTTP_GET )
+            TRAP( leaveCode, error = GetHttpPolicyL( finalUri, list, apSD); )
+    #endif 
+
+            
+                        
+            }
+    }
+    if( error )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPolicyManager::DownloadPolicyL:");
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- GetHttpPolicyL returned error: %d"), error ));
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," => attempting to read policy from file system..");
+        TRAP( leaveCode, error = GetPolicyFromFileL( list ); )
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- GetPolicyFromFileL returned: %d"), error ));
+        }
+
+    CleanupStack::Pop(&list);  
+    
+    TInt count(list.Count());
+    for(TInt i = 0; i< count; i++)
+    {
+        CExpiredPolicy* req = list[i];
+        if(req->Contents() != KNullDesC8())
+        {
+            RPointerArray<CSenWSDescription> serviceDescriptions;
+            CleanupClosePushL(serviceDescriptions);
+            TInt retVal(KErrNone);
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, retVal = iSenHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, req->Contract()));
+            if(leaveCode == KErrNone && retVal == KErrNone && serviceDescriptions.Count() > 0)
+                {
+                for(TInt j = 0; j < serviceDescriptions.Count(); j++)
+                    {
+                    CSenWSDescription* sD = serviceDescriptions[j];
+
+                    CSenWSDescription* tempSd = CSenWSDescription::NewLC();
+                        CBufFlat *pBuf = CBufFlat::NewL(64);
+                        CleanupStack::PushL(pBuf);
+                        RBufWriteStream bufWs(*pBuf);
+                        CleanupClosePushL(bufWs);
+                        
+                        if(sD->Contract() == KWSStarSTSContract)
+                            {
+                            CWSStarTrustClient* pTrustClient = (CWSStarTrustClient*)sD;   
+                            pTrustClient->WriteAsXMLToL(bufWs);
+                            tempSd->SetReader(*iSenHandlerContext.GetSenCoreServiceManager()->XMLReader());
+                            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(pBuf->Ptr(0)));
+                            tempSd->ParseL(pBuf->Ptr(0));
+                            }
+                        else if (sD->DescriptionClassType() == MSenServiceDescription::EWSStarServiceSession)
+                            {
+                            CWSStarServiceSession* pSd = (CWSStarServiceSession*)sD;
+                            pSd->WriteAsXMLToL(bufWs);
+                            tempSd->SetReader(*iSenHandlerContext.GetSenCoreServiceManager()->XMLReader());
+                            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(pBuf->Ptr(0)));
+                            tempSd->ParseL(pBuf->Ptr(0));
+                            }
+
+                    CleanupStack::PopAndDestroy(&bufWs);
+                    CleanupStack::PopAndDestroy(pBuf);
+                    
+                    TInt errorCode(KErrGeneral);
+                    AddWsPolicy1L(tempSd, req->Uri(), req->Contents(), errorCode );             
+                    iDictionary->InvokeL(&iSenHandlerContext, tempSd);
+			        TSenDataTrafficDetails details;
+			        iDictionary->DataTrafficDetails(details);
+				    iPolicyDetails += details;  
+                    CleanupStack::PopAndDestroy(tempSd); 
+                    }
+                }
+            CleanupStack::PopAndDestroy(&serviceDescriptions); 
+        }
+    }
+    list.ResetAndDestroy();
+/*
+//This is ONLY working for MS cases. i.e. urn:wstar:sts contract.
+//Right now its not parsing any other Sds to find dictionaries becuase 
+//the search uses MS specifc namespace to dfind the dictioanry elements
+#ifndef RD_SEN_WS_STAR_DISABLE_DICTIONARY_FETCHING
+        iDictionary->InvokeL(&iSenHandlerContext); 
+#endif // not defined RD_SEN_WS_STAR_DISABLE_DICTIONARY_FETCHING
+//        }
+    requestMap.ResetAndDestroy();
+    iRegistry->ResetRegistry();
+*/    
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CWSStarPolicyManager::GetHttpPolicyL( const TDesC8& aEndpoint, RExpiredPolicyArray& aRequestMap, CSenWSDescription* /*apSD*/ )
+    {
+    TInt retVal(KErrNone);
+    CSenWSDescription* pInitializer = CSenWSDescription::NewLC();
+    pInitializer->SetEndPointL(aEndpoint);
+
+    CWSStarHttpClient* pPolicyClient = CWSStarHttpClient::NewLC(*(CSIF*)iSenHandlerContext.GetAnyL(HandlerContextKey::KSIF()), pInitializer, *Log());//codescannerwarnings
+        
+    // Fix the first URI and request part of the request
+    TInt count( aRequestMap.Count() );
+    for (TInt i = 0; i< count; i++)
+        {
+        
+        CExpiredPolicy* req = aRequestMap[i];
+        TPtrC8 contract = req->Contract();
+        TPtrC8 endpoint = req->Uri();
+        
+        TPtrC8 request(endpoint.Right(endpoint.Length() - aEndpoint.Length()));
+
+        RPointerArray<CSenWSDescription> serviceDescriptions;
+        CleanupClosePushL(serviceDescriptions);
+        TInt retVal(KErrNone);
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, retVal = iSenHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, contract));
+        if(leaveCode == KErrNone && retVal == KErrNone && serviceDescriptions.Count() > 0)
+            {
+            CSenWSDescription* sD = serviceDescriptions[0];
+
+            HBufC8* pResponse = NULL;
+            TInt leaveCode(KErrNone);
+            TInt submitRetCode(KErrNone);
+
+            TRAP( leaveCode, submitRetCode = pPolicyClient->GetHttpL( request, pResponse, sD ); )
+            TSenDataTrafficDetails details;
+            pPolicyClient->DataTrafficDetails(details);
+            iPolicyDetails += details; 
+                    
+            if( submitRetCode && retVal == KErrNone )
+                {
+                // Store the error code from the 1st failing request 
+                retVal = submitRetCode;
+                }    
+            if( leaveCode && retVal == KErrNone )
+                {
+                retVal = leaveCode;
+                }    
+            if(pResponse && pResponse->Length() > 0)
+                {
+                CleanupStack::PushL(pResponse);
+                TPtrC8 pReq = pResponse->Des();                
+                req->SetContentsL( pReq );          
+                CleanupStack::PopAndDestroy(pResponse);            
+                }    
+            else // if(retVal == 404)    
+                {
+                delete pResponse;
+                TPtrC8 pReq(KNullDesC8());
+                req->SetContentsL( pReq );          
+                }
+
+            }
+        CleanupStack::PopAndDestroy(&serviceDescriptions);        
+
+
+        } // for each request
+    CleanupStack::PopAndDestroy(pPolicyClient); 
+    CleanupStack::PopAndDestroy(pInitializer);  
+    return retVal;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+// 
+// start of "debug / test method"    
+TInt CWSStarPolicyManager::GetPolicyFromFileL( RExpiredPolicyArray& aRequestMap )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarPolicyManager::GetPolicyFromFileL:");
+
+    TInt retVal(KErrNone);
+    
+    TInt count(aRequestMap.Count());
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Count: %d"), count));
+
+    _LIT(KPath, "c:\\");
+    for (TInt i = 0; i< count; i++)
+        {
+        TFileName filepath(KPath);    
+
+        CExpiredPolicy* req = aRequestMap[i];
+        TPtrC8 contract = req->Contract();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Contract: '%S'"), &contract));
+
+        TPtrC8 endpoint = req->Uri();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Endpoint: '%S'"), &endpoint));
+
+        TInt namePosition = endpoint.LocateReverse('/');
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Nameposition: %d"), namePosition));
+
+
+        if(namePosition > 0)
+            {
+//            _LIT(KXmlFileExt, ".xml");
+
+            TPtrC8 name = endpoint.Right( endpoint.Length() - (namePosition+1) );
+            
+            if( name == KNullDesC8 ) 
+                {
+                // Note: if metadata endpoint ends with '/' -char, USE hardcoded DEFAULT VALUE
+                _LIT8(KDefaultPolicyFilename, "secpol.xml");
+                name.Set( KDefaultPolicyFilename );                
+                }
+            
+            HBufC* nameBuf = HBufC::NewLC(name.Length());
+            TPtr nameBufPtr( nameBuf->Des() );
+            
+            retVal = CnvUtfConverter::ConvertToUnicodeFromUtf8( nameBufPtr, name );  
+            
+            if(retVal == KErrNone)
+                {
+                TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Policy file name: '%S'"), nameBuf));
+                TFileName filename; 
+                filename.Append( nameBufPtr );
+                filepath.Append( filename );
+    
+                RFs fss;
+                User::LeaveIfError( fss.Connect() );
+                CleanupClosePushL( fss );
+                
+                RFile  xmlFile;
+                retVal = xmlFile.Open(fss , filepath, EFileRead );
+                if(retVal == KErrNone)
+                    {
+                    TInt size;
+                    xmlFile.Size(size);
+                    if(size > 0)
+                        {
+                        HBufC8 *pBuf=HBufC8::NewLC(size); // CodeScannerWarning
+                        TPtr8 buf8ptr(pBuf->Des());
+                        xmlFile.Read(buf8ptr, size);
+                        req->SetContentsL(buf8ptr);
+                        CleanupStack::PopAndDestroy(pBuf);
+                        }
+                    }
+                xmlFile.Close();                
+                CleanupStack::PopAndDestroy( &fss );
+                }
+            CleanupStack::PopAndDestroy( nameBuf );
+            }
+        }
+    return retVal;
+    }
+// end of "debug / test method"    
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//   
+CSenElement* CWSStarPolicyManager::PolicyL(MSenServiceDescription* aSD)	//codescannerwarnings
+    {
+    TInt error(KErrGeneral);
+    CSenWSDescription* sd = (CSenWSDescription*)aSD;
+    CSenElement* ele = WsPolicy1L(sd, error);    
+    
+    if(error == KErrNone)
+        return ele;
+    
+    return NULL;    
+    } 
+    
+CSenElement* CWSStarPolicyManager::PolicyL(const TDesC8& aUri)	//codescannerwarnings
+    {
+    TInt error(KErrGeneral);
+    
+    CSenElement* ele = WsPolicy1L(NULL, aUri, error);    
+    
+    if(error == KErrNone)
+        return ele;
+    
+    return NULL;    
+    } 
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+// 
+TInt CWSStarPolicyManager::UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler)
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPolicyManager::UpdatePolicyL ")));    
+    TInt retVal(KErrNone);
+    
+    TInt count(iContracts.Count());
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TPtrC8 contract = iContracts[i]->Des();
+        RPointerArray<CSenWSDescription> serviceDescriptions;
+        CleanupClosePushL(serviceDescriptions);
+
+        TInt leaveCode(KErrNone);
+        TInt getSDsError(KErrNone);
+        TRAP(leaveCode, getSDsError = iSenHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, contract));
+        if( getSDsError && retVal == KErrNone )
+            {
+            // store the return code from 1st error:
+            retVal = getSDsError;
+            }
+            
+        TInt sdCount(serviceDescriptions.Count());
+        if( sdCount > 0  && getSDsError == KErrNone && leaveCode == KErrNone )
+            {
+            for ( TInt j = 0; j < sdCount; j++ )
+                {
+                CSenWSDescription* sD = serviceDescriptions[j];
+                TInt updateError(KErrNone);
+                if(sD->Contract() == KWSStarSTSContract)
+                    {
+                    CWSStarTrustClient* pTrustClient = (CWSStarTrustClient*)sD;   
+                    updateError = pTrustClient->UpdatePolicyL( aPolicyHandler, pTrustClient );
+                    }
+                else if (sD->DescriptionClassType() == MSenServiceDescription::EWSStarServiceSession)
+                    {
+                    CWSStarServiceSession* pWsSession = (CWSStarServiceSession*)sD;
+                    updateError = pWsSession->UpdatePolicyL( aPolicyHandler, pWsSession );
+                    }
+                if( updateError && retVal == KErrNone )
+                    {
+                    // store the code from first update error:
+                    retVal = updateError;
+                    }
+                } // for each SD
+            } // if any SD to process
+            CleanupStack::PopAndDestroy(); //serviceDescriptions
+            
+        } // for each item in policy map    
+    return retVal;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+RFileLogger* CWSStarPolicyManager::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iSenHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+
+
+TInt  CWSStarPolicyManager::RegisterWsPolicyL( const TDesC8& aContract )
+    {
+    
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    CleanupClosePushL(serviceDescriptions);
+    TInt retVal(KErrNone);
+    TInt leaveCode(KErrNone);
+    TInt errorCode(KErrGeneral);    
+    TRAP(leaveCode, retVal = iSenHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, aContract));
+    if(leaveCode == KErrNone && retVal == KErrNone && serviceDescriptions.Count() > 0)
+        {
+        for(TInt j = 0; j < serviceDescriptions.Count(); j++)
+            {
+            CSenWSDescription* sD = serviceDescriptions[j];
+            CSenWSDescription* tempSd = CSenWSDescription::NewLC();
+                CBufFlat *pBuf = CBufFlat::NewL(64); 
+                CleanupStack::PushL(pBuf);
+                RBufWriteStream bufWs(*pBuf);
+                CleanupClosePushL(bufWs);
+                
+                if(sD->Contract() == KWSStarSTSContract)
+                    {
+                    CWSStarTrustClient* pTrustClient = (CWSStarTrustClient*)sD;   
+                    pTrustClient->WriteAsXMLToL(bufWs);
+                    tempSd->SetReader(*iSenHandlerContext.GetSenCoreServiceManager()->XMLReader());
+                    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(pBuf->Ptr(0)));
+                    tempSd->ParseL(pBuf->Ptr(0));
+                    }
+                else if (sD->DescriptionClassType() == MSenServiceDescription::EWSStarServiceSession)
+                    {
+                    CWSStarServiceSession* pSd = (CWSStarServiceSession*)sD;
+                    pSd->WriteAsXMLToL(bufWs);
+                    tempSd->SetReader(*iSenHandlerContext.GetSenCoreServiceManager()->XMLReader());
+                    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(pBuf->Ptr(0)));
+                    tempSd->ParseL(pBuf->Ptr(0));
+                    }
+            
+            CleanupStack::PopAndDestroy(&bufWs);
+            CleanupStack::PopAndDestroy(pBuf);
+
+            RegisterWsPolicy1L(tempSd, errorCode);
+            
+            CleanupStack::PopAndDestroy(tempSd); 
+
+            }
+        }
+    CleanupStack::PopAndDestroy(&serviceDescriptions);        
+    return KErrNone;            
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+TInt CWSStarPolicyManager::UnRegisterWsPolicyL(MSenServiceDescription& aServiceDescription,
+                                                    TInt& aErrorTo)
+    {
+    CSenWSDescription* sD = (CSenWSDescription*)&aServiceDescription;
+    return UnRegisterWsPolicy1L(sD, aErrorTo);
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+
+TInt CWSStarPolicyManager::PolicyConsumerAddedL(CSenServiceSession* aNewSession, MSenRemoteServiceConsumer& aRemoteConsumer)
+    {
+  
+    CSenElement* clientPolicy = NULL;
+    MSenServicePolicy* service = NULL;
+    TPtrC8 cosumerid = aRemoteConsumer.Id();
+
+    if(aNewSession->Contract() == KWSStarSTSContract)
+        {
+        CWSStarTrustClient* pTrustClient = (CWSStarTrustClient*)aNewSession;   
+        service = pTrustClient->ServicePolicy();
+        clientPolicy = service->ClientPolicy();        
+        }
+    else if(aNewSession->DescriptionClassType() == MSenServiceDescription::EWSStarServiceSession)
+        {
+        service = aNewSession->ServicePolicy();
+        clientPolicy = service->ClientPolicy();                
+        }
+    
+
+    if(clientPolicy)
+        {
+        RPointerArray<CSenElement> metaDataPoliciesUris;
+        CleanupClosePushL(metaDataPoliciesUris);
+        clientPolicy->ElementsL(metaDataPoliciesUris, KMetaDataLocalName);
+        TInt count(metaDataPoliciesUris.Count());
+        if(count> 0)
+            {
+            CSenElement* metaData = NULL;
+            for(TInt i=0; i<count; i++)
+                {
+                metaData = metaDataPoliciesUris[i];
+                if(metaData && metaData->HasContent())
+                    {
+                    TPtrC8 uriName = metaData->Content();
+                    AddPolicyConsumer1L(uriName,cosumerid);        
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(&metaDataPoliciesUris);             
+        }
+        
+    return KErrNone;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+
+TInt CWSStarPolicyManager::AddWsPolicy1L(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo)
+{
+    return iPolicyManager->AddWsPolicy1L(aPattern, aUri, aPolicy, aErrorTo);
+}
+
+TInt CWSStarPolicyManager::RemoveWsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo)
+{
+    return iPolicyManager->RemoveWsPolicy1L(aPattern, aUri, aErrorTo);
+}
+                                                                                                                                                                                               
+TInt CWSStarPolicyManager::RegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+{
+    return iPolicyManager->RegisterWsPolicyL(aPattern, aErrorTo);    
+}
+
+TInt CWSStarPolicyManager::UnRegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+{
+    return iPolicyManager->UnRegisterWsPolicy1L(aPattern, aErrorTo);
+}
+                                                    
+CSenElement*  CWSStarPolicyManager::WsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo)
+{
+    return iPolicyManager->WsPolicy1L(aPattern, aUri, aErrorTo);
+}
+
+CSenElement*  CWSStarPolicyManager::WsPolicy1L( CSenWSDescription* aPattern, 
+                                                TInt& aErrorTo)
+{
+    return iPolicyManager->WsPolicy1L(aPattern, aErrorTo);
+}
+CSenElement*  CWSStarPolicyManager::WsPolicy1L( const TDesC8& aProviderId, TInt& aErrorTo)
+{
+    return iPolicyManager->WsPolicy1L(aProviderId, aErrorTo);
+}
+TInt CWSStarPolicyManager::AddPolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    return iPolicyManager->AddPolicyConsumer1L(aUri,aConsumerId);    
+}
+
+TInt CWSStarPolicyManager::RemovePolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    return iPolicyManager->RemovePolicyConsumer1L(aUri,aConsumerId);    
+}
+void CWSStarPolicyManager::DataTrafficDetails(TSenDataTrafficDetails& aDetails) 		
+{
+	aDetails = iPolicyDetails;
+}
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarpolicyrequest.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,630 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+#include "wsstarpolicyrequest.h"
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//     
+CPolicyRequest* CPolicyRequest::NewL(const TDesC8& aContract)
+{
+    CPolicyRequest* self   = CPolicyRequest::NewLC(aContract);
+    CleanupStack::Pop();
+    return self;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//                                
+CPolicyRequest* CPolicyRequest::NewLC(const TDesC8& aContract)
+{
+    CPolicyRequest* self   = new (ELeave) CPolicyRequest();
+    CleanupStack::PushL (self);
+    self->ConstructL(aContract);
+    return self;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+CPolicyRequest::~CPolicyRequest()
+{
+    delete iContract; //service contract representing the policy
+    iPolicies.ResetAndDestroy();
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyRequest::CPolicyRequest() :
+iSD(NULL),iContract(NULL)
+{
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+void CPolicyRequest::ConstructL(const TDesC8& aContract)
+{
+    if(aContract.Length() < 1)
+        User::Leave (KErrArgument);
+    
+    iContract = aContract.AllocL();
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//    
+TPtrC8  CPolicyRequest::Contract()
+{
+    if (iContract != NULL)
+        return iContract->Des();
+    else
+        return KNullDesC8();
+
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CSenWSDescription* CPolicyRequest::ServiceDescription()
+{
+    return iSD;    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::SetSD(CSenWSDescription* aSD)
+{
+    if(aSD != NULL && aSD->Contract().Compare(iContract->Des()) == 0)
+    {
+        iSD = aSD; //not owned              
+    }
+    else
+    {
+        iSD = NULL;
+    }
+         
+    return KErrNone;         
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+void CPolicyRequest::URIs(RArray<TPtrC8>& aURI)
+{
+    for(TInt i = 0; i <iPolicies.Count(); i++ )
+    {
+        CPolicyReq* req = iPolicies[i];
+        if(req)
+        {
+            TPtrC8 uri = req->URI();    
+            aURI.Append(uri);
+        }
+    }
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::LookForUri( const TDesC8& aUri )
+    {
+    for (TInt i = 0; i< iPolicies.Count(); i++)
+        {
+        CPolicyReq* req = iPolicies[i];
+        if (req->URI().Compare(aUri) == 0)
+            {
+            return i;   
+            }
+        }
+    return KErrNotFound;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::AddMetadataUriL( const TDesC8& aUri )
+{
+    if(aUri.Length() < 1)    
+        return KErrArgument;
+    
+    TInt indx = LookForUri(aUri);
+    if(indx == KErrNotFound)
+    {
+        CPolicyReq* req = CPolicyReq::NewL(aUri);
+        if(req)
+            return iPolicies.Append(req);
+    }
+    else
+    {
+        return indx;
+    }
+    
+    return KErrNotFound;        
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::AddMetadataUriL( const TDesC8& aUri, const TDesC8& aName)
+{
+
+    if(aUri.Length() < 1 || aName.Length() < 1)    
+        return KErrArgument;
+    
+    TInt indx = LookForUri(aUri);
+    if(indx == KErrNotFound)
+    {
+        CPolicyReq* req = CPolicyReq::NewL(aUri);
+        if(req)
+        {
+            req->SetNameL(aName);    
+            return iPolicies.Append(req);
+        }
+    }
+    else
+    {
+        CPolicyReq* req = iPolicies[indx];
+        req->SetNameL(aName);
+        return indx;
+    }
+    
+    return KErrNotFound;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::AddMetadataUriL(const TDesC8& aUri, const TDesC8& aName, const TDesC8& aContents )
+{
+
+    if(aUri.Length() < 1 || aName.Length() < 1 || aContents.Length() < 1)    
+        return KErrArgument;
+    
+    TInt indx = LookForUri(aUri);
+    if(indx == KErrNotFound)
+    {
+        CPolicyReq* req = CPolicyReq::NewL(aUri);
+        if(req)
+        {
+            req->SetNameL(aName);
+            req->SetContentsL(aContents);
+            return iPolicies.Append(req);
+        }
+    }
+    else
+    {
+        CPolicyReq* req = iPolicies[indx];
+        req->SetNameL(aName);
+        req->SetContentsL(aContents);
+        return indx;
+
+    }
+    return KErrNotFound;        
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::SetContentsL( const TDesC8& aUri, const TDesC8& aContent )
+    {
+    if(aUri.Length() < 1 || aContent.Length() < 1)    
+        {
+        return KErrArgument;
+        }
+    TInt indx = LookForUri(aUri);
+    if(indx != KErrNotFound)
+        {
+        CPolicyReq* req = iPolicies[indx];
+        req->SetContentsL(aContent);
+        return indx;
+        }
+    return KErrNotFound;    
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyRequest::SetPolicyL( const TDesC8& aUri, CWSPolicy* aPolicy )
+    {
+    if(aUri.Length() < 1 || aPolicy == NULL)    
+        {
+        return KErrArgument;
+        }
+    TInt indx = LookForUri(aUri);
+    if(indx != KErrNotFound)
+        {
+        CPolicyReq* req = iPolicies[indx];
+        req->SetPolicy(aPolicy);
+        return indx;
+        }
+    return KErrNotFound;    
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CSenElement* CPolicyRequest::PolicyL()	//codescannerwarnings
+    {
+    if(iPolicies.Count() > 0)
+        {
+        CPolicyReq* req = iPolicies[0];
+         // return NULL if there was no way to fetch policy from network
+        CWSPolicy* pol = req->Policy();
+        if(pol)
+            {
+                return pol->PolicyL();	//codescannerwarning
+            }
+            else
+            {
+                return NULL;
+            }
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CSenElement* CPolicyRequest::PolicyL( const TDesC8& aUri )	//codescannerwarnings
+    {
+    if( aUri.Length() < 1 )    
+        {
+        return NULL;
+        }
+    TInt indx = LookForUri(aUri);
+    if(indx != KErrNotFound)
+        {
+        CPolicyReq* req = iPolicies[indx];
+        CWSPolicy* pol = req->Policy();
+        if(pol)
+            {
+            return pol->PolicyL();	//codescannerwarning
+            }
+        }
+    return NULL;
+    }
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CSenElement* CPolicyRequest::OriginalPolicyL( const TDesC8& aUri )	//codescannerwarnings
+    {
+    if( aUri.Length() < 1 )    
+        {
+        return NULL;
+        }
+    TInt indx = LookForUri( aUri );
+    if(indx != KErrNotFound)
+        {
+        CPolicyReq* req = iPolicies[indx];
+        CWSPolicy* pol = req->Policy();
+        if( pol )
+            {
+            return pol->NonNormalizedPolicyL();		//codescannerwarning
+            }
+        }
+    return NULL;    
+    }
+
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//  
+CPolicyReq* CPolicyReq::NewL(const TDesC8& aUri)
+{
+    CPolicyReq* self   = CPolicyReq::NewLC(aUri);
+    CleanupStack::Pop();
+    return self;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReq* CPolicyReq::NewLC(const TDesC8& aUri)
+{
+    CPolicyReq* self   = new (ELeave) CPolicyReq();
+    CleanupStack::PushL (self);
+    self->ConstructL(aUri);
+    return self;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReq::~CPolicyReq()
+{
+    delete iPolicy;
+    delete iName; //policy name
+    delete iURI; //uri to download
+    delete iContents; //contents
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TPtrC8  CPolicyReq::Name()
+{
+    if (iName != NULL)
+    return iName->Des();
+    else
+    return KNullDesC8();
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TPtrC8  CPolicyReq::URI()
+{
+        if (iURI != NULL)
+        return iURI->Des();
+    else
+        return KNullDesC8();
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TPtrC8  CPolicyReq::Contents()
+{
+    if (iContents != NULL)
+        return iContents->Des();
+    else
+        return KNullDesC8();
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt    CPolicyReq::SetNameL(const TDesC8& aName)
+{
+    if(aName.Length() < 1)    
+    return KErrArgument;
+
+    if (iName != NULL)
+    {
+        delete iName;
+        iName = NULL;
+    }
+
+   iName = aName.AllocL(); 
+   return KErrNone;
+     
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt    CPolicyReq::SetContentsL(const TDesC8& aContent)
+{
+    if(aContent.Length() < 1)    
+    return KErrArgument;
+
+    if (iContents != NULL)
+    {
+        delete iContents;
+        iContents = NULL;
+    }
+
+   iContents = aContent.AllocL();     
+   return KErrNone;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReq::CPolicyReq() : 
+iPolicy(NULL), iName(NULL),iURI(NULL),iContents(NULL)
+{
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+void CPolicyReq::ConstructL(const TDesC8& aUri)
+{
+    if(aUri.Length() < 1)    
+    User::Leave (KErrArgument);
+        
+    iURI = aUri.AllocL();
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CWSPolicy* CPolicyReq::Policy()
+{
+    return iPolicy;    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyReq::SetPolicy(CWSPolicy* aPolicy)
+{
+    if(iPolicy)    
+    {
+        delete iPolicy;
+        iPolicy = NULL;
+    }
+    
+    iPolicy = aPolicy;
+    return KErrNone;
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReqMap* CPolicyReqMap::NewL(const TDesC8& aContract)
+{
+    CPolicyReqMap* self   = CPolicyReqMap::NewLC(aContract);
+    CleanupStack::Pop();
+    return self;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReqMap* CPolicyReqMap::NewLC(const TDesC8& aContract)
+{
+    CPolicyReqMap* self   = new (ELeave) CPolicyReqMap();
+    CleanupStack::PushL (self);
+    self->ConstructL(aContract);
+    return self;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReqMap::CPolicyReqMap(): iURI(NULL), iContents(NULL), iSD(NULL) 
+{
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CPolicyReqMap::~CPolicyReqMap()
+{
+    delete iContract; //service contract
+    delete iURI; //uri to download
+    delete iContents; //contents
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+void CPolicyReqMap::ConstructL(const TDesC8& aContract)
+{
+    if (aContract.Length() > 0)    
+        iContract = aContract.AllocL();
+        
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TPtrC8  CPolicyReqMap::Contract()
+{
+    if(iContract)
+        return iContract->Des();
+    else
+        return KNullDesC8();
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TPtrC8  CPolicyReqMap::Uri()
+{
+    if(iURI)
+        return iURI->Des();
+    else
+        return KNullDesC8();
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TPtrC8  CPolicyReqMap::Contents()
+{
+    if(iContents)
+        return iContents->Des();
+    else
+        return KNullDesC8();
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt    CPolicyReqMap::SetUriL(const TDesC8& aUri)
+{
+    if(aUri.Length() > 0)
+    {
+        iURI = aUri.AllocL();
+        return KErrNone;
+    }
+    return KErrArgument;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt    CPolicyReqMap::SetContentsL(const TDesC8& aContent)
+{
+
+    if(iContents)
+    {
+        delete iContents;
+        iContents = NULL;
+    }
+
+    if(aContent.Length() > 0)
+    {
+        iContents = aContent.AllocL();
+    }
+    return KErrNone;
+    
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+CSenWSDescription* CPolicyReqMap::ServiceDescription()
+{
+    return iSD;
+}
+//---------------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------------
+//
+TInt CPolicyReqMap::SetSD(CSenWSDescription* aSD)
+{
+    iSD  =   aSD; 
+    return KErrNone;
+}
+// END OF FILE
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarproxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "wsstarplugin.h"
+#include "wsstarvalidatehandler.h"
+#include "wsstarregisterhandler.h"
+#include "wsstarserviceupdatehandler.h"
+#include "wsstarpolicyhandler.h"
+
+//#ifdef RD_SEN_VTCP_SUPPORT
+//#include "WSStarVtcpHandler.h"
+//#endif
+
+#ifdef RD_SEN_VTCP_SUPPORT
+#include "wsstarcobrandinghandler.h"
+#endif//RD_SEN_VTCP_SUPPORT
+
+#ifdef RD_SEN_WS_STAR__WBXML
+#include "WBXMLPlugin.h"
+#endif
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+    const TInt32 KStarPlugin = 0x101F9718;
+    const TInt32 KWSStarValidateHandler = 0x101F9719;
+    const TInt32 KWSStarRegisterHandler = 0x101F971A;
+    const TInt32 KWSStarServiceUpdateHandler = 0x101F971B;
+    const TInt32 KWSStarPolicyHandler = 0x101F9796;
+	#ifdef RD_SEN_VTCP_SUPPORT
+    	const TInt32 KWSStarVtcpHandler = 0x101F9722;
+	    const TInt32 KWSStarCoBrandingHandler = 0x101F9798;
+	#endif//RD_SEN_VTCP_SUPPORT
+#else
+    const TInt32 KStarPlugin = 0x10282C50;
+    const TInt32 KWSStarValidateHandler = 0x10282C51;
+    const TInt32 KWSStarRegisterHandler = 0x10282C52;
+    const TInt32 KWSStarServiceUpdateHandler = 0x10282C53;
+    const TInt32 KWSStarPolicyHandler = 0x10282C54;
+	#ifdef RD_SEN_VTCP_SUPPORT
+	    const TInt32 KWSStarVtcpHandler = 0x10282C55;
+	    const TInt32 KWSStarCoBrandingHandler = 0x10282C6D;
+	#endif//RD_SEN_VTCP_SUPPORT		
+#endif
+// ---------------------------------------------------------------------------
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KStarPlugin,  CWSStarPlugin::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarValidateHandler,  CWSStarValidateHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarRegisterHandler,  CWSStarRegisterHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarServiceUpdateHandler,  CWSStarServiceUpdateHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarPolicyHandler,  CWSStarPolicyHandler::NewL),
+#ifdef RD_SEN_VTCP_SUPPORT // wsstarvtcphandler plugin is moved from wsstarplugin to vtcptransportplugin
+    //IMPLEMENTATION_PROXY_ENTRY(KWSStarVtcpHandler,  CWSStarVtcpHandler::NewL),
+    IMPLEMENTATION_PROXY_ENTRY(KWSStarCoBrandingHandler,  CWSStarCoBrandingHandler::NewL)
+#endif//RD_SEN_VTCP_SUPPORT
+#ifdef RD_SEN_WS_STAR__WBXML
+    ,IMPLEMENTATION_PROXY_ENTRY(0x00191919,  CWBXMLPlugin::NewL)
+#endif
+    };
+
+// ---------------------------------------------------------------------------
+// Function used to return an instance of the proxy table.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarregisterhandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsstarregisterhandler.h"
+#include "wsstartrustclient.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+class CWSStarHandlerContext;
+// Create instance of concrete ECOM interface implementation
+CWSStarRegisterHandler* CWSStarRegisterHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarRegisterHandler* self   = new (ELeave) CWSStarRegisterHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSStarRegisterHandler::CWSStarRegisterHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    
+    }
+
+// Destructor
+CWSStarRegisterHandler::~CWSStarRegisterHandler()
+    {
+    }
+
+// Second phase construction.
+void CWSStarRegisterHandler::ConstructL()
+    {
+    }
+    
+TInt CWSStarRegisterHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+    MSenServiceDescription& pServiceDescription = *(MSenServiceDescription*)aCtx.GetSenWSDescriptionL(WSStarContextKeys::KServiceDescription());
+    const TDesC8* action = aCtx.GetDesC8L(WSStarContextKeys::KRegisterAction());
+    TInt result(KErrNone);
+    if (*action == WSStarContextValues::KActionRegister())
+        {
+        result = RegisterServiceDescriptionL(pServiceDescription);
+        }
+    else if (*action == WSStarContextValues::KActionUnregister())
+        {
+        result = UnregisterServiceDescriptionL(pServiceDescription);
+        };
+    return result;  
+    }
+    
+SenHandler::THandlerDirection CWSStarRegisterHandler::Direction() const
+    {
+        return SenHandler::EBoth;
+    };
+SenHandler::THandlerPhase CWSStarRegisterHandler::Phase()
+    {
+        return SenHandler::EDiscovery;
+    };
+
+//---------------------------------------------------------------------------
+// Attempt to register the ServiceDescription to the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSStarRegisterHandler::RegisterServiceDescriptionL(MSenServiceDescription& aServiceDescription )
+    {
+    TInt retval(KErrNone);
+    CWSStarServiceSession* pSession = NULL;
+    TPtrC8 contract = aServiceDescription.Contract();
+    TPtrC8 endpoint = aServiceDescription.Endpoint();
+
+    if (contract == KNullDesC8) 
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarRegisterHandler::RegisterServiceDescriptionL failed - KErrSenNoContract");
+        retval = KErrSenNoContract;
+        }
+    else if(endpoint == KNullDesC8)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarRegisterHandler::RegisterServiceDescriptionL failed - KErrSenNoEndpoint");
+        retval = KErrSenNoEndpoint;
+        }
+    else
+        {
+        if(contract == KWSStarSTSContract)
+            {
+            retval = RegisterSTSClientL(&aServiceDescription);
+            }
+        else if (aServiceDescription.DescriptionClassType() ==
+                        MSenServiceDescription::EWSStarServiceSession)
+            {
+            //  description already is a session so we just add to core-DAO
+            //  example:    when connection has been made, and service is registered 
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarRegisterHandler::RegisterServiceDescriptionL - session is already so just adding")));
+                pSession = (CWSStarServiceSession*) &aServiceDescription;
+                retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pSession);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarRegisterHandler::RegisterServiceDescriptionL - Creating session from description...")));
+            pSession = CWSStarServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+            //example:  when description has been read from db during bootup
+            //          session has to be initialized (set validity time for example)
+            retval = pSession->InitializeFromL(aServiceDescription);
+            if (retval == KErrNone)
+                {
+                retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pSession);
+                CleanupStack::Pop(pSession);
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy(pSession);
+                }
+            }
+        }
+    return retval;
+    }
+    
+    
+//---------------------------------------------------------------------------
+// Attempt to unregister the ServiceDescription from the ServiceManager 
+//---------------------------------------------------------------------------
+//
+TInt CWSStarRegisterHandler::UnregisterServiceDescriptionL(
+    MSenServiceDescription& aServiceDescription)
+    {
+    TInt retval(KErrNone);
+    CWSStarServiceSession *pSession = NULL;
+    TPtrC8 contract = aServiceDescription.Contract();
+
+    if(contract == KWSStarSTSContract)
+        {
+        retval = UnRegisterSTSClientL(&aServiceDescription);
+        }
+    else
+        {
+        if(aServiceDescription.DescriptionClassType() ==
+                MSenServiceDescription::EWSStarServiceSession)
+            {
+            pSession = (CWSStarServiceSession*) &aServiceDescription;
+            retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pSession);
+            }
+        else
+            {
+
+            pSession = CWSStarServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+            retval = pSession->InitializeFromL(aServiceDescription);
+            if (retval == KErrNone)
+                {
+                retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pSession);
+                }
+            CleanupStack::PopAndDestroy(pSession);
+            }
+        }
+
+    return retval;
+    }    
+
+//---------------------------------------------------------------------------
+// Register specific description (STS contract)
+//---------------------------------------------------------------------------
+//    
+TInt CWSStarRegisterHandler::RegisterSTSClientL(
+                                MSenServiceDescription *aServiceDescription)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarRegisterHandler::RegisterSTSClientL");
+    
+    TPtrC8 endpoint = aServiceDescription->Endpoint();
+    TInt retval = KErrNone;
+    CWSStarServiceSession* pSession = NULL;
+    CWSStarTrustClient* pSTSClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                MSenServiceDescription::EWSStarSTSClient)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarRegisterHandler::RegisterSTSClient - This ServiceDescription is already an STS Client")));
+        pSTSClient = (CWSStarTrustClient*)aServiceDescription;
+        retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pSTSClient);
+        }
+    else
+        {
+        // Create new STS client and initialize
+        // it from given description
+        pSession = CWSStarServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+        retval = pSession->InitializeFromL(*aServiceDescription);
+
+        if(retval != KErrNone)
+            {
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarRegisterHandler::RegisterSTSClientL failed %d"), retval));
+            CleanupStack::PopAndDestroy(pSession);
+            return retval;
+            }
+        TPtrC8 sessionEndpoint = pSession->Endpoint();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarRegisterHandler::RegisterSTSClientL created STS using endpoint:'%S'"), &sessionEndpoint));
+
+        pSTSClient = CWSStarTrustClient::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()), *Log());	//codescannerwarnings
+        pSTSClient->SetSTSSessionL(pSession);    // pSession will be owned by STSClient
+        CleanupStack::Pop(pSTSClient);
+        CleanupStack::Pop(pSession);
+        CleanupStack::PushL(pSTSClient);
+
+        retval = iHandlerContext.GetSenCoreServiceManager()->AddServiceDescriptionL(pSTSClient);
+        if(retval != KErrNone)
+            {
+            delete pSTSClient;
+            }
+        CleanupStack::Pop(pSTSClient); 
+        pSTSClient = NULL;
+        }
+    return retval;
+    }
+
+//---------------------------------------------------------------------------
+// Unregister specific description (STS contract)
+//---------------------------------------------------------------------------
+//    
+
+TInt CWSStarRegisterHandler::UnRegisterSTSClientL(
+                                MSenServiceDescription *aServiceDescription)
+    {
+    TInt retval = KErrNone;
+
+    CWSStarServiceSession *pSession = NULL;
+    CWSStarTrustClient *pSTSClient = NULL;
+
+    if(aServiceDescription->DescriptionClassType() ==
+                MSenServiceDescription::EWSStarSTSClient)
+        {
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarRegisterHandler::RegisterSTSClient - This ServiceDescription is already an STS Client")));
+        pSTSClient = (CWSStarTrustClient*)aServiceDescription;
+        retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pSTSClient);
+        }
+    else
+        {
+        
+        pSession = CWSStarServiceSession::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()));	//codescannerwarnings
+        retval = pSession->InitializeFromL(*aServiceDescription);
+        if(retval != KErrNone)
+            {
+            CleanupStack::PopAndDestroy(pSession);
+            return retval;
+            }
+        pSTSClient = CWSStarTrustClient::NewLC(*(CSIF*)iHandlerContext.GetAnyL(HandlerContextKey::KSIF()), *Log());	//codescannerwarnings
+        pSTSClient->SetSTSSessionL(pSession);    // pSession will be owned by STSClient
+        CleanupStack::Pop(pSTSClient);
+        CleanupStack::Pop(pSession);
+        CleanupStack::PushL(pSTSClient);
+
+        retval = iHandlerContext.GetSenCoreServiceManager()->RemoveServiceDescriptionL(*pSTSClient);
+        CleanupStack::PopAndDestroy(pSTSClient);
+        }
+
+    return retval;
+    }    
+    
+//---------------------------------------------------------------------------
+// Logger using during DEBUG mode
+//---------------------------------------------------------------------------
+//    
+RFileLogger* CWSStarRegisterHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+
+TInt CWSStarRegisterHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarrstresponse.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,657 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include <SenXmlUtils.h>
+
+#include "wsstarrstresponse.h"
+#include "SenDateUtils.h"
+#include "senlogger.h"
+
+using namespace WSStarTrustFault;
+
+// Local CONSTANTS
+const TInt KStateParsingRSTResponse  = 502; // ignore state   (even number)
+const TInt KStateParsingPOP = 503;
+const TInt KStateParsingLifeTime = 505;
+const TInt KStateParsingEntropy = 507;
+const TInt KStateParsingAppliesTo = 509;
+const TInt KStateParsingAttachedReference = 510;//even becouse of parsing delegation
+const TInt KStateParsingKeySize = 511;
+const TInt KStateParsingSearchHeader = 512;
+const TInt KStateParsingHeader = 514;
+const TInt KStateParsingTokenType = 515;
+
+
+CWSStarRSTResponse* CWSStarRSTResponse::NewL(TBool aParseIssuedTokens, const TDesC8& aAppliedTo, const TDesC8* aVersion)
+    {
+    CWSStarRSTResponse* pNew = NewLC(aParseIssuedTokens, aAppliedTo, aVersion);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+CWSStarRSTResponse* CWSStarRSTResponse::NewLC(TBool aParseIssuedTokens, const TDesC8& aAppliedTo, const TDesC8* aVersion)
+    {
+    CWSStarRSTResponse* pNew =
+            new (ELeave) CWSStarRSTResponse(aParseIssuedTokens, aAppliedTo);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aVersion);
+    return pNew;
+    }
+
+CWSStarRSTResponse::CWSStarRSTResponse(TBool aParseIssuedTokens, const TDesC8& aAppliedTo)
+    {
+    iContextToken = EFalse;
+    iIsResponse = EFalse;
+    iCollection = EFalse;
+    iTokenEstablished = EFalse;
+    iDefTokenEstablished = EFalse;
+    iParseIssuedTokens = aParseIssuedTokens;
+    iAppliedTo.Set(aAppliedTo);
+    if (iParseIssuedTokens)
+        {
+        iState = KStateParsingSearchHeader;
+        }
+    }
+
+void CWSStarRSTResponse::ConstructL(const TDesC8* aVersion)
+    {
+    iActiveXmlns = aVersion;
+    //unlimited value
+    iNotOnOrAfter = Time::MaxTTime();
+    CSenBaseFragment::BaseConstructL(
+        *aVersion,
+        WSTrust::KRSTResponseTag
+        );
+
+    }
+
+CWSStarRSTResponse::~CWSStarRSTResponse()
+    {
+    delete iCredential;
+    delete iSTRFr;
+    delete iSTR;
+    delete iPOPencodedAsBase64;
+    delete iTokenType;
+    delete iTypeOfBinary;
+    delete iEntropySTS;
+    delete iComputedKey;
+    delete iCredentialExpires;
+    delete iCredentialCreated;
+    delete iKeySize;
+    delete iCredentialDef;
+    delete iSTRDef;
+    delete iPOPencodedAsBase64Def;
+    delete iTokenTypeDef;
+    delete iTypeOfBinaryDef;
+    delete iEntropySTSDef;
+    delete iComputedKeyDef;
+    delete iCredentialExpiresDef;
+    delete iCredentialCreatedDef;    
+    delete iKeySizeDef;
+    }
+
+void CWSStarRSTResponse::StartElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes )
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {    
+            if ((aNsUri == *iActiveXmlns)&& (!iTokenEstablished))
+                {
+                iParsingApliedTo = EFalse;
+                if  (aLocalName == WSTrust::KRSTResponseTag)
+                    {
+                    iState = KStateParsingRSTResponse;
+                    iIsResponse = ETrue;
+                    }
+                else if(aLocalName == WSTrust::KRSTResponseCollectionTag)
+                    {
+                    iCollection = ETrue;
+                    }
+                }
+            break;
+            }
+        case KStateParsingRSTResponse:
+            {            
+            if (aNsUri == *iActiveXmlns)
+                {
+                if (aLocalName == WSTrust::KRequestedSecurityTokenTag)
+                    {
+                    iState = KStateParsingSingleCredential;
+                    iContextToken = EFalse;
+                    }
+                else if((aLocalName == WSTrust::KLifetimeTag)
+                        ||
+                        (aLocalName == WSTrust::KLifeTimeTag))
+                    {
+                    iState = KStateParsingLifeTime;
+                    }
+                else if(aLocalName == WSTrust::KProofTokenTag)
+                    {
+                    iState = KStateParsingPOP;
+                    }            
+                else if(aLocalName == WSTrust::KTokenTypeTag)
+                    {
+                    iState = KStateParsingTokenType;
+                    }            
+                else if(aLocalName == WSTrust::KEntropyTag)
+                    {
+                    iState = KStateParsingEntropy;
+                    }            
+                else if(aLocalName == WSTrust::KKeySize)
+                    {
+                    ResetContentL();
+                    iState = KStateParsingKeySize;
+                    }            
+                else if(((aLocalName ==
+                          WSTrust::KRequestedAttachedReferenceTag) &&
+                         (aNsUri == WSTrust::KTrustNamespace200502)) ||
+                        ((aLocalName ==
+                          WSTrust::KRequestedTokenReferenceTag) &&
+                         (aNsUri == WSTrust::KTrustNamespace200404)))
+                    {
+                    iState = KStateParsingAttachedReference;
+                    }
+                }
+            else if(iPolicyVersion && aNsUri == *iPolicyVersion)
+                {
+                if (aLocalName == WSPolicy::KAppliesToTag)
+                    {
+                    iState = KStateParsingAppliesTo;
+                    }
+                }
+                                
+                
+            break;
+            }
+        case KStateParsingSingleCredential:
+            {
+            if ((aNsUri == WSSecureConversation::KSecureConversationNamespace()
+                || aNsUri == WSSecureConversation::KSecureConversationNamespaceMS())
+                && (aLocalName == WSSecureConversation::KSecurityContextToken())
+               )
+                {
+                iContextToken = ETrue;
+                }
+            CSenCredential* pCredential = CSenCredential::NewL(
+               aNsUri, aLocalName, aQName, aAttributes);
+            delete iCredential;
+            iCredential = NULL;
+            iCredential = pCredential;
+            DelegateParsingL(*iCredential);
+            //in case when credential parsed after lifetime
+            //  if first credentail is parsed this assigment is reduntant, 
+            //  but it costs less than checking time
+            iCredential->DetachL();
+            iCredential->SetValidUntil(iNotOnOrAfter);
+            break;
+            }
+        case KStateParsingAttachedReference:
+            {
+            //parsing STR
+            delete iSTRFr;
+            iSTRFr = NULL;
+            iSTRFr = CSenBaseFragment::NewL(aNsUri, aLocalName, aQName,
+                    aAttributes);
+            DelegateParsingL(*iSTRFr);
+            break;
+            }
+        case KStateParsingPOP:
+            {
+            // We clean the buffer so that we can save the element content
+            // At endElement we will know what member of the resource offering
+            // to set.
+             if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KBinarySecretTag)
+                {
+                delete iTypeOfBinary;
+                iTypeOfBinary = NULL;
+                iTypeOfBinary = SenXmlUtils::AttrValue(aAttributes, WSTrust::KBinaryTypeAttr).AllocL();
+                ResetContentL();
+                }
+             else if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KComputedKeyTag)
+                {
+                ResetContentL();
+                }            
+                break;
+            }
+        case KStateParsingEntropy:
+            {
+            if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KBinarySecretTag)
+                {
+                delete iTypeOfBinary;
+                iTypeOfBinary = NULL;
+                iTypeOfBinary = SenXmlUtils::AttrValue(aAttributes, WSTrust::KBinaryTypeAttr).AllocL();
+                ResetContentL();
+                }
+            break;
+            }
+        case KStateParsingTokenType:
+            {
+            ResetContentL();
+            }            
+            break;
+        case KStateParsingLifeTime:
+            {
+            if (aNsUri == WSTrust::KWsuNamespace && 
+                ((aLocalName == WSTrust::KExpiresTag) || (aLocalName == WSTrust::KCreatedTag)))
+                {
+                ResetContentL();
+                }
+            break;
+            }
+        case KStateParsingSearchHeader:
+            {
+            if (((aNsUri == KSenSoapEnvelopeXmlns) || (aNsUri == KSenSoap12EnvelopeXmlns)) &&
+                (aLocalName == KSenSoapEnvelopeHeaderName))
+                {
+                iState = KStateParsingHeader;
+                }
+            break;
+            }
+        case KStateParsingHeader:
+            {
+            if ((aNsUri == *iActiveXmlns) &&
+                (aLocalName == WSTrust::KIssuedTokens))
+                {
+                iState = KStateIgnore;
+                }
+            else
+                {
+                iState = KStateParsingSearchHeader;
+                }
+            break;
+            }
+        case KStateParsingAppliesTo:
+            {
+            if (iAddressingNs 
+                && iAddressingEndpointTag
+                && aNsUri == *iAddressingNs
+                && aLocalName == *iAddressingEndpointTag)
+                {
+                ResetContentL();
+                }
+            break;
+            }                            
+        default:
+            break;
+        }
+    }
+
+void CWSStarRSTResponse::EndElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& /*aQName*/
+    )
+    {
+     switch (iState)
+        {
+        case KStateIgnore:
+            {
+            break;
+            }
+        case KStateParsingRSTResponse:
+            {
+            if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KRSTResponseTag)
+                {
+                iState = KStateIgnore;
+                if (iParsingApliedTo)
+                    {
+                    iTokenEstablished = ETrue;
+                    iDefTokenEstablished = EFalse;
+                    }
+                else if(!iDefTokenEstablished)
+                    {
+                    iDefTokenEstablished = ETrue;
+                    iCredentialDef = iCredential;
+                    iCredential = NULL;
+                    iKeySizeDef = iKeySize;
+                    iKeySize = NULL;
+                    iSTRDef = iSTR;
+                    iSTR = NULL;
+                    iPOPencodedAsBase64Def = iPOPencodedAsBase64;
+                    iPOPencodedAsBase64 = NULL;
+                    iTokenTypeDef = iTokenType;
+                    iTokenType = NULL;
+                    iTypeOfBinaryDef = iTypeOfBinary;
+                    iTypeOfBinary = NULL;
+                    iEntropySTSDef = iEntropySTS;
+                    iEntropySTS = NULL;
+                    iComputedKeyDef = iComputedKey;
+                    iComputedKey = NULL;
+                    iCredentialExpiresDef = iCredentialExpires;
+                    iCredentialExpires = NULL;
+                    iCredentialCreatedDef = iCredentialCreated;    
+                    iCredentialCreated = NULL;
+                    }
+                }
+            break;
+            }     
+        case KStateParsingSingleCredential:
+            {
+            if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KRequestedSecurityTokenTag)
+                {
+                iState = KStateParsingRSTResponse;
+                }
+            break;
+            }
+        case KStateParsingAttachedReference:
+            {
+            delete iSTR;
+            iSTR = NULL;
+            if (iSTRFr->LocalName() == KSecurityTokenReference)
+                {
+                iSTRFr->DetachL();
+                iSTR = iSTRFr->AsXmlL();
+                }
+            else
+                {
+                TLSLOG(KSenFaultsLogChannel, KSenFaultsLogLevel, KBadSCT());
+                }
+            delete iSTRFr;
+            iSTRFr = NULL;
+            iState = KStateParsingRSTResponse;
+            break;
+            }
+        case KStateParsingTokenType:
+                {
+                if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KTokenType)
+                    {
+                    delete iTokenType;
+                    iTokenType = NULL;
+                    iTokenType = Content().AllocL();
+                    }
+                iState = KStateParsingRSTResponse;
+                break;   
+                }
+        case KStateParsingPOP:
+            {
+            if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KBinarySecretTag)
+                {
+                iState = KStateParsingRSTResponse;
+                delete iPOPencodedAsBase64;
+                iPOPencodedAsBase64 = NULL;
+                iPOPencodedAsBase64 = Content().AllocL();
+                }
+            else if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KComputedKeyTag)
+                {
+                iState = KStateParsingRSTResponse;
+                delete iComputedKey;
+                iComputedKey = NULL;
+                iComputedKey = Content().AllocL();
+                }
+            break;
+            }
+        case KStateParsingEntropy:
+            {
+            if (aNsUri == *iActiveXmlns && aLocalName == WSTrust::KBinarySecretTag)
+                {
+                iState = KStateParsingRSTResponse;
+                delete iEntropySTS;
+                iEntropySTS = NULL;
+                iEntropySTS = Content().AllocL();
+                }
+            break;
+            }
+        case KStateParsingKeySize:
+            {
+            iState = KStateParsingRSTResponse;
+            delete iKeySize;
+            iKeySize = NULL;
+            iKeySize = new (ELeave) TInt(0);
+            TLex8 lex(Content());
+            if (lex.Val(*iKeySize) != KErrNone)
+                {
+                delete iKeySize;
+                iKeySize = NULL;
+                };
+            break;
+            }
+        case KStateParsingLifeTime:
+            {
+            if (aNsUri == WSTrust::KWsuNamespace() && aLocalName == WSTrust::KExpiresTag)
+                {
+                delete iCredentialExpires;
+                iCredentialExpires = NULL;
+                iCredentialExpires = Content().AllocL();
+                iNotOnOrAfter =  SenDateUtils::FromXmlDateTimeL(*iCredentialExpires);
+                iState = KStateParsingRSTResponse;
+                //in case if credential has been already parsed
+                if (iCredential)
+                    {
+                    iCredential->SetValidUntil(iNotOnOrAfter);
+                    }
+                }
+            else if(aNsUri == WSTrust::KWsuNamespace() && aLocalName == WSTrust::KCreatedTag)
+                {
+                delete iCredentialCreated;
+                iCredentialCreated = NULL;
+                iCredentialCreated = Content().AllocL();
+                //check if only created tag, what hapeens with states & parsing
+                }
+            break;
+            }
+        case KStateParsingAppliesTo:            
+            {
+            if(aNsUri == *iPolicyVersion && aLocalName == WSPolicy::KAppliesToTag)
+                {
+                iState = KStateParsingRSTResponse;
+                }
+            else if (iAddressingNs 
+                && iAddressingEndpointTag
+                && aNsUri == *iAddressingNs
+                && aLocalName == *iAddressingEndpointTag)
+                {
+                //if no collection, we take anyway, we will try
+                if ((iAppliedTo != Content()) && (iAppliedTo != KNullDesC8)) 
+                    {
+                    Reset();
+                    iState = KStateIgnore;
+                    }
+                else
+                    {
+                    iParsingApliedTo = ETrue;
+                    }
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+CSenCredential* CWSStarRSTResponse::Credential()
+    {
+    return iDefTokenEstablished ? iCredentialDef : iCredential;
+    }
+
+TPtrC8 CWSStarRSTResponse::POPBase64()
+    {
+    HBufC8* POPencodedAsBase64 = iDefTokenEstablished ? iPOPencodedAsBase64Def :
+            iPOPencodedAsBase64;
+    if (POPencodedAsBase64)
+        {
+        return *POPencodedAsBase64;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+TPtrC8 CWSStarRSTResponse::TokenType()
+    {
+    HBufC8* tokenType = iDefTokenEstablished ? iTokenTypeDef :
+            iTokenType;
+    if (tokenType)
+        {
+        return *tokenType;    
+        }
+    else 
+        {
+        return KNullDesC8();
+        }
+    }
+TPtrC8 CWSStarRSTResponse::BinaryType()
+    {
+    HBufC8* typeOfBinary = iDefTokenEstablished ? iTypeOfBinaryDef :
+            iTypeOfBinary;
+    if (typeOfBinary && typeOfBinary->Length())
+        {
+        return *typeOfBinary;    
+        }
+    else
+        {
+        return WSTrust::KBinaryTypeSimmetricValue(); 
+        }
+       
+    }
+TPtrC8 CWSStarRSTResponse::EntropySTS()
+    {
+    HBufC8* entropySTS = iDefTokenEstablished ? iEntropySTSDef : iEntropySTS;
+    if (entropySTS)
+        {
+        return *entropySTS;    
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+TPtrC8 CWSStarRSTResponse::ComputedKey()
+    {
+    HBufC8* computedKey = iDefTokenEstablished ? iComputedKeyDef : iComputedKey;
+    if (computedKey)
+        {
+        return *computedKey;    
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+TInt CWSStarRSTResponse::KeySize()
+    {
+    TInt* keySize = iKeySizeDef ? iKeySizeDef : iKeySize;
+    if (keySize)
+        {
+        return *keySize;    
+        }
+    else
+        {
+        return 0;
+        }
+    }
+TPtrC8 CWSStarRSTResponse::CredentialExpires()
+    {
+    HBufC8* credentialExpires = iDefTokenEstablished ? iCredentialExpiresDef :
+            iCredentialExpires;
+    if (credentialExpires)
+        {
+        return *credentialExpires;    
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+TPtrC8 CWSStarRSTResponse::CredentialCreated()
+    {
+    HBufC8* credentialCreated = iDefTokenEstablished ? iCredentialCreatedDef :
+            iCredentialCreated;
+    if (credentialCreated)
+        {
+        return *credentialCreated;    
+        }
+    else
+        {
+        return KNullDesC8(); 
+        }
+    }
+TPtrC8 CWSStarRSTResponse::STR()
+    {
+    HBufC8* str = iDefTokenEstablished ? iSTRDef : iSTR;
+    return str ? *str : KNullDesC8();
+    }
+TBool CWSStarRSTResponse::IsContextToken()
+    {
+    return iContextToken;
+    }
+
+TBool CWSStarRSTResponse::IsResponse()
+    {
+    return iIsResponse;
+    }
+
+void CWSStarRSTResponse::UpdateAddressingHoldersL(MSenSessionContext& aCtx)
+    {
+    //priority
+    //  1)version declared by facet in SD scope (we get value by KAddressingVersion)
+    //  2)version of addressing handler (we get value by KAddressinNsHolder)
+    iAddressingNs = aCtx.GetDesC8L(WSStarContextKeys::KAddressingVersion);    
+    if (!iAddressingNs)
+        {
+        iAddressingNs = aCtx.GetDesC8L(WSStarContextKeys::KAddressingNsHolder);    
+        }
+    iAddressingEndpointTag = aCtx.GetDesC8L(WSStarContextKeys::KAddressingEndpointTagHolder);
+    }
+void CWSStarRSTResponse::Reset()    
+    {
+    delete iCredential;
+    iCredential = NULL;
+    
+    delete iSTR;
+    iSTR = NULL;
+    
+    delete iPOPencodedAsBase64;
+    iPOPencodedAsBase64 = NULL;
+    
+    delete iTokenType;
+    iTokenType = NULL;
+    
+    delete iTypeOfBinary;
+    iTypeOfBinary = NULL;
+    
+    delete iEntropySTS;
+    iEntropySTS = NULL;
+    
+    delete iComputedKey;
+    iComputedKey = NULL;
+    
+    delete iCredentialExpires;
+    iCredentialExpires = NULL;
+    
+    delete iCredentialCreated;    
+    iCredentialCreated = NULL;
+    }
+void CWSStarRSTResponse::SetPolicyVersion(const TDesC8* aVersion)
+    {
+    iPolicyVersion = aVersion;
+    }    
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarservicesession.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2491 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+// INCLUDE
+#include "wsstarservicesession.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "SenSoapFault.h"
+#include "senservicemanagerdefines.h"
+#include "SenServiceConnection.h" // err code definitions
+#include "senserviceinvocationframework.h"
+#include "SenHttpTransportProperties.h"
+#include "senvtcptransportproperties.h"
+#include "SenDateUtils.h"
+#include "wsstarpolicy.h"
+#include "sendebug.h"
+#include "sencryptoutils.h"
+#include "senwspattern.h"
+#include "SenXmlUtils.h"
+#include <xmlengnodelist.h> 
+
+#include <SenIdentityProvider.h>
+#include "wsstarcredentialobserver.h"
+using namespace WSPolicy;
+
+/* Constant margin. Value is copied from framework internal class.
+ * We check if MT is expired (now < validUntil - skew time - margin)
+ * Margin is 15 minutes.
+ */
+const TInt64 KClockSlipMinutes = 15;
+
+
+CWSStarServiceSession* CWSStarServiceSession::NewL(MSIF& aFramework)
+    {
+    CWSStarServiceSession* self = CWSStarServiceSession::NewLC(aFramework);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CWSStarServiceSession* CWSStarServiceSession::NewLC(MSIF& aFramework)
+    {
+    CWSStarServiceSession* self = new (ELeave) CWSStarServiceSession(
+        MSenServiceDescription::EWSStarServiceSession, aFramework);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CWSStarServiceSession::CWSStarServiceSession(TDescriptionClassType aType,
+                                           MSIF& aSIF)
+    : CSenWebServiceSession(aType, aSIF),
+        iMessageThread(EFalse),
+        iSubmitState(WSStarSession::KSubmitStateOK)
+    {
+    }
+
+CWSStarServiceSession::~CWSStarServiceSession()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::~CWSStarServiceSession");            
+    delete iSessionContext;
+    delete iProviderID;
+    delete iTrustAnchor;
+    delete iOutContext;
+    delete iInContext;
+    delete ipReceivedMessageIdInTrans;
+    delete iTransProp;
+    
+    TInt count(iConsumerList.Count());
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarServiceSession::~CWSStarServiceSession leaved ConsumerL now=  %d"), count));
+    for(TInt i=0; i<count; i++)
+        {
+        // we can assume that every remote consumer
+        // has been wrapped inside WSStarSessionConsumer
+        // -wrapperclass. Cast and destroy:
+        CWSStarSessionConsumer* pConsumer
+            = (CWSStarSessionConsumer*) iConsumerList[i];
+
+        // this destroys the wrapper, but the remote
+        // consumer objects ownership remains in either
+        // XMLDao or ClientSession (etc)
+        delete pConsumer;
+        }
+    delete iTicketObs;
+    }
+
+void CWSStarServiceSession::ConstructL()
+    {
+    CSenWebServiceSession::ConstructL();    
+    iTicketObs = CWSStarCredentialObserver::NewL(this, iFramework.Manager().Log());
+    }
+
+TInt CWSStarServiceSession::AddConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::AddConsumerL");            
+    
+    const TInt consumerCount(iConsumerList.Count());
+    for(TInt i=0; i<consumerCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aConsumer.Id())
+            {
+            return KErrAlreadyExists; // already added, nothing to do
+            }
+        }
+
+    CWSStarSessionConsumer* pSessionConsumer =
+                                    CWSStarSessionConsumer::NewL(aConsumer, *Log());
+
+    TInt error = iConsumerList.Append(pSessionConsumer);
+    CWSStarPlugin* fmw = (CWSStarPlugin*)&iFramework;
+    fmw->PolicyConsumerAddedL(this,*pSessionConsumer);
+    return KErrNone;
+    }
+
+/**
+ * DetachCredentialsL
+ *
+ * This function  invalidates the session by deleting the credential
+ * This also call setStatusL to recompute the status
+*/
+void CWSStarServiceSession::DetachCredentialsL()
+	{
+		ClearCredentialL() ;
+		SetStatusL() ;
+	}
+TBool CWSStarServiceSession::ExistConsumerL()
+    {
+    const TInt consumerCount(iConsumerList.Count());
+    if( consumerCount == 0 )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"   - Consumer count = 0");
+        return EFalse;
+        }
+    else
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Consumer count =  %d"), consumerCount));
+        return ETrue;
+        }
+    }
+
+TInt CWSStarServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer)
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::RemoveConsumerL:");    
+    
+    const TInt consumerCount(iConsumerList.Count());
+    for(TInt i=0; i<consumerCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aConsumer.Id())
+            {
+            CWSStarSessionConsumer* pConsumer
+                            = (CWSStarSessionConsumer*) iConsumerList[i];
+            delete pConsumer;
+            iConsumerList.Remove(i);
+            CSLOG_FORMAT((aConsumer.ConnectionId() , KMinLogLevel , _L8("CWSStarServiceSession::Removed ConsumerL now=  %d"), consumerCount-1));
+            
+            if( (consumerCount-1) == 0 )
+                {
+                iTicketObs->Cancel();
+                }
+            break;
+            }
+        }
+    // If this session has no consumers, we can hold our grip to the credential
+    // (note: this does NOT mean that credential is removed, not at all(!), but
+    //  that new search for the credential has to be performed).
+    if( consumerCount == 0 )
+        {
+        CSLOG_L(aConsumer.ConnectionId() ,KNormalLogLevel ,"- Consumer count == 0");
+        
+        CSLOG_L(aConsumer.ConnectionId() ,KNormalLogLevel ,"-> Closing the handle to the credential owned by the Credential Manager.");
+        
+        SetSecurityL(KNullDesC8); // this removes the reference to credential, but
+                                  // it can be regained on next lookup
+                                  // This needs to implemet. so that userinfo (password)
+                                  // that grants the permission to use the credential
+                                  // will be checked on that (credential sharing) lookup.
+        }           
+                
+    return CSenServiceSession::RemoveConsumerL(aConsumer);
+    }
+
+TInt CWSStarServiceSession::MessageForSendingL( const TDesC8& aBody,
+                                                const TDesC8& aSenderID,
+                                                CSenSoapMessage*& aMessage)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::MessageForSendingL");    
+    TInt error(KErrNone);
+    if (AmIHostletSession())
+        {
+        return CSenWebServiceSession::MessageForSendingL(aBody, aSenderID, aMessage);
+        }
+    else
+        {
+        CleanupStack::PushL(aMessage);
+        CWSStarSessionConsumer* pConsumer = NULL;
+        //senderID is internal id of consumer
+        error = SessionConsumerL(aSenderID, pConsumer);
+        if (error)
+            {
+            CleanupStack::Pop(aMessage);
+            return error; 
+            }
+        
+        CWSStarSessionContext* ssCtx = (CWSStarSessionContext*)SessionContext();
+        
+        //----adding addressing info
+        //messageId - set by handler
+        User::LeaveIfError(iOutContext->Add(WSStarContextKeys::KTo, Contract()));
+        if(ipReceivedMessageIdInTrans)
+            {
+            User::LeaveIfError(iOutContext->Add(WSStarContextKeys::KRelatesTo,
+                    *ipReceivedMessageIdInTrans));
+            }
+        else
+            {
+            User::LeaveIfError(iOutContext->Add(WSStarContextKeys::KRelatesTo, NULL));
+            }
+        
+        iOutContext->SetOwnedEnvelope();
+        iOutContext->UpdateFromSessionContextL(*ssCtx);
+        CleanupStack::Pop(aMessage);
+        error = ((CWSStarPlugin&)iFramework).ProcessOutboundMessageL(
+                iOutContext, &aBody, aMessage);
+        
+        iSessionContext->UpdateFromMessageOutContextL(*iOutContext);
+        const TDesC8* resolvedBody = iSessionContext->GetDesC8L(WSStarContextKeys::KBody);
+       
+        if (resolvedBody && (!error))
+            {
+            error = pConsumer->MessageForSendingL(*resolvedBody , iOutContext);
+            }
+            
+        aMessage = iOutContext->GetCurrentSoapMessage();
+        iOutContext->SetOwnedEnvelope(EFalse);
+        delete iOutContext;
+        iOutContext = NULL;
+        }
+    return error;
+    }
+
+TInt CWSStarServiceSession::NewMessageL(CSenSoapMessage*& aMessage)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::NewMessageL( CSenSoapMessage*& )");                    
+    //method used during ibound processing
+    const TInt* soapVer = iSessionContext->GetIntL(WSStarContextKeys::KSoapVersion);
+    
+    if (soapVer)
+        {
+        aMessage = CSenSoapMessage::NewL((TSOAPVersion)*soapVer);    
+        }
+    else
+        {
+        aMessage = CSenSoapMessage::NewL(ESOAP12);    
+        }
+    CSenXmlReader* reader = XmlReader();
+    if (iInContext)
+        {
+        delete iInContext;
+        iInContext = NULL;
+        }
+    iInContext = CWSStarMessageContext::NewL(SenContext::EIncoming, reader);
+    CWSStarSessionContext* ssCtx = (CWSStarSessionContext*)SessionContext();
+    iInContext->UpdateFromSessionContextL(*ssCtx);
+        
+    return KErrNone;
+    }
+
+TInt CWSStarServiceSession::ParseMessageL(CSenSoapMessage& aSOAPMessage)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::ParseMessageL(CSenSoapMessage& )");
+
+//-----SCHarF ------- 7.5.3.3 Inbound messageflow    
+    
+    CSenXmlReader* reader = XmlReader();
+    CSenSoapMessage* soapMessage = &aSOAPMessage;
+    ((CWSStarPlugin&)iFramework).ProcessInboundDispatchL(this, soapMessage);
+    ((CWSStarPlugin&)iFramework).ProcessInboundMessageL(iInContext, soapMessage);
+    
+    iServerTime.UniversalTime();
+
+    //keep transaction chain
+    if (iMessageThread)
+        {
+        const TDesC8* msgId = iInContext->GetDesC8L(WSStarContextKeys::KMessageID());
+        if (msgId)
+            {
+            delete ipReceivedMessageIdInTrans;
+            ipReceivedMessageIdInTrans = NULL;
+            ipReceivedMessageIdInTrans = msgId->AllocL();
+            }
+        else
+            {
+            //transaction mode is enabled, but no messageId in response so what to do.
+            //anyway we will continue without signalizing error
+            }
+        }
+    
+    iSessionContext->UpdateFromMessageInContextL(*iInContext);
+    
+    return CSenWebServiceSession::ParseMessageL(aSOAPMessage);
+
+    }
+
+TInt CWSStarServiceSession::SendSoapMessageToConsumerL( CSenSoapMessage* apMessage,
+                                                        const TInt aTxnId,
+                                                        MSenRemoteServiceConsumer& aConsumer,
+                                                        MSenProperties* aResponseTransportProperties )
+                                            
+    {
+    //-----SCHarF ------- glue with dispather for handlers 7.5.3.2 inbound
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::SendSoapMessageToConsumerL");
+    
+
+    if ( apMessage )
+        {
+        CleanupStack::PushL( apMessage );
+        //dispatch to proper consumer
+        CWSStarSessionConsumer* pConsumer = NULL;
+        SessionConsumerL( iInContext, pConsumer );
+        if (!pConsumer) 
+            {
+            CleanupStack::PopAndDestroy( apMessage ); // de-alloc immediately! Change this, if WS-stack one day gives back faults to Service Connections
+            // No related consumer, signalize fault error 
+            aConsumer.HandleErrorL( NULL, KErrSenBrokenSoapEnvelope, aTxnId, aResponseTransportProperties );
+            }
+        else
+            {
+            // handle message destroys this
+            TBool completeServerMessages;
+            HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+            CleanupStack::Pop( apMessage ); // REQUIREMENT for next method => it MUST take ownership IMMEDIATELY
+            pConsumer->HandleSoapMessageL( apMessage, aTxnId, aResponseTransportProperties, completeServerMessages );
+            }
+        iRetryCounter = 0;     //reset counter for retryAfter faults. If proper message incomes, we can reset counter
+        iRenewCounter = 0;     //
+        iRedirectCounter =0 ;
+        delete iInContext;
+        iInContext = NULL;        
+        return KErrNone;
+        }
+    else
+        {
+        CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::SendSoapMessageToConsumerL - apMessage == NULL => invoking remote consumer's HandleErrorL with KErrSenBrokenSoapEnvelope");
+        
+        /*TInt retVal = */ aConsumer.HandleErrorL( NULL, KErrSenBrokenSoapEnvelope, aTxnId, aResponseTransportProperties );
+        return KErrSenInternal;
+        }
+    }
+
+
+
+MSenRemoteServiceConsumer* CWSStarServiceSession::RemoteConsumerL( const TDesC8& aSenderID )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::RemoteConsumerL");        
+    TInt consumersCount(iConsumerList.Count());
+
+    for(TInt i=0; i<consumersCount; i++)
+        {
+        if(iConsumerList[i]->Id() == aSenderID)
+            {
+            return iConsumerList[i];
+            }
+        }
+    return NULL; // not found
+    }
+
+//---------------------------------------------------------------------------
+// To obtain consumer during processing INBOUND.
+//---------------------------------------------------------------------------
+//   
+
+TInt CWSStarServiceSession::SessionConsumerL( CWSStarMessageContext*& aMsgCtx,
+                                              CWSStarSessionConsumer*& aSessionConsumer )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::SessionConsumerL");                
+    TInt consumersCount(iConsumerList.Count());
+    TInt error(KErrNotFound);
+    const TDesC8* relatesTo = aMsgCtx->GetDesC8L(WSStarContextKeys::KRelatesTo);
+    const TDesC8* endpoint = aMsgCtx->GetDesC8L(WSStarContextKeys::KTo);
+    for(TInt i=0; i<consumersCount; i++)
+        {
+        CWSStarSessionConsumer* pConsumer = (CWSStarSessionConsumer*)iConsumerList[i];
+        if ((relatesTo) && (pConsumer->Expects(*relatesTo, endpoint)))
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::SessionConsumerL - Found consumer");
+            aSessionConsumer = pConsumer;
+            error = KErrNone;
+            break;
+            }
+        }
+    if (error && consumersCount)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarServiceSession::SessionConsumerL - consumer was not found - using the 1st one (as default)");
+        aSessionConsumer = (CWSStarSessionConsumer*)iConsumerList[0];
+        error = KErrNone;
+        }
+    return error;
+    }
+
+//---------------------------------------------------------------------------
+// To obtain consumer during processing OUTBOUND.
+//---------------------------------------------------------------------------
+//   
+        
+TInt CWSStarServiceSession::SessionConsumerL( const TDesC8& aSenderID,
+                                              CWSStarSessionConsumer*& aSessionConsumer )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::SessionConsumerL");                        
+    aSessionConsumer = (CWSStarSessionConsumer*) RemoteConsumerL(aSenderID);
+    if(aSessionConsumer)
+        {
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+// SYNC IMPLEMENTATION(!) - only available internally.
+//  It means, that all SYNC operation for 3rd developer from public API are in fact ASYNC. 
+//  @see SenServiceConnectionImpl.cpp
+//  aSOAPMessage.IsFault() should always be TRUE.
+// 
+TInt CWSStarServiceSession::HandleSoapFaultL( CSenSoapMessage* apSOAPMessage,
+                                              HBufC8*& aResponse )
+    { 
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::HandleErrorL(CSenSoapMessage&, HBufC8*&)");
+
+    TInt retVal(KErrNone);
+    
+    if ( apSOAPMessage )
+        {
+        CleanupStack::PushL( apSOAPMessage ); // ownerhip is here
+        TInt answer = CanHandleErrorL();
+        
+        if (answer == KErrSenResendRequired)
+            {
+            CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed atm
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CanHandleErrorL == TRUE");
+    
+            CWSStarSessionConsumer* pConsumer = NULL;
+    
+            // this takes care of messageIDs
+            retVal = SessionConsumerL(iInContext, pConsumer);
+            if(!pConsumer)
+                {
+                CleanupStack::PopAndDestroy( apSOAPMessage );
+                return KErrNotFound;
+                }
+            const TDesC8* relatesTo = iInContext->GetDesC8L(WSStarContextKeys::KRelatesTo);
+            if (!relatesTo)
+                {
+                //if response from backend doesn't include any relatesTo we can try assume
+                //      that response is for last outgoing message. This trick is used by passport phase
+                const TInt* isPassportEnabled = iInContext->GetIntL(WSStarContextKeys::KPassportEnabled);
+                if (isPassportEnabled && *isPassportEnabled == TRUE)
+                    {
+                    relatesTo = iSessionContext->GetDesC8L(WSStarContextKeys::KMessageID);    
+                    }
+                }
+            if (relatesTo)
+                {
+                TDesC8* pBody = pConsumer->BodyL(*relatesTo);
+                if (pBody)
+                    {
+                    HBufC8* pTemp = HBufC8::NewLC(pBody->Length());
+                    TPtr8 temp = pTemp->Des();
+                    temp.Append(*pBody);
+    
+                    HBufC8* startBody = HBufC8::NewLC(KSenSoapEnvelopeBodyQName().Length()+
+                                                    KSenLessThan().Length()+
+                                                    KSenGreaterThan().Length());
+                                                    
+                    TPtr8 startBodyPtr = startBody->Des();
+                    startBodyPtr.Append(KSenLessThan());                                
+                    startBodyPtr.Append(KSenSoapEnvelopeBodyQName());                                
+                    startBodyPtr.Append(KSenGreaterThan());                                
+                    HBufC8* endBody = HBufC8::NewLC(KSenSoapEnvelopeBodyQName().Length()+
+                                                    KSenLessThanSlash().Length()+
+                                                    KSenGreaterThan().Length());
+                                                    
+                    TPtr8 endBodyPtr = endBody->Des();
+                    endBodyPtr.Append(KSenLessThanSlash());                                
+                    endBodyPtr.Append(KSenSoapEnvelopeBodyQName());                                
+                    endBodyPtr.Append(KSenGreaterThan());                                
+    
+                    if( SenXmlUtils::StartsWith(*pBody, *startBody) )
+                        {
+                        temp.Delete( 0,startBody->Length() );
+                        }
+    
+                    if( SenXmlUtils::EndsWith(*pTemp, *endBody) )
+                        {
+                        temp.Delete( pTemp->Length()-endBody->Length(),endBody->Length() );
+                        }
+    
+                    CleanupStack::PopAndDestroy(endBody);                
+                    CleanupStack::PopAndDestroy(startBody);                
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Re-submitting the request");
+                    //clear Id
+                    retVal = SubmitL(*pTemp,
+                           pConsumer->TransportProperties(*relatesTo),
+                            *pConsumer, aResponse);
+                    //retVal = SubmitL(*pTemp, KNullDesC8, *pConsumer, aResponse);        
+                    CleanupStack::PopAndDestroy(pTemp);                
+                    return retVal;
+                    }    
+                }
+            }
+        // In any other case, it is mean that we can not handle error, we can not
+        // replace with new response.
+                    
+        // This is a fault which WS* cannot handle
+        
+        // or ESenReAuthAndResendNeeded which is not supported in SYNC internal mode.
+        // In other words, wst:RenewNeeded is not supported when it coems from STS. 
+        //     It is only supported when it comes from WebService, bit such scenario 
+        //     use only ASYNC HandleError
+        
+        CSenSoapFault* pDetached = apSOAPMessage->DetachFaultL();
+        CleanupStack::PopAndDestroy( apSOAPMessage ); // de-alloc msg after detach!
+        TBool completeServerMessages(EFalse);
+        HasFacetL(KCompleteMessagesFacet, completeServerMessages);
+
+        if( pDetached )
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"Detached a SOAP fault");
+            CleanupStack::PushL(pDetached);
+            // Response contains only soapfault in case no completeServerMessages facet 
+            // otherwise it should be left empty
+            // aResponse is updated only when detached soap fault is required.
+            if(completeServerMessages == EFalse) 
+            	{
+            	aResponse = pDetached->AsXmlL();	
+            	}
+            CleanupStack::PopAndDestroy(pDetached); 
+            return KErrSenSoapFault; // this is 2nd OK return code!
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- No SOAP fault was received. Returning KErrNotFound");
+            return KErrNotFound;
+            }
+        }
+    else // apSOAPMessage == NULL
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Fatal(!): CWSStarServiceSession::HandleErrorL - apSOAPMessage == NULL!. Returning KErrNotFound.");
+        return KErrNotFound;
+        }
+    }
+
+  void CWSStarServiceSession::ReattachCredentialsL()
+	{
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("  -Entering ReattachCredentialsL iStatus : %d"), iStatus));
+	
+	TInt retValue = TryToSearchValidCredentialL();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("  -ReattachCredentialsL retValue : %d"), retValue));
+    if(retValue != KErrNone)
+    {
+    iValidUntil.Set(_L("19000101:")); // way back in history: January 1st 1900
+    iStatus = ComputeStatusL();			
+    }
+	TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("  -Leaving ReattachCredentialsL iStatus : %d"), iStatus));
+	}
+// ASYNC
+TInt CWSStarServiceSession::HandleSoapFaultL( CSenSoapMessage* apSOAPMessage,
+                                              const TInt aErrorCode, // should be KErrSenSoapFault..
+                                              const TInt aTxnId,
+                                              MSenRemoteServiceConsumer& aConsumer,
+                                              MSenProperties* aResponseTransportProperties )
+
+    {
+    TInt err(KErrNone);
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::HandleErrorL(CSenSoapMessage&)");
+    
+
+    if( apSOAPMessage )
+        {
+        CleanupStack::PushL(apSOAPMessage);
+        TInt answer = CanHandleErrorL();
+        
+        if (answer)
+            {
+            aConsumer.HandleErrorL(NULL, answer, aTxnId, aResponseTransportProperties);
+            }
+        else
+            {
+            TBool hasFacet = EFalse;
+            TInt err1 = HasFacetL(KCompleteMessagesFacet, hasFacet);
+            HBufC8* pAsXml = NULL;
+            if (hasFacet && (err1 == KErrNone))
+                {
+                CSLOG_L(aConsumer.ConnectionId() ,KNormalLogLevel ,"Full a SOAP fault");
+                
+                pAsXml = apSOAPMessage->AsXmlL();
+                }
+            else
+                {
+                CSenSoapFault* pDetached = apSOAPMessage->DetachFaultL();
+                if(pDetached)
+                    {
+                    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"Detached a SOAP fault");
+                    
+                    CleanupStack::PushL(pDetached);
+                    // pass KErrSenSoapFault // which is 2nd "OK" return code!
+                    pAsXml = pDetached->AsXmlL();
+                    CleanupStack::PopAndDestroy(pDetached);
+                    }
+                }
+            if(pAsXml)
+                {
+                aConsumer.HandleErrorL(pAsXml, KErrSenSoapFault, aTxnId, aResponseTransportProperties);
+                err = KErrNone;
+                }
+            else
+                {
+                CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"No SOAP fault was received.");
+                
+                aConsumer.HandleErrorL(NULL, aErrorCode, aTxnId, aResponseTransportProperties);
+                err = KErrSenInternal; // pass on the orig error code(?)
+                }    
+            }
+        CleanupStack::PopAndDestroy(apSOAPMessage);
+        }
+    else
+        {
+        CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"Fatal(!): CWSStarServiceSession::HandleSoapFaultL - apSoapMessage arg is NULL.");
+        
+        /*TInt retVal =*/ aConsumer.HandleErrorL(NULL, aErrorCode, aTxnId, aResponseTransportProperties);
+        err = KErrSenInternal;
+        }        
+    return err;
+    }
+
+TInt CWSStarServiceSession::CanHandleErrorL()
+    {
+    TInt answer(KErrNone);
+    
+    //if failedAuthentication (SCT is now switched to MT, therefore we have to resend
+    const TInt* retryAfter = iSessionContext->GetIntL(WSStarContextKeys::KRetryAfter());
+    //othar case is simple retry after from service
+    if (!retryAfter)
+        retryAfter = iInContext->GetIntL(WSStarContextKeys::KRetryAfter());
+    const TDesC8* redirect = iInContext->GetDesC8L(WSStarContextKeys::KRedirect());
+    
+    const TBool* renewNeeded = NULL;
+    if (iSessionContext)
+        {
+        renewNeeded = iSessionContext->GetIntL(WSStarContextKeys::KReAuthNeeded());
+        }
+     //temporary code, becouse its server proces, we have to leave immediatlly
+
+    //retry in milisecunds
+    if (retryAfter && 
+        *retryAfter <= WSStarSession::KMaxTimeForRetry*1000 &&
+        *retryAfter >= KErrNone &&
+        iRetryCounter < WSStarSession::KCounterMax)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarServiceSession::CanHandleErrorL - RETRY request with delay = %d"), *retryAfter));        
+        RTimer timer;  // The synchronous timer
+        TRequestStatus timerStatus; // associated with timer
+        timer.CreateLocal();   // Always created for this thread.
+        timer.After(timerStatus,*retryAfter*1000);//in microseconds
+        User::WaitForRequest(timerStatus);
+        timer.Close();
+       
+        iRetryCounter++;
+        answer = KErrSenResendRequired;  
+        }
+    else if((renewNeeded && *renewNeeded &&
+           iRenewCounter < WSStarSession::KCounterMax)
+           )
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarServiceSession::CanHandleErrorL - RENEW request (new ticket is needed) iRenewCounter = [%d]"), iRenewCounter)) ;
+        iRenewCounter++;
+        answer = KErrSenReinitRequired;                    
+        }
+    else if (redirect &&
+           iRedirectCounter< WSStarSession::KCounterMax)
+        {
+        iRedirectCounter++;
+        this->SetEndPointL(*redirect);
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarServiceSession::CanHandleErrorL - REDIRECT request iRenewCounter = [%d]"), iRedirectCounter) );
+        answer = KErrSenResendRequired;
+        }
+    else
+        {
+        iRetryCounter = 0;
+        iRenewCounter = 0;
+        iRedirectCounter =0;
+        answer = KErrNone;
+        }
+    return answer;
+    }
+
+TBool CWSStarServiceSession::Matches(MSenServiceDescription& aPattern)
+    {
+    TBool matches = CSenWebServiceSession::Matches(aPattern);
+    if (!matches) return EFalse;
+
+    /*HBufC8* patternClusterValue = NULL;
+    TPtrC8 clusterFacetName(WSStarSession::KClusterLocalName);
+    aPattern.FacetValue(clusterFacetName, patternClusterValue);
+    CleanupStack::PushL(patternClusterValue);
+    HBufC8* thisClusterValue = NULL;
+    this->FacetValue(clusterFacetName, thisClusterValue);
+    CleanupStack::PushL(thisClusterValue);
+    if (!(thisClusterValue &&
+        patternClusterValue &&
+        *thisClusterValue == *patternClusterValue))
+        {
+        matches = EFalse;
+        }
+        
+    CleanupStack::PopAndDestroy(thisClusterValue);
+    CleanupStack::PopAndDestroy(patternClusterValue);*/
+
+    MSenElement& xmlPatternAsElement = ((CSenWSDescription&)aPattern).AsElement();
+
+//    MSenElement* pElement = xmlPatternAsElement.Element(WSStarSession::KProviderIdElementLocalName);
+    MSenElement* pElement = xmlPatternAsElement.Element( KSenIdpProviderIdLocalname );
+    //MSenElement* pElement =
+     //                   xmlPatternAsElement.Element(WSStarSession::KProviderIdElementLocalName);
+    if(pElement)
+        {
+        TPtrC8 patternProviderID = pElement->Content();
+        TPtrC8 thisProviderID = ProviderID();
+        if(patternProviderID.Length()>0)
+            {
+            if(!(thisProviderID.Length()>0 && patternProviderID == thisProviderID))
+                {
+                return EFalse;
+                }
+            }
+        }
+        
+    if (aPattern.DescriptionClassType() == MSenServiceDescription::EWSDescription)
+        {
+        TPtrC8 patternTransportCue = ((CSenWSDescription&)aPattern).TransportCue();
+        if (patternTransportCue.Length() > 0)
+            {
+            if(!iTransportCue || (patternTransportCue != *iTransportCue))
+                {
+                return EFalse;
+                }
+            }
+        }
+    // for now the only interesting facet is the messageThread facet
+    // if this session uses messageThreads it should not match any
+    // description, as it essentially makes the session unique
+    // (unless nobody is using this session).
+    if (iMessageThread && HasConsumer())
+        {
+        // a new session is needed in any case
+        matches = EFalse;
+        }
+    else
+        {
+        TBool hasFacet;
+        TRAPD(leaveCode, aPattern.HasFacetL(KMessageThread, hasFacet));
+        if (leaveCode != KErrNone) return EFalse;
+        if (hasFacet)
+            {
+            if (matches && !HasConsumer()) matches = ETrue;
+            else matches = EFalse;
+            }
+        }
+    return matches;
+    }
+
+TInt CWSStarServiceSession::ScoreMatchL(MSenServiceDescription& aPattern)
+    {
+    TInt score = CSenWebServiceSession::ScoreMatchL(aPattern);
+    
+    MSenElement& xmlPatternAsElement = ((CSenWSDescription&)aPattern).AsElement();
+//    MSenElement* pElement = xmlPatternAsElement.Element(WSStarSession::KProviderIdElementLocalName);
+    MSenElement* pElement = xmlPatternAsElement.Element(KSenIdpProviderIdLocalname);
+   // MSenElement* pElement =
+     //                   xmlPatternAsElement.Element(WSStarSession::KProviderIdElementLocalName);
+
+    if(pElement)
+        {
+        TPtrC8 patternProviderID = pElement->Content();
+        TPtrC8 thisProviderID = ProviderID();
+        if(patternProviderID.Length()>0)
+            {
+            if ( thisProviderID.Length()>0 && patternProviderID == thisProviderID )
+                {
+                score++;
+                }
+            }
+        }
+        
+    if (aPattern.DescriptionClassType() == MSenServiceDescription::EWSDescription)
+        {
+        TPtrC8 patternTransportCue = ((CSenWSDescription&)aPattern).TransportCue();
+        if (patternTransportCue.Length() > 0)
+            {
+            if ( iTransportCue && (patternTransportCue == *iTransportCue) )
+                {
+                score++;
+                }
+            }
+        }
+        
+    return score;
+    }
+
+void CWSStarServiceSession::StartTransaction()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::StartTransaction()");                                            
+    iMessageThread = ETrue;
+    }
+
+void CWSStarServiceSession::TransactionCompleted()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::TransactionCompleted()");                                    
+    delete ipReceivedMessageIdInTrans;
+    ipReceivedMessageIdInTrans = NULL;
+    iMessageThread = EFalse;    
+    }
+
+TInt CWSStarServiceSession::SetTransportPropertiesL(const TDesC8& aProperties,
+                                             MSenRemoteServiceConsumer& aConsumer)
+    {
+        if(iTransProp)
+            {
+            delete iTransProp;
+            iTransProp = NULL;
+            }
+        iTransProp = HBufC8::NewL(aProperties.Length());
+        TPtr8 ptr = iTransProp->Des();
+        ptr.Append(aProperties);
+        CWSStarSessionConsumer* pConsumer = NULL;
+        //senderID is internal id of consumer
+        TInt error = SessionConsumerL(aConsumer.Id(), pConsumer);
+        if (!error && pConsumer)
+            {
+            MSenTransport& tp = pConsumer->TransportL();
+            HBufC8* transProp = ApplyTransportPropertiesL(aProperties);
+            CleanupStack::PushL(transProp);
+            tp.SetPropertiesL(*transProp, MSenLayeredProperties::ESenTransportLayer, &aConsumer);
+            CleanupStack::PopAndDestroy(transProp);
+            }
+        return KErrNone;
+    }
+
+HBufC8* CWSStarServiceSession::ApplyTransportPropertiesL(const TDesC8& aTransportProperties)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::ApplyTransportPropertiesL():");
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(aTransportProperties));
+    HBufC8* result = NULL;
+    CSenXmlReader* reader = XmlReader();
+    TInt error(KErrNone);
+   TPtrC8 value;
+    CSenVtcpTransportProperties* vtcpTransProp = NULL;
+    if (aTransportProperties.Length() <= KSenXmlPropertiesLocalname().Length()*2 
+                                                                    + KSenLessThanSlash().Length()
+                                                                    + KSenLessThan().Length()
+                                                                    + KSenGreaterThan().Length()*2)
+        {
+        if (iTransProp && iTransProp->Length())
+            {
+            vtcpTransProp = CSenVtcpTransportProperties::NewLC(*iTransProp, *reader);
+            }
+        else
+            {
+            vtcpTransProp = CSenVtcpTransportProperties::NewLC();
+            }
+        }
+    else
+        {
+        vtcpTransProp = CSenVtcpTransportProperties::NewLC(aTransportProperties, *reader);
+        if (iTransProp) 
+            {
+            //1 merge session and message layer transport properties
+            CSenVtcpTransportProperties* conVtcpTransProp = CSenVtcpTransportProperties::NewLC(*iTransProp, *reader);
+            
+            //download folder
+            if (vtcpTransProp->DownloadFolderL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->DownloadFolderL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetDownloadFolderL(value);
+                    }
+                }
+            //device id
+            if (vtcpTransProp->DeviceIDL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->DeviceIDL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetDeviceIDL(value);
+                    }
+                }
+
+            if (vtcpTransProp->ProxyHostL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->ProxyHostL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetProxyHostL(value);
+                    }
+                }
+
+            if (vtcpTransProp->MwsNamespaceL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->MwsNamespaceL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetMwsNamespaceL(value);
+                    }
+                }
+
+            TBool boolValue;
+            if (vtcpTransProp->ConnectionBoundL(boolValue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->ConnectionBoundL(boolValue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetConnectionBoundL(boolValue);
+                    }
+                }
+            if (vtcpTransProp->OnewayMessageOnOffL(boolValue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->OnewayMessageOnOffL(boolValue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetOnewayMessageOnOffL(boolValue);
+                    }
+                }
+            if (vtcpTransProp->BoolPropertyL(KSenIAPDoNotPrompt, boolValue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->BoolPropertyL(KSenIAPDoNotPrompt, boolValue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetBoolPropertyL(KSenIAPDoNotPrompt, boolValue);
+                    }
+                }
+            TInt intvalue;
+            if (vtcpTransProp->ConnectionTimeOutL(intvalue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->ConnectionTimeOutL(intvalue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetConnectionTimeOutL(intvalue);
+                    }
+                }
+            if (vtcpTransProp->DeviceLCIDL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->DeviceLCIDL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetDeviceLCIDL(value);
+                    }
+                }
+            if (vtcpTransProp->DeviceLCIDL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->DeviceLCIDL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetDeviceLCIDL(value);
+                    }
+                }
+            if (vtcpTransProp->UserAgentL(value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->UserAgentL(value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetUserAgentL(value);
+                    }
+                }
+            TUint32 uint32value;
+            if (vtcpTransProp->IapIdL(uint32value) == KErrNotFound)
+                {
+                if (conVtcpTransProp->IapIdL(uint32value) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetIapIdL(uint32value);
+                    }
+                }
+            if (vtcpTransProp->HeartbeatL(intvalue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->HeartbeatL(intvalue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetHeartbeatL(intvalue);
+                    }
+                }
+            if (vtcpTransProp->MaxTimeToLiveL(intvalue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->MaxTimeToLiveL(intvalue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetMaxTimeToLiveL(intvalue);
+                    }
+                }
+            if (vtcpTransProp->MinTimeToLiveL(intvalue) == KErrNotFound)
+                {
+                if (conVtcpTransProp->MinTimeToLiveL(intvalue) != KErrNotFound)
+                    {
+                    vtcpTransProp->SetMinTimeToLiveL(intvalue);
+                    }
+                }
+            CleanupStack::PopAndDestroy(conVtcpTransProp);    
+            }
+        }
+    
+    
+
+
+    error = vtcpTransProp->DeviceIDL(value);
+    if (error || !value.Length())
+        {
+        value.Set(KNullDesC8());
+        error = ((CWSStarPlugin&)iFramework).DeviceId(value);   
+        if (!error)
+            {
+            vtcpTransProp->SetDeviceIDL(value);  			
+            }
+        }
+    if (iOutContext)
+        {
+        if (value.Length())//value of device Id
+            {
+            TPtrC8 endpoint = Contract();
+            TInt pos = endpoint.LocateReverse(TChar('/'));
+            if (pos!=KErrNotFound)
+                {
+                TPtrC8 serviceName = endpoint.Mid(pos);
+                HBufC8* deviceId = HBufC8::NewLC(value.Length()+serviceName.Length());
+                TPtr8 deviceIdDes = deviceId->Des();
+                deviceIdDes.Append(value);
+                deviceIdDes.Append(serviceName);
+                iOutContext->Update(WSStarContextKeys::KReplyToDeviceAddress, *deviceId);
+                CleanupStack::PopAndDestroy(deviceId);
+                }
+            else
+                {
+                iOutContext->Update(WSStarContextKeys::KReplyToDeviceAddress, value);
+                }
+            }
+        error = vtcpTransProp->ProxyHostL(value);
+        if (!error)
+            {
+            iOutContext->Update(WSStarContextKeys::KReplyTo, value);
+            }
+	#ifdef RD_SEN_VTCP_SUPPORT
+        //Proxy url CR
+        error = vtcpTransProp->PropertyL(KSenConnectionProxyUrl,value);
+        if (!error)
+            {
+            iOutContext->Update(WSStarContextKeys::KReplyTo, value);
+            }	
+	#endif//RD_SEN_VTCP_SUPPORT
+
+        error = vtcpTransProp->MwsNamespaceL(value);
+        if (!error)
+            {
+            iOutContext->Update(WSStarContextKeys::KMwsNamespace, value);
+            }
+        error = vtcpTransProp->SoapActionL(value);
+        if (!error)
+            {
+            _LIT8(KQuote, "\"");
+
+            HBufC8* pTemp = HBufC8::NewLC(value.Length());
+
+            TPtr8 temp = pTemp->Des();
+
+            temp.Append(value);
+
+            if(SenXmlUtils::StartsWith(value, KQuote))
+                {
+                temp.Delete(0,KQuote().Length());
+                }
+
+            if(SenXmlUtils::EndsWith(*pTemp, KQuote))
+                {
+                temp.Delete(pTemp->Length()-1,KQuote().Length());
+                }
+
+            iOutContext->Update(WSStarContextKeys::KAction, *pTemp);
+            CleanupStack::PopAndDestroy(pTemp);
+            }
+        //some GUI clients need messageId in GUI level :( and has control logic realted to messageId
+        error = vtcpTransProp->PropertyL( KSenClientGeneratedMessageId, value );
+        if (!error && iOutContext)
+            {
+                iOutContext->Update(WSStarContextKeys::KMessageID, value);
+            }           
+        }
+    HBufC8* updatedTP = vtcpTransProp->AsUtf8LC();
+    CSenHttpTransportProperties* httpTransProp = NULL;
+    if (!updatedTP->Length())
+        {
+        httpTransProp = CSenHttpTransportProperties::NewLC();
+        }
+    else
+        {
+        httpTransProp = CSenHttpTransportProperties::NewLC(*updatedTP, *reader);
+        }
+    const TInt* soapVer = iSessionContext->GetIntL(WSStarContextKeys::KSoapVersion);
+    error = httpTransProp->SoapActionL(value);
+    if (!error && soapVer)
+        {
+        httpTransProp->ApplyBindingL((TSOAPVersion)*soapVer);
+        }
+
+    result = httpTransProp->AsUtf8L();
+    CleanupStack::PopAndDestroy(httpTransProp);
+    CleanupStack::PopAndDestroy(updatedTP);
+    CleanupStack::PopAndDestroy(vtcpTransProp);
+    return result;
+    }
+
+TInt CWSStarServiceSession::SendL( const TDesC8& aMessage, 
+                                   const TDesC8& aTransportProperties,
+                                   MSenRemoteServiceConsumer& aConsumer,
+                                   TInt& aTxnId,
+                                   HBufC8*& aRevalidationError )
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::SendL(TDesC8&, ...)");
+    TInt retVal(KErrNone);
+    if ( AmIHostletSession() )
+        {
+        CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"- This is a session for a hostlet.");
+        
+        retVal  = CSenWebServiceSession::SendL( aMessage, aTransportProperties, aConsumer, aTxnId, aRevalidationError );
+        CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Return value from CSenWebServiceSession::SendL: %d"), retVal ));
+        
+        CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Transaction ID from transport: %d"), aTxnId ));
+        
+        }
+    else
+        {
+        CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"- This is a session for a consumer.");
+        
+        PrepareOutCtxL(aTransportProperties);
+        FindAndShareSCTL();
+        
+        VerifyPermissionL();
+        //we still have to check if validUntil is not expired.
+        retVal = RevalidateMobileTicketIfExpiredL( aRevalidationError ); // RefreshMTL
+        iSessionContext->Update(WSStarContextKeys::KOnlySharing, ETrue);
+        //retVal = RefreshMTL( aRevalidationError );
+
+#ifdef _SENDEBUG
+        if( aRevalidationError )
+            {
+            CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"- SOAP Fault / error from re-validation:");
+        
+            CSLOG_ALL(aConsumer.ConnectionId() ,KMinLogLevel ,( *aRevalidationError ));
+        
+            }
+#endif // _SENDEBUG            
+        if( retVal == KErrNone )
+            {
+            delete aRevalidationError; // should ALWAYS be null in here (as retval from RevalidateMobileTicketIfExpiredL was KErrNone!) //(as retval from RefreshMT was KErrNone!)
+            aRevalidationError = NULL;
+            HBufC8* transProp = ApplyTransportPropertiesL(aTransportProperties);
+            CleanupStack::PushL(transProp);
+            retVal  = CSenWebServiceSession::SendL( aMessage, *transProp, aConsumer, aTxnId, aRevalidationError );
+            CleanupStack::PopAndDestroy(transProp);    
+            }
+        //else { // if RevalidateMobileTicketIfExpiredL method provided such // } // return error code and aRevalidationError, if RefreshMT method provided such // }
+        }
+    return retVal;
+    }
+
+
+TInt CWSStarServiceSession::SubmitL( const TDesC8& aMessage, 
+                                     const TDesC8& aTransportProperties,
+                                     MSenRemoteServiceConsumer& aConsumer,
+                                     HBufC8*& aResponse )
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::SubmitL(TDesC8&, ...)");
+    
+    TInt retVal(KErrNone);
+    if (!AmIHostletSession())
+        {
+        PrepareOutCtxL(aTransportProperties);
+        HBufC8* transProp = ApplyTransportPropertiesL(aTransportProperties);
+        CleanupStack::PushL(transProp);
+        retVal = CSenWebServiceSession::SubmitL(aMessage, *transProp, aConsumer, aResponse);
+        CleanupStack::PopAndDestroy(transProp);
+        if (retVal == KErrNone)
+            {
+            iSubmitState = WSStarSession::KSubmitStateOK;
+            }
+
+    //becouse of lack phase (dispatch to proprr consumer). 
+    //It is SUBMIT nature, only used internally between Client and STS
+    //we have to make validation here
+        CWSStarSessionConsumer* consumer = NULL;
+        if (iInContext)
+            {
+            SessionConsumerL(iInContext, consumer);    
+            if (!(consumer && consumer->Id() == aConsumer.Id()))
+                {
+                retVal = KErrSenBrokenSoapEnvelope;
+                }
+            }
+        }
+    return retVal;
+    }
+
+TInt CWSStarServiceSession::SubmitSoapL( const TDesC8& aSoapMessage, 
+                                         const TDesC8& aTransportProperties,
+                                         MSenRemoteServiceConsumer& aConsumer,
+                                         HBufC8*& aResponse )
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::SubmitSoapL(TDesC8& ...)");
+    
+    TInt retVal(KErrNone);
+    if (!AmIHostletSession())
+        {
+        PrepareOutCtxL(aTransportProperties);
+        CSenSoapMessage* message = NULL;
+        HBufC8* body = NULL;    
+        CreateAndParseSoapMessageL(aSoapMessage, message, body);
+        CleanupStack::PushL(body);
+        // message ownership transfered to MessageForSendingL
+        HBufC8* transProp = ApplyTransportPropertiesL(aTransportProperties);
+        CleanupStack::PushL(transProp);
+            
+        retVal = MessageForSendingL(*body,aConsumer.Id(),message);
+        CleanupStack::PushL(message);    
+        HBufC8* pMsg = message->AsXmlL();
+        CleanupStack::PushL(pMsg);    
+        if (retVal == KErrNone)
+            {
+            retVal = CSenWebServiceSession::SubmitSoapL(*pMsg, *transProp, aConsumer, aResponse);
+            }
+        CleanupStack::PopAndDestroy(pMsg);
+        CleanupStack::PopAndDestroy(message);
+        CleanupStack::PopAndDestroy(transProp);
+        CleanupStack::PopAndDestroy(body);
+        if (retVal == KErrNone)
+            {
+            iSubmitState = WSStarSession::KSubmitStateOK;
+            }
+
+    //becouse of lack phase (dispatch to proprr consumer). 
+    //It is SUBMIT nature, only used internally between Client and STS
+    //we have to make validation here
+        CWSStarSessionConsumer* consumer = NULL;
+        if (iInContext)
+            {
+            SessionConsumerL(iInContext, consumer);    
+            }
+        if (!(consumer && consumer->Id() == aConsumer.Id()))
+            {
+            retVal = KErrSenBrokenSoapEnvelope;
+            }
+        }
+    return retVal;
+            
+    }
+
+TInt CWSStarServiceSession::SendSoapL( const TDesC8& aSoapMessage, 
+                                       const TDesC8& aTransportProperties,
+                                       MSenRemoteServiceConsumer& aConsumer,
+                                       TInt& aTxnId,
+                                       HBufC8*& aRevalidationError )
+    {
+    CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CWSStarServiceSession::SubmitSoapL(TDesC8& ...)");
+    
+    TInt retVal(KErrNone);
+    if ( !AmIHostletSession() ) // no support for SendSoapL in hostlet sessions
+        {
+        PrepareOutCtxL(aTransportProperties);
+        FindAndShareSCTL();
+        VerifyPermissionL();
+        // We still have to check if validUntil is not expired.
+        retVal = RevalidateMobileTicketIfExpiredL( aRevalidationError ); // RefreshMTL
+        iSessionContext->Update(WSStarContextKeys::KOnlySharing, ETrue);
+        //retVal = RefreshMTL( aRevalidationError );
+
+#ifdef _SENDEBUG
+        if( aRevalidationError )
+            {
+            CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"- SOAP Fault / error from re-validation:");
+    
+            CSLOG_ALL(aConsumer.ConnectionId() ,KMinLogLevel ,( *aRevalidationError ));
+           
+            }
+#endif // _SENDEBUG            
+
+        if (retVal == KErrNone) 
+            {
+            CSenSoapMessage* message = NULL;
+            HBufC8* body = NULL;    
+            CreateAndParseSoapMessageL(aSoapMessage, message, body);
+            CleanupStack::PushL(body);
+            // message ownership transfered to MessageForSendingL
+            HBufC8* transProp = ApplyTransportPropertiesL(aTransportProperties);
+            CleanupStack::PushL(transProp);
+            retVal = MessageForSendingL(*body,aConsumer.Id(),message);
+            CleanupStack::PushL(message);    
+            HBufC8* pMsg = message->AsXmlL();
+            CleanupStack::PushL(pMsg);
+            ParseToSoapMessage2L( *pMsg,aConsumer,aTxnId );
+
+//wslog            FILELOGALL(_L("WsLog"), _L("last_req.xml"), pMsg->Des());
+
+            if (retVal == KErrNone)
+                {
+                delete aRevalidationError; // should ALWAYS be null in here (as retval from RevalidateMobileTicketIfExpiredL was KErrNone!)// RefreshMT was KErrNone!)
+                aRevalidationError = NULL;
+                retVal = CSenWebServiceSession::SendSoapL( *pMsg, *transProp, aConsumer, aTxnId, aRevalidationError );
+                }
+            CleanupStack::PopAndDestroy(pMsg);
+            CleanupStack::PopAndDestroy(message);
+            CleanupStack::PopAndDestroy(transProp);
+            CleanupStack::PopAndDestroy(body);
+            }
+        //else { // re-validation failed, return an error and aRevalidationError descriptor }
+        }
+    return retVal;
+    }
+
+void CWSStarServiceSession::CreateAndParseSoapMessageL(const TDesC8& aSoapMessage, CSenSoapMessage*& aMessage, HBufC8*& aBody)
+    {
+    CSenXmlReader* reader = XmlReader();   
+
+    aMessage = CSenSoapMessage::NewL();
+    aMessage->SetReader(*reader);
+    aMessage->BuildFrom(aSoapMessage);
+    const TDesC8& uri = aMessage->NsUri();
+    TInt version;
+    if (uri == KSenSoapEnvelopeXmlns)
+        {
+        version = ESOAP11;
+        }
+    else
+        {
+        version  = ESOAP12;
+        }
+
+    if (iOutContext)
+        {
+        iSessionContext->Update(WSStarContextKeys::KSoapVersion,version);
+        }
+
+    CSenElement& bodyEl = aMessage->BodyL();
+    HBufC8* bodyXml = bodyEl.AsXmlL();
+    CleanupStack::PushL(bodyXml);
+    TInt length = bodyXml->Length();
+    CleanupStack::PopAndDestroy(bodyXml);
+    aBody = HBufC8::NewLC(length);
+    RPointerArray<CSenElement>& elements = bodyEl.ElementsL();
+    TPtr8 body = aBody->Des();
+    for (TInt i=0;i<elements.Count();i++)
+        {
+        CSenElement* element = elements[i];
+        HBufC8* elXml = element->AsXmlL();
+        CleanupStack::PushL(elXml);
+        body.Append(*elXml);
+        CleanupStack::PopAndDestroy(elXml);
+        }   
+    CleanupStack::Pop(aBody);
+    }
+    
+TBool CWSStarServiceSession::IsExpiredL()
+    {
+    CSenServiceSession::SetStatusL();
+    return (CSenServiceSession::StatusL() == KSenConnectionStatusExpired);
+    }
+    
+        
+void CWSStarServiceSession::SetSessionContext(CWSStarSessionContext* aContext)
+    {
+    delete iSessionContext;
+    iSessionContext = aContext;
+    }
+CWSStarSessionContext* CWSStarServiceSession::SessionContext()
+    {
+    return iSessionContext;
+    }
+    
+void CWSStarServiceSession::ClearCredentialL()
+    {
+    // Before removing the credential, checkt that
+    // iCredentialPtr.Credential() != NULL
+    if ( HasSecurity() ) // this performs the NULL check for credential
+    	{
+	    // Remove Invalid Credential from Credentials DB
+	    TInt credentialId = iCredentialPtr.Credential()->IdentifierL().IdL();	//codescannerwarnings
+	    ((MSenServiceManager&)iFramework.Manager()).RemoveCredentialL(credentialId);	//codescannerwarnings
+    	}
+
+    // Remove Credential usage from Session
+    SetSecurityL(KNullDesC8);
+    iValidUntil.Set(_L("18000101:"));
+    }
+    
+TInt CWSStarServiceSession::InitializeFromL( MSenServiceDescription& aDescription, 
+                                             CWSStarPolicyHandler* aPolicyHandler )
+    {
+    CSenWebServiceSession::SetSecurityL(KNullDesC8);
+    iValidUntil.Set(_L("19000101:"));//from SetSecurityL()moved to here, because ID-WSF doesn't need
+    aDescription.HasFacetL(KMessageThread,iMessageThread);
+    
+    TDescriptionClassType classType = aDescription.DescriptionClassType();
+    if( classType == MSenServiceDescription::EWSDescription
+                                            ||
+        classType == MSenServiceDescription::EWSPattern
+                                            ||
+        classType == MSenServiceDescription::EIdentityProvider
+        )
+        {
+        MSenElement& xmlSdAsElement = (
+            (CSenWSDescription*)&aDescription)->AsElement();
+
+
+        MSenElement* pElement = xmlSdAsElement.Element(KSenIdpProviderIdLocalname);
+        //MSenElement* pElement =
+         //               xmlSdAsElement.Element(WSStarSession::KProviderIdElementLocalName);
+        delete iProviderID;
+        iProviderID = NULL;
+        if(pElement)
+            {
+            iProviderID = pElement->Content().AllocL();
+            }
+        else
+            {
+            CSenIdentityProvider* provider = ((CWSStarPlugin&)iFramework).
+                    Manager().IdentityProviderL(aDescription);
+            if (provider)
+                {
+                iProviderID = provider->ProviderID().AllocL();
+                }
+            }
+        pElement = xmlSdAsElement.Element(WSStarSession::KTrustAnchorElementLocalName);
+        if(pElement)
+            {
+            delete iTrustAnchor;
+            iTrustAnchor = NULL;
+            iTrustAnchor = pElement->Content().AllocL();
+            }
+        
+        CSenXmlReader* reader = XmlReader();
+        if (!iSessionContext) 
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::InitializeFromL");
+            iSessionContext = CWSStarSessionContext::NewL(reader, &aDescription, aPolicyHandler);
+            
+            pElement = xmlSdAsElement.Element(WSStarSession::KSTRLocalName);
+            if(pElement)
+                {
+                CSenElement* pNestedElement = pElement->Child(0);//assumption STR always has wsse:SecurityTokenReference
+                if (pNestedElement)
+                    {
+                    HBufC8* content = pNestedElement->AsXmlL();
+                    CleanupStack::PushL(content);
+                    if (content)
+                        {
+                        User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KSTR, *content));
+                        }
+                    CleanupStack::PopAndDestroy(content);    
+                    }
+                }
+                
+            //calling higher class load such things like iClientServerInterval
+            CSenWebServiceSession::InitializeFromL(aDescription);
+    
+            if ( StatusL() != KSenConnectionStatusReady )
+                {
+                // Try to search Credential directly from CredentialManager
+                // if Connection/Credential is not ready
+                if ( TryToSearchValidCredentialL() == KErrNone )	//codescannerwarnings
+                    {
+                    SetStatusL();
+                    }
+                }
+
+            if ( !iCredentialPtr.Credential() )
+                {
+                pElement = xmlSdAsElement.Element(WSStarSession::KPOPBase64LocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KPOPBase64, pElement->Content()));    
+                    }
+                pElement = xmlSdAsElement.Element(WSStarSession::KTokenType);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KTokenType, pElement->Content()));    
+                    }
+                pElement = xmlSdAsElement.Element(WSStarSession::KBinaryTypeLocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KBinaryType, pElement->Content()));    
+                    }
+                pElement = xmlSdAsElement.Element(WSStarSession::KCreatedLocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KTimestampCreated, pElement->Content()));    
+                    }
+                pElement = xmlSdAsElement.Element(WSStarSession::KPhoneTimeWhenMTResolvedLocalName);
+                if(pElement)
+                    {
+                    User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KPhoneTimeWhenMTResolved, pElement->Content()));    
+                    }
+                }
+                
+            AddSecurityTokenToContextL();                
+            ActiveTicketObserverL();           
+            }
+        }
+    else
+        {
+        CSenWebServiceSession::InitializeFromL(aDescription);
+        }
+        
+    return KErrNone;
+    }
+    
+void CWSStarServiceSession::AddSecurityTokenToContextL()
+    {
+    if ( HasSecurity() )
+        {
+        CSenCredentialProperties& properties = iCredentialPtr.Credential()->PropertiesL();	//codescannerwarnings
+        TInt retVal;
+        TPtrC8 value;
+        if ( iSessionContext )
+            {
+            retVal = properties.PropertyL(WSStarSession::KPOPBase64LocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KPOPBase64, value));    
+                }
+            retVal = properties.PropertyL(WSStarSession::KTokenType, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KTokenType, value));    
+                }
+            retVal = properties.PropertyL(WSStarSession::KBinaryTypeLocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KBinaryType, value));    
+                }
+            retVal = properties.PropertyL(WSStarSession::KCreatedLocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KTimestampCreated, value));    
+                }
+            retVal = properties.PropertyL(WSStarSession::KPhoneTimeWhenMTResolvedLocalName, value);
+            if ( retVal == KErrNone )
+                {
+                User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KPhoneTimeWhenMTResolved, value));    
+                }
+
+	        HBufC8* pSecurity = SecurityL();
+	        if (pSecurity)
+	            {
+	            CleanupStack::PushL(pSecurity);
+	            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::InitializeFromL - adding token to ctx");
+
+	            retVal = properties.PropertyL(WSStarSession::KTokenType, value);
+	            if ( retVal != KErrNone)
+	                {
+	                value.Set(KNullDesC8);
+	                }
+	            HBufC8* binarySecurityToken =
+	                    SenCryptoUtils::CreateEncodedBinarySecretL(*pSecurity, value);
+	            CleanupStack::PopAndDestroy(pSecurity);
+	            CleanupStack::PushL(binarySecurityToken);
+	            User::LeaveIfError(iSessionContext->Add(
+	                    WSStarContextKeys::KSecurityToken,
+	                    *binarySecurityToken));  
+	            User::LeaveIfError(iSessionContext->Add(
+	                    WSStarContextKeys::KSecurityTokenBackup,
+	                    *binarySecurityToken));  
+	            CleanupStack::PopAndDestroy(binarySecurityToken);  
+	            TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+	            SenDateUtils::ToXmlDateTimeUtf82L(ts, iValidUntil);
+	            User::LeaveIfError(iSessionContext->Add(WSStarContextKeys::KTimestampExpires, ts));    
+	            }    
+	        }
+		}
+    }
+
+void CWSStarServiceSession::WriteExtensionsAsXMLToL(RWriteStream& aWriteStream)
+    {
+    CSenWebServiceSession::WriteExtensionsAsXMLToL(aWriteStream);
+
+    if(iProviderID)
+        {
+        aWriteStream.WriteL(WSStarSession::KProviderIDTag);
+        aWriteStream.WriteL(*iProviderID);
+        aWriteStream.WriteL(WSStarSession::KProviderIDEndTag);
+        }
+
+    if(iTrustAnchor)
+        {
+        aWriteStream.WriteL(WSStarSession::KTrustAnchorTag);
+        aWriteStream.WriteL(*iTrustAnchor);
+        aWriteStream.WriteL(WSStarSession::KTrustAnchorEndTag);
+        }
+    
+    if(iClientServerInterval.Int64() != 0)
+        {
+        aWriteStream.WriteL(WSStarSession::KServiceInterval);
+        TBuf8<64> buf;
+        buf.AppendNum(iClientServerInterval.Int64());
+        aWriteStream.WriteL(buf);
+        aWriteStream.WriteL(WSStarSession::KServiceIntervalEnd);
+        }
+        
+    
+    if (iSessionContext)
+        {
+        if ( iCredentialPtr.Credential() )
+            {/*
+            CSenCredentialProperties& properties = iCredentialPtr.Credential()->Properties();
+            const TDesC8* pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KPOPBase64);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KPOPBase64LocalName(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTokenType);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KTokenType(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KBinaryType);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KBinaryTypeLocalName(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KSTR);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KSTRLocalName(), *pValue);
+                }                    
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTimestampCreated);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KCreatedLocalName(), *pValue);
+                }                                
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KPhoneTimeWhenMTResolvedLocalName(), *pValue);
+                }*/            
+            }
+        else
+            {
+            const TDesC8* value = iSessionContext->GetDesC8L(WSStarContextKeys::KPOPBase64);
+            if(value)
+                {
+                aWriteStream.WriteL(WSStarSession::KPOPBase64Tag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSStarSession::KPOPBase64EndTag);
+                }        
+            value = iSessionContext->GetDesC8L(WSStarContextKeys::KTokenType);
+            if(value)
+                {
+                aWriteStream.WriteL(WSStarSession::KTokenTypeTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSStarSession::KTokenTypeEndTag);
+                }        
+            value = iSessionContext->GetDesC8L(WSStarContextKeys::KBinaryType);
+            if(value)
+                {
+                aWriteStream.WriteL(WSStarSession::KBinaryTypeTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSStarSession::KBinaryTypeEndTag);
+                }        
+            value = iSessionContext->GetDesC8L(WSStarContextKeys::KSTR);
+            if(value)
+                {
+                aWriteStream.WriteL(WSStarSession::KSTRTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSStarSession::KSTREndTag);
+                }                    
+            value = iSessionContext->GetDesC8L(WSStarContextKeys::KTimestampCreated);
+            if(value)
+                {
+                aWriteStream.WriteL(WSStarSession::KCreatedTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSStarSession::KCreatedEndTag);
+                }                                
+            value = iSessionContext->GetDesC8L(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+            if(value)
+                {
+                aWriteStream.WriteL(WSStarSession::KPhoneTimeWhenMTResolvedTag);
+                aWriteStream.WriteL(*value);
+                aWriteStream.WriteL(WSStarSession::KPhoneTimeWhenMTResolvedEndTag);
+                }            
+            }
+        }
+    }
+    
+TPtrC8 CWSStarServiceSession::ProviderID()
+    {
+    if(iProviderID)
+        return *iProviderID;
+    else
+        return KNullDesC8();
+   
+    }
+ 
+void CWSStarServiceSession::SetTrustAnchorL(const TDesC8& aURI)
+    {
+    delete iTrustAnchor;
+    iTrustAnchor = NULL;
+    iTrustAnchor = aURI.AllocL();
+    }
+TPtrC8 CWSStarServiceSession::TrustAnchor()
+    {
+    if(iTrustAnchor)
+        return *iTrustAnchor;
+    else
+        return KNullDesC8();
+    }
+
+TInt CWSStarServiceSession::ComputeStatusL()
+    {
+    
+    TInt retVal = CSenServiceSession::ComputeStatusL();
+    TTime createTime;
+    //we copy logic from CSenWebServiceSession and add :1) IProviderID condition
+    if ((retVal == KSenConnectionStatusReady) && iProviderID)
+        {
+        TTime now;
+        //we dont base of Mobile Time
+        //now.UniversalTime(); 
+        // now for us is passportTime + X (x = interval time = now - MTObtainedTime)
+        
+        // Following check is needed, so that *primary* search for credential properties 
+        // is performed from the credential (first), context search is secondary 
+        // (in practice, compute status call is always performed when we have 
+        // credential so this code is always executed). Requirement for this code:
+        // => This code is needed, when MT of this session has been expired, but a valid Module Test exists in DB
+        // In WebServiceSession layer, there is a search (find) logic, looking for valid Module Tests, after which
+        // the super class will call ComputeStatusL() [since WSS cannot know SIF spesific rules for validity].
+        if ( HasSecurity() )
+            {
+            CSenCredentialProperties& properties = iCredentialPtr.Credential()->PropertiesL();	//codescannerwarnings
+            
+            TPtrC8 createdValue;
+            TInt retVal = properties.PropertyL(WSStarSession::KCreatedLocalName, createdValue);
+            if ( retVal == KErrNone )
+                {
+                TTime clientTime;
+                TTime mtTime;
+                TPtrC8 mtTimetd;
+                retVal = properties.PropertyL(WSStarSession::KPhoneTimeWhenMTResolvedLocalName, mtTimetd);
+                if ( retVal == KErrNone )
+                    {
+                    mtTime = SenDateUtils::FromXmlDateTimeL(mtTimetd);
+                    clientTime.UniversalTime();
+                    if (clientTime != Time::NullTTime())
+                        {
+                        TTimeIntervalMicroSeconds  diff  = clientTime.MicroSecondsFrom(mtTime);
+                        createTime = SenDateUtils::FromXmlDateTimeL(createdValue);
+                        now = createTime;
+                        if (diff > 0)
+                            {
+                            now += diff;
+                            }
+                        }           
+                    }
+                }
+            else
+                {
+                now.UniversalTime();
+                }
+            }
+        else if ( iSessionContext )
+            {
+            const TDesC8*  createdValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTimestampCreated);
+                     
+            if (createdValue)
+                {
+                TTime clientTime;
+                TTime mtTime;
+                const TDesC8* mtTimetd = iSessionContext->GetDesC8L(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+                if (mtTimetd)
+                    {
+                    mtTime = SenDateUtils::FromXmlDateTimeL(*mtTimetd);
+                    clientTime.UniversalTime();
+                    if (clientTime != Time::NullTTime())
+                        {
+                        TTimeIntervalMicroSeconds  diff  = clientTime.MicroSecondsFrom(mtTime);
+                        createTime = SenDateUtils::FromXmlDateTimeL(*createdValue);
+                        now = createTime;
+                        if (diff > 0)
+                            {
+                            now += diff;
+                            }
+                        }           
+                    }
+                }
+            else
+                {
+                now.UniversalTime();
+                }
+            }
+        else
+            {
+            //for passport session, (internal session)
+            //We wil base on Device time
+            now.UniversalTime();
+            }
+        
+#ifdef _SENDEBUG
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> timeStr;
+    TRAPD(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(timeStr, now);)
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarServiceSession::computeStatus - now =: %S"), &timeStr));
+
+    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(timeStr, createTime);)
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarServiceSession::computeStatus - created =: %S"), &timeStr));
+
+    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(timeStr, iValidUntil);)
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarServiceSession::computeStatus - iValidUntil =: %S"), &timeStr));
+#endif
+        //HC !!!!!!!!!!!! very tricky things. Microsoft ticket always expires after 10hours event timestamps says sth different
+        ///   therefore we simulate 14 hours (so one day ticket 24H -14 gives 10 magic hours)
+        /*const TInt KMSUndocumentedMinutes = 60*14;  //nice for testing is 60*23+56
+        TTimeIntervalMinutes ticketWindow;
+        iValidUntil.MinutesFrom(createTime, ticketWindow);
+        if (ticketWindow > TTimeIntervalMinutes(KMSUndocumentedMinutes)) 
+            {
+            LOG_WRITE((_L("CWSStarServiceSession::computeStatus ticket window is ok")));
+            now = now + TTimeIntervalMinutes(KMSUndocumentedMinutes);
+            }
+        else
+            {
+            
+             LOG_WRITE((_L("CWSStarServiceSession::computeStatus ticket window is too short to cut sth")));
+            }
+        
+
+#ifdef _SENDEBUG
+    TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf8L(timeStr, now);)
+    if (!leaveCode)
+        {
+            LOG_WRITEFORMAT((_L8("CWSStarServiceSession::computeStatus + fake MS 10Hours- now =: %S"), &timeStr));
+        }
+#endif
+    */
+        //include also margin (3 minutes)
+        if (iValidUntil != Time::NullTTime() && 
+            now > (iValidUntil - TTimeIntervalMinutes(KClockSlipMinutes)))
+            //||
+            //(iValidUntil == Time::NullTTime() && 
+            //!HasSecurity()))
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceSession::Credential is expired.")));
+            retVal = KSenConnectionStatusExpired;
+            }
+           else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceSession::Credential is ok.")));
+            }
+        }
+    return retVal;
+    } 
+    
+void CWSStarServiceSession::PrepareOutCtxL(const TDesC8& aTransportProperties)
+    {
+    iClientTime.UniversalTime();
+    
+    CSenXmlReader* reader = XmlReader();
+    if (iOutContext)
+        {
+        delete iOutContext;
+        iOutContext = NULL;
+        }
+    iOutContext = CWSStarMessageContext::NewL(SenContext::EOutgoing, reader);
+    if (aTransportProperties != KNullDesC8)
+        {
+        iOutContext->Add(WSStarContextKeys::KWSStarTranspProp,
+                aTransportProperties);
+        }
+    }
+  
+// This method IS USED only by ASYNC methods (serving session SendL invokations 
+// from 3rd party developer via SC) but NOT  by sync methods (like internal consumers)
+TInt CWSStarServiceSession::RevalidateMobileTicketIfExpiredL( HBufC8*& aErrorMessage ) // RefreshMTL
+//TInt CWSStarServiceSession::RefreshMTL( HBufC8*& aErrorMessage )
+    {
+    TInt result(KErrNone);
+    if (IsExpiredL())
+        {
+        //we need revalidate
+        TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceSession::RevalidateMobileTicketIfExpiredL - revalidation is required.")));
+        //LOG_WRITE((_L("CWSStarServiceSession::RefreshMT - we have to refresh")));
+        result = ((CWSStarPlugin&)iFramework).ProcessOutboundValidationL( *this, this, aErrorMessage );
+        if ( result == KErrNone )
+            {
+            // validation succeeded => serialize this session (and its credentials immediately)
+            iFramework.Manager().SaveL( *this ); // this will currently *also* serialize associated credential (new/updated MT)
+            }
+        return result;
+        }
+    //LOG_WRITE((_L("CWSStarServiceSession::RefreshMT - ticket still valid")));        
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceSession::RevalidateMobileTicketIfExpiredL - ticket is still valid.")));        
+    return KErrNone;
+    }
+    
+TBool CWSStarServiceSession::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::EWebServiceSession ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenWebServiceSession::HasSuperClass( aType ); 
+        }
+    }
+
+TInt CWSStarServiceSession::ShareTokenWithL( CWSStarServiceSession* aWSStarSessionDst, 
+                                             TBool& aMTwasReplaceBySCT,
+                                             TBool aSeekSCT )
+    {
+    TInt error(KErrNone);
+    if (aSeekSCT)
+        {
+        const TInt* isR = NULL;
+        isR = iSessionContext->GetIntL(WSStarContextKeys::KMTIsReplacedBySCT);
+        if (!isR || (isR && *isR == FALSE)) return KErrNotFound;
+        }
+    if ( !HasSecurity() )//if not MT than SCT for sure doesnt exist
+        {
+        return KErrNotFound;
+        }
+    //share MT (only not expired), otherway it is sensless
+    //dont call SetStatus/IsExpired becouse it will infornm consumer/Core about chnge. 
+    //Session will not be able to revalidate by itself in next sending
+    if (ComputeStatusL() != KSenConnectionStatusExpired)
+        {
+/*#ifdef _SENDEBUG
+        _LIT8(KCredsLogLine, "Token sharing FROM (%S) TO (%S)");
+        CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelNormal, KCredsLogLine,  &Endpoint(), &(aWSStarSessionDst->Endpoint())));
+#endif  */
+        //share possible SCT are already in ctx
+        error = iSessionContext->ShareTokenWithL(
+                aWSStarSessionDst->SessionContext(), aMTwasReplaceBySCT);        
+                
+        //HBufC8* pSecurity = SecurityL();
+        //CleanupStack::PushL(pSecurity);
+        //aWSStarSessionDst->AddCredentialL(*pSecurity, iValidUntil);//this also recalculate state
+        aWSStarSessionDst->AddCredentialL(iCredentialPtr, iValidUntil);//this also recalculate state
+        //CleanupStack::PopAndDestroy(pSecurity);
+        return error;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+    
+void CWSStarServiceSession::AddCredentialL( const TDesC8& aSecurity, TTime aValidUntil )
+    {
+    iValidUntil = aValidUntil;
+    SetSecurityL(aSecurity);
+    SetStatusL();
+    }
+    
+void CWSStarServiceSession::AddCredentialL(RSenCredentialPtr aCredentialPtr, TTime aValidUntil)
+    {
+    iValidUntil = aValidUntil;
+    SetCredentialPtrL(aCredentialPtr); // Share same Credential between multiple Sessions	//codescannerwarnings
+    SetStatusL();
+    }
+    
+TBool CWSStarServiceSession::AmIHostletSession()
+    {
+    if(iTransportCue && (KSenTransportCueHostletConnection() == *iTransportCue))
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+    
+void CWSStarServiceSession::FindAndShareSCTL()
+    {
+    
+    if (!iProviderID)
+        {
+        return;
+        }
+
+    //1)  check if we have already SCT
+    const TInt* isR = iSessionContext->GetIntL(WSStarContextKeys::KMTIsReplacedBySCT);
+    if (isR && *isR == TRUE) return;//SCT already exist so we dont have to share    
+    
+    //2) real sharing
+    HBufC8* clusterUsed = CWSStarPolicy::GetPolicyValueL(WSPolicy::KIssuedToken, WSPolicy::KRPSCluster, (CWSStarPlugin&)iFramework, this);
+    TInt retVal(KErrNone);
+    //its mean - if our provider uses cluster template, 
+    //we can SCT form other msn services which use same provider ID
+    if (clusterUsed)
+        {
+        RPointerArray<CSenWSDescription> msnSDs;
+        CleanupClosePushL(msnSDs);
+        CSenWSPattern* pattern = CSenWSPattern::NewLC();
+     
+        //select * from session_of_SD where session is (ws* framework, and has same provideId)
+        //here we assume that provider use cluster template
+        
+        pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+        pattern->AsElement().AddElementL(KSenIdpProviderIdLocalname).SetContentL(*iProviderID);
+        //pattern->AsElement().AddElementL(WSStarSession::KProviderIdElementLocalName).SetContentL(*iProviderID);
+        //seeking
+        CWSStarServiceSession* msnSession = NULL;
+        TRAPD(leaveError, retVal = ((CWSStarPlugin&)iFramework).Manager().ServiceDescriptionsL(msnSDs, *pattern));
+        //      Becouse they are registered without framework Id (DAO keep sessions, but in client case only SD -> see registering STSClient, DSClient..)
+        //      SD matches only by enpoint and contract
+        if(!retVal && !leaveError)
+            {
+            TInt count = msnSDs.Count();
+            TBool pMTwasReplaceBySCT = EFalse;
+            //if MT has been shared already than it happened during validation
+            // now we just looking for SCT.
+            //usecase:
+            //      -----SC1::new
+            //      -----SC2:new  (MT sharing inside trusat client
+            //      -----SC1::send  (SCT is only inside SC1)
+            //      -----SC2::send  (now we can share SCT)
+            
+            TBool seekOnlySCT = ETrue;
+            for(TInt i = 0; i < msnSDs.Count(); i++)
+                {
+                //all sessions (so in practice we have also access to SCT, not only MT),
+                // to eliminate client, just for case we check type
+                TDescriptionClassType dt = msnSDs[i]->DescriptionClassType();
+                if (dt == MSenServiceDescription::EWSStarServiceSession)
+                    {
+                    msnSession = (CWSStarServiceSession*)msnSDs[i];
+                    TRAPD(err, retVal = msnSession->ShareTokenWithL(
+                            this, pMTwasReplaceBySCT,
+                            seekOnlySCT));
+                    if ((retVal == KErrNone) && (err == KErrNone))
+                        {
+                        if (pMTwasReplaceBySCT)
+                            {
+                            break;    
+                            }
+                        }
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(2, &msnSDs);
+        }
+    delete clusterUsed;
+    }
+
+TInt CWSStarServiceSession::UpdatePolicyL( CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::UpdatePolicyL");
+    CWSStarSessionContext* pCtx = SessionContext();
+    if( !pCtx )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarServiceSession::UpdatePolicyL: - Attempting to create new session context");
+        // In the future => session context exists BEFORE the session even has been created(!)
+        CSenXmlReader* reader = XmlReader();
+        iSessionContext = CWSStarSessionContext::NewL(reader, aSD, aPolicyHandler);        
+        pCtx = SessionContext();
+        
+        if( !pCtx )
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::UpdatePolicyL: - FATAL: unable to create new session context(!).");
+            return KErrSenInternal; // very unlikely oom case (that did not leave!) / construction of ctx oddly failed
+            }
+        }
+    return pCtx->UpdatePolicyL(aPolicyHandler, aSD); 
+    }
+    
+void CWSStarServiceSession::ParseToSoapMessage2L( const TDesC8& aSoapMessage, MSenRemoteServiceConsumer& aConsumer, TInt& aTxnId )
+    {
+    TInt ctxLookupErr(KErrNone);
+    CSenSoapMessageDom2* soapMessage2 = NULL;
+    MSenMessageContext* pCtx = aConsumer.MessageContextByTxnIdL( aTxnId, ctxLookupErr );
+    if( ctxLookupErr == KErrNone && pCtx )
+        {
+        soapMessage2 = (CSenSoapMessageDom2*)pCtx->MessageL();		//codescannerwarnigs
+        }
+
+    if (!soapMessage2)
+        {
+        return;
+        }
+    CSenSoapMessageDom2* newMessage2 = CSenSoapMessageDom2::NewLC();
+    CSenParser* parser = CSenParser::NewLC();
+    parser->EnableFeature(EReportNamespaceMapping);
+    parser->ParseL(aSoapMessage, *newMessage2); 
+    CleanupStack::PopAndDestroy(parser);
+
+    _LIT8(KCidPrefix, "cid:*");
+    RArray<TXmlEngElement> binaryElements;
+   	RXmlEngNodeList<TXmlEngAttr> attrArray;
+   	CleanupClosePushL(binaryElements);
+    TXmlEngElement rootElement = newMessage2->AsElementL();
+    TInt countEl = ListBinaryElementsL(binaryElements,rootElement);        
+    if (countEl == 0)
+        {
+        CleanupStack::PopAndDestroy(&binaryElements);
+        CleanupStack::Pop(newMessage2);
+        pCtx->SetMessage(newMessage2,ETrue);
+        return;
+        }
+    CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- Count of <xop:Include elements> in DOM tree: %d"), countEl));
+    
+
+    TXmlEngAttr attr;
+    TPtrC8 cid;
+
+    RSenDocument document = newMessage2->AsDocumentL();
+    RSenDocument doc = soapMessage2->AsDocumentL();
+    RArray<TXmlEngDataContainer> dataContainerArray;
+    CleanupClosePushL(dataContainerArray);
+    doc.GetDataContainerList(dataContainerArray);
+    TInt countDC(dataContainerArray.Count());
+
+ 	
+  	TXmlEngElement element;
+  	if ( countEl > 0 && countDC > 0 )
+	    {
+		for ( TInt i = 0; i < countEl; i++ )
+		    {
+			element = binaryElements[i];
+			element.GetAttributes(attrArray);
+			while ( attrArray.HasNext() )
+				{
+				attr = attrArray.Next();
+				TPtrC8 value = attr.Value();
+            	TInt position = value.Match(KCidPrefix);
+            	if ( position < 0 )
+            		{
+            		position = 0;
+            		}
+            	cid.Set(value.Mid( position + KCidPrefix().Size() - 1)); // minus star character (*)
+            	if ( cid.Length() > 0 )
+            	    {
+            	    break;
+            	    }
+				}
+		    attrArray.Close();
+			
+			for ( TInt j = 0; j < countDC; j++ )
+			    {
+			    TXmlEngDataContainer dataContainer = dataContainerArray[j];
+                if ( dataContainer.Cid() == cid )
+                    {
+            		if ( dataContainer.NodeType() == TXmlEngNode::EChunkContainer)
+            			{
+                	    TXmlEngChunkContainer binData =
+                	            document.CreateChunkContainerL(
+                	                        dataContainer.Cid(),
+                	                        dataContainer.AsChunkContainer().Chunk(),
+                	                        dataContainer.AsChunkContainer().ChunkOffset(),
+                	                        dataContainer.AsChunkContainer().Size() );
+                        element.ReplaceWith(binData);
+            			}
+            		else if ( dataContainer.NodeType() == TXmlEngNode::EFileContainer)
+            			{
+                	    TXmlEngFileContainer binData = 
+                	            document.CreateFileContainerL(
+                	                        dataContainer.Cid(),
+    	                                    dataContainer.AsFileContainer().File() );
+            			
+                        element.ReplaceWith(binData);
+            			}
+
+                    break;
+                    }
+			    }
+		    }
+		}        
+    CleanupStack::PopAndDestroy(2, &binaryElements);
+    CleanupStack::Pop(newMessage2);
+    pCtx->SetMessage(newMessage2,ETrue);
+    }
+    
+TInt CWSStarServiceSession::ListBinaryElementsL( RArray<TXmlEngElement>& aElementArray,
+                                                 TXmlEngElement& aElement )
+    {
+//    TLSLOG_L(KSenCoreServiceManagerLogChannelBase, KMinLogLevel,"CWSStarServiceSession::ListBinaryElementsL"); // logged *way* TOO often! => commented out
+	_LIT8(KInclude,         "Include");
+	_LIT8(KXopIncludeUri,   "http://www.w3.org/2004/08/xop/include");
+	
+	TInt count(0);
+	RXmlEngNodeList<TXmlEngElement> list;
+	CleanupClosePushL(list);
+	aElement.GetChildElements(list);
+	TInt c = list.Count();
+
+#ifdef _SENDEBUG
+    TPtrC8 root = aElement.Name();
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("- Processing element: '%S', num of child elements: %d"), &root, c));
+    TPtrC8 content = aElement.Text();
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"----  Content START ----");
+    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(content));
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"----  Content END ----");
+#endif // _SENDEBUG
+
+	
+
+    while ( list.HasNext() )
+        {
+        TXmlEngElement element = list.Next();
+        
+        TPtrC8 tag = element.Name();
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- child: '%S'"), &tag));
+        if ( tag == KInclude )
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- <xop:Include> element found.");
+            if ( element.NamespaceUri() == KXopIncludeUri )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- namespace == http://www.w3.org/2004/08/xop/include");
+                aElementArray.AppendL(element);
+                count = count + 1;
+                }
+            }
+        count = count + ListBinaryElementsL(aElementArray, element);
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    return count;
+    }
+
+void CWSStarServiceSession::FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::FillCredentialIdentifierL:");
+    CSenWebServiceSession::FillCredentialIdentifierL(aIdentifier);
+    //_LIT8(KProviderIdElementLocalName,  "ProviderID");
+    //aIdentifier.SetPropertyL(KProviderIdElementLocalName, ProviderID());
+
+    TPtrC8 providerId = ProviderID();
+    aIdentifier.SetPropertyL(KSenIdpProviderIdLocalname, providerId);
+    
+    // Add information about the account that is priviledged to consume this credential
+    
+    // (a) find matching IDP description (which represents the account / userinfo)
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- About to call LookupIdentityProviderL");
+    CSenIdentityProvider* pIdentityProvider = LookupIdentityProviderL();
+//    CSenIdentityProvider* pIdentityProvider = NULL;
+//    if ( providerId != KNullDesC8 )
+//        {
+//        LOG_WRITEFORMAT((_L8("- Searching for IdentityProvider using ProviderId : %S"), &providerId));
+//        CSenWSDescription* pIdpPattern = CSenWSDescription::NewLC();
+//        pIdpPattern->SetEndPointL(providerId);
+//        pIdentityProvider = iFramework.Manager().IdentityProviderL(*pIdpPattern);
+//        CleanupStack::PopAndDestroy(pIdpPattern);
+//        }
+
+    if ( pIdentityProvider )
+        {
+        TPtrC8 username = pIdentityProvider->UserName();
+        if( username.Length() > 0 )
+            {
+            aIdentifier.SetPropertyL(KSenIdpAuthzIDLocalname, username);
+            }
+        TPtrC8 password = pIdentityProvider->Password();
+        if( password.Length() > 0 )
+            {
+            aIdentifier.SetPropertyL(KSenIdpPasswordLocalname, password);
+            }
+        }
+    }
+    
+void CWSStarServiceSession::VerifyPermissionL()
+    {
+    if( HasSecurity() )
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::VerifyPermissionL:");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Making call to LookupIdentityProviderL");
+        CSenIdentityProvider* pProvider = LookupIdentityProviderL();
+        if ( pProvider )
+            {
+            CSenCredentialIdentifier& identifier = iCredentialPtr.Credential()->IdentifierL();
+            TPtrC8 username; // that was used to acquire this credential
+            TInt retVal = identifier.PropertyL(KSenIdpAuthzIDLocalname, username);
+            
+            TPtrC8 password; // that was used to acquire this credential
+            retVal = identifier.PropertyL(KSenIdpPasswordLocalname, password);
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("=> Credential properties: username = '%S', password = '%S'"), &username, &password));
+
+            TPtrC8 accountUsername = pProvider->UserName();
+            TPtrC8 accountPassword = pProvider->Password();
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("=> Candidate IDP details: username = '%S', password = '%S'"), &accountUsername, &accountPassword));
+            
+            if( ( username.Length() > 0 && username != accountUsername ) ||
+                ( password.Length() > 0 && password != accountPassword ) )
+                {
+                // either username or password DOES NOT MATCH (and the mismatching
+                // one is not zero-length string)
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"-> Will not grant permission to consume current credential,");
+
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"   clearing credential & it's properties from context.");
+                SetSecurityL(KNullDesC8);
+                ClearCredentialPropertiesFromContext();
+                }
+             else 
+                { 
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"--> Permission to consume current credential is granted.");
+                // => Permission to consume this credential is granted(!) 
+                }
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- There is no IDP (account), clearing credential & it's properties from context.");
+            // It is not possible to consumer WS-* service(s) without IDP (account)
+            SetSecurityL(KNullDesC8);
+            ClearCredentialPropertiesFromContext();
+            }
+        }
+    else
+        {
+        // If session has no credential (neither MT or SCT), neither should it have any 
+        // related data in context(!)
+        //--> LOG_WRITE_L("- There is no credential, clearing credential properties from context.");
+        //--> SetSecurityL(KNullDesC8);
+        ClearCredentialPropertiesFromContext();
+        }        
+    }
+    
+CSenIdentityProvider* CWSStarServiceSession::LookupIdentityProviderL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarServiceSession::LookupIdpL()");
+    TPtrC8 providerId = ProviderID();
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if ( providerId != KNullDesC8 )
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Searching for IdentityProvider using ProviderId : %S"), &providerId));
+        CSenWSDescription* pIdpPattern = CSenWSDescription::NewLC();
+        pIdpPattern->SetEndPointL(providerId);
+        pIdentityProvider = iFramework.Manager().IdentityProviderL(*pIdpPattern);
+        CleanupStack::PopAndDestroy(pIdpPattern);
+        }
+    return pIdentityProvider;
+    }
+     
+    
+void CWSStarServiceSession::AddPropertiesFromSessionContextToCredentialL()
+    {
+    if (iSessionContext)
+        {
+        if ( iCredentialPtr.Credential() )
+            {
+            CSenCredentialProperties& properties = iCredentialPtr.Credential()->PropertiesL();	//codescannerwarnings
+            const TDesC8* pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KPOPBase64);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KPOPBase64LocalName(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTokenType);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KTokenType(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KBinaryType);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KBinaryTypeLocalName(), *pValue);
+                }        
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KSTR);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KSTRLocalName(), *pValue);
+                }                    
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTimestampCreated);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KCreatedLocalName(), *pValue);
+                }                                
+            pValue = iSessionContext->GetDesC8L(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+            if ( pValue )
+                {
+                properties.SetPropertyL(WSStarSession::KPhoneTimeWhenMTResolvedLocalName(), *pValue);
+                }            
+
+            // Now, serialize this session (and all it's updated credentials) into database(s)
+            iFramework.Manager().SaveL( *this ); // this will currently *also* serialize associated credential (new/updated MT)                
+            }
+        }
+    }
+    
+TBool CWSStarServiceSession::HasEqualPrimaryKeysL( MSenServiceDescription& aCandidate )
+    {
+    TBool retVal(EFalse);
+    if ( CSenWSDescription::HasEqualPrimaryKeysL(aCandidate) )
+        {
+        // Endpoint, Contract and FrameworkID match, all of them.
+        // Now, in WS-*, also check ProviderID
+        if (aCandidate.DescriptionClassType() == DescriptionClassType())
+            {
+            CWSStarServiceSession& sessionCandidate = (CWSStarServiceSession&)aCandidate;
+            if (sessionCandidate.ProviderID() == ProviderID())
+                {
+                retVal = ETrue;
+                }
+            }
+        }
+    return retVal; 
+    }
+    
+void CWSStarServiceSession::CredentialChanged( TSenCredentialChange aChange,
+		                                       TAny* apPointer )
+    {
+    if ( aChange == MSenCredentialObserver::EDestroyed && iSessionContext )
+        {
+        ClearCredentialPropertiesFromContext();
+        }
+    CSenWebServiceSession::CredentialChanged( aChange, apPointer );
+    }
+
+
+void CWSStarServiceSession::ClearCredentialPropertiesFromContext()
+    {
+    if( iSessionContext )
+        {
+        iSessionContext->Remove(WSStarContextKeys::KPOPBase64);
+        iSessionContext->Remove(WSStarContextKeys::KTokenType);
+        iSessionContext->Remove(WSStarContextKeys::KBinaryType);
+        iSessionContext->Remove(WSStarContextKeys::KSTR);
+        iSessionContext->Remove(WSStarContextKeys::KTimestampCreated);
+        iSessionContext->Remove(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+        iSessionContext->Remove(WSStarContextKeys::KMTIsReplacedBySCT);    
+        iSessionContext->Remove(WSStarContextKeys::KSecurityToken);    
+        }
+    //CSenWebServiceSession::CredentialChanged(aChange, apPointer);
+    }
+
+void CWSStarServiceSession::ActiveTicketObserverL()
+    {
+    const TDesC8*  createdValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTimestampCreated);
+    const TDesC8*  expiresValue = iSessionContext->GetDesC8L(WSStarContextKeys::KTimestampExpires);
+    const TDesC8*  phoneTimeValue = iSessionContext->GetDesC8L(WSStarContextKeys::KPhoneTimeWhenMTResolved);
+
+    TTimeIntervalMinutes margin(KClockSlipMinutes - 1);              
+    if (createdValue && expiresValue  && phoneTimeValue)
+        {
+        TTime expTime, creTime, phTime, nowTime;
+        creTime = SenDateUtils::FromXmlDateTimeL(*createdValue);
+        expTime = SenDateUtils::FromXmlDateTimeL(*expiresValue);
+        phTime = SenDateUtils::FromXmlDateTimeL(*phoneTimeValue);
+        
+        creTime += margin;
+        TTimeIntervalMicroSeconds  diff = expTime.MicroSecondsFrom(creTime);   
+        
+#ifdef _SENDEBUG        
+        TBuf8<64> buf;                              
+        buf.Num( diff.Int64() );
+        TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase, KNormalLogLevel, _L8("CWSStarServiceSession::ActiveTicketObserverL - range %S microsec"), &buf ));
+#endif // _SENDEBUG        
+        
+        nowTime.UniversalTime();
+        if (nowTime != Time::NullTTime())
+            {
+            TTimeIntervalMicroSeconds  diff2 = nowTime.MicroSecondsFrom( phTime ); // already missed time
+#ifdef _SENDEBUG        
+            buf.Num( diff2.Int64() );
+            TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarServiceSession::ActiveTicketObserverL - already pased %S microsec"), &buf ));
+#endif // _SENDEBUG        
+            diff = TTimeIntervalMicroSeconds( diff.Int64() - diff2.Int64() ); // Counting the real difference
+            }
+        
+        if (diff > 0) 
+            {
+            iTicketObs->Start( diff );//nowTime + diff);
+#ifdef _SENDEBUG        
+            buf.Num(diff.Int64());
+            TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase, KNormalLogLevel, _L8("CWSStarServiceSession::ActiveTicketObserverL - iTicketObs->Start(%S) microsec"), &buf ));
+            TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+            SenDateUtils::ToXmlDateTimeUtf8L(ts, nowTime + diff);
+            TLSLOG_FORMAT(( KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarServiceSession::ActiveTicketObserverL - START time %S "), &ts ));
+#endif            
+            }
+#ifdef _SENDEBUG        
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase, KMinLogLevel, "CWSStarServiceSession::ActiveTicketObserverL - SKIP - ticket expired already we don't need to wait");
+            // ==> Validation phase will soon executed and new timer WILL BE activated
+            }
+#endif            
+        }
+        
+    }
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarserviceupdatehandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "wsstarserviceupdatehandler.h"
+#include "wsstartrustclient.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "SenSoapFault.h"
+#include "SenSoapMessage.h"
+#include "wsstarservicesession.h"
+#include "SenXmlUtils.h"
+#include "wsstarrstresponse.h"
+
+namespace WSSecureConversation
+{ 
+    //---------Faults data
+    _LIT8( KBadContextToken, "BadContextToken");
+}
+namespace WSSecurity
+{ 
+    //---------Faults data
+    _LIT8( KMessageExpired, "MessageExpired");
+    _LIT8( KInvalidSecurity, "InvalidSecurity");
+}
+
+class CWSStarHandlerContext;
+// Create instance of concrete ECOM interface implementation
+CWSStarServiceUpdateHandler* CWSStarServiceUpdateHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarServiceUpdateHandler* self   = new (ELeave) CWSStarServiceUpdateHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Constructor
+CWSStarServiceUpdateHandler::CWSStarServiceUpdateHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    
+    }
+
+// Destructor
+CWSStarServiceUpdateHandler::~CWSStarServiceUpdateHandler()
+    {
+    }
+
+// Second phase construction.
+void CWSStarServiceUpdateHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceUpdateHandler::ConstructL()")));
+    const TDesC8* version = iHandlerContext.GetDesC8L(HandlerContextKey::KVersion);
+    if (version && 
+        (*version == WSTrust::KTrustNamespace200502 || *version == WSTrust::KTrustNamespace200404))
+        {
+        iVersion = version;
+        }
+    else
+        {
+        iVersion = &WSTrust::KTrustNamespace200502;
+        }
+    }
+    
+TInt CWSStarServiceUpdateHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+    CSenSoapEnvelope* message = (CSenSoapEnvelope*)(aCtx.GetAnyL(SenContext::KSenCurrentSoapMessageCtxKey));//codescannerwarnings
+    CWSStarServiceSession* pNewSession = (CWSStarServiceSession*)aCtx.GetSenRemoteServiceSessionL(WSStarContextKeys::KServiceSession());
+    
+    //abstract variable which represent probelm (it is code or subcode depends of soap version)
+    TPtrC8 problem(KNullDesC8);
+    if (message)
+        {
+        if ((aCtx.Direction()==SenContext::EIncoming) ||
+            (aCtx.Direction()==SenContext::EBoth))
+            {  
+            if (message->IsFault())
+                {
+                CSenSoapFault* faultElement = message->FaultL();
+                if (faultElement)
+                    {
+                    if (message->NsUri() == KSenSoap12EnvelopeXmlns)
+                        {
+//----------------SOAP1.2
+                        TPtrC8 code = faultElement->FaultCode();
+                        const CSenNamespace* nmSpaceCode = faultElement->Namespace(SenXmlUtils::NsPrefix(code), ETrue);
+                        code.Set(SenXmlUtils::LocalName(code));
+                        
+                        if ((
+                            (nmSpaceCode && 
+                            nmSpaceCode->URI() == KSenSoap12EnvelopeXmlns) 
+                            ||
+                            !nmSpaceCode)
+                            &&
+                            code == KSender)
+                            {
+                            TPtrC8 subcode = faultElement->FaultSubcode();
+                            const CSenNamespace* nmSpace = faultElement->Namespace(SenXmlUtils::NsPrefix(subcode), ETrue);
+                            subcode.Set(SenXmlUtils::LocalName(subcode));
+                            
+                            if ((nmSpace && 
+                                nmSpace->URI() == *iVersion)
+                                ||
+                                !nmSpace) 
+                                {
+                                problem.Set(subcode);
+                                }    
+                            }
+                        else if (nmSpaceCode && nmSpaceCode->URI() == KSecurityXmlNs)
+                            {
+                            problem.Set(code);
+                            }
+                        }
+                    else if (message->NsUri() == KSenSoapEnvelopeXmlns)
+                        {
+//----------------SOAP1.1
+                        TPtrC8 code = faultElement->FaultCode();
+                        const CSenNamespace* nmSpace = faultElement->Namespace(SenXmlUtils::NsPrefix(code), ETrue);
+                        code.Set(SenXmlUtils::LocalName(code));
+                        if ((nmSpace && 
+                            nmSpace->URI() == *iVersion))
+                            {
+                            problem.Set(code);
+                            }    
+                        }
+//------------------real logic                        
+                    if (problem.Length()>0)
+                        {
+                        if( problem == WSTrust::KInvalidRequest ||
+                            problem == WSTrust::KRequestFailed  ||
+                            problem == WSTrust::KInvalidSecurityToken  ||
+                            problem == WSTrust::KAuthenticationBadElements  ||
+                                   
+                            problem == WSTrust::KBadRequest  ||
+                            problem == WSTrust::KExpiredData  ||
+                            problem == WSTrust::KInvalidTimeRange  ||
+                            problem == WSTrust::KInvalidScope  ||
+                            problem == WSTrust::KUnableToRenew
+                           )
+                           {
+                           ((MSenContext&)aCtx).Update(WSStarSession::KErrorLayer, WSStarSession::ETrust);
+                           }
+                        else if (problem == WSTrust::KRenewNeeded ||
+                        
+                                 problem == WSTrust::KFailedAuthentication ||
+                                 problem == WSTrust::KInvalidSecurityToken ||
+                                 problem == WSSecurity::KInvalidSecurity ||
+                                 problem == WSSecureConversation::KBadContextToken ||
+                                 problem == WSSecurity::KMessageExpired)
+                            {
+				TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceUpdateHandler::InvokeL")));
+				TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,problem);
+				TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarServiceUpdateHandler::InvokeL clear credential")));
+                            ((MSenContext&)aCtx).Update(WSStarSession::KErrorLayer, WSStarSession::ETrust);
+                            ((MSenContext&)aCtx).Update(WSStarContextKeys::KReAuthNeeded, ETrue);
+                            pNewSession->ClearCredentialL();
+                            pNewSession->SetStatusL();//in order to compute state
+                            }
+                        }
+                    }
+                }
+            else if (message->HasHeader())
+                {//checking for SCT (SecureContextToken)
+                CSenElement& el = message->HeaderL();
+                //HBufC8* msg = message->HeaderL().AsXmlL();
+                                
+                CSenElement* detached = el.DetachL();
+                CleanupStack::PushL(detached);
+                CSenElement& body = message->BodyL();
+                HBufC8* msg = detached->AsXmlL();
+                CleanupStack::PushL(msg);
+                message->AsElement().InsertElementL(*detached, body);
+                CleanupStack::Pop(2, detached);
+                CleanupStack::PushL(msg);
+                
+                //in case MSP Guide v3.0, seems that SCT comes in Body (not in header)
+                CWSStarRSTResponse* rstResponse =
+                        CWSStarRSTResponse::NewLC(FALSE, KNullDesC8, iVersion);
+                //policy namespace has not be set, is not neccessary for SCT
+                CSenXmlReader* reader = const_cast<CSenXmlReader*>(aCtx.GetParser());
+                rstResponse->SetReader(*reader);
+                rstResponse->BuildFrom(*msg);
+                if (rstResponse->IsResponse())
+                    {
+                    if (rstResponse->IsContextToken())
+                        {
+                        CWSStarSessionContext* ssCtx = pNewSession->SessionContext();
+                        ssCtx->SetTokenKeysL(*rstResponse, NULL, ETrue,ETrue);
+                        #ifdef _SENDEBUG
+                                TPtrC8 endpoint = pNewSession->Endpoint();
+                                _LIT8(KCredsLogLine, "SCT has been delivered by backend TO service (%S), so present token will be replaced");
+                                CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelNormal, KCredsLogLine,  &endpoint));
+                        #endif           
+                        //----update expires
+                        /*
+                        timestamp is calcualted
+                        
+                        if (rstResponse->CredentialExpires().Length())
+                            {
+                            ssCtx->Update(WSStarContextKeys::KTimestampExpires, rstResponse->CredentialExpires());
+                            }
+                        else
+                            {
+                            //ssCtx->Remove(WSStarContextKeys::KTimestampExpires);
+                            }
+                        //----update created
+                        if (rstResponse->CredentialCreated().Length())
+                            {
+                            ssCtx->Update(WSStarContextKeys::KTimestampCreated, rstResponse->CredentialCreated());
+                            }
+                        else
+                            {
+                            ssCtx->Remove(WSStarContextKeys::KTimestampCreated);
+                            }
+                            */
+                        //---remove SCT from BODY, it is not a bisness logic
+                        //namespace if in SOAP element still will be not visible for user 
+                        // becouse only HandleMessage(Body) is supported
+                        
+                        //after wave11 increment SCT is only in header so below logic is just for case
+                        /*CSenElement& body = message->BodyL();
+                        CSenElement* sct = GetSCTElementL(body);
+                        if (sct)
+                            {
+                            sct = sct->DetachL();
+                            delete sct;
+                            sct = NULL;
+                            }*/
+                        //----end removing SCT from BODY
+                        }
+                    }
+                CleanupStack::PopAndDestroy(2, msg);
+                }
+            }
+        }
+    return KErrNone;       
+    }
+    
+SenHandler::THandlerDirection CWSStarServiceUpdateHandler::Direction() const
+    {
+    return SenHandler::EIncoming;
+    };
+SenHandler::THandlerPhase CWSStarServiceUpdateHandler::Phase()
+    {
+    return SenHandler::EMessage;
+    };
+
+//---------------------------------------------------------------------------
+// Logger using during DEBUG mode
+//---------------------------------------------------------------------------
+//    
+RFileLogger* CWSStarServiceUpdateHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+
+TInt CWSStarServiceUpdateHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+
+CSenElement* CWSStarServiceUpdateHandler::GetSCTElementL(CSenElement& aParent)
+    {
+    CSenElement* sct = NULL;
+    sct = aParent.Element(*iVersion, WSTrust::KRSTResponseTag);
+    if (!sct)
+        {
+        RPointerArray<CSenElement>& elementsBody = aParent.ElementsL();
+        TInt count(elementsBody.Count());
+        TInt i=0;
+        while (i<count && !sct)
+            {
+            sct = GetSCTElementL(*elementsBody[i]);
+            i++;
+            }
+        }
+    return sct;
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarsessionconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenXmlUtils.h>
+
+#include "wsstarsessionconsumer.h"
+#include "sendebug.h"
+#include <SenServiceConnection.h>
+#include "senlogger.h"
+#include "wsstarcons.h"
+
+CWSStarSessionConsumer* CWSStarSessionConsumer::NewL( MSenRemoteServiceConsumer& aServiceConsumer,
+                                                      RFileLogger& aLogger )
+    {
+    CWSStarSessionConsumer* pSelf =
+        CWSStarSessionConsumer::NewLC(aServiceConsumer, aLogger);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CWSStarSessionConsumer* CWSStarSessionConsumer::NewLC( MSenRemoteServiceConsumer& aServiceConsumer,
+                                                       RFileLogger& aLogger )
+    {
+    CWSStarSessionConsumer* pSelf =
+                        new (ELeave) CWSStarSessionConsumer( aServiceConsumer, aLogger );
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+    }
+
+CWSStarSessionConsumer::~CWSStarSessionConsumer()
+    {
+    //delete iSentMessageId;
+    //delete iReceivedMessageId;
+    iSentMessages.Reset();
+    iSendReplyTo.Reset();
+    iTranspProp.Reset();
+    }
+
+CWSStarSessionConsumer::CWSStarSessionConsumer( MSenRemoteServiceConsumer& aServiceConsumer,
+                                                RFileLogger& aLogger )
+:   iConsumer(aServiceConsumer),
+    iLogger(aLogger),
+    //iSentMessageId(NULL),
+    //iReceivedMessageId(NULL),
+    iSentMessages(ETrue, ETrue),
+    iSendReplyTo(ETrue, ETrue),
+    iTranspProp(ETrue, ETrue)
+    {
+    }
+
+
+const TDesC8& CWSStarSessionConsumer::Id() const
+    {
+    return iConsumer.Id();
+    }
+
+TInt CWSStarSessionConsumer::SetSessionL(MSenRemoteServiceSession& aServiceSession)
+    {
+    iConsumer.SetSessionL(aServiceSession);
+    return KErrNone;
+    }
+
+void CWSStarSessionConsumer::HandleSoapMessageL( CSenSoapMessage* apMessage,
+                                                 const TInt aTxnId,
+                                                 MSenProperties* aResponseTransportProperties,
+                                                 TBool aCompleteMessage )
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarSessionConsumer::HandleSoapMessageL(CSenSoapMessage*)");
+    
+    if ( apMessage )
+        {
+        CleanupStack::PushL( apMessage ); // this method has the ownership, until passed forward(!)
+        
+        // fix for the error HTUR-6XDABN : Start
+        
+    	// After sending the message to Remote consumer, Corresponding message is not 
+    	// removed from the message queue. Due to this the message body sits in the 
+    	// queue (memory) till the session consumer object gets destroyed. 
+    	CSenElement& header = apMessage->HeaderL();
+    	// Response RelatesTo content=MessageId of the request
+        RPointerArray<CSenElement>& msgIdArray = header.ElementsL();
+    
+    	for(TInt i = 0; i < msgIdArray.Count(); i++)
+    		{
+    		CSenElement& idElement = *msgIdArray[i];
+    		
+    		if( idElement.LocalName() == WSStarContextKeys::KRelatesTo() )
+    			{
+            	// Remove the consumed message from the message queue 
+            	iSentMessages.RemoveByKey( idElement.Content() );
+            	iTranspProp.RemoveByKey( idElement.Content() ); 		
+            	break;
+    			}
+    		}
+    		
+    	// msgIdArray.Close(); // Must be removed (now commented out) OR otherwise regression 
+    	                       // (MMAA-6YFQ5V) will occur! The msgIdArray is a *reference*, 
+    	                       // and any modification to this array will MODIFY the actual
+    	                       // contents of that DOM tree(!). 
+    	                         
+    	// fix for the error HTUR-6XDABN : End
+    	
+        HBufC8* pMessageAsString = NULL;
+        if (aCompleteMessage)
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Returning whole SOAP-ENV");
+            pMessageAsString = apMessage->AsXmlL();
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Detaching SOAP body (calling BodyAsStringL).");
+            pMessageAsString = apMessage->BodyAsStringL();
+            }
+        CleanupStack::PopAndDestroy( apMessage ); // object has been serialized into a descriptor => de-alloc it
+        
+        if (pMessageAsString)
+            {
+            iConsumer.HandleMessageL(pMessageAsString, aTxnId, aResponseTransportProperties);
+            }
+        else
+            {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Fatal(!): pMessageAsString == NULL, invoking remote consumer's HandleErrorL.");
+            iConsumer.HandleErrorL(NULL, KErrSenNoSoapBody, aTxnId, aResponseTransportProperties);
+            }
+        }
+    else // apMessage == NULL
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"- Fatal(!): WSStarSessionConsumer::HandleSoapMessageL, apMessage == NULL, sending KErrSenInternal to remote consumer via HandleErrorL.");
+        iConsumer.HandleErrorL(NULL, KErrSenInternal, aTxnId, aResponseTransportProperties);
+        }           
+    }
+
+TInt CWSStarSessionConsumer::HandleMessageL( HBufC8* apMessage,
+                                             const TInt aTxnId,
+                                             MSenProperties* aResponseTransportProperties )
+    {
+#ifdef _SENDEBUG
+    CleanupStack::PushL(apMessage);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarSessionConsumer::HandleMessageL");
+    CleanupStack::Pop(apMessage);
+#endif // _SENDEBUG    
+    return iConsumer.HandleMessageL(apMessage, aTxnId, aResponseTransportProperties);
+    }
+
+TInt CWSStarSessionConsumer::HandleErrorL( HBufC8* apError,
+                                           const TInt aErrorCode,
+                                           const TInt aTxnId,
+                                           MSenProperties* aResponseTransportProperties )
+    {
+#ifdef _SENDEBUG
+    CleanupStack::PushL(apError);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarSessionConsumer::HandleErrorL");
+    CleanupStack::Pop(apError);
+#endif // _SENDEBUG    
+    return iConsumer.HandleErrorL(apError, aErrorCode, aTxnId, aResponseTransportProperties);
+    }
+
+void CWSStarSessionConsumer::SetStatusL(const TInt status)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarSessionConsumer::SetStatusL");
+    //we will not inform consumers about  fact that credential is expired, 
+    // ws* has to obtain new ticket and keep connection valid
+    if (status == KSenConnectionStatusExpired) 
+        {
+        iConsumer.SetStatusL(KSenConnectionStatusReady);    
+        }
+    else
+        {
+        iConsumer.SetStatusL(status);
+        }
+    }
+
+TInt CWSStarSessionConsumer::MessageForSendingL(const TDesC8& aBody,
+                                           CWSStarMessageContext*& aCtx)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarSessionConsumer::MessageForSendingL");
+    
+    //do nothing with message. Message is preapred by session and handlers
+    //we need only set correlation id using context which travel with message
+    //------------SCHarF ------- glue with addressing to get messageId. We will expect some answer
+    const TDesC8* msgId = aCtx->GetDesC8L(WSStarContextKeys::KMessageID);
+    const TDesC8* replyTo = aCtx->GetDesC8L(WSStarContextKeys::KReplyTo);
+    if (msgId)
+        {
+        iSentMessages.Append(msgId->AllocL(), aBody.AllocL());    
+        if(replyTo)
+            {
+            iSendReplyTo.Append(msgId->AllocL(), replyTo->AllocL());
+            }
+        const TDesC8* transpProp =
+                aCtx->GetDesC8L(WSStarContextKeys::KWSStarTranspProp);
+        if (transpProp)
+            {
+            iTranspProp.Append(msgId->AllocL(), transpProp->AllocL());
+            }
+        }
+    //------------end SCHarF ------- 
+    
+    return KErrNone;
+    }
+
+void CWSStarSessionConsumer::ConstructL()
+    {
+    }
+
+/*void CWSStarSessionConsumer::SetSentMessageIdL(const TDesC8& aSentMessageId)
+    {
+    HBufC8* pNew = NULL;
+    if(aSentMessageId.Length()>0)
+        pNew = aSentMessageId.AllocL();
+    delete iSentMessageId;
+    iSentMessageId = pNew;
+    }
+
+TPtrC8 CWSStarSessionConsumer::SentMessageId()
+    {
+    if(iSentMessageId)
+        {
+        return *iSentMessageId;
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+void CWSStarSessionConsumer::SetReceivedMessageIdL(
+                                            const TDesC8& aReceivedMessageId)
+    {
+    HBufC8* pNew =NULL;
+    if(aReceivedMessageId.Length()>0)
+        pNew = aReceivedMessageId.AllocL();
+    delete iReceivedMessageId;
+    iReceivedMessageId = pNew;
+    }
+
+TPtrC8 CWSStarSessionConsumer::ReceivedMessageId()
+    {
+    if(iReceivedMessageId)
+        return *iReceivedMessageId;
+    else
+        return KNullDesC8();
+    }
+*/
+TBool CWSStarSessionConsumer::Expects(const TDesC8& aRelatesTo, const TDesC8* aTo)
+    {
+    TInt index = iSentMessages.Find(aRelatesTo);
+    TBool result(EFalse);
+    TInt index2 = index; 
+    if (aTo)
+        index2 = iSendReplyTo.Find(aRelatesTo);
+    
+    if (index == index2 && index2 != KErrNotFound)
+        {
+        if (aTo)
+            {
+            const TDesC8* replyTo = iSendReplyTo.ValueAt(index);
+            if (*replyTo == *aTo)
+                {
+                result = ETrue;
+                }
+            else
+                {
+                TLSLOG(KSenFaultsLogChannel, KSenFaultsLogLevel, WSStarSessionConsumer::KFaultInvalidToTag);   
+                }
+            }
+        else
+            {
+            result = ETrue;
+            }
+        }
+    else
+        {
+        TLSLOG(KSenFaultsLogChannel, KSenFaultsLogLevel, WSStarSessionConsumer::KFaultInvalidRelatesToTag);   
+        }
+
+    return result;
+    }
+
+TDesC8* CWSStarSessionConsumer::BodyL(const TDesC8& aMessageID) const
+    {
+    HBufC8* pBody = NULL;
+
+    TInt index = iSentMessages.Find(aMessageID);
+    if (index != KErrNotFound)
+        {
+        pBody = (HBufC8*)iSentMessages.ValueAt(index);
+        }
+    return pBody;
+    }
+
+const TDesC8& CWSStarSessionConsumer::TransportProperties(
+        const TDesC8& aMessageID) const
+    {
+    TInt index = iTranspProp.Find(aMessageID);
+    if (index != KErrNotFound)
+        {
+        const TDesC8* tp = iTranspProp.ValueAt(index);
+        if (tp)
+            {
+            return *tp;
+            }
+        }
+    return KNullDesC8;
+    }
+
+MSenTransport& CWSStarSessionConsumer::TransportL()
+    {
+    return iConsumer.TransportL();
+    }
+    
+TInt CWSStarSessionConsumer::ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk)
+    {
+    return iConsumer.ChunkByTxnIdL(aTxnId, aChunk);
+    }
+
+void CWSStarSessionConsumer::FileProgress(TInt /*aTxnId*/, TBool /*aIncoming*/, TBool /*aIsSoap*/,
+                const TDesC8& /*aSoapOrCid*/, TInt /*aProgress*/)
+    {
+    }
+
+CSenIdentifier& CWSStarSessionConsumer::Identifier() const
+    {
+    return iConsumer.Identifier();
+    }
+
+
+// enable file logging (macros)
+RFileLogger* CWSStarSessionConsumer::Log() const
+    {
+    return (RFileLogger*) &iLogger;
+    }
+    
+TBool CWSStarSessionConsumer::HasAuthenticationCallback()
+    {
+    return iConsumer.HasAuthenticationCallback();
+    }
+
+TInt CWSStarSessionConsumer::ReauthenticationNeededL(CSenIdentityProvider*& aIdp)
+	{
+	return iConsumer.ReauthenticationNeededL(aIdp);
+	}
+void CWSStarSessionConsumer::SetDataTrafficDetails( TSenDataTrafficDetails&  aDetails)  
+	{
+	iConsumer.SetDataTrafficDetails(aDetails);
+	}
+
+TBool CWSStarSessionConsumer::HasCoBrandingCallback()
+    {
+    return iConsumer.HasCoBrandingCallback();
+    }
+
+TBool CWSStarSessionConsumer::OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId)
+    {
+    return iConsumer.OnGetBrandIdL(aBrandIdListAsXmlSnippet,aSelectedBrandId);
+    }
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarsessioncontext.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,753 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "wsstarrstresponse.h"
+#include "wsstarsessioncontext.h"
+#include "senwsdescription.h"
+#include <SenServiceConnection.h>
+#include <SenDateUtils.h>
+#include "sencryptoutils.h"
+#include "wsstarpolicy.h"
+#include "senlogger.h"
+#include "wsstarservicesession.h"
+#include "msenremoteservicesession.h"  // internal Framework\inc
+
+using namespace WSStarContextKeys;
+using namespace WSStarContextValues;
+
+CWSStarSessionContext* CWSStarSessionContext::NewL(CSenXmlReader* aParser, MSenServiceDescription* aSD, CWSStarPolicyHandler* aPolicyHandler)
+    {
+    CWSStarSessionContext* self = NewLC(aParser, aSD, aPolicyHandler);
+    CleanupStack::Pop(self);
+    return self;
+    }
+CWSStarSessionContext* CWSStarSessionContext::NewLC(CSenXmlReader* aParser, MSenServiceDescription* aSD, CWSStarPolicyHandler* aPolicyHandler)
+    {
+    CWSStarSessionContext* self = new (ELeave) CWSStarSessionContext(aParser);
+    CleanupStack::PushL (self);
+    self->ConstructL(aSD, aPolicyHandler);
+    return self;
+    }
+
+// Constructor
+CWSStarSessionContext::CWSStarSessionContext(CSenXmlReader* aParser):
+    iDescriptions(EFalse,EFalse),
+    iInts(EFalse,ETrue),
+    iDescs(EFalse,ETrue),
+    iParser(aParser)
+    {
+    }
+
+// Constructor
+void CWSStarSessionContext::ConstructL(MSenServiceDescription* aSD, CWSStarPolicyHandler* /*aPolicyHandler*/)
+    {
+    if (CWSStarPolicy::CheckPolicyValueL(WSPolicy::KSoap12, aSD))
+        {
+        Update(KSoapVersion, ESOAP12);
+        }
+    else
+        {
+        Update(KSoapVersion, ESOAP11);
+        }   
+    HBufC8* addrVer = CWSStarPolicy::GetPolicyValueL(WSPolicy::KAddressing, aSD);
+    if (addrVer)
+        {
+        Update(KAddressingVersion, *addrVer);
+        delete addrVer;
+        addrVer = NULL;
+        }  
+            
+    }
+
+// Destructor
+CWSStarSessionContext::~CWSStarSessionContext()
+    {
+    iDescriptions.Reset();
+    iInts.Reset();
+    iDescs.Reset();
+    if( ipSignedParts )
+        {
+        ipSignedParts->ResetAndDestroy();
+        delete ipSignedParts;
+        ipSignedParts = NULL;
+        }
+    delete iBody;
+    iBody = NULL;
+    }
+    
+TInt CWSStarSessionContext::UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD)
+    {
+    CWSStarPolicyHandler* pPolicyHandler = (CWSStarPolicyHandler*)aPolicyHandler;
+    if (pPolicyHandler)
+        {
+        RPointerArray<HBufC8>* pElements = new (ELeave) RPointerArray<HBufC8>();
+        CleanupStack::PushL( pElements );
+        CWSStarPolicy::GetPolicyValueL( WSPolicy::KSignedParts, KNullDesC8, pPolicyHandler, aSD, *pElements );
+        if ( ipSignedParts )
+            {
+            ipSignedParts->ResetAndDestroy();
+            delete ipSignedParts;
+            ipSignedParts = NULL;
+            }
+        ipSignedParts = pElements; // takes the ownership of the elements array
+        CleanupStack::Pop( pElements );
+        }
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// Sets token context keys based on RST response.
+// -----------------------------------------------------------------------------
+//
+TInt CWSStarSessionContext::SetTokenKeysL(CWSStarRSTResponse& aRSTResponse,
+        HBufC8* aClientEntropy, TBool aSignalConsumers, TBool aSCT)
+    {
+
+//1)TOKEN
+    CWSStarServiceSession* session = (CWSStarServiceSession*)
+                GetSenRemoteServiceSessionL(KServiceSession);
+    CSenCredential* credential = aRSTResponse.Credential();
+    if (credential)
+        {
+        if (!aSCT)
+            {
+            if (aRSTResponse.CredentialExpires().Length())
+                {
+                User::LeaveIfError(Update(KTimestampExpires, aRSTResponse.CredentialExpires()));    
+                }
+
+            User::LeaveIfError(Update(KMTIsReplacedBySCT, EFalse));
+            TTime clientTime;
+            clientTime.UniversalTime();
+            TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, SenDateUtils::ToXmlDateTimeUtf82L(ts, clientTime);)
+            if (!leaveCode)
+                {
+                User::LeaveIfError(Update(KPhoneTimeWhenMTResolved, ts));                        
+                }
+
+            if (aRSTResponse.CredentialCreated().Length())
+                {
+                User::LeaveIfError(Update(KTimestampCreated, aRSTResponse.CredentialCreated()));
+
+                TTime serverTime = SenDateUtils::FromXmlDateTimeL(aRSTResponse.CredentialCreated());
+                if (serverTime != Time::NullTTime())
+                    {
+                    TTimeIntervalMicroSeconds interval = serverTime.MicroSecondsFrom(clientTime);
+                    ((CSenWebServiceSession*)session)->SetClientServerIntervalL(interval);	//codescannerwarnings
+                    }
+                }
+
+            //adding credential also calculate new status
+            ((CSenWebServiceSession*)session)->AddCredentialL(*credential);
+            session->AddPropertiesFromSessionContextToCredentialL();
+            }
+         else
+            {
+            User::LeaveIfError(Update(KMTIsReplacedBySCT, ETrue));    
+            }
+            
+        //Co-Branding CR
+        if(aSignalConsumers)
+            {
+            session->SetStatusL();
+            if (((CSenServiceSession*)session)->StatusL() == KSenConnectionStatusExpired)
+                {
+                return KErrNotReady;
+                }
+            }
+            
+        HBufC8* securityToken = credential->AsXmlL();
+        if (securityToken)
+            {
+            if (!aSCT)
+                {
+                CleanupStack::PushL(securityToken);
+                User::LeaveIfError(Update(KTokenType, aRSTResponse.TokenType()));
+                HBufC8* binarySecurityToken =
+                        SenCryptoUtils::CreateEncodedBinarySecretL(*securityToken, aRSTResponse.TokenType());
+                CleanupStack::PushL(binarySecurityToken);
+                User::LeaveIfError(Update(WSStarContextKeys::KSecurityToken,
+                        *binarySecurityToken));
+                User::LeaveIfError(Update(WSStarContextKeys::KSecurityTokenBackup,
+                        *binarySecurityToken));
+                CleanupStack::PopAndDestroy(binarySecurityToken);                
+                CleanupStack::PopAndDestroy(securityToken);                
+                }
+            else
+                {//SCT is not encoded
+                CleanupStack::PushL(securityToken);
+                User::LeaveIfError(Update(WSStarContextKeys::KSecurityToken,
+                        *securityToken));
+                CleanupStack::PopAndDestroy(securityToken);
+                }
+            }    
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+//2)KEY TOKEN
+    if (!aSCT)//if SCT comes, we still use old pop
+        {
+        const TInt KByteSize = 8;
+        TPtrC8 popBase64 = aRSTResponse.POPBase64();
+        HBufC8* newPOPBase64 = NULL;
+        //if no (POP/BinarySecret) from server
+        if (!popBase64.Length())
+            {
+
+            if (
+                //IOP 2007 improve, determine by ComputedKey tag instead optional nonce value.
+                //binaryType is optional attribute so it doesn't determine flow, better is checking ComputedKey tag
+                /*(aRSTResponse.BinaryType() == WSTrust::KBinaryTypeNonceValue)*/
+                aRSTResponse.ComputedKey().Length()
+                &&
+                aRSTResponse.EntropySTS().Length())
+                    {
+                    if (aClientEntropy)
+                        {
+                        //calcualte new POP using algorithm
+                        TPtrC8 computedKey = aRSTResponse.ComputedKey();
+                        if (computedKey == WSTrust::KComputedKeyPSHA1Value)
+                            {
+                            HBufC8* clientBin = SenCryptoUtils::DecodeBase64L(
+                                    *aClientEntropy);
+                            CleanupStack::PushL(clientBin);
+                            HBufC8* STSBin = SenCryptoUtils::DecodeBase64L(
+                                    aRSTResponse.EntropySTS());
+                            CleanupStack::PushL(STSBin);
+                            TInt keySize = aRSTResponse.KeySize();
+                            if (!keySize)
+                                {
+                                TLSLOG(KSenFaultsLogChannel, KSenFaultsLogLevel, WSStarTrustFault::KBadKeySize());
+                                keySize = WSTrust::KSizeOfComputedKey;
+                                }
+                            if (keySize % KByteSize)
+                                {
+                                TLSLOG(KSenFaultsLogChannel, KSenFaultsLogLevel, WSStarTrustFault::KBadKeySize());
+                                }
+                            keySize = keySize / KByteSize; //byte = 8 bits
+                            HBufC8* newEntropy = 
+                                SenCryptoUtils::GetPSHA1HashL( *clientBin, *STSBin, keySize);
+                                
+                            CleanupStack::PopAndDestroy(2, clientBin);
+                            CleanupStack::PushL(newEntropy);
+                            newPOPBase64 = SenCryptoUtils::EncodeBase64L(
+                                    *newEntropy);
+                            CleanupStack::PopAndDestroy(newEntropy);
+                            CleanupStack::PushL(newPOPBase64);
+                            newEntropy = NULL;
+                            popBase64.Set(*newPOPBase64);
+                            }
+                        else
+                        //http://schemas.xmlsoap.org/ws/2005/02/trust/CK/HASH not supported
+                            {
+                            //still possible to talk with service without POP (we just will not sign anything)
+                            //return KErrNotFound;
+                            }
+                        }
+                       else
+                        {
+                        //server response with cmupting key but client doesnt provide entropy. wrong scenario
+                        //still possible to talk with service without POP (we just will not sign anything)
+                        }
+                    }
+        //no from server nor calculated so last chance that
+        //6.2.3 If the requestor provides entropy and the responder doesn't 
+        //(issuer uses the requestor's key),
+        //then a proof-of-possession token need not be returned.
+                else if (aClientEntropy)
+                    {
+                    popBase64.Set(*aClientEntropy);
+                    }
+                else
+                    {
+                    //still possible to talk with service without POP (we just will not sign anything)
+                    //return KErrNotFound;
+                    }
+            }
+        if (popBase64.Length())
+            {
+            User::LeaveIfError(Update(KPOPBase64, popBase64));
+            if (newPOPBase64) CleanupStack::PopAndDestroy(newPOPBase64);
+            
+            //binary type always will be (default simmetric)
+            if (aRSTResponse.BinaryType()== WSTrust::KBinaryTypeSimmetricValue)
+                {
+                User::LeaveIfError(Update(KBinaryType,   KPOPTypeSimmetric()));
+                }
+            else if (aRSTResponse.BinaryType()== WSTrust::KBinaryTypeAsimmetricValue)
+                {
+                User::LeaveIfError(Update(KBinaryType, KPOPTypeAsimmetric()));
+                }
+            else if (aRSTResponse.BinaryType()== WSTrust::KBinaryTypeNonceValue)
+                {
+                User::LeaveIfError(Update(KBinaryType, KPOPTypeNonce()));
+                }
+            //adding KeyInfo (its identifier)
+            TPtrC8 str = aRSTResponse.STR();
+            if (str.Length())
+                {
+                User::LeaveIfError(Update(KSTR, str));
+                }
+            }
+        }
+    session->AddPropertiesFromSessionContextToCredentialL();
+    return KErrNone;
+    }
+
+//-----------------------------------------------------
+//              from MSessionContext
+//-----------------------------------------------------
+const CSenWSDescription* CWSStarSessionContext::GetSession()
+    {
+    return NULL;
+    };
+const CSenWSDescription* CWSStarSessionContext::GetInitializer()
+    {
+    return NULL;
+    };
+
+//descriptions    
+TInt CWSStarSessionContext::Add(const TDesC8& aKey, CSenWSDescription* aValue)
+    {
+    return iDescriptions.Append(&aKey,aValue);
+    };
+
+TInt CWSStarSessionContext::Update(const TDesC8& aKey, CSenWSDescription* aValue)
+    {
+    iDescriptions.RemoveByKey(aKey);
+    return iDescriptions.Append(&aKey,aValue);
+    };
+
+const CSenWSDescription* CWSStarSessionContext::GetSenWSDescriptionL(const TDesC8& aKey)
+    {
+    TInt index = iDescriptions.Find(aKey);
+    if (index!=KErrNotFound)
+        {
+        return iDescriptions.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        };        
+    };
+
+
+//sessions    
+TInt CWSStarSessionContext::Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue)
+    {
+    return Update(aKey, aValue);
+    };
+TInt CWSStarSessionContext::Update(const TDesC8& /*aKey*/, MSenRemoteServiceSession& aValue)
+    {
+    iSession = &aValue;
+    return KErrNone;
+    };
+const MSenRemoteServiceSession* CWSStarSessionContext::GetSenRemoteServiceSessionL(const TDesC8& /*aKey*/)
+    {
+    return iSession;
+    };    
+
+
+
+//-----------------------------------------------------
+//              from MContext
+//-----------------------------------------------------
+
+SenContext::TContextType CWSStarSessionContext::Type() const  
+    {
+    return SenContext::ESessionContext;
+    }
+
+SenContext::TContextDirection CWSStarSessionContext::Direction() const 
+    {
+    return SenContext::EBoth;
+    }
+
+
+
+//-----------------descs
+TInt CWSStarSessionContext::Add(const TDesC8& aKey, const TDesC8& aValue)
+    {   
+        //version without copy
+        //return iDescs.Append(&aKey,&aValue);
+        
+        //version with making of copy
+        if (!aValue.Length()) return KErrUnderflow;
+        HBufC8* newValue = NULL;
+        TInt error(KErrNone);
+        TRAP(error, newValue = aValue.AllocL());
+        if (!error)
+            {
+            error = iDescs.Append(&aKey,newValue);
+            }
+        return 
+            error;
+    }
+TInt CWSStarSessionContext::Update(const TDesC8& aKey, const TDesC8& aValue)
+    {
+        //return iDescs.UpdateValue(&aKey,&aValue);
+        
+        //version with makeing of copy
+        TInt error(KErrNone);
+        if (!aValue.Length())
+            {
+            error = Remove(aKey);
+            if (error == KErrNotFound)
+                return KErrNone;
+            else
+                return error;
+            }
+        HBufC8* newValue = NULL;
+        
+        TRAP(error, newValue = aValue.AllocL());
+        
+        if (!error)
+            {
+            error = iDescs.UpdateValue(&aKey,newValue);
+            }
+        return 
+            error;
+    }
+const TDesC8* CWSStarSessionContext::GetDesC8L(const TDesC8& aKey)
+    {
+    TInt index = iDescs.Find(aKey);
+    if (index != KErrNotFound)
+        {
+        return iDescs.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        };        
+    }
+TInt CWSStarSessionContext::Remove(const TDesC8& aKey)
+    {
+    return iDescs.RemoveByKey(aKey);
+    }
+
+
+//-----------------TInts
+TInt CWSStarSessionContext::Add(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a) 
+        {
+        return iInts.Append(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+        
+    }
+TInt CWSStarSessionContext::Update(const TDesC8& aKey, TInt aValue)
+    {
+    TInt* a = NULL;
+    a = new TInt(aValue);
+    if (a) 
+        {
+        return iInts.UpdateValue(&aKey, a);
+        }
+    else
+        {
+        return KErrNoMemory;
+        }
+    }
+const TInt* CWSStarSessionContext::GetIntL(const TDesC8& aKey)
+    {
+    TInt index = iInts.Find(aKey);
+    if (index!=KErrNotFound)
+        {
+        return iInts.ValueAt(index);
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+//-----------------elements
+TInt CWSStarSessionContext::Add(const TDesC8& aKey, CSenElement* aValue)
+    {
+    return Update(aKey,aValue);
+    }
+TInt CWSStarSessionContext::Update(const TDesC8& aKey, CSenElement* aValue)
+    {
+    if (aKey == KBodyElement)
+        {
+        delete iBody;
+        iBody = NULL;
+        iBody = aValue;
+        return KErrNone;
+        }
+    return KErrNotFound;
+    }
+const CSenElement* CWSStarSessionContext::GetSenElementL(const TDesC8& aKey)
+    {
+    if (aKey == KBodyElement)
+        {
+        return iBody;
+        }
+    return NULL;
+    }
+
+//-----------------TAnys
+TInt CWSStarSessionContext::Add(const TDesC8& aKey, TAny* aValue)
+    {
+    TInt err(KErrNone);
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        if (!iCurrentEnvelope)
+            {
+            iCurrentEnvelope = (CSenSoapEnvelope*)aValue;
+            }
+        else
+            {
+            err = KErrAlreadyExists;
+            }
+        }
+    else if ( aKey == SenContext::KRemoteConsumer() )
+        {
+        if ( !ipConsumer )
+            {
+            ipConsumer = aValue;
+            }
+         else
+            {
+            err = KErrAlreadyExists;
+            }
+        }
+    else 
+        {
+        err = KErrNotFound;
+        }        
+    return err;
+    }
+TInt CWSStarSessionContext::Update(const TDesC8& aKey, TAny* aValue)
+    {
+    TInt err(KErrNone);
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey())
+        {
+        iCurrentEnvelope = (CSenSoapEnvelope*)aValue;
+        }
+    else if ( aKey == SenContext::KRemoteConsumer() )
+        {
+        ipConsumer = aValue;
+        }
+    else
+        {
+        err = KErrNotFound;
+        }
+    return err;
+    }
+TAny* CWSStarSessionContext::GetAnyL(const TDesC8& aKey)	//codescannerwarnings
+    {
+    if (aKey == SenContext::KSenCurrentSoapMessageCtxKey)
+        {
+        return iCurrentEnvelope;
+        }
+    else if ( aKey == WSStarContextKeys::KRemoteConsumer )
+        {
+        return ipConsumer;
+        }
+    else if(aKey == WSStarContextKeys::KSignedPartsArray)
+        {
+        return ipSignedParts;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+
+//-----------------Rest
+const CSenXmlReader* CWSStarSessionContext::GetParser()
+    {
+    return iParser;
+    }
+TInt CWSStarSessionContext::Count() const
+    { 
+    return 0;
+    }
+TPtrC8 CWSStarSessionContext::KeyAtL(TInt /*aIndex*/)
+    { 
+    return KNullDesC8();
+    }        
+void CWSStarSessionContext::Reset()
+    {
+    }
+//-----------------------new    
+void CWSStarSessionContext::UpdateDesC8L(CWSStarMessageContext& aMessageContext, const TDesC8& aKey)
+    {
+    const TDesC8* ptr =
+            aMessageContext.GetDesC8L(aKey);
+    if (ptr)
+        {
+        User::LeaveIfError(Update(aKey, *ptr));
+        }
+    else
+        {
+        Remove(aKey);
+        }
+    
+    }
+    
+void CWSStarSessionContext::UpdateFromMessageInContextL(
+        CWSStarMessageContext& aMessageContext)
+    {
+    const TDesC8* ptr =
+            aMessageContext.GetDesC8L(KAction);
+    if (ptr)
+        {
+        User::LeaveIfError(Update(KResponseAction, *ptr));
+        }
+    else
+        {
+        Remove(KResponseAction);
+        }
+    
+    UpdateDesC8L(aMessageContext, KAddressingNsHolder);
+    UpdateDesC8L(aMessageContext, KAddressingEndpointTagHolder);
+    const TInt* ptrInt =
+            aMessageContext.GetIntL(KReAuthNeeded);
+    if (ptrInt)
+        {
+        User::LeaveIfError(Update(KReAuthNeeded, *ptrInt));
+        }
+    const TDesC8* ptrBrandID =
+        aMessageContext.GetDesC8L(KMainBrandID);
+    if (ptrBrandID)
+        {
+        User::LeaveIfError(Update(KMainBrandID, *ptrBrandID));
+        }
+    const TDesC8* ptrBrandIDList =
+        aMessageContext.GetDesC8L(KBrandIDList);
+    if (ptrBrandIDList)
+        {
+        User::LeaveIfError(Update(KBrandIDList, *ptrBrandIDList));
+        }
+    }
+
+void CWSStarSessionContext::UpdateFromMessageOutContextL(
+        CWSStarMessageContext& aMessageContext)
+    {
+    if (!aMessageContext.GetSenElementL(KBodyElement))
+        {
+        iBody = NULL;    
+        }
+    UpdateDesC8L(aMessageContext, KSTR);
+    UpdateDesC8L(aMessageContext, KBody);
+    UpdateDesC8L(aMessageContext, KMessageID);
+    }
+
+TInt CWSStarSessionContext::ShareTokenWithL(CWSStarSessionContext* aWSStarSessionCtxDst, TBool& aMTwasReplaceBySCT)
+    {
+    //first check SCT
+    const TBool* isreplaced = NULL;
+    const TDesC8* desc = NULL;
+    isreplaced = GetIntL(KMTIsReplacedBySCT);
+    if (isreplaced && *isreplaced == TRUE)
+        {
+        aMTwasReplaceBySCT = ETrue;
+        }
+    else
+        {
+        aMTwasReplaceBySCT = EFalse;
+        }
+    TInt error = KErrNone;
+    desc = GetDesC8L(KTimestampExpires);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KTimestampExpires, *desc);
+        if (error) return error;
+        }
+    desc = GetDesC8L(KTimestampCreated);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KTimestampCreated, *desc);    
+        if (error) return error;
+        }    
+    desc = GetDesC8L(KPhoneTimeWhenMTResolved);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KPhoneTimeWhenMTResolved, *desc);    
+        if (error) return error;
+        }
+    if (aMTwasReplaceBySCT)
+        {
+        CREDLOG_L(KSenCredsLogLevelNormal,"....this session has SCT so share it also");
+        error = aWSStarSessionCtxDst->Update(KMTIsReplacedBySCT, aMTwasReplaceBySCT);    
+        if (error) return error; 
+        }
+    desc = GetDesC8L(KSecurityToken);
+    if (desc)//here we possible copy SCT, flag KMTIsReplacedBySCT determine
+        {
+        //some MS email "...1 SCT to access all WL for mobile services) but is not likely to remain that way..."
+        //in future SCT will be not copied
+        error = aWSStarSessionCtxDst->Update(KSecurityToken, *desc);    
+        if (error) return error;
+        }
+    desc = GetDesC8L(KSecurityTokenBackup);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KSecurityTokenBackup, *desc);    
+        if (error) return error;
+        }
+    //POP
+    desc = GetDesC8L(KPOPBase64);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KPOPBase64, *desc);    
+        if (error) return error;
+        }  
+    desc = GetDesC8L(KTokenType);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KTokenType, *desc);    
+        if (error) return error;
+        }  
+    desc = GetDesC8L(KBinaryType);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KBinaryType, *desc);    
+        if (error) return error;
+        } 
+    desc = GetDesC8L(KBinaryType);
+    if (desc)
+        {
+        error = aWSStarSessionCtxDst->Update(KSTR, *desc);    
+        if (error) return error;
+        }                        
+    return error;    
+    }
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstartrustclient.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1209 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "wsstartrustclient.h"
+
+#include <s32mem.h>
+#include <f32file.h>
+#include <s32file.h>
+#include <SenXmlUtils.h>
+#include "sencryptoutils.h"
+
+#include "wsstarservicesession.h"
+#include "SenXmlUtils.h"
+#include "msencoreservicemanager.h"
+#include "sendebug.h"
+#include "senlogger.h"
+#include "MSenServiceDescription.h"
+#include "senlogger.h"
+#include "SenServiceConnection.h"
+#include "seninternalserviceconsumer.h"
+#include "wsstarrstresponse.h"
+#include <SenCredential.h>
+#include "wsstarpolicy.h"
+#include "wsstarplugin.h"
+#include <SenTransportProperties.h>
+#include "senwspattern.h"
+
+using namespace WSTrust;
+using namespace WSPolicy;
+
+_LIT8(KRemoteConsumer,       "RemoteConsumer");
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class.
+//---------------------------------------------------------------------------
+//
+CWSStarTrustClient* CWSStarTrustClient::NewL(
+                                                        CSIF& aSIF,
+                                                        RFileLogger& aLogger)
+    {
+    CWSStarTrustClient* pNew = NewLC(aSIF, aLogger);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Creates and returns a new instace of this class and leaves the object on the cleanup stack
+//---------------------------------------------------------------------------
+//
+CWSStarTrustClient* CWSStarTrustClient::NewLC(
+                                                        CSIF& aSIF,
+                                                        RFileLogger& aLogger)
+    {
+    CWSStarTrustClient* pNew =
+        new (ELeave) CWSStarTrustClient(
+                    aSIF,
+                    MSenServiceDescription::EWSStarSTSClient,
+                    aLogger);
+
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarTrustClient::CWSStarTrustClient(
+                                                CSIF& aSIF,
+                                                TDescriptionClassType aType,
+                                                RFileLogger& aLogger)
+    : CSenInternalServiceConsumer(aType, aSIF),
+    iLog(aLogger)
+    {
+    }
+
+void CWSStarTrustClient::BaseConstructL()
+    {
+    CSenInternalServiceConsumer::ConstructL();
+    iTpCounter = 0;
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarTrustClient::ConstructL()")));
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarTrustClient::~CWSStarTrustClient()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::~CWSStarTrustClient");
+    delete iSTSSession;
+    delete iEntropyClient;
+    delete iAppliesTo;
+    delete ipTransport;
+    delete iTokenType;
+    delete iSTSOrginalEndpoint;
+    }
+
+
+//---------------------------------------------------------------------------
+// The most siginificant method of this class. Make validation of session, 
+//    credentails obtained if needed.
+//    Sequential logic, synchronized, step bye SOAP exchange scenrio.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarTrustClient::ValidateL( CWSStarServiceSession& aSession,
+                                    TBool aRenewing,
+                                    HBufC8*& aErrorMessage,
+                                    TBool aOnlySharing )
+    {
+    iSTSSession->CompleteServerMessagesOnOffL(ETrue);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL(..)");
+    TInt retVal(KErrNone);            // for returning error codes
+    iWSStarServiceSession = &aSession;            // save session
+    
+//----------------------
+//0  token sharing
+//----------------------
+    TBool sharingSucceed = EFalse;
+    HBufC8* clusterUsed = CWSStarPolicy::GetPolicyValueL(KIssuedToken, KRPSCluster, *iHndCtx, iSTSSession);
+    CleanupStack::PushL(clusterUsed);
+    
+    //its mean - if our provider uses cluster template, 
+    //so we can try copy MT and SCT form other msn services which use same provider ID
+    if (clusterUsed)
+        {
+        RPointerArray<CSenWSDescription> msnSDs;
+        CleanupClosePushL(msnSDs);
+        CSenWSPattern* pattern = CSenWSPattern::NewLC();
+     
+        //select * from session_of_SD where session is (ws* framework, and has same provideId)
+        //here we assume that provider use cluster template
+        
+        pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+        pattern->AsElement().AddElementL(KSenIdpProviderIdLocalname).SetContentL(iIdentityProvider->ProviderID());
+        //pattern->AsElement().AddElementL(WSStarSession::KProviderIdElementLocalName).SetContentL(iIdentityProvider->ProviderID());
+        //seeking
+        CWSStarServiceSession* msnSession = NULL;
+        TRAPD(leaveError, retVal = Framework().Manager().ServiceDescriptionsL(msnSDs, *pattern));
+        if(!retVal && !leaveError)
+            {
+            TInt count = msnSDs.Count();
+            TBool pMTwasReplaceBySCT = EFalse;
+            TBool seekSCT = EFalse;
+            for(TInt i = 0; i < msnSDs.Count(); i++)
+                {
+                //all sessions (so in practice we have also access to SCT, not only MT),
+                // to eliminate client, just for case we check type
+                TDescriptionClassType dt = msnSDs[i]->DescriptionClassType();
+                if (dt == MSenServiceDescription::EWSStarServiceSession)
+                    {
+                    msnSession = (CWSStarServiceSession*)msnSDs[i];
+                    //dont share to itself
+                    if (msnSession != iWSStarServiceSession)
+                        {
+                        TRAPD(err, retVal = msnSession->ShareTokenWithL(
+                                iWSStarServiceSession, pMTwasReplaceBySCT,
+                                seekSCT));
+                        if ((retVal == KErrNone) && (err == KErrNone))
+                            {
+                            sharingSucceed = ETrue;
+                            if (pMTwasReplaceBySCT)
+                                {
+                                break;    
+                                }
+                            else
+                                {
+                                seekSCT = ETrue;//in order to find other session which can have additioanly SCT
+                                }
+                            }    
+                        }
+                    }
+                }
+            if ( !pMTwasReplaceBySCT && !sharingSucceed )
+                {
+                // Did not find valid MT      (<=> sharingSucceed     == EFalse)
+                // AND did not find valid SCT (<=> pMTwasReplaceBySCT == EFalse) 
+                // 
+                // Try to search valid MT directly from CredentialManager
+                // (This is needed especially in case when MT is imported
+                //  through Public API
+                //  => There is not yet Session which holds imported MT)
+                if ( iWSStarServiceSession->TryToSearchValidCredentialL() == KErrNone )	//codescannerwarnings
+                    {
+                    iWSStarServiceSession->SetStatusL();
+                    iWSStarServiceSession->AddSecurityTokenToContextL();
+                    sharingSucceed = ETrue;
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(2, &msnSDs);
+        }
+    CleanupStack::PopAndDestroy(clusterUsed);
+    
+    if (sharingSucceed)
+        {
+        iWSStarServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL(..) - sharing succed, we don't need more validation");
+        return KErrNone;
+        }
+    if (aOnlySharing)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL(..) - only sharing was allowed so NO continuation");
+        return KErrNone;
+        }
+    
+    
+//-----------------
+//1 Init session
+//-----------------
+
+    if (!iSTSSession)// if trustClient has NOT been registered earlier
+        {
+        iSTSSession = CWSStarServiceSession::NewL(Framework());
+        iSTSSession->InitializeFromL(*this);
+        iSTSSession->SetEndPointL(iIdentityProvider->Endpoint());
+        iSTSSession->SetContractL(KWSStarSTSContract);
+        iSTSSession->AddConsumerL(*this);
+        }
+    CSenXmlReader* reader = Framework().Manager().XMLReader();
+    CWSStarSessionContext* stsSsnContext = iSTSSession->SessionContext();
+    iPassportMode = CWSStarPolicy::CheckPolicyValueL(KPassportExtensions, iSTSSession);
+    if (iPassportMode)
+        {
+        stsSsnContext->Update(WSStarContextKeys::KPassportEnabled, ETrue);
+        aRenewing = FALSE; //MS passport doesn't support renewing binding. So we force here issue binding
+        }
+    iRenewingMode = aRenewing;
+
+//-----------------
+//2.preparing context    
+//-----------------------WS-TRUST 2005-02 chapter 6 -  RST issue-------------------------    
+    stsSsnContext->Update(WSStarContextKeys::KAction, GetAction());
+    
+    TInt retryCounter(0);
+    TBool retry(ETrue);
+    TBool authenticationInfoPromptedFromUser(EFalse);
+    TPckgBuf<TSenAuthentication> authInfo;
+    HBufC8* responseXML = NULL;
+    HBufC8* pBodyXML = NULL;
+    MSenRemoteServiceConsumer* pConsumer = NULL;
+            
+    while ( retry ) // Authentication loop starts
+        {
+        retry = EFalse;
+        
+        //setting secure profile of authentication with sts, can X509, so in future some factory calling
+    if (CWSStarPolicy::CheckPolicyValueL(KUsernameTokenOverTLS, iSTSSession))
+            {
+            HBufC8* token = NULL;
+            if ( authenticationInfoPromptedFromUser )
+                {
+                CSenWsSecurityHeader::UsernameTokenL(authInfo().iUsername,
+                                                     authInfo().iPassword,
+                                                     token);
+                }
+            else
+                {
+                CSenWsSecurityHeader::UsernameTokenL(iIdentityProvider->UserName(),
+                                                     iIdentityProvider->Password(),
+                                                     token);
+                }
+            stsSsnContext->Update(WSStarContextKeys::KSecurityToken, *token);    
+        delete token;    
+        token = NULL;
+        }
+    
+    //building body
+    CWSStarPlugin& frmWSStar = (CWSStarPlugin&)Framework();
+    CSenElement* pBody = CreateBodyL();
+    stsSsnContext->Update(WSStarContextKeys::KBodyElement, pBody);
+        pBodyXML = pBody->AsXmlL();
+        CleanupStack::PushL(pBodyXML);
+    //-----------------    
+    //_____________________________________SYNC Sending____________________________________________
+
+        CSenTransportProperties* transProp = CSenTransportProperties::NewLC();
+		const TDesC8* value =stsSsnContext->GetDesC8L(WSStarContextKeys::KAction);
+		if(value)
+        transProp->SetSoapActionL(*value);
+        
+        // IAP dialog used to appear though IAP id is provided as a part of Service Description
+        // Get the IAP setting and accordingly set the transport properties
+    	TUint32 id = 0;
+    	TInt getIapRetCode = IapId(id);
+    	
+    	    ;
+    	// Check whether IAP ID is pre-defined, and copy it only if such property value is found
+    	//if ( getIapRetCode == KErrNone && id < 4294967295) // unsigned 4294967295 == -1 signed
+    	if ( getIapRetCode == KErrNone && id < (TUint32)KErrNotFound) // unsigned 4294967295 == -1 signed
+    	    {
+    	    transProp->SetIapIdL(id); 
+    	    }
+    	// ETMI-6WAGDB end
+    	
+    	//limit http timeout, 
+    	//  if sts hangs and can not send any response, then we block every async client method.
+    	//  Possibel revalidation during sendL can take too long time therefore we create new limit
+    	transProp->SetMaxTimeToLiveL(WSStarSession::KMaxHttpTimeOut);
+    	 	    
+        HBufC8* transPropAsXml = transProp->AsUtf8LC();
+    /*
+        if( iWSStarServiceSession )
+            {
+            iWSStarServiceSession->SendStatusToConsumerL( KSenStatusAuthentication );
+            }
+    */        
+        //overwrite passport endpoint (provided by GUI)  by endpoint provided by policy
+        AdaptStsEndpointL();	//codescannerwarnings
+        iTpCounter++;
+        retVal = iSTSSession->SubmitL(*pBodyXML, *transPropAsXml, *this, responseXML);
+        iTpCounter--;
+        CWSStarSessionContext* pSessionCtxt = iWSStarServiceSession->SessionContext();// redundant code 
+        TAny* ptr = pSessionCtxt->GetAnyL(KRemoteConsumer());	//codescannerwarnings
+        if ( ptr )
+            {
+            pConsumer = REINTERPRET_CAST(MSenRemoteServiceConsumer*, ptr);
+            }
+        else
+            {
+            pConsumer = iWSStarServiceSession->Consumer();
+            }
+
+        pConsumer->SetDataTrafficDetails(iTrustDetails);
+        AdaptStsEndpointL(ETrue);
+        CleanupStack::PopAndDestroy(transPropAsXml);
+        CleanupStack::PopAndDestroy(transProp);
+        CleanupStack::PopAndDestroy(pBodyXML);
+        
+        CleanupStack::PushL(responseXML);
+
+        if ( retVal == KErrSenSoapFault )
+            {
+            //CREDLOG_L(KSenCredsLogLevelNormal,".......failed (SOAP Fault)");
+            CWSStarSessionContext* pSessionContext = iWSStarServiceSession->SessionContext();
+            TAny* ptr = pSessionContext->GetAnyL(KRemoteConsumer());	//codescannerwarnings
+            if ( ptr )
+                {
+                pConsumer = REINTERPRET_CAST(MSenRemoteServiceConsumer*, ptr);
+                }
+            else
+                {
+                pConsumer = iWSStarServiceSession->Consumer();
+                }
+            
+            if ( pConsumer && !pConsumer->HasAuthenticationCallback() &&
+                 retryCounter < 3 )
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL - Consumer does not have AuthenticationCallback");
+                
+                const TDesC8* pValue = iIdentityProvider->AsElement().AttrValue( KSenAttrPromptUserInfo );
+                
+#ifdef _RD_SEN_WS_STAR_DO_NOT_PROMPT_AUTHINFO_BY_DEFAULT
+                if ( pValue && *pValue != _L8("false") )
+                // attribute has to exist, otherwise logic defaults to: DO NOT PROMPT
+#else
+                if ( !pValue || *pValue != _L8("false") )
+                // even when attribute does NOT exist, or when it does and has any other value but "false", default to: PROMPT
+#endif                
+                    {
+                    const TBool* renewingPtr = stsSsnContext->GetIntL(WSStarContextKeys::KReAuthNeeded);
+					if ( renewingPtr )
+                     	{
+                    if ( *renewingPtr )
+                        {
+                            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"- Prompt is used to get AuthenticationInfo");
+                        TInt ret = (Framework().Manager()).AuthenticationForL(*iIdentityProvider,
+                                                                              authInfo);
+                        if ( ret == KErrNone )
+                            {
+                            retryCounter++;
+                            retry = ETrue;
+                            authenticationInfoPromptedFromUser = ETrue;
+                            }
+                        }
+                     	}
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::ValidateL - promptUserInfo = false");
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel," => prompt is not used.");
+                    }
+                }
+            if ( pConsumer && pConsumer->HasAuthenticationCallback() &&
+                             retryCounter < 3 )
+            	{
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::ValidateL - Consumer has AuthenticationCallback");
+                
+                const TDesC8* pValue = iIdentityProvider->AsElement().AttrValue( KSenAttrPromptUserInfo );
+                
+                if ( !pValue || *pValue != _L8("false") )
+                    {
+                    const TBool* renewingPtr = stsSsnContext->GetIntL(WSStarContextKeys::KReAuthNeeded);
+                    if ( renewingPtr && *renewingPtr )
+                        {
+                        const TBool* renewingByCredObserv = iWSStarServiceSession->SessionContext()->GetIntL(WSStarContextKeys::KReAuthNeededFromCredObserv);
+                        if( renewingByCredObserv != NULL && *renewingByCredObserv )
+                        	{
+                        	// Credential Observer -> call reauthenticatino through connection agent
+                        	CSenIdentityProvider* newIdP = iIdentityProvider;
+                        	TRAPD(error, retVal = pConsumer->ReauthenticationNeededL(newIdP));
+    	                    if(error == KErrNone && retVal == KErrNone)
+    	                    	{
+    	                    	// Update identity provider in case old one got corrupted
+    	                    	iIdentityProvider = newIdP;
+    	                    	retryCounter++;
+    	                    	retry = ETrue;
+    	                    	}
+    	                    else
+    	                    	{
+    	                    	retVal = KErrSenFailedAuthentication;
+    	                    	}
+                        	}
+                        else
+                        	{
+                        	retVal = KErrSenFailedAuthentication;
+                        	}
+                        }
+                    }
+                else
+                    {
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::ValidateL - UserInfoPrompt = false");
+                    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel," => AuthenticationCallback is not used.");
+                    }
+                
+            	}
+            }
+            
+        if ( retry )
+            {
+            CleanupStack::PopAndDestroy(responseXML);
+            }
+        }  // Authentication loop ends
+   
+    if (!retVal)
+        {
+        const TDesC8* responseAction = stsSsnContext->GetDesC8L(WSStarContextKeys::KResponseAction);
+        if  (responseAction &&
+                responseAction->Length())
+            {
+            if (*responseAction != GetActionResponse())
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::ValidateL - wrong action in response");
+
+                retVal = KErrNotFound;
+                //no ws-trust specifiv fault defined for invalid RESPONSE. I can only answer iwth addressign fault
+                //but no access to addressing handler directly
+                }
+            }
+        }
+    if (retVal != KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarTrustClient::ValidateL - error when submit to STS %d"), retVal));
+
+        if (responseXML)
+            {
+            aErrorMessage = responseXML;
+            }
+        
+        CleanupStack::Pop(responseXML);
+        if (! iTpCounter)
+            {
+            //we don't have to keep transport. Important expecially during night test, 
+            //  when transport and its RConnection exceed idle timeout
+            delete ipTransport;
+            ipTransport = NULL;
+            }
+        return retVal;
+        }
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL - response from STS is a valid SOAP");
+	#ifdef RD_SEN_VTCP_SUPPORT
+	//#ifdef RD_SEN_CO_BRAND_SUPPORT
+	//stsSsnContext->Update(WSStarContextKeys::KBrandIDEnabled, EFalse);
+    const TDesC8* mainBrandID = stsSsnContext->GetDesC8L(WSStarContextKeys::KMainBrandID);
+    if  (mainBrandID && mainBrandID->Length())
+        {
+        if(iPassportMode)
+            {
+            //Call Back Consumer
+            CWSStarSessionContext* pSessionContext = iWSStarServiceSession->SessionContext();
+            TAny* ptr = pSessionContext->GetAnyL(KRemoteConsumer());	//codescannerwarnings
+            if ( ptr )
+                {
+                pConsumer = REINTERPRET_CAST(MSenRemoteServiceConsumer*, ptr);
+                }
+            else
+                {
+                pConsumer = iWSStarServiceSession->Consumer();
+                }
+          
+            if ( pConsumer && pConsumer->HasCoBrandingCallback() )
+                {
+                	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::HasCoBrandingCallback");
+                    const TDesC8* brandIDList = stsSsnContext->GetDesC8L(WSStarContextKeys::KBrandIDList);
+
+                    RBuf8 selectedBrandId;
+                    //User will reply with go/no go optoin
+                    if(pConsumer->OnGetBrandIdL(*brandIDList,selectedBrandId))
+                    {
+                		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::Brand ID Is Enabled");
+                        // co-branding - Add co branding details in context
+                        stsSsnContext->Update(WSStarContextKeys::KBrandIDEnabled, ETrue);
+                    }
+                    else
+                    {
+                		TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarTrustClient::Brand ID Is Disabled");
+                        // co-branding - Add co branding details in context
+                        stsSsnContext->Update(WSStarContextKeys::KBrandIDEnabled, EFalse);
+                    }
+
+                }
+
+            }
+        }
+    
+    TBool cacheToken = ETrue;
+    const TBool* brandID = stsSsnContext->GetIntL(WSStarContextKeys::KBrandIDEnabled);
+    if(brandID && !(*brandID))
+    {
+    	cacheToken = EFalse;
+    	retVal = KErrSenBrandNotSupported;
+    }
+    
+    if(cacheToken)
+	{
+	//#endif//RD_SEN_CO_BRAND_SUPPORT	
+   #endif//RD_SEN_VTCP_SUPPORT
+//-----------------
+//4 building response    
+//-----------------
+    CWSStarRSTResponse* rstResponse = CWSStarRSTResponse::NewLC(FALSE, *iAppliesTo, iVersion);
+    rstResponse->SetPolicyVersion(&GetPolicyNs());
+    rstResponse->UpdateAddressingHoldersL(*stsSsnContext);
+    rstResponse->SetReader(*Framework().Manager().XMLReader());
+    //shouldnt be error, parsing is done earlier by core so we can be sure, that it is valid SOAP XML
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL - building RSTResponse");
+    rstResponse->BuildFrom(*responseXML);
+    
+    if (! iWSStarServiceSession->ExistConsumerL())
+        {
+        retVal = KErrNotFound;
+        }
+   else
+        {
+    iWSStarServiceSession->SetTrustAnchorL(iIdentityProvider->ProviderID());
+    if (rstResponse->IsResponse())
+        {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL - set ctx basing on RSTR");
+	            //const TBool* brandID = stsSsnContext->GetIntL(WSStarContextKeys::KBrandIDEnabled);
+	            TBool isWAPExists = CWSStarPolicy::CheckPolicyValueL(WSStarContextKeys::KWAPGW, iSTSSession);
+			#ifdef RD_SEN_VTCP_SUPPORT
+			//#ifdef RD_SEN_CO_BRAND_SUPPORT
+				if(isWAPExists && (brandID && *brandID))
+			#else
+        if(isWAPExists)
+      //#endif//RD_SEN_CO_BRAND_SUPPORT   
+			#endif//RD_SEN_VTCP_SUPPORT				
+	            {
+	                retVal = iWSStarServiceSession->SessionContext()->SetTokenKeysL(
+	                        *rstResponse, iEntropyClient,EFalse);                        
+	            }
+	            else
+	            {
+	                retVal = iWSStarServiceSession->SessionContext()->SetTokenKeysL(
+	                        *rstResponse, iEntropyClient,ETrue);
+	            }
+            iWSStarServiceSession->ActiveTicketObserverL();
+        //SetTokenKeys call indirectly SetStatus in order to signal session's consumers that connection is ready for sending                
+        if (retVal)
+            {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL - response from STS is wrong RSTR, maybe some nested Fault");
+                //CREDLOG_L(KSenCredsLogLevelNormal,".......failed, problem with RSTR analizing");
+            aErrorMessage = responseXML;
+					if (retVal == KErrNotFound)
+						{
+						retVal = KErrSenSoapFault;
+		                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel," ------- returning SOAP Fault for MS and clearing the credential if any");
+						iWSStarServiceSession->DetachCredentialsL();
+						}
+	                }
+            /*else
+                {
+                #ifdef _SENDEBUG
+                    _LIT8(KCredsLogLine, "...Token has been issued (period = %S - %S)");
+                    CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelNormal, KCredsLogLine,  &(rstResponse->CredentialCreated()),  &(rstResponse->CredentialExpires())));
+                 #endif           
+                }*/
+        }
+    else
+        {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::ValidateL - response from STS is not a proper RSTR");
+        aErrorMessage = responseXML;
+        retVal = KErrNotFound;
+        }
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel, _L8("CWSStarTrustClient::ValidateL - building session Ctx: %d"), retVal));
+       }
+  
+    CleanupStack::PopAndDestroy(rstResponse);
+#ifdef RD_SEN_VTCP_SUPPORT
+//#ifdef RD_SEN_CO_BRAND_SUPPORT
+	}
+//#endif//RD_SEN_CO_BRAND_SUPPORT	
+#endif//RD_SEN_VTCP_SUPPORT	
+    if (!aErrorMessage)
+        {
+        CleanupStack::PopAndDestroy(responseXML);
+        }
+    else
+        {
+        CleanupStack::Pop(responseXML);
+        }
+    if (! iTpCounter)
+        {
+        delete ipTransport;
+        ipTransport = NULL;
+        }
+    return retVal;
+    }
+
+
+
+//---------------------------------------------------------------------------
+// SetStatus
+//---------------------------------------------------------------------------
+//
+
+void CWSStarTrustClient::SetStatus(TInt /*aStatus */)
+    {
+    // No implementation in Java
+     }
+
+//---------------------------------------------------------------------------
+// SetAccount
+//---------------------------------------------------------------------------
+//
+void CWSStarTrustClient::SetAccount(
+                                    CSenIdentityProvider* aIdentityProvicer)
+    {
+    iIdentityProvider = aIdentityProvicer;
+    }
+/*CSenIdentityProvider* CWSStarTrustClient::Account()
+    {
+    return iIdentityProvider;
+    }*/
+/*TInt CWSStarTrustClient::SetProviderIdL(const TDesC8& aProviderID)
+    {
+    HBufC8* pNew = NULL;
+    if(aProviderID.Length()>0)
+        {
+        pNew = aProviderID.AllocL();
+        }
+    delete ipProviderId;
+    ipProviderId = pNew;
+    return KErrNone;
+    }
+TPtrC8 CWSStarTrustClient::ProviderId()
+    {
+    if(ipProviderId)
+        return *ipProviderId;
+    else
+        return KNullDesC8();
+    }*/
+
+//---------------------------------------------------------------------------
+// ServiceSession
+//---------------------------------------------------------------------------
+//
+CSenServiceSession* CWSStarTrustClient::ServiceSession()
+    {
+    return iWSStarServiceSession;
+    }
+
+//---------------------------------------------------------------------------
+// Obtain Transport using a factory from Core Manager
+//---------------------------------------------------------------------------
+//
+MSenTransport& CWSStarTrustClient::TransportL()
+    {
+    if(!ipTransport)
+        {
+        // Core is capable of working as transport factory, too.
+        // The returned transport instancies may or may not be
+        // ECOM plugins:
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::Instantiating new transport");
+        ipTransport = Framework().Manager().CreateL(*iSTSSession, iSTSSession); 
+        }
+    return *ipTransport;
+    }
+//---------------------------------------------------------------------------
+// SetSTSSessionL
+//---------------------------------------------------------------------------
+//
+void CWSStarTrustClient::SetSTSSessionL(
+                                                CWSStarServiceSession* aSession)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::SetServiceSessionL");
+    _LIT8(KTouch, "touch");
+    // free memory
+    //delete iSTSSession;
+    const TDesC8* attrValue = aSession->AsElement().AttrValue(KTouch);
+    if(attrValue != NULL)
+    	{
+    	AsElement().AddAttrL(KTouch, *attrValue);
+    	}
+    iSTSSession = aSession;
+    if(iSTSSession)
+        {
+        iSTSSession->AddConsumerL(*this);
+        }
+    }
+
+CWSStarServiceSession* CWSStarTrustClient::GetSTSSessionL()
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::SetServiceSessionL");
+    if(iSTSSession)
+        {
+        return iSTSSession;
+        }
+    else
+        {
+        return NULL;            
+        }
+}
+//---------------------------------------------------------------------------
+// Create body for STS request
+//---------------------------------------------------------------------------
+//
+CSenElement* CWSStarTrustClient::CreateBodyL()
+    {
+    HBufC8* value = const_cast<HBufC8*>(CWSStarPolicy::GetPolicyValueL(KIssuedToken, KRPSCluster, *iHndCtx, iSTSSession));
+    CleanupStack::PushL(value);    
+
+//-----------------
+//1 RST part (1st otken, proper one)
+//-----------------
+    CSenElement* specificRST = NULL;
+    if (value && iPassportMode)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::CreateBodyL - found cluster");
+        delete iAppliesTo;
+        iAppliesTo = NULL;
+        iAppliesTo = value;
+        specificRST = CreateRSTL(iRenewingMode, value->Des());
+        CleanupStack::Pop(value);        
+        value = NULL;
+        }
+    else
+        {
+        delete iAppliesTo;
+        iAppliesTo = NULL;
+        iAppliesTo = iWSStarServiceSession->Endpoint().AllocL();
+        specificRST = CreateRSTL(iRenewingMode, *iAppliesTo);
+        CleanupStack::PopAndDestroy(value);        
+        //Renewing - check from policy
+        //@Allow not specified, the default value is true.
+        //@OK not specified, the default value is false.
+        specificRST->AddElementL(*iVersion, KRenewingTag);    
+        }
+    CleanupStack::PushL(specificRST);
+
+//-----------------
+//2 entropy
+//-----------------
+    
+    if (CWSStarPolicy::CheckPolicyValueL(KClientEntropy, iSTSSession))
+        {
+        TRAPD(error, RandomEntropyClientL());
+        if (!error)
+            {
+            CSenElement& entrElement = specificRST->AddElementL(*iVersion, KEntropyTag);    
+            entrElement.AddElementL(*iVersion, KBinarySecretTag).SetContentL(*iEntropyClient);    
+            }
+        }
+
+//-----------------
+//3 excluding dynamic RST by RST template 
+//-----------------
+    delete iTokenType;
+    iTokenType = NULL;
+    iTokenType = CWSStarPolicy::GetPolicyValueL(WSPolicy::KTokenType, iSTSSession);
+    if (!iTokenType && iPassportMode)
+        {
+        iTokenType = WSPassport32::KDefaultTokenType().AllocL();
+        }
+        
+        
+    RPointerArray<CSenElement> elements;
+    if (iTokenType)
+        {
+/*#ifdef _RD_SEN_ENABLE_CREDLOG
+        _LIT8(KCredsLogLine, "Sending RST to STS to get new token (type %S)....");
+        CREDLOG_FORMAT((KSenCredsLogChannel, KSenCredsLogLevelNormal, KCredsLogLine,  tokenType));
+#endif        */
+        value  = CWSStarPolicy::GetPolicyValueL(*iTokenType, KIssuedToken, KRequestSecurityTokenTemplate, *iHndCtx, iSTSSession, elements);
+        }
+    else
+        {
+        value  = CWSStarPolicy::GetPolicyValueL(KIssuedToken, KRequestSecurityTokenTemplate, *iHndCtx, iSTSSession, elements);
+        }
+    if (!value)
+        {
+       	if (iTokenType)
+       	    {
+            specificRST->AddElementL(*iVersion, 
+                                KTokenTypeTag).SetContentL(*iTokenType);
+      	    }
+        }
+    else
+        {
+            TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,(*value));//in debug we dont have to push to cleanup stack
+            delete value;
+            value = NULL;
+            CleanupStack::PopAndDestroy(specificRST);
+            CSenDomFragment* domFrg = CSenDomFragment::NewL(*iVersion, 
+                                                    KRSTTag, 
+                                                    KRSTQTag);
+            CleanupStack::PushL(domFrg);
+            specificRST = domFrg->ExtractElement();
+            CleanupStack::PopAndDestroy(domFrg);
+            CleanupStack::PushL(specificRST);
+            
+            for (TInt i = 0; i<elements.Count(); i++ )
+                {
+                CSenDomFragment* rstTemplate = CSenDomFragment::NewL(*elements[i]);
+                CSenElement* rstTemplateEl = rstTemplate->ExtractElement();
+                delete rstTemplate;
+                rstTemplate = NULL;
+                CleanupStack::PushL(rstTemplateEl);
+                specificRST->AddElementL(*rstTemplateEl);
+                CleanupStack::Pop(rstTemplateEl);
+                }
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::CreateBodyL - added template");
+            }
+       
+     
+//-----------------
+//4 add passport RST (redundant info, but passport requires that)
+//      and enable multirequest
+//-----------------
+    if (!iPassportMode)
+        {
+        CleanupStack::Pop(specificRST);
+        return specificRST;
+        }
+    else
+        {
+        CSenElement* passportRST = CreateRSTL(EFalse, WSPassport32::KPassportAppliesTo());
+        CleanupStack::PushL(passportRST);
+        CSenDomFragment* domFrg = CSenDomFragment::NewL(WSStarContextKeys::KMultiReqTagMark);
+        CSenElement* reqMultiple = domFrg->ExtractElement();
+        delete domFrg;
+        CleanupStack::PushL(reqMultiple);
+        reqMultiple->AddElementL(*specificRST);
+        reqMultiple->AddElementL(*passportRST);
+        CleanupStack::Pop(3, specificRST);
+        return reqMultiple;
+        }
+    }
+//---------------------------------------------------------------------------
+// Create RST skeleton.
+//---------------------------------------------------------------------------
+//
+CSenElement* CWSStarTrustClient::CreateRSTL(TBool aRenewing, TPtrC8 aAppliesTo)
+    {
+    //whole logic for RST factory
+    TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("CWSStarTrustClient::CreateRST - appliesTo: %S"), &aAppliesTo));
+
+    CSenDomFragment* domFrg = CSenDomFragment::NewL(*iVersion, 
+                                                    KRSTTag, 
+                                                    KRSTQTag);
+    CSenElement* elementRst = domFrg->ExtractElement();
+    CleanupStack::PushL(elementRst);
+    delete domFrg;
+    domFrg = NULL;
+    elementRst->AddElementL(*iVersion, KRequestTypeTag).SetContentL(GetRequestType());
+    
+//__________ISSUE
+    if (!aRenewing)
+        {
+            CSenElement& applies = elementRst->AddElementL(GetPolicyNs(),
+                                                            KAppliesToTag,
+                                                            KAppliesToQTag);
+            SenXmlUtils::AddAttributeL(applies, WSStarContextKeys::KAddressAttrMark, aAppliesTo);
+        
+        }
+//__________RENEW
+    //in 7. Renewal Binding
+    //Other extensions MAY be specified in the request (and the response), but the key
+    //semantics (size, type, algorithms, scope, etc.) MUST NOT be altered during renewal.
+    else
+        {
+        CSenElement& el = elementRst->AddElementL(*iVersion, KRenewTargetTag);
+        const TDesC8* oldToken = iWSStarServiceSession->SessionContext()->GetDesC8L(WSStarContextKeys::KSecurityTokenBackup);
+        if (oldToken)
+            {
+            el.SetContentL(*oldToken);
+            }
+        }
+    CleanupStack::Pop(elementRst);
+    return elementRst;
+    }
+// End of file
+
+//---------------------------------------------------------------------------
+// Getter for endpoint
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarTrustClient::Endpoint()
+    {
+    return iSTSSession->Endpoint();
+    }
+//---------------------------------------------------------------------------
+// Getter for contract
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarTrustClient::Contract()
+    {
+    return iSTSSession->Contract();
+    }
+//---------------------------------------------------------------------------
+// Getter for providerId
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarTrustClient::ProviderID()
+    {
+    return iSTSSession->ProviderID();
+    }
+
+//---------------------------------------------------------------------------
+// Getter for framework
+//---------------------------------------------------------------------------
+//
+TPtrC8 CWSStarTrustClient::FrameworkId()
+    {
+    return iSTSSession->FrameworkId();
+    }
+//---------------------------------------------------------------------------
+// serialie to xml
+//---------------------------------------------------------------------------
+//
+void CWSStarTrustClient::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    iSTSSession->WriteAsXMLToL(aWriteStream);
+    }
+TInt CWSStarTrustClient::UpdatePolicyL(CWSStarPolicyHandler* aPolicyHandler, MSenServiceDescription* aSD)
+    {
+    return iSTSSession->UpdatePolicyL(aPolicyHandler, aSD);
+    }
+
+MSenServicePolicy* CWSStarTrustClient::ServicePolicy()
+    {
+    return iSTSSession->ServicePolicy();
+    }
+TInt CWSStarTrustClient::IapId(TUint32& aCurrentIapId)
+    {
+    return iSTSSession->IapId(aCurrentIapId);
+    }
+//---------------------------------------------------------------------------
+// randomize entropy for client
+//---------------------------------------------------------------------------
+//
+void CWSStarTrustClient::RandomEntropyClientL()
+    {
+    HBufC8* hashedRandom = SenCryptoUtils::RandomAndHashMd5LC();
+    iEntropyClient = SenCryptoUtils::EncodeBase64L(*hashedRandom);
+    CleanupStack::PopAndDestroy(hashedRandom);
+    if (!iEntropyClient)
+        {
+        User::Leave(KErrNotFound);
+        }
+    }
+//---------------------------------------------------------------------------
+// setter for ws-trust version
+//---------------------------------------------------------------------------
+//
+
+void CWSStarTrustClient::SetVersion(const TDesC8* aVersion)
+    {
+    iVersion = aVersion;
+    }
+    
+//---------------------------------------------------------------------------
+// getter for action (depends on version)
+//---------------------------------------------------------------------------
+//
+const TDesC8& CWSStarTrustClient::GetAction()
+    {
+    if (!iRenewingMode)
+        {
+        if (*iVersion == KTrustNamespace200502)
+            {
+            return KActionIssueRST200502;
+            }
+        else
+            {
+            return KActionIssueRST200404;   
+            }
+        }
+    else
+        {
+        if (*iVersion == KTrustNamespace200502)
+            {
+            return KActionRenewRST200502;      
+            }
+        else
+            {
+            return KActionRenewRST200404;
+            }
+        }
+    }
+//---------------------------------------------------------------------------
+// getter for action response (depends on version)
+//---------------------------------------------------------------------------
+//
+const TDesC8& CWSStarTrustClient::GetActionResponse()
+    {
+    if (!iRenewingMode)
+        {
+        if (*iVersion == KTrustNamespace200502)
+            {
+            return KActionIssueRSTR200502;
+            }
+        else
+            {
+            return KActionIssueRSTR200404;   
+            }
+        }
+    else
+        {
+        if (*iVersion == KTrustNamespace200502)
+            {
+            return KActionRenewRSTR200502;      
+            }
+        else
+            {
+            return KActionRenewRSTR200404;
+            }
+        }
+    }
+//---------------------------------------------------------------------------
+// getter for request type (depends on version)
+//---------------------------------------------------------------------------
+//
+    
+const TDesC8& CWSStarTrustClient::GetRequestType()
+    {
+    if (!iRenewingMode)
+        {
+        if (*iVersion == KTrustNamespace200502)
+            {
+            return KRequestTypeIssueRST200502;
+            }
+        else
+            {
+            return KRequestTypeIssueRST200404;   
+            }
+        }
+    else
+        {
+        if (*iVersion == KTrustNamespace200502)
+            {
+            return KRequestTypeRenewRST200502;      
+            }
+        else
+            {
+            return KRequestTypeRenewRST200404;
+            }
+        }
+    }
+//---------------------------------------------------------------------------
+// getter for policy namespace(depends on version)
+//---------------------------------------------------------------------------
+//
+
+const TDesC8& CWSStarTrustClient::GetPolicyNs()
+    {
+    if (*iVersion == KTrustNamespace200502)
+        {
+        return KPolicyNamespace200409;
+        }
+    else
+        {
+        return KPolicyNamespace200212 ;   
+        }
+    }
+
+TBool CWSStarTrustClient::HasSuperClass( TDescriptionClassType aType )
+    {
+    if( aType == MSenServiceDescription::ESenInternalServiceConsumer ) // direct superclass!
+        {
+        // If asked type is the know *direct* father/mother, return true:
+        return ETrue; 
+        } 
+    else
+        {
+        // Otherwise, ask from superclass (chain, recursively)
+        return CSenInternalServiceConsumer::HasSuperClass( aType ); 
+        }
+    }
+
+void CWSStarTrustClient::SetHandlerCtx(MSenHandlerContext* aHndCtx)
+    {
+    iHndCtx = aHndCtx;
+    }
+TBool CWSStarTrustClient::HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate)
+    {
+    TBool retVal(EFalse);
+    if ( CSenWSDescription::HasEqualPrimaryKeysL(aCandidate) )
+        {
+        // Endpoint, Contract and FrameworkID match, all of them.
+        // Now, in WS-*, also check ProviderID
+        if (aCandidate.DescriptionClassType() == DescriptionClassType())
+            {
+            CWSStarTrustClient& trustCandidate = (CWSStarTrustClient&)aCandidate;
+            if (trustCandidate.ProviderID() == ProviderID())
+                {
+                retVal = ETrue;
+                }
+            }
+        }
+    return retVal; 
+    }
+/*
+TBool CWSStarTrustClient::HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate)
+    {
+    TBool retVal(EFalse);
+    //if ( aCandidate.Endpoint() == Endpoint() &&  aCandidate.Contract() == Contract() && aCandidate.FrameworkId() == FrameworkId() )
+    if ( CSenWSDescription::HasEqualPrimaryKeysL(aCandidate) )
+        {
+        // Endpoint, Contract and FrameworkID match, all of them.
+        // Now, in WS-*, also check ProviderID
+        TPtrC8 providerID = ContentOf( WSStarSession::KProviderIdElementLocalName );
+        CSenWSDescription& xmlSD = (CSenWSDescription&)aCandidate;
+        CSenElement* idElement = xmlSD.AsElement().Element( WSStarSession::KProviderIdElementLocalName );
+        if ( idElement && idElement->Content() == providerID ) 
+            {
+            // candidate has ProviderID element, which is equal with this sessions's provider ID
+            retVal = ETrue;
+            }
+        }
+    return retVal;    
+    }
+*/
+
+void CWSStarTrustClient::AdaptStsEndpointL(TBool aToOrginal)	//codescannerwarnings
+    {
+    if (aToOrginal)
+        {
+        iSTSSession->SetEndPointL(*iSTSOrginalEndpoint);
+        return;
+        }
+    
+    delete iSTSOrginalEndpoint;
+    iSTSOrginalEndpoint = NULL;
+    iSTSOrginalEndpoint = iSTSSession->Endpoint().AllocL();        
+    HBufC8* address = NULL;
+    if (iTokenType)
+        {
+        address = CWSStarPolicy::GetPolicyValueL(*iTokenType, KIssuedToken, KAddress, *iHndCtx, iSTSSession);    
+        }
+    else
+        {
+        address = CWSStarPolicy::GetPolicyValueL(KIssuedToken, KAddress, *iHndCtx, iSTSSession);    
+        }
+    
+    if (address)
+        {
+        iSTSSession->SetEndPointL(*address);
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"CWSStarTrustClient::AdaptStsEndpoint() - endpoint replaced by value from policy");
+        }
+    delete address;
+    address = NULL;
+    }
+TBool CWSStarTrustClient::Matches(MSenServiceDescription& aOtherServiceDescription)
+    {
+    return iSTSSession->Matches(aOtherServiceDescription);
+    }
+void CWSStarTrustClient::SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) 		
+	{
+	iTrustDetails = aDetails;
+	}
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarplugin/src/wsstarvalidatehandler.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,310 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "wsstarvalidatehandler.h"
+#include "wsstartrustclient.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+class CWSStarHandlerContext;
+
+//---------------------------------------------------------------------------
+// Create instance of concrete ECOM interface implementation
+//---------------------------------------------------------------------------
+//
+CWSStarValidateHandler* CWSStarValidateHandler::NewL(TAny* aHandlerCtx)
+    {
+    
+    MSenHandlerContext* handlerCtx =
+        reinterpret_cast<MSenHandlerContext*>(aHandlerCtx);
+    CWSStarValidateHandler* self   = new (ELeave) CWSStarValidateHandler(*handlerCtx);
+    CleanupStack::PushL (self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+//---------------------------------------------------------------------------
+// Constructor
+//---------------------------------------------------------------------------
+//
+CWSStarValidateHandler::CWSStarValidateHandler(MSenHandlerContext& aCtx):CSenSessionHandler(aCtx)
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Destructor
+//---------------------------------------------------------------------------
+//
+CWSStarValidateHandler::~CWSStarValidateHandler()
+    {
+    }
+
+//---------------------------------------------------------------------------
+// Second phase construction.
+//---------------------------------------------------------------------------
+//
+void CWSStarValidateHandler::ConstructL()
+    {
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSStarValidateHandler::ConstructL()")));
+    const TDesC8* version = iHandlerContext.GetDesC8L(HandlerContextKey::KVersion);
+    if (version && 
+        (*version == WSTrust::KTrustNamespace200502 || *version == WSTrust::KTrustNamespace200404))
+        {
+        iVersion = version;
+        }
+    else
+        {
+        iVersion = &WSTrust::KTrustNamespace200502; //passport interface 2
+        //&WSTrust::KTrustNamespace200404;
+        }
+    }
+    
+
+//---------------------------------------------------------------------------
+// the most emergent method in message handler interface.
+// Each sub-class must implement this method thus providing message processing routine.
+//---------------------------------------------------------------------------
+//
+TInt CWSStarValidateHandler::InvokeL(MSenSessionContext& aCtx)
+    {
+
+//getting data from input
+    CWSStarServiceSession* pNewSession =
+            (CWSStarServiceSession*)aCtx.GetSenRemoteServiceSessionL(
+            WSStarContextKeys::KServiceSession());
+    if (pNewSession->ProviderID() == KNullDesC8)
+        {
+        return KErrNone;
+        }
+//try to find identity provider for curennt webService using its ProviderId
+    CSenIdentityProvider* pIdentityProvider = IdentityProviderFromCoreL(
+            pNewSession->ProviderID());
+    if (!pIdentityProvider)
+        {
+        return KErrNotFound;
+        }
+    
+    //in session context we have info
+    const TBool* renewingPtr = ((MSenContext&)aCtx).GetIntL(WSStarContextKeys::KReAuthNeeded);
+    TBool renewing;
+    if (renewingPtr)
+        {
+        renewing = *renewingPtr;
+        }
+    else
+        {
+        renewing = EFalse;
+        }
+    const TBool* onlySharingPtr = ((MSenContext&)aCtx).GetIntL(WSStarContextKeys::KOnlySharing);
+    TBool onlySharing;
+    if (onlySharingPtr)
+        {
+        onlySharing = *onlySharingPtr;
+        }
+    else
+        {
+        onlySharing = ETrue;
+        }
+    
+    CWSStarTrustClient* pSTSClient = STSClientL(pIdentityProvider);
+    if (pSTSClient)
+            {
+            TInt error(KErrNone);
+            pSTSClient->SetHandlerCtx(&iHandlerContext);
+            pSTSClient->SetVersion(iVersion);
+            //validate session of concrete WebService
+            HBufC8* errorMessage = NULL;
+             // fix for compiler warning #550-D reverted back
+            TRAPD(lerror,error = pSTSClient->ValidateL(*pNewSession, renewing, errorMessage, onlySharing);)    
+            lerror = 0; // not used in release builds
+            ((MSenContext&)aCtx).Update(WSStarContextKeys::KReAuthNeeded, EFalse);
+            if (errorMessage)
+                {
+                ((MSenContext&)aCtx).Update(WSStarContextKeys:: KErrMessage,  *errorMessage);
+                }
+            delete errorMessage;
+            errorMessage = NULL;
+            //if credential expired session will use validator to obtain new
+            
+            // Core / XML DAO takes ownership of new session (will keep in array of SD):
+            // - new session HAS
+            //      - credential
+            //      - context which keep for example key for signing message        
+            // - if duplicate (equal primary keys) exists, it is deleted
+            return error;
+            }
+       else
+            {
+            return KErrNotFound;
+            }
+    
+    }
+    
+SenHandler::THandlerDirection CWSStarValidateHandler::Direction() const
+    {
+        return SenHandler::EBoth;
+    };
+SenHandler::THandlerPhase CWSStarValidateHandler::Phase()
+    {
+        return SenHandler::EValidate;
+    };
+    
+//---------------------------------------------------------------------------
+// Obtain or construct STS client
+//---------------------------------------------------------------------------
+//
+  
+CWSStarTrustClient* CWSStarValidateHandler::STSClientL(CSenIdentityProvider*& aIdentityProvider)
+{
+    TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSStarPlugin::STSClientL")));
+
+    CWSStarTrustClient* pSTSClient = NULL;
+    //providerId from Identities.xml
+    TPtrC8 providerId(KNullDesC8);
+    if(aIdentityProvider)
+        {
+        providerId.Set(aIdentityProvider->ProviderID());
+        }
+
+    RPointerArray<CSenWSDescription> serviceDescriptions;
+    CleanupClosePushL(serviceDescriptions);
+        
+    //try to find STS session in cache,some STS can be registered
+    TInt retVal(KErrNone);
+    
+    TRAPD(error, retVal = iHandlerContext.GetSenCoreServiceManager()->ServiceDescriptionsL(serviceDescriptions, KWSStarSTSContract()));
+    if(!retVal&&!error)
+        {
+        RPointerArray<CSenWSDescription> matches;
+        CleanupClosePushL(matches);
+        
+        for(TInt i = 0; i < serviceDescriptions.Count(); i++)
+            {
+            //select XMLDescription from DAO where contract = STS, so we can cast
+            pSTSClient = (CWSStarTrustClient*)serviceDescriptions[i];
+            if(providerId.Length()>0)
+                {
+                TPtrC8 providerIDFromDescription = pSTSClient->ProviderID();
+                if(providerIDFromDescription == providerId)
+                    {
+                    matches.AppendL(pSTSClient);
+                    }
+                }
+            else
+                {
+                matches.AppendL(pSTSClient);
+                }
+            }
+        if(matches.Count())
+            {
+            pSTSClient =
+                reinterpret_cast<CWSStarTrustClient*>(matches[0]);
+            pSTSClient->SetAccount(aIdentityProvider);
+            }
+        else
+            {
+            TLSLOG(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,(_L("CWSStarValidateHandler::STSClient - No matching STS description available!")));
+            pSTSClient = NULL;
+            }
+    
+        //if we find multi sts client (different only with lifetime, probably Secure Context Token lifetime)
+        if(matches.Count() > 1)
+            {
+            // search for a instance with longest validity
+            for(TInt i = matches.Count()-1; i > 0 ; i--)
+                {
+                CWSStarTrustClient* pNewerSTSClient =
+                  reinterpret_cast<CWSStarTrustClient*>(matches[i]);
+                CWSStarServiceSession* newerSession = (CWSStarServiceSession*)pNewerSTSClient->ServiceSession();
+                CWSStarServiceSession* session = (CWSStarServiceSession*)pSTSClient->ServiceSession();
+                
+				if(newerSession && session) // STSClient Session was not set, if not validated 
+					{
+					if(newerSession->ValidUntilL() > session->ValidUntilL())
+					  	{
+					    pSTSClient = pNewerSTSClient;
+					    pSTSClient->SetAccount(aIdentityProvider);
+					    }
+					}
+                }
+            }
+            CleanupStack::PopAndDestroy(2, &serviceDescriptions);
+        }
+    else
+        {
+          CleanupStack::PopAndDestroy(&serviceDescriptions);
+        }
+    
+    
+    //no session, so we have create new STS client, temporary code 
+    // architects says:- Yes... You must have AS registered into DAO (DB) sessions db
+    /*if (!pSTSClient)
+        {
+        CSIF* sif = (CSIF*)iHandlerContext.GetAny(HandlerContextKey::KSIF());
+        pSTSClient = CWSStarTrustClient::NewL(*sif,*Log());
+        }*/
+    return pSTSClient;
+}
+
+//---------------------------------------------------------------------------
+// Create IdentityProvider from CoreManager
+//---------------------------------------------------------------------------
+//
+CSenIdentityProvider* CWSStarValidateHandler::IdentityProviderFromCoreL(
+                                            const TDesC8& aProviderID)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KNormalLogLevel,"CWSStarValidateHandler::IdentityProviderLFromCore");
+    CSenIdentityProvider* pIdentityProvider = NULL;
+    if(aProviderID.Length() > 0)
+        {
+        CDesC8ArrayFlat* array = new (ELeave) CDesC8ArrayFlat(1);
+        CleanupStack::PushL(array);
+        array->AppendL(aProviderID);
+        pIdentityProvider = iHandlerContext.GetSenCoreServiceManager()->
+                IdentityProviderL(*array, ETrue);
+        CleanupStack::PopAndDestroy(array);
+        }
+    return pIdentityProvider;
+    }
+
+//---------------------------------------------------------------------------
+// Init implementation
+//---------------------------------------------------------------------------
+//
+TInt CWSStarValidateHandler::InitL(MSenHandlerContext& aCtx)
+    {
+    iHandlerContext = aCtx;
+    return KErrNone;
+    }
+RFileLogger* CWSStarValidateHandler::Log() const
+    {
+    RFileLogger* pLog = NULL;
+    TRAP_IGNORE( pLog = (RFileLogger*)iHandlerContext.GetAnyL(HandlerContextKey::KLogger); )
+    return pLog;
+    }
+    
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/BWINSCW/WsPolicyU.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+EXPORTS
+	??0CWSPolicy@@AAE@XZ @ 1 NONAME ; CWSPolicy::CWSPolicy(void)
+	??1CExpiredPolicy@@UAE@XZ @ 2 NONAME ; CExpiredPolicy::~CExpiredPolicy(void)
+	??1CSenWSPolicyManager@@UAE@XZ @ 3 NONAME ; CSenWSPolicyManager::~CSenWSPolicyManager(void)
+	?AddPolicyConsumerL@CSenWSPolicyManager@@QAEHABVTDesC8@@0@Z @ 4 NONAME ; int CSenWSPolicyManager::AddPolicyConsumerL(class TDesC8 const &, class TDesC8 const &)
+	?AddWsPolicyL@CSenWSPolicyManager@@QAEHPAVCSenWSDescription@@ABVTDesC8@@1AAH@Z @ 5 NONAME ; int CSenWSPolicyManager::AddWsPolicyL(class CSenWSDescription *, class TDesC8 const &, class TDesC8 const &, int &)
+	?ConstructL@CWSPolicy@@AAEXXZ @ 6 NONAME ; void CWSPolicy::ConstructL(void)
+	?Contents@CExpiredPolicy@@QAE?AVTPtrC8@@XZ @ 7 NONAME ; class TPtrC8 CExpiredPolicy::Contents(void)
+	?Contract@CExpiredPolicy@@QAE?AVTPtrC8@@XZ @ 8 NONAME ; class TPtrC8 CExpiredPolicy::Contract(void)
+	?Endpoint@CExpiredPolicy@@QAE?AVTPtrC8@@XZ @ 9 NONAME ; class TPtrC8 CExpiredPolicy::Endpoint(void)
+	?ExpiredPoliciesL@CSenWSPolicyManager@@QAEHAAV?$RPointerArray@VCExpiredPolicy@@@@AAH@Z @ 10 NONAME ; int CSenWSPolicyManager::ExpiredPoliciesL(class RPointerArray<class CExpiredPolicy> &, int &)
+	?IntersectPolicyL@CWSPolicy@@QAEPAV1@PAV1@@Z @ 11 NONAME ; class CWSPolicy * CWSPolicy::IntersectPolicyL(class CWSPolicy *)
+	?IsExpiredPolicyL@CWSPolicy@@QAEHXZ @ 12 NONAME ; int CWSPolicy::IsExpiredPolicyL(void)
+	?IsExpiredPolicyL@CWSPolicyUtils@@SAHPAVCSenElement@@@Z @ 13 NONAME ; int CWSPolicyUtils::IsExpiredPolicyL(class CSenElement *)
+	?LookupPolicy@CPolicyRegistry@@QAEPAVCSenElement@@ABVTPtrC8@@@Z @ 14 NONAME ; class CSenElement * CPolicyRegistry::LookupPolicy(class TPtrC8 const &)
+	?LookupPolicyByNameL@CPolicyRegistry@@QAEPAVCSenElement@@ABVTPtrC8@@@Z @ 15 NONAME ; class CSenElement * CPolicyRegistry::LookupPolicyByNameL(class TPtrC8 const &)
+	?MergePolicyL@CWSPolicy@@QAEPAV1@PAV1@@Z @ 16 NONAME ; class CWSPolicy * CWSPolicy::MergePolicyL(class CWSPolicy *)
+	?NewL@CExpiredPolicy@@SAPAV1@ABVTDesC8@@000@Z @ 17 NONAME ; class CExpiredPolicy * CExpiredPolicy::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CPolicyRegistry@@SAPAV1@XZ @ 18 NONAME ; class CPolicyRegistry * CPolicyRegistry::NewL(void)
+	?NewL@CSenWSPolicyManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 19 NONAME ; class CSenWSPolicyManager * CSenWSPolicyManager::NewL(class MSenCoreServiceManager &)
+	?NewL@CWSPolicy@@SAPAV1@AAVTDesC8@@0@Z @ 20 NONAME ; class CWSPolicy * CWSPolicy::NewL(class TDesC8 &, class TDesC8 &)
+	?NewL@CWSPolicy@@SAPAV1@PAVCSenElement@@@Z @ 21 NONAME ; class CWSPolicy * CWSPolicy::NewL(class CSenElement *)
+	?NewL@CWSPolicy@@SAPAV1@XZ @ 22 NONAME ; class CWSPolicy * CWSPolicy::NewL(void)
+	?NewLC@CExpiredPolicy@@SAPAV1@ABVTDesC8@@000@Z @ 23 NONAME ; class CExpiredPolicy * CExpiredPolicy::NewLC(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CPolicyRegistry@@SAPAV1@XZ @ 24 NONAME ; class CPolicyRegistry * CPolicyRegistry::NewLC(void)
+	?NewLC@CSenWSPolicyManager@@SAPAV1@AAVMSenCoreServiceManager@@@Z @ 25 NONAME ; class CSenWSPolicyManager * CSenWSPolicyManager::NewLC(class MSenCoreServiceManager &)
+	?NewLC@CWSPolicy@@SAPAV1@AAVTDesC8@@0@Z @ 26 NONAME ; class CWSPolicy * CWSPolicy::NewLC(class TDesC8 &, class TDesC8 &)
+	?NewLC@CWSPolicy@@SAPAV1@PAVCSenElement@@@Z @ 27 NONAME ; class CWSPolicy * CWSPolicy::NewLC(class CSenElement *)
+	?NewLC@CWSPolicy@@SAPAV1@XZ @ 28 NONAME ; class CWSPolicy * CWSPolicy::NewLC(void)
+	?NonNormalizedPolicyL@CWSPolicy@@QAEPAVCSenElement@@XZ @ 29 NONAME ; class CSenElement * CWSPolicy::NonNormalizedPolicyL(void)
+	?NormalizePolicyL@CWSPolicy@@QAEHPAVCPolicyRegistry@@@Z @ 30 NONAME ; int CWSPolicy::NormalizePolicyL(class CPolicyRegistry *)
+	?Normalized@CWSPolicy@@QAEHXZ @ 31 NONAME ; int CWSPolicy::Normalized(void)
+	?Parent@CPolicyRegistry@@QAEPAV1@XZ @ 32 NONAME ; class CPolicyRegistry * CPolicyRegistry::Parent(void)
+	?PolicyAsXmlL@CWSPolicy@@QAEPAVHBufC8@@XZ @ 33 NONAME ; class HBufC8 * CWSPolicy::PolicyAsXmlL(void)
+	?PolicyIdL@CWSPolicyUtils@@SA?AVTPtrC8@@PAVCSenElement@@@Z @ 34 NONAME ; class TPtrC8 CWSPolicyUtils::PolicyIdL(class CSenElement *)
+	?PolicyL@CWSPolicy@@QAEPAVCSenElement@@XZ @ 35 NONAME ; class CSenElement * CWSPolicy::PolicyL(void)
+	?PolicyNameL@CWSPolicyUtils@@SA?AVTPtrC8@@PAVCSenElement@@@Z @ 36 NONAME ; class TPtrC8 CWSPolicyUtils::PolicyNameL(class CSenElement *)
+	?PolicyUriL@CWSPolicyUtils@@SA?AVTPtrC8@@PAVCSenElement@@@Z @ 37 NONAME ; class TPtrC8 CWSPolicyUtils::PolicyUriL(class CSenElement *)
+	?PopulateRegistryL@CPolicyRegistry@@QAEXPAVCSenElement@@@Z @ 38 NONAME ; void CPolicyRegistry::PopulateRegistryL(class CSenElement *)
+	?RegisterPolicy@CPolicyRegistry@@QAEXAAVTDesC8@@PAVCSenElement@@@Z @ 39 NONAME ; void CPolicyRegistry::RegisterPolicy(class TDesC8 &, class CSenElement *)
+	?RegisterWsPolicyL@CSenWSPolicyManager@@QAEHPAVCSenWSDescription@@AAH@Z @ 40 NONAME ; int CSenWSPolicyManager::RegisterWsPolicyL(class CSenWSDescription *, int &)
+	?RemovePolicyConsumerL@CSenWSPolicyManager@@QAEHABVTDesC8@@0@Z @ 41 NONAME ; int CSenWSPolicyManager::RemovePolicyConsumerL(class TDesC8 const &, class TDesC8 const &)
+	?RemoveWsPolicyL@CSenWSPolicyManager@@QAEHPAVCSenWSDescription@@ABVTDesC8@@AAH@Z @ 42 NONAME ; int CSenWSPolicyManager::RemoveWsPolicyL(class CSenWSDescription *, class TDesC8 const &, int &)
+	?ResetRegistry@CPolicyRegistry@@QAEXXZ @ 43 NONAME ; void CPolicyRegistry::ResetRegistry(void)
+	?SetContentsL@CExpiredPolicy@@QAEHABVTDesC8@@@Z @ 44 NONAME ; int CExpiredPolicy::SetContentsL(class TDesC8 const &)
+	?SetParent@CPolicyRegistry@@QAEXPAV1@@Z @ 45 NONAME ; void CPolicyRegistry::SetParent(class CPolicyRegistry *)
+	?SetPolicyL@CWSPolicy@@QAEHAAVTDesC8@@0@Z @ 46 NONAME ; int CWSPolicy::SetPolicyL(class TDesC8 &, class TDesC8 &)
+	?UnRegisterWsPolicyL@CSenWSPolicyManager@@QAEHPAVCSenWSDescription@@AAH@Z @ 47 NONAME ; int CSenWSPolicyManager::UnRegisterWsPolicyL(class CSenWSDescription *, int &)
+	?UnregisterPolicy@CPolicyRegistry@@QAEXABVTPtrC8@@@Z @ 48 NONAME ; void CPolicyRegistry::UnregisterPolicy(class TPtrC8 const &)
+	?Uri@CExpiredPolicy@@QAE?AVTPtrC8@@XZ @ 49 NONAME ; class TPtrC8 CExpiredPolicy::Uri(void)
+	?WsPolicyL@CSenWSPolicyManager@@QAEPAVCSenElement@@PAVCSenWSDescription@@ABVTDesC8@@AAH@Z @ 50 NONAME ; class CSenElement * CSenWSPolicyManager::WsPolicyL(class CSenWSDescription *, class TDesC8 const &, int &)
+	?GetEffectiveOutputPolicyL@CWsdlPolicyAttachment@@QAEPAVCSenElement@@ABVTDesC8@@00@Z @ 51 NONAME ; class CSenElement * CWsdlPolicyAttachment::GetEffectiveOutputPolicyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?GetEffectiveServicePolicyL@CWsdlPolicyAttachment@@QAEPAVCSenElement@@ABVTDesC8@@@Z @ 52 NONAME ; class CSenElement * CWsdlPolicyAttachment::GetEffectiveServicePolicyL(class TDesC8 const &)
+	?GetEffectiveOperationPolicyL@CWsdlPolicyAttachment@@QAEPAVCSenElement@@ABVTDesC8@@00@Z @ 53 NONAME ; class CSenElement * CWsdlPolicyAttachment::GetEffectiveOperationPolicyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CWsdlPolicyAttachment@@SAPAV1@ABVTDesC8@@@Z @ 54 NONAME ; class CWsdlPolicyAttachment * CWsdlPolicyAttachment::NewLC(class TDesC8 const &)
+	?NewL@CWsdlPolicyAttachment@@SAPAV1@ABVTDesC8@@@Z @ 55 NONAME ; class CWsdlPolicyAttachment * CWsdlPolicyAttachment::NewL(class TDesC8 const &)
+	?GetEffectiveInputPolicyL@CWsdlPolicyAttachment@@QAEPAVCSenElement@@ABVTDesC8@@00@Z @ 56 NONAME ; class CSenElement * CWsdlPolicyAttachment::GetEffectiveInputPolicyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?GetEffectiveFaultPolicyL@CWsdlPolicyAttachment@@QAEPAVCSenElement@@ABVTDesC8@@0@Z @ 57 NONAME ; class CSenElement * CWsdlPolicyAttachment::GetEffectiveFaultPolicyL(class TDesC8 const &, class TDesC8 const &)
+	?GetEffectiveEndpointPolicyL@CWsdlPolicyAttachment@@QAEPAVCSenElement@@ABVTDesC8@@0@Z @ 58 NONAME ; class CSenElement * CWsdlPolicyAttachment::GetEffectiveEndpointPolicyL(class TDesC8 const &, class TDesC8 const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/data/101f9722.rss	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Resource definitions for project WSStarMessageHandlers
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+#include <ecom/RegistryInfo.rh>
+
+// RESOURCE DEFINITIONS
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x101F9722;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented (Message Handler Interface)
+            interface_uid = 0x20000394;
+            implementations = 
+                {
+                // Enveloper handler
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x101F9723;
+                    version_no         = 1;
+                    display_name       = "WSStar Policy";
+                    default_data       = "urn:com.nokia.ws.wsstar.handler.policy:1.0";
+                    opaque_data        = "";
+                    }
+                
+                };
+            }
+        };
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/eabi/WsPolicyu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,149 @@
+EXPORTS
+	_ZN14CExpiredPolicy12SetContentsLERK6TDesC8 @ 1 NONAME
+	_ZN14CExpiredPolicy3UriEv @ 2 NONAME
+	_ZN14CExpiredPolicy4NewLERK6TDesC8S2_S2_S2_ @ 3 NONAME
+	_ZN14CExpiredPolicy5NewLCERK6TDesC8S2_S2_S2_ @ 4 NONAME
+	_ZN14CExpiredPolicy8ContentsEv @ 5 NONAME
+	_ZN14CExpiredPolicy8ContractEv @ 6 NONAME
+	_ZN14CExpiredPolicy8EndpointEv @ 7 NONAME
+	_ZN14CExpiredPolicyD0Ev @ 8 NONAME
+	_ZN14CExpiredPolicyD1Ev @ 9 NONAME
+	_ZN14CExpiredPolicyD2Ev @ 10 NONAME
+	_ZN14CWSPolicyUtils10PolicyUriLEP11CSenElement @ 11 NONAME
+	_ZN14CWSPolicyUtils11PolicyNameLEP11CSenElement @ 12 NONAME
+	_ZN14CWSPolicyUtils16IsExpiredPolicyLEP11CSenElement @ 13 NONAME
+	_ZN14CWSPolicyUtils9PolicyIdLEP11CSenElement @ 14 NONAME
+	_ZN15CPolicyRegistry12LookupPolicyERK6TPtrC8 @ 15 NONAME
+	_ZN15CPolicyRegistry13ResetRegistryEv @ 16 NONAME
+	_ZN15CPolicyRegistry14RegisterPolicyER6TDesC8P11CSenElement @ 17 NONAME
+	_ZN15CPolicyRegistry16UnregisterPolicyERK6TPtrC8 @ 18 NONAME
+	_ZN15CPolicyRegistry17PopulateRegistryLEP11CSenElement @ 19 NONAME
+	_ZN15CPolicyRegistry19LookupPolicyByNameLERK6TPtrC8 @ 20 NONAME
+	_ZN15CPolicyRegistry4NewLEv @ 21 NONAME
+	_ZN15CPolicyRegistry5NewLCEv @ 22 NONAME
+	_ZN15CPolicyRegistry6ParentEv @ 23 NONAME
+	_ZN15CPolicyRegistry9SetParentEPS_ @ 24 NONAME
+	_ZN19CSenWSPolicyManager12AddWsPolicyLEP17CSenWSDescriptionRK6TDesC8S4_Ri @ 25 NONAME
+	_ZN19CSenWSPolicyManager15RemoveWsPolicyLEP17CSenWSDescriptionRK6TDesC8Ri @ 26 NONAME
+	_ZN19CSenWSPolicyManager16ExpiredPoliciesLER13RPointerArrayI14CExpiredPolicyERi @ 27 NONAME
+	_ZN19CSenWSPolicyManager17RegisterWsPolicyLEP17CSenWSDescriptionRi @ 28 NONAME
+	_ZN19CSenWSPolicyManager18AddPolicyConsumerLERK6TDesC8S2_ @ 29 NONAME
+	_ZN19CSenWSPolicyManager19UnRegisterWsPolicyLEP17CSenWSDescriptionRi @ 30 NONAME
+	_ZN19CSenWSPolicyManager21RemovePolicyConsumerLERK6TDesC8S2_ @ 31 NONAME
+	_ZN19CSenWSPolicyManager4NewLER22MSenCoreServiceManager @ 32 NONAME
+	_ZN19CSenWSPolicyManager5NewLCER22MSenCoreServiceManager @ 33 NONAME
+	_ZN19CSenWSPolicyManager9WsPolicyLEP17CSenWSDescriptionRK6TDesC8Ri @ 34 NONAME
+	_ZN19CSenWSPolicyManagerD0Ev @ 35 NONAME
+	_ZN19CSenWSPolicyManagerD1Ev @ 36 NONAME
+	_ZN19CSenWSPolicyManagerD2Ev @ 37 NONAME
+	_ZN9CWSPolicy10ConstructLEv @ 38 NONAME
+	_ZN9CWSPolicy10NormalizedEv @ 39 NONAME
+	_ZN9CWSPolicy10SetPolicyLER6TDesC8S1_ @ 40 NONAME
+	_ZN9CWSPolicy12MergePolicyLEPS_ @ 41 NONAME
+	_ZN9CWSPolicy12PolicyAsXmlLEv @ 42 NONAME
+	_ZN9CWSPolicy16IntersectPolicyLEPS_ @ 43 NONAME
+	_ZN9CWSPolicy16IsExpiredPolicyLEv @ 44 NONAME
+	_ZN9CWSPolicy16NormalizePolicyLEP15CPolicyRegistry @ 45 NONAME
+	_ZN9CWSPolicy20NonNormalizedPolicyLEv @ 46 NONAME
+	_ZN9CWSPolicy4NewLEP11CSenElement @ 47 NONAME
+	_ZN9CWSPolicy4NewLER6TDesC8S1_ @ 48 NONAME
+	_ZN9CWSPolicy4NewLEv @ 49 NONAME
+	_ZN9CWSPolicy5NewLCEP11CSenElement @ 50 NONAME
+	_ZN9CWSPolicy5NewLCER6TDesC8S1_ @ 51 NONAME
+	_ZN9CWSPolicy5NewLCEv @ 52 NONAME
+	_ZN9CWSPolicy7PolicyLEv @ 53 NONAME
+	_ZN9CWSPolicyC1Ev @ 54 NONAME
+	_ZN9CWSPolicyC2Ev @ 55 NONAME
+	_ZTI10CAssertion @ 56 NONAME ; #<TI>#
+	_ZTI14CExpiredPolicy @ 57 NONAME ; #<TI>#
+	_ZTI15CPolicyRegistry @ 58 NONAME ; #<TI>#
+	_ZTI15CWSPolicyReader @ 59 NONAME ; #<TI>#
+	_ZTI15CWSPolicyWriter @ 60 NONAME ; #<TI>#
+	_ZTI16CPolicyAssertion @ 61 NONAME ; #<TI>#
+	_ZTI18CConsumerContainer @ 62 NONAME ; #<TI>#
+	_ZTI18CSenWSPolicyLoader @ 63 NONAME ; #<TI>#
+	_ZTI19CPrimitiveAssertion @ 64 NONAME ; #<TI>#
+	_ZTI19CSenWSPolicyManager @ 65 NONAME ; #<TI>#
+	_ZTI20CSenInternalWsPolicy @ 66 NONAME ; #<TI>#
+	_ZTI22CAndCompositeAssertion @ 67 NONAME ; #<TI>#
+	_ZTI22CSenWSPolicyIdentifier @ 68 NONAME ; #<TI>#
+	_ZTI22CSenWSPolicyProperties @ 69 NONAME ; #<TI>#
+	_ZTI22CXorCompositeAssertion @ 70 NONAME ; #<TI>#
+	_ZTI25CPolicyReferenceAssertion @ 71 NONAME ; #<TI>#
+	_ZTI26CNormalizedPolicyConatiner @ 72 NONAME ; #<TI>#
+	_ZTI6CMyXml @ 73 NONAME ; #<TI>#
+	_ZTI6CQName @ 74 NONAME ; #<TI>#
+	_ZTI9CWSPolicy @ 75 NONAME ; #<TI>#
+	_ZTV10CAssertion @ 76 NONAME ; #<VT>#
+	_ZTV14CExpiredPolicy @ 77 NONAME ; #<VT>#
+	_ZTV15CPolicyRegistry @ 78 NONAME ; #<VT>#
+	_ZTV15CWSPolicyReader @ 79 NONAME ; #<VT>#
+	_ZTV15CWSPolicyWriter @ 80 NONAME ; #<VT>#
+	_ZTV16CPolicyAssertion @ 81 NONAME ; #<VT>#
+	_ZTV18CConsumerContainer @ 82 NONAME ; #<VT>#
+	_ZTV18CSenWSPolicyLoader @ 83 NONAME ; #<VT>#
+	_ZTV19CPrimitiveAssertion @ 84 NONAME ; #<VT>#
+	_ZTV19CSenWSPolicyManager @ 85 NONAME ; #<VT>#
+	_ZTV20CSenInternalWsPolicy @ 86 NONAME ; #<VT>#
+	_ZTV22CAndCompositeAssertion @ 87 NONAME ; #<VT>#
+	_ZTV22CSenWSPolicyIdentifier @ 88 NONAME ; #<VT>#
+	_ZTV22CSenWSPolicyProperties @ 89 NONAME ; #<VT>#
+	_ZTV22CXorCompositeAssertion @ 90 NONAME ; #<VT>#
+	_ZTV25CPolicyReferenceAssertion @ 91 NONAME ; #<VT>#
+	_ZTV26CNormalizedPolicyConatiner @ 92 NONAME ; #<VT>#
+	_ZTV6CMyXml @ 93 NONAME ; #<VT>#
+	_ZTV6CQName @ 94 NONAME ; #<VT>#
+	_ZTV9CWSPolicy @ 95 NONAME ; #<VT>#
+	_ZN21CWsdlPolicyAttachment24GetEffectiveFaultPolicyLERK6TDesC8S2_ @ 96 NONAME
+	_ZN21CWsdlPolicyAttachment24GetEffectiveInputPolicyLERK6TDesC8S2_S2_ @ 97 NONAME
+	_ZN21CWsdlPolicyAttachment25GetEffectiveOutputPolicyLERK6TDesC8S2_S2_ @ 98 NONAME
+	_ZN21CWsdlPolicyAttachment26GetEffectiveServicePolicyLERK6TDesC8 @ 99 NONAME
+	_ZN21CWsdlPolicyAttachment27GetEffectiveEndpointPolicyLERK6TDesC8S2_ @ 100 NONAME
+	_ZN21CWsdlPolicyAttachment28GetEffectiveOperationPolicyLERK6TDesC8S2_S2_ @ 101 NONAME
+	_ZN21CWsdlPolicyAttachment4NewLERK6TDesC8 @ 102 NONAME
+	_ZN21CWsdlPolicyAttachment5NewLCERK6TDesC8 @ 103 NONAME
+	_ZTI10CSamlToken @ 104 NONAME ; #<TI>#
+	_ZTI10CWsTrust10 @ 105 NONAME ; #<TI>#
+	_ZTI11CHttpsToken @ 106 NONAME ; #<TI>#
+	_ZTI12CIssuedToken @ 107 NONAME ; #<TI>#
+	_ZTI12CTokenHolder @ 108 NONAME ; #<TI>#
+	_ZTI14CUsernameToken @ 109 NONAME ; #<TI>#
+	_ZTI15CAlgorithmSuite @ 110 NONAME ; #<TI>#
+	_ZTI16CTranportBinding @ 111 NONAME ; #<TI>#
+	_ZTI17CSymmAsymmBinding @ 112 NONAME ; #<TI>#
+	_ZTI17CSymmetricBinding @ 113 NONAME ; #<TI>#
+	_ZTI17CWsSecurityPolicy @ 114 NONAME ; #<TI>#
+	_ZTI18CAsymmetricBinding @ 115 NONAME ; #<TI>#
+	_ZTI21CEncryptedSignedParts @ 116 NONAME ; #<TI>#
+	_ZTI21CWsdlPolicyAttachment @ 117 NONAME ; #<TI>#
+	_ZTI24CEncryptedSignedElements @ 118 NONAME ; #<TI>#
+	_ZTI24CSecureConversationToken @ 119 NONAME ; #<TI>#
+	_ZTI29CRequestSecurityTokenTemplate @ 120 NONAME ; #<TI>#
+	_ZTI6CToken @ 121 NONAME ; #<TI>#
+	_ZTI6CWss10 @ 122 NONAME ; #<TI>#
+	_ZTI6CWss11 @ 123 NONAME ; #<TI>#
+	_ZTI7CLayout @ 124 NONAME ; #<TI>#
+	_ZTI8CBinding @ 125 NONAME ; #<TI>#
+	_ZTV10CSamlToken @ 126 NONAME ; #<VT>#
+	_ZTV10CWsTrust10 @ 127 NONAME ; #<VT>#
+	_ZTV11CHttpsToken @ 128 NONAME ; #<VT>#
+	_ZTV12CIssuedToken @ 129 NONAME ; #<VT>#
+	_ZTV12CTokenHolder @ 130 NONAME ; #<VT>#
+	_ZTV14CUsernameToken @ 131 NONAME ; #<VT>#
+	_ZTV15CAlgorithmSuite @ 132 NONAME ; #<VT>#
+	_ZTV16CTranportBinding @ 133 NONAME ; #<VT>#
+	_ZTV17CSymmAsymmBinding @ 134 NONAME ; #<VT>#
+	_ZTV17CSymmetricBinding @ 135 NONAME ; #<VT>#
+	_ZTV17CWsSecurityPolicy @ 136 NONAME ; #<VT>#
+	_ZTV18CAsymmetricBinding @ 137 NONAME ; #<VT>#
+	_ZTV21CEncryptedSignedParts @ 138 NONAME ; #<VT>#
+	_ZTV21CWsdlPolicyAttachment @ 139 NONAME ; #<VT>#
+	_ZTV24CEncryptedSignedElements @ 140 NONAME ; #<VT>#
+	_ZTV24CSecureConversationToken @ 141 NONAME ; #<VT>#
+	_ZTV29CRequestSecurityTokenTemplate @ 142 NONAME ; #<VT>#
+	_ZTV6CToken @ 143 NONAME ; #<VT>#
+	_ZTV6CWss10 @ 144 NONAME ; #<VT>#
+	_ZTV6CWss11 @ 145 NONAME ; #<VT>#
+	_ZTV7CLayout @ 146 NONAME ; #<VT>#
+	_ZTV8CBinding @ 147 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Build information file for wsstarpolicy 
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+PRJ_EXPORTS
+../rom/wsstarpolicy.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsstarpolicy.iby)
+PRJ_MMPFILES
+
+wspolicy.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/group/wspolicy.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Project specification file for wspolicy   
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "../../../inc/webservices.hrh"
+
+
+TARGETTYPE    DLL
+//DLL recognition UID followed by the unique UID for this dll
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET WSPolicy.dll
+UID 0x10009D8D 0x101F9795
+#else
+TARGET wsstarpolicy.dll
+UID 0x10009D8D 0x10282C47
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+#if defined(ARMCC)
+  DEFFILE     ../eabi/WsPolicy.def
+#elif defined(WINSCW)
+  DEFFILE     ../BWINSCW/WsPolicy.def
+#elif defined(WINS)
+  DEFFILE     ../BWINS/WsPolicy.def
+#else 
+  DEFFILE     ../BMARM/WsPolicy.def
+#endif
+
+SOURCEPATH    ../src
+SOURCE				 assertion.cpp
+SOURCE				 andcompositeassertion.cpp
+SOURCE				 compositeassertion.cpp
+SOURCE				 policyassertion.cpp
+SOURCE				 primitiveassertion.cpp
+SOURCE				 xorcompositeassertion.cpp
+SOURCE				 policyreferenceassertion.cpp
+
+SOURCE				 wspolicyreader.cpp
+SOURCE				 wspolicywriter.cpp
+SOURCE				 wspolicyutils.cpp
+SOURCE 				 wspolicy.cpp
+
+SOURCE				WsdlPolicyAttachment.cpp
+SOURCE				WsSecurityPolicy.cpp //WS SecurityPolicy
+SOURCE				wspolicyregistry.cpp
+
+SOURCE 				seninternalwspolicy.cpp
+SOURCE				senwspolicymanager.cpp
+
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../../inc
+
+
+USERINCLUDE   ../inc 
+USERINCLUDE   ../../../wsutils/inc
+USERINCLUDE   ../../../wslogger/inc
+USERINCLUDE   ../../../wsframework/inc         // MSenCoreServiceManager.h
+USERINCLUDE   ../../../wsidentitymanager/inc   // MSenIdentityManager.h <= needed by MSenCoreServiceManager.h
+USERINCLUDE   ../../../wscore/inc              // MSenDAO.h (friend class)
+USERINCLUDE   ../../../wsdescription/inc   
+USERINCLUDE 	../../../wsxml/inc								//senxmldebug.h
+
+SYSTEMINCLUDE /epoc32/include/ecom
+SYSTEMINCLUDE /epoc32/include/libc
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY SenUtils.lib
+LIBRARY SenXml.lib
+LIBRARY SenLogger.lib
+LIBRARY SenFragment.lib
+LIBRARY senlogger.lib
+#else
+LIBRARY wslogger.lib 
+LIBRARY wsUtils.lib
+LIBRARY wsXml.lib
+LIBRARY wsLogger.lib
+LIBRARY wsFragment.lib
+#endif
+// Symbian XML framework is used since S60 3rd edition (3.0)
+LIBRARY         XMLFRAMEWORK.lib
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY         XmlEngineDOM.lib
+    LIBRARY         XmlEngineUtils.lib
+    LIBRARY         XmlEngine.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+    LIBRARY         WsStarXmlEngine.lib
+#endif
+
+// System libs
+LIBRARY         euser.lib
+LIBRARY         estlib.lib 
+LIBRARY         efsrv.lib   // for RFs
+LIBRARY         estor.lib   // for RFileWriteStream
+LIBRARY         sysutil.lib // sysutil.h
+LIBRARY         flogger.lib
+LIBRARY         bafl.lib    // RStringbase
+
+SMPSAFE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/andcompositeassertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef C_AND_COMPOSITE_ASSERTION_H
+#define C_AND_COMPOSITE_ASSERTION_H
+
+
+#include "assertion.h"
+
+class CAndCompositeAssertion : public CAssertion
+{
+public:
+    static  CAndCompositeAssertion* NewL();
+    static  CAndCompositeAssertion* NewLC();
+    static  CAndCompositeAssertion* NewL(CAndCompositeAssertion* aValue);
+    static  CAndCompositeAssertion* NewLC(CAndCompositeAssertion* aValue);
+    
+    virtual ~CAndCompositeAssertion();
+//from CAssertion
+    virtual  TAssertionType Type();
+    virtual  void           AddTerm(MAssertion* aAssertion);
+    virtual  void 	        AddTermCopyL(MAssertion* aAssertion);    
+    virtual  MAssertion* 	NormalizeL(CPolicyRegistry* aRegistry);         
+    virtual  MAssertion* IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual  MAssertion* 	MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+ 
+private:
+     CAndCompositeAssertion();
+     void ConstructL(); 
+     void ConstructL(CAndCompositeAssertion* aValue); 
+    
+};
+#endif //C_AND_COMPOSITE_ASSERTION_H              
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/assertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef C_ASSERTION_H
+#define C_ASSERTION_H
+
+#include <e32base.h>
+#include <s32strm.h>
+#include "massertion.h"
+
+
+class CWSPolicyWriter;
+
+class CAssertion: public  CBase, public MAssertion 
+{ 
+
+public:
+    static CAssertion* NewL();
+    static CAssertion* NewLC();
+    virtual ~CAssertion();
+public:
+
+
+    virtual void 	AddTerm(MAssertion* aAssertion);
+    virtual void 	AddTerms(RPolicyTerms& aAssertions);
+    virtual void 	AddTermCopyL(MAssertion* aAssertion);
+    virtual void 	AddTermsCopyL(RPolicyTerms& aAssertions);
+
+    virtual void 	        MoveTermL(RPolicyTerms& aAssertions);
+    virtual void 	        MoveTermsL(RPolicyTerms& aAssertions);
+
+
+    virtual  MAssertion* 	GetParent();
+    virtual RPolicyTerms& 	GetTerms();
+    virtual  TBool 	HasParent();
+    virtual  MAssertion* 	IntersectL(MAssertion* aAssertion);
+    virtual  TBool 	IsEmpty();
+    virtual  TBool 	IsNormalized();
+    virtual  MAssertion* 	MergeL(MAssertion* aAssertion);
+    virtual  MAssertion* 	NormalizeL();
+    virtual TInt 	Remove(MAssertion* aAssertion);
+    virtual  void 	SetNormalized(TBool aFlag);
+    virtual  void 	SetParent(MAssertion* aParent);
+    virtual  TAssertionType Type();
+
+
+    virtual  MAssertion*   IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual  MAssertion*   MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual  MAssertion*   NormalizeL(CPolicyRegistry* aRegistry);
+
+    TInt 	Size();    
+    CAssertion();
+
+    static TInt DeleteAssertion(MAssertion* aAssertion);    
+
+private:
+    
+    void ConstructL();
+    
+private:
+    RPolicyTerms iChildterms;
+    MAssertion* iParent;
+    TBool iNormalized;
+    
+//    RFileLogger iLog;
+    
+};
+
+#endif //C_ASSERTION_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/compositeassertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef CPOLICYASSERTION_H
+#define CPOLICYASSERTION_H
+
+#include "Assertion.h"
+class CCompositeAssertion :public CAssertion
+{
+ 
+};
+
+#endif //CPOLICYASSERTION_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/massertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef MASSERTION_H
+#define MASSERTION_H
+
+#include <e32std.h>
+#include "wspolicyregistry.h"
+
+class MAssertion;
+class CPolicyRegistry;
+
+typedef RPointerArray<MAssertion> RPolicyTerms;
+
+ enum TAssertionType
+ {
+    EInvalidType = 0,
+    ECompositeAndType = 1,
+    ECompositePolicyType = 2,
+    ECompositeXorType = 3,
+    EPolicyReferenceType = 4,
+    EPrimitiveType = 5
+     
+ };
+
+class MAssertion
+{
+
+public: 
+    virtual void 	        AddTerm(MAssertion* aAssertion) = 0;
+    virtual void 	        AddTerms(RPolicyTerms& aAssertions) = 0;
+    virtual void 	        AddTermCopyL(MAssertion* aAssertion) = 0;
+    virtual void 	        AddTermsCopyL(RPolicyTerms& aAssertions) = 0;
+ 
+    virtual void 	        MoveTermL(RPolicyTerms& aAssertions) = 0;
+    virtual void 	        MoveTermsL(RPolicyTerms& aAssertions) = 0;
+
+    virtual MAssertion* 	GetParent() = 0;
+    virtual RPolicyTerms& 	GetTerms() = 0;
+    virtual TBool 	        HasParent() = 0;
+    virtual MAssertion* 	IntersectL(MAssertion* aAssertion) = 0;
+    virtual TBool 	        IsEmpty() = 0;
+    virtual TBool 	        IsNormalized() = 0;
+    virtual MAssertion* 	MergeL(MAssertion* aAssertion) = 0;
+    virtual MAssertion* 	NormalizeL() = 0;
+    virtual TBool 	        Remove(MAssertion* aAssertion) = 0;
+    virtual void 	        SetNormalized(TBool aFlag) = 0;
+    virtual void 	        SetParent(MAssertion* aParent) = 0;
+    virtual TInt 	        Size() = 0;
+    virtual TAssertionType  Type() = 0;
+
+    virtual MAssertion*   IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry) = 0;
+    virtual MAssertion*   MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry) = 0;
+    virtual MAssertion*   NormalizeL(CPolicyRegistry* aRegistry) = 0;
+    
+
+};
+
+#endif //MASSERTION_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/msenwspolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_WSPOLICY_H
+#define M_SEN_WSPOLICY_H
+
+#include <e32std.h>
+
+class CWSPolicy;
+class CPolicyRegistry;
+class CSenElement;
+
+ enum TWSPolicyType
+ {
+    EInvalidType = 0,
+    EWsPolicyType = 1,
+    EWsWsdlPolicyType = 2,     
+ };
+
+class MSenWsPolicy
+{
+
+public: 
+    virtual CWSPolicy* 	    GetPolicyDoc() = 0;
+    virtual CSenElement*    GetPolicyDoc() = 0;
+    virtual TBool 	        IsEmpty() = 0;
+    virtual TBool 	        IsNormalized() = 0;
+    virtual TBool 	        Remove() = 0;
+    virtual TInt 	        Size() = 0;
+    virtual TWSPolicyType  Type() = 0;
+};
+
+#endif //M_SEN_WSPOLICY_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/msenwspolicymanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_WS_POLICY_MANAGER_H
+#define M_SEN_WS_POLICY_MANAGER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CSenWSDescription;
+class CSenInternalWsPolicy;
+class RSenWSPolicyPtr;
+class CSenElement;
+
+typedef RPointerArray<CSenInternalWsPolicy> RSenWSPolicyArray;
+typedef RArray<RSenWSPolicyPtr> RSenPolicyPtrArray;
+
+class MSenWsPolicyManager
+    {
+    public:
+
+
+        virtual TInt AddWsPolicy1L(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo) = 0;
+
+        virtual TInt RemoveWsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo) = 0;
+                                                                                                                                                                                               
+        virtual TInt RegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo) = 0;
+
+        virtual TInt UnRegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo) = 0;
+                                                    
+        virtual CSenElement*  WsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo) = 0;
+
+        virtual CSenElement*  WsPolicy1L( CSenWSDescription* aPattern, 
+                                                TInt& aErrorTo) = 0;
+
+        virtual CSenElement*  WsPolicy1L( const TDesC8& aProviderId, TInt& aErrorTo) = 0;
+
+        virtual TInt AddPolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId) = 0;
+
+        virtual TInt RemovePolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId) = 0;
+        
+                                                
+    };
+
+#endif // M_SEN_WS_POLICY_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/policyassertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef C_POLICY_ASSERTION_H
+#define C_POLICY_ASSERTION_H
+#include "assertion.h"
+
+class CPolicyAssertion : public CAssertion
+{
+public:
+    static  CPolicyAssertion* NewL();
+    static  CPolicyAssertion* NewLC();
+
+    static  CPolicyAssertion* NewL(CPolicyAssertion* aValue);
+    static  CPolicyAssertion* NewLC(CPolicyAssertion* aValue);
+    
+    virtual ~CPolicyAssertion();
+//from CAssertion
+    virtual  TAssertionType Type();
+    virtual  MAssertion* 	NormalizeL();
+    virtual  MAssertion* 	NormalizeL(CPolicyRegistry* aRegistry);         
+    virtual  MAssertion* IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual  MAssertion* 	MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+ 
+public:          
+    void SetNameL(TDesC8& aName);          
+    void SetIdL(TDesC8& aId);
+    TPtrC8 	Name();     
+    TPtrC8 	Id();
+    TPtrC8 PolicyURI();
+          
+private:
+     CPolicyAssertion();
+     void ConstructL();
+     void ConstructL(CPolicyAssertion* aValue);
+private:
+     HBufC8* iName;
+     HBufC8* iId;
+     HBufC8* iMetadataEndpoint;
+ 
+    
+};
+#endif //C_POLICY_ASSERTION_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/policyintersecter.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_POLICY_INTERSECTER_H
+#define WSSTAR_POLICY_INTERSECTER_H
+
+#include <SenDomFragmentBase.h>
+#include <RSenDocument.h>
+#include <XmlEngDDocument.h>
+
+
+class CSenElement;
+class CWsSecurityPolicy;
+
+/**
+ * Class:   CPolicyIntersecter
+ * Description: This class can intersect two polcicies provided as fileNames or TElements
+ * The Intersection take care of domain specific knowledge of the assertions and can resolve it. 
+ * currently only Ws-SecurityPolicy domain is supported
+ */
+
+class CPolicyIntersecter : public CBase
+
+{
+  
+  public:
+
+  static CPolicyIntersecter* NewL();
+  static CPolicyIntersecter* NewLC();
+    
+  virtual ~CPolicyIntersecter();
+
+  TXmlEngElement IntersectL(TDesC& aFirstPolicy, TDesC& aSecondPolicy); //filenames with absolute path
+  TXmlEngElement IntersectL(TXmlEngElement aFirstPolicy, TXmlEngElement aSecondPolicy); //root elements
+private:
+
+  void ConstructL();
+
+  CPolicyIntersecter();
+  
+  void IntersectAllANDAssertionsL(TXmlEngElement aFirstElement, 
+                    TXmlEngElement aSecondElement, RArray<TXmlEngElement>& aResult);
+  TXmlEngElement IntersectCompareSecondAssertionsL(TXmlEngElement aFirstElement, 
+                    TXmlEngElement aSecondElement, TXmlEngElement aIntersectedAND);
+  
+  TInt VerifyNamespace(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement);
+  
+private:    
+   CWsSecurityPolicy* iSecurityPolicyDomain;
+   
+   TXmlEngElement   irootAND;
+   
+   TXmlEngElement  iIntersectedPolicyElement;
+   RXmlEngDocument iPolicy1; 
+   RXmlEngDocument iPolicy2;
+   
+//   TString XORString;
+//   TString ANDString;
+//   TString policyNsUri;
+};
+
+#endif //WSSTAR_POLICY_INTERSECTER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/policymerger.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_POLICY_MERGER_H
+#define WSSTAR_POLICY_MERGER_H
+
+#include <SenDomFragmentBase.h>
+#include <RSenDocument.h>
+#include <XmlEngDDocument.h>
+
+
+class CSenElement;
+class CWsSecurityPolicy;
+
+/**
+ * Class:   CPolicyMerger
+ * Description: This class can merge two polcicies provided as fileNames or TElement
+ * The Merging take care of domian specific knowledge of the assertion and can resolve it. 
+ * currently only Ws-SecurityPolicy domain is supported
+ */
+
+class CPolicyMerger : public CBase	//CodeScannerWarnings
+
+{
+  
+  public:
+
+  static CPolicyMerger* NewL();
+  static CPolicyMerger* NewLC();
+    
+  virtual ~CPolicyMerger();
+
+  TXmlEngElement MergeL(TDesC& aFirstPolicy, TDesC& aSecondPolicy); //filenames with absolute path
+  TXmlEngElement MergeL(TXmlEngElement aFirstPolicy, TXmlEngElement aSecondPolicy); //root elements
+private:
+
+  void ConstructL();
+
+  CPolicyMerger();
+  
+  void MergeAllANDAssertionsL(TXmlEngElement aFirstElement, 
+                    TXmlEngElement aSecondElement, RArray<TXmlEngElement>& aResult);
+  TXmlEngElement MergeCompareSecondAssertionsL(TXmlEngElement aFirstElement, 
+                    TXmlEngElement aSecondElement, TXmlEngElement aIntersectedAND);
+  
+  TInt VerifyNamespace(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement);
+  
+private:    
+   CWsSecurityPolicy* iSecurityPolicyDomain;
+   
+   TXmlEngElement  irootAND;
+   TXmlEngElement  iMergedPolicyElement;
+      
+   RXmlEngDocument iPolicy1; 
+   RXmlEngDocument iPolicy2;
+
+//   TString XORString;
+//   TString ANDString;
+//   TString policyNsUri;
+};
+
+#endif //WSSTAR_POLICY_MERGER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/policynormalizer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef POLICY_NORMALIZER_H
+#define POLICY_NORMALIZER_H
+
+#include <e32std.h>
+#include "SenDomFragment.h"
+#include "SenPointerMap.h"
+
+// FORWARD DECLARATIONS
+class CPolicyNormalizer;
+class CPolicyRegistry;
+class CWSPolicy;
+typedef RSenPointerMap<TDesC8, CSenElement> RPolicyMap;
+// CONSTANTS
+
+
+// INCLUDES
+namespace  WSPolicy
+    {
+    
+	_LIT8( KAndCompositeAssertion , "All");             // Tag name of AndComposteAssertion
+	_LIT8( KXorCompositeAssertion , "ExactlyOne");      // Tag name of XorCompositeAssertion
+	_LIT8( KWsPolicy , "Policy");                       // Tag name of Policy
+	_LIT8( KWsPolicyPrefix , "wsp");                    // Prefix of WS-Policy namespace
+	_LIT8( KWsuNsPrefix , "wsu");                       // Prefix of WSU namespace
+	_LIT8( KWsPolicyReference , "PolicyReference");     // Tag name of PolicyReference
+	_LIT8( KWspOptinal , "wsp:Optional");             // Tag name of Optional Attribute
+	_LIT8( KWspOptinalTrue , "true");             // Tag name of Optional Attribute TRUE
+	_LIT8( KWspOptinalFalse , "false");             // Tag name of Optional Attribute FALSE
+	_LIT8( KWsPolicyNsUri , "http://schemas.xmlsoap.org/ws/2004/09/policy"); // Namespace of WS-Policy
+    
+    _LIT8( KWsuPrefix , "wsu"); // Namespace of WSU	
+	_LIT8( KWsuNsUri , "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); // Namespace of WSU
+	_LIT8( KXmlNsUri , "http://www.w3.org/XML/1998/namespace"); // XML namespace
+	
+	_LIT8( KWsuId , "wsu:Id");                       // Prefix ID
+	_LIT8( KId , "Id");                       // Prefix ID
+	_LIT8( KName, "Name"); 
+	_LIT8( KWsSecuritypolicyPrefix , "sp");                    // Prefix of WS-Security Policy namespace
+	_LIT8( KWsSecurityPolicyNsUri , "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"); // Namespace of WS-Security Policy
+	
+	_LIT8( KUri , "URI");                       // PolicyReference URI
+    }
+
+namespace  MSWSPolicy
+{
+ 	_LIT8( KMetaDataValidity, "metadatavalidity");
+	_LIT8( KMetaDataNsUri, "http://schemas.live.com/mws/2005/08/core");
+	_LIT8( KExpiry, "Expiry");
+	_LIT8(KMetaDataLocalName, "MetadataEndpoint");    
+}
+
+
+/**
+ * Class:   CPolicyNormalizer
+ * Description: This class creates an instance of PolicyNormalizer. The DOM of policy is created by calling ReadL(TDesC8& aXmlDesc) method of the 
+ * class. Then The DOM tree can be normalized as described in WS-Policy specification.
+ */
+class CPolicyNormalizer : public CSenDomFragment
+    {
+
+public:
+    static CPolicyNormalizer* NewL();
+    static CPolicyNormalizer* NewLC();
+    ~CPolicyNormalizer();
+    
+    void ReadFileL(TFileName aPath);
+    TInt ReadL(TDesC8& aXmlDesc);
+    
+    CSenElement* NormalizeL(CPolicyRegistry* aRegistry);
+    CSenElement* NormalizedPolicy() {return  iNewPolicy; }
+private:       
+
+    CPolicyNormalizer();
+    void ConstructL();
+    void WriteL(CSenElement* aXml);
+    void WriteAllL(CSenElement* aXml);
+
+    TBool ValidateElementNsL(CSenElement* aAssertion);
+    TBool IsOptionalL(CSenElement* aAssertion);               //codescannerwarnings
+
+    CSenElement* ProcessPolicyReferenceL(CSenElement* aPolicy, CPolicyRegistry* aRegistry);
+    TInt ReplacePolicyReferenceL(CSenElement* aReferenceElement, CSenElement* aReferredPolicy);	//codescannerwarnings
+    TPtrC8 GetReferenceUriL(CSenElement* aReference);          //codescannerwarnings
+    
+    CSenElement* ProcessXORTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion);
+    CSenElement* ProcessANDTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion);
+    CSenElement* ProcessPolicyTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion);
+    CSenElement* ProcessAssertionTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion);
+    CSenElement* ProcessOptionalElement(CSenElement* aAssertion, CSenElement* aNormalAssertion);
+    
+    
+    CSenElement* AddAndElementL(CSenElement* aAssertion);
+    CSenElement* AddXorElementL(CSenElement* aAssertion);
+    CSenElement* AddPolicyElementL(CSenElement* aAssertion);
+    
+    CSenElement* CopySenElementL(CSenElement* aSource,CSenElement* aDestination);
+    TBool CopySenElementWithoutOptionL(CSenElement* aSource,CSenElement* aDestination);	//codescannerwarnings
+    
+    CSenElement* ProcessLogicL(CSenElement* aTerm);     //codescannerwarnings
+    CSenElement* ProcessXorCollapseLogicL(CSenElement* aParent, CSenElement* aChild);  //codescannerwarnings
+    CSenElement* ProcessAndCollapseLogic(CSenElement* aParent, CSenElement* aChild);
+    CSenElement* ProcessAndAndLogicL(CSenElement* aFirstTerm, CSenElement* aSecondTerm ); //codescannerwarnings
+    
+    CSenElement* ProcessAssertionBranchingL(CSenElement* aPolicy);    //codescannerwarnings
+    CSenElement* DuplicateAssertionBranchL(CSenElement* aParent, CSenElement* aDuplicatingPolicy);   //codescannerwarnings
+    
+    TInt HasChildL(CSenElement* aTerm);  //codescannerwarnings
+    CSenElement* FindRootAssertionL(CSenElement* aElement);  //codescannerwarnings
+    TBool IsChildOfElement(CSenElement* aParent, CSenElement* aChild);
+    CSenElement* DeleteAsertionIndexL(CSenElement* aAssertion, CSenElement* anewAssertion, TInt aIndx);  //codescannerwarnings
+
+    HBufC*        iPath;
+    CSenElement* iNewPolicy;
+    RPointerArray<CSenElement> iOrphanElements;
+    TInt count;
+
+    };
+#endif // POLICY_NORMALIZER_H
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/policyreferenceassertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef CPOLICYREFERENCE_ASSERTION_H
+#define CPOLICYREFERENCE_ASSERTION_H
+
+#include "assertion.h"
+class CPolicyReferenceAssertion :public CAssertion
+{
+public:
+    static  CPolicyReferenceAssertion* NewL(TDesC8& aUri);
+    static  CPolicyReferenceAssertion* NewLC(TDesC8& aUri);
+    static  CPolicyReferenceAssertion* NewL(CPolicyReferenceAssertion* aValue);
+    static  CPolicyReferenceAssertion* NewLC(CPolicyReferenceAssertion* aValue);
+    
+    virtual ~CPolicyReferenceAssertion();
+    
+//from CAssertion
+    virtual void 	        AddTerm(MAssertion* aAssertion);
+    virtual void 	        AddTerms(RPolicyTerms& aAssertions);
+    virtual void 	        AddTermCopyL(MAssertion* aAssertion);
+    virtual void 	        AddTermsCopyL(RPolicyTerms& aAssertions);
+ 
+    virtual void 	        MoveTermL(RPolicyTerms& aAssertions);
+    virtual void 	        MoveTermsL(RPolicyTerms& aAssertions);
+
+    virtual MAssertion* 	GetParent();
+    virtual TBool 	        HasParent();
+    virtual MAssertion* 	IntersectL(MAssertion* aAssertion);
+    virtual TBool 	        IsEmpty();
+    virtual TBool 	        IsNormalized();
+    virtual MAssertion* 	MergeL(MAssertion* aAssertion);
+    virtual MAssertion* 	NormalizeL();
+    virtual TBool 	        Remove(MAssertion* aAssertion);
+    virtual void 	        SetNormalized(TBool aFlag);
+    virtual void 	        SetParent(MAssertion* aParent);
+    virtual TInt 	        Size();
+    virtual TAssertionType  Type();
+
+    virtual MAssertion*   IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual MAssertion*   MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual MAssertion*   NormalizeL(CPolicyRegistry* aRegistry);
+    
+public:    
+    TPtrC8 PolicyUri();
+private:
+     CPolicyReferenceAssertion();
+     void ConstructL(TDesC8& aUri); 
+     void ConstructL(CPolicyReferenceAssertion* aValue); 
+    
+    HBufC8* iUri;
+};
+
+#endif //CPOLICYREFERENCE_ASSERTION_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/primitiveassertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+#ifndef C_PRIMITIVE_ASSERTION_H
+#define C_PRIMITIVE_ASSERTION_H
+
+
+#include "assertion.h"
+#include "SenBaseAttribute.h"
+class CPolicyAssertion;
+class CAssertionAttrib;
+class CQName;
+
+typedef RSenPointerMap<TDesC8, TDesC8> RAttributeMap;
+
+class CPrimitiveAssertion : public CAssertion
+{
+public:
+    static  CPrimitiveAssertion* NewL();
+    static  CPrimitiveAssertion* NewLC();
+
+    static  CPrimitiveAssertion* NewL(CPrimitiveAssertion* aValue);
+    static  CPrimitiveAssertion* NewLC(CPrimitiveAssertion* aValue);
+
+    static  CPrimitiveAssertion* NewL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
+    static  CPrimitiveAssertion* NewLC(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
+
+    virtual ~CPrimitiveAssertion();
+//from CAssertion
+    virtual  MAssertion* 	GetParent();
+    virtual RPolicyTerms& 	GetTerms();
+    virtual  TAssertionType Type();
+    virtual  TBool 	HasParent();
+    virtual  TBool 	IsEmpty();
+    virtual  MAssertion* 	NormalizeL();         
+    virtual  MAssertion* 	NormalizeL(CPolicyRegistry* aRegistry);         
+    virtual  MAssertion* IntersectL(MAssertion* aAssertion);
+    virtual  MAssertion* IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual  MAssertion* 	MergeL(MAssertion* aAssertion);
+    virtual  MAssertion* 	MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual TBool 	Remove(MAssertion* aAssertion);
+    
+    virtual  TInt 	Size();
+public:    
+ 
+    void  AddAttributeL(TDesC8& aQname, TDesC8& aValue);
+    TPtrC8 GetAttributeValue(const TDesC8& aQname);
+    RAttributeMap&  Attributes();
+    TInt SetAttributesL(RAttributeMap& aAttributes);
+    TInt  RemoveAttribute(const TDesC8& aQname);
+
+    CQName* QName();
+    TPtrC8 Name();
+    TPtrC8 StrValue();
+    void SetStrValueL(TDesC8& aStrValue);
+    TAny* Value(); 
+
+    TBool IsOptional();
+    TInt SetOptional(TBool aOptional);
+    CQName* iQname;
+private:
+    CPrimitiveAssertion();
+    void ConstructL();
+    void ConstructL(CPrimitiveAssertion* aValue);
+    void ConstructL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
+    TInt SetTermsL(RPolicyTerms& aTerms);
+    RPolicyTerms GetTerms(CPolicyAssertion* aPolicy); 
+    TBool IsEmptyPolicy(CPolicyAssertion* aPolicy); 
+    CPolicyAssertion* GetSinglePolicyL(RPolicyTerms aChildTerms);
+    CPrimitiveAssertion* GetSelfWithoutTermsL();
+private:
+    MAssertion* iOwner;
+	RAttributeMap* iAttr; 
+	TBool iIsOptional;
+	HBufC8* iStrValue;
+	TAny* iValue;
+      
+    
+};
+
+class CQName :public CBase
+{
+public:
+    static  CQName* NewL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
+    static  CQName* NewLC(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
+    ~CQName();
+public:
+    TPtrC8 Name();
+    TPtrC8 QName();
+    TPtrC8 Prefix();
+    TPtrC8 Uri();
+
+private:
+    CQName();
+    void ConstructL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri);
+    HBufC8* iName;
+    HBufC8* iQName;
+    HBufC8* iPrefix;
+    HBufC8* iUri;
+};
+#endif //C_PRIMITIVE_ASSERTION_H              
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/seninternalwspolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,588 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_INTERNAL_WS_POLICY_H
+#define SEN_INTERNAL_WS_POLICY_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+
+#include <SenFragmentBase.h>
+#include <SenDomFragmentBase.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+
+// FORWARD DECLARATIONS
+class SenDateUtils;
+class CSenCredentialIdentifier;
+class CSenWSDescription;
+class CSenIdentityProvider;
+class CSenServiceSession;
+class CSenFacet;
+class CSenElement;
+
+class CSenWSPolicyProperties;
+class CSenWSPolicyIdentifier;
+class CSenWSDescription;
+class RSenWSPolicyPtr;
+class CSenWSPolicyMetadata;
+// CLASS DECLARATION
+
+namespace SenWSInternalPolicy
+    {
+// CONSTANTS
+
+    _LIT8(KSenWsPolicies,             "SenWsPolicies");
+    _LIT8(KEndpointLocalname,           "Endpoint");
+    _LIT8(KContractLocalname,           "Contract");    
+    _LIT8(KProviderIdLocalName,             "ProviderID");
+    
+    _LIT8(KMetadataEndpointLocalname,           "MetadataEndpoint"); 
+    _LIT8(KMetadataMethodLocalname,           "method");
+    _LIT8(KServicePolicyLocalName,       "ServicePolicy");    
+    _LIT8(KClientPolicyLocalName,       "ClientPolicy");
+    
+    
+    _LIT8(KWsdlDocument, "definitions");
+    _LIT8(KWsdlNsPrefix, "wsdl");
+    _LIT8(KPolicyDocument, "Policy");
+    _LIT8(KPolicyNsPrefix, "wsp");
+    
+    _LIT8(KSenWSPolicyId,                 "WsPolicyId");
+    _LIT8(KSenWSPolicyValidUntil,           "ValidUntil");
+    
+    _LIT8(KSenWsPolicyIdentifierLocalname,"Identifier");
+    _LIT8(KSenWsPolicyProperteisLocalname,"Properties");
+    _LIT8(KSenWSPolicyMetadata,"PolicyMetadata");
+    
+    _LIT8(KWsPoliciesMaxID,        "PolicyMaxID");
+    _LIT8(KWsPolicyContainer,     "SenWsPolicyContainer");
+    
+    }
+
+/**
+* Class implements (web) service policy functionality
+*  @since Series60 3.0
+*/
+class CSenInternalWsPolicy : public CSenDomFragment
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        static CSenInternalWsPolicy* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        static CSenInternalWsPolicy* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        static CSenInternalWsPolicy* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        static CSenInternalWsPolicy* NewLC(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        static CSenInternalWsPolicy* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            CSenElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        static CSenInternalWsPolicy* NewLC(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes,
+                                             CSenElement& aParent);
+
+        /**
+        * Constructor which copies itself from another credential.
+        *
+        * @since Series60 4.0
+        * @param    aPolicy     credential to copy from.
+        * @return new CSenCredential instance pointer
+        */
+        static CSenInternalWsPolicy* NewL(const CSenInternalWsPolicy& aPolicy);
+
+        /**
+        * Constructor which copies itself from another credential.
+        *
+        * @since Series60 4.0
+        * @param    aPolicy     credential to copy from.
+        * @return new CSenCredential instance pointer, which is left on
+        *         cleanup stack.
+        */
+        static CSenInternalWsPolicy* NewLC(const CSenInternalWsPolicy& aPolicy);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenInternalWsPolicy();
+
+        // New functions
+
+        /**
+        * Method for checking if this credential is applicable for
+        * given pattern.
+        *
+        * @since Series60 4.0
+        * @param    aPattern    pattern to check.
+        * @return   ETrue       if Credential is applicable
+        *           EFalse      if Credential is not applicable
+        */
+        TBool IsApplicableL(CSenWSDescription& aPattern);	//codescannerwarnings
+        TBool IsApplicableL(const TDesC8& aPolicyEndpoint);	//codescannerwarnings
+        TBool IsApplicableL(CSenInternalWsPolicy* aInternalPolicy);	//codescannerwarnings
+        /**
+        * Method for setting CredentialIdentifier.
+        *
+        * @since Series60 4.0
+        * @param    aIdentifier identifier to set.
+        */
+        void SetIdentifier(CSenWSPolicyIdentifier* aIdentifier);
+
+        /**
+        * Method for getting CredentialIdentifier.
+        *
+        * @since Series60 4.0
+        * @return   Identifier for this Credentiel
+        */
+        CSenWSPolicyIdentifier& IdentifierL();	//codescannerwarnings
+
+        /**
+        * Method for setting ServiceSession for this Credential.
+        * Setting ServiceSession does build relation between this
+        * Credential and given ServiceSession.
+        *
+        * @since Series60 4.0
+        * @param   aSession             ServiceSession for this Credentiel
+        */
+        void SetSession(CSenServiceSession& aSession);
+
+        /**
+        * Method for getting ServiceSession which is related to this
+        * Credential.
+        *
+        * @since Series60 4.0
+        * @return   ServiceSession for this Credentiel or NULL
+        *           if related ServiceSession is not set
+        */
+        virtual CSenServiceSession* Session();
+
+        TBool UpdateMetadataEndpointL(CSenInternalWsPolicy* aInternalPolicy, TInt& aExist);
+        
+        
+        TInt AddMetadataPolicyL(CSenElement* aElement);
+        TInt UpdateMetadataPolicyL(CSenElement* aElement);
+        TInt RemoveMetadataPolicyL(const TDesC8& aUri);
+//        CSenElement* WsPolicy(const CSenWSDescription& aPattern);
+        CSenElement* WsPolicyByUriL(const TDesC8& aUri);
+        CSenElement* WsPolicyByName(const TDesC8& aName);
+        TTime ValidUntilL(const TDesC8& aUri);
+        
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenInternalWsPolicy();
+
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 4.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        */
+        void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 4.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        * @param aParent is the parent element, which may declare other
+        *        namespaces.
+        */
+        void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8&  aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes,
+                                  CSenElement& aParent);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 4.0
+        * @param aPolicy is the source credential to be copied.
+        */
+        void ConstructL(CSenInternalWsPolicy& aPolicy);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * BaseConstructL for setting XML localname for this Credential.
+        * @since Series60 4.0
+        * @param aLocalName XML localname for this Credential
+        */
+        void ConstructL(const TDesC8& aLocalName);
+
+        // New functions
+
+        /**
+        * Setter for Credential ID
+        *
+        * @since Series60 4.0
+        * @param aId is the unique ID for this Credential
+        */
+        void SetIdL(const TDesC8& aId);
+
+        TInt PolicyCountL();	//codescannerwarnings
+        TPtrC8 ExpiryTimeL(CSenElement* aElement); //codescannerwarnings
+
+    private: // Data
+        CSenWSPolicyIdentifier*   ipIdentifier;
+//        CSenWSPolicyProperties*   ipProperties;
+        CSenServiceSession*         ipSession;
+               
+    };
+
+class CSenWSPolicyProperties : public CSenDomFragment
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        static CSenWSPolicyProperties* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        static CSenWSPolicyProperties* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        static CSenWSPolicyProperties* NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        static CSenWSPolicyProperties* NewLC(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        static CSenWSPolicyProperties* NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes,
+                                                           CSenElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        static CSenWSPolicyProperties* NewLC(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& aAttributes,
+                                                            CSenElement& aParent);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenWSPolicyProperties();
+
+        /**
+        * Sets new property.
+        *
+        * If property with given name does not exist,
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60 4.0
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        Is the value of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        */
+        TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+
+        /**
+        * Gets the value of the property behind certain name.
+        *
+        * @since Series60 4.0
+        * @param aName    The name identifying this property.
+        * @param aValue   A TPtrC8 reference to be filled in with the value of
+        *                 the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+
+
+        
+     protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenWSPolicyProperties();
+
+   };
+
+class CSenWSPolicyIdentifier : public CSenWSPolicyProperties
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        static CSenWSPolicyIdentifier* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        static CSenWSPolicyIdentifier* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        static CSenWSPolicyIdentifier* NewL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                          const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        static CSenWSPolicyIdentifier* NewLC(const TDesC8& aNsUri,
+                                                        const TDesC8& aLocalName,
+                                                        const TDesC8& aQName,
+                                                        const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        static CSenWSPolicyIdentifier* NewL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttributes,
+                                                       CSenElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        static CSenWSPolicyIdentifier* NewLC(const TDesC8& aNsUri,
+                                                        const TDesC8& aLocalName,
+                                                        const TDesC8& aQName,
+                                                        const RAttributeArray& aAttributes,
+                                                        CSenElement& aParent);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenWSPolicyIdentifier();
+
+        void SetIdL(TInt aId);
+
+        TInt IdL();
+        
+        TPtrC8 ContractL();  //codescannerwarnings
+        TPtrC8 EndpointL();  //codescannerwarnings
+        TPtrC8 ProviderIdL(); //codescannerwarnings
+        TPtrC8 MetadataEndpointL(); //codescannerwarnings
+        CSenElement* MetadataEndpointElementL(); //codescannerwarnings
+        
+        TInt AddMetadataEndpointL(CSenElement* aElement);
+        TInt UpdateMetadataEndpointL(CSenWSPolicyIdentifier& aIdentifier);
+        
+        static TPtrC8 ElementAttribValueL(CSenElement* aElement, const TDesC8& aName); 
+        static TBool HasAttributeL(CSenElement* aElement, const TDesC8& aName);
+        
+        
+     private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenWSPolicyIdentifier();
+   };
+
+typedef struct
+    {
+    CSenInternalWsPolicy* ipPolicy;
+    TInt                    iCounter;
+    } TSenWsPolicyData;
+
+class RSenWSPolicyPtr
+	{
+    public:
+	    void OpenL(CSenInternalWsPolicy* apPolicy);
+	    CSenInternalWsPolicy* Policy();
+	    void SetPolicy(CSenInternalWsPolicy* apPolicy);
+	    RSenWSPolicyPtr Clone();
+	    void Close();
+	    void CloseAndDestroyPolicy();
+
+        /**
+        * C++ default constructor.
+        */
+        RSenWSPolicyPtr();
+
+    private: // Data
+        TSenWsPolicyData* ipPolicyData;
+	};
+
+#endif // SEN_INTERNAL_WS_POLICY_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/senwspolicymanager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,387 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_WS_POLICY_MANAGER_H
+#define SEN_WS_POLICY_MANAGER_H
+
+// INCLUDES
+#include "msenwspolicymanager.h"
+
+#include <e32std.h>
+#include <flogger.h>    // RFileLogger
+
+#include <SenFragmentBase.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+
+// FORWARD DECLARATIONS
+class MSenCoreServiceManager;
+class CSenWSPolicyIdentifier;
+class CSenWSPolicyProperties;
+class CSenParser;
+class CSenWSPolicyLoader;
+class CNormalizedPolicyConatiner;
+class CExpiredPolicy;
+class CConsumerContainer;
+// CLASS DECLARATION
+typedef RPointerArray<CNormalizedPolicyConatiner> RNormalizedArray;
+typedef RPointerArray<CExpiredPolicy> RExpiredPolicyArray;
+typedef RPointerArray<CConsumerContainer> RPolicyConsumerArray;
+
+class CSenWSPolicyManager: public CBase , public MSenWsPolicyManager
+    {
+    public:
+        IMPORT_C static CSenWSPolicyManager* NewL(MSenCoreServiceManager& aManager);
+
+        IMPORT_C static CSenWSPolicyManager* NewLC(MSenCoreServiceManager& aManager);
+
+        IMPORT_C virtual ~CSenWSPolicyManager();
+
+        IMPORT_C TInt RegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                            TInt& aErrorTo);
+        
+        IMPORT_C TInt UnRegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+                                                                
+        //add a new Policy to existing SD whose endpoints are already registered by Register
+        IMPORT_C TInt AddWsPolicyL(CSenWSDescription* aPattern, const TDesC8& aUri, 
+                                               const TDesC8& aPolicy, TInt& aErrorTo);
+                                                        
+        //remove a policy from existing SD. The Metadataendpoint will not be removed
+        IMPORT_C TInt RemoveWsPolicyL( CSenWSDescription* aPattern, 
+                                                        const TDesC8& aUri, TInt& aErrorTo);    
+
+
+        IMPORT_C CSenElement*  WsPolicyL( CSenWSDescription* aPattern, 
+                                                        const TDesC8& aUri, TInt& aErrorTo);
+
+        IMPORT_C TInt ExpiredPoliciesL(RExpiredPolicyArray& aArray,  TInt& aErrorTo);
+        
+        IMPORT_C TInt AddPolicyConsumerL(const TDesC8& aUri, const TDesC8& aConsumerId);
+        
+        IMPORT_C TInt RemovePolicyConsumerL(const TDesC8& aUri, const TDesC8& aConsumerId);
+        
+
+
+    //from MSenWsPolicyManager
+        virtual TInt AddWsPolicy1L(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo);
+
+        virtual TInt RemoveWsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo);
+                                                                                                                                                                                               
+        virtual TInt RegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+
+        virtual TInt UnRegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+                                                    
+        virtual CSenElement*  WsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo);
+
+        virtual CSenElement*  WsPolicy1L( CSenWSDescription* aPattern, 
+                                                TInt& aErrorTo);
+
+        virtual CSenElement*  WsPolicy1L( const TDesC8& aProviderId, TInt& aErrorTo);
+        
+        virtual TInt AddPolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId);
+
+        virtual TInt RemovePolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId);
+
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenWSPolicyManager(MSenCoreServiceManager& aManager);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        CSenElement* PolicyFromUri(CSenWSDescription* aPolicy, const TDesC8& aUri);
+        CSenElement* PolicyFromSDL(CSenWSDescription* aPolicy);  //codescannerwarnings
+        CSenElement* PolicyByProviderId(const TDesC8& aProviderId, TInt&  aErrorTo);
+        TInt IsContainerL(CSenInternalWsPolicy* aInternalPolicy);	//codescannerwarnings
+        TInt CreatePolicyContainerL(CSenInternalWsPolicy* aInternalPolicy);  //codescannerwarnings
+        TInt RefreshPolicyContainerL();  //codescannerwarnings
+        TInt UpdatePolicyContainerL(CSenInternalWsPolicy* aInternalPolicy);
+        TInt PolicyConsumerCountL(CSenInternalWsPolicy* aInternalPolicy); //codescannerwarnings
+        TInt IsConsumerExist(const TDesC8& aEndpoint, const TDesC8& aConsumerId);
+        RFileLogger* Log();
+    private:
+        MSenCoreServiceManager&     iManager;
+        RFileLogger*                iLog;                   // not owned (no create/close)    
+        CSenWSPolicyLoader* iPolicDataLoader;
+        RNormalizedArray iPolicyArray;
+        RPolicyConsumerArray iConsumerArray;
+    
+    };
+//Policy container holding the Normalized Policy
+class CNormalizedPolicyConatiner : public CBase
+    {
+    public:
+        static CNormalizedPolicyConatiner* NewL(CSenInternalWsPolicy* aPolicy, const TDesC8& aUri);
+
+        static CNormalizedPolicyConatiner* NewLC(CSenInternalWsPolicy* aPolicy, const TDesC8& aUri);
+
+        virtual ~CNormalizedPolicyConatiner();
+        
+        TBool IsSameContainer(const TDesC8& aUri);
+        TBool UpdateL(CSenInternalWsPolicy* aInternalPolicy);
+        
+        void CountInc();
+        void CountDec();
+        void SetConsumerCount(TInt aCount);
+        TInt ConsumerCount();
+        TPtrC8  Contract();
+        TPtrC8  Endpoint();
+        TPtrC8  ProviderId();        
+        TPtrC8  URI();
+        TTime  ValidUntil();
+        CSenElement* Policy();
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CNormalizedPolicyConatiner();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(CSenInternalWsPolicy* aPolicy, const TDesC8& aUri);    
+    
+    private:
+        HBufC8* iContract;
+        HBufC8* iEndpoint;
+        HBufC8* iProviderId;
+        HBufC8* iUri; //contents
+        TTime iValidUntil; //contents
+        TInt    iCount;
+        CSenElement* iPolicy;    
+    };
+//for loading and saving the DB    
+class CSenWSPolicyLoader : public CSenBaseFragment 
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenWSPolicyLoader* NewL(MSenCoreServiceManager& aManager);
+
+        static CSenWSPolicyLoader* NewLC(MSenCoreServiceManager& aManager);
+
+        virtual ~CSenWSPolicyLoader();
+
+        /**
+        * Load and parse Policies from the file.
+        * Statuscodes:
+        *   KErrNone                Ok
+        *  Other codes are system error codes.
+        * @return status code.
+        */
+        TInt LoadDBL();	//codescannerwarnings
+
+        /**
+        * Save Policies as an XML document into
+        * the file.
+        * Statuscodes:
+        *   KErrNone                Ok
+        *  Other codes are system error codes.
+        * @return status code.
+        */
+        TInt SaveDB();
+        TInt MergeToL();
+        // From CSenBaseFragment
+        /**
+        * Callback function which implements the XML content handler interface.
+        * @since Series60 3.0
+        * @param aNsURI     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        virtual void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+        // From CSenBaseFragment 
+        /**
+        * Callback function which implement the XML content handler interface.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        */
+        virtual void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                      const TDesC8& aQName);
+
+//new Methods  
+
+		RSenWSPolicyPtr AddWsPolicyL(CSenInternalWsPolicy* apPolicy,
+		                                          TInt& aErrorTo);
+                                                  
+        TInt RegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+        
+                                                    
+        
+        TInt AddWsPolicyL(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo);
+
+
+        TInt RemoveWsPolicyL( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo);    
+
+        CSenElement*  WsPolicyL( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo);
+                                                
+
+        TInt InternalWsPoliciesL(RSenWSPolicyArray& aPolicies);
+        TInt UnRegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo);
+                                                       
+
+	protected:
+	    RFileLogger* Log();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenWSPolicyLoader(MSenCoreServiceManager& aManager);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // New functions
+
+        /**
+        * Initialize this SenPolicyManager by parsing
+        * the given file with the given XMLReader.
+        * The file is expected to contain valid XML that
+        * follows the example given above.
+        * @param file
+        * @param reader
+        */
+        void LoadFromL(const TDesC& aFile);
+
+        /**
+        * Save the current state of the SenPolicyManager as an XML
+        * document into a file.
+        * Status codes:
+        *   KErrNone                Ok
+        *   Other codes are system error codes.
+        * @return status code.
+        */
+        TInt SaveToL( const TDesC& aFile );
+
+	    virtual TInt NextId();
+	    
+	    virtual void UpdateMaxId();
+	    CSenElement* CreatePolicyElementL(const TDesC8& aUri, const TDesC8& aPolicy);
+	    CSenElement* GetExpiryTagL(CSenElement& aPolicy);
+	    TInt EvaluateExpiryL(CSenElement* aExpiry, TTime& aExpiryTime);
+	    TInt ProcessNewPolicyL( const TDesC8& aUri, CSenElement& aPolicy);
+        TInt InternalWsPolicyL(CSenWSDescription& aPattern,
+								  RSenWSPolicyArray& aPolicies);
+        TInt InternalWsPolicyL(const TDesC8& aUri, RSenWSPolicyArray& aPolicies);
+
+        TInt RegisterWsPolicyL(CSenInternalWsPolicy* aInternalPolicy,
+                                                    TInt& aErrorTo);
+        
+        TInt AddWsPolicyL(const TDesC8& aUri, CSenElement* aPolicy, TInt& aErrorTo);
+        TInt VerifyPolicyContentsL(CSenInternalWsPolicy* apInternalPolicy, TInt& aErrorTo); //codescannerwarnings
+								  
+
+    private: // Data
+        MSenCoreServiceManager&     iManager;
+        RFileLogger*                iLog;                   // not owned (no create/close)    
+		RSenPolicyPtrArray      iPolicyArray;       // owned
+		
+		CSenBaseFragment*           ipPolicyContainer;  // owned
+		CSenWSPolicyIdentifier*   ipPolicyIdentifier; // owned
+		CSenInternalWsPolicy*     ipWSpolicy;           // owned
+		
+		TInt                        iMaxPolicyID;
+    };
+    
+//for Storing the Active consumer information
+class CConsumerContainer :public CBase
+    {
+    public:    
+        static CConsumerContainer* NewL(const TDesC8& aUri, const TDesC8& aConsumerId);
+        static CConsumerContainer* NewLC(const TDesC8& aUri, const TDesC8& aConsumerId);
+        virtual ~CConsumerContainer();
+        TPtrC8  Uri();
+        TPtrC8  ConsumerId();
+    private:
+        CConsumerContainer();
+        void ConstructL(const TDesC8& aUri, const TDesC8& aConsumerId);
+
+        HBufC8* iConsumerId;
+        HBufC8* iURI;
+    };    
+//for getting the expired policies information    
+class CExpiredPolicy :public CBase
+    {
+    public:
+        IMPORT_C static CExpiredPolicy* NewL(const TDesC8& aContract, const TDesC8& aEndpoint, 
+                                            const TDesC8& aUri, const TDesC8& aProviderId);
+        IMPORT_C static CExpiredPolicy* NewLC(const TDesC8& aContract, const TDesC8& aEndpoint, 
+                                            const TDesC8& aUri, const TDesC8& aProviderId);
+        IMPORT_C virtual ~CExpiredPolicy();
+
+
+        IMPORT_C TPtrC8  Contract();
+        IMPORT_C TPtrC8  Endpoint();
+        TPtrC8  ProvideId();
+        IMPORT_C TPtrC8  Uri();
+        IMPORT_C TPtrC8  Contents();
+
+        IMPORT_C TInt    SetContentsL(const TDesC8& aContent);
+        
+    private:
+        CExpiredPolicy();
+        void ConstructL(const TDesC8& aContract, const TDesC8& aEndpoint, const TDesC8& aUri, const TDesC8& aProviderId);
+        
+    private:
+        HBufC8* iContract; //service contract
+        HBufC8* iEndpoint; //service contract
+        HBufC8* iProvideId; //service contract
+        HBufC8* iURI; //uri to download
+        HBufC8* iContents; //contents
+    };
+#endif // SEN_WS_POLICY_MANAGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wsdlpolicyattachment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_WSDL_POLICY_ATTACHMENT_H
+#define WSSTAR_WSDL_POLICY_ATTACHMENT_H
+
+#include "SenElement.h"
+#include "SenBaseAttribute.h"
+#include "senpointermap.h"
+#include "SenDomFragment.h"
+
+//class CWsdlService;
+//class CWsdlPort;
+//class CWsdlBinding;
+//class CWsdlOperation;
+//class CWsdlInputOperation;
+//class CWsdlOutputOperation;
+//class CWsaEndpointReference;
+class CPolicyRegistry;
+class CWSPolicy;
+class CPolicyAssertion;
+typedef RSenPointerMap<TDesC8, CSenElement> RWsdlPolicyMap;
+
+namespace WsdlPolicyAttachment
+{
+//from wsdl
+    _LIT8(KDefinitions, "definitions");
+    _LIT8(KOperation, "operation");
+    _LIT8(KMessage, "message");
+    _LIT8(KPortType, "portType");
+    _LIT8(KPort, "port");
+    _LIT8(KBinding, "binding");
+    _LIT8(KService, "service");
+    _LIT8(KImport, "import");
+    _LIT8(KName, "name");
+    _LIT8(KElement, "element");
+    _LIT8(KType, "type");
+    _LIT8(KLocation, "location");
+    _LIT8(KInput, "input");
+    _LIT8(KOutput, "output");
+    _LIT8(KFault, "fault");
+    _LIT8(KRequired, "required");
+    _LIT8(KTargetNamespace, "targetNamespace");
+    _LIT8(KWsdlNsPrefix, "wsdl");
+    _LIT8(KWsdlNsUri, "http://schemas.xmlsoap.org/wsdl/");
+    
+//from policy    
+    _LIT8(KWspPolicyReference, "PolicyReference");
+    _LIT8(KUri, "URI");
+    _LIT8(KId, "Id");
+    _LIT8(KWsuId, "wsu:Id");
+    _LIT8(KPolicy, "Policy");
+    _LIT8(KWspNsUri, "http://schemas.xmlsoap.org/ws/2004/09/policy");
+    _LIT8(KWsuNsUri, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
+    _LIT8(KColon, ":");
+//from soap    
+    _LIT8(KAddress, "address");
+    _LIT8(KSoap12NsUri,"http://schemas.xmlsoap.org/wsdl/soap12/");
+//  {"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/soap-envelope"},
+//  {"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/soap-encoding"},
+//  {"xsi", "http://www.w3.org/2001/XMLSchema-instance"},
+//  {"xsd", ""}, // http://www.w3.org/2001/XMLSchema"}, // don't use this, it might conflict with xs
+//  {"xml", "http://www.w3.org/XML/1998/namespace"},
+//  {"xs", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/XMLSchema" },
+//  {"http", "http://schemas.xmlsoap.org/wsdl/http/"},
+//  {"soap", "http://schemas.xmlsoap.org/wsdl/soap/", "http://schemas.xmlsoap.org/wsdl/soap*/"},
+//  {"mime", "http://schemas.xmlsoap.org/wsdl/mime/"},
+//  {"dime", "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/", "http://schemas.xmlsoap.org/ws/*/dime/wsdl/"},
+//  {"wsdl", "http://schemas.xmlsoap.org/wsdl/"},
+//  {"gwsdl", "http://www.gridforum.org/namespaces/2003/03/gridWSDLExtensions"},
+//  {"sd", "http://www.gridforum.org/namespaces/2003/03/serviceData"},
+}
+
+class CWsdlPolicyAttachment :public CSenDomFragment
+{
+  
+  public:
+    IMPORT_C static CWsdlPolicyAttachment* NewL(const TDesC8& aWsdlFileName);
+    IMPORT_C static CWsdlPolicyAttachment* NewLC(const TDesC8& aWsdlFileName);
+
+    virtual ~CWsdlPolicyAttachment();
+//Service policy    
+    IMPORT_C CSenElement* GetEffectiveServicePolicyL(const TDesC8& aService); //codescannerwarnings
+//Endpoint policy    
+    IMPORT_C CSenElement* GetEffectiveEndpointPolicyL(const TDesC8& aService, const TDesC8& aPort); //codescannerwarnings
+//Operation Policy    
+    IMPORT_C CSenElement* GetEffectiveOperationPolicyL(const TDesC8& aService, const TDesC8& aPortName, const TDesC8& aOpName); //codescannerwarnings
+//Message Policies    
+    IMPORT_C CSenElement* GetEffectiveInputPolicyL(const TDesC8& aService, const TDesC8& aPortName, const TDesC8& aOpName);  //codescannerwarnings
+    IMPORT_C CSenElement* GetEffectiveOutputPolicyL(const TDesC8& aService, const TDesC8& aPortName, const TDesC8& aOpName);  //codescannerwarnings
+    IMPORT_C CSenElement* GetEffectiveFaultPolicyL(/*QName aService, */const TDesC8& aPortName, const TDesC8& aOpName);
+	
+
+private:
+
+    void ConstructL(const TDesC8& aWsdlFileName);
+
+    CWsdlPolicyAttachment();
+    void CreateWsdlPolicyL(const TDesC8& aWsdlContent);  //codescannerwarnings
+    TPtrC8 GetAttributeValueL(const TDesC8& aAttribute, CSenElement* aElement);
+
+    CSenElement* GetPolicyL(const TDesC8& aUri); //search the wsdl for policy tag with specific URI    
+    
+    CSenElement* GetServicePolicyL(const TDesC8& aServiceName);
+    CSenElement* GetServiceElementL(const TDesC8& aServiceName);
+    
+    CSenElement* GetPortPolicyL(const TDesC8& aServiceName, const TDesC8& aPort);
+    CSenElement* GetPortElementL(const TDesC8& aPortName, CSenElement* aElement);    
+//    CSenElement* GetPortElementL(const TDesC8& aPortName);
+    
+    CSenElement* GetPortTypePolicyL(const TDesC8& aServiceName, const TDesC8& aPort);
+    CSenElement* GetPortTypeElementL(const TDesC8& aPortTypeName);
+    
+    CSenElement* GetBindingPolicyL(const TDesC8& aServiceName, const TDesC8& aPort);
+    CSenElement* GetBindingElementL(const TDesC8& aBindingName);
+   
+    CSenElement* GetPortTypeOperationPolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName);
+    CSenElement* GetBindingOperationPolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName); 
+    CSenElement* GetOperationPolicyL(const TDesC8& aOpName, CSenElement* aElement); 
+
+    CSenElement* GetMessagePolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName, TBool aInput);
+    CSenElement* GetMessageElementL(const TDesC8& aMessageName);
+    
+    CSenElement* GetPortTypeOperationInputOutputPolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName, TBool aInput);
+    CSenElement* GetBindingOperationInputOutputPolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName, TBool aInput);
+    CSenElement* GetOperationInputOutputPolicyL(const TDesC8& aOpName, CSenElement* aElement, TBool aInput);
+    
+    CSenElement* GetElementL(const TDesC8& aName, const TDesC8& aType);
+    CSenElement* GetElementL(const TDesC8& aName, const TDesC8& aType, CSenElement* aElement);
+    CSenElement* GetPolicyReferenceL(CSenElement* aElement);
+    CSenElement* GetEffectivePolicyL(const TDesC8& aUri);
+    CWSPolicy* GetEffectivePolicyL(RPointerArray<CSenElement>& aPolicyArray, CPolicyRegistry* aReg);
+    
+    CWSPolicy* GetPolicyToSenL(CPolicyAssertion* aPolicy);
+    CPolicyAssertion* GetSenToPolicyL(CSenElement* aPolicy, CPolicyRegistry* aReg);
+    
+private:
+//    CWsdlService* iService;
+    CSenElement* iPolicy;
+    RWsdlPolicyMap iOriginalPolicies;
+    RWsdlPolicyMap iNormalizedPolicies;
+    TFileName iWsdlFileName;
+    TBool iParsed;
+    CPolicyRegistry* iRegistry;
+        
+};
+
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wspolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WS_POLICY_H
+#define WS_POLICY_H
+
+// INCLUDES
+#include <e32std.h>
+
+#include "SenDomFragment.h"
+#include <SenDomFragmentBase.h>
+#include "policyassertion.h"
+#include "xorcompositeassertion.h"
+#include "andcompositeassertion.h"
+#include "wspolicyreader.h"
+#include "wspolicyutils.h"
+// FORWARD DECLARATIONS
+class CWSPolicyReader;
+class CWSPolicyWriter;
+class CMyXml;
+/**
+ * Class: CWSPolicy
+ * Description: Public interface to a policy. A policy should be created by this class. 
+ * The policy will be stored as XML-DOM tree in memory and can be used to do different 
+ * kind of processings on the policy. i.e. Normalizing, intersecting and merging
+ */
+class CWSPolicy : public CBase
+    {
+
+    public:
+        //public two phase constructors
+        //still there is no purpose to create a policy with empty arguments ??
+        IMPORT_C    static CWSPolicy* NewL();
+        IMPORT_C    static CWSPolicy* NewLC();
+        //creates a policy from a descriptor
+        IMPORT_C    static CWSPolicy* NewL(TDesC8& aPolicyUri, TDesC8& aPolicy);
+        IMPORT_C    static CWSPolicy* NewLC(TDesC8& aPolicyUri, TDesC8& aPolicy);
+        //creates a policy from CSenElement    
+        IMPORT_C    static CWSPolicy* NewL(CSenElement* aPolicy);
+        IMPORT_C    static CWSPolicy* NewLC(CSenElement* aPolicy);
+        //creates a policy from TElement//libxml2
+        //IMPORT_C    static CWSPolicy* NewL(TElement aPolicy);
+        //IMPORT_C    static CWSPolicy* NewLC(TElement aPolicy);
+
+        IMPORT_C    TInt SetPolicyL(TDesC8& aPolicyUri, TDesC8& aPolicy);
+        //Normalize a policy using a registry to solve references
+        //returns ETrue if normalization is successfult else EFalse
+        IMPORT_C    TBool NormalizePolicyL(CPolicyRegistry* aRegistry);
+        CSenElement*  NormalizePolicy2L(CSenElement& aPolicy, CPolicyRegistry* aRegistry);
+        //Intersect a policy with second policy provided as a parameter
+        //return intersected policy
+        IMPORT_C    CWSPolicy* IntersectPolicyL(CWSPolicy* aPolicy);
+        //Merge a policy with second policy provided as a parameter
+        //return merged policy
+        IMPORT_C    CWSPolicy* MergePolicyL(CWSPolicy* aPolicy);
+            
+        //returns ETrue if the policy is normalized else EFalse
+        IMPORT_C    TBool Normalized();
+
+        IMPORT_C    HBufC8* PolicyAsXmlL();
+        IMPORT_C    CSenElement* PolicyL();	//codescannerwarnings
+        IMPORT_C    HBufC8* NormalizedAsXmlL();
+        IMPORT_C    CSenElement* NormalizedPolicy();
+        IMPORT_C    TBool IsExpiredPolicyL();	//codescannerwarnings
+        IMPORT_C    CSenElement* NonNormalizedPolicyL();	//codescannerwarnings
+        ~CWSPolicy();   
+        
+    private:
+        CWSPolicy();
+        void ConstructL();
+        TInt NormalizePL(CPolicyRegistry* aRegistry);
+        CWSPolicy* MergePL(CWSPolicy* aPolicy);
+        CWSPolicy* IntersectPL(CWSPolicy* aPolicy);	//codescannerwarnings  
+
+        void GeneratePolicyIdL(CSenElement* aPolicy);	//codescannerwarnings 
+        TPtrC8 PolicyIdL(CSenElement* aPolicy);
+        TPtrC8 PolicyNameL(CSenElement* aPolicy);
+        TInt AddPolicyNameL(CSenElement* aPolicy);
+        TInt AddPolicyMetadatEndpointL(CSenElement* aPolicy);
+        TInt AddPolicyIdL(CSenElement* aPolicy);
+        TInt AddPolicyValidityL(CSenElement* aPolicy);
+        TInt EvaluateExpiryL(CSenElement* aPolicy);	//codescannerwarnings 
+        CSenElement* GetExpiryTagL();	//codescannerwarnings 
+        void BaseConstructL(TDesC8& aPolicyUri, TDesC8& aPolicy);
+        void BaseConstructL(CSenElement* aPolicy);
+
+        MAssertion* NormaAssertion();
+
+    private: // Data
+
+        CWSPolicyReader* iReader;
+        CWSPolicyWriter* iWriter;
+        CMyXml* iInDoc;
+        CMyXml* iOutDoc;
+
+        CSenElement* iNormPolicy; //owned           
+        CPolicyAssertion* iNormaPolicyAssert; //owned
+        TBool iNormalized;
+        TBool iExpired;
+        HBufC8* iPolicyId;
+        HBufC8* iPolicyName;
+        HBufC8* iPolicyUri;
+        TInt count;
+        TTime iExpiry;
+    };
+
+class CMyXml :public CSenDomFragment
+{
+public:    
+    static CMyXml* NewL();
+    static CMyXml* NewLC();
+    ~CMyXml();
+    
+    TInt ReadFromDescL(const TDesC8& aData);
+    CSenElement* XMLDocL();
+private:
+
+    CMyXml();
+    void ConstructL();
+    TBool iParsed;
+
+};   
+#endif // WS_POLICY_H
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wspolicyreader.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef C_WS_POLICY_READER_H
+#define C_WS_POLICY_READER_H
+
+
+#include <e32std.h>
+#include <f32file.h>
+
+#include "SenDomFragment.h"
+#include "policyassertion.h"
+#include "primitiveassertion.h"
+
+class CPolicyAssertion;
+class CAndCompositeAssertion;
+class CXorCompositeAssertion;
+class CAssertion;
+class CPrimitiveAssertion;
+class CPolicyReferenceAssertion;
+namespace WSPolicy
+{
+
+	_LIT8( KAndCompositeAssertion , "All");             // Tag name of AndComposteAssertion
+	_LIT8( KXorCompositeAssertion , "ExactlyOne");      // Tag name of XorCompositeAssertion
+	_LIT8( KWsPolicy , "Policy");                       // Tag name of Policy
+	_LIT8( KWsPolicyPrefix , "wsp");                    // Prefix of WS-Policy namespace
+	_LIT8( KWsuNsPrefix , "wsu");                       // Prefix of WSU namespace
+	_LIT8( KWsPolicyReference , "PolicyReference");     // Tag name of PolicyReference
+	_LIT8( KWspOptinal , "wsp:Optional");             // Tag name of Optional Attribute
+	_LIT8( KWspOptinalTrue , "true");             // Tag name of Optional Attribute TRUE
+	_LIT8( KWspOptinalFalse , "false");             // Tag name of Optional Attribute FALSE
+	_LIT8( KWsPolicyNsUri , "http://schemas.xmlsoap.org/ws/2004/09/policy"); // Namespace of WS-Policy
+    
+    _LIT8( KWsuPrefix , "wsu"); // Namespace of WSU	
+	_LIT8( KWsuNsUri , "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); // Namespace of WSU
+	_LIT8( KXmlNsUri , "http://www.w3.org/XML/1998/namespace"); // XML namespace
+	
+	_LIT8( KWsuId , "wsu:Id");                       // Prefix ID
+	_LIT8( KId , "Id");                       // Prefix ID
+	_LIT8( KName, "Name"); 
+	_LIT8( KWsSecuritypolicyPrefix , "sp");                    // Prefix of WS-Security Policy namespace
+	_LIT8( KWsSecurityPolicyNsUri , "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"); // Namespace of WS-Security Policy
+	
+	_LIT8( KUri , "URI");                       // PolicyReference URI
+
+}
+
+namespace  MSWSPolicy
+{
+ 	_LIT8( KMSNsPrefix, "mws");
+ 	_LIT8( KMetaDataValidity, "metadatavalidity");
+	_LIT8( KExpiry, "Expiry");
+	_LIT8(KMetaDataLocalName, "MetadataEndpoint");    
+}
+
+class CWSPolicyReader : public CBase
+{
+public:
+    static  CWSPolicyReader* NewL();
+    static  CWSPolicyReader* NewLC();
+    ~CWSPolicyReader();
+
+    CPolicyAssertion* GetPolicyL(CSenElement* aPolicy);
+private:
+     CPolicyAssertion* ReadPolicyL(CSenElement* aEle);
+     CAndCompositeAssertion* ReadAndAssertionL(CSenElement* aEle);
+     CXorCompositeAssertion* ReadXorAssertionL(CSenElement* aEle);
+     CAssertion* ReadAssertionL(CSenElement* aEle);
+     CPolicyReferenceAssertion* ReadPolicyReferenceL(CSenElement* aEle);
+     CPrimitiveAssertion* ReadPrimitiveAssertionL(CSenElement* aEle);
+     void ReadTermsL(CSenElement* aEle, RPointerArray<MAssertion>& aTerms);
+     void GetAttributesL(CSenElement* aEle, RAttributeMap& aAttributes);
+     
+     TPtrC8 GetAttribL(TPtrC8 aReference, CSenElement* aEle);
+     
+     CWSPolicyReader();
+     void ConstructL();
+private:
+    TInt count;
+};
+#endif //C_WS_POLICY_READER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wspolicyregistry.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_POLICY_REGISTRY_H
+#define WSSTAR_POLICY_REGISTRY_H
+
+// INCLUDES
+#include <e32std.h>
+#include "senwsdescription.h"
+#include "senpointermap.h"
+
+// FORWARD DECLARATIONS
+class CWSPolicy;
+// CONSTANTS
+typedef RSenPointerMap<TDesC8, CSenElement> RPolicyMap;
+
+
+/**
+ * Class: CPolicyRegistry  
+ *
+ * Description: This class holds information about all the policies present in the current session.
+ * This information is used to solve the policy references with-in the policies.
+ * Also while creating this registry, polices can be checked for validity/expiration and can be 
+ * re-obtained from the service.
+ */
+class CPolicyRegistry : public CBase
+{
+  public:
+IMPORT_C    static CPolicyRegistry* NewL();
+IMPORT_C    static CPolicyRegistry* NewLC();
+            ~CPolicyRegistry();
+    
+IMPORT_C	void SetParent(CPolicyRegistry* parent);
+IMPORT_C	CPolicyRegistry* Parent();
+IMPORT_C    CSenElement* LookupPolicy(const TPtrC8& aPolicyURI);
+IMPORT_C    CSenElement* LookupPolicyByNameL(const TPtrC8& aPolicyName);	//codescannerwarnings
+//IMPORT_C    void RegisterPolicy(TDesC8& aPolicyURI, CWSPolicy* aPolicy);
+IMPORT_C    void RegisterPolicy(TDesC8& aPolicyID, CSenElement* aPolicy);
+IMPORT_C	void UnregisterPolicy(const TPtrC8& aPolicyID);
+	
+IMPORT_C	void PopulateRegistryL(CSenElement* aServicePolicy);	//codescannerwarnings
+IMPORT_C    void ResetRegistry();
+private:       
+    TPtrC8 PolicyIdL(CSenElement* aPolicy);
+    TPtrC8 PolicyNameL(CSenElement* aPolicy);
+    CPolicyRegistry();
+    void ConstructL();
+    
+    RPolicyMap iRegistry;
+    CPolicyRegistry* iParent;
+}; 
+
+#endif // WSSTAR_POLICY_REGISTRY_H
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wspolicyutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This utility class provides static methods for conversions*
+*/
+
+
+
+
+
+
+
+
+#ifndef WS_POLICYC_UTILS_H
+#define WS_POLICYC_UTILS_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "massertion.h"
+// CLASS DECLARATION
+class CPolicyRegistry;
+class CPolicyAssertion;
+/**
+*  @lib WSPolicy.lib
+*  @since Series60 3.0
+*/
+class CWSPolicyUtils : public CBase
+    {
+    public: 
+
+        static CPolicyAssertion* GetPolicy(RPolicyTerms& terms);
+        static CPolicyAssertion* GetSinglePolicyL(RPolicyTerms& policyList, CPolicyRegistry* reg);
+        static void GetPrimTermsListL(CPolicyAssertion* policy, RPolicyTerms& aTerms); 
+        
+        IMPORT_C static TPtrC8 PolicyNameL(CSenElement* aPolicy);
+
+        /**
+        */
+        IMPORT_C static TPtrC8 PolicyIdL(CSenElement* aPolicy);
+        
+        IMPORT_C static TPtrC8 PolicyUriL(CSenElement* aPolicy);
+                /**
+        */
+        IMPORT_C static TBool IsExpiredPolicyL(CSenElement* aPolicy);
+
+
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        CWSPolicyUtils() { }
+
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        CWSPolicyUtils( const CWSPolicyUtils& );
+
+        /**
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        CWSPolicyUtils& operator=( const CWSPolicyUtils& );
+        
+        static CSenElement* GetExpiryTagL(CSenElement* aPolicy);
+    };
+
+#endif // WS_POLICYC_UTILS_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wspolicywriter.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef C_WS_POLICY_WRITER_H
+#define C_WS_POLICY_WRITER_H
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include <s32mem.h>
+
+#include "SenDomFragment.h"
+#include "policyassertion.h"
+#include "primitiveassertion.h"
+
+class CPolicyAssertion;
+class CAndCompositeAssertion;
+class CXorCompositeAssertion;
+class CAssertion;
+class CPrimitiveAssertion;
+class CPolicyReferenceAssertion;
+namespace PolicyWriter
+{
+    // XML String constants
+_LIT8(KSenColon,                 ":");
+_LIT8(KStartElement,              "<");
+_LIT8(KSenGreaterThan,           ">");
+_LIT8(KSenSpace,                 " ");
+_LIT8(KSenDblQuot,               "\"");
+_LIT8(KSenEquals,                "=");
+_LIT8(KSenEqualsDblQuot,         "=\"");
+_LIT8(KEndElement,               "/>");
+_LIT8(KSenLessThanSlash,         "</");
+_LIT8(KSenSpaceXmlns,            " xmlns");
+_LIT8(KSenXmlns,                 "xmlns");
+_LIT8(KSenXmlNsAttNamePlusColon, " xmlns:"); 
+
+// The predeclared, basic XML entities:
+// &apos;    (')
+// &quot;    (")
+// &gt;      (>)
+// &lt;      (<)
+// &amp;     (&)
+_LIT8(KSenQuotedApos,    "&apos;");
+_LIT8(KSenQuotedDblQuot, "&quot;");
+_LIT8(KSenQuotedGt,      "&gt;");
+_LIT8(KSenQuotedLt,      "&lt;");
+_LIT8(KSenQuotedAmp,     "&amp;");
+_LIT8(KWspPolicyPrefix,     "wsp:Policy");
+_LIT8(KWspXorPrefix,     "wsp:ExactlyOne");
+_LIT8(KWspAndPrefix,     "wsp:All");
+_LIT8(KWspPolicyReferencePrefix,     "wsp:PolicyReference");
+_LIT8(KWspPolicyReferenceUri,     "URI ");
+
+_LIT8(KSenXmlNsAttNamePlusColonWsp, " xmlns:wsp");
+}
+
+typedef RSenPointerMap<TDesC8, TDesC8> RNamespaceMap;
+
+class CWSPolicyWriter : public CBase
+{
+public:
+    static  CWSPolicyWriter* NewL();
+    static  CWSPolicyWriter* NewLC();
+    ~CWSPolicyWriter();
+    
+//#ifdef _SENDEBUG    
+    void WriteToFileAllL(CSenElement* aXml);
+    void WriteToFileAllL(TDesC8& aXml);
+//#endif
+    
+    HBufC8* WriteAllAsXMlL(CPolicyAssertion* aPolicy);
+    HBufC8* WriteAllAsXmlL(CSenElement* aXml);
+    TPtrC8 WriteToBufL(CBufBase& aBuf, CPolicyAssertion* aEle);
+private:
+    
+     TInt WritePolicyL(CPolicyAssertion* aEle, RWriteStream& aWriteStream);
+     TInt WriteAndAssertionL(CAndCompositeAssertion* aEle, RWriteStream& aWriteStream);
+     TInt WriteXorAssertionL(CXorCompositeAssertion* aEle, RWriteStream& aWriteStream);
+     TInt WriteAssertionL(MAssertion* aEle, RWriteStream& aWriteStream);
+     TInt WritePolicyReferenceL(CPolicyReferenceAssertion* aAssertion, RWriteStream& aWriteStream);
+     TInt WritePrimitiveAssertionL(CPrimitiveAssertion* aEle, RWriteStream& aWriteStream);
+     TInt WriteTermsL(RPointerArray<MAssertion>& aTerms, RWriteStream& aWriteStream);
+     void WriteAttributesL(CPrimitiveAssertion* aAsserion, RWriteStream& aWriteStream);
+     
+     TPtrC8 GetAttrib(TPtrC8 aReference, CSenElement* aEle);
+     
+     TInt AddNameSpaceL(TPtrC8 aName, TPtrC8 aUri);	//codescannerwarnings
+     TBool IsNamespaceAdded(TPtrC8 aName);
+     
+     CWSPolicyWriter();
+     void ConstructL();
+private:
+    RNamespaceMap iNamespcaes;
+    TInt count;
+};
+#endif //C_WS_POLICY_WRITER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wssecuritypolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,639 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_SECURITY_POLICY_H
+#define WSSTAR_SECURITY_POLICY_H
+
+#include <SenElement.h>
+
+#include "wssecuritypolicyconstants.h"
+
+    
+// CLASS DECLARATION
+/**
+ * Class: CWsSecurityPolicy
+ *
+ * Description: Class which can holds the information found in a WS SecurityPolicy Assertion
+ *              The information can be Intersected and Merged with other  CWsSecurityPolicy 
+ *              object and a resultant CSenElement* will be provided holding Intersected or Merged data.
+ */
+class CWsSecurityPolicy : public CBase
+    {
+    public:
+
+        /**
+        * Standard 2 phase constructor
+        * @since Series60 5.0
+        * @return new instance of CWsSecurityPolicy object
+        */
+        static CWsSecurityPolicy* NewL();
+        static CWsSecurityPolicy* NewLC();
+
+        virtual ~CWsSecurityPolicy();
+        /**
+        * Intersect the two WsSecurityPolicy Assertions
+        * @since Series60 5.0
+        * @param aKey: Name of the WsSecurityPolicy assertion
+        * @param aFirst: First assertion to intersect
+        * @param aSecond: Second assertion to intersect with aFirst
+        * @return new Element containing the Intersected Element 
+        * or NULL if intersection return no result
+        */
+
+        CSenElement* IntersectL(TDesC8& aKey, CSenElement* aFirst, CSenElement* aSecond);	//codescannerwarnings
+
+        /**
+        * Merge the two WsSecurityPolicy Assertions
+        * @since Series60 5.0
+        * @param aKey: Name of the WsSecurityPolicy assertion
+        * @param aFirst: First assertion to merge
+        * @param aSecond: Second assertion to merge with aFirst
+        * @return new Element containing the Merged Element 
+        * or NULL if merging return no result
+        */
+        CSenElement* MergeL(TDesC8& aKey, CSenElement* aFirst, CSenElement* aSecond);	//codescannerwarnings
+
+    private:
+        void ConstructL();
+        CWsSecurityPolicy();
+    };
+
+/**
+ * Class: CAlgorithmSuite
+ *
+ * Description: Class which can holds the information found in a WS-SecurityPolicy Assertion "AlgorithmSuite"
+ * and provide information related to that particular assertion
+ */
+
+class CAlgorithmSuite : public CBase
+    {
+    public:
+        static CAlgorithmSuite* NewL(CSenElement* aAlgoSuite);
+        static CAlgorithmSuite* NewLC(CSenElement* aAlgoSuite);
+        virtual ~CAlgorithmSuite();
+  
+        TPtrC8 AlgoSuite();
+        TPtrC8 SymmetricSignature();
+        TPtrC8 AsymmetricSignature();
+        TPtrC8 ComputedKey();
+        TInt MaximumSymmetricKeyLength();
+        TInt MinimumAsymmetricKeyLength();
+        TInt MaximumAsymmetricKeyLength();
+        TPtrC8 Digest();
+        TPtrC8 Encryption();
+        TPtrC8 SymmetricKeyWrap();
+        TPtrC8 AsymmetricKeyWrap();
+        TPtrC8 EncryptionKeyDerivation();
+        TPtrC8 SignatureKeyDerivation();
+        TInt MinimumSymmetricKeyLength();
+        TPtrC8 C14n();
+        TPtrC8 SoapNormalization();
+        TPtrC8 StrTransform();
+        TPtrC8 XPath();
+        TPtrC8 XPathFilter20();
+
+
+        void SetC14nL(TDesC8& aValue);	//codescannerwarnings
+        void SetSoapNormalizationL(TDesC8& aValue);	//codescannerwarnings
+        void SetStrTransformL(TDesC8& aValue);	//codescannerwarnings
+        void SetXPathL(TDesC8& aValue);	//codescannerwarnings
+        void SetXPathFilter20L(TDesC8& aValue);	//codescannerwarnings
+
+        TBool IsEqualAlgoSuite(CAlgorithmSuite* aAlgoSuite);
+
+    private:
+        void ConstructL(CSenElement* aAlgoSuite);
+        void SetAlgoSuiteL(TDesC8& aSuiteName);	//codescannerwarnings
+        CAlgorithmSuite();
+        
+    private: // Data
+        HBufC8* iAlgoSuite;
+        
+        HBufC8* iSymmetricSignature;
+        HBufC8* iAsymmetricSignature;
+        HBufC8*  iComputedKey;
+        TInt iMaximumSymmetricKeyLength;
+        TInt iMinimumAsymmetricKeyLength;
+        TInt iMaximumAsymmetricKeyLength;
+        HBufC8* iDigest;
+        HBufC8* iEncryption;
+        HBufC8* iSymmetricKeyWrap;
+        HBufC8* iAsymmetricKeyWrap;
+        HBufC8* iEncryptionKeyDerivation;
+        HBufC8* iSignatureKeyDerivation;
+        TInt iMinimumSymmetricKeyLength;
+        HBufC8* iC14n; 
+        HBufC8* iSoapNormalization;
+        HBufC8* iStrTransform;
+        HBufC8* iXPath;
+        HBufC8* iXPathFilter20; 
+    };
+
+
+class CXmlHelper : public CBase
+    {
+    public:
+        static CSenElement* RipPolicyXORElementL(CSenElement* aAsymmBinding);	//codescannerwarnings   
+        static TBool HasAttributeL(CSenElement* aAsymmBinding, const TDesC8& aAttrib);
+        static TPtrC8 AttributeValueL(CSenElement* aAssertion, const TDesC8& aAttrib);
+    private:        
+        CXmlHelper() { }
+        CXmlHelper( const CXmlHelper& );
+        CXmlHelper& operator=( const CXmlHelper& );
+    
+    };
+
+/**
+ * Class: CLayout
+ *
+ * Description: Class which can holds the information found in a WS-SecurityPolicy Assertion "Layout"
+ * and provide information related to that particular assertion
+ */
+
+class CLayout : public CBase
+    {
+    public:
+        static CLayout* NewL(CSenElement* aLayout);
+        static CLayout* NewLC(CSenElement* aLayout);
+        virtual ~CLayout();
+
+        TPtrC8 Layout() { return iLayout;}
+        TBool IsEqualLayout(CLayout* aLayout);
+
+    private:
+        void ConstructL(CSenElement* aLayout);
+        CLayout();
+    private: // data
+        TPtrC8 iLayout;
+    };
+////////////////////////////////////////////////////
+////////////////////////////////////////////////////
+/**
+ * Class: CToken
+ *
+ * Description: Base class to hold WS-SecurityPolicy Assertion "Token" common values
+ */
+
+class CToken : public CBase
+    {
+    public:
+        virtual ~CToken();
+    protected:
+        CToken();
+        
+        inline TPtrC8 GetTokenInclusion() {return iTokenInclusion;}
+        inline TBool DerivedKeys() {return iDerivedKeys;}
+        inline void SetDerivedKeys(TBool aDerivedKeys) { iDerivedKeys = aDerivedKeys; }
+        void BaseConstructL(CSenElement* aToken);
+    private:
+        void ConstructL(CSenElement* aToken);
+    private: // Data
+        TPtrC8 iTokenInclusion;
+        TBool iDerivedKeys;
+    };
+//TOKEN TYPES
+
+/**
+ * Class: CUsernameToken
+ *
+ * Description: Class to hold WS-SecurityPolicy Assertion "UsernameToken"
+ * This class extends the CToken class
+ */
+class CUsernameToken : public CToken
+    {
+    public:
+        static CUsernameToken* NewL(CSenElement* aToken);
+        static CUsernameToken* NewLC(CSenElement* aToken);
+        virtual ~CUsernameToken();
+        TPtrC8 UserNameToken() {return iUsernameTokenProfile;}
+    private:
+        CUsernameToken();  
+        void ConstructL(CSenElement* aToken);
+
+        TPtrC8 iUsernameTokenProfile;
+    };
+
+class CRequestSecurityTokenTemplate :public CBase
+    {
+    public:
+        static CRequestSecurityTokenTemplate* NewL(CSenElement* aToken);
+        static CRequestSecurityTokenTemplate* NewLC(CSenElement* aToken);
+        virtual ~CRequestSecurityTokenTemplate();
+        TPtrC8 Token() {return iToken->Des();}
+        TPtrC8 TrustVersion() {return iTrustVersion->Des();}
+    private:
+        CRequestSecurityTokenTemplate();  
+        void ConstructL(CSenElement* aToken);
+
+    private: // Data
+        HBufC8* iToken;
+        HBufC8* iTrustVersion;
+    };
+
+class CHttpsToken : public CToken
+{
+    public: 
+        static CHttpsToken* NewL(CSenElement* aToken);
+        static CHttpsToken* NewLC(CSenElement* aToken);
+        virtual ~CHttpsToken();
+        TBool RequireClientCertificate() {return iRequireClientCertificate; }
+        CSenElement* HttpsTokenPolicy() {return iPolicy; }
+  
+    private:
+        CHttpsToken();  
+        void ConstructL(CSenElement* aToken);
+
+    private: // Data
+        TBool iRequireClientCertificate;
+        CSenElement* iPolicy;
+
+};
+
+class CSamlToken : public CToken
+    {
+    public:
+        static CSamlToken* NewL(CSenElement* aToken);
+        static CSamlToken* NewLC(CSenElement* aToken);
+        virtual ~CSamlToken();
+        TBool RequireDerivedKeys() {return iRequireDerivedKeys; }
+        TBool RequireKeyIdentifierReference() {return iRequireKeyIdentifierReference; }
+        TPtrC8 SamlTokenProfile() {return iSamlTokenProfile; }
+
+    private:
+        CSamlToken();  
+        void ConstructL(CSenElement* aToken);
+
+    private: // Data
+        TBool iRequireDerivedKeys;
+        TBool iRequireKeyIdentifierReference;
+        TPtrC8 iSamlTokenProfile;
+    };
+    
+class CSecureConversationToken : public CToken
+    {
+    public:
+        static CSecureConversationToken* NewL(CSenElement* aToken);
+        static CSecureConversationToken* NewLC(CSenElement* aToken);
+        virtual ~CSecureConversationToken();
+
+        TPtrC8 Issuer();
+        TBool RequireExternalUriReference();
+        TBool SC10SecurityContextToken();
+        TBool RequireDerivedKeys() {return iRequireDerivedKeys; }
+        TBool IsBootstrapPolicy();
+        CSenElement* BootstrapPolicy();
+        
+    private:
+        CSecureConversationToken();  
+        void ConstructL(CSenElement* aToken);
+
+    private: // Data
+        HBufC8* iIssuer;
+        TBool iRequireExternalUriReference;
+        TBool iSC10SecurityContextToken;
+        TBool iRequireDerivedKeys;
+        TBool iBootstrap;
+        CSenElement* iBootstrapPolicy;
+    };
+
+
+
+/*
+<wsp:Policy>
+<sp:IssuedToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+<sp:Issuer> 
+    <EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
+    <Address>http://AdressOfTheSTS.com</Address>
+</sp:Issuer>
+<sp:RequestSecurityTokenTemplate>
+    <!-- Policy defined by the Service for the STS -->
+    <wst:TokenType>urn:oasis:names:tc:SAML:1.1</wst:TokenType>
+    <wst:KeyType> http://schemas.xmlsoap.org/ws/2004/04/trust/SharedKey </wst:KeyType>
+</sp:RequestSecurityTokenTemplate>
+</sp:IssuedToken>
+</wsp:Policy>
+*/
+class CIssuedToken : public CToken
+    {
+    public:
+        static CIssuedToken* NewL(CSenElement* aToken);
+        static CIssuedToken* NewLC(CSenElement* aToken);
+        virtual ~CIssuedToken();
+        CSenElement* Issuer() {return iIssuer; }
+        TBool RequireDerivedKeys() {return iRequireDerivedKeys; }
+        CSenElement* RequestSecurityTokenTemplate() {return  iRequestSecurityTokenTemplate;}
+    private:
+        CIssuedToken();  
+        void ConstructL(CSenElement* aToken);
+
+    private: // Data
+        CSenElement* iIssuer; //not owned
+        TBool iRequireDerivedKeys;
+        CSenElement* iRequestSecurityTokenTemplate; //not owned
+        TBool iRequireExternalReference;
+        TBool iRequireInternalReference;
+      
+    };
+
+//TOKEN HOLDER
+/**
+ * Class: CTokenHolder
+ *
+ * Description: Class to hold different kind of tokens.
+ * It also holds the name of the Token and the token is casted to that particulat token type.
+ */
+
+class CTokenHolder : public CBase
+{
+    public:
+        static CTokenHolder* NewL(CSenElement* aToken);
+        static CTokenHolder* NewLC(CSenElement* aToken);
+        virtual ~CTokenHolder();
+
+    private:
+
+        void ConstructL(CSenElement* aToken);
+        CTokenHolder();
+
+    private: // Data
+        TPtrC8  iTokenType;
+        CToken* iToken;
+};
+
+////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////
+class CBinding  : public CBase
+{
+    public:
+        static CBinding* NewL(CSenElement* aBinding);
+        static CBinding* NewLC(CSenElement* aBinding);
+        virtual ~CBinding();
+
+    protected:
+        CBinding(); 
+        CAlgorithmSuite* GetAlgoSuite() {return iAlgorithmSuite;}
+        CLayout* GetLayout() {return iLayout;}
+        TBool IncludetimeStamp() {return iIncludeTimestamp;}
+        void SetbaseElementL(CSenElement* aBinding);
+
+    private:
+        void ConstructL(CSenElement* aBinding);
+
+    private: // Data
+        CAlgorithmSuite* iAlgorithmSuite;
+        CLayout* iLayout;
+        TBool iIncludeTimestamp;
+};
+
+class CSymmAsymmBinding : public CBinding
+    {
+    public:
+        static CSymmAsymmBinding* NewL(CSenElement* aBinding);
+        static CSymmAsymmBinding* NewLC(CSenElement* aBinding);
+        virtual ~CSymmAsymmBinding();
+
+    protected:
+        void BaseConstructL(CSenElement* aBinding);
+        CSymmAsymmBinding();
+
+        TPtrC8 EncryptBeforeSigning() {return iProtectionOrder;}
+        TBool  EncryptSignature() {return iEncryptSignature;}
+        TBool  ProtectTokens() {return iProtectTokens;}
+        TBool  OnlySignEntireHeadersAndBody() {return iOnlySignEntireHeadersAndBody;}
+
+    private:
+        void ConstructL(CSenElement* aBinding);
+
+    private: // Data
+        TPtrC8 iProtectionOrder;
+        TBool iEncryptSignature;
+        TBool iProtectTokens;
+        TBool iOnlySignEntireHeadersAndBody;  
+    };
+
+class CTranportBinding : public CBinding
+    {
+    public:
+        static CTranportBinding* NewL(CSenElement* aTransportBinding);
+        static CTranportBinding* NewLC(CSenElement* aTransportBinding);
+        virtual ~CTranportBinding();
+        TBool IsEqualTransportBindingAssertion(CTranportBinding* aTransportBinding);
+        
+    protected:
+        CTokenHolder* GetTransportToken() {return iTransportToken;}
+        
+    private:
+        void ConstructL(CSenElement* aTransportBinding);
+        CTranportBinding();
+
+    private: // Data
+        CTokenHolder* iTransportToken;
+    };
+
+
+class CAsymmetricBinding : public CSymmAsymmBinding
+    {
+    public:
+        static CAsymmetricBinding* NewL(CSenElement* aAsymmBinding);
+        static CAsymmetricBinding* NewLC(CSenElement* aAsymmBinding);
+        virtual ~CAsymmetricBinding();
+        TBool IsEqualAsymmtericAssertion(CAsymmetricBinding* aAsymmetricBinding);
+
+    protected:
+        CTokenHolder* GetInitiatorToken() {return iInitiatorToken;}
+        CTokenHolder* GetRecipientToken() {return iRecipientToken;}      
+
+    private:
+        void ConstructL(CSenElement* aAsymmBinding);
+        CAsymmetricBinding();
+
+    private: // Data
+        CTokenHolder* iInitiatorToken;
+        CTokenHolder* iRecipientToken;
+
+};
+
+
+class CSymmetricBinding : public CSymmAsymmBinding
+    {
+    public:
+        static CSymmetricBinding* NewL(CSenElement* aSymmBinding);
+        static CSymmetricBinding* NewLC(CSenElement* aSymmBinding);
+        virtual ~CSymmetricBinding();
+        TBool IsEqualSymmtericAssertion(CSymmetricBinding* aSymmetricBinding);
+
+    protected:
+        CTokenHolder* GetEncryptionToken() {return iEncriptionToken;}
+        CTokenHolder* GetSignatureToken() {return iSignatureToken;}      
+
+    private:
+        void ConstructL(CSenElement* aSymmBinding);
+        CSymmetricBinding();
+
+    private: // Data
+        CTokenHolder* iEncriptionToken;
+        CTokenHolder* iSignatureToken;
+        CTokenHolder* iProtectionToken;
+    };
+
+class CWss10 :public CBase
+    {
+    public:
+        static CWss10* NewL(CSenElement* aAssertion);
+        static CWss10* NewLC(CSenElement* aAssertion);
+        virtual ~CWss10();
+
+        TBool IsEqualWss10Assertion(CWss10* aAssertion);
+
+        TBool MustSupportRefKeyIdentifier();
+        TBool MustSupportRefIssuerSerial();
+        TBool MustSupportRefExternalURI();
+        TBool MustSupportRefEmbeddedToken();
+        
+    protected:
+        void BaseConstructL(CSenElement* aAssertion); 
+        CWss10();
+        
+    private:
+        void ConstructL(CSenElement* aAssertion);
+
+    private: // Data
+        TBool iMustSupportRefKeyIdentifier;
+        TBool iMustSupportRefIssuerSerial;
+        TBool iMustSupportRefExternalURI;
+        TBool iMustSupportRefEmbeddedToken;
+    };
+
+class CWss11 : public CWss10
+    {
+    public:
+        static CWss11* NewL(CSenElement* aAssertion);
+        static CWss11* NewLC(CSenElement* aAssertion);
+        virtual ~CWss11();
+
+        TBool IsEqualWss11Assertion(CWss11* aAssertion);
+
+        TBool MustSupportRefThumbprint();
+        TBool MustSupportRefEncryptedKey();
+        TBool RequireSignatureConfirmation();  
+
+    private:
+        void ConstructL(CSenElement* aAssertion);
+        CWss11();
+
+    private: // Data
+        TBool iMustSupportRefThumbprint;
+        TBool iMustSupportRefEncryptedKey;
+        TBool iRequireSignatureConfirmation;
+
+    };
+
+class CWsTrust10 :public CBase
+    {
+    public:
+        static CWsTrust10* NewL(CSenElement* aAssertion);
+        static CWsTrust10* NewLC(CSenElement* aAssertion);
+        virtual ~CWsTrust10();
+
+        TBool IsEqualWsTrust10Assertion(CWsTrust10* aAssertion);
+        
+        TBool MustSupportClientChallenge();
+        TBool MustSupportServerChallenge();
+        TBool RequireClientEntropy();
+        TBool RequireServerEntropy();
+        TBool MustSupportIssuedTokens();
+
+    private:
+        void ConstructL(CSenElement* aAssertion);
+        CWsTrust10(); 
+
+    private: // Data
+        TBool iMustSupportClientChallenge;
+        TBool iMustSupportServerChallenge;
+        TBool iRequireClientEntropy;
+        TBool iRequireServerEntropy;
+        TBool iMustSupportIssuedTokens;
+    };
+
+struct SoapHeader
+    {
+	TPtrC8 iName;
+	TPtrC8 iNsUri;
+    };
+
+class CEncryptedSignedParts : public CBase
+    {
+    public:
+        static CEncryptedSignedParts* NewL(CSenElement* aAssertion);
+        static CEncryptedSignedParts* NewLC(CSenElement* aAssertion);
+        virtual ~CEncryptedSignedParts();
+
+        TBool IsEqualEncryptedSignedParts(CEncryptedSignedParts* aAssertion);
+        void ElementsL(RPointerArray<HBufC8>& aElements);	//codescannerwarnings
+        TBool Header();
+        TBool Body();
+    //    void GetHeaders()
+    private:
+        void ConstructL(CSenElement* aAssertion);
+        CEncryptedSignedParts(); 
+
+    private: // Data
+        TBool iHeader;
+        TBool iBody;
+        RArray<SoapHeader> iHeaders;  
+        
+    };
+
+class CEncryptedSignedElements : public CBase
+    {
+    public:
+        static CEncryptedSignedElements* NewL(CSenElement* aAssertion);
+        static CEncryptedSignedElements* NewLC(CSenElement* aAssertion);
+        virtual ~CEncryptedSignedElements();
+        
+        TBool IsEqualEncryptedSignedElements(CEncryptedSignedElements* aAssertion);
+        TBool MergedElements(CEncryptedSignedElements* aAssertion, RArray<TPtrC8>& aResult);
+        TPtrC8 XPathVersion() { return iXPathVersion->Des(); }
+        
+        TBool IfNsQualified(CSenElement* aAssertion, TDesC8& aXpath);
+        TInt GetXPaths(RArray<TPtrC8>& aXpaths); //will return copy of xpaths and RArray ownership
+
+    private:
+        void ConstructL(CSenElement* aAssertion);
+        CEncryptedSignedElements(); 
+
+    private: // Data
+        HBufC8* iXPathVersion;
+        RArray<TPtrC8> iXpaths;
+    };
+
+
+#endif //WSSTAR_SECURITY_POLICY_H
+
+// END OF FILE
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/wssecuritypolicyconstants.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+ 
+
+#ifndef WSSTAR_SECURITY_POLICY_CONSTANTS_H
+#define WSSTAR_SECURITY_POLICY_CONSTANTS_H
+
+
+namespace WsSecurityPolicy 
+    {	
+	_LIT8(KIncludeNever, "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never");
+	_LIT8(KIncludeOnce, "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Once");
+	_LIT8(KIncludeAlwaysToReceipent, "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient");
+	_LIT8(KIncludeAlways, "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always");
+
+    // Prefix of WS-Security Policy namespace:
+	_LIT8( KWsSecuritypolicyPrefix , "sp");   
+	                 
+    // Namespace of WS-Security Policy:
+	_LIT8( KWsSecurityPolicyNsUri , "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy");
+    _LIT(KSlash, "//");
+    _LIT8(KColon, ":");
+    _LIT8(KTrue, "true");
+    _LIT8(KFalse, "false");
+
+    _LIT8(KXPath, "XPath"); 
+    _LIT8(KXPathVersion, "XPathVersion"); 
+
+    _LIT8(KHeader, "Header"); 
+    _LIT8(KBody, "Body"); 
+    _LIT8(KName, "Name"); 
+    
+    _LIT8(KNamespace, "Namespace");
+    //5.1.1
+    _LIT8(KSignedParts, "SignedParts"); 
+    //5.1.2    
+    _LIT8(KSignedElements, "SignedElements"); 
+    //5.2.1    
+    _LIT8(KEncryptedParts, "EncryptedParts"); 
+    //5.2.2    
+    _LIT8(KEncryptedElements, "EncryptedElements");
+    //5.3    
+    _LIT8(KRequiredElements, "RequiredElements");
+
+    //6.3.1 Username Token assertion
+    _LIT8(KUsernameToken, "UsernameToken");
+    _LIT8(KIncludeToken, "IncludeToken");
+    _LIT8(KWssUsernameToken10, "WssUsernameToken10");
+    _LIT8(KWssUsernameToken11, "WssUsernameToken11");
+    //6.3.2 IssuedToken Assertion
+    _LIT8(KIssuedToken, "IssuedToken");
+    _LIT8(KIssuer, "Issuer");
+    _LIT8(KRequestSecurityTokenTemplate, "RequestSecurityTokenTemplate");
+    _LIT8(KTrustVersion, "TrustVersion");
+    _LIT8(KRequireDerivedKeys, "RequireDerivedKeys");
+    _LIT8(KRequireExternalReference, "RequireExternalReference");
+    _LIT8(KRequireInternalReference, "RequireInternalReference");
+    //6.3.3    
+    _LIT8(KX509Token, "X509Token");
+    _LIT8(KRequireKeyIdentifierReference, "RequireKeyIdentifierReference");
+    _LIT8(KRequireIssuerSerialReference, "RequireIssuerSerialReference");
+    _LIT8(KRequireEmbeddedTokenReference, "RequireEmbeddedTokenReference");
+    _LIT8(KRequireThumbprintReference, "RequireThumbprintReference");
+    
+            
+    _LIT8(KWssX509V1Token10, "WssX509V1Token10");
+    _LIT8(KWssX509V3Token10, "WssX509V3Token10");
+    _LIT8(KWssX509Pkcs7Token10, "WssX509Pkcs7Token10");
+    _LIT8(KWssX509PkiPathV1Token10, "WssX509PkiPathV1Token10");
+    _LIT8(KWssX509V1Token11, "WssX509V1Token11");
+    _LIT8(KWssX509V3Token11, "WssX509V3Token11");
+    _LIT8(KWssX509Pkcs7Token11, "WssX509Pkcs7Token11");
+    _LIT8(KWssX509PkiPathV1Token11, "WssX509PkiPathV1Token11");
+    //6.3.4
+    _LIT8(KKerberosToken, "KerberosToken");
+    _LIT8(KWssKerberosV5ApReqToken11, "WssKerberosV5ApReqToken11");
+    _LIT8(KWssGssKerberosV5ApReqToken11, "WssGssKerberosV5ApReqToken11");
+    //6.3.5    
+    _LIT8(KSpnegoContextToken, "SpnegoContextToken");
+    //6.3.6
+    _LIT8(KSecurityContextToken, "SecurityContextToken");
+    _LIT8(KRequireExternalUriReference, "RequireExternalUriReference");
+    _LIT8(KSC10SecurityContextToken, "SC10SecurityContextToken");
+    //6.3.7 SecureConversationtoken asseertion
+    _LIT8(KSecureConversationToken, "SecureConversationToken");
+    _LIT8(KBootstrapPolicy, "BootstrapPolicy");
+    //6.3.8 SamlToken Assertion    
+    _LIT8(KSamlToken, "SamlToken");
+    _LIT8(KWssSamlV10Token10, "WssSamlV10Token10");
+    _LIT8(KWssSamlV11Token10, "WssSamlV11Token10");
+    _LIT8(KWssSamlV10Token11, "WssSamlV10Token11");
+    _LIT8(KWssSamlV11Token11, "WssSamlV11Token11");
+    _LIT8(KWssSamlV20Token11, "WssSamlV20Token11");
+    //6.3.9 RelToken
+    _LIT8(KRelToken, "RelToken");
+    _LIT8(KWssRelV10Token10, "WssRelV10Token10");
+    _LIT8(KWssRelV20Token10, "WssRelV20Token10");
+    _LIT8(KWssRelV10Token11, "WssRelV10Token11");
+    _LIT8(KWssRelV20Token11, "WssRelV20Token11");
+    //6.3.10 Https TokenAssertion
+    _LIT8(KHttpsToken, "HttpsToken");
+    _LIT8(KRequireClientCertificate, "RequireClientCertificate");
+    //8.1 Alogorithm suite assertion
+    _LIT8(KAlgorithmSuite, "AlgorithmSuite");
+    
+        
+    _LIT8(KBasic256, "Basic256");
+    _LIT8(KBasic192, "Basic192");
+    _LIT8(KBasic128, "Basic128");
+    _LIT8(KTripleDes, "TripleDes");
+    _LIT8(KBasic256Rsa15, "Basic256Rsa15");
+    _LIT8(KBasic192Rsa15, "Basic192Rsa15");
+    _LIT8(KBasic128Rsa15, "Basic128Rsa15");
+    _LIT8(KTripleDesRsa15, "TripleDesRsa15");
+    _LIT8(KBasic256Sha256, "Basic256Sha256");
+    _LIT8(KBasic192Sha256, "Basic192Sha256");
+    _LIT8(KBasic128Sha256, "Basic128Sha256");
+    _LIT8(KTripleDesSha256, "TripleDesSha256");
+    _LIT8(KBasic256Sha256Rsa15, "Basic256Sha256Rsa15");
+    _LIT8(KBasic192Sha256Rsa15, "Basic192Sha256Rsa15");
+    _LIT8(KBasic128Sha256Rsa15, "Basic128Sha256Rsa15");
+    _LIT8(KTripleDesSha256Rsa15, "TripleDesSha256Rsa15");
+    _LIT8(KInclusiveC14N, "InclusiveC14N");
+    _LIT8(KSoapNormalization10, "SoapNormalization10");
+    _LIT8(KStrTransform10, "StrTransform10");
+    _LIT8(KXPath10, "XPath10");
+    _LIT8(KXPathFilter20, "XPathFilter20");
+    //8.2 Layout assertion
+    _LIT8(KLayout, "Layout");
+    _LIT8(KStrict, "Strict");
+    _LIT8(KLax, "Lax");
+    _LIT8(KLaxTsFirst, "LaxTsFirst");
+    _LIT8(KLaxTsLast, "LaxTsLast");
+    //8.3 TransportBinding assertion    
+    _LIT8(KTransportBinding, "TransportBinding");
+    _LIT8(KTransportToken, "TransportToken");
+    _LIT8(KIncludeTimestamp, "IncludeTimestamp");
+    
+    //8.4 Symmetric binding    
+    _LIT8(KSymmetricBinding, "SymmetricBinding");
+    _LIT8(KEncryptionToken, "EncryptionToken");
+    _LIT8(KSignatureToken, "SignatureToken");
+    _LIT8(KProtectionToken, "ProtectionToken");
+    //Binding commons    
+    _LIT8(KEncryptBeforeSigning, "EncryptBeforeSigning");
+    _LIT8(KSignBeforeEncrypting, "SignBeforeEncrypting");
+    _LIT8(KEncryptSignature, "EncryptSignature");
+    _LIT8(KProtectTokens, "ProtectTokens");
+    _LIT8(KOnlySignEntireHeadersAndBody, "OnlySignEntireHeadersAndBody");
+    //8.5 Assymetric binding assertion    
+    _LIT8(KAsymmetricBinding, "AsymmetricBinding");
+    _LIT8(KInitiatorToken, "InitiatorToken");
+    _LIT8(KRecipientToken, "RecipientToken");
+    //9.1    
+    _LIT8(KSupportingTokens, "SupportingTokens");
+    //9.2    
+    _LIT8(KSignedSupportingTokens, "SignedSupportingTokens");
+    //9.3    
+    _LIT8(KEndorsingSupportingTokens, "EndorsingSupportingTokens");
+    // 9.4    
+    _LIT8(KSignedEndorsingSupportingTokens, "SignedEndorsingSupportingTokens");
+    //10. WSS SOAP message security options
+    //Wss10 Assertion
+    _LIT8(KWss10, "Wss10");
+    _LIT8(KMustSupportRefKeyIdentifier, "MustSupportRefKeyIdentifier");
+    _LIT8(KMustSupportRefIssuerSerial, "MustSupportRefIssuerSerial");
+    _LIT8(KMustSupportRefExternalURI, "MustSupportRefExternalURI");
+    _LIT8(KMustSupportRefEmbeddedToken, "MustSupportRefEmbeddedToken");
+    //Wss11 Assertion in addition to Wss10
+    _LIT8(KWss11, "Wss11");
+    _LIT8(KMustSupportRefThumbprint, "MustSupportRefThumbprint");
+    _LIT8(KMustSupportRefEncryptedKey, "MustSupportRefEncryptedKey");
+    _LIT8(KRequireSignatureConfirmation, "RequireSignatureConfirmation");
+    //Trust10 Assertion
+    _LIT8(KTrust10, "Trust10");
+    _LIT8(KMustSupportClientChallenge, "MustSupportClientChallenge");
+    _LIT8(KMustSupportServerChallenge, "MustSupportServerChallenge");
+    _LIT8(KRequireClientEntropy, "RequireClientEntropy");
+    _LIT8(KRequireServerEntropy, "RequireServerEntropy");
+    _LIT8(KMustSupportIssuedTokens, "MustSupportIssuedTokens");
+
+/*    
+
+    SUPPORTING_TOKEN_SUPPORTING = 1;
+    SUPPORTING_TOKEN_ENDORSING = 2;
+    SUPPORTING_TOKEN_SIGNED = 3;
+    SUPPORTING_TOKEN_SIGNED_ENDORSING = 4;
+*/    
+  
+    ///
+    ///Algorithms Namespaces
+    ///
+    _LIT8(KAlgoHMAC_SHA1, "http://www.w3.org/2000/09/xmldsig#hmac-sha1");
+    _LIT8(KAlgoRSA_SHA1, "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
+    _LIT8(KAlgoSHA1, "http://www.w3.org/2000/09/xmldsig#sha1");
+    _LIT8(KAlgoSHA256, "http://www.w3.org/2001/04/xmlenc#sha256");
+    _LIT8(KAlgoSHA512, "http://www.w3.org/2001/04/xmlenc#sha512");
+    _LIT8(KAlgoAES128, "http://www.w3.org/2001/04/xmlenc#aes128-cbc");
+    _LIT8(KAlgoAES192, "http://www.w3.org/2001/04/xmlenc#aes192-cbc");
+    _LIT8(KAlgoAES256, "http://www.w3.org/2001/04/xmlenc#aes256-cbc");
+    _LIT8(KAlgoTRIPLE_DES, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc");
+    _LIT8(KAlgoKW_AES128, "http://www.w3.org/2001/04/xmlenc#kw-aes256");
+    _LIT8(KAlgoKW_AES192, "http://www.w3.org/2001/04/xmlenc#kw-aes192");
+    _LIT8(KAlgoKW_AES256, "http://www.w3.org/2001/04/xmlenc#kw-aes128");
+    _LIT8(KAlgoKW_TRIPLE_DES, "http://www.w3.org/2001/04/xmlenc#kw-tripledes");
+    _LIT8(KAlgoKW_RSA_OAEP, "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
+    _LIT8(KAlgoKW_RSA15, "http://www.w3.org/2001/04/xmlenc#rsa-1_5");
+    _LIT8(KAlgoP_SHA1, "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1");
+    _LIT8(KAlgoP_SHA1_L128, "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1");
+    _LIT8(KAlgoP_SHA1_L192, "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1");
+    _LIT8(KAlgoP_SHA1_L256, "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1");
+    _LIT8(KAlgoC14N, "http://www.w3.org/2001/10/xml-c14n#");
+    _LIT8(KAlgoEX_C14N, "http://www.w3.org/2001/10/xml-exc-c14n#");
+    _LIT8(KAlgoSNT, "http://www.w3.org/TR/soap12-n11n");
+    _LIT8(KAlgoSTRT10, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform");
+    _LIT8(KAlgoXPATH, "http://www.w3.org/TR/1999/REC-xpath-19991116");
+    _LIT8(KAlgoXPATH20, "http://www.w3.org/2002/06/xmldsig-filter2");
+    }
+
+#endif //WSSTAR_SECURITY_POLICY_CONSTANTS_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/inc/xorcompositeassertion.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef C_XOR_COMPOSITE_ASSERTION_H
+#define C_XOR_COMPOSITE_ASSERTION_H
+
+
+#include "assertion.h"
+
+class CXorCompositeAssertion : public CAssertion
+{
+public:
+    static  CXorCompositeAssertion* NewL();
+    static  CXorCompositeAssertion* NewLC();
+    static  CXorCompositeAssertion* NewL(CXorCompositeAssertion* aValue);
+    static  CXorCompositeAssertion* NewLC(CXorCompositeAssertion* aValue);
+    
+    virtual ~CXorCompositeAssertion();
+//from CAssertion
+    virtual  TAssertionType Type();
+    virtual  void           AddTerm(MAssertion* aAssertion);
+    virtual void 	AddTermCopyL(MAssertion* aAssertion);
+    
+    virtual  MAssertion* 	NormalizeL(CPolicyRegistry* aRegistry);         
+    virtual  MAssertion*    IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+    virtual  MAssertion* 	MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry);
+ 
+private:
+     CXorCompositeAssertion();
+     void ConstructL(CXorCompositeAssertion* aValue); 
+     void ConstructL(); 
+    
+};
+#endif //C_XOR_COMPOSITE_ASSERTION_H          
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/rom/wsstarpolicy.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSSTARPOLICY_IBY__
+#define __WSSTARPOLICY_IBY__
+
+// WSPolicy
+file=ABI_DIR\BUILD_DIR\WSPolicy.dll          PROGRAMS_DIR\WSPolicy.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/PolicyIntersecter.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#include "PolicyIntersecter.h"
+
+#include <XmlEngDdom.h>
+#include "wssecuritypolicy.h"
+#include "Wspolicy.h"
+
+
+using namespace WSPolicy;
+
+CPolicyIntersecter* CPolicyIntersecter::NewL()
+{
+    CPolicyIntersecter* pSelf =
+        CPolicyIntersecter::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CPolicyIntersecter* CPolicyIntersecter::NewLC()
+{
+    CPolicyIntersecter* pSelf = new (ELeave) CPolicyIntersecter();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;  
+}
+void CPolicyIntersecter::ConstructL()
+{
+    iSecurityPolicyDomain =    CWsSecurityPolicy::NewL();
+   
+}
+CPolicyIntersecter::~CPolicyIntersecter()
+{
+   iPolicy1.Close(); 
+   iPolicy2.Close();
+
+   delete iSecurityPolicyDomain;
+}
+CPolicyIntersecter::CPolicyIntersecter()
+{
+    
+}
+
+TXmlEngElement CPolicyIntersecter::IntersectL(TDesC& /*aFirstPolicy*/, TDesC& /*aSecondPolicy*/)
+{
+//    TDOMImplementation domImpl = XmlEngine::DOM::DOMImplementationSource::DOMImplementationL (XmlEngine::DOM::KImplementationID);  
+    RXmlEngDOMImplementation domImpl;
+    RXmlEngDocument doc;
+    doc.OpenL(domImpl);
+
+//    RDOMParser parser = domImpl.CreateDOMParser();
+
+//    iPolicy1 = parser.ParseFileL( aFirstPolicy );
+//    iPolicy2 = parser.ParseFileL( aSecondPolicy );
+
+    TXmlEngElement& pPolicy1 = iPolicy1.AsElement();
+    TXmlEngElement& pPolicy2 = iPolicy2.AsElement();
+    
+    
+    TXmlEngElement result = IntersectL(pPolicy1,pPolicy2);
+    return result;
+}
+
+
+TXmlEngElement CPolicyIntersecter::IntersectL(TXmlEngElement aFirstPolicy, TXmlEngElement aSecondPolicy)
+{
+    RXmlEngDocument policyDoc  = aFirstPolicy.OwnerDocument().CloneDocumentL();
+    TXmlEngElement& newIntersectedPolicy = policyDoc.AsElement();
+
+    RXmlEngNodeList<TXmlEngElement> listPolicynew;
+    newIntersectedPolicy.GetChildElements(listPolicynew); //get the children of policy  
+
+    if(listPolicynew.HasNext()) 
+    {
+        iIntersectedPolicyElement = listPolicynew.Next();
+        iIntersectedPolicyElement.RemoveChildren();
+    }
+
+        //now add all the intersecterd assertions in this AND Element
+
+    RXmlEngNodeList<TXmlEngElement> listPolicyFirst;
+    aFirstPolicy.GetChildElements(listPolicyFirst); //get the children of policy
+
+    RXmlEngNodeList<TXmlEngElement> listPolicySecond;
+    aSecondPolicy.GetChildElements(listPolicySecond); //get the children of policy
+    
+    TXmlEngElement XOR = iIntersectedPolicyElement.AddNewElementSameNsL(WSPolicy::KXorCompositeAssertion);
+
+    if(listPolicyFirst.HasNext() && listPolicySecond.HasNext()) 
+    {
+        TXmlEngElement policyElement = listPolicyFirst.Next();
+        
+        TPtrC8 localName = policyElement.TagName();
+                
+        RXmlEngNodeList<TXmlEngElement> xorList; //get the only xor element
+        policyElement.GetElementsByTagNameL(xorList, WSPolicy::KXorCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+        TXmlEngElement pXORFirst = NULL;
+        
+        if(xorList.HasNext())
+            pXORFirst = xorList.Next();
+        //get all AND elements from the above xor. 
+        
+        RXmlEngNodeList<TXmlEngElement> andListFirst; //get the only xor element from First Policy
+        pXORFirst.GetElementsByTagNameL(andListFirst, WSPolicy::KAndCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+
+    //second policy
+        TXmlEngElement policyElementSec = listPolicySecond.Next();
+        
+        TPtrC8 localName2 = policyElementSec.TagName();
+                
+        RXmlEngNodeList<TXmlEngElement> xorListSec; //get the only xor element
+        policyElementSec.GetElementsByTagNameL(xorListSec, WSPolicy::KXorCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+        TXmlEngElement pXORSec = NULL;
+        
+        if(xorListSec.HasNext())
+            pXORSec = xorListSec.Next();
+        //we have to get all AND elements from the above xor. we will do it in loop
+        
+        
+        while (andListFirst.HasNext())
+        {
+            TXmlEngElement AND = XOR.AddNewElementSameNsL(WSPolicy::KAndCompositeAssertion);
+            
+            TXmlEngElement andEleF = andListFirst.Next();
+            
+            TPtrC8 localName = andEleF.TagName();
+            //find all assertions in this AND element
+            
+            
+            IntersectCompareSecondAssertionsL(andEleF, pXORSec, AND);
+        }
+  
+    }
+    
+
+    return XOR;
+    
+}
+
+TXmlEngElement CPolicyIntersecter::IntersectCompareSecondAssertionsL(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement, TXmlEngElement aIntersectedAND)
+{
+
+    RXmlEngNodeList<TXmlEngElement> assertionListF; //get all of first assrtions
+    aFirstElement.GetChildElements(assertionListF);
+
+    RXmlEngNodeList<TXmlEngElement> andListSec; //get all of AND elements
+    aSecondElement.GetElementsByTagNameL(andListSec, WSPolicy::KAndCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+    
+    RArray<TXmlEngElement> result;
+    while(andListSec.HasNext())
+    {
+    //for every of AND element, loop for every AND element in first policy
+        TXmlEngElement andEleS = andListSec.Next();
+        
+        TPtrC8 localNameS = andEleS.TagName();
+        //find all assertions in this AND element
+        
+        RXmlEngNodeList<TXmlEngElement> assertionListS; //get the only xor element
+        andEleS.GetChildElements(assertionListS);
+        //RESOLVE all assertion from same AND element  
+
+         IntersectAllANDAssertionsL(aFirstElement, andEleS, result);
+         if(result.Count() > 0)             
+         {
+           for (TInt i = 0; i<result.Count(); i++) 
+           {
+           TXmlEngElement resultEle = result[i].CopyL();
+           aIntersectedAND.AppendChildL(resultEle);
+           }
+           result.Reset();
+         }
+        //if result then we have merged policy else we have NULL here
+         
+    }
+    return NULL;
+}
+void CPolicyIntersecter::IntersectAllANDAssertionsL(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement, RArray<TXmlEngElement>& aResult)
+{
+    TInt outcount = 0;
+    TInt inCount = 0;
+
+    RXmlEngNodeList<TXmlEngElement> assertionListF; //get all of first assrtions
+    aFirstElement.GetChildElements(assertionListF);
+    
+    while (assertionListF.HasNext())
+    {
+        TXmlEngElement assertionFirst = assertionListF.Next();
+
+        TPtrC8 localName1 = assertionFirst.TagName();
+        
+        outcount++;
+
+        RXmlEngNodeList<TXmlEngElement> assertionListS; //get all of AND elements
+        aSecondElement.GetChildElements(assertionListS);
+
+        while(assertionListS.HasNext())
+        {
+            TXmlEngElement assertionSecond = assertionListS.Next();
+
+            TPtrC8 localName2 = assertionSecond.TagName();
+            inCount++;
+            if((localName1.Compare(localName2) == 0) && 
+            VerifyNamespace(assertionFirst, assertionSecond))            
+            {
+                //call domain specific policy to resolve
+                //check the namespaces here to find which domain we need to process
+                //both namespaces should be checked and if they are same then we can intersect them
+
+                TPtrC8 namespaceUri1 = assertionFirst.NamespaceUri();
+
+                //if its ws security policy
+                if(namespaceUri1.Compare(KWsSecurityPolicyNsUri) == 0)
+                {
+/*                
+                    TXmlEngElement result = iSecurityPolicyDomain->Intersect(localName1, assertionFirst, assertionSecond);
+                    if(result.NotNull())
+                    {
+                        aResult.Append(assertionFirst);
+                        aResult.Append(assertionSecond);
+                    }
+*/                    
+                }                
+            }
+        }
+        
+    }
+}
+
+TInt CPolicyIntersecter::VerifyNamespace(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement)
+{
+
+    TPtrC8 namespaceUri1 = aFirstElement.NamespaceUri();
+    TPtrC8 namespaceUri2 = aSecondElement.NamespaceUri();
+
+    if(namespaceUri1 != KNullDesC8() && namespaceUri2 != KNullDesC8())
+    {
+      if(namespaceUri1.Compare(namespaceUri2) == 0)
+        return ETrue;  
+    }
+
+  return KErrNotFound;  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/PolicyMerger.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#include "PolicyMerger.h"
+
+#include <XmlEngDdom.h>
+#include "wssecuritypolicy.h"
+#include "WSPolicy.h"
+
+using namespace WSPolicy;
+
+CPolicyMerger* CPolicyMerger::NewL()
+{
+    CPolicyMerger* pSelf =
+        CPolicyMerger::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CPolicyMerger* CPolicyMerger::NewLC()
+{
+    CPolicyMerger* pSelf = new (ELeave) CPolicyMerger();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;  
+}
+void CPolicyMerger::ConstructL()
+{
+   iSecurityPolicyDomain =    CWsSecurityPolicy::NewL();   
+}
+CPolicyMerger::~CPolicyMerger()
+{
+   iPolicy1.Close(); 
+   iPolicy2.Close();
+    
+   delete iSecurityPolicyDomain;
+   
+}
+CPolicyMerger::CPolicyMerger()
+{
+    
+}
+
+TXmlEngElement CPolicyMerger::MergeL(TDesC& /*aFirstPolicy*/, TDesC& /*aSecondPolicy*/)
+{
+/*
+    TDOMImplementation domImpl = XmlEngine::DOM::DOMImplementationSource::DOMImplementationL (XmlEngine::DOM::KImplementationID);  
+    RDOMParser parser = domImpl.CreateDOMParser();
+
+    iPolicy1 = parser.ParseFileL( aFirstPolicy );
+    iPolicy2 = parser.ParseFileL( aSecondPolicy );
+
+    TXmlEngElement& pPolicy1 = iPolicy1.AsElement();
+    TXmlEngElement& pPolicy2 = iPolicy2.AsElement();
+    
+    TXmlEngElement result = MergeL(pPolicy1,pPolicy2);
+
+    return result;
+      */
+      return NULL;
+}
+
+
+TXmlEngElement CPolicyMerger::MergeL(TXmlEngElement aFirstPolicy, TXmlEngElement aSecondPolicy)
+{
+    RXmlEngDocument mergedPolicyDoc = aFirstPolicy.OwnerDocument().CloneDocumentL();
+    TXmlEngElement& newIntersectedPolicy = mergedPolicyDoc.AsElement();
+
+    RXmlEngNodeList<TXmlEngElement> listPolicynew;
+    newIntersectedPolicy.GetChildElements(listPolicynew); //get the children of policy  
+
+    if(listPolicynew.HasNext()) 
+    {
+        iMergedPolicyElement = listPolicynew.Next();
+        iMergedPolicyElement.RemoveChildren();
+    }
+
+    RXmlEngNodeList<TXmlEngElement> listPolicyFirst;
+    aFirstPolicy.GetChildElements(listPolicyFirst); //get the children of policy
+
+    RXmlEngNodeList<TXmlEngElement> listPolicySecond;
+    aSecondPolicy.GetChildElements(listPolicySecond); //get the children of policy
+    
+    TXmlEngElement XOR = iMergedPolicyElement.AddNewElementSameNsL(WSPolicy::KXorCompositeAssertion);
+    
+    
+    if(listPolicyFirst.HasNext() && listPolicySecond.HasNext()) 
+    {
+        TXmlEngElement policyElement = listPolicyFirst.Next();
+        TPtrC8 localName = policyElement.TagName();
+                
+        RXmlEngNodeList<TXmlEngElement> xorList; //get the only xor element
+        policyElement.GetElementsByTagNameL(xorList, WSPolicy::KXorCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+        TXmlEngElement pXORFirst = NULL;
+        
+        if(xorList.HasNext())
+            pXORFirst = xorList.Next();
+        //get all AND elements from the above xor. 
+        
+        RXmlEngNodeList<TXmlEngElement> andListFirst; //get the only xor element from First Policy
+        pXORFirst.GetElementsByTagNameL(andListFirst, WSPolicy::KAndCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+
+
+
+    //second policy
+        TXmlEngElement policyElementSec = listPolicySecond.Next();
+        
+        TPtrC8 localName2 = policyElementSec.TagName();
+
+                
+        RXmlEngNodeList<TXmlEngElement> xorListSec; //get the only xor element
+        policyElementSec.GetElementsByTagNameL(xorListSec, WSPolicy::KXorCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+        TXmlEngElement pXORSec = NULL;
+        
+        if(xorListSec.HasNext())
+            pXORSec = xorListSec.Next();
+        //we have to get all AND elements from the above xor. we will do it in loop
+        
+        
+        while (andListFirst.HasNext())
+        {
+            TXmlEngElement AND = XOR.AddNewElementSameNsL(WSPolicy::KAndCompositeAssertion);
+            
+            TXmlEngElement andEleF = andListFirst.Next();
+            
+            TPtrC8 localName = andEleF.TagName();
+            //find all assertions in this AND element
+            
+            
+            MergeCompareSecondAssertionsL(andEleF, pXORSec, AND);
+        }
+  
+    }
+
+    return XOR;
+}
+
+
+TXmlEngElement CPolicyMerger::MergeCompareSecondAssertionsL(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement, TXmlEngElement aIntersectedAND)
+{
+
+    RXmlEngNodeList<TXmlEngElement> assertionListF; //get all of first assrtions
+    aFirstElement.GetChildElements(assertionListF);
+
+    RXmlEngNodeList<TXmlEngElement> andListSec; //get all of AND elements
+    aSecondElement.GetElementsByTagNameL(andListSec, WSPolicy::KAndCompositeAssertion, WSPolicy::KWsPolicyNsUri);
+    
+    RArray<TXmlEngElement> result;
+    while(andListSec.HasNext())
+    {
+    //for every of AND element, loop for every AND element in first policy
+        TXmlEngElement andEleS = andListSec.Next();
+        
+        TPtrC8 localNameS = andEleS.TagName();
+        //find all assertions in this AND element
+        
+        RXmlEngNodeList<TXmlEngElement> assertionListS; //get the only xor element
+        andEleS.GetChildElements(assertionListS);
+        //RESOLVE all assertion from same AND element  
+
+         MergeAllANDAssertionsL(aFirstElement, andEleS, result);
+         if(result.Count() > 0)             
+         {
+           for (TInt i = 0; i<result.Count(); i++) 
+           {
+                TXmlEngElement resultEle = result[i].CopyL();
+                aIntersectedAND.AppendChildL(resultEle);
+           }
+           result.Reset();
+         }
+        //if result then we have merged policy else we have NULL here
+         
+    }
+    return NULL;
+}
+
+void CPolicyMerger::MergeAllANDAssertionsL(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement, RArray<TXmlEngElement>& aResult)
+{
+    TInt outcount = 0;
+    TInt inCount = 0;
+
+    RXmlEngNodeList<TXmlEngElement> assertionListF; //get all of first assrtions
+    aFirstElement.GetChildElements(assertionListF);
+    
+    while (assertionListF.HasNext())
+    {
+        TXmlEngElement assertionFirst = assertionListF.Next();
+
+        TPtrC8 localName1 = assertionFirst.TagName();
+        outcount++;
+
+        RXmlEngNodeList<TXmlEngElement> assertionListS; //get all of AND elements
+        aSecondElement.GetChildElements(assertionListS);
+
+        while(assertionListS.HasNext())
+        {
+            TXmlEngElement assertionSecond = assertionListS.Next();
+
+            TPtrC8 localName2 = assertionSecond.TagName();
+            inCount++;
+            if((localName1.Compare(localName2) == 0) && 
+            VerifyNamespace(assertionFirst, assertionSecond))            
+            {
+                //call domain specific policy to resolve
+                //check the namespaces here to find which domain we need to process
+                //both namespaces should be checked and if they are same then we can intersect them
+                TPtrC8 namespaceUri1 = assertionFirst.NamespaceUri();
+                //if its ws security policy
+                if(namespaceUri1.Compare(KWsSecurityPolicyNsUri) == 0)
+                {
+/*                
+                    TXmlEngElement result = iSecurityPolicyDomain->Merge(localName1, assertionFirst, assertionSecond);
+                    if(result.NotNull())
+                    {
+                        aResult.Append(result);
+                    }
+                    else
+                    {
+                        aResult.Append(assertionFirst);
+                        aResult.Append(assertionSecond);
+                    }
+*/                    
+                }                
+            }
+        }
+        
+    }
+    
+}
+
+TInt CPolicyMerger::VerifyNamespace(TXmlEngElement aFirstElement, TXmlEngElement aSecondElement)
+{
+    TPtrC8 namespaceUri1 = aFirstElement.NamespaceUri();
+    TPtrC8 namespaceUri2 = aSecondElement.NamespaceUri();
+    
+    if(namespaceUri1 != KNullDesC8() && namespaceUri2 != KNullDesC8())
+    {
+      if(namespaceUri1.Compare(namespaceUri2) == 0)
+        return ETrue;  
+    }
+
+  return KErrNotFound;  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/PolicyNormalizer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1466 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <f32file.h>
+#include "PolicyNormalizer.h"
+#include "SenXmlElement.h"
+#include "WSPolicyRegistry.h"
+
+using namespace WSPolicy;
+
+namespace
+{
+_LIT( KOutPath, "c:\\logs\\out.xml");
+_LIT8(KColon, ":");
+//_LIT8( KServicePolicyLocalName, "ServicePolicy");
+}
+
+    
+    
+CPolicyNormalizer* CPolicyNormalizer::NewL()
+    {
+    CPolicyNormalizer* pSelf =
+        CPolicyNormalizer::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CPolicyNormalizer* CPolicyNormalizer::NewLC()
+    {
+    CPolicyNormalizer* pSelf =
+                        new (ELeave) CPolicyNormalizer();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+    }
+
+CPolicyNormalizer::~CPolicyNormalizer()
+{
+    delete iXmlReader;
+    delete iPath;
+    delete iNewPolicy;
+    iOrphanElements.ResetAndDestroy();
+}
+
+CPolicyNormalizer::CPolicyNormalizer()
+    {
+    }
+void CPolicyNormalizer::ConstructL()
+    {
+//    BaseConstructL(KServicePolicyLocalName());
+    iXmlReader = CSenXmlReader::NewL();
+    iNewPolicy = CSenXmlElement::NewL(KWsPolicy);
+    count = 0;
+    }
+    
+
+
+CSenElement* CPolicyNormalizer::NormalizeL(CPolicyRegistry* aRegistry)
+{
+
+    CSenElement& element = AsElement();
+    TPtrC8 name = element.LocalName();
+
+    if (name.Compare(KWsPolicy) == 0)
+    {
+        iNewPolicy->CopyFromL(element);
+        
+        RPointerArray<CSenElement>& children = iNewPolicy->ElementsL();
+        CleanupClosePushL(children);
+        TInt childCount = children.Count();
+        
+        if(childCount > 0)
+        {
+            CSenElement* pNextChild;   
+            TInt i = 0;
+            
+            while (i < childCount)
+            {   
+                
+                pNextChild = children[childCount-1];
+                CSenElement* newElement = iNewPolicy->RemoveElement(*pNextChild);
+                delete newElement;
+                childCount--;
+            }
+                
+        }
+        CleanupStack::PopAndDestroy(); //children
+       ProcessPolicyReferenceL(&element, aRegistry);
+       ProcessPolicyTermL(&element, iNewPolicy);
+       ProcessLogicL(iNewPolicy);
+       ProcessAssertionBranchingL(iNewPolicy);
+       
+//#ifdef _SENDEBUG       
+       WriteL(iNewPolicy);
+//#endif
+       return iNewPolicy;
+    }
+
+    return NULL; //&element;   
+
+}
+
+TPtrC8 CPolicyNormalizer::GetReferenceUriL(CSenElement* aReference)
+    {
+    RPointerArray<CSenBaseAttribute>& attrs = aReference->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+         bs = (attrs)[j];
+         if(bs->Name().Compare(KUri) == 0)
+         {
+            return bs->Value();
+         }
+            
+              
+         }
+    return KNullDesC8();
+    }
+    
+TInt CPolicyNormalizer::ReplacePolicyReferenceL(CSenElement* aReferenceElement, CSenElement* aReferredPolicy)
+    {
+    //get the parent of policy, remove referenceElement and add referred policy there 
+    
+    CSenElement* parent = aReferenceElement->Parent();
+    
+    if(!parent)
+        return KErrNotFound;
+    //add all policy child elements here and then copy those element's contents 
+    //from referred policy,
+    //the referred policy element is owned by SD so do not use it
+    
+     RPointerArray<CSenElement>& children = aReferredPolicy->ElementsL();
+        TInt childCount = children.Count();
+        
+        if(childCount > 0)
+        {
+            CSenElement* pNextChild;   
+            TInt i = 0;
+            
+            while (i < childCount)
+            {   
+                
+                pNextChild = children[i];
+                TPtrC8 localName = pNextChild->LocalName();
+                TPtrC8 nsUri = pNextChild->NamespaceURI();
+                CSenElement& newElement = parent->AddElementL(nsUri, localName);
+                newElement.CopyFromL(*pNextChild);                
+                i++;
+            }
+        }
+
+//now we have resolved the reference so we dont need the PolicyReference element    
+    CSenElement* removed = parent->RemoveElement(*aReferenceElement);
+    
+    if(removed)
+        {
+        delete removed;
+        return KErrNone;
+        }
+    return KErrNotFound;
+    }
+
+CSenElement* CPolicyNormalizer::ProcessPolicyReferenceL(CSenElement* aPolicy, CPolicyRegistry* aRegistry)
+{    //Loop for wsp:PolicyReference element and if found then replace
+    // it with wsp:All and copy everything from found policy to here
+    if(aRegistry == NULL)
+        return NULL;
+    //Check if there is a reference if yes then resolve it
+    RPointerArray<CSenElement> referenceChildren;
+    
+    if(aPolicy->ElementsL(referenceChildren, KWsPolicyReference) == KErrNone)
+        {
+        TInt childCount = referenceChildren.Count();
+        TInt i = 0;
+        CSenElement* pNextChild;
+
+        while (i < childCount)
+            {
+            pNextChild = referenceChildren[i];
+            TPtrC8 localName = pNextChild->LocalName();
+            TPtrC8 uri = GetReferenceUriL(pNextChild);
+            _LIT8(KHash, "#");
+            
+            HBufC8* aRippedUri = NULL;
+             
+            if(uri.Left(1).Compare(KHash) == 0)
+               aRippedUri = uri.Right(uri.Length()-1).AllocL();
+            
+            if(aRippedUri->Length() > 0)
+                {
+                CSenElement* referedPolicy = aRegistry->LookupPolicy(aRippedUri->Des());
+                if(referedPolicy)
+                    {
+                    ReplacePolicyReferenceL(pNextChild,referedPolicy);
+                    }
+                }
+                delete aRippedUri;
+                
+            i++;
+            }
+        }
+        
+    //Check in all children recursively PolicyReferences and resolve them
+    RPointerArray<CSenElement>& children = aPolicy->ElementsL();
+    TInt childCount = children.Count();    
+
+    CSenElement* pNextChild;
+    TInt i=0;
+
+    while (i < childCount)
+    {
+        pNextChild = children[i];
+        TPtrC8 localName = pNextChild->LocalName();
+        ProcessPolicyReferenceL(pNextChild, aRegistry);
+        i++;
+    }
+    
+  return NULL;  
+}
+
+TBool CPolicyNormalizer::IsOptionalL(CSenElement* aAssertion)
+{
+    // 7, 21, 23, 24
+    RPointerArray<CSenBaseAttribute>& attrs = aAssertion->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+         bs = (attrs)[j];
+         if(bs->Name().Compare(KWspOptinal) == 0)
+         {
+            if(bs->Value() == KWspOptinalTrue)
+                return ETrue;
+         }
+            
+              
+         }
+    return EFalse;
+}
+
+CSenElement* CPolicyNormalizer::ProcessOptionalElement(CSenElement* /*aAssertion*/, CSenElement* aNormalAssertion)
+    {
+    return aNormalAssertion;
+    }
+
+CSenElement* CPolicyNormalizer::ProcessAssertionTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion)
+{
+    TPtrC8 assertionName = aAssertion->LocalName();
+    TPtrC8 assertionNsUri = aAssertion->NamespaceURI();
+    TPtrC8 nsPrefix = aAssertion->NsPrefix();
+    TBuf8<255> qname(nsPrefix);
+    qname.Append(':');
+    qname.Append(assertionName);
+    CSenElement& newNormalForm = aNormalAssertion->AddElementL(assertionNsUri,assertionName, qname);
+  
+    if(IsOptionalL(aAssertion))
+    {
+        if (CopySenElementWithoutOptionL(aAssertion, &newNormalForm))
+        {
+            CSenElement* parent = aNormalAssertion->Parent();
+            AddAndElementL(parent);
+        }
+    }
+    else
+    {
+        CopySenElementL(aAssertion, &newNormalForm);    
+    }
+    
+    
+    
+
+    RPointerArray<CSenElement>& children = aAssertion->ElementsL();
+    TInt childCount = children.Count();  
+    
+    if (childCount > 0)
+    {
+        CSenElement* pNextChild;
+        TInt i =0;
+        while (i < childCount)
+        {
+        
+            pNextChild = children[i]; 
+            TPtrC8 localName = pNextChild->LocalName();
+            
+            
+            if(localName.Compare(KXorCompositeAssertion) == 0)
+            {
+
+            }
+            else if (localName.Compare(KAndCompositeAssertion) == 0)
+            {
+
+            }
+            else if (localName.Compare(KWsPolicy) == 0 )
+            {
+                CSenElement* aNewElement = AddPolicyElementL(&newNormalForm);
+                aNewElement = ProcessPolicyTermL(pNextChild,aNewElement);
+
+            }
+            else
+            {//if asserion is not well defined and dont have  apolicy object here 
+               //then it should add one and then add XOR and AND
+//                 CSenElement* aNewElement = AddPolicyElementL(&newNormalForm);
+//                 CSenElement* pChildXor = AddXorElementL(aNewElement);
+//                 CSenElement* pChildAnd = AddAndElementL(pChildXor);
+                 aNormalAssertion = ProcessAssertionTermL(pNextChild, &newNormalForm);
+            }
+            
+            i++;    
+        }
+    }
+    
+  	return aNormalAssertion;
+}
+
+CSenElement* CPolicyNormalizer::ProcessPolicyTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion)
+{
+     
+    RPointerArray<CSenElement>& children = aAssertion->ElementsL();
+    TInt childCount = children.Count();    
+    CSenElement* pNextChild;
+    
+    if(childCount == 0)
+    {
+      CSenElement* pXor = AddXorElementL(aNormalAssertion);
+      CSenElement* pAnd = AddAndElementL(pXor);
+      return aNormalAssertion;
+    }
+    TInt i=0;
+    
+    CSenElement* assertionParent = aNormalAssertion;
+   
+
+    while (i < childCount)
+    {
+        pNextChild = children[i];
+         
+        
+        TPtrC8 localName = pNextChild->LocalName();
+
+        if(localName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+        {
+            TPtrC8 nt = aNormalAssertion->LocalName();
+
+            if(nt.Compare(WSPolicy::KWsPolicy)== 0) //PERFECT we need it
+            {
+            //        aNormalAssertion = 
+                ProcessXORTermL(pNextChild,aNormalAssertion);
+            }
+
+            else if(nt.Compare(WSPolicy::KXorCompositeAssertion)== 0)
+            {
+               CSenElement* NewXorParent =  aNormalAssertion->Parent();
+               ProcessXORTermL(pNextChild,NewXorParent); 
+            }
+            else if(nt.Compare(WSPolicy::KAndCompositeAssertion)== 0)
+            {
+               CSenElement* NewXorParent =  aNormalAssertion->Parent()->Parent();
+               ProcessXORTermL(pNextChild,NewXorParent);
+            }
+            else
+            {
+                //SHOULDNT BE  A CASE CAZ then we have XOR in some assertion
+                //It should always be in a POLICY tag
+            }
+        }
+        
+    
+        else if (localName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+        {
+            CSenElement* pNormChild = AddXorElementL(aNormalAssertion);
+            
+    //        aNormalAssertion = 
+            ProcessANDTermL(pNextChild, pNormChild);
+        }
+            
+        
+        else if (localName.Compare(WSPolicy::KWsPolicy) == 0 )
+        {
+            TPtrC8 parentName = aNormalAssertion->LocalName();
+            if(parentName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+            {
+                CSenElement* pChildXor = AddXorElementL(aNormalAssertion);
+                CSenElement* pChildAnd = AddAndElementL(pChildXor);
+                
+            }
+            else if(parentName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+            {
+            }
+            else if(parentName.Compare(WSPolicy::KWsPolicy) == 0)
+            {
+                CSenElement* pChildXor = AddXorElementL(aNormalAssertion);
+                CSenElement* pChildAnd = AddAndElementL(pChildXor);
+               
+            }
+            else
+            {
+                CSenElement* pChildXor = AddXorElementL(aNormalAssertion);
+                CSenElement* pChildAnd = AddAndElementL(pChildXor);                
+            }
+        }
+        else    //its an Assertion
+        {
+            TPtrC8 parentName = assertionParent->LocalName();
+            //if parent is Policy -> add XOR and AND and then process 
+            //assertion- >new parent for same level is AND
+            
+            //if parent is XOR -> Add AND and then process assertion. at this level the parent will be AND
+            //if parent is AND just process assertion
+            if(IsOptionalL(pNextChild))
+            {
+                if(parentName.Compare(WSPolicy::KWsPolicy) == 0)
+                {
+                    CSenElement* pXor = AddXorElementL(assertionParent);
+                    CSenElement* pAnd = AddAndElementL(pXor);
+    //                aNormalAssertion = 
+                    ProcessAssertionTermL(pNextChild, pAnd);
+                }
+                else if(parentName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+                {
+                    CSenElement* parentNow = assertionParent;
+                    assertionParent = assertionParent->Parent();
+                    CSenElement* policyParent= assertionParent->Parent();
+                    CSenElement* pXor = AddXorElementL(policyParent);
+                    CSenElement* pAnd = AddAndElementL(pXor);
+    //              aNormalAssertion = 
+                    ProcessAssertionTermL(pNextChild, pAnd);   
+                    assertionParent = parentNow;  
+
+                }   
+                else if(parentName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+                {
+                    
+                }
+                else
+                {
+                    //probably error   
+                }
+                
+ 
+            }
+            else
+            {
+                if(parentName.Compare(WSPolicy::KWsPolicy) == 0)
+                {
+                    CSenElement* pXor = AddXorElementL(assertionParent);
+                    CSenElement* pAnd = AddAndElementL(pXor);
+                    assertionParent = pAnd;
+    //                assertionParent =  ProcessAssertionTermL(pNextChild, pAnd);
+                    
+                }
+                else if(parentName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+                {
+    
+                    CSenElement* pXor = AddXorElementL(assertionParent);
+                    CSenElement* pAnd = AddAndElementL(pXor);
+    //            aNormalAssertion = ProcessAssertionTermL(pNextChild, pAnd);
+
+                    
+                }
+                else if(parentName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+                {
+    
+    //            aNormalAssertion = ProcessAssertionTermL(pNextChild, assertionParent);
+                    
+                }
+                else 
+                {
+                    CSenElement* pXor = AddXorElementL(assertionParent);
+                    CSenElement* pAnd = AddAndElementL(pXor);
+                    assertionParent = pAnd;
+      //            aNormalAssertion =  ProcessAssertionTermL(pNextChild, pAnd);
+                }
+                
+                ProcessAssertionTermL(pNextChild, assertionParent);
+            
+            }
+        }
+        
+    
+
+     i++;   
+    }
+
+    return assertionParent;
+
+}
+CSenElement* CPolicyNormalizer::ProcessXORTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion)
+{
+    
+    CSenElement* pNormChild = AddXorElementL(aNormalAssertion);
+    
+    RPointerArray<CSenElement>& children = aAssertion->ElementsL();
+    TInt childCount = children.Count();
+    TInt i = 0;
+    
+     while (i < childCount)
+    {
+        CSenElement* pChild = children[i];
+        
+        CSenElement* pNewChild = NULL;
+//        CSenElement* newChild = NULL;
+        
+        TPtrC8 childName = pChild->LocalName();
+        
+        if(childName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+        {
+            //If AND element then take child of AND
+//            CSenElement* newChild = 
+            ProcessANDTermL(pChild, pNormChild);
+            
+        }
+        else if (childName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+        {
+
+        }
+        else if(childName.Compare(WSPolicy::KWsPolicy) == 0)
+        {
+            pNewChild = AddAndElementL(pNormChild);
+            if(HasChildL(pChild) > 0)
+                ProcessPolicyTermL(pChild,pNewChild);
+        }
+        else
+        {
+            pNewChild = AddAndElementL(pNormChild);
+//            newChild = 
+            ProcessAssertionTermL(pChild, pNewChild);
+            //if Assertion then first we haveto add AND and then add Assertion
+            //(assertion will be done by AND too)
+        }
+          
+          i++;  
+    }
+    
+    		
+	return pNormChild;	
+	
+}
+CSenElement* CPolicyNormalizer::ProcessANDTermL(CSenElement* aAssertion, CSenElement* aNormalAssertion)
+{
+    CSenElement* pNormChild = AddAndElementL(aNormalAssertion);
+    
+    RPointerArray<CSenElement>& children = aAssertion->ElementsL();
+    TInt childCount = children.Count();
+//    CSenElement* normalizedFinalChild = NULL;
+    TInt i=0;
+    while (i < childCount)
+    {
+        CSenElement* pChild = children[i];
+//        CSenElement* newChild = NULL;
+        
+        TPtrC8 childName = pChild->LocalName();
+     
+    if(childName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+        {
+        
+        }
+    else if (childName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+        {
+            //will be solved during collapsing
+        
+        }
+    else if (childName.Compare(WSPolicy::KWsPolicy) == 0)
+        {
+            ProcessPolicyTermL(pChild,pNormChild);
+            
+        }
+    else
+        {
+//              normalizedFinalChild = 
+              ProcessAssertionTermL(pChild, pNormChild);
+        }
+ 
+        i++; 
+    }
+       
+	return aNormalAssertion;
+}
+
+
+
+
+
+CSenElement* CPolicyNormalizer::ProcessLogicL(CSenElement* aTerm)
+{
+    
+     //if sibling names are same as <ExactlyOne>
+    RPointerArray<CSenElement> matchingSiblings;
+    TInt matchingSiblingCount = 0;
+    if(aTerm->ElementsL(matchingSiblings, WSPolicy::KXorCompositeAssertion) == KErrNone)
+        matchingSiblingCount= matchingSiblings.Count();
+    if(matchingSiblingCount>1)
+        {  //XOR elements should have AND elements in them else normalization error
+        //Find elements
+        CSenElement* firstSibling = matchingSiblings[0];
+        
+        TInt i = 1;
+            while ( i < matchingSiblingCount)
+            {
+                CSenElement* nextSibling = matchingSiblings[i];
+                firstSibling = ProcessAndAndLogicL(firstSibling, nextSibling);
+
+                i++;
+            }
+            TInt j = 0;
+            while ( j < matchingSiblingCount)
+            {
+                CSenElement* removed = aTerm->RemoveElement(*matchingSiblings[j]);
+                if(removed)
+                    delete removed;
+                j++;                
+            }
+                        
+/****        aTerm->AddElementL(*firstSibling); */
+         }
+    
+    RPointerArray<CSenElement>& children = aTerm->ElementsL();
+    TInt childCount = children.Count();
+    
+    TInt i=0;
+        
+
+    while (i < childCount)
+    {
+        CSenElement* pChild = children[i];
+        
+        if(childCount == 1)
+            ProcessLogicL(pChild);
+        
+        TPtrC8 childName = pChild->LocalName();
+        TPtrC8 parentName = aTerm->LocalName();
+    
+        
+        //if parent name and child name are same
+        if(childName.Compare(parentName) == 0)
+        {
+                if(childName.Compare(WSPolicy::KWsPolicy) == 0)
+                {
+                    
+                }
+                else if(childName.Compare(WSPolicy::KAndCompositeAssertion) == 0)
+                {
+                    
+                }
+                else if(childName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+                {
+                  ProcessXorCollapseLogicL(aTerm,pChild);
+                  continue;  
+                }   
+          
+        }
+        
+
+        i++;
+    }
+    
+    matchingSiblings.Close();
+    return aTerm;
+}
+
+CSenElement* CPolicyNormalizer::ProcessXorCollapseLogicL(CSenElement* aParent, CSenElement* aChild)
+{
+        RPointerArray<CSenElement>& siblings = aParent->ElementsL();
+        RPointerArray<CSenElement>& collapsingChildren = aChild->ElementsL();
+        
+        TInt childCount = collapsingChildren.Count();
+        TInt i=0;
+     
+        RPointerArray<CSenElement> matchingSiblings;
+        TInt matchingSiblingCount = 0;
+        if(aParent->ElementsL(matchingSiblings, WSPolicy::KAndCompositeAssertion) == KErrNone)
+            matchingSiblingCount= matchingSiblings.Count();
+                
+     
+        while (i < childCount)
+        {
+            CSenElement* child = collapsingChildren[i];
+           
+         
+              for (TInt j = 0; j<matchingSiblingCount; j++)                    
+                {
+                
+                    RPointerArray<CSenElement>& siblingsChildren = matchingSiblings[j]->ElementsL();
+                    TInt matchingSiblingChildrenCount= siblingsChildren.Count();
+                    
+                    for (TInt k = 0; k<matchingSiblingChildrenCount; k++)
+                    {
+                        CSenElement* element = siblingsChildren[k];
+                        child->AddElementL(*element);
+ //                       TPtrC8 name = detachedSibling->LocalName();
+                        
+                    }
+                    
+                    
+                }
+                child->SetParent(aParent);
+                aParent->AddElementL(*child);
+
+      
+        i++;
+        }
+        
+         CSenElement* thisOne = aParent->RemoveElement(*aChild);
+         if(thisOne)
+            delete thisOne;
+        
+        for (TInt j = 0; j<matchingSiblingCount; j++)  
+        {
+            CSenElement* thisOneagain = aParent->RemoveElement(*matchingSiblings[j]);    
+            if(thisOneagain)
+                delete thisOneagain;
+            
+        }
+        
+        
+        return aParent;
+    
+
+}
+CSenElement* CPolicyNormalizer::ProcessAssertionBranchingL(CSenElement* aPolicy)
+{
+  
+  RPointerArray<CSenElement>& children = aPolicy->ElementsL();
+  TInt childCount = children.Count();
+  
+  if(childCount == 0)
+    return aPolicy;
+  
+  TInt i = 0;
+  while (i < childCount)
+    {
+    CSenElement* pChild = children[i];
+    TPtrC8 childName = pChild->LocalName();
+    
+    if( childName.Compare(WSPolicy::KWsPolicy) == 0 
+        || childName.Compare(WSPolicy::KAndCompositeAssertion) == 0
+        || childName.Compare(WSPolicy::KXorCompositeAssertion) == 0)
+        {
+        ProcessAssertionBranchingL(pChild);
+        }   
+    else //Assertion
+        {
+        DuplicateAssertionBranchL(aPolicy , pChild);
+        }
+    i++;
+    }
+  return aPolicy;
+  }
+
+CSenElement* CPolicyNormalizer::DuplicateAssertionBranchL(CSenElement* /*aParent*/, CSenElement* aDuplicatingPolicy)
+{  //aDuplicatingPolicy is always an assertion 
+//check if aDuplicatingPolicy have two assertions, if yes then divide the assertion in 
+  // T W O separate assertions
+  //first check that if any of the two assertion themselve have 
+  
+  // if XOR have multiple ANDs then check if XOR parent is an Assertion. 
+  // if yes then divide them in Two assertions.
+  TPtrC8 asseryName = aDuplicatingPolicy->LocalName();
+  TInt childCount = HasChildL(aDuplicatingPolicy);
+  
+  if( childCount== 0) //There is NO CHILD NESTING in assertion
+        return aDuplicatingPolicy;  
+  else if (childCount == 1) ////Assertion should always have only one <wsp:policy> element. 
+  {
+    TBool deleted = EFalse;
+        CSenElement* assertionPolicyElement = aDuplicatingPolicy->Child(0); //policy element
+        TPtrC8 policyName = assertionPolicyElement->LocalName();
+        if(policyName.Compare(WSPolicy::KWsPolicy)== 0)
+        { //now we should have XOR and AND elements
+        
+        CSenElement* assertionXORElement = assertionPolicyElement->Child(0); //XOR element
+        //there should be only one XOR element (in normalize mode)
+        TPtrC8 name1 = assertionXORElement->LocalName();
+        TInt AndElementCount = HasChildL(assertionXORElement);
+        //If it has only one AND child element then nuthing to do here but if more then one element
+        // then it means that assertion have nesting and should have a different branch.
+        if(AndElementCount == 0)
+            return aDuplicatingPolicy;
+        else if(AndElementCount == 1)
+        {
+             ProcessAssertionBranchingL(assertionXORElement->Child(0));   
+        }
+        else if(AndElementCount > 1)
+        {
+             RPointerArray<CSenElement>& assertionXorChildren = assertionXORElement->ElementsL(); //AND elements
+             TInt i = 0;
+             while (i < AndElementCount)
+             {
+                //copy the root assertion to new tag
+                // Take out the replacing tag
+                // create two separate tag and replace them in the original and root copy tag
+                
+                CSenXmlElement* AND = (CSenXmlElement*)assertionXorChildren[i];
+//                ProcessAssertionBranchingL(AND);
+                
+                CSenXmlElement* rootAssertion = (CSenXmlElement*)FindRootAssertionL(AND);
+                if (!IsChildOfElement(rootAssertion, AND))
+                {
+                    i++;
+                    continue;
+                }
+                
+//create a duplicate tag,
+                //duplicating assertion                
+                TPtrC8 assertionCopyName = rootAssertion->LocalName();
+                TPtrC8 assertionCopyNsUri = rootAssertion->NamespaceURI();
+                CSenXmlElement* XORParent = (CSenXmlElement*)rootAssertion->Parent();
+                CSenElement* parentsBrandNewRootAssertion =AddAndElementL(XORParent->Parent());
+                
+                CSenElement& newDuplicateAssertion = parentsBrandNewRootAssertion->AddElementL(assertionCopyNsUri,assertionCopyName);
+
+//cut and paste the second AND to duplicate
+                
+                newDuplicateAssertion.CopyFromL(*rootAssertion);
+                
+                DeleteAsertionIndexL(aDuplicatingPolicy, &newDuplicateAssertion, i);
+                deleted = ETrue;
+//                newDuplicateAssertion.SetParent(parentsBrandNewRootAssertion);
+                //parentsBrandNewRootAssertion->ReplaceElementL(newDuplicateAssertion);
+                
+                //find from this new element the required assertion and then delete
+                // all of the optins from it except the current i+1 ALL element
+             
+                i++;
+             }
+
+            if(deleted)                    
+            {
+             CSenElement* rootAssertion = FindRootAssertionL(aDuplicatingPolicy);
+             CSenElement* AND = rootAssertion->Parent();
+             CSenElement* XOR = AND->Parent();
+             CSenElement* thisOne = XOR->RemoveElement(*AND);
+             if(thisOne)             
+                 iOrphanElements.Append(thisOne);
+//                delete thisOne; //P DuplicateAssertionBranch A T H E T I C   H A C K 
+             //now we have solved the first level nesting
+             //our original policy is changed so now use the original policy and solve it again
+             CSenElement* documentRoot = (CSenElement*)&XOR->Root(); 
+             ProcessAssertionBranchingL(documentRoot);
+ 
+        }
+        
+        
+        }
+        }
+  }
+  else if(childCount > 1)
+  {
+  //this count is always one because its a child wsp:policy element, policy element 
+  //could have multiple XOR elements . If it comes here something is W R O N G
+    
+  }
+    //here is the nesting problem. the assertion policy should have only one 
+   // Alternative = <XOR><AND>< --assertion-- ></AND></XOR> 
+   // NO TWO XORs are allowed here
+   return aDuplicatingPolicy;
+}
+CSenElement* CPolicyNormalizer::DeleteAsertionIndexL(CSenElement* aAssertion, CSenElement* anewAssertion, TInt aIndx)
+{
+    TPtrC8 name = aAssertion->LocalName();
+    TPtrC8 nsUri = aAssertion->NamespaceURI();
+    TInt i = 0;
+
+    RPointerArray<CSenElement>& assertionChildren = anewAssertion->ElementsL();
+    TInt newAssertionChildCount = assertionChildren.Count();
+    
+    if(newAssertionChildCount == 0)
+        return anewAssertion;
+    
+    TPtrC8 namee = anewAssertion->LocalName();
+    if (name.Compare(anewAssertion->LocalName())== 0)
+    { //delete children from this assertion except index child
+        CSenXmlElement* PolicyElement = (CSenXmlElement*)anewAssertion->Child(0);
+        CSenXmlElement* XORElement = (CSenXmlElement*)PolicyElement->Child(0);
+        RPointerArray<CSenElement>& XorChildren = XORElement->ElementsL();
+        TInt XORChildrenCount = XorChildren.Count();
+         
+        for (TInt k = 0; k <XORChildrenCount; k++)
+        {
+            if(k == aIndx)
+            {
+                
+            }
+            else
+            {
+                CSenElement* newElement = XORElement->RemoveElement(*XorChildren[XORChildrenCount-1-k]);
+                if(newElement)
+                {
+                    delete newElement;               
+                //    break;    
+                }
+                
+            }
+                
+        }
+        return anewAssertion;
+    }
+
+    while (i < newAssertionChildCount)
+    {
+    
+        DeleteAsertionIndexL(aAssertion, assertionChildren[i], aIndx);
+        i++;
+    }
+    
+    return anewAssertion;
+}
+CSenElement* CPolicyNormalizer::FindRootAssertionL(CSenElement* aElement)
+{
+
+    CSenElement* rootAssertionTag = NULL;
+    
+    CSenElement* documentRoot = (CSenElement*)&aElement->Root();
+    CSenElement* doumentXOR = documentRoot->Child(0); //cant be more then one :p
+    
+    //find first assertion here  
+    RPointerArray<CSenElement>& children = doumentXOR->ElementsL(); //AND elements
+    TInt childCount = children.Count();
+    
+    if(childCount == 0) //something invalid with document
+        return aElement;
+  
+    else if (childCount > 0) //onyl one AND element, Next child should be root Assertion
+    {
+        TInt i = 0;
+        while (i < childCount)
+        {            
+            CSenElement* andTag = children[i];
+        TInt andAssertions = HasChildL(andTag);
+        
+        if(andAssertions == 0)
+            return aElement;
+        else if(andAssertions == 1)
+            {
+                TBool isChild = IsChildOfElement(andTag->Child(0), aElement);
+                if(isChild)
+                return andTag->Child(0);
+            }
+        else if (andAssertions > 1)
+        {
+            RPointerArray<CSenElement>& rootAssertions = andTag->ElementsL(); //AND elements
+            TInt j = 0;
+            while (j < andAssertions)
+            {
+                
+                TBool isChild = IsChildOfElement(rootAssertions[j], aElement);
+                
+                if(isChild)
+                {
+                     rootAssertionTag = rootAssertions[j];
+                     break;
+                }
+                
+                j++;
+                }
+            }
+        i++;
+        }
+        
+        
+    }
+    else if (childCount > 1)
+    {
+    
+        
+    }
+    
+    return rootAssertionTag;
+
+}
+TBool CPolicyNormalizer::IsChildOfElement(CSenElement* aParent, CSenElement* aChild)
+{ //aParent and child botth are assertions
+    
+    CSenElement* rootChildAssertionTag = aChild; //->Parent();
+    TPtrC8 nqame1 = aParent->LocalName();
+    while (true)
+    {
+        
+        if(rootChildAssertionTag)
+        {
+            
+            TPtrC8 nqame2 = rootChildAssertionTag->LocalName();
+            
+            if(rootChildAssertionTag == aParent)
+            {
+                return ETrue;
+        
+            }
+        }
+        else
+        {
+            return EFalse;    
+        }   
+        rootChildAssertionTag = rootChildAssertionTag->Parent();
+    }
+}
+CSenElement* CPolicyNormalizer::ProcessAndCollapseLogic(CSenElement* aParent, CSenElement* /*aChild*/)
+{
+ return  aParent;  
+}
+
+CSenElement* CPolicyNormalizer::ProcessAndAndLogicL(CSenElement* aFirstTerm, CSenElement* aSecondTerm )
+{
+    //Two XOR XOR parameters are given which have same parent and have AND child elements,
+    //The AND child elements will be resolved according to Ditributive law 
+    //takes all child Assertion elements from SecondTerm and put them in first term
+    
+
+    RPointerArray<CSenElement> matchingSiblingsFirst;
+    CleanupClosePushL(matchingSiblingsFirst);
+    
+    if(aFirstTerm->ElementsL(matchingSiblingsFirst, WSPolicy::KAndCompositeAssertion) == KErrNone
+       || aFirstTerm->ElementsL(matchingSiblingsFirst, WSPolicy::KXorCompositeAssertion) == KErrNone
+       || aFirstTerm->ElementsL(matchingSiblingsFirst, WSPolicy::KWsPolicy) == KErrNone
+       || aSecondTerm->ElementsL(matchingSiblingsFirst, WSPolicy::KAndCompositeAssertion) == KErrNone
+       || aSecondTerm->ElementsL(matchingSiblingsFirst, WSPolicy::KXorCompositeAssertion) == KErrNone
+       || aSecondTerm->ElementsL(matchingSiblingsFirst, WSPolicy::KWsPolicy) == KErrNone)
+       
+       
+       
+    { // they are NOT the last children so first go deep to last assertion and then process that assertion
+            ProcessLogicL(aFirstTerm);
+            ProcessLogicL(aSecondTerm);
+    }
+    CleanupStack::PopAndDestroy();//matchingSiblingsFirst
+    
+//    else // they are the last children
+   
+     
+        RPointerArray<CSenElement>& siblings = aFirstTerm->ElementsL();
+        RPointerArray<CSenElement>& collapsingChildren = aSecondTerm->ElementsL();
+         
+        
+        TInt siblingsCount = siblings.Count();
+        TInt childCount = collapsingChildren.Count();
+        
+        if(siblingsCount == 0)
+            return aFirstTerm;
+        else if (childCount == 0)
+            return aSecondTerm;
+        
+        TInt i=0;
+        TInt j=0;
+        
+        CSenElement* collpasingElement = NULL;
+        CSenElement* returningElement = NULL;
+        if(siblingsCount <  childCount)
+        {
+            CSenElement& distributiveElement = aFirstTerm->Parent()->AddElementL(WSPolicy::KWsPolicyNsUri,WSPolicy::KXorCompositeAssertion);;
+//            distributiveElement = CSenXmlElement::NewL(WSPolicy::KWsPolicyNsUri,WSPolicy::KXorCompositeAssertion);   
+//            aFirstTerm->Parent()->AddElementL(*distributiveElement);
+//            distributiveElement->SetParent(aFirstTerm->Parent());
+            
+            while(j < childCount)
+            { //chnage logic for <ALL/>
+/*
+
+<XOR>
+    <AND>
+        <!--assertion1-->
+    </AND>
+    <AND/>
+</XOR>
+<XOR>
+    <AND>
+        <!--assertion3-->
+    </AND>
+    <AND>
+        <!--assertion4-->
+    </AND>
+
+</XOR>
+
+1.make assertion1 assertion 3
+2. make assertion 2 assertion 3
+3. Replace <AND/> with all the assertions from second <XOR> i.e. 
+with 
+    <AND>
+        <!--assertion3-->
+    </AND>
+    <AND>
+        <!--assertion4-->
+    </AND>
+*/                
+                CSenElement* newParentElement = collapsingChildren[j];
+                
+                TBool EmptyAndElement = EFalse;
+                if (HasChildL(newParentElement) < 1)
+                {
+                    EmptyAndElement = ETrue;
+                }
+                
+                while(i < siblingsCount)
+                {
+                    collpasingElement = siblings[i];
+
+                    RPointerArray<CSenElement>& collpasEleAssertion = collpasingElement->ElementsL();
+                    TInt countt = collpasEleAssertion.Count();
+                    
+                    if(EmptyAndElement) //copy all elements from here to new parent
+                    {
+
+                           CSenElement& ele = distributiveElement.AddElementL(collpasingElement->NamespaceURI(), collpasingElement->LocalName());
+                           ele.CopyFromL(*collpasingElement);
+                    }
+//                    else if(collpasingElement->Child(0))
+//                        newParentElement->AddElementL(*collpasingElement->Child(0));
+                    else
+                    { //This is an empty <ALL /> element so use distributive law to resolve it
+                       
+                       CSenElement* AndElement = AddAndElementL(&distributiveElement);
+                        //copy here all elements from first AND element and 2nd AND element
+                        
+                        RPointerArray<CSenElement>& ParentChildren = newParentElement->ElementsL();
+                        TInt countHere = ParentChildren.Count();
+                          for (TInt k = 0; k < countHere; k++)
+                            {
+                                CSenElement* pkChild = ParentChildren[k];
+                                CSenElement& here = AndElement->AddElementL(pkChild->NamespaceURI(), pkChild->LocalName());
+                                here.CopyFromL(*pkChild);
+                            }
+                          for(TInt l = 0; l < countt; l++)
+                            {
+                                CSenElement* paChild = collpasEleAssertion[l];
+                                CSenElement& hereAgain = AndElement->AddElementL(paChild->NamespaceURI(), paChild->LocalName());
+                                hereAgain.CopyFromL(*paChild);
+                                
+                            }
+                          
+                    }
+                    i++;
+                }
+                i = 0;
+                j++;
+            }
+            returningElement = &distributiveElement;
+            CSenElement* parentElement = aFirstTerm->Parent();
+//            parentElement->RemoveElement(*aFirstTerm);
+            
+        }
+        else
+        {
+            CSenElement& distributiveElement = aFirstTerm->Parent()->AddElementL(WSPolicy::KWsPolicyNsUri,WSPolicy::KXorCompositeAssertion);;
+//            distributiveElement = CSenXmlElement::NewL(WSPolicy::KWsPolicyNsUri,WSPolicy::KXorCompositeAssertion);   
+//            aFirstTerm->Parent()->AddElementL(*distributiveElement);
+//            distributiveElement->SetParent(aFirstTerm->Parent());
+            while(j < siblingsCount)
+            {
+                CSenElement* newParentElement = siblings[j]; //AND element
+
+                TBool EmptyAndElement = EFalse;
+                if (HasChildL(newParentElement) < 1)
+                {
+                    EmptyAndElement = ETrue;
+                }
+
+        
+                while(i < childCount)
+                {
+                    collpasingElement = collapsingChildren[i]; //AND element
+
+                    RPointerArray<CSenElement>& collpasEleAssertion = collpasingElement->ElementsL(); // AND element Assertions
+                    TInt countt = collpasEleAssertion.Count();
+                    
+                    if(EmptyAndElement) //copy all elements from here to new parent
+                    {
+                           CSenElement& ele = distributiveElement.AddElementL(collpasingElement->NamespaceURI(), collpasingElement->LocalName());
+                           ele.CopyFromL(*collpasingElement);
+                    }   
+//                    else if(countt == 1)    //If AND has only one assertion
+//                        newParentElement->AddElementL(*collpasingElement->Child(0));
+                    else //if(countt > 1)
+                    { //Distributive Law
+                    
+                        CSenElement* AndElement = AddAndElementL(&distributiveElement);
+                        //copy here all elements from first AND element and 2nd AND element
+                        
+                        RPointerArray<CSenElement>& ParentChildren = newParentElement->ElementsL();
+                        TInt countHere = ParentChildren.Count();
+                          for (TInt k = 0; k < countHere; k++)
+                            {
+                                CSenElement* pkChild = ParentChildren[k];
+                                CSenElement& here = AndElement->AddElementL(pkChild->NamespaceURI(), pkChild->LocalName());
+                                here.CopyFromL(*pkChild);
+                            }
+                          for(TInt l = 0; l < countt; l++)
+                            {
+                                CSenElement* paChild = collpasEleAssertion[l];
+                                CSenElement& hereAgain = AndElement->AddElementL(paChild->NamespaceURI(), paChild->LocalName());
+                                hereAgain.CopyFromL(*paChild);
+                            }
+                         
+                    }
+                    i++;
+                }
+                i = 0;
+                j++;
+        }
+            returningElement = &distributiveElement; //; aFirstTerm;
+            CSenElement* parentElement = aSecondTerm->Parent();
+        }
+
+    return  returningElement;
+    
+}
+
+TInt CPolicyNormalizer::HasChildL(CSenElement* aTerm)
+{
+    RPointerArray<CSenElement>& children = aTerm->ElementsL();
+    
+    TInt childCount = children.Count();
+    return childCount;
+    
+}
+
+CSenElement* CPolicyNormalizer::AddAndElementL(CSenElement* aAssertion)
+{
+   
+    CSenElement& newElement = aAssertion->AddElementL(WSPolicy::KWsPolicyNsUri,
+                                                 WSPolicy::KAndCompositeAssertion);
+    return &newElement;
+                                                                                                  
+}
+
+CSenElement* CPolicyNormalizer::AddXorElementL(CSenElement* aAssertion)
+{
+     CSenElement& newElement = aAssertion->AddElementL(WSPolicy::KWsPolicyNsUri,
+                                                 WSPolicy::KXorCompositeAssertion);
+       return &newElement;
+                                                                                                  
+}
+
+CSenElement* CPolicyNormalizer::AddPolicyElementL(CSenElement* aAssertion)
+{
+     CSenElement& newElement = aAssertion->AddElementL(WSPolicy::KWsPolicyNsUri,
+                                                 WSPolicy::KWsPolicy);
+       return &newElement;                                                                                                
+}
+
+
+
+TBool CPolicyNormalizer::ValidateElementNsL(CSenElement* aAssertion)
+{
+  
+  CSenElement& element = AsElement();
+  RPointerArray<CSenNamespace>& namespaces = element.NamespacesL();
+  
+  if(aAssertion->NamespaceURI().Length() < 1 )
+  {
+  
+   TPtrC8 elementName = aAssertion->LocalName();
+   TInt location = elementName.Find(KColon);
+   
+   if (location)
+       {
+        TPtrC8 nsPrefix = elementName.Left(location);
+          
+        CSenNamespace* ns = NULL;
+        TInt count = namespaces.Count();
+        for (TInt i=0; i < count; i++)
+            {
+            ns = (namespaces)[i];
+            if(ns->Prefix().Compare(nsPrefix) == 0)
+                {
+                aAssertion->SetNamespaceL(ns->Prefix(),ns->URI());
+                return ETrue;
+                }
+            }
+        }
+    }
+    return EFalse;
+}
+
+
+TBool CPolicyNormalizer::CopySenElementWithoutOptionL(CSenElement* aSource,CSenElement* aDestination)
+{
+  
+  TPtrC8 sourceContent = aSource->Content();
+  TBool isTrue = EFalse;
+  if (sourceContent.Length() > 0)
+      {
+        aDestination->SetContentL(sourceContent);
+        
+      }
+
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aSource->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+            if(pBaseAttribute->Name().Compare(WSPolicy::KWspOptinal) == 0)
+            {
+                if(pBaseAttribute->Value().Compare(WSPolicy::KWspOptinalTrue) == 0)
+                    isTrue = ETrue;                    
+            }
+                
+            else
+                aDestination->AddAttributeL(pBaseAttribute->Name(),pBaseAttribute->Value());
+            
+            }
+        }
+//        sourceAttributes.Close();
+        return isTrue;  
+}
+
+CSenElement* CPolicyNormalizer::CopySenElementL(CSenElement* aSource, CSenElement* aDestination)
+{
+  TPtrC8 sourceContent = aSource->Content();
+  if (sourceContent.Length() > 0)
+      {
+        aDestination->SetContentL(sourceContent);
+        
+      }
+    aDestination->SetNamespaceL(aSource->NsPrefix(), aSource->NamespaceURI());
+
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aSource->AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+
+            aDestination->AddAttributeL(pBaseAttribute->Name(),
+                                        pBaseAttribute->Value());
+            
+            }
+        }
+//        sourceAttributes.Close();
+        return aDestination;
+}
+
+void CPolicyNormalizer::ReadFileL( TFileName aPath )
+    {
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+     
+    if(iPath)
+        {
+        delete iPath;
+        iPath = NULL;
+        }
+        
+    iPath = aPath.AllocL();
+    
+    TFileName iFileName(aPath);
+    RFile  xmlFile;
+    TInt err = xmlFile.Open(fss , iFileName, EFileRead );
+    
+    if(err == KErrNone)
+        {
+        TInt size;
+        xmlFile.Size(size);
+
+        HBufC8 *iBuf=HBufC8::NewL(size);
+
+        TPtr8 buf8ptr(iBuf->Des());
+        xmlFile.Read(buf8ptr,size);
+        xmlFile.Close();
+
+        TInt leaveCode(KErrNone);
+        TRAP leaveCode, ParseL(buf8ptr) );
+        leaveCode = 0; // not used currently
+        delete iBuf;
+        iBuf = NULL;
+        }
+    CleanupStack::PopAndDestroy(1); // fss
+    }
+
+TInt CPolicyNormalizer::ReadL(TDesC8& aXmlDesc)
+    {
+    TInt err (KErrNone);
+    TInt size = aXmlDesc.Length();
+    if(size > 0)
+        {
+        HBufC8 *pBuf= aXmlDesc.AllocL();
+        CleanupStack::PushL(pBuf);
+        TPtr8 buf8ptr(pBuf->Des());
+        
+        TRAP (err, ParseL(buf8ptr));
+        
+        CleanupStack::PopAndDestroy(pBuf);
+        }
+        return err;
+    }
+
+void CPolicyNormalizer::WriteAllL(CSenElement* /*aXml*/)
+{
+  RFs fss;
+       User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+        
+    TBuf<255> file;
+    _LIT( KFileName, "c:\\logs\\normalizer%d.xml");
+    file.Format(KFileName, count);
+    count++;
+    TPtrC OutputFile(file);
+    
+   TBuf<256> tempp(KOutPath);
+//   tempp.Insert(tempp.Length() , iPath->Des());
+   
+//   TFileName iFileName(tempp);
+   RFile  xmlFile;
+   xmlFile.Replace(fss , OutputFile, EFileWrite );
+   HBufC8* temp = iNewPolicy->AsXmlL();
+   xmlFile.Write(temp->Des());
+   xmlFile.Close();
+   delete temp;
+    
+   CleanupStack::PopAndDestroy(1); // fss
+  
+}
+void CPolicyNormalizer::WriteL(CSenElement* aXml)
+{
+    RFs fss;
+        User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+        
+    TBuf<255> file;
+    _LIT( KFileName, "c:\\logs\\normalizer%d.xml");
+    file.Format(KFileName, count);
+    count++;
+    TPtrC OutputFile(file);
+    
+   TBuf<256> tempp(KOutPath);
+//   tempp.Insert(tempp.Length() , iPath->Des());
+   
+//   TFileName iFileName(tempp);
+   RFile  xmlFile;
+   xmlFile.Replace(fss , OutputFile, EFileWrite );
+   HBufC8* temp = aXml->AsXmlL();
+   xmlFile.Write(temp->Des());
+   xmlFile.Close();
+   delete temp;
+    
+   CleanupStack::PopAndDestroy(1); // fss
+   
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/WSStarPolicyMain.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+#include <e32base.h>
+
+// ---------------------------------------------------------------------------
+// DLL Entry point
+// ---------------------------------------------------------------------------
+//
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/WSStarPolicyProxy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "WSStarPolicy.h"
+
+// ---------------------------------------------------------------------------
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(0x101F9723,  CWSStarPolicy::NewL)
+    };
+
+// ---------------------------------------------------------------------------
+// Function used to return an instance of the proxy table.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+                                                            TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/WsSecurityPolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2364 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    
+*
+*/
+
+
+
+
+#include "wssecuritypolicy.h"
+#include "wspolicy.h"
+#include "wssecuritypolicyconstants.h"
+
+using namespace WsSecurityPolicy;
+
+CWsSecurityPolicy* CWsSecurityPolicy::NewL()
+{
+    CWsSecurityPolicy* pSelf =
+        CWsSecurityPolicy::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CWsSecurityPolicy* CWsSecurityPolicy::NewLC()
+{
+    CWsSecurityPolicy* pSelf = new (ELeave) CWsSecurityPolicy();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;  
+}
+void CWsSecurityPolicy::ConstructL()
+{
+
+}
+CWsSecurityPolicy::~CWsSecurityPolicy()
+{
+    
+}
+CWsSecurityPolicy::CWsSecurityPolicy()
+{
+    
+}
+
+CSenElement* CWsSecurityPolicy::IntersectL(TDesC8& aKey, CSenElement* aFirst, CSenElement* aSecond)
+    {
+    TBool reply(EFalse);
+
+    if(aKey.Compare(KAsymmetricBinding) == 0)
+        {
+        CAsymmetricBinding* firstBinding = CAsymmetricBinding::NewL(aFirst);
+        CleanupStack::PushL( firstBinding );
+        CAsymmetricBinding* secondBinding = CAsymmetricBinding::NewL(aSecond);
+        CleanupStack::PushL( secondBinding );
+        reply = firstBinding->IsEqualAsymmtericAssertion( secondBinding );        
+        CleanupStack::PopAndDestroy( secondBinding ); // delete secondBinding;
+        CleanupStack::PopAndDestroy( firstBinding ); // delete firstBinding;
+        }
+    else if(aKey.Compare(KSymmetricBinding) == 0)
+        {
+        CSymmetricBinding* firstBinding = CSymmetricBinding::NewL(aFirst);
+        CleanupStack::PushL( firstBinding );
+        CSymmetricBinding* secondBinding = CSymmetricBinding::NewL(aSecond);
+        CleanupStack::PushL( secondBinding );
+        reply = firstBinding->IsEqualSymmtericAssertion(secondBinding);
+        CleanupStack::PopAndDestroy( secondBinding ); // delete secondBinding;
+        CleanupStack::PopAndDestroy( firstBinding ); // delete firstBinding;
+        }
+    else if(aKey.Compare(KWss10) == 0)
+        {
+        CWss10* pFirstAssertion = CWss10::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CWss10* pSecondAssertion = CWss10::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualWss10Assertion(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }
+    else if(aKey.Compare(KWss11) == 0)
+        {
+        CWss11* pFirstAssertion = CWss11::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CWss11* pSecondAssertion = CWss11::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualWss11Assertion(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }
+    else if(aKey.Compare(KTrust10) == 0)
+        {
+        CWsTrust10* pFirstAssertion = CWsTrust10::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CWsTrust10* pSecondAssertion = CWsTrust10::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualWsTrust10Assertion(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }
+    else if(aKey.Compare(KSignedParts) == 0 || aKey.Compare(KEncryptedParts) == 0 )
+        {
+        CEncryptedSignedParts* pFirstAssertion = CEncryptedSignedParts::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CEncryptedSignedParts* pSecondAssertion = CEncryptedSignedParts::NewL(aSecond);        
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualEncryptedSignedParts(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }   
+    else if(aKey.Compare(KSignedElements) == 0 || aKey.Compare(KEncryptedElements) == 0 )
+        {
+        CEncryptedSignedElements* pFirstAssertion = CEncryptedSignedElements::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CEncryptedSignedElements* pSecondAssertion = CEncryptedSignedElements::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualEncryptedSignedElements(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }   
+
+    // return the first, if comparison equals
+    if (reply)
+        {
+        return aFirst;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+CSenElement* CWsSecurityPolicy::MergeL(TDesC8& aKey, CSenElement* aFirst, CSenElement* aSecond)
+    {
+    TBool reply(EFalse);
+    if(aKey.Compare(KAsymmetricBinding) == 0)
+    {
+        CAsymmetricBinding* firstBinding = CAsymmetricBinding::NewL(aFirst);
+        CleanupStack::PushL( firstBinding );
+        CAsymmetricBinding* secondBinding = CAsymmetricBinding::NewL(aSecond);
+        CleanupStack::PushL( secondBinding );
+        reply = firstBinding->IsEqualAsymmtericAssertion(secondBinding);
+        CleanupStack::PopAndDestroy( secondBinding ); // delete secondBinding;
+        CleanupStack::PopAndDestroy( firstBinding ); // delete firstBinding;
+        }
+    else if(aKey.Compare(KSymmetricBinding) == 0)
+        {
+        CSymmetricBinding* firstBinding = CSymmetricBinding::NewL(aFirst);
+        CleanupStack::PushL( firstBinding );
+        CSymmetricBinding* secondBinding = CSymmetricBinding::NewL(aSecond);
+        CleanupStack::PushL( secondBinding );
+        reply = firstBinding->IsEqualSymmtericAssertion(secondBinding);
+        CleanupStack::PopAndDestroy( secondBinding ); // delete secondBinding;
+        CleanupStack::PopAndDestroy( firstBinding ); // delete firstBinding;
+        }
+    else if(aKey.Compare(KWss10) == 0)
+        {
+        CWss10* pFirstAssertion = CWss10::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CWss10* pSecondAssertion = CWss10::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualWss10Assertion(pFirstAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }
+    else if(aKey.Compare(KWss11) == 0)
+        {
+        CWss11* pFirstAssertion = CWss11::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CWss11* pSecondAssertion = CWss11::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualWss11Assertion(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }
+     else if(aKey.Compare(KTrust10) == 0)
+        {
+        CWsTrust10* pFirstAssertion = CWsTrust10::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CWsTrust10* pSecondAssertion = CWsTrust10::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualWsTrust10Assertion(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }   
+    else if(aKey.Compare(KSignedParts) == 0 || aKey.Compare(KEncryptedParts) == 0 )
+        {
+        CEncryptedSignedParts* pFirstAssertion = CEncryptedSignedParts::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CEncryptedSignedParts* pSecondAssertion = CEncryptedSignedParts::NewL(aSecond);        
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualEncryptedSignedParts(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+        }   
+    else if(aKey.Compare(KSignedElements) == 0 || aKey.Compare(KEncryptedElements) == 0 )
+        {
+        CEncryptedSignedElements* pFirstAssertion = CEncryptedSignedElements::NewL(aFirst);
+        CleanupStack::PushL( pFirstAssertion );
+        CEncryptedSignedElements* pSecondAssertion = CEncryptedSignedElements::NewL(aSecond);
+        CleanupStack::PushL( pSecondAssertion );
+        reply = pFirstAssertion->IsEqualEncryptedSignedElements(pSecondAssertion);
+        CleanupStack::PopAndDestroy( pSecondAssertion ); // delete pSecondAssertion;
+        CleanupStack::PopAndDestroy( pFirstAssertion ); // delete pFirstAssertion;
+
+//        RArray<TPtrC8> result;
+//        TBool signAll = firstAssertion->MergedElements(SecondAssertion, result);
+//        CSenElement* mergedEelement = aFirst.CopyL();
+//        mergedEelement.RemoveChildren();
+//        
+//        if(!signAll)
+//        {
+//
+//            //reply value depends on it
+//            if(//reply && 
+//            result.Count() > 0)
+//            {
+////                TString argument;
+////                argument.SetL(KXPath);
+//                for(TInt i = 0; i< result.Count(); i++)
+//                {//Copy original element, delete all children and add new children
+//                    
+//                    TPtrC8 te= result[i];
+////                    TString content;
+////                    content.SetL(te);
+//                    CSenElement* xpath = mergedEelement.AddNewElementSameNsL(KXPath);
+//                    xpath.AddTextL(te);
+////                    content.Close();
+//                }
+////                argument.Close();
+//
+//              }
+//        
+//        }
+//
+        }   
+    if (reply)
+        {
+        return aFirst;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+
+CToken::~CToken()
+    {
+    }
+
+CToken::CToken():
+iTokenInclusion(KIncludeAlways),
+iDerivedKeys(EFalse)
+    {
+    }
+
+void CToken::ConstructL(CSenElement* aToken)
+    {
+    const TDesC8* attr = aToken->AttrValue(KIncludeToken);
+    if(attr)
+        {
+        HBufC8* attrib = attr->AllocL();
+        TPtrC8 includeToken = attrib->Des();
+        if(includeToken.Compare(KIncludeNever) == 0)
+            iTokenInclusion.Set(KIncludeNever);
+        else if(includeToken.Compare(KIncludeOnce) == 0)
+            iTokenInclusion.Set(KIncludeOnce);
+        else if(includeToken.Compare(KIncludeAlwaysToReceipent) == 0)
+            iTokenInclusion.Set(KIncludeAlwaysToReceipent);
+        else if(includeToken.Compare(KIncludeAlways) == 0)
+            iTokenInclusion.Set(KIncludeAlways);
+        delete attrib;
+        }
+   }
+
+void CToken::BaseConstructL(CSenElement* aToken)
+    {
+    ConstructL(aToken);
+    }
+
+
+CHttpsToken* CHttpsToken::NewL(CSenElement* aToken)
+    {
+    CHttpsToken* pSelf = CHttpsToken::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CHttpsToken* CHttpsToken::NewLC(CSenElement* aToken)
+    {
+    CHttpsToken* pSelf = new (ELeave) CHttpsToken();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf;  
+    }
+
+CHttpsToken::~CHttpsToken()
+    {
+    }
+
+CHttpsToken::CHttpsToken():
+iRequireClientCertificate(ETrue)
+{
+ 
+}
+
+void CHttpsToken::ConstructL(CSenElement* aToken)
+    {
+    const TDesC8* attr = aToken->AttrValue(KRequireClientCertificate); 
+    if(attr)
+        {
+        HBufC8* attrib = attr->AllocL();
+        TPtrC8 requireCertificateToken = attrib->Des();
+        if(requireCertificateToken.Compare(KTrue) == 0)
+            iRequireClientCertificate = ETrue;
+        else if(requireCertificateToken.Compare(KFalse) == 0)
+            iRequireClientCertificate = EFalse;
+        }
+    RPointerArray<CSenElement>& tokenChildren = aToken->ElementsL();
+    CSenElement* child = NULL;
+    for (TInt i = 0; i < tokenChildren.Count(); i++)
+        { 
+        //There should be only one element here the TokenType
+        child = tokenChildren[i];
+        TPtrC8 localName = child->LocalName();
+        if(localName.Compare(WSPolicy::KWsPolicy) == 0)
+            {
+            iPolicy = child;
+            }
+        }
+    }
+
+CSamlToken* CSamlToken::NewL(CSenElement* aToken)
+{
+    CSamlToken* pSelf = CSamlToken::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+  
+}
+CSamlToken* CSamlToken::NewLC(CSenElement* aToken)
+{
+    CSamlToken* pSelf = new (ELeave) CSamlToken();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf; 
+
+}
+CSamlToken::~CSamlToken()
+{
+    
+}
+CSamlToken::CSamlToken()
+{
+    
+}
+void CSamlToken::ConstructL(CSenElement* aToken)
+{
+    BaseConstructL(aToken);
+   
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aToken);
+
+    RPointerArray<CSenElement>& tokenChildren =   AND->ElementsL();
+
+    CSenElement* child;
+
+    for (TInt i = 0; i < tokenChildren.Count(); i++)
+    { //There should be only one element here the TokenType
+        child = tokenChildren[i];
+
+        TPtrC8 localName = child->LocalName();
+        
+        if(localName.Compare(KRequireKeyIdentifierReference) == 0)
+        {
+            iRequireKeyIdentifierReference = ETrue;
+        }
+        else if(localName.Compare(KWssSamlV10Token10) == 0)
+        {
+            iSamlTokenProfile.Set(KWssSamlV10Token10);
+        }
+        else if(localName.Compare(KWssSamlV11Token10) == 0)
+        {
+            iSamlTokenProfile.Set(KWssSamlV11Token10);
+        }
+        
+        else if(localName.Compare(KWssSamlV10Token11) == 0)
+        {
+            iSamlTokenProfile.Set(KWssSamlV10Token11);
+        }
+        else if(localName.Compare(KWssSamlV11Token11) == 0)
+        {
+            iSamlTokenProfile.Set(KWssSamlV11Token11);
+        }
+        else if(localName.Compare(KWssSamlV20Token11) == 0)
+        {
+            iSamlTokenProfile.Set(KWssSamlV20Token11);
+        }
+    }
+
+}
+
+CUsernameToken* CUsernameToken::NewL(CSenElement* aToken)
+{
+    CUsernameToken* pSelf = CUsernameToken::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CUsernameToken* CUsernameToken::NewLC(CSenElement* aToken)
+{
+    CUsernameToken* pSelf = new (ELeave) CUsernameToken();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf; 
+}
+CUsernameToken::~CUsernameToken()
+{
+
+}
+
+CUsernameToken::CUsernameToken()
+:iUsernameTokenProfile(KWssUsernameToken10)
+{
+
+}
+void CUsernameToken::ConstructL(CSenElement* aToken)
+{
+    BaseConstructL(aToken);
+ 
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aToken);
+     
+
+    RPointerArray<CSenElement>& tokenChildren =  AND->ElementsL();
+    
+    CSenElement* child;
+  
+    for (TInt i = 0; i < tokenChildren.Count(); i++)
+    { //There should be only one element here the TokenType
+        child = tokenChildren[i];
+
+        TPtrC8 localName = child->LocalName();
+        
+        if(localName.Compare(KWssUsernameToken10) == 0)
+        {
+            iUsernameTokenProfile.Set(KWssUsernameToken10);
+        }
+        else if(localName.Compare(KWssUsernameToken11) == 0)
+        {
+            iUsernameTokenProfile.Set(KWssUsernameToken11);
+        }
+    }
+
+}
+
+
+CRequestSecurityTokenTemplate* CRequestSecurityTokenTemplate::NewL(CSenElement* aToken)
+{
+    CRequestSecurityTokenTemplate* pSelf = CRequestSecurityTokenTemplate::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CRequestSecurityTokenTemplate* CRequestSecurityTokenTemplate::NewLC(CSenElement* aToken)
+{
+    CRequestSecurityTokenTemplate* pSelf = new (ELeave) CRequestSecurityTokenTemplate();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf; 
+   
+}
+CRequestSecurityTokenTemplate::~CRequestSecurityTokenTemplate()
+{
+  delete iToken;
+  delete iTrustVersion;  
+}
+CRequestSecurityTokenTemplate::CRequestSecurityTokenTemplate()
+:iToken(KNullDesC8().AllocL()),
+iTrustVersion(KNullDesC8().AllocL())
+{
+    
+}
+void CRequestSecurityTokenTemplate::ConstructL(CSenElement* aToken)
+{ //parse the token and then save it as HBufC8 
+
+    const TDesC8* attr = aToken->AttrValue(KTrustVersion);    
+    if(attr)
+    {
+        iTrustVersion = attr->AllocL();
+    }
+    
+    RPointerArray<CSenElement>& tokenChildren =   aToken->ElementsL();
+
+    CSenElement* child = NULL;
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    RBuf8 request;
+    CleanupClosePushL(request);
+
+    for (TInt i = 0; i < tokenChildren.Count(); i++)  
+    { 
+        child = tokenChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+//        child.OuterXmlL(buffer);
+        request.Append(buffer);
+    }
+
+    iToken = request.AllocL();
+    
+    CleanupStack::PopAndDestroy(&request);
+    CleanupStack::PopAndDestroy(&buffer);
+        
+}
+
+
+
+CIssuedToken* CIssuedToken::NewL(CSenElement* aToken)
+{
+     CIssuedToken* pSelf = CIssuedToken::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+   
+}
+CIssuedToken* CIssuedToken::NewLC(CSenElement* aToken)
+{
+      CIssuedToken* pSelf = new (ELeave) CIssuedToken();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf; 
+  
+}
+CIssuedToken::~CIssuedToken()
+{
+}
+
+CIssuedToken::CIssuedToken()
+:
+iIssuer(NULL),
+iRequireDerivedKeys(EFalse),
+iRequestSecurityTokenTemplate(NULL),
+iRequireExternalReference(EFalse),
+iRequireInternalReference(EFalse)
+{
+}
+void CIssuedToken::ConstructL(CSenElement* aToken)
+{ //can have multiple child elements including poliy and assertions
+   //loop for multiple children 
+   
+    BaseConstructL(aToken);
+
+    RPointerArray<CSenElement>& tokenChildren =   aToken->ElementsL();
+
+    CSenElement* child;
+    for (TInt i = 0; i < tokenChildren.Count(); i++)  
+    { 
+        child = tokenChildren[i];
+
+        TPtrC8 localName = child->LocalName();
+        
+        if(localName.Compare(KIssuer) == 0)
+        { //get the issuer element and save it, this is endpoint of STS
+            iIssuer = child; //request.AllocL();
+        }
+        else if(localName.Compare(KRequestSecurityTokenTemplate) == 0)
+        { 
+        //we are just using the origianl element o get all the 
+        //information from RequestSecurityTokenTemplate
+            iRequestSecurityTokenTemplate = child; 
+            // CRequestSecurityTokenTemplate::NewL(child);  
+        }
+        else if(localName.Compare(WSPolicy::KWsPolicy) == 0)
+        {
+             
+            CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aToken);
+             
+
+            RPointerArray<CSenElement>& children = AND->ElementsL();
+            
+            CSenElement* child2;
+            for (TInt j = 0; j < children.Count(); j++)  
+            { 
+                child2 = children[j];
+
+                TPtrC8 localName = child2->LocalName();
+                
+                if(localName.Compare(KRequireDerivedKeys) == 0)
+                { 
+                    iRequireDerivedKeys = ETrue;
+                }
+                if(localName.Compare(KRequireExternalReference) == 0)
+                { 
+                    iRequireExternalReference = ETrue;
+                }
+                else if(localName.Compare(KRequireInternalReference) == 0)
+                { 
+                    iRequireInternalReference = ETrue; 
+                }
+
+            }
+
+        }
+    
+    }
+
+}
+
+
+CSecureConversationToken* CSecureConversationToken::NewL(CSenElement* aToken)
+{
+    CSecureConversationToken* pSelf = CSecureConversationToken::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CSecureConversationToken* CSecureConversationToken::NewLC(CSenElement* aToken)
+{
+    CSecureConversationToken* pSelf = new (ELeave) CSecureConversationToken();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf; 
+  
+}
+CSecureConversationToken::~CSecureConversationToken()
+{
+ delete iIssuer;   
+}
+
+TPtrC8 CSecureConversationToken::Issuer()
+{
+  return iIssuer->Des();  
+}
+TBool CSecureConversationToken::RequireExternalUriReference()
+{
+    return iRequireExternalUriReference;
+}
+TBool CSecureConversationToken::SC10SecurityContextToken()
+{
+   return  iSC10SecurityContextToken;
+}
+TBool CSecureConversationToken::IsBootstrapPolicy()
+{
+    return iBootstrap;
+}
+CSenElement* CSecureConversationToken::BootstrapPolicy()
+{
+    return iBootstrapPolicy;
+}
+CSecureConversationToken::CSecureConversationToken()
+:
+    iIssuer(KNullDesC8().AllocL()),
+    iRequireExternalUriReference(EFalse),
+    iSC10SecurityContextToken(EFalse),
+    iRequireDerivedKeys(EFalse),
+    iBootstrap(EFalse)
+{
+    
+}
+void CSecureConversationToken::ConstructL(CSenElement* aToken)
+{
+   BaseConstructL(aToken);
+   
+   TPtrC8 localName = aToken->LocalName();
+   
+    RPointerArray<CSenElement>& tokenChildren = aToken->ElementsL();
+    CSenElement* child;
+
+    for (TInt j = 0; j < tokenChildren.Count(); j++)  
+    { 
+        child = tokenChildren[j];
+
+        TPtrC8 childName = child->LocalName();
+        
+        if(childName.Compare(KIssuer) == 0)
+        { //get the issuer element and save it, this is endpoint of STS
+            RBuf8 buffer;
+            CleanupClosePushL(buffer);
+//            child.OuterXmlL(buffer);
+            iIssuer = buffer.AllocL();
+            CleanupStack::PopAndDestroy(&buffer);
+        }
+        else if(childName.Compare(WSPolicy::KWsPolicy) == 0)
+        {
+             
+            CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aToken);
+             
+            
+            RPointerArray<CSenElement>& ANDChildren =  AND->ElementsL();
+            TPtrC8 policyChildName = child->LocalName();
+            
+            CSenElement* child2;
+
+            for (TInt i = 0; i < ANDChildren.Count(); i++)  
+            { 
+                child2 = ANDChildren[i];
+
+                TPtrC8 localName = child2->LocalName();
+  
+                if(localName.Compare(KRequireDerivedKeys) == 0)
+                { 
+                     iRequireDerivedKeys = ETrue;
+                }
+                else if(localName.Compare(KRequireExternalUriReference) == 0)
+                { 
+                    iRequireExternalUriReference = ETrue; 
+                }
+                else if(localName.Compare(KSC10SecurityContextToken) == 0)
+                { 
+                    iSC10SecurityContextToken = ETrue; 
+                }
+                else if(localName.Compare(KBootstrapPolicy) == 0)
+                { 
+                    iBootstrap = ETrue;
+                    iBootstrapPolicy = child2; 
+                }
+
+            }
+        }
+
+    }
+ }
+
+
+//TOKEN HOLDERS  
+  ////////////////////////////////////////////////////////
+
+CTokenHolder* CTokenHolder::NewL(CSenElement* aToken)
+{
+     CTokenHolder* pSelf = CTokenHolder::NewLC(aToken);
+    CleanupStack::Pop(pSelf);
+    return pSelf;   
+}
+CTokenHolder* CTokenHolder::NewLC(CSenElement* aToken)
+{
+           CTokenHolder* pSelf = new (ELeave) CTokenHolder();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aToken);
+    return pSelf; 
+}
+CTokenHolder::~CTokenHolder()
+{
+   if(iToken)
+        delete iToken;
+}
+
+//check here what kind of token the element have and then  
+//instantiate that TokenType
+CTokenHolder::CTokenHolder()
+:iToken(NULL)
+{
+    
+}
+void CTokenHolder::ConstructL(CSenElement* aToken)
+{
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aToken);
+     
+
+    RPointerArray<CSenElement>& tokenChildren = AND->ElementsL();
+
+    CSenElement* child;
+    for (TInt i = 0; i < tokenChildren.Count(); i++)  
+    { //There should be only one element here the TokenType
+        child = tokenChildren[i];
+
+        TPtrC8 localName = child->LocalName();
+        
+        if(localName.Compare(KUsernameToken) == 0)
+        {
+            iTokenType.Set(KUsernameToken);
+            iToken = CUsernameToken::NewL(child);
+        }
+        else if(localName.Compare(KIssuedToken) == 0)
+        {
+            iTokenType.Set(KIssuedToken);
+            iToken = CIssuedToken::NewL(child);
+        }
+        else if(localName.Compare(KSecureConversationToken) == 0)
+        {
+            iTokenType.Set(KSecureConversationToken);
+            iToken = CSecureConversationToken::NewL(child);
+        }
+        else if(localName.Compare(KSamlToken) == 0)
+        {
+            iTokenType.Set(KSamlToken);
+            iToken = CSamlToken::NewL(child);
+        }
+        else if(localName.Compare(KHttpsToken) == 0)
+        {
+            iTokenType.Set(KHttpsToken);
+            iToken = CHttpsToken::NewL(child);
+        }
+        else
+        {
+            //errror here
+        }
+
+    }
+}
+
+CWss10* CWss10::NewL(CSenElement* aAssertion)
+{
+    CWss10* pSelf = CWss10::NewLC(aAssertion);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+   
+}
+CWss10* CWss10::NewLC(CSenElement* aAssertion)
+{
+    CWss10* pSelf = new (ELeave) CWss10();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAssertion);
+    return pSelf;
+}
+CWss10::~CWss10()
+{
+    
+}
+void CWss10::ConstructL(CSenElement* aAssertion)
+{
+
+    BaseConstructL(aAssertion);
+}
+
+CWss10::CWss10()
+:iMustSupportRefKeyIdentifier(EFalse),
+iMustSupportRefIssuerSerial(EFalse),
+iMustSupportRefExternalURI(EFalse),
+iMustSupportRefEmbeddedToken(EFalse)
+{
+
+}
+
+TBool CWss10::IsEqualWss10Assertion(CWss10* aAssertion)
+{
+   if 
+    (
+    (MustSupportRefKeyIdentifier() == aAssertion->MustSupportRefKeyIdentifier()) &&
+    (MustSupportRefIssuerSerial() == aAssertion->MustSupportRefIssuerSerial()) &&
+    (MustSupportRefExternalURI() == aAssertion->MustSupportRefExternalURI()) &&
+    (MustSupportRefEmbeddedToken() == aAssertion->MustSupportRefEmbeddedToken())
+    )    
+        return ETrue;
+    else
+        return EFalse;
+  
+}
+
+TBool CWss10::MustSupportRefKeyIdentifier()
+{
+    return iMustSupportRefKeyIdentifier;    
+}
+TBool CWss10::MustSupportRefIssuerSerial()
+{
+    return iMustSupportRefIssuerSerial;
+}
+TBool CWss10::MustSupportRefExternalURI()
+{
+    return iMustSupportRefExternalURI;
+}
+TBool CWss10::MustSupportRefEmbeddedToken()
+{
+    return iMustSupportRefEmbeddedToken;
+}
+
+void CWss10::BaseConstructL(CSenElement* aAssertion)
+{
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aAssertion);
+     
+
+    RPointerArray<CSenElement>& wss10Children = AND->ElementsL();
+    CSenElement* child = NULL;
+
+    for (TInt i = 0; i<wss10Children.Count(); i++)
+    {
+        child = wss10Children[i];
+        
+        TPtrC8 localName = child->LocalName();
+
+       if(localName.Compare(KMustSupportRefKeyIdentifier) == 0)
+        {
+            iMustSupportRefKeyIdentifier = ETrue;
+        }
+        else if(localName.Compare(KMustSupportRefIssuerSerial) == 0)
+        {
+            iMustSupportRefIssuerSerial = ETrue;
+        }
+        else if(localName.Compare(KMustSupportRefExternalURI) == 0)
+        {
+            iMustSupportRefExternalURI = ETrue;
+        }
+        else if(localName.Compare(KMustSupportRefEmbeddedToken) == 0)
+        {
+            iMustSupportRefEmbeddedToken = ETrue;
+        }
+        else
+        {
+            //do something    
+        }
+    }
+}
+
+
+CWss11* CWss11::NewL(CSenElement* aAssertion)
+{
+    CWss11* pSelf = CWss11::NewLC(aAssertion);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CWss11* CWss11::NewLC(CSenElement* aAssertion)
+{
+    CWss11* pSelf = new (ELeave) CWss11();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAssertion);
+    return pSelf;
+   
+}
+CWss11::~CWss11()
+{
+    
+}
+
+TBool CWss11::IsEqualWss11Assertion(CWss11* aAssertion)
+{
+    if 
+    ((MustSupportRefThumbprint() == aAssertion->MustSupportRefThumbprint()) &&
+    (MustSupportRefEncryptedKey() == aAssertion->MustSupportRefEncryptedKey()) &&
+    (RequireSignatureConfirmation() == aAssertion->RequireSignatureConfirmation()) &&
+    (MustSupportRefKeyIdentifier() == aAssertion->MustSupportRefKeyIdentifier()) &&
+    (MustSupportRefIssuerSerial() == aAssertion->MustSupportRefIssuerSerial()) &&
+    (MustSupportRefExternalURI() == aAssertion->MustSupportRefExternalURI()) &&
+    (MustSupportRefEmbeddedToken() == aAssertion->MustSupportRefEmbeddedToken())
+    
+    )    
+        return ETrue;
+    else
+        return EFalse;
+    
+}
+
+TBool CWss11::MustSupportRefThumbprint()
+{
+    return  iMustSupportRefThumbprint;    
+}
+TBool CWss11::MustSupportRefEncryptedKey()
+{
+    return  iMustSupportRefEncryptedKey;
+}
+TBool CWss11::RequireSignatureConfirmation()
+{
+    return  iRequireSignatureConfirmation;
+}
+void CWss11::ConstructL(CSenElement* aAssertion)
+{   
+    BaseConstructL(aAssertion);
+    
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aAssertion);
+     
+
+    RPointerArray<CSenElement>& wss11Children = AND->ElementsL();
+    CSenElement* child;
+    TInt count = wss11Children.Count();
+
+    for (TInt i = 0; i<count; i++)
+    {
+        child = wss11Children[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+       if(localName.Compare(KMustSupportRefThumbprint) == 0)
+        {
+            iMustSupportRefThumbprint = ETrue;
+        }
+        else if(localName.Compare(KMustSupportRefEncryptedKey) == 0)
+        {
+            iMustSupportRefEncryptedKey = ETrue;
+        }
+        else if(localName.Compare(KRequireSignatureConfirmation) == 0)
+        {
+            iRequireSignatureConfirmation = ETrue;
+        }
+        else
+        {
+            //do something    
+        }
+    }
+}
+CWss11::CWss11()
+:iMustSupportRefThumbprint(EFalse),
+iMustSupportRefEncryptedKey(EFalse),
+iRequireSignatureConfirmation(EFalse)
+{
+    
+}
+
+
+
+CWsTrust10* CWsTrust10::NewL(CSenElement* aAssertion)
+{
+    CWsTrust10* pSelf = CWsTrust10::NewLC(aAssertion);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+   
+}
+CWsTrust10* CWsTrust10::NewLC(CSenElement* aAssertion)
+{
+    CWsTrust10* pSelf = new (ELeave) CWsTrust10();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAssertion);
+    return pSelf;
+}
+CWsTrust10::~CWsTrust10()
+{
+    
+}
+
+TBool CWsTrust10::IsEqualWsTrust10Assertion(CWsTrust10* aAssertion)
+{
+    if  (
+        (MustSupportClientChallenge() == aAssertion->MustSupportClientChallenge()) &&
+        (MustSupportServerChallenge() == aAssertion->MustSupportServerChallenge()) &&
+        (RequireClientEntropy() == aAssertion->RequireClientEntropy()) &&
+        (RequireServerEntropy() == aAssertion->RequireServerEntropy()) &&
+        (MustSupportIssuedTokens() == aAssertion->MustSupportIssuedTokens())
+        )
+        return ETrue;
+    else
+        return EFalse;
+}
+/*
+_LIT8(KTrust10, "Trust10");
+*/    
+TBool CWsTrust10::MustSupportClientChallenge()
+{
+    return   iMustSupportClientChallenge;  
+}
+TBool CWsTrust10::MustSupportServerChallenge()
+{
+    return iMustSupportServerChallenge;
+}
+TBool CWsTrust10::RequireClientEntropy()
+{
+    return iRequireClientEntropy;
+}
+TBool CWsTrust10::RequireServerEntropy()
+{
+    return iRequireServerEntropy;
+}
+TBool CWsTrust10::MustSupportIssuedTokens()
+{
+    return iMustSupportIssuedTokens;
+}
+
+
+
+void CWsTrust10::ConstructL(CSenElement* aAssertion)
+{
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aAssertion);
+     
+
+    RPointerArray<CSenElement>& wsTrustChildren = AND->ElementsL();
+    
+    CSenElement* child;
+    TInt count = wsTrustChildren.Count();
+
+    for (TInt i = 0; i<count; i++)
+    {
+        child = wsTrustChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+
+        if(localName.Compare(KMustSupportClientChallenge) == 0)
+        {
+            iMustSupportClientChallenge = ETrue;
+        }
+        else if(localName.Compare(KMustSupportServerChallenge) == 0)
+        {
+            iMustSupportServerChallenge = ETrue;
+        }
+        else if(localName.Compare(KRequireClientEntropy) == 0)
+        {
+            iRequireClientEntropy = ETrue;
+        }
+        else if(localName.Compare(KRequireServerEntropy) == 0)
+        {
+            iRequireServerEntropy = ETrue;
+        }
+        else if(localName.Compare(KMustSupportIssuedTokens) == 0)
+        {
+            iMustSupportIssuedTokens  = ETrue;  
+        }
+        else
+        {
+            //errror here
+        }
+    }
+}
+CWsTrust10::CWsTrust10()
+:iMustSupportClientChallenge(EFalse),
+iMustSupportServerChallenge(EFalse),
+iRequireClientEntropy(EFalse),
+iRequireServerEntropy(EFalse),
+iMustSupportIssuedTokens(EFalse)
+{
+    
+}
+
+
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+/*
+CXmlHelper::CXmlHelper()
+    {
+    }
+    
+CXmlHelper::~CXmlHelper()
+    {
+    }
+*/
+
+TPtrC8 CXmlHelper::AttributeValueL(CSenElement* aAssertion, const TDesC8& aAttribName)
+{
+    if(aAssertion == NULL) { User::Leave(KErrArgument); }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aAssertion->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(aAttribName) == 0)
+            {
+                 return bs->Value();
+            }
+         }
+
+            
+        }
+    return KNullDesC8();
+    
+}
+TBool CXmlHelper::HasAttributeL(CSenElement* aAssertion, const TDesC8& aAttribName)
+{
+    if(aAssertion == NULL) { User::Leave(KErrArgument); }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aAssertion->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(aAttribName) == 0)
+            {
+                 return ETrue;
+            }
+         }
+
+            
+        }
+    return EFalse;
+    
+}
+CSenElement* CXmlHelper::RipPolicyXORElementL(CSenElement* aElement)
+{
+
+    RPointerArray<CSenElement>& pPolicyList = aElement->ElementsL();
+
+    CSenElement* XOR = NULL;
+    CSenElement* AND = NULL;
+    if(pPolicyList.Count() > 0)
+    {
+        CSenElement* policy = pPolicyList[0];
+        TPtrC8 policyName = policy->LocalName();
+        
+        RPointerArray<CSenElement>& policyXORChild = policy->ElementsL(); //find the policy/XOR element
+        
+        if(policyXORChild.Count() > 0)
+        {
+            XOR = policyXORChild[0];
+            
+            TPtrC8 xorName = XOR->LocalName();
+
+            RPointerArray<CSenElement>& policyANDChild = XOR->ElementsL(); //find the policy/XOR/AND element
+            
+            if(policyANDChild.Count() > 0)
+            {
+                AND = policyANDChild[0];
+                TPtrC8 andName = AND->LocalName();
+                return AND;
+
+            }
+        }
+
+    }
+
+    return NULL;
+}
+
+
+///////////////////////////////////////////////////////////////////
+// CLayout
+///////////////////////////////////////////////////////////////////
+
+CLayout* CLayout::NewL(CSenElement* aLayout)
+{
+    CLayout* pSelf = CLayout::NewLC(aLayout);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CLayout* CLayout::NewLC(CSenElement* aLayout)
+{
+        CLayout* pSelf = new (ELeave) CLayout();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aLayout);
+    return pSelf;
+}
+CLayout::~CLayout()
+{
+
+}
+void CLayout::ConstructL(CSenElement* aLayout)
+{ 
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aLayout);
+     
+
+    RPointerArray<CSenElement>& layoutChildren = AND->ElementsL();
+    CleanupClosePushL(layoutChildren);
+    CSenElement* child;
+    TInt count = layoutChildren.Count();
+    for (TInt i = 0; i<count; i++)
+    {
+        child = layoutChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+
+        if(localName.Compare(KStrict) == 0)
+        {
+            iLayout.Set(KStrict);
+        }
+        else if(localName.Compare(KLax) == 0)
+        {
+            iLayout.Set(KLax);   
+        }
+        else if(localName.Compare(KLaxTsFirst) == 0)
+        {
+            iLayout.Set(KLaxTsFirst);
+        }
+        else if(localName.Compare(KLaxTsLast) == 0)
+        {
+            iLayout.Set(KLaxTsLast);
+        }
+        else
+        {
+            //errror here
+        }
+    }
+    CleanupStack::PopAndDestroy(&layoutChildren);
+}
+
+CLayout::CLayout()
+:iLayout(KLax)
+{
+
+}
+
+TBool CLayout::IsEqualLayout(CLayout* aLayout)
+{
+    if (iLayout.Compare(aLayout->Layout()) == 0)
+        return ETrue;
+    else
+        return EFalse;
+}
+///////////////////////////////////////////////////////////////////
+//BINDING, SYMASYMMBINDING, ASYMMETRICBINDING, SYMMETRICBINDING
+///////////////////////////////////////////////////////////////////
+
+CBinding* CBinding::NewL(CSenElement* aBinding)
+{
+    CBinding* pSelf = CBinding::NewLC(aBinding);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+}
+CBinding* CBinding::NewLC(CSenElement* aBinding)
+{
+    CBinding* pSelf = new (ELeave) CBinding();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aBinding);
+    return pSelf;
+}
+CBinding::~CBinding()
+{
+    delete iAlgorithmSuite;
+    delete iLayout; 
+}
+
+void CBinding::SetbaseElementL(CSenElement* aBinding)
+{
+    RPointerArray<CSenElement>& symmBindingChildren = aBinding->ElementsL();
+    TInt count = symmBindingChildren.Count();
+    CSenElement* child = NULL;
+    for (TInt i = 0; i<count; i++)
+    {
+        child = symmBindingChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+        if(localName.Compare(KAlgorithmSuite) == 0)
+        {
+            iAlgorithmSuite = CAlgorithmSuite::NewL(child);   
+        }
+        else if(localName.Compare(KLayout) == 0)
+        {
+            iLayout = CLayout::NewL(child);
+        }
+        else if(localName.Compare(KIncludeTimestamp) == 0)
+        {
+            iIncludeTimestamp = ETrue;
+        }
+        else
+        {
+            //do something    
+        }
+    }
+}
+
+CBinding::CBinding():
+iAlgorithmSuite(NULL),
+iLayout(NULL),
+iIncludeTimestamp(EFalse)
+{
+    
+}
+void CBinding::ConstructL(CSenElement* /*aBinding*/)
+{
+    
+}
+/////////////////////////////////////////////////////////////
+CSymmAsymmBinding* CSymmAsymmBinding::NewL(CSenElement* aBinding)
+{
+    CSymmAsymmBinding* pSelf = CSymmAsymmBinding::NewLC(aBinding);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+
+}
+CSymmAsymmBinding* CSymmAsymmBinding::NewLC(CSenElement* aBinding)
+{
+    CSymmAsymmBinding* pSelf = new (ELeave) CSymmAsymmBinding();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aBinding);
+    return pSelf;
+
+}
+
+CSymmAsymmBinding::~CSymmAsymmBinding()
+{
+
+}
+void CSymmAsymmBinding::BaseConstructL(CSenElement* aBinding)
+{
+
+    SetbaseElementL(aBinding);
+
+    RPointerArray<CSenElement>& symmBindingChildren = aBinding->ElementsL();
+
+    CSenElement* child = NULL;
+
+    for (TInt i = 0; i < symmBindingChildren.Count(); i++)
+    {
+        child = symmBindingChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+        if(localName.Compare(KEncryptBeforeSigning) == 0)
+        {
+            iProtectionOrder.Set(KEncryptBeforeSigning);
+        }
+        else if(localName.Compare(KSignBeforeEncrypting) == 0 )
+        {
+            iProtectionOrder.Set(KSignBeforeEncrypting);
+        }
+        else if(localName.Compare(KEncryptSignature) == 0)
+        {
+             iEncryptSignature = ETrue;
+        }
+        else if(localName.Compare(KProtectTokens) == 0)
+        {
+            iProtectTokens = ETrue;
+        }
+        else if (localName.Compare(KOnlySignEntireHeadersAndBody) == 0)
+        {
+            iOnlySignEntireHeadersAndBody = ETrue;
+        }
+        else
+        {
+            //do something    
+        }
+    }
+
+}
+
+CSymmAsymmBinding::CSymmAsymmBinding()
+:
+iProtectionOrder(KSignBeforeEncrypting),
+iEncryptSignature(EFalse),
+iProtectTokens(EFalse),
+iOnlySignEntireHeadersAndBody(EFalse)
+
+{
+
+}
+void CSymmAsymmBinding::ConstructL(CSenElement* /*aBinding*/)
+{
+    
+}
+///////////////////////////////////////////////////////////
+//CAsymmetricBinding
+///////////////////////////////////////////////////////////
+CAsymmetricBinding* CAsymmetricBinding::NewL(CSenElement* aAsymmBinding)
+{
+    CAsymmetricBinding* pSelf = CAsymmetricBinding::NewLC(aAsymmBinding);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+}
+CAsymmetricBinding* CAsymmetricBinding::NewLC(CSenElement* aAsymmBinding)
+{
+    CAsymmetricBinding* pSelf = new (ELeave) CAsymmetricBinding();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAsymmBinding);
+    return pSelf;
+}
+CAsymmetricBinding::~CAsymmetricBinding()
+{
+    delete iInitiatorToken;
+    delete iRecipientToken;
+}
+void CAsymmetricBinding::ConstructL(CSenElement* aAsymmBinding)
+{//parse AsymmBinding and get AlgoSuite Element
+
+    TPtrC8 localName = aAsymmBinding->LocalName();
+   
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aAsymmBinding);
+     
+
+    BaseConstructL(AND);        
+    RPointerArray<CSenElement>& symmBindingChildren =  AND->ElementsL();
+    
+    CSenElement* child = NULL;
+
+    for (TInt i = 0; i < symmBindingChildren.Count(); i++)
+    {
+        child = symmBindingChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+       if(localName.Compare(KInitiatorToken) == 0)
+        {
+         iInitiatorToken = CTokenHolder::NewL(child);
+
+        }
+        else if(localName.Compare(KRecipientToken) == 0)
+        {
+         iRecipientToken = CTokenHolder::NewL(child);
+        }
+        else
+        {
+            //do something    
+        }
+    }
+    CleanupStack::PopAndDestroy(&symmBindingChildren);
+
+}
+
+CAsymmetricBinding::CAsymmetricBinding()
+{
+/*
+<sp:InitiatorToken> </sp:InitiatorToken>
+<sp:RecipientToken> </sp:RecipientToken>
+<sp:AlgorithmSuite ... > ... </sp:AlgorithmSuite>
+<sp:Layout ... > ... </sp:Layout> ?
+<sp:IncludeTimestamp ... /> ?
+<sp:EncryptBeforeSigning ... /> ?
+<sp:EncryptSignature ... /> ?
+<sp:ProtectTokens ... /> ?
+<sp:OnlySignEntireHeadersAndBody ... /> ?
+*/
+}
+
+TBool CAsymmetricBinding::IsEqualAsymmtericAssertion(CAsymmetricBinding* aAsymmetricBinding)
+{
+
+   if(
+    (GetAlgoSuite()->IsEqualAlgoSuite(aAsymmetricBinding->GetAlgoSuite())) && 
+    (GetLayout()->IsEqualLayout(aAsymmetricBinding->GetLayout())) &&
+    (IncludetimeStamp() == aAsymmetricBinding->IncludetimeStamp()) &&
+    (EncryptSignature() == aAsymmetricBinding->EncryptSignature()) &&
+    (EncryptBeforeSigning().Compare(aAsymmetricBinding->EncryptBeforeSigning()) == 0) &&
+    (ProtectTokens() == aAsymmetricBinding->ProtectTokens()) &&
+    (OnlySignEntireHeadersAndBody() == aAsymmetricBinding->OnlySignEntireHeadersAndBody()))
+    {
+        return ETrue;    
+    }
+        
+    return EFalse;
+        
+}
+
+///////////////////////////////////////////////////////////
+//CSymmetricBinding
+///////////////////////////////////////////////////////////
+CSymmetricBinding* CSymmetricBinding::NewL(CSenElement* aSymmBinding)
+{
+    CSymmetricBinding* pSelf = CSymmetricBinding::NewLC(aSymmBinding);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+}
+CSymmetricBinding* CSymmetricBinding::NewLC(CSenElement* aSymmBinding)
+{
+    CSymmetricBinding* pSelf = new (ELeave) CSymmetricBinding();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aSymmBinding);
+    return pSelf;
+}
+CSymmetricBinding::~CSymmetricBinding()
+{
+
+   delete iEncriptionToken;
+   delete iSignatureToken;
+   delete iProtectionToken;
+   
+}
+void CSymmetricBinding::ConstructL(CSenElement* aAsymmBinding)
+{//parse AsymmBinding and get AlgoSuite Element
+
+    TPtrC8 localName = aAsymmBinding->LocalName();
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aAsymmBinding);
+    RPointerArray<CSenElement>& symmBindingChildren = AND->ElementsL();
+    BaseConstructL(AND);    
+    CSenElement* child = NULL;
+
+    for (TInt i = 0; i < symmBindingChildren.Count(); i++)
+    {
+        child = symmBindingChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+       if(localName.Compare(KEncryptionToken) == 0)
+        {
+         iEncriptionToken = CTokenHolder::NewL(child);
+        }
+        else if(localName.Compare(KSignatureToken) == 0)
+        {
+         iSignatureToken = CTokenHolder::NewL(child);
+        }
+        else if(localName.Compare(KProtectionToken) == 0)
+        {
+         iProtectionToken = CTokenHolder::NewL(child);
+        }
+        else
+        {
+            //do something    
+        }
+    }
+    
+
+}
+
+CSymmetricBinding::CSymmetricBinding()
+{
+/*
+<sp:EncryptionToken> </sp:EncryptionToken>
+<sp:SignatureToken> </sp:SignatureToken>
+or
+<sp:ProtectionToken> </sp:ProtectionToken>
+
+<sp:AlgorithmSuite ... > ... </sp:AlgorithmSuite>
+<sp:Layout ... > ... </sp:Layout> ?
+<sp:IncludeTimestamp ... /> ?
+<sp:EncryptBeforeSigning ... /> ?
+<sp:EncryptSignature ... /> ?
+<sp:ProtectTokens ... /> ?
+<sp:OnlySignEntireHeadersAndBody ... /> ?
+*/
+}
+
+TBool CSymmetricBinding::IsEqualSymmtericAssertion(CSymmetricBinding* aSymmetricBinding)
+{
+
+   if(
+    (GetAlgoSuite()->IsEqualAlgoSuite(aSymmetricBinding->GetAlgoSuite())) && 
+    (GetLayout()->IsEqualLayout(aSymmetricBinding->GetLayout())) &&
+    (IncludetimeStamp() == aSymmetricBinding->IncludetimeStamp()) &&
+    (EncryptSignature() == aSymmetricBinding->EncryptSignature()) &&
+    (EncryptBeforeSigning().Compare(aSymmetricBinding->EncryptBeforeSigning()) == 0) &&
+    (ProtectTokens() == aSymmetricBinding->ProtectTokens()) &&
+    (OnlySignEntireHeadersAndBody() == aSymmetricBinding->OnlySignEntireHeadersAndBody()))
+    {
+        return ETrue;    
+    }
+        
+    return EFalse;
+        
+}
+
+///////////////////////////////////////////////////////////
+//CTranportBinding
+///////////////////////////////////////////////////////////
+
+CTranportBinding* CTranportBinding::NewL(CSenElement* aTransportBinding)
+{
+    CTranportBinding* pSelf = CTranportBinding::NewLC(aTransportBinding);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+    
+}
+CTranportBinding* CTranportBinding::NewLC(CSenElement* aTransportBinding)
+{
+    CTranportBinding* pSelf = new (ELeave) CTranportBinding();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aTransportBinding);
+    return pSelf;
+    
+}
+CTranportBinding::~CTranportBinding()
+{
+  delete iTransportToken;  
+}
+  
+TBool CTranportBinding::IsEqualTransportBindingAssertion(CTranportBinding* aTransportBinding)
+{
+    if(
+    (GetAlgoSuite()->IsEqualAlgoSuite(aTransportBinding->GetAlgoSuite())) && 
+    (GetLayout()->IsEqualLayout(aTransportBinding->GetLayout())) &&
+    (IncludetimeStamp() == aTransportBinding->IncludetimeStamp()))
+    {
+        return ETrue;    
+    }
+        
+    return EFalse;
+  
+}
+void CTranportBinding::ConstructL(CSenElement* aTransportBinding)
+{
+    TPtrC8 localName = aTransportBinding->LocalName();
+   
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aTransportBinding);
+     
+    
+    SetbaseElementL(AND);    
+
+    RPointerArray<CSenElement>& bindingChildren = AND->ElementsL();
+    
+    CSenElement* child = NULL;
+
+    for (TInt i = 0; i < bindingChildren.Count(); i++)
+    {
+        child = bindingChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        
+       if(localName.Compare(KTransportToken) == 0)
+        {
+         iTransportToken = CTokenHolder::NewL(child);
+        }
+        else
+        {
+            //do something    
+        }
+    }
+
+}
+CTranportBinding::CTranportBinding()
+{
+    
+}
+
+//   CTokenHolder* iTransportToken;
+   
+
+///////////////////////////////////////////////////////////
+//CAlgorithmSuite
+///////////////////////////////////////////////////////////
+
+CAlgorithmSuite* CAlgorithmSuite::NewL(CSenElement* aAlgoSuite)
+{
+    CAlgorithmSuite* pSelf = CAlgorithmSuite::NewLC(aAlgoSuite);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+}  
+
+CAlgorithmSuite* CAlgorithmSuite::NewLC(CSenElement* aAlgoSuite)
+{
+    CAlgorithmSuite* pSelf = new (ELeave) CAlgorithmSuite();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAlgoSuite);
+    return pSelf;
+}
+
+CAlgorithmSuite::~CAlgorithmSuite()
+{
+    delete iAlgoSuite;
+    delete iSymmetricSignature;
+    delete iAsymmetricSignature;
+    delete iComputedKey;
+    delete iDigest;
+    delete iEncryption;
+    delete iSymmetricKeyWrap;
+    delete iAsymmetricKeyWrap;
+    delete iEncryptionKeyDerivation;
+    delete iSignatureKeyDerivation;
+    delete iC14n; 
+    delete iSoapNormalization;
+    delete iStrTransform;
+    delete iXPath;
+    delete iXPathFilter20;
+      
+}
+void CAlgorithmSuite::ConstructL(CSenElement* aAlgoSuite)
+{
+     
+    CSenElement* AND = CXmlHelper::RipPolicyXORElementL(aAlgoSuite);
+     
+
+    RPointerArray<CSenElement>& algoChildren = AND->ElementsL();; //find the policy element
+    CSenElement* child = NULL;
+    for (TInt i = 0; i < algoChildren.Count(); i++)
+    {   //should be only one element
+        child = algoChildren[i];
+        
+        TPtrC8 localName = child->LocalName();
+        iAlgoSuite = localName.AllocL();
+        SetAlgoSuiteL(localName);
+        
+    }
+  
+}
+CAlgorithmSuite::CAlgorithmSuite()
+:
+iAlgoSuite(KNullDesC8().AllocL()),
+iSymmetricSignature(KAlgoHMAC_SHA1().AllocL()),
+iAsymmetricSignature(KAlgoRSA_SHA1().AllocL()),
+iComputedKey(KAlgoP_SHA1().AllocL()),
+iMaximumSymmetricKeyLength(256),
+iMinimumAsymmetricKeyLength(1024),
+iMaximumAsymmetricKeyLength(4096),
+iDigest(KNullDesC8().AllocL()),
+iEncryption(KNullDesC8().AllocL()),
+iSymmetricKeyWrap(KNullDesC8().AllocL()),
+iAsymmetricKeyWrap(KNullDesC8().AllocL()),
+iEncryptionKeyDerivation(KNullDesC8().AllocL()),
+iSignatureKeyDerivation(KNullDesC8().AllocL()),
+iMinimumSymmetricKeyLength(0),
+iC14n(KAlgoEX_C14N().AllocL()),
+iSoapNormalization(KNullDesC8().AllocL()),
+iStrTransform(KNullDesC8().AllocL()),
+iXPath(KNullDesC8().AllocL()),
+iXPathFilter20(KNullDesC8().AllocL())
+
+{
+    
+}
+TBool CAlgorithmSuite::IsEqualAlgoSuite(CAlgorithmSuite* aAlgoSuite)
+    {
+    if (AlgoSuite().Compare(aAlgoSuite->AlgoSuite()) == 0)
+        return ETrue;
+    else
+        return EFalse;
+    }
+
+void CAlgorithmSuite::SetAlgoSuiteL(TDesC8& aSuiteName)
+    {
+    if(aSuiteName.Compare(KBasic256) == 0) 
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoAES256().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES256().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L256().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 256;
+        } 
+    else if (aSuiteName.Compare(KBasic192) == 0) 
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoAES192().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES192().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        }
+    else if (aSuiteName.Compare(KBasic128) == 0)
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoAES128().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES128().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iMinimumSymmetricKeyLength = 128;
+        } 
+    else if (aSuiteName.Compare(KTripleDes) == 0) 
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoTRIPLE_DES().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_TRIPLE_DES().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        } 
+    else if (aSuiteName.Compare(KBasic256Rsa15) == 0)
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoAES256().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES256().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L256().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 256;
+        } 
+    else if (aSuiteName.Compare(KBasic192Rsa15) == 0) 
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoAES192().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES192().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        } 
+    else if (aSuiteName.Compare(KBasic128Rsa15) == 0) 
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoAES128().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES128().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iMinimumSymmetricKeyLength = 128;
+        } 
+    else if (aSuiteName.Compare(KTripleDesRsa15) == 0)
+        {
+        iDigest = KAlgoSHA1().AllocL();
+        iEncryption = KAlgoTRIPLE_DES().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_TRIPLE_DES().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        }
+    else if(aSuiteName.Compare(KBasic256Sha256) == 0) 
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoAES256().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES256().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L256().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 256;
+        }
+    else if (aSuiteName.Compare(KBasic192Sha256) == 0)
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoAES192().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES192().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        } 
+    else if (aSuiteName.Compare(KBasic128Sha256) == 0)
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoAES128().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES128().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iMinimumSymmetricKeyLength = 128;
+        } 
+    else if(aSuiteName.Compare(KTripleDesSha256) == 0) 
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoTRIPLE_DES().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_TRIPLE_DES().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA_OAEP().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        }  
+    else if (aSuiteName.Compare(KBasic256Sha256Rsa15) == 0) 
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoAES256().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES256().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L256().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 256;
+        } 
+    else if (aSuiteName.Compare(KBasic192Sha256Rsa15) == 0) 
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoAES192().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES192().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        } 
+    else if (aSuiteName.Compare(KBasic128Sha256Rsa15) == 0) 
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoAES128().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_AES128().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L128().AllocL();
+        iMinimumSymmetricKeyLength = 128;
+        } 
+    else if (aSuiteName.Compare(KTripleDesSha256Rsa15) == 0) 
+        {
+        iDigest = KAlgoSHA256().AllocL();
+        iEncryption = KAlgoTRIPLE_DES().AllocL();
+        iSymmetricKeyWrap = KAlgoKW_TRIPLE_DES().AllocL();
+        iAsymmetricKeyWrap = KAlgoKW_RSA15().AllocL();
+        iEncryptionKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iSignatureKeyDerivation = KAlgoP_SHA1_L192().AllocL();
+        iMinimumSymmetricKeyLength = 192;
+        } 
+    //else {}
+    }
+
+TPtrC8 CAlgorithmSuite::AlgoSuite()
+    {
+    return iAlgoSuite->Des();    
+    }
+
+TPtrC8 CAlgorithmSuite::SymmetricSignature()
+    {
+    return iSymmetricSignature->Des();
+    }
+
+TPtrC8 CAlgorithmSuite::AsymmetricSignature()
+    {
+    return iAsymmetricSignature->Des();
+    }
+
+TPtrC8 CAlgorithmSuite::ComputedKey()
+    {
+    return iComputedKey->Des();
+    }
+
+TInt CAlgorithmSuite::MaximumSymmetricKeyLength()
+    {
+    return iMaximumSymmetricKeyLength;
+    }
+
+TInt CAlgorithmSuite::MinimumAsymmetricKeyLength()
+    {
+    return iMinimumAsymmetricKeyLength;
+    }
+
+TInt CAlgorithmSuite::MaximumAsymmetricKeyLength()
+    {
+    return iMaximumAsymmetricKeyLength;
+    }
+
+TPtrC8 CAlgorithmSuite::Digest()
+    {
+    return iDigest->Des();
+    }
+
+TPtrC8 CAlgorithmSuite::Encryption()
+    {
+    return iEncryption->Des();
+    }
+
+TPtrC8 CAlgorithmSuite::SymmetricKeyWrap()
+    {
+    return iSymmetricKeyWrap->Des();
+    }
+
+TPtrC8 CAlgorithmSuite::AsymmetricKeyWrap()
+    {
+    return iAsymmetricKeyWrap->Des();    
+    }
+
+TPtrC8 CAlgorithmSuite::EncryptionKeyDerivation()
+    {
+    return iEncryptionKeyDerivation->Des();
+    }
+
+TPtrC8 CAlgorithmSuite::SignatureKeyDerivation()
+    {
+    return iSignatureKeyDerivation->Des();
+    }
+    
+TInt CAlgorithmSuite::MinimumSymmetricKeyLength()
+    {
+    return iMinimumSymmetricKeyLength;
+    }
+
+TPtrC8 CAlgorithmSuite::C14n()
+    {
+    return iC14n->Des();
+    }
+TPtrC8 CAlgorithmSuite::SoapNormalization()
+{
+    return iSoapNormalization->Des();
+}
+TPtrC8 CAlgorithmSuite::StrTransform()
+    {
+    return iStrTransform->Des();
+    }
+    
+TPtrC8 CAlgorithmSuite::XPath()
+    {
+    return iXPath->Des();
+    }
+    
+TPtrC8 CAlgorithmSuite::XPathFilter20()
+    {
+    return iXPathFilter20->Des();
+    }
+
+void CAlgorithmSuite::SetC14nL(TDesC8& aValue)
+    {
+    if(iC14n)
+        {
+        delete iC14n;
+        iC14n = NULL;
+        }
+    iC14n = aValue.AllocL();
+    }
+
+void CAlgorithmSuite::SetSoapNormalizationL(TDesC8& aValue)
+    {
+    if(iSoapNormalization)
+        delete iSoapNormalization;
+    iSoapNormalization = NULL;
+    iSoapNormalization = aValue.AllocL();
+    }
+    
+void CAlgorithmSuite::SetStrTransformL(TDesC8& aValue)
+    {
+    if(iStrTransform)
+        delete iStrTransform;
+    iStrTransform = NULL;
+    iStrTransform = aValue.AllocL();
+    }
+    
+void CAlgorithmSuite::SetXPathL(TDesC8& aValue)
+    {
+    if(iXPath)
+        delete iXPath;
+    iXPath = NULL;
+    iXPath = aValue.AllocL();
+    }
+    
+void CAlgorithmSuite::SetXPathFilter20L(TDesC8& aValue)
+    {
+    if(iXPathFilter20)
+        delete iXPathFilter20;
+    iXPathFilter20 = NULL;
+    iXPathFilter20 = aValue.AllocL();
+    }
+
+///////////////////////////////////////////////////////////////////////
+//////    CEncryptedSignedParts                                              
+///////////////////////////////////////////////////////////////////////
+CEncryptedSignedParts* CEncryptedSignedParts::NewL(CSenElement* aAssertion)
+    {
+    CEncryptedSignedParts* pSelf = CEncryptedSignedParts::NewLC(aAssertion);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+    }
+
+CEncryptedSignedParts* CEncryptedSignedParts::NewLC(CSenElement* aAssertion)
+    {
+    CEncryptedSignedParts* pSelf = new (ELeave) CEncryptedSignedParts();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAssertion);
+    return pSelf;  
+    }
+    
+CEncryptedSignedParts::~CEncryptedSignedParts()
+    {
+    iHeaders.Close();
+    }
+
+TBool CEncryptedSignedParts::IsEqualEncryptedSignedParts(CEncryptedSignedParts* aAssertion)
+    {
+    
+    if(Body() == aAssertion->Body() && Header() == aAssertion->Header())
+        {
+        return ETrue;    
+        }
+    return EFalse;
+    }
+
+TBool CEncryptedSignedParts::Header()
+    {
+    return iHeader;    
+    }
+    
+TBool CEncryptedSignedParts::Body()
+    {
+    return iBody;
+    }
+    
+void CEncryptedSignedParts::ConstructL(CSenElement* aAssertion)
+    {
+    //No need to rip off caz there wont be any policy elements here
+    RPointerArray<CSenElement>& tokenChildren =   aAssertion->ElementsL();
+    if(tokenChildren.Count() < 0)
+        {
+        iHeader = ETrue;
+        iBody = ETrue;
+        return;
+        }
+    CSenElement* child;
+    for (TInt i = 0; i < tokenChildren.Count(); i++)
+        { 
+        child = tokenChildren[i];
+
+        TPtrC8 localName = child->LocalName();
+                
+        if(localName.Compare(KBody) == 0)
+            {
+           iBody = ETrue;
+            }
+        else if(localName.Compare(KHeader) == 0)
+            {
+            iHeader = ETrue;
+            //get header attributes
+            SoapHeader header;
+            if(CXmlHelper::HasAttributeL(aAssertion, KName()))
+                {
+                TPtrC8 headerName  = CXmlHelper::AttributeValueL(aAssertion, KName);
+                header.iName.Set(headerName);
+                }
+            if(CXmlHelper::HasAttributeL(aAssertion, KNamespace()))
+                {
+                TPtrC8 nsUri  = CXmlHelper::AttributeValueL(aAssertion, KNamespace());
+                header.iNsUri.Set(nsUri);
+                }           
+           iHeaders.Append(header);
+            }
+        } 
+    }
+    
+CEncryptedSignedParts::CEncryptedSignedParts()
+:   iHeader(EFalse),
+    iBody(EFalse)
+    {
+    }
+    
+void CEncryptedSignedParts::ElementsL( RPointerArray<HBufC8>& aElements )
+    {
+    if(iBody)
+        {
+        aElements.Append(KBody().AllocL());
+        aElements.Append(KNullDesC8().AllocL());
+        }
+        
+    if(iHeader && iHeaders.Count() == 0)
+        {
+        aElements.Append(KHeader().AllocL());
+        }
+    else if(iHeader && iHeaders.Count() > 0)
+        {
+        for(TInt i = 0; i< iHeaders.Count(); i++)
+            {
+            SoapHeader header(iHeaders[i]);
+            TPtrC8 name(header.iName);
+            if(name != KNullDesC8())
+                {
+                aElements.Append(name.AllocL());
+                aElements.Append(header.iNsUri.AllocL());
+                }
+            }
+        }
+    }
+    
+///////////////////////////////////////////////////////////////////////
+//////    CEncryptedSignedElements                                              
+///////////////////////////////////////////////////////////////////////
+CEncryptedSignedElements* CEncryptedSignedElements::NewL(CSenElement* aAssertion)
+    {
+    CEncryptedSignedElements* pSelf = CEncryptedSignedElements::NewLC(aAssertion);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+    } 
+
+CEncryptedSignedElements* CEncryptedSignedElements::NewLC(CSenElement* aAssertion)
+    {
+    CEncryptedSignedElements* pSelf = new (ELeave) CEncryptedSignedElements();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aAssertion);
+    return pSelf;  
+    }
+
+CEncryptedSignedElements::~CEncryptedSignedElements()
+    {
+    iXpaths.Close(); 
+    delete iXPathVersion; 
+    }
+
+TBool CEncryptedSignedElements::IsEqualEncryptedSignedElements(CEncryptedSignedElements* aAssertion)
+    {
+    
+    if( XPathVersion().Compare(aAssertion->XPathVersion()) == 0 )
+        {
+        return ETrue;         
+        }
+    return EFalse;        
+    }
+
+void CEncryptedSignedElements::ConstructL(CSenElement* aAssertion)
+    {
+    //No need to rip off caz there wont be any policy elements here
+    if(CXmlHelper::HasAttributeL(aAssertion, KXPathVersion()))
+        {
+        TPtrC8 xpathVersion  = CXmlHelper::AttributeValueL(aAssertion,KXPathVersion());
+        iXPathVersion = xpathVersion.AllocL();
+        }
+    RPointerArray<CSenElement> tokenChildren;
+    CleanupClosePushL(tokenChildren);
+    aAssertion->ElementsL(tokenChildren, KWsSecurityPolicyNsUri, KXPath);
+    CSenElement* child;
+    TInt count = tokenChildren.Count();
+    for (TInt i = 0; i < count; i++)
+        { 
+        child = tokenChildren[i];
+        TPtrC8 localName = child->LocalName();
+        if(child->HasContent())
+            {
+            TPtrC8 content = child->Content();
+            //check if xpath is ns qualified
+            TBool result = IfNsQualified(aAssertion, content);
+            
+            if(result)
+                {
+                iXpaths.Append(content);
+                }
+            }
+        } 
+    CleanupStack::PopAndDestroy(&tokenChildren);
+    }
+    
+CEncryptedSignedElements::CEncryptedSignedElements()
+:iXPathVersion(KNullDesC8().AllocL())
+    {
+    }
+    
+TInt CEncryptedSignedElements::GetXPaths(RArray<TPtrC8>& aXpaths)
+    {
+    RArray<TPtrC8> xpaths(iXpaths);
+    aXpaths =  xpaths;
+    return KErrNone;
+    }
+    
+TBool CEncryptedSignedElements::MergedElements(CEncryptedSignedElements* aAssertion, RArray<TPtrC8>& aResult)
+    {
+    if( XPathVersion().Compare(aAssertion->XPathVersion()) == 0 )
+        {
+        RArray<TPtrC8> xpath1;
+        GetXPaths(xpath1);
+        RArray<TPtrC8> xpath2;
+        aAssertion->GetXPaths(xpath2);
+        
+        TInt count = xpath1.Count(); 
+        TInt count2 = xpath2.Count(); 
+        
+        if(count == 0 || count2 == 0) //we have to sign/encrypt ALL Headers+Body
+            {
+            return ETrue;
+            }
+        
+        for (TInt i=0; i< count; i++)
+            {
+            aResult.Append(xpath1[i]);
+            }
+
+        for ( TInt j=0; j< count2; j++ )
+            {
+            if(aResult.Find(xpath2[j]) == KErrNotFound)
+                {
+                aResult.Append(xpath1[j]);  
+                }
+            } 
+       }
+    return EFalse;           
+    }
+
+TBool CEncryptedSignedElements::IfNsQualified(CSenElement* aAssertion, TDesC8& aXpath)
+    {
+    // the xpath is /pp:nimi/qq:foo/rr:bah/ 
+    //all the namespacce defined in Xpath should be in the Document namespaces
+    TPtrC8 xpath(aXpath);
+    while ( true )
+        {
+        TInt slash = xpath.Find(_L8("/"));
+        xpath.Set(xpath.Right(xpath.Length()-slash-1)); 
+        if( slash >= 0 )   
+            {
+            TInt position = xpath.Find(KColon);
+            if(position)
+                {
+                TPtrC8 nsString = xpath.Left(position);
+                const CSenNamespace* nameSpace = aAssertion->Namespace(nsString, ETrue);
+                if(nameSpace != NULL)
+                    {
+                    continue;
+                    }
+                else
+                    {
+                    return EFalse;
+                    }
+                }
+            else 
+                break;
+            }
+        else
+            {
+            break;
+            }
+        }
+    return ETrue;
+    }
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/WsdlPolicyAttachment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,910 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+
+#include "wsdlpolicyattachment.h"
+#include "wspolicyreader.h"
+#include "wspolicywriter.h"
+#include "policyassertion.h"
+#include "wspolicy.h"
+using namespace WsdlPolicyAttachment;
+
+EXPORT_C CWsdlPolicyAttachment* CWsdlPolicyAttachment::NewL(const TDesC8& aWsdlFileName)
+    {
+    CWsdlPolicyAttachment* pSelf = CWsdlPolicyAttachment::NewLC(aWsdlFileName);
+    CleanupStack::Pop(pSelf);
+    return pSelf;  
+    }
+    
+EXPORT_C CWsdlPolicyAttachment* CWsdlPolicyAttachment::NewLC(const TDesC8& aWsdlFileName)
+    {
+    CWsdlPolicyAttachment* pSelf = new (ELeave) CWsdlPolicyAttachment();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aWsdlFileName);
+    return pSelf;  
+    }
+
+CWsdlPolicyAttachment::~CWsdlPolicyAttachment()
+    {
+    iOriginalPolicies.Reset();
+    iNormalizedPolicies.Reset();
+    if( iRegistry )
+        {
+        iRegistry->ResetRegistry();
+        }
+    delete iRegistry;
+    }
+
+void CWsdlPolicyAttachment::ConstructL(const TDesC8& aWsdlFileName)
+    {
+    iRegistry = CPolicyRegistry::NewL();
+    CreateWsdlPolicyL( aWsdlFileName );
+    }
+
+CWsdlPolicyAttachment::CWsdlPolicyAttachment() :
+iOriginalPolicies(ETrue,ETrue),
+iNormalizedPolicies(ETrue, ETrue), 
+iParsed(EFalse)
+    {
+    }
+
+void CWsdlPolicyAttachment::CreateWsdlPolicyL( const TDesC8& aWsdlContent )
+    {
+    TInt size = aWsdlContent.Length();
+    if(size > 0)
+        {
+        iXmlReader = CSenXmlReader::NewL( KXmlParserMimeType ); // use libxml2 sax parser + CodeScannerWarnings     
+        TRAPD (err, ParseL( aWsdlContent )); 
+        delete iXmlReader;
+        iXmlReader = NULL;
+        
+        if(err == KErrNone)
+            {
+            iParsed = ETrue;
+            iPolicy = &AsElement(); 
+            iRegistry->PopulateRegistryL(iPolicy);   
+            }
+        }   
+}
+
+TPtrC8 CWsdlPolicyAttachment::GetAttributeValueL(const TDesC8& aAttribute, CSenElement* aElement)
+{
+    RPointerArray<CSenBaseAttribute>& attrs = aElement->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name().Compare(aAttribute) == 0)
+            {
+             return bs->Value();
+            }
+         }
+    return KNullDesC8();
+}
+
+EXPORT_C CSenElement* CWsdlPolicyAttachment::GetEffectiveServicePolicyL( const TDesC8& aService )
+    {
+    //wsdl:service
+    CSenElement* pServicePolicy = GetServicePolicyL( aService );
+    RPointerArray<CSenElement> array;
+    CleanupClosePushL( array );
+    if( pServicePolicy )
+        {
+        array.Append( pServicePolicy );
+        }
+    CWSPolicy* pol = GetEffectivePolicyL( array, iRegistry );
+    CleanupStack::PopAndDestroy( &array ); //array.Close();    
+    //CSenElement* policy = NULL;
+    //return policy;
+    return NULL;
+    }
+
+
+EXPORT_C CSenElement* CWsdlPolicyAttachment::GetEffectiveEndpointPolicyL( 
+    const TDesC8& aService, 
+    const TDesC8& aPort )
+{
+    //wsdl:port
+    //wsdl:portType
+    //wsdl:binding
+    CSenElement* portPolicy = GetPortPolicyL(aService, aPort);
+    RPointerArray<CSenElement> array;
+    CleanupClosePushL( array );
+    if( portPolicy )
+        {
+        array.Append(portPolicy);
+        }
+    CSenElement* portTypePolicy = GetPortTypePolicyL(aService, aPort);
+    if(portTypePolicy)
+        {
+        array.Append(portTypePolicy);    
+        }
+        
+    CSenElement* bindingPolicy = GetBindingPolicyL(aService, aPort);
+    if(bindingPolicy)
+        {
+        array.Append(bindingPolicy);
+        }
+
+    // (!) Merge these policies to get effective one:
+    CWSPolicy* pol = GetEffectivePolicyL(array, iRegistry); //merge these policies to get effective one
+    if( pol )
+        {
+        // Serialize into file: 
+        RFs fss;
+        User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+        
+        CSenElement* poli = pol->PolicyL();
+        _LIT( KFileNameOut, "c:\\logs\\WsSecurity10Sign.svc.xml");        
+        HBufC8* temp = poli->AsXmlL();
+        CleanupStack::PushL(temp);
+        TFileName iFileName12(KFileNameOut);
+        RFile  xmlFilew;
+        xmlFilew.Replace(fss , iFileName12, EFileWrite );
+        xmlFilew.Write(temp->Des());
+        xmlFilew.Close();
+        CleanupStack::PopAndDestroy(temp);    
+        CleanupStack::PopAndDestroy(&fss);
+        }    
+    CleanupStack::PopAndDestroy( &array ); // array.Close();
+    return NULL;    
+    }
+
+EXPORT_C CSenElement* CWsdlPolicyAttachment::GetEffectiveOperationPolicyL( const TDesC8& aService, 
+                                                                           const TDesC8& aPortName, 
+                                                                           const TDesC8& aOpName )
+    {
+    // wsdl:portType/wsdl:operation
+    // wsdl:binding/wsdl:operation
+    CSenElement* portTypePolicy = GetPortTypeOperationPolicyL(aService, aPortName, aOpName);
+    RPointerArray<CSenElement> array;
+    CleanupClosePushL( array );
+    if(portTypePolicy)
+        {
+        array.Append(portTypePolicy);    
+        }
+    CSenElement* bindingPolicy = GetBindingOperationPolicyL(aService, aPortName, aOpName);
+    if(bindingPolicy)
+        {
+        array.Append(bindingPolicy);    
+        }
+    // (!) Merge these policies to get effective one:
+    GetEffectivePolicyL(array, iRegistry);
+    CleanupStack::PopAndDestroy( &array ); // array.Close();
+    // CSenElement* policy = NULL;
+    // return policy;  
+    return NULL;
+    }
+
+EXPORT_C CSenElement* CWsdlPolicyAttachment::GetEffectiveInputPolicyL(const TDesC8& aService, const TDesC8& aPortName, const TDesC8& aOpName)
+    {
+    // wsdl:message
+    // wsdl:portType/wsdl:operation/wsdl:input
+    // wsdl:binding/wsdl:operation/wsdl:input
+    CSenElement* messagePolicy = GetMessagePolicyL(aService, aPortName, aOpName, ETrue);
+    RPointerArray<CSenElement> array;
+    CleanupClosePushL( array );
+    if( messagePolicy )
+        {
+        array.Append(messagePolicy);
+        }
+    CSenElement* portTypePolicy = GetPortTypeOperationInputOutputPolicyL(aService, aPortName, aOpName, ETrue);
+    if( portTypePolicy )
+        {
+        array.Append(portTypePolicy);        
+        }
+    CSenElement* bindingPolicy = GetBindingOperationInputOutputPolicyL(aService, aPortName, aOpName, ETrue);
+    if( bindingPolicy )
+        {
+        array.Append(bindingPolicy);    
+        }
+    // (!) Merge these policies to get effective one:
+    GetEffectivePolicyL(array, iRegistry); 
+    CleanupStack::PopAndDestroy( &array ); // array.Close();
+    //CSenElement* policy = NULL;
+    //return policy;  
+    return NULL;
+    }
+
+EXPORT_C CSenElement* CWsdlPolicyAttachment::GetEffectiveOutputPolicyL(const TDesC8& aService, const TDesC8& aPortName, const TDesC8& aOpName)
+    {
+    // wsdl:message
+    // wsdl:portType/wsdl:operation/wsdl:output
+    // wsdl:binding/wsdl:operation/wsdl:output
+    CSenElement* messagePolicy = GetMessagePolicyL(aService, aPortName, aOpName, EFalse);
+    RPointerArray<CSenElement> array;
+    if( messagePolicy )
+        {
+        array.Append(messagePolicy);        
+        }
+    CSenElement* portTypePolicy = GetPortTypeOperationInputOutputPolicyL(aService, aPortName, aOpName, EFalse);
+    if( portTypePolicy )
+        {
+        array.Append(portTypePolicy);    
+        }
+    CSenElement* bindingPolicy = GetBindingOperationInputOutputPolicyL(aService, aPortName, aOpName, EFalse);
+    if( bindingPolicy )
+        {
+        array.Append(bindingPolicy);    
+        }
+    // (!) Merge these policies to get effective one:
+    GetEffectivePolicyL( array, iRegistry );
+    CleanupStack::PopAndDestroy( &array ); // array.Close();
+    // CSenElement* policy = NULL;
+    // return policy;  
+    return NULL;
+}
+
+EXPORT_C CSenElement* CWsdlPolicyAttachment::GetEffectiveFaultPolicyL( /*QName aService, */
+                                                                        const TDesC8& /*aPortName*/, 
+                                                                        const TDesC8& /*aOpName*/ )
+    { 
+        
+    // wsdl:message
+    // wsdl:portType/wsdl:operation/wsdl:fault
+    // wsdl:binding/wsdl:operation/wsdl:fault
+      return NULL;
+    }
+    
+////////////////////////////////////////////////////////////////////////
+//PRIVATE FUNCTIONS
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+CSenElement* CWsdlPolicyAttachment::GetServicePolicyL( const TDesC8& aServiceName )
+    {
+    //    RPointerArray<CSenElement>& list = iPolicy->ElementsL(); //get the definitions elements
+    //    TInt count = list.Count();
+    //    for(TInt i = 0; i< count; i++)
+    //    {
+    //        CSenElement* definitions = list[i];
+    //        TPtrC8 localName = definitions->LocalName();
+                
+    RPointerArray<CSenElement> serviceList;     // get the wsdl:service
+    iPolicy->ElementsL(serviceList, KService); //KWsdlNsUri, KService);
+    CleanupClosePushL( serviceList );
+    TInt count2 = serviceList.Count();
+    for( TInt j = 0; j< count2; j++ )
+        {
+        CSenElement* service = serviceList[j];
+        
+        TPtrC8 localServiceName = service->LocalName();
+
+        TPtrC8 serviceName  = GetAttributeValueL(KName, service);
+        if(serviceName != KNullDesC8())
+            {
+            if (serviceName.Compare(aServiceName) == 0)
+                { //we have right service tag, search its children for PolicyReference
+                    serviceList.Close();
+                    return GetPolicyReferenceL(service);
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy( &serviceList ); // serviceList.Close();
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPortPolicyL(const TDesC8& aServiceName, const TDesC8& aPort)
+    {
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if (result)
+        {
+        result = GetPortElementL(aPort, result);
+        if (result)
+            {
+            return GetPolicyReferenceL(result);
+            }
+        
+        }
+    return NULL;  
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPortTypePolicyL( const TDesC8& aServiceName, 
+                                                        const TDesC8& aPort )
+    {
+    //from service get port
+    //from port get binding
+    //from binding get porttype
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if (result)
+        {
+        result = GetPortElementL(aPort, result);
+        if (result)
+            {   
+            // get binding from port 
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+
+            result = GetBindingElementL(bindingName);
+            if(result)    
+                {
+                //we got the right binding, now get the portType
+                TPtrC8 portTypeQName = GetAttributeValueL(KType, result); 
+                //actually this is buinding type
+                TPtrC8 portTypePrefix = portTypeQName.Left(portTypeQName.Find(KColon));
+                TPtrC8 portTypeName = portTypeQName.Right(portTypeQName.Length() - portTypePrefix.Length()-1);
+                //here we have port Name
+                //now look for this port type in wsdl
+                result = GetPortTypeElementL(portTypeName);
+                if(result)
+                    {
+                    return GetPolicyReferenceL(result);
+                    }
+                else
+                    {
+                    return NULL;
+                    }
+                }
+            }
+        }
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetBindingPolicyL( const TDesC8& aServiceName, 
+                                                       const TDesC8& aPort )
+    {
+    //the aBindingName is obtained from the port operation. 
+    //so Use that Name and then jsut search for that particualr binding
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if (result)
+        {
+        result = GetPortElementL(aPort, result);
+        if (result)
+            {   
+            // get binding from port and
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+            result = GetBindingElementL(bindingName);
+            if( result )    
+                {
+                //we got the right binding, now get the policy
+                result = GetPolicyReferenceL( result );
+                //if ( result ) 
+                //    //we got a policy TAG for the binding
+                // { 
+                return result; 
+                }
+            }
+        }
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPortTypeOperationPolicyL( const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName )
+    {
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if ( result )
+        {
+        result = GetPortElementL(aPort, result);
+        if ( result )
+            {
+            // get binding from port and
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+            result = GetBindingElementL(bindingName);
+            if( result )
+                {
+                // we got the right binding, now get the portType
+                TPtrC8 portTypeQName = GetAttributeValueL(KType, result); 
+                //actually this is buinding type
+                TPtrC8 portTypePrefix = portTypeQName.Left(portTypeQName.Find(KColon));
+                TPtrC8 portTypeName = portTypeQName.Right(portTypeQName.Length() - portTypePrefix.Length()-1);
+                // here we have port Name
+                // now look for this port type in wsdl
+                result = GetPortTypeElementL( portTypeName );
+                if( result ) //we got the portType
+                    {
+                    // now get the operation in this element
+                    result = GetOperationPolicyL( aOpName, result );
+                    return result;
+                    }
+                }
+            }
+        }
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetBindingOperationPolicyL( const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName )
+    {
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if ( result )
+        {
+        result = GetPortElementL(aPort, result);
+        if ( result )
+            {   
+            //get binding from port and
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+            result = GetBindingElementL(bindingName);
+            if(result)    //we got the right binding, 
+                // now get the OperationPolicy from this binding
+                {
+                result = GetOperationPolicyL(aOpName, result);   
+                return result;
+                }
+            }
+        }
+    return NULL;
+    }
+    
+CSenElement* CWsdlPolicyAttachment::GetOperationPolicyL( const TDesC8& aOpName, 
+                                                         CSenElement* aElement )
+    {
+    RPointerArray<CSenElement> operationList;        
+    aElement->ElementsL(operationList, KWsdlNsUri, KOperation);
+    CleanupClosePushL( operationList );
+    TInt count = operationList.Count();
+    CSenElement* result = NULL;
+    for(TInt i = 0; i< count; i++)
+        {
+        CSenElement* operation = operationList[i];
+        TPtrC8 operationName = GetAttributeValueL(KName, operation);
+        if(operationName.Compare(aOpName) == 0)
+            {
+            //we got the rigth operation element
+            //now retrieve policy from this element
+            result = GetPolicyReferenceL(operation);
+            //if( result ) 
+            //    {
+            //    //we got a policy TAG for the binding
+            //    
+            //    }
+            }
+        }
+    CleanupStack::PopAndDestroy( &operationList ); // operationList.Close();
+    return result;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetMessagePolicyL( const TDesC8& aServiceName, 
+                                                       const TDesC8& aPort, 
+                                                       const TDesC8& aOpName, TBool aInput )
+    {
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if ( result )
+        {
+        result = GetPortElementL(aPort, result);
+        if ( result )
+            {   
+            //get binding from port and
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+            result = GetBindingElementL(bindingName);
+            if( result )    
+                {
+                // we got the right binding, now get the Operation from this binding                     
+                // if aInput == ETrue then its Input policy else its output policy
+                // we get binding now find the input/output for that aOpName
+                RPointerArray<CSenElement> operationList;
+                result->ElementsL(operationList, KWsdlNsUri, KOperation);
+                CleanupClosePushL(operationList);
+                TInt count = operationList.Count();
+                for(TInt i = 0; i< count; i++)
+                    {
+                    CSenElement* operation = operationList[i];
+                    TPtrC8 operationName = GetAttributeValueL(KName, operation);
+                    if(operationName.Compare(aOpName) == 0)
+                        {
+                        //we got the rigth operation element
+                        //now retrieve input/output element
+                        RPointerArray<CSenElement> operationInOutList;
+                        CleanupClosePushL(operationInOutList);
+                        if(aInput)
+                            {
+                            operation->ElementsL(operationInOutList, KWsdlNsUri, KInput);
+                            }
+                        else
+                            {
+                            operation->ElementsL(operationInOutList, KWsdlNsUri, KOutput);
+                            }
+                        TInt operationListCount = operationInOutList.Count();
+                        for( TInt j = 0; j< operationListCount; j++ )
+                            {
+                            //should be only one, no more then one input. 
+                            //if there are more, then weired but the fucntion 
+                            //will return on first instance of input/output
+                            
+                            CSenElement* inputoutput = operationInOutList[j];
+                            //get the message attribute of this input/output operation
+                            if(inputoutput)
+                                {
+                                TPtrC8 messageName = GetAttributeValueL(KMessage, inputoutput);
+                                if(messageName != KNullDesC8())
+                                    { 
+                                    
+                                    // if Qname then retrieve the name from Qname
+                                
+                                    CSenElement* result = GetMessageElementL(messageName);
+                                    if( result )
+                                        {
+                                        result = GetPolicyReferenceL(result);
+                                        CleanupStack::PopAndDestroy(&operationInOutList);
+                                        CleanupStack::PopAndDestroy(&operationList);                    
+                                        return result;
+                                        }
+                                    else
+                                        {
+                                        CleanupStack::PopAndDestroy(&operationInOutList);
+                                        CleanupStack::PopAndDestroy(&operationList);                    
+                                        return NULL;
+                                        }
+                                    }
+                                }
+                            }
+                        CleanupStack::PopAndDestroy(&operationInOutList);
+                        }
+                    }
+                CleanupStack::PopAndDestroy(&operationList);                    
+                }
+            }
+        }
+    return NULL;
+    }
+
+
+CSenElement* CWsdlPolicyAttachment::GetPortTypeOperationInputOutputPolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName, TBool aInput)
+    {
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if (result)
+        {
+        result = GetPortElementL(aPort, result);
+        if (result)
+            {
+            // get binding from port and
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+            result = GetBindingElementL( bindingName );
+            if( result )
+                {
+                // we got the right binding, now get the portType
+                TPtrC8 portTypeQName = GetAttributeValueL(KType, result); 
+                // actually this is buinding type
+                TPtrC8 portTypePrefix = portTypeQName.Left(portTypeQName.Find(KColon));
+                TPtrC8 portTypeName = portTypeQName.Right(portTypeQName.Length() - portTypePrefix.Length()-1);
+                //here we have port Name
+                //now look for this port type in wsdl
+                result = GetPortTypeElementL(portTypeName);
+                if( result ) //we got the portType
+                    {
+                    // now get the operation input output policy from this element                        
+                    return GetOperationInputOutputPolicyL(aOpName, result, aInput);
+                    }
+                else
+                    {
+                    return NULL;
+                    }
+                }
+            }
+        }
+    return NULL;
+    }
+    
+CSenElement* CWsdlPolicyAttachment::GetBindingOperationInputOutputPolicyL(const TDesC8& aServiceName, const TDesC8& aPort, const TDesC8& aOpName, TBool aInput)
+    {
+    CSenElement* result = GetServiceElementL(aServiceName);
+    if (result)
+        {
+        result = GetPortElementL(aPort, result);
+        if (result)
+            {   
+            // get binding from port and
+            TPtrC8 bindingQName = GetAttributeValueL(KBinding, result);
+            
+            TPtrC8 bindingPrefix = bindingQName.Left(bindingQName.Find(KColon));
+            TPtrC8 bindingName = bindingQName.Right(bindingQName.Length() - bindingPrefix.Length()-1);
+
+            result = GetBindingElementL(bindingName);
+            if(result)    //we got the right binding, 
+            
+                {
+                // now get the Operation from this binding                 
+                // if aInput == ETrue then its Input policy else its output policy
+            
+                result = GetOperationInputOutputPolicyL(aOpName, result, aInput);
+                if(result)
+                    {
+                    return result;
+                    }
+                else
+                    {
+                    return NULL;
+                    }
+                }
+            }
+        }
+    return NULL;  
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetOperationInputOutputPolicyL(const TDesC8& aOpName, CSenElement* aElement, TBool aInput)
+{
+    RPointerArray<CSenElement> operationList;
+    aElement->ElementsL( operationList, KWsdlNsUri, KOperation );
+    CleanupClosePushL( operationList );
+    TInt count = operationList.Count();
+    for( TInt i = 0; i< count; i++ )
+        {
+        CSenElement* operation = operationList[i];
+        TPtrC8 operationName = GetAttributeValueL(KName, operation);
+        if(operationName.Compare(aOpName) == 0)
+            {
+            // we got the rigth operation element
+            // now retrieve input/output element
+            RPointerArray<CSenElement> operationInOutList;
+            if(aInput)
+                operation->ElementsL(operationInOutList, KWsdlNsUri, KInput);
+            else
+                operation->ElementsL(operationInOutList, KWsdlNsUri, KOutput);
+            
+            CleanupClosePushL(operationInOutList);
+            TInt operationInOutListCount = operationInOutList.Count();
+            for(TInt j = 0; j< operationInOutListCount; j++)
+                { 
+                //should be only one, no more then one input. 
+                //if there are then weired but the fucntion will return on first instance of input/output
+                CSenElement* inputoutput = operationInOutList[j];
+                if(inputoutput)
+                    {
+                    CleanupStack::PopAndDestroy(&operationInOutList);
+                    CleanupStack::PopAndDestroy(&operationList);
+                    return GetPolicyReferenceL(inputoutput);
+                    }
+                else
+                    {
+                    CleanupStack::PopAndDestroy(&operationInOutList);
+                    CleanupStack::PopAndDestroy(&operationList);
+                    return NULL;
+                    }
+                }
+            CleanupStack::PopAndDestroy(&operationInOutList);            
+            }
+        }
+    CleanupStack::PopAndDestroy(&operationList);
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPolicyReferenceL(CSenElement* aElement)
+    {
+    RPointerArray<CSenElement> policyRef; //find the policyReference from input child aElement
+    aElement->ElementsL(policyRef, KWspNsUri, KWspPolicyReference);
+    //now we have PolicyReference tag in our PolicyRef List
+    //get its URI and get teh hell out of here
+    CleanupClosePushL(policyRef);
+    //there shud be only ONE count here otherwise seems to me a problem
+    TInt count = policyRef.Count();
+    for(TInt i = 0; i< count; i++)
+        {
+        CSenElement* policyReference = policyRef[i];
+        TPtrC8 policyUri  = GetAttributeValueL(KUri, policyReference);
+        //may be only uri is enough at the moment.
+        CSenElement* resultPolicy = GetPolicyL(policyUri);
+        if(resultPolicy) //it should exist
+            {
+            CleanupStack::PopAndDestroy(&policyRef);
+            return resultPolicy;
+            }
+        }
+    CleanupStack::PopAndDestroy(&policyRef);    
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPolicyL(const TDesC8& aUri)
+    {
+    //only take an input URI and return corresponding policy Element from wsdl file
+    if(aUri.Length() < 1)
+        return NULL;
+   
+    TPtrC8 reqPolicy = aUri.Right(aUri.Length()-1);
+            
+    RPointerArray<CSenElement> policyList; //get the wsp:policy elements
+    iPolicy->ElementsL(policyList, KWspNsUri, KPolicy);
+    CleanupClosePushL(policyList);
+    TInt policyListcount = policyList.Count();
+    
+    CSenElement* requiredPolicy;
+    for (TInt j = 0; j< policyListcount; j++)
+        {
+        requiredPolicy = policyList[j];
+        if(requiredPolicy)
+            {
+            TPtrC8 policyId  = GetAttributeValueL(KWsuId, requiredPolicy);
+            if(policyId.Compare(reqPolicy) == 0)
+                {
+                CleanupStack::PopAndDestroy(&policyList);                
+                return requiredPolicy;
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy(&policyList);        
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetServiceElementL(const TDesC8& aServiceName)
+    {
+    return GetElementL(aServiceName, KService);
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPortElementL(const TDesC8& aPortName, CSenElement* aElement)
+    {
+    return GetElementL(aPortName, KPort, aElement);
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetPortTypeElementL(const TDesC8& aPortTypeName)
+    {
+    return GetElementL(aPortTypeName, KPortType);
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetBindingElementL(const TDesC8& aBindingName)
+    {
+    return GetElementL(aBindingName, KBinding); 
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetMessageElementL(const TDesC8& aMessageName)
+    {
+    return GetElementL(aMessageName, KMessage); 
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetElementL(const TDesC8& aName, const TDesC8& aType)
+    {
+    RPointerArray<CSenElement> list; 
+    //get the wsdl:definitions child elements with aType name
+    iPolicy->ElementsL(list, KWsdlNsUri, aType);
+    CleanupClosePushL(list);
+    TInt count = list.Count();
+    CSenElement* ele = NULL;
+    for (TInt j = 0; j< count; j++)
+        {
+        ele = list[j];
+        TPtrC8 localName = ele->LocalName();
+        TPtrC8 name  = GetAttributeValueL(KName, ele);
+        if(name.Compare(aName) == 0) //We got the right name 
+            {
+            CleanupStack::PopAndDestroy(&list);
+            return ele;
+            }
+        ele = NULL;            
+        }
+    CleanupStack::PopAndDestroy(&list);        
+    return NULL;
+    }
+
+CSenElement* CWsdlPolicyAttachment::GetElementL(const TDesC8& aName, const TDesC8& aType, CSenElement* aElement)
+    {
+    RPointerArray<CSenElement> list; //get the wsdl:definitions child elements with aType name
+    aElement->ElementsL(list, KWsdlNsUri, aType);
+    CleanupClosePushL(list);
+    
+    TInt count = list.Count();
+    CSenElement* ele = NULL;
+    for (TInt j = 0; j< count; j++)
+        {
+        ele = list[j];
+        TPtrC8 localName = ele->LocalName();
+        
+        TPtrC8 name  = GetAttributeValueL(KName, ele);
+        if(name.Compare(aName) == 0) //We got the right name 
+            {
+            CleanupStack::PopAndDestroy(&list);
+            return ele;
+            }
+        ele = NULL;            
+        }
+    CleanupStack::PopAndDestroy(&list);        
+    return NULL;
+    }
+
+CWSPolicy* CWsdlPolicyAttachment::GetPolicyToSenL(CPolicyAssertion* aPolicy)
+    {
+    _LIT8(KN, "name");
+    TPtrC8 nimi(KN);
+    CWSPolicyWriter* iWriter = CWSPolicyWriter::NewLC();
+    CWSPolicy* policy = NULL;
+    if(aPolicy)
+        {
+        CBufFlat *pBuf = CBufFlat::NewL(128);
+        CleanupStack::PushL(pBuf);
+        TPtrC8 p = iWriter->WriteToBufL(*pBuf, aPolicy);
+        policy = CWSPolicy::NewL(nimi, p);                        
+        if(policy)
+            policy->NormalizePolicyL(NULL);
+        
+        CleanupStack::PopAndDestroy(pBuf);
+        }
+    CleanupStack::PopAndDestroy(iWriter);	
+    return policy;
+    }
+
+CPolicyAssertion* CWsdlPolicyAttachment::GetSenToPolicyL(CSenElement* aPolicy, CPolicyRegistry* aReg)
+    {
+    CWSPolicyReader* iReader = CWSPolicyReader::NewLC();    
+    CPolicyAssertion* policyTerm = iReader->GetPolicyL(aPolicy);
+    CPolicyAssertion* policy = NULL;
+    if(policyTerm)
+        {
+        CleanupStack::PushL(policyTerm);
+        policy = (CPolicyAssertion*)policyTerm->NormalizeL(aReg);
+        CleanupStack::PopAndDestroy(policyTerm);    
+        }    
+    CleanupStack::PopAndDestroy(iReader);  
+    return policy;
+    }
+
+CWSPolicy* CWsdlPolicyAttachment::GetEffectivePolicyL(RPointerArray<CSenElement>& aPolicyArray, CPolicyRegistry* aReg)
+    {
+    TInt count = aPolicyArray.Count(); 
+    
+
+	CPolicyAssertion* policyTerm = NULL;
+	CPolicyAssertion* policyTerm2 = NULL;
+    CSenElement* policy = NULL;
+    
+    for(TInt i = 0; i< count; i++)
+        {
+        policy = aPolicyArray[i];
+        if(policy && policy->LocalName().Compare(WSPolicy::KWsPolicy) == 0)
+            {
+            policyTerm2 = GetSenToPolicyL(policy, aReg);
+            
+			if(policyTerm == NULL)
+			    {
+			    policyTerm = policyTerm2; 
+			    }
+			else
+			    {
+			    CleanupStack::PushL(policyTerm);
+			    CleanupStack::PushL(policyTerm2);
+			    CPolicyAssertion* temp = (CPolicyAssertion*)policyTerm->MergeL(policyTerm2, NULL);
+			    CleanupStack::PopAndDestroy(policyTerm2);
+			    CleanupStack::PopAndDestroy(policyTerm);
+			    policyTerm = temp;
+			    }
+            }
+        }
+
+	if (policyTerm && !policyTerm->IsNormalized()) 
+    	{
+	    CleanupStack::PushL(policyTerm);
+	    CPolicyAssertion* temp = (CPolicyAssertion*) policyTerm->NormalizeL();
+	    CleanupStack::PopAndDestroy(policyTerm);
+	    policyTerm = temp;        
+	    }
+    return GetPolicyToSenL(policyTerm);    
+    }
+    
+CSenElement* CWsdlPolicyAttachment::GetEffectivePolicyL(const TDesC8& /*aUri*/)
+    {
+    // will be a merged from all policies
+    // input should be array of URIs or array of CSenElement*::PolicyElements 
+    return NULL;
+    }
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/andcompositeassertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,486 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include "andcompositeassertion.h"
+#include "xorcompositeassertion.h"
+#include "primitiveassertion.h"
+#include "policyassertion.h"
+
+CAndCompositeAssertion* CAndCompositeAssertion::NewL()
+{
+    CAndCompositeAssertion* pSelf = CAndCompositeAssertion::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+   
+}
+CAndCompositeAssertion* CAndCompositeAssertion::NewLC()
+{
+    CAndCompositeAssertion* pSelf = new (ELeave) CAndCompositeAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+ 
+}
+CAndCompositeAssertion* CAndCompositeAssertion::NewL(CAndCompositeAssertion* aValue)
+{
+    CAndCompositeAssertion* pSelf = CAndCompositeAssertion::NewLC(aValue);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CAndCompositeAssertion* CAndCompositeAssertion::NewLC(CAndCompositeAssertion* aValue)
+{
+    CAndCompositeAssertion* pSelf = new (ELeave) CAndCompositeAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aValue);
+    return pSelf;
+    
+}
+
+CAndCompositeAssertion::~CAndCompositeAssertion()
+{
+    
+}
+CAndCompositeAssertion::CAndCompositeAssertion()
+{
+    
+}
+void CAndCompositeAssertion::ConstructL()
+{
+    
+} 
+void CAndCompositeAssertion::ConstructL(CAndCompositeAssertion* aValue)
+{
+    ConstructL();
+
+    RPolicyTerms terms = aValue->GetTerms();
+    
+    if(terms.Count() > 0)
+        AddTermsCopyL(terms);
+    
+ //   terms.Close();    
+}
+
+TAssertionType CAndCompositeAssertion::Type()
+{
+  return ECompositeAndType;  
+}
+void  CAndCompositeAssertion::AddTerm(MAssertion* aAssertion)
+{
+	if ((IsNormalized() && (aAssertion->Type() == EPrimitiveType))) 
+	{
+			SetNormalized(EFalse);
+	}
+	
+	CAssertion::AddTerm(aAssertion);    
+}
+void CAndCompositeAssertion::AddTermCopyL(MAssertion* aAssertion)
+{
+ 	if ((IsNormalized() && (aAssertion->Type() == EPrimitiveType))) 
+	{
+			SetNormalized(EFalse);
+	}
+	
+	CAssertion::AddTermCopyL(aAssertion);    
+}
+MAssertion*	CAndCompositeAssertion::NormalizeL(CPolicyRegistry* aRegistry){
+
+	if (IsNormalized()) 
+	{
+		return this;
+	}
+
+	CAndCompositeAssertion* AND = CAndCompositeAssertion::NewL();
+
+	if (IsEmpty()) 
+	{
+		AND->SetNormalized(ETrue);
+		return AND;
+	}
+
+/////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////
+	RPolicyTerms XORs;
+
+	RPointerArray<MAssertion> terms1 = GetTerms();
+	MAssertion* term = NULL;
+    TInt termCount = terms1.Count();
+
+    for (TInt i = 0; i< termCount; i++)
+    {
+        
+		term = terms1[i];
+		MAssertion* result = term;
+		if(!dynamic_cast<CPolicyAssertion*>(term))
+		{
+		    //term has new value object, no need to copy
+		    result = term->NormalizeL(aRegistry);
+		}
+
+		if (dynamic_cast<CPolicyAssertion*>(result)) 
+		{
+			CAndCompositeAssertion* wrapper = CAndCompositeAssertion::NewL();
+			RPolicyTerms termsPol1 = result->GetTerms();
+			wrapper->AddTermsCopyL(termsPol1);
+
+			if(result != term)
+			{
+                CPolicyAssertion* eleToDel = (CPolicyAssertion*)result;
+                delete eleToDel;
+			}
+
+			result = NULL;
+			//term has new value object, no need to copy
+			result = wrapper->NormalizeL(aRegistry);
+			delete wrapper;
+//			termsPol1.Close(); //not needed any more
+		}
+
+		if (dynamic_cast<CXorCompositeAssertion*>(result)) 
+		{
+
+			if (result->IsEmpty()) 
+			{
+                result->SetNormalized(true);
+				delete AND;
+                return result;
+			}
+			XORs.Append(result);
+			continue;
+
+		}
+
+		if (dynamic_cast<CAndCompositeAssertion*>(result)) 
+		{
+  			if (result->IsEmpty()) 
+			{
+			    CAndCompositeAssertion* eleToDel = (CAndCompositeAssertion*)result;
+			    delete eleToDel;
+			}
+			else
+			{
+    		    RPolicyTerms termsPol2 = result->GetTerms();
+    			AND->AddTermsCopyL(termsPol2);
+
+			    CAndCompositeAssertion* eleToDel = (CAndCompositeAssertion*)result;
+			    delete eleToDel;
+    			
+//    			termsPol2.Close();
+			}
+			continue;
+		}
+
+		AND->AddTerm(result);
+    }
+    
+	// processing child-XORCompositeAssertions
+
+/////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////
+    
+    CXorCompositeAssertion* XOR = CXorCompositeAssertion::NewL();
+	
+	if (XORs.Count() > 1) 
+	{
+		for (int i = 0; i < XORs.Count(); i++) 
+		{
+
+			for (int j = i; j < XORs.Count(); j++) 
+			{
+
+				if (i != j) 
+				{
+					CXorCompositeAssertion* XOR_A = (CXorCompositeAssertion*) XORs[i];
+					CXorCompositeAssertion* XOR_B = (CXorCompositeAssertion*) XORs[j];
+
+					RPolicyTerms iterA = XOR_A->GetTerms();
+					for (TInt k = 0; k< iterA.Count(); k++) 
+					{
+					    MAssertion* anAND_A = iterA[k];
+						RPolicyTerms iterB = XOR_B->GetTerms();
+
+						for (TInt l = 0; l< iterB.Count(); l++)
+						{
+
+							MAssertion* anAND_B = iterB[l];
+							CAndCompositeAssertion* nAND = CAndCompositeAssertion::NewL();
+							RPolicyTerms termsAA = anAND_A->GetTerms();
+							RPolicyTerms termsBB = anAND_B->GetTerms();
+							nAND->AddTermsCopyL(termsAA);
+							nAND->AddTermsCopyL(termsBB);
+//                            termsAA.Close();
+  //                          termsBB.Close();
+							XOR->AddTerm(nAND);
+						}
+//						iterB.Close();
+					}
+//					iterA.Close();
+				}
+			}
+		}
+
+	} 
+	else if (XORs.Count() == 1) 
+	{	
+		CXorCompositeAssertion* XORterm = (CXorCompositeAssertion*)XORs[0];
+	    RPolicyTerms termsPol3 = XORterm->GetTerms();
+		XOR->AddTermsCopyL(termsPol3);
+		delete XORterm;
+//		termsPol3.Close();
+	}
+
+	XORs.Close();
+
+/////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////
+	
+	if (XOR->IsEmpty())
+	{
+	    delete XOR;
+		AND->SetNormalized(true);
+		return AND;
+	}
+
+	if (AND->IsEmpty()) 
+	{
+	    delete AND;
+		XOR->SetNormalized(true);
+		return XOR;
+	}
+
+/////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////
+
+	RPolicyTerms primTerms = AND->GetTerms();
+	RPolicyTerms xTerms = XOR->GetTerms();
+
+	for (TInt x = 0; x< xTerms.Count(); x++) 
+	{
+		MAssertion* rAND = xTerms[x];
+		rAND->AddTermsCopyL(primTerms);
+	}
+
+    delete AND; //we have copied everythign from AND so now we dont need it
+    
+	XOR->SetNormalized(ETrue);
+	return XOR;
+    
+}         
+MAssertion* CAndCompositeAssertion::IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+    MAssertion* normalizedMe = ((IsNormalized()) ? this : NormalizeL(aRegistry));
+
+    if (!(dynamic_cast<CAndCompositeAssertion*>(normalizedMe))) 
+    {
+    	return normalizedMe->IntersectL(aAssertion, aRegistry);
+    }
+
+    MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+    short type = target->Type();
+
+    switch (type) 
+    {
+
+        case ECompositePolicyType: 
+        {
+        	CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+        	nPOLICY->AddTerm(normalizedMe->IntersectL(target->GetTerms()[0], NULL));
+        	return nPOLICY;
+        }
+
+        case ECompositeXorType: 
+        {
+        	CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+        	RPointerArray<MAssertion> terms = target->GetTerms();
+
+            TInt termCount = terms.Count();
+
+           	for (TInt i = 0; i< termCount; i++)
+        	{
+        		MAssertion* asser = normalizedMe->IntersectL(terms[i]);
+
+        		if (asser->Type() == ECompositeAndType) 
+        		{
+        			nXOR->AddTerm(asser);
+        		}
+        		else
+        		{
+        		    DeleteAssertion(asser);
+        		}
+        		
+        	}
+        	return nXOR;
+        }
+
+        case ECompositeAndType: 
+        {
+        	RPolicyTerms PRIMITIVES_A = ((normalizedMe->Size() > target->Size()) ? normalizedMe->GetTerms() : target->GetTerms());
+        	RPolicyTerms PRIMITIVES_B = ((normalizedMe->Size() > target->Size()) ? target->GetTerms() : normalizedMe->GetTerms());
+
+        	CPrimitiveAssertion* PRIMITIVE_A = NULL;
+        	CPrimitiveAssertion* PRIMITIVE_B = NULL;
+
+        	for (int i = 0; i < PRIMITIVES_A.Count(); i++) 
+        	{
+        		PRIMITIVE_A = (CPrimitiveAssertion*) PRIMITIVES_A[i];
+
+        		TBool flag = false;
+
+        		for (int j = 0; j < PRIMITIVES_B.Count(); j++) 
+        		{
+        			PRIMITIVE_B = (CPrimitiveAssertion*) PRIMITIVES_B[j];
+
+        			if (PRIMITIVE_A->Name().Compare(PRIMITIVE_B->Name()) == 0) 
+        			{
+        				flag = true;
+        				break;
+        			}
+
+        		}
+
+        		if (!flag) 
+        		{
+        			return CXorCompositeAssertion::NewL();
+        		}
+
+        		MAssertion* a = PRIMITIVE_A->IntersectL(PRIMITIVE_B);
+
+        		if (dynamic_cast<CXorCompositeAssertion*>(a)) 
+        		{
+        		    DeleteAssertion(a);
+        			return CXorCompositeAssertion::NewL();
+        		}
+                else
+                {
+                    DeleteAssertion(a);
+                }
+        		
+        	}
+        	CAndCompositeAssertion* result = CAndCompositeAssertion::NewL();
+        	result->AddTermsCopyL(PRIMITIVES_A);
+        	result->AddTermsCopyL(PRIMITIVES_B);
+        	return result;
+        }
+
+        case EPrimitiveType: 
+        {
+        	CQName* name = ((CPrimitiveAssertion*) target)->QName();
+        	TBool isMatch = false;
+
+        	CQName* targetName = NULL;
+        	RPolicyTerms terms = normalizedMe->GetTerms();
+            for (TInt j = 0; j < terms.Count(); j++) 
+        	{
+        		targetName = ((CPrimitiveAssertion*) terms[j])->QName();
+
+        		if (name->Uri().Compare(targetName->Uri()) == 0) 
+        		{
+        			isMatch = true;
+        			break;
+        		}
+        	}
+
+        	if (isMatch) {
+        		CAndCompositeAssertion* nAND = CAndCompositeAssertion::NewL();
+        	    RPolicyTerms tgtTerm = normalizedMe->GetTerms();
+        		nAND->AddTerms(tgtTerm);
+        		nAND->AddTerm(target);
+        		return nAND;
+        	}
+
+        	return CXorCompositeAssertion::NewL();
+        }
+
+        default: 
+        {
+        }
+
+    }
+    return NULL;    
+}
+MAssertion*	CAndCompositeAssertion::MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+	MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+
+	if (!(dynamic_cast<CAndCompositeAssertion*>(normalizedMe))) 
+	{
+		return normalizedMe->MergeL(aAssertion, aRegistry);
+	}
+
+	MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+
+	switch (target->Type()) 
+	{
+
+    	case ECompositePolicyType: 
+    	{
+    		CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+    		RPolicyTerms xTerms = target->GetTerms();
+    		if(xTerms.Count() > 0)
+    		{
+    		    CXorCompositeAssertion* term = (CXorCompositeAssertion*)xTerms[0];		    
+    		    nPOLICY->AddTerm(normalizedMe->MergeL(term));		   
+    		}		
+    		return nPOLICY;
+    	}
+
+    	case ECompositeXorType: 
+    	{
+
+    		CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+            RPolicyTerms xTerms = target->GetTerms();
+    		for (TInt i=0; i< xTerms.Count(); i++)
+    		{
+    			CAndCompositeAssertion* AND = (CAndCompositeAssertion*) xTerms[i];
+    			nXOR->AddTerm(normalizedMe->MergeL(AND));
+    		}
+
+    		return nXOR;
+    	}
+
+    	case ECompositeAndType: 
+    	{
+    		CAndCompositeAssertion* nAND = CAndCompositeAssertion::NewL();
+            RPolicyTerms terms = normalizedMe->GetTerms();
+    		nAND->AddTermsCopyL(terms);
+    		RPolicyTerms targeterms = target->GetTerms();
+    		nAND->AddTermsCopyL(targeterms);
+
+    		return nAND;
+    	}
+
+    	case EPrimitiveType: 
+    	{
+    		CAndCompositeAssertion* nAND = CAndCompositeAssertion::NewL();
+            RPolicyTerms terms = normalizedMe->GetTerms();
+    		nAND->AddTermsCopyL(terms);
+    		nAND->AddTermCopyL(target);
+
+    		return nAND;
+    	}
+
+	}
+    
+    return NULL;	
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/assertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include "assertion.h"
+#include "andcompositeassertion.h"
+#include "xorcompositeassertion.h"
+#include "wspolicywriter.h"
+#include "policyreferenceassertion.h"
+#include "sendebug.h"                 // internal Utils\inc - logging MACROs
+
+CAssertion* CAssertion::NewL()
+{
+    CAssertion* pSelf = CAssertion::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+
+}
+CAssertion* CAssertion::NewLC()
+{
+    CAssertion* pSelf = new (ELeave) CAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+}
+CAssertion::~CAssertion()
+{
+    if(iChildterms.Count() > 0)
+        {
+        for(TInt i=0; i< iChildterms.Count(); i++) 
+            {
+            MAssertion* assert = iChildterms[i];
+            DeleteAssertion(assert);
+            }
+        }
+    iChildterms.Reset();
+}
+    
+CAssertion::CAssertion() :
+iParent(NULL),
+iNormalized(EFalse)
+{    
+}
+
+void CAssertion::ConstructL()
+{
+}
+
+void CAssertion::AddTerm(MAssertion* aAssertion)
+{
+    if(aAssertion)
+    {
+        iChildterms.Append(aAssertion);    
+    }
+}
+
+void 	CAssertion::AddTerms(RPolicyTerms& aAssertions)
+{
+  for(TInt i = 0; i<aAssertions.Count(); i++ )  
+  {
+    MAssertion* assertion  = aAssertions[i];
+    AddTerm(assertion);
+  }
+}
+
+void CAssertion::AddTermCopyL(MAssertion* aAssertion)
+{
+    MAssertion* eleToAdd = NULL;
+    if (aAssertion->Type() == EPrimitiveType)
+    {
+    
+		eleToAdd = CPrimitiveAssertion::NewL((CPrimitiveAssertion*)aAssertion);
+
+	}
+	else if (aAssertion->Type() == ECompositeXorType)
+	{
+		eleToAdd = CXorCompositeAssertion::NewL((CXorCompositeAssertion*)aAssertion);
+	}
+    else if (aAssertion->Type() == EPolicyReferenceType) 
+    {
+	    eleToAdd = CPolicyReferenceAssertion::NewL((CPolicyReferenceAssertion*)aAssertion);
+    }
+	else if (aAssertion->Type() == ECompositePolicyType)
+	{
+        eleToAdd = CPolicyAssertion::NewL((CPolicyAssertion*)aAssertion);
+	
+	} 
+	else if (aAssertion->Type() == ECompositeAndType)
+	{
+		eleToAdd = CAndCompositeAssertion::NewL((CAndCompositeAssertion*)aAssertion);
+
+	} 
+	else
+	{
+	}
+	
+	
+    if(eleToAdd)
+    {
+        iChildterms.Append(eleToAdd);    	
+    }
+    
+}
+void CAssertion::AddTermsCopyL(RPolicyTerms& aAssertions)
+{
+  for(TInt i = 0; i<aAssertions.Count(); i++ )  
+  {
+    MAssertion* assertion  = aAssertions[i];
+    AddTermCopyL(assertion);
+  }
+    
+}
+void CAssertion::MoveTermL(RPolicyTerms& /*aAssertions*/)
+{
+    
+}
+void CAssertion::MoveTermsL(RPolicyTerms& aAssertions)
+{
+
+  for(TInt i = 0; i<aAssertions.Count(); i++ )  
+  {
+    MAssertion* assertion  = aAssertions[i];
+    
+    if(assertion)
+    {
+        iChildterms.Append(assertion);
+    }
+        
+  }
+    aAssertions.Reset();
+}
+
+MAssertion* CAssertion::GetParent()
+{
+    if(iParent)
+        return  iParent;
+    else
+        return NULL;
+   
+}
+RPolicyTerms& CAssertion::GetTerms()
+{
+    return iChildterms;
+}
+TBool CAssertion::HasParent()
+{
+    if(iParent)
+        return  ETrue;
+    else
+        return EFalse;
+}
+MAssertion*	CAssertion::IntersectL(MAssertion* aAssertion)
+{
+    return IntersectL(aAssertion, NULL);    
+}
+TBool CAssertion::IsEmpty()
+{
+    if(iChildterms.Count() < 1)
+        return ETrue;
+    else
+        return EFalse;
+}
+TBool CAssertion::IsNormalized()
+{
+    return iNormalized;
+}
+MAssertion* CAssertion::MergeL(MAssertion* aAssertion)
+{
+    return MergeL(aAssertion, NULL);
+}
+MAssertion* CAssertion::NormalizeL()
+{
+    return NormalizeL(NULL);
+}
+TBool CAssertion::Remove(MAssertion* aAssertion)
+{
+    if(Size() > 0)
+    {
+        TInt indx = iChildterms.Find(aAssertion);
+        if(indx != KErrNotFound)
+        {
+            iChildterms.Remove(indx);
+            return ETrue;
+        }
+    }
+    
+    return EFalse;
+}
+
+void CAssertion::SetNormalized(TBool aFlag)
+{
+    iNormalized = aFlag;
+    for (TInt i = 0; i < iChildterms.Count(); i++)
+	{
+    	((MAssertion*)iChildterms[i])->SetNormalized(aFlag);
+	}
+}
+void CAssertion::SetParent(MAssertion* aParent)
+{
+    iParent = aParent;
+}
+TInt CAssertion::Size()
+{
+    return iChildterms.Count();    
+}
+
+MAssertion* CAssertion::IntersectL(MAssertion* /*aAssertion*/, CPolicyRegistry* /*aRegistry*/)
+{
+    return NULL;   
+}
+MAssertion* CAssertion::MergeL(MAssertion* /*aAssertion*/, CPolicyRegistry* /*aRegistry*/)
+{
+    return NULL;   
+}
+MAssertion* CAssertion::NormalizeL(CPolicyRegistry* /*aRegistry*/)
+{
+    return NULL;    
+}
+
+TAssertionType CAssertion::Type()
+{
+    return EInvalidType;   
+}
+TInt CAssertion::DeleteAssertion(MAssertion* aAssertion)
+{
+    if(aAssertion == NULL)
+        return KErrNone;
+    
+    
+    if (dynamic_cast<CPrimitiveAssertion*>(aAssertion))
+    {
+		CPrimitiveAssertion* ele = (CPrimitiveAssertion*)aAssertion;
+        delete ele;
+        ele = NULL;    
+	} 
+	else if (dynamic_cast<CXorCompositeAssertion*>(aAssertion))
+	{
+		CAssertion* ele = (CAssertion*)aAssertion;
+        delete ele;
+        ele = NULL;    
+	} 
+    else if (dynamic_cast<CPolicyReferenceAssertion*>(aAssertion)) 
+    {
+		CPolicyReferenceAssertion* ele = (CPolicyReferenceAssertion*)aAssertion;
+        delete ele;
+        ele = NULL;    
+	} 
+	else if (dynamic_cast<CPolicyAssertion*>(aAssertion))
+	{
+        CPolicyAssertion* ele = (CPolicyAssertion*)aAssertion;
+        delete ele;
+        ele = NULL;    
+	}
+	else if (dynamic_cast<CAndCompositeAssertion*>(aAssertion))
+	{
+		CAssertion* ele = (CAssertion*)aAssertion;
+        delete ele;
+        ele = NULL;    
+	}
+    return KErrNone;
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/compositeassertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef CCOMPOLICYASSERTION_H
+#define CCOMPOLICYASSERTION_H
+
+#include "assertion.h"
+class CCompositeAssertion :public CAssertion
+{
+ 
+};
+
+#endif //CCOMPOLICYASSERTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/policyassertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,391 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include "policyassertion.h"
+#include "xorcompositeassertion.h"
+#include "andcompositeassertion.h"
+#include "wspolicywriter.h"
+#include "sendebug.h"
+CPolicyAssertion* CPolicyAssertion::NewL()
+{
+    CPolicyAssertion* pSelf = CPolicyAssertion::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+
+}
+CPolicyAssertion* CPolicyAssertion::NewLC()
+{
+    CPolicyAssertion* pSelf = new (ELeave) CPolicyAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+
+}
+CPolicyAssertion* CPolicyAssertion::NewL(CPolicyAssertion* aValue)
+{
+    CPolicyAssertion* pSelf = CPolicyAssertion::NewLC(aValue);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CPolicyAssertion* CPolicyAssertion::NewLC(CPolicyAssertion* aValue)
+{
+    CPolicyAssertion* pSelf = new (ELeave) CPolicyAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aValue);
+    return pSelf;    
+}
+
+CPolicyAssertion::~CPolicyAssertion()
+{
+    delete iName;
+    delete iId;
+    delete iMetadataEndpoint;
+}
+CPolicyAssertion::CPolicyAssertion():
+iName(NULL),
+iId(NULL),
+iMetadataEndpoint(NULL)
+{
+
+}
+void CPolicyAssertion::ConstructL()
+{
+
+}
+
+void CPolicyAssertion::ConstructL(CPolicyAssertion* aValue)
+{
+    ConstructL();
+
+    RPolicyTerms terms = aValue->GetTerms();
+    
+    if(terms.Count() > 0)
+        AddTermsCopyL(terms);
+    
+}
+TAssertionType CPolicyAssertion::Type()
+{
+    return ECompositePolicyType;
+}
+MAssertion* CPolicyAssertion::NormalizeL()
+{
+    return NormalizeL(NULL);
+}
+MAssertion*	CPolicyAssertion::NormalizeL(CPolicyRegistry* aRegistry)
+{
+    if (IsNormalized()) 
+    {
+    	return this;
+    }
+//	TPtrC8 xmlBase = Name();
+//	TPtrC8 id = Id();
+	CPolicyAssertion* policy = CPolicyAssertion::NewL(); //new Policy(xmlBase, id);
+
+	CXorCompositeAssertion* XOR = CXorCompositeAssertion::NewL();
+	CAndCompositeAssertion* AND = CAndCompositeAssertion::NewL();	
+	
+    RPolicyTerms childXorTermList;
+    
+	RPointerArray<MAssertion> terms = GetTerms();
+	MAssertion* term = NULL;
+	MAssertion* result = NULL;
+    TInt termCount = terms.Count();
+	for (TInt i = 0; i< termCount; i++)
+	{
+		term = terms[i];
+		result = term->NormalizeL(aRegistry);
+
+		if(dynamic_cast<CPolicyAssertion*>(result))
+		{
+			CXorCompositeAssertion* tempXor = (CXorCompositeAssertion*) result->GetTerms()[0];
+
+			if (tempXor->Size() != 1)
+			{
+			//result is Policy and have an XOR
+			//delete the policy and put XOR as result
+//				result = Xor;
+                
+			    CPolicyAssertion* ele = (CPolicyAssertion*)result;
+			    result = NULL;
+			    result = CXorCompositeAssertion::NewL();
+			    
+			    RPolicyTerms xorTerms = tempXor->GetTerms();
+			    result->AddTermsCopyL(xorTerms);
+			    
+			    delete ele;
+			    ele = NULL;
+            } 
+			else 
+			{
+			    MAssertion* tempTerm = tempXor->GetTerms()[0];
+			    if(tempTerm)
+			    {
+                    RPolicyTerms terms2 = tempTerm->GetTerms();
+    				AND->AddTermsCopyL(terms2);
+//    				terms2.Close();
+			    }
+    				CPolicyAssertion* eleToDel = (CPolicyAssertion*)result;
+    				delete eleToDel;
+    				eleToDel = NULL;
+    				result = NULL;
+		
+				continue;
+			}
+		}
+
+		if(dynamic_cast<CXorCompositeAssertion*>(result))
+		{
+
+			if (((CXorCompositeAssertion*) result)->IsEmpty())
+			{
+//				CXorCompositeAssertion* emptyXor = CXorCompositeAssertion::NewL();
+//				emptyXor->SetNormalized(ETrue);
+//                result->AddTermL(AND);
+				policy->AddTerm(result);
+				policy->SetNormalized(ETrue);
+                delete AND;
+                delete XOR;
+                childXorTermList.Close();
+				return policy;
+			}
+
+			childXorTermList.Append(result);
+			continue;
+		}
+
+		if(dynamic_cast<CAndCompositeAssertion*>(result))
+		{
+
+			if (result->IsEmpty()) 
+			{
+				CAndCompositeAssertion* emptyAnd = CAndCompositeAssertion::NewL();
+				XOR->AddTerm(emptyAnd);
+
+			} 
+			else 
+			{
+			    RPolicyTerms terms3 = result->GetTerms();
+				AND->AddTermsCopyL(terms3);
+			}
+                CAndCompositeAssertion* eletoDel = (CAndCompositeAssertion*)result;
+				delete eletoDel;			
+			
+			continue;
+		}
+		
+		AND->AddTerm(result);
+	}
+
+////////////////////////////////////////////////////	
+////////////////////////////////////////////////////
+	// processing child-XORCompositeAssertions
+	if (childXorTermList.Count() > 1) {
+
+		for (TInt i = 0; i < childXorTermList.Count(); i++) {
+
+			for (TInt j = i; j < childXorTermList.Count(); j++) {
+
+				if (i != j) {
+					CXorCompositeAssertion* xorTermA = (CXorCompositeAssertion*) childXorTermList[i];
+					CXorCompositeAssertion* xorTermB = (CXorCompositeAssertion*) childXorTermList[j];
+
+					RPolicyTerms iterA = xorTermA->GetTerms();
+
+					for (TInt k = 0; k< iterA.Count(); k++)
+					{
+						MAssertion* andTermA = iterA[k];
+                        
+                        RPolicyTerms iterB = xorTermB->GetTerms();
+
+    					for (TInt l = 0; l< iterB.Count(); l++)
+    					{
+							MAssertion* andTermB = iterB[l];
+							CAndCompositeAssertion* anAndTerm = CAndCompositeAssertion::NewL();
+							RPolicyTerms termsAA = andTermA->GetTerms();
+							RPolicyTerms termsBB = andTermB->GetTerms();
+							anAndTerm->AddTermsCopyL(termsAA);
+							anAndTerm->AddTermsCopyL(termsBB);
+//							termsBB.Close();
+//							termsAA.Close();
+							XOR->AddTerm(anAndTerm);
+						}
+//    						iterB.Close();
+					}
+//    					iterA.Close();
+				}
+			}
+		}
+		for (TInt x = 0; x < childXorTermList.Count(); x++) 
+	    {
+	        CXorCompositeAssertion* xorTermTemp = (CXorCompositeAssertion*)childXorTermList[x];
+	        if(xorTermTemp)
+	            delete xorTermTemp;	        
+	    }
+	}
+	else if (childXorTermList.Count() == 1) 
+	{
+		CXorCompositeAssertion* xorTerm = (CXorCompositeAssertion*)childXorTermList[0];
+		XOR->AddTermsCopyL(xorTerm->GetTerms());
+        delete xorTerm;
+	}
+
+	else if (childXorTermList.Count() == 0)
+	{
+        if(AND->Size() > 0)
+            XOR->AddTerm(AND);
+        else
+            delete AND;
+        policy->AddTerm(XOR);
+		policy->SetNormalized(ETrue);
+		
+        childXorTermList.Close();
+    	return policy;
+	}
+
+    childXorTermList.Close();
+	
+////////////////////////////////////////////////////	
+////////////////////////////////////////////////////
+	RPolicyTerms primTerms = AND->GetTerms();
+	RPolicyTerms andTerms = XOR->GetTerms();
+    for(TInt p = 0; p < andTerms.Count(); p++)
+    {
+		MAssertion* anAndTerm = andTerms[p];
+		anAndTerm->AddTermsCopyL(primTerms);
+	}
+	
+    delete AND;
+	policy->AddTerm(XOR);
+	policy->SetNormalized(ETrue);
+	
+	return policy;
+
+}         
+MAssertion* CPolicyAssertion::IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+	MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+	if (!(dynamic_cast<CPolicyAssertion*>(normalizedMe))) 
+	{
+		return normalizedMe->IntersectL(aAssertion, aRegistry);
+	}
+
+	MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+	short type = target->Type();
+
+	switch (type) 
+	{
+	case ECompositePolicyType: 
+	{
+		CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+		CXorCompositeAssertion* norm1 = (CXorCompositeAssertion*) normalizedMe->GetTerms()[0];
+		nPOLICY->AddTerm(norm1->IntersectL((CXorCompositeAssertion*) target->GetTerms()[0], NULL));
+		return nPOLICY;
+	}
+	case ECompositeXorType:
+	case ECompositeAndType:
+	case EPrimitiveType: 
+	{
+		CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+		nPOLICY->AddTerm((normalizedMe->GetTerms()[0])->IntersectL(target, NULL));
+		return nPOLICY;
+	}
+
+	default: 
+	{
+	}
+
+	}
+return NULL;	
+}
+MAssertion* CPolicyAssertion::MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+    MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+
+	if (!(dynamic_cast<CPolicyAssertion*>(normalizedMe))) 
+	{
+		return normalizedMe->MergeL(aAssertion, aRegistry);
+	}
+
+	CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+
+	MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+	short type = target->Type();
+
+    RPolicyTerms terms = normalizedMe->GetTerms();
+    if(terms.Count() > 0)
+    {
+        CXorCompositeAssertion* xorTerm = (CXorCompositeAssertion*)terms[0];
+            
+    	switch (type) 
+    	{
+
+        	case ECompositePolicyType: 
+        	{
+        	    RPolicyTerms tgtTerms = target->GetTerms();
+        	    if(tgtTerms.Count() > 0)
+        	    {
+                    CXorCompositeAssertion* tgtTerm = (CXorCompositeAssertion*)tgtTerms[0];
+                    MAssertion* result = xorTerm->MergeL(tgtTerm, NULL);
+                    nPOLICY->AddTerm(result);
+        	    }
+        		return nPOLICY;
+        	}
+        	case ECompositeXorType:
+        	case ECompositeAndType:
+        	case EPrimitiveType:
+            {
+                MAssertion* result = xorTerm->MergeL(target, NULL);            
+        		nPOLICY->AddTerm(result);
+        		return nPOLICY;
+        	}
+
+        	default: 
+        	{
+        	}
+
+    	}
+    }
+    return NULL;    
+}
+
+void CPolicyAssertion::SetNameL(TDesC8& aName)
+{
+    iName = aName.AllocL();
+}          
+void CPolicyAssertion::SetIdL(TDesC8& aId)
+{
+    iId = aId.AllocL();
+}
+TPtrC8 	CPolicyAssertion::Name()
+{
+    return iName->Des();
+}     
+TPtrC8 	CPolicyAssertion::Id()
+{
+    return iId->Des();
+}
+TPtrC8 CPolicyAssertion::PolicyURI()
+{
+    return iName->Des();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/policyreferenceassertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,218 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "policyreferenceassertion.h"
+#include "wspolicyregistry.h"
+#include "policyassertion.h"
+#include "wspolicyreader.h"
+CPolicyReferenceAssertion* CPolicyReferenceAssertion::NewL(TDesC8& aUri)
+{
+    CPolicyReferenceAssertion* pSelf = CPolicyReferenceAssertion::NewLC(aUri);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CPolicyReferenceAssertion* CPolicyReferenceAssertion::NewLC(TDesC8& aUri)
+{
+    CPolicyReferenceAssertion* pSelf = new (ELeave) CPolicyReferenceAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aUri);
+    return pSelf;
+    
+}
+CPolicyReferenceAssertion* CPolicyReferenceAssertion::NewL(CPolicyReferenceAssertion* aValue)
+{
+    CPolicyReferenceAssertion* pSelf = CPolicyReferenceAssertion::NewLC(aValue);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CPolicyReferenceAssertion* CPolicyReferenceAssertion::NewLC(CPolicyReferenceAssertion* aValue)
+{
+    CPolicyReferenceAssertion* pSelf = new (ELeave) CPolicyReferenceAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aValue);
+    return pSelf;
+    
+}
+CPolicyReferenceAssertion::~CPolicyReferenceAssertion()
+{
+    delete iUri;    
+}
+CPolicyReferenceAssertion::CPolicyReferenceAssertion()
+:iUri(NULL)
+{
+    
+}
+void CPolicyReferenceAssertion::ConstructL(TDesC8& aUri)
+{
+    if(aUri.Length() > 0)
+    {
+        iUri = aUri.AllocL();
+    }
+}
+TPtrC8 CPolicyReferenceAssertion::PolicyUri()
+{
+    if(iUri && iUri->Length() > 0)
+    {
+        TPtrC8 p = iUri->Des();
+        return p;
+    }
+    else
+    {
+        return KNullDesC8();
+    }
+}
+
+void CPolicyReferenceAssertion::ConstructL(CPolicyReferenceAssertion* aValue)
+{
+    if(aValue->PolicyUri().Length() > 0)
+    {
+        TPtrC8 uri = aValue->PolicyUri();
+        ConstructL(uri);
+    }
+}
+void CPolicyReferenceAssertion::AddTerm(MAssertion* /*aAssertion*/)
+{
+    
+}
+void CPolicyReferenceAssertion::AddTerms(RPolicyTerms& /*aAssertions*/)
+{
+    
+}
+void CPolicyReferenceAssertion::AddTermCopyL(MAssertion* /*aAssertion*/)
+{
+    
+}
+void CPolicyReferenceAssertion::AddTermsCopyL(RPolicyTerms& /*aAssertions*/)
+{
+    
+}
+void CPolicyReferenceAssertion::MoveTermL(RPolicyTerms& /*aAssertions*/)
+{
+    
+}
+void CPolicyReferenceAssertion::MoveTermsL(RPolicyTerms& /*aAssertions*/)
+{
+    
+}
+MAssertion* CPolicyReferenceAssertion::GetParent()
+{
+  return NULL;  
+}
+TBool CPolicyReferenceAssertion::HasParent()
+{
+    return EFalse;
+}
+TBool CPolicyReferenceAssertion::IsEmpty()
+{
+    return ETrue;
+}
+TBool CPolicyReferenceAssertion::IsNormalized()
+{
+    return EFalse;
+}
+TBool CPolicyReferenceAssertion::Remove(MAssertion* /*aAssertion*/)
+{
+    return EFalse;
+}
+void CPolicyReferenceAssertion::SetNormalized(TBool /*aFlag*/)
+{
+    
+}
+void CPolicyReferenceAssertion::SetParent(MAssertion* /*aParent*/)
+{
+    
+}
+TInt CPolicyReferenceAssertion::Size()
+{
+    return KErrNone;
+}
+TAssertionType  CPolicyReferenceAssertion::Type()
+{
+    return EPolicyReferenceType;    
+}
+
+MAssertion* CPolicyReferenceAssertion::IntersectL(MAssertion* /*aAssertion*/, CPolicyRegistry* /*aRegistry*/)
+{
+    return NULL;
+}
+MAssertion* CPolicyReferenceAssertion::IntersectL(MAssertion* /*aAssertion*/)
+{
+    return NULL;
+}
+MAssertion* CPolicyReferenceAssertion::MergeL(MAssertion* /*aAssertion*/, CPolicyRegistry* /*aRegistry*/)
+{
+    return NULL;
+}
+MAssertion* CPolicyReferenceAssertion::MergeL(MAssertion* /*aAssertion*/)
+{
+    return NULL;
+}
+MAssertion* CPolicyReferenceAssertion::NormalizeL(CPolicyRegistry* aRegistry)
+{
+    if (aRegistry == NULL) 
+    {
+        return NULL;
+    }
+
+    _LIT8(KHash, "#");
+    HBufC8* pRippedUri = NULL;	//CodeScannerWarnings
+    MAssertion* result = NULL;
+    
+    TPtrC8 uri = PolicyUri();
+    
+    if(uri.Left(1).Compare(KHash) == 0)
+    {
+        pRippedUri = uri.Right(uri.Length()-1).AllocL(); 
+        CleanupStack::PushL(pRippedUri);
+        if(pRippedUri->Length() > 0)
+        {
+            
+            CSenElement* targetPolicy = aRegistry->LookupPolicy(pRippedUri->Des());
+            if (targetPolicy == NULL)
+            {
+                result = NULL;;
+            }
+            else
+            {
+                CWSPolicyReader* reader = CWSPolicyReader::NewLC();
+                CPolicyAssertion* policy = reader->GetPolicyL(targetPolicy);
+                CleanupStack::PopAndDestroy();
+                CleanupStack::PushL( policy );
+                result = policy->NormalizeL( aRegistry );
+                CleanupStack::PopAndDestroy( policy );
+            }
+            
+        }
+        CleanupStack::PopAndDestroy(pRippedUri);
+    }
+    return result;
+
+}
+MAssertion* CPolicyReferenceAssertion::NormalizeL()
+{
+    return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/primitiveassertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,704 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+ 
+
+#include "primitiveassertion.h"
+#include "policyassertion.h"
+#include "xorcompositeassertion.h"
+#include "andcompositeassertion.h"
+#include "wspolicyreader.h"
+#include "wspolicyutils.h"
+using namespace WSPolicy;
+
+CPrimitiveAssertion* CPrimitiveAssertion::NewL()
+{
+    CPrimitiveAssertion* pSelf = CPrimitiveAssertion::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CPrimitiveAssertion* CPrimitiveAssertion::NewLC()
+{
+     CPrimitiveAssertion* pSelf = new (ELeave) CPrimitiveAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+   
+}
+CPrimitiveAssertion* CPrimitiveAssertion::NewL(CPrimitiveAssertion* aValue)
+{
+    CPrimitiveAssertion* pSelf = CPrimitiveAssertion::NewLC(aValue);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CPrimitiveAssertion* CPrimitiveAssertion::NewLC(CPrimitiveAssertion* aValue)
+{
+    CPrimitiveAssertion* pSelf = new (ELeave) CPrimitiveAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aValue);
+    return pSelf;
+}
+
+CPrimitiveAssertion* CPrimitiveAssertion::NewL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri)
+{
+    CPrimitiveAssertion* pSelf = CPrimitiveAssertion::NewLC(aName,aPrefix, aUri);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CPrimitiveAssertion* CPrimitiveAssertion::NewLC(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri)
+{
+     CPrimitiveAssertion* pSelf = new (ELeave) CPrimitiveAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aName, aPrefix, aUri);
+    return pSelf;
+   
+}
+
+CPrimitiveAssertion::~CPrimitiveAssertion()
+    {
+    delete iQname;//	QName qname;
+    if(iAttr != NULL)
+    	{
+        iAttr->Reset(); //Hashtable attributes = new Hashtable();
+        delete iAttr;
+    	}
+	delete iStrValue;
+    }
+
+CPrimitiveAssertion::CPrimitiveAssertion():
+iOwner(NULL), iIsOptional(EFalse),iStrValue(NULL)
+{
+    
+}
+void CPrimitiveAssertion::ConstructL()
+{
+    iAttr = new (ELeave) RAttributeMap(ETrue, ETrue);    
+}
+void CPrimitiveAssertion::ConstructL(CPrimitiveAssertion* aValue)
+{
+    CQName* temp = aValue->QName();
+    if(temp)
+    {
+        TPtrC8 name = temp->Name();
+        TPtrC8 prefix = temp->Prefix();
+        TPtrC8 uri = temp->Uri();
+        ConstructL(name, prefix,uri);
+    
+        SetAttributesL(aValue->Attributes());
+
+        TPtrC8 strval = aValue->StrValue();
+        iStrValue = strval.AllocL();
+        
+        RPolicyTerms terms = aValue->GetTerms();
+        
+        if(terms.Count() > 0)
+            AddTermsCopyL(terms);
+    }
+        
+}
+
+void CPrimitiveAssertion::ConstructL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri)
+{
+    iQname = CQName::NewL(aName, aPrefix, aUri);
+    ConstructL();
+}
+MAssertion*	CPrimitiveAssertion::GetParent()
+{
+    return iOwner;   
+}
+RPolicyTerms& CPrimitiveAssertion::GetTerms()
+{  
+    return CAssertion::GetTerms();
+}
+TAssertionType CPrimitiveAssertion::Type()
+{
+  return EPrimitiveType;    
+}
+TBool CPrimitiveAssertion::HasParent()
+{
+    if(iOwner)    
+    return ETrue;
+    else
+    return EFalse;
+}
+TBool CPrimitiveAssertion::IsEmpty()
+{
+    if(Size() > 0)
+        return EFalse;
+    else
+        return ETrue;
+}
+void AppendAll(RPolicyTerms& aSource, RPolicyTerms& aDest)
+{
+    TInt count = aSource.Count();
+    if(count > 0)
+    {
+        for (TInt i = 0; i < count; i++)
+        {
+            MAssertion* term = aSource[i];
+            aDest.Append(term);
+        }
+    }
+}
+MAssertion* CPrimitiveAssertion::NormalizeL()
+{
+    return NormalizeL(NULL);
+}
+MAssertion* CPrimitiveAssertion::NormalizeL(CPolicyRegistry* aRegistry)
+{
+    if (IsNormalized()) 
+    {
+    	return this;
+    }
+
+    if (IsOptional()) 
+    {
+
+    	CXorCompositeAssertion* XOR = CXorCompositeAssertion::NewL();
+    	CAndCompositeAssertion* AND = CAndCompositeAssertion::NewL();
+
+    	CPrimitiveAssertion* PRIM = GetSelfWithoutTermsL();
+    	PRIM->RemoveAttribute(KWspOptinal);
+    	PRIM->SetOptional(false);
+    	RPolicyTerms terms1 = GetTerms();
+    	PRIM->SetTermsL(terms1);
+        
+    	AND->AddTerm(PRIM);
+    	XOR->AddTerm(AND);
+    	XOR->AddTerm(CAndCompositeAssertion::NewL());
+        
+        MAssertion* result = XOR->NormalizeL(aRegistry);
+        delete XOR;
+    	return result;
+
+    }
+    RPolicyTerms terms2 = GetTerms();
+    if (terms2.Count() == 0) 
+    {
+    	CPrimitiveAssertion* PRIM = GetSelfWithoutTermsL();
+    	PRIM->SetNormalized(true);
+    	return PRIM;
+    }
+
+    RPolicyTerms policyTerms;
+    RPolicyTerms nonPolicyTerms;
+    for(TInt i =0 ; i < terms2.Count(); i++) 
+    {
+    	MAssertion* term = terms2[i];
+
+    	if (dynamic_cast<CPolicyAssertion*>(term)) 
+    	{
+    		policyTerms.Append(term);
+
+    	} 
+    	else if (dynamic_cast<CPrimitiveAssertion*>(term)) 
+    	{
+    		nonPolicyTerms.Append(term);
+
+    	} 
+    	else 
+    	{
+    	}
+    }
+
+    if (policyTerms.Count() == 0) {
+    	CPrimitiveAssertion* PRIM = CPrimitiveAssertion::NewL(this);
+    	PRIM->SetNormalized(true);
+        policyTerms.Close();
+        nonPolicyTerms.Close();
+    	return PRIM;
+    }
+
+    CPolicyAssertion* policyTerm = CWSPolicyUtils::GetSinglePolicyL(policyTerms, aRegistry);
+    RPolicyTerms polTerms = policyTerm->GetTerms();
+    if(polTerms.Count() > 0)
+    {
+        MAssertion* xorTerm = polTerms[0];
+        RPolicyTerms ANDs = xorTerm->GetTerms();
+
+        if (ANDs.Count() == 0) 
+        {
+            delete policyTerm;
+            policyTerms.Close();
+            nonPolicyTerms.Close();
+        	return CXorCompositeAssertion::NewL();
+        }
+
+        if (ANDs.Count() == 1) 
+        {
+        //DONE
+            CAndCompositeAssertion* term = (CAndCompositeAssertion*) ANDs[0];
+        	term->AddTermsCopyL(nonPolicyTerms);
+        	CPrimitiveAssertion* PRIM = GetSelfWithoutTermsL();
+        	PRIM->AddTerm(policyTerm);
+            policyTerms.Close();
+            nonPolicyTerms.Close();
+        	return PRIM;
+        }
+
+        CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+        CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+        nPOLICY->AddTerm(nXOR);
+
+        RPolicyTerms list;
+
+        for (TInt j = 0; j < ANDs.Count(); j++) 
+        {
+        	CPrimitiveAssertion* nPRIM = GetSelfWithoutTermsL();
+        	
+            CAndCompositeAssertion* andTerm = (CAndCompositeAssertion*)ANDs[j];
+            RPolicyTerms terms3 = andTerm->GetTerms();
+        	AppendAll(terms3, list);
+
+        	if (nonPolicyTerms.Count() > 0) 
+        	{
+        		AppendAll(nonPolicyTerms, list);
+        	}
+        	CPolicyAssertion* pol = GetSinglePolicyL(list);
+        	nPRIM->AddTerm(pol);
+        	
+        	CAndCompositeAssertion* AND = CAndCompositeAssertion::NewL();
+        	AND->AddTerm(nPRIM);
+        	nXOR->AddTerm(AND);
+        	list.Close();
+        }
+
+    	delete policyTerm;
+        policyTerms.Close();
+        nonPolicyTerms.Close();
+        
+        nPOLICY->SetNormalized(ETrue);
+        return nPOLICY;    
+    }
+    
+    return NULL;    
+}
+MAssertion* CPrimitiveAssertion::IntersectL(MAssertion* aAssertion)
+{
+    return IntersectL(aAssertion, NULL); 
+}
+MAssertion* CPrimitiveAssertion::IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+	MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+
+	if (!(dynamic_cast<CPrimitiveAssertion*>(normalizedMe))) 
+	{
+		return normalizedMe->IntersectL(aAssertion, aRegistry);
+	}
+
+	MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+
+	// Am not a primitive assertion anymore ..
+	if (!(dynamic_cast<CPrimitiveAssertion*>(aAssertion))) 
+	{
+		return normalizedMe->IntersectL(aAssertion, aRegistry);
+	}
+
+	// argument is not primitive type ..
+	if (!(dynamic_cast<CPrimitiveAssertion*>(target))) 
+	{
+		return target->IntersectL(normalizedMe, aRegistry);
+	}
+
+	CPrimitiveAssertion* arg = (CPrimitiveAssertion*) target;
+	CPrimitiveAssertion* self = (CPrimitiveAssertion*) normalizedMe;
+
+	if (!self->Name().Compare(arg->Name()) == 0) 
+	{
+		return CXorCompositeAssertion::NewL(); // no bahaviour is admisible
+	}
+
+	if (self->GetTerms().Count() == 0 && arg->GetTerms().Count() == 0) 
+	{
+		CAndCompositeAssertion* assertion2 = CAndCompositeAssertion::NewL();
+		assertion2->AddTermCopyL(self);
+		assertion2->AddTermCopyL(arg);
+		return assertion2;
+	}
+
+	if (self->GetTerms().Count() == 0 || arg->GetTerms().Count() == 0) 
+	{
+		return CXorCompositeAssertion::NewL(); // no
+	}
+
+	RPolicyTerms argChildTerms;
+	TBool closeArrayarg = EFalse;
+	if (dynamic_cast<CPolicyAssertion*>(arg->GetTerms()[0])) 
+	{
+		CWSPolicyUtils::GetPrimTermsListL((CPolicyAssertion*) arg->GetTerms()[0], argChildTerms);
+		closeArrayarg = ETrue;
+	}
+	else 
+	{
+		argChildTerms = arg->GetTerms();
+	}
+
+	RPolicyTerms selfChildTerms;
+	TBool closeArrayself = EFalse;
+	if (dynamic_cast<CPolicyAssertion*>(self->GetTerms()[0])) 
+	{
+		CWSPolicyUtils::GetPrimTermsListL((CPolicyAssertion*) self->GetTerms()[0], selfChildTerms);
+		closeArrayself = ETrue;
+	} 
+	else 
+	{
+		selfChildTerms = self->GetTerms();
+	}
+
+	///////////////////////////////////////////////////////////////////////
+	///////////////////////////////////////////////////////////////////////
+
+	CPrimitiveAssertion* PRIMITIVE_A = NULL;
+	CPrimitiveAssertion* PRIMITIVE_B = NULL;
+	RPolicyTerms primListA, primListB;
+
+	if (selfChildTerms.Count() > argChildTerms.Count()) {
+		primListA = selfChildTerms;
+		primListB = argChildTerms;
+	} else {
+		primListA = argChildTerms;
+		primListB = selfChildTerms;
+	}
+
+    for (TInt i = 0 ; i < primListA.Count(); i++)
+    {
+		PRIMITIVE_A = (CPrimitiveAssertion*) primListA[i];
+
+		TBool found = EFalse;
+        for (TInt j = 0 ; j < primListB.Count(); j++)
+        {
+			PRIMITIVE_B = (CPrimitiveAssertion*) primListB[j];
+			if (PRIMITIVE_A->Name().Compare(PRIMITIVE_B->Name()) == 0)
+			{
+				found = ETrue;
+				break;
+			}
+		}
+
+		if (!found) 
+		{
+		    if(closeArrayarg)
+		        argChildTerms.Close();
+		    if(closeArrayself)
+		        selfChildTerms.Close();
+		    
+			return CXorCompositeAssertion::NewL();
+		}
+
+        MAssertion* assert = PRIMITIVE_A->IntersectL(PRIMITIVE_B);
+		if (dynamic_cast<CXorCompositeAssertion*>(assert)) 
+		{
+		    if(closeArrayarg)
+		        argChildTerms.Close();
+		    if(closeArrayself)
+		        selfChildTerms.Close();
+		
+		    DeleteAssertion(assert);
+			return CXorCompositeAssertion::NewL();
+		}
+		else
+		{
+		    DeleteAssertion(assert);
+		}
+	}
+
+	CAndCompositeAssertion* andCompositeAssertion = CAndCompositeAssertion::NewL();
+	andCompositeAssertion->AddTermCopyL(arg);
+	andCompositeAssertion->AddTermCopyL(self);
+
+		    if(closeArrayarg)
+		        argChildTerms.Close();
+		    if(closeArrayself)
+		        selfChildTerms.Close();
+		    
+	return andCompositeAssertion;
+    
+}
+MAssertion* CPrimitiveAssertion::MergeL(MAssertion* aAssertion)
+{
+    return MergeL(aAssertion, NULL);
+}
+MAssertion* CPrimitiveAssertion::MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+	MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+
+	if (!(dynamic_cast<CPrimitiveAssertion*>(normalizedMe))) 
+	{
+		return normalizedMe->MergeL(aAssertion, aRegistry);
+	}
+
+	MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+
+	if (!(dynamic_cast<CPrimitiveAssertion*>(target))) 
+	{
+		return target->MergeL(normalizedMe, aRegistry);
+	}
+
+	/*
+	 * both self and the argument are primitive assertions. Hence both
+	 * should be wrapped in an AndCompositeType
+	 */
+	CAndCompositeAssertion* AND = CAndCompositeAssertion::NewL();
+	AND->AddTermCopyL(target);
+	AND->AddTermCopyL(normalizedMe);
+	return AND;
+    
+}
+TBool CPrimitiveAssertion::Remove(MAssertion* aAssertion)
+{
+    if(aAssertion)
+    {
+        CAssertion::Remove(aAssertion);
+    }
+    return ETrue;
+    
+}
+TInt CPrimitiveAssertion::Size()
+{
+    return CAssertion::Size();
+}
+
+
+TInt CPrimitiveAssertion::SetTermsL(RPolicyTerms& aTerms)
+{
+		this->AddTermsCopyL(aTerms);
+		return KErrNone;    
+}
+void  CPrimitiveAssertion::AddAttributeL(TDesC8& aQname, TDesC8& aValue)
+{
+    TInt indx = iAttr->Find(aQname);
+    if(indx == KErrNotFound)
+    {
+        iAttr->Append(aQname.AllocL(),aValue.AllocL());        
+    }
+    else
+    {
+        iAttr->UpdateValue(aQname.AllocL(),aValue.AllocL());    
+    }
+}
+TPtrC8 CPrimitiveAssertion::GetAttributeValue(const TDesC8& aQname)
+{
+    TInt indx = iAttr->Find(aQname);
+    if(indx != KErrNotFound)
+    {
+        const TDesC8* value =  iAttr->ValueAt(indx);
+        return *value; //->Ptr();
+    }
+    return KNullDesC8();
+}
+RAttributeMap& CPrimitiveAssertion::Attributes()
+{
+//    aAttributes.Copy(iAttr);
+return *iAttr;
+}
+TInt CPrimitiveAssertion::SetAttributesL(RAttributeMap& aAttributes)
+{
+ 
+ TInt count = aAttributes.Count();
+ for (TInt i=0; i< count; i++)   
+ {
+    const TDesC8* name = aAttributes.KeyAt(i);
+    const TDesC8* value = aAttributes.ValueAt(i);
+    HBufC8* tt = name->AllocL();
+    HBufC8* tt2 = value->AllocL();
+    TPtrC8 namePtr = tt->Des();
+    TPtrC8 valPtr = tt2->Des();
+    AddAttributeL(namePtr, valPtr);
+    delete tt;
+    delete tt2;
+ }
+    return KErrNone;
+}
+TInt  CPrimitiveAssertion::RemoveAttribute(const TDesC8& aQname)
+{
+    TInt indx = iAttr->Find(aQname);
+    if(indx != KErrNotFound)
+    {
+        iAttr->RemoveByKey(aQname);
+        return KErrNone;
+    }
+    return KErrNotFound;
+}
+
+CQName* CPrimitiveAssertion::QName()
+{   if(iQname)
+        return iQname;
+    else
+        return NULL;
+}
+TPtrC8 CPrimitiveAssertion::Name()
+{   if(iQname)
+    return iQname->QName();
+else
+    return KNullDesC8();
+}
+TPtrC8 CPrimitiveAssertion::StrValue()
+{
+    if(iStrValue)
+    return iStrValue->Des();
+    else
+    return KNullDesC8();
+}
+void CPrimitiveAssertion::SetStrValueL(TDesC8& aStrValue)
+{
+    if(aStrValue.Length() > 0)
+        iStrValue = aStrValue.AllocL();     
+}
+TAny* CPrimitiveAssertion::Value()
+{
+  return NULL;
+}
+
+TBool CPrimitiveAssertion::IsOptional()
+{
+    return iIsOptional;    
+}
+TInt CPrimitiveAssertion::SetOptional(TBool aOptional)
+{
+    iIsOptional = aOptional; 
+    return KErrNone; 
+}
+
+CPolicyAssertion* CPrimitiveAssertion::GetSinglePolicyL(RPolicyTerms aChildTerms)
+{
+
+		CPolicyAssertion* policy = CPolicyAssertion::NewL();
+		CXorCompositeAssertion* pXor = CXorCompositeAssertion::NewL();
+		CAndCompositeAssertion* pAnd = CAndCompositeAssertion::NewL();
+		pAnd->AddTermsCopyL(aChildTerms);
+		pXor->AddTerm(pAnd);
+		policy->AddTerm(pXor);
+		return policy;
+
+}
+
+TBool CPrimitiveAssertion::IsEmptyPolicy(CPolicyAssertion* aPolicy) 
+{
+
+        RPolicyTerms terms = aPolicy->GetTerms();
+        if(terms.Count() > 0)
+        {
+   	    	CXorCompositeAssertion* xorTerm = (CXorCompositeAssertion* )terms[0];
+    		return xorTerm->IsEmpty();
+        }
+        else
+            return EFalse;
+
+}
+
+RPolicyTerms CPrimitiveAssertion::GetTerms(CPolicyAssertion* aPolicy) 
+{
+
+    RPolicyTerms terms1 = aPolicy->GetTerms();
+    if(terms1.Count() > 0)
+    {
+        CXorCompositeAssertion* xorTerm = (CXorCompositeAssertion*)terms1[0];
+        if(xorTerm)
+        {
+            RPolicyTerms terms2 = xorTerm->GetTerms();
+            if(terms2.Count() > 0)
+            {
+                CAndCompositeAssertion* andTerm= (CAndCompositeAssertion*) terms2[0];
+                if(andTerm)
+                    return andTerm->GetTerms();
+            }
+        }
+    }
+    RPolicyTerms empty_terms;
+    return empty_terms;
+}
+
+CPrimitiveAssertion* CPrimitiveAssertion::GetSelfWithoutTermsL() 
+{
+    TPtrC8 name = iQname->Name();
+    TPtrC8 prefix = iQname->Prefix();
+    TPtrC8 uri = iQname->Uri();
+    
+	CPrimitiveAssertion* prim = CPrimitiveAssertion::NewL(name, prefix, uri);
+	prim->SetAttributesL(*iAttr);
+	TPtrC8 strval = StrValue();
+	prim->SetStrValueL(strval);
+	return prim;
+}
+
+
+CQName* CQName::NewL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri)
+{
+    CQName* pSelf = CQName::NewLC(aName, aPrefix, aUri);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CQName* CQName::NewLC(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri)
+{
+    CQName* pSelf = new (ELeave) CQName();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aName, aPrefix, aUri);
+    return pSelf;
+   
+}
+CQName::~CQName()
+{
+    delete iName;
+    delete iQName;
+    delete iPrefix;
+    delete iUri;	
+}
+TPtrC8 CQName::Name()
+{
+    return iName->Des();
+}
+TPtrC8 CQName::QName()
+{
+    return iQName->Des();
+}
+TPtrC8 CQName::Prefix()
+{
+    return iPrefix->Des();
+}
+TPtrC8 CQName::Uri()
+{
+    return iUri->Des();
+}
+CQName::CQName()
+{
+    
+}
+
+void CQName::ConstructL(TDesC8& aName, TDesC8& aPrefix, TDesC8& aUri)
+    {
+	_LIT8(KColon, ":"); 
+    iName = aName.AllocL();
+    iPrefix = aPrefix.AllocL();
+    iUri = aUri.AllocL();
+    iQName = HBufC8::NewL( aPrefix.Length() + KColon().Length() + aName.Length() );
+    TPtr8 qname = iQName->Des();
+    qname.Append( aPrefix );
+    qname.Append( KColon );
+    qname.Append( aName );
+    }
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/seninternalwspolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1098 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "seninternalwspolicy.h"
+#include "SenFacet.h"
+#include <SenXmlElement.h>
+#include <SenXmlUtils.h>
+#include "senwsdescription.h"
+#include "SenDateUtils.h"
+#include "senservicepolicy.h"
+#include "wspolicyutils.h"
+
+
+#ifdef SYMBIAN_SECURE_ECOM
+    // for S60 FP3 (2.8) platform or newer (3.0 and above)
+    #include <xml/attribute.h> // needed for RAttributeArray
+//#else  // for S60 FP2 platform (2.6) or older
+    //#include "Attribute.h"
+#endif
+
+#include <xmlengnodelist.h> 
+using namespace Xml;
+using namespace SenWSInternalPolicy;
+namespace
+    {
+    const TInt KFlatBufSize                       = 128;
+    }
+CSenInternalWsPolicy* CSenInternalWsPolicy::NewL()
+    {
+    CSenInternalWsPolicy* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenInternalWsPolicy* CSenInternalWsPolicy::NewLC()
+    {
+    CSenInternalWsPolicy* pNew = new (ELeave) CSenInternalWsPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(KSenWSPolicyMetadata);
+    return pNew;
+    }
+
+CSenInternalWsPolicy* CSenInternalWsPolicy::NewL(
+                                           	const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenInternalWsPolicy* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenInternalWsPolicy* CSenInternalWsPolicy::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenInternalWsPolicy* pNew = new (ELeave) CSenInternalWsPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+CSenInternalWsPolicy* CSenInternalWsPolicy::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                             CSenElement& aParent)
+    {
+    CSenInternalWsPolicy* pNew = NewLC(aNsUri, aLocalName,
+                                         aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenInternalWsPolicy* CSenInternalWsPolicy::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            CSenElement& aParent)
+    {
+    CSenInternalWsPolicy* pNew = new (ELeave) CSenInternalWsPolicy;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+void CSenInternalWsPolicy::ConstructL(const TDesC8&  aNsUri,
+                                          const TDesC8&  aLocalName,
+                                          const TDesC8&  aQName,
+                                          const RAttributeArray& aAttributes,
+                                           CSenElement& aParent)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    }
+void CSenInternalWsPolicy::ConstructL(const TDesC8&  aNsUri,
+                                          const TDesC8&  aLocalName,
+                                          const TDesC8&  aQName,
+                                          const RAttributeArray& aAttributes)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    }
+  
+void CSenInternalWsPolicy::ConstructL(const TDesC8& aLocalName)
+    {
+    CSenBaseFragment::BaseConstructL(aLocalName);
+    }
+
+CSenInternalWsPolicy::CSenInternalWsPolicy()
+    {
+    }
+
+CSenInternalWsPolicy::~CSenInternalWsPolicy()
+    {
+    delete ipIdentifier;
+    }
+
+TBool CSenInternalWsPolicy::IsApplicableL(CSenWSDescription& aPattern)
+    {
+    TPtrC8 value;
+    CSenElement& patternElement = ((CSenWSDescription&)aPattern).AsElement();
+    CSenWSPolicyIdentifier& identifier = IdentifierL();
+
+    TPtrC8 contract = aPattern.Contract();
+    TPtrC8 endpoint = aPattern.Endpoint();
+    CSenElement* providerId = aPattern.AsElement().Element(KProviderIdLocalName);
+    if(providerId && providerId->HasContent())     
+        {
+        TPtrC8 provider = providerId->Content();    
+        TPtrC8 valProviderId = identifier.ProviderIdL();
+        TPtrC8 valEndpoint = identifier.EndpointL();
+        TPtrC8 valContract = identifier.ContractL();
+    
+        if(contract == valContract && 
+            endpoint == valEndpoint && 
+            provider == valProviderId)
+            {
+            return ETrue;     
+            }
+        }
+    return EFalse;    
+    }
+    
+TBool CSenInternalWsPolicy::IsApplicableL(const TDesC8& aPolicyEndpoint)
+    {
+    CSenWSPolicyIdentifier& identifier = IdentifierL();
+
+        TPtrC8 valEndpoint = identifier.MetadataEndpointL();
+        if(valEndpoint == aPolicyEndpoint)
+        {
+            return ETrue;     
+        }
+    return EFalse;    
+    }
+
+TBool CSenInternalWsPolicy::IsApplicableL(CSenInternalWsPolicy* aInternalPolicy)
+{
+    CSenWSPolicyIdentifier& identifier = IdentifierL();
+    CSenWSPolicyIdentifier& id = aInternalPolicy->IdentifierL();
+
+        TPtrC8 valmetaEndpoint = identifier.MetadataEndpointL();
+        TPtrC8 metaendpoint = id.MetadataEndpointL();
+        TPtrC8 valEndpoint = identifier.EndpointL();
+        TPtrC8 endpoint = id.EndpointL();
+        TPtrC8 valcontract = identifier.ContractL();
+        TPtrC8 contract = id.ContractL();
+
+        if(valmetaEndpoint == metaendpoint &&
+        valEndpoint == endpoint &&
+        valcontract == contract)
+        {
+            return ETrue;     
+        }
+    return EFalse;    
+    
+}
+TInt CSenInternalWsPolicy::PolicyCountL()
+{
+    TInt count = 0;
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list = element.ElementsL();
+    CleanupClosePushL(list);
+    count = list.Count();
+    CleanupStack::PopAndDestroy(&list); // Close()
+    return count;
+    
+}
+TBool CSenInternalWsPolicy::UpdateMetadataEndpointL(CSenInternalWsPolicy* aInternalPolicy, TInt& aExist)
+    {
+//see if the New policy is in database
+//&aPolicy is new Policy
+//if the new policy is present and newer then the current -- we have to  replace  it
+//if the new policy is present and same then the current -- check expiry - if same then no replace
+//if the new policy dont have a policy then get the policy from here
+//if the new policy is same (from expiry time)
+
+    CSenWSPolicyIdentifier& newId = aInternalPolicy->IdentifierL();
+    CSenWSPolicyIdentifier& id = IdentifierL();
+    
+    if (IsApplicableL(aInternalPolicy))
+        {
+            aExist = KErrNone;
+            id.UpdateMetadataEndpointL(newId);
+            return ETrue;
+        }
+        return EFalse;
+    
+    }
+
+void CSenInternalWsPolicy::SetIdentifier(CSenWSPolicyIdentifier* aIdentifier)
+    {
+    if ( ipIdentifier )
+        {
+        delete ipIdentifier;
+        }
+
+    ipIdentifier = aIdentifier;
+    }
+
+CSenWSPolicyIdentifier& CSenInternalWsPolicy::IdentifierL()
+    {
+    if ( !ipIdentifier )
+        {
+        ipIdentifier = CSenWSPolicyIdentifier::NewL();
+        }
+
+    return *ipIdentifier;
+    }
+
+    
+void CSenInternalWsPolicy::SetSession(CSenServiceSession& aSession)
+    {
+    ipSession = &aSession;
+    }
+
+CSenServiceSession* CSenInternalWsPolicy::Session()
+    {
+    return ipSession;
+    }
+
+TPtrC8 CSenInternalWsPolicy::ExpiryTimeL(CSenElement* aElement)
+{
+    if(CSenWSPolicyIdentifier::HasAttributeL(aElement, KSenWSPolicyValidUntil))
+        {
+        return IdentifierL().ElementAttribValueL(aElement, KSenWSPolicyValidUntil);
+        }
+    
+    return KNullDesC8();        
+
+}
+TInt CSenInternalWsPolicy::AddMetadataPolicyL(CSenElement* aElement)
+{
+    if(aElement == NULL)
+        return KErrArgument;
+    
+    TInt retVal(KErrNotFound);
+    TPtrC8 metaendpoint = CWSPolicyUtils::PolicyUriL(aElement);
+    TPtrC8 expiry = ExpiryTimeL(aElement);
+    
+    CSenElement& ele = AsElement();
+    CSenElement* metaEndPointEle= IdentifierL().MetadataEndpointElementL();
+    if (metaEndPointEle)
+    {
+        //confirm if the expiry time is greater then current time
+        TTime now;
+        now.UniversalTime();
+        TTime validuntil = SenDateUtils::FromXmlDateTimeL(expiry);
+        if(validuntil > now)
+            {
+            SenXmlUtils::AddAttributeL(*metaEndPointEle, KSenWSPolicyValidUntil,expiry); 
+//Have to copy incase for multiple SDs have same policy
+//we cannot give ownership of Policy here so create a copy and dont take ownership
+            
+            CSenElement* copy = CSenXmlElement::NewL(aElement->LocalName());
+            copy->CopyFromL(*aElement);
+            ele.AddElementL(*copy);
+            retVal = KErrNone;
+            }
+    }
+
+    return retVal;
+}
+TInt CSenInternalWsPolicy::UpdateMetadataPolicyL(CSenElement* aElement)
+{
+
+    TInt retVal(KErrNotFound);
+    TPtrC8 metaendpoint = CWSPolicyUtils::PolicyUriL(aElement);
+    TPtrC8 newExpiry = ExpiryTimeL(aElement);
+    
+    CSenElement* metaEndPointEle= IdentifierL().MetadataEndpointElementL();
+             
+    CSenElement& ele = AsElement();
+    RPointerArray<CSenElement>& policyList = ele.ElementsL();
+   
+    TInt count2(policyList.Count());    //Now check for WSDL or wsp:Policy 
+    for(TInt i = 0; i < count2; i++)
+        {
+        CSenElement* docElement = policyList[i];
+        TPtrC8 currentExpiry = ExpiryTimeL(docElement);
+        TPtrC8 eleName = docElement->LocalName();
+        TPtrC8 eleNs = docElement->NsPrefix();
+        
+        if(eleName == KWsdlDocument && eleNs == KWsdlNsPrefix)
+            {
+            }
+        else if (eleName == KPolicyDocument && eleNs == KPolicyNsPrefix)
+            {
+            TPtrC8 doc_metaendpoint = CWSPolicyUtils::PolicyUriL(docElement);
+            
+            TTime now;
+            now.UniversalTime();
+            TBuf8<SenDateUtils::KXmlDateTimeMaxLength> nowtime;
+            TRAPD(error, SenDateUtils::ToXmlDateTimeUtf82L(nowtime, now);)
+            
+            if(error == KErrNone && metaEndPointEle && doc_metaendpoint == metaendpoint && 
+                        newExpiry > currentExpiry &&
+                        newExpiry > nowtime)
+                {
+                CSenElement* removed = ele.RemoveElement(*docElement);
+                delete removed;
+                removed = NULL;
+                
+                SenXmlUtils::AddAttributeL(*metaEndPointEle, KSenWSPolicyValidUntil,newExpiry); 
+//Have to copy incase for multiple SDs have same policy
+//we cannot give ownership of Policy here so create a copy and dont take ownership
+                CSenElement* copy = CSenXmlElement::NewL(aElement->LocalName());
+                copy->CopyFromL(*aElement);
+                ele.AddElementL(*copy);
+
+                retVal = KErrNone;
+                return retVal;
+                }
+            
+            }            
+        }
+
+
+
+    return retVal;
+}
+TInt CSenInternalWsPolicy::RemoveMetadataPolicyL(const TDesC8& aUri)
+{
+    TInt retVal(KErrNotFound);
+    CSenElement& ele = AsElement();
+    TPtrC8 endpoint = IdentifierL().MetadataEndpointL();
+    if(endpoint != aUri)
+    {
+        return retVal;
+    }
+    
+    CSenElement* metadataendpoint = IdentifierL().MetadataEndpointElementL();
+    if (metadataendpoint)
+    {
+        RPointerArray<CSenElement>& policyList = ele.ElementsL();
+        TInt policyCount(policyList.Count());
+        for(TInt i = 0; i< policyCount; i++)
+        {
+            CSenElement* policy = policyList[i];
+            TPtrC8 metaendpoint = CWSPolicyUtils::PolicyUriL(policy);
+            if(metaendpoint == aUri)
+            {
+                CSenElement* removed = ele.RemoveElement(*policy);
+                delete removed;
+                removed = NULL;
+                
+                retVal = KErrNone;
+                return retVal;
+            }
+        }
+    }
+    retVal = KErrNotFound;
+    return retVal;
+    
+}
+CSenElement* CSenInternalWsPolicy::WsPolicyByUriL(const TDesC8& aUri)
+{
+    CSenElement& ele = AsElement();
+    TPtrC8 uri = IdentifierL().MetadataEndpointL();
+    if(uri != aUri)
+    {
+        return NULL;
+    }
+    
+    RPointerArray<CSenElement>& policyList = ele.ElementsL();
+    TInt policyCount(policyList.Count());
+    for(TInt i = 0; i< policyCount; i++)
+    {
+        CSenElement* policy = policyList[i];
+        TPtrC8 metaendpoint = CWSPolicyUtils::PolicyUriL(policy);
+        if(metaendpoint == aUri)
+        {
+
+            return policy;
+        }
+    }
+    return NULL;
+    
+}
+CSenElement* CSenInternalWsPolicy::WsPolicyByName(const TDesC8& /*aName*/)
+{
+/*
+    CSenElement& ele = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+    TInt retVal = Identifier().MetadataEndpoint(list, aUri);
+    if (retVal == KErrNone)
+    {
+        TInt count(list.Count()); //we should al3ways have count "1"
+        if(count ==1) 
+        {
+            RPointerArray<CSenElement>& policyList = ele.ElementsL();
+            TInt policyCount(policyList.Count());
+            for(TInt i = 0; i< policyCount; i++)
+            {
+                CSenElement* policy = policyList[i];
+                TPtrC8 name = CWSPolicyUtils::PolicyNameL(policy);
+                if(name == aName)
+                {
+                    CleanupStack::PopAndDestroy(&list);
+                    return policy;
+                }
+                    
+            }
+                
+        }
+    }
+    CleanupStack::PopAndDestroy(&list);
+*/    
+    return NULL;
+    
+}
+TTime CSenInternalWsPolicy::ValidUntilL(const TDesC8& aUri)
+    {
+    TTime retTime = Time::NullTTime();
+    TInt retVal(KErrGeneral);
+
+    CSenElement& ele = AsElement();
+    TPtrC8 uri = IdentifierL().MetadataEndpointL();
+    if(uri != aUri)
+    {
+        return retTime;
+    }
+    
+    CSenElement* metaEndPointEle = IdentifierL().MetadataEndpointElementL();
+    if(metaEndPointEle)
+    {
+        TPtrC8 expiry = ExpiryTimeL(metaEndPointEle);
+        if(expiry.Length() > 0)
+            TRAP (retVal, retTime = SenDateUtils::FromXmlDateTimeL(expiry));
+    }
+    
+
+    if(retVal != KErrNone)
+        retTime = Time::NullTTime();
+        
+    return retTime;
+    
+    }
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+
+
+CSenWSPolicyProperties* CSenWSPolicyProperties::NewL()
+    {
+    CSenWSPolicyProperties* pNew = NewLC();
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenWSPolicyProperties* CSenWSPolicyProperties::NewLC()
+    {
+    CSenWSPolicyProperties* pNew = new (ELeave) CSenWSPolicyProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KSenWsPolicyProperteisLocalname);
+    return pNew;
+    }
+
+CSenWSPolicyProperties* CSenWSPolicyProperties::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenWSPolicyProperties* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenWSPolicyProperties* CSenWSPolicyProperties::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenWSPolicyProperties* pNew = new (ELeave) CSenWSPolicyProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+CSenWSPolicyProperties* CSenWSPolicyProperties::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            CSenElement& aParent)
+    {
+    CSenWSPolicyProperties* pNew = NewLC(aNsUri, aLocalName,
+                                           aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenWSPolicyProperties* CSenWSPolicyProperties::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            CSenElement& aParent)
+    {
+    CSenWSPolicyProperties* pNew = new (ELeave) CSenWSPolicyProperties;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+CSenWSPolicyProperties::~CSenWSPolicyProperties()
+    {
+    }
+
+CSenWSPolicyProperties::CSenWSPolicyProperties()
+    {
+    }
+
+TInt CSenWSPolicyProperties::SetPropertyL(const TDesC8& aName,
+                                                         const TDesC8& aValue)
+    {
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, aName);
+
+    if ( list.Count() > 0 )
+        {
+        CSenElement* firstElement = list[0];
+        firstElement->SetContentL(aValue);
+        CleanupStack::PopAndDestroy(&list); 
+        
+        return KErrNone;
+        }
+    CleanupStack::PopAndDestroy(&list);
+
+    CSenElement& newElement = element.AddElementL(aName);
+    newElement.SetContentL(aValue);
+    return KErrNone;
+    }
+
+TInt CSenWSPolicyProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+    {
+    TInt retVal(KErrNone);
+
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, aName);
+
+    if ( list.Count() > 0 )
+        {
+        CSenElement* firstElement = list[0];
+        if(firstElement->HasContent())
+            aValue.Set(firstElement->Content());
+        }
+    else
+        {
+        retVal = KErrNotFound;
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    return retVal;
+    }
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+CSenWSPolicyIdentifier* CSenWSPolicyIdentifier::NewL()
+    {
+    CSenWSPolicyIdentifier* pNew = NewLC();
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenWSPolicyIdentifier* CSenWSPolicyIdentifier::NewLC()
+    {
+    CSenWSPolicyIdentifier* pNew = new (ELeave) CSenWSPolicyIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(KSenWsPolicyIdentifierLocalname);
+    return pNew;
+    }
+
+CSenWSPolicyIdentifier* CSenWSPolicyIdentifier::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenWSPolicyIdentifier* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenWSPolicyIdentifier* CSenWSPolicyIdentifier::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenWSPolicyIdentifier* pNew = new (ELeave) CSenWSPolicyIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+CSenWSPolicyIdentifier* CSenWSPolicyIdentifier::NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            CSenElement& aParent)
+    {
+    CSenWSPolicyIdentifier* pNew = NewLC(aNsUri, aLocalName,
+                                           aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenWSPolicyIdentifier* CSenWSPolicyIdentifier::NewLC(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes,
+                                            CSenElement& aParent)
+    {
+    CSenWSPolicyIdentifier* pNew = new (ELeave) CSenWSPolicyIdentifier;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+CSenWSPolicyIdentifier::~CSenWSPolicyIdentifier()
+    {
+    }
+
+CSenWSPolicyIdentifier::CSenWSPolicyIdentifier()
+    {
+    }
+
+void CSenWSPolicyIdentifier::SetIdL(TInt aId)
+    {
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KSenWSPolicyId);
+
+    CSenElement* idElement;
+    if ( list.Count() > 0 )
+        {
+        idElement = list[0];
+        }
+    else
+        {
+        idElement = &element.AddElementL(KSenWSPolicyId);
+        }
+
+    TBuf8<KFlatBufSize> buffer;
+    buffer.Num(aId);
+    idElement->SetContentL(buffer);
+
+    CleanupStack::PopAndDestroy(&list); 
+    }
+
+TInt CSenWSPolicyIdentifier::IdL()
+    {
+    TInt retVal(KErrNotFound);
+
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KSenWSPolicyId);
+
+    if ( list.Count() > 0 )
+        {
+        CSenElement* idElement = list[0];
+        if(idElement->HasContent())
+            {
+            TLex8 lex;
+            lex.Assign(idElement->Content());
+            lex.Val( retVal );
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&list); 
+
+    return retVal;
+    }
+TPtrC8 CSenWSPolicyIdentifier::ContractL()
+{
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KContractLocalname);
+    
+    if ( list.Count() > 0 )
+        {
+        CSenElement* idElement = list[0];
+        CleanupStack::PopAndDestroy(&list); 
+        if(idElement->HasContent())
+            return idElement->Content();
+       else
+            return KNullDesC8();           
+        
+        }
+
+    CleanupStack::PopAndDestroy(&list); 
+
+    return KNullDesC8();
+    
+}
+TPtrC8 CSenWSPolicyIdentifier::EndpointL()
+{
+    
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KEndpointLocalname);
+    
+    if ( list.Count() > 0 )
+        {
+        CSenElement* idElement = list[0];
+        CleanupStack::PopAndDestroy(&list); 
+       if(idElement->HasContent())
+            return idElement->Content();
+       else
+            return KNullDesC8();           
+
+        }
+
+    CleanupStack::PopAndDestroy(&list); 
+
+    return KNullDesC8();
+    
+}
+TPtrC8 CSenWSPolicyIdentifier::MetadataEndpointL()
+{
+
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KMetadataEndpointLocalname);
+    
+    if ( list.Count() > 0 )
+        {
+        CSenElement* idElement = list[0];
+        CleanupStack::PopAndDestroy(&list); 
+       if(idElement->HasContent())
+            return idElement->Content();
+       else
+            return KNullDesC8();           
+
+        }
+
+    CleanupStack::PopAndDestroy(&list); 
+
+    return KNullDesC8();    
+    
+}
+CSenElement* CSenWSPolicyIdentifier::MetadataEndpointElementL()
+{
+
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KMetadataEndpointLocalname);
+    
+    if ( list.Count() > 0 )
+        {
+        CSenElement* idElement = list[0];
+        CleanupStack::PopAndDestroy(&list); 
+       if(idElement->HasContent())
+            return idElement;
+       else
+            return NULL;
+
+        }
+
+    CleanupStack::PopAndDestroy(&list); 
+
+    return NULL;    
+    
+}
+
+TPtrC8 CSenWSPolicyIdentifier::ProviderIdL()
+{
+
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+
+    element.ElementsL(list, KProviderIdLocalName);
+    
+    if ( list.Count() > 0 )
+        {
+        CSenElement* idElement = list[0];
+        CleanupStack::PopAndDestroy(&list); 
+       if(idElement->HasContent())
+            return idElement->Content();
+       else
+            return KNullDesC8();           
+
+        }
+
+    CleanupStack::PopAndDestroy(&list); 
+
+    return KNullDesC8();    
+}
+TPtrC8 CSenWSPolicyIdentifier::ElementAttribValueL(CSenElement* aElement, const TDesC8& aName)
+{
+
+    if(aElement == NULL || aName.Length() == NULL) { return KNullDesC8(); }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aElement->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(aName) == 0)
+            {
+                 return bs->Value();
+            }
+         }
+
+            
+        }
+    return KNullDesC8();
+}
+TBool CSenWSPolicyIdentifier::HasAttributeL(CSenElement* aElement, const TDesC8& aName)
+{
+     if(aElement == NULL || aName.Length() == NULL) { return EFalse; }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aElement->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(aName) == 0)
+            {
+                 return ETrue;
+            }
+         }
+
+            
+        }
+    return EFalse;
+    
+}
+
+TInt CSenWSPolicyIdentifier::AddMetadataEndpointL(CSenElement* aElement)
+{
+
+    if(aElement == NULL || aElement->HasContent() == EFalse)
+        return KErrArgument;
+
+//get the method    
+    TPtrC8 ptrMethod = ElementAttribValueL(aElement, KMetadataMethodLocalname);
+//now compare the two Metadata endpoints
+    CSenElement& element = AsElement();
+    RPointerArray<CSenElement> list;
+    CleanupClosePushL(list);
+    element.ElementsL(list, aElement->LocalName());
+    TInt count = list.Count();
+    
+    if(count == 0)    
+        {
+        CSenElement& newElement = element.AddElementL(aElement->LocalName());
+        newElement.SetContentL(aElement->Content());
+        if(ptrMethod.Length() > 0)
+            SenXmlUtils::AddAttributeL(newElement, KMetadataMethodLocalname, ptrMethod);
+        CleanupStack::PopAndDestroy(&list);
+        return KErrNone;
+        }
+    
+    for(TInt i = 0; i < count; i++)
+        {
+        CSenElement* firstElement = list[i];
+        if(firstElement->Content() == aElement->Content())
+            {
+            
+            TPtrC8 firstMethod = ElementAttribValueL(firstElement, KMetadataMethodLocalname);            
+            if (ptrMethod.Compare(firstMethod) == 0 )
+                {
+                CleanupStack::PopAndDestroy(&list); // Close()
+                //exactly Same so no need to add again                        
+                return KErrNone;
+                }
+            }
+            
+        }
+
+    CleanupStack::PopAndDestroy(&list);
+    
+    CSenElement& newElement = element.AddElementL(aElement->LocalName());
+    newElement.SetContentL(aElement->Content());
+    if(ptrMethod.Length() > 0)
+        SenXmlUtils::AddAttributeL(newElement, KMetadataMethodLocalname, ptrMethod);
+
+    return KErrNone;
+    
+    
+}
+
+TInt CSenWSPolicyIdentifier::UpdateMetadataEndpointL(CSenWSPolicyIdentifier& aIdentifier)
+{
+
+//now compare contents and then compare attributes
+    TInt retVal = KErrNotFound;
+    TPtrC8 endpoint = MetadataEndpointL();
+    TPtrC8 canEndPoint = aIdentifier.MetadataEndpointL();
+    if(endpoint == canEndPoint)
+        {
+        CSenElement* ele1 = MetadataEndpointElementL();        
+        CSenElement* ele2 = aIdentifier.MetadataEndpointElementL();
+
+        if(ele1 && ele2 && ele1->HasContent()) //&& ele2->HasContent())
+        //no need to verify this as important thing is that new content has Contents
+        {
+            //if Endpoint URi is same
+            if(ele1->Content() == ele2->Content())
+                {
+                if(HasAttributeL(ele1, KMetadataMethodLocalname))
+                    {
+                    TPtrC8 val1 =  ElementAttribValueL(ele1, KMetadataMethodLocalname);
+                      
+                    if(HasAttributeL(ele2, KMetadataMethodLocalname))
+                        {
+                        TPtrC8 val2 =  ElementAttribValueL(ele2, KMetadataMethodLocalname) ; 
+                        if(val1.Compare(val2) != 0)
+                            {
+                            //replace the Attribute with a newer Value
+                             ele2->AddAttrL(KMetadataMethodLocalname,val1);
+                             retVal = KErrNone;
+                            }
+                        }
+                    }                
+                }        
+        }
+        }
+    return retVal;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+
+
+void RSenWSPolicyPtr::OpenL(CSenInternalWsPolicy* apPolicy)
+    {
+    ipPolicyData = new (ELeave) TSenWsPolicyData;
+    ipPolicyData->iCounter = 1;
+    ipPolicyData->ipPolicy = apPolicy;
+    }
+    
+CSenInternalWsPolicy* RSenWSPolicyPtr::Policy()
+    {
+    if ( ipPolicyData )
+        {
+        return ipPolicyData->ipPolicy;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+    
+void RSenWSPolicyPtr::SetPolicy(CSenInternalWsPolicy* apPolicy)
+    {
+    if ( ipPolicyData )
+        {
+        delete ipPolicyData->ipPolicy;
+        ipPolicyData->ipPolicy = apPolicy;
+        }
+    }
+    
+RSenWSPolicyPtr RSenWSPolicyPtr::Clone()
+    {
+    if ( ipPolicyData )
+        {
+        (ipPolicyData->iCounter)++;
+        }
+    return *this;
+    }
+    
+void RSenWSPolicyPtr::Close()
+    {
+    if ( ipPolicyData )
+        {
+
+        (ipPolicyData->iCounter)--;
+        if ( ipPolicyData->iCounter == 0 )
+            {
+            TRAP_IGNORE( ipPolicyData->ipPolicy->IdentifierL().ExtractElement(); )
+            ipPolicyData->ipPolicy->ExtractElement();
+            delete ipPolicyData->ipPolicy;
+            delete ipPolicyData;
+            }
+
+        ipPolicyData = NULL;
+        }
+    }
+
+void RSenWSPolicyPtr::CloseAndDestroyPolicy()
+    {
+    if ( ipPolicyData )
+        {
+        TRAP_IGNORE( ipPolicyData->ipPolicy->IdentifierL().ExtractElement(); )
+        ipPolicyData->ipPolicy->ExtractElement();
+        delete ipPolicyData->ipPolicy;
+        ipPolicyData->ipPolicy = NULL;
+        
+        (ipPolicyData->iCounter)--;
+        if ( ipPolicyData->iCounter == 0 )
+            {
+            delete ipPolicyData;
+            }
+
+        ipPolicyData = NULL;
+        }
+    }
+    
+RSenWSPolicyPtr::RSenWSPolicyPtr()
+: ipPolicyData(NULL)
+    {
+    }
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/senwspolicymanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1964 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include "senwspolicymanager.h"
+#include "seninternalwspolicy.h"
+
+#include <s32mem.h>
+#include <s32file.h>
+#include <sysutil.h>
+#include <SenFacet.h>
+#include <SenXmlUtils.h>
+#include "sendebug.h"               // internal \Utils\inc - filelogging MACROs
+#include "msencoreservicemanager.h" // internal \Framework\inc
+#include "SenParser.h"
+#include "SenDateUtils.h"
+#include "senservicepolicy.h"
+#include "wspolicyutils.h"
+#include "wspolicy.h"
+#include "senguidgen.h"
+#include "senxmldebug.h"
+#include "senlogger.h"
+
+
+#include <SenServiceConnection.h> 
+#include <xmlengnodelist.h> 
+using namespace WSPolicy;
+using namespace SenWSInternalPolicy;
+namespace
+    {
+#if !defined( EKA2 ) && !defined( RD_SECURE_PRIV_DATA )
+    _LIT(KWsPolicyFile,           "C:\\system\\data\\senwspolicies.xml");
+#else
+    _LIT(KWsPolicyFile,           "senwspolicies.xml");
+#endif
+
+    const TInt KStateParsingContainer   = 99;
+    const TInt KStateParsingIdentifier  = 100;
+    const TInt KStateParsingProperties  = 102;
+    const TInt KStateParsingPolicy            = 104;
+    const TInt KFlatBufSize                       = 128;
+    
+    const TUint KValidityTime = +7;
+    
+    }
+
+
+
+
+EXPORT_C CSenWSPolicyManager* CSenWSPolicyManager::NewL(MSenCoreServiceManager& aManager)
+    {
+    CSenWSPolicyManager* pNew = NewLC(aManager);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+       
+    }
+
+EXPORT_C CSenWSPolicyManager* CSenWSPolicyManager::NewLC(MSenCoreServiceManager& aManager)
+    {
+    CSenWSPolicyManager* pNew = new (ELeave) CSenWSPolicyManager(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    
+    }
+
+EXPORT_C CSenWSPolicyManager::~CSenWSPolicyManager()
+    {
+    delete iPolicDataLoader;
+    iPolicyArray.ResetAndDestroy();
+    iConsumerArray.ResetAndDestroy();
+
+    }
+CSenWSPolicyManager::CSenWSPolicyManager(MSenCoreServiceManager& aManager) 
+:iManager(aManager),
+iLog((RFileLogger*)aManager.Log())
+    {
+    
+    }
+void CSenWSPolicyManager::ConstructL()
+    {
+        iPolicDataLoader  = CSenWSPolicyLoader::NewL(iManager);
+        RefreshPolicyContainerL();	//codescannerwarnings
+    }
+RFileLogger* CSenWSPolicyManager::Log()
+    {
+    return iLog;
+    }
+
+EXPORT_C TInt CSenWSPolicyManager::RegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::RegisterWsPolicyL");                
+        TInt retVal(KErrGeneral);
+        if(iPolicDataLoader == NULL)
+        {
+          iPolicDataLoader  = CSenWSPolicyLoader::NewL(iManager);
+        }
+        
+        retVal = iPolicDataLoader->RegisterWsPolicyL(aPattern, aErrorTo);
+        
+        if(retVal == KErrNone)
+            RefreshPolicyContainerL();	//codescannerwarnings
+        
+        if(iPolicDataLoader)
+        {
+            delete iPolicDataLoader;
+            iPolicDataLoader = NULL;
+        }
+        return retVal;
+    }
+
+EXPORT_C TInt CSenWSPolicyManager::UnRegisterWsPolicyL(CSenWSDescription* aPattern, 
+                                                        TInt& aErrorTo)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::UnRegisterWsPolicyL");
+        TInt retVal(KErrGeneral);
+        if(iPolicDataLoader == NULL)
+        {
+          iPolicDataLoader  = CSenWSPolicyLoader::NewL(iManager);
+        }
+        
+        retVal = iPolicDataLoader->UnRegisterWsPolicyL(aPattern, aErrorTo);
+        
+        if(retVal == KErrNone)
+            RefreshPolicyContainerL();	//codescannerwarnings
+        
+        if(iPolicDataLoader)
+        {
+            delete iPolicDataLoader;
+            iPolicDataLoader = NULL;
+        }
+        return retVal;
+    
+}
+
+EXPORT_C TInt CSenWSPolicyManager::AddWsPolicyL(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::AddWsPolicyL");        
+        TInt retVal(KErrGeneral);
+        if(iPolicDataLoader == NULL)
+        {
+          iPolicDataLoader  = CSenWSPolicyLoader::NewL(iManager);
+        }
+        
+        retVal = iPolicDataLoader->AddWsPolicyL(aPattern, aUri, aPolicy, aErrorTo);
+        if(retVal == KErrNone)
+            RefreshPolicyContainerL();	//codescannerwarnings
+        
+        if(iPolicDataLoader)
+        {
+            delete iPolicDataLoader;
+            iPolicDataLoader = NULL;
+        }
+        return retVal;
+    
+    }
+
+EXPORT_C TInt CSenWSPolicyManager::RemoveWsPolicyL( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo)
+    {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::RemoveWsPolicyL");
+        TInt retVal(KErrGeneral);
+        if(iPolicDataLoader == NULL)
+        {
+          iPolicDataLoader  = CSenWSPolicyLoader::NewL(iManager);
+        }
+        
+        retVal = iPolicDataLoader->RemoveWsPolicyL(aPattern, aUri, aErrorTo);
+        
+        if(retVal == KErrNone)
+            RefreshPolicyContainerL();  //codescannerwarnings
+        
+        if(iPolicDataLoader)
+        {
+            delete iPolicDataLoader;
+            iPolicDataLoader = NULL;
+        }
+        return retVal;
+    
+    }
+TInt CSenWSPolicyManager::IsConsumerExist(const TDesC8& aEndpoint, const TDesC8& aConsumerId)
+{
+    TInt count(iConsumerArray.Count());
+    for(TInt i = 0; i< count; i++)
+    {
+        CConsumerContainer* consumer = iConsumerArray[i];
+        if(consumer->Uri() == aEndpoint && consumer->ConsumerId() == aConsumerId)
+            return i;
+    }
+    return KErrNotFound;
+}
+TInt CSenWSPolicyManager::PolicyConsumerCountL(CSenInternalWsPolicy* aInternalPolicy)	//codescannerwarnings
+	{
+    TInt retVal(KErrNone);
+	if (aInternalPolicy)
+		{
+	    TPtrC8 metadata = aInternalPolicy->IdentifierL().MetadataEndpointL();	//codescannerwarnings
+	    TInt count(iConsumerArray.Count());
+	    for(TInt i = 0; i< count; i++)
+			{
+			CConsumerContainer* consumer = iConsumerArray[i];
+			if(consumer->Uri() == metadata)
+			    retVal++;
+			}
+		}    
+    return retVal;
+	}
+
+EXPORT_C TInt CSenWSPolicyManager::AddPolicyConsumerL(const TDesC8& aUri, const TDesC8& aConsumerId)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::AddPolicyConsumerL");
+    
+    TInt indx = IsConsumerExist(aUri,aConsumerId);
+    if(indx == KErrNotFound)
+    {
+        CConsumerContainer* consumer = CConsumerContainer::NewL(aUri,aConsumerId);    
+        if(consumer) 
+        {
+            iConsumerArray.Append(consumer);
+            RefreshPolicyContainerL();	//codescannerwarnings
+        }
+        else
+        {
+            
+        }
+            
+        
+    }
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWSPolicyManager::RemovePolicyConsumerL(const TDesC8& aUri, const TDesC8& aConsumerId)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::RemovePolicyConsumerL");
+    TInt indx = IsConsumerExist(aUri,aConsumerId);
+    if(indx > KErrNotFound)
+        {
+        CConsumerContainer* consumer = iConsumerArray[indx];
+        if(consumer) 
+            {
+            TInt count (iPolicyArray.Count());
+            for(TInt i = 0; i< count; i++)
+                {
+                CNormalizedPolicyConatiner* container =  iPolicyArray[i];
+                if(container->IsSameContainer(aUri))
+                   {
+                    container->CountDec();
+                    if(container->ConsumerCount() < 1)
+                        { //we no longer ahve any consumer for this conatiner
+                        iPolicyArray.Remove(i);
+                        delete container;
+                        container = NULL;
+                        }
+                    }
+            }
+            iConsumerArray.Remove(indx);
+            delete consumer;
+            consumer = NULL;
+            return KErrNone;
+            }
+        }
+    return KErrNotFound;
+    }
+
+EXPORT_C CSenElement*  CSenWSPolicyManager::WsPolicyL( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo)
+    {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::WsPolicyL");
+        aErrorTo = KErrNotFound;
+        CSenElement* ele = NULL;
+
+        if(aPattern == NULL && aUri.Length() > 0) //special case for MS
+            {
+            TInt count (iPolicyArray.Count());
+            for(TInt i = 0; i< count; i++)
+                {
+                CNormalizedPolicyConatiner* container =  iPolicyArray[i];
+                if(container->URI() == aUri)
+                    {
+                    aErrorTo = KErrNone;
+                    return container->Policy();
+                    }
+                }
+                
+            }
+    
+        if(aUri.Length() == 0)
+            {
+            ele = PolicyFromSDL(aPattern);	//codescannerwarnings
+            }
+        else
+            {
+            ele = PolicyFromUri(aPattern, aUri);   
+            }
+         
+        
+        if(ele != NULL)
+            aErrorTo = KErrNone;
+        
+        return ele;
+    }
+    
+CSenElement* CSenWSPolicyManager::PolicyByProviderId(const TDesC8& aProviderId, TInt&  aErrorTo)
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::PolicyByProviderId");
+    TInt count (iPolicyArray.Count());
+    for(TInt i = 0; i< count; i++)
+    {
+       CNormalizedPolicyConatiner* container =  iPolicyArray[i];
+       if(container->ProviderId() == aProviderId)
+       {
+       CSenElement* ele = container->Policy();
+       if(ele)
+           {
+            aErrorTo = KErrNone;
+            return ele;
+           }
+       }
+    }
+    aErrorTo = KErrNotFound;
+    return NULL;
+  
+}
+
+CSenElement* CSenWSPolicyManager::PolicyFromUri(CSenWSDescription* /*aPolicy*/, const TDesC8& aUri)
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::PolicyFromUri");
+    TInt count (iPolicyArray.Count());
+    for(TInt i = 0; i< count; i++)
+    {
+       CNormalizedPolicyConatiner* container =  iPolicyArray[i];
+       if(container->IsSameContainer(aUri))
+       {
+        return container->Policy();
+       }
+    }
+    return NULL;
+}
+
+CSenElement* CSenWSPolicyManager::PolicyFromSDL(CSenWSDescription* aPolicy)	//codescannerwarnings
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::PolicyFromSD");
+
+    if( aPolicy )
+        {
+        CSenServicePolicy* pol = (CSenServicePolicy*)aPolicy->ServicePolicy();
+        CSenElement& servicePolicy = pol->AsElement();
+        CSenElement* clientPolicy = servicePolicy.Element( KClientPolicyLocalName );
+        if(clientPolicy)
+            {
+            RPointerArray<CSenElement> metaDataPoliciesUris;
+            CleanupClosePushL(metaDataPoliciesUris);
+            clientPolicy->ElementsL(metaDataPoliciesUris, KMetadataEndpointLocalname);
+            TInt count(metaDataPoliciesUris.Count());
+            if(count> 0)
+                {
+                CSenElement* metaData = NULL;
+                for(TInt i=0; i<count; i++)
+                    {
+                    metaData = metaDataPoliciesUris[i];
+                    if(metaData && metaData->HasContent())
+                        {
+                         TPtrC8 uriName = metaData->Content();
+                         CleanupStack::PopAndDestroy(&metaDataPoliciesUris);            
+                         return PolicyFromUri(aPolicy, uriName);                   
+                        }
+                    }
+                }
+             CleanupStack::PopAndDestroy(&metaDataPoliciesUris);            
+            }
+        }
+    return NULL;
+    }
+
+
+TInt CSenWSPolicyManager::UpdatePolicyContainerL(CSenInternalWsPolicy* aInternalPolicy) //codescannerwarnings
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::UpdatePolicyContainer");
+        TInt indx(IsContainerL(aInternalPolicy));
+        CNormalizedPolicyConatiner* container =  iPolicyArray[indx];
+        if(container && container->URI().Compare(aInternalPolicy->IdentifierL().MetadataEndpointL()) == 0)	//codescannerwarnings
+        {
+            TBool retval = container->UpdateL(aInternalPolicy);
+            container->SetConsumerCount(PolicyConsumerCountL(aInternalPolicy));//codescannerwarnings
+            return KErrNone;
+        }
+    return KErrNotFound;
+    
+    }
+TInt CSenWSPolicyManager::IsContainerL(CSenInternalWsPolicy* aInternalPolicy) //codescannerwarnings
+    {
+    TInt count (iPolicyArray.Count());
+    for(TInt i = 0; i< count && aInternalPolicy; i++)
+    {
+        CNormalizedPolicyConatiner* container =  iPolicyArray[i];
+        TPtrC8 endpoint = aInternalPolicy->IdentifierL().MetadataEndpointL();	//codescannerwarnings
+        if(container)
+        {
+            if(container->URI().Compare(endpoint) == 0)
+                return i;
+        }
+    }
+    return KErrNotFound;
+    
+    }    
+    
+TInt CSenWSPolicyManager::CreatePolicyContainerL(CSenInternalWsPolicy* aInternalPolicy)	//codescannerwarnings
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::CreatePolicyContainer");
+    TInt retVal(KErrNone);
+    TInt indx = IsContainerL(aInternalPolicy);	//codescannerwarnings
+    if(indx == KErrNotFound)
+        {
+        TPtrC8 metaendpoint = aInternalPolicy->IdentifierL().MetadataEndpointL();	//codescannerwarnings
+        CSenElement* metadta = aInternalPolicy->IdentifierL().MetadataEndpointElementL();	//codescannerwarnings
+        {
+        
+        if(metadta && metadta->HasContent())
+            {
+            TPtrC8 endpoint = metadta->Content();
+            CNormalizedPolicyConatiner* container = 
+            CNormalizedPolicyConatiner::NewL(aInternalPolicy, endpoint);
+            TPtrC8 metaendpoint = aInternalPolicy->IdentifierL().MetadataEndpointL();	//codescannerwarnings
+            
+            if(container && container->IsSameContainer(metaendpoint))
+                {
+                container->UpdateL(aInternalPolicy);
+                retVal = iPolicyArray.Append(container);
+                }
+
+            }
+        }
+        
+        }
+    return retVal;
+    
+    }    
+
+TInt CSenWSPolicyManager::RefreshPolicyContainerL()	//codescannerwarnings
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::RefreshPolicyContainer");
+    TInt retVal(KErrGeneral);
+    if(iPolicDataLoader == NULL)
+        {
+        iPolicDataLoader  = CSenWSPolicyLoader::NewL(iManager);
+        }
+        
+    RSenWSPolicyArray policies;
+    CleanupClosePushL(policies);
+    retVal = iPolicDataLoader->InternalWsPoliciesL(policies);
+    if(retVal == KErrNone)
+        {
+        TInt count(policies.Count());
+        for(TInt i = 0; i< count; i++)
+            {
+            CSenInternalWsPolicy* policy =  policies[i];
+            TInt consumerCount = PolicyConsumerCountL(policy);//codescannerwarnings
+            if( consumerCount > 0)
+            {
+            //for every internal policy we should have a container here            
+            if(policy && IsContainerL(policy) != KErrNotFound)	//codescannerwarnings
+                {//We have alreadya  containere
+                // we already have this Policy container
+                // we just got a new consumer for this policy
+                // so the count will be increased
+                retVal = UpdatePolicyContainerL(policy); //codescannerwarnings
+                if(retVal == KErrNone)
+                { //we got proper update
+                    
+                }
+                }
+            else
+                {//create a new container
+				retVal = CreatePolicyContainerL(policy); //codescannerwarnings
+                }
+                
+            }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(&policies);
+    
+    if(iPolicDataLoader)
+        {
+        delete iPolicDataLoader;
+        iPolicDataLoader = NULL;
+        }
+
+    return retVal;
+        
+    }
+
+EXPORT_C TInt CSenWSPolicyManager::ExpiredPoliciesL(RExpiredPolicyArray& aArray,  TInt& aErrorTo)
+{
+TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyManager::ExpiredPoliciesL");    
+    TTime now;
+    now.UniversalTime();
+    
+    TInt count (iPolicyArray.Count());
+    
+    for(TInt i = 0; i< count; i++)
+    {
+        CNormalizedPolicyConatiner* container =  iPolicyArray[i];
+        if(container && container->ValidUntil() < now)
+        {
+            CExpiredPolicy* expir = CExpiredPolicy::NewL(container->Contract(),
+                                                    container->Endpoint(),
+                                                    container->URI(), container->ProviderId()); 
+            if(expir)                                                    
+            {
+                aArray.Append(expir);
+                aErrorTo = KErrNone;
+            }
+        }
+    }
+    
+    if(aArray.Count() > 0)
+        return KErrNone;
+    else
+        return KErrNotFound;
+    
+}
+
+TInt CSenWSPolicyManager::AddWsPolicy1L(CSenWSDescription* aPattern, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo)
+{
+    return AddWsPolicyL(aPattern, aUri, aPolicy, aErrorTo);   
+}
+
+TInt CSenWSPolicyManager::RemoveWsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo)
+{
+    return RemoveWsPolicyL(aPattern, aUri, aErrorTo);  
+}
+                                                                                                                                                                                               
+TInt CSenWSPolicyManager::RegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+{
+   return RegisterWsPolicyL(aPattern, aErrorTo);   
+}
+
+TInt CSenWSPolicyManager::UnRegisterWsPolicy1L(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+{
+    return UnRegisterWsPolicyL(aPattern, aErrorTo);  
+}
+                                                    
+CSenElement*  CSenWSPolicyManager::WsPolicy1L( CSenWSDescription* aPattern, 
+                                                const TDesC8& aUri, TInt& aErrorTo)
+{
+    return WsPolicyL(aPattern, aUri, aErrorTo);  
+}
+
+CSenElement*  CSenWSPolicyManager::WsPolicy1L( CSenWSDescription* aPattern, 
+                                                TInt& aErrorTo)
+{
+    return WsPolicyL(aPattern, KNullDesC8(), aErrorTo);  
+}
+CSenElement*  CSenWSPolicyManager::WsPolicy1L( const TDesC8& aProviderId, TInt& aErrorTo)
+{
+    return PolicyByProviderId(aProviderId, aErrorTo);
+}
+TInt CSenWSPolicyManager::AddPolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    return AddPolicyConsumerL(aUri,aConsumerId);    
+}
+
+TInt CSenWSPolicyManager::RemovePolicyConsumer1L(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    return RemovePolicyConsumerL(aUri,aConsumerId);    
+}
+
+
+CNormalizedPolicyConatiner* CNormalizedPolicyConatiner::NewL(CSenInternalWsPolicy* aPolicy, const TDesC8& aUri)
+    {
+    CNormalizedPolicyConatiner* pNew = CNormalizedPolicyConatiner::NewLC(aPolicy, aUri);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+        
+    }
+CNormalizedPolicyConatiner* CNormalizedPolicyConatiner::NewLC(CSenInternalWsPolicy* aPolicy, const TDesC8& aUri)
+    {
+    CNormalizedPolicyConatiner* pNew = new (ELeave) CNormalizedPolicyConatiner();
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aPolicy, aUri);
+    return pNew;
+ 
+    }
+CNormalizedPolicyConatiner::~CNormalizedPolicyConatiner()
+    {
+    delete iContract; 
+    delete iEndpoint; 
+    delete iUri; 
+    delete iProviderId;
+    delete iPolicy;
+    }
+CNormalizedPolicyConatiner::CNormalizedPolicyConatiner()
+    {
+        
+    }
+void CNormalizedPolicyConatiner::ConstructL(CSenInternalWsPolicy* aPolicy, const TDesC8& aUri)
+    {
+    TPtrC8 contract = aPolicy->IdentifierL().ContractL();	//codescannerwarnings
+    TPtrC8 endpoint = aPolicy->IdentifierL().EndpointL();	//codescannerwarnings
+    TPtrC8 providerId = aPolicy->IdentifierL().ProviderIdL();	//codescannerwarnings
+    TTime valid = aPolicy->ValidUntilL(aUri);
+    
+    iCount = 1;
+    iContract = contract.AllocL();
+    iEndpoint = endpoint.AllocL();
+    iProviderId= providerId.AllocL();
+    iUri = aUri.AllocL();
+    iValidUntil = valid;
+    }
+
+TBool CNormalizedPolicyConatiner::UpdateL(CSenInternalWsPolicy* aInternalPolicy)
+    {
+    TTime valid = aInternalPolicy->ValidUntilL(URI());
+    CSenElement* normPolicy = NULL;
+    if(valid  > iValidUntil ) //we have new expiry time
+    {
+        CSenElement*  policy = aInternalPolicy->WsPolicyByUriL(URI());
+        TInt length = 0;
+        if(policy)
+        {
+        CBufFlat* pBuf = NULL;
+        pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+        policy->WriteAsXMLToL(bufWs);
+        TPtr8 p8 = pBuf->Ptr(0);
+        length = p8.Length();
+        CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+        }
+
+        if(length < 100000)        
+        {
+        CWSPolicy* wspolicy = CWSPolicy::NewLC();
+        TRAPD(error, normPolicy = wspolicy->NormalizePolicy2L(*policy, NULL);)
+        
+        CleanupStack::PopAndDestroy(wspolicy);
+        if(error == KErrNone && normPolicy)
+        {
+            if(iPolicy)
+                delete iPolicy;
+            
+            iPolicy = normPolicy;
+            iValidUntil   = valid;            
+            return ETrue;            
+        }
+        //set this policy as new policy
+    }
+    }
+    else if(valid == iValidUntil)
+    {
+        if(iPolicy == NULL)
+        {
+        CSenElement*  policy = aInternalPolicy->WsPolicyByUriL(URI());
+        TInt length = 0;
+        if(policy)
+        {
+        CBufFlat* pBuf = NULL;
+        pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        RBufWriteStream bufWs(*pBuf);
+        CleanupClosePushL(bufWs);
+        policy->WriteAsXMLToL(bufWs);
+        TPtr8 p8 = pBuf->Ptr(0);
+        length = p8.Length();
+        CleanupStack::PopAndDestroy(2); // bufWs (close), pBuf
+        }
+
+        if(length < 100000)        
+        {
+        CWSPolicy* wspolicy = CWSPolicy::NewLC();
+        TRAPD(error, normPolicy = wspolicy->NormalizePolicy2L(*policy, NULL);)    
+        CleanupStack::PopAndDestroy(wspolicy);
+        if(error == KErrNone && normPolicy)
+        {            
+            iPolicy = normPolicy;
+            iValidUntil   = valid;            
+            return ETrue;            
+        }
+        //set this policy as new policy
+            
+        }
+    }
+    }
+    return EFalse;
+    }   
+TBool CNormalizedPolicyConatiner::IsSameContainer(const TDesC8& aUri)
+    {
+    
+    if(aUri.Compare(URI()) == 0)
+        {
+            return ETrue;    
+        }
+       return EFalse;
+    }
+void CNormalizedPolicyConatiner::CountInc()
+{
+    iCount++;    
+}
+void CNormalizedPolicyConatiner::CountDec()
+{
+    iCount--;
+    if(iCount < 0)
+        iCount = 0;
+}
+void CNormalizedPolicyConatiner::SetConsumerCount(TInt aCount)
+{
+    iCount = aCount;
+}
+TInt  CNormalizedPolicyConatiner::ConsumerCount()
+    {
+    return iCount;
+    }
+TPtrC8  CNormalizedPolicyConatiner::Contract()
+    {
+    return iContract->Des();
+    }
+TPtrC8  CNormalizedPolicyConatiner::Endpoint()
+    {
+    return iEndpoint->Des();
+    }
+TPtrC8  CNormalizedPolicyConatiner::ProviderId()
+    {
+    return iProviderId->Des();
+    }
+TPtrC8  CNormalizedPolicyConatiner::URI()
+    {
+    return iUri->Des();
+    }
+TTime  CNormalizedPolicyConatiner::ValidUntil()
+    {
+    return iValidUntil;
+    }
+CSenElement*  CNormalizedPolicyConatiner::Policy()
+    {
+    return iPolicy;
+    }
+
+    
+CSenWSPolicyLoader* CSenWSPolicyLoader::NewL(MSenCoreServiceManager& aManager)
+    {
+    CSenWSPolicyLoader* pNew = NewLC(aManager);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+    }
+
+CSenWSPolicyLoader* CSenWSPolicyLoader::NewLC(MSenCoreServiceManager& aManager)
+    {
+    CSenWSPolicyLoader* pNew = new (ELeave) CSenWSPolicyLoader(aManager);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+CSenWSPolicyLoader::CSenWSPolicyLoader(MSenCoreServiceManager& aManager)
+: iManager(aManager),
+  iLog((RFileLogger*)aManager.Log()),
+  iMaxPolicyID(0)
+    {
+    }
+
+CSenWSPolicyLoader::~CSenWSPolicyLoader()
+    {
+    SaveDB();
+    
+    TInt count = iPolicyArray.Count();
+    for (TInt i=0; i < count; i++)
+        {
+        iPolicyArray[i].Close();
+        }
+
+    iPolicyArray.Close();
+    
+    delete ipPolicyContainer;
+    delete ipPolicyIdentifier;
+    delete ipWSpolicy;
+   
+    }
+
+void CSenWSPolicyLoader::ConstructL()
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::ConstructL");
+    BaseConstructL(KSenWsPolicies);
+    LoadDBL();	//codescannerwarnings
+    }
+
+RFileLogger* CSenWSPolicyLoader::Log()
+    {
+    return iLog;
+    }
+    
+void CSenWSPolicyLoader::StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    const TPtrC8 localName   = aLocalName;
+    
+    switch (iState)
+        {
+        case KSenStateSave:
+            {
+
+            if (aLocalName.Compare(KWsPolicyContainer) == 0)
+                {
+                if ( ipPolicyContainer )
+                    {
+                    CSenElement* element  = ipPolicyContainer->ExtractElement();
+                    delete ipPolicyContainer;
+                    ipPolicyContainer = NULL;
+                    }
+                    
+
+                CSenElement& element = AsElement();
+
+                TPtrC8 prefix(KNullDesC8);
+                if(aQName.Length()>0)
+                    {
+                    TInt colon = aQName.Locate(':');
+                    if(colon>0) // Note: 0 also treated as no prefix
+                        {
+                        prefix.Set(aQName.Ptr(), colon);
+                        }
+                    }
+                
+				ipPolicyContainer = CSenBaseFragment::NewL(
+					                         aNsUri, aLocalName,
+					                         aQName, aAttributes,
+					                         element);
+				
+				ipPolicyContainer->AsElement().SetNamespaceL(prefix, aNsUri);	                         
+                iState = KStateParsingContainer;
+                }
+
+            break;
+            }
+        case KStateParsingContainer: 
+            {
+            if (aLocalName.Compare(KSenWsPolicyIdentifierLocalname) == 0)
+                {
+                if ( ipPolicyIdentifier )
+                    {
+                    CSenElement* element  = ipPolicyIdentifier->ExtractElement();
+                    delete ipPolicyIdentifier;
+                    ipPolicyIdentifier = NULL;
+                    }
+
+                CSenElement& element  = ipPolicyContainer->AsElement();
+                TPtrC8 prefix(KNullDesC8);
+                if(aQName.Length()>0)
+                    {
+                    TInt colon = aQName.Locate(':');
+                    if(colon>0) // Note: 0 also treated as no prefix
+                        {
+                        prefix.Set(aQName.Ptr(), colon);
+                        }
+                    }
+
+				ipPolicyIdentifier = CSenWSPolicyIdentifier::NewL(
+					                         aNsUri, aLocalName,
+					                         aQName, aAttributes,
+					                         element);
+
+                iState = KStateParsingIdentifier;
+                ipPolicyIdentifier->AsElement().SetNamespaceL(prefix, aNsUri);
+                DelegateParsingL(*ipPolicyIdentifier);
+                }                
+            else if(aLocalName.Compare(KSenWSPolicyMetadata) == 0)
+                {
+                // Parsing Policy
+                // 
+                // <=> Container can have only two elements:
+                //     1) Identifier,
+                //     2) PolicyMetadata
+                
+                if ( ipWSpolicy )
+                    {
+                    CSenElement* element  = ipWSpolicy->ExtractElement();
+                    delete ipWSpolicy;
+                    ipWSpolicy = NULL;
+                    }
+                
+
+                CSenElement& element  = ipPolicyContainer->AsElement();
+
+				ipWSpolicy = CSenInternalWsPolicy::NewL(
+					                         aNsUri, aLocalName,
+					                         aQName, aAttributes,
+					                         element
+					                         );
+		        ipWSpolicy->SetIdentifier(ipPolicyIdentifier);
+		        ipPolicyIdentifier = NULL;
+
+                iState = KStateParsingPolicy;
+
+                DelegateParsingL(*ipWSpolicy);
+                }
+              
+            break;
+            }
+        default:
+            {
+
+            if (aLocalName.Compare(KSenWsPolicies) == 0)
+                {
+                TInt count(aAttributes.Count());
+
+                for (TInt i=0; i<count; i++)
+                    {
+                    TPtrC8 localName = aAttributes[i].Attribute().LocalName().DesC();
+                    TPtrC8 value = aAttributes[i].Value().DesC();
+                    
+                    if ( localName == KWsPoliciesMaxID )
+                        {
+                        TLex8 lex;
+                        lex.Assign(value);
+                        lex.Val( iMaxPolicyID );                        
+                        break;
+                        }
+                    }
+                }
+                
+            CSenBaseFragment::StartElementL(aNsUri, aLocalName, aQName, aAttributes);
+            break;
+            }
+        }
+    }
+
+void CSenWSPolicyLoader::EndElementL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName)
+    
+
+    {
+    switch(iState)
+        {
+        case KStateParsingIdentifier:
+            {
+            iState = KStateParsingContainer;
+            break;
+            }
+        case KStateParsingProperties:
+            {
+            iState = KStateParsingContainer;
+            break;
+            }           
+        case KStateParsingPolicy:
+            {
+
+            RSenWSPolicyPtr policyPtr;
+            policyPtr.OpenL(ipWSpolicy);
+            CleanupClosePushL(policyPtr);
+            iPolicyArray.Append(policyPtr);
+            CleanupStack::Pop(&policyPtr);    
+            
+            CSenElement& element = this->AsElement().AddElementL(KWsPolicyContainer);
+            element.AddElementL(ipWSpolicy->IdentifierL().AsElement());	//codescannerwarnings
+            ipWSpolicy->IdentifierL().AsElement().SetParent(&element);	//codescannerwarnings
+            ipWSpolicy->IdentifierL().SetIdL(NextId());	//codescannerwarnings
+            element.AddElementL(ipWSpolicy->AsElement());
+            ipWSpolicy->AsElement().SetParent(&element);
+
+                
+            ipWSpolicy = NULL;
+
+            iState = KStateParsingContainer;            
+            break;
+            }
+        case KStateParsingContainer:
+            {
+            if ( ipPolicyContainer )
+                {
+                CSenElement& element  = ipPolicyContainer->AsElement();
+                RPointerArray<CSenElement>& children = element.ElementsL();
+                    
+                // Element should always have 2 child elements:
+                //         1) Identifier and
+                //         2) PolicyMetadata
+                if ( children.Count() < 2 )
+                    {
+                    if ( ipPolicyIdentifier )
+                        {
+                        CSenElement* element  = ipPolicyIdentifier->ExtractElement();
+                        delete ipPolicyIdentifier;
+                        ipPolicyIdentifier = NULL;
+                        }
+                    if ( ipWSpolicy )
+                        {
+                        CSenElement* element  = ipWSpolicy->ExtractElement();
+                        delete ipWSpolicy;
+                        ipWSpolicy = NULL;
+                        }
+                    }
+
+                delete ipPolicyContainer;
+                ipPolicyContainer = NULL;
+                }
+                
+            iState = KSenStateSave;
+            break;
+            }
+        default:
+            {
+            CSenBaseFragment::EndElementL(aNsUri, aLocalName, aQName);
+            break;
+            }
+        }
+    }    
+    
+TInt CSenWSPolicyLoader::LoadDBL()	//codescannerwarnings
+    {
+
+    TInt retVal(KErrNone);
+    TRAP(retVal, LoadFromL(KWsPolicyFile));
+
+    return retVal;
+    }
+
+void CSenWSPolicyLoader::LoadFromL(const TDesC& aFile)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::LoadFromL");            
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    TInt leaveCode(KErrNone);
+
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+    TBuf<KMaxPath> file;
+    fss.CreatePrivatePath(EDriveC);
+    fss.PrivatePath(file);
+    file.Append(aFile);
+
+    RFile  xmlFile;
+    leaveCode = xmlFile.Open(fss , file, EFileRead );
+    if(leaveCode == KErrNone)
+        {
+        TInt size;
+        xmlFile.Size(size);
+
+        HBufC8 *pBuf=HBufC8::NewL(size);	//CodeScannerWarnings
+
+        CleanupStack::PushL(pBuf);
+        TPtr8 buf8ptr(pBuf->Des());
+        xmlFile.Read(buf8ptr,size);
+        iXmlReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+        TRAP(leaveCode, ParseL(buf8ptr));
+        delete iXmlReader;
+        iXmlReader = NULL;  //CodeScannerWarnings
+        CleanupStack::PopAndDestroy(pBuf);
+        }
+    xmlFile.Close();        
+#else
+    TRAP(leaveCode, ParseL(fss, aFile, *this));
+#endif
+
+    iState = KSenStateSave;
+    
+#ifdef _SENDEBUG
+    if(leaveCode == KErrNotFound)
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"- The senwspolicies.xml does not exist!");
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"- New file will be generated.");
+        }
+    else if(leaveCode != KErrNone)
+        {
+        TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel, _L8("- Parsing of senwspolicies.xml leaved: %d"), leaveCode));
+        }
+    else
+        {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"- Policy database (senwspolicies.xml) successfully read.");
+        }
+#else
+    leaveCode=0; // this is a decision: we are not interested
+                 // of invalid input in read/parse phase
+#endif
+
+    SaveDB(); // Always validatby saving
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::LoadL - End");        
+    CleanupStack::PopAndDestroy(); // fss
+    }
+
+TInt CSenWSPolicyLoader::SaveDB()
+    {
+    TInt retVal(KErrNone);
+    TRAP(retVal, SaveToL(KWsPolicyFile));
+    return retVal;
+    }
+TInt CSenWSPolicyLoader::MergeToL()
+{
+//    CSenWSPolicyDBLoader* dbLoader = CSenWSPolicyDBLoader::NewL(iManager); 
+return KErrNone;   
+}
+TInt CSenWSPolicyLoader::SaveToL(const TDesC& aFile)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::SaveToL");        
+    TInt count = iPolicyArray.Count();
+    TInt maxId = 0;
+    for (TInt i=0; i<count; i++)
+        {
+        if ( iPolicyArray[i].Policy()->IdentifierL().IdL() > maxId )	//codescannerwarnings
+            {
+            maxId = iPolicyArray[i].Policy()->IdentifierL().IdL();	//codescannerwarnings
+            }
+        }
+    iMaxPolicyID = maxId;
+//    UpdateMaxId();
+
+    // First, collect everything into MEMORY
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+
+    AsElement().WriteAsXMLToL(bufWs);
+
+    TPtrC8 p8 = pBuf->Ptr(0);
+
+    CleanupStack::PopAndDestroy(1); // bufWs
+
+    // Everything in MEMORY ok, prepare to write into file
+    RFs fss;
+    User::LeaveIfError(fss.Connect());
+    CleanupClosePushL(fss);
+
+    RFileWriteStream fileOutStream;
+    CleanupClosePushL(fileOutStream);
+
+    if(!SysUtil::FFSSpaceBelowCriticalLevelL(&fss, p8.Length()) )
+        {
+        //Data caging 2 implementation
+#if defined( EKA2 ) || defined( RD_SECURE_PRIV_DATA )
+        TBuf<KMaxPath> file;
+        fss.CreatePrivatePath(EDriveC);
+        fss.PrivatePath(file);
+        file.Append(aFile);
+        fileOutStream.Replace(fss, file, EFileWrite);
+#else
+        fileOutStream.Replace(fss, aFile, EFileWrite);
+#endif
+        // finally write the UTF-8 into the file.
+        fileOutStream.WriteL(p8);
+        }
+
+    CleanupStack::PopAndDestroy(3); // fileOutStream, fss, pBuf
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::SaveToL - End");        
+    return KErrNone;
+    }
+
+TInt CSenWSPolicyLoader::InternalWsPoliciesL(RSenWSPolicyArray& aPolicies)
+    {
+
+    TInt retVal(KErrNotFound);
+
+    TInt count = iPolicyArray.Count();
+    
+    for (TInt i=0; i<count; i++)
+        {
+        aPolicies.AppendL(iPolicyArray[i].Policy());                
+        }
+
+    if ( aPolicies.Count() == 0 )
+        {
+        return retVal;
+        }
+
+    return KErrNone;
+    
+    }
+TInt CSenWSPolicyLoader::InternalWsPolicyL(CSenWSDescription& aPattern,
+								         RSenWSPolicyArray& aPolicies)
+    {
+    
+    TInt retVal(KErrNotFound);
+
+    TInt count = iPolicyArray.Count();
+    
+    for (TInt i=0; i<count; i++)
+        {
+        if ( iPolicyArray[i].Policy()->IsApplicableL(aPattern) )	//codescannerwarnings
+            {
+            aPolicies.AppendL(iPolicyArray[i].Policy());                
+            }
+        }
+
+    if ( aPolicies.Count() == 0 )
+        {
+        return retVal;
+        }
+
+    return KErrNone;
+    }
+TInt CSenWSPolicyLoader::InternalWsPolicyL(const TDesC8& aUri,
+								         RSenWSPolicyArray& aPolicies)
+    {
+    
+    TInt retVal(KErrNotFound);
+
+    TInt count = iPolicyArray.Count();
+    
+    for (TInt i=0; i<count; i++)
+        {
+        if ( iPolicyArray[i].Policy()->IsApplicableL(aUri) )	//codescannerwarnings
+            {
+            aPolicies.AppendL(iPolicyArray[i].Policy());                
+            }
+        }
+
+    if ( aPolicies.Count() == 0 )
+        {
+        return retVal;
+        }
+
+    return KErrNone;
+    }
+
+TInt CSenWSPolicyLoader::VerifyPolicyContentsL(CSenInternalWsPolicy* apInternalPolicy, TInt& aErrorTo)	//codescannerwarnings
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::VerifyPolicyContents Final");    
+    TInt retVal(KErrNotFound);
+
+    TInt count = iPolicyArray.Count();
+    TPtrC8 uri = apInternalPolicy->IdentifierL().MetadataEndpointL();
+    for (TInt i=0; i<count; i++)
+        {
+        CSenInternalWsPolicy* pIntPolicy = iPolicyArray[i].Policy();
+        if(pIntPolicy)
+        {
+            TPtrC8 pUri = pIntPolicy->IdentifierL().MetadataEndpointL();
+            if(uri == pUri)
+            {
+                TPtrC8 contract = apInternalPolicy->IdentifierL().ContractL();	//codescannerwarnings
+                TPtrC8 endpoint = apInternalPolicy->IdentifierL().EndpointL();	//codescannerwarnings
+                TPtrC8 pContract = pIntPolicy->IdentifierL().ContractL();	//codescannerwarnings
+                TPtrC8 pEndpoint = pIntPolicy->IdentifierL().EndpointL();	//codescannerwarnings
+                if(contract == pContract && endpoint== pEndpoint)
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"same policy");    
+                    //same do nuthing
+                }
+                else
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"different policy");    
+                aErrorTo = KErrNone;
+                CSenElement*  policy = pIntPolicy->WsPolicyByUriL(pUri);
+                CSenElement*  policyNew = apInternalPolicy->WsPolicyByUriL(pUri);
+                if(policy)
+                {
+                    if(policyNew == NULL) //no existing policy
+                    {
+                        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"different policy, add");    
+                        retVal = apInternalPolicy->AddMetadataPolicyL(policy);    
+                    }
+                    else //existing policy so verify it 
+                    {
+                        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"different policy, update");    
+                        retVal = apInternalPolicy->UpdateMetadataPolicyL(policy);
+                    // if the Metadata of Policy (aElement) is already euqal to 
+                    }                
+                }
+                }
+            }
+            
+        }
+        
+        }
+        return retVal;
+        
+}
+RSenWSPolicyPtr CSenWSPolicyLoader::AddWsPolicyL(CSenInternalWsPolicy* apInternalPolicy,
+                                                        TInt& aErrorTo)
+    {
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::AddWsPolicyL Final");    
+    if ( !apInternalPolicy )
+        {
+        SENDEBUG_L("AddPolicyL(*) - Illegal argument: NULL");
+        aErrorTo = KErrArgument;
+        return RSenWSPolicyPtr();
+        }
+        
+    CleanupStack::PushL(apInternalPolicy);
+    RSenWSPolicyPtr policyPtr;
+    policyPtr.OpenL(apInternalPolicy);
+    CleanupStack::Pop(apInternalPolicy);
+    CleanupClosePushL(policyPtr);
+    iPolicyArray.AppendL(policyPtr);
+    CleanupStack::Pop(&policyPtr);
+    
+    CSenElement& element = this->AsElement().AddElementL(KWsPolicyContainer);
+    element.AddElementL(apInternalPolicy->IdentifierL().AsElement());	//codescannerwarnings
+    apInternalPolicy->IdentifierL().AsElement().SetParent(&element);	//codescannerwarnings
+    apInternalPolicy->IdentifierL().SetIdL(NextId());	//codescannerwarnings
+    element.AddElementL(apInternalPolicy->AsElement());
+    apInternalPolicy->AsElement().SetParent(&element);
+    
+    VerifyPolicyContentsL(apInternalPolicy,aErrorTo);	//codescannerwarnings
+    SaveDB();
+    
+    aErrorTo = KErrNone;
+    return policyPtr;
+    }
+TInt CSenWSPolicyLoader::AddWsPolicyL(const TDesC8& aUri, CSenElement* aPolicy, TInt& aErrorTo)
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::AddWsPolicyL as Element");
+    TInt retVal(KErrNotFound);
+    RSenWSPolicyArray array;
+    CleanupClosePushL(array);
+    aErrorTo = InternalWsPolicyL(aUri,array);
+    
+    //array should have only one policy
+    TInt count(array.Count()); 
+    TPtrC8 metaendpoint = CWSPolicyUtils::PolicyUriL(aPolicy);
+    
+    for (TInt i = 0; i< count; i++)   
+    {
+        CSenInternalWsPolicy* ptr = array[i];
+        CSenWSPolicyIdentifier& identifier = ptr->IdentifierL();	//codescannerwarnings
+        if(identifier.MetadataEndpointL() == metaendpoint)	//codescannerwarnings
+        {
+
+        CSenElement* policy = ptr->WsPolicyByUriL(metaendpoint);
+        if(policy == NULL) //no existing policy
+        {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::AddWsPolicyL Add");
+            retVal = ptr->AddMetadataPolicyL(aPolicy);    
+        }
+        else //existing policy so verify it 
+        {
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::AddWsPolicyL Replace");
+            retVal = ptr->UpdateMetadataPolicyL(aPolicy);
+        // if the Metadata of Policy (aElement) is already euqal to 
+        }
+        SaveDB();            
+            
+        }
+
+        
+    }
+    CleanupStack::PopAndDestroy(&array);
+    
+    return retVal; 
+}
+TInt CSenWSPolicyLoader::AddWsPolicyL(CSenWSDescription* /*aPattern*/, const TDesC8& aUri,
+                                               const TDesC8& aPolicy, TInt& aErrorTo)
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::AddWsPolicyL");
+    TInt retVal(KErrNotFound);
+    CSenElement* policy = CreatePolicyElementL(aUri, aPolicy);
+    if(policy)
+    {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::AddWsPolicyL adding Policy as string");
+        CleanupStack::PushL(policy);
+        retVal = AddWsPolicyL(aUri, policy, aErrorTo);
+        CleanupStack::PopAndDestroy(policy);
+        policy = NULL;        
+    }
+    else
+    {
+        TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"Not a Valid xml policy to add ");
+    }
+    return retVal; 
+}
+TInt CSenWSPolicyLoader::RemoveWsPolicyL( CSenWSDescription* aPattern, 
+                                                    const TDesC8& aUri, TInt& aErrorTo)
+{
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::RemoveWsPolicyL");
+    TInt retVal(KErrNotFound);
+
+    RSenWSPolicyArray array;
+    CleanupClosePushL(array);
+    aErrorTo = InternalWsPolicyL(*aPattern,array);
+    
+    //array should have only one Entry in array i.e. Matching Service
+    TInt count(array.Count()); 
+    for (TInt i = 0; i< count; i++)   
+    {
+        CSenInternalWsPolicy* ptr = array[i];
+        if(aUri.Length() == 0)
+            {
+            // delete all policies
+           //delete all metadatas
+           
+            }
+        else
+            {
+            CSenElement* policy = ptr->WsPolicyByUriL(aUri);
+            if(policy) //we have policy so remove it
+                {
+                TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"Removing CSenWSPolicyLoader::RemoveWsPolicyL");
+                aErrorTo = ptr->RemoveMetadataPolicyL(aUri);
+                retVal = KErrNone;    
+                }
+                
+            }
+    }
+
+    CleanupStack::PopAndDestroy(&array);
+    SaveDB(); 
+    return retVal;
+}
+    
+TInt CSenWSPolicyLoader::NextId()
+    {
+    iMaxPolicyID++;
+
+    UpdateMaxId();    
+    
+    return iMaxPolicyID;
+    }
+    
+void CSenWSPolicyLoader::UpdateMaxId()
+    {
+/*    
+    TBool found = EFalse;
+    CSenElement& element = AsElement();
+    RPointerArray<CSenBaseAttribute>& attrs = element.AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for(TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+            {
+            if(bs->Name().Compare(KWsPoliciesMaxID) == 0)
+                {
+                TBuf8<KFlatBufSize> buffer;
+                buffer.Num(iMaxPolicyID);
+                bs->SetValueL(buffer);
+                found = ETrue;
+                }
+            }
+        }
+        
+    if ( !found )
+        {
+        TBuf8<KFlatBufSize> buffer;
+        buffer.Num(iMaxPolicyID);
+        element.AddAttributeL(KWsPoliciesMaxID, buffer);
+        }
+*/
+    }
+    
+TInt CSenWSPolicyLoader::RegisterWsPolicyL(CSenInternalWsPolicy* aInternalPolicy,
+                                                    TInt& aErrorTo)
+{
+	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::RegisterWsPolicyL2");
+    if(aInternalPolicy == NULL)
+    {
+        aErrorTo = KErrArgument;
+        return KErrGeneral;
+    }
+    
+    TInt count = iPolicyArray.Count();
+    TInt isPresent(KErrNotFound);
+
+    
+    for (TInt i=0; i<count; i++)
+        {
+        CSenInternalWsPolicy* internalPolicy = iPolicyArray[i].Policy();
+        TBool retVal = internalPolicy->IsApplicableL(aInternalPolicy);	//codescannerwarnings
+        if(retVal)
+            {
+            isPresent = KErrNone;
+            break;
+            }
+        }
+
+    if(isPresent == KErrNotFound)
+    {
+    	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"Adding CSenWSPolicyLoader::RegisterWsPolicyL");
+        AddWsPolicyL(aInternalPolicy, aErrorTo);
+        return KErrNone;
+    }
+    
+    return KErrAlreadyExists;
+        
+}
+
+        
+TInt CSenWSPolicyLoader::RegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+{
+//check if the policy is already in DB
+//if yes then use that
+//else
+//create new one
+    TInt retVal(KErrGeneral);
+    TInt ret(KErrGeneral);
+    TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::RegisterWsPolicyL");    
+
+    TPtrC8 cont = aPattern->Contract();
+    TPtrC8 endpo = aPattern->Endpoint();
+    CSenElement* providerId = aPattern->AsElement().Element(KProviderIdLocalName);
+
+    CSenServicePolicy* pol = (CSenServicePolicy*)aPattern->ServicePolicy();
+    CSenElement& servicePolicy = pol->AsElement();
+    CSenElement* clientPolicy = servicePolicy.Element( KClientPolicyLocalName );
+    if(clientPolicy)
+        {
+        RPointerArray<CSenElement> metaDataPoliciesUris;
+        CleanupClosePushL(metaDataPoliciesUris);
+        clientPolicy->ElementsL(metaDataPoliciesUris, KMetadataEndpointLocalname);
+        TInt count(metaDataPoliciesUris.Count());
+        if(count> 0)
+            {
+            CSenElement* metaData = NULL;
+            for(TInt i=0; i<count; i++)
+                {
+                metaData = metaDataPoliciesUris[i];
+                if(metaData && metaData->HasContent())
+                    {
+                    TPtrC8 uriName = metaData->Content();
+                    
+                    CSenInternalWsPolicy* pInternalPolicy = CSenInternalWsPolicy::NewLC();
+                    CSenWSPolicyIdentifier& identifier = pInternalPolicy->IdentifierL();	//codescannerwarnings
+                    
+                    identifier.AddMetadataEndpointL(metaData);
+
+                    if(cont.Length() > 0)
+                        identifier.SetPropertyL(KContractLocalname, cont);
+                    if(endpo.Length() > 0)
+                        identifier.SetPropertyL(KEndpointLocalname, endpo);
+                    if(providerId && providerId->HasContent())     
+                        {
+                        TPtrC8 provider = providerId->Content();    
+                        identifier.SetPropertyL(KProviderIdLocalName, provider);
+                        }
+                    TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,(uriName));
+                    retVal = RegisterWsPolicyL(pInternalPolicy, aErrorTo);
+                        
+                    if(retVal != KErrNone )
+                    {
+                        CleanupStack::PopAndDestroy(pInternalPolicy);
+                    }
+                    else
+                    {
+                        CleanupStack::Pop(pInternalPolicy);
+                        ret = KErrNone;
+                    }
+                    
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(&metaDataPoliciesUris);
+        }
+
+    return ret;          
+}
+
+TInt CSenWSPolicyLoader::UnRegisterWsPolicyL(CSenWSDescription* aPattern,
+                                                    TInt& aErrorTo)
+{
+	TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KSenCoreServiceManagerLogLevel,"CSenWSPolicyLoader::UnRegisterWsPolicyL");
+    TInt isPresent(KErrNotFound);
+    TInt count = 0;
+    for (TInt i=0; i<iPolicyArray.Count(); i++)
+    {
+        if(iPolicyArray[i].Policy()->IsApplicableL(*aPattern))	//codescannerwarnings
+        {
+            count++;
+        }
+    }
+
+    for(TInt j=0; j<count; j++)
+        {
+        for (TInt i=0; i<iPolicyArray.Count(); i++)
+            {
+                if(iPolicyArray[i].Policy()->IsApplicableL(*aPattern))	//codescannerwarnings
+                {
+                    CSenElement& root = this->AsElement();
+                    CSenElement& element = iPolicyArray[i].Policy()->AsElement();
+                    CSenElement* parent = element.Parent();
+                    iPolicyArray[i].Close();
+                    iPolicyArray.Remove(i);
+
+                    if(parent)
+                    {
+                        CSenElement* removed = root.RemoveElement(*parent);
+                        delete removed;
+                        removed = NULL;
+                    }
+                        
+                    aErrorTo = KErrNone;
+                    isPresent=  KErrNone; 
+                }
+            }
+        }
+    SaveDB();        
+    return isPresent;
+}
+
+CSenElement*  CSenWSPolicyLoader::WsPolicyL( CSenWSDescription* /*aPattern*/, 
+                                                const TDesC8& /*aUri*/, TInt& /*aErrorTo*/)
+{
+ return NULL;   
+}
+
+CSenElement* CSenWSPolicyLoader::GetExpiryTagL(CSenElement& aPolicy)
+    {
+//if there is no expiry tag in the policy the default expiry time is UTC +7 days    
+    RPointerArray<CSenElement> timeStamps;
+    CleanupClosePushL(timeStamps);       
+    CSenElement* validity = NULL;
+    const CSenNamespace* msNsUri = aPolicy.Namespace(MSWSPolicy::KMSNsPrefix);
+    if(msNsUri)
+        {
+        if(aPolicy.ElementsL(timeStamps, msNsUri->URI(), MSWSPolicy::KMetaDataValidity) == KErrNone)    
+            {
+            TInt validityStampsCount = timeStamps.Count();
+            
+            if(validityStampsCount > 0)
+                {
+                validity = timeStamps[0];//mws:metadatavalidity 
+                CleanupStack::PopAndDestroy();
+                return validity->Element(msNsUri->URI(), MSWSPolicy::KExpiry);
+                }
+            }
+        
+        }
+    else
+        {
+        if(aPolicy.ElementsL(timeStamps, MSWSPolicy::KMetaDataValidity) == KErrNone)
+            {
+                    
+            TInt validityStampsCount = timeStamps.Count();
+            
+            if(validityStampsCount > 0)
+                {
+                validity = timeStamps[0];//mws:metadatavalidity 
+                CleanupStack::PopAndDestroy();
+                return validity->Element(MSWSPolicy::KExpiry);
+                }
+            }
+        
+        }
+    CleanupStack::PopAndDestroy();        
+    return NULL;
+    }
+CSenElement* CSenWSPolicyLoader::CreatePolicyElementL(const TDesC8& aUri, const TDesC8& aPolicy)
+{
+    TInt retVal(KErrGeneral);
+    
+    CMyXml* xml = CMyXml::NewLC();
+    
+    retVal = xml->ReadFromDescL(aPolicy);
+  
+    CSenElement* ele = NULL;
+
+    if(retVal == KErrNone)
+        {
+         ele = xml->ExtractElement();
+         TPtrC8 eleName = ele->LocalName();
+         TPtrC8 eleNs = ele->NsPrefix();
+        if(ele)
+           if((eleName == KWsdlDocument && eleNs == KWsdlNsPrefix) || 
+            (eleName == KPolicyDocument && eleNs == KPolicyNsPrefix))
+            {//this is definitely a poliycy or wsdl file
+            //Add Name, Id, Metaendpoint; validity
+            ProcessNewPolicyL(aUri, *ele);
+            }
+        else            
+            {
+            delete ele; 
+            ele = NULL;
+            }
+        }
+
+        CleanupStack::PopAndDestroy();
+        return ele;
+
+}    
+TInt CSenWSPolicyLoader::ProcessNewPolicyL( const TDesC8& aUri, CSenElement& aPolicy)
+{
+     TPtrC8 policyUri = CWSPolicyUtils::PolicyUriL(&aPolicy);
+     if(policyUri.Length() == 0)
+        SenXmlUtils::AddAttributeL(aPolicy, KMetadataEndpointLocalname, aUri);   
+     
+     TPtrC8 name = CWSPolicyUtils::PolicyNameL(&aPolicy);
+     if(name.Length() == 0)
+        SenXmlUtils::AddAttributeL(aPolicy, KName, aUri);   
+     
+     TPtrC8 id = CWSPolicyUtils::PolicyIdL(&aPolicy);
+     if(id.Length() == 0)
+        {
+
+        CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
+        HBufC8* iPolicyId = pGuidGenerator->GetRandomGuid8LC();
+        TPtr8 policyIdDes = iPolicyId->Des();
+        policyIdDes.LowerCase();
+
+        aPolicy.AddAttrL(KWsuId, policyIdDes);
+        aPolicy.AddNamespaceL(KWsuPrefix, KWsuNsUri);
+                
+        CleanupStack::PopAndDestroy(iPolicyId);
+        CleanupStack::PopAndDestroy(pGuidGenerator);
+        }
+
+        
+    CSenElement* expiry = GetExpiryTagL(aPolicy);
+    TInt addtimeTag(KErrGeneral);
+    TTime expiryTime = Time::NullTTime();
+    if(expiry)
+        {
+        TInt updateTime = EvaluateExpiryL(expiry, expiryTime);
+        if(updateTime == KErrNone)
+            {
+            addtimeTag = KErrNone;
+            }
+        }
+    
+    if(addtimeTag != KErrNone)
+        {
+        expiryTime.UniversalTime();
+        TTimeIntervalDays interval(KValidityTime);
+        expiryTime+=interval;
+        }
+    
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf82L(ts, expiryTime);
+    SenXmlUtils::AddAttributeL(aPolicy, KSenWSPolicyValidUntil, ts); 
+        
+    return KErrNone;   
+}    
+TInt CSenWSPolicyLoader::EvaluateExpiryL(CSenElement* aExpiry, TTime& aExpiryTime)
+{ 
+    TInt updateTime(KErrNotFound);
+    if(aExpiry && aExpiry->HasContent())
+    {
+        TPtrC8 timeTag = aExpiry->Content();
+        _LIT8(KUtc,"UTC");
+        _LIT8(KDays,"days");
+        TInt utc = timeTag.Find(KUtc);  //CodeScannerWarnings      
+        TInt days = timeTag.Find(KDays);
+        if(utc != KErrNotFound && days != KErrNotFound)
+        {   //We found UTC +x days timestamp
+            //replace this time stamp with expiry time starting from now
+        
+            TInt plus = timeTag.Locate('+');
+            if(plus != KErrNotFound)
+            {
+                TInt timeLength = days-plus-2;
+                TPtrC8 timeValue =   timeTag.Mid(plus+2,timeLength-1);
+                if(timeValue != KNullDesC8)
+                {
+                    TInt value = 0;        
+                    TLex8 lex(timeValue);
+                    TInt retVal = lex.Val(value);
+                    
+                    if(retVal != KErrNone)
+                    {
+                    value = KValidityTime;
+                    }
+
+                    if(value > 0)
+                    {
+                        TTime expiry;
+                        expiry.UniversalTime();
+                        TTimeIntervalDays interval(value);
+                        expiry+=interval;
+                        
+                        TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+                        TRAP (retVal, SenDateUtils::ToXmlDateTimeUtf82L(ts, expiry));
+                        if(retVal == KErrNone && ts.Length() > 0)
+                        {
+                            aExpiry->SetContentL(ts);
+                            aExpiryTime = expiry;
+                            updateTime = KErrNone;
+                        }
+                    }
+                }
+            }
+        }
+        
+        if(updateTime != KErrNone)
+        //the content is not in "UTC +7 days" format so try the XML time format
+        {
+            TTime now;
+            now.UniversalTime();
+     
+            TTime expiry = Time::NullTTime();
+            TRAPD(retval, expiry = SenDateUtils::FromXmlDateTimeL(timeTag);)
+            if(retval == KErrNone)
+                {   
+                if(expiry > now)
+                    {
+                    aExpiryTime = expiry;
+                    updateTime = KErrNone;
+                    }
+                    else //strange case. the policy provided to us is already expired
+                    {
+                    updateTime = KErrNone;                        
+                    }
+                }
+            else
+                {
+             updateTime = KErrGeneral;
+                }
+            
+        }
+    }
+    
+    return updateTime;
+}
+/////////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+
+EXPORT_C CExpiredPolicy* CExpiredPolicy::NewL(const TDesC8& aContract, const TDesC8& aEndpoint,
+                                             const TDesC8& aUri, const TDesC8& aProviderId)
+{
+    CExpiredPolicy* pNew = NewLC(aContract, aEndpoint, aUri, aProviderId);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+}
+EXPORT_C CExpiredPolicy* CExpiredPolicy::NewLC(const TDesC8& aContract, const TDesC8& aEndpoint,
+                                             const TDesC8& aUri, const TDesC8& aProviderId)
+{
+    CExpiredPolicy* pNew = new (ELeave) CExpiredPolicy();
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aContract, aEndpoint, aUri, aProviderId);
+    return pNew;
+}
+EXPORT_C CExpiredPolicy::~CExpiredPolicy()
+{
+    delete iContract; //service contract
+    delete iEndpoint; //service contract
+    delete iURI; //uri to download
+    delete iProvideId;
+    delete iContents; //contents
+
+}
+
+EXPORT_C TPtrC8  CExpiredPolicy::Contract()
+{
+    return  iContract->Des();  
+}
+EXPORT_C TPtrC8  CExpiredPolicy::Endpoint()
+{
+    return iEndpoint->Des();    
+}
+EXPORT_C TPtrC8  CExpiredPolicy::Uri()
+{
+    return iURI->Des();
+}
+TPtrC8  CExpiredPolicy::ProvideId()
+{
+    return iProvideId->Des();
+}
+EXPORT_C TPtrC8  CExpiredPolicy::Contents()
+{
+    if(iContents)
+        return iContents->Des();
+    else
+        return KNullDesC8();
+}
+EXPORT_C TInt    CExpiredPolicy::SetContentsL(const TDesC8& aContent)
+{
+    if(aContent.Length() > 0)
+        {
+        if(iContents)
+            {
+                delete iContents;
+                iContents = NULL;
+            }
+        iContents = aContent.AllocL();
+        return KErrNone;
+        }
+    
+    return KErrArgument;        
+}
+    
+
+CExpiredPolicy::CExpiredPolicy() :iContents(NULL)
+{
+    
+}
+void CExpiredPolicy::ConstructL(const TDesC8& aContract, const TDesC8& aEndpoint, const TDesC8& aUri, const TDesC8& aProviderId)
+{
+
+    iContract = aContract.AllocL();
+    iEndpoint = aEndpoint.AllocL();
+    iProvideId = aProviderId.AllocL();
+    iURI = aUri.AllocL();
+ 
+}
+    
+CConsumerContainer* CConsumerContainer::NewL(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    CConsumerContainer* pNew = NewLC(aUri, aConsumerId);
+    CleanupStack::Pop(pNew);
+    return(pNew);
+
+}
+CConsumerContainer* CConsumerContainer::NewLC(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    CConsumerContainer* pNew = new (ELeave) CConsumerContainer();
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aUri, aConsumerId);
+    return pNew;
+
+}
+CConsumerContainer::~CConsumerContainer()
+{
+    delete iConsumerId;
+    delete iURI;
+
+}
+TPtrC8  CConsumerContainer::Uri()
+{
+    return iURI->Des();
+}
+TPtrC8  CConsumerContainer::ConsumerId()
+{
+    return iConsumerId->Des();
+}
+CConsumerContainer::CConsumerContainer()
+{
+    
+}
+void CConsumerContainer::ConstructL(const TDesC8& aUri, const TDesC8& aConsumerId)
+{
+    iConsumerId =  aConsumerId.AllocL();
+    iURI = aUri.AllocL();
+}
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/wspolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,827 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "wspolicy.h"
+#include <f32file.h>
+#include <xmlengdom.h>
+#include <SenXmlUtils.h>
+#include "senguidgen.h"
+#include "SenXmlElement.h"
+#include "SenDateUtils.h"
+#include "wspolicywriter.h"
+#include "senxmldebug.h"
+
+using namespace WSPolicy;
+namespace
+{
+    _LIT8(KIntersect, " intersect ");
+    _LIT8(KMerge, " merge ");
+    _LIT8(KValidUntil, "ValidUntil");
+    const TUint KValidityTime = +7;
+    const TUint KFlatBufSize = 128;
+}
+
+EXPORT_C CWSPolicy* CWSPolicy::NewL()
+    {
+    CWSPolicy* pSelf = CWSPolicy::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+EXPORT_C CWSPolicy* CWSPolicy::NewLC()
+    {
+    CWSPolicy* pSelf = new (ELeave) CWSPolicy();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+    }
+
+EXPORT_C CWSPolicy* CWSPolicy::NewL(TDesC8& aPolicyUri, TDesC8& aPolicy)
+    {
+    CWSPolicy* pSelf = CWSPolicy::NewLC(aPolicyUri, aPolicy);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+    
+EXPORT_C CWSPolicy* CWSPolicy::NewLC(TDesC8& aPolicyUri, TDesC8& aPolicy)
+    {
+    CWSPolicy* pSelf = new (ELeave) CWSPolicy();
+    CleanupStack::PushL(pSelf);
+    pSelf->BaseConstructL(aPolicyUri, aPolicy);
+    return pSelf;
+    }
+
+EXPORT_C CWSPolicy* CWSPolicy::NewL(CSenElement* aPolicy)
+    {
+     CWSPolicy* pSelf = CWSPolicy::NewLC(aPolicy);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+    
+EXPORT_C CWSPolicy* CWSPolicy::NewLC(CSenElement* aPolicy)
+    {
+    CWSPolicy* pSelf = new (ELeave) CWSPolicy();
+    CleanupStack::PushL(pSelf);
+    pSelf->BaseConstructL(aPolicy);
+    return pSelf;   
+    }
+CWSPolicy::~CWSPolicy()
+    {
+    delete iReader;
+    delete iWriter;
+    delete iInDoc;
+    delete iOutDoc;
+    delete iNormaPolicyAssert; //owned
+    delete iPolicyId;
+    delete iPolicyName;
+    delete iPolicyUri;
+    }
+
+EXPORT_C CWSPolicy::CWSPolicy()
+: iNormPolicy(NULL),
+iNormaPolicyAssert(NULL),
+iNormalized(EFalse),
+iExpired(ETrue)
+
+    {
+    }
+    
+EXPORT_C void CWSPolicy::ConstructL()
+    {
+    iReader = CWSPolicyReader::NewL();
+    iWriter = CWSPolicyWriter::NewL();
+    iInDoc= CMyXml::NewL();
+    iOutDoc = CMyXml::NewL();
+    iNormPolicy = NULL;
+    count = 0;
+
+    TTime now;
+    iExpiry.UniversalTime();
+    TTimeIntervalDays interval(KValidityTime);
+    iExpiry+=interval;
+    }
+    
+EXPORT_C TInt CWSPolicy::SetPolicyL(TDesC8& aPolicyUri, TDesC8& aPolicy)
+    {
+    TRAPD (error , BaseConstructL(aPolicyUri, aPolicy));
+    return error;
+    }
+    
+void CWSPolicy::BaseConstructL(TDesC8& aPolicyUri, TDesC8& aPolicy)
+    {
+    ConstructL();
+
+    if(aPolicyUri.Length() > 0 && aPolicy.Length() > 0)
+    {
+        TInt error = iInDoc->ReadFromDescL(aPolicy);
+        if(error != KErrNone)
+            return;
+
+        
+        CSenElement* policy = iInDoc->XMLDocL();
+        if(policy)
+        {
+            
+    //        CSenElement* policy = Policy();
+            TPtrC8 policyUri = CWSPolicyUtils::PolicyUriL(policy);
+
+            if(policyUri == KNullDesC8())
+            {
+                iPolicyUri = aPolicyUri.AllocL();            
+                AddPolicyMetadatEndpointL(policy);
+            }
+            else
+            {
+                iPolicyUri = policyUri.AllocL();
+            }
+            
+
+            TPtrC8 name = CWSPolicyUtils::PolicyNameL(policy);
+            if(name == KNullDesC8())
+            {
+                iPolicyName = aPolicyUri.AllocL();
+                AddPolicyNameL(policy);    
+                
+            }
+            else
+            {
+                iPolicyName = name.AllocL();
+            }
+            
+            TPtrC8 id = PolicyIdL(policy);
+            iPolicyId = id.AllocL();
+            
+            
+            CSenElement* expiry = GetExpiryTagL();	//codescannerwarnings 
+            if(EvaluateExpiryL(expiry))	//codescannerwarnings 
+            {
+               AddPolicyValidityL(policy);
+            }
+            else
+            {
+                AddPolicyValidityL(policy);
+            }
+            //We have modifed the original XMLElement. Now its safe to 
+            //convert this element into PolicyAssertion
+        }        
+    }
+    }
+
+void CWSPolicy::BaseConstructL(CSenElement* aPolicy)
+    {
+    if(aPolicy)
+        {
+        TPtrC8 name = CWSPolicyUtils::PolicyNameL(aPolicy);
+        TPtrC8 uri = CWSPolicyUtils::PolicyUriL(aPolicy);
+        TPtrC8 id = PolicyIdL(aPolicy);
+
+        if(id != KNullDesC8())
+            iPolicyId = id.AllocL();
+        
+        HBufC8* policy = aPolicy->AsXmlL();
+        CleanupStack::PushL(policy);
+        BaseConstructL(uri, *policy);
+        CleanupStack::PopAndDestroy(policy);
+        }
+    }
+    
+EXPORT_C TBool CWSPolicy::Normalized()
+    { 
+    return iNormalized;
+    }
+//returns the descriptor of NON-NORMALIZED/NORMALIZED Policy
+EXPORT_C HBufC8* CWSPolicy::PolicyAsXmlL()
+    {
+    CSenElement* policy = iOutDoc->XMLDocL();
+    if(policy && Normalized())
+    {
+        return policy->AsXmlL();
+    }
+    else
+    {
+        policy = iInDoc->XMLDocL();
+        if(policy)
+        {
+            return policy->AsXmlL();
+        }
+    }
+    return NULL;    
+    }
+//returns the xml element of NON-NORMALIZED/NORMALIZED Policy    
+EXPORT_C    CSenElement* CWSPolicy::PolicyL()	//codescannerwarnings
+    {
+    CSenElement* policy = iOutDoc->XMLDocL();
+    if(policy && Normalized())
+    {
+        return policy;
+    }
+    else
+    {
+        policy = iInDoc->XMLDocL();
+        if(policy)
+        {
+            return policy;
+        }
+    }
+    return NULL;    
+    }
+EXPORT_C CSenElement* CWSPolicy::NonNormalizedPolicyL()	//codescannerwarnings
+{
+    if(iInDoc)
+    {
+        CSenElement* policy = iInDoc->XMLDocL();
+        if(policy)
+        {
+            return policy;
+        }
+    }
+    return NULL;    
+}
+MAssertion* CWSPolicy::NormaAssertion()
+{
+    if(iNormaPolicyAssert)
+        return iNormaPolicyAssert;
+    else
+        return NULL;
+}
+EXPORT_C TBool CWSPolicy::NormalizePolicyL(CPolicyRegistry* aRegistry)
+    {
+    TBool retval = EFalse;
+    TRAPD(error, retval = NormalizePL(aRegistry));
+    if(error ==KErrNone)
+        return retval;
+    else
+        return EFalse;
+    }
+TInt CWSPolicy::NormalizePL(CPolicyRegistry* aRegistry)
+    {
+        CPolicyAssertion* poolicy = iReader->GetPolicyL(PolicyL());	//codescannerwarnings
+    
+    if(!poolicy)
+        {
+        return EFalse;
+        }
+    if(poolicy->IsNormalized())
+        {
+        return iNormalized;
+        }
+    TInt error = KErrNone;    
+    
+    MAssertion* normalized = NULL;
+    TRAP(error, normalized = poolicy->NormalizeL(aRegistry));
+	if(error == KErrNone && normalized)
+	    {
+        iNormalized = ETrue;
+        iNormaPolicyAssert = (CPolicyAssertion*)normalized;
+        delete poolicy;
+//        delete iInDoc;
+//        iInDoc = NULL;
+
+        CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        TPtrC8 p = iWriter->WriteToBufL(*pBuf, iNormaPolicyAssert);
+        TInt error = iOutDoc->ReadFromDescL(p);
+        CleanupStack::PopAndDestroy(pBuf);
+
+        if(error == KErrNone)
+            {
+            iNormPolicy = iOutDoc->XMLDocL();
+            if(iNormPolicy)
+                {
+                TPtrC8 policyUri = CWSPolicyUtils::PolicyUriL(iNormPolicy);
+                if(policyUri == KNullDesC8())
+                    {
+                    AddPolicyMetadatEndpointL(iNormPolicy);
+                    }
+
+                TPtrC8 name = CWSPolicyUtils::PolicyNameL(iNormPolicy);
+                if(name == KNullDesC8())
+                    {
+                    AddPolicyNameL(iNormPolicy); 
+                    AddPolicyIdL(iNormPolicy);
+                    
+                    }
+                }
+            }
+        else
+            {
+            iNormPolicy = NULL;
+            }
+            
+
+	    return ETrue;
+	    }
+	else
+	    {
+	    return EFalse;      
+	    }
+    
+    }
+    
+EXPORT_C CWSPolicy* CWSPolicy::IntersectPolicyL(CWSPolicy* aPolicy)
+    {
+    CWSPolicy* intersectedPolicy = NULL; 
+    TRAPD(error, intersectedPolicy = IntersectPL(aPolicy));	//codescannerwarnings
+    if(error ==KErrNone)    
+        return intersectedPolicy;
+    else
+        {
+        delete intersectedPolicy;
+        return NULL;
+        }
+    
+    }
+CWSPolicy* CWSPolicy::IntersectPL(CWSPolicy* aPolicy)	//codescannerwarnings
+    {
+    MAssertion* pol1 = NormaAssertion();
+    MAssertion* pol2 = aPolicy->NormaAssertion();
+
+//Only normalized policies can be intersected so if we provide a non normalized policy we will get NULL    
+    if(pol1->IsNormalized() && pol2->IsNormalized())    
+    {
+        MAssertion* result = pol1->IntersectL(pol2);
+
+        if(result)
+        {
+            CPolicyAssertion* intersected = (CPolicyAssertion*)result;
+            
+            CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            TPtrC8 p = iWriter->WriteToBufL(*pBuf, intersected);
+            delete intersected; //we dont need it any more
+            CWSPolicy* intersectedPolicy = NULL;            
+            if(p.Length() > 0)
+            {
+                TPtrC8 policy2Uri = CWSPolicyUtils::PolicyUriL(aPolicy->PolicyL());  //codescannerwarnings
+                HBufC8* nameBuf = HBufC8::NewLC(iPolicyUri->Length()+ policy2Uri.Length()+11);
+                TPtr8 name = nameBuf->Des();
+                name.Append(iPolicyUri->Des());
+                name.Append(KIntersect);
+                name.Append(policy2Uri);
+            
+                intersectedPolicy = CWSPolicy::NewL(name, p);
+                CleanupStack::PopAndDestroy(nameBuf);
+                if(intersectedPolicy)
+                {
+                    if(intersectedPolicy->NormalizePolicyL(NULL))
+                    {
+                        //return intersectedPolicy;
+                    }
+                    else //cannot normalize intersected so return NULL
+                    {
+                        delete intersectedPolicy;
+                        intersectedPolicy = NULL;
+                    }
+                }
+                else
+                {
+                    delete intersectedPolicy;
+                    intersectedPolicy = NULL;
+                }
+                
+            }
+            
+            CleanupStack::PopAndDestroy(pBuf);
+            return intersectedPolicy;
+        }
+    }
+    
+    return NULL;
+    }
+
+
+EXPORT_C CWSPolicy* CWSPolicy::MergePolicyL(CWSPolicy* aPolicy)
+    {
+    CWSPolicy* mergedPolicy = NULL; 
+    TRAPD(error, mergedPolicy = MergePL(aPolicy));
+    if(error ==KErrNone)    
+        return mergedPolicy;
+    else
+        {
+        delete mergedPolicy;
+        return NULL;
+        }
+
+    }
+
+CWSPolicy* CWSPolicy::MergePL(CWSPolicy* aPolicy)
+    {
+    MAssertion* pol1 = NormaAssertion();
+    MAssertion* pol2 = aPolicy->NormaAssertion();
+
+//Only normalized policies can be merged so if we provide a non normalized policy we will get NULL    
+    if(pol1->IsNormalized() && pol2->IsNormalized())    
+    {
+        MAssertion* result = pol1->MergeL(pol2);
+  
+        if(result)
+        {
+            CPolicyAssertion* merged = (CPolicyAssertion*)result;
+
+            CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+            CleanupStack::PushL(pBuf);
+            TPtrC8 p = iWriter->WriteToBufL(*pBuf, merged);
+            delete merged; //we dont need it any more
+            CWSPolicy* mergedPolicy = NULL;            
+            if(p.Length() > 0)
+            {
+                TPtrC8 policy2Uri = CWSPolicyUtils::PolicyUriL(aPolicy->PolicyL());  //codescannerwarnings
+                HBufC8* nameBuf = HBufC8::NewLC(iPolicyUri->Length()+ policy2Uri.Length()+7);
+                TPtr8 name = nameBuf->Des();
+                name.Append(iPolicyUri->Des());
+                name.Append(KMerge);
+                name.Append(policy2Uri);
+            
+                mergedPolicy = CWSPolicy::NewL(name, p);
+                CleanupStack::PopAndDestroy(nameBuf);                
+                if(mergedPolicy)
+                {
+                    if(mergedPolicy->NormalizePolicyL(NULL))
+                    {
+//                        return mergedPolicy;
+                    }
+                    else //cannot normalize merged so return NULL
+                    {
+                        delete mergedPolicy;
+                        mergedPolicy = NULL;
+                    }
+                }
+                else
+                {
+                    delete mergedPolicy;
+                    mergedPolicy = NULL;
+                    
+                }
+                
+            }
+            CleanupStack::PopAndDestroy(pBuf);
+            return mergedPolicy;
+        }
+    }
+    
+    return NULL;
+    }
+
+CSenElement* CWSPolicy::NormalizePolicy2L(CSenElement& aPolicy, CPolicyRegistry* aRegistry)
+{
+    CPolicyAssertion* poolicy = iReader->GetPolicyL(&aPolicy);
+    
+    if(!poolicy)
+        {
+        return NULL;
+        }
+    if(poolicy->IsNormalized())
+        {
+        return iNormPolicy;
+        }
+    TInt error = KErrNone;    
+    
+    MAssertion* normalized = NULL;
+    TRAP(error, normalized = poolicy->NormalizeL(aRegistry));
+	if(error == KErrNone && normalized)
+	    {
+        iNormalized = ETrue;
+        iNormaPolicyAssert = (CPolicyAssertion*)normalized;
+        delete poolicy;
+//        delete iInDoc;
+//        iInDoc = NULL;
+
+        CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+        CleanupStack::PushL(pBuf);
+        TPtrC8 p = iWriter->WriteToBufL(*pBuf, iNormaPolicyAssert);        
+        delete iNormaPolicyAssert;
+        iNormaPolicyAssert = NULL;
+        TInt error = iOutDoc->ReadFromDescL(p);
+        CleanupStack::PopAndDestroy(pBuf);
+
+        if(error == KErrNone)
+            {
+            iNormPolicy = iOutDoc->XMLDocL();
+            if(iNormPolicy)
+                {
+                iNormPolicy = iOutDoc->ExtractElement();
+                }
+            }
+        else
+            {
+            iNormPolicy = NULL;
+            }
+	    }
+	return iNormPolicy;
+    
+}
+TPtrC8 CWSPolicy::PolicyIdL(CSenElement* aPolicy)
+    {
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name().Compare(WSPolicy::KWsuId) == 0)
+            {
+             return bs->Value();
+            }
+         }
+    GeneratePolicyIdL(aPolicy);  //codescannerwarnings
+    
+    return PolicyIdL(aPolicy);
+    }
+
+TPtrC8 CWSPolicy::PolicyNameL(CSenElement* aPolicy)
+    {
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name().Compare(KName) == 0)
+            {
+             return bs->Value();
+            }
+         }
+    return KNullDesC8();
+    }
+
+TInt CWSPolicy::AddPolicyNameL(CSenElement* aPolicy)
+    {
+  SenXmlUtils::AddAttributeL(*aPolicy, KName, iPolicyName->Des());
+  return KErrNone; 
+   
+    }
+TInt CWSPolicy::AddPolicyMetadatEndpointL(CSenElement* aPolicy)
+    {
+  SenXmlUtils::AddAttributeL(*aPolicy, MSWSPolicy::KMetaDataLocalName, iPolicyUri->Des());
+  return KErrNone; 
+   
+    }
+TInt CWSPolicy::AddPolicyIdL(CSenElement* aPolicy)
+    {
+    aPolicy->AddAttrL(KWsuId, iPolicyId->Des());
+    aPolicy->AddNamespaceL(KWsuPrefix, KWsuNsUri);
+    return KErrNone; 
+   
+    }
+void CWSPolicy::GeneratePolicyIdL(CSenElement* aPolicy)  //codescannerwarnings
+    {
+
+    CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
+    HBufC8* pPolicyId = pGuidGenerator->GetRandomGuid8LC();//codescannerwarning
+    TPtr8 policyIdDes = pPolicyId->Des();
+    policyIdDes.LowerCase();
+
+    aPolicy->AddAttrL(KWsuId, policyIdDes);
+    aPolicy->AddNamespaceL(KWsuPrefix, KWsuNsUri);
+            
+    CleanupStack::PopAndDestroy(pPolicyId);
+    CleanupStack::PopAndDestroy(pGuidGenerator);
+    }
+
+TInt CWSPolicy::AddPolicyValidityL(CSenElement* aPolicy)
+    {
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf82L(ts, iExpiry);
+    if(ts.Length() > 0)
+        {
+        SenXmlUtils::AddAttributeL(*aPolicy, KValidUntil, ts);
+        return KErrNone; 
+        }
+    return KErrNotFound;        
+    }
+    
+EXPORT_C TBool CWSPolicy::IsExpiredPolicyL()  //codescannerwarnings
+    {
+    CSenElement* expiry = GetExpiryTagL();	//codescannerwarnings 
+    if(expiry && expiry->HasContent())
+        {
+        TPtrC8 expiryTime = expiry->Content();
+     
+        TTime now;
+        now.UniversalTime();
+     
+        TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+        SenDateUtils::ToXmlDateTimeUtf82L(ts, now);
+        
+        if(ts > expiryTime)
+            return ETrue;
+        else
+            return EFalse;
+        }
+    return EFalse; 
+    }
+    
+CSenElement* CWSPolicy::GetExpiryTagL()	//codescannerwarnings 
+    {
+     CSenElement* documentRoot = PolicyL();  //codescannerwarnings //(CSenElement*)&iPolicyNormalizer->AsElement().Root();
+    if(documentRoot)     
+    {
+        RPointerArray<CSenElement> timeStamps;
+        CleanupClosePushL(timeStamps);       
+        CSenElement* validity = NULL;
+        const CSenNamespace* msNsUri = documentRoot->Namespace(MSWSPolicy::KMSNsPrefix);
+        if(msNsUri)
+            {
+            if(documentRoot->ElementsL(timeStamps, msNsUri->URI(), MSWSPolicy::KMetaDataValidity) == KErrNone)    
+                {
+                TInt validityStampsCount = timeStamps.Count();
+                
+                if(validityStampsCount > 0)
+                    {
+                    validity = timeStamps[0];//mws:metadatavalidity 
+                    CleanupStack::PopAndDestroy();
+                    return validity->Element(msNsUri->URI(), MSWSPolicy::KExpiry);
+                    }
+                }
+            
+            }
+        else
+            {
+            if(documentRoot->ElementsL(timeStamps, MSWSPolicy::KMetaDataValidity) == KErrNone)
+                {
+                        
+                TInt validityStampsCount = timeStamps.Count();
+                
+                if(validityStampsCount > 0)
+                    {
+                    validity = timeStamps[0];//mws:metadatavalidity 
+                    CleanupStack::PopAndDestroy();
+                    return validity->Element(MSWSPolicy::KExpiry);
+                    }
+                }
+            
+            }
+
+        CleanupStack::PopAndDestroy();
+    }
+    return NULL;
+    }
+    
+TBool CWSPolicy::EvaluateExpiryL(CSenElement* aExpiry)	//codescannerwarnings 
+{ //we have metadatavalidity element here ,
+//extract the Expiry value, and if its "UTC + 7 days" then replace it with expiry time
+    TInt updateTime(KErrNotFound);
+    if(aExpiry && aExpiry->HasContent())
+    {
+        TPtrC8 timeTag = aExpiry->Content();
+        
+        TInt utc = timeTag.Find(_L8("UTC"));        
+        TInt days = timeTag.Find(_L8("days"));
+        if(utc != KErrNotFound && days != KErrNotFound)
+        {   //We found UTC +x days timestamp
+            //replace this time stamp with expiry time starting from now
+        
+            TInt plus = timeTag.Locate('+');
+            if(plus != KErrNotFound)
+            {
+                TInt timeLength = days-plus-2;
+                TPtrC8 timeValue =   timeTag.Mid(plus+2,timeLength-1);
+                if(timeValue != KNullDesC8)
+                {
+                    TInt value = 0;        
+                    TLex8 lex(timeValue);
+                    TInt retVal = lex.Val(value);
+                    if(retVal == KErrNone)
+                    {
+                        if(value > 0)
+                        {
+                            TTime now;
+                            now.UniversalTime();
+                            TTimeIntervalDays interval(value);
+                            now+=interval;
+                            
+                            TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+                            SenDateUtils::ToXmlDateTimeUtf82L(ts, now);
+                            if(ts.Length() > 0)
+                            {
+                                aExpiry->SetContentL(ts);
+                                iExpiry = now;
+                                updateTime = KErrNone;
+                            }
+                        }
+                    }
+                    else if(retVal == KErrGeneral || retVal == KErrOverflow)
+                    {
+                        
+                    }
+
+                }
+            }
+        }
+        else //the content is not in "UTC +7 days" format so try the XML time format
+        {
+            TTime now;
+            now.UniversalTime();
+     
+            TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+            SenDateUtils::ToXmlDateTimeUtf82L(ts, now);
+            TTime expiry = SenDateUtils::FromXmlDateTimeL(timeTag);
+            if(expiry > now)
+            {
+              iExpiry = expiry;
+              updateTime = KErrNone;  
+            }
+        
+            
+        }
+    }
+
+    if(updateTime == KErrNone)
+        return ETrue;    
+    else
+        return EFalse;
+}
+
+CMyXml* CMyXml::NewL()
+{
+     CMyXml* pSelf = CMyXml::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CMyXml* CMyXml::NewLC()
+{
+       CMyXml* pSelf = new (ELeave) CMyXml();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+  
+}
+CMyXml::~CMyXml()
+{
+}
+CMyXml::CMyXml() :iParsed(EFalse)
+{
+    
+}
+void CMyXml::ConstructL()
+{
+}
+CSenElement* CMyXml::XMLDocL()
+{
+    if(iParsed)
+    {
+        CSenElement* ele = NULL;
+        TRAPD (error, ele = &AsElement());
+        if(error == KErrNone)
+        {
+            if (ele->LocalName().Compare(KWsPolicy) == 0)
+            {
+                return ele;
+            }        
+        }
+    }
+
+    return NULL;
+}
+TInt CMyXml::ReadFromDescL(const TDesC8& aData)
+{
+
+
+    TInt size = aData.Length();
+    if(size > 0)
+        {
+        iXmlReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser + CodeScannerWarnings     
+        TRAPD (err, ParseL(aData);)
+        delete(iXmlReader);
+        iXmlReader = NULL;
+        
+        if(err == KErrNone)
+            iParsed = ETrue;
+        
+        return err;
+        }
+    return KErrArgument;        
+}   
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/wspolicyreader.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,276 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+#include "wspolicyreader.h"
+
+#include "policyassertion.h"
+#include "andcompositeassertion.h"
+#include "xorcompositeassertion.h"
+#include "assertion.h"
+#include "primitiveassertion.h"
+#include "policyreferenceassertion.h"
+
+using namespace WSPolicy;
+
+CWSPolicyReader* CWSPolicyReader::NewL()
+{
+     CWSPolicyReader* pSelf = CWSPolicyReader::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CWSPolicyReader* CWSPolicyReader::NewLC()
+{
+       CWSPolicyReader* pSelf = new (ELeave) CWSPolicyReader();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+     
+}
+CWSPolicyReader::~CWSPolicyReader()
+{
+}
+CWSPolicyReader::CWSPolicyReader()
+{
+}
+void CWSPolicyReader::ConstructL()
+{
+}
+
+CPolicyAssertion* CWSPolicyReader::GetPolicyL(CSenElement* aPolicy)
+{
+    CPolicyAssertion* policy = ReadPolicyL(aPolicy);
+    if(policy)
+        return policy;
+    else
+        return NULL;
+}
+
+
+//PRIVATE METHODS
+CPolicyAssertion* CWSPolicyReader::ReadPolicyL(CSenElement* aEle)
+{
+    if(!aEle)
+    return NULL;
+    
+    CPolicyAssertion* policy = CPolicyAssertion::NewL();
+    
+    TPtrC8 kwsuid(KWsuId);
+    TPtrC8 id = GetAttribL(kwsuid, aEle);
+    if (id != KNullDesC8())
+    {
+        policy->SetIdL(id);
+    }
+
+    RPointerArray<MAssertion> terms;
+    ReadTermsL(aEle, terms);
+    policy->AddTerms(terms);
+    terms.Reset();
+
+    return policy;
+
+}
+CAndCompositeAssertion* CWSPolicyReader::ReadAndAssertionL(CSenElement* aEle)
+{
+	CAndCompositeAssertion* andAssert = CAndCompositeAssertion::NewL();
+
+    RPointerArray<MAssertion> terms;
+    ReadTermsL(aEle, terms);
+    andAssert->AddTerms(terms);
+    terms.Reset();
+    return andAssert;
+    
+}
+CXorCompositeAssertion* CWSPolicyReader::ReadXorAssertionL(CSenElement* aEle)
+{
+	CXorCompositeAssertion* xorAssert = CXorCompositeAssertion::NewL();
+
+    RPointerArray<MAssertion> terms;
+    ReadTermsL(aEle, terms);
+    xorAssert->AddTerms(terms);
+    terms.Reset();
+    return xorAssert;
+    
+}
+CAssertion* CWSPolicyReader::ReadAssertionL(CSenElement* aEle)
+{
+	TPtrC8 nsUri = aEle->NamespaceURI();
+	TPtrC8 localName = aEle->LocalName();
+	
+	if(nsUri.Length() == 0 || localName.Length() == 0)
+	    return NULL;
+
+		if (!(nsUri == KWsPolicyNsUri)) 
+		{
+			return ReadPrimitiveAssertionL(aEle);
+		}
+
+		if (localName == KWsPolicy)
+		{
+			return ReadPolicyL(aEle);
+
+		}
+		else if (localName == KAndCompositeAssertion)
+		{
+          return ReadAndAssertionL(aEle);
+
+		}
+		else if (localName == KXorCompositeAssertion)
+		{
+			return ReadXorAssertionL(aEle);
+
+		}
+		else if (localName == KWsPolicyReference ) 
+		{
+			return ReadPolicyReferenceL(aEle);
+
+		} 
+		else 
+		{
+		    return NULL;
+		}
+}
+CPolicyReferenceAssertion* CWSPolicyReader::ReadPolicyReferenceL(CSenElement* aEle)
+{
+    
+    TPtrC8 id = GetAttribL(KUri(), aEle);
+    if(id.Length() > 0)
+    {
+        return CPolicyReferenceAssertion::NewL(id);    
+    }
+    return NULL;    
+}
+CPrimitiveAssertion* CWSPolicyReader::ReadPrimitiveAssertionL(CSenElement* aEle)
+{
+    TPtrC8 localName = aEle->LocalName();//GetQname
+    TPtrC8 nsprefix = aEle->NsPrefix();
+    TPtrC8 nsuri= aEle->NamespaceURI();
+    
+    if(localName.Length() == 0 || nsprefix.Length() == 0 || nsuri.Length() == 0)    
+    return NULL;
+    
+    CPrimitiveAssertion* result = CPrimitiveAssertion::NewL(localName,nsprefix,nsuri);
+
+    RAttributeMap attribs(ETrue,ETrue);
+    GetAttributesL(aEle, attribs);
+    result->SetAttributesL(attribs);
+    attribs.Reset();
+
+    
+    TPtrC8 isOptional = result->GetAttributeValue(KWspOptinal);
+    
+    if(isOptional == KWspOptinalTrue)
+    {
+        result->SetOptional(ETrue);
+    }
+    else if(isOptional == KWspOptinalFalse)
+    {
+        result->SetOptional(EFalse);
+        result->RemoveAttribute(KWspOptinal);
+    }
+
+    // setting the text value ..
+    if(aEle->HasContent())
+    {
+        TPtrC8 strValue = aEle->Content();    
+        if(strValue != KNullDesC8())
+        
+    	result->SetStrValueL(strValue);
+    }
+    
+
+    RPointerArray<CSenElement> childElements = aEle->ElementsL();
+    for (TInt i=0; i<childElements.Count(); i++ )
+    {
+        CSenElement* childElement = childElements[i];
+        if(childElement && childElement->LocalName() == KWsPolicy
+            && childElement->NamespaceURI() == KWsPolicyNsUri)
+        {
+            CPolicyAssertion* policy = ReadPolicyL(childElement);
+    		result->AddTerm(policy);
+
+    	} 
+    	else
+    	{
+    		CPrimitiveAssertion* pa = ReadPrimitiveAssertionL(childElement);
+    		result->AddTerm(pa);
+    	}
+    }
+    
+    return result;
+
+}
+void CWSPolicyReader::ReadTermsL(CSenElement* aEle, RPointerArray<MAssertion>& aTerms)
+{
+	RPointerArray<CSenElement> childElements = aEle->ElementsL();
+    for (TInt i=0; i<childElements.Count(); i++ )
+    {
+        CSenElement* obj = childElements[i];
+        if(obj)
+        {
+            MAssertion* ass = ReadAssertionL(obj);
+            if(ass)
+            {
+                aTerms.Append(ass);
+            }
+        }
+    }
+}
+
+void CWSPolicyReader::GetAttributesL(CSenElement* aEle, RAttributeMap& aAttributes)
+{
+	RPointerArray<CSenBaseAttribute> attribs = aEle->AttributesL();
+    for (TInt i=0; i<attribs.Count(); i++ )
+    {
+        CSenBaseAttribute* obj = attribs[i];
+        if(obj)
+        {
+            TPtrC8 name = obj->Name();
+            TPtrC8 value = obj->Value();
+            
+            aAttributes.Append(name.AllocL(), value.AllocL()); 
+        }
+    }
+}
+
+TPtrC8 CWSPolicyReader::GetAttribL(TPtrC8 aReference, CSenElement* aEle)
+{
+
+    RPointerArray<CSenBaseAttribute>& attrs = aEle->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+         bs = (attrs)[j];
+         if(bs->Name().Compare(aReference) == 0)
+         {
+            return bs->Value();
+         }
+            
+              
+         }
+    return KNullDesC8();
+}
+//EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/wspolicyregistry.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+
+#include "wspolicyregistry.h"
+#include <SenXmlElement.h> // check if this include is needed(?)
+#include "wspolicy.h"
+
+using namespace WSPolicy;
+
+
+EXPORT_C CPolicyRegistry* CPolicyRegistry::NewL()
+{
+     CPolicyRegistry* pSelf =
+        CPolicyRegistry::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+   
+}
+EXPORT_C CPolicyRegistry* CPolicyRegistry::NewLC()
+{
+    CPolicyRegistry* pSelf =
+                        new (ELeave) CPolicyRegistry();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+  
+}
+CPolicyRegistry::~CPolicyRegistry()
+{
+   iRegistry.Reset(); // destroys
+   delete iParent;
+}
+EXPORT_C void CPolicyRegistry::PopulateRegistryL(CSenElement* aServicePolicy)	//codescannerwarnings
+{
+    RPointerArray<CSenElement> policies;
+    CleanupClosePushL(policies);
+    aServicePolicy->ElementsL(policies,WSPolicy::KWsPolicyNsUri,WSPolicy::KWsPolicy);
+    
+    CSenElement* pPolicy = NULL;
+   
+    TInt count(policies.Count());
+
+    if(count > 0)
+    {
+        
+    for(TInt i=0; i<count; i++)
+        {
+        pPolicy = policies[i];
+        if(pPolicy)
+            {
+                TPtrC8 id = PolicyIdL(pPolicy);
+                TPtrC8 name = PolicyNameL(pPolicy);
+                if(id != KNullDesC8() && name != KNullDesC8())
+                RegisterPolicy(id, pPolicy);
+            }
+        }
+    }
+    
+    CleanupStack::PopAndDestroy(); // policies
+}
+EXPORT_C void CPolicyRegistry::ResetRegistry()
+{
+    iRegistry.Reset();
+}
+
+TPtrC8 CPolicyRegistry::PolicyIdL(CSenElement* aPolicy)
+{
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name().Compare(WSPolicy::KWsuId) == 0)
+            {
+             return bs->Value();
+            }
+         }
+
+    return KNullDesC8();
+}
+TPtrC8 CPolicyRegistry::PolicyNameL(CSenElement* aPolicy)
+{
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+
+        if(bs->Name().Compare(WSPolicy::KName) == 0)
+            {
+             return bs->Value();
+            }
+         }
+
+    return KNullDesC8();
+}
+
+
+EXPORT_C void CPolicyRegistry::SetParent(CPolicyRegistry* aParent)
+{
+    iParent = aParent;
+}
+EXPORT_C CPolicyRegistry* CPolicyRegistry::Parent()
+{
+    return iParent;
+}
+
+EXPORT_C CSenElement* CPolicyRegistry::LookupPolicyByNameL(const TPtrC8& aPolicyName)	//codescannerwarnings
+{
+    if(aPolicyName.Length() <1)
+        return NULL;
+    
+    TInt count = iRegistry.Count();
+    
+    for (TInt i = 0; i< count; i++)
+    {
+      CSenElement* policy = (CSenElement*)iRegistry.ValueAt(i);
+      
+      if(policy)
+      {
+        TPtrC8 name = PolicyNameL(policy);
+        TPtrC8 policyUri = CWSPolicyUtils::PolicyUriL(policy);
+        if(name != KNullDesC8() && (name.Compare(aPolicyName) == 0 
+                                || policyUri.Compare(aPolicyName) == 0))
+        {
+            return  policy;  
+        }
+      }
+        
+    }
+
+    return NULL;
+}
+EXPORT_C CSenElement* CPolicyRegistry::LookupPolicy(const TPtrC8& aPolicyID)
+{
+
+    TInt index = iRegistry.Find(aPolicyID);
+    if(index!=KErrNotFound)
+    {
+        CSenElement* policy = (CSenElement*)iRegistry.ValueAt(index);
+        TDesC8* policyId(iRegistry.KeyAt(index));
+
+        if (policy == NULL && iParent != NULL) 
+        {//No recursive calls as it is a flat array of policies
+//            policy = iParent->LookupPolicy(aPolicyURI);
+        }
+        
+        return policy;
+    }
+    else
+    return NULL;
+}
+EXPORT_C void CPolicyRegistry::RegisterPolicy(TDesC8& aPolicyID, CSenElement* aPolicy)
+{
+    
+    TInt index = iRegistry.Find(aPolicyID);
+    if(index == KErrNotFound)
+    {
+        TInt  append = iRegistry.Append(aPolicyID.Alloc(), aPolicy);    
+//        if(append==KErrNone) { }
+    }
+    
+}
+EXPORT_C void CPolicyRegistry::UnregisterPolicy(const TPtrC8& aPolicyID)
+{
+    TInt  retVal = iRegistry.RemoveByKey(aPolicyID);
+    if(retVal == KErrNone)
+    {
+        
+    }
+                
+}
+CPolicyRegistry::CPolicyRegistry():
+iRegistry(ETrue,EFalse),
+iParent(NULL)
+{
+    
+}
+void CPolicyRegistry::ConstructL()
+{
+//    if(aParent != NULL)
+//     iParent = aParent;       
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/wspolicyutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,239 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "wspolicyutils.h"
+#include "SenDateUtils.h"
+#include "SenXmlElement.h"
+#include "senattributes.h"
+#include "policyassertion.h"
+#include "xorcompositeassertion.h"
+#include "andcompositeassertion.h"
+#include "wspolicyreader.h"
+using namespace WSPolicy;
+using namespace MSWSPolicy;
+
+
+CPolicyAssertion* CWSPolicyUtils::GetSinglePolicyL(RPolicyTerms& policyList, CPolicyRegistry* reg)
+{
+		CPolicyAssertion* policyTerm = NULL;
+		CPolicyAssertion* policyTerm2 = NULL;
+
+		for(TInt i = 0; i < policyList.Count() ; i++)
+
+		{
+			policyTerm2 = (CPolicyAssertion*) policyList[i];
+			if(policyTerm == NULL)
+			{
+			   policyTerm = policyTerm2; 
+			}
+			else
+			{
+			    policyTerm = (CPolicyAssertion*)policyTerm->MergeL(policyTerm2, reg);
+			}
+		}
+
+		if (policyTerm && (!policyTerm->IsNormalized())) 
+		{
+			policyTerm = (CPolicyAssertion*) policyTerm->NormalizeL();
+		}
+		
+		return policyTerm;
+	}
+
+void CWSPolicyUtils::GetPrimTermsListL(CPolicyAssertion* policy, RPolicyTerms& aTerms) 
+{
+	MAssertion* norm = policy;
+	if (!policy->IsNormalized())
+	{
+		norm = (CPolicyAssertion*) policy->NormalizeL();
+	}
+
+	CXorCompositeAssertion* xorTerm = (CXorCompositeAssertion*) norm->GetTerms()[0];
+	CAndCompositeAssertion* andTerm = (CAndCompositeAssertion*) xorTerm->GetTerms()[0];
+
+    RPolicyTerms terms = andTerm->GetTerms();
+    TInt count = terms.Count();
+    for(TInt i = 0; i<count ; i++)
+    {
+        MAssertion* asser = terms[i];
+        aTerms.Append(asser);
+    }
+}
+	
+CPolicyAssertion* CWSPolicyUtils::GetPolicy(RPolicyTerms& /*terms*/)
+{
+//implemented in PrimitiveAssertion
+return KErrNone;
+}
+
+
+EXPORT_C TPtrC8 CWSPolicyUtils::PolicyIdL(CSenElement* aPolicy)
+{
+
+    if(aPolicy == NULL) { return KNullDesC8(); }
+
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+            {
+            if(bs->Name().Compare(KWsuId) == 0)
+                {
+                return bs->Value();
+                }
+            }
+         }    
+    return KNullDesC8();
+}
+
+EXPORT_C TPtrC8 CWSPolicyUtils::PolicyNameL(CSenElement* aPolicy)
+{
+
+    if(aPolicy == NULL) { return KNullDesC8(); }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(KName) == 0)
+            {
+                 return bs->Value();
+            }
+         }
+
+            
+        }
+    return KNullDesC8();
+}
+
+EXPORT_C TPtrC8 CWSPolicyUtils::PolicyUriL(CSenElement* aPolicy)
+{
+
+    if(aPolicy == NULL) { return KNullDesC8(); }
+    
+    RPointerArray<CSenBaseAttribute>& attrs = aPolicy->AttributesL();
+    
+    CSenBaseAttribute* bs = NULL;
+    TInt ele_count = attrs.Count();
+         
+    for (TInt j=0; j < ele_count; j++)
+        {
+            
+        bs = (attrs)[j];
+        if(bs)
+        {
+            if(bs->Name().Compare(MSWSPolicy::KMetaDataLocalName) == 0)
+            {
+                 return bs->Value();
+            }
+         }
+
+            
+        }
+    return KNullDesC8();
+}
+EXPORT_C TBool CWSPolicyUtils::IsExpiredPolicyL(CSenElement* aPolicy)
+{
+    if(aPolicy == NULL) { return ETrue; }
+    
+    CSenElement* expiry = GetExpiryTagL(aPolicy);
+    if(expiry and expiry->HasContent())
+    {
+        TPtrC8 expiryTime = expiry->Content();
+     
+        TTime now;
+        now.UniversalTime();
+     
+        TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+        SenDateUtils::ToXmlDateTimeUtf82L(ts, now);
+        
+        if(ts > expiryTime)
+            return ETrue;
+        else
+            return EFalse;
+    }
+    return EFalse; 
+}
+CSenElement* CWSPolicyUtils::GetExpiryTagL(CSenElement* aPolicy)
+{
+    CSenElement* documentRoot = (CSenElement*)&aPolicy->Root();
+    if(documentRoot)     
+    {
+        RPointerArray<CSenElement> timeStamps;
+        CleanupClosePushL(timeStamps);       
+        CSenElement* validity = NULL;
+        const CSenNamespace* msNsUri = documentRoot->Namespace(MSWSPolicy::KMSNsPrefix);
+        if(msNsUri)
+            {
+            if(documentRoot->ElementsL(timeStamps, msNsUri->URI(), MSWSPolicy::KMetaDataValidity) == KErrNone)    
+                {
+                TInt validityStampsCount = timeStamps.Count();
+                
+                if(validityStampsCount > 0)
+                    {
+                    validity = timeStamps[0];//mws:metadatavalidity 
+                    CleanupStack::PopAndDestroy();
+                    return validity->Element(msNsUri->URI(), MSWSPolicy::KExpiry);
+                    }
+                }
+            
+            }
+        else
+            {
+            if(documentRoot->ElementsL(timeStamps, MSWSPolicy::KMetaDataValidity) == KErrNone)
+                {
+                        
+                TInt validityStampsCount = timeStamps.Count();
+                
+                if(validityStampsCount > 0)
+                    {
+                    validity = timeStamps[0];//mws:metadatavalidity 
+                    CleanupStack::PopAndDestroy();
+                    return validity->Element(MSWSPolicy::KExpiry);
+                    }
+                }
+            
+            }
+
+        CleanupStack::PopAndDestroy();
+    }
+    return NULL;
+}
+	
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/wspolicywriter.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,388 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include "wspolicywriter.h"
+#include "wspolicyreader.h"
+
+#include "policyassertion.h"
+#include "andcompositeassertion.h"
+#include "xorcompositeassertion.h"
+#include "assertion.h"
+#include "primitiveassertion.h"
+#include "policyreferenceassertion.h"
+using namespace WSPolicy;
+using namespace PolicyWriter;    
+
+CWSPolicyWriter* CWSPolicyWriter::NewL()
+{
+     CWSPolicyWriter* pSelf = CWSPolicyWriter::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CWSPolicyWriter* CWSPolicyWriter::NewLC()
+{
+       CWSPolicyWriter* pSelf = new (ELeave) CWSPolicyWriter();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+     
+}
+CWSPolicyWriter::~CWSPolicyWriter()
+{
+    iNamespcaes.Reset();
+}
+CWSPolicyWriter::CWSPolicyWriter():iNamespcaes(ETrue,ETrue)
+{
+}
+void CWSPolicyWriter::ConstructL()
+{
+count = 0;    
+}
+
+TPtrC8 CWSPolicyWriter::WriteToBufL(CBufBase& aBuf, CPolicyAssertion* aEle)
+    {
+    RBufWriteStream bufWs(aBuf);
+    CleanupClosePushL(bufWs);
+    WritePolicyL(aEle, bufWs);
+    CleanupStack::PopAndDestroy(); // bufWs.Close();
+//    TPtrC8 p = aBuf.Ptr(0);
+//    TInt size(p.Length());
+    iNamespcaes.Reset();
+    return aBuf.Ptr(0);
+    }
+HBufC8* CWSPolicyWriter::WriteAllAsXMlL(CPolicyAssertion* aPolicy)
+{
+   if(!aPolicy)
+    return NULL;
+   
+    CBufFlat *pBuf = CBufFlat::NewL(128);
+    CleanupStack::PushL(pBuf);
+    TPtrC8 p = WriteToBufL(*pBuf, aPolicy);
+
+    TInt size(p.Length());
+    HBufC8* pRet = NULL; //p.AllocL();   
+    
+    if (size > 0)
+    {
+        pRet = HBufC8::NewLC(size);
+        TPtr8 retP = pRet->Des();
+        retP.Copy(p.Ptr(),size);
+        CleanupStack::Pop(); //pRet
+        WriteToFileAllL(retP);            
+    }
+    
+    CleanupStack::PopAndDestroy(); // pBuf;
+    iNamespcaes.Reset();    
+    return pRet;    
+}
+HBufC8* CWSPolicyWriter::WriteAllAsXmlL(CSenElement* /*aXml*/)
+{
+return NULL;    
+}
+         
+TInt CWSPolicyWriter::WritePolicyL(CPolicyAssertion* aEle, RWriteStream& aWriteStream)
+{
+    aWriteStream.WriteL(KStartElement);
+    aWriteStream.WriteL(KWspPolicyPrefix);
+    TPtrC8 name(KSenXmlNsAttNamePlusColonWsp);
+    if(IsNamespaceAdded(name) == KErrNotFound)
+    {
+        aWriteStream.WriteL(KSenXmlNsAttNamePlusColonWsp); //namespace
+        aWriteStream.WriteL(KSenEqualsDblQuot);
+        aWriteStream.WriteL(KWsPolicyNsUri); //namespace
+        aWriteStream.WriteL(KSenDblQuot);
+        TPtrC8 nameuri(KWsPolicyNsUri);
+        AddNameSpaceL(name, nameuri);	//codescannerwarnings
+    }
+    
+/*
+		if (policy.getId() != null) {
+
+			writer.writeNamespace(PolicyConstants.WSU_NAMESPACE_PREFIX,
+					PolicyConstants.WSU_NAMESPACE_URI);
+			writer.setPrefix(PolicyConstants.WSU_NAMESPACE_PREFIX,
+					PolicyConstants.WSU_NAMESPACE_URI);
+
+			writer.writeAttribute("wsu", PolicyConstants.WSU_NAMESPACE_URI,
+					"Id", policy.getId());
+		}
+*/
+		RPolicyTerms terms = aEle->GetTerms();
+		
+		if(terms.Count() > 0)
+		{
+		    aWriteStream.WriteL(KSenGreaterThan);		    
+       		for (TInt i = 0; i< terms.Count(); i++) 
+       		{
+			MAssertion* term = terms[i];
+			WriteAssertionL(term, aWriteStream);
+		    }
+		}
+		else
+		{
+		    aWriteStream.WriteL(KSenGreaterThan);
+		}
+        
+        
+        aWriteStream.WriteL(KSenLessThanSlash);
+        aWriteStream.WriteL(KWspPolicyPrefix);
+		aWriteStream.WriteL(KSenGreaterThan);
+
+        return KErrNone;
+}
+TInt CWSPolicyWriter::WriteAndAssertionL(CAndCompositeAssertion* aEle, RWriteStream& aWriteStream)
+{
+    aWriteStream.WriteL(KStartElement);
+    aWriteStream.WriteL(KWspAndPrefix);
+    aWriteStream.WriteL(KSenGreaterThan);
+	RPolicyTerms terms = aEle->GetTerms();
+	
+	if(terms.Count() > 0)
+	{
+    	WriteTermsL(terms, aWriteStream);
+	}
+		
+    aWriteStream.WriteL(KSenLessThanSlash);
+    aWriteStream.WriteL(KWspAndPrefix);
+    aWriteStream.WriteL(KSenGreaterThan);  
+    
+    return KErrNone; 
+}
+TInt CWSPolicyWriter::WriteXorAssertionL(CXorCompositeAssertion* aEle, RWriteStream& aWriteStream)
+{
+    aWriteStream.WriteL(KStartElement);
+    aWriteStream.WriteL(KWspXorPrefix);
+    aWriteStream.WriteL(KSenGreaterThan);
+	RPolicyTerms terms = aEle->GetTerms();
+	
+	if(terms.Count() > 0)
+	{
+    	WriteTermsL(terms, aWriteStream);
+	}
+
+		
+    aWriteStream.WriteL(KSenLessThanSlash);
+    aWriteStream.WriteL(KWspXorPrefix);
+    aWriteStream.WriteL(KSenGreaterThan);  
+    return KErrNone; 
+}
+TInt CWSPolicyWriter::WriteAssertionL(MAssertion* aEle, RWriteStream& aWriteStream)
+{
+    if(!aEle)
+        return KErrNone; 
+    
+		if (aEle->Type() == EPrimitiveType)
+		{
+			WritePrimitiveAssertionL((CPrimitiveAssertion*) aEle, aWriteStream);
+
+		}
+		else if (aEle->Type() == ECompositeXorType)
+		{
+			WriteXorAssertionL((CXorCompositeAssertion*) aEle,	aWriteStream);
+		}
+		else if (aEle->Type()== EPolicyReferenceType ) 
+		{
+			WritePolicyReferenceL((CPolicyReferenceAssertion*)aEle, aWriteStream);
+		} 
+		else if (aEle->Type() == ECompositePolicyType)
+		{
+			WritePolicyL((CPolicyAssertion*) aEle, aWriteStream);
+		
+		}
+		else if (aEle->Type() == ECompositeAndType)
+		{
+			WriteAndAssertionL((CAndCompositeAssertion*) aEle,aWriteStream);
+
+		} 
+		else 
+		{
+		}
+    
+        return KErrNone;
+}
+TInt CWSPolicyWriter::WritePolicyReferenceL(CPolicyReferenceAssertion* aAssertion, RWriteStream& aWriteStream)
+{
+
+    aWriteStream.WriteL(KStartElement);
+    aWriteStream.WriteL(KWspPolicyReferencePrefix);
+    aWriteStream.WriteL(KSenSpace);
+    aWriteStream.WriteL(KWspPolicyReferenceUri);
+
+    aWriteStream.WriteL(KSenEqualsDblQuot);
+    aWriteStream.WriteL(aAssertion->PolicyUri());
+    aWriteStream.WriteL(KSenDblQuot);
+    aWriteStream.WriteL(KSenGreaterThan);
+    
+    
+    aWriteStream.WriteL(KSenLessThanSlash);
+    aWriteStream.WriteL(KWspPolicyReferencePrefix);
+    aWriteStream.WriteL(KSenGreaterThan);  
+
+    return KErrNone;
+}
+TInt CWSPolicyWriter::WritePrimitiveAssertionL(CPrimitiveAssertion* aAssertion, RWriteStream& aWriteStream)
+{
+	TPtrC8 qname = aAssertion->Name();
+	aWriteStream.WriteL(KStartElement);
+    aWriteStream.WriteL(qname);
+
+    TBuf8<200> name(KSenXmlNsAttNamePlusColon);
+    name.Append(aAssertion->iQname->Prefix());
+//    if(IsNamespaceAdded(name) == KErrNotFound)
+    {
+        aWriteStream.WriteL(name); //namespace
+        aWriteStream.WriteL(KSenEqualsDblQuot);
+        aWriteStream.WriteL(aAssertion->iQname->Uri()); //namespace
+        aWriteStream.WriteL(KSenDblQuot);
+        TPtrC8 nameuri(aAssertion->iQname->Uri());
+        AddNameSpaceL(name, nameuri);	//codescannerwarnings
+    }
+    
+	WriteAttributesL(aAssertion, aWriteStream);
+    aWriteStream.WriteL(KSenGreaterThan);	
+    
+    TPtrC8 strValue = aAssertion->StrValue();    
+
+	if (strValue != KNullDesC8()) {
+	
+		aWriteStream.WriteL(strValue);
+	}
+
+    
+	RPolicyTerms terms = aAssertion->GetTerms();
+	if(terms.Count() > 0)
+	{
+	    
+    	WriteTermsL(terms, aWriteStream);
+	}
+
+	aWriteStream.WriteL(KSenLessThanSlash);
+    aWriteStream.WriteL(qname);
+    aWriteStream.WriteL(KSenGreaterThan);   
+    return KErrNone; 
+}
+TInt CWSPolicyWriter::WriteTermsL(RPointerArray<MAssertion>& aTerms, RWriteStream& aWriteStream)
+{
+
+    for (TInt i=0; i<aTerms.Count(); i++ )
+    {
+        CAssertion* obj = (CAssertion*)aTerms[i];
+        if(obj)
+        {
+            WriteAssertionL(obj, aWriteStream);
+        }
+    }
+    return KErrNone;
+}
+void WriteAttrToL(RWriteStream& aWriteStream, TDesC8& aName, TDesC8& aValue)
+{
+    aWriteStream.WriteL(KSenSpace);
+    aWriteStream.WriteL(aName);
+    aWriteStream.WriteL(KSenEqualsDblQuot);
+    aWriteStream.WriteL(aValue);
+    aWriteStream.WriteL(KSenDblQuot);    
+}
+
+void CWSPolicyWriter::WriteAttributesL(CPrimitiveAssertion* aAssertion, RWriteStream& aWriteStream)
+{
+
+	RAttributeMap& attributes = aAssertion->Attributes();
+	
+	TInt attCount = attributes.Count();
+	
+	for (TInt i=0; i<attCount; i++ )
+    {
+        const TDesC8* nameptr= attributes.KeyAt(i);
+        const TDesC8* valptr= attributes.ValueAt(i);
+        HBufC8* tt = nameptr->AllocL();
+        HBufC8* tt2 = valptr->AllocL();
+        TPtrC8 name =  tt->Des();   
+        TPtrC8 value =  tt2->Des();
+        WriteAttrToL(aWriteStream, name, value);
+        delete tt;
+        delete tt2;
+        
+    }
+}
+
+TPtrC8 CWSPolicyWriter::GetAttrib(TPtrC8 /*aReference*/, CSenElement* /*aEle*/)
+{
+    return KNullDesC8();
+}
+TBool CWSPolicyWriter::IsNamespaceAdded(TPtrC8 aName)
+{
+    return iNamespcaes.Find(aName);
+}
+
+TInt CWSPolicyWriter::AddNameSpaceL(TPtrC8 aName, TPtrC8 aUri)	//codescannerwarnings
+{
+    if(IsNamespaceAdded(aName) == KErrNotFound)
+    {
+        return iNamespcaes.Append(aName.AllocL(),aUri.AllocL());            
+    }
+    return KErrGeneral;
+}
+
+//#ifdef _SENDEBUG  
+void CWSPolicyWriter::WriteToFileAllL(CSenElement* aXml)
+{
+  RFs fss;
+  User::LeaveIfError(fss.Connect());
+  CleanupClosePushL(fss);
+    
+  TBuf<255> file;
+  _LIT( KFileName, "c:\\logs\\normalizer%d.xml");
+  file.Format(KFileName, count);
+  count++;
+  TPtrC OutputFile(file);
+    
+   RFile  xmlFile;
+   xmlFile.Replace(fss , OutputFile, EFileWrite );
+   HBufC8* temp = aXml->AsXmlL();
+   CleanupStack::PushL(temp);
+   xmlFile.Write(temp->Des());
+   xmlFile.Close();
+   CleanupStack::PopAndDestroy(temp);
+   CleanupStack::PopAndDestroy(1); // fss
+}
+void CWSPolicyWriter::WriteToFileAllL(TDesC8& aXml)
+{
+  RFs fss;
+  User::LeaveIfError(fss.Connect());
+  CleanupClosePushL(fss);
+    
+  TBuf<255> file;
+  _LIT( KFileName, "c:\\logs\\normalizer%d.xml");
+  file.Format(KFileName, count);
+  count++;
+  TPtrC OutputFile(file);
+    
+   RFile  xmlFile;
+   xmlFile.Replace(fss , OutputFile, EFileWrite );
+   xmlFile.Write(aXml);
+   xmlFile.Close();
+   CleanupStack::PopAndDestroy(1); // fss
+}
+
+//#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsstar/wsstarpolicy/src/xorcompositeassertion.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,388 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include "xorcompositeassertion.h"
+#include "andcompositeassertion.h"
+#include "primitiveassertion.h"
+#include "policyassertion.h"
+
+
+CXorCompositeAssertion* CXorCompositeAssertion::NewL()
+{
+    CXorCompositeAssertion* pSelf = CXorCompositeAssertion::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CXorCompositeAssertion* CXorCompositeAssertion::NewLC()
+{
+     CXorCompositeAssertion* pSelf = new (ELeave) CXorCompositeAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+   
+}
+CXorCompositeAssertion* CXorCompositeAssertion::NewL(CXorCompositeAssertion* aValue)
+{
+    CXorCompositeAssertion* pSelf = CXorCompositeAssertion::NewLC(aValue);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    
+}
+CXorCompositeAssertion* CXorCompositeAssertion::NewLC(CXorCompositeAssertion* aValue)
+{
+     CXorCompositeAssertion* pSelf = new (ELeave) CXorCompositeAssertion();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL(aValue);
+    return pSelf;
+    
+}
+
+CXorCompositeAssertion::~CXorCompositeAssertion()
+{
+    
+}
+CXorCompositeAssertion::CXorCompositeAssertion()
+{
+    
+}
+void CXorCompositeAssertion::ConstructL(CXorCompositeAssertion* aValue)
+{
+    ConstructL();
+
+    RPolicyTerms terms = aValue->GetTerms();
+    
+    if(terms.Count() > 0)
+        AddTermsCopyL(terms);
+    
+//    terms.Close();
+
+}
+void CXorCompositeAssertion::ConstructL()
+{
+    
+}
+
+//from CAssertion
+TAssertionType CXorCompositeAssertion::Type()
+{
+  return ECompositeXorType;    
+}
+void CXorCompositeAssertion::AddTerm(MAssertion* aAssertion)
+{
+	if ( IsNormalized() 
+	    && (aAssertion->Type() == ECompositeAndType) 
+	    && (aAssertion->IsNormalized()
+	    ))
+	{
+			SetNormalized(EFalse);
+	}
+	CAssertion::AddTerm(aAssertion);
+}
+void CXorCompositeAssertion::AddTermCopyL(MAssertion* aAssertion)
+{
+	if ( IsNormalized() 
+	    && (aAssertion->Type() == ECompositeAndType) 
+	    && (aAssertion->IsNormalized()
+	    ))
+	{
+			SetNormalized(EFalse);
+	}
+	CAssertion::AddTermCopyL(aAssertion);
+    
+}
+MAssertion*	CXorCompositeAssertion::NormalizeL(CPolicyRegistry* aRegistry)
+{
+	if (IsNormalized()) {
+			return this;
+		}
+
+		CXorCompositeAssertion* XOR = CXorCompositeAssertion::NewL();
+
+		if (IsEmpty()) {
+			XOR->SetNormalized(true);
+			return XOR;
+		}
+
+		RPointerArray<MAssertion> terms1 = GetTerms();
+        TInt termCount = terms1.Count();
+        for (TInt i = 0; i< termCount; i++)
+        {
+        
+			MAssertion* term = terms1[i];
+			MAssertion* result = term;
+			if(!dynamic_cast<CPolicyAssertion*>(term))
+			{
+			    result = term->NormalizeL(aRegistry);
+			}
+
+			if (dynamic_cast<CPolicyAssertion*>(result))
+			{
+				CAndCompositeAssertion* wrapper = CAndCompositeAssertion::NewL();
+				
+				RPolicyTerms termsPol1 = result->GetTerms();
+				wrapper->AddTermsCopyL(termsPol1);
+
+    			if(result != term)
+    			{
+                    CPolicyAssertion* eleToDel = (CPolicyAssertion*)result;
+                    delete eleToDel;
+    			}
+				result = NULL;
+				
+				result = wrapper->NormalizeL(aRegistry);
+				delete wrapper;
+
+				if (dynamic_cast<CAndCompositeAssertion*>(result))
+				{
+					XOR->AddTerm(result);
+				}
+				else
+				{
+				    RPolicyTerms termsPol2 = result->GetTerms();
+					XOR->AddTermsCopyL(termsPol2);
+					
+					CPolicyAssertion* eleToDel = (CPolicyAssertion*)result;
+					delete eleToDel;
+//					termsPol2.Close();
+				}
+				continue;
+			}
+            
+            if (dynamic_cast<CPrimitiveAssertion*>(result)) 
+			{
+				CAndCompositeAssertion* wrapper = CAndCompositeAssertion::NewL();
+				wrapper->AddTermCopyL(result);
+				XOR->AddTerm(wrapper);
+				CPrimitiveAssertion* eleToDel = (CPrimitiveAssertion*)result;
+				delete eleToDel;
+				result = NULL;
+				continue;
+			}
+			
+			if (dynamic_cast<CXorCompositeAssertion*>(result)) 
+			{
+			    RPolicyTerms termsPol3 = result->GetTerms();
+				XOR->AddTermsCopyL(termsPol3);
+				CXorCompositeAssertion* eleToDel = (CXorCompositeAssertion*)result;				
+                delete eleToDel;				
+				continue;
+			}
+			
+			if (dynamic_cast<CAndCompositeAssertion*>(result)) 
+			{
+				XOR->AddTerm(result);
+			}
+		}
+//        terms1.Close();
+		XOR->SetNormalized(ETrue);
+		return XOR;    
+}
+MAssertion* CXorCompositeAssertion::IntersectL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+    MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+
+    if (!(dynamic_cast<CXorCompositeAssertion*>(normalizedMe))) 
+    {
+    	return normalizedMe->IntersectL(aAssertion, aRegistry);
+    }
+
+    MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+    short type = target->Type();
+    
+    RPolicyTerms terms = normalizedMe->GetTerms();
+    
+    switch (type) {
+
+    case ECompositePolicyType: {
+    	CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+        CXorCompositeAssertion* term = (CXorCompositeAssertion*)terms[0];
+    	nPOLICY->AddTerm(term->IntersectL(target, NULL));
+    	return nPOLICY;
+    }
+
+    case ECompositeXorType: {
+    	CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+
+    	MAssertion* asser = NULL;
+    	CAndCompositeAssertion* AND;
+
+    	for (TInt i=0; i< terms.Count(); i++) 
+    	{
+    		AND = (CAndCompositeAssertion*)terms[i];
+            RPolicyTerms tgtTerms = target->GetTerms();
+    		for (TInt j=0; j< tgtTerms.Count(); j++) 
+    		{
+    		    asser = NULL;
+    			asser = AND->IntersectL((CAndCompositeAssertion*)tgtTerms[j], NULL);
+
+    			if (dynamic_cast<CAndCompositeAssertion*>(asser)) 
+    			{
+    				nXOR->AddTerm(asser);
+    			}
+    			else
+    			{
+    			    DeleteAssertion(asser);
+    			}
+
+    			
+    			
+    		}
+    	}
+
+    	return nXOR;
+    }
+
+    case ECompositeAndType: {
+    	CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+    	MAssertion* asser;
+    	
+    	for (TInt i=0; i< terms.Count(); i++) 
+    	{
+    		asser = ((CAndCompositeAssertion*) terms[i])->IntersectL(target, NULL);
+
+    		if (dynamic_cast<CAndCompositeAssertion*>(asser)) 
+    		{
+    			nXOR->AddTerm(asser);
+    		}
+            else
+            {
+                DeleteAssertion(asser);
+            }
+    	}
+    	return nXOR;
+    }
+
+    case EPrimitiveType: {
+    	CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+
+    	MAssertion* asser;
+        for (TInt i=0; i< terms.Count(); i++) 
+    	{
+    		asser = ((CAndCompositeAssertion*)terms[i])->IntersectL(target, NULL);
+
+    		if (dynamic_cast<CAndCompositeAssertion*>(asser)) 
+    		{
+    			nXOR->AddTerm(asser);
+    		}
+            else
+            {
+                DeleteAssertion(asser);
+            }
+    		
+    	}
+    	return nXOR;
+    }
+
+    default: {
+    }
+
+    }
+return NULL;    
+}
+MAssertion* CXorCompositeAssertion::MergeL(MAssertion* aAssertion, CPolicyRegistry* aRegistry)
+{
+	MAssertion* normalizedMe = (IsNormalized()) ? this : NormalizeL(aRegistry);
+
+	if (!(dynamic_cast<CXorCompositeAssertion*>(normalizedMe)))
+	{
+		return normalizedMe->MergeL(aAssertion, aRegistry);
+	}
+
+	MAssertion* target = (aAssertion->IsNormalized()) ? aAssertion : aAssertion->NormalizeL(aRegistry);
+
+	short type = target->Type();
+
+	switch (type) 
+	{
+
+    	case ECompositePolicyType: 
+    	{
+
+    		CPolicyAssertion* nPOLICY = CPolicyAssertion::NewL();
+    		nPOLICY->AddTerm(normalizedMe->MergeL(target->GetTerms()[0]));
+    		return nPOLICY;
+    	}
+
+    	case ECompositeXorType: 
+    	{
+
+    		CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+            RPolicyTerms xTerms = normalizedMe->GetTerms();
+    		for (TInt i=0; i< xTerms.Count(); i++)
+    		{
+    			CAndCompositeAssertion* AND = (CAndCompositeAssertion*) xTerms[i];
+
+                RPolicyTerms targetTerms = target->GetTerms();
+    	    	for (TInt j=0; j< targetTerms.Count(); j++)
+    			{
+                    MAssertion* tgtTerm = targetTerms[j];
+    				nXOR->AddTerm(AND->MergeL(tgtTerm, NULL)); 
+    			}
+
+    			if (target->IsEmpty() && AND->IsEmpty()) { 
+    				/*
+    				 * " <wsp:ExactlyOne> <wsp:All/>
+    				 * </wsp:ExactlyOne>".intersect(" <wsp:ExactlyOne/>")
+    				 */
+    				nXOR->AddTermCopyL(AND);
+    			}
+    		}
+
+    		return nXOR;
+    	}
+
+    	case ECompositeAndType: 
+    	{
+
+    		CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+            RPolicyTerms xTerms = normalizedMe->GetTerms();
+    		for (TInt i=0; i< xTerms.Count(); i++)
+    		{
+    			CAndCompositeAssertion* term = (CAndCompositeAssertion*)xTerms[i];
+    			nXOR->AddTerm(term->MergeL(target, NULL)); 
+    		}
+    		return nXOR;
+    	}
+
+    	case EPrimitiveType: 
+    	{
+    		CXorCompositeAssertion* nXOR = CXorCompositeAssertion::NewL();
+
+            RPolicyTerms xTerms = normalizedMe->GetTerms();
+    		for (TInt i=0; i< xTerms.Count(); i++)
+    		{
+    		    CAndCompositeAssertion*  tgtTerm =  (CAndCompositeAssertion*)xTerms[i];
+    		    nXOR->AddTerm(tgtTerm->MergeL(target, NULL)); 
+    		}
+
+    		return nXOR;
+    	}
+
+    	default: 
+    	{
+    	}
+
+	}
+return NULL;	    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/BMARM/SENUTILSU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,218 @@
+EXPORTS
+	__20CSenWsSecurityHeader @ 1 NONAME R3UNUSED ; CSenWsSecurityHeader::CSenWsSecurityHeader(void)
+	AddSecurityTokenL__15CSenSoapMessageRC6TDesC8 @ 2 NONAME R3UNUSED ; CSenSoapMessage::AddSecurityTokenL(TDesC8 const &)
+	BaseConstructL__15CSenSoapMessage @ 3 NONAME R3UNUSED ; CSenSoapMessage::BaseConstructL(void)
+	BaseConstructL__16CSenSoapEnvelope @ 4 NONAME R3UNUSED ; CSenSoapEnvelope::BaseConstructL(void)
+	BaseConstructL__20CSenWsSecurityHeader @ 5 NONAME R3UNUSED ; CSenWsSecurityHeader::BaseConstructL(void)
+	BaseConstructL__20CSenWsSecurityHeaderRC6TDesC8 @ 6 NONAME R3UNUSED ; CSenWsSecurityHeader::BaseConstructL(TDesC8 const &)
+	BodyAsStringL__16CSenSoapEnvelope @ 7 NONAME R3UNUSED ; CSenSoapEnvelope::BodyAsStringL(void)
+	BodyL__16CSenSoapEnvelope @ 8 NONAME R3UNUSED ; CSenSoapEnvelope::BodyL(void)
+	ConstructL__13CSenSoapFaultR11CSenElement @ 9 NONAME R3UNUSED ; CSenSoapFault::ConstructL(CSenElement &)
+	ConstructL__13CSenSoapFaultRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 10 NONAME ; CSenSoapFault::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	DetachFaultL__16CSenSoapEnvelope @ 11 NONAME R3UNUSED ; CSenSoapEnvelope::DetachFaultL(void)
+	Detail__13CSenSoapFault @ 12 NONAME R3UNUSED ; CSenSoapFault::Detail(void)
+	EndElementL__16CSenSoapEnvelopeRC6TDesC8N21 @ 13 NONAME ; CSenSoapEnvelope::EndElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	FaultActor__13CSenSoapFault @ 14 NONAME R3UNUSED ; CSenSoapFault::FaultActor(void)
+	FaultCode__13CSenSoapFault @ 15 NONAME R3UNUSED ; CSenSoapFault::FaultCode(void)
+	FaultL__16CSenSoapEnvelope @ 16 NONAME R3UNUSED ; CSenSoapEnvelope::FaultL(void)
+	FaultString__13CSenSoapFault @ 17 NONAME R3UNUSED ; CSenSoapFault::FaultString(void)
+	FromXmlDateTimeL__12SenDateUtilsRC6TDesC8 @ 18 NONAME R3UNUSED ; SenDateUtils::FromXmlDateTimeL(TDesC8 const &)
+	GetRandomGuid16LC__11CSenGuidGen @ 19 NONAME R3UNUSED ; CSenGuidGen::GetRandomGuid16LC(void)
+	GetRandomGuid8LC__11CSenGuidGen @ 20 NONAME R3UNUSED ; CSenGuidGen::GetRandomGuid8LC(void)
+	GetRandomGuidLC__11CSenGuidGen @ 21 NONAME R3UNUSED ; CSenGuidGen::GetRandomGuidLC(void)
+	HeaderL__16CSenSoapEnvelope @ 22 NONAME R3UNUSED ; CSenSoapEnvelope::HeaderL(void)
+	IsFault__16CSenSoapEnvelope @ 23 NONAME R3UNUSED ; CSenSoapEnvelope::IsFault(void)
+	NewLC__11CSenGuidGen @ 24 NONAME R3UNUSED ; CSenGuidGen::NewLC(void)
+	NewL__11CSenGuidGen @ 25 NONAME R3UNUSED ; CSenGuidGen::NewL(void)
+	NewL__13CSenSoapFaultR11CSenElement @ 26 NONAME R3UNUSED ; CSenSoapFault::NewL(CSenElement &)
+	NewL__13CSenSoapFaultRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 27 NONAME ; CSenSoapFault::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	NewL__15CSenSoapMessage @ 28 NONAME R3UNUSED ; CSenSoapMessage::NewL(void)
+	NewL__16CSenSoapEnvelope @ 29 NONAME R3UNUSED ; CSenSoapEnvelope::NewL(void)
+	NewL__20CSenWsSecurityHeader @ 30 NONAME R3UNUSED ; CSenWsSecurityHeader::NewL(void)
+	NewL__20CSenWsSecurityHeaderRC6TDesC8 @ 31 NONAME R3UNUSED ; CSenWsSecurityHeader::NewL(TDesC8 const &)
+	NewSecurityHeaderLC__15CSenSoapMessagePC6TDesC8 @ 32 NONAME R3UNUSED ; CSenSoapMessage::NewSecurityHeaderLC(TDesC8 const *)
+	ParseHeaderL__15CSenSoapMessageRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 33 NONAME ; CSenSoapMessage::ParseHeaderL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	ParseHeaderL__16CSenSoapEnvelopeRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 34 NONAME ; CSenSoapEnvelope::ParseHeaderL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	SetBodyL__16CSenSoapEnvelopeRC6TDesC8 @ 35 NONAME R3UNUSED ; CSenSoapEnvelope::SetBodyL(TDesC8 const &)
+	SetSecurityHeaderL__15CSenSoapMessageRC6TDesC8 @ 36 NONAME R3UNUSED ; CSenSoapMessage::SetSecurityHeaderL(TDesC8 const &)
+	SetSoapActionL__16CSenSoapEnvelopeRC6TDesC8 @ 37 NONAME R3UNUSED ; CSenSoapEnvelope::SetSoapActionL(TDesC8 const &)
+	SoapAction__16CSenSoapEnvelope @ 38 NONAME R3UNUSED ; CSenSoapEnvelope::SoapAction(void)
+	StartElementL__16CSenSoapEnvelopeRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 39 NONAME ; CSenSoapEnvelope::StartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	ToXmlDateTimeUtf8L__12SenDateUtilsR5TDes8RC5TTime @ 40 NONAME R3UNUSED ; SenDateUtils::ToXmlDateTimeUtf8L(TDes8 &, TTime const &)
+	UsernameTokenL__20CSenWsSecurityHeaderR20CSenIdentityProvider @ 41 NONAME R3UNUSED ; CSenWsSecurityHeader::UsernameTokenL(CSenIdentityProvider &)
+	UsernameTokenL__20CSenWsSecurityHeaderRC6TDesC8RP6HBufC8 @ 42 NONAME R3UNUSED ; CSenWsSecurityHeader::UsernameTokenL(TDesC8 const &, HBufC8 *&)
+	XmlNsPrefix__20CSenWsSecurityHeader @ 43 NONAME R3UNUSED ; CSenWsSecurityHeader::XmlNsPrefix(void)
+	XmlNs__20CSenWsSecurityHeader @ 44 NONAME R3UNUSED ; CSenWsSecurityHeader::XmlNs(void)
+	"_._13CSenSoapFault" @ 45 NONAME R3UNUSED ; CSenSoapFault::~CSenSoapFault(void)
+	"_._15CSenSoapMessage" @ 46 NONAME R3UNUSED ; CSenSoapMessage::~CSenSoapMessage(void)
+	"_._16CSenSoapEnvelope" @ 47 NONAME R3UNUSED ; CSenSoapEnvelope::~CSenSoapEnvelope(void)
+	"_._20CSenWsSecurityHeader" @ 48 NONAME R3UNUSED ; CSenWsSecurityHeader::~CSenWsSecurityHeader(void)
+	__13CSenSoapFault @ 49 NONAME R3UNUSED ; CSenSoapFault::CSenSoapFault(void)
+	__15CSenSoapMessage @ 50 NONAME R3UNUSED ; CSenSoapMessage::CSenSoapMessage(void)
+	AddHeaderL__16CSenSoapEnvelopeR11CSenElement @ 51 NONAME R3UNUSED ; CSenSoapEnvelope::AddHeaderL(CSenElement &)
+	AddAttribute__14CSenIdentifierR13CSenAttribute @ 52 NONAME R3UNUSED ; CSenIdentifier::AddAttribute(CSenAttribute &)
+	AddValue__13CSenAttributeRC6TDesC8 @ 53 NONAME R3UNUSED ; CSenAttribute::AddValue(TDesC8 const &)
+	Attributes__C14CSenIdentifier @ 54 NONAME R3UNUSED ; CSenIdentifier::Attributes(void) const
+	CertInfoToStringLC__12SenCertUtilsRC9TCertInfo @ 55 NONAME R3UNUSED ; SenCertUtils::CertInfoToStringLC(TCertInfo const &)
+	ConstructL__13CSenAttributeRC6TDesC8N31 @ 56 NONAME ; CSenAttribute::ConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	Count__C14CSenAttributes @ 57 NONAME R3UNUSED ; CSenAttributes::Count(void) const
+	Equals__14CSenIdentifierRC14CSenIdentifier @ 58 NONAME R3UNUSED ; CSenIdentifier::Equals(CSenIdentifier const &)
+	Equals__C13CSenAttributeRC13CSenAttribute @ 59 NONAME R3UNUSED ; CSenAttribute::Equals(CSenAttribute const &) const
+	Equals__C14CSenAttributesRC13CSenAttribute @ 60 NONAME R3UNUSED ; CSenAttributes::Equals(CSenAttribute const &) const
+	FriendlyName__C13CSenAttribute @ 61 NONAME R3UNUSED ; CSenAttribute::FriendlyName(void) const
+	GetAttribute__C14CSenAttributesRC6TDesC8 @ 62 NONAME R3UNUSED ; CSenAttributes::GetAttribute(TDesC8 const &) const
+	GetValues__C13CSenAttribute @ 63 NONAME R3UNUSED ; CSenAttribute::GetValues(void) const
+	IsProxy__C14CSenIdentifier @ 64 NONAME R3UNUSED ; CSenIdentifier::IsProxy(void) const
+	MatchAny__14CSenAttributesRC14CSenAttributes @ 65 NONAME R3UNUSED ; CSenAttributes::MatchAny(CSenAttributes const &)
+	Name__C13CSenAttribute @ 66 NONAME R3UNUSED ; CSenAttribute::Name(void) const
+	NewLC__14CSenAttributes @ 67 NONAME R3UNUSED ; CSenAttributes::NewLC(void)
+	NewLC__14CSenAttributesRC14CSenAttributes @ 68 NONAME R3UNUSED ; CSenAttributes::NewLC(CSenAttributes const &)
+	NewLC__14CSenIdentifier @ 69 NONAME R3UNUSED ; CSenIdentifier::NewLC(void)
+	NewLC__14CSenIdentifierQ213SenIdentifier15TIdentifierTypeRC6TDesC8 @ 70 NONAME R3UNUSED ; CSenIdentifier::NewLC(SenIdentifier::TIdentifierType, TDesC8 const &)
+	NewLC__14CSenIdentifierQ213SenIdentifier15TIdentifierTypeRC6TDesC8T2 @ 71 NONAME R3UNUSED ; CSenIdentifier::NewLC(SenIdentifier::TIdentifierType, TDesC8 const &, TDesC8 const &)
+	NewLC__14CSenIdentifierQ213SenIdentifier15TIdentifierTypeRC9TCertInfo @ 72 NONAME R3UNUSED ; CSenIdentifier::NewLC(SenIdentifier::TIdentifierType, TCertInfo const &)
+	NewLC__14CSenIdentifierRC14CSenIdentifier @ 73 NONAME R3UNUSED ; CSenIdentifier::NewLC(CSenIdentifier const &)
+	NewL__13CSenAttributeRC6TDesC8N21 @ 74 NONAME R3UNUSED ; CSenAttribute::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__13CSenAttributeRC6TDesC8N31 @ 75 NONAME ; CSenAttribute::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__14CSenAttributes @ 76 NONAME R3UNUSED ; CSenAttributes::NewL(void)
+	NewL__14CSenAttributesRC14CSenAttributes @ 77 NONAME R3UNUSED ; CSenAttributes::NewL(CSenAttributes const &)
+	NewL__14CSenIdentifier @ 78 NONAME R3UNUSED ; CSenIdentifier::NewL(void)
+	NewL__14CSenIdentifierQ213SenIdentifier15TIdentifierTypeRC6TDesC8 @ 79 NONAME R3UNUSED ; CSenIdentifier::NewL(SenIdentifier::TIdentifierType, TDesC8 const &)
+	NewL__14CSenIdentifierQ213SenIdentifier15TIdentifierTypeRC6TDesC8T2 @ 80 NONAME R3UNUSED ; CSenIdentifier::NewL(SenIdentifier::TIdentifierType, TDesC8 const &, TDesC8 const &)
+	NewL__14CSenIdentifierQ213SenIdentifier15TIdentifierTypeRC9TCertInfo @ 81 NONAME R3UNUSED ; CSenIdentifier::NewL(SenIdentifier::TIdentifierType, TCertInfo const &)
+	NewL__14CSenIdentifierRC14CSenIdentifier @ 82 NONAME R3UNUSED ; CSenIdentifier::NewL(CSenIdentifier const &)
+	NumValues__C13CSenAttribute @ 83 NONAME R3UNUSED ; CSenAttribute::NumValues(void) const
+	ProxyFor__14CSenIdentifierP14CSenIdentifier @ 84 NONAME R3UNUSED ; CSenIdentifier::ProxyFor(CSenIdentifier *)
+	Proxy__C14CSenIdentifier @ 85 NONAME R3UNUSED ; CSenIdentifier::Proxy(void) const
+	Root__C14CSenIdentifier @ 86 NONAME R3UNUSED ; CSenIdentifier::Root(void) const
+	SetValue__13CSenAttributeRC6TDesC8 @ 87 NONAME R3UNUSED ; CSenAttribute::SetValue(TDesC8 const &)
+	Type__C13CSenAttribute @ 88 NONAME R3UNUSED ; CSenAttribute::Type(void) const
+	Type__C14CSenIdentifier @ 89 NONAME R3UNUSED ; CSenIdentifier::Type(void) const
+	Value__C13CSenAttribute @ 90 NONAME R3UNUSED ; CSenAttribute::Value(void) const
+	Value__C14CSenIdentifier @ 91 NONAME R3UNUSED ; CSenIdentifier::Value(void) const
+	"_._13CSenAttribute" @ 92 NONAME R3UNUSED ; CSenAttribute::~CSenAttribute(void)
+	"_._14CSenAttributes" @ 93 NONAME R3UNUSED ; CSenAttributes::~CSenAttributes(void)
+	"_._14CSenIdentifier" @ 94 NONAME R3UNUSED ; CSenIdentifier::~CSenIdentifier(void)
+	__13CSenAttribute @ 95 NONAME R3UNUSED ; CSenAttribute::CSenAttribute(void)
+	AddAttribute__14CSenAttributesRC13CSenAttribute @ 96 NONAME R3UNUSED ; CSenAttributes::AddAttribute(CSenAttribute const &)
+	ParseL__16CSenSoapEnvelopeRC6TDesC8 @ 97 NONAME R3UNUSED ; CSenSoapEnvelope::ParseL(TDesC8 const &)
+	HasBody__16CSenSoapEnvelope @ 98 NONAME R3UNUSED ; CSenSoapEnvelope::HasBody(void)
+	HasHeader__16CSenSoapEnvelope @ 99 NONAME R3UNUSED ; CSenSoapEnvelope::HasHeader(void)
+	__eq__9CSenChunkRC9CSenChunk @ 100 NONAME R3UNUSED ; CSenChunk::operator==(CSenChunk const &)
+	AdjustChunk__9CSenChunki @ 101 NONAME R3UNUSED ; CSenChunk::AdjustChunk(int)
+	AllocDescToChunk__9CSenChunkiRP5TPtr8 @ 102 NONAME R3UNUSED ; CSenChunk::AllocDescToChunk(int, TPtr8 *&)
+	ChunkHeader__9CSenChunk @ 103 NONAME R3UNUSED ; CSenChunk::ChunkHeader(void)
+	ChunkName__C9CSenChunk @ 104 NONAME R3UNUSED ; CSenChunk::ChunkName(void) const
+	ChunkToArgs__9CSenChunkR8TIpcArgsi @ 105 NONAME R3UNUSED ; CSenChunk::ChunkToArgs(TIpcArgs &, int)
+	Chunk__9CSenChunk @ 106 NONAME R3UNUSED ; CSenChunk::Chunk(void)
+	CloseChunk__9CSenChunk @ 107 NONAME R3UNUSED ; CSenChunk::CloseChunk(void)
+	CreateChunk__9CSenChunk @ 108 NONAME R3UNUSED ; CSenChunk::CreateChunk(void)
+	DescFromChunk__9CSenChunkR6TPtrC8i @ 109 NONAME R3UNUSED ; CSenChunk::DescFromChunk(TPtrC8 &, int)
+	DescToChunk__9CSenChunkRC6TDesC8 @ 110 NONAME R3UNUSED ; CSenChunk::DescToChunk(TDesC8 const &)
+	DescsFromChunk__9CSenChunkR6TPtrC8T1 @ 111 NONAME R3UNUSED ; CSenChunk::DescsFromChunk(TPtrC8 &, TPtrC8 &)
+	DescsToChunk__9CSenChunkRC6TDesC8T1 @ 112 NONAME R3UNUSED ; CSenChunk::DescsToChunk(TDesC8 const &, TDesC8 const &)
+	Log__C9CSenChunk @ 113 NONAME R3UNUSED ; CSenChunk::Log(void) const
+	NewLC__9CSenChunkRC7TDesC16 @ 114 NONAME R3UNUSED ; CSenChunk::NewLC(TDesC16 const &)
+	NewL__9CSenChunkRC7TDesC16 @ 115 NONAME R3UNUSED ; CSenChunk::NewL(TDesC16 const &)
+	OpenChunkFromRMsgL__9CSenChunkRC9RMessage2i @ 116 NONAME R3UNUSED ; CSenChunk::OpenChunkFromRMsgL(RMessage2 const &, int)
+	OpenChunk__9CSenChunk @ 117 NONAME R3UNUSED ; CSenChunk::OpenChunk(void)
+	SetLogger__9CSenChunkP11RFileLogger @ 118 NONAME R3UNUSED ; CSenChunk::SetLogger(RFileLogger *)
+	"_._9CSenChunk" @ 119 NONAME R3UNUSED ; CSenChunk::~CSenChunk(void)
+	__9CSenChunk @ 120 NONAME R3UNUSED ; CSenChunk::CSenChunk(void)
+	__eq__14CSenIdentifierRC14CSenIdentifier @ 121 NONAME R3UNUSED ; CSenIdentifier::operator==(CSenIdentifier const &)
+	NewLC__20CSenWsSecurityHeader @ 122 NONAME R3UNUSED ; CSenWsSecurityHeader::NewLC(void)
+	NewLC__20CSenWsSecurityHeaderRC6TDesC8 @ 123 NONAME R3UNUSED ; CSenWsSecurityHeader::NewLC(TDesC8 const &)
+	TimestampL__20CSenWsSecurityHeaderRC6TDesC8RP6HBufC8 @ 124 NONAME R3UNUSED ; CSenWsSecurityHeader::TimestampL(TDesC8 const &, HBufC8 *&)
+	TimestampL__20CSenWsSecurityHeaderRC6TDesC8T1RP6HBufC8 @ 125 NONAME R3UNUSED ; CSenWsSecurityHeader::TimestampL(TDesC8 const &, TDesC8 const &, HBufC8 *&)
+	UsernameTokenL__20CSenWsSecurityHeaderR20CSenIdentityProviderQ220CSenWsSecurityHeader13TPasswordType @ 126 NONAME R3UNUSED ; CSenWsSecurityHeader::UsernameTokenL(CSenIdentityProvider &, CSenWsSecurityHeader::TPasswordType)
+	UsernameTokenL__20CSenWsSecurityHeaderRC6TDesC8T1Q220CSenWsSecurityHeader13TPasswordTypeRP6HBufC8 @ 127 NONAME ; CSenWsSecurityHeader::UsernameTokenL(TDesC8 const &, TDesC8 const &, CSenWsSecurityHeader::TPasswordType, HBufC8 *&)
+	UsernameTokenL__20CSenWsSecurityHeaderRC6TDesC8T1RP6HBufC8 @ 128 NONAME R3UNUSED ; CSenWsSecurityHeader::UsernameTokenL(TDesC8 const &, TDesC8 const &, HBufC8 *&)
+	AsUtf8LC__23CSenTransportProperties @ 129 NONAME R3UNUSED ; CSenTransportProperties::AsUtf8LC(void)
+	AsUtf8L__23CSenTransportProperties @ 130 NONAME R3UNUSED ; CSenTransportProperties::AsUtf8L(void)
+	BaseConstructL__15CSenSoapMessage12TSOAPVersion @ 131 NONAME R3UNUSED ; CSenSoapMessage::BaseConstructL(TSOAPVersion)
+	BaseConstructL__16CSenSoapEnvelope12TSOAPVersion @ 132 NONAME R3UNUSED ; CSenSoapEnvelope::BaseConstructL(TSOAPVersion)
+	BaseConstructL__15CSenSoapMessage12TSOAPVersionRC6TDesC8 @ 133 NONAME R3UNUSED ; CSenSoapMessage::BaseConstructL(TSOAPVersion, TDesC8 const &)
+	BaseConstructL__20CSenWsSecurityHeaderRC6TDesC8T1 @ 134 NONAME R3UNUSED ; CSenWsSecurityHeader::BaseConstructL(TDesC8 const &, TDesC8 const &)
+	BaseConstructL__23CSenTransportPropertiesRC11CSenElement @ 135 NONAME R3UNUSED ; CSenTransportProperties::BaseConstructL(CSenElement const &)
+	BaseConstructL__23CSenTransportPropertiesRC6TDesC8N21P13CSenXmlReader @ 136 NONAME ; CSenTransportProperties::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, CSenXmlReader *)
+	BaseConstructL__23CSenTransportPropertiesRC6TDesC8T1P13CSenXmlReader @ 137 NONAME ; CSenTransportProperties::BaseConstructL(TDesC8 const &, TDesC8 const &, CSenXmlReader *)
+	BinarySecurityTokenL__20CSenWsSecurityHeaderRC6TDesC8RP6HBufC8 @ 138 NONAME R3UNUSED ; CSenWsSecurityHeader::BinarySecurityTokenL(TDesC8 const &, HBufC8 *&)
+	BoolPropertyL__23CSenTransportPropertiesRC6TDesC8Ri @ 139 NONAME R3UNUSED ; CSenTransportProperties::BoolPropertyL(TDesC8 const &, int &)
+	DecodeBase64L__14SenCryptoUtilsRC6TDesC8 @ 140 NONAME R3UNUSED ; SenCryptoUtils::DecodeBase64L(TDesC8 const &)
+	DeviceIDL__23CSenTransportPropertiesR6TPtrC8 @ 141 NONAME R3UNUSED ; CSenTransportProperties::DeviceIDL(TPtrC8 &)
+	EncodeBase64L__14SenCryptoUtilsRC6TDesC8 @ 142 NONAME R3UNUSED ; SenCryptoUtils::EncodeBase64L(TDesC8 const &)
+	FaultSubcode__13CSenSoapFault @ 143 NONAME R3UNUSED ; CSenSoapFault::FaultSubcode(void)
+	IapIdL__23CSenTransportPropertiesRUl @ 144 NONAME R3UNUSED ; CSenTransportProperties::IapIdL(unsigned long &)
+	IntPropertyL__23CSenTransportPropertiesRC6TDesC8Ri @ 145 NONAME R3UNUSED ; CSenTransportProperties::IntPropertyL(TDesC8 const &, int &)
+	NewLC__17CSenXmlProperties @ 146 NONAME R3UNUSED ; CSenXmlProperties::NewLC(void)
+	NewLC__17CSenXmlPropertiesRC11CSenElement @ 147 NONAME R3UNUSED ; CSenXmlProperties::NewLC(CSenElement const &)
+	NewLC__17CSenXmlPropertiesRC6TDesC8R13CSenXmlReader @ 148 NONAME R3UNUSED ; CSenXmlProperties::NewLC(TDesC8 const &, CSenXmlReader &)
+	NewLC__20CSenWsSecurityHeaderRC6TDesC8T1 @ 149 NONAME R3UNUSED ; CSenWsSecurityHeader::NewLC(TDesC8 const &, TDesC8 const &)
+	NewLC__23CSenTransportProperties @ 150 NONAME R3UNUSED ; CSenTransportProperties::NewLC(void)
+	NewLC__23CSenTransportPropertiesRC11CSenElement @ 151 NONAME R3UNUSED ; CSenTransportProperties::NewLC(CSenElement const &)
+	NewLC__23CSenTransportPropertiesRC6TDesC8R13CSenXmlReader @ 152 NONAME R3UNUSED ; CSenTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &)
+	NewLC__27CSenHttpTransportProperties @ 153 NONAME R3UNUSED ; CSenHttpTransportProperties::NewLC(void)
+	NewLC__27CSenHttpTransportPropertiesRC11CSenElement @ 154 NONAME R3UNUSED ; CSenHttpTransportProperties::NewLC(CSenElement const &)
+	NewLC__27CSenHttpTransportPropertiesRC6TDesC8R13CSenXmlReader @ 155 NONAME R3UNUSED ; CSenHttpTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &)
+	NewLC__27CSenVtcpTransportProperties @ 156 NONAME R3UNUSED ; CSenVtcpTransportProperties::NewLC(void)
+	NewLC__27CSenVtcpTransportPropertiesRC6TDesC8R13CSenXmlReader @ 157 NONAME R3UNUSED ; CSenVtcpTransportProperties::NewLC(TDesC8 const &, CSenXmlReader &)
+	NewL__15CSenSoapMessage12TSOAPVersion @ 158 NONAME R3UNUSED ; CSenSoapMessage::NewL(TSOAPVersion)
+	NewL__15CSenSoapMessage12TSOAPVersionRC6TDesC8 @ 159 NONAME R3UNUSED ; CSenSoapMessage::NewL(TSOAPVersion, TDesC8 const &)
+	NewL__17CSenXmlProperties @ 160 NONAME R3UNUSED ; CSenXmlProperties::NewL(void)
+	NewL__17CSenXmlPropertiesRC11CSenElement @ 161 NONAME R3UNUSED ; CSenXmlProperties::NewL(CSenElement const &)
+	NewL__17CSenXmlPropertiesRC6TDesC8R13CSenXmlReader @ 162 NONAME R3UNUSED ; CSenXmlProperties::NewL(TDesC8 const &, CSenXmlReader &)
+	NewL__20CSenWsSecurityHeaderRC6TDesC8T1 @ 163 NONAME R3UNUSED ; CSenWsSecurityHeader::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__21CSenPropertiesElementRC6TDesC8N21P11RStringPool @ 164 NONAME ; CSenPropertiesElement::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RStringPool *)
+	NewL__21CSenPropertiesElementRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeP11RStringPool @ 165 NONAME ; CSenPropertiesElement::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, RStringPool *)
+	NewL__21CSenPropertiesElementRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElementP11RStringPool @ 166 NONAME ; CSenPropertiesElement::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &, RStringPool *)
+	NewL__21CSenPropertiesElementRC6TDesC8P11RStringPool @ 167 NONAME R3UNUSED ; CSenPropertiesElement::NewL(TDesC8 const &, RStringPool *)
+	NewL__21CSenPropertiesElementRC6TDesC8T1P11RStringPool @ 168 NONAME R3UNUSED ; CSenPropertiesElement::NewL(TDesC8 const &, TDesC8 const &, RStringPool *)
+	NewL__22CSenPropertiesFragmentP11RStringPool @ 169 NONAME R3UNUSED ; CSenPropertiesFragment::NewL(RStringPool *)
+	NewL__22CSenPropertiesFragmentRC11CSenElementP11RStringPool @ 170 NONAME R3UNUSED ; CSenPropertiesFragment::NewL(CSenElement const &, RStringPool *)
+	NewL__22CSenPropertiesFragmentRC6TDesC8N21P11RStringPool @ 171 NONAME ; CSenPropertiesFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RStringPool *)
+	NewL__22CSenPropertiesFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeP11RStringPool @ 172 NONAME ; CSenPropertiesFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, RStringPool *)
+	NewL__22CSenPropertiesFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElementP11RStringPool @ 173 NONAME ; CSenPropertiesFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &, RStringPool *)
+	NewL__22CSenPropertiesFragmentRC6TDesC8P11RStringPool @ 174 NONAME R3UNUSED ; CSenPropertiesFragment::NewL(TDesC8 const &, RStringPool *)
+	NewL__22CSenPropertiesFragmentRC6TDesC8T1P11RStringPool @ 175 NONAME R3UNUSED ; CSenPropertiesFragment::NewL(TDesC8 const &, TDesC8 const &, RStringPool *)
+	NewL__23CSenTransportProperties @ 176 NONAME R3UNUSED ; CSenTransportProperties::NewL(void)
+	NewL__23CSenTransportPropertiesRC11CSenElement @ 177 NONAME R3UNUSED ; CSenTransportProperties::NewL(CSenElement const &)
+	NewL__23CSenTransportPropertiesRC6TDesC8R13CSenXmlReader @ 178 NONAME R3UNUSED ; CSenTransportProperties::NewL(TDesC8 const &, CSenXmlReader &)
+	NewL__27CSenHttpTransportProperties @ 179 NONAME R3UNUSED ; CSenHttpTransportProperties::NewL(void)
+	NewL__27CSenHttpTransportPropertiesRC11CSenElement @ 180 NONAME R3UNUSED ; CSenHttpTransportProperties::NewL(CSenElement const &)
+	NewL__27CSenHttpTransportPropertiesRC6TDesC8R13CSenXmlReader @ 181 NONAME R3UNUSED ; CSenHttpTransportProperties::NewL(TDesC8 const &, CSenXmlReader &)
+	NewL__27CSenVtcpTransportProperties @ 182 NONAME R3UNUSED ; CSenVtcpTransportProperties::NewL(void)
+	NewL__27CSenVtcpTransportPropertiesRC6TDesC8R13CSenXmlReader @ 183 NONAME R3UNUSED ; CSenVtcpTransportProperties::NewL(TDesC8 const &, CSenXmlReader &)
+	OpenChunkFromHandleNumberL__9CSenChunki @ 184 NONAME R3UNUSED ; CSenChunk::OpenChunkFromHandleNumberL(int)
+	PSHA1L__14SenCryptoUtilsRC6TDesC8T1i @ 185 NONAME R3UNUSED ; SenCryptoUtils::PSHA1L(TDesC8 const &, TDesC8 const &, int)
+	PropertiesClassType__23CSenTransportProperties @ 186 NONAME R3UNUSED ; CSenTransportProperties::PropertiesClassType(void)
+	PropertyL__23CSenTransportPropertiesRC6TDesC8R6TPtrC8 @ 187 NONAME R3UNUSED ; CSenTransportProperties::PropertyL(TDesC8 const &, TPtrC8 &)
+	PropertyL__23CSenTransportPropertiesRC6TDesC8R6TPtrC8T2 @ 188 NONAME ; CSenTransportProperties::PropertyL(TDesC8 const &, TPtrC8 &, TPtrC8 &)
+	ProxyHostL__23CSenTransportPropertiesR6TPtrC8 @ 189 NONAME R3UNUSED ; CSenTransportProperties::ProxyHostL(TPtrC8 &)
+	ProxyPortL__23CSenTransportPropertiesRi @ 190 NONAME R3UNUSED ; CSenTransportProperties::ProxyPortL(int &)
+	ProxyUsageL__23CSenTransportPropertiesRi @ 191 NONAME R3UNUSED ; CSenTransportProperties::ProxyUsageL(int &)
+	RandomAndHashMd5LC__14SenCryptoUtils @ 192 NONAME R3UNUSED ; SenCryptoUtils::RandomAndHashMd5LC(void)
+	ReadFromL__23CSenTransportPropertiesRC6TDesC8 @ 193 NONAME R3UNUSED ; CSenTransportProperties::ReadFromL(TDesC8 const &)
+	RemovePropertyL__23CSenTransportPropertiesRC6TDesC8 @ 194 NONAME R3UNUSED ; CSenTransportProperties::RemovePropertyL(TDesC8 const &)
+	SecureDialogL__23CSenTransportPropertiesRi @ 195 NONAME R3UNUSED ; CSenTransportProperties::SecureDialogL(int &)
+	SetSoapActionL__23CSenTransportPropertiesRC6TDesC8 @ 196 NONAME R3UNUSED ; CSenTransportProperties::SetSoapActionL(TDesC8 const &)
+	SetBoolPropertyL__23CSenTransportPropertiesRC6TDesC8i @ 197 NONAME R3UNUSED ; CSenTransportProperties::SetBoolPropertyL(TDesC8 const &, int)
+	SetDeviceIDL__23CSenTransportPropertiesRC6TDesC8 @ 198 NONAME R3UNUSED ; CSenTransportProperties::SetDeviceIDL(TDesC8 const &)
+	SetIapIdL__23CSenTransportPropertiesUl @ 199 NONAME R3UNUSED ; CSenTransportProperties::SetIapIdL(unsigned long)
+	SetIntPropertyL__23CSenTransportPropertiesRC6TDesC8i @ 200 NONAME R3UNUSED ; CSenTransportProperties::SetIntPropertyL(TDesC8 const &, int)
+	SetOmittedL__23CSenTransportPropertiesRC6TDesC8i @ 201 NONAME R3UNUSED ; CSenTransportProperties::SetOmittedL(TDesC8 const &, int)
+	SetPropertyL__23CSenTransportPropertiesRC6TDesC8N21 @ 202 NONAME ; CSenTransportProperties::SetPropertyL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	SetPropertyL__23CSenTransportPropertiesRC6TDesC8T1 @ 203 NONAME R3UNUSED ; CSenTransportProperties::SetPropertyL(TDesC8 const &, TDesC8 const &)
+	SetProxyHostL__23CSenTransportPropertiesRC6TDesC8 @ 204 NONAME R3UNUSED ; CSenTransportProperties::SetProxyHostL(TDesC8 const &)
+	SetProxyPortL__23CSenTransportPropertiesi @ 205 NONAME R3UNUSED ; CSenTransportProperties::SetProxyPortL(int)
+	SetProxyUsageL__23CSenTransportPropertiesi @ 206 NONAME R3UNUSED ; CSenTransportProperties::SetProxyUsageL(int)
+	SetReader__23CSenTransportPropertiesR13CSenXmlReader @ 207 NONAME R3UNUSED ; CSenTransportProperties::SetReader(CSenXmlReader &)
+	SetSecureDialogL__23CSenTransportPropertiesi @ 208 NONAME R3UNUSED ; CSenTransportProperties::SetSecureDialogL(int)
+	SetUserAgentL__23CSenTransportPropertiesRC6TDesC8 @ 209 NONAME R3UNUSED ; CSenTransportProperties::SetUserAgentL(TDesC8 const &)
+	UserAgentL__23CSenTransportPropertiesR6TPtrC8 @ 210 NONAME R3UNUSED ; CSenTransportProperties::UserAgentL(TPtrC8 &)
+	WriteToL__23CSenTransportPropertiesR12RWriteStream @ 211 NONAME R3UNUSED ; CSenTransportProperties::WriteToL(RWriteStream &)
+	"_._23CSenTransportProperties" @ 212 NONAME R3UNUSED ; CSenTransportProperties::~CSenTransportProperties(void)
+	__23CSenTransportProperties @ 213 NONAME R3UNUSED ; CSenTransportProperties::CSenTransportProperties(void)
+	SoapActionL__23CSenTransportPropertiesR6TPtrC8 @ 214 NONAME R3UNUSED ; CSenTransportProperties::SoapActionL(TPtrC8 &)
+	ApplyBindingL__23CSenTransportProperties12TSOAPVersion @ 215 NONAME R3UNUSED ; CSenTransportProperties::ApplyBindingL(TSOAPVersion)
+	SoapVersion__16CSenSoapEnvelope @ 216 NONAME R3UNUSED ; CSenSoapEnvelope::SoapVersion(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/BWINS/SENUTILSU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,219 @@
+EXPORTS
+	??0CSenSoapFault@@IAE@XZ @ 1 NONAME ; protected: __thiscall CSenSoapFault::CSenSoapFault(void)
+	??0CSenSoapMessage@@IAE@XZ @ 2 NONAME ; protected: __thiscall CSenSoapMessage::CSenSoapMessage(void)
+	??0CSenWsSecurityHeader@@IAE@XZ @ 3 NONAME ; protected: __thiscall CSenWsSecurityHeader::CSenWsSecurityHeader(void)
+	??1CSenSoapEnvelope@@UAE@XZ @ 4 NONAME ; public: virtual __thiscall CSenSoapEnvelope::~CSenSoapEnvelope(void)
+	??1CSenSoapFault@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CSenSoapFault::~CSenSoapFault(void)
+	??1CSenSoapMessage@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CSenSoapMessage::~CSenSoapMessage(void)
+	??1CSenWsSecurityHeader@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CSenWsSecurityHeader::~CSenWsSecurityHeader(void)
+	?AddHeaderL@CSenSoapEnvelope@@UAEAAVCSenElement@@AAV2@@Z @ 8 NONAME ; public: virtual class CSenElement & __thiscall CSenSoapEnvelope::AddHeaderL(class CSenElement &)
+	?AddSecurityTokenL@CSenSoapMessage@@QAEHABVTDesC8@@@Z @ 9 NONAME ; public: int __thiscall CSenSoapMessage::AddSecurityTokenL(class TDesC8 const &)
+	?BaseConstructL@CSenSoapEnvelope@@IAEXXZ @ 10 NONAME ; protected: void __thiscall CSenSoapEnvelope::BaseConstructL(void)
+	?BaseConstructL@CSenSoapMessage@@IAEXXZ @ 11 NONAME ; protected: void __thiscall CSenSoapMessage::BaseConstructL(void)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXABVTDesC8@@@Z @ 12 NONAME ; protected: void __thiscall CSenWsSecurityHeader::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXXZ @ 13 NONAME ; protected: void __thiscall CSenWsSecurityHeader::BaseConstructL(void)
+	?BodyAsStringL@CSenSoapEnvelope@@UAEPAVHBufC8@@XZ @ 14 NONAME ; public: virtual class HBufC8 * __thiscall CSenSoapEnvelope::BodyAsStringL(void)
+	?BodyL@CSenSoapEnvelope@@UAEAAVCSenElement@@XZ @ 15 NONAME ; public: virtual class CSenElement & __thiscall CSenSoapEnvelope::BodyL(void)
+	?ConstructL@CSenSoapFault@@IAEXAAVCSenElement@@@Z @ 16 NONAME ; protected: void __thiscall CSenSoapFault::ConstructL(class CSenElement &)
+	?ConstructL@CSenSoapFault@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 17 NONAME ; protected: void __thiscall CSenSoapFault::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?DetachFaultL@CSenSoapEnvelope@@UAEPAVCSenSoapFault@@XZ @ 18 NONAME ; public: virtual class CSenSoapFault * __thiscall CSenSoapEnvelope::DetachFaultL(void)
+	?Detail@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 19 NONAME ; public: class TPtrC8 __thiscall CSenSoapFault::Detail(void)
+	?EndElementL@CSenSoapEnvelope@@MAEXABVTDesC8@@00@Z @ 20 NONAME ; protected: virtual void __thiscall CSenSoapEnvelope::EndElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?FaultActor@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 21 NONAME ; public: class TPtrC8 __thiscall CSenSoapFault::FaultActor(void)
+	?FaultCode@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 22 NONAME ; public: class TPtrC8 __thiscall CSenSoapFault::FaultCode(void)
+	?FaultL@CSenSoapEnvelope@@UAEPAVCSenSoapFault@@XZ @ 23 NONAME ; public: virtual class CSenSoapFault * __thiscall CSenSoapEnvelope::FaultL(void)
+	?FaultString@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 24 NONAME ; public: class TPtrC8 __thiscall CSenSoapFault::FaultString(void)
+	?FromXmlDateTimeL@SenDateUtils@@SA?AVTTime@@ABVTDesC8@@@Z @ 25 NONAME ; public: static class TTime __cdecl SenDateUtils::FromXmlDateTimeL(class TDesC8 const &)
+	?GetRandomGuid16LC@CSenGuidGen@@QAEPAVHBufC16@@XZ @ 26 NONAME ; public: class HBufC16 * __thiscall CSenGuidGen::GetRandomGuid16LC(void)
+	?GetRandomGuid8LC@CSenGuidGen@@QAEPAVHBufC8@@XZ @ 27 NONAME ; public: class HBufC8 * __thiscall CSenGuidGen::GetRandomGuid8LC(void)
+	?GetRandomGuidLC@CSenGuidGen@@QAEPAVHBufC16@@XZ @ 28 NONAME ; public: class HBufC16 * __thiscall CSenGuidGen::GetRandomGuidLC(void)
+	?HeaderL@CSenSoapEnvelope@@UAEAAVCSenElement@@XZ @ 29 NONAME ; public: virtual class CSenElement & __thiscall CSenSoapEnvelope::HeaderL(void)
+	?IsFault@CSenSoapEnvelope@@UAEHXZ @ 30 NONAME ; public: virtual int __thiscall CSenSoapEnvelope::IsFault(void)
+	?NewL@CSenGuidGen@@SAPAV1@XZ @ 31 NONAME ; public: static class CSenGuidGen * __cdecl CSenGuidGen::NewL(void)
+	?NewL@CSenSoapEnvelope@@SAPAV1@XZ @ 32 NONAME ; public: static class CSenSoapEnvelope * __cdecl CSenSoapEnvelope::NewL(void)
+	?NewL@CSenSoapFault@@SAPAV1@AAVCSenElement@@@Z @ 33 NONAME ; public: static class CSenSoapFault * __cdecl CSenSoapFault::NewL(class CSenElement &)
+	?NewL@CSenSoapFault@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 34 NONAME ; public: static class CSenSoapFault * __cdecl CSenSoapFault::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenSoapMessage@@SAPAV1@XZ @ 35 NONAME ; public: static class CSenSoapMessage * __cdecl CSenSoapMessage::NewL(void)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@@Z @ 36 NONAME ; public: static class CSenWsSecurityHeader * __cdecl CSenWsSecurityHeader::NewL(class TDesC8 const &)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@XZ @ 37 NONAME ; public: static class CSenWsSecurityHeader * __cdecl CSenWsSecurityHeader::NewL(void)
+	?NewLC@CSenGuidGen@@SAPAV1@XZ @ 38 NONAME ; public: static class CSenGuidGen * __cdecl CSenGuidGen::NewLC(void)
+	?NewSecurityHeaderLC@CSenSoapMessage@@MAEPAVCSenWsSecurityHeader@@PBVTDesC8@@@Z @ 39 NONAME ; protected: virtual class CSenWsSecurityHeader * __thiscall CSenSoapMessage::NewSecurityHeaderLC(class TDesC8 const *)
+	?ParseHeaderL@CSenSoapEnvelope@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 40 NONAME ; protected: virtual void __thiscall CSenSoapEnvelope::ParseHeaderL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?ParseHeaderL@CSenSoapMessage@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 41 NONAME ; protected: virtual void __thiscall CSenSoapMessage::ParseHeaderL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?SetBodyL@CSenSoapEnvelope@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 42 NONAME ; public: virtual class TPtrC8 __thiscall CSenSoapEnvelope::SetBodyL(class TDesC8 const &)
+	?SetSecurityHeaderL@CSenSoapMessage@@QAEXABVTDesC8@@@Z @ 43 NONAME ; public: void __thiscall CSenSoapMessage::SetSecurityHeaderL(class TDesC8 const &)
+	?SetSoapActionL@CSenSoapEnvelope@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 44 NONAME ; public: virtual class TPtrC8 __thiscall CSenSoapEnvelope::SetSoapActionL(class TDesC8 const &)
+	?SoapAction@CSenSoapEnvelope@@UAE?AVTPtrC8@@XZ @ 45 NONAME ; public: virtual class TPtrC8 __thiscall CSenSoapEnvelope::SoapAction(void)
+	?StartElementL@CSenSoapEnvelope@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 46 NONAME ; protected: virtual void __thiscall CSenSoapEnvelope::StartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?ToXmlDateTimeUtf8L@SenDateUtils@@SAXAAVTDes8@@ABVTTime@@@Z @ 47 NONAME ; public: static void __cdecl SenDateUtils::ToXmlDateTimeUtf8L(class TDes8 &,class TTime const &)
+	?UsernameTokenL@CSenWsSecurityHeader@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@@Z @ 48 NONAME ; public: class HBufC8 * __thiscall CSenWsSecurityHeader::UsernameTokenL(class CSenIdentityProvider &)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 49 NONAME ; public: static int __cdecl CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &,class HBufC8 * &)
+	?XmlNs@CSenWsSecurityHeader@@UAE?AVTPtrC8@@XZ @ 50 NONAME ; public: virtual class TPtrC8 __thiscall CSenWsSecurityHeader::XmlNs(void)
+	?XmlNsPrefix@CSenWsSecurityHeader@@UAE?AVTPtrC8@@XZ @ 51 NONAME ; public: virtual class TPtrC8 __thiscall CSenWsSecurityHeader::XmlNsPrefix(void)
+	??0CSenAttribute@@IAE@XZ @ 52 NONAME ; protected: __thiscall CSenAttribute::CSenAttribute(void)
+	??1CSenAttribute@@UAE@XZ @ 53 NONAME ; public: virtual __thiscall CSenAttribute::~CSenAttribute(void)
+	??1CSenAttributes@@UAE@XZ @ 54 NONAME ; public: virtual __thiscall CSenAttributes::~CSenAttributes(void)
+	??1CSenIdentifier@@UAE@XZ @ 55 NONAME ; public: virtual __thiscall CSenIdentifier::~CSenIdentifier(void)
+	?AddAttribute@CSenAttributes@@QAEXABVCSenAttribute@@@Z @ 56 NONAME ; public: void __thiscall CSenAttributes::AddAttribute(class CSenAttribute const &)
+	?AddAttribute@CSenIdentifier@@QAEXAAVCSenAttribute@@@Z @ 57 NONAME ; public: void __thiscall CSenIdentifier::AddAttribute(class CSenAttribute &)
+	?AddValue@CSenAttribute@@QAEXABVTDesC8@@@Z @ 58 NONAME ; public: void __thiscall CSenAttribute::AddValue(class TDesC8 const &)
+	?Attributes@CSenIdentifier@@QBEPBVCSenAttributes@@XZ @ 59 NONAME ; public: class CSenAttributes const * __thiscall CSenIdentifier::Attributes(void)const 
+	?CertInfoToStringLC@SenCertUtils@@SAPAVHBufC8@@ABVTCertInfo@@@Z @ 60 NONAME ; public: static class HBufC8 * __cdecl SenCertUtils::CertInfoToStringLC(class TCertInfo const &)
+	?ConstructL@CSenAttribute@@IAEXABVTDesC8@@000@Z @ 61 NONAME ; protected: void __thiscall CSenAttribute::ConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?Count@CSenAttributes@@QBEHXZ @ 62 NONAME ; public: int __thiscall CSenAttributes::Count(void)const 
+	?Equals@CSenAttribute@@QBEHABV1@@Z @ 63 NONAME ; public: int __thiscall CSenAttribute::Equals(class CSenAttribute const &)const 
+	?Equals@CSenAttributes@@QBEHABVCSenAttribute@@@Z @ 64 NONAME ; public: int __thiscall CSenAttributes::Equals(class CSenAttribute const &)const 
+	?Equals@CSenIdentifier@@QAEHABV1@@Z @ 65 NONAME ; public: int __thiscall CSenIdentifier::Equals(class CSenIdentifier const &)
+	?FriendlyName@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 66 NONAME ; public: class TPtrC8 __thiscall CSenAttribute::FriendlyName(void)const 
+	?GetAttribute@CSenAttributes@@QBEABVCSenAttribute@@ABVTDesC8@@@Z @ 67 NONAME ; public: class CSenAttribute const & __thiscall CSenAttributes::GetAttribute(class TDesC8 const &)const 
+	?GetValues@CSenAttribute@@QBE?BV?$RPointerArray@VHBufC8@@@@XZ @ 68 NONAME ; public: class RPointerArray<class HBufC8> const __thiscall CSenAttribute::GetValues(void)const 
+	?IsProxy@CSenIdentifier@@QBEHXZ @ 69 NONAME ; public: int __thiscall CSenIdentifier::IsProxy(void)const 
+	?MatchAny@CSenAttributes@@QAEHABV1@@Z @ 70 NONAME ; public: int __thiscall CSenAttributes::MatchAny(class CSenAttributes const &)
+	?Name@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 71 NONAME ; public: class TPtrC8 __thiscall CSenAttribute::Name(void)const 
+	?NewL@CSenAttribute@@SAPAV1@ABVTDesC8@@000@Z @ 72 NONAME ; public: static class CSenAttribute * __cdecl CSenAttribute::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenAttribute@@SAPAV1@ABVTDesC8@@00@Z @ 73 NONAME ; public: static class CSenAttribute * __cdecl CSenAttribute::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenAttributes@@SAPAV1@ABV1@@Z @ 74 NONAME ; public: static class CSenAttributes * __cdecl CSenAttributes::NewL(class CSenAttributes const &)
+	?NewL@CSenAttributes@@SAPAV1@XZ @ 75 NONAME ; public: static class CSenAttributes * __cdecl CSenAttributes::NewL(void)
+	?NewL@CSenIdentifier@@SAPAV1@ABV1@@Z @ 76 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewL(class CSenIdentifier const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTCertInfo@@@Z @ 77 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType,class TCertInfo const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@1@Z @ 78 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@@Z @ 79 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType,class TDesC8 const &)
+	?NewL@CSenIdentifier@@SAPAV1@XZ @ 80 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewL(void)
+	?NewLC@CSenAttributes@@SAPAV1@ABV1@@Z @ 81 NONAME ; public: static class CSenAttributes * __cdecl CSenAttributes::NewLC(class CSenAttributes const &)
+	?NewLC@CSenAttributes@@SAPAV1@XZ @ 82 NONAME ; public: static class CSenAttributes * __cdecl CSenAttributes::NewLC(void)
+	?NewLC@CSenIdentifier@@SAPAV1@ABV1@@Z @ 83 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewLC(class CSenIdentifier const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTCertInfo@@@Z @ 84 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType,class TCertInfo const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@1@Z @ 85 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType,class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@@Z @ 86 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType,class TDesC8 const &)
+	?NewLC@CSenIdentifier@@SAPAV1@XZ @ 87 NONAME ; public: static class CSenIdentifier * __cdecl CSenIdentifier::NewLC(void)
+	?NumValues@CSenAttribute@@QBEHXZ @ 88 NONAME ; public: int __thiscall CSenAttribute::NumValues(void)const 
+	?Proxy@CSenIdentifier@@QBEPBV1@XZ @ 89 NONAME ; public: class CSenIdentifier const * __thiscall CSenIdentifier::Proxy(void)const 
+	?ProxyFor@CSenIdentifier@@QAEXPAV1@@Z @ 90 NONAME ; public: void __thiscall CSenIdentifier::ProxyFor(class CSenIdentifier *)
+	?Root@CSenIdentifier@@QBEPBV1@XZ @ 91 NONAME ; public: class CSenIdentifier const * __thiscall CSenIdentifier::Root(void)const 
+	?SetValue@CSenAttribute@@QAEXABVTDesC8@@@Z @ 92 NONAME ; public: void __thiscall CSenAttribute::SetValue(class TDesC8 const &)
+	?Type@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 93 NONAME ; public: class TPtrC8 __thiscall CSenAttribute::Type(void)const 
+	?Type@CSenIdentifier@@QBE?AW4TIdentifierType@SenIdentifier@@XZ @ 94 NONAME ; public: enum SenIdentifier::TIdentifierType __thiscall CSenIdentifier::Type(void)const 
+	?Value@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 95 NONAME ; public: class TPtrC8 __thiscall CSenAttribute::Value(void)const 
+	?Value@CSenIdentifier@@QBE?AVTPtrC8@@XZ @ 96 NONAME ; public: class TPtrC8 __thiscall CSenIdentifier::Value(void)const 
+	?ParseL@CSenSoapEnvelope@@UAEXABVTDesC8@@@Z @ 97 NONAME ; public: virtual void __thiscall CSenSoapEnvelope::ParseL(class TDesC8 const &)
+	?HasBody@CSenSoapEnvelope@@QAEHXZ @ 98 NONAME ; public: int __thiscall CSenSoapEnvelope::HasBody(void)
+	?HasHeader@CSenSoapEnvelope@@QAEHXZ @ 99 NONAME ; public: int __thiscall CSenSoapEnvelope::HasHeader(void)
+	??0CSenChunk@@IAE@XZ @ 100 NONAME ; protected: __thiscall CSenChunk::CSenChunk(void)
+	??1CSenChunk@@UAE@XZ @ 101 NONAME ; public: virtual __thiscall CSenChunk::~CSenChunk(void)
+	??8CSenChunk@@QAEHABV0@@Z @ 102 NONAME ; public: int __thiscall CSenChunk::operator==(class CSenChunk const &)
+	?AdjustChunk@CSenChunk@@QAEHH@Z @ 103 NONAME ; public: int __thiscall CSenChunk::AdjustChunk(int)
+	?AllocDescToChunk@CSenChunk@@QAEHHAAPAVTPtr8@@@Z @ 104 NONAME ; public: int __thiscall CSenChunk::AllocDescToChunk(int,class TPtr8 * &)
+	?Chunk@CSenChunk@@QAEAAVRChunk@@XZ @ 105 NONAME ; public: class RChunk & __thiscall CSenChunk::Chunk(void)
+	?ChunkHeader@CSenChunk@@QAEAAVTChunkHeader@@XZ @ 106 NONAME ; public: class TChunkHeader & __thiscall CSenChunk::ChunkHeader(void)
+	?ChunkName@CSenChunk@@QBE?AVTPtrC16@@XZ @ 107 NONAME ; public: class TPtrC16 __thiscall CSenChunk::ChunkName(void)const 
+	?ChunkToArgs@CSenChunk@@QAEXAAVTIpcArgs@@H@Z @ 108 NONAME ; public: void __thiscall CSenChunk::ChunkToArgs(class TIpcArgs &,int)
+	?CloseChunk@CSenChunk@@QAEXXZ @ 109 NONAME ; public: void __thiscall CSenChunk::CloseChunk(void)
+	?CreateChunk@CSenChunk@@QAEHXZ @ 110 NONAME ; public: int __thiscall CSenChunk::CreateChunk(void)
+	?DescFromChunk@CSenChunk@@QAEHAAVTPtrC8@@H@Z @ 111 NONAME ; public: int __thiscall CSenChunk::DescFromChunk(class TPtrC8 &,int)
+	?DescToChunk@CSenChunk@@QAEHABVTDesC8@@@Z @ 112 NONAME ; public: int __thiscall CSenChunk::DescToChunk(class TDesC8 const &)
+	?DescsFromChunk@CSenChunk@@QAEHAAVTPtrC8@@0@Z @ 113 NONAME ; public: int __thiscall CSenChunk::DescsFromChunk(class TPtrC8 &,class TPtrC8 &)
+	?DescsToChunk@CSenChunk@@QAEHABVTDesC8@@0@Z @ 114 NONAME ; public: int __thiscall CSenChunk::DescsToChunk(class TDesC8 const &,class TDesC8 const &)
+	?Log@CSenChunk@@IBEPAVRFileLogger@@XZ @ 115 NONAME ; protected: class RFileLogger * __thiscall CSenChunk::Log(void)const 
+	?NewL@CSenChunk@@SAPAV1@ABVTDesC16@@@Z @ 116 NONAME ; public: static class CSenChunk * __cdecl CSenChunk::NewL(class TDesC16 const &)
+	?NewLC@CSenChunk@@SAPAV1@ABVTDesC16@@@Z @ 117 NONAME ; public: static class CSenChunk * __cdecl CSenChunk::NewLC(class TDesC16 const &)
+	?OpenChunk@CSenChunk@@QAEHXZ @ 118 NONAME ; public: int __thiscall CSenChunk::OpenChunk(void)
+	?OpenChunkFromRMsgL@CSenChunk@@QAEHABVRMessage2@@H@Z @ 119 NONAME ; public: int __thiscall CSenChunk::OpenChunkFromRMsgL(class RMessage2 const &,int)
+	?SetLogger@CSenChunk@@QAEXPAVRFileLogger@@@Z @ 120 NONAME ; public: void __thiscall CSenChunk::SetLogger(class RFileLogger *)
+	??8CSenIdentifier@@QAEHABV0@@Z @ 121 NONAME ; public: int __thiscall CSenIdentifier::operator==(class CSenIdentifier const &)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@@Z @ 122 NONAME ; public: static class CSenWsSecurityHeader * __cdecl CSenWsSecurityHeader::NewLC(class TDesC8 const &)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@XZ @ 123 NONAME ; public: static class CSenWsSecurityHeader * __cdecl CSenWsSecurityHeader::NewLC(void)
+	?TimestampL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 124 NONAME ; public: static int __cdecl CSenWsSecurityHeader::TimestampL(class TDesC8 const &,class TDesC8 const &,class HBufC8 * &)
+	?TimestampL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 125 NONAME ; public: static int __cdecl CSenWsSecurityHeader::TimestampL(class TDesC8 const &,class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@W4TPasswordType@1@@Z @ 126 NONAME ; public: class HBufC8 * __thiscall CSenWsSecurityHeader::UsernameTokenL(class CSenIdentityProvider &,enum CSenWsSecurityHeader::TPasswordType)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 127 NONAME ; public: static int __cdecl CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &,class TDesC8 const &,class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0W4TPasswordType@1@AAPAVHBufC8@@@Z @ 128 NONAME ; public: static int __cdecl CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &,class TDesC8 const &,enum CSenWsSecurityHeader::TPasswordType,class HBufC8 * &)
+	??0CSenTransportProperties@@IAE@XZ @ 129 NONAME ; protected: __thiscall CSenTransportProperties::CSenTransportProperties(void)
+	??1CSenTransportProperties@@UAE@XZ @ 130 NONAME ; public: virtual __thiscall CSenTransportProperties::~CSenTransportProperties(void)
+	?SoapActionL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 131 NONAME ; public: virtual int __thiscall CSenTransportProperties::SoapActionL(class TPtrC8 &)
+	?AsUtf8L@CSenTransportProperties@@UAEPAVHBufC8@@XZ @ 132 NONAME ; public: virtual class HBufC8 * __thiscall CSenTransportProperties::AsUtf8L(void)
+	?AsUtf8LC@CSenTransportProperties@@UAEPAVHBufC8@@XZ @ 133 NONAME ; public: virtual class HBufC8 * __thiscall CSenTransportProperties::AsUtf8LC(void)
+	?BaseConstructL@CSenSoapEnvelope@@IAEXW4TSOAPVersion@@@Z @ 134 NONAME ; protected: void __thiscall CSenSoapEnvelope::BaseConstructL(enum TSOAPVersion)
+	?BaseConstructL@CSenSoapMessage@@IAEXW4TSOAPVersion@@@Z @ 135 NONAME ; protected: void __thiscall CSenSoapMessage::BaseConstructL(enum TSOAPVersion)
+	?BaseConstructL@CSenSoapMessage@@IAEXW4TSOAPVersion@@ABVTDesC8@@@Z @ 136 NONAME ; protected: void __thiscall CSenSoapMessage::BaseConstructL(enum TSOAPVersion,class TDesC8 const &)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVCSenElement@@@Z @ 137 NONAME ; protected: virtual void __thiscall CSenTransportProperties::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@000PAVCSenXmlReader@@@Z @ 138 NONAME ; protected: virtual void __thiscall CSenTransportProperties::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class CSenXmlReader *)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@00PAVCSenXmlReader@@@Z @ 139 NONAME ; protected: virtual void __thiscall CSenTransportProperties::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class CSenXmlReader *)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@0PAVCSenXmlReader@@@Z @ 140 NONAME ; protected: virtual void __thiscall CSenTransportProperties::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class CSenXmlReader *)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXABVTDesC8@@0@Z @ 141 NONAME ; protected: void __thiscall CSenWsSecurityHeader::BaseConstructL(class TDesC8 const &,class TDesC8 const &)
+	?BinarySecurityTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 142 NONAME ; public: static int __cdecl CSenWsSecurityHeader::BinarySecurityTokenL(class TDesC8 const &,class HBufC8 * &)
+	?BoolPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 143 NONAME ; public: virtual int __thiscall CSenTransportProperties::BoolPropertyL(class TDesC8 const &,int &)
+	?DecodeBase64L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 144 NONAME ; public: static class HBufC8 * __cdecl SenCryptoUtils::DecodeBase64L(class TDesC8 const &)
+	?DeviceIDL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 145 NONAME ; public: virtual int __thiscall CSenTransportProperties::DeviceIDL(class TPtrC8 &)
+	?EncodeBase64L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 146 NONAME ; public: static class HBufC8 * __cdecl SenCryptoUtils::EncodeBase64L(class TDesC8 const &)
+	?FaultSubcode@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 147 NONAME ; public: class TPtrC8 __thiscall CSenSoapFault::FaultSubcode(void)
+	?IapIdL@CSenTransportProperties@@UAEHAAK@Z @ 148 NONAME ; public: virtual int __thiscall CSenTransportProperties::IapIdL(unsigned long &)
+	?IntPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 149 NONAME ; public: virtual int __thiscall CSenTransportProperties::IntPropertyL(class TDesC8 const &,int &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 150 NONAME ; public: static class CSenHttpTransportProperties * __cdecl CSenHttpTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 151 NONAME ; public: static class CSenHttpTransportProperties * __cdecl CSenHttpTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@XZ @ 152 NONAME ; public: static class CSenHttpTransportProperties * __cdecl CSenHttpTransportProperties::NewL(void)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@PAVRStringPool@@@Z @ 153 NONAME ; public: static class CSenPropertiesElement * __cdecl CSenPropertiesElement::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &,class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@PAVRStringPool@@@Z @ 154 NONAME ; public: static class CSenPropertiesElement * __cdecl CSenPropertiesElement::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00PAVRStringPool@@@Z @ 155 NONAME ; public: static class CSenPropertiesElement * __cdecl CSenPropertiesElement::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@0PAVRStringPool@@@Z @ 156 NONAME ; public: static class CSenPropertiesElement * __cdecl CSenPropertiesElement::NewL(class TDesC8 const &,class TDesC8 const &,class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@PAVRStringPool@@@Z @ 157 NONAME ; public: static class CSenPropertiesElement * __cdecl CSenPropertiesElement::NewL(class TDesC8 const &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVCSenElement@@PAVRStringPool@@@Z @ 158 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class CSenElement const &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@PAVRStringPool@@@Z @ 159 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@PAVRStringPool@@@Z @ 160 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00PAVRStringPool@@@Z @ 161 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@0PAVRStringPool@@@Z @ 162 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class TDesC8 const &,class TDesC8 const &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@PAVRStringPool@@@Z @ 163 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class TDesC8 const &,class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@PAVRStringPool@@@Z @ 164 NONAME ; public: static class CSenPropertiesFragment * __cdecl CSenPropertiesFragment::NewL(class RStringPool *)
+	?NewL@CSenSoapMessage@@SAPAV1@W4TSOAPVersion@@@Z @ 165 NONAME ; public: static class CSenSoapMessage * __cdecl CSenSoapMessage::NewL(enum TSOAPVersion)
+	?NewL@CSenSoapMessage@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 166 NONAME ; public: static class CSenSoapMessage * __cdecl CSenSoapMessage::NewL(enum TSOAPVersion,class TDesC8 const &)
+	?NewL@CSenTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 167 NONAME ; public: static class CSenTransportProperties * __cdecl CSenTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 168 NONAME ; public: static class CSenTransportProperties * __cdecl CSenTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &)
+	?NewL@CSenTransportProperties@@SAPAV1@XZ @ 169 NONAME ; public: static class CSenTransportProperties * __cdecl CSenTransportProperties::NewL(void)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 170 NONAME ; public: static class CSenVtcpTransportProperties * __cdecl CSenVtcpTransportProperties::NewL(class TDesC8 const &,class CSenXmlReader &)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@XZ @ 171 NONAME ; public: static class CSenVtcpTransportProperties * __cdecl CSenVtcpTransportProperties::NewL(void)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@0@Z @ 172 NONAME ; public: static class CSenWsSecurityHeader * __cdecl CSenWsSecurityHeader::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenXmlProperties@@SAPAV1@ABVCSenElement@@@Z @ 173 NONAME ; public: static class CSenXmlProperties * __cdecl CSenXmlProperties::NewL(class CSenElement const &)
+	?NewL@CSenXmlProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 174 NONAME ; public: static class CSenXmlProperties * __cdecl CSenXmlProperties::NewL(class TDesC8 const &,class CSenXmlReader &)
+	?NewL@CSenXmlProperties@@SAPAV1@XZ @ 175 NONAME ; public: static class CSenXmlProperties * __cdecl CSenXmlProperties::NewL(void)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 176 NONAME ; public: static class CSenHttpTransportProperties * __cdecl CSenHttpTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 177 NONAME ; public: static class CSenHttpTransportProperties * __cdecl CSenHttpTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@XZ @ 178 NONAME ; public: static class CSenHttpTransportProperties * __cdecl CSenHttpTransportProperties::NewLC(void)
+	?NewLC@CSenTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 179 NONAME ; public: static class CSenTransportProperties * __cdecl CSenTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 180 NONAME ; public: static class CSenTransportProperties * __cdecl CSenTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &)
+	?NewLC@CSenTransportProperties@@SAPAV1@XZ @ 181 NONAME ; public: static class CSenTransportProperties * __cdecl CSenTransportProperties::NewLC(void)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 182 NONAME ; public: static class CSenVtcpTransportProperties * __cdecl CSenVtcpTransportProperties::NewLC(class TDesC8 const &,class CSenXmlReader &)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@XZ @ 183 NONAME ; public: static class CSenVtcpTransportProperties * __cdecl CSenVtcpTransportProperties::NewLC(void)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@0@Z @ 184 NONAME ; public: static class CSenWsSecurityHeader * __cdecl CSenWsSecurityHeader::NewLC(class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenXmlProperties@@SAPAV1@ABVCSenElement@@@Z @ 185 NONAME ; public: static class CSenXmlProperties * __cdecl CSenXmlProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenXmlProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 186 NONAME ; public: static class CSenXmlProperties * __cdecl CSenXmlProperties::NewLC(class TDesC8 const &,class CSenXmlReader &)
+	?NewLC@CSenXmlProperties@@SAPAV1@XZ @ 187 NONAME ; public: static class CSenXmlProperties * __cdecl CSenXmlProperties::NewLC(void)
+	?OpenChunkFromHandleNumberL@CSenChunk@@QAEHH@Z @ 188 NONAME ; public: int __thiscall CSenChunk::OpenChunkFromHandleNumberL(int)
+	?PSHA1L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@0H@Z @ 189 NONAME ; public: static class HBufC8 * __cdecl SenCryptoUtils::PSHA1L(class TDesC8 const &,class TDesC8 const &,int)
+	?PropertiesClassType@CSenTransportProperties@@UAE?AW4TSenPropertiesClassType@MSenProperties@@XZ @ 190 NONAME ; public: virtual enum MSenProperties::TSenPropertiesClassType __thiscall CSenTransportProperties::PropertiesClassType(void)
+	?PropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@1@Z @ 191 NONAME ; public: virtual int __thiscall CSenTransportProperties::PropertyL(class TDesC8 const &,class TPtrC8 &,class TPtrC8 &)
+	?PropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@@Z @ 192 NONAME ; public: virtual int __thiscall CSenTransportProperties::PropertyL(class TDesC8 const &,class TPtrC8 &)
+	?ProxyHostL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 193 NONAME ; public: virtual int __thiscall CSenTransportProperties::ProxyHostL(class TPtrC8 &)
+	?ProxyPortL@CSenTransportProperties@@UAEHAAH@Z @ 194 NONAME ; public: virtual int __thiscall CSenTransportProperties::ProxyPortL(int &)
+	?ProxyUsageL@CSenTransportProperties@@UAEHAAH@Z @ 195 NONAME ; public: virtual int __thiscall CSenTransportProperties::ProxyUsageL(int &)
+	?RandomAndHashMd5LC@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 196 NONAME ; public: static class HBufC8 * __cdecl SenCryptoUtils::RandomAndHashMd5LC(void)
+	?ReadFromL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 197 NONAME ; public: virtual void __thiscall CSenTransportProperties::ReadFromL(class TDesC8 const &)
+	?RemovePropertyL@CSenTransportProperties@@UAEHABVTDesC8@@@Z @ 198 NONAME ; public: virtual int __thiscall CSenTransportProperties::RemovePropertyL(class TDesC8 const &)
+	?SecureDialogL@CSenTransportProperties@@UAEHAAH@Z @ 199 NONAME ; public: virtual int __thiscall CSenTransportProperties::SecureDialogL(int &)
+	?SetSoapActionL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 200 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetSoapActionL(class TDesC8 const &)
+	?SetBoolPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 201 NONAME ; public: virtual int __thiscall CSenTransportProperties::SetBoolPropertyL(class TDesC8 const &,int)
+	?SetDeviceIDL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 202 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetDeviceIDL(class TDesC8 const &)
+	?SetIapIdL@CSenTransportProperties@@UAEXK@Z @ 203 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetIapIdL(unsigned long)
+	?SetIntPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 204 NONAME ; public: virtual int __thiscall CSenTransportProperties::SetIntPropertyL(class TDesC8 const &,int)
+	?SetOmittedL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 205 NONAME ; public: virtual int __thiscall CSenTransportProperties::SetOmittedL(class TDesC8 const &,int)
+	?SetPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@00@Z @ 206 NONAME ; public: virtual int __thiscall CSenTransportProperties::SetPropertyL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?SetPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@0@Z @ 207 NONAME ; public: virtual int __thiscall CSenTransportProperties::SetPropertyL(class TDesC8 const &,class TDesC8 const &)
+	?SetProxyHostL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 208 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetProxyHostL(class TDesC8 const &)
+	?SetProxyPortL@CSenTransportProperties@@UAEXH@Z @ 209 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetProxyPortL(int)
+	?SetProxyUsageL@CSenTransportProperties@@UAEXH@Z @ 210 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetProxyUsageL(int)
+	?SetReader@CSenTransportProperties@@UAEXAAVCSenXmlReader@@@Z @ 211 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetReader(class CSenXmlReader &)
+	?SetSecureDialogL@CSenTransportProperties@@UAEXH@Z @ 212 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetSecureDialogL(int)
+	?SetUserAgentL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 213 NONAME ; public: virtual void __thiscall CSenTransportProperties::SetUserAgentL(class TDesC8 const &)
+	?UserAgentL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 214 NONAME ; public: virtual int __thiscall CSenTransportProperties::UserAgentL(class TPtrC8 &)
+	?WriteToL@CSenTransportProperties@@UAEXAAVRWriteStream@@@Z @ 215 NONAME ; public: virtual void __thiscall CSenTransportProperties::WriteToL(class RWriteStream &)
+	?ApplyBindingL@CSenTransportProperties@@UAEXW4TSOAPVersion@@@Z @ 216 NONAME ; public: virtual void __thiscall CSenTransportProperties::ApplyBindingL(enum TSOAPVersion)
+	?SoapVersion@CSenSoapEnvelope@@UAE?AW4TSOAPVersion@@XZ @ 217 NONAME ; public: virtual enum TSOAPVersion __thiscall CSenSoapEnvelope::SoapVersion(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/BWINSCW/SENUTILSU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,270 @@
+EXPORTS
+	??0CSenSoapFault@@IAE@XZ @ 1 NONAME ; CSenSoapFault::CSenSoapFault(void)
+	??0CSenSoapMessage@@IAE@XZ @ 2 NONAME ; CSenSoapMessage::CSenSoapMessage(void)
+	??0CSenWsSecurityHeader@@IAE@XZ @ 3 NONAME ; CSenWsSecurityHeader::CSenWsSecurityHeader(void)
+	??1CSenSoapEnvelope@@UAE@XZ @ 4 NONAME ; CSenSoapEnvelope::~CSenSoapEnvelope(void)
+	??1CSenSoapFault@@UAE@XZ @ 5 NONAME ; CSenSoapFault::~CSenSoapFault(void)
+	??1CSenSoapMessage@@UAE@XZ @ 6 NONAME ; CSenSoapMessage::~CSenSoapMessage(void)
+	??1CSenWsSecurityHeader@@UAE@XZ @ 7 NONAME ; CSenWsSecurityHeader::~CSenWsSecurityHeader(void)
+	?AddHeaderL@CSenSoapEnvelope@@UAEAAVCSenElement@@AAV2@@Z @ 8 NONAME ; class CSenElement & CSenSoapEnvelope::AddHeaderL(class CSenElement &)
+	?AddSecurityTokenL@CSenSoapMessage@@QAEHABVTDesC8@@@Z @ 9 NONAME ; int CSenSoapMessage::AddSecurityTokenL(class TDesC8 const &)
+	?BaseConstructL@CSenSoapEnvelope@@IAEXXZ @ 10 NONAME ; void CSenSoapEnvelope::BaseConstructL(void)
+	?BaseConstructL@CSenSoapMessage@@IAEXXZ @ 11 NONAME ; void CSenSoapMessage::BaseConstructL(void)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXABVTDesC8@@@Z @ 12 NONAME ; void CSenWsSecurityHeader::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXXZ @ 13 NONAME ; void CSenWsSecurityHeader::BaseConstructL(void)
+	?BodyAsStringL@CSenSoapEnvelope@@UAEPAVHBufC8@@XZ @ 14 NONAME ; class HBufC8 * CSenSoapEnvelope::BodyAsStringL(void)
+	?BodyL@CSenSoapEnvelope@@UAEAAVCSenElement@@XZ @ 15 NONAME ; class CSenElement & CSenSoapEnvelope::BodyL(void)
+	?ConstructL@CSenSoapFault@@IAEXAAVCSenElement@@@Z @ 16 NONAME ; void CSenSoapFault::ConstructL(class CSenElement &)
+	?ConstructL@CSenSoapFault@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 17 NONAME ; void CSenSoapFault::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?DetachFaultL@CSenSoapEnvelope@@UAEPAVCSenSoapFault@@XZ @ 18 NONAME ; class CSenSoapFault * CSenSoapEnvelope::DetachFaultL(void)
+	?Detail@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 19 NONAME ; class TPtrC8 CSenSoapFault::Detail(void)
+	?EndElementL@CSenSoapEnvelope@@MAEXABVTDesC8@@00@Z @ 20 NONAME ; void CSenSoapEnvelope::EndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?FaultActor@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 21 NONAME ; class TPtrC8 CSenSoapFault::FaultActor(void)
+	?FaultCode@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 22 NONAME ; class TPtrC8 CSenSoapFault::FaultCode(void)
+	?FaultL@CSenSoapEnvelope@@UAEPAVCSenSoapFault@@XZ @ 23 NONAME ; class CSenSoapFault * CSenSoapEnvelope::FaultL(void)
+	?FaultString@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 24 NONAME ; class TPtrC8 CSenSoapFault::FaultString(void)
+	?FromXmlDateTimeL@SenDateUtils@@SA?AVTTime@@ABVTDesC8@@@Z @ 25 NONAME ; class TTime SenDateUtils::FromXmlDateTimeL(class TDesC8 const &)
+	?GetRandomGuid16LC@CSenGuidGen@@QAEPAVHBufC16@@XZ @ 26 NONAME ; class HBufC16 * CSenGuidGen::GetRandomGuid16LC(void)
+	?GetRandomGuid8LC@CSenGuidGen@@QAEPAVHBufC8@@XZ @ 27 NONAME ; class HBufC8 * CSenGuidGen::GetRandomGuid8LC(void)
+	?GetRandomGuidLC@CSenGuidGen@@QAEPAVHBufC16@@XZ @ 28 NONAME ; class HBufC16 * CSenGuidGen::GetRandomGuidLC(void)
+	?HeaderL@CSenSoapEnvelope@@UAEAAVCSenElement@@XZ @ 29 NONAME ; class CSenElement & CSenSoapEnvelope::HeaderL(void)
+	?IsFault@CSenSoapEnvelope@@UAEHXZ @ 30 NONAME ; int CSenSoapEnvelope::IsFault(void)
+	?NewL@CSenGuidGen@@SAPAV1@XZ @ 31 NONAME ; class CSenGuidGen * CSenGuidGen::NewL(void)
+	?NewL@CSenSoapEnvelope@@SAPAV1@XZ @ 32 NONAME ; class CSenSoapEnvelope * CSenSoapEnvelope::NewL(void)
+	?NewL@CSenSoapFault@@SAPAV1@AAVCSenElement@@@Z @ 33 NONAME ; class CSenSoapFault * CSenSoapFault::NewL(class CSenElement &)
+	?NewL@CSenSoapFault@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 34 NONAME ; class CSenSoapFault * CSenSoapFault::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenSoapMessage@@SAPAV1@XZ @ 35 NONAME ; class CSenSoapMessage * CSenSoapMessage::NewL(void)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@@Z @ 36 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewL(class TDesC8 const &)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@XZ @ 37 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewL(void)
+	?NewLC@CSenGuidGen@@SAPAV1@XZ @ 38 NONAME ; class CSenGuidGen * CSenGuidGen::NewLC(void)
+	?NewSecurityHeaderLC@CSenSoapMessage@@MAEPAVCSenWsSecurityHeader@@PBVTDesC8@@@Z @ 39 NONAME ; class CSenWsSecurityHeader * CSenSoapMessage::NewSecurityHeaderLC(class TDesC8 const *)
+	?ParseHeaderL@CSenSoapEnvelope@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 40 NONAME ; void CSenSoapEnvelope::ParseHeaderL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ParseHeaderL@CSenSoapMessage@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 41 NONAME ; void CSenSoapMessage::ParseHeaderL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?SetBodyL@CSenSoapEnvelope@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 42 NONAME ; class TPtrC8 CSenSoapEnvelope::SetBodyL(class TDesC8 const &)
+	?SetSecurityHeaderL@CSenSoapMessage@@QAEXABVTDesC8@@@Z @ 43 NONAME ; void CSenSoapMessage::SetSecurityHeaderL(class TDesC8 const &)
+	?SetSoapActionL@CSenSoapEnvelope@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 44 NONAME ; class TPtrC8 CSenSoapEnvelope::SetSoapActionL(class TDesC8 const &)
+	?SoapAction@CSenSoapEnvelope@@UAE?AVTPtrC8@@XZ @ 45 NONAME ; class TPtrC8 CSenSoapEnvelope::SoapAction(void)
+	?StartElementL@CSenSoapEnvelope@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 46 NONAME ; void CSenSoapEnvelope::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ToXmlDateTimeUtf8L@SenDateUtils@@SAXAAVTDes8@@ABVTTime@@@Z @ 47 NONAME ; void SenDateUtils::ToXmlDateTimeUtf8L(class TDes8 &, class TTime const &)
+	?UsernameTokenL@CSenWsSecurityHeader@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@@Z @ 48 NONAME ; class HBufC8 * CSenWsSecurityHeader::UsernameTokenL(class CSenIdentityProvider &)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 49 NONAME ; int CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &, class HBufC8 * &)
+	?XmlNs@CSenWsSecurityHeader@@UAE?AVTPtrC8@@XZ @ 50 NONAME ; class TPtrC8 CSenWsSecurityHeader::XmlNs(void)
+	?XmlNsPrefix@CSenWsSecurityHeader@@UAE?AVTPtrC8@@XZ @ 51 NONAME ; class TPtrC8 CSenWsSecurityHeader::XmlNsPrefix(void)
+	??0CSenAttribute@@IAE@XZ @ 52 NONAME ; CSenAttribute::CSenAttribute(void)
+	??1CSenAttribute@@UAE@XZ @ 53 NONAME ; CSenAttribute::~CSenAttribute(void)
+	??1CSenAttributes@@UAE@XZ @ 54 NONAME ; CSenAttributes::~CSenAttributes(void)
+	??1CSenIdentifier@@UAE@XZ @ 55 NONAME ; CSenIdentifier::~CSenIdentifier(void)
+	?AddAttributeL@CSenAttributes@@QAEXABVCSenAttribute@@@Z @ 56 NONAME ; void CSenAttributes::AddAttributeL(class CSenAttribute const &)
+	?AddAttributeL@CSenIdentifier@@QAEXAAVCSenAttribute@@@Z @ 57 NONAME ; void CSenIdentifier::AddAttributeL(class CSenAttribute &)
+	?AddValueL@CSenAttribute@@QAEXABVTDesC8@@@Z @ 58 NONAME ; void CSenAttribute::AddValueL(class TDesC8 const &)
+	?Attributes@CSenIdentifier@@QBEPBVCSenAttributes@@XZ @ 59 NONAME ; class CSenAttributes const * CSenIdentifier::Attributes(void) const
+	?CertInfoToStringLC@SenCertUtils@@SAPAVHBufC8@@ABVTCertInfo@@@Z @ 60 NONAME ; class HBufC8 * SenCertUtils::CertInfoToStringLC(class TCertInfo const &)
+	?ConstructL@CSenAttribute@@IAEXABVTDesC8@@000@Z @ 61 NONAME ; void CSenAttribute::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?Count@CSenAttributes@@QBEHXZ @ 62 NONAME ; int CSenAttributes::Count(void) const
+	?Equals@CSenAttribute@@QBEHABV1@@Z @ 63 NONAME ; int CSenAttribute::Equals(class CSenAttribute const &) const
+	?Equals@CSenAttributes@@QBEHABVCSenAttribute@@@Z @ 64 NONAME ; int CSenAttributes::Equals(class CSenAttribute const &) const
+	?Equals@CSenIdentifier@@QAEHABV1@@Z @ 65 NONAME ; int CSenIdentifier::Equals(class CSenIdentifier const &)
+	?FriendlyName@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 66 NONAME ; class TPtrC8 CSenAttribute::FriendlyName(void) const
+	?GetAttribute@CSenAttributes@@QBEABVCSenAttribute@@ABVTDesC8@@@Z @ 67 NONAME ; class CSenAttribute const & CSenAttributes::GetAttribute(class TDesC8 const &) const
+	?GetValues@CSenAttribute@@QBE?BV?$RPointerArray@VHBufC8@@@@XZ @ 68 NONAME ; class RPointerArray<class HBufC8> const CSenAttribute::GetValues(void) const
+	?IsProxy@CSenIdentifier@@QBEHXZ @ 69 NONAME ; int CSenIdentifier::IsProxy(void) const
+	?MatchAny@CSenAttributes@@QAEHABV1@@Z @ 70 NONAME ; int CSenAttributes::MatchAny(class CSenAttributes const &)
+	?Name@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 71 NONAME ; class TPtrC8 CSenAttribute::Name(void) const
+	?NewL@CSenAttribute@@SAPAV1@ABVTDesC8@@000@Z @ 72 NONAME ; class CSenAttribute * CSenAttribute::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenAttribute@@SAPAV1@ABVTDesC8@@00@Z @ 73 NONAME ; class CSenAttribute * CSenAttribute::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenAttributes@@SAPAV1@ABV1@@Z @ 74 NONAME ; class CSenAttributes * CSenAttributes::NewL(class CSenAttributes const &)
+	?NewL@CSenAttributes@@SAPAV1@XZ @ 75 NONAME ; class CSenAttributes * CSenAttributes::NewL(void)
+	?NewL@CSenIdentifier@@SAPAV1@ABV1@@Z @ 76 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(class CSenIdentifier const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTCertInfo@@@Z @ 77 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType, class TCertInfo const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@1@Z @ 78 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@@Z @ 79 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType, class TDesC8 const &)
+	?NewL@CSenIdentifier@@SAPAV1@XZ @ 80 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(void)
+	?NewLC@CSenAttributes@@SAPAV1@ABV1@@Z @ 81 NONAME ; class CSenAttributes * CSenAttributes::NewLC(class CSenAttributes const &)
+	?NewLC@CSenAttributes@@SAPAV1@XZ @ 82 NONAME ; class CSenAttributes * CSenAttributes::NewLC(void)
+	?NewLC@CSenIdentifier@@SAPAV1@ABV1@@Z @ 83 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(class CSenIdentifier const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTCertInfo@@@Z @ 84 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType, class TCertInfo const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@1@Z @ 85 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@@Z @ 86 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType, class TDesC8 const &)
+	?NewLC@CSenIdentifier@@SAPAV1@XZ @ 87 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(void)
+	?NumValues@CSenAttribute@@QBEHXZ @ 88 NONAME ; int CSenAttribute::NumValues(void) const
+	?Proxy@CSenIdentifier@@QBEPBV1@XZ @ 89 NONAME ; class CSenIdentifier const * CSenIdentifier::Proxy(void) const
+	?ProxyFor@CSenIdentifier@@QAEXPAV1@@Z @ 90 NONAME ; void CSenIdentifier::ProxyFor(class CSenIdentifier *)
+	?Root@CSenIdentifier@@QBEPBV1@XZ @ 91 NONAME ; class CSenIdentifier const * CSenIdentifier::Root(void) const
+	?SetValueL@CSenAttribute@@QAEXABVTDesC8@@@Z @ 92 NONAME ; void CSenAttribute::SetValueL(class TDesC8 const &)
+	?Type@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 93 NONAME ; class TPtrC8 CSenAttribute::Type(void) const
+	?Type@CSenIdentifier@@QBE?AW4TIdentifierType@SenIdentifier@@XZ @ 94 NONAME ; enum SenIdentifier::TIdentifierType CSenIdentifier::Type(void) const
+	?Value@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 95 NONAME ; class TPtrC8 CSenAttribute::Value(void) const
+	?Value@CSenIdentifier@@QBE?AVTPtrC8@@XZ @ 96 NONAME ; class TPtrC8 CSenIdentifier::Value(void) const
+	?ParseL@CSenSoapEnvelope@@UAEXABVTDesC8@@@Z @ 97 NONAME ; void CSenSoapEnvelope::ParseL(class TDesC8 const &)
+	?HasBody@CSenSoapEnvelope@@QAEHXZ @ 98 NONAME ; int CSenSoapEnvelope::HasBody(void)
+	?HasHeader@CSenSoapEnvelope@@QAEHXZ @ 99 NONAME ; int CSenSoapEnvelope::HasHeader(void)
+	??0CSenChunk@@IAE@XZ @ 100 NONAME ; CSenChunk::CSenChunk(void)
+	??1CSenChunk@@UAE@XZ @ 101 NONAME ; CSenChunk::~CSenChunk(void)
+	??8CSenChunk@@QAEHABV0@@Z @ 102 NONAME ; int CSenChunk::operator==(class CSenChunk const &)
+	?AdjustChunk@CSenChunk@@QAEHH@Z @ 103 NONAME ; int CSenChunk::AdjustChunk(int)
+	?AllocDescToChunk@CSenChunk@@QAEHHAAPAVTPtr8@@@Z @ 104 NONAME ; int CSenChunk::AllocDescToChunk(int, class TPtr8 * &)
+	?Chunk@CSenChunk@@QAEAAVRChunk@@XZ @ 105 NONAME ; class RChunk & CSenChunk::Chunk(void)
+	?ChunkHeader@CSenChunk@@QAEAAVTChunkHeader@@XZ @ 106 NONAME ; class TChunkHeader & CSenChunk::ChunkHeader(void)
+	?ChunkName@CSenChunk@@QBE?AVTPtrC16@@XZ @ 107 NONAME ; class TPtrC16 CSenChunk::ChunkName(void) const
+	?ChunkToArgs@CSenChunk@@QAEXAAVTIpcArgs@@H@Z @ 108 NONAME ; void CSenChunk::ChunkToArgs(class TIpcArgs &, int)
+	?CloseChunk@CSenChunk@@QAEXXZ @ 109 NONAME ; void CSenChunk::CloseChunk(void)
+	?CreateChunk@CSenChunk@@QAEHXZ @ 110 NONAME ; int CSenChunk::CreateChunk(void)
+	?DescFromChunk@CSenChunk@@QAEHAAVTPtrC8@@H@Z @ 111 NONAME ; int CSenChunk::DescFromChunk(class TPtrC8 &, int)
+	?DescToChunk@CSenChunk@@QAEHABVTDesC8@@@Z @ 112 NONAME ; int CSenChunk::DescToChunk(class TDesC8 const &)
+	?DescsFromChunk@CSenChunk@@QAEHAAVTPtrC8@@0@Z @ 113 NONAME ; int CSenChunk::DescsFromChunk(class TPtrC8 &, class TPtrC8 &)
+	?DescsToChunk@CSenChunk@@QAEHABVTDesC8@@0@Z @ 114 NONAME ; int CSenChunk::DescsToChunk(class TDesC8 const &, class TDesC8 const &)
+	?Log@CSenChunk@@IBEPAVRFileLogger@@XZ @ 115 NONAME ; class RFileLogger * CSenChunk::Log(void) const
+	?NewL@CSenChunk@@SAPAV1@ABVTDesC16@@@Z @ 116 NONAME ; class CSenChunk * CSenChunk::NewL(class TDesC16 const &)
+	?NewLC@CSenChunk@@SAPAV1@ABVTDesC16@@@Z @ 117 NONAME ; class CSenChunk * CSenChunk::NewLC(class TDesC16 const &)
+	?OpenChunk@CSenChunk@@QAEHXZ @ 118 NONAME ; int CSenChunk::OpenChunk(void)
+	?OpenChunkFromRMsgL@CSenChunk@@QAEHABVRMessage2@@H@Z @ 119 NONAME ; int CSenChunk::OpenChunkFromRMsgL(class RMessage2 const &, int)
+	?SetLogger@CSenChunk@@QAEXPAVRFileLogger@@@Z @ 120 NONAME ; void CSenChunk::SetLogger(class RFileLogger *)
+	??8CSenIdentifier@@QAEHABV0@@Z @ 121 NONAME ; int CSenIdentifier::operator==(class CSenIdentifier const &)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@@Z @ 122 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewLC(class TDesC8 const &)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@XZ @ 123 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewLC(void)
+	?TimestampL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 124 NONAME ; int CSenWsSecurityHeader::TimestampL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?TimestampL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 125 NONAME ; int CSenWsSecurityHeader::TimestampL(class TDesC8 const &, class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@W4TPasswordType@1@@Z @ 126 NONAME ; class HBufC8 * CSenWsSecurityHeader::UsernameTokenL(class CSenIdentityProvider &, enum CSenWsSecurityHeader::TPasswordType)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 127 NONAME ; int CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0W4TPasswordType@1@AAPAVHBufC8@@@Z @ 128 NONAME ; int CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &, class TDesC8 const &, enum CSenWsSecurityHeader::TPasswordType, class HBufC8 * &)
+	?BaseConstructL@CSenSoapEnvelope@@IAEXW4TSOAPVersion@@@Z @ 129 NONAME ; void CSenSoapEnvelope::BaseConstructL(enum TSOAPVersion)
+	?BaseConstructL@CSenSoapMessage@@IAEXW4TSOAPVersion@@@Z @ 130 NONAME ; void CSenSoapMessage::BaseConstructL(enum TSOAPVersion)
+	?FaultSubcode@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 131 NONAME ; class TPtrC8 CSenSoapFault::FaultSubcode(void)
+	?NewL@CSenSoapMessage@@SAPAV1@W4TSOAPVersion@@@Z @ 132 NONAME ; class CSenSoapMessage * CSenSoapMessage::NewL(enum TSOAPVersion)
+	??0CSenTransportProperties@@IAE@XZ @ 133 NONAME ; CSenTransportProperties::CSenTransportProperties(void)
+	??1CSenTransportProperties@@UAE@XZ @ 134 NONAME ; CSenTransportProperties::~CSenTransportProperties(void)
+	?SoapActionL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 135 NONAME ; int CSenTransportProperties::SoapActionL(class TPtrC8 &)
+	?AsUtf8L@CSenTransportProperties@@UAEPAVHBufC8@@XZ @ 136 NONAME ; class HBufC8 * CSenTransportProperties::AsUtf8L(void)
+	?AsUtf8LC@CSenTransportProperties@@UAEPAVHBufC8@@XZ @ 137 NONAME ; class HBufC8 * CSenTransportProperties::AsUtf8LC(void)
+	?BaseConstructL@CSenSoapMessage@@IAEXW4TSOAPVersion@@ABVTDesC8@@@Z @ 138 NONAME ; void CSenSoapMessage::BaseConstructL(enum TSOAPVersion, class TDesC8 const &)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVCSenElement@@@Z @ 139 NONAME ; void CSenTransportProperties::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@000PAVCSenXmlReader@@@Z @ 140 NONAME ; void CSenTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@00PAVCSenXmlReader@@@Z @ 141 NONAME ; void CSenTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@0PAVCSenXmlReader@@@Z @ 142 NONAME ; void CSenTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXABVTDesC8@@0@Z @ 143 NONAME ; void CSenWsSecurityHeader::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BinarySecurityTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 144 NONAME ; int CSenWsSecurityHeader::BinarySecurityTokenL(class TDesC8 const &, class HBufC8 * &)
+	?BoolPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 145 NONAME ; int CSenTransportProperties::BoolPropertyL(class TDesC8 const &, int &)
+	?DecodeBase64L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 146 NONAME ; class HBufC8 * SenCryptoUtils::DecodeBase64L(class TDesC8 const &)
+	?DeviceIDL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 147 NONAME ; int CSenTransportProperties::DeviceIDL(class TPtrC8 &)
+	?EncodeBase64L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 148 NONAME ; class HBufC8 * SenCryptoUtils::EncodeBase64L(class TDesC8 const &)
+	?IapIdL@CSenTransportProperties@@UAEHAAK@Z @ 149 NONAME ; int CSenTransportProperties::IapIdL(unsigned long &)
+	?IntPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 150 NONAME ; int CSenTransportProperties::IntPropertyL(class TDesC8 const &, int &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 151 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 152 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@XZ @ 153 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewL(void)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@PAVRStringPool@@@Z @ 154 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@PAVRStringPool@@@Z @ 155 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00PAVRStringPool@@@Z @ 156 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@0PAVRStringPool@@@Z @ 157 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@PAVRStringPool@@@Z @ 158 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVCSenElement@@PAVRStringPool@@@Z @ 159 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class CSenElement const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@PAVRStringPool@@@Z @ 160 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@PAVRStringPool@@@Z @ 161 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00PAVRStringPool@@@Z @ 162 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@0PAVRStringPool@@@Z @ 163 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@PAVRStringPool@@@Z @ 164 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@PAVRStringPool@@@Z @ 165 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class RStringPool *)
+	?NewL@CSenSoapMessage@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 166 NONAME ; class CSenSoapMessage * CSenSoapMessage::NewL(enum TSOAPVersion, class TDesC8 const &)
+	?NewL@CSenTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 167 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 168 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenTransportProperties@@SAPAV1@XZ @ 169 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewL(void)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 170 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@XZ @ 171 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewL(void)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@0@Z @ 172 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenXmlProperties@@SAPAV1@ABVCSenElement@@@Z @ 173 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewL(class CSenElement const &)
+	?NewL@CSenXmlProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 174 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenXmlProperties@@SAPAV1@XZ @ 175 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewL(void)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 176 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 177 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@XZ @ 178 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewLC(void)
+	?NewLC@CSenTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 179 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 180 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenTransportProperties@@SAPAV1@XZ @ 181 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewLC(void)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 182 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@XZ @ 183 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewLC(void)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@0@Z @ 184 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenXmlProperties@@SAPAV1@ABVCSenElement@@@Z @ 185 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenXmlProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 186 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenXmlProperties@@SAPAV1@XZ @ 187 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewLC(void)
+	?OpenChunkFromHandleNumberL@CSenChunk@@QAEHH@Z @ 188 NONAME ; int CSenChunk::OpenChunkFromHandleNumberL(int)
+	?GetPSHA1HashL@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@0H@Z @ 189 NONAME ; class HBufC8 * SenCryptoUtils::GetPSHA1HashL(class TDesC8 const &, class TDesC8 const &, int)
+	?PropertiesClassType@CSenTransportProperties@@UAE?AW4TSenPropertiesClassType@MSenProperties@@XZ @ 190 NONAME ; enum MSenProperties::TSenPropertiesClassType CSenTransportProperties::PropertiesClassType(void)
+	?PropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@1@Z @ 191 NONAME ; int CSenTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &, class TPtrC8 &)
+	?PropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@@Z @ 192 NONAME ; int CSenTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &)
+	?ProxyHostL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 193 NONAME ; int CSenTransportProperties::ProxyHostL(class TPtrC8 &)
+	?ProxyPortL@CSenTransportProperties@@UAEHAAH@Z @ 194 NONAME ; int CSenTransportProperties::ProxyPortL(int &)
+	?ProxyUsageL@CSenTransportProperties@@UAEHAAH@Z @ 195 NONAME ; int CSenTransportProperties::ProxyUsageL(int &)
+	?RandomAndHashMd5LC@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 196 NONAME ; class HBufC8 * SenCryptoUtils::RandomAndHashMd5LC(void)
+	?ReadFromL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 197 NONAME ; void CSenTransportProperties::ReadFromL(class TDesC8 const &)
+	?RemovePropertyL@CSenTransportProperties@@UAEHABVTDesC8@@@Z @ 198 NONAME ; int CSenTransportProperties::RemovePropertyL(class TDesC8 const &)
+	?SecureDialogL@CSenTransportProperties@@UAEHAAH@Z @ 199 NONAME ; int CSenTransportProperties::SecureDialogL(int &)
+	?SetSoapActionL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 200 NONAME ; void CSenTransportProperties::SetSoapActionL(class TDesC8 const &)
+	?SetBoolPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 201 NONAME ; int CSenTransportProperties::SetBoolPropertyL(class TDesC8 const &, int)
+	?SetDeviceIDL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 202 NONAME ; void CSenTransportProperties::SetDeviceIDL(class TDesC8 const &)
+	?SetIapIdL@CSenTransportProperties@@UAEXK@Z @ 203 NONAME ; void CSenTransportProperties::SetIapIdL(unsigned long)
+	?SetIntPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 204 NONAME ; int CSenTransportProperties::SetIntPropertyL(class TDesC8 const &, int)
+	?SetOmittedL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 205 NONAME ; int CSenTransportProperties::SetOmittedL(class TDesC8 const &, int)
+	?SetPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@00@Z @ 206 NONAME ; int CSenTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@0@Z @ 207 NONAME ; int CSenTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &)
+	?SetProxyHostL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 208 NONAME ; void CSenTransportProperties::SetProxyHostL(class TDesC8 const &)
+	?SetProxyPortL@CSenTransportProperties@@UAEXH@Z @ 209 NONAME ; void CSenTransportProperties::SetProxyPortL(int)
+	?SetProxyUsageL@CSenTransportProperties@@UAEXH@Z @ 210 NONAME ; void CSenTransportProperties::SetProxyUsageL(int)
+	?SetReader@CSenTransportProperties@@UAEXAAVCSenXmlReader@@@Z @ 211 NONAME ; void CSenTransportProperties::SetReader(class CSenXmlReader &)
+	?SetSecureDialogL@CSenTransportProperties@@UAEXH@Z @ 212 NONAME ; void CSenTransportProperties::SetSecureDialogL(int)
+	?SetUserAgentL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 213 NONAME ; void CSenTransportProperties::SetUserAgentL(class TDesC8 const &)
+	?UserAgentL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 214 NONAME ; int CSenTransportProperties::UserAgentL(class TPtrC8 &)
+	?WriteToL@CSenTransportProperties@@UAEXAAVRWriteStream@@@Z @ 215 NONAME ; void CSenTransportProperties::WriteToL(class RWriteStream &)
+	?ApplyBindingL@CSenTransportProperties@@UAEXW4TSOAPVersion@@@Z @ 216 NONAME ; void CSenTransportProperties::ApplyBindingL(enum TSOAPVersion)
+	?Clone@CSenTransportProperties@@UBEPAVMSenProperties@@AAH@Z @ 217 NONAME ; class MSenProperties * CSenTransportProperties::Clone(int &) const
+	?CloneL@CSenTransportProperties@@UBEPAVMSenProperties@@XZ @ 218 NONAME ; class MSenProperties * CSenTransportProperties::CloneL(void) const
+	?CreateEncodedBinarySecretL@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@0@Z @ 219 NONAME ; class HBufC8 * SenCryptoUtils::CreateEncodedBinarySecretL(class TDesC8 const &, class TDesC8 const &)
+	?DescToChunk@CSenChunk@@QAEHABVTDesC8@@H@Z @ 220 NONAME ; int CSenChunk::DescToChunk(class TDesC8 const &, int)
+	?DownloadFolderL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 221 NONAME ; int CSenTransportProperties::DownloadFolderL(class TPtrC8 &)
+	?FileAttachmentL@CSenTransportProperties@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 222 NONAME ; int CSenTransportProperties::FileAttachmentL(class TDesC8 const &, class HBufC8 * &)
+	?HeartbeatL@CSenTransportProperties@@UAEHAAH@Z @ 223 NONAME ; int CSenTransportProperties::HeartbeatL(int &)
+	?IsSafeToCast@CSenTransportProperties@@UAEHW4TSenPropertiesClassType@MSenProperties@@@Z @ 224 NONAME ; int CSenTransportProperties::IsSafeToCast(enum MSenProperties::TSenPropertiesClassType)
+	?MaxTimeToLiveL@CSenTransportProperties@@UAEHAAH@Z @ 225 NONAME ; int CSenTransportProperties::MaxTimeToLiveL(int &)
+	?MaxTimeToLiveL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 226 NONAME ; int CSenVtcpTransportProperties::MaxTimeToLiveL(int &)
+	?MessageIdL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 227 NONAME ; int CSenTransportProperties::MessageIdL(class TPtrC8 &)
+	?MinTimeToLiveL@CSenTransportProperties@@UAEHAAH@Z @ 228 NONAME ; int CSenTransportProperties::MinTimeToLiveL(int &)
+	?MinTimeToLiveL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 229 NONAME ; int CSenVtcpTransportProperties::MinTimeToLiveL(int &)
+	?MwsNamespaceL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 230 NONAME ; int CSenTransportProperties::MwsNamespaceL(class TPtrC8 &)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 231 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewL(class CSenElement const &)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 232 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewLC(class CSenElement const &)
+	?OnewayMessageOnOffL@CSenTransportProperties@@UAEHAAH@Z @ 233 NONAME ; int CSenTransportProperties::OnewayMessageOnOffL(int &)
+	?OnewayMessageOnOffL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 234 NONAME ; int CSenVtcpTransportProperties::OnewayMessageOnOffL(int &)
+	?SearchEndTagL@SenSaxUtils@@SAHABVTDesC8@@00AAH1@Z @ 235 NONAME ; int SenSaxUtils::SearchEndTagL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, int &, int &)
+	?SearchEndTagL@SenSaxUtils@@SAHABVTDesC8@@0AAH1AAVTPtrC8@@@Z @ 236 NONAME ; int SenSaxUtils::SearchEndTagL(class TDesC8 const &, class TDesC8 const &, int &, int &, class TPtrC8 &)
+	?SearchStartTagL@SenSaxUtils@@SAHABVTDesC8@@00AAH1@Z @ 237 NONAME ; int SenSaxUtils::SearchStartTagL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, int &, int &)
+	?SearchStartTagL@SenSaxUtils@@SAHABVTDesC8@@0AAH1AAVTPtrC8@@@Z @ 238 NONAME ; int SenSaxUtils::SearchStartTagL(class TDesC8 const &, class TDesC8 const &, int &, int &, class TPtrC8 &)
+	?SetDownloadFolderL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 239 NONAME ; void CSenTransportProperties::SetDownloadFolderL(class TDesC8 const &)
+	?SetFileAttachmentL@CSenTransportProperties@@UAEHABVTDesC8@@0@Z @ 240 NONAME ; int CSenTransportProperties::SetFileAttachmentL(class TDesC8 const &, class TDesC8 const &)
+	?SetHeartbeatL@CSenTransportProperties@@UAEHH@Z @ 241 NONAME ; int CSenTransportProperties::SetHeartbeatL(int)
+	?SetMaxTimeToLiveL@CSenTransportProperties@@UAEHH@Z @ 242 NONAME ; int CSenTransportProperties::SetMaxTimeToLiveL(int)
+	?SetMaxTimeToLiveL@CSenVtcpTransportProperties@@UAEHH@Z @ 243 NONAME ; int CSenVtcpTransportProperties::SetMaxTimeToLiveL(int)
+	?SetMessageIdL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 244 NONAME ; void CSenTransportProperties::SetMessageIdL(class TDesC8 const &)
+	?SetMinTimeToLiveL@CSenTransportProperties@@UAEHH@Z @ 245 NONAME ; int CSenTransportProperties::SetMinTimeToLiveL(int)
+	?SetMinTimeToLiveL@CSenVtcpTransportProperties@@UAEHH@Z @ 246 NONAME ; int CSenVtcpTransportProperties::SetMinTimeToLiveL(int)
+	?SetMwsNamespaceL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 247 NONAME ; void CSenTransportProperties::SetMwsNamespaceL(class TDesC8 const &)
+	?SetOnewayMessageOnOffL@CSenTransportProperties@@UAEXH@Z @ 248 NONAME ; void CSenTransportProperties::SetOnewayMessageOnOffL(int)
+	?SetOnewayMessageOnOffL@CSenVtcpTransportProperties@@UAEXH@Z @ 249 NONAME ; void CSenVtcpTransportProperties::SetOnewayMessageOnOffL(int)
+	?SoapVersion@CSenSoapEnvelope@@QAE?AW4TSOAPVersion@@XZ @ 250 NONAME ; enum TSOAPVersion CSenSoapEnvelope::SoapVersion(void)
+	?BinarySecurityTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 251 NONAME ; int CSenWsSecurityHeader::BinarySecurityTokenL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?SoapAction2@CSenSoapEnvelope@@QAE?AVTPtrC8@@XZ @ 252 NONAME ; class TPtrC8 CSenSoapEnvelope::SoapAction2(void)
+	?ToXmlDateTimeUtf82L@SenDateUtils@@SAXAAVTDes8@@ABVTTime@@@Z @ 253 NONAME ; void SenDateUtils::ToXmlDateTimeUtf82L(class TDes8 &, class TTime const &)
+	?GetRandomNonceL@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 254 NONAME ; class HBufC8 * SenCryptoUtils::GetRandomNonceL(void)
+	?GetTimestampL@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 255 NONAME ; class HBufC8 * SenCryptoUtils::GetTimestampL(void)
+	?EndpointResourceL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 256 NONAME ; int CSenTransportProperties::EndpointResourceL(class TPtrC8 &)
+	?SetEndpointResourceL@CSenTransportProperties@@UAEHABVTDesC8@@@Z @ 257 NONAME ; int CSenTransportProperties::SetEndpointResourceL(class TDesC8 const &)
+	?GetTimestampL@SenCryptoUtils@@SAPAVHBufC8@@VTTime@@@Z @ 258 NONAME ; class HBufC8 * SenCryptoUtils::GetTimestampL(class TTime)
+	?SetSnapIdL@CSenTransportProperties@@QAEXK@Z @ 259 NONAME ; void CSenTransportProperties::SetSnapIdL(unsigned long)
+	?SnapIdL@CSenTransportProperties@@QAEHAAK@Z @ 260 NONAME ; int CSenTransportProperties::SnapIdL(unsigned long &)
+	?MaxRetryTTLL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 261 NONAME ; int CSenVtcpTransportProperties::MaxRetryTTLL(int &)
+	?SetRetryDeltaTimeoutL@CSenVtcpTransportProperties@@UAEHH@Z @ 262 NONAME ; int CSenVtcpTransportProperties::SetRetryDeltaTimeoutL(int)
+	?MinRetryTTLL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 263 NONAME ; int CSenVtcpTransportProperties::MinRetryTTLL(int &)
+	?SetMaxRetryTTLL@CSenVtcpTransportProperties@@UAEHH@Z @ 264 NONAME ; int CSenVtcpTransportProperties::SetMaxRetryTTLL(int)
+	?RetryDeltaTimeoutL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 265 NONAME ; int CSenVtcpTransportProperties::RetryDeltaTimeoutL(int &)
+	?SetMinRetryTTLL@CSenVtcpTransportProperties@@UAEHH@Z @ 266 NONAME ; int CSenVtcpTransportProperties::SetMinRetryTTLL(int)
+	?RequestFileHandle@CSenChunk@@QAEXAAVRFile@@@Z @ 267 NONAME ; void CSenChunk::RequestFileHandle(class RFile &)
+	?RequestFileHandle@CSenChunk@@QAEAAVRFile@@XZ @ 268 NONAME ; class RFile & CSenChunk::RequestFileHandle(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/BWINSCW/SENUTILS_V2U.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,270 @@
+EXPORTS
+	??0CSenSoapFault@@IAE@XZ @ 1 NONAME ; CSenSoapFault::CSenSoapFault(void)
+	??0CSenSoapMessage@@IAE@XZ @ 2 NONAME ; CSenSoapMessage::CSenSoapMessage(void)
+	??0CSenWsSecurityHeader@@IAE@XZ @ 3 NONAME ; CSenWsSecurityHeader::CSenWsSecurityHeader(void)
+	??1CSenSoapEnvelope@@UAE@XZ @ 4 NONAME ; CSenSoapEnvelope::~CSenSoapEnvelope(void)
+	??1CSenSoapFault@@UAE@XZ @ 5 NONAME ; CSenSoapFault::~CSenSoapFault(void)
+	??1CSenSoapMessage@@UAE@XZ @ 6 NONAME ; CSenSoapMessage::~CSenSoapMessage(void)
+	??1CSenWsSecurityHeader@@UAE@XZ @ 7 NONAME ; CSenWsSecurityHeader::~CSenWsSecurityHeader(void)
+	?AddHeaderL@CSenSoapEnvelope@@UAEAAVCSenElement@@AAV2@@Z @ 8 NONAME ; class CSenElement & CSenSoapEnvelope::AddHeaderL(class CSenElement &)
+	?AddSecurityTokenL@CSenSoapMessage@@QAEHABVTDesC8@@@Z @ 9 NONAME ; int CSenSoapMessage::AddSecurityTokenL(class TDesC8 const &)
+	?BaseConstructL@CSenSoapEnvelope@@IAEXXZ @ 10 NONAME ; void CSenSoapEnvelope::BaseConstructL(void)
+	?BaseConstructL@CSenSoapMessage@@IAEXXZ @ 11 NONAME ; void CSenSoapMessage::BaseConstructL(void)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXABVTDesC8@@@Z @ 12 NONAME ; void CSenWsSecurityHeader::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXXZ @ 13 NONAME ; void CSenWsSecurityHeader::BaseConstructL(void)
+	?BodyAsStringL@CSenSoapEnvelope@@UAEPAVHBufC8@@XZ @ 14 NONAME ; class HBufC8 * CSenSoapEnvelope::BodyAsStringL(void)
+	?BodyL@CSenSoapEnvelope@@UAEAAVCSenElement@@XZ @ 15 NONAME ; class CSenElement & CSenSoapEnvelope::BodyL(void)
+	?ConstructL@CSenSoapFault@@IAEXAAVCSenElement@@@Z @ 16 NONAME ; void CSenSoapFault::ConstructL(class CSenElement &)
+	?ConstructL@CSenSoapFault@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 17 NONAME ; void CSenSoapFault::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?DetachFaultL@CSenSoapEnvelope@@UAEPAVCSenSoapFault@@XZ @ 18 NONAME ; class CSenSoapFault * CSenSoapEnvelope::DetachFaultL(void)
+	?Detail@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 19 NONAME ; class TPtrC8 CSenSoapFault::Detail(void)
+	?EndElementL@CSenSoapEnvelope@@MAEXABVTDesC8@@00@Z @ 20 NONAME ; void CSenSoapEnvelope::EndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?FaultActor@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 21 NONAME ; class TPtrC8 CSenSoapFault::FaultActor(void)
+	?FaultCode@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 22 NONAME ; class TPtrC8 CSenSoapFault::FaultCode(void)
+	?FaultL@CSenSoapEnvelope@@UAEPAVCSenSoapFault@@XZ @ 23 NONAME ; class CSenSoapFault * CSenSoapEnvelope::FaultL(void)
+	?FaultString@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 24 NONAME ; class TPtrC8 CSenSoapFault::FaultString(void)
+	?FromXmlDateTimeL@SenDateUtils@@SA?AVTTime@@ABVTDesC8@@@Z @ 25 NONAME ; class TTime SenDateUtils::FromXmlDateTimeL(class TDesC8 const &)
+	?GetRandomGuid16LC@CSenGuidGen@@QAEPAVHBufC16@@XZ @ 26 NONAME ; class HBufC16 * CSenGuidGen::GetRandomGuid16LC(void)
+	?GetRandomGuid8LC@CSenGuidGen@@QAEPAVHBufC8@@XZ @ 27 NONAME ; class HBufC8 * CSenGuidGen::GetRandomGuid8LC(void)
+	?GetRandomGuidLC@CSenGuidGen@@QAEPAVHBufC16@@XZ @ 28 NONAME ; class HBufC16 * CSenGuidGen::GetRandomGuidLC(void)
+	?HeaderL@CSenSoapEnvelope@@UAEAAVCSenElement@@XZ @ 29 NONAME ; class CSenElement & CSenSoapEnvelope::HeaderL(void)
+	?IsFault@CSenSoapEnvelope@@UAEHXZ @ 30 NONAME ; int CSenSoapEnvelope::IsFault(void)
+	?NewL@CSenGuidGen@@SAPAV1@XZ @ 31 NONAME ; class CSenGuidGen * CSenGuidGen::NewL(void)
+	?NewL@CSenSoapEnvelope@@SAPAV1@XZ @ 32 NONAME ; class CSenSoapEnvelope * CSenSoapEnvelope::NewL(void)
+	?NewL@CSenSoapFault@@SAPAV1@AAVCSenElement@@@Z @ 33 NONAME ; class CSenSoapFault * CSenSoapFault::NewL(class CSenElement &)
+	?NewL@CSenSoapFault@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 34 NONAME ; class CSenSoapFault * CSenSoapFault::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenSoapMessage@@SAPAV1@XZ @ 35 NONAME ; class CSenSoapMessage * CSenSoapMessage::NewL(void)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@@Z @ 36 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewL(class TDesC8 const &)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@XZ @ 37 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewL(void)
+	?NewLC@CSenGuidGen@@SAPAV1@XZ @ 38 NONAME ; class CSenGuidGen * CSenGuidGen::NewLC(void)
+	?NewSecurityHeaderLC@CSenSoapMessage@@MAEPAVCSenWsSecurityHeader@@PBVTDesC8@@@Z @ 39 NONAME ; class CSenWsSecurityHeader * CSenSoapMessage::NewSecurityHeaderLC(class TDesC8 const *)
+	?ParseHeaderL@CSenSoapEnvelope@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 40 NONAME ; void CSenSoapEnvelope::ParseHeaderL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ParseHeaderL@CSenSoapMessage@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 41 NONAME ; void CSenSoapMessage::ParseHeaderL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?SetBodyL@CSenSoapEnvelope@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 42 NONAME ; class TPtrC8 CSenSoapEnvelope::SetBodyL(class TDesC8 const &)
+	?SetSecurityHeaderL@CSenSoapMessage@@QAEXABVTDesC8@@@Z @ 43 NONAME ; void CSenSoapMessage::SetSecurityHeaderL(class TDesC8 const &)
+	?SetSoapActionL@CSenSoapEnvelope@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 44 NONAME ; class TPtrC8 CSenSoapEnvelope::SetSoapActionL(class TDesC8 const &)
+	?SoapAction@CSenSoapEnvelope@@UAE?AVTPtrC8@@XZ @ 45 NONAME ; class TPtrC8 CSenSoapEnvelope::SoapAction(void)
+	?StartElementL@CSenSoapEnvelope@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 46 NONAME ; void CSenSoapEnvelope::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ToXmlDateTimeUtf8L@SenDateUtils@@SAXAAVTDes8@@ABVTTime@@@Z @ 47 NONAME ; void SenDateUtils::ToXmlDateTimeUtf8L(class TDes8 &, class TTime const &)
+	?UsernameTokenL@CSenWsSecurityHeader@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@@Z @ 48 NONAME ; class HBufC8 * CSenWsSecurityHeader::UsernameTokenL(class CSenIdentityProvider &)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 49 NONAME ; int CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &, class HBufC8 * &)
+	?XmlNs@CSenWsSecurityHeader@@UAE?AVTPtrC8@@XZ @ 50 NONAME ; class TPtrC8 CSenWsSecurityHeader::XmlNs(void)
+	?XmlNsPrefix@CSenWsSecurityHeader@@UAE?AVTPtrC8@@XZ @ 51 NONAME ; class TPtrC8 CSenWsSecurityHeader::XmlNsPrefix(void)
+	??0CSenAttribute@@IAE@XZ @ 52 NONAME ; CSenAttribute::CSenAttribute(void)
+	??1CSenAttribute@@UAE@XZ @ 53 NONAME ; CSenAttribute::~CSenAttribute(void)
+	??1CSenAttributes@@UAE@XZ @ 54 NONAME ; CSenAttributes::~CSenAttributes(void)
+	??1CSenIdentifier@@UAE@XZ @ 55 NONAME ; CSenIdentifier::~CSenIdentifier(void)
+	?AddAttributeL@CSenAttributes@@QAEXABVCSenAttribute@@@Z @ 56 NONAME ; void CSenAttributes::AddAttributeL(class CSenAttribute const &)
+	?AddAttributeL@CSenIdentifier@@QAEXAAVCSenAttribute@@@Z @ 57 NONAME ; void CSenIdentifier::AddAttributeL(class CSenAttribute &)
+	?AddValueL@CSenAttribute@@QAEXABVTDesC8@@@Z @ 58 NONAME ; void CSenAttribute::AddValueL(class TDesC8 const &)
+	?Attributes@CSenIdentifier@@QBEPBVCSenAttributes@@XZ @ 59 NONAME ; class CSenAttributes const * CSenIdentifier::Attributes(void) const
+	?CertInfoToStringLC@SenCertUtils@@SAPAVHBufC8@@ABVTCertInfo@@@Z @ 60 NONAME ; class HBufC8 * SenCertUtils::CertInfoToStringLC(class TCertInfo const &)
+	?ConstructL@CSenAttribute@@IAEXABVTDesC8@@000@Z @ 61 NONAME ; void CSenAttribute::ConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?Count@CSenAttributes@@QBEHXZ @ 62 NONAME ; int CSenAttributes::Count(void) const
+	?Equals@CSenAttribute@@QBEHABV1@@Z @ 63 NONAME ; int CSenAttribute::Equals(class CSenAttribute const &) const
+	?Equals@CSenAttributes@@QBEHABVCSenAttribute@@@Z @ 64 NONAME ; int CSenAttributes::Equals(class CSenAttribute const &) const
+	?Equals@CSenIdentifier@@QAEHABV1@@Z @ 65 NONAME ; int CSenIdentifier::Equals(class CSenIdentifier const &)
+	?FriendlyName@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 66 NONAME ; class TPtrC8 CSenAttribute::FriendlyName(void) const
+	?GetAttribute@CSenAttributes@@QBEABVCSenAttribute@@ABVTDesC8@@@Z @ 67 NONAME ; class CSenAttribute const & CSenAttributes::GetAttribute(class TDesC8 const &) const
+	?GetValues@CSenAttribute@@QBE?BV?$RPointerArray@VHBufC8@@@@XZ @ 68 NONAME ; class RPointerArray<class HBufC8> const CSenAttribute::GetValues(void) const
+	?IsProxy@CSenIdentifier@@QBEHXZ @ 69 NONAME ; int CSenIdentifier::IsProxy(void) const
+	?MatchAny@CSenAttributes@@QAEHABV1@@Z @ 70 NONAME ; int CSenAttributes::MatchAny(class CSenAttributes const &)
+	?Name@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 71 NONAME ; class TPtrC8 CSenAttribute::Name(void) const
+	?NewL@CSenAttribute@@SAPAV1@ABVTDesC8@@000@Z @ 72 NONAME ; class CSenAttribute * CSenAttribute::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenAttribute@@SAPAV1@ABVTDesC8@@00@Z @ 73 NONAME ; class CSenAttribute * CSenAttribute::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenAttributes@@SAPAV1@ABV1@@Z @ 74 NONAME ; class CSenAttributes * CSenAttributes::NewL(class CSenAttributes const &)
+	?NewL@CSenAttributes@@SAPAV1@XZ @ 75 NONAME ; class CSenAttributes * CSenAttributes::NewL(void)
+	?NewL@CSenIdentifier@@SAPAV1@ABV1@@Z @ 76 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(class CSenIdentifier const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTCertInfo@@@Z @ 77 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType, class TCertInfo const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@1@Z @ 78 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@@Z @ 79 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(enum SenIdentifier::TIdentifierType, class TDesC8 const &)
+	?NewL@CSenIdentifier@@SAPAV1@XZ @ 80 NONAME ; class CSenIdentifier * CSenIdentifier::NewL(void)
+	?NewLC@CSenAttributes@@SAPAV1@ABV1@@Z @ 81 NONAME ; class CSenAttributes * CSenAttributes::NewLC(class CSenAttributes const &)
+	?NewLC@CSenAttributes@@SAPAV1@XZ @ 82 NONAME ; class CSenAttributes * CSenAttributes::NewLC(void)
+	?NewLC@CSenIdentifier@@SAPAV1@ABV1@@Z @ 83 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(class CSenIdentifier const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTCertInfo@@@Z @ 84 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType, class TCertInfo const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@1@Z @ 85 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType, class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenIdentifier@@SAPAV1@W4TIdentifierType@SenIdentifier@@ABVTDesC8@@@Z @ 86 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(enum SenIdentifier::TIdentifierType, class TDesC8 const &)
+	?NewLC@CSenIdentifier@@SAPAV1@XZ @ 87 NONAME ; class CSenIdentifier * CSenIdentifier::NewLC(void)
+	?NumValues@CSenAttribute@@QBEHXZ @ 88 NONAME ; int CSenAttribute::NumValues(void) const
+	?Proxy@CSenIdentifier@@QBEPBV1@XZ @ 89 NONAME ; class CSenIdentifier const * CSenIdentifier::Proxy(void) const
+	?ProxyFor@CSenIdentifier@@QAEXPAV1@@Z @ 90 NONAME ; void CSenIdentifier::ProxyFor(class CSenIdentifier *)
+	?Root@CSenIdentifier@@QBEPBV1@XZ @ 91 NONAME ; class CSenIdentifier const * CSenIdentifier::Root(void) const
+	?SetValueL@CSenAttribute@@QAEXABVTDesC8@@@Z @ 92 NONAME ; void CSenAttribute::SetValueL(class TDesC8 const &)
+	?Type@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 93 NONAME ; class TPtrC8 CSenAttribute::Type(void) const
+	?Type@CSenIdentifier@@QBE?AW4TIdentifierType@SenIdentifier@@XZ @ 94 NONAME ; enum SenIdentifier::TIdentifierType CSenIdentifier::Type(void) const
+	?Value@CSenAttribute@@QBE?AVTPtrC8@@XZ @ 95 NONAME ; class TPtrC8 CSenAttribute::Value(void) const
+	?Value@CSenIdentifier@@QBE?AVTPtrC8@@XZ @ 96 NONAME ; class TPtrC8 CSenIdentifier::Value(void) const
+	?ParseL@CSenSoapEnvelope@@UAEXABVTDesC8@@@Z @ 97 NONAME ; void CSenSoapEnvelope::ParseL(class TDesC8 const &)
+	?HasBody@CSenSoapEnvelope@@QAEHXZ @ 98 NONAME ; int CSenSoapEnvelope::HasBody(void)
+	?HasHeader@CSenSoapEnvelope@@QAEHXZ @ 99 NONAME ; int CSenSoapEnvelope::HasHeader(void)
+	??0CSenChunk@@IAE@XZ @ 100 NONAME ; CSenChunk::CSenChunk(void)
+	??1CSenChunk@@UAE@XZ @ 101 NONAME ; CSenChunk::~CSenChunk(void)
+	??8CSenChunk@@QAEHABV0@@Z @ 102 NONAME ; int CSenChunk::operator==(class CSenChunk const &)
+	?AdjustChunk@CSenChunk@@QAEHH@Z @ 103 NONAME ; int CSenChunk::AdjustChunk(int)
+	?AllocDescToChunk@CSenChunk@@QAEHHAAPAVTPtr8@@@Z @ 104 NONAME ; int CSenChunk::AllocDescToChunk(int, class TPtr8 * &)
+	?Chunk@CSenChunk@@QAEAAVRChunk@@XZ @ 105 NONAME ; class RChunk & CSenChunk::Chunk(void)
+	?ChunkHeader@CSenChunk@@QAEAAVTChunkHeader@@XZ @ 106 NONAME ; class TChunkHeader & CSenChunk::ChunkHeader(void)
+	?ChunkName@CSenChunk@@QBE?AVTPtrC16@@XZ @ 107 NONAME ; class TPtrC16 CSenChunk::ChunkName(void) const
+	?ChunkToArgs@CSenChunk@@QAEXAAVTIpcArgs@@H@Z @ 108 NONAME ; void CSenChunk::ChunkToArgs(class TIpcArgs &, int)
+	?CloseChunk@CSenChunk@@QAEXXZ @ 109 NONAME ; void CSenChunk::CloseChunk(void)
+	?CreateChunk@CSenChunk@@QAEHXZ @ 110 NONAME ; int CSenChunk::CreateChunk(void)
+	?DescFromChunk@CSenChunk@@QAEHAAVTPtrC8@@H@Z @ 111 NONAME ; int CSenChunk::DescFromChunk(class TPtrC8 &, int)
+	?DescToChunk@CSenChunk@@QAEHABVTDesC8@@@Z @ 112 NONAME ; int CSenChunk::DescToChunk(class TDesC8 const &)
+	?DescsFromChunk@CSenChunk@@QAEHAAVTPtrC8@@0@Z @ 113 NONAME ; int CSenChunk::DescsFromChunk(class TPtrC8 &, class TPtrC8 &)
+	?DescsToChunk@CSenChunk@@QAEHABVTDesC8@@0@Z @ 114 NONAME ; int CSenChunk::DescsToChunk(class TDesC8 const &, class TDesC8 const &)
+	?Log@CSenChunk@@IBEPAVRFileLogger@@XZ @ 115 NONAME ; class RFileLogger * CSenChunk::Log(void) const
+	?NewL@CSenChunk@@SAPAV1@ABVTDesC16@@@Z @ 116 NONAME ; class CSenChunk * CSenChunk::NewL(class TDesC16 const &)
+	?NewLC@CSenChunk@@SAPAV1@ABVTDesC16@@@Z @ 117 NONAME ; class CSenChunk * CSenChunk::NewLC(class TDesC16 const &)
+	?OpenChunk@CSenChunk@@QAEHXZ @ 118 NONAME ; int CSenChunk::OpenChunk(void)
+	?OpenChunkFromRMsgL@CSenChunk@@QAEHABVRMessage2@@H@Z @ 119 NONAME ; int CSenChunk::OpenChunkFromRMsgL(class RMessage2 const &, int)
+	?SetLogger@CSenChunk@@QAEXPAVRFileLogger@@@Z @ 120 NONAME ; void CSenChunk::SetLogger(class RFileLogger *)
+	??8CSenIdentifier@@QAEHABV0@@Z @ 121 NONAME ; int CSenIdentifier::operator==(class CSenIdentifier const &)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@@Z @ 122 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewLC(class TDesC8 const &)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@XZ @ 123 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewLC(void)
+	?TimestampL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 124 NONAME ; int CSenWsSecurityHeader::TimestampL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?TimestampL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 125 NONAME ; int CSenWsSecurityHeader::TimestampL(class TDesC8 const &, class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader@@QAEPAVHBufC8@@AAVCSenIdentityProvider@@W4TPasswordType@1@@Z @ 126 NONAME ; class HBufC8 * CSenWsSecurityHeader::UsernameTokenL(class CSenIdentityProvider &, enum CSenWsSecurityHeader::TPasswordType)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 127 NONAME ; int CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?UsernameTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0W4TPasswordType@1@AAPAVHBufC8@@@Z @ 128 NONAME ; int CSenWsSecurityHeader::UsernameTokenL(class TDesC8 const &, class TDesC8 const &, enum CSenWsSecurityHeader::TPasswordType, class HBufC8 * &)
+	?BaseConstructL@CSenSoapEnvelope@@IAEXW4TSOAPVersion@@@Z @ 129 NONAME ; void CSenSoapEnvelope::BaseConstructL(enum TSOAPVersion)
+	?BaseConstructL@CSenSoapMessage@@IAEXW4TSOAPVersion@@@Z @ 130 NONAME ; void CSenSoapMessage::BaseConstructL(enum TSOAPVersion)
+	?FaultSubcode@CSenSoapFault@@QAE?AVTPtrC8@@XZ @ 131 NONAME ; class TPtrC8 CSenSoapFault::FaultSubcode(void)
+	?NewL@CSenSoapMessage@@SAPAV1@W4TSOAPVersion@@@Z @ 132 NONAME ; class CSenSoapMessage * CSenSoapMessage::NewL(enum TSOAPVersion)
+	??0CSenTransportProperties@@IAE@XZ @ 133 NONAME ; CSenTransportProperties::CSenTransportProperties(void)
+	??1CSenTransportProperties@@UAE@XZ @ 134 NONAME ; CSenTransportProperties::~CSenTransportProperties(void)
+	?SoapActionL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 135 NONAME ; int CSenTransportProperties::SoapActionL(class TPtrC8 &)
+	?AsUtf8L@CSenTransportProperties@@UAEPAVHBufC8@@XZ @ 136 NONAME ; class HBufC8 * CSenTransportProperties::AsUtf8L(void)
+	?AsUtf8LC@CSenTransportProperties@@UAEPAVHBufC8@@XZ @ 137 NONAME ; class HBufC8 * CSenTransportProperties::AsUtf8LC(void)
+	?BaseConstructL@CSenSoapMessage@@IAEXW4TSOAPVersion@@ABVTDesC8@@@Z @ 138 NONAME ; void CSenSoapMessage::BaseConstructL(enum TSOAPVersion, class TDesC8 const &)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVCSenElement@@@Z @ 139 NONAME ; void CSenTransportProperties::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@000PAVCSenXmlReader@@@Z @ 140 NONAME ; void CSenTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@00PAVCSenXmlReader@@@Z @ 141 NONAME ; void CSenTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *)
+	?BaseConstructL@CSenTransportProperties@@MAEXABVTDesC8@@0PAVCSenXmlReader@@@Z @ 142 NONAME ; void CSenTransportProperties::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class CSenXmlReader *)
+	?BaseConstructL@CSenWsSecurityHeader@@IAEXABVTDesC8@@0@Z @ 143 NONAME ; void CSenWsSecurityHeader::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BinarySecurityTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 144 NONAME ; int CSenWsSecurityHeader::BinarySecurityTokenL(class TDesC8 const &, class HBufC8 * &)
+	?BoolPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 145 NONAME ; int CSenTransportProperties::BoolPropertyL(class TDesC8 const &, int &)
+	?DecodeBase64L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 146 NONAME ; class HBufC8 * SenCryptoUtils::DecodeBase64L(class TDesC8 const &)
+	?DeviceIDL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 147 NONAME ; int CSenTransportProperties::DeviceIDL(class TPtrC8 &)
+	?EncodeBase64L@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 148 NONAME ; class HBufC8 * SenCryptoUtils::EncodeBase64L(class TDesC8 const &)
+	?IapIdL@CSenTransportProperties@@UAEHAAK@Z @ 149 NONAME ; int CSenTransportProperties::IapIdL(unsigned long &)
+	?IntPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAH@Z @ 150 NONAME ; int CSenTransportProperties::IntPropertyL(class TDesC8 const &, int &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 151 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 152 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenHttpTransportProperties@@SAPAV1@XZ @ 153 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewL(void)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@PAVRStringPool@@@Z @ 154 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@PAVRStringPool@@@Z @ 155 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@00PAVRStringPool@@@Z @ 156 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@0PAVRStringPool@@@Z @ 157 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesElement@@SAPAV1@ABVTDesC8@@PAVRStringPool@@@Z @ 158 NONAME ; class CSenPropertiesElement * CSenPropertiesElement::NewL(class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVCSenElement@@PAVRStringPool@@@Z @ 159 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class CSenElement const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@PAVRStringPool@@@Z @ 160 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@PAVRStringPool@@@Z @ 161 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@00PAVRStringPool@@@Z @ 162 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@0PAVRStringPool@@@Z @ 163 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@ABVTDesC8@@PAVRStringPool@@@Z @ 164 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class TDesC8 const &, class RStringPool *)
+	?NewL@CSenPropertiesFragment@@SAPAV1@PAVRStringPool@@@Z @ 165 NONAME ; class CSenPropertiesFragment * CSenPropertiesFragment::NewL(class RStringPool *)
+	?NewL@CSenSoapMessage@@SAPAV1@W4TSOAPVersion@@ABVTDesC8@@@Z @ 166 NONAME ; class CSenSoapMessage * CSenSoapMessage::NewL(enum TSOAPVersion, class TDesC8 const &)
+	?NewL@CSenTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 167 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewL(class CSenElement const &)
+	?NewL@CSenTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 168 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenTransportProperties@@SAPAV1@XZ @ 169 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewL(void)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 170 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@XZ @ 171 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewL(void)
+	?NewL@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@0@Z @ 172 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenXmlProperties@@SAPAV1@ABVCSenElement@@@Z @ 173 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewL(class CSenElement const &)
+	?NewL@CSenXmlProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 174 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewL(class TDesC8 const &, class CSenXmlReader &)
+	?NewL@CSenXmlProperties@@SAPAV1@XZ @ 175 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewL(void)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 176 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 177 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenHttpTransportProperties@@SAPAV1@XZ @ 178 NONAME ; class CSenHttpTransportProperties * CSenHttpTransportProperties::NewLC(void)
+	?NewLC@CSenTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 179 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 180 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenTransportProperties@@SAPAV1@XZ @ 181 NONAME ; class CSenTransportProperties * CSenTransportProperties::NewLC(void)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 182 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@XZ @ 183 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewLC(void)
+	?NewLC@CSenWsSecurityHeader@@SAPAV1@ABVTDesC8@@0@Z @ 184 NONAME ; class CSenWsSecurityHeader * CSenWsSecurityHeader::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenXmlProperties@@SAPAV1@ABVCSenElement@@@Z @ 185 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewLC(class CSenElement const &)
+	?NewLC@CSenXmlProperties@@SAPAV1@ABVTDesC8@@AAVCSenXmlReader@@@Z @ 186 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewLC(class TDesC8 const &, class CSenXmlReader &)
+	?NewLC@CSenXmlProperties@@SAPAV1@XZ @ 187 NONAME ; class CSenXmlProperties * CSenXmlProperties::NewLC(void)
+	?OpenChunkFromHandleNumberL@CSenChunk@@QAEHH@Z @ 188 NONAME ; int CSenChunk::OpenChunkFromHandleNumberL(int)
+	?GetPSHA1HashL@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@0H@Z @ 189 NONAME ; class HBufC8 * SenCryptoUtils::GetPSHA1HashL(class TDesC8 const &, class TDesC8 const &, int)
+	?PropertiesClassType@CSenTransportProperties@@UAE?AW4TSenPropertiesClassType@MSenProperties@@XZ @ 190 NONAME ; enum MSenProperties::TSenPropertiesClassType CSenTransportProperties::PropertiesClassType(void)
+	?PropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@1@Z @ 191 NONAME ; int CSenTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &, class TPtrC8 &)
+	?PropertyL@CSenTransportProperties@@UAEHABVTDesC8@@AAVTPtrC8@@@Z @ 192 NONAME ; int CSenTransportProperties::PropertyL(class TDesC8 const &, class TPtrC8 &)
+	?ProxyHostL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 193 NONAME ; int CSenTransportProperties::ProxyHostL(class TPtrC8 &)
+	?ProxyPortL@CSenTransportProperties@@UAEHAAH@Z @ 194 NONAME ; int CSenTransportProperties::ProxyPortL(int &)
+	?ProxyUsageL@CSenTransportProperties@@UAEHAAH@Z @ 195 NONAME ; int CSenTransportProperties::ProxyUsageL(int &)
+	?RandomAndHashMd5LC@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 196 NONAME ; class HBufC8 * SenCryptoUtils::RandomAndHashMd5LC(void)
+	?ReadFromL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 197 NONAME ; void CSenTransportProperties::ReadFromL(class TDesC8 const &)
+	?RemovePropertyL@CSenTransportProperties@@UAEHABVTDesC8@@@Z @ 198 NONAME ; int CSenTransportProperties::RemovePropertyL(class TDesC8 const &)
+	?SecureDialogL@CSenTransportProperties@@UAEHAAH@Z @ 199 NONAME ; int CSenTransportProperties::SecureDialogL(int &)
+	?SetSoapActionL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 200 NONAME ; void CSenTransportProperties::SetSoapActionL(class TDesC8 const &)
+	?SetBoolPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 201 NONAME ; int CSenTransportProperties::SetBoolPropertyL(class TDesC8 const &, int)
+	?SetDeviceIDL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 202 NONAME ; void CSenTransportProperties::SetDeviceIDL(class TDesC8 const &)
+	?SetIapIdL@CSenTransportProperties@@UAEXK@Z @ 203 NONAME ; void CSenTransportProperties::SetIapIdL(unsigned long)
+	?SetIntPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 204 NONAME ; int CSenTransportProperties::SetIntPropertyL(class TDesC8 const &, int)
+	?SetOmittedL@CSenTransportProperties@@UAEHABVTDesC8@@H@Z @ 205 NONAME ; int CSenTransportProperties::SetOmittedL(class TDesC8 const &, int)
+	?SetPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@00@Z @ 206 NONAME ; int CSenTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetPropertyL@CSenTransportProperties@@UAEHABVTDesC8@@0@Z @ 207 NONAME ; int CSenTransportProperties::SetPropertyL(class TDesC8 const &, class TDesC8 const &)
+	?SetProxyHostL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 208 NONAME ; void CSenTransportProperties::SetProxyHostL(class TDesC8 const &)
+	?SetProxyPortL@CSenTransportProperties@@UAEXH@Z @ 209 NONAME ; void CSenTransportProperties::SetProxyPortL(int)
+	?SetProxyUsageL@CSenTransportProperties@@UAEXH@Z @ 210 NONAME ; void CSenTransportProperties::SetProxyUsageL(int)
+	?SetReader@CSenTransportProperties@@UAEXAAVCSenXmlReader@@@Z @ 211 NONAME ; void CSenTransportProperties::SetReader(class CSenXmlReader &)
+	?SetSecureDialogL@CSenTransportProperties@@UAEXH@Z @ 212 NONAME ; void CSenTransportProperties::SetSecureDialogL(int)
+	?SetUserAgentL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 213 NONAME ; void CSenTransportProperties::SetUserAgentL(class TDesC8 const &)
+	?UserAgentL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 214 NONAME ; int CSenTransportProperties::UserAgentL(class TPtrC8 &)
+	?WriteToL@CSenTransportProperties@@UAEXAAVRWriteStream@@@Z @ 215 NONAME ; void CSenTransportProperties::WriteToL(class RWriteStream &)
+	?ApplyBindingL@CSenTransportProperties@@UAEXW4TSOAPVersion@@@Z @ 216 NONAME ; void CSenTransportProperties::ApplyBindingL(enum TSOAPVersion)
+	?Clone@CSenTransportProperties@@UBEPAVMSenProperties@@AAH@Z @ 217 NONAME ; class MSenProperties * CSenTransportProperties::Clone(int &) const
+	?CloneL@CSenTransportProperties@@UBEPAVMSenProperties@@XZ @ 218 NONAME ; class MSenProperties * CSenTransportProperties::CloneL(void) const
+	?CreateEncodedBinarySecretL@SenCryptoUtils@@SAPAVHBufC8@@ABVTDesC8@@0@Z @ 219 NONAME ; class HBufC8 * SenCryptoUtils::CreateEncodedBinarySecretL(class TDesC8 const &, class TDesC8 const &)
+	?DescToChunk@CSenChunk@@QAEHABVTDesC8@@H@Z @ 220 NONAME ; int CSenChunk::DescToChunk(class TDesC8 const &, int)
+	?DownloadFolderL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 221 NONAME ; int CSenTransportProperties::DownloadFolderL(class TPtrC8 &)
+	?FileAttachmentL@CSenTransportProperties@@UAEHABVTDesC8@@AAPAVHBufC8@@@Z @ 222 NONAME ; int CSenTransportProperties::FileAttachmentL(class TDesC8 const &, class HBufC8 * &)
+	?HeartbeatL@CSenTransportProperties@@UAEHAAH@Z @ 223 NONAME ; int CSenTransportProperties::HeartbeatL(int &)
+	?IsSafeToCast@CSenTransportProperties@@UAEHW4TSenPropertiesClassType@MSenProperties@@@Z @ 224 NONAME ; int CSenTransportProperties::IsSafeToCast(enum MSenProperties::TSenPropertiesClassType)
+	?MaxTimeToLiveL@CSenTransportProperties@@UAEHAAH@Z @ 225 NONAME ; int CSenTransportProperties::MaxTimeToLiveL(int &)
+	?MaxTimeToLiveL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 226 NONAME ; int CSenVtcpTransportProperties::MaxTimeToLiveL(int &)
+	?MessageIdL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 227 NONAME ; int CSenTransportProperties::MessageIdL(class TPtrC8 &)
+	?MinTimeToLiveL@CSenTransportProperties@@UAEHAAH@Z @ 228 NONAME ; int CSenTransportProperties::MinTimeToLiveL(int &)
+	?MinTimeToLiveL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 229 NONAME ; int CSenVtcpTransportProperties::MinTimeToLiveL(int &)
+	?MwsNamespaceL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 230 NONAME ; int CSenTransportProperties::MwsNamespaceL(class TPtrC8 &)
+	?NewL@CSenVtcpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 231 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewL(class CSenElement const &)
+	?NewLC@CSenVtcpTransportProperties@@SAPAV1@ABVCSenElement@@@Z @ 232 NONAME ; class CSenVtcpTransportProperties * CSenVtcpTransportProperties::NewLC(class CSenElement const &)
+	?OnewayMessageOnOffL@CSenTransportProperties@@UAEHAAH@Z @ 233 NONAME ; int CSenTransportProperties::OnewayMessageOnOffL(int &)
+	?OnewayMessageOnOffL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 234 NONAME ; int CSenVtcpTransportProperties::OnewayMessageOnOffL(int &)
+	?SearchEndTagL@SenSaxUtils@@SAHABVTDesC8@@00AAH1@Z @ 235 NONAME ; int SenSaxUtils::SearchEndTagL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, int &, int &)
+	?SearchEndTagL@SenSaxUtils@@SAHABVTDesC8@@0AAH1AAVTPtrC8@@@Z @ 236 NONAME ; int SenSaxUtils::SearchEndTagL(class TDesC8 const &, class TDesC8 const &, int &, int &, class TPtrC8 &)
+	?SearchStartTagL@SenSaxUtils@@SAHABVTDesC8@@00AAH1@Z @ 237 NONAME ; int SenSaxUtils::SearchStartTagL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, int &, int &)
+	?SearchStartTagL@SenSaxUtils@@SAHABVTDesC8@@0AAH1AAVTPtrC8@@@Z @ 238 NONAME ; int SenSaxUtils::SearchStartTagL(class TDesC8 const &, class TDesC8 const &, int &, int &, class TPtrC8 &)
+	?SetDownloadFolderL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 239 NONAME ; void CSenTransportProperties::SetDownloadFolderL(class TDesC8 const &)
+	?SetFileAttachmentL@CSenTransportProperties@@UAEHABVTDesC8@@0@Z @ 240 NONAME ; int CSenTransportProperties::SetFileAttachmentL(class TDesC8 const &, class TDesC8 const &)
+	?SetHeartbeatL@CSenTransportProperties@@UAEHH@Z @ 241 NONAME ; int CSenTransportProperties::SetHeartbeatL(int)
+	?SetMaxTimeToLiveL@CSenTransportProperties@@UAEHH@Z @ 242 NONAME ; int CSenTransportProperties::SetMaxTimeToLiveL(int)
+	?SetMaxTimeToLiveL@CSenVtcpTransportProperties@@UAEHH@Z @ 243 NONAME ; int CSenVtcpTransportProperties::SetMaxTimeToLiveL(int)
+	?SetMessageIdL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 244 NONAME ; void CSenTransportProperties::SetMessageIdL(class TDesC8 const &)
+	?SetMinTimeToLiveL@CSenTransportProperties@@UAEHH@Z @ 245 NONAME ; int CSenTransportProperties::SetMinTimeToLiveL(int)
+	?SetMinTimeToLiveL@CSenVtcpTransportProperties@@UAEHH@Z @ 246 NONAME ; int CSenVtcpTransportProperties::SetMinTimeToLiveL(int)
+	?SetMwsNamespaceL@CSenTransportProperties@@UAEXABVTDesC8@@@Z @ 247 NONAME ; void CSenTransportProperties::SetMwsNamespaceL(class TDesC8 const &)
+	?SetOnewayMessageOnOffL@CSenTransportProperties@@UAEXH@Z @ 248 NONAME ; void CSenTransportProperties::SetOnewayMessageOnOffL(int)
+	?SetOnewayMessageOnOffL@CSenVtcpTransportProperties@@UAEXH@Z @ 249 NONAME ; void CSenVtcpTransportProperties::SetOnewayMessageOnOffL(int)
+	?SoapVersion@CSenSoapEnvelope@@QAE?AW4TSOAPVersion@@XZ @ 250 NONAME ; enum TSOAPVersion CSenSoapEnvelope::SoapVersion(void)
+	?BinarySecurityTokenL@CSenWsSecurityHeader@@SAHABVTDesC8@@0AAPAVHBufC8@@@Z @ 251 NONAME ; int CSenWsSecurityHeader::BinarySecurityTokenL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?SetSnapIdL@CSenTransportProperties@@QAEXK@Z @ 252 NONAME ; void CSenTransportProperties::SetSnapIdL(unsigned long)
+	?SnapIdL@CSenTransportProperties@@QAEHAAK@Z @ 253 NONAME ; int CSenTransportProperties::SnapIdL(unsigned long &)
+	?EndpointResourceL@CSenTransportProperties@@UAEHAAVTPtrC8@@@Z @ 254 NONAME ; int CSenTransportProperties::EndpointResourceL(class TPtrC8 &)
+	?GetRandomNonceL@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 255 NONAME ; class HBufC8 * SenCryptoUtils::GetRandomNonceL(void)
+	?GetTimestampL@SenCryptoUtils@@SAPAVHBufC8@@XZ @ 256 NONAME ; class HBufC8 * SenCryptoUtils::GetTimestampL(void)
+	?SetEndpointResourceL@CSenTransportProperties@@UAEHABVTDesC8@@@Z @ 257 NONAME ; int CSenTransportProperties::SetEndpointResourceL(class TDesC8 const &)
+	?GetTimestampL@SenCryptoUtils@@SAPAVHBufC8@@VTTime@@@Z @ 258 NONAME ; class HBufC8 * SenCryptoUtils::GetTimestampL(class TTime)
+	?MaxRetryTTLL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 259 NONAME ; int CSenVtcpTransportProperties::MaxRetryTTLL(int &)
+	?MinRetryTTLL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 260 NONAME ; int CSenVtcpTransportProperties::MinRetryTTLL(int &)
+	?RetryDeltaTimeoutL@CSenVtcpTransportProperties@@UAEHAAH@Z @ 261 NONAME ; int CSenVtcpTransportProperties::RetryDeltaTimeoutL(int &)
+	?SetMaxRetryTTLL@CSenVtcpTransportProperties@@UAEHH@Z @ 262 NONAME ; int CSenVtcpTransportProperties::SetMaxRetryTTLL(int)
+	?SetMinRetryTTLL@CSenVtcpTransportProperties@@UAEHH@Z @ 263 NONAME ; int CSenVtcpTransportProperties::SetMinRetryTTLL(int)
+	?SetRetryDeltaTimeoutL@CSenVtcpTransportProperties@@UAEHH@Z @ 264 NONAME ; int CSenVtcpTransportProperties::SetRetryDeltaTimeoutL(int)
+	?ToXmlDateTimeUtf82L@SenDateUtils@@SAXAAVTDes8@@ABVTTime@@@Z @ 265 NONAME ; void SenDateUtils::ToXmlDateTimeUtf82L(class TDes8 &, class TTime const &)
+	?SoapAction2@CSenSoapEnvelope@@QAE?AVTPtrC8@@XZ @ 266 NONAME ; class TPtrC8 CSenSoapEnvelope::SoapAction2(void)
+	?RequestFileHandle@CSenChunk@@QAEXAAVRFile@@@Z @ 267 NONAME ; void CSenChunk::RequestFileHandle(class RFile &)
+	?RequestFileHandle@CSenChunk@@QAEAAVRFile@@XZ @ 268 NONAME ; class RFile & CSenChunk::RequestFileHandle(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/eabi/SENUTILSu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,327 @@
+EXPORTS
+	_ZN11CSenGuidGen15GetRandomGuidLCEv @ 1 NONAME
+	_ZN11CSenGuidGen16GetRandomGuid8LCEv @ 2 NONAME
+	_ZN11CSenGuidGen17GetRandomGuid16LCEv @ 3 NONAME
+	_ZN11CSenGuidGen4NewLEv @ 4 NONAME
+	_ZN11CSenGuidGen5NewLCEv @ 5 NONAME
+	_ZN12SenDateUtils16FromXmlDateTimeLERK6TDesC8 @ 6 NONAME
+	_ZN12SenDateUtils18ToXmlDateTimeUtf8LER5TDes8RK5TTime @ 7 NONAME
+	_ZN13CSenSoapFault10ConstructLER11CSenElement @ 8 NONAME
+	_ZN13CSenSoapFault10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 9 NONAME
+	_ZN13CSenSoapFault10FaultActorEv @ 10 NONAME
+	_ZN13CSenSoapFault11FaultStringEv @ 11 NONAME
+	_ZN13CSenSoapFault4NewLER11CSenElement @ 12 NONAME
+	_ZN13CSenSoapFault4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 13 NONAME
+	_ZN13CSenSoapFault6DetailEv @ 14 NONAME
+	_ZN13CSenSoapFault9FaultCodeEv @ 15 NONAME
+	_ZN13CSenSoapFaultC1Ev @ 16 NONAME
+	_ZN13CSenSoapFaultC2Ev @ 17 NONAME
+	_ZN13CSenSoapFaultD0Ev @ 18 NONAME
+	_ZN13CSenSoapFaultD1Ev @ 19 NONAME
+	_ZN13CSenSoapFaultD2Ev @ 20 NONAME
+	_ZN15CSenSoapMessage12ParseHeaderLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 21 NONAME
+	_ZN15CSenSoapMessage14BaseConstructLEv @ 22 NONAME
+	_ZN15CSenSoapMessage17AddSecurityTokenLERK6TDesC8 @ 23 NONAME
+	_ZN15CSenSoapMessage18SetSecurityHeaderLERK6TDesC8 @ 24 NONAME
+	_ZN15CSenSoapMessage19NewSecurityHeaderLCEPK6TDesC8 @ 25 NONAME
+	_ZN15CSenSoapMessage4NewLEv @ 26 NONAME
+	_ZN15CSenSoapMessageC1Ev @ 27 NONAME
+	_ZN15CSenSoapMessageC2Ev @ 28 NONAME
+	_ZN15CSenSoapMessageD0Ev @ 29 NONAME
+	_ZN15CSenSoapMessageD1Ev @ 30 NONAME
+	_ZN15CSenSoapMessageD2Ev @ 31 NONAME
+	_ZN16CSenSoapEnvelope10AddHeaderLER11CSenElement @ 32 NONAME
+	_ZN16CSenSoapEnvelope10SoapActionEv @ 33 NONAME
+	_ZN16CSenSoapEnvelope11EndElementLERK6TDesC8S2_S2_ @ 34 NONAME
+	_ZN16CSenSoapEnvelope13BodyAsStringLEv @ 35 NONAME
+	_ZN16CSenSoapEnvelope12DetachFaultLEv @ 36 NONAME
+	_ZN16CSenSoapEnvelope12ParseHeaderLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 37 NONAME
+	_ZN16CSenSoapEnvelope13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 38 NONAME
+	_ZN16CSenSoapEnvelope14BaseConstructLEv @ 39 NONAME
+	_ZN16CSenSoapEnvelope14SetSoapActionLERK6TDesC8 @ 40 NONAME
+	_ZN16CSenSoapEnvelope4NewLEv @ 41 NONAME
+	_ZN16CSenSoapEnvelope5BodyLEv @ 42 NONAME
+	_ZN16CSenSoapEnvelope6FaultLEv @ 43 NONAME
+	_ZN16CSenSoapEnvelope7HeaderLEv @ 44 NONAME
+	_ZN16CSenSoapEnvelope7IsFaultEv @ 45 NONAME
+	_ZN16CSenSoapEnvelope8SetBodyLERK6TDesC8 @ 46 NONAME
+	_ZN16CSenSoapEnvelopeD0Ev @ 47 NONAME
+	_ZN16CSenSoapEnvelopeD1Ev @ 48 NONAME
+	_ZN16CSenSoapEnvelopeD2Ev @ 49 NONAME
+	_ZN20CSenWsSecurityHeader11XmlNsPrefixEv @ 50 NONAME
+	_ZN20CSenWsSecurityHeader14BaseConstructLERK6TDesC8 @ 51 NONAME
+	_ZN20CSenWsSecurityHeader14BaseConstructLEv @ 52 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLER20CSenIdentityProvider @ 53 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLERK6TDesC8RP6HBufC8 @ 54 NONAME
+	_ZN20CSenWsSecurityHeader4NewLERK6TDesC8 @ 55 NONAME
+	_ZN20CSenWsSecurityHeader4NewLEv @ 56 NONAME
+	_ZN20CSenWsSecurityHeader5XmlNsEv @ 57 NONAME
+	_ZN20CSenWsSecurityHeaderC1Ev @ 58 NONAME
+	_ZN20CSenWsSecurityHeaderC2Ev @ 59 NONAME
+	_ZN20CSenWsSecurityHeaderD0Ev @ 60 NONAME
+	_ZN20CSenWsSecurityHeaderD1Ev @ 61 NONAME
+	_ZN20CSenWsSecurityHeaderD2Ev @ 62 NONAME
+	_ZTI11CSenGuidGen @ 63 NONAME ; #<TI>#
+	_ZTI13CSenSoapFault @ 64 NONAME ; #<TI>#
+	_ZTI15CSenSoapMessage @ 65 NONAME ; #<TI>#
+	_ZTI16CSenSoapEnvelope @ 66 NONAME ; #<TI>#
+	_ZTI20CSenWsSecurityHeader @ 67 NONAME ; #<TI>#
+	_ZTV11CSenGuidGen @ 68 NONAME ; #<VT>#
+	_ZTV13CSenSoapFault @ 69 NONAME ; #<VT>#
+	_ZTV15CSenSoapMessage @ 70 NONAME ; #<VT>#
+	_ZTV16CSenSoapEnvelope @ 71 NONAME ; #<VT>#
+	_ZTV20CSenWsSecurityHeader @ 72 NONAME ; #<VT>#
+	_ZN11SenSaxUtils13SearchEndTagLERK6TDesC8S2_RiS3_R6TPtrC8 @ 73 NONAME
+	_ZN11SenSaxUtils13SearchEndTagLERK6TDesC8S2_S2_RiS3_ @ 74 NONAME
+	_ZN11SenSaxUtils15SearchStartTagLERK6TDesC8S2_RiS3_R6TPtrC8 @ 75 NONAME
+	_ZN11SenSaxUtils15SearchStartTagLERK6TDesC8S2_S2_RiS3_ @ 76 NONAME
+	_ZN12SenCertUtils18CertInfoToStringLCERK9TCertInfo @ 77 NONAME
+	_ZN13CSenAttribute10ConstructLERK6TDesC8S2_S2_S2_ @ 78 NONAME
+	_ZN13CSenAttribute4NewLERK6TDesC8S2_S2_ @ 79 NONAME
+	_ZN13CSenAttribute4NewLERK6TDesC8S2_S2_S2_ @ 80 NONAME
+	_ZN13CSenAttribute9AddValueLERK6TDesC8 @ 81 NONAME
+	_ZN13CSenAttribute9SetValueLERK6TDesC8 @ 82 NONAME
+	_ZN13CSenAttributeC1Ev @ 83 NONAME
+	_ZN13CSenAttributeC2Ev @ 84 NONAME
+	_ZN13CSenAttributeD0Ev @ 85 NONAME
+	_ZN13CSenAttributeD1Ev @ 86 NONAME
+	_ZN13CSenAttributeD2Ev @ 87 NONAME
+	_ZN13CSenSoapFault12FaultSubcodeEv @ 88 NONAME
+	_ZN14CSenAttributes13AddAttributeLERK13CSenAttribute @ 89 NONAME
+	_ZN14CSenAttributes4NewLERKS_ @ 90 NONAME
+	_ZN14CSenAttributes4NewLEv @ 91 NONAME
+	_ZN14CSenAttributes5NewLCERKS_ @ 92 NONAME
+	_ZN14CSenAttributes5NewLCEv @ 93 NONAME
+	_ZN14CSenAttributes8MatchAnyERKS_ @ 94 NONAME
+	_ZN14CSenAttributesD0Ev @ 95 NONAME
+	_ZN14CSenAttributesD1Ev @ 96 NONAME
+	_ZN14CSenAttributesD2Ev @ 97 NONAME
+	_ZN14CSenIdentifier13AddAttributeLER13CSenAttribute @ 98 NONAME
+	_ZN14CSenIdentifier4NewLEN13SenIdentifier15TIdentifierTypeERK6TDesC8 @ 99 NONAME
+	_ZN14CSenIdentifier4NewLEN13SenIdentifier15TIdentifierTypeERK6TDesC8S4_ @ 100 NONAME
+	_ZN14CSenIdentifier4NewLEN13SenIdentifier15TIdentifierTypeERK9TCertInfo @ 101 NONAME
+	_ZN14CSenIdentifier4NewLERKS_ @ 102 NONAME
+	_ZN14CSenIdentifier4NewLEv @ 103 NONAME
+	_ZN14CSenIdentifier5NewLCEN13SenIdentifier15TIdentifierTypeERK6TDesC8 @ 104 NONAME
+	_ZN14CSenIdentifier5NewLCEN13SenIdentifier15TIdentifierTypeERK6TDesC8S4_ @ 105 NONAME
+	_ZN14CSenIdentifier5NewLCEN13SenIdentifier15TIdentifierTypeERK9TCertInfo @ 106 NONAME
+	_ZN14CSenIdentifier5NewLCERKS_ @ 107 NONAME
+	_ZN14CSenIdentifier5NewLCEv @ 108 NONAME
+	_ZN14CSenIdentifier6EqualsERKS_ @ 109 NONAME
+	_ZN14CSenIdentifier8ProxyForEPS_ @ 110 NONAME
+	_ZN14CSenIdentifierD0Ev @ 111 NONAME
+	_ZN14CSenIdentifierD1Ev @ 112 NONAME
+	_ZN14CSenIdentifierD2Ev @ 113 NONAME
+	_ZN14CSenIdentifiereqERKS_ @ 114 NONAME
+	_ZN14SenCryptoUtils13DecodeBase64LERK6TDesC8 @ 115 NONAME
+	_ZN14SenCryptoUtils13EncodeBase64LERK6TDesC8 @ 116 NONAME
+	_ZN14SenCryptoUtils18RandomAndHashMd5LCEv @ 117 NONAME
+	_ZN14SenCryptoUtils26CreateEncodedBinarySecretLERK6TDesC8S2_ @ 118 NONAME
+	_ZN14SenCryptoUtils13GetPSHA1HashLERK6TDesC8S2_i @ 119 NONAME
+	_ZN15CSenSoapMessage14BaseConstructLE12TSOAPVersion @ 120 NONAME
+	_ZN15CSenSoapMessage14BaseConstructLE12TSOAPVersionRK6TDesC8 @ 121 NONAME
+	_ZN15CSenSoapMessage4NewLE12TSOAPVersion @ 122 NONAME
+	_ZN15CSenSoapMessage4NewLE12TSOAPVersionRK6TDesC8 @ 123 NONAME
+	_ZN16CSenSoapEnvelope11SoapVersionEv @ 124 NONAME
+	_ZN16CSenSoapEnvelope14BaseConstructLE12TSOAPVersion @ 125 NONAME
+	_ZN16CSenSoapEnvelope6ParseLERK6TDesC8 @ 126 NONAME
+	_ZN16CSenSoapEnvelope7HasBodyEv @ 127 NONAME
+	_ZN16CSenSoapEnvelope9HasHeaderEv @ 128 NONAME
+	_ZN17CSenXmlProperties4NewLERK11CSenElement @ 129 NONAME
+	_ZN17CSenXmlProperties4NewLERK6TDesC8R13CSenXmlReader @ 130 NONAME
+	_ZN17CSenXmlProperties4NewLEv @ 131 NONAME
+	_ZN17CSenXmlProperties5NewLCERK11CSenElement @ 132 NONAME
+	_ZN17CSenXmlProperties5NewLCERK6TDesC8R13CSenXmlReader @ 133 NONAME
+	_ZN17CSenXmlProperties5NewLCEv @ 134 NONAME
+	_ZN20CSenWsSecurityHeader10TimestampLERK6TDesC8RP6HBufC8 @ 135 NONAME
+	_ZN20CSenWsSecurityHeader10TimestampLERK6TDesC8S2_RP6HBufC8 @ 136 NONAME
+	_ZN20CSenWsSecurityHeader14BaseConstructLERK6TDesC8S2_ @ 137 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLER20CSenIdentityProviderNS_13TPasswordTypeE @ 138 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLERK6TDesC8S2_NS_13TPasswordTypeERP6HBufC8 @ 139 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLERK6TDesC8S2_RP6HBufC8 @ 140 NONAME
+	_ZN20CSenWsSecurityHeader20BinarySecurityTokenLERK6TDesC8RP6HBufC8 @ 141 NONAME
+	_ZN20CSenWsSecurityHeader4NewLERK6TDesC8S2_ @ 142 NONAME
+	_ZN20CSenWsSecurityHeader5NewLCERK6TDesC8 @ 143 NONAME
+	_ZN20CSenWsSecurityHeader5NewLCERK6TDesC8S2_ @ 144 NONAME
+	_ZN20CSenWsSecurityHeader5NewLCEv @ 145 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8P11RStringPool @ 146 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_P11RStringPool @ 147 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_S2_P11RStringPool @ 148 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEEP11RStringPool @ 149 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElementP11RStringPool @ 150 NONAME
+	_ZN22CSenPropertiesFragment4NewLEP11RStringPool @ 151 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK11CSenElementP11RStringPool @ 152 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8P11RStringPool @ 153 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_P11RStringPool @ 154 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_S2_P11RStringPool @ 155 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEEP11RStringPool @ 156 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElementP11RStringPool @ 157 NONAME
+	_ZN23CSenTransportProperties10HeartbeatLERi @ 158 NONAME
+	_ZN23CSenTransportProperties10MessageIdLER6TPtrC8 @ 159 NONAME
+	_ZN23CSenTransportProperties10ProxyHostLER6TPtrC8 @ 160 NONAME
+	_ZN23CSenTransportProperties10ProxyPortLERi @ 161 NONAME
+	_ZN23CSenTransportProperties10UserAgentLER6TPtrC8 @ 162 NONAME
+	_ZN23CSenTransportProperties11ProxyUsageLERi @ 163 NONAME
+	_ZN23CSenTransportProperties11SetOmittedLERK6TDesC8i @ 164 NONAME
+	_ZN23CSenTransportProperties11SoapActionLER6TPtrC8 @ 165 NONAME
+	_ZN23CSenTransportProperties12IntPropertyLERK6TDesC8Ri @ 166 NONAME
+	_ZN23CSenTransportProperties12IsSafeToCastEN14MSenProperties23TSenPropertiesClassTypeE @ 167 NONAME
+	_ZN23CSenTransportProperties12SetDeviceIDLERK6TDesC8 @ 168 NONAME
+	_ZN23CSenTransportProperties12SetPropertyLERK6TDesC8S2_ @ 169 NONAME
+	_ZN23CSenTransportProperties12SetPropertyLERK6TDesC8S2_S2_ @ 170 NONAME
+	_ZN23CSenTransportProperties13ApplyBindingLE12TSOAPVersion @ 171 NONAME
+	_ZN23CSenTransportProperties13BoolPropertyLERK6TDesC8Ri @ 172 NONAME
+	_ZN23CSenTransportProperties13MwsNamespaceLER6TPtrC8 @ 173 NONAME
+	_ZN23CSenTransportProperties13SecureDialogLERi @ 174 NONAME
+	_ZN23CSenTransportProperties13SetHeartbeatLEi @ 175 NONAME
+	_ZN23CSenTransportProperties13SetMessageIdLERK6TDesC8 @ 176 NONAME
+	_ZN23CSenTransportProperties13SetProxyHostLERK6TDesC8 @ 177 NONAME
+	_ZN23CSenTransportProperties13SetProxyPortLEi @ 178 NONAME
+	_ZN23CSenTransportProperties13SetUserAgentLERK6TDesC8 @ 179 NONAME
+	_ZN23CSenTransportProperties14BaseConstructLERK11CSenElement @ 180 NONAME
+	_ZN23CSenTransportProperties14BaseConstructLERK6TDesC8S2_P13CSenXmlReader @ 181 NONAME
+	_ZN23CSenTransportProperties14BaseConstructLERK6TDesC8S2_S2_P13CSenXmlReader @ 182 NONAME
+	_ZN23CSenTransportProperties14MaxTimeToLiveLERi @ 183 NONAME
+	_ZN23CSenTransportProperties14MinTimeToLiveLERi @ 184 NONAME
+	_ZN23CSenTransportProperties14SetProxyUsageLEi @ 185 NONAME
+	_ZN23CSenTransportProperties14SetSoapActionLERK6TDesC8 @ 186 NONAME
+	_ZN23CSenTransportProperties15DownloadFolderLER6TPtrC8 @ 187 NONAME
+	_ZN23CSenTransportProperties15FileAttachmentLERK6TDesC8RP6HBufC8 @ 188 NONAME
+	_ZN23CSenTransportProperties15RemovePropertyLERK6TDesC8 @ 189 NONAME
+	_ZN23CSenTransportProperties15SetIntPropertyLERK6TDesC8i @ 190 NONAME
+	_ZN23CSenTransportProperties16SetBoolPropertyLERK6TDesC8i @ 191 NONAME
+	_ZN23CSenTransportProperties16SetMwsNamespaceLERK6TDesC8 @ 192 NONAME
+	_ZN23CSenTransportProperties16SetSecureDialogLEi @ 193 NONAME
+	_ZN23CSenTransportProperties17SetMaxTimeToLiveLEi @ 194 NONAME
+	_ZN23CSenTransportProperties17SetMinTimeToLiveLEi @ 195 NONAME
+	_ZN23CSenTransportProperties18SetDownloadFolderLERK6TDesC8 @ 196 NONAME
+	_ZN23CSenTransportProperties18SetFileAttachmentLERK6TDesC8S2_ @ 197 NONAME
+	_ZN23CSenTransportProperties19OnewayMessageOnOffLERi @ 198 NONAME
+	_ZN23CSenTransportProperties19PropertiesClassTypeEv @ 199 NONAME
+	_ZN23CSenTransportProperties22SetOnewayMessageOnOffLEi @ 200 NONAME
+	_ZN23CSenTransportProperties4NewLERK11CSenElement @ 201 NONAME
+	_ZN23CSenTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 202 NONAME
+	_ZN23CSenTransportProperties4NewLEv @ 203 NONAME
+	_ZN23CSenTransportProperties5NewLCERK11CSenElement @ 204 NONAME
+	_ZN23CSenTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 205 NONAME
+	_ZN23CSenTransportProperties5NewLCEv @ 206 NONAME
+	_ZN23CSenTransportProperties6IapIdLERm @ 207 NONAME
+	_ZN23CSenTransportProperties7AsUtf8LEv @ 208 NONAME
+	_ZN23CSenTransportProperties8AsUtf8LCEv @ 209 NONAME
+	_ZN23CSenTransportProperties8WriteToLER12RWriteStream @ 210 NONAME
+	_ZN23CSenTransportProperties9DeviceIDLER6TPtrC8 @ 211 NONAME
+	_ZN23CSenTransportProperties9PropertyLERK6TDesC8R6TPtrC8 @ 212 NONAME
+	_ZN23CSenTransportProperties9PropertyLERK6TDesC8R6TPtrC8S4_ @ 213 NONAME
+	_ZN23CSenTransportProperties9ReadFromLERK6TDesC8 @ 214 NONAME
+	_ZN23CSenTransportProperties9SetIapIdLEm @ 215 NONAME
+	_ZN23CSenTransportProperties9SetReaderER13CSenXmlReader @ 216 NONAME
+	_ZN23CSenTransportPropertiesC1Ev @ 217 NONAME
+	_ZN23CSenTransportPropertiesC2Ev @ 218 NONAME
+	_ZN23CSenTransportPropertiesD0Ev @ 219 NONAME
+	_ZN23CSenTransportPropertiesD1Ev @ 220 NONAME
+	_ZN23CSenTransportPropertiesD2Ev @ 221 NONAME
+	_ZN27CSenHttpTransportProperties4NewLERK11CSenElement @ 222 NONAME
+	_ZN27CSenHttpTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 223 NONAME
+	_ZN27CSenHttpTransportProperties4NewLEv @ 224 NONAME
+	_ZN27CSenHttpTransportProperties5NewLCERK11CSenElement @ 225 NONAME
+	_ZN27CSenHttpTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 226 NONAME
+	_ZN27CSenHttpTransportProperties5NewLCEv @ 227 NONAME
+	_ZN27CSenVtcpTransportProperties4NewLERK11CSenElement @ 228 NONAME
+	_ZN27CSenVtcpTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 229 NONAME
+	_ZN27CSenVtcpTransportProperties4NewLEv @ 230 NONAME
+	_ZN27CSenVtcpTransportProperties5NewLCERK11CSenElement @ 231 NONAME
+	_ZN27CSenVtcpTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 232 NONAME
+	_ZN27CSenVtcpTransportProperties5NewLCEv @ 233 NONAME
+	_ZN9CSenChunk10CloseChunkEv @ 234 NONAME
+	_ZN9CSenChunk11AdjustChunkEi @ 235 NONAME
+	_ZN9CSenChunk11ChunkHeaderEv @ 236 NONAME
+	_ZN9CSenChunk11ChunkToArgsER8TIpcArgsi @ 237 NONAME
+	_ZN9CSenChunk11CreateChunkEv @ 238 NONAME
+	_ZN9CSenChunk11DescToChunkERK6TDesC8 @ 239 NONAME
+	_ZN9CSenChunk11DescToChunkERK6TDesC8i @ 240 NONAME
+	_ZN9CSenChunk12DescsToChunkERK6TDesC8S2_ @ 241 NONAME
+	_ZN9CSenChunk13DescFromChunkER6TPtrC8i @ 242 NONAME
+	_ZN9CSenChunk14DescsFromChunkER6TPtrC8S1_ @ 243 NONAME
+	_ZN9CSenChunk16AllocDescToChunkEiRP5TPtr8 @ 244 NONAME
+	_ZN9CSenChunk18OpenChunkFromRMsgLERK9RMessage2i @ 245 NONAME
+	_ZN9CSenChunk26OpenChunkFromHandleNumberLEi @ 246 NONAME
+	_ZN9CSenChunk4NewLERK7TDesC16 @ 247 NONAME
+	_ZN9CSenChunk5ChunkEv @ 248 NONAME
+	_ZN9CSenChunk5NewLCERK7TDesC16 @ 249 NONAME
+	_ZN9CSenChunk9OpenChunkEv @ 250 NONAME
+	_ZN9CSenChunk9SetLoggerEP11RFileLogger @ 251 NONAME
+	_ZN9CSenChunkC1Ev @ 252 NONAME
+	_ZN9CSenChunkC2Ev @ 253 NONAME
+	_ZN9CSenChunkD0Ev @ 254 NONAME
+	_ZN9CSenChunkD1Ev @ 255 NONAME
+	_ZN9CSenChunkD2Ev @ 256 NONAME
+	_ZN9CSenChunkeqERKS_ @ 257 NONAME
+	_ZNK13CSenAttribute12FriendlyNameEv @ 258 NONAME
+	_ZNK13CSenAttribute4NameEv @ 259 NONAME
+	_ZNK13CSenAttribute4TypeEv @ 260 NONAME
+	_ZNK13CSenAttribute5ValueEv @ 261 NONAME
+	_ZNK13CSenAttribute6EqualsERKS_ @ 262 NONAME
+	_ZNK13CSenAttribute9GetValuesEv @ 263 NONAME
+	_ZNK13CSenAttribute9NumValuesEv @ 264 NONAME
+	_ZNK14CSenAttributes12GetAttributeERK6TDesC8 @ 265 NONAME
+	_ZNK14CSenAttributes5CountEv @ 266 NONAME
+	_ZNK14CSenAttributes6EqualsERK13CSenAttribute @ 267 NONAME
+	_ZNK14CSenIdentifier10AttributesEv @ 268 NONAME
+	_ZNK14CSenIdentifier4RootEv @ 269 NONAME
+	_ZNK14CSenIdentifier4TypeEv @ 270 NONAME
+	_ZNK14CSenIdentifier5ProxyEv @ 271 NONAME
+	_ZNK14CSenIdentifier5ValueEv @ 272 NONAME
+	_ZNK14CSenIdentifier7IsProxyEv @ 273 NONAME
+	_ZNK23CSenTransportProperties5CloneERi @ 274 NONAME
+	_ZNK23CSenTransportProperties6CloneLEv @ 275 NONAME
+	_ZNK9CSenChunk3LogEv @ 276 NONAME
+	_ZNK9CSenChunk9ChunkNameEv @ 277 NONAME
+	_ZTI13CSenAttribute @ 278 NONAME ; #<TI>#
+	_ZTI14CSenAttributes @ 279 NONAME ; #<TI>#
+	_ZTI14CSenIdentifier @ 280 NONAME ; #<TI>#
+	_ZTI17CSenXmlProperties @ 281 NONAME ; #<TI>#
+	_ZTI21CSenPropertiesElement @ 282 NONAME ; #<TI>#
+	_ZTI22CSenPropertiesFragment @ 283 NONAME ; #<TI>#
+	_ZTI23CSenTransportProperties @ 284 NONAME ; #<TI>#
+	_ZTI27CSenHttpTransportProperties @ 285 NONAME ; #<TI>#
+	_ZTI27CSenVtcpTransportProperties @ 286 NONAME ; #<TI>#
+	_ZTI9CSenChunk @ 287 NONAME ; #<TI>#
+	_ZTV13CSenAttribute @ 288 NONAME ; #<VT>#
+	_ZTV14CSenAttributes @ 289 NONAME ; #<VT>#
+	_ZTV14CSenIdentifier @ 290 NONAME ; #<VT>#
+	_ZTV17CSenXmlProperties @ 291 NONAME ; #<VT>#
+	_ZTV21CSenPropertiesElement @ 292 NONAME ; #<VT>#
+	_ZTV22CSenPropertiesFragment @ 293 NONAME ; #<VT>#
+	_ZTV23CSenTransportProperties @ 294 NONAME ; #<VT>#
+	_ZTV27CSenHttpTransportProperties @ 295 NONAME ; #<VT>#
+	_ZTV27CSenVtcpTransportProperties @ 296 NONAME ; #<VT>#
+	_ZTV9CSenChunk @ 297 NONAME ; #<VT>#
+	_ZThn4_N16CSenSoapEnvelope6ParseLERK6TDesC8 @ 298 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties12IntPropertyLERK6TDesC8Ri @ 299 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties12IsSafeToCastEN14MSenProperties23TSenPropertiesClassTypeE @ 300 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties12SetPropertyLERK6TDesC8S2_ @ 301 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties13BoolPropertyLERK6TDesC8Ri @ 302 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties15SetIntPropertyLERK6TDesC8i @ 303 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties16SetBoolPropertyLERK6TDesC8i @ 304 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties19PropertiesClassTypeEv @ 305 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties7AsUtf8LEv @ 306 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties8AsUtf8LCEv @ 307 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties8WriteToLER12RWriteStream @ 308 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties9PropertyLERK6TDesC8R6TPtrC8 @ 309 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties9ReadFromLERK6TDesC8 @ 310 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties9SetReaderER13CSenXmlReader @ 311 NONAME ; #<thunk>#
+	_ZThn4_NK23CSenTransportProperties5CloneERi @ 312 NONAME ; #<thunk>#
+	_ZThn4_NK23CSenTransportProperties6CloneLEv @ 313 NONAME ; #<thunk>#
+	_ZN20CSenWsSecurityHeader20BinarySecurityTokenLERK6TDesC8S2_RP6HBufC8 @ 314 NONAME
+	_ZN12SenDateUtils19ToXmlDateTimeUtf82LER5TDes8RK5TTime @ 315 NONAME
+	_ZN16CSenSoapEnvelope11SoapAction2Ev @ 316 NONAME
+	_ZN14SenCryptoUtils13GetTimestampLEv @ 317 NONAME
+	_ZN14SenCryptoUtils15GetRandomNonceLEv @ 318 NONAME
+	_ZN23CSenTransportProperties17EndpointResourceLER6TPtrC8 @ 319 NONAME
+	_ZN23CSenTransportProperties20SetEndpointResourceLERK6TDesC8 @ 320 NONAME
+	_ZN14SenCryptoUtils13GetTimestampLE5TTime @ 321 NONAME
+	_ZN23CSenTransportProperties10SetSnapIdLEm @ 322 NONAME
+	_ZN23CSenTransportProperties7SnapIdLERm @ 323 NONAME
+	_ZN9CSenChunk17RequestFileHandleER5RFile @ 324 NONAME
+	_ZN9CSenChunk17RequestFileHandleEv @ 325 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/eabi/senutils_v2u.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,327 @@
+EXPORTS
+	_ZN11CSenGuidGen15GetRandomGuidLCEv @ 1 NONAME
+	_ZN11CSenGuidGen16GetRandomGuid8LCEv @ 2 NONAME
+	_ZN11CSenGuidGen17GetRandomGuid16LCEv @ 3 NONAME
+	_ZN11CSenGuidGen4NewLEv @ 4 NONAME
+	_ZN11CSenGuidGen5NewLCEv @ 5 NONAME
+	_ZN12SenDateUtils16FromXmlDateTimeLERK6TDesC8 @ 6 NONAME
+	_ZN12SenDateUtils18ToXmlDateTimeUtf8LER5TDes8RK5TTime @ 7 NONAME
+	_ZN13CSenSoapFault10ConstructLER11CSenElement @ 8 NONAME
+	_ZN13CSenSoapFault10ConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 9 NONAME
+	_ZN13CSenSoapFault10FaultActorEv @ 10 NONAME
+	_ZN13CSenSoapFault11FaultStringEv @ 11 NONAME
+	_ZN13CSenSoapFault4NewLER11CSenElement @ 12 NONAME
+	_ZN13CSenSoapFault4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 13 NONAME
+	_ZN13CSenSoapFault6DetailEv @ 14 NONAME
+	_ZN13CSenSoapFault9FaultCodeEv @ 15 NONAME
+	_ZN13CSenSoapFaultC1Ev @ 16 NONAME
+	_ZN13CSenSoapFaultC2Ev @ 17 NONAME
+	_ZN13CSenSoapFaultD0Ev @ 18 NONAME
+	_ZN13CSenSoapFaultD1Ev @ 19 NONAME
+	_ZN13CSenSoapFaultD2Ev @ 20 NONAME
+	_ZN15CSenSoapMessage12ParseHeaderLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 21 NONAME
+	_ZN15CSenSoapMessage14BaseConstructLEv @ 22 NONAME
+	_ZN15CSenSoapMessage17AddSecurityTokenLERK6TDesC8 @ 23 NONAME
+	_ZN15CSenSoapMessage18SetSecurityHeaderLERK6TDesC8 @ 24 NONAME
+	_ZN15CSenSoapMessage19NewSecurityHeaderLCEPK6TDesC8 @ 25 NONAME
+	_ZN15CSenSoapMessage4NewLEv @ 26 NONAME
+	_ZN15CSenSoapMessageC1Ev @ 27 NONAME
+	_ZN15CSenSoapMessageC2Ev @ 28 NONAME
+	_ZN15CSenSoapMessageD0Ev @ 29 NONAME
+	_ZN15CSenSoapMessageD1Ev @ 30 NONAME
+	_ZN15CSenSoapMessageD2Ev @ 31 NONAME
+	_ZN16CSenSoapEnvelope10AddHeaderLER11CSenElement @ 32 NONAME
+	_ZN16CSenSoapEnvelope10SoapActionEv @ 33 NONAME
+	_ZN16CSenSoapEnvelope11EndElementLERK6TDesC8S2_S2_ @ 34 NONAME
+	_ZN16CSenSoapEnvelope13BodyAsStringLEv @ 35 NONAME
+	_ZN16CSenSoapEnvelope12DetachFaultLEv @ 36 NONAME
+	_ZN16CSenSoapEnvelope12ParseHeaderLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 37 NONAME
+	_ZN16CSenSoapEnvelope13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 38 NONAME
+	_ZN16CSenSoapEnvelope14BaseConstructLEv @ 39 NONAME
+	_ZN16CSenSoapEnvelope14SetSoapActionLERK6TDesC8 @ 40 NONAME
+	_ZN16CSenSoapEnvelope4NewLEv @ 41 NONAME
+	_ZN16CSenSoapEnvelope5BodyLEv @ 42 NONAME
+	_ZN16CSenSoapEnvelope6FaultLEv @ 43 NONAME
+	_ZN16CSenSoapEnvelope7HeaderLEv @ 44 NONAME
+	_ZN16CSenSoapEnvelope7IsFaultEv @ 45 NONAME
+	_ZN16CSenSoapEnvelope8SetBodyLERK6TDesC8 @ 46 NONAME
+	_ZN16CSenSoapEnvelopeD0Ev @ 47 NONAME
+	_ZN16CSenSoapEnvelopeD1Ev @ 48 NONAME
+	_ZN16CSenSoapEnvelopeD2Ev @ 49 NONAME
+	_ZN20CSenWsSecurityHeader11XmlNsPrefixEv @ 50 NONAME
+	_ZN20CSenWsSecurityHeader14BaseConstructLERK6TDesC8 @ 51 NONAME
+	_ZN20CSenWsSecurityHeader14BaseConstructLEv @ 52 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLER20CSenIdentityProvider @ 53 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLERK6TDesC8RP6HBufC8 @ 54 NONAME
+	_ZN20CSenWsSecurityHeader4NewLERK6TDesC8 @ 55 NONAME
+	_ZN20CSenWsSecurityHeader4NewLEv @ 56 NONAME
+	_ZN20CSenWsSecurityHeader5XmlNsEv @ 57 NONAME
+	_ZN20CSenWsSecurityHeaderC1Ev @ 58 NONAME
+	_ZN20CSenWsSecurityHeaderC2Ev @ 59 NONAME
+	_ZN20CSenWsSecurityHeaderD0Ev @ 60 NONAME
+	_ZN20CSenWsSecurityHeaderD1Ev @ 61 NONAME
+	_ZN20CSenWsSecurityHeaderD2Ev @ 62 NONAME
+	_ZTI11CSenGuidGen @ 63 NONAME ; #<TI>#
+	_ZTI13CSenSoapFault @ 64 NONAME ; #<TI>#
+	_ZTI15CSenSoapMessage @ 65 NONAME ; #<TI>#
+	_ZTI16CSenSoapEnvelope @ 66 NONAME ; #<TI>#
+	_ZTI20CSenWsSecurityHeader @ 67 NONAME ; #<TI>#
+	_ZTV11CSenGuidGen @ 68 NONAME ; #<VT>#
+	_ZTV13CSenSoapFault @ 69 NONAME ; #<VT>#
+	_ZTV15CSenSoapMessage @ 70 NONAME ; #<VT>#
+	_ZTV16CSenSoapEnvelope @ 71 NONAME ; #<VT>#
+	_ZTV20CSenWsSecurityHeader @ 72 NONAME ; #<VT>#
+	_ZN11SenSaxUtils13SearchEndTagLERK6TDesC8S2_RiS3_R6TPtrC8 @ 73 NONAME
+	_ZN11SenSaxUtils13SearchEndTagLERK6TDesC8S2_S2_RiS3_ @ 74 NONAME
+	_ZN11SenSaxUtils15SearchStartTagLERK6TDesC8S2_RiS3_R6TPtrC8 @ 75 NONAME
+	_ZN11SenSaxUtils15SearchStartTagLERK6TDesC8S2_S2_RiS3_ @ 76 NONAME
+	_ZN12SenCertUtils18CertInfoToStringLCERK9TCertInfo @ 77 NONAME
+	_ZN13CSenAttribute10ConstructLERK6TDesC8S2_S2_S2_ @ 78 NONAME
+	_ZN13CSenAttribute4NewLERK6TDesC8S2_S2_ @ 79 NONAME
+	_ZN13CSenAttribute4NewLERK6TDesC8S2_S2_S2_ @ 80 NONAME
+	_ZN13CSenAttribute9AddValueLERK6TDesC8 @ 81 NONAME
+	_ZN13CSenAttribute9SetValueLERK6TDesC8 @ 82 NONAME
+	_ZN13CSenAttributeC1Ev @ 83 NONAME
+	_ZN13CSenAttributeC2Ev @ 84 NONAME
+	_ZN13CSenAttributeD0Ev @ 85 NONAME
+	_ZN13CSenAttributeD1Ev @ 86 NONAME
+	_ZN13CSenAttributeD2Ev @ 87 NONAME
+	_ZN13CSenSoapFault12FaultSubcodeEv @ 88 NONAME
+	_ZN14CSenAttributes13AddAttributeLERK13CSenAttribute @ 89 NONAME
+	_ZN14CSenAttributes4NewLERKS_ @ 90 NONAME
+	_ZN14CSenAttributes4NewLEv @ 91 NONAME
+	_ZN14CSenAttributes5NewLCERKS_ @ 92 NONAME
+	_ZN14CSenAttributes5NewLCEv @ 93 NONAME
+	_ZN14CSenAttributes8MatchAnyERKS_ @ 94 NONAME
+	_ZN14CSenAttributesD0Ev @ 95 NONAME
+	_ZN14CSenAttributesD1Ev @ 96 NONAME
+	_ZN14CSenAttributesD2Ev @ 97 NONAME
+	_ZN14CSenIdentifier13AddAttributeLER13CSenAttribute @ 98 NONAME
+	_ZN14CSenIdentifier4NewLEN13SenIdentifier15TIdentifierTypeERK6TDesC8 @ 99 NONAME
+	_ZN14CSenIdentifier4NewLEN13SenIdentifier15TIdentifierTypeERK6TDesC8S4_ @ 100 NONAME
+	_ZN14CSenIdentifier4NewLEN13SenIdentifier15TIdentifierTypeERK9TCertInfo @ 101 NONAME
+	_ZN14CSenIdentifier4NewLERKS_ @ 102 NONAME
+	_ZN14CSenIdentifier4NewLEv @ 103 NONAME
+	_ZN14CSenIdentifier5NewLCEN13SenIdentifier15TIdentifierTypeERK6TDesC8 @ 104 NONAME
+	_ZN14CSenIdentifier5NewLCEN13SenIdentifier15TIdentifierTypeERK6TDesC8S4_ @ 105 NONAME
+	_ZN14CSenIdentifier5NewLCEN13SenIdentifier15TIdentifierTypeERK9TCertInfo @ 106 NONAME
+	_ZN14CSenIdentifier5NewLCERKS_ @ 107 NONAME
+	_ZN14CSenIdentifier5NewLCEv @ 108 NONAME
+	_ZN14CSenIdentifier6EqualsERKS_ @ 109 NONAME
+	_ZN14CSenIdentifier8ProxyForEPS_ @ 110 NONAME
+	_ZN14CSenIdentifierD0Ev @ 111 NONAME
+	_ZN14CSenIdentifierD1Ev @ 112 NONAME
+	_ZN14CSenIdentifierD2Ev @ 113 NONAME
+	_ZN14CSenIdentifiereqERKS_ @ 114 NONAME
+	_ZN14SenCryptoUtils13DecodeBase64LERK6TDesC8 @ 115 NONAME
+	_ZN14SenCryptoUtils13EncodeBase64LERK6TDesC8 @ 116 NONAME
+	_ZN14SenCryptoUtils18RandomAndHashMd5LCEv @ 117 NONAME
+	_ZN14SenCryptoUtils26CreateEncodedBinarySecretLERK6TDesC8S2_ @ 118 NONAME
+	_ZN14SenCryptoUtils13GetPSHA1HashLERK6TDesC8S2_i @ 119 NONAME
+	_ZN15CSenSoapMessage14BaseConstructLE12TSOAPVersion @ 120 NONAME
+	_ZN15CSenSoapMessage14BaseConstructLE12TSOAPVersionRK6TDesC8 @ 121 NONAME
+	_ZN15CSenSoapMessage4NewLE12TSOAPVersion @ 122 NONAME
+	_ZN15CSenSoapMessage4NewLE12TSOAPVersionRK6TDesC8 @ 123 NONAME
+	_ZN16CSenSoapEnvelope11SoapVersionEv @ 124 NONAME
+	_ZN16CSenSoapEnvelope14BaseConstructLE12TSOAPVersion @ 125 NONAME
+	_ZN16CSenSoapEnvelope6ParseLERK6TDesC8 @ 126 NONAME
+	_ZN16CSenSoapEnvelope7HasBodyEv @ 127 NONAME
+	_ZN16CSenSoapEnvelope9HasHeaderEv @ 128 NONAME
+	_ZN17CSenXmlProperties4NewLERK11CSenElement @ 129 NONAME
+	_ZN17CSenXmlProperties4NewLERK6TDesC8R13CSenXmlReader @ 130 NONAME
+	_ZN17CSenXmlProperties4NewLEv @ 131 NONAME
+	_ZN17CSenXmlProperties5NewLCERK11CSenElement @ 132 NONAME
+	_ZN17CSenXmlProperties5NewLCERK6TDesC8R13CSenXmlReader @ 133 NONAME
+	_ZN17CSenXmlProperties5NewLCEv @ 134 NONAME
+	_ZN20CSenWsSecurityHeader10TimestampLERK6TDesC8RP6HBufC8 @ 135 NONAME
+	_ZN20CSenWsSecurityHeader10TimestampLERK6TDesC8S2_RP6HBufC8 @ 136 NONAME
+	_ZN20CSenWsSecurityHeader14BaseConstructLERK6TDesC8S2_ @ 137 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLER20CSenIdentityProviderNS_13TPasswordTypeE @ 138 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLERK6TDesC8S2_NS_13TPasswordTypeERP6HBufC8 @ 139 NONAME
+	_ZN20CSenWsSecurityHeader14UsernameTokenLERK6TDesC8S2_RP6HBufC8 @ 140 NONAME
+	_ZN20CSenWsSecurityHeader20BinarySecurityTokenLERK6TDesC8RP6HBufC8 @ 141 NONAME
+	_ZN20CSenWsSecurityHeader4NewLERK6TDesC8S2_ @ 142 NONAME
+	_ZN20CSenWsSecurityHeader5NewLCERK6TDesC8 @ 143 NONAME
+	_ZN20CSenWsSecurityHeader5NewLCERK6TDesC8S2_ @ 144 NONAME
+	_ZN20CSenWsSecurityHeader5NewLCEv @ 145 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8P11RStringPool @ 146 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_P11RStringPool @ 147 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_S2_P11RStringPool @ 148 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEEP11RStringPool @ 149 NONAME
+	_ZN21CSenPropertiesElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElementP11RStringPool @ 150 NONAME
+	_ZN22CSenPropertiesFragment4NewLEP11RStringPool @ 151 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK11CSenElementP11RStringPool @ 152 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8P11RStringPool @ 153 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_P11RStringPool @ 154 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_S2_P11RStringPool @ 155 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEEP11RStringPool @ 156 NONAME
+	_ZN22CSenPropertiesFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElementP11RStringPool @ 157 NONAME
+	_ZN23CSenTransportProperties10HeartbeatLERi @ 158 NONAME
+	_ZN23CSenTransportProperties10MessageIdLER6TPtrC8 @ 159 NONAME
+	_ZN23CSenTransportProperties10ProxyHostLER6TPtrC8 @ 160 NONAME
+	_ZN23CSenTransportProperties10ProxyPortLERi @ 161 NONAME
+	_ZN23CSenTransportProperties10UserAgentLER6TPtrC8 @ 162 NONAME
+	_ZN23CSenTransportProperties11ProxyUsageLERi @ 163 NONAME
+	_ZN23CSenTransportProperties11SetOmittedLERK6TDesC8i @ 164 NONAME
+	_ZN23CSenTransportProperties11SoapActionLER6TPtrC8 @ 165 NONAME
+	_ZN23CSenTransportProperties12IntPropertyLERK6TDesC8Ri @ 166 NONAME
+	_ZN23CSenTransportProperties12IsSafeToCastEN14MSenProperties23TSenPropertiesClassTypeE @ 167 NONAME
+	_ZN23CSenTransportProperties12SetDeviceIDLERK6TDesC8 @ 168 NONAME
+	_ZN23CSenTransportProperties12SetPropertyLERK6TDesC8S2_ @ 169 NONAME
+	_ZN23CSenTransportProperties12SetPropertyLERK6TDesC8S2_S2_ @ 170 NONAME
+	_ZN23CSenTransportProperties13ApplyBindingLE12TSOAPVersion @ 171 NONAME
+	_ZN23CSenTransportProperties13BoolPropertyLERK6TDesC8Ri @ 172 NONAME
+	_ZN23CSenTransportProperties13MwsNamespaceLER6TPtrC8 @ 173 NONAME
+	_ZN23CSenTransportProperties13SecureDialogLERi @ 174 NONAME
+	_ZN23CSenTransportProperties13SetHeartbeatLEi @ 175 NONAME
+	_ZN23CSenTransportProperties13SetMessageIdLERK6TDesC8 @ 176 NONAME
+	_ZN23CSenTransportProperties13SetProxyHostLERK6TDesC8 @ 177 NONAME
+	_ZN23CSenTransportProperties13SetProxyPortLEi @ 178 NONAME
+	_ZN23CSenTransportProperties13SetUserAgentLERK6TDesC8 @ 179 NONAME
+	_ZN23CSenTransportProperties14BaseConstructLERK11CSenElement @ 180 NONAME
+	_ZN23CSenTransportProperties14BaseConstructLERK6TDesC8S2_P13CSenXmlReader @ 181 NONAME
+	_ZN23CSenTransportProperties14BaseConstructLERK6TDesC8S2_S2_P13CSenXmlReader @ 182 NONAME
+	_ZN23CSenTransportProperties14MaxTimeToLiveLERi @ 183 NONAME
+	_ZN23CSenTransportProperties14MinTimeToLiveLERi @ 184 NONAME
+	_ZN23CSenTransportProperties14SetProxyUsageLEi @ 185 NONAME
+	_ZN23CSenTransportProperties14SetSoapActionLERK6TDesC8 @ 186 NONAME
+	_ZN23CSenTransportProperties15DownloadFolderLER6TPtrC8 @ 187 NONAME
+	_ZN23CSenTransportProperties15FileAttachmentLERK6TDesC8RP6HBufC8 @ 188 NONAME
+	_ZN23CSenTransportProperties15RemovePropertyLERK6TDesC8 @ 189 NONAME
+	_ZN23CSenTransportProperties15SetIntPropertyLERK6TDesC8i @ 190 NONAME
+	_ZN23CSenTransportProperties16SetBoolPropertyLERK6TDesC8i @ 191 NONAME
+	_ZN23CSenTransportProperties16SetMwsNamespaceLERK6TDesC8 @ 192 NONAME
+	_ZN23CSenTransportProperties16SetSecureDialogLEi @ 193 NONAME
+	_ZN23CSenTransportProperties17SetMaxTimeToLiveLEi @ 194 NONAME
+	_ZN23CSenTransportProperties17SetMinTimeToLiveLEi @ 195 NONAME
+	_ZN23CSenTransportProperties18SetDownloadFolderLERK6TDesC8 @ 196 NONAME
+	_ZN23CSenTransportProperties18SetFileAttachmentLERK6TDesC8S2_ @ 197 NONAME
+	_ZN23CSenTransportProperties19OnewayMessageOnOffLERi @ 198 NONAME
+	_ZN23CSenTransportProperties19PropertiesClassTypeEv @ 199 NONAME
+	_ZN23CSenTransportProperties22SetOnewayMessageOnOffLEi @ 200 NONAME
+	_ZN23CSenTransportProperties4NewLERK11CSenElement @ 201 NONAME
+	_ZN23CSenTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 202 NONAME
+	_ZN23CSenTransportProperties4NewLEv @ 203 NONAME
+	_ZN23CSenTransportProperties5NewLCERK11CSenElement @ 204 NONAME
+	_ZN23CSenTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 205 NONAME
+	_ZN23CSenTransportProperties5NewLCEv @ 206 NONAME
+	_ZN23CSenTransportProperties6IapIdLERm @ 207 NONAME
+	_ZN23CSenTransportProperties7AsUtf8LEv @ 208 NONAME
+	_ZN23CSenTransportProperties8AsUtf8LCEv @ 209 NONAME
+	_ZN23CSenTransportProperties8WriteToLER12RWriteStream @ 210 NONAME
+	_ZN23CSenTransportProperties9DeviceIDLER6TPtrC8 @ 211 NONAME
+	_ZN23CSenTransportProperties9PropertyLERK6TDesC8R6TPtrC8 @ 212 NONAME
+	_ZN23CSenTransportProperties9PropertyLERK6TDesC8R6TPtrC8S4_ @ 213 NONAME
+	_ZN23CSenTransportProperties9ReadFromLERK6TDesC8 @ 214 NONAME
+	_ZN23CSenTransportProperties9SetIapIdLEm @ 215 NONAME
+	_ZN23CSenTransportProperties9SetReaderER13CSenXmlReader @ 216 NONAME
+	_ZN23CSenTransportPropertiesC1Ev @ 217 NONAME
+	_ZN23CSenTransportPropertiesC2Ev @ 218 NONAME
+	_ZN23CSenTransportPropertiesD0Ev @ 219 NONAME
+	_ZN23CSenTransportPropertiesD1Ev @ 220 NONAME
+	_ZN23CSenTransportPropertiesD2Ev @ 221 NONAME
+	_ZN27CSenHttpTransportProperties4NewLERK11CSenElement @ 222 NONAME
+	_ZN27CSenHttpTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 223 NONAME
+	_ZN27CSenHttpTransportProperties4NewLEv @ 224 NONAME
+	_ZN27CSenHttpTransportProperties5NewLCERK11CSenElement @ 225 NONAME
+	_ZN27CSenHttpTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 226 NONAME
+	_ZN27CSenHttpTransportProperties5NewLCEv @ 227 NONAME
+	_ZN27CSenVtcpTransportProperties4NewLERK11CSenElement @ 228 NONAME
+	_ZN27CSenVtcpTransportProperties4NewLERK6TDesC8R13CSenXmlReader @ 229 NONAME
+	_ZN27CSenVtcpTransportProperties4NewLEv @ 230 NONAME
+	_ZN27CSenVtcpTransportProperties5NewLCERK11CSenElement @ 231 NONAME
+	_ZN27CSenVtcpTransportProperties5NewLCERK6TDesC8R13CSenXmlReader @ 232 NONAME
+	_ZN27CSenVtcpTransportProperties5NewLCEv @ 233 NONAME
+	_ZN9CSenChunk10CloseChunkEv @ 234 NONAME
+	_ZN9CSenChunk11AdjustChunkEi @ 235 NONAME
+	_ZN9CSenChunk11ChunkHeaderEv @ 236 NONAME
+	_ZN9CSenChunk11ChunkToArgsER8TIpcArgsi @ 237 NONAME
+	_ZN9CSenChunk11CreateChunkEv @ 238 NONAME
+	_ZN9CSenChunk11DescToChunkERK6TDesC8 @ 239 NONAME
+	_ZN9CSenChunk11DescToChunkERK6TDesC8i @ 240 NONAME
+	_ZN9CSenChunk12DescsToChunkERK6TDesC8S2_ @ 241 NONAME
+	_ZN9CSenChunk13DescFromChunkER6TPtrC8i @ 242 NONAME
+	_ZN9CSenChunk14DescsFromChunkER6TPtrC8S1_ @ 243 NONAME
+	_ZN9CSenChunk16AllocDescToChunkEiRP5TPtr8 @ 244 NONAME
+	_ZN9CSenChunk18OpenChunkFromRMsgLERK9RMessage2i @ 245 NONAME
+	_ZN9CSenChunk26OpenChunkFromHandleNumberLEi @ 246 NONAME
+	_ZN9CSenChunk4NewLERK7TDesC16 @ 247 NONAME
+	_ZN9CSenChunk5ChunkEv @ 248 NONAME
+	_ZN9CSenChunk5NewLCERK7TDesC16 @ 249 NONAME
+	_ZN9CSenChunk9OpenChunkEv @ 250 NONAME
+	_ZN9CSenChunk9SetLoggerEP11RFileLogger @ 251 NONAME
+	_ZN9CSenChunkC1Ev @ 252 NONAME
+	_ZN9CSenChunkC2Ev @ 253 NONAME
+	_ZN9CSenChunkD0Ev @ 254 NONAME
+	_ZN9CSenChunkD1Ev @ 255 NONAME
+	_ZN9CSenChunkD2Ev @ 256 NONAME
+	_ZN9CSenChunkeqERKS_ @ 257 NONAME
+	_ZNK13CSenAttribute12FriendlyNameEv @ 258 NONAME
+	_ZNK13CSenAttribute4NameEv @ 259 NONAME
+	_ZNK13CSenAttribute4TypeEv @ 260 NONAME
+	_ZNK13CSenAttribute5ValueEv @ 261 NONAME
+	_ZNK13CSenAttribute6EqualsERKS_ @ 262 NONAME
+	_ZNK13CSenAttribute9GetValuesEv @ 263 NONAME
+	_ZNK13CSenAttribute9NumValuesEv @ 264 NONAME
+	_ZNK14CSenAttributes12GetAttributeERK6TDesC8 @ 265 NONAME
+	_ZNK14CSenAttributes5CountEv @ 266 NONAME
+	_ZNK14CSenAttributes6EqualsERK13CSenAttribute @ 267 NONAME
+	_ZNK14CSenIdentifier10AttributesEv @ 268 NONAME
+	_ZNK14CSenIdentifier4RootEv @ 269 NONAME
+	_ZNK14CSenIdentifier4TypeEv @ 270 NONAME
+	_ZNK14CSenIdentifier5ProxyEv @ 271 NONAME
+	_ZNK14CSenIdentifier5ValueEv @ 272 NONAME
+	_ZNK14CSenIdentifier7IsProxyEv @ 273 NONAME
+	_ZNK23CSenTransportProperties5CloneERi @ 274 NONAME
+	_ZNK23CSenTransportProperties6CloneLEv @ 275 NONAME
+	_ZNK9CSenChunk3LogEv @ 276 NONAME
+	_ZNK9CSenChunk9ChunkNameEv @ 277 NONAME
+	_ZTI13CSenAttribute @ 278 NONAME ; #<TI>#
+	_ZTI14CSenAttributes @ 279 NONAME ; #<TI>#
+	_ZTI14CSenIdentifier @ 280 NONAME ; #<TI>#
+	_ZTI17CSenXmlProperties @ 281 NONAME ; #<TI>#
+	_ZTI21CSenPropertiesElement @ 282 NONAME ; #<TI>#
+	_ZTI22CSenPropertiesFragment @ 283 NONAME ; #<TI>#
+	_ZTI23CSenTransportProperties @ 284 NONAME ; #<TI>#
+	_ZTI27CSenHttpTransportProperties @ 285 NONAME ; #<TI>#
+	_ZTI27CSenVtcpTransportProperties @ 286 NONAME ; #<TI>#
+	_ZTI9CSenChunk @ 287 NONAME ; #<TI>#
+	_ZTV13CSenAttribute @ 288 NONAME ; #<VT>#
+	_ZTV14CSenAttributes @ 289 NONAME ; #<VT>#
+	_ZTV14CSenIdentifier @ 290 NONAME ; #<VT>#
+	_ZTV17CSenXmlProperties @ 291 NONAME ; #<VT>#
+	_ZTV21CSenPropertiesElement @ 292 NONAME ; #<VT>#
+	_ZTV22CSenPropertiesFragment @ 293 NONAME ; #<VT>#
+	_ZTV23CSenTransportProperties @ 294 NONAME ; #<VT>#
+	_ZTV27CSenHttpTransportProperties @ 295 NONAME ; #<VT>#
+	_ZTV27CSenVtcpTransportProperties @ 296 NONAME ; #<VT>#
+	_ZTV9CSenChunk @ 297 NONAME ; #<VT>#
+	_ZThn4_N16CSenSoapEnvelope6ParseLERK6TDesC8 @ 298 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties12IntPropertyLERK6TDesC8Ri @ 299 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties12IsSafeToCastEN14MSenProperties23TSenPropertiesClassTypeE @ 300 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties12SetPropertyLERK6TDesC8S2_ @ 301 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties13BoolPropertyLERK6TDesC8Ri @ 302 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties15SetIntPropertyLERK6TDesC8i @ 303 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties16SetBoolPropertyLERK6TDesC8i @ 304 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties19PropertiesClassTypeEv @ 305 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties7AsUtf8LEv @ 306 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties8AsUtf8LCEv @ 307 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties8WriteToLER12RWriteStream @ 308 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties9PropertyLERK6TDesC8R6TPtrC8 @ 309 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties9ReadFromLERK6TDesC8 @ 310 NONAME ; #<thunk>#
+	_ZThn4_N23CSenTransportProperties9SetReaderER13CSenXmlReader @ 311 NONAME ; #<thunk>#
+	_ZThn4_NK23CSenTransportProperties5CloneERi @ 312 NONAME ; #<thunk>#
+	_ZThn4_NK23CSenTransportProperties6CloneLEv @ 313 NONAME ; #<thunk>#
+	_ZN20CSenWsSecurityHeader20BinarySecurityTokenLERK6TDesC8S2_RP6HBufC8 @ 314 NONAME
+	_ZN23CSenTransportProperties10SetSnapIdLEm @ 315 NONAME
+	_ZN23CSenTransportProperties7SnapIdLERm @ 316 NONAME
+	_ZN14SenCryptoUtils13GetTimestampLEv @ 317 NONAME
+	_ZN14SenCryptoUtils15GetRandomNonceLEv @ 318 NONAME
+	_ZN23CSenTransportProperties17EndpointResourceLER6TPtrC8 @ 319 NONAME
+	_ZN23CSenTransportProperties20SetEndpointResourceLERK6TDesC8 @ 320 NONAME
+	_ZN14SenCryptoUtils13GetTimestampLE5TTime @ 321 NONAME
+	_ZN12SenDateUtils19ToXmlDateTimeUtf82LER5TDes8RK5TTime @ 322 NONAME
+	_ZN16CSenSoapEnvelope11SoapAction2Ev @ 323 NONAME
+	_ZN9CSenChunk17RequestFileHandleER5RFile @ 324 NONAME
+	_ZN9CSenChunk17RequestFileHandleEv @ 325 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsutils   
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsutils.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsutils.iby)
+PRJ_MMPFILES
+senutils.mmp
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/group/senutils.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       Project specification file for wsutils    
+*
+*/
+
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenUtils.DLL
+UID             0x1000008d 0x101F9703
+#else
+TARGET          wsutils.DLL
+UID             0x1000008d 0x101F973A
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+SOURCE          senutilsdll.cpp
+SOURCE          senguidgen.cpp
+SOURCE          sendateutils.cpp
+SOURCE          sensoapenvelope.cpp
+SOURCE          sensoapmessage.cpp
+SOURCE          sensoapfault.cpp
+SOURCE          senwssecurityheader.cpp
+SOURCE          senpropertieselement.cpp
+SOURCE          senpropertiesfragment.cpp
+SOURCE          senxmlproperties.cpp
+SOURCE          sentransportproperties.cpp
+SOURCE          senhttptransportproperties.cpp
+SOURCE          senvtcptransportproperties.cpp
+SOURCE          sensaxutils.cpp
+
+
+// new private classes for 4.0:
+SOURCE          senattribute.cpp
+SOURCE          senattributes.cpp
+SOURCE          senidentifier.cpp
+SOURCE          sencertutils.cpp
+SOURCE          senchunk.cpp
+SOURCE          sencryptoutils.cpp
+
+
+SYSTEMINCLUDE   ../../inc
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wslogger/inc // for TLS based logging
+USERINCLUDE   ../../wsdescription/inc      // removes <SenXmlServiceDescription.h> warning..
+USERINCLUDE   ../../wsxml/inc								//senxmldebug.h
+
+//SYSTEMINCLUDE   ../../wsServiceDescription/inc      // removes <SenXmlServiceDescription.h> warning..
+
+MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         hash.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib // TVolumeInfo => hostid for CMD5 based UUID (URN) generation
+LIBRARY         flogger.lib
+LIBRARY         bafl.lib    // RStringbase
+LIBRARY imut.lib // for base64 encoding
+// WSF libraries
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenLogger.lib // for TLS based logging
+LIBRARY         SenXml.lib
+#else
+LIBRARY         wslogger.lib // for TLS based logging
+LIBRARY         wsxml.lib
+#endif
+
+
+LANG            SC
+
+#if defined(ARMCC)
+	#if defined (RD_SEN_COMPILE_SIS_PACKAGE_FILES)
+		DEFFILE ../EABI/SENUTILS_V2.DEF
+	#else
+  	DEFFILE ../eabi/SENUTILS.DEF
+	#endif//RD_SEN_COMPILE_SIS_PACKAGE_FILES  	
+#elif defined(WINSCW)
+	#if defined (RD_SEN_COMPILE_SIS_PACKAGE_FILES)
+		DEFFILE ../BWINSCW/SENUTILS_V2.DEF
+	#else
+  DEFFILE ../BWINSCW/SENUTILS.DEF
+  #endif//RD_SEN_COMPILE_SIS_PACKAGE_FILES
+#elif defined(WINS)
+  DEFFILE ../BWINS/SENUTILS.DEF
+#else 
+  DEFFILE ../BMARM/SENUTILS.DEF
+#endif
+
+SMPSAFE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senattribute.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+ *
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_ATTRIBUTE_H
+#define SEN_ATTRIBUTE_H
+
+#include <e32base.h>
+
+typedef RPointerArray<HBufC8> RAttrValueArray;
+
+
+// CLASS DECLARATION
+
+/**
+ *  ?one_line_short_description.
+ *  ?other_description_lines
+ *
+ *  @lib SenUtils.lib
+ *  @since Series60 3.0
+ */
+class CSenAttribute : public CBase
+    {
+public:  // Constructors and destructor
+
+    /**
+     * Basic constructor.
+     * @since Series60 3.0
+     * @param aName the name of the attribute
+     * @param aType the type of the attribute
+     * @param aValue the value of the attribute
+     */
+    IMPORT_C static CSenAttribute* NewL(const TDesC8& aName,
+                                        const TDesC8& aType,
+                                        const TDesC8& aValue);
+    /**
+     * Basic constructor.
+     * @since Series60 3.0
+     * @param aName the name of the attribute
+     * @param aType the type of the attribute
+     * @param aValue the value of the attribute
+     * @param aFriendlyName if the name is not descriptive, the friendly name
+     * can be used to give morehuman-readble information
+     */
+    IMPORT_C static CSenAttribute* NewL(const TDesC8& aName,
+                                        const TDesC8& aType,
+                                        const TDesC8& aValue,
+                                        const TDesC8& aFriendlyName);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CSenAttribute();
+
+public: // New functions
+    /**
+     * Returns the attribute value as string.
+     * If attribute is multi-valued, the first value added will be returned.
+     * @since Series60 3.0
+     * @return ?description
+     */
+    IMPORT_C TPtrC8 Value() const;
+
+    /**
+     * Returns the attribute name as string
+     * @since Series60 3.0
+     * @return ?description
+     */
+    IMPORT_C TPtrC8 Name() const;
+
+    /**
+     * Returns the actor string
+     * @since Series60 3.0
+     * @return ?description
+     */
+    IMPORT_C TPtrC8 Type() const;
+
+    /**
+     * Returns the friendly name
+     * @since Series60 3.0
+     * @return the firendly name for the attribute
+     */
+    IMPORT_C TPtrC8 FriendlyName() const;
+
+    /**
+     * Sets the value of the attribute, separately from instantiation.
+     * Replaces existing value(s), if present.
+     * @since Series60 3.0
+     * @return void
+     */
+    IMPORT_C void SetValueL(const TDesC8& aValue);	//codescannerwarnings
+
+    /**
+     * Adds the value to the attribute, separately from instantiation.
+     * If value(s) are already present in attribute, value is appended
+     * to create multi-valued attribute.
+     * @since Series60 4.0
+     * @return void
+     */
+    IMPORT_C void AddValueL(const TDesC8& aValue);	//codescannerwarnings
+
+    /**
+     * Returns the values of the (multi-valued) attribute.
+     * @since Series60 4.0
+     * @return RAttrValueArray
+     */
+    IMPORT_C const RAttrValueArray GetValues() const;
+
+    /**
+     * Returns the number of values in the attribute.
+     * @since Series60 4.0
+     * @return TInt
+     */
+    IMPORT_C TInt NumValues() const;
+
+
+    /**
+     * Returns true if attributes are equal
+     * (string equality of values, type and friendly name equality)
+     * @since Series60 4.0
+     * @return TBool
+     */
+    IMPORT_C TBool Equals(const CSenAttribute& aAttr) const;
+
+public: // Functions from base classes
+
+    protected:  // New functions
+    /***
+     * Constructor
+     */
+    IMPORT_C CSenAttribute();
+
+    /**
+     * Basic ConstructL function
+     * @since Series60 3.0
+     */
+
+    IMPORT_C void ConstructL(const TDesC8& aName,
+                             const TDesC8& aType,
+                             const TDesC8& aValue,
+                             const TDesC8& aFriendlyName);
+private:    // Data
+
+    HBufC8* ipName ;
+    HBufC8* ipType ;
+    HBufC8* ipFriendlyName ;
+
+    RAttrValueArray iValues;
+
+    // Reserved pointer for future extension
+    TAny* ipReserved;
+    };
+
+
+#endif // SEN_ATTRIBUTE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senattributes.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+ *
+*/
+
+
+
+
+
+
+
+
+#ifndef C_SEN_ATTRIBUTES_H
+#define C_SEN_ATTRIBUTES_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <flogger.h>
+
+#include "senattribute.h"
+
+#include "senpointermap.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DEFINITIONS
+
+class CSenAttribute;
+
+/**
+ * @author lewontin
+ * A list of CSenAttribute objects.
+ * Each supports multiple values (for example, multiple groups). 
+ */
+class CSenAttributes : public CBase
+    {
+
+    public: 
+    
+        // Constructors and Destructors
+
+        IMPORT_C static CSenAttributes* NewL();
+
+        IMPORT_C static CSenAttributes* NewLC();
+
+
+        IMPORT_C static CSenAttributes* NewL(const CSenAttributes& aAttributes);
+
+        IMPORT_C static CSenAttributes* NewLC(const CSenAttributes& aAttributes);
+
+
+        IMPORT_C virtual ~CSenAttributes();
+
+        // New methods:
+
+        IMPORT_C void AddAttributeL(const CSenAttribute& aValue);	//codescannerwarnings
+
+
+        IMPORT_C const CSenAttribute& GetAttribute(const TDesC8& aName) const;
+
+
+        // Number of attributes
+        IMPORT_C TInt Count() const;
+
+
+        // Attribute equality condition test
+        IMPORT_C TBool Equals(const CSenAttribute& aAttr) const;
+
+
+        // Match any attribute
+        IMPORT_C TBool MatchAny(const CSenAttributes& aAttrs);
+
+
+    protected:
+        void BaseConstructL();
+        void BaseConstructL(const CSenAttributes& aAttributes);
+
+        
+
+    private:
+
+        CSenAttributes();
+
+        // Returns attribute at index position
+        const CSenAttribute& AttributeAt(TInt aIndex) const;
+
+
+        /**
+         * File logger.
+         *
+         */
+        //RFileLogger* Log() const;
+
+
+    private: // Data
+
+        RSenPointerMap<TDesC8, CSenAttribute> iAttrList;
+
+        //RFileLogger iLog;
+
+    };
+
+#endif // C_SEN_ATTRIBUTES_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/sencertutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+/*
+ * =========================================================================
+ *  Name     : SenCertUtils.h
+ */
+
+#ifndef C_SEN_CERT_UTILS_H
+#define C_SEN_CERT_UTILS_H
+
+// INCLUDES
+
+#include <e32base.h>
+
+
+// CONSTANTS
+_LIT8(KSenCASNDelimiter, "-"); // Delimiter for TCertInfo fields in string representation
+
+
+// FORWARD DECLARATIONS
+class TCertInfo; // from ssl.h
+
+// CLASS DEFINITIONS
+
+/**
+ * Set of static convenience methods to process X.509 certificates
+ *
+ * <p>
+ * (c) Copyright Nokia 2004, 2005
+ * <p>
+ * @author Norbert Leser
+ */
+class SenCertUtils
+    {
+
+    public:
+        /**
+         * CertInfoToStringLC
+         * Converts TCertInfo type to string representation (TDesC8),
+         * where fields are delimited by KSenCASNDelimiter
+         *
+         * @since Series60 4.0
+         *
+         * @param aCertInfo The certificate info object that provides a unique
+         * identification of a certificate.
+         *
+         * @return newly allocated string representation of cert info, which is
+         *         left on cleanupstack.
+         */
+        IMPORT_C static HBufC8* CertInfoToStringLC(const TCertInfo& aCertInfo);
+
+
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        SenCertUtils() { }
+
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        SenCertUtils( const SenCertUtils& );
+
+        /**
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        SenCertUtils& operator=( const SenCertUtils& );
+    };
+
+#endif // C_SEN_CERT_UTILS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senchunk.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,490 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_CHUNK_H
+#define SEN_CHUNK_H
+
+// INCLUDES
+#include <e32base.h>
+#include <flogger.h>
+#include <f32file.h>
+
+#include <MSenMessage.h>
+#include <MSenProperties.h>
+
+// Min size for new RChunk allocations:
+const TInt KSenMinRChunkSize = 0x2750;   // 10064 bytes
+// Max size for new RChunk allocations:
+const TInt KSenMaxRChunkSize = 0x400000; // 4194304 bytes 
+
+
+// FORWARD DECLARE
+class CSenChunk;
+
+// CLASS DECLARATION
+class TChunkHeader
+  /**
+  * This class is set in the beginning of the RChunk. Class is used
+  * to store header information.
+  *
+  * Note: All data in here must be 4-byte aligned (using dummy values
+  * if needed)
+  */
+  {
+  public:
+    /**
+    * Getter for message class enumeration
+    * @return message type enumeration
+    * @see MSenMessage.h
+    */
+    inline MSenMessage::TClass MessageType() const
+        {
+        return (MSenMessage::TClass)iMessageType;
+        }
+
+    /**
+    * Setter for message class enumeration
+    * @param aValue defines the message class type enumeration.
+    * @see MSenMessage.h
+    */
+    inline void SetMessageType(MSenMessage::TClass aType)
+        {
+        iMessageType = (TInt)aType;
+        }
+
+    /**
+    * Getter for message direction enumeration
+    * @return message type enumeration
+    * @see MSenMessage.h
+    */
+    inline MSenMessage::TDirection MessageDirection() const
+        {
+        return (MSenMessage::TDirection)iMessageDirection;
+        }
+
+    /**
+    * Setter for message direction enumeration
+    * @param aValue defines the message class type enumeration.
+    * @see MSenMessage.h
+    */
+    inline void SetMessageDirection(MSenMessage::TDirection aDirection)
+        {
+        iMessageDirection = (TInt)aDirection;
+        }
+
+    /**
+    * Getter to determine should init be done before sending the message.
+    * @return ETrue if yes, otherwise EFalse.
+    */
+    inline TBool DoInitBeforeSending() const
+        {
+        if ( iDoInitBeforeSending )
+            {
+            return ETrue;
+            }
+        else
+            {
+            return EFalse;
+            }            
+        }
+
+    /**
+    * Sets the flag indicating that init should be done
+    * before sending the message
+    * @param aValue if ETrue, init will be done before sending
+     *              if EFalse, init will not be done before sending
+    */
+    inline void SetDoInitBeforeSending(TBool aValue)
+        {
+        if ( aValue )
+            {
+            iDoInitBeforeSending = 1;
+            }
+        else
+            {
+            iDoInitBeforeSending = 0;
+            }
+//        iDoInitBeforeSending = aValue;
+        }
+        
+    /**
+    * Getter for (transport) properties type.
+    * @return transport properties type
+    * enumeration. Note:
+    *   ENotInUse means that transport
+    *   properties are not in use.
+    * @see MSenProperties
+    */
+    inline MSenProperties::TSenPropertiesClassType PropertiesType() const
+        {
+        return (MSenProperties::TSenPropertiesClassType)iPropertiesType;
+        }
+
+    /**
+    * Sets the (transport) properties type enumeration
+    * @param aType where ENotInUse indicates that
+    * there are no associated properties, and all
+    * the others point to a concrete properties 
+    * class.
+    * @see MSenProperties
+    */
+    inline void SetPropertiesType(MSenProperties::TSenPropertiesClassType aType)
+        {
+        iPropertiesType = (TInt)aType;
+        }
+
+    /**
+    * Getter for descriptor count.
+    * @return the descriptor count
+    */
+    inline TInt DescriptorCount() const
+        {
+        return iDescriptorCount;
+        }
+
+    /**
+    * Setter for descriptor count.
+    * @param aCount is the descriptor count
+    */
+    inline void SetDescriptorCount(TInt aCount)
+        {
+        iDescriptorCount = aCount;
+        }
+
+    /**
+    * Getter for transaction id.
+    * @return the transaction id
+    */
+    inline TInt TransactionId() const
+        {
+        return iTransactionId;
+        }
+
+    /**
+    * Setter for transaction id.
+    * @param aID is the transaction id
+    */
+    inline void SetTransactionId(TInt aId)
+        {
+        iTransactionId = aId;
+        }
+
+    /**
+    * Getter for ctx id.
+    * @return the ctx id
+    */
+    inline TInt ContextId() const
+        {
+        return iContextId;
+        }
+
+    /**
+    * Setter for ctx id.
+    * @param aID is the ctx id
+    */
+    inline void SetContextId(TInt aId)
+        {
+        iContextId = aId;
+        }
+
+    /**
+    * Getter for pending transaction id.
+    * @return the pending transaction id
+    */
+    inline TInt PendingTransactionId() const
+        {
+        return iPendingTransactionId;
+        }
+
+    /**
+    * Setter for pending transaction id.
+    * @param aCount is the pending transaction id
+    */
+    inline void SetPendingTransactionId(TInt aId)
+        {
+        iPendingTransactionId = aId;
+        }
+
+  private:
+        /*MSenMessage::TClass*/                     TInt iMessageType;
+        /*MSenMessage::TDirection*/                 TInt iMessageDirection;
+        /*TBool*/                                   TInt iDoInitBeforeSending;
+        /*MSenProperties::TSenPropertiesClassType*/ TInt iPropertiesType; 
+        TInt                                             iDescriptorCount;
+        TInt                                             iTransactionId;
+        TInt                                             iPendingTransactionId;
+        TInt                                             iContextId;
+  };
+
+/**
+* Offset to the beginning of header
+*/
+const TInt KHeaderOffset    = 0;
+
+/**
+* Offset to the beginning of data
+*/
+const TInt KDataOffset      = KHeaderOffset + sizeof(TChunkHeader);
+
+// CLASS DECLARATION
+class CSenChunk : public CBase
+    {
+  /**
+  * Helper class for storing RChunks
+  */
+    public:
+        /**
+        * Two-phased constructor.
+        * @since Series60 4.0
+        * @param aChunkName is the chunk name.
+        * @return a new CSenChunk
+        */
+        IMPORT_C static CSenChunk* NewL(const TDesC& aChunkName);
+        
+        /**
+        * Two-phased constructor.
+        * @since Series60 4.0
+        * @param aChunkName is the chunk name.
+        * @return a new CSenChunk
+        */        
+        IMPORT_C static CSenChunk* NewLC(const TDesC& aChunkName);
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CSenChunk();
+
+      /**
+    * @since Series60 4.0
+        * @return   a reference to internal chunk
+      */
+      IMPORT_C RChunk& Chunk();
+      
+      /**
+    * @since Series60 4.0
+        * @return   a pointer to ChunkName
+      */
+        IMPORT_C TPtrC ChunkName() const;
+
+        /**
+        * Creates global protected RChunk inside CSenChunk
+        * @since Series60 4.0
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt CreateChunk();
+        
+        /**
+        * Opens global protected RChunk inside CSenChunk
+        * @since Series60 4.0
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt OpenChunk();
+        
+        /**
+        * Closes RChunk inside CSenChunk
+        * @since Series60 4.0
+        */
+        IMPORT_C void CloseChunk();
+
+        /**
+        * Changes the number of bytes committed to the internal chunk.
+        * This value is always rounded up to the next nearest processor
+        * page boundary.
+        * This value is rounded up to KSenMinRChunkSize if value is
+        * less than KSenMinRChunkSize.
+        * @since Series60 4.0
+        * @param    aNewSize The number of bytes to be committed to this chunk.
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt AdjustChunk(TInt aNewSize);
+
+      /**
+    * @since Series60 4.0
+        * @return   a header of the internal chunk
+      */
+        IMPORT_C TChunkHeader& ChunkHeader();
+
+        /**
+        * Stores given descriptor into internal chunk.
+        * Internal chunk is tried to adjust so that given descriptor
+        * fits into chunk.
+        * @since Series60 4.0
+        * @param aDesc is the descriptor to store        
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt DescToChunk(const TDesC8& aDesc);
+
+        /**
+        * Stores given descriptor into internal chunk.
+        * Internal chunk is tried to adjust so that given descriptor
+        * fits into chunk.
+        * @since Series60 4.0
+        * @param aDesc is the descriptor to store        
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt DescToChunk(const TDesC8& aDesc, TInt aIndex);
+        
+        /**
+        * Changes the number of bytes committed to the internal chunk
+        * and places a pointer to chunk to apAllocated.
+        * Size is always rounded up to the next nearest processor
+        * page boundary.
+        * Size is rounded up to KSenMinRChunkSize if given size is
+        * less than KSenMinRChunkSize.
+        * @since Series60 4.0
+        * @param    aSize The number of bytes to be committed to this chunk.
+        * @param    apAllocated 
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt AllocDescToChunk(TInt aSize, TPtr8*& apAllocated);
+        
+        /**
+        * Stores given descriptors into internal chunk.
+        * Internal chunk is tried to adjust so that both of the 
+        * given descriptors fit into chunk.
+        * @since Series60 4.0
+        * @param aDesc is the first descriptor to store        
+        * @param aDesc2 is the second descriptor to store        
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt DescsToChunk(const TDesC8& aDesc,
+                             const TDesC8& aDesc2);
+                             
+        /**
+        * Gets stored descriptor in given index from internal chunk.
+        * @since Series60 4.0
+        * @param aDesc will hold the pointer to descriptor in internal chunk        
+        * @param aIndex is the index of descriptor to get
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt DescFromChunk(TPtrC8& aDesc, TInt aIndex = 0);
+        
+        /**
+        * Gets stored descriptors from internal chunk.
+        * @since Series60 4.0
+        * @param aDesc1 will hold the pointer to the first descriptor in internal chunk        
+        * @param aDesc2 will hold the pointer to the second descriptor in internal chunk        
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt DescsFromChunk(TPtrC8& aDesc1, TPtrC8& aDesc2);
+
+        /**
+        * Sets an internal chunk into TIpcArgs into given po.
+        * @since Series60 4.0
+        * @param aArgs  The IPC message arguments
+        * @param aIndex An index value that identifies the slot in the array 
+        *               of arguments into which the chunk is to be 
+        *               placed. This must be a value in the range 0 to 3. 
+        */
+        IMPORT_C void ChunkToArgs(TIpcArgs& aArgs, TInt aIndex);
+        
+        /**
+        * Opens internal chunk using a handle number sent by a client to a server.
+        * This function is called by the server.
+        * @since Series60 4.0
+        * @param aMessage Represents the contents of the client message
+        * @param aIndex An index specifying which of the four message arguments 
+        *               contains the handle number. 
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt OpenChunkFromRMsgL(const RMessage2& aMessage, TInt aIndex);
+        
+        /**
+        * Opens internal chunk using a handle number returned by a server to a client.
+        * This function is called by the client.
+        * @since Series60 4.0
+        * @param aHandleOrError A handle-number, if zero or positive;
+        *                       an error value, if negative.
+        * @return   KErrNone, if aHandle is a handle-number;
+        *           the value of aHandleOrError, otherwise..
+        */
+        IMPORT_C TInt OpenChunkFromHandleNumberL(TInt aHandleOrError);
+        
+        /**
+        * Tests whether two CSenChunks are equal.
+        * @since Series60 4.0
+        * @param aChunk The SenChunk to be compared with this SenChunk
+        * @return   True if the two SenChunks are equal. False if not.
+        */
+        IMPORT_C TBool operator==(const CSenChunk& aChunk);
+        
+        /**
+        * Sets the file logger used for debug messages.
+        * @since Series60 4.0
+        * @param aLog is the file logger
+        */
+        IMPORT_C void SetLogger(RFileLogger* aLog);
+        
+        /**
+        * Gets the Rfile Pointer to CHUNK to send content by HTTP:POST
+        * @since Series60
+        */
+        IMPORT_C RFile& RequestFileHandle();
+        
+        /**
+        * Sets the Rfile Pointer to CHUNK to send content by HTTP:POST
+        * @since Series60
+        */
+        IMPORT_C void RequestFileHandle(RFile& aFile);        
+
+    protected: // Helper functions
+        /**
+        * @since Series60 4.0
+        * @return   Pointer to the file logger
+        */
+        IMPORT_C RFileLogger* Log() const;
+
+    /**
+     *  Constructor.
+     */
+     IMPORT_C CSenChunk();
+
+    private:
+        /**
+        * This private helper ensures that cast address is dividable by four (MANDATORY in ARMv5 environment, for example)
+        */
+        TUint8* RoundToNextDividableByFourAddress(TUint8* aValue);
+
+
+        /**
+        * Basic ConstructL function
+        * @since Series60 4.0
+            * @param aChunkName is the chunk name.
+        */
+        void ConstructL(const TDesC& aChunkName);
+        
+
+    protected: // Data
+        HBufC*          ipChunkName;
+
+    private: // Data
+        RChunk          iChunk;
+        RFileLogger*    iLog;
+        RFile           iFile;
+    };
+
+#endif //R_SEN_SERVICE_CONNECTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/sencryptoutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+#ifndef C_SEN_CRYPTO_UTILS_H
+#define C_SEN_CRYPTO_UTILS_H
+
+#include <hash.h>
+
+
+/**
+ * Set of static convenience methods to help in cryptography
+ */
+class SenCryptoUtils
+    {
+    public:
+        /**
+        * Algorithm taken from of TLS specification RFC 2246 - 5.HMAC and the pseudorandom function  
+        *           
+        *           P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
+        *                              HMAC_hash(secret, A(2) + seed) +
+        *                              HMAC_hash(secret, A(3) + seed) + ...
+        *
+        *               Where + indicates concatenation.
+        *
+        *               A() is defined as:
+        *                   A(0) = seed
+        *                   A(i) = HMAC_hash(secret, A(i-1))
+        *
+        *       P_hash can be iterated as many times as is necessary to produce the
+        *       required quantity of data. For example, if P_SHA-1 was being used to
+        *       create 64 bytes of data, it would have to be iterated 4 times
+        *       (through A(4)), creating 80 bytes of output data; the last 16 bytes
+        *       of the final iteration would then be discarded, leaving 64 bytes of
+        *       output data.
+        * @param aSecret - secret
+        * @param aSeed - seed
+        * @param aLength - length of new secret
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static HBufC8* GetPSHA1HashL( const TDesC8& aSecret, 
+                                               const TDesC8& aSeed, 
+                                               const TInt aLength );
+    
+        /*
+        * Encode data into Base64 format
+        * @param aData - source data
+        * @return encoded data, if some problem occurs, NULL is returned
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static HBufC8* EncodeBase64L(const TDesC8& aData);
+    
+        /*
+        * Decode data from Base64 format
+        * @param aData - source data
+        * @return decoded data, if some problem occurs, NULL is returned
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static HBufC8* DecodeBase64L(const TDesC8& aData);
+    
+        /*
+        * Randomize some data and hash it using MD5 digest algorithm.
+        * @return hashed randomized data (constant length of hash according to MD5 specification)
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static HBufC8* RandomAndHashMd5LC();
+        
+        /*
+        * Create <BinarySecret> tag from security token.
+        * @param aSecret security context token.
+        * @param aValueType Indicates what the security token is
+        * @return <BinarySecret> tag with encoded (base64) token.
+        */
+        IMPORT_C static HBufC8* CreateEncodedBinarySecretL( const TDesC8& aSecret, 
+                                                            const TDesC8& aValueType );
+        
+        /*
+        * Timestamp as number of seconds since 1 january 1970.
+        * Calculated for present phone time.
+        * @return timestamp value
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static HBufC8* GetTimestampL();
+        
+        
+        /*
+        * Timestamp as number of seconds since 1 january 1970.
+        *   Calculated for provided time.
+        * @param aTime base for generated timestamp
+        * @return timestamp value
+        * @since Series60 5.0
+        */
+        IMPORT_C static HBufC8* GetTimestampL(TTime aTime);
+        
+
+        /*
+        * Randomize some data (based on time) and hash it using MD5 digest algorithm, 
+        * convert each byte to hex nember representation
+        * @return hashed randomized data (constant length of hash according to MD5 specification
+        * doubled during hex conversion)
+        * @since Series60 3.2.3
+        */
+        IMPORT_C static HBufC8* GetRandomNonceL();
+        
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        SenCryptoUtils();
+    };
+
+#endif // C_SEN_CRYPTO_UTILS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/sendebug.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Central place for debug-type macros
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_DEBUG_H
+#define SEN_DEBUG_H
+
+// Note that _DEBUG is automatically defined for debug builds
+
+/**
+* To enable file logging: please comment following #ifdef line and 
+* uncomment #ifdef TRUE
+*/
+#ifdef _DEBUG
+
+//#ifdef TRUE // to enable logging & debug in all builds
+//#ifndef TRUE // to disable logging & debug in all builds
+
+//  INCLUDES
+#include <e32svr.h>
+#include <flogger.h>
+
+// MACROS
+#define _SENDEBUG   1
+#define SENDEBUG(parameters)        RDebug::Print parameters
+#define SENDEBUG_L(string)          RDebug::Print(_L(string))   // single param
+
+#define LOG_CONNECT                 Log()->Connect()
+#define LOG_CREATELOG(parameters)   Log()->CreateLog parameters
+#define LOG_WRITE(parameters)       Log()->Write parameters
+#define LOG_WRITE_L(string)         Log()->Write(_L(string))    // single param
+#define LOG_WRITEFORMAT(parameters) Log()->WriteFormat parameters
+#define LOG_CLOSELOG                Log()->CloseLog()
+#define LOG_CLOSE                   Log()->Close()
+
+
+//#define LOG_WRITEALL(parameters)    Log()->Write parameters
+
+#define LOG_WRITEALL(parameters) \
+    { \
+    TInt ___iZen___ = 0; \
+    TInt ___amountZen___ = 100; \
+    while(___iZen___<(parameters).Length()) \
+        { \
+        if(( (parameters).Length()-___iZen___) < 100) \
+            ___amountZen___ = (parameters).Length()-___iZen___; \
+        Log()->Write((parameters).Mid(___iZen___,___amountZen___)); \
+        ___iZen___+=100; \
+        } \
+    }
+
+
+#define FILELOG(dir, file, string)          RFileLogger::Write(dir, file, EFileLoggingModeOverwriteRaw, string);
+#define FILELOGAPPEND(dir, file, string)    RFileLogger::Write(dir, file, EFileLoggingModeAppendRaw, string);
+
+#define FILELOGALL(dir, file, longstring) \
+    { \
+    TInt ___iZen2___ = 0; \
+    TInt ___amountZen2___ = 100; \
+    FILELOG(dir, file, KNullDesC8()); \
+    while(___iZen2___<longstring.Length()) \
+        { \
+        if(( longstring.Length()-___iZen2___) < 100) \
+            ___amountZen2___ = longstring.Length()-___iZen2___; \
+        if(___iZen2___==0) FILELOG(dir, file, longstring.Mid(___iZen2___,___amountZen2___)) \
+        else FILELOGAPPEND(dir, file, longstring.Mid(___iZen2___,___amountZen2___)) \
+        ___iZen2___+=100; \
+        } \
+    }
+#else
+
+#define SENDEBUG(parameters)
+#define SENDEBUG_L(string)
+
+#define LOG_CONNECT
+#define LOG_CREATELOG(parameters)
+#define LOG_WRITE(parameters)
+#define LOG_WRITE_L(string)
+#define LOG_WRITEFORMAT(parameters)
+#define LOG_CLOSELOG
+#define LOG_CLOSE
+#define LOG_WRITEALL(parameters)
+
+#define FILELOG(dir, file, string)
+#define FILELOGAPPEND(dir, file, string)
+#define FILELOGALL(dir, file, parameters)
+
+#endif // _DEBUG
+
+#endif // SEN_DEBUG_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senguidgen.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef CCGUIDGEN_H
+#define CCGUIDGEN_H
+
+// INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+// CONSTANTS
+_LIT8(KSenUuidPrefix, "uuid:"); // GUID is valid URN
+const TInt KSenUuidMaxHostIdLength = 64;
+const TInt KSenUuidMaxInt64Length = 20;
+const TInt KSenUuidNumOfSlashes = 4;
+const TInt KSenUuidHexWidth = 2;
+const TInt KSenUuidPrefixLength = 5; // KSenUuidPrefix().Length(); 
+const TInt KSenUuidHashMultiplier = 2;
+const TInt KSenUuidHashReserved = 2;
+const TInt KSenUuidMaxHashLength = KSenUuidMaxHostIdLength + KSenUuidMaxInt64Length * KSenUuidHashMultiplier + KSenUuidHashReserved;
+const TInt KSenUuidMaxLength = KSenUuidPrefixLength + KSenUuidMaxHashLength * KSenUuidHexWidth + KSenUuidNumOfSlashes; 
+
+// FORWARD DECLARATIONS
+class CMD5;
+
+// CLASS DECLARATION
+class CSenGuidGen : public CBase
+    {
+    public: // Constructors and destructor
+        
+        IMPORT_C static CSenGuidGen* NewL();
+        IMPORT_C static CSenGuidGen* NewLC();
+        ~CSenGuidGen();
+        
+        // New functions
+        
+        /**
+        *  Generate totally random (but not cryptographically strong)
+        *  GUIDs. The GUID is based on the MD5 hash of a random number
+        *  and the current time. Some kind of host ID should be also
+        *  used but the author did not find an easy way of getting it.
+        */
+        IMPORT_C HBufC* GetRandomGuidLC();
+        IMPORT_C HBufC8* GetRandomGuid8LC();
+        IMPORT_C HBufC16* GetRandomGuid16LC();
+        
+    private:
+    /**
+    * C++ default constructor.
+        */
+        CSenGuidGen();
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */  
+        void ConstructL();
+        
+        // New functions
+        
+        TPtrC8 GetRandomHash();
+        
+    private: // Data
+        TInt64 iSeed;
+        HBufC8 *ipHostId;
+        CMD5 *ipMd5HashGen;
+    };
+
+#endif // CCGUIDGEN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senidentifier.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,292 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef C_SEN_IDENTIFIER_H
+#define C_SEN_IDENTIFIER_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <flogger.h>
+#include <ssl.h>
+
+#include "senattributes.h"
+
+// CONSTANTS
+namespace SenIdentifier
+    {
+    enum TIdentifierType
+        {
+        EUnknown = 0,
+        EEndpoint, // URL
+        ECertInfo, // (Server) certificate info object - unique ID of X509 cert
+        ESession,  // Symbian server session
+        ELocalApp, // Symbian App GUID
+        EProvider, // i.e., Liberty ProviderID
+        ERole,     // Role ID (e.g., in form of SAML NameIdentifier)
+        EIdentity, // Subject ID, e.g., SAML NameIdentifier
+        EThread,   // Thread ID
+        EProcess   // Process ID
+        };
+    }
+
+// CLASS DEFINITIONS
+
+/**
+ * An Identifier is used to address (point to) a Principal.
+ * The system uses a variety of actual types to identify different
+ * parties. For example an URL endpoint can serve as an identifier
+ * for a remote service; a (G)UID may identitfy a local application, and
+ * an XML document or SAML NameIdentifier may identify a person.
+ * 
+ * NOTE: This is just like a java.security.Principal
+ * and could potentially be extended to supply that kind of interface
+ * to requesters
+ * 
+ * How are Identifiers related? One way is via the Proxy mechanism - but
+ * an attribute (ie. SAML attribute is just an Identifier with a different 
+ * name, and possibly multiple values)
+ * 
+ * Identifiers are useful for policy related to a Subject, but can also be 
+ * used to index a session with a consumer application
+ *  
+ * <p>
+ * (c) Copyright Nokia 2004, 2005
+ * <p>
+ */
+class CSenIdentifier : public CBase
+    {
+    /*
+    public final static CSenIdentifier NULL = new Identifier();
+    */
+
+    public: // Constructors and Destructors
+
+        IMPORT_C static CSenIdentifier* NewL();
+
+        IMPORT_C static CSenIdentifier* NewLC();
+
+        IMPORT_C static CSenIdentifier* NewL(const CSenIdentifier& aParent);
+
+        IMPORT_C static CSenIdentifier* NewLC(const CSenIdentifier& aParent);
+
+        IMPORT_C static CSenIdentifier* NewL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                             const TDesC8& aIdentifierValue);
+
+        IMPORT_C static CSenIdentifier* NewLC(SenIdentifier::TIdentifierType aIdentifierType, 
+                                              const TDesC8& aIdentifierValue);
+
+
+        IMPORT_C static CSenIdentifier* NewL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                             const TDesC8& aIdentifierValue, 
+                                             const TDesC8& aFriendlyName);
+
+        IMPORT_C static CSenIdentifier* NewLC(SenIdentifier::TIdentifierType aIdentifierType, 
+                                              const TDesC8& aIdentifierValue, 
+                                              const TDesC8& aFriendlyName);
+
+
+        /**
+         * 
+         * Constructor taking TCertInfo type as value input, which will be
+         * converted into string representation (TDesC8) where fields are 
+         * delimited by KSenCASNDelimiter.
+         * 
+         * @since Series60 5.0
+         * 
+         * @param aIdentifierType The identifier type value, which typically would be ECertInfo.
+         * @param aCertInfo The certificate info object that provides a unique
+         * identification of a certificate.
+         * @return a pointer to new CSenIdentifier instance
+         * 
+         */
+        IMPORT_C static CSenIdentifier* NewL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                             const TCertInfo& aCertInfo);
+
+        /**
+         * 
+         * Constructor taking TCertInfo type as value input, which will be
+         * converted into string representation (TDesC8) where fields are 
+         * delimited by KSenCASNDelimiter.
+         * 
+         * @since Series60 5.0
+         * 
+         * @param aIdentifierType The identifier type value, which typically would be ECertInfo.
+         * @param aCertInfo The certificate info object that provides a unique
+         * identification of a certificate.
+         * @return  new CSenIdentifier instance pointer, which has been left on cleanup stack.
+         * 
+         */
+        IMPORT_C static CSenIdentifier* NewLC(SenIdentifier::TIdentifierType aIdentifierType, 
+                                              const TCertInfo& aCertInfo);
+
+
+        IMPORT_C virtual ~CSenIdentifier();
+
+        /**
+        * Getter for Identifier value
+        * @return the value of this identifier
+        */
+        IMPORT_C TPtrC8 Value() const;
+
+
+        /**
+        * Getter for Identifier type
+        * @return TIdentifierType enumeration (type) of this identifier
+        */
+        IMPORT_C SenIdentifier::TIdentifierType Type() const;
+
+
+        /**
+         * Equality operation for two identifiers
+         */
+        IMPORT_C TBool Equals(const CSenIdentifier& otherIdentifier);
+
+        /** 
+         * This identifier is saying that it is acting as a proxy for the given (param) 
+         * identifier. An example of proxying is if the PAOS filter or another piece of
+         * local software acts on behalf of some remote network entity, forwarding a 
+         * request message to Core Service Manager (and then onto the service instance).
+         *
+         * @param aIdentifier identifier of which self is a proxy for. That is,
+         * aIdentifier becomes parent of self. Method takes ownership of aIdentifier.
+         */
+        IMPORT_C void ProxyFor( CSenIdentifier* aIdentifier );
+
+        /**
+         * Is the Identifier acting as the proxy for another Identifier?
+         * 
+         * @return TBool - indicating that the Identifier in question is 
+         * acting as a proxy for some other Identifier
+         * 
+         */
+        IMPORT_C TBool IsProxy() const;
+
+        /**
+         * Getter for parent identifier (ie. that which this identifier 
+         * is proxying for. 
+         * 
+         * @return the identifier that is being proxied for, or NULL,
+         *         if this identifier does not act as a proxy to any 
+         *         other.
+         */
+        IMPORT_C const CSenIdentifier* Proxy() const;
+
+
+        /**
+         * Getter for top level proxy (parent) of the identifier chain.
+         * If this identifier is not proxy for any other, then this
+         * method returns itself.
+         * @return pointer to root identifier or if this identifier is
+         *         not a proxy, the pointer to this identifier itself.
+         */
+        IMPORT_C const CSenIdentifier* Root() const;
+
+
+        /**
+         * Add an Attribute statement to this Identifier. An attribute might say something like
+         * "this Identifier was authenticated at such and such a time" or "this Identifier is a member
+         * of group YYY"
+         * 
+         * Note: It is possible that multiple attributes with the same name, but different values
+         * could have been added to the list. Currently there is no check on this in the Attribute
+         * or Identifier code.
+         * 
+         * 
+         * @param aAttribute
+         * @see com.nokia.serene.utils.Attribute
+         */
+        IMPORT_C void AddAttributeL( CSenAttribute& aAttribute );	//codescannerwarnings
+
+
+        /**
+         * Get a reference to the attributes associated with this Identifier
+         * 
+         *
+         * @since Series60 5.0
+         * 
+         * @param       none
+         *
+         * @return      CSenAttributes
+         */
+        IMPORT_C const CSenAttributes* Attributes() const;
+
+
+        /**
+        * Tests whether or not two CSenIdentifier instances are equal.
+        * @since Series60 5.0
+        * @param aIdentifier is the CSenIdentifier to be compared with this
+        * @return   True if the two CSenIdentifier are equal. False if not.
+        */
+        IMPORT_C TBool operator==(const CSenIdentifier& aIdentifier);
+
+    protected:
+
+
+
+        void ConstructL(SenIdentifier::TIdentifierType aIdentifierType, 
+                        const TDesC8& aIdentifierValue, 
+                        const TDesC8& aFriendlyName);
+
+
+        void ConstructL(const CSenIdentifier& aParent);
+
+
+    private:
+
+        CSenIdentifier();
+
+        /**
+        * Getter for parent identifier (which is being proxied by
+        * this identifier, or if this identifier does not act as
+        * proxy, it returns it self.
+        * @return parent identifier. Unlike Proxy(), this method
+        *         returns a reference to itself, if it does not
+        *         have a parent.
+        */
+        const CSenIdentifier& Parent() const;
+
+        /**
+        * Getter for statement attribute list.
+        * @return a list of attributes that containt statements of
+        *         this identifier.
+        */
+        const CSenAttributes& Statements() const;
+
+
+    protected: // Data
+
+        SenIdentifier::TIdentifierType iType;
+        HBufC8* ipValue; // owned
+
+    private: // Data
+        HBufC8* ipFriendlyName; // ownedd
+        CSenIdentifier* ipParent; // not owned
+        CSenAttributes* ipStatements; // owned
+
+
+    };
+
+#endif // C_SEN_IDENTIFIER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senpointermap.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,279 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef POINTERMAP_H
+#define POINTERMAP_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+template <typename K, typename V>
+class RSenPointerMap
+    {
+    public: // Constructors and destructor
+        
+    RSenPointerMap(TBool aTakeOwnershipKey, TBool aTakeOwnershipValue)
+        :
+        iTakeOwnershipKey(aTakeOwnershipKey),
+        iTakeOwnershipValue(aTakeOwnershipValue)
+        {}
+
+    ~RSenPointerMap()
+        {
+        Reset();
+        }
+
+        // New functions
+        
+    TInt Append(const K* aKey, const V* aValue)
+        {
+        TInt err = iKeys.Append(aKey);
+        if (err == KErrNone)
+            {
+            err = iValues.Append(aValue);
+            if (err != KErrNone)
+                {
+                // last element of iKeys should be removed
+                TInt lastElementIndex = iKeys.Count() - 1;
+                iKeys.Remove(lastElementIndex);
+                }
+            }
+        return err;
+        }
+
+    TInt Find(const K& aKey) const
+        {
+        TInt index( KErrNotFound );
+        for (TInt i = 0; i < iKeys.Count(); i++)
+            {
+            if (*iKeys[i] == aKey)
+                {
+                index = i;
+                break;
+                }
+            }
+        return index;
+        }
+
+    TInt FindReverse(const K& aKey) const
+        {
+        TInt index( KErrNotFound );
+        TInt count( iKeys.Count() );
+        for (TInt i = count-1; i >=0 ; i--)
+            {
+            if (*iKeys[i] == aKey)
+                {
+                index = i;
+                break;
+                }
+            }
+        return index;
+        }
+        
+        
+    TInt RemoveAt( TInt aIndex ) 
+        {
+        K* key = KeyAt( aIndex );
+    	return RemoveByKey( *key );
+    	}
+
+    // @return the index of removed key-value pair, or
+    // KErrNotFound, if such key was not found
+    TInt RemoveByKey(const K& aKey)
+        {
+        TInt index = Find(aKey);
+        if (index != KErrNotFound)
+            {
+            if(iTakeOwnershipKey)
+                {
+                K* key = KeyAt(index);
+                delete key;
+                }
+            if(iTakeOwnershipValue)
+                {
+                V* value = iValues[index];
+                delete value;
+                }
+            iKeys.Remove(index);
+            iValues.Remove(index);
+            }
+        return index;
+        }
+
+    // @return the index of removed key-value pair, or
+    // KErrNotFound, if such key was not found
+    TInt Remove(const V& aValue)
+        {
+        TInt index = FindValue(aValue);
+        if (index != KErrNotFound)
+            {
+            if (iTakeOwnershipValue)
+                {
+                V* value = iValues[index];
+                delete value;
+                }
+            if (iTakeOwnershipKey)
+                {
+                K* key = iKeys[index];
+                delete key;
+                }
+            iValues.Remove(index);
+            iKeys.Remove(index);
+            }
+        return index; 
+        }
+
+    TInt FindValue(const V& aValue) const
+        {
+        TInt index = KErrNotFound;
+        for (TInt i = 0; i < iValues.Count(); i++)
+            {
+            if ((iValues[i]) && (*iValues[i] == aValue))
+                {
+                index = i;
+                break;
+                }
+            }
+        return index;
+        }
+
+
+    // Note: deletes the current value of this key
+    TInt UpdateValue(const K* aKey, const V* aValue)
+        {
+        TInt index=Find(*aKey);
+        if (index==KErrNotFound)
+            {
+            return Append(aKey, aValue);
+            }
+
+        V* bValue=iValues[index];
+        if (iTakeOwnershipValue)
+            {
+            // Since OWNED value is going to be replaced with aValue,
+            // destroy old value instance first:
+            delete bValue;  
+            }
+
+        iValues[index]=(V*)aValue;
+        return KErrNone;
+        }
+
+
+    K* KeyAt(TInt aIndex)
+        {
+        return iKeys[aIndex];
+        }
+
+    const V* ValueAt(TInt aIndex) const
+        {
+        return iValues[aIndex];
+        }
+
+    TInt Count() const
+        {
+        return iKeys.Count();
+        }
+
+    void Reset()
+        {
+        if ( iTakeOwnershipKey )
+            {
+            iKeys.ResetAndDestroy();
+            }
+        else
+            {
+            iKeys.Reset();
+            }
+
+        if ( iTakeOwnershipValue )
+            {
+            iValues.ResetAndDestroy();
+            }
+        else
+            {
+            iValues.Reset();
+            }
+        }
+        
+    TInt Insert(const K* aKey, const V* aValue)
+        {
+        TInt count=iKeys.Count();
+        TInt err=KErrNone;
+		TBool inserted=EFalse;
+
+        for(TInt i=0; i<count; i++)
+        	{
+        	 if(*iKeys[i] >= *aKey)
+        	 {
+	        err = iKeys.Insert(aKey, i);
+	        if (err == KErrNone)
+	            {
+	            err = iValues.Insert(aValue, i);
+	            if (err != KErrNone)
+	                {
+	                // inserted element of iKeys should be removed
+	                iKeys.Remove(i);
+	                }
+				    else
+					{
+					inserted=ETrue;
+					}
+            	}
+			break;  	 	
+        	 }
+			}
+
+        if(!inserted)
+        	{
+	        err = iKeys.Append(aKey);
+	        if (err == KErrNone)
+	            {
+	            err = iValues.Append(aValue);
+	            if (err != KErrNone)
+	                {
+	                // last element of iKeys should be removed
+	                TInt lastElementIndex = iKeys.Count() - 1;
+	                iKeys.Remove(lastElementIndex);
+	                }
+            	}
+        	}
+	return err;
+        }
+        
+    private: // Data
+    TBool iTakeOwnershipKey;
+    TBool iTakeOwnershipValue;
+    RPointerArray<K> iKeys;
+    RPointerArray<V> iValues;
+    };
+
+#endif // POINTERMAP_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senpropertieselement.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#include <SenXmlElement.h>
+#include "MSenProperty.h"
+
+#ifndef SEN_PROPERTIES_ELEMENT_H
+#define SEN_PROPERTIES_ELEMENT_H
+
+class CSenPropertiesElement : public CSenXmlElement, public MSenProperty
+    {
+    friend class CSenPropertiesFragment;
+    
+    public:  // Constructors and destructor
+
+        /**
+         *  Standard constructor.
+         *  @param aLocalName   the local name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+
+        IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aLocalName,
+                                                    RStringPool* aStringPool);
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName,
+                                                    RStringPool* aStringPool);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aQName,
+                                                    RStringPool* aStringPool);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  @param apAttrs      the attributes for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri, 
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aQName,
+                                                    const RAttributeArray& apAttrs,
+                                                    RStringPool* aStringPool);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  @param apAttrs      the attributes for this element.
+         *  @param aParent: the parent element for the new element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aQName,
+                                                    const RAttributeArray& apAttrs,
+                                                    CSenElement& aParent,
+                                                    RStringPool* aStringPool);
+  
+        // From CSenXmlElement:
+
+        virtual CSenElement* CreateElementL(const TDesC8& aNsPrefix,
+                                            const TDesC8& aLocalName);
+                                             
+        virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName);
+
+        virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aQName);
+
+        virtual CSenElement& AddElementL(const TDesC8& aLocalName);
+
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+        
+        void CopyFromL(CSenElement& aSource);
+        
+        virtual const TDesC8& LocalName() const;
+
+        virtual void Set( const TDesC8& aNsUri, 
+                          const TDesC8& aLocalname,
+                          const TDesC8& aQName );
+
+        virtual TBool HasContent() const;
+
+        virtual TPtrC8 Content() const;
+        
+        virtual TPtrC8 SetContentL(const TDesC8& aContent);
+
+        virtual RWriteStream& ContentWriteStreamL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSenPropertiesElement();
+        
+        // From MSenProperty
+        virtual TPtrC8 Name();
+        virtual TPtrC8 Type();
+        virtual TPtrC8 Value();
+        virtual TInt IntValue(TInt& aValue);
+        virtual TInt BoolValue(TBool& aValue);
+
+        /**
+        * @param aTokens will contain tokanized values,
+        * which ownership is NOT transferred to the caller(!)
+        */
+        virtual TInt ValueTokensL(const TDesC8& aDelimiter,
+                                  RPointerArray<TPtrC8>& aTokens);
+                                  
+        virtual void SetStringPool(RStringPool& aStringPool);
+        
+    protected:  // New functions
+    
+        /**
+        * C++ default constructor
+        */
+        CSenPropertiesElement();
+
+        void BaseConstructL(const TDesC8& aLocalName,
+                            RStringPool* aStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName,
+                            RStringPool* aStringPool);
+        
+        void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName,
+                            const TDesC8& aQName, RStringPool* aStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName,
+                            const TDesC8& aQName,
+                            const RAttributeArray& apAttrs,
+                            RStringPool* aStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName,
+                            const TDesC8& aQName,
+                            const RAttributeArray& apAttrs,
+                            CSenElement& aParent,
+                            RStringPool* aStringPool);
+                                              
+        virtual void WriteContentToL(RWriteStream& aWriteStream);
+        
+        virtual void AllocContentBufL();
+        
+        virtual RStringPool& StringPool();
+        
+    protected: // Data
+        RStringPool*    ipStringPool;   // Not owned
+        RString         iLocalName;     // Owned
+        RString         iContent;       // Owned
+    };        
+
+#endif // SEN_PROPERTIES_ELEMENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senpropertiesfragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_PROPERTIES_FRAGMENT_H
+#define SEN_PROPERTIES_FRAGMENT_H
+
+//  INCLUDES
+#include <SenDomFragment.h>
+
+class CSenPropertiesFragment : public CSenDomFragment
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Basic contructor. Should be used only for parsing new fragments etc. 
+        * Constructing DomFragments for other use should be done with at least 
+        * localname parameter.
+        * @since Series60
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(
+                                            RStringPool *ipStringPool = NULL);
+
+        /**
+        * Basic constructor.
+        * @since Series60
+        * @param aElement Element to copy construction data from.
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(
+                                            const CSenElement& aElement,
+                                            RStringPool *ipStringPool = NULL);
+
+        /**
+        * Basic constructor.
+        * @since Series60
+        * @param aLocalName is the XML localname of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(
+                                            const TDesC8& aLocalName,
+                                            RStringPool *ipStringPool = NULL);
+
+        /**
+        * Basic constructor.
+        * @since Series60
+        * @param aNsUri is the XML namespace user of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            RStringPool *ipStringPool = NULL);
+
+        /**
+        * Basic constructor.
+        * @since Series60
+        * @param aNsUri is the XML namespace user of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aQName is the XML qualifiedname of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(
+                                            const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            RStringPool *ipStringPool = NULL);
+
+        /**
+        * Basic constructor.
+        * @since Series60
+        * @param aNsUri is the XML namespace of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aQName is the qualifiedname of this fragment
+        * @param aAttrs are the XML attributes of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttrs,
+                                            RStringPool *ipStringPool = NULL);
+
+        /**
+        * Basic constructor.
+        * @since Series60
+        * @param aNsUri is the XML namespace of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aQName is the qualifiedname of this fragment
+        * @param aAttrs are the XML attributes of this fragment
+        * @param aParent is the parent XML element of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenPropertiesFragment* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttrs,
+                                            CSenElement& aParent,
+                                            RStringPool *ipStringPool = NULL);
+
+
+        virtual void ExpandL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName,
+                                      const RAttributeArray& aAttrs);
+
+        virtual void SetStringPool(RStringPool& aStringPool);
+                           
+        virtual RStringPool& StringPool();
+        
+        virtual TBool HasStringPool() const;
+                                      
+        /**
+        * Destructor.
+        */
+        virtual ~CSenPropertiesFragment();
+
+    protected:  
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenPropertiesFragment();
+
+        void BaseConstructL(const CSenElement& aElement, 
+                            RStringPool *ipStringPool);
+
+        void BaseConstructL(const TDesC8& aLocalName,
+                            RStringPool *ipStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            RStringPool *ipStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            const TDesC8& aQName,
+                            RStringPool *ipStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            const TDesC8& aQName,
+                            const RAttributeArray& aAttrs,
+                            RStringPool *ipStringPool);
+
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            const TDesC8& aQName,
+                            const RAttributeArray& aAttrs,
+                            CSenElement& aParent,
+                            RStringPool *ipStringPool);
+
+        void BaseConstructL(CSenXmlReader& aReader,
+                            RStringPool *ipStringPool);
+        
+        virtual void StartElementL(const TDesC8& aNsUri,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName,
+                                   const RAttributeArray& aAttrs);
+
+        virtual void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName);
+
+        virtual void CharactersL(const TDesC8& aChars,TInt aStart,TInt aLength);
+        
+        virtual void AllocContentSaverL();     
+        
+    protected: // Data
+        RStringPool* ipStringPool;
+    };
+
+#endif //SEN_PROPERTIES_FRAGMENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/sensaxutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This utility class provides static methods for searching
+*                StartTag and EndTag of certain element from XML Document.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SAX_UTILS_H
+#define SEN_SAX_UTILS_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+const TInt KSenMaxLengthSaxParsingSoapMsg = 10000;
+
+// CLASS DECLARATION
+
+/**
+* This utility class provides static methods for searching
+* StartTag and EndTag from XML Document.
+*  @lib SenUtils.lib
+*  @since Series60 4.0
+*/
+class SenSaxUtils
+    {
+    public:
+        /**
+        * Search StartTag from XML Document.
+        * Searching starts from the beginning of the given document.
+        *
+        * @since Series60 4.0
+        * @param aDocument      XML Document from which StartTag is
+        *                       searched.
+        * @param aLocalName     LocalName of StartTag to be searched.
+        * @param aStartTagStart Reference to TInt which will contain
+        *                       value telling starting position of
+        *                       searched StartTag.
+        * @param aStartTagEnd   Reference to TInt which will contain
+        *                       value telling ending position of
+        *                       searched StartTag.
+        * @param aPrefix        Reference to TPtrC8 for which pointer
+        *                       of the Prefix of StartTag will be
+        *                       stored.
+        *                       Note: aPrefix points to given
+        *                             aDocument descriptor.
+        * @return KErrNone      if StartTag were found.
+        *         KErrNotFound  if StartTag were not found.
+        */
+        IMPORT_C static TInt SearchStartTagL(const TDesC8& aDocument,
+                                             const TDesC8& aLocalName,
+                                             TInt& aStartTagStart,
+                                             TInt& aStartTagEnd,
+                                             TPtrC8& aPrefix);
+
+        /**
+        * Search StartTag from XML Document.
+        * Searching starts from the beginning of the given document.
+        *
+        * @since Series60 4.0
+        * @param aDocument      Document from which StartTag is searched
+        * @param aPrefix        Prefix of StartTag to be searched.
+        * @param aLocalName     LocalName of StartTag to be searched.
+        * @param aStartTagStart Reference to TInt which will contain
+        *                       value telling starting position of
+        *                       searched StartTag.
+        * @param aStartTagEnd   Reference to TInt which will contain
+        *                       value telling ending position of
+        *                       searched StartTag.
+        * @return KErrNone      if StartTag were found.
+        *         KErrNotFound  if StartTag were not found.
+        */
+        IMPORT_C static TInt SearchStartTagL(const TDesC8& aDocument,
+                                             const TDesC8& aPrefix,
+                                             const TDesC8& aLocalName,
+                                             TInt& aStartTagStart,
+                                             TInt& aStartTagEnd);
+
+        /**
+        * Search EndTag from XML Document.
+        * Searching starts from the end of the given document.
+        *
+        * @since Series60 4.0
+        * @param aDocument      XML Document from which EndTag is
+        *                       searched.
+        * @param aLocalName     LocalName of EndTag to be searched.
+        * @param aEndTagStart   Reference to TInt which will contain
+        *                       value telling ending position of
+        *                       searched EndTag.
+        * @param aEndTagEnd     Reference to TInt which will contain
+        *                       value telling ending position of
+        *                       searched EndTag.
+        * @param aPrefix        Reference to TPtrC8 for which pointer
+        *                       of the Prefix of EndTag will be
+        *                       stored.
+        *                       Note: aPrefix points to given
+        *                             aDocument descriptor.
+        * @return KErrNone      if EndTag were found.
+        *         KErrNotFound  if EndTag were not found.
+        */
+        IMPORT_C static TInt SearchEndTagL(const TDesC8& aDocument,
+                                           const TDesC8& aLocalName,
+                                           TInt& aEndTagStart,
+                                           TInt& aEndTagEnd,
+                                           TPtrC8& aPrefix);
+
+        /**
+        * Search EndTag from XML Document.
+        * Searching starts from the end of the given document.
+        *
+        * @since Series60 4.0
+        * @param aDocument      Document from which EndTag is searched
+        * @param aPrefix        Prefix of EndTag to be searched.
+        * @param aLocalName     LocalName of EndTag to be searched.
+        * @param aEndTagStart   Reference to TInt which will contain
+        *                       value telling starting position of
+        *                       searched EndTag.
+        * @param aEndTagEnd     Reference to TInt which will contain
+        *                       value telling ending position of
+        *                       searched EndTag.
+        * @return KErrNone      if EndTag were found.
+        *         KErrNotFound  if EndTag were not found.
+        */
+        IMPORT_C static TInt SearchEndTagL(const TDesC8& aDocument,
+                                           const TDesC8& aPrefix,
+                                           const TDesC8& aLocalName,
+                                           TInt& aEndTagStart,
+                                           TInt& aEndTagEnd);
+
+
+    private:
+        static TInt SearchStartTagL(const TDesC8& aDocument,
+                                    const TDesC8& aLocalName,
+                                    TInt& aStartTagStart,
+                                    TInt& aStartTagEnd,
+                                    TPtrC8& aPrefix,
+                                    TBool aSearchPrefix);
+                                    
+        static TInt SearchEndTagL(const TDesC8& aDocument,
+                                  const TDesC8& aLocalName,
+                                  TInt& aEndTagStart,
+                                  TInt& aEndTagEnd,
+                                  TPtrC8& aPrefix,
+                                  TBool aSearchPrefix);
+                                  
+        static TInt SearchMarkStartingFromPlus(const TDesC8& aDocument,
+                                               const TDesC8& aMark,
+                                               TInt position,
+                                               TInt size);
+                                           
+        static TInt SearchMarkStartingFromMinus(const TDesC8& aDocument,
+                                                const TDesC8& aMark,
+                                                TInt position);
+                                           
+        static TInt SearchMatchingGreaterThanStartingFrom(const TDesC8& aDocument,
+                                                          TInt position,
+                                                          TInt size);
+                                           
+        static TInt SearchEndOfCommentStartingFrom(const TDesC8& aDocument,
+                                                   TInt position,
+                                                   TInt size);
+                                                   
+        static TInt SearchStartOfCommentStartingFrom(const TDesC8& aDocument,
+                                                     TInt position);
+
+        /**
+        * Hide default C++ constructor.
+        */
+        SenSaxUtils() { }
+
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        SenSaxUtils( const SenSaxUtils& );
+
+        /**
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        SenSaxUtils& operator=( const SenSaxUtils& );
+    };
+
+#endif // SEN_SAX_UTILS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senvtcptransportproperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,607 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_VTCP_TRANSPORT_PROPERTIES_H
+#define SEN_VTCP_TRANSPORT_PROPERTIES_H
+
+// INCLUDE
+#include <SenTransportProperties.h>
+
+
+// CONSTANTS
+_LIT8(KDeviceLCIDLocalName,              "DeviceLCID");
+_LIT8(KConnectionBoundLocalName,         "ConnectionBound");
+_LIT8(KConnectionTimeOutLocalName,       "ConnectionTimeOut");
+
+// CLASS DECLARATION
+class CSenVtcpTransportProperties : public CSenTransportProperties
+    {
+    public:
+                
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenVtcpTransportProperties class instance.
+        */
+        IMPORT_C static CSenVtcpTransportProperties* NewL();
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenVtcpTransportProperties class instance.
+        */
+        IMPORT_C static CSenVtcpTransportProperties* NewLC();
+
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenVtcpTransportProperties class instance.
+        */
+        IMPORT_C static CSenVtcpTransportProperties* NewL(const TDesC8& aXmlUtf8,
+                                                          CSenXmlReader& aParser);
+
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenVtcpTransportProperties class instance.
+        */
+        IMPORT_C static CSenVtcpTransportProperties* NewLC(const TDesC8& aXmlUtf8,
+                                                           CSenXmlReader& aParser);
+
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenVtcpTransportProperties class instance.
+        */
+        IMPORT_C static CSenVtcpTransportProperties* NewL(const CSenElement& aElement);
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenVtcpTransportProperties class instance.
+        */
+        IMPORT_C static CSenVtcpTransportProperties* NewLC(const CSenElement& aElement);
+
+        // From MSenProperties
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual TSenPropertiesClassType PropertiesClassType();
+        virtual void WriteToL(RWriteStream& aWriteStream);
+        virtual void ReadFromL(const TDesC8& aBuffer);
+        virtual HBufC8* AsUtf8L();
+        virtual HBufC8* AsUtf8LC();
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+        virtual MSenProperties* CloneL() const;
+        
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);        
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);        
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);
+
+       /**
+        * Gets the IAP ID.
+        * @param aCurrentIapId  A TUint32 reference to be filled in with the
+        *                       value of the IAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        virtual TInt IapIdL(TUint32& aCurrentIapId);
+
+        /**
+        * Sets the IAP ID.
+        * @param aIapId is the new IAP ID.
+        */
+        virtual void SetIapIdL(TUint32 aIapId);
+
+        /**
+        * Gets the Proxy Port.
+        * @param aProxyPort  A TInt reference to be filled in with the
+        *                    value of the Proxy Port.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyPortL(TInt& aProxyPort);
+
+        /**
+        * Sets the Proxy Port.
+        * @param aProxyPort is the new Proxy Port.
+        */
+        virtual void SetProxyPortL(TInt aProxyPort);
+
+        /**
+        * Gets the Proxy Host.
+        * @param aProxyHost  A TPtrC8 reference to be filled in with the
+        *                    value of the Proxy Host.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyHostL(TPtrC8& aProxyHost);
+
+        /**
+        * Sets the Proxy Host.
+        * @param aProxyHost is the new Proxy Host.
+        */
+        virtual void SetProxyHostL(const TDesC8& aProxyHost);
+        
+        /**
+        * Gets the Proxy Usage flag.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the Proxy Usage.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyUsageL(TBool& aProxyUsage);
+
+        /**
+        * Sets the Proxy Usage flag.
+        * @param aProxyUsage is the new value for Proxy Usage.
+        */
+        virtual void SetProxyUsageL(TBool aProxyUsage);
+
+        /**
+        * Gets the information if SecureDialog is shown or not.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the SecureDialog flag.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SecureDialogL(TBool& aSecureDialog);
+
+        /**
+        * Sets the flag which controls showing of SecureDialog.
+        * @param aSecureDialog is the new value for SecureDialog flag.
+        */
+        virtual void SetSecureDialogL(TBool aSecureDialog);
+
+        /**
+        * Gets the UserAgent.
+        * @param aUserAgent  A TPtrC8 reference to be filled in with the
+        *                    value of the UserAgent.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt UserAgentL(TPtrC8& aUserAgent);
+        
+        /**
+        * Sets the UserAgent.
+        * @param aUserAgent is the new User Agent.
+        */
+        virtual void SetUserAgentL(const TDesC8& aUserAgent);
+
+
+        /**
+        * Gets the device ID
+        * @param aDeviceID  A TPtrC8 reference to be filled in with the
+        *                    value of the Device ID.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DeviceIDL(TPtrC8& aDeviceID);
+
+        /**
+        * Sets the Device ID.
+        * @param aDeviceID is the new Device ID.
+        */
+        virtual void SetDeviceIDL(const TDesC8& aDeviceID);
+
+        /**
+        * Gets the Action of message
+        * @param aAction A TPtrC8 reference to be filled in with the
+        *                    value of the Action.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SoapActionL(TPtrC8& aAction);
+        
+        /**
+        * Sets the Action.
+        * @param aAction is the new Soap Action.
+        */
+        virtual void SetSoapActionL(const TDesC8& aAction);
+
+        /**
+        * Apply binding.
+        * @param aSoapVersion is the version of Soap (1.1 or 1.2).
+        */
+        virtual void ApplyBindingL(TSOAPVersion aSoapVersion);
+
+        /**
+        * Gets the device LCID
+        * @param aDeviceLCID  A TPtrC8 reference to be filled in with the
+        *                    value of the Device LCID.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DeviceLCIDL(TPtrC8& aDeviceLCID);
+        
+        /**
+        * Sets the Device LCID.
+        * @param aDeviceLCID is the new Device LCID.
+        */
+        virtual void SetDeviceLCIDL(const TDesC8& aDeviceLCID);
+        
+        /**
+        * Gets connection bound mode
+        * @param aConnectionBound  A boolean reference used to return the
+        *                    connection value (ETrue if bounded).
+        *                    With virtual TCP, default is EFalse 
+        *                    (unbound == persistant connection).
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ConnectionBoundL(TBool& aConnectionBound);
+        
+        /**
+        * Sets the connection bound mode.
+        * @param aConnectionBound is the connection bound mode
+        */
+        virtual void SetConnectionBoundL(const TBool& aConnectionBound);
+
+        /**
+        * Gets virtual connection timeout
+        * @param aConnectionTimeOut  A TPtrC8 reference to be filled in with the
+        *                    value of the connection time out
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ConnectionTimeOutL(TInt& aConnectionTimeOut);
+        
+        /**
+        * Sets the connection time out
+        * @param aConnectionTimeOut is the connection time out
+        */
+        virtual void SetConnectionTimeOutL(const TInt& aConnectionTimeOut);
+       
+        /**
+        * Gets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
+        *                    value of the shared, public folder for downloaded 
+        *                    content
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
+        
+        /**
+        * Sets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - shared, public folder for downloaded content
+        */
+        virtual void SetDownloadFolderL(const TDesC8& aDownloadFolder);
+
+        /**
+        * Gets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
+        
+        /**
+        * Sets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName);
+
+        /**
+        * Gets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace 
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
+        
+        /**
+        * Sets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual void SetMwsNamespaceL(const TDesC8& aMwsNamespace);
+
+        /**
+        * Gets message ID
+        * @param aMessageId - is the id of the message
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt MessageIdL(TPtrC8& aMessageId);
+
+        /**
+        * Sets message ID. Typically, this property is set per each message, instead of
+        * applying the same message ID for whole consumer session (service connection)
+        * @param aMessageID - is the ID of the message
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual void SetMessageIdL(const TDesC8& aMessageId);
+
+        /**
+        * Gets one-way message mode.
+        * @param aOnewayMsgOnOff A TBool reference to be filled in with the
+        *                    value of the one-way message mode.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt OnewayMessageOnOffL(TBool& aOnewayMessageOnOff);
+
+        /**
+        * Sets the one-way message mode on/off. Typically, one-way
+        * messages are rarely used by default: instead, a request-
+        * response pair (consumer[request]<->[response]provider)
+        * transaction takes place.
+        * However, if one-way message mode is enabled, sending such
+        * message will typically result immediate callback from
+        * the transport (plug-in) itself. This means, that the
+        * actual service response from the provider is not being
+        * waited. 
+        * Common use case to enable one-way message is when service
+        * connection is used in transmitting *responses* to notification
+        * request(s) that some remote consumer (from outside device) has 
+        * sent earlier.
+        * Such notification requests may thus be received via hostlet 
+        * connection (hc), and by enabling one-way message, once can reply
+        * via service connection, instead of calling hc->RespondL method.
+        * Furthermore, application might wish to enable one-way message
+        * mode to hostlet connection, if it is not interested of replying
+        * to these two-way notifications via hostlet connection, but wishes
+        * to use service connection instead.
+        * @param aOnewayMessageOnOff is the new value of one-way message mode.
+        */
+        IMPORT_C virtual void SetOnewayMessageOnOffL(TBool aOnewayMessageOnOff);
+
+
+       /**
+        * Destructor.
+        */
+        virtual ~CSenVtcpTransportProperties();
+
+    protected: // base class functions
+
+        virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const CSenElement& aElement);
+
+
+    public: // Extensions
+      
+      
+      
+        /**
+        * Gets the (connection) heartbeat property value as int.
+        * @param aDelta     A TInt reference to be filled in with the
+        *                       value of the heartbeat (in seconds).
+        *                       Positive value means that a heartbeat
+        *                       messages are sent to backend, keeping
+        *                       the socket connection open (longlived
+        *                       connection). Keeping heartbeat may be
+        *                       costy, but increases performance in
+        *                       scenarios, where multiple network
+        *                       transactions take place within short
+        *                       period (time window).
+        * @return             KErrNone if no error, or some of the system
+        *                       wide error codes.
+        *                     KErrNotFound if shortlive connection defined
+        */
+        virtual TInt HeartbeatL(TInt& aDelta);
+
+
+        /**
+        * Sets the (connection) heartbeat property value as int.
+        * Note, that with some transports, like vTCP, the heartbeat
+        * can also be used to control connection modes (longlive
+        * vs. shortlive connection). 
+        * Hertbeat value is called also as delta.
+        * 
+        * Together with delta You can also set parameters Min & Max TTL
+        * Long and short connection is set in different way, below guider.
+        *
+        * To setup longlive connection:
+        *   delta   : user defined
+        *   min TTL : If not specified then the default value of 90 sec will be used
+        *   max TTL : If not specified then the default value 1800 sec will be used
+        *
+        * To setup shortlive connection:
+        *   delta   : -1
+        *   min TTL : If not specified then the default value of 90 sec will be used
+        *   max TTL : ignored
+        *
+        * So, providing a negative value
+        * (-1) can be utilized to disable heartbeat and to switch
+        * the connection mode to a short lived state. With vTCP
+        * transport, if heartbeat of -1 is set, the socket will be
+        * kept open only for effective timeout value (shortlived), 
+        * 
+        * @param aDelta    TInt reference to be filled in with 
+        *                      the value of the heartbeat (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                      wide error codes.
+        */
+        virtual TInt SetHeartbeatL(TInt aDelta);
+        
+        /**
+        * Sets the (connection) Max TTL for longlive connection.
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the max TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SetMaxTimeToLiveL(TInt aMaxTTL);
+        
+        /**
+        * Gets the (connection) max TTL property value as int.
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMaxTTL       A TInt reference to be filled in with the
+        *                       value of the max TTL (in seconds).
+        *
+        * @return           KErrNotFound if shortlive connection defined
+        *                   KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt MaxTimeToLiveL(TInt& aMaxTTL);
+
+        /**
+        * Sets the (connection) Min TTL
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the min TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SetMinTimeToLiveL(TInt aMinTTL);
+
+        /**
+        * Gets the (connection) min TTL property value as int.
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMinTTL     A TInt reference to be filled in with the
+        *                       value of the min TTL (in seconds).
+        *
+        * @return           KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt MinTimeToLiveL(TInt& aMinTTL);
+
+	public:
+        /**
+        * Sets the SNAP ID.
+        * @param aSnapId is the new SNAP ID.
+        */
+		virtual void SetSnapIdL(TUint32 aSnapId);
+
+       /**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+       	virtual TInt SnapIdL(TUint32& aCurrentSnapId);	
+    /**
+        * Sets the (LongLived Retry) Long Lived Retry property value as int.
+        * Note, that with some transports, like vTCP, the RetryMaxTTL
+        * can also be used to control only long lived connection retry modes 
+        * RetryMaxTTL value is called also as delta.
+        * Together with delta You can also set parameters RetryMinTTL & RetryMaxTTL
+        * Long and short connection is set in different way, below guider.
+        * @param aDelta    TInt reference to be filled in with 
+        *                      the value of the RetryMaxTTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                      wide error codes.
+        */
+        IMPORT_C virtual TInt SetMaxRetryTTLL(TInt aMaxRetryTTL);
+        
+	    /**
+        * Gets the (Long Lived Retry)RetryMaxTTL property value as int.
+        * @param aDelta     A TInt reference to be filled in with the
+        *                       value of the RetryMaxTTL (in seconds).
+        *                       Positive value means that a RetryMaxTTL
+        *                       messages are sent to backend, keeping
+        *                       the socket connection open (longlived
+        *                       connection). Keeping RetryMaxTTL may be
+        *                       costy, but increases performance in
+        *                       scenarios, where multiple network
+        *                       transactions take place within short
+        *                       period (time window).
+        * @return             KErrNone if no error, or some of the system
+        *                       wide error codes.
+        *                     KErrNotFound if shortlive connection defined
+        */
+        IMPORT_C virtual TInt MaxRetryTTLL(TInt& aMaxRetryTTL);
+        
+        
+		/**
+        * Sets the (LongLived Retry) RetryDelta
+        *
+        * @see SetMaxRetryTTLL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the min TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+ 		IMPORT_C virtual TInt SetRetryDeltaTimeoutL(TInt aTimeout);
+ 		
+		/**
+        * Gets the (LongLived Retry) RetryDelta
+        *
+        * @see SetMaxRetryTTLL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the min TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt RetryDeltaTimeoutL(TInt& aTimeout);
+        
+		/**
+        * Sets the (LongLived Retry) RetryMinTTL
+        *
+        * @see SetMaxRetryTTLL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the min TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SetMinRetryTTLL(TInt aMinRetryTTL);
+        
+		/**
+        * Gets the (LongLived Retry) RetryMinTTL
+        *
+        * @see SetMaxRetryTTLL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the min TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt MinRetryTTLL(TInt& aMinRetryTTL);
+
+    protected:
+        /**
+        * Constructor.
+        */
+        CSenVtcpTransportProperties();
+    };
+
+#endif // SEN_VTCP_TRANSPORT_PROPERTIES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/inc/senwsaepr.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_WSAEPR_H
+#define SEN_WSAEPR_H
+
+#include "SenBaseFragment.h"
+
+namespace
+    {
+    _LIT8(KName, "EndpointReference");
+    _LIT8(KNsPrefix, "wsa");
+
+    // Note: below value is from editor's draft of WS-A spec. 
+
+    _LIT8(KMessageIdNs, "http://www.w3.org/2005/03/addressing") ;
+    }
+
+
+class CSenWsaMessageId : public CSenBaseFragment
+    {
+    /*
+    public:
+
+        IMPORT_C static CSenWsaMessageId* NewL();
+
+        IMPORT_C virtual ~CSenWsaMessageId();
+
+    public:
+
+        IMPORT_C virtual TPtrC8 MessageId();
+
+    private: // Data
+        HBufC8* ipMessageId;         // Owned
+    */
+    };
+
+#endif // WSA_MESSAGEID_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/rom/wsutils.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSUTILS_IBY__
+#define __WSUTILS_IBY__
+
+// Utils
+file=ABI_DIR\BUILD_DIR\SenUtils.dll             SHARED_LIB_DIR\SenUtils.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senattribute.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include "senattribute.h"
+
+#include "senlogger.h"
+
+
+//#ifdef _SENDEBUG
+// // CONSTATS for file logging
+//namespace
+//    {
+//    _LIT(KLogFileDir, "SenUtils");
+//    _LIT(KLogFileName, "SenAttribute.log"); 
+//    }
+//#endif // _SENDEBUG
+
+EXPORT_C CSenAttribute* CSenAttribute::NewL(const TDesC8& aName,
+                                            const TDesC8& aType,
+                                            const TDesC8& aValue,
+                                            const TDesC8& aFriendlyName)
+    {
+    CSenAttribute* pNew = new (ELeave) CSenAttribute;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aName, aType, aValue, aFriendlyName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenAttribute* CSenAttribute::NewL(const TDesC8& aName,
+                                            const TDesC8& aType,
+                                            const TDesC8& aValue)
+    {
+    CSenAttribute* pNew = new (ELeave) CSenAttribute;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aName, aType, aValue, KNullDesC8());
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenAttribute::~CSenAttribute()
+    {
+    delete ipName;
+    delete ipType;
+    delete ipFriendlyName;
+    iValues.ResetAndDestroy();
+
+//    // Close the log file and the connection to the server.
+//    LOG_WRITE((_L("Log file closed.")));
+//    LOG_CLOSELOG;
+//    LOG_CLOSE;
+    }
+
+EXPORT_C CSenAttribute::CSenAttribute()
+    {
+    }
+
+
+EXPORT_C void CSenAttribute::ConstructL(const TDesC8& aName,
+                                        const TDesC8& aType,
+                                        const TDesC8& aValue,
+                                        const TDesC8& aFriendlyName)
+    {
+//    LOG_CONNECT;
+//    LOG_CREATELOG((KLogFileDir, KLogFileName, EFileLoggingModeOverwrite));
+//    LOG_WRITE(( _L8("CSenAttribute::ConstructL(): Log opened") ));
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenAttribute::ConstructL(): Start");
+    ipName = aName.AllocL() ;
+    ipType = aType.AllocL() ;
+    iValues.Append(aValue.AllocL());
+    // If the friendly nameparam isn't set, then don't set the owned value
+    ipFriendlyName = aFriendlyName.AllocL() ;
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenAttribute::ConstructL(): End");
+    }
+
+
+EXPORT_C TPtrC8 CSenAttribute::Name() const
+    {
+    if ( ipName == NULL )
+        {
+        return KNullDesC8();
+        } else
+        {
+        return *ipName;
+        }
+    }
+
+
+EXPORT_C TPtrC8 CSenAttribute::Value() const
+    {
+    if ( 0 == iValues.Count() )
+        {
+        return KNullDesC8();
+        } else
+        {
+        return *iValues[0];
+        }
+    }
+
+
+EXPORT_C TPtrC8 CSenAttribute::Type() const
+    {
+    if ( ipType == NULL )
+        {
+        return KNullDesC8();
+        } else
+        {
+        return *ipType;
+        }
+    }
+
+
+EXPORT_C TPtrC8 CSenAttribute::FriendlyName() const
+    {
+    if ( ipFriendlyName == NULL )
+        {
+        return KNullDesC8();
+        } else
+        {
+        return *ipFriendlyName;
+        }
+    }
+
+
+EXPORT_C void CSenAttribute::SetValueL(const TDesC8& aValue)	//codescannerwarnings
+    {
+    iValues.ResetAndDestroy();
+    iValues.Append(aValue.AllocL());
+    }
+
+
+EXPORT_C void CSenAttribute::AddValueL(const TDesC8& aValue)	//codescannerwarnings
+    {
+    iValues.Append(aValue.AllocL());
+    }
+
+
+EXPORT_C const RAttrValueArray CSenAttribute::GetValues() const
+    {
+    return iValues;
+    }
+
+
+EXPORT_C TInt CSenAttribute::NumValues() const
+    {
+    return iValues.Count();
+    }
+
+
+EXPORT_C TBool CSenAttribute::Equals(const CSenAttribute& aAttr) const
+    {
+    if ( 0 != aAttr.Name().Compare(*ipName) ) return EFalse;
+    if ( 0 != aAttr.Type().Compare(*ipType) ) return EFalse;
+    if ( 0 != aAttr.FriendlyName().Compare(*ipFriendlyName) ) return EFalse;
+
+    TInt count = iValues.Count();
+    if ( count != aAttr.NumValues() ) return EFalse;
+
+    RAttrValueArray thatValues = aAttr.GetValues();
+    TBool ret = ETrue;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( EFalse == ret ) break;
+        ret = EFalse;
+        for ( TInt ii = 0; ii < count; ii++ )
+            {
+            if ( 0 == iValues[i]->Compare(*thatValues[ii]) )
+                {
+                ret = ETrue;
+                break;
+                }
+            }
+        }
+    return ret;
+    }
+
+
+//RFileLogger* CSenAttribute::Log() const
+//    {
+//    return(RFileLogger*) &iLog;
+//    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senattributes.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include "senattributes.h"
+
+#include "sendebug.h"
+#include "senlogger.h"
+
+
+EXPORT_C CSenAttributes* CSenAttributes::NewL()
+    {
+    CSenAttributes* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenAttributes* CSenAttributes::NewLC()
+    {
+    CSenAttributes* self = new (ELeave) CSenAttributes();
+    CleanupStack::PushL(self);
+    self->BaseConstructL();
+    return self;
+    }
+
+EXPORT_C CSenAttributes* CSenAttributes::NewL(const CSenAttributes& aAttributes)
+    {
+    CSenAttributes* self = NewLC(aAttributes);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenAttributes* CSenAttributes::NewLC(const CSenAttributes& aAttributes)
+    {
+    CSenAttributes* self = new (ELeave) CSenAttributes();
+    CleanupStack::PushL(self);
+    self->BaseConstructL(aAttributes);
+    return self;
+    }
+
+void CSenAttributes::BaseConstructL()
+    {
+    TLSLOG_OPEN(KSenUtilsLogChannel,KSenUtilsLogLevel,KSenUtils,KSenUtilsLog);
+    TLSLOG_L(KSenUtilsLogChannel,KMinLogLevel ,"CSenAttributes::BaseConstructL(): Log opened");
+    TLSLOG_L(KSenUtilsLogChannel,KMinLogLevel ,"CSenAttributes::BaseConstructL(): End");
+    }
+
+void CSenAttributes::BaseConstructL(const CSenAttributes& aAttributes)
+    {
+    TLSLOG_OPEN(KSenUtilsLogChannel,KSenUtilsLogLevel,KSenUtils,KSenUtilsLog);
+    TLSLOG_L(KSenUtilsLogChannel,KMinLogLevel ,"CSenAttributes::BaseConstructL(): Log opened");
+    TLSLOG_L(KSenUtilsLogChannel,KMinLogLevel ,"CSenAttributes::BaseConstructL(): End");
+
+    TInt error(KErrNone);
+    for (TInt i = 0; i<aAttributes.Count(); i++)
+        {
+        error = iAttrList.Append( ((CSenAttributes&)aAttributes).iAttrList.KeyAt(i),
+                                  ((CSenAttributes&)aAttributes).iAttrList.ValueAt(i));
+        if(error!=KErrNone)
+            {
+            iAttrList.Reset();
+            User::Leave(error);
+            }
+        }
+    }
+
+
+CSenAttributes::CSenAttributes() : 
+    iAttrList(ETrue, EFalse)
+    {
+    }
+
+
+EXPORT_C CSenAttributes::~CSenAttributes()
+    {
+    iAttrList.Reset();
+
+    // Close the log file and the connection to the server.
+    TLSLOG(KSenUtilsLogChannel,KMinLogLevel,(_L("Log file closed.")));
+    TLSLOG_CLOSE(KSenUtilsLogChannel);
+    }
+
+
+EXPORT_C void CSenAttributes::AddAttributeL(const CSenAttribute& aValue)	//codescannerwarnings
+    {
+    TPtrC8 name = aValue.Name();
+    if ( KErrNotFound != iAttrList.Find(name) )
+        {
+        // Replace, if attribute exists
+        iAttrList.RemoveByKey(name);
+        }
+    iAttrList.Append(name.AllocL(),&aValue);
+    }
+
+
+EXPORT_C const CSenAttribute& CSenAttributes::GetAttribute(const TDesC8& aName) const
+    {
+    TInt index = iAttrList.Find(aName);
+    return *(iAttrList.ValueAt(index));
+    }
+
+
+EXPORT_C TInt CSenAttributes::Count() const
+    {
+    return iAttrList.Count();
+    }
+
+
+EXPORT_C TBool CSenAttributes::Equals(const CSenAttribute& aValue) const
+    {
+    return GetAttribute(aValue.Name()).Equals(aValue);
+    }
+
+
+EXPORT_C TBool CSenAttributes::MatchAny(const CSenAttributes& aAttrs)
+    {
+    for ( TInt i = 0; i < aAttrs.Count(); i++ )
+        {
+        for ( TInt ii = 0; ii < iAttrList.Count(); ii++ )
+            {
+            if ( 0 == aAttrs.AttributeAt(i).Equals(*(iAttrList.ValueAt(ii))) )
+                {
+                return(ETrue);
+                }
+            }
+        }
+    return EFalse;
+    }
+
+
+const CSenAttribute& CSenAttributes::AttributeAt(TInt aIndex) const
+    {
+    return *(iAttrList.ValueAt(aIndex));
+    }
+
+/*
+RFileLogger* CSenAttributes::Log() const
+    {
+    return(RFileLogger*) &iLog;
+    }
+
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sencertutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include "sencertutils.h"
+#include <ssl.h>
+
+EXPORT_C HBufC8* SenCertUtils::CertInfoToStringLC(const TCertInfo& aCertInfo)
+    {
+    //
+    // Convert TCertInfo to TDesC8
+    //
+    TInt certLength = aCertInfo.iIssuerDNInfo.iCountry.Length();
+    certLength += aCertInfo.iIssuerDNInfo.iOrganizationUnit.Length();
+    certLength += aCertInfo.iIssuerDNInfo.iOrganization.Length();
+    certLength += aCertInfo.iIssuerDNInfo.iCommonName.Length();
+    certLength += aCertInfo.iSerialNo.Length() * 2;
+    certLength += aCertInfo.iFingerprint.Length() * 2;
+    
+    HBufC8* casn = HBufC8::NewLC( certLength + 4);
+    TPtr8 ptr = casn->Des();
+
+    
+    if ( aCertInfo.iIssuerDNInfo.iCommonName.Length())
+        {
+        ptr.Append( aCertInfo.iIssuerDNInfo.iCommonName);
+        ptr.Append( KSenCASNDelimiter );
+        }
+    
+    if ( aCertInfo.iIssuerDNInfo.iOrganization.Length())
+        {
+        ptr.Append( aCertInfo.iIssuerDNInfo.iOrganization);
+        ptr.Append( KSenCASNDelimiter );
+        }
+    
+    if ( aCertInfo.iIssuerDNInfo.iOrganizationUnit.Length())
+        {
+        ptr.Append( aCertInfo.iIssuerDNInfo.iOrganizationUnit);
+        ptr.Append( KSenCASNDelimiter );
+        }
+    
+    if ( aCertInfo.iIssuerDNInfo.iCountry.Length())
+        {
+        ptr.Append( aCertInfo.iIssuerDNInfo.iCountry);
+        ptr.Append( KSenCASNDelimiter );
+        }
+    
+    if ( aCertInfo.iSerialNo.Length())
+        {
+        //convert serialnumber to plain text
+        for ( TInt i(0); i < aCertInfo.iSerialNo.Length(); i++)
+            {
+            ptr.AppendNum( aCertInfo.iSerialNo[i], EHex);
+            }   
+        ptr.Append( KSenCASNDelimiter );
+        }
+
+    if ( aCertInfo.iFingerprint.Length())
+        {
+        //convert fingerprint to plain text
+        for ( TInt i(0); i < aCertInfo.iFingerprint.Length(); i++)
+            {
+            ptr.AppendNum( aCertInfo.iFingerprint[i], EHex);
+            }   
+        }   
+    return casn;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senchunk.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,474 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#include "senchunk.h"
+#include "sendebug.h" // internal Utils\inc - filelogging MACROs
+#include "senlogger.h"
+
+const TInt KSenChunkFourByteAlignment = 4;
+
+EXPORT_C CSenChunk* CSenChunk::NewL(const TDesC& aChunkName)
+    {
+    CSenChunk* pOperation = NewLC(aChunkName);
+    CleanupStack::Pop();
+    return pOperation;
+    }
+
+EXPORT_C CSenChunk* CSenChunk::NewLC(const TDesC& aChunkName)
+    {
+    CSenChunk* pOperation = new (ELeave) CSenChunk;
+    CleanupStack::PushL(pOperation);
+    pOperation->ConstructL(aChunkName);
+    return pOperation;
+    }
+
+void CSenChunk::ConstructL(const TDesC& aChunkName)
+    {
+    if (aChunkName.Length() > 0)
+        {
+        ipChunkName = aChunkName.AllocL();
+        }
+    else
+        {
+        ipChunkName = NULL;
+        }
+    }
+
+EXPORT_C CSenChunk::CSenChunk() :
+    ipChunkName(NULL)
+    {
+    }
+
+EXPORT_C CSenChunk::~CSenChunk()
+    {
+    CloseChunk();
+    delete ipChunkName;
+    }
+
+EXPORT_C RChunk& CSenChunk::Chunk()
+    {
+    return iChunk;
+    }
+
+EXPORT_C TPtrC CSenChunk::ChunkName() const
+    {
+    if(ipChunkName)
+        {
+        return *ipChunkName;
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+EXPORT_C TBool CSenChunk::operator==(const CSenChunk& a)
+    {
+    return (this==&a);
+    }
+
+EXPORT_C TInt CSenChunk::CreateChunk()
+    {
+    TInt retVal(KErrNone);
+#ifdef EKA2
+    // Create protected global chunk in EKA2
+    // (Global chunk will be protected chunk when chunk name length is zero)
+    retVal = iChunk.CreateGlobal(KNullDesC, KSenMinRChunkSize, KSenMaxRChunkSize);
+#else // EKA1
+    // Create named global chunk in EKA1
+    retVal = iChunk.CreateGlobal(*ipChunkName, KSenMinRChunkSize, KSenMaxRChunkSize);
+#ifdef _SENDEBUG
+        TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- RChunk.CreateGlobal('%S', %d, %d) returned: %d"),
+                ipChunkName,
+                KSenMinRChunkSize,
+                KSenMinRChunkSize,
+                retVal));
+#endif // _SENDEBUG
+#endif // EKA2/EKA1
+    if (retVal == KErrNone)
+        {
+        TUint8* heapPtr = iChunk.Base();
+        // Create header in the beginning of the chunk
+        TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("CSenChunk::CreateChunk KHeaderOffset size: (%d)"), KHeaderOffset));        
+        new (heapPtr+KHeaderOffset) TChunkHeader;
+        TChunkHeader& header = ChunkHeader();
+        header.SetDescriptorCount(0);
+        header.SetMessageType(MSenMessage::EMessageBase);
+        header.SetMessageDirection(MSenMessage::EOutbound);
+        header.SetPropertiesType(MSenProperties::ENotInUse);
+        header.SetDoInitBeforeSending(EFalse);
+        header.SetTransactionId(0);
+        header.SetPendingTransactionId(0);
+        }
+    return retVal;
+    }
+    
+EXPORT_C TInt CSenChunk::OpenChunk()
+    {
+    TInt retVal(KErrNone);
+#ifdef EKA2
+    retVal = KErrNotSupported;
+#else // EKA1
+    // Open named global chunk in EKA1
+    retVal = iChunk.OpenGlobal(*ipChunkName, EFalse); 
+#ifdef _SENDEBUG
+        TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- RChunk.OpenGlobal() returned %d"), retVal));
+#endif // _SENDEBUG
+#endif // EKA2/EKA1
+    return retVal;
+    }
+    
+EXPORT_C TInt CSenChunk::OpenChunkFromRMsgL(const RMessage2& aMessage, TInt aIndex)
+    {
+    TInt retVal(KErrNone);
+#ifdef EKA2 // // EKA2
+    retVal = iChunk.Open(aMessage, aIndex, EOwnerProcess);
+#else // EKA1
+    HBufC* pChunkName = HBufC::NewLC(KMaxName);
+    TPtr chunkname = pChunkName->Des();
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, retVal = aMessage.Read(aIndex, chunkname); )
+
+    if(retVal==KErrNone && leaveCode != KErrNone)
+        {
+#ifdef _SENDEBUG
+            TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("- aMessage.Read(aIndex, chunkname) leaved: %d"), leaveCode ));
+#endif // _SENDEBUG
+        retVal = leaveCode;
+        }
+        
+    ipChunkName = chunkname.AllocL();
+    CleanupStack::PopAndDestroy(pChunkName);
+
+#ifdef _SENDEBUG
+    if (ipChunkName->Length() > 0 )
+        {
+        TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- RChunk name from RMessage2: '%S'"), ipChunkName ));
+        }
+#endif // _SENDEBUG
+
+    if(retVal==KErrNone)
+        {
+        retVal = iChunk.OpenGlobal(*ipChunkName, EFalse); 
+#ifdef _SENDEBUG
+             TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- RChunk.OpenGlobal() returned %d"), retVal));
+#endif // _SENDEBUG
+        }    
+#endif // EKA2/EKA1
+    return retVal;
+    }
+
+EXPORT_C TInt CSenChunk::OpenChunkFromHandleNumberL(TInt aHandleOrError)
+    {
+    TInt retVal(KErrNone);
+#ifdef EKA2 // // EKA2
+    retVal = iChunk.SetReturnedHandle(aHandleOrError);
+#else // EKA1
+    iChunk.SetHandle(aHandleOrError);
+#endif // EKA2/EKA1
+    return retVal;
+    }
+    
+EXPORT_C void CSenChunk::CloseChunk()
+    {
+#ifdef _SENDEBUG
+        TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("CSenChunk::CloseChunk - handle: %d"), iChunk.Handle()));
+#endif // _SENDEBUG
+
+    THandleInfo chunkInfo;
+    iChunk.HandleInfo(&chunkInfo);
+#ifdef _SENDEBUG
+        TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- Before Close(): TChunkInfo: numOpenInThread: %d, numOpenInProcess: %d, numProcesses: %d"),
+            chunkInfo.iNumOpenInThread,
+            chunkInfo.iNumOpenInProcess,
+            chunkInfo.iNumProcesses));
+#endif // _SENDEBUG
+
+    iChunk.Close();
+    }
+    
+EXPORT_C TInt CSenChunk::AdjustChunk(TInt aNewSize)
+    {
+    // Ensure that at least 10064 bytes are allocated:
+    if(aNewSize<KSenMinRChunkSize)
+        {
+        aNewSize = KSenMinRChunkSize;
+        }
+    TInt retVal = iChunk.Adjust(aNewSize);
+    TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("CSenChunk::AdjustChunk returns: (%d)"), retVal));
+    return retVal;
+    }
+
+EXPORT_C TChunkHeader& CSenChunk::ChunkHeader()
+    {
+    return *reinterpret_cast<TChunkHeader*>(iChunk.Base()+KHeaderOffset);
+    }
+
+EXPORT_C TInt CSenChunk::DescToChunk(const TDesC8& aDescriptor)
+    {
+    TInt retVal(KErrNone);
+
+    TInt size(aDescriptor.Length()+sizeof(TPtr8)+KSenChunkFourByteAlignment+KDataOffset);
+
+    retVal = AdjustChunk(size);
+
+    if(retVal == KErrNone)
+        {
+        TUint8* heapPtr = iChunk.Base();
+        TChunkHeader& header = ChunkHeader();
+        header.SetDescriptorCount(1);
+        heapPtr += KDataOffset;
+        heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+        // Place a new descriptor in the chunk to initialize it
+        new (heapPtr) TPtr8(heapPtr + sizeof(TPtr8), 0, aDescriptor.Length());
+        // Set the descriptor
+        TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr);
+        pDes->Zero();
+        pDes->Append(aDescriptor);
+        }
+    return retVal;
+    }
+EXPORT_C TInt CSenChunk::DescToChunk(const TDesC8& aDescriptor, TInt aIndex)
+    {
+#ifdef _SENDEBUG
+        TLSLOG_L(KSenUtilsLogChannel,KMinLogLevel ,"CSenChunk::DescFromChunk");
+#endif // _SENDEBUG
+    TInt retVal(KErrNone);
+    
+    if ( iChunk.Handle() > KErrNone )
+        {
+        TInt maxPtr = iChunk.Size();
+
+        TInt size(aDescriptor.Length()+sizeof(TPtr8)+(aIndex+1)*KSenChunkFourByteAlignment);
+        retVal = AdjustChunk(maxPtr+size);
+        
+        TChunkHeader& header = *reinterpret_cast<TChunkHeader*>(iChunk.Base() + KHeaderOffset);
+        
+        if ( aIndex <= header.DescriptorCount() )
+            {
+            header.SetDescriptorCount(aIndex+1);
+            
+            TUint8* heapPtr = iChunk.Base();
+            heapPtr += KDataOffset;
+            heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+            TPtr8* pDesc;
+            pDesc = reinterpret_cast<TPtr8*>(heapPtr);
+            for (TInt i=1; i < aIndex; i++)
+                {
+                heapPtr += (sizeof(TPtr8) + pDesc->MaxLength());
+                heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+                pDesc = reinterpret_cast<TPtr8*>(heapPtr);
+                }
+            heapPtr += (sizeof(TPtr8) + pDesc->MaxLength());
+            heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+            
+            // Place a new descriptor in the chunk to initialize it
+            new (heapPtr) TPtr8(heapPtr + sizeof(TPtr8), 0, aDescriptor.Length());
+            // Set the descriptor
+            pDesc = reinterpret_cast<TPtr8*>(heapPtr);
+            pDesc->Zero();
+            pDesc->Append(aDescriptor);
+            }
+        else
+            {
+            retVal = KErrNotFound;
+            }
+        }
+    else
+        {
+        retVal = KErrBadHandle;
+#ifdef _SENDEBUG
+            TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("CSenChunk::DescFromChunk(chunk), RChunk.Handle(): %d is an error!"),
+                iChunk.Handle()));
+#endif // _SENDEBUG
+        }
+        
+    return retVal;
+    }
+    
+EXPORT_C TInt CSenChunk::AllocDescToChunk(TInt size, TPtr8*& apAllocated)
+    {
+    TInt retVal(KErrNone);
+    
+    retVal = AdjustChunk(size+KSenChunkFourByteAlignment);
+    
+    if(retVal == KErrNone)
+        {
+        TUint8* heapPtr = iChunk.Base();
+        TChunkHeader& header = ChunkHeader();
+        header.SetDescriptorCount(1);
+        heapPtr += KDataOffset;
+        heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+        // Place a new descriptor in the chunk to initialize it
+        new (heapPtr) TPtr8(heapPtr + sizeof(TPtr8), 0, size);
+        // Set the descriptor
+        apAllocated = reinterpret_cast<TPtr8*>(heapPtr);
+        apAllocated->Zero();
+        }
+    return retVal;    
+    }
+
+EXPORT_C TInt CSenChunk::DescsToChunk(const TDesC8& aDescriptor1,
+                                   const TDesC8& aDescriptor2)
+    {
+TInt retVal(KErrNone);
+
+    TInt size(KDataOffset+aDescriptor1.Length()+aDescriptor2.Length()+\
+              2*sizeof(TPtr8)+2*KSenChunkFourByteAlignment); 
+
+    retVal = AdjustChunk(size);
+
+    if(retVal == KErrNone)
+        {
+        TUint8* heapPtr = iChunk.Base();
+        TChunkHeader& header = ChunkHeader();
+        header.SetDescriptorCount(2);
+        heapPtr += KDataOffset;
+        heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+        // Place a new descriptor in the chunk to initialize it
+        new (heapPtr) TPtr8(heapPtr + sizeof(TPtr8), 0, aDescriptor1.Length());
+        // Set the descriptor
+        TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr);
+        pDes->Zero();
+        pDes->Append(aDescriptor1);
+
+        heapPtr = heapPtr + sizeof(TPtr8) + aDescriptor1.Length();
+        heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+        // Place a new descriptor in the chunk to initialize it
+        new (heapPtr) TPtr8(heapPtr + sizeof(TPtr8), 0, aDescriptor2.Length());
+        // Set the descriptor
+        pDes = reinterpret_cast<TPtr8*>(heapPtr);
+        pDes->Zero();
+        pDes->Append(aDescriptor2);
+        }
+    return retVal;
+
+    }
+
+EXPORT_C TInt CSenChunk::DescFromChunk(TPtrC8& aDesc, TInt aIndex)
+    {
+#ifdef _SENDEBUG
+        TLSLOG_L(KSenUtilsLogChannel,KMinLogLevel ,"CSenChunk::DescFromChunk");
+#endif // _SENDEBUG
+    TInt retVal(KErrNone);
+    
+    if(iChunk.Handle()>KErrNone)
+        {
+        TChunkHeader& header = *reinterpret_cast<TChunkHeader*>(iChunk.Base() + KHeaderOffset);
+        
+        if (aIndex < header.DescriptorCount() && aIndex >= 0)
+            {
+            TUint8* heapPtr = iChunk.Base();
+            heapPtr += KDataOffset;
+            heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+            TPtr8* pDesc;
+            pDesc = reinterpret_cast<TPtr8*>(heapPtr);
+            for (TInt i=1; i <= aIndex; i++)
+                {
+                heapPtr += (sizeof(TPtr8) + pDesc->MaxLength());
+                heapPtr = RoundToNextDividableByFourAddress(heapPtr);
+                pDesc = reinterpret_cast<TPtr8*>(heapPtr);
+                }
+            const TInt length = pDesc->Length();
+            const TInt maxLength = pDesc->MaxLength();
+            pDesc->Set(heapPtr + sizeof(TPtr8), length, maxLength);
+            aDesc.Set(*pDesc);
+            }
+        else
+            {
+            retVal = KErrNotFound;
+            }
+        }
+    else
+        {
+        retVal = KErrBadHandle;
+#ifdef _SENDEBUG
+            TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("CSenChunk::DescFromChunk(chunk), RChunk.Handle(): %d is an error!"),
+                iChunk.Handle()));
+#endif // _SENDEBUG
+        }
+
+    return retVal;
+    }
+    
+EXPORT_C TInt CSenChunk::DescsFromChunk(TPtrC8& aDesc1, TPtrC8& aDesc2)
+    {
+    TInt retVal;
+    retVal = DescFromChunk(aDesc1,0);
+    if (retVal == KErrNone)
+        {
+        retVal = DescFromChunk(aDesc2,1);
+        }
+    return retVal;
+    }
+
+EXPORT_C void CSenChunk::ChunkToArgs(TIpcArgs& aArgs, TInt aIndex)
+    {
+#ifdef EKA2
+    aArgs.Set(aIndex, iChunk); // EKA2
+#else
+    aArgs.Set(aIndex, ipChunkName); // EKA1
+#endif
+    }
+
+EXPORT_C void CSenChunk::SetLogger(RFileLogger* aLog)
+    {
+    iLog = aLog;
+    }
+
+EXPORT_C RFileLogger* CSenChunk::Log() const
+    {
+    return iLog;
+    }
+    
+TUint8* CSenChunk::RoundToNextDividableByFourAddress(TUint8* aValue)
+    {
+    TInt modulo = ((TUint)aValue)%KSenChunkFourByteAlignment;
+    if ( modulo == 0 ) 
+        {
+        return aValue;
+        }
+    else
+        {
+        return aValue+(KSenChunkFourByteAlignment-modulo);        
+        }
+    }
+    
+EXPORT_C RFile& CSenChunk::RequestFileHandle()
+	{
+	return iFile;
+	}
+	
+EXPORT_C void CSenChunk::RequestFileHandle(RFile& aFile)
+	{
+	iFile = aFile;
+	}
+    
+
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sencryptoutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,252 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#include "sencryptoutils.h"
+#include <imcvcodc.h>
+#include "senguidgen.h"
+#include <e32math.h>
+#include <SenDomFragment.h>
+#include <SenNameSpace.h>
+#include "SenWsSecurityHeader.h"
+//#include "senxmldebug.h"
+
+namespace
+    {
+    _LIT(KTimeReference,         "19700000:000000");
+    const TInt KToBase64CoefficientNumerator  = 4;
+    const TInt KToBase64CoefficientNominative = 3;
+    const TInt KInt64Length = 20;
+	const TInt KInt32Length = 10;
+	const TInt KHexWidth = 2;
+    }
+
+EXPORT_C HBufC8* SenCryptoUtils::GetPSHA1HashL( const TDesC8& aSecret, 
+                                                const TDesC8& aSeed, 
+                                                const TInt aLength )
+{
+    HBufC8* output = HBufC8::NewLC(aLength);
+
+    CSHA1* sha1 = CSHA1::NewL();    
+    CleanupStack::PushL(sha1);
+
+    CHMAC* hmac = CHMAC::NewL(aSecret, sha1);
+    CleanupStack::Pop(sha1);
+    CleanupStack::PushL(hmac);    
+    
+    HBufC8* A = HBufC8::NewLC(Max(aSeed.Length(), hmac->HashSize())); // simulate the "A" array from the rfc
+    HBufC8* msg = HBufC8::NewLC(hmac->HashSize() + aSeed.Length());
+    
+    TInt generated = 0;    
+    A->Des() = aSeed;    
+    while (generated < aLength)
+    {
+        hmac->Reset();
+        A->Des() = hmac->Hash(*A);
+        msg->Des() = *A;
+        msg->Des().Append(aSeed);
+        
+        TInt length = Min(aLength - generated, hmac->HashSize());
+        
+        hmac->Reset();        
+        output->Des().Append(hmac->Hash(*msg).Left(length));
+        
+        generated += length;
+    }
+    
+    CleanupStack::PopAndDestroy(msg);
+    CleanupStack::PopAndDestroy(A);
+    CleanupStack::PopAndDestroy(hmac);    
+    CleanupStack::Pop(output);
+    
+    return output;
+}
+
+EXPORT_C HBufC8* SenCryptoUtils::EncodeBase64L(const TDesC8& aData)
+{
+    if (aData.Length() == 0)
+        {
+        return NULL;
+        }
+
+    TInt remainder = aData.Length() % KToBase64CoefficientNominative;
+    TInt length = aData.Length() * KToBase64CoefficientNumerator;
+    length /= KToBase64CoefficientNominative;
+    if (remainder)
+        {
+        length++;
+        length += KToBase64CoefficientNominative - remainder;
+        }
+
+    HBufC8* buffer = HBufC8::NewLC(length);
+    
+    
+    TImCodecB64 base64Codec;
+    base64Codec.Initialise();
+    TPtr8 des = buffer->Des();  // don't blame me, it's the compiler's fault    
+    base64Codec.Encode(aData, des);
+    
+    CleanupStack::Pop(buffer);
+    return buffer;
+}
+
+EXPORT_C HBufC8* SenCryptoUtils::DecodeBase64L(const TDesC8& aData)
+{
+    const TUint8 KBase64Fill = '=';
+
+    TInt length = aData.Length();
+    if (aData[length-1] == KBase64Fill)
+        {
+        length--;
+        if (aData[length-2] == KBase64Fill)
+            {
+            length--;
+            }
+        }
+    length *= KToBase64CoefficientNominative;
+    length /= KToBase64CoefficientNumerator;
+    if (length <= 0)
+        {
+        return NULL;
+        }
+
+    HBufC8* buffer = HBufC8::NewLC(length);
+
+    TImCodecB64 base64Codec;
+    base64Codec.Initialise();
+    TPtr8 des = buffer->Des();  // don't blame me, it's the compiler's fault    
+
+    base64Codec.Decode(aData, des);
+
+    CleanupStack::Pop(buffer);
+    return buffer;    
+}
+
+EXPORT_C HBufC8* SenCryptoUtils::RandomAndHashMd5LC()
+    {
+    HBufC8* hashedRandom = NULL;
+    TTime homeTime;
+    homeTime.HomeTime();
+    TInt64 seed = homeTime.Int64();
+    TBuf8<KSenUuidMaxInt64Length> valueBeforeMd5;
+    //randomize
+    valueBeforeMd5.AppendNum(Math::Rand(seed));
+    //hashing
+    CMD5* md5HashGen = CMD5::NewL();
+    CleanupStack::PushL(md5HashGen);
+    TPtrC8 hash = md5HashGen->Hash(valueBeforeMd5);
+    hashedRandom = hash.AllocL();
+    CleanupStack::PopAndDestroy(md5HashGen);
+    CleanupStack::PushL(hashedRandom);
+    return hashedRandom;
+    }    
+
+EXPORT_C HBufC8* SenCryptoUtils::CreateEncodedBinarySecretL(const TDesC8& aSecret, const TDesC8& aValueType)
+    {
+    //from MSP guide
+    //aSecret "...Contains the Compact mobile security token. The contents should be Base64 encoded and passed as the BinarySecurityToken element in the WS-Security header 
+    
+    TPtrC8 pSecret(aSecret);
+    CSenXmlReader* reader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+    CleanupStack::PushL(reader);
+    CSenDomFragment* pFragment = CSenDomFragment::NewL();
+    CleanupStack::PushL(pFragment);
+    pFragment->SetReader(*reader);    
+    pFragment->BuildFrom(aSecret);  
+    CSenElement& pElement = pFragment->AsElement();
+    if (pElement.LocalName() == KBinarySecurityToken
+        && (pElement.Namespace()->URI() == KSecuritySchemeXmlNs
+        || pElement.Namespace()->URI() == KSecurityXmlNs))
+        {
+        pSecret.Set(pElement.Content());
+        }
+    else
+        {
+        pSecret.Set(aSecret);
+        }
+    HBufC8* encodedSecurityToken = EncodeBase64L(pSecret);
+    CleanupStack::PushL(encodedSecurityToken);
+    HBufC8* binarySecurityToken(NULL);
+    if (aValueType.Length())
+        {
+        CSenWsSecurityHeader::BinarySecurityTokenL(*encodedSecurityToken, aValueType, binarySecurityToken);
+        }
+    else
+        {
+        CSenWsSecurityHeader::BinarySecurityTokenL(*encodedSecurityToken, binarySecurityToken);
+        }
+    CleanupStack::PopAndDestroy(encodedSecurityToken);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(reader);
+    return binarySecurityToken;
+    }
+
+EXPORT_C HBufC8* SenCryptoUtils::GetTimestampL()
+	{
+	TTime time;
+	time.UniversalTime();
+	TTimeIntervalSeconds timestamp;
+	TTime refTime(KTimeReference);
+
+	time.SecondsFrom(refTime, timestamp);
+	HBufC8* pTimestamp = HBufC8::NewL(KInt32Length);
+    TPtr8 buf = pTimestamp->Des();
+    buf.AppendNum(timestamp.Int());
+	return pTimestamp;
+	}
+EXPORT_C HBufC8* SenCryptoUtils::GetTimestampL(TTime aTime)
+    {
+    TTimeIntervalSeconds timestamp;
+    TTime refTime(KTimeReference);
+
+    aTime.SecondsFrom(refTime, timestamp);
+    HBufC8* pTimestamp = HBufC8::NewL(KInt32Length);
+    TPtr8 buf = pTimestamp->Des();
+    buf.AppendNum(timestamp.Int());
+    return pTimestamp;
+    }
+EXPORT_C HBufC8* SenCryptoUtils::GetRandomNonceL()
+	{
+	TTime time;
+	time.UniversalTime();
+	CMD5 *pMD5HashGen = CMD5::NewL();
+	CleanupStack::PushL (pMD5HashGen);
+    TBuf8<KInt64Length+KInt32Length> valueBeforeHash;
+    // Append current system time
+    valueBeforeHash.AppendNum(time.Int64());
+    // Append random number
+    valueBeforeHash.AppendNum(Math::Random()); //TUint32 Random();
+	
+    // Calculate hash
+    TPtrC8 hash (pMD5HashGen->Hash(valueBeforeHash));
+    HBufC8* pResult = HBufC8::NewL(hash.Length() * KHexWidth);
+    TPtr8 buf = pResult->Des();
+    for (TInt i = 0; i < hash.Length(); i++)
+        {
+        buf.AppendNumFixedWidth(hash[i], EHex, KHexWidth);
+        }
+    CleanupStack::PopAndDestroy(pMD5HashGen);
+    return pResult;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sendateutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenDateUtils.h"
+
+namespace
+    {
+    _LIT8(KXmlDateTimeFormat8, "%04d-%02d-%02dT%02d:%02d:%02dZ"); // prior WS-* MT / SCT timestamp fix (2006-12-06) => Liberty IOP confirmed
+    _LIT8(KXmlDateTimeFormat82, "%04d-%02d-%02dT%02d:%02d:%02d.%06dZ");
+    }
+
+EXPORT_C TTime SenDateUtils::FromXmlDateTimeL(const TDesC8& aXmlDateTime)
+    {
+    // Format: '2004-01-22T15:31:00Z' or '2004-01-22T15:31:00+02:00'
+
+    TInt year;
+    TInt month;
+    TInt day;
+    TInt hour;
+    TInt min;
+    TInt sec;
+    TInt microsec;
+
+    // Try to leave instead of panic in all places
+    if(aXmlDateTime.Length() < 20) { User::Leave(KErrUnderflow); }
+
+    TLex8 yearLex(aXmlDateTime.Mid(0, 4));
+    User::LeaveIfError(yearLex.Val(year));
+
+    if(aXmlDateTime[4] != '-') { User::Leave(KErrGeneral); }
+
+    TLex8 monthLex(aXmlDateTime.Mid(5, 2));
+    User::LeaveIfError(monthLex.Val(month));
+    month--;
+    if(month < 0) { User::Leave(KErrUnderflow); }
+    if(month >= 12) { User::Leave(KErrOverflow); }
+
+    if(aXmlDateTime[7] != '-') { User::Leave(KErrGeneral); }
+
+    TLex8 dayLex(aXmlDateTime.Mid(8, 2));
+    User::LeaveIfError(dayLex.Val(day));
+    day--;
+    if(day < 0) { User::Leave(KErrUnderflow); }
+    if(day >= 31) { User::Leave(KErrOverflow); }
+
+    if(aXmlDateTime[10] != 'T') { User::Leave(KErrGeneral); }
+
+    TLex8 hourLex(aXmlDateTime.Mid(11, 2));
+    User::LeaveIfError(hourLex.Val(hour));
+    if(hour < 0) { User::Leave(KErrUnderflow); }
+    if(hour >= 24) { User::Leave(KErrOverflow); }
+
+    if(aXmlDateTime[13] != ':') { User::Leave(KErrGeneral); }
+
+    TLex8 minLex(aXmlDateTime.Mid(14, 2));
+    User::LeaveIfError(minLex.Val(min));
+    if(min < 0) { User::Leave(KErrUnderflow); }
+    if(min >= 60) { User::Leave(KErrOverflow); }
+
+    if(aXmlDateTime[16] != ':') { User::Leave(KErrGeneral); }
+
+    TLex8 secLex(aXmlDateTime.Mid(17, 2));
+    User::LeaveIfError(secLex.Val(sec));
+    if(sec < 0) { User::Leave(KErrUnderflow); }
+    if(sec >= 60) { User::Leave(KErrOverflow); }
+
+    TUint16 nextChar = aXmlDateTime[19];
+    TUint16 tzChar = aXmlDateTime[19];
+    
+    TInt i = 19;
+    while((tzChar != 'Z') && (tzChar != '+') && (tzChar != '-'))
+        {
+        i++;
+        if(i < aXmlDateTime.Length()) tzChar = aXmlDateTime[i];
+        else { User::Leave(KErrGeneral); }
+        }
+        
+    if(nextChar == '.')
+        {
+        TInt lastMicrosec;
+        if(i > 26) lastMicrosec = 26;
+        else lastMicrosec = i;
+        TLex8 microsecLex(aXmlDateTime.Mid(20, lastMicrosec-20));
+        User::LeaveIfError(microsecLex.Val(microsec));
+        TInt j = 26;
+        while (j > lastMicrosec)
+            {
+            microsec = microsec * 10;
+            j--;
+            }
+        }
+    else
+        {
+        microsec = 0;
+        }       
+
+    TTime time(
+        TDateTime(
+            year,
+            static_cast<TMonth>(month),
+            day,
+            hour,
+            min,
+            sec,
+            microsec
+            )
+        );
+
+    if(tzChar == 'Z')
+        {
+        // UTC
+        if(aXmlDateTime.Length() > i+1) { User::Leave(KErrOverflow); }
+        }
+    else
+        {
+        // Time zone info is appended
+        if(aXmlDateTime.Length() < i+6) { User::Leave(KErrUnderflow); }
+        if(aXmlDateTime.Length() > i+6) { User::Leave(KErrOverflow); }
+        TInt tzSign = 0;
+        if(tzChar == '+') { tzSign = +1; }
+        if(tzChar == '-') { tzSign = -1; }
+        if(tzSign == 0) { User::Leave(KErrGeneral); }
+
+        TInt tzHour;
+        TInt tzMin;
+
+        TLex8 tzHourLex(aXmlDateTime.Mid(i+1, 2));
+        User::LeaveIfError(tzHourLex.Val(tzHour));
+        if(tzHour < 0) { User::Leave(KErrUnderflow); }
+        if(tzHour >= 24) { User::Leave(KErrOverflow); }
+
+        if(aXmlDateTime[i+3] != ':') { User::Leave(KErrGeneral); }
+
+        TLex8 tzMinLex(aXmlDateTime.Mid(i+4, 2));
+        User::LeaveIfError(tzMinLex.Val(tzMin));
+        if(tzMin < 0) { User::Leave(KErrUnderflow); }
+        if(tzMin >= 60) { User::Leave(KErrOverflow); }
+
+        TInt tzShiftMins = tzSign * (tzMin + tzHour * 60);
+        time += TTimeIntervalMinutes(tzShiftMins);
+        }
+
+    return time;
+    }
+
+EXPORT_C void SenDateUtils::ToXmlDateTimeUtf8L(TDes8& aDest, const TTime& aSrc)
+    {
+    if(aDest.MaxLength() < KXmlDateTimeMaxLength)
+        {
+        User::Leave(KErrOverflow);
+        }
+
+    TDateTime dt = aSrc.DateTime();
+    aDest.Format(
+        KXmlDateTimeFormat8,
+        dt.Year(),
+        dt.Month() + 1,
+        dt.Day() + 1,
+        dt.Hour(),
+        dt.Minute(),
+        dt.Second()
+        );
+}
+    
+    
+EXPORT_C void SenDateUtils::ToXmlDateTimeUtf82L(TDes8& aDest, const TTime& aSrc)
+    {
+    if(aDest.MaxLength() < KXmlDateTimeMaxLength)
+        {
+        User::Leave(KErrOverflow);
+        }
+
+    TDateTime dt = aSrc.DateTime();
+    aDest.Format(
+        KXmlDateTimeFormat82,
+        dt.Year(),
+        dt.Month() + 1,
+        dt.Day() + 1,
+        dt.Hour(),
+        dt.Minute(),
+        dt.Second(),
+		dt.MicroSecond()   // Added in WS-* MT / SCT fix (2006-12-06)
+        );
+    }
+    
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senguidgen.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <hash.h> 
+#include <e32math.h>
+#include <f32file.h> // TVolumeInfo
+#include "senguidgen.h"
+#include "sendebug.h"
+#include "senlogger.h"
+
+CSenGuidGen::CSenGuidGen()
+    {
+    TTime homeTime;
+    homeTime.HomeTime();
+    iSeed = homeTime.Int64();
+    }
+
+void CSenGuidGen::ConstructL()
+    {
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenGuidGen::ConstructL");
+    // Get host name
+    //ipHostId = _L8("localhost").AllocL();
+    ipHostId = HBufC8::NewL( KSenUuidMaxHostIdLength );
+    TPtr8 hostID = ipHostId->Des();
+    
+    TInt error(KErrNone);
+
+    
+    RFs rfs;
+    User::LeaveIfError(rfs.Connect());
+#ifndef __WINS__ // only required in RELEASE builds    
+    TLSLOG_L(KSenUtilsLogChannel, KNormalLogLevel, "CSenGuidGen::ConstructL - about to call RFs.GetMediaSerialNumber()");
+    TMediaSerialNumber mediaID;
+    error = rfs.GetMediaSerialNumber(mediaID, EDriveC);
+    TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("CSenGuidGen::ConstructL - GetMediaSerialNumber() returned: %d"), error));
+    if( !error )
+        {
+        hostID.Append(mediaID);
+        }
+#else // WINS (emulator) environment
+    TLSLOG_L(KSenUtilsLogChannel, KNormalLogLevel, "CSenGuidGen::ConstructL - about to call RFs.Volume()");
+    TVolumeInfo info;
+    error = rfs.Volume(info);
+    TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("CSenGuidGen::ConstructL - Volume() returned: %d"), error));
+    if( !error )
+        {
+        hostID.AppendNum(info.iUniqueID);
+        }
+#endif    
+    rfs.Close();
+
+    if( error )
+        {
+        hostID.Append( _L8("localhost") );
+        }
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenGuidGen::ConstructL - host ID:");
+    TLSLOG(KSenUtilsLogChannel, KMinLogLevel, hostID);
+    // Create hash generator
+    ipMd5HashGen = CMD5::NewL();
+    }
+
+CSenGuidGen::~CSenGuidGen()
+    {
+    delete ipMd5HashGen;
+    delete ipHostId;
+    }
+
+EXPORT_C CSenGuidGen* CSenGuidGen::NewLC()
+    {
+    CSenGuidGen* pNew = new (ELeave) CSenGuidGen;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenGuidGen* CSenGuidGen::NewL()
+    {
+    CSenGuidGen* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C HBufC* CSenGuidGen::GetRandomGuidLC()
+    {
+#ifdef _UNICODE
+    return GetRandomGuid16LC();
+#else
+    return GetRandomGuid8LC();
+#endif
+    }
+
+
+EXPORT_C HBufC8* CSenGuidGen::GetRandomGuid8LC()
+    {
+    TPtrC8 hash = GetRandomHash();
+    HBufC8* pResult = HBufC8::NewLC(hash.Length() * KSenUuidHexWidth + KSenUuidNumOfSlashes + KSenUuidPrefix().Length());
+    TPtr8 result = pResult->Des();
+
+    // Ensure that resulting uuid is a URI as well as an NCName
+    result.Append(KSenUuidPrefix) ;
+
+    for (TInt i = 0; i < hash.Length(); i++)
+        {
+        if ((i == 4) || (i == 6) || (i == 8) || (i == 10)) // four slashes
+            {
+            result.Append('-');
+            }
+        result.AppendNumFixedWidth(hash[i], EHex, KSenUuidHexWidth); // hash[i] as hex!, doubles the hash length
+        }
+    result.UpperCase();
+    return pResult;
+    }
+
+
+EXPORT_C HBufC16* CSenGuidGen::GetRandomGuid16LC()
+    {
+    TPtrC8 hash = GetRandomHash();
+    HBufC16* pResult = HBufC16::NewLC(hash.Length() * KSenUuidHexWidth + KSenUuidNumOfSlashes + KSenUuidPrefix().Length());
+    TPtr16 result = pResult->Des();
+
+    // Ensure that resulting uuid is a URI as well as an NCName
+
+    TBuf16<KSenUuidPrefixLength> uuidPrefix16; // KSenUuidPrefixLength == KSenUuidPrefix().Length()
+    
+    uuidPrefix16.Copy(KSenUuidPrefix); // OK, since there are no Unicode characters in KSenUuidPrefix
+    result.Append(uuidPrefix16);
+    
+    for (TInt i = 0; i < hash.Length(); i++)
+        {
+        if ((i == 4) || (i == 6) || (i == 8) || (i == 10)) // four slashes
+            {
+            result.Append('-');
+            }
+        result.AppendNumFixedWidth(hash[i], EHex, KSenUuidHexWidth); // hash[i] as hex!, doubles the hash length
+        }
+    result.UpperCase();
+    return pResult;
+    }
+
+TPtrC8 CSenGuidGen::GetRandomHash()
+    {
+    TBuf8<KSenUuidMaxHashLength> valueBeforeMd5;
+
+    // Append host id
+    valueBeforeMd5.Append(*ipHostId);
+    valueBeforeMd5.Append(':');
+
+    // Append current system time
+    TTime homeTime;
+    homeTime.HomeTime();
+    valueBeforeMd5.AppendNum(homeTime.Int64());
+    valueBeforeMd5.Append(':');
+
+    // Append random number
+    valueBeforeMd5.AppendNum(Math::Rand(iSeed));
+
+    // Calculate hash
+    TPtrC8 hash = ipMd5HashGen->Hash(valueBeforeMd5);
+    return hash;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senhttptransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,606 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include <SenXmlUtils.h>
+#include <SenBaseAttribute.h>
+#include <SenXmlConstants.h>
+
+#include "senlogger.h"
+#include "SenHttpTransportProperties.h"
+#include "senpropertiesfragment.h"
+#include "MSenProperty.h"
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL()
+    {
+    CSenHttpTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC()
+    {
+    CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL(const TDesC8& aXmlUtf8,
+                                                               CSenXmlReader& aParser)
+    {
+    CSenHttpTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                                CSenXmlReader& aParser)
+    {
+    CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenHttpTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+
+void CSenHttpTransportProperties::SetReader(CSenXmlReader& aReader)
+    {
+    CSenTransportProperties::SetReader(aReader);
+    } 
+
+MSenProperties::TSenPropertiesClassType CSenHttpTransportProperties::PropertiesClassType() 
+    {
+    return ESenHttpTransportProperties;
+    }
+
+void CSenHttpTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenTransportProperties::WriteToL(aWriteStream);
+    }
+    
+void CSenHttpTransportProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    CSenTransportProperties::ReadFromL(aBuffer);
+    }    
+
+HBufC8* CSenHttpTransportProperties::AsUtf8L()
+    {
+    return CSenTransportProperties::AsUtf8L();
+    }
+
+HBufC8* CSenHttpTransportProperties::AsUtf8LC()
+    {
+    return CSenTransportProperties::AsUtf8LC();
+    }
+    
+TBool CSenHttpTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenHttpTransportProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return CSenTransportProperties::IsSafeToCast(aClass);
+        }
+    }      
+    
+    
+TInt CSenHttpTransportProperties::SetPropertyL(const TDesC8& aName,
+                                               const TDesC8& aValue)
+    {
+    return CSenTransportProperties::SetPropertyL(aName, aValue);
+    }
+    
+TInt CSenHttpTransportProperties::PropertyL(const TDesC8& aName,
+                                            TPtrC8& aValue)
+    {
+    return CSenTransportProperties::PropertyL(aName, aValue);
+    }
+    
+TInt CSenHttpTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                  const TInt aValue)
+    {
+    return CSenTransportProperties::SetIntPropertyL(aName, aValue);
+    }
+
+TInt CSenHttpTransportProperties::IntPropertyL(const TDesC8& aName,
+                                               TInt& aValue)
+    {
+    return CSenTransportProperties::IntPropertyL(aName, aValue);
+    }
+
+TInt CSenHttpTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                   const TBool aValue)
+    {
+    return CSenTransportProperties::SetBoolPropertyL(aName, aValue);
+    }
+
+TInt CSenHttpTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                TBool& aValue)
+    {
+    return CSenTransportProperties::BoolPropertyL(aName, aValue);
+    }  
+
+TInt CSenHttpTransportProperties::SetOmittedL(const TDesC8& aName, TBool aValue)
+    {
+    return CSenTransportProperties::SetOmittedL(aName, aValue);
+    }
+
+TInt CSenHttpTransportProperties::RemovePropertyL(const TDesC8& aName)
+    {
+    return CSenTransportProperties::RemovePropertyL(aName);
+    }
+
+CSenHttpTransportProperties::~CSenHttpTransportProperties()
+    {
+    }
+
+void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aLocalname, aXml, aParser);
+    }
+
+void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser);
+    }
+
+void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aQualifiedName, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, aXml, aParser);
+    }
+
+void CSenHttpTransportProperties::BaseConstructL(const CSenElement& aElement)
+    {
+    CSenTransportProperties::BaseConstructL(aElement);
+    }
+
+CSenHttpTransportProperties::CSenHttpTransportProperties()
+    {
+    }
+
+
+TInt CSenHttpTransportProperties::ContentTypeL(TPtrC8& aContentType)
+    {
+    return HttpHeaderL(KContentTypeLocalName, aContentType);
+    }
+
+void CSenHttpTransportProperties::SetContentTypeL(const TDesC8& aContentType)
+    {
+    SetPropertyL(KContentTypeLocalName, aContentType, KHttpHeaderType);
+    }
+
+TInt CSenHttpTransportProperties::UserAgentL(TPtrC8& aUserAgent)
+    {
+    return HttpHeaderL(KUserAgentLocalName, aUserAgent);
+    }
+
+void CSenHttpTransportProperties::SetUserAgentL(const TDesC8& aUserAgent)
+    {
+    SetPropertyL(KUserAgentLocalName, aUserAgent, KHttpHeaderType);
+    }
+
+        
+TInt CSenHttpTransportProperties::SoapActionL(TPtrC8& aSoapAction)
+    {
+    return CSenTransportProperties::SoapActionL(aSoapAction);
+    }
+
+void CSenHttpTransportProperties::SetSoapActionL(const TDesC8& aSoapAction)
+    {
+    _LIT8(KQuote, "\"");
+    HBufC8* pTemp = HBufC8::NewLC(aSoapAction.Length()+(2*KQuote().Length()));  
+
+    TPtr8 temp = pTemp->Des();
+
+    if(!SenXmlUtils::StartsWith(aSoapAction, KQuote))
+        {
+        temp.Append(KQuote);
+        }
+    temp.Append(aSoapAction);
+
+    if(!SenXmlUtils::EndsWith(*pTemp, KQuote))
+        {
+        temp.Append(KQuote);
+        }
+
+    SetPropertyL(KSoapActionLocalName, *pTemp, KHttpHeaderType);
+
+    CleanupStack::PopAndDestroy(pTemp); // Destroy temporary SoapAction
+	}
+
+TInt CSenHttpTransportProperties::AcceptL(TPtrC8& aAccept)
+    {
+    return HttpHeaderL(KAcceptLocalName, aAccept);    
+    }
+
+void CSenHttpTransportProperties::SetAcceptL(const TDesC8& aAccept)
+    {
+    SetPropertyL(KAcceptLocalName, aAccept, KHttpHeaderType);
+    }
+        
+TInt CSenHttpTransportProperties::HttpMethodL(TSenHttpMethod& aMethod)
+    {
+    TPtrC8 method;
+    TInt retVal = PropertyL(KHttpMethodLocalName, method);
+    if (retVal == KErrNone)
+        {
+        if (method == KHttpGet)
+            {
+            aMethod = ESenHttpGet;
+            return KErrNone;
+            }
+        else if (method == KHttpPost)
+            {
+            aMethod = ESenHttpPost;
+            return KErrNone;
+            }
+        else if (method == KHttpPut)
+            {
+            aMethod = ESenHttpPut;
+            return KErrNone;
+            }
+        else if (method == KHttpDelete)
+            {
+            aMethod = ESenHttpDelete;
+            return KErrNone;
+            }
+        else
+            {
+            return KErrUnknown;
+            }
+        }
+    else
+        {
+        return retVal;
+        }
+    }
+
+void CSenHttpTransportProperties::SetHttpMethodL(TSenHttpMethod aHttpMethod)
+    {
+    switch ( aHttpMethod )
+        {
+        case ESenHttpGet:
+            SetPropertyL(KHttpMethodLocalName, KHttpGet);
+            break;
+        case ESenHttpPost:
+            SetPropertyL(KHttpMethodLocalName, KHttpPost);
+            break;
+        case ESenHttpPut:
+            SetPropertyL(KHttpMethodLocalName, KHttpPut);
+            break;
+        case ESenHttpDelete:
+            SetPropertyL(KHttpMethodLocalName, KHttpDelete);
+            break;
+        default:
+            // Not possible
+            break;
+        }
+    }
+
+TInt CSenHttpTransportProperties::HttpVersionL(TSenHttpVersion& aHttpVersion)
+    {
+    TPtrC8 method;
+    TInt retVal = PropertyL(KHttpVersionLocalName, method);
+    if (retVal == KErrNone)
+        {
+        if (method == KHttp10)
+            {
+            aHttpVersion = ESenHttp10;
+            return KErrNone;
+            }
+        else if (method == KHttp11)
+            {
+            aHttpVersion = ESenHttp11;
+            return KErrNone;
+            }
+        else
+            {
+            return KErrUnknown;
+            }
+        }
+    else
+        {
+        return retVal;
+        }
+    }
+
+void CSenHttpTransportProperties::SetHttpVersionL(TSenHttpVersion aHttpVersion)
+    {
+    switch ( aHttpVersion )
+        {
+        case ESenHttp10:
+            SetPropertyL(KHttpVersionLocalName, KHttp10);
+            break;
+        case ESenHttp11:
+            SetPropertyL(KHttpVersionLocalName, KHttp11);
+            break;
+        default:
+            // Not possible
+            break;
+        }
+    }
+
+TInt CSenHttpTransportProperties::HttpHeaderL(const TDesC8& aHeaderName,
+                                                TPtrC8& aValue)
+    {
+    TPtrC8 value;
+    TPtrC8 type;
+    TInt retVal = PropertyL(aHeaderName, value, type);
+    if ( retVal == KErrNone )
+        {
+        if ( type == KHttpHeaderType )
+            {
+            aValue.Set(value);
+            }
+        else
+            {
+            retVal = KErrNotFound;
+            }
+        }
+    return retVal;
+    }
+        
+void CSenHttpTransportProperties::SetHttpHeaderL(const TDesC8& aHeaderName, const TDesC8& aValue)
+    {
+    SetPropertyL(aHeaderName, aValue, KHttpHeaderType);
+    }
+
+TInt CSenHttpTransportProperties::SetPropertyL(const TDesC8& aName,
+                                               const TDesC8& aValue,
+                                               const TDesC8& aType)
+    {
+    return CSenTransportProperties::SetPropertyL(aName, aValue, aType);
+    }
+
+TInt CSenHttpTransportProperties::PropertyL(const TDesC8& aName,
+                                            TPtrC8& aValue,
+                                            TPtrC8& aType)
+    {
+    return CSenTransportProperties::PropertyL(aName, aValue, aType);
+    }
+
+TInt CSenHttpTransportProperties::IapIdL(TUint32& aCurrentIapId)
+    {
+    return CSenTransportProperties::IapIdL(aCurrentIapId);
+    }
+
+void CSenHttpTransportProperties::SetIapIdL(TUint32 aIapId)
+    {
+    CSenTransportProperties::SetIapIdL(aIapId);
+    }
+
+void CSenHttpTransportProperties::SetSnapIdL(TUint32 aSnapId)
+    {
+	CSenTransportProperties::SetSnapIdL(aSnapId);
+    }
+
+
+TInt CSenHttpTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
+    {
+    return CSenTransportProperties::SnapIdL(aCurrentSnapId);
+    }
+TInt CSenHttpTransportProperties::ProxyPortL(TInt& aProxyPort)
+    {
+    return CSenTransportProperties::ProxyPortL(aProxyPort);
+    }
+
+void CSenHttpTransportProperties::SetProxyPortL(TInt aProxyPort)
+    {
+    CSenTransportProperties::SetProxyPortL(aProxyPort);
+    }
+
+TInt CSenHttpTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
+    {
+    return CSenTransportProperties::ProxyHostL(aProxyHost);
+    }
+
+void CSenHttpTransportProperties::SetProxyHostL(const TDesC8& aProxyHost)
+    {
+    CSenTransportProperties::SetProxyHostL(aProxyHost);
+    }
+
+TInt CSenHttpTransportProperties::ProxyUsageL(TBool& aValue)
+    {
+    return CSenTransportProperties::ProxyUsageL(aValue);
+    }
+
+void CSenHttpTransportProperties::SetProxyUsageL(TBool aProxyUsage)
+    {
+    CSenTransportProperties::SetProxyUsageL(aProxyUsage);
+    }
+    
+TInt CSenHttpTransportProperties::SecureDialogL(TBool& aValue)
+    {
+    return CSenTransportProperties::SecureDialogL(aValue);
+    }
+
+void CSenHttpTransportProperties::SetSecureDialogL(TBool aSecureDialog)
+    {
+    CSenTransportProperties::SetSecureDialogL(aSecureDialog);
+    }
+/*
+TInt CSenHttpTransportProperties::IAPDialogL(TBool& aValue)
+    {
+    return CSenTransportProperties::IAPDialogL(aValue);
+    }
+
+void CSenHttpTransportProperties::SetIAPDialogL(TBool aIAPDialog)
+    {
+    CSenTransportProperties::SetIAPDialogL(aIAPDialog);
+    }
+*/
+TInt CSenHttpTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
+    {
+    return CSenTransportProperties::DeviceIDL(aDeviceID);
+    }
+
+void CSenHttpTransportProperties::SetDeviceIDL(const TDesC8& aDeviceID)
+    {
+    CSenTransportProperties::SetDeviceIDL(aDeviceID);
+    }    
+TInt CSenHttpTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
+    {
+    return CSenTransportProperties::DownloadFolderL(aDownloadFolder);
+    }
+
+void CSenHttpTransportProperties::SetDownloadFolderL(const TDesC8& aDownloadFolder)
+    {
+    CSenTransportProperties::SetDownloadFolderL(aDownloadFolder);
+    }  
+
+TInt CSenHttpTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
+    {
+    return CSenTransportProperties::FileAttachmentL(aCid, aFileName);
+    }
+
+TInt CSenHttpTransportProperties::SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName)
+    {
+    return CSenTransportProperties::SetFileAttachmentL(aCid, aFileName);
+    }
+
+void CSenHttpTransportProperties::ApplyBindingL(TSOAPVersion aSoapVersion)
+    {
+
+    TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L("CSenHttpTransportProperties::ApplyBindingL(SOAP1.%d)"), aSoapVersion==ESOAP11?1:2));
+    //TLSLOG_L(KSenUtilsLogChannel, KSenUtilsLogLevel, "CSenHttpTransportProperties::ApplyBindingL");
+    TPtrC8 value;
+    SoapActionL(value);
+    if ( aSoapVersion == ESOAP11 )
+        {
+        TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "- Applying SOAP 1.1 binding.");
+        HBufC8* dblQutoedValue = AdaptDblQutesLC(value);
+        SetSoapActionL(*dblQutoedValue);
+        CleanupStack::PopAndDestroy(dblQutoedValue);
+        }
+    else
+        {
+        TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "- Applying SOAP 1.2 binding.");
+        const TInt KActionLength = 11; // comes from chars: '; action=""'
+	    CSenElement* pElement = ipFragment->AsElement().Element(KSoapActionLocalName);
+	    if ( pElement )
+		    {
+		    // Remove the type attribute, to prevent HTTP header to be added in HTTP transport plug-in(s)
+	        CSenBaseAttribute* attr = SenXmlUtils::RemoveAttributeL(*pElement, KSenTypeAttributeName);
+	        delete attr;
+	        attr = NULL;
+		    }
+//        // (Re-)setting empty (zero-length) value for type attribute should do the same trick:
+//        SetPropertyL(KSoapActionLocalName, value, KNullDesC8);
+
+        HBufC8* dblQutoedValue = AdaptDblQutesLC(value);
+        HBufC8* buf = HBufC8::NewLC(dblQutoedValue->Length() + KSenSoap12ContentTypeHeaderValue().Length() +
+                KActionLength);
+        TPtr8 ptr = buf->Des();
+        ptr.Append(KSenSoap12ContentTypeHeaderValue);
+        if ( ptr.Length() )
+            {
+            _LIT8(KColonSpace,"; ");
+            ptr.Append(KColonSpace);	//CodeScannerWarnings
+            }
+        _LIT8(KAction,"action=");
+        ptr.Append(KAction);	//CodeScannerWarnings
+        ptr.Append( *dblQutoedValue );
+        SetContentTypeL( *buf );
+        CleanupStack::PopAndDestroy( buf );        
+        CleanupStack::PopAndDestroy( dblQutoedValue );        
+        SetAcceptL( KSenSoap12AcceptHeaderValue );
+        }
+    }    
+HBufC8* CSenHttpTransportProperties::AdaptDblQutesLC(const TDesC8& aValue)
+    {
+    if((!SenXmlUtils::StartsWith(aValue, KSenDblQuot()))
+       && (!SenXmlUtils::EndsWith(aValue, KSenDblQuot()))
+       && (aValue.Length() >= 2 * KSenDblQuot().Length()))
+        {
+        HBufC8* buf = HBufC8::NewLC(aValue.Length()  + 2 * KSenDblQuot().Length());
+        TPtr8 ptr = buf->Des();
+        ptr.Append( KSenDblQuot);
+        ptr.Append( aValue );
+        ptr.Append( KSenDblQuot);
+        return buf;
+        }
+     else
+        {
+        return aValue.AllocLC();
+        }
+    }
+MSenProperties* CSenHttpTransportProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenHttpTransportProperties* pProperties = this->NewLC(element);
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+TInt CSenHttpTransportProperties::MwsNamespaceL(TPtrC8& aMwsNamespace)
+    {
+    return CSenTransportProperties::MwsNamespaceL(aMwsNamespace);
+    }
+
+void CSenHttpTransportProperties::SetMwsNamespaceL(const TDesC8& aMwsNamespace)
+    {
+    CSenTransportProperties::SetMwsNamespaceL(aMwsNamespace);
+    }  
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senidentifier.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,272 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include "senidentifier.h"
+#include "sencertutils.h"
+
+#include "senlogger.h"
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewL()
+    {
+    CSenIdentifier* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewLC()
+    {
+    CSenIdentifier* self = new (ELeave) CSenIdentifier();
+    CleanupStack::PushL(self);
+    self->ConstructL(SenIdentifier::EUnknown, KNullDesC8(), KNullDesC8());
+    return self;
+    }
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewL(const CSenIdentifier& aParent)
+    {
+    CSenIdentifier* self = NewLC(aParent);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewLC(const CSenIdentifier& aParent)
+    {
+    CSenIdentifier* self = new (ELeave) CSenIdentifier();
+    CleanupStack::PushL(self);
+    self->ConstructL(aParent);
+    return self;
+    }
+
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                              const TDesC8& aIdentifierValue)
+    {
+    CSenIdentifier* self = NewLC(aIdentifierType, aIdentifierValue);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewLC(SenIdentifier::TIdentifierType aIdentifierType, 
+                                               const TDesC8& aIdentifierValue)
+    {
+    CSenIdentifier* self = new (ELeave) CSenIdentifier();
+    CleanupStack::PushL(self);
+    self->ConstructL(aIdentifierType, aIdentifierValue, KNullDesC8());
+    return self;
+    }
+
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                              const TCertInfo& aCertInfo)
+    {
+    CSenIdentifier* self = NewLC(aIdentifierType, aCertInfo);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewLC(SenIdentifier::TIdentifierType aIdentifierType, 
+                                               const TCertInfo& aCertInfo)
+    {
+    CSenIdentifier* self = new (ELeave) CSenIdentifier();
+    CleanupStack::PushL(self);
+    HBufC8* pCertInfo = SenCertUtils::CertInfoToStringLC(aCertInfo);
+    self->ConstructL(aIdentifierType, *pCertInfo, KNullDesC8);
+    CleanupStack::PopAndDestroy(); // CertInfoToStringLC
+    return self;
+    }
+
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                              const TDesC8& aIdentifierValue, 
+                                              const TDesC8& aFriendlyName)
+    {
+    CSenIdentifier* self = NewLC(aIdentifierType, aIdentifierValue, aFriendlyName);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+EXPORT_C CSenIdentifier* CSenIdentifier::NewLC(SenIdentifier::TIdentifierType aIdentifierType, 
+                                               const TDesC8& aIdentifierValue, 
+                                               const TDesC8& aFriendlyName)
+    {
+    CSenIdentifier* self = new (ELeave) CSenIdentifier();
+    CleanupStack::PushL(self);
+    self->ConstructL(aIdentifierType, aIdentifierValue, aFriendlyName);
+    return self;
+    }
+
+
+void CSenIdentifier::ConstructL(SenIdentifier::TIdentifierType aIdentifierType, 
+                                const TDesC8& aIdentifierValue, 
+                                const TDesC8& aFriendlyName)
+    {
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenIdentifier::ConstructL - Start");
+
+    iType = aIdentifierType;
+    ipValue = aIdentifierValue.AllocL();
+    ipFriendlyName = aFriendlyName.AllocL();
+    ipStatements = CSenAttributes::NewL();
+    ipParent = this;
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenIdentifier::ConstructL - End");
+    }
+
+void CSenIdentifier::ConstructL(const CSenIdentifier& aParent)
+    {
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenIdentifier::ConstructL - Start");
+    iType = aParent.iType;
+    ipValue = aParent.Value().AllocL();
+    ipFriendlyName = aParent.ipFriendlyName->AllocL();
+    ipStatements = CSenAttributes::NewL(aParent.Statements());
+
+    // Note that all childs in chain get the root as their parent(!):
+    ipParent = CSenIdentifier::NewL(aParent.Parent()); 
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenIdentifier::ConstructL - End");
+    }
+
+CSenIdentifier::CSenIdentifier() : 
+    ipValue(NULL),
+    ipFriendlyName(NULL),
+    ipStatements(NULL)
+    {
+
+    iType = SenIdentifier::EUnknown;
+    }
+
+
+EXPORT_C CSenIdentifier::~CSenIdentifier()
+    {
+    delete ipValue;         // it is safe to delete NULL in Symbian C++
+    delete ipFriendlyName;
+    delete ipStatements;
+
+    delete Proxy(); // destroy the parent (proxy), if such is owned 
+    /*
+    if ( IsProxy() )  // atm equal to: delete Proxy();
+        {   
+        delete ipParent; // mm: was identifier ment to take ownership of its parent?
+        }
+    */
+    }
+
+
+EXPORT_C TPtrC8 CSenIdentifier::Value() const
+    {
+    return *ipValue;
+    }
+
+
+EXPORT_C SenIdentifier::TIdentifierType CSenIdentifier::Type() const
+    {
+    return iType;
+    }
+
+
+EXPORT_C TBool CSenIdentifier::Equals(const CSenIdentifier& otherIdentifier)
+    {
+    TBool result = EFalse;
+    result = (iType == otherIdentifier.Type()) && (0 == ipValue->Compare(otherIdentifier.Value()));
+    return(result);
+    }
+
+// == ParentFor
+EXPORT_C void CSenIdentifier::ProxyFor( CSenIdentifier* aIdentifier )
+    {
+    ipParent = aIdentifier;
+    }
+
+/*
+
+EXPORT_C TBool CSenIdentifier::IsProxy() const
+    {
+    // if parent is NULL, then this is the root
+    // and is thus not a proxy for another identifier
+
+    return(!(ipParent == NULL));
+    }
+
+// == Parent()
+EXPORT_C const CSenIdentifier* CSenIdentifier::Proxy() const
+    {
+    return(ipParent);    
+    }
+
+
+EXPORT_C const CSenIdentifier* CSenIdentifier::Root() const
+    {
+    return( (IsProxy()) ? ipParent : this );   
+    }
+*/
+
+EXPORT_C TBool CSenIdentifier::IsProxy() const
+    {
+    // If parent is this, then this is the root
+    // and thus not a proxy for another identifier
+    return(!(ipParent == this));
+    }
+
+// return the parent (or this, if this is not a proxy)
+EXPORT_C const CSenIdentifier* CSenIdentifier::Proxy() const
+    {
+    return( IsProxy() ? ipParent : NULL );    
+    }
+
+// return the root of (possible parent) 
+EXPORT_C const CSenIdentifier* CSenIdentifier::Root() const
+    {
+    return( IsProxy() ? ipParent->Root() : this );   
+    }
+
+EXPORT_C void CSenIdentifier::AddAttributeL( CSenAttribute& aAttribute )	//codescannerwarnings
+    {
+    ipStatements->AddAttributeL(aAttribute);	//codescannerwarnings
+    }
+
+
+EXPORT_C const CSenAttributes* CSenIdentifier::Attributes() const
+    {
+    return ipStatements;
+    }
+
+EXPORT_C TBool CSenIdentifier::operator==(const CSenIdentifier& a)
+    {
+    return (this==&a);
+    }
+
+const CSenIdentifier& CSenIdentifier::Parent() const
+    {
+    // if(!ipParent) User::Leave( <define leave code >
+    return *ipParent;
+    }
+
+const CSenAttributes& CSenIdentifier::Statements() const
+    {
+    // if(!ipStatements) User::Leave( <define leave code >
+    return *ipStatements;
+    }
+
+// End of file
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senpropertieselement.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,602 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h> // KErrSenZeroLengthDescriptor, KSenColon, ++
+
+#include "senpropertieselement.h" 
+
+namespace
+    {
+    _LIT8(KSenPropertyType,     "Type");
+    _LIT8(KSenPropertyTrue,     "true");
+    _LIT8(KSenPropertyFalse,    "false");
+    }
+
+EXPORT_C CSenPropertiesElement* CSenPropertiesElement::NewL(const TDesC8& aLocalName,
+                                                            RStringPool* aStringPool)
+    {
+    CSenPropertiesElement* pNew = new (ELeave) CSenPropertiesElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName, aStringPool);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesElement* CSenPropertiesElement::NewL(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            RStringPool* aStringPool)
+    {
+    CSenPropertiesElement* pNew = new (ELeave) CSenPropertiesElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aStringPool);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesElement* CSenPropertiesElement::NewL(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            RStringPool* aStringPool)
+    {
+    CSenPropertiesElement* pNew = new (ELeave) CSenPropertiesElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aStringPool);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesElement* CSenPropertiesElement::NewL(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& apAttrs,
+                                                            RStringPool* aStringPool)
+    {
+    CSenPropertiesElement* pNew = new (ELeave) CSenPropertiesElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, apAttrs, aStringPool);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+
+EXPORT_C CSenPropertiesElement* CSenPropertiesElement::NewL(const TDesC8& aNsUri,
+                                                            const TDesC8& aLocalName,
+                                                            const TDesC8& aQName,
+                                                            const RAttributeArray& apAttrs,
+                                                            CSenElement& aParent,
+                                                            RStringPool* aStringPool)
+    {
+    CSenPropertiesElement* pNew = new (ELeave) CSenPropertiesElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, apAttrs, aParent, aStringPool);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CSenPropertiesElement::CSenPropertiesElement()
+    {
+    }
+
+CSenPropertiesElement::~CSenPropertiesElement()
+    {
+    iLocalName.Close();
+    iContent.Close();
+    }
+
+void CSenPropertiesElement::BaseConstructL(const TDesC8& aLocalName,
+                                           RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    if (aLocalName == KNullDesC8)
+        {
+        User::Leave(KErrSenZeroLengthDescriptor);
+        }
+    SenXmlUtils::LeaveOnXmlEscapesL(aLocalName);
+    
+    if ( ipStringPool )
+        {
+        iLocalName = ipStringPool->OpenStringL(aLocalName);
+        }
+    else
+        {
+        Set(KNullDesC8, aLocalName, aLocalName);
+        }
+    }
+
+void CSenPropertiesElement::BaseConstructL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    if (aLocalName == KNullDesC8)
+        {
+        User::Leave(KErrSenZeroLengthDescriptor);
+        }
+    SenXmlUtils::LeaveOnXmlEscapesL(aLocalName);
+
+    if(aNsUri.Length()>0)
+        {
+        SetNamespaceL(aNsUri);
+        }
+    if ( ipStringPool )
+        {
+        iLocalName = ipStringPool->OpenStringL(aLocalName);
+        }
+    else
+        {
+        Set(KNullDesC8, aLocalName, aLocalName);
+        }
+    }
+
+void CSenPropertiesElement::BaseConstructL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+
+    if (aLocalName == KNullDesC8)
+        {
+        User::Leave(KErrSenZeroLengthDescriptor);
+        }
+    SenXmlUtils::LeaveOnXmlEscapesL(aLocalName);
+
+    if (aQName == KNullDesC8)
+        {
+        User::Leave(KErrSenZeroLengthDescriptor);
+        }
+    SenXmlUtils::LeaveOnXmlEscapesL(aQName);
+
+    if ( ipStringPool )
+        {
+        iLocalName = ipStringPool->OpenStringL(aLocalName);
+        }
+    else
+        {
+        Set(KNullDesC8, aLocalName, aLocalName);
+        }
+    TPtrC8 ptrPrefix(KNullDesC8);
+
+    if (aQName.Length() > 0 )
+        {
+        TInt colon = aQName.Locate(':');
+        if (colon > 0) // Note: 0 also treated as no prefix
+            {
+            ptrPrefix.Set(aQName.Ptr(),colon);
+            }
+        }
+
+    SetNamespaceL(ptrPrefix, aNsUri);    
+    }
+
+void CSenPropertiesElement::BaseConstructL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& apAttrs,
+                                           RStringPool* aStringPool)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aStringPool);
+    SetAttributesL(apAttrs);
+    }
+
+void CSenPropertiesElement::BaseConstructL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& apAttrs,
+                                           CSenElement& aParent,
+                                           RStringPool* aStringPool)
+    {
+    // parent must be set here at first line, because
+    // namespace setting dependends of it(!)
+    SetParent(&aParent);
+
+    BaseConstructL(aNsUri, aLocalName, aQName, aStringPool);
+    SetAttributesL(apAttrs);
+    }
+
+void CSenPropertiesElement::WriteContentToL(RWriteStream& aWriteStream)
+    {
+    HBufC8* pEncoded = SenXmlUtils::EncodeHttpCharactersLC(Content());
+    aWriteStream.WriteL(*pEncoded);
+    CleanupStack::PopAndDestroy(pEncoded);
+    }
+    
+CSenElement* CSenPropertiesElement::CreateElementL(const TDesC8& aNsPrefix,
+                                                   const TDesC8& aLocalName)
+    {
+    CSenElement* pNewElement = NULL;
+
+    if (aNsPrefix.Length() > 0)
+        {
+        CSenNamespace* pNamespace = (CSenNamespace*)Namespace(aNsPrefix);
+        if (pNamespace)
+            {
+            HBufC8 *pQName =
+                HBufC8::NewLC(aNsPrefix.Length() + aLocalName.Length() +5);
+            TPtr8 ptr = pQName->Des();
+            ptr.Append(aNsPrefix);
+            ptr.Append(':');
+            ptr.Append(aLocalName);
+            pNewElement = CSenPropertiesElement::NewL(pNamespace->URI(),
+                                                      aLocalName,
+                                                      *pQName,
+                                                      ipStringPool);
+                                                      
+            CleanupStack::PopAndDestroy(); // pQName
+            }
+        }
+    else
+        {
+        pNewElement = CSenPropertiesElement::NewL(aLocalName, ipStringPool);
+        }
+
+    return pNewElement; // Returns NULL if required namespace can not be found!
+    }
+    
+CSenElement& CSenPropertiesElement::AddElementL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName)
+    {
+    return CSenXmlElement::AddElementL(*CSenPropertiesElement::NewL(aNsUri,
+                                                                    aLocalName,
+                                                                    ipStringPool));
+    }
+
+CSenElement& CSenPropertiesElement::AddElementL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName)
+    {
+    return CSenXmlElement::AddElementL(*CSenPropertiesElement::NewL(aNsUri,
+                                                                    aLocalName,
+                                                                    aQName,
+                                                                    ipStringPool));
+    }
+
+CSenElement& CSenPropertiesElement::AddElementL(const TDesC8& aLocalName)
+    {
+    return CSenXmlElement::AddElementL(*CSenPropertiesElement::NewL(aLocalName,
+                                                                    ipStringPool));
+    }
+
+void CSenPropertiesElement::CopyFromL(CSenElement& aSource)
+    {
+    TPtrC8 sourceContent = aSource.Content();
+    if (sourceContent.Length() > 0)
+        {
+        SetContentL(sourceContent);
+        }
+
+    RPointerArray<CSenElement> sourceElements = aSource.ElementsL();
+    if (sourceElements.Count() > 0)
+        {
+        for (TInt i=0;i<sourceElements.Count(); i++)
+            {
+            CSenElement* pElement = sourceElements[i];
+            CSenElement* pNewElement =
+                                CSenPropertiesElement::NewL(pElement->LocalName(),
+                                                            ipStringPool);
+            pNewElement->CopyFromL(*pElement);
+
+            CSenXmlElement::AddElementL(*pNewElement);
+            }
+        }
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aSource.AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+
+            // 2005-04-28: check for duplicate and override existing value if
+            // attribute already exists.
+            CSenBaseAttribute* pOriginal = FindAttr(pBaseAttribute->Name());
+            if (pOriginal)
+                {
+                pOriginal->SetValueL(pBaseAttribute->Value());
+                continue;
+                }
+
+            CSenBaseAttribute* pNewBaseAttribute =
+                CSenBaseAttribute::NewL(pBaseAttribute->Name(),
+                                        pBaseAttribute->Value());
+
+            CSenXmlElement::AddAttributeL(pNewBaseAttribute);
+            }
+        }
+
+    RPointerArray<CSenNamespace> sourceNamespaces = aSource.NamespacesL();
+    if (sourceNamespaces.Count() > 0)
+        {
+        for (TInt i=0;i<sourceNamespaces.Count(); i++)
+            {
+            CSenNamespace* pNamespace = sourceNamespaces[i];
+            CSenNamespace* pNewNamespace =
+                CSenNamespace::NewL(pNamespace->Prefix(),pNamespace->URI());
+
+            CSenXmlElement::AddNamespaceL(*pNewNamespace, EFalse);
+            }
+        }
+
+    SetNamespaceL(aSource.NamespaceURI());
+    }    
+    
+TPtrC8 CSenPropertiesElement::Name()
+    {
+    return this->LocalName();
+    }
+
+TPtrC8 CSenPropertiesElement::Type()
+    {
+    TPtrC8 retVal(*this->AttrValue(KSenPropertyType));
+    return retVal;
+    }
+
+TPtrC8 CSenPropertiesElement::Value()
+    {
+    return this->Content();
+    }
+
+TInt CSenPropertiesElement::IntValue(TInt& aValue)
+    {
+    TInt retVal(KErrNone);
+    
+    TPtrC8 value = this->Content();
+    TLex8 lex(value);
+    retVal = lex.Val(aValue);
+
+    return retVal;
+    }
+
+TInt CSenPropertiesElement::BoolValue(TBool& aValue)
+    {
+     TInt retVal(KErrNone);
+
+    TPtrC8 value = this->Content();
+    if (value == KSenPropertyTrue)
+        {
+        aValue = ETrue;
+        }
+    else if (value == KSenPropertyFalse)
+        {
+        aValue = EFalse;
+        }
+    else
+        {
+        retVal = KErrGeneral;
+        }
+        
+    return retVal;   
+    }
+    
+TInt CSenPropertiesElement::ValueTokensL(const TDesC8& aDelimiter,
+                                         RPointerArray<TPtrC8>& aTokens)
+    {
+    TPtrC8 content = this->Content();
+    TInt delim = content.Find(aDelimiter);
+    while ( delim != KErrNotFound )
+        {
+        TPtrC8* piece = new (ELeave) TPtrC8();
+        piece->Set(content.Mid(0,delim));
+        aTokens.Append(piece);
+        
+        content.Set(content.Mid(delim+aDelimiter.Length(),
+                                content.Length()-(delim+aDelimiter.Length())));
+
+        delim = content.Find(aDelimiter);
+        }
+
+    if(!(this->Content()!=KNullDesC8 && content==KNullDesC8))
+        {
+        // If this property does NOT zero-length content
+        // and the "last" (or first) token is KNullDesC8
+        // it means that the string ends with delimiter;
+        // Therefore, KNullDesC8 must NOT be added as a
+        // result of "tailing delimiter".
+
+        // Add all other tokens here; even KNullDesC8
+        // gets added, if it is eiher first or 
+        TPtrC8* token = new (ELeave) TPtrC8();
+        token->Set(content);
+        aTokens.Append(token);
+        }    
+    if (aTokens.Count() == 0)
+        {
+        return KErrNotFound;
+        }
+    return KErrNone;
+    }
+    
+const TDesC8& CSenPropertiesElement::LocalName() const
+    {
+    if ( !ipStringPool )
+        {
+        return CSenXmlElement::LocalName();
+        }
+    else
+        {
+        return iLocalName.DesC();
+        }
+    }
+    
+void CSenPropertiesElement::Set( const TDesC8& aNamespaceURI,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName )
+    {
+    if ( !ipStringPool )
+        {
+        CSenXmlElement::Set(aNamespaceURI, aLocalName, aQName);
+        }
+    else
+        {
+        RString localName;
+        TInt leaveCode(KErrNone);
+        TRAP( leaveCode, localName = ipStringPool->OpenStringL(aLocalName); )
+        if( !leaveCode )
+            {
+            iLocalName.Close();
+            iLocalName = localName;
+        
+            TPtrC8 prefix(KNullDesC8);
+    
+            if(aQName != KNullDesC8)
+                {
+                TInt colon(KErrNotFound);
+                colon = aQName.Locate(':');
+                if(colon!=KErrNotFound)
+                    {
+                    prefix.Set(aQName.Left(colon));
+                    }
+                }
+            TRAP( leaveCode, SetNamespaceL(prefix, aNamespaceURI); )
+            leaveCode=0; // ignored
+            } // else { // ipStringPool->OpenStringL leaved(!) }
+        }
+    }
+    
+TBool CSenPropertiesElement::HasContent() const
+    {
+    if ( !ipStringPool )
+        {
+        return CSenXmlElement::HasContent();
+        }
+    else
+        {
+        return (iContent.DesC().Length() > 0);
+        }
+    }
+
+TPtrC8 CSenPropertiesElement::Content() const
+    {
+    if ( !ipStringPool )
+        {
+        return CSenXmlElement::Content();
+        }
+    else
+        {
+        return TPtrC8(iContent.DesC());
+        }
+    }
+    
+TPtrC8 CSenPropertiesElement::SetContentL(const TDesC8& aContent)
+    {
+    if ( !ipStringPool )
+        {
+        return CSenXmlElement::SetContentL(aContent);
+        }
+    else
+        {
+        iContent.Close();
+        iContent = ipStringPool->OpenStringL(aContent);
+        return TPtrC8(iContent.DesC());
+        }
+    }
+    
+void CSenPropertiesElement::AllocContentBufL()
+    {
+    if ( !ipStringPool )
+        {
+        CSenXmlElement::AllocContentBufL();
+        }
+    }
+    
+RWriteStream& CSenPropertiesElement::ContentWriteStreamL()
+    {
+    if ( !ipStringPool )
+        {
+        return CSenXmlElement::ContentWriteStreamL();
+        }
+    else
+        {
+        return CSenXmlElement::ContentWriteStreamL();
+        }
+    }
+    
+void CSenPropertiesElement::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    if ( !ipStringPool )
+        {
+        CSenXmlElement::WriteAsXMLToL(aWriteStream);
+        }
+    else
+        {
+        // Find out whether we should declare the namespace
+        TPtrC8 nsPrefix = NsPrefix();
+
+        // Element name
+        aWriteStream.WriteL(KSenLessThan);
+        if (nsPrefix.Length() > 0)
+            {
+            aWriteStream.WriteL(nsPrefix);
+            aWriteStream.WriteL(KSenColon);
+            }
+        aWriteStream.WriteL(iLocalName.DesC());
+
+        
+        WriteNamespacesToL(aWriteStream);
+        WriteAttrsToL(aWriteStream);
+
+        // Elements and content
+        RPointerArray<CSenElement> elements =  ElementsL();
+        if ((elements.Count() > 0) || HasContent())
+            {
+            aWriteStream.WriteL(KSenGreaterThan);
+
+            // Body
+            WriteElementsToL(aWriteStream);
+            WriteContentToL(aWriteStream);
+
+            // Closing element
+            aWriteStream.WriteL(KSenLessThanSlash);
+            if (nsPrefix.Length() > 0)
+                {
+                aWriteStream.WriteL(nsPrefix);
+                aWriteStream.WriteL(KSenColon);
+                }
+            aWriteStream.WriteL(iLocalName.DesC());
+            aWriteStream.WriteL(KSenGreaterThan);
+            }
+        else
+            {
+            aWriteStream.WriteL(KSenSlashGreaterThan);
+            }
+        }
+    }
+    
+
+RStringPool& CSenPropertiesElement::StringPool()
+    {
+//    __ASSERT_ALWAYS(ipStringPool, User::Panic(KPanic, EStringPoolNotInitialized));
+    return *ipStringPool;
+    }
+    
+void CSenPropertiesElement::SetStringPool(RStringPool& aStringPool)
+    {
+    ipStringPool = &aStringPool;
+    }
+    
+    
+// END OF FILE
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senpropertiesfragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <SenXmlUtils.h>
+#include "senpropertiesfragment.h"
+#include "senpropertieselement.h"
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    pNew->ipStringPool = aStringPool;
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        const CSenElement& aElement,
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aElement, aStringPool);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        const TDesC8& aLocalName,
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName, aStringPool);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aStringPool);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs,
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttrs, aStringPool);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs,
+                                        CSenElement& aParent,
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttrs, aParent,
+                         aStringPool);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenPropertiesFragment* CSenPropertiesFragment::NewL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        RStringPool* aStringPool)
+    {
+    CSenPropertiesFragment* pNew = new (ELeave) CSenPropertiesFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aStringPool);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+CSenPropertiesFragment::~CSenPropertiesFragment()
+    {
+    }
+
+CSenPropertiesFragment::CSenPropertiesFragment()
+    {
+    }
+
+void CSenPropertiesFragment::BaseConstructL(const CSenElement& aElement,
+                                            RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    ipElement = CSenPropertiesElement::NewL(aElement.LocalName(),
+                                            ipStringPool);
+    ipElement->CopyFromL((CSenElement&)aElement);
+    }
+
+void CSenPropertiesFragment::BaseConstructL(const TDesC8& aLocalName,
+                                            RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    ipElement = CSenPropertiesElement::NewL(aLocalName, ipStringPool);
+    }
+
+void CSenPropertiesFragment::BaseConstructL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    ipElement = CSenPropertiesElement::NewL(aNsUri, aLocalName, ipStringPool);
+    }
+
+void CSenPropertiesFragment::BaseConstructL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs,
+                                        RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    ipElement = CSenPropertiesElement::NewL(aNsUri, aLocalName, aQName,
+                                            aAttrs, ipStringPool);
+    }
+
+void CSenPropertiesFragment::BaseConstructL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs,
+                                        CSenElement& aParent,
+                                        RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    // this transfers the ipElement ownership to the parent(!)
+    ipElement = CSenPropertiesElement::NewL(aNsUri, aLocalName, aQName, aAttrs,
+                                            aParent, ipStringPool);
+    }
+
+void CSenPropertiesFragment::BaseConstructL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        RStringPool* aStringPool
+    )
+    {
+    ipStringPool = aStringPool;
+    ipElement = CSenPropertiesElement::NewL(aNsUri, aLocalName, aQName,
+                                            ipStringPool);
+    }
+
+void CSenPropertiesFragment::BaseConstructL(CSenXmlReader& aReader,
+                                            RStringPool* aStringPool)
+    {
+    ipStringPool = aStringPool;
+    CSenDomFragment::BaseConstructL(aReader);
+    }
+    
+void CSenPropertiesFragment::ExpandL(
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs)
+    {
+
+    if(ipDomDelegate)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipDomDelegate->ExtractElement();
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+
+    // delegate parsing to a new DOMFragment,
+    // until we encounter the end of an element with the given qualified name
+    ipDomDelegate = CSenPropertiesFragment::NewL(aNsUri,
+                                                 aLocalName,
+                                                 aQName,
+                                                 aAttrs,
+                                                 *ipElement,
+                                                 ipStringPool);
+
+    ipElement->AddElementL(ipDomDelegate->AsElement());
+
+    DelegateParsingL(*ipDomDelegate); // note that the parsing is actually
+                                      // performed AFTER the StartElement()
+                                      // method, which called this ExpandL()
+                                      // has been fully executed (this is an
+                                      // async signal send to the _same_
+                                      // parser(!)
+    }
+    
+
+void CSenPropertiesFragment::StartElementL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttrs)
+    {
+    if(!ipElement)
+        {
+        ipElement = CSenPropertiesElement::NewL(aNsUri, aLocalName, aQName,
+                                                ipStringPool);
+        }
+        
+    if ( !ipStringPool )
+        {
+        AllocContentSaverL();
+        }
+
+    if(iState == KStateIgnore)
+        {
+        const TDesC8& localName = ipElement->LocalName();
+        const TDesC8& nsUri = ipElement->NamespaceURI();
+
+        if(localName == aLocalName && nsUri == aNsUri)
+            {
+            iState = KStateSave; // IOP
+            SetAttributesL(aAttrs);
+            }
+        }
+    else if((iState & KStateSave) == KStateSave)
+        {
+        // When a new property is parsed, any existing one (with same [local] name) must be removed first
+        CSenElement* pElement = AsElement().RemoveElement(aNsUri, aLocalName);
+        delete pElement;
+        
+        ExpandL(aNsUri, aLocalName, aQName, aAttrs);
+        }
+    }
+    
+void CSenPropertiesFragment::EndElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CSenDomFragment::EndElementL(aNsUri, aLocalName, aQName);
+    }
+    
+void CSenPropertiesFragment::CharactersL(
+    const TDesC8& aChars,
+    const TInt /*aStart*/,
+    const TInt /*aLength*/
+    )
+    {
+    if ( !ipStringPool )
+        {
+        AllocContentSaverL();
+
+        HBufC8* pCharsCopy = NULL;
+        
+        if (SenXmlUtils::DecodeHttpCharactersL(aChars, pCharsCopy))
+            {
+            CleanupStack::PushL(pCharsCopy);
+            iWs.WriteL(*pCharsCopy);
+            CleanupStack::PopAndDestroy(); // pCharsCopy
+            }
+        else
+            {
+            delete pCharsCopy;
+            iWs.WriteL(aChars);
+            }
+        }
+    else
+        {
+        ipElement->SetContentL(aChars);
+        }
+    }
+    
+void CSenPropertiesFragment::AllocContentSaverL()
+    {
+    if ( !ipStringPool )
+        {
+        CSenBaseFragment::AllocContentSaverL();
+        }
+    }    
+    
+RStringPool& CSenPropertiesFragment::StringPool()
+    {
+    return *ipStringPool;
+    }
+    
+void CSenPropertiesFragment::SetStringPool(RStringPool& aStringPool)
+    {
+    ipStringPool = &aStringPool;
+    }
+    
+TBool CSenPropertiesFragment::HasStringPool() const
+    {
+    return ( ipStringPool ) ? ETrue : EFalse;
+    }
+
+// END OF FILE
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sensaxutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,551 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:       
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "sensaxutils.h"
+#include <SenXmlConstants.h>
+
+
+EXPORT_C TInt SenSaxUtils::SearchStartTagL(const TDesC8& aDocument,
+                                           const TDesC8& aLocalName,
+                                           TInt& aStartTagStart,
+                                           TInt& aStartTagEnd,
+                                           TPtrC8& aPrefix)
+    {
+    return SearchStartTagL(aDocument, aLocalName, aStartTagStart, aStartTagEnd,
+                           aPrefix, EFalse);
+    }
+
+
+EXPORT_C TInt SenSaxUtils::SearchStartTagL(const TDesC8& aDocument,
+                                           const TDesC8& aPrefix,
+                                           const TDesC8& aLocalName,
+                                           TInt& aStartTagStart,
+                                           TInt& aStartTagEnd)
+    {
+    TPtrC8 tmpPrefix(aPrefix);
+    return SearchStartTagL(aDocument, aLocalName, aStartTagStart, aStartTagEnd,
+                           tmpPrefix, ETrue);
+    }
+
+EXPORT_C TInt SenSaxUtils::SearchEndTagL(const TDesC8& aDocument,
+                                                const TDesC8& aLocalName,
+                                                TInt& aEndTagStart,
+                                                TInt& aEndTagEnd,
+                                                TPtrC8& aPrefix)
+    {
+    return SearchEndTagL(aDocument, aLocalName, aEndTagStart, aEndTagEnd,
+                         aPrefix, EFalse);
+    }
+
+EXPORT_C TInt SenSaxUtils::SearchEndTagL(const TDesC8& aDocument,
+                                                const TDesC8& aPrefix,
+                                                const TDesC8& aLocalName,
+                                                TInt& aEndTagStart,
+                                                TInt& aEndTagEnd)
+    {
+    TPtrC8 tmpPrefix(aPrefix);
+    return SearchEndTagL(aDocument, aLocalName, aEndTagStart, aEndTagEnd,
+                         tmpPrefix, ETrue);
+    }
+
+TInt SenSaxUtils::SearchStartTagL(const TDesC8& aDocument,
+                                  const TDesC8& aLocalName,
+                                  TInt& aStartTagStart,
+                                  TInt& aStartTagEnd,
+                                  TPtrC8& aPrefix,
+                                  TBool aSearchPrefix = EFalse)
+
+    {
+    TPtrC8 localNamePtr(KNullDesC8);
+    TPtrC8 stPrefixPtr(KNullDesC8);
+        
+    TInt i;
+    TBool tagFound(EFalse);
+    TInt colon(KErrNotFound);
+    TInt lessThan(KErrNotFound);
+    TInt space(KErrNotFound);
+    
+    TInt size = aDocument.Size()-(aLocalName.Size()+3); // </a> <=> at least size-4
+    TPtrC8 currentCharacter(KNullDesC8);
+    for (i = 0; i < size; i++)
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        
+        // ************* Handle Quotes <=> ' or " ******** //
+        if ( currentCharacter == KSenDblQuot ) // Check "\""
+            {
+            i = SearchMarkStartingFromPlus(aDocument, KSenDblQuot, i+1, size);
+            if ( i == KErrNotFound )
+                {
+                return i;
+                }
+            }
+        else if ( currentCharacter == KSenQuot ) // Check "'"
+            {
+            i = SearchMarkStartingFromPlus(aDocument, KSenQuot, i+1, size);
+            if ( i == KErrNotFound )
+                {
+                return i;
+                }
+            }
+        else
+            {
+            // ************* Handle "<" ****************** //
+            if ( currentCharacter == KSenLessThan )   // Check "<"
+                {
+                currentCharacter.Set(aDocument.Ptr()+i,4);
+                // ************* Handle comments ********* //
+                if ( currentCharacter == KSenXmlCommentStart )          // Check "<!--"
+                    {
+                    i+=3;
+                    i = SearchEndOfCommentStartingFrom(aDocument, i, size);
+                    if ( i == KErrNotFound )
+                        {
+                        return i;
+                        }
+                    }
+                else
+                    {
+                    currentCharacter.Set(aDocument.Ptr()+i,2);
+                    if ( currentCharacter == KSenXmlInstructionStart || // Check "<?"
+                         currentCharacter == KSenXmlEntityStart ||      // Check "<!"
+                         currentCharacter == KSenLessThanSlash )        // Check "<\"
+                        {
+                        i+=1;
+                        i = SearchMatchingGreaterThanStartingFrom(aDocument,
+                                                                  i,
+                                                                  size);
+                        if ( i == KErrNotFound )
+                            {
+                            return i;
+                            }
+                        }
+                    else
+                        {
+                        colon = KErrNotFound;
+                        space = KErrNotFound;
+                        lessThan = i;
+                        }
+                    }
+                }
+            // ************* Handle ">" ****************** //                
+            else if ( currentCharacter == KSenGreaterThan ) // Check ">"
+                {
+                if ( lessThan != KErrNotFound )
+                    {
+                    if ( colon != KErrNotFound )
+                        {
+                        // Both Prefix and LocalName can be found.
+                        if ( space != KErrNotFound )
+                            {
+                            localNamePtr.Set(aDocument.Ptr()+colon+1, space-colon-1);
+                            }
+                        else
+                            {
+                            localNamePtr.Set(aDocument.Ptr()+colon+1, i-colon-1);
+                            }
+                        if ( !aSearchPrefix )
+                            {
+                            aPrefix.Set(aDocument.Ptr()+lessThan+1, colon-lessThan-1);
+                            }
+                        else
+                            {
+                            stPrefixPtr.Set(aDocument.Ptr()+lessThan+1, colon-lessThan-1);
+                            }
+                        }
+                    else
+                        {
+                        // Only LocalName can be found.
+                        if ( space != KErrNotFound )
+                            {
+                            localNamePtr.Set(aDocument.Ptr()+lessThan+1, space-lessThan-1);
+                            }
+                        else
+                            {
+                            localNamePtr.Set(aDocument.Ptr()+lessThan+1, i-lessThan-1);
+                            }
+                        stPrefixPtr.Set(KNullDesC8);                            
+                        }
+
+                    if ( localNamePtr == aLocalName )
+                        {
+                        if ( aSearchPrefix )              
+                            {
+                            if ( stPrefixPtr == aPrefix )
+                                {
+                                tagFound = ETrue;
+                                break;
+                                }
+                            else
+                                {
+                                tagFound = EFalse;
+                                lessThan = KErrNotFound;
+                                colon = KErrNotFound;
+                                space = KErrNotFound;
+                                }
+                            }
+                        else
+                            {
+                            tagFound = ETrue;
+                            break;
+                            }
+                        }
+                    else
+                        {
+                        tagFound = EFalse;
+                        lessThan = KErrNotFound;
+                        colon = KErrNotFound;
+                        space = KErrNotFound;
+                        }
+                    }
+                }
+            // ************* Handle ":" ****************** //                
+            else if ( currentCharacter == KSenColon ) // Check ":"
+                {
+                if ( lessThan != KErrNotFound &&
+                     space == KErrNotFound &&
+                     colon == KErrNotFound )
+                    {
+                    colon = i;
+                    }
+                }
+            // ************* Handle " " ****************** //                
+            else if ( currentCharacter == KSenSpace ) // Check " "
+                {
+                if ( lessThan != KErrNotFound && 
+                     space == KErrNotFound )
+                    {
+                    space = i;
+                    }
+                }
+            }        
+        }
+
+    if ( tagFound )
+        {
+        aStartTagStart   = lessThan;
+        aStartTagEnd     = i;
+        }
+    else
+        {
+        aStartTagStart   = KErrNotFound;
+        aStartTagEnd     = KErrNotFound;
+        return KErrNotFound;
+        }
+
+    return KErrNone;
+    }
+
+TInt SenSaxUtils::SearchEndTagL(const TDesC8& aDocument,
+                                const TDesC8& aLocalName,
+                                TInt& aEndTagStart,
+                                TInt& aEndTagEnd,
+                                TPtrC8& aPrefix,
+                                TBool aSearchPrefix)
+    {
+    // Search EndTag starting from the end
+    // of XML Document
+    TPtrC8 localNamePtr(KNullDesC8);
+    TPtrC8 etPrefixPtr(KNullDesC8);
+    
+    TInt colon(KErrNotFound);
+    TInt greaterThan(KErrNotFound);
+    TBool tagFound      = EFalse;
+
+    TInt i=aDocument.Size()-1;
+    TPtrC8 currentCharacter(KNullDesC8);
+    for (; i > 2; i--)
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        
+        // ************* Handle Quotes <=> ' or " ******** //
+        if ( currentCharacter == KSenDblQuot ) // Check "\""
+            {
+            i = SearchMarkStartingFromMinus(aDocument, KSenDblQuot, i-1);
+            if ( i == KErrNotFound )
+                {
+                return i;
+                }
+            }
+        else if ( currentCharacter == KSenQuot ) // Check "'"
+            {
+            i = SearchMarkStartingFromMinus(aDocument, KSenQuot, i-1);
+            if ( i == KErrNotFound )
+                {
+                return i;
+                }
+            }
+        else
+            {
+            // ************* Handle ">" ****************** //
+            if ( currentCharacter == KSenGreaterThan ) // Check ">"
+                {
+                currentCharacter.Set(aDocument.Ptr()+i-2,3);
+                // ************* Handle comments ********* //
+                if ( currentCharacter == KSenXmlCommentEnd ) // Check "-->"
+                    {
+                    i-=3;
+                    i = SearchStartOfCommentStartingFrom(aDocument, i);
+                    if ( i == KErrNotFound )
+                        {
+                        return i;
+                        }
+                    }
+                else
+                    {
+                    greaterThan = i;
+                    colon = KErrNotFound;
+                    }
+                }
+            // ************* Handle "<" ****************** //
+            else if ( currentCharacter == KSenLessThan ) // Check "<"
+                {
+                currentCharacter.Set(aDocument.Ptr()+i,2);
+                if ( currentCharacter == KSenXmlInstructionStart || // Check "<?"
+                     currentCharacter == KSenXmlEntityStart)        // Check "<!" 
+                    {
+                    greaterThan = KErrNotFound;
+                    colon = KErrNotFound;
+                    }
+                else if ( currentCharacter == KSenLessThanSlash )   // Check "</"
+                    {
+                    if ( greaterThan != KErrNotFound )
+                        {
+                        if ( colon != KErrNotFound )
+                            {
+                            // Both Prefix and LocalName was found.
+                            localNamePtr.Set(aDocument.Ptr()+colon+1, greaterThan-colon-1);
+                            if ( !aSearchPrefix )
+                                {
+                                aPrefix.Set(aDocument.Ptr()+i+2, colon-i-2);
+                                }
+                            else
+                                {
+                                etPrefixPtr.Set(aDocument.Ptr()+i+2, colon-i-2);
+                                }
+                            }
+                        else
+                            {
+                            // Only LocalName was found.
+                            localNamePtr.Set(aDocument.Ptr()+i+2, greaterThan-i-2);
+                            etPrefixPtr.Set(KNullDesC8);
+                            }
+
+                        if ( localNamePtr == aLocalName )
+                            {
+                            if ( aSearchPrefix )              
+                                {
+                                if ( etPrefixPtr == aPrefix )
+                                    {
+                                    tagFound = ETrue;
+                                    break;
+                                    }
+                                else
+                                    {
+                                    tagFound = EFalse;
+                                    greaterThan = KErrNotFound;
+                                    colon = KErrNotFound;
+                                    }
+                                }
+                            else
+                                {
+                                tagFound = ETrue;
+                                break;
+                                }
+                            }
+                        else
+                            {
+                            tagFound = EFalse;
+                            greaterThan = KErrNotFound;
+                            colon = KErrNotFound;
+                            }
+                        }
+                    }
+                }
+            else if ( currentCharacter == KSenColon ) // Check ":"
+                {
+                if ( greaterThan != KErrNotFound )
+                    {
+                    colon = i;
+                    }
+                }
+            }
+        }
+        
+    if ( tagFound )
+        {
+        aEndTagStart = i;
+        aEndTagEnd   = greaterThan;
+        }
+    else
+        {
+        aEndTagStart = KErrNotFound;
+        aEndTagEnd   = KErrNotFound;
+        return KErrNotFound;
+        }
+        
+    return KErrNone;
+    }
+
+TInt SenSaxUtils::SearchMarkStartingFromPlus(const TDesC8& aDocument,
+                                             const TDesC8& aMark,
+                                             TInt position,
+                                             TInt size)
+    {
+    TPtrC8 currentCharacter;
+    TInt i = position;
+    for (; i < size; i++ )
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        if ( currentCharacter == aMark )
+            {
+            return i;
+            }
+        }
+    
+    return KErrNotFound;
+    }
+
+TInt SenSaxUtils::SearchMarkStartingFromMinus(const TDesC8& aDocument,
+                                              const TDesC8& aMark,
+                                              TInt position)
+    {
+    TPtrC8 currentCharacter;
+    TInt i = position;
+    for (; i >= 0; i--)
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        if ( currentCharacter == aMark )
+            {
+            return i;
+            }
+        }
+    
+    return KErrNotFound;
+    }
+
+TInt SenSaxUtils::SearchMatchingGreaterThanStartingFrom(const TDesC8& aDocument,
+                                                        TInt position,
+                                                        TInt size)
+    {
+    TInt lessThanCount = 1;
+    TPtrC8 currentCharacter;
+    
+    for (TInt i = position; i < size; i++)
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        
+        if ( currentCharacter == KSenDblQuot ) // Check "\""
+            {
+            i = SearchMarkStartingFromPlus(aDocument, KSenDblQuot, i+1, size);
+            if ( i == KErrNotFound )
+                {
+                return i;
+                }
+            }
+        else if ( currentCharacter == KSenQuot ) // Check "'"
+            {
+            i = SearchMarkStartingFromPlus(aDocument, KSenQuot, i+1, size);
+            if ( i == KErrNotFound )
+                {
+                return i;
+                }
+            }
+        else
+            {
+            if ( currentCharacter == KSenLessThan )   // Check "<"
+                {
+                currentCharacter.Set(aDocument.Ptr()+i,4);
+                if ( currentCharacter == KSenXmlCommentStart )          // Check "<!--"
+                    {
+                    i+=3;
+                    i = SearchEndOfCommentStartingFrom(aDocument, i, size);
+                    }
+                else
+                    {
+                    lessThanCount++;
+                    }
+                }
+            else if ( currentCharacter == KSenGreaterThan ) // Check ">"
+                {
+                lessThanCount--;
+                if ( lessThanCount == 0)
+                    {
+                    return i;
+                    }
+                }
+            }            
+        }
+    
+    return KErrNotFound;
+    }
+
+TInt SenSaxUtils::SearchEndOfCommentStartingFrom(const TDesC8& aDocument,
+                                                 TInt position,
+                                                 TInt size)
+    {
+    TPtrC8 currentCharacter;
+
+    for (TInt i = position; i < size; i++)
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        
+        if ( currentCharacter == KSenGreaterThan ) // Check ">"
+            {
+            currentCharacter.Set(aDocument.Ptr()+i-2,3);
+            if ( currentCharacter == KSenXmlCommentEnd ) // Check "-->"
+                {
+                return i;
+                }
+            }
+        }
+        
+    return KErrNotFound;        
+    }
+
+TInt SenSaxUtils::SearchStartOfCommentStartingFrom(const TDesC8& aDocument,
+                                                   TInt position)
+    {
+    TPtrC8 currentCharacter;
+
+    for (TInt i = position; i >= 0; i--)
+        {
+        currentCharacter.Set(aDocument.Ptr()+i,1);
+        
+        if ( currentCharacter == KSenLessThan ) // Check "<"
+            {
+            currentCharacter.Set(aDocument.Ptr()+i,4);
+            if ( currentCharacter == KSenXmlCommentStart ) // Check "<!--"
+                {
+                return i;
+                }
+            }
+        }
+        
+    return KErrNotFound;        
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sensoapenvelope.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,513 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <s32strm.h>
+
+#include <SenXmlElement.h>
+#include <SenXmlUtils.h>
+#include <SenDomFragment.h>
+
+#include "SenSoapEnvelope.h"
+#include "SenSoapFault.h"
+#include "senlogger.h"
+
+#ifdef _SENDEBUG
+namespace
+    {
+     _LIT8(KVersionMismatchFormat8,  "Fault.SOAP1.2 : %S");
+    }
+
+#endif // _SENDEBUG
+
+EXPORT_C CSenSoapEnvelope* CSenSoapEnvelope::NewL()
+    {
+    CSenSoapEnvelope* pNew = new (ELeave) CSenSoapEnvelope();
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C void CSenSoapEnvelope::BaseConstructL(TSOAPVersion aVersion)
+    {
+    if (aVersion != ESOAP12)
+        {
+        CSenBaseFragment::BaseConstructL(KSenSoapEnvelopeXmlns, KSenSoapEnvelopeName, KSenSoapEnvelopeQName);
+        }
+    else
+        {
+        CSenBaseFragment::BaseConstructL(KSenSoap12EnvelopeXmlns, KSenSoapEnvelopeName, KSenSoapEnvelopeQName);
+        }
+    }
+
+EXPORT_C void CSenSoapEnvelope::BaseConstructL()
+    {
+    BaseConstructL(ESOAP11);
+    }
+
+CSenSoapEnvelope::CSenSoapEnvelope()
+:   ipBodyFragment(NULL),
+    ipHeaderFragment(NULL),
+    ipSoapAction(NULL),
+    iFault(EFalse)
+    {
+    }
+
+EXPORT_C CSenSoapEnvelope::~CSenSoapEnvelope()
+    {
+    if(ipBodyFragment)
+        {
+        ipBodyFragment->ExtractElement();
+        delete ipBodyFragment;
+        }
+    if(ipHeaderFragment)
+        {
+        ipHeaderFragment->ExtractElement(); // // delegate's element is owned by us
+        delete ipHeaderFragment;
+        }
+    delete ipSoapAction;
+    }
+
+EXPORT_C void CSenSoapEnvelope::StartElementL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName, 
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& aAttributes)
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            // check if we encounter the start of a soap:Envelope...
+            if(!ipElement && aNsUri == NsUri() &&
+                aLocalName == KSenSoapEnvelopeName)
+                {
+                ipElement = CSenXmlElement::NewL(aNsUri, aLocalName, aQName);
+                }
+            if (ipElement && aLocalName == KSenSoapEnvelopeName && aNsUri!=NsUri())
+                {
+                TLSLOG_FORMAT((KSenFaultsLogChannel, KSenFaultsLogLevel, KVersionMismatchFormat8, &KVersionMismatch()));
+                delete ipElement;
+                ipElement = NULL;
+                CSenBaseFragment::BaseConstructL(aNsUri, aLocalName, aQName);
+                }
+            if(ipElement && ipElement->LocalName() == aLocalName &&
+                            ipElement->NamespaceURI() == aNsUri)
+                {
+                if ( ipElement->NsPrefix() != SenXmlUtils::NsPrefix(aQName) )
+                    {
+                    delete ipElement;
+                    ipElement = NULL;
+                    CSenBaseFragment::BaseConstructL(aNsUri, aLocalName, aQName);
+                    }
+                else
+                    {
+                    ipElement->Set(aNsUri, aLocalName, aQName);
+                    }
+
+                SetAttributesL(aAttributes);    // results in
+                }
+
+            else if(aNsUri == NsUri())
+                {
+                // we are interested in SOAP Header
+                if(aLocalName == KSenSoapEnvelopeHeaderName)
+                    {
+                    iState = KStateParsingSoapHeader;
+
+                    // Make sure that header element exists:
+                    // == this ensures that we add a "Header"
+                    // element to the children:
+                    CSenElement& header = HeaderL();
+                    header.Set(aNsUri, aLocalName, aQName);
+                    header.AddAttributesL(aAttributes);
+                    }
+                else if(aLocalName == KSenSoapEnvelopeBodyName)
+                    {
+                    iState = KStateParsingSoapBody;
+
+                    CSenElement& body = BodyL();
+                    body.Set(aNsUri, aLocalName, aQName);
+                    body.AddAttributesL(aAttributes);
+                    }
+                //ESLI-6WEN9V
+                //This case is to handle fault which lies outside the body or without body
+                else if(aLocalName == KSenSoapFaultName)
+                    {
+                    iFault = ETrue;
+                    // delegate parsing to a SOAPFaultFragment to keep
+                    // a structured representation.
+                    CSenSoapFault* pSOAPFault =
+                        CSenSoapFault::NewL(aNsUri, aLocalName, aQName, aAttributes);
+                    CleanupStack::PushL(pSOAPFault);
+                    // use DOM fragment copy constructor to get correct type
+                    // of element inside of it.
+                    ipBodyFragment = CSenDomFragment::NewL(*pSOAPFault);
+                    CleanupStack::PopAndDestroy(); // pSOAPFault
+                    ipBodyFragment->SetOwner(*this);
+                    BodyL().AddElementL(ipBodyFragment->AsElement());
+                    ipBodyFragment->ParseWithL(*Reader());
+                    }
+                //ESLI-6WEN9V
+                }
+            break;
+            }
+        case KStateParsingSoapHeader:
+            {
+            ParseHeaderL(aNsUri, aLocalName, aQName, aAttributes);
+            }
+            break;
+        case KStateParsingSoapBody:
+            {
+            if(ipBodyFragment)
+                {
+                ipBodyFragment->ExtractElement();
+                delete ipBodyFragment;
+                ipBodyFragment = NULL;
+                }
+
+            // check if we encounter a Fault
+            if (aLocalName == KSenSoapFaultName)
+                {
+                iFault = ETrue;
+                // delegate parsing to a SOAPFaultFragment to keep
+                // a structured representation.
+                CSenSoapFault* pSOAPFault =
+                    CSenSoapFault::NewL(aNsUri, aLocalName, aQName, aAttributes);
+                CleanupStack::PushL(pSOAPFault);
+                // use DOM fragment copy constructor to get correct type
+                // of element inside of it.
+                ipBodyFragment = CSenDomFragment::NewL(*pSOAPFault);
+                CleanupStack::PopAndDestroy(); // pSOAPFault
+                ipBodyFragment->SetOwner(*this);
+                BodyL().AddElementL(ipBodyFragment->AsElement());
+                ipBodyFragment->ParseWithL(*Reader());
+                }
+            else
+                {
+                ipBodyFragment =
+                    CSenBaseFragment::NewL( aNsUri,
+                                            aLocalName,
+                                            aQName,
+                                            aAttributes);
+
+                ipBodyFragment->SetOwner(*this);
+                BodyL().AddElementL(ipBodyFragment->AsElement());
+                ipBodyFragment->ParseWithL(*Reader());
+                }
+            }
+            break;
+        default:
+            break;
+        }
+    }
+
+EXPORT_C void CSenSoapEnvelope::EndElementL(const TDesC8& aNsUri, 
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& /*aQName*/)
+    {
+    switch (iState)
+        {
+        case KStateIgnore:
+            {
+            break;
+            }
+        case KStateParsingSoapHeader:
+            {
+            if (aNsUri == NsUri() && aLocalName == KSenSoapEnvelopeHeaderName)
+                {
+                iState = KStateIgnore;
+                }
+            break;
+            }
+        case KStateParsingSoapBody:
+            {
+            if (aNsUri == NsUri() && aLocalName == KSenSoapEnvelopeBodyName)
+                {
+                iState = KStateIgnore;
+                }
+/*
+              else
+                {
+                if(ipBodyFragment)
+                    {
+                    //ipBodyFragment->EnsureNamespacesL();
+                    }
+                } 
+*/
+            }
+            break;
+        default:
+            break;
+        }
+    }
+
+EXPORT_C TPtrC8 CSenSoapEnvelope::SetBodyL(const TDesC8& aBody)
+    {
+    return BodyL().SetContentL(aBody);
+    }
+
+EXPORT_C CSenElement& CSenSoapEnvelope::BodyL()
+    {
+    CSenElement& envelope = this->AsElement();
+    CSenElement* pBody = envelope.Element(NsUri(), KSenSoapEnvelopeBodyName);
+    if (pBody == NULL)
+        {
+        pBody = &envelope.AddElementL(NsUri(), KSenSoapEnvelopeBodyName);
+        }
+    return *pBody;
+    }
+
+EXPORT_C CSenElement& CSenSoapEnvelope::HeaderL()
+    {
+    CSenElement& envelope = this->AsElement();
+    CSenElement* pHeader = envelope.Element(NsUri(), KSenSoapEnvelopeHeaderName);
+    if (!pHeader)
+        {
+        // add it
+        CSenElement& body = BodyL();
+        pHeader = envelope.CreateElementL(envelope.NsPrefix(), KSenSoapEnvelopeHeaderName);
+        if (pHeader)
+            {
+            envelope.InsertElementL(*pHeader,body);
+            }
+        }
+    return *pHeader; 
+    }
+
+EXPORT_C CSenElement& CSenSoapEnvelope::AddHeaderL(CSenElement& aHeaderElement)
+    {
+    return (HeaderL().AddElementL(aHeaderElement));
+    }
+
+EXPORT_C void CSenSoapEnvelope::ParseHeaderL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes)
+    {
+    if(ipHeaderFragment)
+        {
+        ipHeaderFragment->ExtractElement();
+        delete ipHeaderFragment;
+        ipHeaderFragment = NULL;
+        }
+    ipHeaderFragment = CSenDomFragment::NewL(aNsUri, aLocalName, aQName, aAttributes);
+    ipHeaderFragment->SetOwner(*this); // to ensure we will return to this class' endElement method
+    
+    HeaderL().AddElementL(ipHeaderFragment->AsElement()); // transfers ownership
+    ipHeaderFragment->ParseWithL(*iXmlReader);
+    }
+
+
+EXPORT_C HBufC8* CSenSoapEnvelope::BodyAsStringL()
+    {
+    CSenElement& body = BodyL();
+
+
+    HBufC8* bodyAsXML = NULL;
+
+    // Note, that difference to Jave ref-implementation here is,
+    // that in *EVERY* case, no matter if SOAP BODY has no child 
+    // element at all OR if it has one or more childer, the whole
+    // <S:Body> element is ALWAYS returned -- [never just the only
+    // child, and never a of zero-length string, even if no children]
+    CSenElement* pDetachedElement = body.DetachL();
+    if(pDetachedElement)
+        {
+        CleanupStack::PushL(pDetachedElement);
+        bodyAsXML = pDetachedElement->AsXmlL();
+        CleanupStack::PopAndDestroy(); // pDetachedElement
+        return bodyAsXML;
+        }
+        
+    // Function now returns NULL only if SOAP-ENV does not contain
+    // a body at all(!)
+    return bodyAsXML;
+    }
+
+EXPORT_C TBool CSenSoapEnvelope::IsFault()
+    {
+    return iFault;
+    }
+
+// NOTE: caller takes ownership of the NEW fault element
+EXPORT_C CSenSoapFault* CSenSoapEnvelope::DetachFaultL()
+    {
+    CSenElement* pNotOwned = this->BodyL().Element(NsUri(), KSenSoapFaultName);
+    if(pNotOwned)
+        {
+        CSenElement* pDetached = pNotOwned->DetachL();
+        if(pDetached)
+            {
+            CleanupStack::PushL(pDetached);
+            CSenSoapFault* pAnswer = CSenSoapFault::NewL(*pDetached);
+            CleanupStack::PopAndDestroy(); // pDetached
+            return pAnswer;
+            }
+        }
+    return NULL;
+    }
+
+
+EXPORT_C CSenSoapFault* CSenSoapEnvelope::FaultL()
+    {
+    CSenSoapFault* pFault = NULL;
+    if(iFault)
+        {
+        // trust that the element is actually
+        // CSenSoapFault added in StartElementL()
+
+        pFault = (CSenSoapFault*)this->BodyL().Element(NsUri(), KSenSoapFaultName);
+
+        }
+    return pFault;
+    }
+
+EXPORT_C TPtrC8 CSenSoapEnvelope::SetSoapActionL(const TDesC8& aSoapAction)
+    {
+
+    _LIT8(KQuote, "\"");
+
+    HBufC8* pTemp = HBufC8::NewLC(aSoapAction.Length()+(2*KQuote().Length()));  
+
+    TPtr8 temp = pTemp->Des();
+
+    if(aSoapAction != KNullDesC8()
+     && !SenXmlUtils::StartsWith(aSoapAction, KQuote))
+        {
+        temp.Append(KQuote);
+        }
+        
+    temp.Append(aSoapAction);
+
+    if(aSoapAction != KNullDesC8() && !SenXmlUtils::EndsWith(*pTemp, KQuote))
+        {
+        temp.Append(KQuote);
+        }
+
+    if(ipSoapAction)
+        {
+        delete ipSoapAction;
+        ipSoapAction = NULL;
+        }
+        
+   	ipSoapAction = pTemp;
+    
+    CleanupStack::Pop(); // pTemp is now safe
+    return SoapAction2();
+    }
+
+
+EXPORT_C TPtrC8 CSenSoapEnvelope::SoapAction()
+    {
+    if(ipSoapAction)
+        {
+        return ipSoapAction->Des();
+        }
+    else
+        {
+		return KSoapActionHeaderValueEmpty();
+        }
+    
+    }
+
+
+EXPORT_C void CSenSoapEnvelope::ParseL(const TDesC8& aXml)
+    {
+    CSenBaseFragment::ParseL(aXml);
+//    CSenElement& envelope = this->AsElement();
+
+    /*
+    // SOAP Header is not mandatory:
+    CSenElement* pHeader = envelope.Element(KSenSoapEnvelopeXmlns, KSenSoapEnvelopeHeaderName);
+    if(!pHeader)
+        {
+        User::Leave(KErrSenNoSoapHeader);
+        }
+    */
+
+    // We could check body, but then this class could not
+    // be used in cases, where header is parsed from file
+    // or some other source, prior setting the body via
+    // SetBody()
+
+    /*
+    CSenElement* pBody = envelope.Element(KSenSoapEnvelopeXmlns, KSenSoapEnvelopeBodyName);
+    if(!pBody)
+        {
+        User::Leave(KErrSenNoSoapBody);
+        }
+    */
+    }
+
+EXPORT_C TBool CSenSoapEnvelope::HasHeader()
+    {
+    CSenElement& envelope = this->AsElement();
+    // True, if element exists, false otherwise:
+    return (envelope.Element(NsUri(), KSenSoapEnvelopeHeaderName) != NULL);
+    }
+
+EXPORT_C TBool CSenSoapEnvelope::HasBody()
+    {
+    CSenElement& envelope = this->AsElement();
+    // True, if element exists, false otherwise:
+    return (envelope.Element(NsUri(), KSenSoapEnvelopeBodyName) != NULL);
+    }
+
+EXPORT_C TSOAPVersion CSenSoapEnvelope::SoapVersion()
+    {
+    if( NsUri() == KSenSoap12EnvelopeXmlns )
+        {
+        return ESOAP12;
+        }
+    else 
+        {
+        return ESOAP11;
+        }
+    }
+    
+    
+EXPORT_C TPtrC8 CSenSoapEnvelope::SoapAction2()
+    {
+    if(ipSoapAction)
+        {
+        return ipSoapAction->Des();
+        }
+    else
+        {
+        // Note, that zero-length descriptor must be returned
+        // if SetSoapActionL() has not been called. Otherwise,
+        // when passing transport properties over IPC boundary,
+        // code cannot determine whether the caller, who utilizes
+        // CSenSoapEnvelope wishes to override any underlying
+        // value of SOAPAction with "empty" value (== "").
+        // If SOAPAction is set in CSenSoapEnvelope, it is stronger
+        // than message level (SendL/SubmitL in CSenServiceConnection)
+        // or session level (SetTransportPropertiesL) definitions.
+        return KNullDesC8();
+        }
+        
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sensoapfault.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES 
+#include "SenSoapFault.h"
+#include "SenSoapEnvelope.h"
+
+EXPORT_C CSenSoapFault* CSenSoapFault::NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+    {
+    CSenSoapFault* pNew = new (ELeave) CSenSoapFault;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenSoapFault* CSenSoapFault::NewL(CSenElement& aCopiedSource)
+    {
+    CSenSoapFault* pNew = new (ELeave) CSenSoapFault;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aCopiedSource);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+
+EXPORT_C CSenSoapFault::~CSenSoapFault()
+    {
+    }
+
+EXPORT_C CSenSoapFault::CSenSoapFault()
+    {
+    }
+
+EXPORT_C void CSenSoapFault::ConstructL(CSenElement& aCopiedSource)
+    {
+    BaseConstructL(aCopiedSource.LocalName());
+    CopyFromL(aCopiedSource);
+    }
+
+
+EXPORT_C void CSenSoapFault::ConstructL(const TDesC8& aNsUri,
+                             const TDesC8& aLocalName,
+                             const TDesC8& aQName,
+                             const RAttributeArray& aAttributes)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    }
+EXPORT_C TPtrC8 CSenSoapFault::FaultCode()
+    {
+        if (NamespaceURI().Compare(KSenSoap12EnvelopeXmlns)!=0)
+        {
+                
+            CSenElement* pChild = Element(KNullDesC8, KFaultCodeLocalname);
+            if(pChild)
+                {
+                return pChild->Content();
+                }
+        }
+        else
+        {
+            CSenElement* pChild = Element(KFault12CodeLocalname);
+            if (pChild)
+            {
+                CSenElement* pValue = pChild->Element(KFault12ValueLocalname);
+                if (pValue)
+                {
+                    return pValue->Content();
+                }
+            }
+            
+        }
+        return KNullDesC8();
+    }
+
+EXPORT_C TPtrC8 CSenSoapFault::FaultSubcode()
+    {
+        if (NamespaceURI().Compare(KSenSoap12EnvelopeXmlns)==0)
+        {
+            CSenElement* pChild = Element(KFault12CodeLocalname);
+            if (pChild)
+            {
+                CSenElement* pSubcode = pChild->Element(KFault12SubcodeLocalname);
+                if (pSubcode)
+                {
+                    CSenElement* pValue = pSubcode->Element(KFault12ValueLocalname);
+                    if (pValue)
+                    {
+                        return pValue->Content();
+                    }
+                }
+            }
+            
+        }
+        return KNullDesC8();
+    }
+
+
+EXPORT_C TPtrC8 CSenSoapFault::FaultString()
+    {
+        if (NamespaceURI().Compare(KSenSoap12EnvelopeXmlns)!=0)
+        {
+            CSenElement* pChild = Element(KNullDesC8, KFaultStringLocalname);
+            if(pChild)
+                {
+                return pChild->Content();
+                }
+        }
+        else
+        {
+            CSenElement* pChild = Element(KNullDesC8, KFault12ReasonLocalname);
+            if (pChild)
+            {
+                CSenElement* pText = pChild->Element(KFault12TextLocalname);
+                if (pText)
+                {
+                    return pText->Content();
+                }
+            }
+        }
+    return KNullDesC8();    
+    }
+
+EXPORT_C TPtrC8 CSenSoapFault::FaultActor()
+    {
+    CSenElement* pChild = Element(KNullDesC8, KFaultActorLocalname);
+    if(pChild)
+        {
+        return pChild->Content();
+        }
+    return KNullDesC8();    
+    }
+
+EXPORT_C TPtrC8 CSenSoapFault::Detail()
+    {
+        if (NamespaceURI().Compare(KSenSoap12EnvelopeXmlns)!=0)
+        {
+            CSenElement* pChild = Element(KNullDesC8, KDetailLocalname);
+            if(pChild)
+                {
+                return pChild->Content();
+                }
+        }
+        else
+        {
+            CSenElement* pChild = Element(KFault12DetailLocalname);
+            if (pChild)
+            {
+                    return pChild->Content();
+            }
+        }
+    return KNullDesC8();    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sensoapmessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <badesca.h>
+#include <SenXmlReader.h>
+#include <s32mem.h>
+#include <utf.h>
+
+#include "SenWsSecurityHeader.h"
+#include "SenSoapMessage.h"
+
+
+EXPORT_C CSenSoapMessage* CSenSoapMessage::NewL()
+    {
+    CSenSoapMessage* pNew = new (ELeave) CSenSoapMessage;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage* CSenSoapMessage::NewL(TSOAPVersion aVersion)
+    {
+    CSenSoapMessage* pNew = new (ELeave) CSenSoapMessage;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aVersion);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage* CSenSoapMessage::NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs)
+    {
+    CSenSoapMessage* pNew = new (ELeave) CSenSoapMessage;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aVersion, aSecurityNs);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenSoapMessage::~CSenSoapMessage()
+    {
+    if (ipSecurityHeader)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipSecurityHeader->ExtractElement();
+        delete ipSecurityHeader;
+        }
+    }
+EXPORT_C CSenSoapMessage::CSenSoapMessage()
+: ipSecurityHeader(NULL)
+    {
+    }
+
+EXPORT_C void CSenSoapMessage::BaseConstructL()
+    {
+    CSenSoapEnvelope::BaseConstructL();
+    }
+EXPORT_C void CSenSoapMessage::BaseConstructL(TSOAPVersion aVersion)
+    {
+    CSenSoapEnvelope::BaseConstructL(aVersion);
+    }
+
+EXPORT_C void CSenSoapMessage::BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs)
+    {
+    BaseConstructL(aVersion);
+    if ((aSecurityNs == KSecuritySchemeXmlNs) ||(aSecurityNs == KSecurityXmlNs))
+        {
+        ipSecurityHeader = CSenWsSecurityHeader::NewL(KNullDesC8, aSecurityNs);
+        CSenElement& soapHeader = HeaderL();
+        soapHeader.AddElementL(ipSecurityHeader->AsElement());
+        }
+    }
+
+EXPORT_C void CSenSoapMessage::SetSecurityHeaderL(const TDesC8& aData)
+    {
+    CSenWsSecurityHeader* pTemp = NULL;
+    
+    if(aData==KNullDesC8)
+        {
+        // we don't have credential
+        pTemp = NewSecurityHeaderLC(NULL);
+        }
+    else
+        {
+        // there is a credential to add..
+        pTemp = NewSecurityHeaderLC(&aData);
+        }
+
+    delete HeaderL().RemoveElement(pTemp->XmlNs(), KSecurityName);
+    if (ipSecurityHeader)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipSecurityHeader->ExtractElement();
+        delete ipSecurityHeader;
+        ipSecurityHeader = NULL;
+        }
+    ipSecurityHeader = pTemp;
+    CleanupStack::Pop(); // pTemp
+    this->AddHeaderL(ipSecurityHeader->AsElement());
+    }
+
+EXPORT_C void CSenSoapMessage::ParseHeaderL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CSenWsSecurityHeader* pTemp = NewSecurityHeaderLC();
+
+    if ((pTemp->XmlNs() == aNsUri) && (KSecurityName() == aLocalName))
+        {
+        // Remove existing <Security> header
+        delete HeaderL().RemoveElement(pTemp->XmlNs(), KSecurityName);
+        if (ipSecurityHeader)
+            {
+            // We do not own the element, so remove it from the fragment.
+            ipSecurityHeader->ExtractElement();
+            delete ipSecurityHeader;
+            ipSecurityHeader = NULL;
+            }
+        ipSecurityHeader = pTemp;
+        CleanupStack::Pop(); // pTemp
+        DelegateParsingL(*ipSecurityHeader);
+        this->AddHeaderL(ipSecurityHeader->AsElement());
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(); // pTemp
+        CSenSoapEnvelope::ParseHeaderL(
+            aNsUri, 
+            aLocalName, 
+            aQName, 
+            aAttributes);
+        }
+    }
+
+EXPORT_C TInt CSenSoapMessage::AddSecurityTokenL(const TDesC8& aNewToken)
+    {
+    CSenElement& soapHeader = HeaderL();
+
+    CSenWsSecurityHeader* pHeader = NewSecurityHeaderLC();
+
+    CSenElement* wsSecurityHeader = NULL;
+    wsSecurityHeader = soapHeader.Element(pHeader->XmlNs(), KSecurityName);
+
+    if(!wsSecurityHeader)
+        {
+        wsSecurityHeader = pHeader->ExtractElement(); // Let's take ownership
+        soapHeader.AddElementL(*wsSecurityHeader);    // takes ownership
+        }
+    CleanupStack::PopAndDestroy(); // pHeader // safe to delete
+
+    HBufC8* pContent = HBufC8::NewLC(wsSecurityHeader->Content().Length() +
+                                aNewToken.Length());
+
+    TPtr8 content = pContent->Des();
+    content.Append(wsSecurityHeader->Content());
+    content.Append(aNewToken);
+    wsSecurityHeader->SetContentL(content);
+    CleanupStack::PopAndDestroy(); // pContent
+
+    return KErrNone;
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenSoapMessage::NewSecurityHeaderLC(
+                                                const TDesC8* aData)
+    {
+    CSenWsSecurityHeader* pNew = NULL;
+    if(aData)
+        {
+        if (ipSecurityHeader)
+            {
+            pNew = CSenWsSecurityHeader::NewL(*aData, ipSecurityHeader->XmlNs());    
+            }
+        else
+            {
+            pNew = CSenWsSecurityHeader::NewL(*aData);
+            }
+        
+        }
+    else
+        {
+        if (ipSecurityHeader)
+            {
+            pNew = CSenWsSecurityHeader::NewL(KNullDesC8, ipSecurityHeader->XmlNs());    
+            }
+        else
+            {
+            pNew = CSenWsSecurityHeader::NewL();    
+            }
+    }
+    CleanupStack::PushL(pNew);
+    return pNew;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/sentransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,653 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:         
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include <SenXmlUtils.h>
+#include <SenTransportProperties.h>
+#include "senpropertiesfragment.h"
+#include "SenBaseAttribute.h"
+#include <xml/attribute.h> // From syslibs, needed for RAttributeArray
+
+#include "senlogger.h"
+//#include "senxmldebug.h"
+
+namespace
+    {
+    _LIT8(KCid,"cid");
+    }
+
+EXPORT_C CSenTransportProperties* CSenTransportProperties::NewL()
+    {
+    CSenTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenTransportProperties* CSenTransportProperties::NewLC()
+    {
+    CSenTransportProperties* pNew = new (ELeave) CSenTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenTransportProperties* CSenTransportProperties::NewL(const TDesC8& aXmlUtf8,
+                                                               CSenXmlReader& aParser)
+    {
+    CSenTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenTransportProperties* CSenTransportProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                                CSenXmlReader& aParser)
+    {
+    CSenTransportProperties* pNew = new (ELeave) CSenTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+
+EXPORT_C CSenTransportProperties* CSenTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenTransportProperties* CSenTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenTransportProperties* pNew = new (ELeave) CSenTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+    
+EXPORT_C void CSenTransportProperties::SetReader(CSenXmlReader& aReader)
+    {
+    CSenXmlProperties::SetReader(aReader);
+    }      
+
+EXPORT_C MSenProperties::TSenPropertiesClassType CSenTransportProperties::PropertiesClassType() 
+    {
+    return ESenTransportProperties;
+    }
+
+EXPORT_C void CSenTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenXmlProperties::WriteToL(aWriteStream);
+    }
+    
+EXPORT_C void CSenTransportProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    CSenXmlProperties::ReadFromL(aBuffer);
+    }    
+
+EXPORT_C HBufC8* CSenTransportProperties::AsUtf8L()
+    {
+    return CSenXmlProperties::AsUtf8L();
+    }
+
+EXPORT_C HBufC8* CSenTransportProperties::AsUtf8LC()
+    {
+    return CSenXmlProperties::AsUtf8LC();
+    }
+    
+EXPORT_C TBool CSenTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenTransportProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return CSenXmlProperties::IsSafeToCast(aClass);
+        }
+    }      
+    
+EXPORT_C TInt CSenTransportProperties::SetPropertyL(const TDesC8& aName,
+                                                       const TDesC8& aValue)
+    {
+    return CSenXmlProperties::SetPropertyL(aName, aValue);
+    }
+    
+EXPORT_C TInt CSenTransportProperties::PropertyL(const TDesC8& aName,
+                                                   TPtrC8& aValue)
+    {
+    return CSenXmlProperties::PropertyL(aName, aValue);
+    }
+    
+EXPORT_C TInt CSenTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                       const TInt aValue)
+    {
+    return CSenXmlProperties::SetIntPropertyL(aName, aValue);
+    }
+
+EXPORT_C TInt CSenTransportProperties::IntPropertyL(const TDesC8& aName,
+                                                    TInt& aValue)
+    {
+    return CSenXmlProperties::IntPropertyL(aName, aValue);
+    }
+
+EXPORT_C TInt CSenTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                        const TBool aValue)
+    {
+    return CSenXmlProperties::SetBoolPropertyL(aName, aValue);
+    }
+
+EXPORT_C TInt CSenTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                     TBool& aValue)
+    {
+    return CSenXmlProperties::BoolPropertyL(aName, aValue);
+    }
+EXPORT_C TInt CSenTransportProperties::SetOmittedL(const TDesC8& aName, TBool aValue)
+    {
+    return CSenXmlProperties::SetOmittedL(aName, aValue);
+    }
+
+EXPORT_C TInt CSenTransportProperties::RemovePropertyL(const TDesC8& aName)
+    {
+    return CSenXmlProperties::RemovePropertyL(aName);
+    }
+
+
+EXPORT_C CSenTransportProperties::~CSenTransportProperties()
+    {
+    }
+
+EXPORT_C void CSenTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenXmlProperties::BaseConstructL(aLocalname, aXml, aParser);
+    }
+
+EXPORT_C void CSenTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenXmlProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser);
+    }
+
+void CSenTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                                 const TDesC8& aLocalname, 
+                                                 const TDesC8& aQualifiedName, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenXmlProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, aXml, aParser);
+    }
+
+EXPORT_C void CSenTransportProperties::BaseConstructL(const CSenElement& aElement)
+    {
+    CSenXmlProperties::BaseConstructL(aElement);
+    }
+
+EXPORT_C CSenTransportProperties::CSenTransportProperties()
+: iFileAttachmentNum(0)
+    {
+    }
+    
+EXPORT_C TInt CSenTransportProperties::SetPropertyL(const TDesC8& aName,
+                                                    const TDesC8& aValue,
+                                                    const TDesC8& aType)
+    {
+    return CSenXmlProperties::SetPropertyL(aName, aValue, aType);
+    }
+
+EXPORT_C TInt CSenTransportProperties::PropertyL(const TDesC8& aName,
+                                                    TPtrC8& aValue,
+                                                    TPtrC8& aType)
+    {
+    return CSenXmlProperties::PropertyL(aName, aValue, aType);
+    }
+//common properties
+EXPORT_C TInt CSenTransportProperties::IapIdL(TUint32& aCurrentIapId)
+    {
+    TPtrC8 value;
+    TInt retVal = PropertyL(KIapIdLocalName, value);
+    
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aCurrentIapId, EDecimal);
+        }
+        
+    if(aCurrentIapId > 0) return retVal;
+    else return KErrNotFound;
+    }
+
+EXPORT_C void CSenTransportProperties::SetIapIdL(TUint32 aIapId)
+    {
+    TBuf8<128> buf;
+    buf.AppendFormat(_L8("%u"), aIapId);
+    SetPropertyL(KIapIdLocalName, buf);
+    }
+
+// Setter for Service Network Access Point (SNAP) ID
+EXPORT_C void CSenTransportProperties::SetSnapIdL(TUint32 aSnapId)
+    {
+	TBuf8<128> buf;
+    buf.AppendFormat(_L8("%u"), aSnapId);
+    SetPropertyL(KSnapIdLocalName, buf);
+    }
+
+// Getter for SNAP ID
+EXPORT_C TInt CSenTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
+    {
+    TPtrC8 value;
+    TInt retVal = PropertyL(KSnapIdLocalName, value);
+    
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aCurrentSnapId, EDecimal);
+        }
+        
+    if(aCurrentSnapId > 0) return retVal;
+    else return KErrNotFound;
+    }
+EXPORT_C TInt CSenTransportProperties::ProxyPortL(TInt& aProxyPort)
+    {
+    TPtrC8 value;
+    TInt retVal = PropertyL(KProxyPortLocalName, value);
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        TUint proxyPort;
+        retVal = lex.Val(proxyPort, EDecimal);
+        if ( retVal == KErrNone )
+            {
+            aProxyPort = proxyPort;
+            }
+        }
+
+    return retVal;
+    }
+
+EXPORT_C void CSenTransportProperties::SetProxyPortL(TInt aProxyPort)
+    {
+    SetIntPropertyL(KProxyPortLocalName, aProxyPort);
+    }
+
+EXPORT_C TInt CSenTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
+    {
+    return PropertyL(KProxyHostLocalName, aProxyHost);
+    }
+
+EXPORT_C void CSenTransportProperties::SetProxyHostL(const TDesC8& aProxyHost)
+    {
+    SetPropertyL(KProxyHostLocalName, aProxyHost);
+    }
+
+EXPORT_C TInt CSenTransportProperties::ProxyUsageL(TBool& aValue)
+    {
+    return BoolPropertyL(KProxyUsageLocalName, aValue);
+    }
+
+EXPORT_C void CSenTransportProperties::SetProxyUsageL(TBool aProxyUsage)
+    {
+    SetBoolPropertyL(KProxyUsageLocalName, aProxyUsage);
+    }
+    
+EXPORT_C TInt CSenTransportProperties::SecureDialogL(TBool& aValue)
+    {
+    return BoolPropertyL(KSecureDialogLocalName, aValue);
+    }
+
+EXPORT_C void CSenTransportProperties::SetSecureDialogL(TBool aSecureDialog)
+    {
+    SetBoolPropertyL(KSecureDialogLocalName, aSecureDialog);
+    }
+/*
+EXPORT_C TInt CSenTransportProperties::IAPDialogL(TBool& aValue)
+    {
+    return BoolPropertyL(KSenIAPDoNotPrompt, aValue);
+    }
+
+EXPORT_C void CSenTransportProperties::SetIapDialogL(TBool aIapDialog)
+    {
+    SetBoolPropertyL(KSenIAPDoNotPrompt, aIapDialog);
+    }
+*/
+EXPORT_C TInt CSenTransportProperties::UserAgentL(TPtrC8& aUserAgent)
+    {
+    return PropertyL(KUserAgentLocalName, aUserAgent);
+    }
+
+EXPORT_C void CSenTransportProperties::SetUserAgentL(const TDesC8& aUserAgent)
+    {
+    SetPropertyL(KUserAgentLocalName, aUserAgent);
+    }
+
+EXPORT_C TInt CSenTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
+    {
+    return PropertyL(KDeviceIDLocalName, aDeviceID);
+    }
+
+EXPORT_C void CSenTransportProperties::SetDeviceIDL(const TDesC8& aDeviceID)
+    {
+    SetPropertyL(KDeviceIDLocalName, aDeviceID);
+    }    
+
+EXPORT_C TInt CSenTransportProperties::SoapActionL(TPtrC8& aAction)
+    {
+    return PropertyL(KSoapActionLocalName, aAction);
+    }
+
+EXPORT_C void CSenTransportProperties::SetSoapActionL(const TDesC8& aAction)
+    {
+    SetPropertyL(KSoapActionLocalName, aAction);
+    }    
+
+EXPORT_C void CSenTransportProperties::ApplyBindingL(TSOAPVersion /*aSoapVersion*/)
+    {
+    }
+
+EXPORT_C TInt CSenTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
+    {
+    return PropertyL(KDownloadFolderLocalName, aDownloadFolder);
+    }
+EXPORT_C void CSenTransportProperties::SetDownloadFolderL(const TDesC8& aDownloadFolder)
+    {
+    SetPropertyL(KDownloadFolderLocalName, aDownloadFolder);
+    }
+
+EXPORT_C TInt CSenTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
+    {
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenTransportProperties::FileAttachmentL:");
+    TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("- CID: '%S'"), &aCid));        
+    
+//    _LIT8(KAttachment, "Attachment");
+    TPtrC8 pFileAttachments;
+    TInt retVal( KErrNotFound );
+    retVal = PropertyL( KFileAttachmentsLocalName, pFileAttachments );    
+    if ( retVal == KErrNone )
+        {
+        CSenXmlReader* reader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+        CleanupStack::PushL( reader );
+        CSenDomFragment* pFragment = CSenDomFragment::NewL();
+        CleanupStack::PushL( pFragment );
+        pFragment->SetReader( *reader );    
+        pFragment->BuildFrom( pFileAttachments );  
+        
+        if (aFileName)
+            {
+            delete aFileName;
+            aFileName = NULL;
+            }
+        
+        RPointerArray<CSenElement>& elements = pFragment->AsElement().ElementsL();
+        TInt count(elements.Count());
+        for ( TInt i=0; i<count && !aFileName; i++ )
+            {
+            CSenElement* pElement = elements[i];
+            TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- Processing file attachment element: '%S'"), &pElement->LocalName()));        
+
+            RPointerArray<CSenBaseAttribute>& attributes = pElement->AttributesL();
+            TInt attrCount(attributes.Count());
+            for ( TInt j=0; j<attrCount; j++ )            
+                {
+                TPtrC8 name = attributes[j]->Name();
+                TPtrC8 value = attributes[j]->Value();
+
+                TLSLOG_FORMAT((KSenUtilsLogChannel, KNormalLogLevel, _L8("- Processing file attachment attribute, name: '%S', value: '%S'"), &name, &value));        
+                if ( name == KCid && value == aCid )
+                    {
+                    TLSLOG_L(KSenUtilsLogChannel, KNormalLogLevel, "- Filename for CID found.");
+                    aFileName = HBufC8::NewL( pElement->Content().Length() );
+                    TPtr8 aFileNameDes = aFileName->Des();                
+                    aFileNameDes.Append( pElement->Content() );
+                    retVal = KErrNone;
+                    break; // no need to check rest of the attributes
+                    }
+                }
+                // if ( aFileName ) break; // no need to check rest of the child elements
+            }
+            
+        CleanupStack::PopAndDestroy(pFragment);
+        CleanupStack::PopAndDestroy(reader);
+        }
+    return retVal;
+        /*
+        HBufC8* pLocalName = HBufC8::NewLC(KAttachment().Length()+aCid.Length());
+        TPtr8 localNameDes = pLocalName->Des();
+        localNameDes.Append(KAttachment);
+        localNameDes.Append(aCid);
+        CSenElement* pElement = pFragment->AsElement().Element(*pLocalName);
+        if(pElement)
+            {
+            if (aFileName)
+                {
+                delete aFileName;
+                aFileName = NULL;
+                }
+            aFileName = HBufC8::NewL(pElement->Content().Length());
+            TPtr8 aFileNameDes = aFileName->Des();                
+            aFileNameDes.Append(pElement->Content());
+            CleanupStack::PopAndDestroy(pLocalName);
+            CleanupStack::PopAndDestroy(pFragment);
+            CleanupStack::PopAndDestroy(reader);
+            return KErrNone;
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(pLocalName);
+            CleanupStack::PopAndDestroy(pFragment);
+            CleanupStack::PopAndDestroy(reader);
+            return KErrNotFound;
+            }
+        }
+            
+        */            
+    }
+
+EXPORT_C TInt CSenTransportProperties::SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName)
+    {
+    TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "CSenTransportProperties::SetFileAttachmentL:");
+    TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L8("- CID: '%S'"), &aCid));        
+    
+    TBuf<32> num;
+    num.AppendNum( iFileAttachmentNum );
+
+    _LIT8(KAttachments,"Attachments");
+    _LIT8(KAttachment,"Attachment");
+    TPtrC8 pFileAttachments;
+    TInt err(KErrNone);
+    err = PropertyL(KFileAttachmentsLocalName, pFileAttachments);
+    if (err != KErrNotFound)
+        {
+        // Add to existing <Attachements/> fragment:
+        CSenXmlReader* reader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+        CleanupStack::PushL(reader);
+        CSenDomFragment* pFragment = CSenDomFragment::NewL();
+        CleanupStack::PushL(pFragment);
+        pFragment->SetReader(*reader);    
+        pFragment->BuildFrom(pFileAttachments);  
+        
+        // --- //
+        HBufC8* pLocalName = HBufC8::NewLC( KAttachment().Length() + num.Length() );
+        TPtr8 localNameDes = pLocalName->Des();
+        localNameDes.Append( KAttachment );
+        localNameDes.Append( num );
+        CSenElement* pElement = pFragment->AsElement().Element(*pLocalName);
+        if (pElement)  
+            {
+            CleanupStack::PopAndDestroy(pLocalName);
+            CleanupStack::PopAndDestroy(pFragment);
+            CleanupStack::PopAndDestroy(reader);
+            return KErrAlreadyExists; 
+            }
+        else
+            {
+            CSenElement& pElement = pFragment->AsElement().AddElementL(*pLocalName);
+            pElement.SetContentL(aFileName);
+            SenXmlUtils::AddAttributeL(pElement, KCid, aCid );	//CodeScannerWarnings
+            HBufC8* pFragmentAsXml = pFragment->AsXmlL();
+            CleanupStack::PushL(pFragmentAsXml);
+            SetPropertyL( KFileAttachmentsLocalName, *pFragmentAsXml );
+            CleanupStack::PopAndDestroy( pFragmentAsXml );
+            }
+        CleanupStack::PopAndDestroy(pLocalName);
+        CleanupStack::PopAndDestroy(pFragment);
+        CleanupStack::PopAndDestroy(reader);
+        }
+    else
+        {
+        
+        // Create new <Attachements/> -fragment (container) for fileattachent properties
+        
+        CSenDomFragment* pFragment = CSenDomFragment::NewL( KAttachments );
+        CleanupStack::PushL(pFragment);
+        
+        // --- //        
+        //HBufC8* pLocalName = HBufC8::NewLC(KAttachment().Length()+aCid.Length());
+        HBufC8* pLocalName = HBufC8::NewLC( KAttachment().Length() + num.Length() );
+        TPtr8 localNameDes = pLocalName->Des();
+        localNameDes.Append(KAttachment);
+        localNameDes.Append( num );
+        CSenElement& pElement = pFragment->AsElement().AddElementL(*pLocalName);
+        pElement.SetContentL( aFileName );
+        SenXmlUtils::AddAttributeL(pElement, KCid, aCid );
+        HBufC8* pFragmentAsXml = pFragment->AsXmlL();
+        CleanupStack::PushL(pFragmentAsXml);
+        SetPropertyL( KFileAttachmentsLocalName, *pFragmentAsXml );
+        CleanupStack::PopAndDestroy(pFragmentAsXml);
+        
+        CleanupStack::PopAndDestroy(pLocalName);
+        CleanupStack::PopAndDestroy(pFragment);
+        }  
+        
+    // Increase internal count of file attachements ONLY if method is successful:         
+    iFileAttachmentNum++; 
+    return KErrNone;    
+    }
+    
+   
+EXPORT_C MSenProperties* CSenTransportProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenTransportProperties* pProperties = NewLC(element);
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+EXPORT_C MSenProperties* CSenTransportProperties::Clone(TInt& aOkOrError) const
+    {
+    MSenProperties* pClone = NULL;
+    TRAP( aOkOrError, pClone = CloneL(); )
+    return pClone;
+    }
+        
+EXPORT_C TInt CSenTransportProperties::MwsNamespaceL( TPtrC8& aMwsNamespace )
+    {
+    return PropertyL( KMwsNamespaceLocalName, aMwsNamespace );
+    }
+    
+EXPORT_C void CSenTransportProperties::SetMwsNamespaceL( const TDesC8& aMwsNamespace )
+    {
+    SetPropertyL( KMwsNamespaceLocalName, aMwsNamespace );
+    }
+
+EXPORT_C TInt CSenTransportProperties::MessageIdL( TPtrC8& aMessageId )
+    {
+    return PropertyL( KSenClientGeneratedMessageId, aMessageId );
+    }      
+
+EXPORT_C void CSenTransportProperties::SetMessageIdL( const TDesC8& aMessageId )
+    {
+    SetPropertyL( KSenClientGeneratedMessageId, aMessageId );
+    }      
+
+EXPORT_C TInt CSenTransportProperties::OnewayMessageOnOffL( TBool& aOnewayMessageOnOff )
+    {
+    return BoolPropertyL( KSenOnewayMessageOnOff, aOnewayMessageOnOff );
+    }
+
+EXPORT_C void CSenTransportProperties::SetOnewayMessageOnOffL( TBool aOnewayMessageOnOff )
+    {
+    SetBoolPropertyL( KSenOnewayMessageOnOff, aOnewayMessageOnOff );
+    }
+    
+EXPORT_C TInt CSenTransportProperties::HeartbeatL(TInt& aHeartbeat) 
+    { 
+    return IntPropertyL( KSenConnectionHeartbeat, aHeartbeat ); 
+    }
+    
+EXPORT_C TInt CSenTransportProperties::SetHeartbeatL(TInt aHeartbeat) 
+    { 
+    return SetIntPropertyL( KSenConnectionHeartbeat, aHeartbeat ); 
+    }
+    
+
+EXPORT_C TInt CSenTransportProperties::SetMaxTimeToLiveL(TInt aMaxTTL) 
+    { 
+    return SetIntPropertyL( KSenConnectionHeartbeatMaxTTL, aMaxTTL ); 
+    }
+
+EXPORT_C TInt CSenTransportProperties::MaxTimeToLiveL(TInt& aMaxTTL) 
+    { 
+    return IntPropertyL( KSenConnectionHeartbeatMaxTTL, aMaxTTL ); 
+    }
+
+EXPORT_C TInt CSenTransportProperties::SetMinTimeToLiveL(TInt aMinTTL) 
+    { 
+    return SetIntPropertyL( KSenConnectionHeartbeatMinTTL, aMinTTL ); 
+    }
+
+EXPORT_C TInt CSenTransportProperties::MinTimeToLiveL(TInt& aMinTTL) 
+    { 
+    return IntPropertyL( KSenConnectionHeartbeatMinTTL, aMinTTL ); 
+    }
+
+EXPORT_C TInt CSenTransportProperties::SetEndpointResourceL(const TDesC8& aEndpointResource)
+    {
+    return SetPropertyL(KSenEndpointResource, aEndpointResource);
+    }
+
+EXPORT_C TInt CSenTransportProperties::EndpointResourceL(TPtrC8& aEndpointResource)
+    {
+    return PropertyL(KSenEndpointResource, aEndpointResource);
+    }
+
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senutilsdll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senvtcptransportproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,456 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:         
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+#include <SenXmlReader.h>
+#include "senvtcptransportproperties.h"
+#include "senpropertiesfragment.h"
+#include "MSenProperty.h"
+#include <SenXmlUtils.h>
+
+EXPORT_C CSenVtcpTransportProperties* CSenVtcpTransportProperties::NewL()
+    {
+    CSenVtcpTransportProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenVtcpTransportProperties* CSenVtcpTransportProperties::NewLC()
+    {
+    CSenVtcpTransportProperties* pNew = new (ELeave) CSenVtcpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenVtcpTransportProperties* CSenVtcpTransportProperties::NewL(const TDesC8& aXmlUtf8,
+                                                               CSenXmlReader& aParser)
+    {
+    CSenVtcpTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenVtcpTransportProperties* CSenVtcpTransportProperties::NewLC(const TDesC8& aXmlUtf8,
+                                                                CSenXmlReader& aParser)
+    {
+    CSenVtcpTransportProperties* pNew = new (ELeave) CSenVtcpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+    
+EXPORT_C CSenVtcpTransportProperties* CSenVtcpTransportProperties::NewL(const CSenElement& aElement)
+    {
+    CSenVtcpTransportProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenVtcpTransportProperties* CSenVtcpTransportProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenVtcpTransportProperties* pNew = new (ELeave) CSenVtcpTransportProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+
+void CSenVtcpTransportProperties::SetReader(CSenXmlReader& aReader)
+    {
+    CSenTransportProperties::SetReader(aReader);
+    } 
+
+MSenProperties::TSenPropertiesClassType CSenVtcpTransportProperties::PropertiesClassType() 
+    {
+    return ESenVtcpTransportProperties;
+    }
+
+void CSenVtcpTransportProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    CSenTransportProperties::WriteToL(aWriteStream);
+    }
+    
+void CSenVtcpTransportProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    CSenTransportProperties::ReadFromL(aBuffer);
+    }    
+
+HBufC8* CSenVtcpTransportProperties::AsUtf8L()
+    {
+    return CSenTransportProperties::AsUtf8L();
+    }
+
+HBufC8* CSenVtcpTransportProperties::AsUtf8LC()
+    {
+    return CSenTransportProperties::AsUtf8LC();
+    }
+    
+TBool CSenVtcpTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenVtcpTransportProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return CSenTransportProperties::IsSafeToCast(aClass);
+        }
+    }      
+
+TInt CSenVtcpTransportProperties::SetPropertyL(const TDesC8& aName,
+                                               const TDesC8& aValue,
+                                               const TDesC8& aType)
+    {
+    return CSenTransportProperties::SetPropertyL(aName, aValue, aType);
+    }
+
+TInt CSenVtcpTransportProperties::PropertyL(const TDesC8& aName,
+                                            TPtrC8& aValue,
+                                            TPtrC8& aType)
+    {
+    return CSenTransportProperties::PropertyL(aName, aValue, aType);
+    }
+
+    
+TInt CSenVtcpTransportProperties::SetPropertyL(const TDesC8& aName,
+                                               const TDesC8& aValue)
+    {
+    return CSenTransportProperties::SetPropertyL(aName, aValue);
+    }
+    
+TInt CSenVtcpTransportProperties::PropertyL(const TDesC8& aName,
+                                            TPtrC8& aValue)
+    {
+    return CSenTransportProperties::PropertyL(aName, aValue);
+    }
+    
+TInt CSenVtcpTransportProperties::SetIntPropertyL(const TDesC8& aName,
+                                                  const TInt aValue)
+    {
+    return CSenTransportProperties::SetIntPropertyL(aName, aValue);
+    }
+
+TInt CSenVtcpTransportProperties::IntPropertyL(const TDesC8& aName,
+                                               TInt& aValue)
+    {
+    return CSenTransportProperties::IntPropertyL(aName, aValue);
+    }
+
+TInt CSenVtcpTransportProperties::SetBoolPropertyL(const TDesC8& aName,
+                                                   const TBool aValue)
+    {
+    return CSenTransportProperties::SetBoolPropertyL(aName, aValue);
+    }
+
+TInt CSenVtcpTransportProperties::BoolPropertyL(const TDesC8& aName,
+                                                TBool& aValue)
+    {
+    return CSenTransportProperties::BoolPropertyL(aName, aValue);
+    }  
+
+CSenVtcpTransportProperties::~CSenVtcpTransportProperties()
+    {
+    }
+
+void CSenVtcpTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                                 const TDesC8& aXml,
+                                                 CSenXmlReader* aParser)
+    {
+    CSenTransportProperties::BaseConstructL(aLocalname, aXml, aParser);
+    }
+
+void CSenVtcpTransportProperties::BaseConstructL(const CSenElement& aElement)
+    {
+    CSenTransportProperties::BaseConstructL(aElement);
+    }
+
+CSenVtcpTransportProperties::CSenVtcpTransportProperties()
+    {
+    }
+
+TInt CSenVtcpTransportProperties::DeviceLCIDL(TPtrC8& aDeviceLCID)
+    {
+    return PropertyL(KDeviceLCIDLocalName, aDeviceLCID);
+    }
+
+void CSenVtcpTransportProperties::SetDeviceLCIDL(const TDesC8& aDeviceLCID)
+    {
+    SetPropertyL(KDeviceLCIDLocalName, aDeviceLCID);
+    }
+
+TInt CSenVtcpTransportProperties::ConnectionBoundL(TBool& aConnectionBound)
+    {
+    return BoolPropertyL(KConnectionBoundLocalName, aConnectionBound);
+    }
+
+void CSenVtcpTransportProperties::SetConnectionBoundL(const TBool& aConnectionBound)
+    {
+    SetBoolPropertyL(KConnectionBoundLocalName, aConnectionBound);
+    }
+
+TInt CSenVtcpTransportProperties::ConnectionTimeOutL(TInt& aConnectionTimeOut)
+    {
+    return IntPropertyL(KConnectionTimeOutLocalName, aConnectionTimeOut);
+    }
+
+void CSenVtcpTransportProperties::SetConnectionTimeOutL(const TInt& aConnectionTimeOut)
+    {
+    SetIntPropertyL(KConnectionTimeOutLocalName, aConnectionTimeOut);
+    }
+    
+//override
+TInt CSenVtcpTransportProperties::IapIdL(TUint32& aCurrentIapId)
+    {
+    return CSenTransportProperties::IapIdL(aCurrentIapId);
+    }
+
+void CSenVtcpTransportProperties::SetIapIdL(TUint32 aIapId)
+    {
+    CSenTransportProperties::SetIapIdL(aIapId);
+    }
+
+void CSenVtcpTransportProperties::SetSnapIdL(TUint32 aSnapId)
+{
+    CSenTransportProperties::SetSnapIdL(aSnapId);
+}
+
+TInt CSenVtcpTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
+{
+    return CSenTransportProperties::SnapIdL(aCurrentSnapId);
+}
+
+TInt CSenVtcpTransportProperties::ProxyPortL(TInt& aProxyPort)
+    {
+    return CSenTransportProperties::ProxyPortL(aProxyPort);
+    }
+
+void CSenVtcpTransportProperties::SetProxyPortL(TInt aProxyPort)
+    {
+    CSenTransportProperties::SetProxyPortL(aProxyPort);
+    }
+
+TInt CSenVtcpTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
+    {
+    return CSenTransportProperties::ProxyHostL(aProxyHost);
+    }
+
+void CSenVtcpTransportProperties::SetProxyHostL(const TDesC8& aProxyHost)
+    {
+    CSenTransportProperties::SetProxyHostL(aProxyHost);
+    }
+
+TInt CSenVtcpTransportProperties::ProxyUsageL(TBool& aValue)
+    {
+    return CSenTransportProperties::ProxyUsageL(aValue);
+    }
+
+void CSenVtcpTransportProperties::SetProxyUsageL(TBool aProxyUsage)
+    {
+    CSenTransportProperties::SetProxyUsageL(aProxyUsage);
+    }
+    
+TInt CSenVtcpTransportProperties::SecureDialogL(TBool& aValue)
+    {
+    return CSenTransportProperties::SecureDialogL(aValue);
+    }
+
+void CSenVtcpTransportProperties::SetSecureDialogL(TBool aSecureDialog)
+    {
+    CSenTransportProperties::SetSecureDialogL(aSecureDialog);
+    }
+
+TInt CSenVtcpTransportProperties::UserAgentL(TPtrC8& aUserAgent)
+    {
+    return CSenTransportProperties::UserAgentL(aUserAgent);
+    }
+
+void CSenVtcpTransportProperties::SetUserAgentL(const TDesC8& aUserAgent)
+    {
+    CSenTransportProperties::SetUserAgentL(aUserAgent);
+    }
+
+
+TInt CSenVtcpTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
+    {
+    return CSenTransportProperties::DeviceIDL(aDeviceID);
+    }
+
+void CSenVtcpTransportProperties::SetDeviceIDL(const TDesC8& aDeviceID)
+    {
+    CSenTransportProperties::SetDeviceIDL(aDeviceID);
+    }    
+
+TInt CSenVtcpTransportProperties::SoapActionL(TPtrC8& aAction)
+    {
+    return CSenTransportProperties::SoapActionL(aAction);
+    }
+
+void CSenVtcpTransportProperties::SetSoapActionL(const TDesC8& aAction)
+    {
+    CSenTransportProperties::SetSoapActionL(aAction);
+    }
+
+void CSenVtcpTransportProperties::ApplyBindingL(TSOAPVersion aSoapVersion)
+    {
+    CSenTransportProperties::ApplyBindingL(aSoapVersion);
+    }
+
+TInt CSenVtcpTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
+    {
+    return CSenTransportProperties::DownloadFolderL(aDownloadFolder);
+    }
+
+void CSenVtcpTransportProperties::SetDownloadFolderL(const TDesC8& aDownloadFolder)
+    {
+    CSenTransportProperties::SetDownloadFolderL(aDownloadFolder);
+    }      
+
+TInt CSenVtcpTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
+    {
+    return CSenTransportProperties::FileAttachmentL(aCid, aFileName);
+    }
+
+TInt CSenVtcpTransportProperties::SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName)
+    {
+    return CSenTransportProperties::SetFileAttachmentL(aCid, aFileName);
+    }
+    
+MSenProperties* CSenVtcpTransportProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenVtcpTransportProperties* pProperties = NewLC(element);
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+        
+TInt CSenVtcpTransportProperties::MwsNamespaceL( TPtrC8& aMwsNamespace )
+    {
+    return CSenTransportProperties::MwsNamespaceL(aMwsNamespace);
+    }
+
+void CSenVtcpTransportProperties::SetMwsNamespaceL( const TDesC8& aMwsNamespace )
+    {
+    CSenTransportProperties::SetMwsNamespaceL(aMwsNamespace);
+    }      
+
+TInt CSenVtcpTransportProperties::MessageIdL( TPtrC8& aMessageId )
+    {
+    return CSenTransportProperties::MessageIdL( aMessageId );
+    }      
+
+void CSenVtcpTransportProperties::SetMessageIdL( const TDesC8& aMessageId )
+    {
+    CSenTransportProperties::SetMessageIdL( aMessageId );
+    }
+    
+TInt CSenVtcpTransportProperties::OnewayMessageOnOffL( TBool& aOnewayMessageOnOff )
+    {
+    return CSenTransportProperties::OnewayMessageOnOffL( aOnewayMessageOnOff );
+    }
+
+void CSenVtcpTransportProperties::SetOnewayMessageOnOffL( TBool aOnewayMessageOnOff )
+    {
+    CSenTransportProperties::SetOnewayMessageOnOffL( aOnewayMessageOnOff );
+    }
+    
+TInt CSenVtcpTransportProperties::HeartbeatL(TInt& aHeartbeat) 
+    { 
+    return CSenTransportProperties::HeartbeatL( aHeartbeat ); 
+    }
+    
+TInt CSenVtcpTransportProperties::SetHeartbeatL(TInt aHeartbeat) 
+    { 
+    return CSenTransportProperties::SetHeartbeatL( aHeartbeat ); 
+    }
+    
+TInt CSenVtcpTransportProperties::SetMaxTimeToLiveL(TInt aMaxTTL) 
+    { 
+    return CSenTransportProperties::SetMaxTimeToLiveL( aMaxTTL ); 
+    }
+
+TInt CSenVtcpTransportProperties::MaxTimeToLiveL(TInt& aMaxTTL) 
+    { 
+    return CSenTransportProperties::MaxTimeToLiveL( aMaxTTL ); 
+    }
+
+TInt CSenVtcpTransportProperties::SetMinTimeToLiveL(TInt aMinTTL) 
+    { 
+    return CSenTransportProperties::SetMinTimeToLiveL( aMinTTL ); 
+    }
+
+TInt CSenVtcpTransportProperties::MinTimeToLiveL(TInt& aMinTTL) 
+    { 
+    return CSenTransportProperties::MinTimeToLiveL( aMinTTL ); 
+    }
+    
+TInt CSenVtcpTransportProperties::SetMaxRetryTTLL(TInt aMaxRetryTTL)
+	{ 
+	return SetIntPropertyL( KSenConnectionRetryMaxTTL, aMaxRetryTTL );
+	}
+	
+TInt CSenVtcpTransportProperties::MaxRetryTTLL(TInt& aMaxRetryTTL)
+	{ 
+	return IntPropertyL( KSenConnectionRetryMaxTTL, aMaxRetryTTL ); 
+	}
+
+TInt CSenVtcpTransportProperties::SetMinRetryTTLL(TInt aMinRetryTTL)
+	{ 
+	return SetIntPropertyL( KSenConnectionRetryMinTTL, aMinRetryTTL );
+	}
+	
+TInt CSenVtcpTransportProperties:: MinRetryTTLL(TInt& aMinRetryTTL)
+	{ 
+	return IntPropertyL( KSenConnectionRetryMinTTL, aMinRetryTTL ); 
+	}
+	
+TInt CSenVtcpTransportProperties::SetRetryDeltaTimeoutL(TInt aTimeout)
+	{ 
+	return SetIntPropertyL( KSenConnectionRetryDelta, aTimeout );
+	}
+	
+TInt CSenVtcpTransportProperties::RetryDeltaTimeoutL(TInt& aTimeout)
+	{ 
+	return IntPropertyL( KSenConnectionRetryDelta, aTimeout ); 
+	}
+
+
+          
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senwssecurityheader.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,399 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <SenIdentityProvider.h>
+
+#include "SenWsSecurityHeader.h"
+#include "sendebug.h"
+
+namespace
+    {
+    _LIT8(KColon, ":");
+
+    _LIT8(KUsernameTokenStartTagFmt,    "<%S:UsernameToken>");
+
+    _LIT8(KUsernameFmt,                 "<%S:Username>%S</%S:Username>");
+
+    _LIT8(KPasswordStartTagDefaultFmt,  "<%S:Password>%S");
+    _LIT8(KPasswordStartTagTypeFmt,     "<%S:Password Type=\"%S:%S\">%S");
+    _LIT8(KPasswordEndTagFmt,           "</%S:Password>");
+
+    _LIT8(KUsernameTokenEndTag,         "</%S:UsernameToken>");
+
+    _LIT8(KTimestampExpiresFormatString8,
+        "<%S:Timestamp xmlns:%S=\"%S\"><%S:Created>%S</%S:Created><%S:Expires>%S</%S:Expires></%S:Timestamp>");
+
+    _LIT8(KTimestampFormatString8,
+        "<%S:Timestamp xmlns:%S=\"%S\"><%S:Created>%S</%S:Created></%S:Timestamp>");
+
+    _LIT8(KBinarySecurityTokenValueTypeFmt,             "<%S:BinarySecurityToken wsu:Id=\"token\" ValueType=\"%S\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%S</%S:BinarySecurityToken>");
+    _LIT8(KBinarySecurityTokenFmt,             "<%S:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%S</%S:BinarySecurityToken>");
+ 
+    /*
+    TInt TokenL(const TDesC8& aSecurityNsPrefix, const TDesC8& aUsername, HBufC8*& aToken)
+        {
+        aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                                KUsernameFmt().Length() +
+                                KUsernameTokenEndTag().Length() +
+                                aUsername.Length() + 
+                                aSecurityNsPrefix.Length() * 4 );
+
+        TPtr8 ptr = aToken->Des();
+        ptr.Format(KUsernameTokenStartTagFmt, &aSecurityNsPrefix);
+        ptr.AppendFormat(KUsernameFmt, &aSecurityNsPrefix, &aUsername, &aSecurityNsPrefix);
+        ptr.AppendFormat(KUsernameTokenEndTag, &aSecurityNsPrefix);
+        CleanupStack::Pop();    // aToken
+        return KErrNone;
+        }
+    */
+
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenWsSecurityHeader::NewL()
+    {
+    CSenWsSecurityHeader* pNew = CSenWsSecurityHeader::NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenWsSecurityHeader::NewLC()
+    {
+    CSenWsSecurityHeader* pNew = new (ELeave) CSenWsSecurityHeader;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenWsSecurityHeader::NewL(const TDesC8& aData)
+    {
+    CSenWsSecurityHeader* pNew = CSenWsSecurityHeader::NewLC(aData);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenWsSecurityHeader::NewLC(const TDesC8& aData)
+    {
+    CSenWsSecurityHeader* pNew = new (ELeave) CSenWsSecurityHeader;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aData);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenWsSecurityHeader::NewL(const TDesC8& aData, const TDesC8& aSecurityNs)
+    {
+    CSenWsSecurityHeader* pNew = CSenWsSecurityHeader::NewLC(aData, aSecurityNs);
+    CleanupStack::Pop(pNew);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader* CSenWsSecurityHeader::NewLC(const TDesC8& aData, const TDesC8& aSecurityNs)
+    {
+    CSenWsSecurityHeader* pNew = new (ELeave) CSenWsSecurityHeader;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aData, aSecurityNs);
+    return pNew;
+    }
+
+EXPORT_C CSenWsSecurityHeader::CSenWsSecurityHeader()
+    {
+    }
+
+EXPORT_C void CSenWsSecurityHeader::BaseConstructL()
+    {
+    // create and push pQualifiedName
+    HBufC8 *pQualifiedName = HBufC8::NewLC(XmlNsPrefix().Length()+
+                                        KColon().Length() +
+                                        KSecurityName().Length());
+
+    TPtr8 qualified = pQualifiedName->Des();
+    qualified.Append(XmlNsPrefix());
+    qualified.Append(KColon);
+    qualified.Append(KSecurityName);
+    CSenBaseFragment::BaseConstructL(XmlNs(), KSecurityName, qualified);
+
+    CleanupStack::PopAndDestroy(); // pQualifiedName
+    }
+
+EXPORT_C void CSenWsSecurityHeader::BaseConstructL(const TDesC8& aData, const TDesC8& aSecurityNs)
+    {
+    // create and push pQualifiedName
+    HBufC8 *pQualifiedName = HBufC8::NewLC(XmlNsPrefix().Length()+
+                                        KColon().Length() +
+                                        KSecurityName().Length());
+
+    TPtr8 qualified = pQualifiedName->Des();
+    qualified.Append(XmlNsPrefix());
+    qualified.Append(KColon);
+    qualified.Append(KSecurityName);
+    CSenBaseFragment::BaseConstructL(aSecurityNs, KSecurityName, qualified);
+    CleanupStack::PopAndDestroy(); // pQualifiedName
+    if (aData.Length())
+        {
+        AsElement().SetContentL(aData);    
+        }
+    }
+
+EXPORT_C void CSenWsSecurityHeader::BaseConstructL(const TDesC8& aData)
+    {
+    BaseConstructL();
+    AsElement().SetContentL(aData);
+    }
+
+EXPORT_C CSenWsSecurityHeader::~CSenWsSecurityHeader()
+    {
+    }
+
+EXPORT_C HBufC8* CSenWsSecurityHeader::UsernameTokenL(CSenIdentityProvider &aIdentityProvider)
+    {
+    TPtrC8 username = aIdentityProvider.AuthzID();
+    HBufC8* pToken = NULL;
+    User::LeaveIfError(UsernameTokenL(username, pToken));
+    return pToken;
+
+    /*
+    TPtrC8 nsPrefix = XmlNsPrefix();
+    HBufC8* aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                                    KUsernameFmt().Length() +
+                                    KUsernameTokenEndTag().Length() +
+                                    username.Length() + 
+                                    nsPrefix.Length() * 4 );
+
+    _LIT8(KUsernameTokenStartTagFmt, "<%S:UsernameToken>");
+    _LIT8(KUsernameFmt,              "<%S:UsernameToken><%S:Username>%S</%S:Username>");
+    _LIT8(KUsernameTokenEndTag,      "</%S:UsernameToken>");
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameFmt, &nsPrefix, &username, &nsPrefix);
+    ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+
+    CleanupStack::Pop();    // aToken
+    return aToken;
+    */
+    }
+
+
+EXPORT_C TPtrC8 CSenWsSecurityHeader::XmlNs()
+    {
+    // Note that AsElement() will panic, if CSenBaseFragment::ipElement == NULL
+    if(ipElement)
+        {
+        return AsElement().NamespaceURI();
+        }
+    else
+        {
+        return KSecurityXmlNs();  
+        }
+    }
+
+EXPORT_C TPtrC8 CSenWsSecurityHeader::XmlNsPrefix()
+    {
+    // Note that AsElement() will panic, if CSenBaseFragment::ipElement == NULL
+    if(ipElement)
+        {
+        return AsElement().NsPrefix();
+        }
+    else
+        {
+        return KSecurityXmlNsPrefix();
+        }
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader::UsernameTokenL(const TDesC8& aUsername, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+    aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                            KUsernameFmt().Length() +
+                            KUsernameTokenEndTag().Length() +
+                            aUsername.Length() + 
+                            nsPrefix.Length() * 4 );
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameFmt, &nsPrefix, &aUsername, &nsPrefix);
+    ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+    CleanupStack::Pop();    // aToken
+    return KErrNone;
+    }
+
+
+EXPORT_C HBufC8* CSenWsSecurityHeader::UsernameTokenL(CSenIdentityProvider &aIdentityProvider,
+                                                      CSenWsSecurityHeader::TPasswordType aType)
+    {
+    TPtrC8 username = aIdentityProvider.AuthzID();
+    TPtrC8 password = aIdentityProvider.Password();
+    HBufC8* pToken = NULL;
+    User::LeaveIfError(UsernameTokenL(username, password, aType, pToken));
+    return pToken;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader::UsernameTokenL(const TDesC8& aUsername,
+                                    const TDesC8& aPassword,
+                                    HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+    aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                            KUsernameFmt().Length() +
+                            KUsernameTokenEndTag().Length() +
+                            KPasswordStartTagDefaultFmt().Length() +
+                            KPasswordEndTagFmt().Length() +
+                            aPassword.Length() +
+                            aUsername.Length() + 
+                            nsPrefix.Length() * 6 );
+
+    TPtr8 ptr = aToken->Des();
+//    ptr.Format(KNameTokenFormat, &nsPrefix, &nsPrefix, &aUsername, &nsPrefix, &nsPrefix);
+    ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameFmt, &nsPrefix, &aUsername, &nsPrefix);
+    ptr.AppendFormat(KPasswordStartTagDefaultFmt, 
+                     &nsPrefix, &aPassword); // no Type -attribute used
+    ptr.AppendFormat(KPasswordEndTagFmt, &nsPrefix);
+    ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+    CleanupStack::Pop();    // aToken
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader::UsernameTokenL(const TDesC8& aUsername,
+                                    const TDesC8& aPassword,
+                                    CSenWsSecurityHeader::TPasswordType aType,
+                                    HBufC8*& aToken)
+    {
+    switch(aType)
+        {
+        case EText:
+            {
+            return UsernameTokenL(aUsername, aPassword, aToken);
+            }
+        case EDigest:
+            {
+            TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+            TPtrC8 typeAttr(KSecurityAttrTypeDigest);
+
+            aToken = HBufC8::NewLC( KUsernameTokenStartTagFmt().Length() +
+                                    KUsernameFmt().Length() +
+                                    KUsernameTokenEndTag().Length() +
+                                    KPasswordStartTagTypeFmt().Length() +
+                                    KPasswordEndTagFmt().Length() +
+                                    aUsername.Length() + 
+                                    aPassword.Length() +
+                                    typeAttr.Length() +
+                                    nsPrefix.Length() * 7 );
+            TPtr8 ptr = aToken->Des();
+            ptr.Format(KUsernameTokenStartTagFmt, &nsPrefix);
+            ptr.AppendFormat(KUsernameFmt, &nsPrefix, &aUsername, &nsPrefix);
+            ptr.AppendFormat(KPasswordStartTagTypeFmt, &nsPrefix, &nsPrefix, 
+                             &typeAttr, &aPassword); // Type = wsse:PasswordDigest
+            ptr.AppendFormat(KPasswordEndTagFmt, &nsPrefix);
+            ptr.AppendFormat(KUsernameTokenEndTag, &nsPrefix);
+            CleanupStack::Pop();    // aToken
+            return KErrNone;
+            }
+        default:
+            {
+            return KErrNotSupported;
+            }
+        }
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader::BinarySecurityTokenL(const TDesC8& aContent, const TDesC8& aValueType, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+    aToken = HBufC8::NewLC( KBinarySecurityTokenValueTypeFmt().Length() +
+                            aContent.Length() + 
+                            aValueType.Length() + 
+                            nsPrefix.Length() * 2 );
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KBinarySecurityTokenValueTypeFmt, &nsPrefix, &aValueType, &aContent, &nsPrefix);
+    CleanupStack::Pop();    // aToken
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader::BinarySecurityTokenL(const TDesC8& aContent, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityXmlNsPrefix();
+    aToken = HBufC8::NewLC( KBinarySecurityTokenFmt().Length() +
+                            aContent.Length() +
+                            nsPrefix.Length() * 2 );
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KBinarySecurityTokenFmt, &nsPrefix, &aContent, &nsPrefix);
+    CleanupStack::Pop();    // aToken
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenWsSecurityHeader::TimestampL(const TDesC8& aCreated, const TDesC8& aExpires, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityUtilityXmlNsPrefix();
+    aToken = HBufC8::NewLC(KTimestampExpiresFormatString8().Length()
+                            + aCreated.Length() 
+                            + aExpires.Length() 
+                            + nsPrefix.Length()*7
+                            + KSecurityUtilityXmlNs().Length());
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KTimestampExpiresFormatString8, 
+               &nsPrefix, 
+               &nsPrefix, 
+               &KSecurityUtilityXmlNs(),
+               &nsPrefix, 
+               &aCreated,
+               &nsPrefix, 
+               &nsPrefix, 
+               &aExpires, 
+               &nsPrefix, 
+               &nsPrefix);
+    CleanupStack::Pop(aToken);
+    return KErrNone;
+    }
+    
+EXPORT_C TInt CSenWsSecurityHeader::TimestampL(const TDesC8& aCreated, HBufC8*& aToken)
+    {
+    TPtrC8 nsPrefix = KSecurityUtilityXmlNsPrefix();
+    aToken = HBufC8::NewLC(KTimestampFormatString8().Length()
+                            + aCreated.Length() 
+                            + nsPrefix.Length()*5
+                            + KSecurityUtilityXmlNs().Length());
+
+    TPtr8 ptr = aToken->Des();
+    ptr.Format(KTimestampFormatString8, 
+               &nsPrefix, 
+               &nsPrefix, 
+               &KSecurityUtilityXmlNs(),
+               &nsPrefix, 
+               &aCreated,
+               &nsPrefix, 
+               &nsPrefix);
+    CleanupStack::Pop(aToken);
+    return KErrNone;
+    }
+    
+//EXPORT_C TInt CSenWsSecurityHeader::SecurityTokenReferenceL(const TDesC8& aURI, HBufC8*& aToken)
+//    {
+//    //to do 
+//    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsutils/src/senxmlproperties.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,422 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <s32strm.h> // RWriteStream
+
+#include <SenXmlReader.h>
+#include <SenXmlUtils.h>
+#include <SenBaseAttribute.h>
+#include "SenXmlProperties.h"
+#include "senpropertiesfragment.h"
+#include "senxmldebug.h"
+
+namespace
+    {
+    const TInt KFlatBufSize     = 64;  // CBufFlat
+    }
+
+EXPORT_C CSenXmlProperties* CSenXmlProperties::NewL()
+    {
+    CSenXmlProperties* pNew = NewLC();
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenXmlProperties* CSenXmlProperties::NewLC()
+    {
+    CSenXmlProperties* pNew = new (ELeave) CSenXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // omit parsing by passing zero-length descriptor
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         KNullDesC8,
+                         NULL);
+    return pNew;
+    }
+
+EXPORT_C CSenXmlProperties* CSenXmlProperties::NewL(const TDesC8& aXmlUtf8,
+                                           CSenXmlReader& aParser)
+    {
+    CSenXmlProperties* pNew = NewLC(aXmlUtf8, aParser);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenXmlProperties* CSenXmlProperties::NewLC(const TDesC8& aXmlUtf8,
+                                            CSenXmlReader& aParser)
+    {
+    CSenXmlProperties* pNew = new (ELeave) CSenXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(KSenXmlPropertiesLocalname,
+                         aXmlUtf8,
+                         &aParser);
+    return pNew;
+    }
+
+
+EXPORT_C CSenXmlProperties* CSenXmlProperties::NewL(const CSenElement& aElement)
+    {
+    CSenXmlProperties* pNew = NewLC(aElement);
+    CleanupStack::Pop(); // pNew
+    return pNew;
+    }
+
+EXPORT_C CSenXmlProperties* CSenXmlProperties::NewLC(const CSenElement& aElement)
+    {
+    CSenXmlProperties* pNew = new (ELeave) CSenXmlProperties;
+    CleanupStack::PushL(pNew);
+
+    // parse the XML document  descriptor into DOM fragment
+    pNew->BaseConstructL(aElement);
+    return pNew;
+    }
+    
+void CSenXmlProperties::SetReader(CSenXmlReader& aReader)
+    {
+    // de-allocate the owned reader, if one exists:
+    if( ipReader )
+        {
+        delete ipReader; 
+        ipReader = NULL;
+        }        
+    // Note: ipFragment does not own the reader 
+    // behind the given reference (aReader) 
+    ipFragment->SetReader(aReader); 
+    }    
+
+MSenProperties::TSenPropertiesClassType CSenXmlProperties::PropertiesClassType() 
+    { 
+    return ESenXmlProperties; 
+    }
+
+void CSenXmlProperties::WriteToL(RWriteStream& aWriteStream)
+    {
+    ipFragment->WriteAsXMLToL(aWriteStream);
+    }
+
+void CSenXmlProperties::ReadFromL(const TDesC8& aBuffer)
+    {
+    // Sanity check: ignore zero-length strings
+    if ( aBuffer.Length() == 0)
+        {
+        return;
+        }
+    // Check if fragment already has a reference to *some*
+    // XML reader
+    if ( !ipFragment->Reader() )
+        {
+        // Check if there is already an owned reader instance
+        if( !ipReader )
+            {
+            ipReader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser
+            }
+        // Sets reference of that XML reader for this fragment:
+        ipFragment->ParseWithL(*ipReader);
+        }
+    ipFragment->ParseL(aBuffer);   
+    }
+
+HBufC8* CSenXmlProperties::AsUtf8L()
+    {
+    return ipFragment->AsXmlL();
+    }
+
+HBufC8* CSenXmlProperties::AsUtf8LC()
+    {
+    HBufC8* pAsXml = ipFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    return pAsXml;
+    }
+    
+TBool CSenXmlProperties::IsSafeToCast(TSenPropertiesClassType aClass)
+    {
+    if ( aClass == MSenProperties::ESenXmlProperties )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse; // has only abstact, layered TP super classes 
+        }
+    }      
+
+TInt CSenXmlProperties::SetPropertyL(const TDesC8& aName,
+                                     const TDesC8& aValue)
+    {
+	CSenElement* pChildElement = ipFragment->AsElement().Element(aName);
+	if ( !pChildElement )
+		{
+		// Add new element
+		pChildElement =  &ipFragment->AsElement().AddElementL(aName);
+		}
+	pChildElement->SetContentL(aValue);
+    return KErrNone;
+    }
+
+TInt CSenXmlProperties::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+    {
+	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if ( pElement )
+		{
+		aValue.Set(pElement->Content());
+        return KErrNone;
+		}
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+    
+TInt CSenXmlProperties::SetPropertyL(const TDesC8& aName,
+                                     const TDesC8& aValue,
+                                     const TDesC8& aType)
+    {
+	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if ( !pElement )
+		{
+		// Add new element
+		pElement =  &ipFragment->AsElement().AddElementL(aName);
+		}
+	pElement->SetContentL(aValue);
+	SenXmlUtils::AddAttributeL(*pElement, KSenTypeAttributeName, aType);
+    return KErrNone;
+    }
+
+TInt CSenXmlProperties::PropertyL(const TDesC8& aName,
+                                  TPtrC8& aValue,
+                                  TPtrC8& aType)
+    {
+	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if ( pElement )
+		{
+		aValue.Set(pElement->Content());
+		aType.Set(*pElement->AttrValue(KSenTypeAttributeName));
+        return KErrNone;
+		}
+    else
+        {
+        return KErrNotFound;
+        }
+    }    
+    
+TInt CSenXmlProperties::SetIntPropertyL(const TDesC8& aName, const TInt aValue)
+    {
+    TBuf8<KFlatBufSize> buffer;
+    buffer.Num(aValue);
+    return SetPropertyL(aName, buffer);
+    }
+
+TInt CSenXmlProperties::IntPropertyL(const TDesC8& aName, TInt& aValue)
+    {
+    TPtrC8 value;
+    TInt retVal(KErrNone);
+    retVal = PropertyL(aName, value);
+    if ( retVal == KErrNone )
+        {
+        TLex8 lex(value);
+        retVal = lex.Val(aValue);
+        }
+    return retVal;
+    }
+    
+TInt CSenXmlProperties::SetBoolPropertyL(const TDesC8& aName, const TBool aValue)
+    {
+    if ( aValue )
+        {
+        return SetPropertyL(aName, KSenPropertyTrue);
+        }
+    else
+        {
+        return SetPropertyL(aName, KSenPropertyFalse);
+        }
+    }
+
+TInt CSenXmlProperties::BoolPropertyL(const TDesC8& aName, TBool& aValue)
+    {
+    TInt retVal(KErrNone);
+    TPtrC8 value;
+    retVal = PropertyL(aName, value);
+    if ( retVal == KErrNone )
+        {
+        if (value == KSenPropertyTrue)
+            {
+            aValue = ETrue;
+            }
+        else if (value == KSenPropertyFalse)
+            {
+            aValue = EFalse;
+            }
+        else
+            {
+            retVal = KErrGeneral;
+            }
+        }
+    return retVal;
+    }    
+
+TInt CSenXmlProperties::SetOmittedL(const TDesC8& aName, TBool aValue)
+    {
+    TBool newElementCreated = EFalse;
+ 	CSenElement* pElement = ipFragment->AsElement().Element(aName);
+	if ( !pElement )
+		{
+		// Add new element
+		pElement =  &ipFragment->AsElement().AddElementL(aName);
+		newElementCreated = ETrue;
+		}
+    else
+        {
+        const TDesC8* pVal = pElement->AttrValue(KSenOmittedAttributeName);
+        if ( pVal )
+            {
+            CSenBaseAttribute* pAttribute = SenXmlUtils::RemoveAttributeL(*pElement, KSenOmittedAttributeName);
+            delete pAttribute;
+            }
+        }
+      
+    if ( pElement )  
+        {
+        if ( aValue )
+            {
+            if ( newElementCreated )
+                {
+                SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenOmittedTrueNoValue);
+                }
+            else
+                {
+                SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenPropertyTrue);
+                }
+            }
+        else
+            {
+            SenXmlUtils::AddAttributeL(*pElement, KSenOmittedAttributeName, KSenPropertyFalse);
+            }
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+        
+    return KErrNone;   
+    }
+    
+TInt CSenXmlProperties::RemovePropertyL(const TDesC8& aName)
+    {
+ 	CSenElement* pElement = ipFragment->AsElement().RemoveElement(aName);
+	if ( pElement )
+		{
+		delete pElement;
+		return KErrNone;
+		}
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+CSenXmlProperties::~CSenXmlProperties()
+    {
+    delete ipReader;
+    delete ipFragment;
+    }
+
+void CSenXmlProperties::BaseConstructL(const TDesC8& aLocalname, 
+                                       const TDesC8& aXml,
+                                       CSenXmlReader* aParser)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aLocalname);
+    if ( aParser && aXml != KNullDesC8 )
+        {
+        // Do parsing
+        ipFragment->ParseWithL(*aParser);
+        ipFragment->ParseL(aXml);
+        }
+   }
+
+void CSenXmlProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                       const TDesC8& aLocalname, 
+                                       const TDesC8& aXml,
+                                       CSenXmlReader* aParser)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aNamespace, aLocalname);
+    if ( aParser && aXml != KNullDesC8 )
+        {
+        // Do parsing
+        ipFragment->ParseWithL(*aParser);
+        ipFragment->ParseL(aXml);
+        }
+    }
+
+void CSenXmlProperties::BaseConstructL(const TDesC8& aNamespace, 
+                                       const TDesC8& aLocalname, 
+                                       const TDesC8& aQualifiedName, 
+                                       const TDesC8& aXml,
+                                       CSenXmlReader* aParser)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aNamespace, 
+                                        aLocalname, 
+                                        aQualifiedName);
+    if ( aParser && aXml != KNullDesC8 )
+        {
+        // Do parsing
+        ipFragment->ParseWithL(*aParser);
+        ipFragment->ParseL(aXml);
+        }
+    }
+
+void CSenXmlProperties::BaseConstructL(const CSenElement& aElement)
+    {
+    ipFragment = CSenPropertiesFragment::NewL(aElement.LocalName());
+    CSenElement& element = ipFragment->AsElement();
+    element.CopyFromL((CSenElement&)aElement);
+    }
+
+CSenXmlProperties::CSenXmlProperties()
+:   ipFragment(NULL),
+    ipReader(NULL)
+    {
+    }
+    
+MSenProperties* CSenXmlProperties::CloneL() const
+    {
+    CSenElement& element = ipFragment->AsElement();
+    
+    CSenXmlProperties* pProperties = this->NewLC(element);
+    CleanupStack::Pop(pProperties);
+    return pProperties;
+    }
+
+MSenProperties* CSenXmlProperties::Clone(TInt& aOkOrError) const
+    {
+    MSenProperties* pClone = NULL;
+    TRAP( aOkOrError, pClone = CloneL(); )
+    return pClone;
+    }
+    
+
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/BMARM/SENXMLU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,203 @@
+EXPORTS
+	__17CSenBaseAttribute @ 1 NONAME R3UNUSED ; CSenBaseAttribute::CSenBaseAttribute(void)
+	AddAttributeL__15CSenBaseElementP17CSenBaseAttribute @ 2 NONAME R3UNUSED ; CSenBaseElement::AddAttributeL(CSenBaseAttribute *)
+	AddAttributeL__15CSenBaseElementRC6TDesC8N21 @ 3 NONAME ; CSenBaseElement::AddAttributeL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	AddAttributeL__15CSenBaseElementRC6TDesC8T1 @ 4 NONAME R3UNUSED ; CSenBaseElement::AddAttributeL(TDesC8 const &, TDesC8 const &)
+	AddAttributesL__15CSenBaseElementRCt6RArray1ZQ23Xml10RAttribute @ 5 NONAME R3UNUSED ; CSenBaseElement::AddAttributesL(RArray<Xml::RAttribute> const &)
+	AddElementL__15CSenBaseElementR11CSenElement @ 6 NONAME R3UNUSED ; CSenBaseElement::AddElementL(CSenElement &)
+	AddElementL__15CSenBaseElementRC6TDesC8 @ 7 NONAME R3UNUSED ; CSenBaseElement::AddElementL(TDesC8 const &)
+	AddElementL__15CSenBaseElementRC6TDesC8N21 @ 8 NONAME ; CSenBaseElement::AddElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	AddElementL__15CSenBaseElementRC6TDesC8T1 @ 9 NONAME R3UNUSED ; CSenBaseElement::AddElementL(TDesC8 const &, TDesC8 const &)
+	AddNamespaceL__15CSenBaseElementR13CSenNamespacei @ 10 NONAME R3UNUSED ; CSenBaseElement::AddNamespaceL(CSenNamespace &, int)
+	AddNamespaceL__15CSenBaseElementRC6TDesC8T1 @ 11 NONAME R3UNUSED ; CSenBaseElement::AddNamespaceL(TDesC8 const &, TDesC8 const &)
+	AllocAttrValueL__11SenXmlUtilsRCt6RArray1ZQ23Xml10RAttributeRC6TDesC8 @ 12 NONAME R3UNUSED ; SenXmlUtils::AllocAttrValueL(RArray<Xml::RAttribute> const &, TDesC8 const &)
+	AllocContentBufL__15CSenBaseElement @ 13 NONAME R3UNUSED ; CSenBaseElement::AllocContentBufL(void)
+	AllocContentSaverL__16CSenBaseFragment @ 14 NONAME R3UNUSED ; CSenBaseFragment::AllocContentSaverL(void)
+	AsElement__15CSenBaseElement @ 15 NONAME R3UNUSED ; CSenBaseElement::AsElement(void)
+	AsElement__16CSenBaseFragment @ 16 NONAME R3UNUSED ; CSenBaseFragment::AsElement(void)
+	AsXmlL__15CSenBaseElement @ 17 NONAME R3UNUSED ; CSenBaseElement::AsXmlL(void)
+	AsXmlL__16CSenBaseFragment @ 18 NONAME R3UNUSED ; CSenBaseFragment::AsXmlL(void)
+	AsXmlUnicodeL__15CSenBaseElement @ 19 NONAME R3UNUSED ; CSenBaseElement::AsXmlUnicodeL(void)
+	AsXmlUnicodeL__16CSenBaseFragment @ 20 NONAME R3UNUSED ; CSenBaseFragment::AsXmlUnicodeL(void)
+	AttrValue__11SenXmlUtilsRCt6RArray1ZQ23Xml10RAttributeRC6TDesC8 @ 21 NONAME R3UNUSED ; SenXmlUtils::AttrValue(RArray<Xml::RAttribute> const &, TDesC8 const &)
+	AttrValue__15CSenBaseElementRC6TDesC8 @ 22 NONAME R3UNUSED ; CSenBaseElement::AttrValue(TDesC8 const &)
+	AttributesL__15CSenBaseElement @ 23 NONAME R3UNUSED ; CSenBaseElement::AttributesL(void)
+	BaseConstructL__15CSenBaseElementRC6TDesC8 @ 24 NONAME R3UNUSED ; CSenBaseElement::BaseConstructL(TDesC8 const &)
+	BaseConstructL__15CSenBaseElementRC6TDesC8N21 @ 25 NONAME ; CSenBaseElement::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	BaseConstructL__15CSenBaseElementRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 26 NONAME ; CSenBaseElement::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	BaseConstructL__15CSenBaseElementRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 27 NONAME ; CSenBaseElement::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	BaseConstructL__15CSenBaseElementRC6TDesC8T1 @ 28 NONAME R3UNUSED ; CSenBaseElement::BaseConstructL(TDesC8 const &, TDesC8 const &)
+	BaseConstructL__15CSenDomFragmentR13CSenXmlReader @ 29 NONAME R3UNUSED ; CSenDomFragment::BaseConstructL(CSenXmlReader &)
+	BaseConstructL__15CSenDomFragmentRC11CSenElement @ 30 NONAME R3UNUSED ; CSenDomFragment::BaseConstructL(CSenElement const &)
+	BaseConstructL__15CSenDomFragmentRC6TDesC8 @ 31 NONAME R3UNUSED ; CSenDomFragment::BaseConstructL(TDesC8 const &)
+	BaseConstructL__15CSenDomFragmentRC6TDesC8N21 @ 32 NONAME ; CSenDomFragment::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	BaseConstructL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 33 NONAME ; CSenDomFragment::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	BaseConstructL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 34 NONAME ; CSenDomFragment::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	BaseConstructL__15CSenDomFragmentRC6TDesC8T1 @ 35 NONAME R3UNUSED ; CSenDomFragment::BaseConstructL(TDesC8 const &, TDesC8 const &)
+	BaseConstructL__16CSenBaseFragmentR13CSenXmlReader @ 36 NONAME R3UNUSED ; CSenBaseFragment::BaseConstructL(CSenXmlReader &)
+	BaseConstructL__16CSenBaseFragmentRC11CSenElement @ 37 NONAME R3UNUSED ; CSenBaseFragment::BaseConstructL(CSenElement const &)
+	BaseConstructL__16CSenBaseFragmentRC6TDesC8 @ 38 NONAME R3UNUSED ; CSenBaseFragment::BaseConstructL(TDesC8 const &)
+	BaseConstructL__16CSenBaseFragmentRC6TDesC8N21 @ 39 NONAME ; CSenBaseFragment::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	BaseConstructL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 40 NONAME ; CSenBaseFragment::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	BaseConstructL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 41 NONAME ; CSenBaseFragment::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	BaseConstructL__16CSenBaseFragmentRC6TDesC8T1 @ 42 NONAME R3UNUSED ; CSenBaseFragment::BaseConstructL(TDesC8 const &, TDesC8 const &)
+	BaseConstructL__17CSenBaseAttributeRC6TDesC8N21 @ 43 NONAME ; CSenBaseAttribute::BaseConstructL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	BaseConstructL__17CSenBaseAttributeRC6TDesC8T1 @ 44 NONAME R3UNUSED ; CSenBaseAttribute::BaseConstructL(TDesC8 const &, TDesC8 const &)
+	BuildFrom__16CSenBaseFragmentRC6TDesC8 @ 45 NONAME R3UNUSED ; CSenBaseFragment::BuildFrom(TDesC8 const &)
+	BuildQNameL__11SenXmlUtilsRC6TDesC8T1RP6HBufC8 @ 46 NONAME R3UNUSED ; SenXmlUtils::BuildQNameL(TDesC8 const &, TDesC8 const &, HBufC8 *&)
+	CharactersL__15CSenDomFragmentRC6TDesC8ii @ 47 NONAME ; CSenDomFragment::CharactersL(TDesC8 const &, int, int)
+	CharactersL__16CSenBaseFragmentRC6TDesC8ii @ 48 NONAME ; CSenBaseFragment::CharactersL(TDesC8 const &, int, int)
+	Characters__16CSenBaseFragmentRC6TDesC8ii @ 49 NONAME ; CSenBaseFragment::Characters(TDesC8 const &, int, int)
+	Child__15CSenBaseElementi @ 50 NONAME R3UNUSED ; CSenBaseElement::Child(int)
+	Compare__C13CSenNamespaceRC13CSenNamespace @ 51 NONAME R3UNUSED ; CSenNamespace::Compare(CSenNamespace const &) const
+	Compare__C13CSenNamespaceRC6TDesC8T1 @ 52 NONAME R3UNUSED ; CSenNamespace::Compare(TDesC8 const &, TDesC8 const &) const
+	ConsistsOfL__15CSenBaseElementR11MSenElement @ 53 NONAME R3UNUSED ; CSenBaseElement::ConsistsOfL(MSenElement &)
+	ConsistsOfL__16CSenBaseFragmentR12MSenFragment @ 54 NONAME R3UNUSED ; CSenBaseFragment::ConsistsOfL(MSenFragment &)
+	ContentOf__16CSenBaseFragmentRC6TDesC8 @ 55 NONAME R3UNUSED ; CSenBaseFragment::ContentOf(TDesC8 const &)
+	ContentUnicodeL__C15CSenBaseElement @ 56 NONAME R3UNUSED ; CSenBaseElement::ContentUnicodeL(void) const
+	ContentWriteStreamL__15CSenBaseElement @ 57 NONAME R3UNUSED ; CSenBaseElement::ContentWriteStreamL(void)
+	Content__16CSenBaseFragment @ 58 NONAME R3UNUSED ; CSenBaseFragment::Content(void)
+	Content__C15CSenBaseElement @ 59 NONAME R3UNUSED ; CSenBaseElement::Content(void) const
+	CopyFromL__15CSenBaseElementR11CSenElement @ 60 NONAME R3UNUSED ; CSenBaseElement::CopyFromL(CSenElement &)
+	CreateElementL__15CSenBaseElementRC6TDesC8T1 @ 61 NONAME R3UNUSED ; CSenBaseElement::CreateElementL(TDesC8 const &, TDesC8 const &)
+	DecodeHttpCharactersLC__11SenXmlUtilsRC6TDesC8 @ 62 NONAME R3UNUSED ; SenXmlUtils::DecodeHttpCharactersLC(TDesC8 const &)
+	DecodeHttpCharactersL__11SenXmlUtilsRC6TDesC8RP6HBufC8 @ 63 NONAME R3UNUSED ; SenXmlUtils::DecodeHttpCharactersL(TDesC8 const &, HBufC8 *&)
+	DelegateParsingL__16CSenBaseFragmentR12MSenFragment @ 64 NONAME R3UNUSED ; CSenBaseFragment::DelegateParsingL(MSenFragment &)
+	DelegateParsingL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 65 NONAME ; CSenBaseFragment::DelegateParsingL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	DetachL__15CSenBaseElement @ 66 NONAME R3UNUSED ; CSenBaseElement::DetachL(void)
+	DetachL__16CSenBaseFragment @ 67 NONAME R3UNUSED ; CSenBaseFragment::DetachL(void)
+	Element__15CSenBaseElementRC6TDesC8 @ 68 NONAME R3UNUSED ; CSenBaseElement::Element(TDesC8 const &)
+	Element__15CSenBaseElementRC6TDesC8T1 @ 69 NONAME R3UNUSED ; CSenBaseElement::Element(TDesC8 const &, TDesC8 const &)
+	ElementsL__15CSenBaseElement @ 70 NONAME R3UNUSED ; CSenBaseElement::ElementsL(void)
+	ElementsL__15CSenBaseElementRt13RPointerArray1Z11CSenElementRC6TDesC8 @ 71 NONAME R3UNUSED ; CSenBaseElement::ElementsL(RPointerArray<CSenElement> &, TDesC8 const &)
+	ElementsL__15CSenBaseElementRt13RPointerArray1Z11CSenElementRC6TDesC8T2 @ 72 NONAME ; CSenBaseElement::ElementsL(RPointerArray<CSenElement> &, TDesC8 const &, TDesC8 const &)
+	EnabledParserFeature__13CSenXmlReader @ 73 NONAME R3UNUSED ; CSenXmlReader::EnabledParserFeature(void)
+	EncodeHttpCharactersLC__11SenXmlUtilsRC6TDesC8 @ 74 NONAME R3UNUSED ; SenXmlUtils::EncodeHttpCharactersLC(TDesC8 const &)
+	EncodeHttpCharactersL__11SenXmlUtilsRC6TDesC8RP6HBufC8 @ 75 NONAME R3UNUSED ; SenXmlUtils::EncodeHttpCharactersL(TDesC8 const &, HBufC8 *&)
+	EndDocument__16CSenBaseFragment @ 76 NONAME R3UNUSED ; CSenBaseFragment::EndDocument(void)
+	EndElementL__16CSenBaseFragmentRC6TDesC8N21 @ 77 NONAME ; CSenBaseFragment::EndElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	EndElement__16CSenBaseFragmentRC6TDesC8N21 @ 78 NONAME ; CSenBaseFragment::EndElement(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	EndsWith__11SenXmlUtilsRC6TDesC8T1 @ 79 NONAME R3UNUSED ; SenXmlUtils::EndsWith(TDesC8 const &, TDesC8 const &)
+	EnsureNamespace__16CSenBaseFragmentRC6TDesC8 @ 80 NONAME R3UNUSED ; CSenBaseFragment::EnsureNamespace(TDesC8 const &)
+	Error__16CSenBaseFragmenti @ 81 NONAME R3UNUSED ; CSenBaseFragment::Error(int)
+	ExpandL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 82 NONAME ; CSenDomFragment::ExpandL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	ExtractElement__16CSenBaseFragment @ 83 NONAME R3UNUSED ; CSenBaseFragment::ExtractElement(void)
+	FindAttr__15CSenBaseElementRC6TDesC8 @ 84 NONAME R3UNUSED ; CSenBaseElement::FindAttr(TDesC8 const &)
+	HasContent__C15CSenBaseElement @ 85 NONAME R3UNUSED ; CSenBaseElement::HasContent(void) const
+	IndexOfElement__C15CSenBaseElementRC6TDesC8T1 @ 86 NONAME R3UNUSED ; CSenBaseElement::IndexOfElement(TDesC8 const &, TDesC8 const &) const
+	InsertElementL__15CSenBaseElementR11CSenElementRC11CSenElement @ 87 NONAME R3UNUSED ; CSenBaseElement::InsertElementL(CSenElement &, CSenElement const &)
+	InsertL__13CSenNamespaceR15RBufWriteStream @ 88 NONAME R3UNUSED ; CSenNamespace::InsertL(RBufWriteStream &)
+	LeaveOnXmlEscapesL__11SenXmlUtilsRC6TDesC8 @ 89 NONAME R3UNUSED ; SenXmlUtils::LeaveOnXmlEscapesL(TDesC8 const &)
+	LocalName__11SenXmlUtilsRC6TDesC8 @ 90 NONAME R3UNUSED ; SenXmlUtils::LocalName(TDesC8 const &)
+	LocalName__C15CSenBaseElement @ 91 NONAME R3UNUSED ; CSenBaseElement::LocalName(void) const
+	LocalName__C16CSenBaseFragment @ 92 NONAME R3UNUSED ; CSenBaseFragment::LocalName(void) const
+	MatchesL__C13CSenNamespaceRC13CSenNamespace @ 93 NONAME R3UNUSED ; CSenNamespace::MatchesL(CSenNamespace const &) const
+	NamespaceURI__C15CSenBaseElement @ 94 NONAME R3UNUSED ; CSenBaseElement::NamespaceURI(void) const
+	Namespace__15CSenBaseElement @ 95 NONAME R3UNUSED ; CSenBaseElement::Namespace(void)
+	Namespace__15CSenBaseElementRC6TDesC8 @ 96 NONAME R3UNUSED ; CSenBaseElement::Namespace(TDesC8 const &)
+	Namespace__15CSenBaseElementRC6TDesC8T1 @ 97 NONAME R3UNUSED ; CSenBaseElement::Namespace(TDesC8 const &, TDesC8 const &)
+	Namespace__15CSenBaseElementRC6TDesC8i @ 98 NONAME R3UNUSED ; CSenBaseElement::Namespace(TDesC8 const &, int)
+	Namespace__16CSenBaseFragmentRC6TDesC8 @ 99 NONAME R3UNUSED ; CSenBaseFragment::Namespace(TDesC8 const &)
+	NamespacesL__15CSenBaseElement @ 100 NONAME R3UNUSED ; CSenBaseElement::NamespacesL(void)
+	NewLC__13CSenNamespaceRC6TDesC8 @ 101 NONAME R3UNUSED ; CSenNamespace::NewLC(TDesC8 const &)
+	NewLC__13CSenNamespaceRC6TDesC8T1 @ 102 NONAME R3UNUSED ; CSenNamespace::NewLC(TDesC8 const &, TDesC8 const &)
+	NewLC__13CSenXmlReader @ 103 NONAME R3UNUSED ; CSenXmlReader::NewLC(void)
+	NewLC__13CSenXmlReaderi @ 104 NONAME R3UNUSED ; CSenXmlReader::NewLC(int)
+	NewL__13CSenNamespaceRC6TDesC8 @ 105 NONAME R3UNUSED ; CSenNamespace::NewL(TDesC8 const &)
+	NewL__13CSenNamespaceRC6TDesC8T1 @ 106 NONAME R3UNUSED ; CSenNamespace::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__13CSenXmlReader @ 107 NONAME R3UNUSED ; CSenXmlReader::NewL(void)
+	NewL__13CSenXmlReaderi @ 108 NONAME R3UNUSED ; CSenXmlReader::NewL(int)
+	NewL__15CSenBaseElementRC6TDesC8 @ 109 NONAME R3UNUSED ; CSenBaseElement::NewL(TDesC8 const &)
+	NewL__15CSenBaseElementRC6TDesC8N21 @ 110 NONAME R3UNUSED ; CSenBaseElement::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__15CSenBaseElementRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 111 NONAME ; CSenBaseElement::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	NewL__15CSenBaseElementRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 112 NONAME ; CSenBaseElement::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	NewL__15CSenBaseElementRC6TDesC8T1 @ 113 NONAME R3UNUSED ; CSenBaseElement::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__15CSenDomFragment @ 114 NONAME R3UNUSED ; CSenDomFragment::NewL(void)
+	NewL__15CSenDomFragmentRC11CSenElement @ 115 NONAME R3UNUSED ; CSenDomFragment::NewL(CSenElement const &)
+	NewL__15CSenDomFragmentRC6TDesC8 @ 116 NONAME R3UNUSED ; CSenDomFragment::NewL(TDesC8 const &)
+	NewL__15CSenDomFragmentRC6TDesC8N21 @ 117 NONAME R3UNUSED ; CSenDomFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 118 NONAME ; CSenDomFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	NewL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 119 NONAME ; CSenDomFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	NewL__15CSenDomFragmentRC6TDesC8T1 @ 120 NONAME R3UNUSED ; CSenDomFragment::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__16CSenBaseFragmentRC11CSenElement @ 121 NONAME R3UNUSED ; CSenBaseFragment::NewL(CSenElement const &)
+	NewL__16CSenBaseFragmentRC6TDesC8 @ 122 NONAME R3UNUSED ; CSenBaseFragment::NewL(TDesC8 const &)
+	NewL__16CSenBaseFragmentRC6TDesC8N21 @ 123 NONAME R3UNUSED ; CSenBaseFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 124 NONAME ; CSenBaseFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	NewL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttributeR11CSenElement @ 125 NONAME ; CSenBaseFragment::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &, CSenElement &)
+	NewL__16CSenBaseFragmentRC6TDesC8T1 @ 126 NONAME R3UNUSED ; CSenBaseFragment::NewL(TDesC8 const &, TDesC8 const &)
+	NewL__17CSenBaseAttributeRC6TDesC8N21 @ 127 NONAME R3UNUSED ; CSenBaseAttribute::NewL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	NewL__17CSenBaseAttributeRC6TDesC8T1 @ 128 NONAME R3UNUSED ; CSenBaseAttribute::NewL(TDesC8 const &, TDesC8 const &)
+	NsPrefix__11SenXmlUtilsRC6TDesC8 @ 129 NONAME R3UNUSED ; SenXmlUtils::NsPrefix(TDesC8 const &)
+	NsPrefix__C15CSenBaseElement @ 130 NONAME R3UNUSED ; CSenBaseElement::NsPrefix(void) const
+	NsPrefix__C16CSenBaseFragment @ 131 NONAME R3UNUSED ; CSenBaseFragment::NsPrefix(void) const
+	NsUri__C16CSenBaseFragment @ 132 NONAME R3UNUSED ; CSenBaseFragment::NsUri(void) const
+	Parent__15CSenBaseElement @ 133 NONAME R3UNUSED ; CSenBaseElement::Parent(void)
+	ParseL__13CSenXmlReaderR3RFsRC7TDesC16 @ 134 NONAME R3UNUSED ; CSenXmlReader::ParseL(RFs &, TDesC16 const &)
+	ParseL__13CSenXmlReaderRC6TDesC8 @ 135 NONAME R3UNUSED ; CSenXmlReader::ParseL(TDesC8 const &)
+	ParseL__16CSenBaseFragmentRC6TDesC8 @ 136 NONAME R3UNUSED ; CSenBaseFragment::ParseL(TDesC8 const &)
+	ParseWithL__15CSenDomFragmentR13CSenXmlReader @ 137 NONAME R3UNUSED ; CSenDomFragment::ParseWithL(CSenXmlReader &)
+	ParseWithL__16CSenBaseFragmentR13CSenXmlReader @ 138 NONAME R3UNUSED ; CSenBaseFragment::ParseWithL(CSenXmlReader &)
+	Prefix__C13CSenNamespace @ 139 NONAME R3UNUSED ; CSenNamespace::Prefix(void) const
+	Reader__16CSenBaseFragment @ 140 NONAME R3UNUSED ; CSenBaseFragment::Reader(void)
+	RemoveElement__15CSenBaseElementR11CSenElement @ 141 NONAME R3UNUSED ; CSenBaseElement::RemoveElement(CSenElement &)
+	RemoveElement__15CSenBaseElementRC6TDesC8 @ 142 NONAME R3UNUSED ; CSenBaseElement::RemoveElement(TDesC8 const &)
+	RemoveElement__15CSenBaseElementRC6TDesC8T1 @ 143 NONAME R3UNUSED ; CSenBaseElement::RemoveElement(TDesC8 const &, TDesC8 const &)
+	ReplaceElementL__15CSenBaseElementR11CSenElement @ 144 NONAME R3UNUSED ; CSenBaseElement::ReplaceElementL(CSenElement &)
+	ResetContentL__16CSenBaseFragment @ 145 NONAME R3UNUSED ; CSenBaseFragment::ResetContentL(void)
+	ResumeParsingFromL__15CSenDomFragmentRC6TDesC8N21 @ 146 NONAME ; CSenDomFragment::ResumeParsingFromL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	ResumeParsingFromL__16CSenBaseFragmentRC6TDesC8N21 @ 147 NONAME ; CSenBaseFragment::ResumeParsingFromL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	Root__15CSenBaseElement @ 148 NONAME R3UNUSED ; CSenBaseElement::Root(void)
+	SaveNamespacesL__16CSenBaseFragmentRCt6RArray1ZQ23Xml10RAttributei @ 149 NONAME R3UNUSED ; CSenBaseFragment::SaveNamespacesL(RArray<Xml::RAttribute> const &, int)
+	SetAttributesL__15CSenBaseElementRCt6RArray1ZQ23Xml10RAttribute @ 150 NONAME R3UNUSED ; CSenBaseElement::SetAttributesL(RArray<Xml::RAttribute> const &)
+	SetAttributesL__15CSenDomFragmentRCt6RArray1ZQ23Xml10RAttribute @ 151 NONAME R3UNUSED ; CSenDomFragment::SetAttributesL(RArray<Xml::RAttribute> const &)
+	SetAttributesL__16CSenBaseFragmentRCt6RArray1ZQ23Xml10RAttribute @ 152 NONAME R3UNUSED ; CSenBaseFragment::SetAttributesL(RArray<Xml::RAttribute> const &)
+	SetContentHandler__13CSenXmlReaderR24MSenContentHandlerClient @ 153 NONAME R3UNUSED ; CSenXmlReader::SetContentHandler(MSenContentHandlerClient &)
+	SetContentL__15CSenBaseElementRC6TDesC8 @ 154 NONAME R3UNUSED ; CSenBaseElement::SetContentL(TDesC8 const &)
+	SetContentOfL__16CSenBaseFragmentRC6TDesC8T1 @ 155 NONAME R3UNUSED ; CSenBaseFragment::SetContentOfL(TDesC8 const &, TDesC8 const &)
+	SetNamespaceL__15CSenBaseElementRC6TDesC8 @ 156 NONAME R3UNUSED ; CSenBaseElement::SetNamespaceL(TDesC8 const &)
+	SetNamespaceL__15CSenBaseElementRC6TDesC8T1 @ 157 NONAME R3UNUSED ; CSenBaseElement::SetNamespaceL(TDesC8 const &, TDesC8 const &)
+	SetOwner__16CSenBaseFragmentR12MSenFragment @ 158 NONAME R3UNUSED ; CSenBaseFragment::SetOwner(MSenFragment &)
+	SetParent__15CSenBaseElementP11CSenElement @ 159 NONAME R3UNUSED ; CSenBaseElement::SetParent(CSenElement *)
+	SetPrefixL__13CSenNamespaceRC6TDesC8 @ 160 NONAME R3UNUSED ; CSenNamespace::SetPrefixL(TDesC8 const &)
+	SetPrefixL__15CSenBaseElementRC6TDesC8 @ 161 NONAME R3UNUSED ; CSenBaseElement::SetPrefixL(TDesC8 const &)
+	SetReader__16CSenBaseFragmentR13CSenXmlReader @ 162 NONAME R3UNUSED ; CSenBaseFragment::SetReader(CSenXmlReader &)
+	SetUriL__13CSenNamespaceRC6TDesC8 @ 163 NONAME R3UNUSED ; CSenNamespace::SetUriL(TDesC8 const &)
+	Set__15CSenBaseElementRC6TDesC8N21 @ 164 NONAME ; CSenBaseElement::Set(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	StartDocument__16CSenBaseFragment @ 165 NONAME R3UNUSED ; CSenBaseFragment::StartDocument(void)
+	StartElementL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 166 NONAME ; CSenDomFragment::StartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	StartElementL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 167 NONAME ; CSenBaseFragment::StartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	StartElement__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 168 NONAME ; CSenBaseFragment::StartElement(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	StartEntity__16CSenBaseFragmentR6TDesC8 @ 169 NONAME R3UNUSED ; CSenBaseFragment::StartEntity(TDesC8 &)
+	StartsWith__11SenXmlUtilsRC6TDesC8T1 @ 170 NONAME R3UNUSED ; SenXmlUtils::StartsWith(TDesC8 const &, TDesC8 const &)
+	ToUnicodeLC__11SenXmlUtilsRC6TDesC8 @ 171 NONAME R3UNUSED ; SenXmlUtils::ToUnicodeLC(TDesC8 const &)
+	ToUtf8LC__11SenXmlUtilsRC7TDesC16 @ 172 NONAME R3UNUSED ; SenXmlUtils::ToUtf8LC(TDesC16 const &)
+	URI__C13CSenNamespace @ 173 NONAME R3UNUSED ; CSenNamespace::URI(void) const
+	WriteAsXMLToL__15CSenBaseElementR12RWriteStream @ 174 NONAME R3UNUSED ; CSenBaseElement::WriteAsXMLToL(RWriteStream &)
+	WriteAsXMLToL__16CSenBaseFragmentR12RWriteStream @ 175 NONAME R3UNUSED ; CSenBaseFragment::WriteAsXMLToL(RWriteStream &)
+	WriteAttrToL__15CSenBaseElementR12RWriteStreamRC6TDesC8T2 @ 176 NONAME ; CSenBaseElement::WriteAttrToL(RWriteStream &, TDesC8 const &, TDesC8 const &)
+	WriteAttrsToL__15CSenBaseElementR12RWriteStream @ 177 NONAME R3UNUSED ; CSenBaseElement::WriteAttrsToL(RWriteStream &)
+	WriteContentToL__15CSenBaseElementR12RWriteStream @ 178 NONAME R3UNUSED ; CSenBaseElement::WriteContentToL(RWriteStream &)
+	WriteElementsToL__15CSenBaseElementR12RWriteStream @ 179 NONAME R3UNUSED ; CSenBaseElement::WriteElementsToL(RWriteStream &)
+	WriteEndElementL__15CSenDomFragmentRC6TDesC8N21 @ 180 NONAME ; CSenDomFragment::WriteEndElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	WriteEndElementL__16CSenBaseFragmentRC6TDesC8N21 @ 181 NONAME ; CSenBaseFragment::WriteEndElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &)
+	WriteNamespacesToL__15CSenBaseElementR12RWriteStream @ 182 NONAME R3UNUSED ; CSenBaseElement::WriteNamespacesToL(RWriteStream &)
+	WriteStartElementL__15CSenDomFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 183 NONAME ; CSenDomFragment::WriteStartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	WriteStartElementL__16CSenBaseFragmentRC6TDesC8N21RCt6RArray1ZQ23Xml10RAttribute @ 184 NONAME ; CSenBaseFragment::WriteStartElementL(TDesC8 const &, TDesC8 const &, TDesC8 const &, RArray<Xml::RAttribute> const &)
+	WriteToBufL__15CSenBaseElementR8CBufBase @ 185 NONAME R3UNUSED ; CSenBaseElement::WriteToBufL(CBufBase &)
+	"_._13CSenNamespace" @ 186 NONAME R3UNUSED ; CSenNamespace::~CSenNamespace(void)
+	"_._13CSenXmlReader" @ 187 NONAME R3UNUSED ; CSenXmlReader::~CSenXmlReader(void)
+	"_._15CSenBaseElement" @ 188 NONAME R3UNUSED ; CSenBaseElement::~CSenBaseElement(void)
+	"_._15CSenDomFragment" @ 189 NONAME R3UNUSED ; CSenDomFragment::~CSenDomFragment(void)
+	"_._16CSenBaseFragment" @ 190 NONAME R3UNUSED ; CSenBaseFragment::~CSenBaseFragment(void)
+	"_._17CSenBaseAttribute" @ 191 NONAME R3UNUSED ; CSenBaseAttribute::~CSenBaseAttribute(void)
+	__13CSenXmlReaderi @ 192 NONAME R3UNUSED ; CSenXmlReader::CSenXmlReader(int)
+	__15CSenBaseElement @ 193 NONAME R3UNUSED ; CSenBaseElement::CSenBaseElement(void)
+	__15CSenDomFragment @ 194 NONAME R3UNUSED ; CSenDomFragment::CSenDomFragment(void)
+	__16CSenBaseFragment @ 195 NONAME R3UNUSED ; CSenBaseFragment::CSenBaseFragment(void)
+	AddAttrL__15CSenBaseElementRC6TDesC8T1 @ 196 NONAME R3UNUSED ; CSenBaseElement::AddAttrL(TDesC8 const &, TDesC8 const &)
+	NewLC__13CSenXmlReaderRC6TDesC8 @ 197 NONAME R3UNUSED ; CSenXmlReader::NewLC(TDesC8 const &)
+	NewLC__13CSenXmlReaderRC6TDesC8i @ 198 NONAME R3UNUSED ; CSenXmlReader::NewLC(TDesC8 const &, int)
+	NewL__13CSenXmlReaderRC6TDesC8 @ 199 NONAME R3UNUSED ; CSenXmlReader::NewL(TDesC8 const &)
+	NewL__13CSenXmlReaderRC6TDesC8i @ 200 NONAME R3UNUSED ; CSenXmlReader::NewL(TDesC8 const &, int)
+	ParserFeature__13CSenXmlReader @ 201 NONAME R3UNUSED ; CSenXmlReader::ParserFeature(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/BWINS/SENXMLU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,203 @@
+EXPORTS
+	??0CSenBaseAttribute@@IAE@XZ @ 1 NONAME ; protected: __thiscall CSenBaseAttribute::CSenBaseAttribute(void)
+	??0CSenBaseElement@@IAE@XZ @ 2 NONAME ; protected: __thiscall CSenBaseElement::CSenBaseElement(void)
+	??0CSenBaseFragment@@IAE@XZ @ 3 NONAME ; protected: __thiscall CSenBaseFragment::CSenBaseFragment(void)
+	??0CSenDomFragment@@IAE@XZ @ 4 NONAME ; protected: __thiscall CSenDomFragment::CSenDomFragment(void)
+	??0CSenXmlReader@@IAE@H@Z @ 5 NONAME ; protected: __thiscall CSenXmlReader::CSenXmlReader(int)
+	??1CSenBaseAttribute@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CSenBaseAttribute::~CSenBaseAttribute(void)
+	??1CSenBaseElement@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CSenBaseElement::~CSenBaseElement(void)
+	??1CSenBaseFragment@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CSenBaseFragment::~CSenBaseFragment(void)
+	??1CSenDomFragment@@UAE@XZ @ 9 NONAME ; public: virtual __thiscall CSenDomFragment::~CSenDomFragment(void)
+	??1CSenNamespace@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall CSenNamespace::~CSenNamespace(void)
+	??1CSenXmlReader@@UAE@XZ @ 11 NONAME ; public: virtual __thiscall CSenXmlReader::~CSenXmlReader(void)
+	?AddAttrL@CSenBaseElement@@UAEXABVTDesC8@@0@Z @ 12 NONAME ; public: virtual void __thiscall CSenBaseElement::AddAttrL(class TDesC8 const &,class TDesC8 const &)
+	?AddAttributeL@CSenBaseElement@@IAEABVTDesC8@@PAVCSenBaseAttribute@@@Z @ 13 NONAME ; protected: class TDesC8 const & __thiscall CSenBaseElement::AddAttributeL(class CSenBaseAttribute *)
+	?AddAttributeL@CSenBaseElement@@MAEABVTDesC8@@ABV2@00@Z @ 14 NONAME ; protected: virtual class TDesC8 const & __thiscall CSenBaseElement::AddAttributeL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?AddAttributeL@CSenBaseElement@@MAEABVTDesC8@@ABV2@0@Z @ 15 NONAME ; protected: virtual class TDesC8 const & __thiscall CSenBaseElement::AddAttributeL(class TDesC8 const &,class TDesC8 const &)
+	?AddAttributesL@CSenBaseElement@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 16 NONAME ; public: virtual void __thiscall CSenBaseElement::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@AAV2@@Z @ 17 NONAME ; public: virtual class CSenElement & __thiscall CSenBaseElement::AddElementL(class CSenElement &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@ABVTDesC8@@00@Z @ 18 NONAME ; public: virtual class CSenElement & __thiscall CSenBaseElement::AddElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@ABVTDesC8@@0@Z @ 19 NONAME ; public: virtual class CSenElement & __thiscall CSenBaseElement::AddElementL(class TDesC8 const &,class TDesC8 const &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@ABVTDesC8@@@Z @ 20 NONAME ; public: virtual class CSenElement & __thiscall CSenBaseElement::AddElementL(class TDesC8 const &)
+	?AddNamespaceL@CSenBaseElement@@UAEPBVCSenNamespace@@AAV2@H@Z @ 21 NONAME ; public: virtual class CSenNamespace const * __thiscall CSenBaseElement::AddNamespaceL(class CSenNamespace &,int)
+	?AddNamespaceL@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@0@Z @ 22 NONAME ; public: virtual class CSenNamespace const * __thiscall CSenBaseElement::AddNamespaceL(class TDesC8 const &,class TDesC8 const &)
+	?AllocAttrValueL@SenXmlUtils@@SAPAVHBufC8@@ABV?$RArray@VRAttribute@Xml@@@@ABVTDesC8@@@Z @ 23 NONAME ; public: static class HBufC8 * __cdecl SenXmlUtils::AllocAttrValueL(class RArray<class Xml::RAttribute> const &,class TDesC8 const &)
+	?AllocContentBufL@CSenBaseElement@@MAEXXZ @ 24 NONAME ; protected: virtual void __thiscall CSenBaseElement::AllocContentBufL(void)
+	?AllocContentSaverL@CSenBaseFragment@@MAEXXZ @ 25 NONAME ; protected: virtual void __thiscall CSenBaseFragment::AllocContentSaverL(void)
+	?AsElement@CSenBaseElement@@UAEPAVMSenElement@@XZ @ 26 NONAME ; public: virtual class MSenElement * __thiscall CSenBaseElement::AsElement(void)
+	?AsElement@CSenBaseFragment@@UAEAAVCSenElement@@XZ @ 27 NONAME ; public: virtual class CSenElement & __thiscall CSenBaseFragment::AsElement(void)
+	?AsXmlL@CSenBaseElement@@UAEPAVHBufC8@@XZ @ 28 NONAME ; public: virtual class HBufC8 * __thiscall CSenBaseElement::AsXmlL(void)
+	?AsXmlL@CSenBaseFragment@@UAEPAVHBufC8@@XZ @ 29 NONAME ; public: virtual class HBufC8 * __thiscall CSenBaseFragment::AsXmlL(void)
+	?AsXmlUnicodeL@CSenBaseElement@@UAEPAVHBufC16@@XZ @ 30 NONAME ; public: virtual class HBufC16 * __thiscall CSenBaseElement::AsXmlUnicodeL(void)
+	?AsXmlUnicodeL@CSenBaseFragment@@UAEPAVHBufC16@@XZ @ 31 NONAME ; public: virtual class HBufC16 * __thiscall CSenBaseFragment::AsXmlUnicodeL(void)
+	?AttrValue@CSenBaseElement@@UAEPBVTDesC8@@ABV2@@Z @ 32 NONAME ; public: virtual class TDesC8 const * __thiscall CSenBaseElement::AttrValue(class TDesC8 const &)
+	?AttrValue@SenXmlUtils@@SA?AVTPtrC8@@ABV?$RArray@VRAttribute@Xml@@@@ABVTDesC8@@@Z @ 33 NONAME ; public: static class TPtrC8 __cdecl SenXmlUtils::AttrValue(class RArray<class Xml::RAttribute> const &,class TDesC8 const &)
+	?AttributesL@CSenBaseElement@@UAEAAV?$RPointerArray@VCSenBaseAttribute@@@@XZ @ 34 NONAME ; public: virtual class RPointerArray<class CSenBaseAttribute> & __thiscall CSenBaseElement::AttributesL(void)
+	?BaseConstructL@CSenBaseAttribute@@IAEXABVTDesC8@@00@Z @ 35 NONAME ; protected: void __thiscall CSenBaseAttribute::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenBaseAttribute@@IAEXABVTDesC8@@0@Z @ 36 NONAME ; protected: void __thiscall CSenBaseAttribute::BaseConstructL(class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@00@Z @ 37 NONAME ; protected: void __thiscall CSenBaseElement::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 38 NONAME ; protected: void __thiscall CSenBaseElement::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 39 NONAME ; protected: void __thiscall CSenBaseElement::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@0@Z @ 40 NONAME ; protected: void __thiscall CSenBaseElement::BaseConstructL(class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@@Z @ 41 NONAME ; protected: void __thiscall CSenBaseElement::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXAAVCSenXmlReader@@@Z @ 42 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class CSenXmlReader &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVCSenElement@@@Z @ 43 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@00@Z @ 44 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 45 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 46 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@0@Z @ 47 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@@Z @ 48 NONAME ; protected: void __thiscall CSenBaseFragment::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenDomFragment@@IAEXAAVCSenXmlReader@@@Z @ 49 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class CSenXmlReader &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVCSenElement@@@Z @ 50 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@00@Z @ 51 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 52 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 53 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@0@Z @ 54 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class TDesC8 const &,class TDesC8 const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@@Z @ 55 NONAME ; protected: void __thiscall CSenDomFragment::BaseConstructL(class TDesC8 const &)
+	?BuildFrom@CSenBaseFragment@@UAEHABVTDesC8@@@Z @ 56 NONAME ; public: virtual int __thiscall CSenBaseFragment::BuildFrom(class TDesC8 const &)
+	?BuildQNameL@SenXmlUtils@@SAXABVTDesC8@@0AAPAVHBufC8@@@Z @ 57 NONAME ; public: static void __cdecl SenXmlUtils::BuildQNameL(class TDesC8 const &,class TDesC8 const &,class HBufC8 * &)
+	?Characters@CSenBaseFragment@@EAEHABVTDesC8@@HH@Z @ 58 NONAME ; private: virtual int __thiscall CSenBaseFragment::Characters(class TDesC8 const &,int,int)
+	?CharactersL@CSenBaseFragment@@MAEXABVTDesC8@@HH@Z @ 59 NONAME ; protected: virtual void __thiscall CSenBaseFragment::CharactersL(class TDesC8 const &,int,int)
+	?CharactersL@CSenDomFragment@@MAEXABVTDesC8@@HH@Z @ 60 NONAME ; protected: virtual void __thiscall CSenDomFragment::CharactersL(class TDesC8 const &,int,int)
+	?Child@CSenBaseElement@@UAEPAVCSenElement@@H@Z @ 61 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::Child(int)
+	?Compare@CSenNamespace@@QBEHABV1@@Z @ 62 NONAME ; public: int __thiscall CSenNamespace::Compare(class CSenNamespace const &)const 
+	?Compare@CSenNamespace@@QBEHABVTDesC8@@0@Z @ 63 NONAME ; public: int __thiscall CSenNamespace::Compare(class TDesC8 const &,class TDesC8 const &)const 
+	?ConsistsOfL@CSenBaseElement@@UAEHAAVMSenElement@@@Z @ 64 NONAME ; public: virtual int __thiscall CSenBaseElement::ConsistsOfL(class MSenElement &)
+	?ConsistsOfL@CSenBaseFragment@@UAEHAAVMSenFragment@@@Z @ 65 NONAME ; public: virtual int __thiscall CSenBaseFragment::ConsistsOfL(class MSenFragment &)
+	?Content@CSenBaseElement@@UBE?AVTPtrC8@@XZ @ 66 NONAME ; public: virtual class TPtrC8 __thiscall CSenBaseElement::Content(void)const 
+	?Content@CSenBaseFragment@@UAE?AVTPtrC8@@XZ @ 67 NONAME ; public: virtual class TPtrC8 __thiscall CSenBaseFragment::Content(void)
+	?ContentOf@CSenBaseFragment@@IAE?AVTPtrC8@@ABVTDesC8@@@Z @ 68 NONAME ; protected: class TPtrC8 __thiscall CSenBaseFragment::ContentOf(class TDesC8 const &)
+	?ContentUnicodeL@CSenBaseElement@@UBEPAVHBufC16@@XZ @ 69 NONAME ; public: virtual class HBufC16 * __thiscall CSenBaseElement::ContentUnicodeL(void)const 
+	?ContentWriteStreamL@CSenBaseElement@@UAEAAVRWriteStream@@XZ @ 70 NONAME ; public: virtual class RWriteStream & __thiscall CSenBaseElement::ContentWriteStreamL(void)
+	?CopyFromL@CSenBaseElement@@UAEXAAVCSenElement@@@Z @ 71 NONAME ; public: virtual void __thiscall CSenBaseElement::CopyFromL(class CSenElement &)
+	?CreateElementL@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 72 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::CreateElementL(class TDesC8 const &,class TDesC8 const &)
+	?DecodeHttpCharactersL@SenXmlUtils@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 73 NONAME ; public: static int __cdecl SenXmlUtils::DecodeHttpCharactersL(class TDesC8 const &,class HBufC8 * &)
+	?DecodeHttpCharactersLC@SenXmlUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 74 NONAME ; public: static class HBufC8 * __cdecl SenXmlUtils::DecodeHttpCharactersLC(class TDesC8 const &)
+	?DelegateParsingL@CSenBaseFragment@@UAEXAAVMSenFragment@@@Z @ 75 NONAME ; public: virtual void __thiscall CSenBaseFragment::DelegateParsingL(class MSenFragment &)
+	?DelegateParsingL@CSenBaseFragment@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 76 NONAME ; public: virtual void __thiscall CSenBaseFragment::DelegateParsingL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?DetachL@CSenBaseElement@@UAEPAVCSenElement@@XZ @ 77 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::DetachL(void)
+	?DetachL@CSenBaseFragment@@UAEXXZ @ 78 NONAME ; public: virtual void __thiscall CSenBaseFragment::DetachL(void)
+	?Element@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 79 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::Element(class TDesC8 const &,class TDesC8 const &)
+	?Element@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@@Z @ 80 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::Element(class TDesC8 const &)
+	?ElementsL@CSenBaseElement@@UAEAAV?$RPointerArray@VCSenElement@@@@XZ @ 81 NONAME ; public: virtual class RPointerArray<class CSenElement> & __thiscall CSenBaseElement::ElementsL(void)
+	?ElementsL@CSenBaseElement@@UAEHAAV?$RPointerArray@VCSenElement@@@@ABVTDesC8@@1@Z @ 82 NONAME ; public: virtual int __thiscall CSenBaseElement::ElementsL(class RPointerArray<class CSenElement> &,class TDesC8 const &,class TDesC8 const &)
+	?ElementsL@CSenBaseElement@@UAEHAAV?$RPointerArray@VCSenElement@@@@ABVTDesC8@@@Z @ 83 NONAME ; public: virtual int __thiscall CSenBaseElement::ElementsL(class RPointerArray<class CSenElement> &,class TDesC8 const &)
+	?EnabledParserFeature@CSenXmlReader@@UAEHXZ @ 84 NONAME ; public: virtual int __thiscall CSenXmlReader::EnabledParserFeature(void)
+	?EncodeHttpCharactersL@SenXmlUtils@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 85 NONAME ; public: static int __cdecl SenXmlUtils::EncodeHttpCharactersL(class TDesC8 const &,class HBufC8 * &)
+	?EncodeHttpCharactersLC@SenXmlUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 86 NONAME ; public: static class HBufC8 * __cdecl SenXmlUtils::EncodeHttpCharactersLC(class TDesC8 const &)
+	?EndDocument@CSenBaseFragment@@EAEHXZ @ 87 NONAME ; private: virtual int __thiscall CSenBaseFragment::EndDocument(void)
+	?EndElement@CSenBaseFragment@@EAEHABVTDesC8@@00@Z @ 88 NONAME ; private: virtual int __thiscall CSenBaseFragment::EndElement(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?EndElementL@CSenBaseFragment@@MAEXABVTDesC8@@00@Z @ 89 NONAME ; protected: virtual void __thiscall CSenBaseFragment::EndElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?EndsWith@SenXmlUtils@@SAHABVTDesC8@@0@Z @ 90 NONAME ; public: static int __cdecl SenXmlUtils::EndsWith(class TDesC8 const &,class TDesC8 const &)
+	?EnsureNamespace@CSenBaseFragment@@UAEXABVTDesC8@@@Z @ 91 NONAME ; public: virtual void __thiscall CSenBaseFragment::EnsureNamespace(class TDesC8 const &)
+	?Error@CSenBaseFragment@@EAEHH@Z @ 92 NONAME ; private: virtual int __thiscall CSenBaseFragment::Error(int)
+	?ExpandL@CSenDomFragment@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 93 NONAME ; public: virtual void __thiscall CSenDomFragment::ExpandL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?ExtractElement@CSenBaseFragment@@UAEPAVCSenElement@@XZ @ 94 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseFragment::ExtractElement(void)
+	?FindAttr@CSenBaseElement@@MAEPAVCSenBaseAttribute@@ABVTDesC8@@@Z @ 95 NONAME ; protected: virtual class CSenBaseAttribute * __thiscall CSenBaseElement::FindAttr(class TDesC8 const &)
+	?HasContent@CSenBaseElement@@UBEHXZ @ 96 NONAME ; public: virtual int __thiscall CSenBaseElement::HasContent(void)const 
+	?IndexOfElement@CSenBaseElement@@MBEHABVTDesC8@@0@Z @ 97 NONAME ; protected: virtual int __thiscall CSenBaseElement::IndexOfElement(class TDesC8 const &,class TDesC8 const &)const 
+	?InsertElementL@CSenBaseElement@@UAEAAVCSenElement@@AAV2@ABV2@@Z @ 98 NONAME ; public: virtual class CSenElement & __thiscall CSenBaseElement::InsertElementL(class CSenElement &,class CSenElement const &)
+	?InsertL@CSenNamespace@@QAEXAAVRBufWriteStream@@@Z @ 99 NONAME ; public: void __thiscall CSenNamespace::InsertL(class RBufWriteStream &)
+	?LeaveOnXmlEscapesL@SenXmlUtils@@SAXABVTDesC8@@@Z @ 100 NONAME ; public: static void __cdecl SenXmlUtils::LeaveOnXmlEscapesL(class TDesC8 const &)
+	?LocalName@CSenBaseElement@@UBEABVTDesC8@@XZ @ 101 NONAME ; public: virtual class TDesC8 const & __thiscall CSenBaseElement::LocalName(void)const 
+	?LocalName@CSenBaseFragment@@UBEABVTDesC8@@XZ @ 102 NONAME ; public: virtual class TDesC8 const & __thiscall CSenBaseFragment::LocalName(void)const 
+	?LocalName@SenXmlUtils@@SA?AVTPtrC8@@ABVTDesC8@@@Z @ 103 NONAME ; public: static class TPtrC8 __cdecl SenXmlUtils::LocalName(class TDesC8 const &)
+	?MatchesL@CSenNamespace@@QBEHABV1@@Z @ 104 NONAME ; public: int __thiscall CSenNamespace::MatchesL(class CSenNamespace const &)const 
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@0@Z @ 105 NONAME ; public: virtual class CSenNamespace const * __thiscall CSenBaseElement::Namespace(class TDesC8 const &,class TDesC8 const &)
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@@Z @ 106 NONAME ; public: virtual class CSenNamespace const * __thiscall CSenBaseElement::Namespace(class TDesC8 const &)
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@H@Z @ 107 NONAME ; public: virtual class CSenNamespace const * __thiscall CSenBaseElement::Namespace(class TDesC8 const &,int)
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@XZ @ 108 NONAME ; public: virtual class CSenNamespace const * __thiscall CSenBaseElement::Namespace(void)
+	?Namespace@CSenBaseFragment@@UAEPAVCSenNamespace@@ABVTDesC8@@@Z @ 109 NONAME ; public: virtual class CSenNamespace * __thiscall CSenBaseFragment::Namespace(class TDesC8 const &)
+	?NamespaceURI@CSenBaseElement@@UBEABVTDesC8@@XZ @ 110 NONAME ; public: virtual class TDesC8 const & __thiscall CSenBaseElement::NamespaceURI(void)const 
+	?NamespacesL@CSenBaseElement@@UAEAAV?$RPointerArray@VCSenNamespace@@@@XZ @ 111 NONAME ; public: virtual class RPointerArray<class CSenNamespace> & __thiscall CSenBaseElement::NamespacesL(void)
+	?NewL@CSenBaseAttribute@@SAPAV1@ABVTDesC8@@00@Z @ 112 NONAME ; public: static class CSenBaseAttribute * __cdecl CSenBaseAttribute::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenBaseAttribute@@SAPAV1@ABVTDesC8@@0@Z @ 113 NONAME ; public: static class CSenBaseAttribute * __cdecl CSenBaseAttribute::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@00@Z @ 114 NONAME ; public: static class CSenBaseElement * __cdecl CSenBaseElement::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 115 NONAME ; public: static class CSenBaseElement * __cdecl CSenBaseElement::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 116 NONAME ; public: static class CSenBaseElement * __cdecl CSenBaseElement::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@0@Z @ 117 NONAME ; public: static class CSenBaseElement * __cdecl CSenBaseElement::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@@Z @ 118 NONAME ; public: static class CSenBaseElement * __cdecl CSenBaseElement::NewL(class TDesC8 const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVCSenElement@@@Z @ 119 NONAME ; public: static class CSenBaseFragment * __cdecl CSenBaseFragment::NewL(class CSenElement const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@00@Z @ 120 NONAME ; public: static class CSenBaseFragment * __cdecl CSenBaseFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 121 NONAME ; public: static class CSenBaseFragment * __cdecl CSenBaseFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 122 NONAME ; public: static class CSenBaseFragment * __cdecl CSenBaseFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@0@Z @ 123 NONAME ; public: static class CSenBaseFragment * __cdecl CSenBaseFragment::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@@Z @ 124 NONAME ; public: static class CSenBaseFragment * __cdecl CSenBaseFragment::NewL(class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVCSenElement@@@Z @ 125 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(class CSenElement const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@00@Z @ 126 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 127 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 128 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &,class CSenElement &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@0@Z @ 129 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@@Z @ 130 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@XZ @ 131 NONAME ; public: static class CSenDomFragment * __cdecl CSenDomFragment::NewL(void)
+	?NewL@CSenNamespace@@SAPAV1@ABVTDesC8@@0@Z @ 132 NONAME ; public: static class CSenNamespace * __cdecl CSenNamespace::NewL(class TDesC8 const &,class TDesC8 const &)
+	?NewL@CSenNamespace@@SAPAV1@ABVTDesC8@@@Z @ 133 NONAME ; public: static class CSenNamespace * __cdecl CSenNamespace::NewL(class TDesC8 const &)
+	?NewL@CSenXmlReader@@SAPAV1@H@Z @ 134 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewL(int)
+	?NewL@CSenXmlReader@@SAPAV1@XZ @ 135 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewL(void)
+	?NewLC@CSenNamespace@@SAPAV1@ABVTDesC8@@0@Z @ 136 NONAME ; public: static class CSenNamespace * __cdecl CSenNamespace::NewLC(class TDesC8 const &,class TDesC8 const &)
+	?NewLC@CSenNamespace@@SAPAV1@ABVTDesC8@@@Z @ 137 NONAME ; public: static class CSenNamespace * __cdecl CSenNamespace::NewLC(class TDesC8 const &)
+	?NewLC@CSenXmlReader@@SAPAV1@H@Z @ 138 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewLC(int)
+	?NewLC@CSenXmlReader@@SAPAV1@XZ @ 139 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewLC(void)
+	?NsPrefix@CSenBaseElement@@UBEABVTDesC8@@XZ @ 140 NONAME ; public: virtual class TDesC8 const & __thiscall CSenBaseElement::NsPrefix(void)const 
+	?NsPrefix@CSenBaseFragment@@UBEABVTDesC8@@XZ @ 141 NONAME ; public: virtual class TDesC8 const & __thiscall CSenBaseFragment::NsPrefix(void)const 
+	?NsPrefix@SenXmlUtils@@SA?AVTPtrC8@@ABVTDesC8@@@Z @ 142 NONAME ; public: static class TPtrC8 __cdecl SenXmlUtils::NsPrefix(class TDesC8 const &)
+	?NsUri@CSenBaseFragment@@UBEABVTDesC8@@XZ @ 143 NONAME ; public: virtual class TDesC8 const & __thiscall CSenBaseFragment::NsUri(void)const 
+	?Parent@CSenBaseElement@@UAEPAVCSenElement@@XZ @ 144 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::Parent(void)
+	?ParseL@CSenBaseFragment@@UAEXABVTDesC8@@@Z @ 145 NONAME ; public: virtual void __thiscall CSenBaseFragment::ParseL(class TDesC8 const &)
+	?ParseL@CSenXmlReader@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 146 NONAME ; public: void __thiscall CSenXmlReader::ParseL(class RFs &,class TDesC16 const &)
+	?ParseL@CSenXmlReader@@QAEXABVTDesC8@@@Z @ 147 NONAME ; public: void __thiscall CSenXmlReader::ParseL(class TDesC8 const &)
+	?ParseWithL@CSenBaseFragment@@UAEXAAVCSenXmlReader@@@Z @ 148 NONAME ; public: virtual void __thiscall CSenBaseFragment::ParseWithL(class CSenXmlReader &)
+	?ParseWithL@CSenDomFragment@@UAEXAAVCSenXmlReader@@@Z @ 149 NONAME ; public: virtual void __thiscall CSenDomFragment::ParseWithL(class CSenXmlReader &)
+	?Prefix@CSenNamespace@@QBEABVTDesC8@@XZ @ 150 NONAME ; public: class TDesC8 const & __thiscall CSenNamespace::Prefix(void)const 
+	?Reader@CSenBaseFragment@@UAEPAVCSenXmlReader@@XZ @ 151 NONAME ; public: virtual class CSenXmlReader * __thiscall CSenBaseFragment::Reader(void)
+	?RemoveElement@CSenBaseElement@@UAEPAVCSenElement@@AAV2@@Z @ 152 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::RemoveElement(class CSenElement &)
+	?RemoveElement@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 153 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::RemoveElement(class TDesC8 const &,class TDesC8 const &)
+	?RemoveElement@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@@Z @ 154 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::RemoveElement(class TDesC8 const &)
+	?ReplaceElementL@CSenBaseElement@@UAEPAVCSenElement@@AAV2@@Z @ 155 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::ReplaceElementL(class CSenElement &)
+	?ResetContentL@CSenBaseFragment@@UAEXXZ @ 156 NONAME ; public: virtual void __thiscall CSenBaseFragment::ResetContentL(void)
+	?ResumeParsingFromL@CSenBaseFragment@@UAEXABVTDesC8@@00@Z @ 157 NONAME ; public: virtual void __thiscall CSenBaseFragment::ResumeParsingFromL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?ResumeParsingFromL@CSenDomFragment@@UAEXABVTDesC8@@00@Z @ 158 NONAME ; public: virtual void __thiscall CSenDomFragment::ResumeParsingFromL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?Root@CSenBaseElement@@UAEAAVMSenElement@@XZ @ 159 NONAME ; public: virtual class MSenElement & __thiscall CSenBaseElement::Root(void)
+	?SaveNamespacesL@CSenBaseFragment@@UAEXABV?$RArray@VRAttribute@Xml@@@@H@Z @ 160 NONAME ; public: virtual void __thiscall CSenBaseFragment::SaveNamespacesL(class RArray<class Xml::RAttribute> const &,int)
+	?Set@CSenBaseElement@@UAEXABVTDesC8@@00@Z @ 161 NONAME ; public: virtual void __thiscall CSenBaseElement::Set(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?SetAttributesL@CSenBaseElement@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 162 NONAME ; public: virtual void __thiscall CSenBaseElement::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetAttributesL@CSenBaseFragment@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 163 NONAME ; public: virtual void __thiscall CSenBaseFragment::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetAttributesL@CSenDomFragment@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 164 NONAME ; public: virtual void __thiscall CSenDomFragment::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetContentHandler@CSenXmlReader@@UAEXAAVMSenContentHandlerClient@@@Z @ 165 NONAME ; public: virtual void __thiscall CSenXmlReader::SetContentHandler(class MSenContentHandlerClient &)
+	?SetContentL@CSenBaseElement@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 166 NONAME ; public: virtual class TPtrC8 __thiscall CSenBaseElement::SetContentL(class TDesC8 const &)
+	?SetContentOfL@CSenBaseFragment@@IAEAAVMSenElement@@ABVTDesC8@@0@Z @ 167 NONAME ; protected: class MSenElement & __thiscall CSenBaseFragment::SetContentOfL(class TDesC8 const &,class TDesC8 const &)
+	?SetNamespaceL@CSenBaseElement@@UAEXABVTDesC8@@0@Z @ 168 NONAME ; public: virtual void __thiscall CSenBaseElement::SetNamespaceL(class TDesC8 const &,class TDesC8 const &)
+	?SetNamespaceL@CSenBaseElement@@UAEXABVTDesC8@@@Z @ 169 NONAME ; public: virtual void __thiscall CSenBaseElement::SetNamespaceL(class TDesC8 const &)
+	?SetOwner@CSenBaseFragment@@UAEXAAVMSenFragment@@@Z @ 170 NONAME ; public: virtual void __thiscall CSenBaseFragment::SetOwner(class MSenFragment &)
+	?SetParent@CSenBaseElement@@UAEPAVCSenElement@@PAV2@@Z @ 171 NONAME ; public: virtual class CSenElement * __thiscall CSenBaseElement::SetParent(class CSenElement *)
+	?SetPrefixL@CSenBaseElement@@UAEXABVTDesC8@@@Z @ 172 NONAME ; public: virtual void __thiscall CSenBaseElement::SetPrefixL(class TDesC8 const &)
+	?SetPrefixL@CSenNamespace@@QAEXABVTDesC8@@@Z @ 173 NONAME ; public: void __thiscall CSenNamespace::SetPrefixL(class TDesC8 const &)
+	?SetReader@CSenBaseFragment@@UAEXAAVCSenXmlReader@@@Z @ 174 NONAME ; public: virtual void __thiscall CSenBaseFragment::SetReader(class CSenXmlReader &)
+	?SetUriL@CSenNamespace@@QAEXABVTDesC8@@@Z @ 175 NONAME ; public: void __thiscall CSenNamespace::SetUriL(class TDesC8 const &)
+	?StartDocument@CSenBaseFragment@@EAEHXZ @ 176 NONAME ; private: virtual int __thiscall CSenBaseFragment::StartDocument(void)
+	?StartElement@CSenBaseFragment@@EAEHABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 177 NONAME ; private: virtual int __thiscall CSenBaseFragment::StartElement(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenBaseFragment@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 178 NONAME ; protected: virtual void __thiscall CSenBaseFragment::StartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenDomFragment@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 179 NONAME ; protected: virtual void __thiscall CSenDomFragment::StartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?StartEntity@CSenBaseFragment@@IAEHAAVTDesC8@@@Z @ 180 NONAME ; protected: int __thiscall CSenBaseFragment::StartEntity(class TDesC8 &)
+	?StartsWith@SenXmlUtils@@SAHABVTDesC8@@0@Z @ 181 NONAME ; public: static int __cdecl SenXmlUtils::StartsWith(class TDesC8 const &,class TDesC8 const &)
+	?ToUnicodeLC@SenXmlUtils@@SAPAVHBufC16@@ABVTDesC8@@@Z @ 182 NONAME ; public: static class HBufC16 * __cdecl SenXmlUtils::ToUnicodeLC(class TDesC8 const &)
+	?ToUtf8LC@SenXmlUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 183 NONAME ; public: static class HBufC8 * __cdecl SenXmlUtils::ToUtf8LC(class TDesC16 const &)
+	?URI@CSenNamespace@@QBEABVTDesC8@@XZ @ 184 NONAME ; public: class TDesC8 const & __thiscall CSenNamespace::URI(void)const 
+	?WriteAsXMLToL@CSenBaseElement@@UAEXAAVRWriteStream@@@Z @ 185 NONAME ; public: virtual void __thiscall CSenBaseElement::WriteAsXMLToL(class RWriteStream &)
+	?WriteAsXMLToL@CSenBaseFragment@@UAEXAAVRWriteStream@@@Z @ 186 NONAME ; public: virtual void __thiscall CSenBaseFragment::WriteAsXMLToL(class RWriteStream &)
+	?WriteAttrToL@CSenBaseElement@@MAEXAAVRWriteStream@@ABVTDesC8@@1@Z @ 187 NONAME ; protected: virtual void __thiscall CSenBaseElement::WriteAttrToL(class RWriteStream &,class TDesC8 const &,class TDesC8 const &)
+	?WriteAttrsToL@CSenBaseElement@@MAEXAAVRWriteStream@@@Z @ 188 NONAME ; protected: virtual void __thiscall CSenBaseElement::WriteAttrsToL(class RWriteStream &)
+	?WriteContentToL@CSenBaseElement@@MAEXAAVRWriteStream@@@Z @ 189 NONAME ; protected: virtual void __thiscall CSenBaseElement::WriteContentToL(class RWriteStream &)
+	?WriteElementsToL@CSenBaseElement@@MAEXAAVRWriteStream@@@Z @ 190 NONAME ; protected: virtual void __thiscall CSenBaseElement::WriteElementsToL(class RWriteStream &)
+	?WriteEndElementL@CSenBaseFragment@@UAEXABVTDesC8@@00@Z @ 191 NONAME ; public: virtual void __thiscall CSenBaseFragment::WriteEndElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?WriteEndElementL@CSenDomFragment@@MAEXABVTDesC8@@00@Z @ 192 NONAME ; protected: virtual void __thiscall CSenDomFragment::WriteEndElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &)
+	?WriteNamespacesToL@CSenBaseElement@@UAEXAAVRWriteStream@@@Z @ 193 NONAME ; public: virtual void __thiscall CSenBaseElement::WriteNamespacesToL(class RWriteStream &)
+	?WriteStartElementL@CSenBaseFragment@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 194 NONAME ; public: virtual void __thiscall CSenBaseFragment::WriteStartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?WriteStartElementL@CSenDomFragment@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 195 NONAME ; protected: virtual void __thiscall CSenDomFragment::WriteStartElementL(class TDesC8 const &,class TDesC8 const &,class TDesC8 const &,class RArray<class Xml::RAttribute> const &)
+	?WriteToBufL@CSenBaseElement@@MAE?AVTPtrC8@@AAVCBufBase@@@Z @ 196 NONAME ; protected: virtual class TPtrC8 __thiscall CSenBaseElement::WriteToBufL(class CBufBase &)
+	?NewL@CSenXmlReader@@SAPAV1@ABVTDesC8@@@Z @ 197 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewL(class TDesC8 const &)
+	?NewL@CSenXmlReader@@SAPAV1@ABVTDesC8@@H@Z @ 198 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewL(class TDesC8 const &,int)
+	?NewLC@CSenXmlReader@@SAPAV1@ABVTDesC8@@@Z @ 199 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewLC(class TDesC8 const &)
+	?NewLC@CSenXmlReader@@SAPAV1@ABVTDesC8@@H@Z @ 200 NONAME ; public: static class CSenXmlReader * __cdecl CSenXmlReader::NewLC(class TDesC8 const &,int)
+	?ParserFeature@CSenXmlReader@@UAEHXZ @ 201 NONAME ; public: virtual int __thiscall CSenXmlReader::ParserFeature(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/BWINSCW/SENXMLU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,282 @@
+EXPORTS
+	??0CSenBaseAttribute@@IAE@XZ @ 1 NONAME ; CSenBaseAttribute::CSenBaseAttribute(void)
+	??0CSenBaseElement@@IAE@XZ @ 2 NONAME ; CSenBaseElement::CSenBaseElement(void)
+	??0CSenBaseFragment@@IAE@XZ @ 3 NONAME ; CSenBaseFragment::CSenBaseFragment(void)
+	??0CSenDomFragment@@IAE@XZ @ 4 NONAME ; CSenDomFragment::CSenDomFragment(void)
+	??0CSenXmlReader@@IAE@H@Z @ 5 NONAME ; CSenXmlReader::CSenXmlReader(int)
+	??1CSenBaseAttribute@@UAE@XZ @ 6 NONAME ; CSenBaseAttribute::~CSenBaseAttribute(void)
+	??1CSenBaseElement@@UAE@XZ @ 7 NONAME ; CSenBaseElement::~CSenBaseElement(void)
+	??1CSenBaseFragment@@UAE@XZ @ 8 NONAME ; CSenBaseFragment::~CSenBaseFragment(void)
+	??1CSenDomFragment@@UAE@XZ @ 9 NONAME ; CSenDomFragment::~CSenDomFragment(void)
+	??1CSenNamespace@@UAE@XZ @ 10 NONAME ; CSenNamespace::~CSenNamespace(void)
+	??1CSenXmlReader@@UAE@XZ @ 11 NONAME ; CSenXmlReader::~CSenXmlReader(void)
+	?AddAttrL@CSenBaseElement@@UAEXABVTDesC8@@0@Z @ 12 NONAME ; void CSenBaseElement::AddAttrL(class TDesC8 const &, class TDesC8 const &)
+	?AddAttributeL@CSenBaseElement@@IAEABVTDesC8@@PAVCSenBaseAttribute@@@Z @ 13 NONAME ; class TDesC8 const & CSenBaseElement::AddAttributeL(class CSenBaseAttribute *)
+	?AddAttributeL@CSenBaseElement@@MAEABVTDesC8@@ABV2@00@Z @ 14 NONAME ; class TDesC8 const & CSenBaseElement::AddAttributeL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddAttributeL@CSenBaseElement@@MAEABVTDesC8@@ABV2@0@Z @ 15 NONAME ; class TDesC8 const & CSenBaseElement::AddAttributeL(class TDesC8 const &, class TDesC8 const &)
+	?AddAttributesL@CSenBaseElement@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 16 NONAME ; void CSenBaseElement::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@AAV2@@Z @ 17 NONAME ; class CSenElement & CSenBaseElement::AddElementL(class CSenElement &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@ABVTDesC8@@00@Z @ 18 NONAME ; class CSenElement & CSenBaseElement::AddElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@ABVTDesC8@@0@Z @ 19 NONAME ; class CSenElement & CSenBaseElement::AddElementL(class TDesC8 const &, class TDesC8 const &)
+	?AddElementL@CSenBaseElement@@UAEAAVCSenElement@@ABVTDesC8@@@Z @ 20 NONAME ; class CSenElement & CSenBaseElement::AddElementL(class TDesC8 const &)
+	?AddNamespaceL@CSenBaseElement@@UAEPBVCSenNamespace@@AAV2@H@Z @ 21 NONAME ; class CSenNamespace const * CSenBaseElement::AddNamespaceL(class CSenNamespace &, int)
+	?AddNamespaceL@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@0@Z @ 22 NONAME ; class CSenNamespace const * CSenBaseElement::AddNamespaceL(class TDesC8 const &, class TDesC8 const &)
+	?AllocAttrValueL@SenXmlUtils@@SAPAVHBufC8@@ABV?$RArray@VRAttribute@Xml@@@@ABVTDesC8@@@Z @ 23 NONAME ; class HBufC8 * SenXmlUtils::AllocAttrValueL(class RArray<class Xml::RAttribute> const &, class TDesC8 const &)
+	?AllocContentBufL@CSenBaseElement@@MAEXXZ @ 24 NONAME ; void CSenBaseElement::AllocContentBufL(void)
+	?AllocContentSaverL@CSenBaseFragment@@MAEXXZ @ 25 NONAME ; void CSenBaseFragment::AllocContentSaverL(void)
+	?AsElement@CSenBaseElement@@UAEPAVMSenElement@@XZ @ 26 NONAME ; class MSenElement * CSenBaseElement::AsElement(void)
+	?AsElement@CSenBaseFragment@@UAEAAVCSenElement@@XZ @ 27 NONAME ; class CSenElement & CSenBaseFragment::AsElement(void)
+	?AsXmlL@CSenBaseElement@@UAEPAVHBufC8@@XZ @ 28 NONAME ; class HBufC8 * CSenBaseElement::AsXmlL(void)
+	?AsXmlL@CSenBaseFragment@@UAEPAVHBufC8@@XZ @ 29 NONAME ; class HBufC8 * CSenBaseFragment::AsXmlL(void)
+	?AsXmlUnicodeL@CSenBaseElement@@UAEPAVHBufC16@@XZ @ 30 NONAME ; class HBufC16 * CSenBaseElement::AsXmlUnicodeL(void)
+	?AsXmlUnicodeL@CSenBaseFragment@@UAEPAVHBufC16@@XZ @ 31 NONAME ; class HBufC16 * CSenBaseFragment::AsXmlUnicodeL(void)
+	?AttrValue@CSenBaseElement@@UAEPBVTDesC8@@ABV2@@Z @ 32 NONAME ; class TDesC8 const * CSenBaseElement::AttrValue(class TDesC8 const &)
+	?AttrValue@SenXmlUtils@@SA?AVTPtrC8@@ABV?$RArray@VRAttribute@Xml@@@@ABVTDesC8@@@Z @ 33 NONAME ; class TPtrC8 SenXmlUtils::AttrValue(class RArray<class Xml::RAttribute> const &, class TDesC8 const &)
+	?AttributesL@CSenBaseElement@@UAEAAV?$RPointerArray@VCSenBaseAttribute@@@@XZ @ 34 NONAME ; class RPointerArray<class CSenBaseAttribute> & CSenBaseElement::AttributesL(void)
+	?BaseConstructL@CSenBaseAttribute@@IAEXABVTDesC8@@00@Z @ 35 NONAME ; void CSenBaseAttribute::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenBaseAttribute@@IAEXABVTDesC8@@0@Z @ 36 NONAME ; void CSenBaseAttribute::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@00@Z @ 37 NONAME ; void CSenBaseElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 38 NONAME ; void CSenBaseElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 39 NONAME ; void CSenBaseElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@0@Z @ 40 NONAME ; void CSenBaseElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenBaseElement@@IAEXABVTDesC8@@@Z @ 41 NONAME ; void CSenBaseElement::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXAAVCSenXmlReader@@@Z @ 42 NONAME ; void CSenBaseFragment::BaseConstructL(class CSenXmlReader &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVCSenElement@@@Z @ 43 NONAME ; void CSenBaseFragment::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@00@Z @ 44 NONAME ; void CSenBaseFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 45 NONAME ; void CSenBaseFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 46 NONAME ; void CSenBaseFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@0@Z @ 47 NONAME ; void CSenBaseFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenBaseFragment@@IAEXABVTDesC8@@@Z @ 48 NONAME ; void CSenBaseFragment::BaseConstructL(class TDesC8 const &)
+	?BaseConstructL@CSenDomFragment@@IAEXAAVCSenXmlReader@@@Z @ 49 NONAME ; void CSenDomFragment::BaseConstructL(class CSenXmlReader &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVCSenElement@@@Z @ 50 NONAME ; void CSenDomFragment::BaseConstructL(class CSenElement const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@00@Z @ 51 NONAME ; void CSenDomFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 52 NONAME ; void CSenDomFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 53 NONAME ; void CSenDomFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@0@Z @ 54 NONAME ; void CSenDomFragment::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenDomFragment@@IAEXABVTDesC8@@@Z @ 55 NONAME ; void CSenDomFragment::BaseConstructL(class TDesC8 const &)
+	?BuildFrom@CSenBaseFragment@@UAEHABVTDesC8@@@Z @ 56 NONAME ; int CSenBaseFragment::BuildFrom(class TDesC8 const &)
+	?BuildQNameL@SenXmlUtils@@SAXABVTDesC8@@0AAPAVHBufC8@@@Z @ 57 NONAME ; void SenXmlUtils::BuildQNameL(class TDesC8 const &, class TDesC8 const &, class HBufC8 * &)
+	?Characters@CSenBaseFragment@@EAEHABVTDesC8@@HH@Z @ 58 NONAME ; int CSenBaseFragment::Characters(class TDesC8 const &, int, int)
+	?CharactersL@CSenBaseFragment@@MAEXABVTDesC8@@HH@Z @ 59 NONAME ; void CSenBaseFragment::CharactersL(class TDesC8 const &, int, int)
+	?CharactersL@CSenDomFragment@@MAEXABVTDesC8@@HH@Z @ 60 NONAME ; void CSenDomFragment::CharactersL(class TDesC8 const &, int, int)
+	?Child@CSenBaseElement@@UAEPAVCSenElement@@H@Z @ 61 NONAME ; class CSenElement * CSenBaseElement::Child(int)
+	?Compare@CSenNamespace@@QBEHABV1@@Z @ 62 NONAME ; int CSenNamespace::Compare(class CSenNamespace const &) const
+	?Compare@CSenNamespace@@QBEHABVTDesC8@@0@Z @ 63 NONAME ; int CSenNamespace::Compare(class TDesC8 const &, class TDesC8 const &) const
+	?ConsistsOfL@CSenBaseElement@@UAEHAAVMSenElement@@@Z @ 64 NONAME ; int CSenBaseElement::ConsistsOfL(class MSenElement &)
+	?ConsistsOfL@CSenBaseFragment@@UAEHAAVMSenFragment@@@Z @ 65 NONAME ; int CSenBaseFragment::ConsistsOfL(class MSenFragment &)
+	?Content@CSenBaseElement@@UBE?AVTPtrC8@@XZ @ 66 NONAME ; class TPtrC8 CSenBaseElement::Content(void) const
+	?Content@CSenBaseFragment@@UAE?AVTPtrC8@@XZ @ 67 NONAME ; class TPtrC8 CSenBaseFragment::Content(void)
+	?ContentOf@CSenBaseFragment@@IAE?AVTPtrC8@@ABVTDesC8@@@Z @ 68 NONAME ; class TPtrC8 CSenBaseFragment::ContentOf(class TDesC8 const &)
+	?ContentUnicodeL@CSenBaseElement@@UBEPAVHBufC16@@XZ @ 69 NONAME ; class HBufC16 * CSenBaseElement::ContentUnicodeL(void) const
+	?ContentWriteStreamL@CSenBaseElement@@UAEAAVRWriteStream@@XZ @ 70 NONAME ; class RWriteStream & CSenBaseElement::ContentWriteStreamL(void)
+	?CopyFromL@CSenBaseElement@@UAEXAAVCSenElement@@@Z @ 71 NONAME ; void CSenBaseElement::CopyFromL(class CSenElement &)
+	?CreateElementL@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 72 NONAME ; class CSenElement * CSenBaseElement::CreateElementL(class TDesC8 const &, class TDesC8 const &)
+	?DecodeHttpCharactersL@SenXmlUtils@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 73 NONAME ; int SenXmlUtils::DecodeHttpCharactersL(class TDesC8 const &, class HBufC8 * &)
+	?DecodeHttpCharactersLC@SenXmlUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 74 NONAME ; class HBufC8 * SenXmlUtils::DecodeHttpCharactersLC(class TDesC8 const &)
+	?DelegateParsingL@CSenBaseFragment@@UAEXAAVMSenFragment@@@Z @ 75 NONAME ; void CSenBaseFragment::DelegateParsingL(class MSenFragment &)
+	?DelegateParsingL@CSenBaseFragment@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 76 NONAME ; void CSenBaseFragment::DelegateParsingL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?DetachL@CSenBaseElement@@UAEPAVCSenElement@@XZ @ 77 NONAME ; class CSenElement * CSenBaseElement::DetachL(void)
+	?DetachL@CSenBaseFragment@@UAEXXZ @ 78 NONAME ; void CSenBaseFragment::DetachL(void)
+	?Element@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 79 NONAME ; class CSenElement * CSenBaseElement::Element(class TDesC8 const &, class TDesC8 const &)
+	?Element@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@@Z @ 80 NONAME ; class CSenElement * CSenBaseElement::Element(class TDesC8 const &)
+	?ElementsL@CSenBaseElement@@UAEAAV?$RPointerArray@VCSenElement@@@@XZ @ 81 NONAME ; class RPointerArray<class CSenElement> & CSenBaseElement::ElementsL(void)
+	?ElementsL@CSenBaseElement@@UAEHAAV?$RPointerArray@VCSenElement@@@@ABVTDesC8@@1@Z @ 82 NONAME ; int CSenBaseElement::ElementsL(class RPointerArray<class CSenElement> &, class TDesC8 const &, class TDesC8 const &)
+	?ElementsL@CSenBaseElement@@UAEHAAV?$RPointerArray@VCSenElement@@@@ABVTDesC8@@@Z @ 83 NONAME ; int CSenBaseElement::ElementsL(class RPointerArray<class CSenElement> &, class TDesC8 const &)
+	?EnabledParserFeature@CSenXmlReader@@UAEHXZ @ 84 NONAME ; int CSenXmlReader::EnabledParserFeature(void)
+	?EncodeHttpCharactersL@SenXmlUtils@@SAHABVTDesC8@@AAPAVHBufC8@@@Z @ 85 NONAME ; int SenXmlUtils::EncodeHttpCharactersL(class TDesC8 const &, class HBufC8 * &)
+	?EncodeHttpCharactersLC@SenXmlUtils@@SAPAVHBufC8@@ABVTDesC8@@@Z @ 86 NONAME ; class HBufC8 * SenXmlUtils::EncodeHttpCharactersLC(class TDesC8 const &)
+	?EndDocument@CSenBaseFragment@@EAEHXZ @ 87 NONAME ; int CSenBaseFragment::EndDocument(void)
+	?EndElement@CSenBaseFragment@@EAEHABVTDesC8@@00@Z @ 88 NONAME ; int CSenBaseFragment::EndElement(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?EndElementL@CSenBaseFragment@@MAEXABVTDesC8@@00@Z @ 89 NONAME ; void CSenBaseFragment::EndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?EndsWith@SenXmlUtils@@SAHABVTDesC8@@0@Z @ 90 NONAME ; int SenXmlUtils::EndsWith(class TDesC8 const &, class TDesC8 const &)
+	?EnsureNamespace@CSenBaseFragment@@UAEXABVTDesC8@@@Z @ 91 NONAME ; void CSenBaseFragment::EnsureNamespace(class TDesC8 const &)
+	?Error@CSenBaseFragment@@EAEHH@Z @ 92 NONAME ; int CSenBaseFragment::Error(int)
+	?ExpandL@CSenDomFragment@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 93 NONAME ; void CSenDomFragment::ExpandL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?ExtractElement@CSenBaseFragment@@UAEPAVCSenElement@@XZ @ 94 NONAME ; class CSenElement * CSenBaseFragment::ExtractElement(void)
+	?FindAttr@CSenBaseElement@@MAEPAVCSenBaseAttribute@@ABVTDesC8@@@Z @ 95 NONAME ; class CSenBaseAttribute * CSenBaseElement::FindAttr(class TDesC8 const &)
+	?HasContent@CSenBaseElement@@UBEHXZ @ 96 NONAME ; int CSenBaseElement::HasContent(void) const
+	?IndexOfElement@CSenBaseElement@@MBEHABVTDesC8@@0@Z @ 97 NONAME ; int CSenBaseElement::IndexOfElement(class TDesC8 const &, class TDesC8 const &) const
+	?InsertElementL@CSenBaseElement@@UAEAAVCSenElement@@AAV2@ABV2@@Z @ 98 NONAME ; class CSenElement & CSenBaseElement::InsertElementL(class CSenElement &, class CSenElement const &)
+	?InsertL@CSenNamespace@@QAEXAAVRBufWriteStream@@@Z @ 99 NONAME ; void CSenNamespace::InsertL(class RBufWriteStream &)
+	?LeaveOnXmlEscapesL@SenXmlUtils@@SAXABVTDesC8@@@Z @ 100 NONAME ; void SenXmlUtils::LeaveOnXmlEscapesL(class TDesC8 const &)
+	?LocalName@CSenBaseElement@@UBEABVTDesC8@@XZ @ 101 NONAME ; class TDesC8 const & CSenBaseElement::LocalName(void) const
+	?LocalName@CSenBaseFragment@@UBEABVTDesC8@@XZ @ 102 NONAME ; class TDesC8 const & CSenBaseFragment::LocalName(void) const
+	?LocalName@SenXmlUtils@@SA?AVTPtrC8@@ABVTDesC8@@@Z @ 103 NONAME ; class TPtrC8 SenXmlUtils::LocalName(class TDesC8 const &)
+	?MatchesL@CSenNamespace@@QBEHABV1@@Z @ 104 NONAME ; int CSenNamespace::MatchesL(class CSenNamespace const &) const
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@0@Z @ 105 NONAME ; class CSenNamespace const * CSenBaseElement::Namespace(class TDesC8 const &, class TDesC8 const &)
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@@Z @ 106 NONAME ; class CSenNamespace const * CSenBaseElement::Namespace(class TDesC8 const &)
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@ABVTDesC8@@H@Z @ 107 NONAME ; class CSenNamespace const * CSenBaseElement::Namespace(class TDesC8 const &, int)
+	?Namespace@CSenBaseElement@@UAEPBVCSenNamespace@@XZ @ 108 NONAME ; class CSenNamespace const * CSenBaseElement::Namespace(void)
+	?Namespace@CSenBaseFragment@@UAEPAVCSenNamespace@@ABVTDesC8@@@Z @ 109 NONAME ; class CSenNamespace * CSenBaseFragment::Namespace(class TDesC8 const &)
+	?NamespaceURI@CSenBaseElement@@UBEABVTDesC8@@XZ @ 110 NONAME ; class TDesC8 const & CSenBaseElement::NamespaceURI(void) const
+	?NamespacesL@CSenBaseElement@@UAEAAV?$RPointerArray@VCSenNamespace@@@@XZ @ 111 NONAME ; class RPointerArray<class CSenNamespace> & CSenBaseElement::NamespacesL(void)
+	?NewL@CSenBaseAttribute@@SAPAV1@ABVTDesC8@@00@Z @ 112 NONAME ; class CSenBaseAttribute * CSenBaseAttribute::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenBaseAttribute@@SAPAV1@ABVTDesC8@@0@Z @ 113 NONAME ; class CSenBaseAttribute * CSenBaseAttribute::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@00@Z @ 114 NONAME ; class CSenBaseElement * CSenBaseElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 115 NONAME ; class CSenBaseElement * CSenBaseElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 116 NONAME ; class CSenBaseElement * CSenBaseElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@0@Z @ 117 NONAME ; class CSenBaseElement * CSenBaseElement::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenBaseElement@@SAPAV1@ABVTDesC8@@@Z @ 118 NONAME ; class CSenBaseElement * CSenBaseElement::NewL(class TDesC8 const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVCSenElement@@@Z @ 119 NONAME ; class CSenBaseFragment * CSenBaseFragment::NewL(class CSenElement const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@00@Z @ 120 NONAME ; class CSenBaseFragment * CSenBaseFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 121 NONAME ; class CSenBaseFragment * CSenBaseFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 122 NONAME ; class CSenBaseFragment * CSenBaseFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@0@Z @ 123 NONAME ; class CSenBaseFragment * CSenBaseFragment::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenBaseFragment@@SAPAV1@ABVTDesC8@@@Z @ 124 NONAME ; class CSenBaseFragment * CSenBaseFragment::NewL(class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVCSenElement@@@Z @ 125 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(class CSenElement const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@00@Z @ 126 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 127 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 128 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@0@Z @ 129 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@ABVTDesC8@@@Z @ 130 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(class TDesC8 const &)
+	?NewL@CSenDomFragment@@SAPAV1@XZ @ 131 NONAME ; class CSenDomFragment * CSenDomFragment::NewL(void)
+	?NewL@CSenNamespace@@SAPAV1@ABVTDesC8@@0@Z @ 132 NONAME ; class CSenNamespace * CSenNamespace::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenNamespace@@SAPAV1@ABVTDesC8@@@Z @ 133 NONAME ; class CSenNamespace * CSenNamespace::NewL(class TDesC8 const &)
+	?NewL@CSenXmlReader@@SAPAV1@H@Z @ 134 NONAME ; class CSenXmlReader * CSenXmlReader::NewL(int)
+	?NewL@CSenXmlReader@@SAPAV1@XZ @ 135 NONAME ; class CSenXmlReader * CSenXmlReader::NewL(void)
+	?NewLC@CSenNamespace@@SAPAV1@ABVTDesC8@@0@Z @ 136 NONAME ; class CSenNamespace * CSenNamespace::NewLC(class TDesC8 const &, class TDesC8 const &)
+	?NewLC@CSenNamespace@@SAPAV1@ABVTDesC8@@@Z @ 137 NONAME ; class CSenNamespace * CSenNamespace::NewLC(class TDesC8 const &)
+	?NewLC@CSenXmlReader@@SAPAV1@H@Z @ 138 NONAME ; class CSenXmlReader * CSenXmlReader::NewLC(int)
+	?NewLC@CSenXmlReader@@SAPAV1@XZ @ 139 NONAME ; class CSenXmlReader * CSenXmlReader::NewLC(void)
+	?NsPrefix@CSenBaseElement@@UBEABVTDesC8@@XZ @ 140 NONAME ; class TDesC8 const & CSenBaseElement::NsPrefix(void) const
+	?NsPrefix@CSenBaseFragment@@UBEABVTDesC8@@XZ @ 141 NONAME ; class TDesC8 const & CSenBaseFragment::NsPrefix(void) const
+	?NsPrefix@SenXmlUtils@@SA?AVTPtrC8@@ABVTDesC8@@@Z @ 142 NONAME ; class TPtrC8 SenXmlUtils::NsPrefix(class TDesC8 const &)
+	?NsUri@CSenBaseFragment@@UBEABVTDesC8@@XZ @ 143 NONAME ; class TDesC8 const & CSenBaseFragment::NsUri(void) const
+	?Parent@CSenBaseElement@@UAEPAVCSenElement@@XZ @ 144 NONAME ; class CSenElement * CSenBaseElement::Parent(void)
+	?ParseL@CSenBaseFragment@@UAEXABVTDesC8@@@Z @ 145 NONAME ; void CSenBaseFragment::ParseL(class TDesC8 const &)
+	?ParseL@CSenXmlReader@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 146 NONAME ; void CSenXmlReader::ParseL(class RFs &, class TDesC16 const &)
+	?ParseL@CSenXmlReader@@QAEXABVTDesC8@@@Z @ 147 NONAME ; void CSenXmlReader::ParseL(class TDesC8 const &)
+	?ParseWithL@CSenBaseFragment@@UAEXAAVCSenXmlReader@@@Z @ 148 NONAME ; void CSenBaseFragment::ParseWithL(class CSenXmlReader &)
+	?ParseWithL@CSenDomFragment@@UAEXAAVCSenXmlReader@@@Z @ 149 NONAME ; void CSenDomFragment::ParseWithL(class CSenXmlReader &)
+	?ParserFeature@CSenXmlReader@@UAEHXZ @ 150 NONAME ; int CSenXmlReader::ParserFeature(void)
+	?Prefix@CSenNamespace@@QBEABVTDesC8@@XZ @ 151 NONAME ; class TDesC8 const & CSenNamespace::Prefix(void) const
+	?Reader@CSenBaseFragment@@UAEPAVCSenXmlReader@@XZ @ 152 NONAME ; class CSenXmlReader * CSenBaseFragment::Reader(void)
+	?RemoveElement@CSenBaseElement@@UAEPAVCSenElement@@AAV2@@Z @ 153 NONAME ; class CSenElement * CSenBaseElement::RemoveElement(class CSenElement &)
+	?RemoveElement@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 154 NONAME ; class CSenElement * CSenBaseElement::RemoveElement(class TDesC8 const &, class TDesC8 const &)
+	?RemoveElement@CSenBaseElement@@UAEPAVCSenElement@@ABVTDesC8@@@Z @ 155 NONAME ; class CSenElement * CSenBaseElement::RemoveElement(class TDesC8 const &)
+	?ReplaceElementL@CSenBaseElement@@UAEPAVCSenElement@@AAV2@@Z @ 156 NONAME ; class CSenElement * CSenBaseElement::ReplaceElementL(class CSenElement &)
+	?ResetContentL@CSenBaseFragment@@UAEXXZ @ 157 NONAME ; void CSenBaseFragment::ResetContentL(void)
+	?ResumeParsingFromL@CSenBaseFragment@@UAEXABVTDesC8@@00@Z @ 158 NONAME ; void CSenBaseFragment::ResumeParsingFromL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?ResumeParsingFromL@CSenDomFragment@@UAEXABVTDesC8@@00@Z @ 159 NONAME ; void CSenDomFragment::ResumeParsingFromL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?Root@CSenBaseElement@@UAEAAVMSenElement@@XZ @ 160 NONAME ; class MSenElement & CSenBaseElement::Root(void)
+	?SaveNamespacesL@CSenBaseFragment@@UAEXABV?$RArray@VRAttribute@Xml@@@@H@Z @ 161 NONAME ; void CSenBaseFragment::SaveNamespacesL(class RArray<class Xml::RAttribute> const &, int)
+	?Set@CSenBaseElement@@UAEXABVTDesC8@@00@Z @ 162 NONAME ; void CSenBaseElement::Set(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetAttributesL@CSenBaseElement@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 163 NONAME ; void CSenBaseElement::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetAttributesL@CSenBaseFragment@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 164 NONAME ; void CSenBaseFragment::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetAttributesL@CSenDomFragment@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 165 NONAME ; void CSenDomFragment::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetContentHandler@CSenXmlReader@@UAEXAAVMSenContentHandlerClient@@@Z @ 166 NONAME ; void CSenXmlReader::SetContentHandler(class MSenContentHandlerClient &)
+	?SetContentL@CSenBaseElement@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 167 NONAME ; class TPtrC8 CSenBaseElement::SetContentL(class TDesC8 const &)
+	?SetContentOfL@CSenBaseFragment@@IAEAAVMSenElement@@ABVTDesC8@@0@Z @ 168 NONAME ; class MSenElement & CSenBaseFragment::SetContentOfL(class TDesC8 const &, class TDesC8 const &)
+	?SetNamespaceL@CSenBaseElement@@UAEXABVTDesC8@@0@Z @ 169 NONAME ; void CSenBaseElement::SetNamespaceL(class TDesC8 const &, class TDesC8 const &)
+	?SetNamespaceL@CSenBaseElement@@UAEXABVTDesC8@@@Z @ 170 NONAME ; void CSenBaseElement::SetNamespaceL(class TDesC8 const &)
+	?SetOwner@CSenBaseFragment@@UAEXAAVMSenFragment@@@Z @ 171 NONAME ; void CSenBaseFragment::SetOwner(class MSenFragment &)
+	?SetParent@CSenBaseElement@@UAEPAVCSenElement@@PAV2@@Z @ 172 NONAME ; class CSenElement * CSenBaseElement::SetParent(class CSenElement *)
+	?SetPrefixL@CSenBaseElement@@UAEXABVTDesC8@@@Z @ 173 NONAME ; void CSenBaseElement::SetPrefixL(class TDesC8 const &)
+	?SetPrefixL@CSenNamespace@@QAEXABVTDesC8@@@Z @ 174 NONAME ; void CSenNamespace::SetPrefixL(class TDesC8 const &)
+	?SetReader@CSenBaseFragment@@UAEXAAVCSenXmlReader@@@Z @ 175 NONAME ; void CSenBaseFragment::SetReader(class CSenXmlReader &)
+	?SetUriL@CSenNamespace@@QAEXABVTDesC8@@@Z @ 176 NONAME ; void CSenNamespace::SetUriL(class TDesC8 const &)
+	?StartDocument@CSenBaseFragment@@EAEHXZ @ 177 NONAME ; int CSenBaseFragment::StartDocument(void)
+	?StartElement@CSenBaseFragment@@EAEHABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 178 NONAME ; int CSenBaseFragment::StartElement(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenBaseFragment@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 179 NONAME ; void CSenBaseFragment::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?StartElementL@CSenDomFragment@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 180 NONAME ; void CSenDomFragment::StartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?StartEntity@CSenBaseFragment@@IAEHAAVTDesC8@@@Z @ 181 NONAME ; int CSenBaseFragment::StartEntity(class TDesC8 &)
+	?StartsWith@SenXmlUtils@@SAHABVTDesC8@@0@Z @ 182 NONAME ; int SenXmlUtils::StartsWith(class TDesC8 const &, class TDesC8 const &)
+	?ToUnicodeLC@SenXmlUtils@@SAPAVHBufC16@@ABVTDesC8@@@Z @ 183 NONAME ; class HBufC16 * SenXmlUtils::ToUnicodeLC(class TDesC8 const &)
+	?ToUtf8LC@SenXmlUtils@@SAPAVHBufC8@@ABVTDesC16@@@Z @ 184 NONAME ; class HBufC8 * SenXmlUtils::ToUtf8LC(class TDesC16 const &)
+	?URI@CSenNamespace@@QBEABVTDesC8@@XZ @ 185 NONAME ; class TDesC8 const & CSenNamespace::URI(void) const
+	?WriteAsXMLToL@CSenBaseElement@@UAEXAAVRWriteStream@@@Z @ 186 NONAME ; void CSenBaseElement::WriteAsXMLToL(class RWriteStream &)
+	?WriteAsXMLToL@CSenBaseFragment@@UAEXAAVRWriteStream@@@Z @ 187 NONAME ; void CSenBaseFragment::WriteAsXMLToL(class RWriteStream &)
+	?WriteAttrToL@CSenBaseElement@@MAEXAAVRWriteStream@@ABVTDesC8@@1@Z @ 188 NONAME ; void CSenBaseElement::WriteAttrToL(class RWriteStream &, class TDesC8 const &, class TDesC8 const &)
+	?WriteAttrsToL@CSenBaseElement@@MAEXAAVRWriteStream@@@Z @ 189 NONAME ; void CSenBaseElement::WriteAttrsToL(class RWriteStream &)
+	?WriteContentToL@CSenBaseElement@@MAEXAAVRWriteStream@@@Z @ 190 NONAME ; void CSenBaseElement::WriteContentToL(class RWriteStream &)
+	?WriteElementsToL@CSenBaseElement@@MAEXAAVRWriteStream@@@Z @ 191 NONAME ; void CSenBaseElement::WriteElementsToL(class RWriteStream &)
+	?WriteEndElementL@CSenBaseFragment@@UAEXABVTDesC8@@00@Z @ 192 NONAME ; void CSenBaseFragment::WriteEndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?WriteEndElementL@CSenDomFragment@@MAEXABVTDesC8@@00@Z @ 193 NONAME ; void CSenDomFragment::WriteEndElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?WriteNamespacesToL@CSenBaseElement@@UAEXAAVRWriteStream@@@Z @ 194 NONAME ; void CSenBaseElement::WriteNamespacesToL(class RWriteStream &)
+	?WriteStartElementL@CSenBaseFragment@@UAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 195 NONAME ; void CSenBaseFragment::WriteStartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?WriteStartElementL@CSenDomFragment@@MAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 196 NONAME ; void CSenDomFragment::WriteStartElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?WriteToBufL@CSenBaseElement@@MAE?AVTPtrC8@@AAVCBufBase@@@Z @ 197 NONAME ; class TPtrC8 CSenBaseElement::WriteToBufL(class CBufBase &)
+	?NewL@CSenXmlReader@@SAPAV1@ABVTDesC8@@@Z @ 198 NONAME ; class CSenXmlReader * CSenXmlReader::NewL(class TDesC8 const &)
+	?NewL@CSenXmlReader@@SAPAV1@ABVTDesC8@@H@Z @ 199 NONAME ; class CSenXmlReader * CSenXmlReader::NewL(class TDesC8 const &, int)
+	?NewLC@CSenXmlReader@@SAPAV1@ABVTDesC8@@@Z @ 200 NONAME ; class CSenXmlReader * CSenXmlReader::NewLC(class TDesC8 const &)
+	?NewLC@CSenXmlReader@@SAPAV1@ABVTDesC8@@H@Z @ 201 NONAME ; class CSenXmlReader * CSenXmlReader::NewLC(class TDesC8 const &, int)
+	??0CSenXmlElement@@IAE@XZ @ 202 NONAME ; CSenXmlElement::CSenXmlElement(void)
+	??1CSenXmlElement@@UAE@XZ @ 203 NONAME ; CSenXmlElement::~CSenXmlElement(void)
+	?AddAttrL@CSenXmlElement@@UAEXABVTDesC8@@0@Z @ 204 NONAME ; void CSenXmlElement::AddAttrL(class TDesC8 const &, class TDesC8 const &)
+	?AddAttributeL@CSenXmlElement@@IAEABVTDesC8@@PAVCSenBaseAttribute@@@Z @ 205 NONAME ; class TDesC8 const & CSenXmlElement::AddAttributeL(class CSenBaseAttribute *)
+	?AddAttributeL@CSenXmlElement@@MAEABVTDesC8@@ABV2@00@Z @ 206 NONAME ; class TDesC8 const & CSenXmlElement::AddAttributeL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddAttributeL@CSenXmlElement@@MAEABVTDesC8@@ABV2@0@Z @ 207 NONAME ; class TDesC8 const & CSenXmlElement::AddAttributeL(class TDesC8 const &, class TDesC8 const &)
+	?AddAttributesL@CSenXmlElement@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 208 NONAME ; void CSenXmlElement::AddAttributesL(class RArray<class Xml::RAttribute> const &)
+	?AddElementL@CSenXmlElement@@UAEAAVCSenElement@@AAV2@@Z @ 209 NONAME ; class CSenElement & CSenXmlElement::AddElementL(class CSenElement &)
+	?AddElementL@CSenXmlElement@@UAEAAVCSenElement@@ABVTDesC8@@00@Z @ 210 NONAME ; class CSenElement & CSenXmlElement::AddElementL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddElementL@CSenXmlElement@@UAEAAVCSenElement@@ABVTDesC8@@0@Z @ 211 NONAME ; class CSenElement & CSenXmlElement::AddElementL(class TDesC8 const &, class TDesC8 const &)
+	?AddElementL@CSenXmlElement@@UAEAAVCSenElement@@ABVTDesC8@@@Z @ 212 NONAME ; class CSenElement & CSenXmlElement::AddElementL(class TDesC8 const &)
+	?AddNamespaceL@CSenXmlElement@@UAEPBVCSenNamespace@@AAV2@H@Z @ 213 NONAME ; class CSenNamespace const * CSenXmlElement::AddNamespaceL(class CSenNamespace &, int)
+	?AddNamespaceL@CSenXmlElement@@UAEPBVCSenNamespace@@ABVTDesC8@@0@Z @ 214 NONAME ; class CSenNamespace const * CSenXmlElement::AddNamespaceL(class TDesC8 const &, class TDesC8 const &)
+	?AllocContentBufL@CSenXmlElement@@MAEXXZ @ 215 NONAME ; void CSenXmlElement::AllocContentBufL(void)
+	?AsElement@CSenXmlElement@@UAEPAVMSenElement@@XZ @ 216 NONAME ; class MSenElement * CSenXmlElement::AsElement(void)
+	?AsXmlL@CSenXmlElement@@UAEPAVHBufC8@@XZ @ 217 NONAME ; class HBufC8 * CSenXmlElement::AsXmlL(void)
+	?AsXmlUnicodeL@CSenXmlElement@@UAEPAVHBufC16@@XZ @ 218 NONAME ; class HBufC16 * CSenXmlElement::AsXmlUnicodeL(void)
+	?AttrValue@CSenXmlElement@@UAEPBVTDesC8@@ABV2@@Z @ 219 NONAME ; class TDesC8 const * CSenXmlElement::AttrValue(class TDesC8 const &)
+	?AttributesL@CSenXmlElement@@UAEAAV?$RPointerArray@VCSenBaseAttribute@@@@XZ @ 220 NONAME ; class RPointerArray<class CSenBaseAttribute> & CSenXmlElement::AttributesL(void)
+	?BaseConstructL@CSenXmlElement@@IAEXABVTDesC8@@00@Z @ 221 NONAME ; void CSenXmlElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenXmlElement@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 222 NONAME ; void CSenXmlElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?BaseConstructL@CSenXmlElement@@IAEXABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 223 NONAME ; void CSenXmlElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?BaseConstructL@CSenXmlElement@@IAEXABVTDesC8@@0@Z @ 224 NONAME ; void CSenXmlElement::BaseConstructL(class TDesC8 const &, class TDesC8 const &)
+	?BaseConstructL@CSenXmlElement@@IAEXABVTDesC8@@@Z @ 225 NONAME ; void CSenXmlElement::BaseConstructL(class TDesC8 const &)
+	?Child@CSenXmlElement@@UAEPAVCSenElement@@H@Z @ 226 NONAME ; class CSenElement * CSenXmlElement::Child(int)
+	?ConsistsOfL@CSenXmlElement@@UAEHAAVMSenElement@@@Z @ 227 NONAME ; int CSenXmlElement::ConsistsOfL(class MSenElement &)
+	?Content@CSenXmlElement@@UBE?AVTPtrC8@@XZ @ 228 NONAME ; class TPtrC8 CSenXmlElement::Content(void) const
+	?ContentUnicodeL@CSenXmlElement@@UBEPAVHBufC16@@XZ @ 229 NONAME ; class HBufC16 * CSenXmlElement::ContentUnicodeL(void) const
+	?ContentWriteStreamL@CSenXmlElement@@UAEAAVRWriteStream@@XZ @ 230 NONAME ; class RWriteStream & CSenXmlElement::ContentWriteStreamL(void)
+	?CopyFromL@CSenXmlElement@@UAEXAAVCSenElement@@@Z @ 231 NONAME ; void CSenXmlElement::CopyFromL(class CSenElement &)
+	?CreateElementL@CSenXmlElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 232 NONAME ; class CSenElement * CSenXmlElement::CreateElementL(class TDesC8 const &, class TDesC8 const &)
+	?DetachL@CSenXmlElement@@UAEPAVCSenElement@@XZ @ 233 NONAME ; class CSenElement * CSenXmlElement::DetachL(void)
+	?Element@CSenXmlElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 234 NONAME ; class CSenElement * CSenXmlElement::Element(class TDesC8 const &, class TDesC8 const &)
+	?Element@CSenXmlElement@@UAEPAVCSenElement@@ABVTDesC8@@@Z @ 235 NONAME ; class CSenElement * CSenXmlElement::Element(class TDesC8 const &)
+	?ElementsL@CSenXmlElement@@UAEAAV?$RPointerArray@VCSenElement@@@@XZ @ 236 NONAME ; class RPointerArray<class CSenElement> & CSenXmlElement::ElementsL(void)
+	?ElementsL@CSenXmlElement@@UAEHAAV?$RPointerArray@VCSenElement@@@@ABVTDesC8@@1@Z @ 237 NONAME ; int CSenXmlElement::ElementsL(class RPointerArray<class CSenElement> &, class TDesC8 const &, class TDesC8 const &)
+	?ElementsL@CSenXmlElement@@UAEHAAV?$RPointerArray@VCSenElement@@@@ABVTDesC8@@@Z @ 238 NONAME ; int CSenXmlElement::ElementsL(class RPointerArray<class CSenElement> &, class TDesC8 const &)
+	?FindAttr@CSenXmlElement@@MAEPAVCSenBaseAttribute@@ABVTDesC8@@@Z @ 239 NONAME ; class CSenBaseAttribute * CSenXmlElement::FindAttr(class TDesC8 const &)
+	?HasContent@CSenXmlElement@@UBEHXZ @ 240 NONAME ; int CSenXmlElement::HasContent(void) const
+	?IndexOfElement@CSenXmlElement@@MBEHABVTDesC8@@0@Z @ 241 NONAME ; int CSenXmlElement::IndexOfElement(class TDesC8 const &, class TDesC8 const &) const
+	?InsertElementL@CSenXmlElement@@UAEAAVCSenElement@@AAV2@ABV2@@Z @ 242 NONAME ; class CSenElement & CSenXmlElement::InsertElementL(class CSenElement &, class CSenElement const &)
+	?LocalName@CSenXmlElement@@UBEABVTDesC8@@XZ @ 243 NONAME ; class TDesC8 const & CSenXmlElement::LocalName(void) const
+	?Namespace@CSenXmlElement@@UAEPBVCSenNamespace@@ABVTDesC8@@0@Z @ 244 NONAME ; class CSenNamespace const * CSenXmlElement::Namespace(class TDesC8 const &, class TDesC8 const &)
+	?Namespace@CSenXmlElement@@UAEPBVCSenNamespace@@ABVTDesC8@@@Z @ 245 NONAME ; class CSenNamespace const * CSenXmlElement::Namespace(class TDesC8 const &)
+	?Namespace@CSenXmlElement@@UAEPBVCSenNamespace@@ABVTDesC8@@H@Z @ 246 NONAME ; class CSenNamespace const * CSenXmlElement::Namespace(class TDesC8 const &, int)
+	?Namespace@CSenXmlElement@@UAEPBVCSenNamespace@@XZ @ 247 NONAME ; class CSenNamespace const * CSenXmlElement::Namespace(void)
+	?NamespaceURI@CSenXmlElement@@UBEABVTDesC8@@XZ @ 248 NONAME ; class TDesC8 const & CSenXmlElement::NamespaceURI(void) const
+	?NamespacesL@CSenXmlElement@@UAEAAV?$RPointerArray@VCSenNamespace@@@@XZ @ 249 NONAME ; class RPointerArray<class CSenNamespace> & CSenXmlElement::NamespacesL(void)
+	?NewL@CSenXmlElement@@SAPAV1@ABVTDesC8@@00@Z @ 250 NONAME ; class CSenXmlElement * CSenXmlElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenXmlElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@@Z @ 251 NONAME ; class CSenXmlElement * CSenXmlElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &)
+	?NewL@CSenXmlElement@@SAPAV1@ABVTDesC8@@00ABV?$RArray@VRAttribute@Xml@@@@AAVCSenElement@@@Z @ 252 NONAME ; class CSenXmlElement * CSenXmlElement::NewL(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class RArray<class Xml::RAttribute> const &, class CSenElement &)
+	?NewL@CSenXmlElement@@SAPAV1@ABVTDesC8@@0@Z @ 253 NONAME ; class CSenXmlElement * CSenXmlElement::NewL(class TDesC8 const &, class TDesC8 const &)
+	?NewL@CSenXmlElement@@SAPAV1@ABVTDesC8@@@Z @ 254 NONAME ; class CSenXmlElement * CSenXmlElement::NewL(class TDesC8 const &)
+	?NsPrefix@CSenXmlElement@@UBEABVTDesC8@@XZ @ 255 NONAME ; class TDesC8 const & CSenXmlElement::NsPrefix(void) const
+	?Parent@CSenXmlElement@@UAEPAVCSenElement@@XZ @ 256 NONAME ; class CSenElement * CSenXmlElement::Parent(void)
+	?RemoveAttributeL@SenXmlUtils@@SAPAVCSenBaseAttribute@@AAVCSenElement@@ABVTDesC8@@@Z @ 257 NONAME ; class CSenBaseAttribute * SenXmlUtils::RemoveAttributeL(class CSenElement &, class TDesC8 const &)
+	?RemoveAttributeL@SenXmlUtils@@SAPAVCSenBaseAttribute@@AAVCSenElement@@PAV2@@Z @ 258 NONAME ; class CSenBaseAttribute * SenXmlUtils::RemoveAttributeL(class CSenElement &, class CSenBaseAttribute *)
+	?RemoveElement@CSenXmlElement@@UAEPAVCSenElement@@AAV2@@Z @ 259 NONAME ; class CSenElement * CSenXmlElement::RemoveElement(class CSenElement &)
+	?RemoveElement@CSenXmlElement@@UAEPAVCSenElement@@ABVTDesC8@@0@Z @ 260 NONAME ; class CSenElement * CSenXmlElement::RemoveElement(class TDesC8 const &, class TDesC8 const &)
+	?RemoveElement@CSenXmlElement@@UAEPAVCSenElement@@ABVTDesC8@@@Z @ 261 NONAME ; class CSenElement * CSenXmlElement::RemoveElement(class TDesC8 const &)
+	?ReplaceElementL@CSenXmlElement@@UAEPAVCSenElement@@AAV2@@Z @ 262 NONAME ; class CSenElement * CSenXmlElement::ReplaceElementL(class CSenElement &)
+	?Root@CSenXmlElement@@UAEAAVMSenElement@@XZ @ 263 NONAME ; class MSenElement & CSenXmlElement::Root(void)
+	?Set@CSenXmlElement@@UAEXABVTDesC8@@00@Z @ 264 NONAME ; void CSenXmlElement::Set(class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?SetAttributesL@CSenXmlElement@@UAEXABV?$RArray@VRAttribute@Xml@@@@@Z @ 265 NONAME ; void CSenXmlElement::SetAttributesL(class RArray<class Xml::RAttribute> const &)
+	?SetContentL@CSenXmlElement@@UAE?AVTPtrC8@@ABVTDesC8@@@Z @ 266 NONAME ; class TPtrC8 CSenXmlElement::SetContentL(class TDesC8 const &)
+	?SetNamespaceL@CSenXmlElement@@UAEXABVTDesC8@@0@Z @ 267 NONAME ; void CSenXmlElement::SetNamespaceL(class TDesC8 const &, class TDesC8 const &)
+	?SetNamespaceL@CSenXmlElement@@UAEXABVTDesC8@@@Z @ 268 NONAME ; void CSenXmlElement::SetNamespaceL(class TDesC8 const &)
+	?SetParent@CSenXmlElement@@UAEPAVCSenElement@@PAV2@@Z @ 269 NONAME ; class CSenElement * CSenXmlElement::SetParent(class CSenElement *)
+	?SetPrefixL@CSenXmlElement@@UAEXABVTDesC8@@@Z @ 270 NONAME ; void CSenXmlElement::SetPrefixL(class TDesC8 const &)
+	?WriteAsXMLToL@CSenXmlElement@@UAEXAAVRWriteStream@@@Z @ 271 NONAME ; void CSenXmlElement::WriteAsXMLToL(class RWriteStream &)
+	?WriteAttrToL@CSenXmlElement@@MAEXAAVRWriteStream@@ABVTDesC8@@1@Z @ 272 NONAME ; void CSenXmlElement::WriteAttrToL(class RWriteStream &, class TDesC8 const &, class TDesC8 const &)
+	?WriteAttrsToL@CSenXmlElement@@MAEXAAVRWriteStream@@@Z @ 273 NONAME ; void CSenXmlElement::WriteAttrsToL(class RWriteStream &)
+	?WriteContentToL@CSenXmlElement@@MAEXAAVRWriteStream@@@Z @ 274 NONAME ; void CSenXmlElement::WriteContentToL(class RWriteStream &)
+	?WriteElementsToL@CSenXmlElement@@MAEXAAVRWriteStream@@@Z @ 275 NONAME ; void CSenXmlElement::WriteElementsToL(class RWriteStream &)
+	?WriteNamespacesToL@CSenXmlElement@@UAEXAAVRWriteStream@@@Z @ 276 NONAME ; void CSenXmlElement::WriteNamespacesToL(class RWriteStream &)
+	?WriteToBufL@CSenXmlElement@@MAE?AVTPtrC8@@AAVCBufBase@@@Z @ 277 NONAME ; class TPtrC8 CSenXmlElement::WriteToBufL(class CBufBase &)
+	?AddAttributeL@SenXmlUtils@@SAABVTDesC8@@AAVCSenElement@@ABV2@11@Z @ 278 NONAME ; class TDesC8 const & SenXmlUtils::AddAttributeL(class CSenElement &, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
+	?AddAttributeL@SenXmlUtils@@SAABVTDesC8@@AAVCSenElement@@ABV2@1@Z @ 279 NONAME ; class TDesC8 const & SenXmlUtils::AddAttributeL(class CSenElement &, class TDesC8 const &, class TDesC8 const &)
+	?AddAttributeL@SenXmlUtils@@SAABVTDesC8@@AAVCSenElement@@PAVCSenBaseAttribute@@@Z @ 280 NONAME ; class TDesC8 const & SenXmlUtils::AddAttributeL(class CSenElement &, class CSenBaseAttribute *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/eabi/SENXMLu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,444 @@
+EXPORTS
+	_ZN11SenXmlUtils10StartsWithERK6TDesC8S2_ @ 1 NONAME
+	_ZN11SenXmlUtils11BuildQNameLERK6TDesC8S2_RP6HBufC8 @ 2 NONAME
+	_ZN11SenXmlUtils11ToUnicodeLCERK6TDesC8 @ 3 NONAME
+	_ZN11SenXmlUtils15AllocAttrValueLERK6RArrayIN3Xml10RAttributeEERK6TDesC8 @ 4 NONAME
+	_ZN11SenXmlUtils18LeaveOnXmlEscapesLERK6TDesC8 @ 5 NONAME
+	_ZN11SenXmlUtils21DecodeHttpCharactersLERK6TDesC8RP6HBufC8 @ 6 NONAME
+	_ZN11SenXmlUtils21EncodeHttpCharactersLERK6TDesC8RP6HBufC8 @ 7 NONAME
+	_ZN11SenXmlUtils22DecodeHttpCharactersLCERK6TDesC8 @ 8 NONAME
+	_ZN11SenXmlUtils22EncodeHttpCharactersLCERK6TDesC8 @ 9 NONAME
+	_ZN11SenXmlUtils8EndsWithERK6TDesC8S2_ @ 10 NONAME
+	_ZN11SenXmlUtils8NsPrefixERK6TDesC8 @ 11 NONAME
+	_ZN11SenXmlUtils8ToUtf8LCERK7TDesC16 @ 12 NONAME
+	_ZN11SenXmlUtils9AttrValueERK6RArrayIN3Xml10RAttributeEERK6TDesC8 @ 13 NONAME
+	_ZN11SenXmlUtils9LocalNameERK6TDesC8 @ 14 NONAME
+	_ZN13CSenNamespace10SetPrefixLERK6TDesC8 @ 15 NONAME
+	_ZN13CSenNamespace4NewLERK6TDesC8 @ 16 NONAME
+	_ZN13CSenNamespace4NewLERK6TDesC8S2_ @ 17 NONAME
+	_ZN13CSenNamespace5NewLCERK6TDesC8 @ 18 NONAME
+	_ZN13CSenNamespace5NewLCERK6TDesC8S2_ @ 19 NONAME
+	_ZN13CSenNamespace7InsertLER15RBufWriteStream @ 20 NONAME
+	_ZN13CSenNamespace7SetUriLERK6TDesC8 @ 21 NONAME
+	_ZN13CSenNamespaceD0Ev @ 22 NONAME
+	_ZN13CSenNamespaceD1Ev @ 23 NONAME
+	_ZN13CSenNamespaceD2Ev @ 24 NONAME
+	_ZN13CSenXmlReader13ParserFeatureEv @ 25 NONAME
+	_ZN13CSenXmlReader17SetContentHandlerER24MSenContentHandlerClient @ 26 NONAME
+	_ZN13CSenXmlReader20EnabledParserFeatureEv @ 27 NONAME
+	_ZN13CSenXmlReader4NewLEi @ 28 NONAME
+	_ZN13CSenXmlReader4NewLEv @ 29 NONAME
+	_ZN13CSenXmlReader5NewLCEi @ 30 NONAME
+	_ZN13CSenXmlReader5NewLCEv @ 31 NONAME
+	_ZN13CSenXmlReader6ParseLER3RFsRK7TDesC16 @ 32 NONAME
+	_ZN13CSenXmlReader6ParseLERK6TDesC8 @ 33 NONAME
+	_ZN13CSenXmlReaderC1Ei @ 34 NONAME
+	_ZN13CSenXmlReaderC2Ei @ 35 NONAME
+	_ZN13CSenXmlReaderD0Ev @ 36 NONAME
+	_ZN13CSenXmlReaderD1Ev @ 37 NONAME
+	_ZN13CSenXmlReaderD2Ev @ 38 NONAME
+	_ZN15CSenBaseElement11AddElementLER11CSenElement @ 39 NONAME
+	_ZN15CSenBaseElement11AddElementLERK6TDesC8 @ 40 NONAME
+	_ZN15CSenBaseElement11AddElementLERK6TDesC8S2_ @ 41 NONAME
+	_ZN15CSenBaseElement11AddElementLERK6TDesC8S2_S2_ @ 42 NONAME
+	_ZN15CSenBaseElement11AttributesLEv @ 43 NONAME
+	_ZN15CSenBaseElement11ConsistsOfLER11MSenElement @ 44 NONAME
+	_ZN15CSenBaseElement11NamespacesLEv @ 45 NONAME
+	_ZN15CSenBaseElement11SetContentLERK6TDesC8 @ 46 NONAME
+	_ZN15CSenBaseElement11WriteToBufLER8CBufBase @ 47 NONAME
+	_ZN15CSenBaseElement13SetNamespaceLERK6TDesC8 @ 48 NONAME
+	_ZN15CSenBaseElement13SetNamespaceLERK6TDesC8S2_ @ 49 NONAME
+	_ZN15CSenBaseElement12WriteAttrToLER12RWriteStreamRK6TDesC8S4_ @ 50 NONAME
+	_ZN15CSenBaseElement13AddAttributeLEP17CSenBaseAttribute @ 51 NONAME
+	_ZN15CSenBaseElement13AddAttributeLERK6TDesC8S2_ @ 52 NONAME
+	_ZN15CSenBaseElement13AddAttributeLERK6TDesC8S2_S2_ @ 53 NONAME
+	_ZN15CSenBaseElement13AddNamespaceLER13CSenNamespacei @ 54 NONAME
+	_ZN15CSenBaseElement13AddNamespaceLERK6TDesC8S2_ @ 55 NONAME
+	_ZN15CSenBaseElement13AsXmlUnicodeLEv @ 56 NONAME
+	_ZN15CSenBaseElement13RemoveElementER11CSenElement @ 57 NONAME
+	_ZN15CSenBaseElement13RemoveElementERK6TDesC8 @ 58 NONAME
+	_ZN15CSenBaseElement13RemoveElementERK6TDesC8S2_ @ 59 NONAME
+	_ZN15CSenBaseElement13WriteAsXMLToLER12RWriteStream @ 60 NONAME
+	_ZN15CSenBaseElement13WriteAttrsToLER12RWriteStream @ 61 NONAME
+	_ZN15CSenBaseElement14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 62 NONAME
+	_ZN15CSenBaseElement14BaseConstructLERK6TDesC8 @ 63 NONAME
+	_ZN15CSenBaseElement14BaseConstructLERK6TDesC8S2_ @ 64 NONAME
+	_ZN15CSenBaseElement14BaseConstructLERK6TDesC8S2_S2_ @ 65 NONAME
+	_ZN15CSenBaseElement14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 66 NONAME
+	_ZN15CSenBaseElement14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 67 NONAME
+	_ZN15CSenBaseElement14CreateElementLERK6TDesC8S2_ @ 68 NONAME
+	_ZN15CSenBaseElement14InsertElementLER11CSenElementRKS0_ @ 69 NONAME
+	_ZN15CSenBaseElement14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 70 NONAME
+	_ZN15CSenBaseElement15ReplaceElementLER11CSenElement @ 71 NONAME
+	_ZN15CSenBaseElement15WriteContentToLER12RWriteStream @ 72 NONAME
+	_ZN15CSenBaseElement16AllocContentBufLEv @ 73 NONAME
+	_ZN15CSenBaseElement16WriteElementsToLER12RWriteStream @ 74 NONAME
+	_ZN15CSenBaseElement19ContentWriteStreamLEv @ 75 NONAME
+	_ZN15CSenBaseElement18WriteNamespacesToLER12RWriteStream @ 76 NONAME
+	_ZN15CSenBaseElement3SetERK6TDesC8S2_S2_ @ 77 NONAME
+	_ZN15CSenBaseElement4NewLERK6TDesC8 @ 78 NONAME
+	_ZN15CSenBaseElement4NewLERK6TDesC8S2_ @ 79 NONAME
+	_ZN15CSenBaseElement4NewLERK6TDesC8S2_S2_ @ 80 NONAME
+	_ZN15CSenBaseElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 81 NONAME
+	_ZN15CSenBaseElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 82 NONAME
+	_ZN15CSenBaseElement4RootEv @ 83 NONAME
+	_ZN15CSenBaseElement5ChildEi @ 84 NONAME
+	_ZN15CSenBaseElement6AsXmlLEv @ 85 NONAME
+	_ZN15CSenBaseElement7DetachLEv @ 86 NONAME
+	_ZN15CSenBaseElement6ParentEv @ 87 NONAME
+	_ZN15CSenBaseElement7ElementERK6TDesC8 @ 88 NONAME
+	_ZN15CSenBaseElement7ElementERK6TDesC8S2_ @ 89 NONAME
+	_ZN15CSenBaseElement8AddAttrLERK6TDesC8S2_ @ 90 NONAME
+	_ZN15CSenBaseElement8FindAttrERK6TDesC8 @ 91 NONAME
+	_ZN15CSenBaseElement9AsElementEv @ 92 NONAME
+	_ZN15CSenBaseElement9AttrValueERK6TDesC8 @ 93 NONAME
+	_ZN15CSenBaseElement9CopyFromLER11CSenElement @ 94 NONAME
+	_ZN15CSenBaseElement9ElementsLER13RPointerArrayI11CSenElementERK6TDesC8 @ 95 NONAME
+	_ZN15CSenBaseElement9ElementsLER13RPointerArrayI11CSenElementERK6TDesC8S6_ @ 96 NONAME
+	_ZN15CSenBaseElement9ElementsLEv @ 97 NONAME
+	_ZN15CSenBaseElement9NamespaceERK6TDesC8 @ 98 NONAME
+	_ZN15CSenBaseElement9NamespaceERK6TDesC8S2_ @ 99 NONAME
+	_ZN15CSenBaseElement9NamespaceERK6TDesC8i @ 100 NONAME
+	_ZN15CSenBaseElement9NamespaceEv @ 101 NONAME
+	_ZN15CSenBaseElement9SetParentEP11CSenElement @ 102 NONAME
+	_ZN15CSenBaseElement10SetPrefixLERK6TDesC8 @ 103 NONAME
+	_ZN15CSenBaseElementC1Ev @ 104 NONAME
+	_ZN15CSenBaseElementC2Ev @ 105 NONAME
+	_ZN15CSenBaseElementD0Ev @ 106 NONAME
+	_ZN15CSenBaseElementD1Ev @ 107 NONAME
+	_ZN15CSenBaseElementD2Ev @ 108 NONAME
+	_ZN15CSenDomFragment10ParseWithLER13CSenXmlReader @ 109 NONAME
+	_ZN15CSenDomFragment11CharactersLERK6TDesC8ii @ 110 NONAME
+	_ZN15CSenDomFragment13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 111 NONAME
+	_ZN15CSenDomFragment14BaseConstructLER13CSenXmlReader @ 112 NONAME
+	_ZN15CSenDomFragment14BaseConstructLERK11CSenElement @ 113 NONAME
+	_ZN15CSenDomFragment14BaseConstructLERK6TDesC8 @ 114 NONAME
+	_ZN15CSenDomFragment14BaseConstructLERK6TDesC8S2_ @ 115 NONAME
+	_ZN15CSenDomFragment14BaseConstructLERK6TDesC8S2_S2_ @ 116 NONAME
+	_ZN15CSenDomFragment14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 117 NONAME
+	_ZN15CSenDomFragment14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 118 NONAME
+	_ZN15CSenDomFragment14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 119 NONAME
+	_ZN15CSenDomFragment16WriteEndElementLERK6TDesC8S2_S2_ @ 120 NONAME
+	_ZN15CSenDomFragment18ResumeParsingFromLERK6TDesC8S2_S2_ @ 121 NONAME
+	_ZN15CSenDomFragment18WriteStartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 122 NONAME
+	_ZN15CSenDomFragment4NewLERK11CSenElement @ 123 NONAME
+	_ZN15CSenDomFragment4NewLERK6TDesC8 @ 124 NONAME
+	_ZN15CSenDomFragment4NewLERK6TDesC8S2_ @ 125 NONAME
+	_ZN15CSenDomFragment4NewLERK6TDesC8S2_S2_ @ 126 NONAME
+	_ZN15CSenDomFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 127 NONAME
+	_ZN15CSenDomFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 128 NONAME
+	_ZN15CSenDomFragment4NewLEv @ 129 NONAME
+	_ZN15CSenDomFragment7ExpandLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 130 NONAME
+	_ZN15CSenDomFragmentC1Ev @ 131 NONAME
+	_ZN15CSenDomFragmentC2Ev @ 132 NONAME
+	_ZN15CSenDomFragmentD0Ev @ 133 NONAME
+	_ZN15CSenDomFragmentD1Ev @ 134 NONAME
+	_ZN15CSenDomFragmentD2Ev @ 135 NONAME
+	_ZN16CSenBaseFragment10CharactersERK6TDesC8ii @ 136 NONAME
+	_ZN16CSenBaseFragment10EndElementERK6TDesC8S2_S2_ @ 137 NONAME
+	_ZN16CSenBaseFragment10ParseWithLER13CSenXmlReader @ 138 NONAME
+	_ZN16CSenBaseFragment11CharactersLERK6TDesC8ii @ 139 NONAME
+	_ZN16CSenBaseFragment11ConsistsOfLER12MSenFragment @ 140 NONAME
+	_ZN16CSenBaseFragment11EndDocumentEv @ 141 NONAME
+	_ZN16CSenBaseFragment11EndElementLERK6TDesC8S2_S2_ @ 142 NONAME
+	_ZN16CSenBaseFragment11StartEntityER6TDesC8 @ 143 NONAME
+	_ZN16CSenBaseFragment13ResetContentLEv @ 144 NONAME
+	_ZN16CSenBaseFragment12StartElementERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 145 NONAME
+	_ZN16CSenBaseFragment13AsXmlUnicodeLEv @ 146 NONAME
+	_ZN16CSenBaseFragment13SetContentOfLERK6TDesC8S2_ @ 147 NONAME
+	_ZN16CSenBaseFragment13StartDocumentEv @ 148 NONAME
+	_ZN16CSenBaseFragment13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 149 NONAME
+	_ZN16CSenBaseFragment13WriteAsXMLToLER12RWriteStream @ 150 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLER13CSenXmlReader @ 151 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLERK11CSenElement @ 152 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLERK6TDesC8 @ 153 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLERK6TDesC8S2_ @ 154 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLERK6TDesC8S2_S2_ @ 155 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 156 NONAME
+	_ZN16CSenBaseFragment14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 157 NONAME
+	_ZN16CSenBaseFragment14ExtractElementEv @ 158 NONAME
+	_ZN16CSenBaseFragment14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 159 NONAME
+	_ZN16CSenBaseFragment15EnsureNamespaceERK6TDesC8 @ 160 NONAME
+	_ZN16CSenBaseFragment15SaveNamespacesLERK6RArrayIN3Xml10RAttributeEEi @ 161 NONAME
+	_ZN16CSenBaseFragment16DelegateParsingLER12MSenFragment @ 162 NONAME
+	_ZN16CSenBaseFragment16DelegateParsingLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 163 NONAME
+	_ZN16CSenBaseFragment16WriteEndElementLERK6TDesC8S2_S2_ @ 164 NONAME
+	_ZN16CSenBaseFragment18AllocContentSaverLEv @ 165 NONAME
+	_ZN16CSenBaseFragment18ResumeParsingFromLERK6TDesC8S2_S2_ @ 166 NONAME
+	_ZN16CSenBaseFragment18WriteStartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 167 NONAME
+	_ZN16CSenBaseFragment4NewLERK11CSenElement @ 168 NONAME
+	_ZN16CSenBaseFragment4NewLERK6TDesC8 @ 169 NONAME
+	_ZN16CSenBaseFragment4NewLERK6TDesC8S2_ @ 170 NONAME
+	_ZN16CSenBaseFragment4NewLERK6TDesC8S2_S2_ @ 171 NONAME
+	_ZN16CSenBaseFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 172 NONAME
+	_ZN16CSenBaseFragment4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 173 NONAME
+	_ZN16CSenBaseFragment5ErrorEi @ 174 NONAME
+	_ZN16CSenBaseFragment6AsXmlLEv @ 175 NONAME
+	_ZN16CSenBaseFragment7DetachLEv @ 176 NONAME
+	_ZN16CSenBaseFragment6ParseLERK6TDesC8 @ 177 NONAME
+	_ZN16CSenBaseFragment6ReaderEv @ 178 NONAME
+	_ZN16CSenBaseFragment7ContentEv @ 179 NONAME
+	_ZN16CSenBaseFragment8SetOwnerER12MSenFragment @ 180 NONAME
+	_ZN16CSenBaseFragment9AsElementEv @ 181 NONAME
+	_ZN16CSenBaseFragment9BuildFromERK6TDesC8 @ 182 NONAME
+	_ZN16CSenBaseFragment9ContentOfERK6TDesC8 @ 183 NONAME
+	_ZN16CSenBaseFragment9NamespaceERK6TDesC8 @ 184 NONAME
+	_ZN16CSenBaseFragment9SetReaderER13CSenXmlReader @ 185 NONAME
+	_ZN16CSenBaseFragmentC1Ev @ 186 NONAME
+	_ZN16CSenBaseFragmentC2Ev @ 187 NONAME
+	_ZN16CSenBaseFragmentD0Ev @ 188 NONAME
+	_ZN16CSenBaseFragmentD1Ev @ 189 NONAME
+	_ZN16CSenBaseFragmentD2Ev @ 190 NONAME
+	_ZN17CSenBaseAttribute14BaseConstructLERK6TDesC8S2_ @ 191 NONAME
+	_ZN17CSenBaseAttribute14BaseConstructLERK6TDesC8S2_S2_ @ 192 NONAME
+	_ZN17CSenBaseAttribute4NewLERK6TDesC8S2_ @ 193 NONAME
+	_ZN17CSenBaseAttribute4NewLERK6TDesC8S2_S2_ @ 194 NONAME
+	_ZN17CSenBaseAttributeC1Ev @ 195 NONAME
+	_ZN17CSenBaseAttributeC2Ev @ 196 NONAME
+	_ZN17CSenBaseAttributeD0Ev @ 197 NONAME
+	_ZN17CSenBaseAttributeD1Ev @ 198 NONAME
+	_ZN17CSenBaseAttributeD2Ev @ 199 NONAME
+	_ZNK13CSenNamespace3URIEv @ 200 NONAME
+	_ZNK13CSenNamespace6PrefixEv @ 201 NONAME
+	_ZNK13CSenNamespace7CompareERK6TDesC8S2_ @ 202 NONAME
+	_ZNK13CSenNamespace7CompareERKS_ @ 203 NONAME
+	_ZNK13CSenNamespace8MatchesLERKS_ @ 204 NONAME
+	_ZNK15CSenBaseElement10HasContentEv @ 205 NONAME
+	_ZNK15CSenBaseElement12NamespaceURIEv @ 206 NONAME
+	_ZNK15CSenBaseElement14IndexOfElementERK6TDesC8S2_ @ 207 NONAME
+	_ZNK15CSenBaseElement15ContentUnicodeLEv @ 208 NONAME
+	_ZNK15CSenBaseElement7ContentEv @ 209 NONAME
+	_ZNK15CSenBaseElement8NsPrefixEv @ 210 NONAME
+	_ZNK15CSenBaseElement9LocalNameEv @ 211 NONAME
+	_ZNK16CSenBaseFragment5NsUriEv @ 212 NONAME
+	_ZNK16CSenBaseFragment8NsPrefixEv @ 213 NONAME
+	_ZNK16CSenBaseFragment9LocalNameEv @ 214 NONAME
+	_ZTI13CSenNamespace @ 215 NONAME ; #<TI>#
+	_ZTI13CSenXmlReader @ 216 NONAME ; #<TI>#
+	_ZTI15CSenBaseElement @ 217 NONAME ; #<TI>#
+	_ZTI15CSenDomFragment @ 218 NONAME ; #<TI>#
+	_ZTI16CSenBaseFragment @ 219 NONAME ; #<TI>#
+	_ZTI17CSenBaseAttribute @ 220 NONAME ; #<TI>#
+	_ZTV13CSenNamespace @ 221 NONAME ; #<VT>#
+	_ZTV13CSenXmlReader @ 222 NONAME ; #<VT>#
+	_ZTV15CSenBaseElement @ 223 NONAME ; #<VT>#
+	_ZTV15CSenDomFragment @ 224 NONAME ; #<VT>#
+	_ZTV16CSenBaseFragment @ 225 NONAME ; #<VT>#
+	_ZTV17CSenBaseAttribute @ 226 NONAME ; #<VT>#
+	_ZThn4_N15CSenBaseElement11AddElementLER11CSenElement @ 227 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11AddElementLERK6TDesC8 @ 228 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11AddElementLERK6TDesC8S2_ @ 229 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11AddElementLERK6TDesC8S2_S2_ @ 230 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11AttributesLEv @ 231 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11ConsistsOfLER11MSenElement @ 232 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11NamespacesLEv @ 233 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement11SetContentLERK6TDesC8 @ 234 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13SetNamespaceLERK6TDesC8 @ 235 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13SetNamespaceLERK6TDesC8S2_ @ 236 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13AddNamespaceLER13CSenNamespacei @ 237 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13AddNamespaceLERK6TDesC8S2_ @ 238 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13AsXmlUnicodeLEv @ 239 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13RemoveElementER11CSenElement @ 240 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13RemoveElementERK6TDesC8 @ 241 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13RemoveElementERK6TDesC8S2_ @ 242 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement13WriteAsXMLToLER12RWriteStream @ 243 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 244 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement14CreateElementLERK6TDesC8S2_ @ 245 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement14InsertElementLER11CSenElementRKS0_ @ 246 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement15ReplaceElementLER11CSenElement @ 247 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement19ContentWriteStreamLEv @ 248 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement18WriteNamespacesToLER12RWriteStream @ 249 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement3SetERK6TDesC8S2_S2_ @ 250 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement4RootEv @ 251 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement5ChildEi @ 252 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement6AsXmlLEv @ 253 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement7DetachLEv @ 254 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement6ParentEv @ 255 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement7ElementERK6TDesC8 @ 256 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement7ElementERK6TDesC8S2_ @ 257 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement8AddAttrLERK6TDesC8S2_ @ 258 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9AsElementEv @ 259 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9AttrValueERK6TDesC8 @ 260 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9CopyFromLER11CSenElement @ 261 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9ElementsLEv @ 262 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9NamespaceERK6TDesC8 @ 263 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9NamespaceERK6TDesC8S2_ @ 264 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9NamespaceERK6TDesC8i @ 265 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9NamespaceEv @ 266 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement9SetParentEP11CSenElement @ 267 NONAME ; #<thunk>#
+	_ZThn4_N15CSenBaseElement10SetPrefixLERK6TDesC8 @ 268 NONAME ; #<thunk>#
+	_ZThn4_N15CSenDomFragment10ParseWithLER13CSenXmlReader @ 269 NONAME ; #<thunk>#
+	_ZThn4_N15CSenDomFragment14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 270 NONAME ; #<thunk>#
+	_ZThn4_N15CSenDomFragment16WriteEndElementLERK6TDesC8S2_S2_ @ 271 NONAME ; #<thunk>#
+	_ZThn4_N15CSenDomFragment18ResumeParsingFromLERK6TDesC8S2_S2_ @ 272 NONAME ; #<thunk>#
+	_ZThn4_N15CSenDomFragment18WriteStartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 273 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment10ParseWithLER13CSenXmlReader @ 274 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment11ConsistsOfLER12MSenFragment @ 275 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment13AsXmlUnicodeLEv @ 276 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment13WriteAsXMLToLER12RWriteStream @ 277 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment14ExtractElementEv @ 278 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 279 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment16DelegateParsingLER12MSenFragment @ 280 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment16DelegateParsingLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 281 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment16WriteEndElementLERK6TDesC8S2_S2_ @ 282 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment18ResumeParsingFromLERK6TDesC8S2_S2_ @ 283 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment18WriteStartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 284 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment6AsXmlLEv @ 285 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment6ParseLERK6TDesC8 @ 286 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment6ReaderEv @ 287 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment8SetOwnerER12MSenFragment @ 288 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment9AsElementEv @ 289 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment9BuildFromERK6TDesC8 @ 290 NONAME ; #<thunk>#
+	_ZThn4_N16CSenBaseFragment9SetReaderER13CSenXmlReader @ 291 NONAME ; #<thunk>#
+	_ZThn4_NK15CSenBaseElement10HasContentEv @ 292 NONAME ; #<thunk>#
+	_ZThn4_NK15CSenBaseElement12NamespaceURIEv @ 293 NONAME ; #<thunk>#
+	_ZThn4_NK15CSenBaseElement15ContentUnicodeLEv @ 294 NONAME ; #<thunk>#
+	_ZThn4_NK15CSenBaseElement7ContentEv @ 295 NONAME ; #<thunk>#
+	_ZThn4_NK15CSenBaseElement8NsPrefixEv @ 296 NONAME ; #<thunk>#
+	_ZThn4_NK15CSenBaseElement9LocalNameEv @ 297 NONAME ; #<thunk>#
+	_ZThn4_NK16CSenBaseFragment5NsUriEv @ 298 NONAME ; #<thunk>#
+	_ZThn4_NK16CSenBaseFragment8NsPrefixEv @ 299 NONAME ; #<thunk>#
+	_ZThn4_NK16CSenBaseFragment9LocalNameEv @ 300 NONAME ; #<thunk>#
+	_ZThn8_N16CSenBaseFragment10CharactersERK6TDesC8ii @ 301 NONAME ; #<thunk>#
+	_ZThn8_N16CSenBaseFragment10EndElementERK6TDesC8S2_S2_ @ 302 NONAME ; #<thunk>#
+	_ZThn8_N16CSenBaseFragment11EndDocumentEv @ 303 NONAME ; #<thunk>#
+	_ZThn8_N16CSenBaseFragment12StartElementERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 304 NONAME ; #<thunk>#
+	_ZThn8_N16CSenBaseFragment13StartDocumentEv @ 305 NONAME ; #<thunk>#
+	_ZThn8_N16CSenBaseFragment5ErrorEi @ 306 NONAME ; #<thunk>#
+	_ZN11SenXmlUtils13AddAttributeLER11CSenElementP17CSenBaseAttribute @ 307 NONAME
+	_ZN11SenXmlUtils13AddAttributeLER11CSenElementRK6TDesC8S4_ @ 308 NONAME
+	_ZN11SenXmlUtils13AddAttributeLER11CSenElementRK6TDesC8S4_S4_ @ 309 NONAME
+	_ZN11SenXmlUtils16RemoveAttributeLER11CSenElementP17CSenBaseAttribute @ 310 NONAME
+	_ZN11SenXmlUtils16RemoveAttributeLER11CSenElementRK6TDesC8 @ 311 NONAME
+	_ZN13CSenXmlReader4NewLERK6TDesC8 @ 312 NONAME
+	_ZN13CSenXmlReader4NewLERK6TDesC8i @ 313 NONAME
+	_ZN13CSenXmlReader5NewLCERK6TDesC8 @ 314 NONAME
+	_ZN13CSenXmlReader5NewLCERK6TDesC8i @ 315 NONAME
+	_ZN14CSenXmlElement10SetPrefixLERK6TDesC8 @ 316 NONAME
+	_ZN14CSenXmlElement11AddElementLER11CSenElement @ 317 NONAME
+	_ZN14CSenXmlElement11AddElementLERK6TDesC8 @ 318 NONAME
+	_ZN14CSenXmlElement11AddElementLERK6TDesC8S2_ @ 319 NONAME
+	_ZN14CSenXmlElement11AddElementLERK6TDesC8S2_S2_ @ 320 NONAME
+	_ZN14CSenXmlElement11AttributesLEv @ 321 NONAME
+	_ZN14CSenXmlElement11ConsistsOfLER11MSenElement @ 322 NONAME
+	_ZN14CSenXmlElement11NamespacesLEv @ 323 NONAME
+	_ZN14CSenXmlElement11SetContentLERK6TDesC8 @ 324 NONAME
+	_ZN14CSenXmlElement11WriteToBufLER8CBufBase @ 325 NONAME
+	_ZN14CSenXmlElement12WriteAttrToLER12RWriteStreamRK6TDesC8S4_ @ 326 NONAME
+	_ZN14CSenXmlElement13AddAttributeLEP17CSenBaseAttribute @ 327 NONAME
+	_ZN14CSenXmlElement13AddAttributeLERK6TDesC8S2_ @ 328 NONAME
+	_ZN14CSenXmlElement13AddAttributeLERK6TDesC8S2_S2_ @ 329 NONAME
+	_ZN14CSenXmlElement13AddNamespaceLER13CSenNamespacei @ 330 NONAME
+	_ZN14CSenXmlElement13AddNamespaceLERK6TDesC8S2_ @ 331 NONAME
+	_ZN14CSenXmlElement13AsXmlUnicodeLEv @ 332 NONAME
+	_ZN14CSenXmlElement13RemoveElementER11CSenElement @ 333 NONAME
+	_ZN14CSenXmlElement13RemoveElementERK6TDesC8 @ 334 NONAME
+	_ZN14CSenXmlElement13RemoveElementERK6TDesC8S2_ @ 335 NONAME
+	_ZN14CSenXmlElement13SetNamespaceLERK6TDesC8 @ 336 NONAME
+	_ZN14CSenXmlElement13SetNamespaceLERK6TDesC8S2_ @ 337 NONAME
+	_ZN14CSenXmlElement13WriteAsXMLToLER12RWriteStream @ 338 NONAME
+	_ZN14CSenXmlElement13WriteAttrsToLER12RWriteStream @ 339 NONAME
+	_ZN14CSenXmlElement14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 340 NONAME
+	_ZN14CSenXmlElement14BaseConstructLERK6TDesC8 @ 341 NONAME
+	_ZN14CSenXmlElement14BaseConstructLERK6TDesC8S2_ @ 342 NONAME
+	_ZN14CSenXmlElement14BaseConstructLERK6TDesC8S2_S2_ @ 343 NONAME
+	_ZN14CSenXmlElement14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 344 NONAME
+	_ZN14CSenXmlElement14BaseConstructLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 345 NONAME
+	_ZN14CSenXmlElement14CreateElementLERK6TDesC8S2_ @ 346 NONAME
+	_ZN14CSenXmlElement14InsertElementLER11CSenElementRKS0_ @ 347 NONAME
+	_ZN14CSenXmlElement14SetAttributesLERK6RArrayIN3Xml10RAttributeEE @ 348 NONAME
+	_ZN14CSenXmlElement15ReplaceElementLER11CSenElement @ 349 NONAME
+	_ZN14CSenXmlElement15WriteContentToLER12RWriteStream @ 350 NONAME
+	_ZN14CSenXmlElement16AllocContentBufLEv @ 351 NONAME
+	_ZN14CSenXmlElement16WriteElementsToLER12RWriteStream @ 352 NONAME
+	_ZN14CSenXmlElement18WriteNamespacesToLER12RWriteStream @ 353 NONAME
+	_ZN14CSenXmlElement19ContentWriteStreamLEv @ 354 NONAME
+	_ZN14CSenXmlElement3SetERK6TDesC8S2_S2_ @ 355 NONAME
+	_ZN14CSenXmlElement4NewLERK6TDesC8 @ 356 NONAME
+	_ZN14CSenXmlElement4NewLERK6TDesC8S2_ @ 357 NONAME
+	_ZN14CSenXmlElement4NewLERK6TDesC8S2_S2_ @ 358 NONAME
+	_ZN14CSenXmlElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 359 NONAME
+	_ZN14CSenXmlElement4NewLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEER11CSenElement @ 360 NONAME
+	_ZN14CSenXmlElement4RootEv @ 361 NONAME
+	_ZN14CSenXmlElement5ChildEi @ 362 NONAME
+	_ZN14CSenXmlElement6AsXmlLEv @ 363 NONAME
+	_ZN14CSenXmlElement6ParentEv @ 364 NONAME
+	_ZN14CSenXmlElement7DetachLEv @ 365 NONAME
+	_ZN14CSenXmlElement7ElementERK6TDesC8 @ 366 NONAME
+	_ZN14CSenXmlElement7ElementERK6TDesC8S2_ @ 367 NONAME
+	_ZN14CSenXmlElement8AddAttrLERK6TDesC8S2_ @ 368 NONAME
+	_ZN14CSenXmlElement8FindAttrERK6TDesC8 @ 369 NONAME
+	_ZN14CSenXmlElement9AsElementEv @ 370 NONAME
+	_ZN14CSenXmlElement9AttrValueERK6TDesC8 @ 371 NONAME
+	_ZN14CSenXmlElement9CopyFromLER11CSenElement @ 372 NONAME
+	_ZN14CSenXmlElement9ElementsLER13RPointerArrayI11CSenElementERK6TDesC8 @ 373 NONAME
+	_ZN14CSenXmlElement9ElementsLER13RPointerArrayI11CSenElementERK6TDesC8S6_ @ 374 NONAME
+	_ZN14CSenXmlElement9ElementsLEv @ 375 NONAME
+	_ZN14CSenXmlElement9NamespaceERK6TDesC8 @ 376 NONAME
+	_ZN14CSenXmlElement9NamespaceERK6TDesC8S2_ @ 377 NONAME
+	_ZN14CSenXmlElement9NamespaceERK6TDesC8i @ 378 NONAME
+	_ZN14CSenXmlElement9NamespaceEv @ 379 NONAME
+	_ZN14CSenXmlElement9SetParentEP11CSenElement @ 380 NONAME
+	_ZN14CSenXmlElementC1Ev @ 381 NONAME
+	_ZN14CSenXmlElementC2Ev @ 382 NONAME
+	_ZN14CSenXmlElementD0Ev @ 383 NONAME
+	_ZN14CSenXmlElementD1Ev @ 384 NONAME
+	_ZN14CSenXmlElementD2Ev @ 385 NONAME
+	_ZNK14CSenXmlElement10HasContentEv @ 386 NONAME
+	_ZNK14CSenXmlElement12NamespaceURIEv @ 387 NONAME
+	_ZNK14CSenXmlElement14IndexOfElementERK6TDesC8S2_ @ 388 NONAME
+	_ZNK14CSenXmlElement15ContentUnicodeLEv @ 389 NONAME
+	_ZNK14CSenXmlElement7ContentEv @ 390 NONAME
+	_ZNK14CSenXmlElement8NsPrefixEv @ 391 NONAME
+	_ZNK14CSenXmlElement9LocalNameEv @ 392 NONAME
+	_ZTI14CSenXmlElement @ 393 NONAME ; #<TI>#
+	_ZTV14CSenXmlElement @ 394 NONAME ; #<VT>#
+	_ZThn4_N14CSenXmlElement10SetPrefixLERK6TDesC8 @ 395 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11AddElementLER11CSenElement @ 396 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11AddElementLERK6TDesC8 @ 397 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11AddElementLERK6TDesC8S2_ @ 398 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11AddElementLERK6TDesC8S2_S2_ @ 399 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11AttributesLEv @ 400 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11ConsistsOfLER11MSenElement @ 401 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11NamespacesLEv @ 402 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement11SetContentLERK6TDesC8 @ 403 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13AddNamespaceLER13CSenNamespacei @ 404 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13AddNamespaceLERK6TDesC8S2_ @ 405 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13AsXmlUnicodeLEv @ 406 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13RemoveElementER11CSenElement @ 407 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13RemoveElementERK6TDesC8 @ 408 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13RemoveElementERK6TDesC8S2_ @ 409 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13SetNamespaceLERK6TDesC8 @ 410 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13SetNamespaceLERK6TDesC8S2_ @ 411 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement13WriteAsXMLToLER12RWriteStream @ 412 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement14AddAttributesLERK6RArrayIN3Xml10RAttributeEE @ 413 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement14CreateElementLERK6TDesC8S2_ @ 414 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement14InsertElementLER11CSenElementRKS0_ @ 415 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement15ReplaceElementLER11CSenElement @ 416 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement18WriteNamespacesToLER12RWriteStream @ 417 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement19ContentWriteStreamLEv @ 418 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement3SetERK6TDesC8S2_S2_ @ 419 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement4RootEv @ 420 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement5ChildEi @ 421 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement6AsXmlLEv @ 422 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement6ParentEv @ 423 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement7DetachLEv @ 424 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement7ElementERK6TDesC8 @ 425 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement7ElementERK6TDesC8S2_ @ 426 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement8AddAttrLERK6TDesC8S2_ @ 427 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9AsElementEv @ 428 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9AttrValueERK6TDesC8 @ 429 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9CopyFromLER11CSenElement @ 430 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9ElementsLEv @ 431 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9NamespaceERK6TDesC8 @ 432 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9NamespaceERK6TDesC8S2_ @ 433 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9NamespaceERK6TDesC8i @ 434 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9NamespaceEv @ 435 NONAME ; #<thunk>#
+	_ZThn4_N14CSenXmlElement9SetParentEP11CSenElement @ 436 NONAME ; #<thunk>#
+	_ZThn4_NK14CSenXmlElement10HasContentEv @ 437 NONAME ; #<thunk>#
+	_ZThn4_NK14CSenXmlElement12NamespaceURIEv @ 438 NONAME ; #<thunk>#
+	_ZThn4_NK14CSenXmlElement15ContentUnicodeLEv @ 439 NONAME ; #<thunk>#
+	_ZThn4_NK14CSenXmlElement7ContentEv @ 440 NONAME ; #<thunk>#
+	_ZThn4_NK14CSenXmlElement8NsPrefixEv @ 441 NONAME ; #<thunk>#
+	_ZThn4_NK14CSenXmlElement9LocalNameEv @ 442 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsxml    
+*
+*/
+
+
+
+
+
+#include <platform_paths.hrh>
+ 
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/wsxml.iby     CORE_MW_LAYER_IBY_EXPORT_PATH(wsxml.iby)
+PRJ_MMPFILES
+senxml.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/group/senxml.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        S60 4.0 reference implementation
+*
+*/
+
+
+
+
+
+
+
+#include "../../inc/webservices.hrh"
+
+
+TARGETTYPE      DLL
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+TARGET          SenXml.dll
+UID             0x1000008d 0x101F9704
+#else
+TARGET          wsxml.dll
+UID             0x1000008d 0x101F973B
+#endif
+
+#ifdef EKA2
+    #if !defined ( VID_DEFAULT ) 
+        VENDORID 0x101FB657
+    #else
+        VENDORID VID_DEFAULT
+    #endif 
+  
+    #if !defined ( CAP_GENERAL_DLL )
+        CAPABILITY ALL -TCB
+    #else
+        CAPABILITY CAP_GENERAL_DLL
+    #endif
+#endif
+
+SOURCEPATH      ../src
+
+SOURCE          senbaseattribute.cpp
+SOURCE          senbaseelement.cpp
+SOURCE          senbasefragment.cpp
+SOURCE          sendomfragment.cpp
+SOURCE          sennamespace.cpp
+SOURCE          senxmldll.cpp
+SOURCE          senxmlutils.cpp
+SOURCE          senxmlreader.cpp
+
+SOURCE          senxmlelement.cpp             // same, but also offers exports (requires freeze)
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+USERINCLUDE     ../inc
+USERINCLUDE     ../../wsutils/inc
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY         charconv.lib
+LIBRARY         estor.lib
+LIBRARY         euser.lib
+LIBRARY         bafl.lib    // RStringbase
+
+LIBRARY         XMLFRAMEWORK.lib
+
+#ifndef EKA2
+LIBRARY         efsrv.lib  // fileserver
+#endif // EKA2
+
+#if defined(ARMCC)
+  DEFFILE ../eabi/SENXML.DEF
+#elif defined(WINSCW)
+  DEFFILE ../BWINSCW/SENXML.DEF
+#elif defined(WINS)
+  DEFFILE ../BWINS/SENXML.DEF
+#else 
+  DEFFILE ../BMARM/SENXML.DEF
+#endif
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/inc/msenfilteraction.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_FILTER_ACTION_H
+#define M_SEN_FILTER_ACTION_H
+
+// INCLUDES
+
+#include <e32base.h>
+
+#include "SenBaseFragment.h"
+#include <SenXmlElement.h> // check if this include is needed(?)
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DEFINITIONS
+
+/**
+ * @author lewontin
+ *
+ */
+class MSenFilterAction 
+{
+
+public:
+
+    virtual void PerformL(const TDesC8& aEvent, 
+                          const RAttributeArray& aAttributes) = 0;
+};
+
+#endif // M_SEN_FILTER_ACTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/inc/msenfiltercollector.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef M_SEN_FILTER_COLLECTOR_H
+#define M_SEN_FILTER_COLLECTOR_H
+
+
+// INCLUDES
+
+#include <e32base.h>
+
+#include "SenBaseFragment.h"
+#include <SenXmlElement.h> // check if this include is needed(?)
+
+//#include "SenAttributes.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DEFINITIONS
+
+
+/**
+ * @author lewontin
+ *
+ * The interface to be implemented by objects that want to collect filter results.
+ */
+
+
+class MSenFilterCollector 
+{
+public:
+    /**PutL
+     * Initialize the collector:
+     * This is called before the collector starts collecting. Use this
+     * to initialize the data structure into which elements are collected.
+     */ 
+    virtual void Initialize() = 0;
+
+    /**
+     * Collect element tag:
+     * Called when an element is first encountered (i.e. before any of the
+     * element's content has been parsed.) Use this to allocate a data type
+     * that represents an element with other element content. 
+     * 
+     */
+    virtual void PutElementL(const TDesC8& aName, 
+                             const RAttributeArray& aAttributes) = 0;
+
+    /**
+     * Collect element text content:
+     * Called when an element's content has been fully parsed. This provides the
+     * text content as a "property", i.e. an elementname/value pair.
+     */
+    virtual void PutL(const TDesC8& aName, 
+                      const TDesC8& aValue) = 0;
+
+
+};
+
+#endif // M_SEN_FILTER_COLLECTOR_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/inc/senfiltercondition.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef C_SEN_FILTER_CONDITION_H
+#define C_SEN_FILTER_CONDITION_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <flogger.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DEFINITIONS
+
+/**
+ * @author lewontin
+ *
+ */
+class CSenFilterCondition : public CBase
+{
+
+public: // Constructors and Destructors
+
+    IMPORT_C static CSenFilterCondition* NewL(TInt aIndex, 
+                                              const TDesC8& aElement, 
+                                              const TDesC8& aAttribute);
+
+
+    CSenFilterCondition(const CSenFilterCondition& aFilterCondition);
+
+
+    IMPORT_C ~CSenFilterCondition();
+
+
+    IMPORT_C TBool Test();
+
+
+protected:
+
+    void ConstructL(TInt aIndex, 
+                    const TDesC8& aElement, 
+                    const TDesC8& aAttribute);
+
+
+    CSenFilterCondition();
+
+
+private:
+    
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    TInt iIndex;
+    TInt iCurrentIndex;
+    HBufC8* ipElement;
+    HBufC8* ipAttribute;
+
+    RFileLogger iLog;
+
+};
+
+#endif // C_SEN_FILTER_CONDITION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/inc/senfilterfragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef C_SEN_FILTER_FRAGMENT_H
+#define C_SEN_FILTER_FRAGMENT_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <flogger.h>
+
+#include "SenElement.h"
+#include "SenBaseFragment.h"
+#include <SenXmlElement.h> // check if this include is needed(?)
+
+#include "SenFilterStateMachine.h"
+#include "MSenFilterCollector.h"
+#include "MSenFilterAction.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+class CSenFilterStateMachine;
+class CSenFilterStateNode;
+class CSenFilterTableEntry;
+class CSenFilterNewProperty;
+class CSenFilterPutProperty;
+
+// CLASS DEFINITIONS
+
+/**
+ * @author lewontin
+ *
+ */
+
+
+class CSenFilterFragment : public CSenBaseFragment
+{
+
+public: // Constructors and Destructors
+
+    IMPORT_C CSenFilterFragment();
+
+
+    IMPORT_C ~CSenFilterFragment();
+
+
+public:
+
+    /**
+     * 
+     * Save any text property
+     */
+
+    
+    
+    IMPORT_C void SetCollector(MSenFilterCollector& aCollector);
+
+    /**
+     *  Inherited methods from CSenBaseFragment
+     */
+    IMPORT_C void StartElementL(const TDesC8& aNamespaceURI, 
+                                const TDesC8& aLocalName, 
+                                const TDesC8& aQName,
+                                const RAttributeArray& aAttributes);
+
+
+    IMPORT_C void CharactersL(const TDesC8& aCh, 
+                              TInt aStart, 
+                              TInt aLength);
+
+
+    IMPORT_C void EndElementL(const TDesC8& aNamespaceURI, 
+                              const TDesC8& aLocalName, 
+                              const TDesC8& aQName);
+
+    IMPORT_C TInt BuildFrom(const TDesC8& aString);
+
+
+// Public filter API
+
+    IMPORT_C CSenFilterStateNode& AddFilterLC(CSenFilterStateNode& aNode, 
+                                              const TDesC8& aLocalName);
+
+
+    IMPORT_C CSenFilterStateNode& AddRootFilterLC(const TDesC8& aLocalName);
+
+
+    IMPORT_C void CompileL();
+
+    /*public void andFilter(const TDesC8& localName) throws FilterException {
+        ipFsm.andFilter(localName, NULL, ipNewP, ipPutP);
+    }
+    public void orFilter(const TDesC8& localName) throws FilterException {
+        ipFsm.orFilter(localName, NULL, ipNewP, ipPutP);
+    }
+    
+    public void compile(){
+        ipFsm.compile();
+    }*/
+
+    /* // Override base parse to make sure the current fsm is compiled first
+     public void parse(org.xml.sax.InputSource source)
+     throws java.io.IOException, org.xml.sax.SAXException
+     {
+         ipFsm.compile();
+         super.parse(source);
+     }*/
+
+
+public:
+
+    CSenFilterNewProperty* ipNewP;
+    CSenFilterPutProperty* ipPutP;
+
+
+protected:
+
+    //To hold the current string property value
+    HBufC8* ipPropertyValue; 
+
+    MSenFilterCollector* ipCollector;
+
+
+private:
+
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    CSenFilterStateMachine* ipFsm;
+
+    //To hold the current property name
+    HBufC8* ipPropertyName;
+
+    CSenFilterStateNode* iRoot;
+
+    RFileLogger iLog;
+
+}; // end class CSenFilterFragment
+
+
+// ------------------------------------------
+//
+// Declaration of class CSenFilterNewProperty
+//
+// ------------------------------------------
+
+class CSenFilterNewProperty : public CBase, MSenFilterAction
+{
+
+public: // Constructors and Destructors
+
+    IMPORT_C CSenFilterNewProperty(MSenFilterCollector& aCollector);
+
+
+    IMPORT_C ~CSenFilterNewProperty();
+
+
+public:
+
+    IMPORT_C void PerformL(const TDesC8& aEvent, 
+                           const RAttributeArray& aAttributes);
+
+
+private:
+
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    MSenFilterCollector* ipCol;
+
+    RFileLogger iLog;
+
+}; // end class CSenFilterNewProperty
+
+
+// ------------------------------------------
+//
+// Declaration of class CSenFilterPutProperty
+//
+// ------------------------------------------
+
+class CSenFilterPutProperty : public CBase, MSenFilterAction
+{
+
+public: // Constructors and Destructors
+
+    CSenFilterPutProperty(MSenFilterCollector& aCollector);
+
+
+    ~CSenFilterPutProperty();
+
+
+public:
+
+    void SetPropertyValueL(const TDesC8& aPropertyValue);
+
+
+    void PerformL(const TDesC8& aEvent, 
+                  const RAttributeArray& aAttributes);
+
+
+private:
+
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    HBufC8* ipPropertyValue; 
+    MSenFilterCollector* ipCol;
+
+    RFileLogger iLog;
+
+}; // end class CSenFilterPutProperty
+
+
+#endif // C_SEN_FILTER_FRAGMENT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/inc/senfilterstatemachine.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,402 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef C_SEN_FILTER_STATE_MACHINE_H
+#define C_SEN_FILTER_STATE_MACHINE_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <e32std.h>
+#include <flogger.h>
+
+#include "SenBaseFragment.h"
+#include <SenXmlElement.h> // check if this include is needed(?)
+
+#include "SenPointerMap.h"
+
+#include "MSenFilterAction.h"
+#include "SenFilterCondition.h"
+
+// FORWARD DECLARATIONS
+
+class CSenFilterStateNode;
+class CSenFilterTableEntry;
+
+// CONSTANTS and DATA TYPES
+
+#define KBufferAllocationBlocks 10*1024
+
+typedef RPointerArray<CSenFilterStateNode> RStateNodeArray;
+
+//typedef RPointerArray<CSenFilterStateNode> RStateNodeArray;
+
+//typedef RSenPointerMap<TInt, CSenFilterTableEntry> RStateTablePointerMap;
+
+// CLASS DEFINITIONS
+
+/**
+ * @author lewontin
+ * 
+ * Implement an XML filter state machine. The supported filter syntax is a bit
+ * like XPath, but adds an || operator so you can select together multiple nodes
+ * below a specified node (e.g. "/a/b/c||d" selects both the c and d elements
+ * below /a/b). The goal is to avoid the necessity of returning intermediate
+ * nodes and then reparsing these one-by-one. Instead, the caller can collect
+ * these target values together (into a data structure) during a single parse.
+ * The parser will support the || operator on intermediate nodes, but this is
+ * not recommended as it makes the parser state table very big.
+ */
+class CSenFilterStateMachine : public CBase
+{
+
+private: // State type enumeration.
+
+    enum TStateType
+    {
+        EEnd = 0,
+        EStart
+    };
+
+
+    // Objects to build a tree representation of the filter state machine
+
+public: // Constructors and Destructors
+
+    IMPORT_C CSenFilterStateMachine();
+
+
+    IMPORT_C ~CSenFilterStateMachine();
+
+
+    /*
+     * The state tree is built up as a list of lists
+     * Each and filter adds a new list of states to the filter chain
+     * Each or filter appends a new set of states to the current list
+     */
+
+
+    /* private Vector filterChain = new Vector();
+     private TInt chainIndex = -1;
+     
+      
+      * Public methods to build filter chains. Parameters:
+      * aEvent -- the element name that causes this transition
+      *  aCondition -- further conditions for transition
+      
+     
+     // Add an AND filter: implements the "/" operator
+     
+     public void andFilter(const TDesC8& aEvent, FilterCondition aCondition, FilterAction aStartAction, FilterAction aEndAction) throws FilterException{
+        
+         filterChain.addElement(new Vector());
+         ++chainIndex;
+         orFilter(aEvent, aCondition, aStartAction, aEndAction);
+     }
+     
+     
+      * Add an OR filter: implements the "|" operator. Note that OR filters in
+      * non-terminal nodes blow up the deterministic state table exponentially so they should
+      * be used sparingly.
+      
+     
+     public void orFilter(const TDesC8& aEvent, FilterCondition aCondition, FilterAction aStartAction, FilterAction aEndAction) throws FilterException {
+         
+         if(chainIndex < 0){
+             throw new FilterException("ORFilter cannot be first in chain");
+         }
+         
+         // Get the current (possibly empty) list of OR states
+         Vector s = (Vector)filterChain.elementAt(chainIndex);
+        
+         if(chainIndex == 0){
+             // No previous states, just add a single new state node to the current list
+             s.addElement(new CSenFilterStateNode(aEvent, aCondition, aStartAction, aEndAction));
+         }
+         
+         else{
+             //Previous state(s) exist(s). Add a state transition from each previous state.
+             // Get the list of previous states 
+             Enumeration pStates = ((Vector)filterChain.elementAt(chainIndex - 1)).elements();
+             // For each previous state
+             while(pStates.hasMoreElements()){
+                 // Add a new state node to the current list
+                 CSenFilterStateNode iState = new CSenFilterStateNode(aEvent, aCondition, aStartAction, aEndAction);
+                 CSenFilterStateNode p = (CSenFilterStateNode)pStates.nextElement();
+                 iState.ipPrev = p;
+                 s.addElement(iState);
+             }
+         }
+     }*/
+
+
+    /* Add a node to the state tree */
+    IMPORT_C CSenFilterStateNode* AddChildLC(CSenFilterStateNode& aStartState, 
+                                             const TDesC8& aEvent,
+                                             const CSenFilterCondition& aCondition,
+                                             MSenFilterAction& aStartAction,
+                                             MSenFilterAction& aEndAction);
+
+    /* Add the root node to the state tree */
+    IMPORT_C CSenFilterStateNode* AddParentLC(const TDesC8& aEvent,
+                                              const CSenFilterCondition& aCondition,
+                                              MSenFilterAction& aStartAction,
+                                              MSenFilterAction& aEndAction);
+
+    /*
+     * Compile a state table by iterating over the state tree. Call this after building
+     * a filter chain from AND and OR filters.
+     */
+
+    /* public void compile(){
+         
+         if(filterChain == NULL){ //Already compiled
+             return;     
+         }
+         
+         Enumeration  chain = filterChain.elements();
+         while(chain.hasMoreElements()){
+             Enumeration iStates = ((Vector)chain.nextElement()).elements();
+             while(iStates.hasMoreElements()){
+                 CSenFilterStateNode node = (CSenFilterStateNode)iStates.nextElement();
+                 TInt p = 0;
+                 if(node.ipPrev != NULL){
+                     p = node.ipPrev.iState;
+                 }
+                 addEntry(p, node.iEvent, node.iCondition, node.iState, node.iStartAction, node.iEndAction);
+             }
+         }
+         //Allow the state tree to be garbage collected
+         filterChain = NULL;
+     }
+     */
+
+
+    /* Recursively compile the tree into a state table */
+    IMPORT_C void CompileL(CSenFilterStateNode& aStartNode);
+
+
+    // Public methods called by parser
+
+    IMPORT_C void StartElementL(const TDesC8& aName, 
+                                const RAttributeArray& aAttributes);
+
+    IMPORT_C void EndElementL(const TDesC8& aName);
+
+
+    // Register a new state by incrementing the state counter
+    // and returning this counter as unique ID for this session
+    const TInt RegisterState();
+
+
+    const TInt States() const;
+
+
+private:
+
+    // Private method to add an entry to the state table
+    void AddEntryL(TInt aInitialState, 
+                   const TDesC8& aEvent, 
+                   const CSenFilterCondition& aCondition, 
+                   TInt aNextState, 
+                   MSenFilterAction& aStartAction, 
+                   MSenFilterAction& aEndAction);
+
+
+    // Create an unique key for state table node
+    const TUint16 GetStateKeyL(TInt aState, 
+                               const TDesC8& aEvent, 
+                               TInt aStart);
+
+
+private:
+
+    // Methods to run the state machine
+    const TInt TransitionL(TInt aState, 
+                           const TDesC8& aEvent, 
+                           TInt start, 
+                           const RAttributeArray& aAttributes);
+
+
+
+private:
+
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    //The filter state machine state table
+    RSenPointerMap<TUint16, CSenFilterTableEntry> iStateTable;
+
+    TInt iFilterState;
+
+    TInt iStates; // Counter of all states
+
+
+    RFileLogger iLog;
+
+}; // end class CSenFilterStateMachine
+
+
+// ----------------------------------------
+//
+// Declaration of class CSenFilterStateNode
+//
+// ----------------------------------------
+
+/**
+     * A node in the state tree
+     * Parent      -  points to the previous state in the diagram
+     * Children    -  set of successor states in the diagram
+     * State       -  state number for this state
+     * Event       -  event that triggers transition from ipPrev to this
+     * Condition   -  additional test on transition
+     * StartAction - 
+     * EndAction   - 
+     */
+class CSenFilterStateNode : public CBase
+{
+
+public:
+
+    IMPORT_C CSenFilterStateNode(const TDesC8& aEvent, 
+                                 const CSenFilterCondition& aCondition, 
+                                 MSenFilterAction& aStartAction, 
+                                 MSenFilterAction& aEndAction,
+                                 CSenFilterStateMachine& aStateMachine);
+
+    IMPORT_C CSenFilterStateNode(const CSenFilterStateNode& aFilterStateNode);
+
+
+    IMPORT_C ~CSenFilterStateNode();
+
+
+public:
+
+    IMPORT_C TInt State() const;
+
+
+    IMPORT_C TDesC8 Event() const;
+
+
+    IMPORT_C CSenFilterCondition Condition() const;
+
+
+    IMPORT_C MSenFilterAction& StartAction() const;
+
+
+    IMPORT_C MSenFilterAction& EndAction() const;
+
+
+    IMPORT_C CSenFilterStateNode& Parent() const;
+
+
+    IMPORT_C RStateNodeArray Children() const;
+
+
+    IMPORT_C void SetParent(CSenFilterStateNode& aNode);
+
+
+private:
+
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    TInt iState; // Node index
+    TDesC8 iEvent;
+    CSenFilterCondition iCondition;
+    MSenFilterAction& iStartAction;
+    MSenFilterAction& iEndAction;
+
+    CSenFilterStateNode* ipPrev;
+
+    RStateNodeArray iChildren;
+
+    RFileLogger iLog;
+
+}; // end class CSenFilterStateNode
+
+
+// -----------------------------------------
+//
+// Declaration of class CSenFilterTableEntry
+//
+// -----------------------------------------
+
+class CSenFilterTableEntry : public CBase
+{
+
+public:
+
+    CSenFilterTableEntry(TInt aNewState, 
+                         const CSenFilterCondition& aCondition,
+                         MSenFilterAction& aAction);
+
+
+    ~CSenFilterTableEntry();
+
+public:
+
+    TInt NewState() const;
+
+
+    CSenFilterCondition Condition() const;
+
+
+    MSenFilterAction& Action() const;
+
+
+private:
+
+    /**
+     * File logger.
+     *
+     */
+    RFileLogger* Log() const;
+
+
+private:
+
+    TInt iNewState;
+    CSenFilterCondition iCondition;
+    MSenFilterAction& iAction;
+
+    RFileLogger iLog;
+
+}; // end class CSenFilterTableEntry
+
+
+#endif // C_SEN_FILTER_STATE_MACHINE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/inc/senxmldebug.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Central place for debug-type macros
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_XML_DEBUG_H
+#define SEN_XML_DEBUG_H
+
+//  INCLUDES
+#include "sendebug.h"
+
+#ifdef _SENDEBUG
+#define SENDEBUG_XML_FRAGMENT_STATE(i) \
+    switch(i) \
+        { \
+        case -1: \
+            SENDEBUG((_L("   Fragment state (%d): KStateNotSet"), i)); \
+            break; \
+        case 0: \
+            SENDEBUG((_L("   Fragment state (%d): KStateIgnore"), i)); \
+            break; \
+        case 1: \
+            SENDEBUG((_L("   Fragment state (%d): KStateSave"), i)); \
+            break; \
+        case 2: \
+            SENDEBUG((_L("   Fragment state (%d): KStateResume"), i)); \
+            break; \
+        case 4: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingFramework"), i)); \
+            break; \
+        case 5: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingSoapFault"), i)); \
+            break; \
+        case 6: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingServiceDescription"), i)); \
+            break; \
+        case 11: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingResourceOffering"), i)); \
+            break; \
+        case 12: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingCredentials"), i)); \
+            break; \
+        case 13: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingService"), i)); \
+            break; \
+        case 14: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingPwTransforms"), i)); \
+            break; \
+        case 20: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingSoapHeader"), i)); \
+            break; \
+        case 40: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingSoapBody"), i)); \
+            break; \
+        case 122: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingSingleCredential"), i)); \
+            break; \
+        case 1222: \
+            SENDEBUG((_L("   Fragment state (%d): KStateParsingProviderPolicy"), i)); \
+            break; \
+        default: \
+            SENDEBUG((_L("   Fragment state (%d): UNKNOWN STATE(!)"), i)); \
+            break; \
+        }
+#else
+#define SENDEBUG_XML_FRAGMENT_STATE(i)
+#endif // _SENDEBUG
+
+#endif // SEN_XML_DEBUG_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/rom/wsxml.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __WSXML_IBY__
+#define __WSXML_IBY__
+
+// Xml
+file=ABI_DIR\BUILD_DIR\SenXml.dll               SHARED_LIB_DIR\SenXml.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senbaseattribute.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenBaseAttribute.h"
+#include "SenXmlUtils.h"
+
+EXPORT_C CSenBaseAttribute* CSenBaseAttribute::NewL(const TDesC8& aName,
+                                                    const TDesC8& aValue)
+    {
+    CSenBaseAttribute* pNew = new (ELeave) CSenBaseAttribute;
+    CleanupStack::PushL(pNew);
+    SenXmlUtils::LeaveOnXmlEscapesL(aName);
+    pNew->BaseConstructL(aName, aValue);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenBaseAttribute* CSenBaseAttribute::NewL(const TDesC8& aQName,
+                                                    const TDesC8& aName,
+                                                    const TDesC8& aValue)
+    {
+    CSenBaseAttribute* pNew = new (ELeave) CSenBaseAttribute;
+    CleanupStack::PushL(pNew);
+    SenXmlUtils::LeaveOnInvalidElementNameL(aName);
+    SenXmlUtils::LeaveOnInvalidElementNameL(aQName);
+    pNew->BaseConstructL(aQName, aName, aValue);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+
+EXPORT_C CSenBaseAttribute::CSenBaseAttribute()
+    {
+    }
+
+EXPORT_C void CSenBaseAttribute::BaseConstructL(const TDesC8& aName,
+                                                const TDesC8& aValue)
+    {
+    ipName = aName.AllocL();
+    ipValue = aValue.AllocL();
+    }
+
+EXPORT_C void CSenBaseAttribute::BaseConstructL(const TDesC8& aQName,
+                                                const TDesC8& /* aName */,
+                                                const TDesC8& aValue)
+    {
+    ipValue = aValue.AllocL();
+    ipName = aQName.AllocL(); // name means nothing here..
+    }
+
+
+
+EXPORT_C CSenBaseAttribute::~CSenBaseAttribute()
+    {
+    delete ipName;
+    delete ipValue;
+    }
+
+const TDesC8& CSenBaseAttribute::Name() const
+    {
+    return *ipName;
+    }
+
+const TDesC8& CSenBaseAttribute::Value() const
+    {
+    return *ipValue;
+    }
+
+const TDesC8& CSenBaseAttribute::SetValueL(const TDesC8& aValue)
+    {
+    HBufC8* pValue = aValue.AllocL();
+    delete ipValue;
+    ipValue = pValue;
+    return *ipValue;
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senbaseelement.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1387 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenBaseElement.h"
+#include "SenXmlUtils.h"
+#include "senxmldebug.h"
+
+#include "SenXmlConstants.h" // KSenColon, ++
+
+
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    // for S60 2nd edition FP3 (2.8) OR newer 3rd edition platform
+    #include <xml/attribute.h> // needed for RAttributeArray
+#else 
+    // for S60 2nd edition, up to FP2 (2.0 - 2.6)
+    #include "Attribute.h" // needed for RAttributeArray
+#endif
+
+using namespace Xml;
+
+namespace
+    {
+/*
+    _LIT8(KColon,            ":");
+    _LIT8(KLessThan,         "<");
+    _LIT8(KGreaterThan,      ">");
+    _LIT8(KSpace,            " ");
+    _LIT8(KDblQuot,          "\"");
+    _LIT8(KEqualsDblQuot,    "=\"");
+    _LIT8(KSlashGreaterThan, "/>");
+    _LIT8(KLessThanSlash,    "</");
+    _LIT8(KSpaceXmlns,       " xmlns");
+    _LIT8(KXmlns,            "xmlns");
+    _LIT8(KXmlNsAttNamePlusColon,   "xmlns:"); 
+*/
+    const TInt KFlatBufSize          = 64;  // CBufFlat
+    }
+
+EXPORT_C CSenBaseElement* CSenBaseElement::NewL(const TDesC8& aLocalName)
+    {
+    CSenBaseElement* pNew = new (ELeave) CSenBaseElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseElement* CSenBaseElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName)
+    {
+    CSenBaseElement* pNew = new (ELeave) CSenBaseElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseElement* CSenBaseElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName)
+    {
+    CSenBaseElement* pNew = new (ELeave) CSenBaseElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseElement* CSenBaseElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs)
+    {
+    CSenBaseElement* pNew = new (ELeave) CSenBaseElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, apAttrs);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+
+EXPORT_C CSenBaseElement* CSenBaseElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs,
+                                                CSenElement& aParent)
+    {
+    CSenBaseElement* pNew = new (ELeave) CSenBaseElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, apAttrs, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseElement::CSenBaseElement()
+: ipLocalName(NULL),
+//  ipNsUri(NULL),
+  ipContentBuf(NULL),
+  ipParent(NULL),
+  ipNamespace(NULL)
+    {
+    }
+
+EXPORT_C CSenBaseElement::~CSenBaseElement()
+    {
+    delete ipLocalName;
+//    delete ipNsUri;
+    delete ipContentBuf;
+
+    iAttrs.ResetAndDestroy();
+
+    iElements.ResetAndDestroy();
+    iNamespaces.ResetAndDestroy();
+    }
+
+
+
+EXPORT_C void CSenBaseElement::BaseConstructL(const TDesC8& aLocalName)
+    {
+    SenXmlUtils::LeaveOnInvalidElementNameL(aLocalName);
+    ipLocalName = aLocalName.AllocL();
+    }
+
+EXPORT_C void CSenBaseElement::BaseConstructL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName)
+    {
+    SenXmlUtils::LeaveOnInvalidElementNameL(aLocalName);
+    if(aNsUri.Length()>0)
+        {
+        SetNamespaceL(aNsUri);
+        }
+    ipLocalName = aLocalName.AllocL();
+    }
+
+EXPORT_C void CSenBaseElement::BaseConstructL(  const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName)
+    {
+    SenXmlUtils::LeaveOnInvalidElementNameL(aLocalName);
+    SenXmlUtils::LeaveOnInvalidElementNameL(aQName);
+    ipLocalName = aLocalName.AllocL();
+    TPtrC8 prefix(KNullDesC8);
+    if(aQName.Length()>0)
+        {
+        TInt colon = aQName.Locate(':');
+        if(colon>0) // Note: 0 also treated as no prefix
+            {
+            prefix.Set(aQName.Ptr(), colon);
+            }
+        }
+    SetNamespaceL(prefix, aNsUri);
+    }
+
+EXPORT_C void CSenBaseElement::BaseConstructL(  const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName);
+    SetAttributesL(apAttrs);
+    }
+
+EXPORT_C void CSenBaseElement::BaseConstructL(  const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs,
+                                                CSenElement& aParent    )
+    {
+    // parent must be set here at first line, because
+    // namespace setting dependends of it(!)
+    ipParent = &aParent;
+
+    BaseConstructL(aNsUri, aLocalName, aQName);
+    SetAttributesL(apAttrs);
+    }
+
+EXPORT_C void CSenBaseElement::SetAttributesL(const RAttributeArray& apAttrs)
+    {
+    AddAttributesL(apAttrs);
+    }
+
+
+EXPORT_C void CSenBaseElement::AddAttributesL(const RAttributeArray& apAttrs)
+    {
+    TInt count(apAttrs.Count());
+    HBufC8* qName = NULL;
+    for(TInt i=0; i<count; i++)
+        {
+        const TPtrC8 localname = apAttrs[i].Attribute().LocalName().DesC();
+        const TPtrC8 prefix = apAttrs[i].Attribute().Prefix().DesC();
+        const TPtrC8 value = apAttrs[i].Value().DesC();
+
+        SenXmlUtils::BuildQNameL(prefix, localname, qName);
+
+        CleanupStack::PushL(qName);
+
+        HBufC8* encodedValue = NULL;
+        TBool encoded = 
+            SenXmlUtils::EncodeHttpCharactersL(value, encodedValue);
+
+        if (encoded)
+            {
+            CleanupStack::PushL(encodedValue);
+            AddAttributeL(*qName, localname, *encodedValue); 
+            // note: this intentionally
+            // skips the 2 param 
+            // AddAttributeL() function
+
+            CleanupStack::PopAndDestroy(); // encodedValue
+            }
+        else
+            {
+            AddAttributeL(*qName, localname, value); 
+            // note: this intentionally
+            // skips the 2 param 
+            // AddAttributeL() function
+            }
+
+        CleanupStack::PopAndDestroy(); // qName
+        }
+    }
+
+EXPORT_C const TDesC8& CSenBaseElement::AddAttributeL(const TDesC8& aQName,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aValue)
+    {
+    // first we check for possible namespace declarations...
+    if ( aQName == KSenXmlns || aLocalName == KSenXmlns)
+        {
+        // this is a default name space declaration
+        SetNamespaceL(aValue);
+        }
+    else if (aLocalName == NsPrefix())
+        {
+        //we have a new declaration for the namespace of this element
+        SetNamespaceL(aLocalName, aValue);
+        }
+    else if(aQName.Find(KSenXmlNsAttNamePlusColon) == 0)
+        {
+        // we have an additional namespace declaration
+        AddNamespaceL(aLocalName, aValue);
+        }
+    else
+        {
+        // we have a real attribute!
+        CSenBaseAttribute* pAttribute = CSenBaseAttribute::NewL(aQName,
+                                                                aLocalName,
+                                                                aValue);
+        AddAttributeL(pAttribute);
+        }
+    return aValue;
+    }
+
+
+
+EXPORT_C const TDesC8& CSenBaseElement::AddAttributeL(const TDesC8& aAttrName,
+                                                      const TDesC8& aValue)
+    {
+    // note, the aAttrName may be a qualified name or simply localname
+    // strip off the possible prefix from possible qualified name:
+    TPtrC8 localName = SenXmlUtils::LocalName(aAttrName);
+    return AddAttributeL(aAttrName, localName, aValue);
+    }
+
+// takes the ownership of aAttribute
+EXPORT_C const TDesC8& CSenBaseElement::AddAttributeL(CSenBaseAttribute* apAttribute)
+    {
+    CSenBaseAttribute* pOldAtt = FindAttr(apAttribute->Name());
+
+    if(!pOldAtt)
+        {
+        // transfrer the ownership to this class:
+#ifdef EKA2
+        iAttrs.AppendL(apAttribute);
+#else
+        User::LeaveIfError(iAttrs.Append(apAttribute));
+#endif // EKA2
+        return apAttribute->Value();
+        }
+    else
+        {
+        pOldAtt->SetValueL(apAttribute->Value());
+        delete apAttribute;
+        apAttribute = NULL;
+        return pOldAtt->Value();
+        }
+    }
+
+
+EXPORT_C CSenBaseAttribute* CSenBaseElement::FindAttr(const TDesC8& aName)
+    {
+    for (TInt i = 0; i < iAttrs.Count(); i++)
+        {
+        if (iAttrs[i]->Name() == aName)
+            {
+            return iAttrs[i];
+            }
+        }
+    return NULL;
+    }
+
+
+EXPORT_C TInt CSenBaseElement::IndexOfElement(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName) const
+    {
+    for (TInt i = 0; i < iElements.Count(); i++)
+        {
+        CSenElement* pElement = iElements[i];
+        const TDesC8& nsUri = pElement->NamespaceURI();
+        const TDesC8& localName = pElement->LocalName();
+        if ((nsUri == aNsUri) && (localName == aLocalName))
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+EXPORT_C const TDesC8& CSenBaseElement::LocalName() const
+    {
+    if (ipLocalName == NULL)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return *ipLocalName;
+        }
+    }
+
+EXPORT_C const TDesC8& CSenBaseElement::NamespaceURI() const
+    {
+    if (ipNamespace)
+        {
+        return ipNamespace->URI();
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+EXPORT_C const TDesC8& CSenBaseElement::NsPrefix() const
+    {
+    if (ipNamespace == NULL)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return ipNamespace->Prefix();
+        }
+    }
+
+EXPORT_C TBool CSenBaseElement::HasContent() const
+    {
+    if (ipContentBuf == NULL)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return (ipContentBuf->Size() > 0);
+        }
+    }
+
+EXPORT_C TPtrC8 CSenBaseElement::Content() const
+    {
+    if (ipContentBuf == NULL)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        TPtrC8 p8 = ipContentBuf->Ptr(0);
+        return p8;
+        }
+    }
+
+
+EXPORT_C HBufC* CSenBaseElement::ContentUnicodeL() const
+    {
+    HBufC* pRet = SenXmlUtils::ToUnicodeLC(Content());
+    CleanupStack::Pop(); // pRet;
+    return pRet;
+    }
+
+EXPORT_C TPtrC8 CSenBaseElement::SetContentL(const TDesC8& aContent)
+    {
+    AllocContentBufL(); // content length is _OK_ to be ZERO
+    ipContentBuf->ResizeL(aContent.Size());
+    ipContentBuf->Write(0, aContent);
+  
+    //   TPtrC8(REINTERPRET_CAST(const TUint8*, aContent.Ptr()),
+    //                                            aContent.Size()));
+    // Reset stream
+    iContentWriteStream.Open(*ipContentBuf);
+    return Content();
+    }
+
+EXPORT_C RWriteStream& CSenBaseElement::ContentWriteStreamL()
+    {
+    AllocContentBufL();
+    iContentWriteStream.Open(*ipContentBuf);
+    return iContentWriteStream;
+    }
+
+// NOTE: assumes(!) that the namespace is same(!)
+EXPORT_C RPointerArray<CSenElement>& CSenBaseElement::ElementsL()
+    {
+    return iElements;
+    }
+
+EXPORT_C TInt CSenBaseElement::ElementsL(
+                                    RPointerArray<CSenElement>& aElementArray,
+                                    const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName)
+    {
+    if (iElements.Count() == 0)
+        return KErrNotFound;
+
+    CSenElement* pElement = NULL;
+    TInt count(iElements.Count());
+    for (TInt i=0; i<count; i++)
+        {
+        pElement = iElements[i];
+        if ( (aLocalName == pElement->LocalName()) &&
+             (aNsUri == pElement->NamespaceURI()) )
+            {
+#ifdef EKA2
+            aElementArray.AppendL(pElement);
+#else
+            User::LeaveIfError(aElementArray.Append(pElement));
+#endif // EKA2
+            }
+        }
+
+    return KErrNone;
+    }
+
+EXPORT_C TInt CSenBaseElement::ElementsL(
+                                    RPointerArray<CSenElement>& aElementArray,
+                                    const TDesC8& aLocalName)
+    {
+    return ElementsL(aElementArray,NamespaceURI(),aLocalName);
+    }
+
+EXPORT_C const TDesC8* CSenBaseElement::AttrValue(const TDesC8& aName)
+    {
+    CSenBaseAttribute* pAttr = FindAttr(aName);
+    if (pAttr == NULL)
+        {
+        return NULL;
+        }
+    else
+        {
+        return &(pAttr->Value());
+        }
+    }
+
+EXPORT_C void CSenBaseElement::AddAttrL(const TDesC8& aName,
+                                        const TDesC8& aValue)
+    {
+    CSenBaseAttribute* pAttr = FindAttr(aName);
+    if (pAttr == NULL)
+        {
+        User::LeaveIfError(iAttrs.Append(CSenBaseAttribute::NewL(aName,
+                                                                 aValue)));
+        }
+    else
+        {
+        pAttr->SetValueL(aValue);
+        }
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::Parent()
+    {
+    return ipParent;
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::SetParent(CSenElement* apParent)  // IOP
+    {
+    if (apParent && ipParent != apParent)
+        {
+        ipParent = apParent;
+        if (!ipNamespace)
+            {
+            // check if there is a default namespace declared in the scope of
+            // the parent
+            const CSenNamespace* pParentNamespace =
+                ((CSenBaseElement*) ipParent)->Namespace(KNullDesC8,ETrue);
+            if (pParentNamespace && pParentNamespace->Prefix() == KNullDesC8)
+                {
+                ipNamespace = (CSenNamespace*)pParentNamespace;
+                }
+            }
+        else
+            {
+            //check if the parent already has a namespace for this element
+            // if so remove it from the local namespace table
+            const CSenNamespace* pNs = ipParent->Namespace(KNullDesC8,
+                                                    ipNamespace->URI());
+            if (pNs && pNs != ipNamespace)
+                {
+                if (ipNamespace->Compare(*pNs) ||
+                    ipNamespace->Prefix().Length() == 0)
+                    {
+                    //prefix is also identical or this element has no prefix
+                    TInt nsIndex = iNamespaces.Find(ipNamespace);
+                    if ( nsIndex != KErrNotFound)
+                        {
+                        iNamespaces.Remove(nsIndex);
+                        }
+                    delete ipNamespace;
+                    ipNamespace = (CSenNamespace*)pNs;
+                    }
+                }
+
+            }
+        }
+    return apParent;
+    }
+
+EXPORT_C MSenElement& CSenBaseElement::Root()
+    {
+    if (ipParent == NULL)
+        {
+        return *this;
+        }
+    else
+        {
+        return ipParent->Root();
+        }
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::Element(const TDesC8& aLocalName)
+    {
+    return Element(NamespaceURI(), aLocalName);
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::Element(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName)
+    {
+    TInt idx = IndexOfElement(aNsUri, aLocalName);
+    if (idx < 0)
+        {
+        return NULL;
+        }
+    else
+        {
+        return iElements[idx];
+        }
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::CreateElementL(const TDesC8& aNsPrefix,
+                                                      const TDesC8& aLocalName)
+    {
+    CSenElement* pNewElement = NULL;
+
+    if (aNsPrefix.Length() > 0)
+        {
+        CSenNamespace* pNamespace = (CSenNamespace*)Namespace(aNsPrefix);
+        if (pNamespace)
+            {
+            HBufC8 *pQName =
+                HBufC8::NewLC(aNsPrefix.Length() + aLocalName.Length() +5);
+            TPtr8 ptr = pQName->Des();
+            ptr.Append(aNsPrefix);
+            ptr.Append(':');
+            ptr.Append(aLocalName);
+            pNewElement =
+                CSenBaseElement::NewL(pNamespace->URI(), aLocalName, *pQName);
+            CleanupStack::PopAndDestroy(); // pQName
+            }
+        }
+    else
+        {
+        pNewElement = CSenBaseElement::NewL(aLocalName);
+        }
+
+    return pNewElement; // Returns NULL if required namespace can not be found!
+    }
+
+EXPORT_C CSenElement& CSenBaseElement::InsertElementL(
+                                          CSenElement& aElement,
+                                          const CSenElement& aBeforeElement)
+    {
+    TInt index(KErrNotFound);
+    index = iElements.Find(&aBeforeElement);
+    if (index != KErrNotFound)
+        {
+        User::LeaveIfError(iElements.Insert(&aElement,index));
+        }
+    else
+        {
+        User::LeaveIfError(iElements.Append(&aElement));
+        }
+    aElement.SetParent(this);
+    return aElement;
+    }
+
+EXPORT_C CSenElement& CSenBaseElement::AddElementL(CSenElement& aElement)
+    {
+    User::LeaveIfError(iElements.Append(&aElement));
+    aElement.SetParent(this);
+    return aElement;
+    }
+
+EXPORT_C CSenElement& CSenBaseElement::AddElementL(const TDesC8& aNsUri,
+                                                   const TDesC8& aLocalName)
+    {
+    return AddElementL(*CSenBaseElement::NewL(aNsUri, aLocalName));
+    }
+
+EXPORT_C CSenElement& CSenBaseElement::AddElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    return AddElementL(*CSenBaseElement::NewL(aNsUri, aLocalName, aQName));
+    }
+
+EXPORT_C CSenElement& CSenBaseElement::AddElementL(const TDesC8& aLocalName)
+    {
+    return AddElementL(*CSenBaseElement::NewL(aLocalName));
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::RemoveElement(CSenElement& aElement)
+    {
+    TInt idx = iElements.Find(&aElement);
+    if (idx >= 0)
+        {
+        CSenElement* pElement = iElements[idx];
+        iElements.Remove(idx);
+        pElement->SetParent(NULL);
+        return pElement;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::RemoveElement(const TDesC8& aNsUri,
+                                                     const TDesC8& aLocalName)
+    {
+    TInt idx = IndexOfElement(aNsUri, aLocalName);
+    if (idx >= 0)
+        {
+        CSenElement* pElement = iElements[idx];
+        iElements.Remove(idx);
+        pElement->SetParent(NULL);
+        return pElement;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::RemoveElement(const TDesC8& aLocalName)
+    {
+    return RemoveElement(NamespaceURI(), aLocalName);
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::ReplaceElementL(CSenElement& aElement)
+    {
+    CSenElement* pOldElement =
+                RemoveElement(aElement.NamespaceURI(), aElement.LocalName());
+    CleanupStack::PushL(pOldElement);
+    AddElementL(aElement);
+    CleanupStack::Pop(); // pOldElement;
+    return pOldElement;
+    }
+
+EXPORT_C HBufC8* CSenBaseElement::AsXmlL()
+    {
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    TPtrC8 p = WriteToBufL(*pBuf);
+    HBufC8* pRet = p.AllocL();
+    CleanupStack::PopAndDestroy(); // pBuf;
+    return pRet;
+
+    }
+
+EXPORT_C HBufC* CSenBaseElement::AsXmlUnicodeL()
+    {
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    TPtrC8 p8 = WriteToBufL(*pBuf);
+    HBufC* pRet = SenXmlUtils::ToUnicodeLC(p8);
+    CleanupStack::Pop(); // pop pRet;
+    CleanupStack::PopAndDestroy(); // pBuf;
+    return pRet;
+    }
+
+EXPORT_C TPtrC8 CSenBaseElement::WriteToBufL(CBufBase& aBuf)
+    {
+    RBufWriteStream bufWs(aBuf);
+    CleanupClosePushL(bufWs);
+    this->WriteAsXMLToL(bufWs);
+    CleanupStack::PopAndDestroy(); // bufWs.Close();
+    return aBuf.Ptr(0);
+    }
+
+EXPORT_C void CSenBaseElement::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    // Find out whether we should declare the namespace
+    TPtrC8 nsPrefix = NsPrefix();
+
+    // Element name
+    aWriteStream.WriteL(KSenLessThan);
+    if (nsPrefix.Length() > 0)
+        {
+        aWriteStream.WriteL(nsPrefix);
+        aWriteStream.WriteL(KSenColon);
+        }
+    aWriteStream.WriteL(*ipLocalName);
+
+    if (iAttrs.Count() > 0 || iNamespaces.Count() > 0)
+        {
+        WriteNamespacesToL(aWriteStream);
+        WriteAttrsToL(aWriteStream);
+        }
+
+    // Elements and content
+    if ((iElements.Count() > 0) || HasContent())
+        {
+        aWriteStream.WriteL(KSenGreaterThan);
+
+        // Body
+        WriteElementsToL(aWriteStream);
+        WriteContentToL(aWriteStream);
+
+        // Closing element
+        aWriteStream.WriteL(KSenLessThanSlash);
+        if (nsPrefix.Length() > 0)
+            {
+            aWriteStream.WriteL(nsPrefix);
+            aWriteStream.WriteL(KSenColon);
+            }
+        aWriteStream.WriteL(*ipLocalName);
+        aWriteStream.WriteL(KSenGreaterThan);
+        }
+    else
+        {
+        aWriteStream.WriteL(KSenSlashGreaterThan);
+        }
+    }
+
+EXPORT_C void CSenBaseElement::WriteAttrToL(RWriteStream& aWriteStream,
+                                            const TDesC8& aName,
+                                            const TDesC8& aValue)
+    {
+    aWriteStream.WriteL(KSenSpace);
+    aWriteStream.WriteL(aName);
+    aWriteStream.WriteL(KSenEqualsDblQuot);
+    aWriteStream.WriteL(aValue);
+    aWriteStream.WriteL(KSenDblQuot);
+    }
+
+EXPORT_C void CSenBaseElement::WriteAttrsToL(RWriteStream& aWriteStream)
+    {
+    for (TInt i = 0; i < iAttrs.Count(); i++)
+        {
+        WriteAttrToL(aWriteStream, iAttrs[i]->Name(), iAttrs[i]->Value());
+        }
+    }
+
+EXPORT_C void CSenBaseElement::WriteNamespacesToL(RWriteStream& aWriteStream)
+    {
+    TInt count = iNamespaces.Count();
+    CSenNamespace* ns = NULL;
+    if (count > 0)
+        {
+        for (TInt i=0; i < count; i++)
+            {
+            ns = iNamespaces[i];
+            if (ns)
+                {
+                aWriteStream.WriteL(KSenSpaceXmlns);
+                if (ns->Prefix().Length() > 0)
+                    {
+                    aWriteStream.WriteL(KSenColon);
+                    aWriteStream.WriteL(ns->Prefix());
+                    }
+                aWriteStream.WriteL(KSenEqualsDblQuot);
+                aWriteStream.WriteL(ns->URI());
+                aWriteStream.WriteL(KSenDblQuot);
+                }
+            }
+        }
+    }
+
+EXPORT_C void CSenBaseElement::WriteElementsToL(RWriteStream& aWriteStream)
+    {
+    TInt elementCount(iElements.Count());
+    for (TInt i=0; i<elementCount; i++)
+        {
+        iElements[i]->WriteAsXMLToL(aWriteStream);
+        }
+    }
+
+EXPORT_C void CSenBaseElement::WriteContentToL(RWriteStream& aWriteStream)
+    {
+    aWriteStream.WriteL(Content());
+    }
+
+EXPORT_C MSenElement* CSenBaseElement::AsElement()
+    {
+    return this;
+    }
+
+EXPORT_C void CSenBaseElement::AllocContentBufL()
+    {
+    if(!ipContentBuf)
+        {
+        ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+        }
+    }
+
+EXPORT_C void CSenBaseElement::SetNamespaceL(const TDesC8& aNsUri)
+    {
+    SetNamespaceL(KNullDesC8, aNsUri);
+    }
+
+EXPORT_C void CSenBaseElement::SetNamespaceL(const TDesC8& aNsPrefix,
+                                             const TDesC8& aNsUri)
+    {
+    if (aNsUri.Length() > 0)
+        {
+        ipNamespace = (CSenNamespace*) Namespace(aNsPrefix, aNsUri);
+        if (!ipNamespace)
+            {
+            ipNamespace = CSenNamespace::NewL(aNsPrefix, aNsUri);
+
+#ifdef EKA2
+            iNamespaces.AppendL(ipNamespace);
+#else
+            User::LeaveIfError(iNamespaces.Append(ipNamespace));
+#endif // EKA2
+            }
+        }
+    }
+
+EXPORT_C const CSenNamespace* CSenBaseElement::Namespace()
+    {
+    return ipNamespace;
+    }
+
+EXPORT_C const CSenNamespace* CSenBaseElement::Namespace(
+                                                    const TDesC8& aNsPrefix)
+    {
+    return Namespace(aNsPrefix,ETrue);
+    }
+
+EXPORT_C const CSenNamespace* CSenBaseElement::Namespace(
+                                                    const TDesC8& aNsPrefix,
+                                                    const TBool aCheckInParent)
+    {
+    if (aNsPrefix.Length() == 0) return NULL;
+
+    const CSenNamespace* pNamespace = NULL;
+
+    TInt count(iNamespaces.Count());
+    for (TInt i=0; i<count && pNamespace == NULL; i++)
+        {
+        pNamespace = iNamespaces[i];
+        if (pNamespace)
+            {
+            if (pNamespace->Prefix() != aNsPrefix) pNamespace = NULL;
+            }
+        }
+
+    if (pNamespace == NULL && ipParent && aCheckInParent)
+        {
+        pNamespace = ipParent->Namespace(aNsPrefix);
+        }
+
+    return pNamespace;
+    }
+
+
+EXPORT_C const CSenNamespace* CSenBaseElement::Namespace(
+                                                    const TDesC8& aNsPrefix,
+                                                    const TDesC8& aUri)
+    {
+    // If prefix == NULL, then any prefix is ok
+    const CSenNamespace* pNs = NULL;
+    // Check if the namespace has already been declared
+    TInt count = iNamespaces.Count();
+    if (count != 0)
+        {
+        for (TInt i=0; i<count; i++)
+            {
+            pNs = iNamespaces[i];
+            if (!pNs->Compare(aNsPrefix, aUri))
+                {
+                pNs = NULL;
+                }
+            else
+                {
+                break;
+                }
+            }
+        }
+    if (pNs == NULL && ipParent != NULL)
+        {
+        // if no namespace defined, but there is a parent, ask its namespace
+        pNs = ipParent->Namespace(aNsPrefix, aUri);
+        }
+    return pNs;
+    }
+
+EXPORT_C RPointerArray<CSenBaseAttribute>& CSenBaseElement::AttributesL()
+    {
+    return iAttrs;
+    }
+
+EXPORT_C RPointerArray<CSenNamespace>& CSenBaseElement::NamespacesL()
+    {
+    return iNamespaces;
+    }
+
+EXPORT_C void CSenBaseElement::CopyFromL(CSenElement& aSource)
+    {
+    TPtrC8 sourceContent = aSource.Content();
+    if (sourceContent.Length() > 0)
+        {
+        if (ipContentBuf == NULL)
+            {
+            SetContentL(sourceContent);
+            }
+        else
+            {
+            RBufWriteStream bufWs(*ipContentBuf);
+            CleanupClosePushL(bufWs);
+            bufWs.WriteL(sourceContent);
+            CleanupStack::PopAndDestroy(); // close bufWs
+            }
+        }
+
+    RPointerArray<CSenNamespace> sourceNamespaces = aSource.NamespacesL();
+    if (sourceNamespaces.Count() > 0)
+        {
+        for (TInt i=0;i<sourceNamespaces.Count(); i++)
+            {
+            CSenNamespace* pNamespace = sourceNamespaces[i];
+            CSenNamespace* pNewNamespace =
+                CSenNamespace::NewL(pNamespace->Prefix(),pNamespace->URI());
+            CleanupStack::PushL(pNewNamespace);
+#ifdef EKA2
+            iNamespaces.AppendL(pNewNamespace);
+#else
+            User::LeaveIfError(iNamespaces.Append(pNewNamespace));
+#endif
+
+            CleanupStack::Pop(pNewNamespace);
+            }
+        }
+    SetNamespaceL(aSource.NsPrefix(), aSource.NamespaceURI());
+
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aSource.AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+
+            // duplicate check. Now overrides the original value
+            CSenBaseAttribute* pOriginal = FindAttr(pBaseAttribute->Name());
+            if (pOriginal)
+                {
+                pOriginal->SetValueL(pBaseAttribute->Value());
+                continue;
+                }
+
+            CSenBaseAttribute* pNewBaseAttribute =
+                CSenBaseAttribute::NewL(pBaseAttribute->Name(),
+                                        pBaseAttribute->Value());
+            CleanupStack::PushL(pNewBaseAttribute);
+#ifdef EKA2
+            iAttrs.AppendL(pNewBaseAttribute);
+#else
+            User::LeaveIfError(iAttrs.Append(pNewBaseAttribute));
+#endif
+            CleanupStack::Pop(pNewBaseAttribute);
+            }
+        }
+
+    RPointerArray<CSenElement> sourceElements = aSource.ElementsL();
+    if (sourceElements.Count() > 0)
+        {
+        for (TInt i=0;i<sourceElements.Count(); i++)
+            {
+            CSenElement* pElement = sourceElements[i];
+            CSenElement* pNewElement =
+                                CSenBaseElement::NewL(pElement->LocalName());
+            pNewElement->SetParent(this);
+            CleanupStack::PushL(pNewElement);
+            pNewElement->CopyFromL(*pElement);
+#ifdef EKA2
+            iElements.AppendL(pNewElement);
+#else
+            User::LeaveIfError(iElements.Append(pNewElement));
+#endif // EKA2
+            CleanupStack::Pop(pNewElement);
+            }
+        }
+    }
+
+EXPORT_C void CSenBaseElement::SetPrefixL(const TDesC8& aPrefix)
+    {
+    if (iNamespaces.Find(ipNamespace) > -1)
+        {
+        //the namespace was locally declared
+
+        // Check if element already has a namespace with given prefix
+        CSenNamespace* pNamespace = NULL;
+        TInt count(iNamespaces.Count());
+        for (TInt i=0; i<count && pNamespace == NULL; i++)
+            {
+            pNamespace = iNamespaces[i];
+            if (pNamespace->Prefix() != aPrefix) pNamespace = NULL;
+            }
+
+        if (pNamespace)
+            {
+            // Update existing namespace
+            const TDesC8& uri = ipNamespace->URI();
+            pNamespace->SetUriL(uri);
+            ipNamespace = pNamespace;
+            }
+        else
+            {
+            if (ipNamespace->Prefix().Length() > 0 && iElements.Count() > 0)
+                {
+                // there may be children that depend on the old prefix in e.g. attribute names
+                const TDesC8& uri = ipNamespace->URI();
+                ipNamespace = CSenNamespace::NewL(aPrefix, uri);
+#ifdef EKA2
+                iNamespaces.AppendL(ipNamespace);
+#else
+                User::LeaveIfError(iNamespaces.Append(ipNamespace));
+#endif
+                }
+            ipNamespace->SetPrefixL(aPrefix);
+            }
+        }
+    }
+
+EXPORT_C const CSenNamespace* CSenBaseElement::AddNamespaceL(
+                                                CSenNamespace& aNewNamespace,
+                                                TBool aCheckInParent)
+    {
+    const CSenNamespace* pNamespace =
+                        Namespace(aNewNamespace.Prefix(), aCheckInParent);
+    if (pNamespace == NULL)
+        {
+        CSenNamespace* pNewNamespace =
+            CSenNamespace::NewL(aNewNamespace.Prefix(), aNewNamespace.URI());
+        CleanupStack::PushL(pNewNamespace);
+#ifdef EKA2
+        iNamespaces.AppendL(pNewNamespace);
+#else
+        User::LeaveIfError(iNamespaces.Append(pNewNamespace));
+#endif
+        CleanupStack::Pop(); // pNewNamespace
+        pNamespace = pNewNamespace;
+        }
+    return pNamespace;
+    }
+
+EXPORT_C const CSenNamespace* CSenBaseElement::AddNamespaceL(
+                                                         const TDesC8& aPrefix,
+                                                         const TDesC8& aUri)
+    {
+    CSenNamespace* pNamespace = (CSenNamespace*)Namespace(aPrefix);
+		if (!pNamespace)
+		{
+    	if (aUri.Length() > 0)
+        	{
+        	pNamespace = CSenNamespace::NewL(aPrefix, aUri);
+        	CleanupStack::PushL(pNamespace);
+#ifdef EKA2
+        	iNamespaces.AppendL(pNamespace);
+#else
+        	User::LeaveIfError(iNamespaces.Append(pNamespace));
+#endif
+        	CleanupStack::Pop(); // pNamespace
+        	}
+        }
+	    else
+	        {
+	        pNamespace->SetUriL(aUri); 
+	        }
+		
+
+    return pNamespace;
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::DetachL()
+    {
+    if (!ipParent)
+        {
+        return NULL;
+        }
+    AddNamespaceMissingFromL(iNamespaces);
+    ipParent->RemoveElement(*this);
+    return this;
+    }
+
+void CSenBaseElement::AddNamespaceMissingFromL(
+                                    RPointerArray<CSenNamespace>& aNamespaces)
+    {
+    // Add namespace of this element (possibly copied from parent)
+    // if that namespace is not already defined in
+    // aNamespaces array.
+    if ( ipNamespace && aNamespaces.Find(ipNamespace) == -1)
+        {
+        // Check if namespace declaration of this element can
+        // be found from aNamespaces array
+        TInt count(aNamespaces.Count());
+        TBool found(EFalse);
+        TInt i = 0;
+        for (; i<count; i++)
+            {
+            if ( aNamespaces[i]->URI() == ipNamespace->URI() && 
+                 aNamespaces[i]->Prefix() == ipNamespace->Prefix() )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        if ( !found )
+            {
+            // Not found 
+            // => Create a copy of namespace declaration
+            //    and append it into aNamespaces array
+            CSenNamespace* pCopy =
+                    CSenNamespace::NewL(ipNamespace->Prefix(), ipNamespace->URI());
+            CleanupStack::PushL(pCopy);
+#ifdef EKA2
+            aNamespaces.AppendL(pCopy);
+#else
+            User::LeaveIfError(aNamespaces.Append(pCopy));
+#endif
+            CleanupStack::Pop(pCopy);
+
+            // Change namespace object for this element to namespace object
+            // which can be found from aNamespaces array
+            ipNamespace = pCopy;
+            }
+        else
+            {
+            // Change namespace object for this element to namespace object
+            // which can be found from aNamespaces array
+            
+            ipNamespace = aNamespaces[i];
+            }
+        }
+
+    // Add namespaces from this element's attributes
+    // if those namespaces are not already defined in
+    // aNamespaces array.
+    if ( iAttrs.Count() > 0 )
+        {
+        TInt colon = -1;
+        const CSenNamespace* pNamespace = NULL;
+
+        TInt count(iAttrs.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            CSenBaseAttribute* pAttribute = iAttrs[i];
+
+            // Check namespace assigned to Name
+            colon = pAttribute->Name().Locate(':');
+            if ( colon > 0 )
+                {
+                pNamespace =
+                    Namespace(pAttribute->Name().Mid(0, colon), KNullDesC8);
+                }
+            if ( pNamespace && (aNamespaces.Find(pNamespace) == -1) )
+                {
+                // Check if namespace declaration for handled attribute
+                // _name_ can be found from aNamespaces array.
+                TInt count(aNamespaces.Count());
+                TBool found(EFalse);
+                for (TInt i = 0; i<count; i++)
+                    {
+                    if ( aNamespaces[i]->URI() == pNamespace->URI() && 
+                         aNamespaces[i]->Prefix() == pNamespace->Prefix() )
+                        {
+                        found = ETrue;
+                        break;
+                        }
+                    }
+                if ( !found )
+                    {
+                    // Not found 
+                    // => Create a copy of namespace declaration
+                    //    and append it into aNamespaces array
+                    CSenNamespace* pCopy =
+                            CSenNamespace::NewL(pNamespace->Prefix(),
+                                                pNamespace->URI());
+                    CleanupStack::PushL(pCopy);
+#ifdef EKA2
+                    aNamespaces.AppendL(pCopy);
+#else
+                    User::LeaveIfError(aNamespaces.Append(pCopy));
+#endif
+                    CleanupStack::Pop(pCopy);
+                    }
+                }
+            pNamespace = NULL;
+
+            // Check namespace assigned to Value
+            colon = pAttribute->Value().Locate(':');
+            if ( colon > 0 )
+                {
+                pNamespace =
+                    Namespace(pAttribute->Value().Mid(0, colon), KNullDesC8);
+                }
+            if ( pNamespace && (aNamespaces.Find(pNamespace) == -1) )
+                {
+                // Check if namespace declaration for handled attribute
+                // _value_ can be found from aNamespaces array.
+                TInt count(aNamespaces.Count());
+                TBool found(EFalse);
+                for (TInt i = 0; i<count; i++)
+                    {
+                    if ( aNamespaces[i]->URI() == pNamespace->URI() && 
+                         aNamespaces[i]->Prefix() == pNamespace->Prefix() )
+                        {
+                        found = ETrue;
+                        break;
+                        }
+                    }
+                if ( !found )
+                    {
+                    // Not found 
+                    // => Create a copy of namespace declaration
+                    //    and append it into aNamespaces array
+                    CSenNamespace* pCopy =
+                            CSenNamespace::NewL(pNamespace->Prefix(), 
+                                                pNamespace->URI());
+                    CleanupStack::PushL(pCopy);
+#ifdef EKA2
+                    aNamespaces.AppendL(pCopy);
+#else
+                    User::LeaveIfError(aNamespaces.Append(pCopy));
+#endif
+                    CleanupStack::Pop(pCopy);
+                    }
+                }
+            pNamespace = NULL;
+            }
+        }
+
+    // Do recursive search for all child elements and for all child
+    // elements of all child elements and so on.
+    if ( iElements.Count() > 0 )
+        {
+        TInt count(iElements.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            CSenBaseElement* pElement = (CSenBaseElement*) iElements[i];
+            pElement->AddNamespaceMissingFromL(aNamespaces);
+            }
+        }
+    }
+
+
+EXPORT_C void CSenBaseElement::Set(const TDesC8& aNamespaceURI,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName)
+    {
+    
+    HBufC8* pTemp = aLocalName.Alloc();
+    if(pTemp)
+        {
+        delete ipLocalName;
+        ipLocalName = NULL;
+        ipLocalName = pTemp;
+        }
+
+
+    TPtrC8 prefix(KNullDesC8);
+
+    if(aQName != KNullDesC8)
+        {
+        TInt colon(KErrNotFound);
+        colon = aQName.Locate(':');
+        if(colon!=KErrNotFound)
+            {
+            prefix.Set(aQName.Left(colon));
+            }
+        }
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, SetNamespaceL(prefix, aNamespaceURI);)
+    leaveCode=0;
+    
+    //if (err) ; 
+    }
+
+EXPORT_C CSenElement* CSenBaseElement::Child(TInt aIndex)
+    {
+    CSenElement* pElement = NULL;
+    if (aIndex < iElements.Count())
+        {
+        pElement = (CSenBaseElement*) iElements[aIndex];
+        }
+    return pElement;
+    }
+
+EXPORT_C TBool CSenBaseElement::ConsistsOfL(MSenElement& aCandidate)
+    {
+    // First check the names and namespaces
+    if (    aCandidate.LocalName() != this->LocalName()
+        ||  aCandidate.NamespaceURI() != this->NamespaceURI()
+        ||  aCandidate.NsPrefix() != this->NsPrefix()
+        )
+        {
+        return EFalse;
+        }
+
+    // Then check content if it exists
+    if (aCandidate.HasContent())
+        {
+        if (aCandidate.Content() != this->Content())
+            {
+            return EFalse;  // Content doesn't match => no match
+            }
+        }
+
+    // Then handle the children
+    RPointerArray<CSenElement>& children = aCandidate.ElementsL();
+    TInt childCount = children.Count();
+    TInt i=0;
+    while (i < childCount)
+        {
+        CSenElement* pMatchChild = children[i];
+        CSenElement* pChild = this->Element(pMatchChild->LocalName());
+        if (!pChild)
+            {
+            return EFalse;  // no child with same name found in children, 
+                            // => no match
+            }
+        else
+            {
+            if (!pChild->ConsistsOfL(*pMatchChild))
+                {
+                return EFalse; // a non matching child was found => No match
+                }
+            }
+        i++;
+        }
+    return ETrue;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senbasefragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,896 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+// INCLUDE FILES
+
+#include <flogger.h>
+#include "SenXmlElement.h" // header to optimized version of SenBaseElement
+#include "SenBaseFragment.h"
+#include "SenXmlConstants.h"
+#include "SenXmlUtils.h"
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    // for 2.8, 3.0 or newer:
+    #include <xml/attribute.h> // needed for RAttributeArray
+#else // for 2.6 or olde
+    #include "Attribute.h"
+#endif
+
+using namespace Xml;
+
+namespace
+    {
+    const TInt KFlatBufSize = 128;
+    }
+
+// ***************************************************************************
+// Fragment class state constants are as following (declared in derivants):
+// KStateNotSet                     = -1;
+// KStateIgnore                     =  0; // even ones ignore(0),
+// KStateSave                       =  1; // and odd ones save(1)
+// KStateResume                     =  2;
+// KStateParsingFramework           =  4;
+// KStateParsingSoapFault           =  5;  // odd, save
+// KStateParsingServiceDescription  =  6;
+// KStateParsingResourceOffering    =  11; // odd, save
+// KStateParsingCredentials         =  12;
+// KStateParsingService             =  13; // odd state, saves content
+// KStateParsingPwTransforms        =  14;
+// KStateParsingSoapHeader          =  20; // ignore state (even num)
+// KStateParsingSoapBody            =  40; // ignore state (even num)
+// KStateParsingSingleCredential    =  122;
+// KStateParsingProviderPolicy      =  1222;
+
+
+EXPORT_C CSenBaseFragment* CSenBaseFragment::NewL( const CSenElement& aElement )
+    {
+    CSenBaseFragment* pNew = new (ELeave) CSenBaseFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aElement);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseFragment* CSenBaseFragment::NewL( const TDesC8& aLocalName )
+    {
+    CSenBaseFragment* pNew = new (ELeave) CSenBaseFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseFragment* CSenBaseFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName
+    )
+    {
+    CSenBaseFragment* pNew = new (ELeave) CSenBaseFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseFragment* CSenBaseFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttrs
+    )
+    {
+    CSenBaseFragment* pNew = new (ELeave) CSenBaseFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttrs);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseFragment* CSenBaseFragment::NewL( const TDesC8& aNsUri,
+                                                   const TDesC8& aLocalName,
+                                                   const TDesC8& aQName,
+                                                   const RAttributeArray& aAttrs,
+                                                   CSenElement& aParent )
+    {
+    CSenBaseFragment* pNew = new (ELeave) CSenBaseFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttrs, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseFragment* CSenBaseFragment::NewL( const TDesC8& aNsUri, 
+                                                   const TDesC8& aLocalName,
+                                                   const TDesC8& aQName )
+    {
+    CSenBaseFragment* pNew = new (ELeave) CSenBaseFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenBaseFragment::~CSenBaseFragment()
+    {
+    if(iElementOwned)
+        {
+        delete ipElement;
+        }
+
+    delete ipDelegate;
+
+    if(ipContentWithNamespaces)
+        {
+        ipContentWithNamespaces->Reset();
+        }
+
+    iNamespaces.Reset(); // not owned
+    iPrefixes.ResetAndDestroy(); // owned copies from parsed values..
+    }
+
+EXPORT_C CSenBaseFragment::CSenBaseFragment()
+: iState(KStateIgnore),
+  ipElement(NULL),
+  iXmlReader(NULL),
+  ipOwner(NULL),
+  ipDelegate(NULL),
+  ipContentWithNamespaces(NULL),
+  hasContentWriteStream(EFalse),
+  iElementOwned(ETrue)
+    {
+    }
+
+EXPORT_C void CSenBaseFragment::BaseConstructL( const CSenElement& aElement )
+    {
+
+    ipElement = CSenXmlElement::NewL(aElement.LocalName());
+    ipElement->CopyFromL((CSenElement&)aElement);
+    }
+
+EXPORT_C void CSenBaseFragment::BaseConstructL( const TDesC8& aLocalName )
+    {
+    ipElement = CSenXmlElement::NewL(aLocalName);
+    }
+
+EXPORT_C void CSenBaseFragment::BaseConstructL( const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName )
+    {
+    ipElement = CSenXmlElement::NewL(aNsUri, aLocalName);
+    }
+
+EXPORT_C void CSenBaseFragment::BaseConstructL( const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& aAttrs )
+    {
+    ipElement = CSenXmlElement::NewL(aNsUri, aLocalName, aQName, aAttrs);
+    }
+
+EXPORT_C void CSenBaseFragment::BaseConstructL( const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& aAttrs,
+                                                CSenElement& aParent )
+    {
+    // this transfers the ipElement ownership to the parent(!)
+    ipElement = CSenXmlElement::NewL(aNsUri, aLocalName, aQName, aAttrs, aParent);
+    }
+
+EXPORT_C void CSenBaseFragment::BaseConstructL( const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName )
+    {
+    ipElement = CSenXmlElement::NewL(aNsUri, aLocalName, aQName);
+    }
+
+// Leaves the the fragment without initialized ipElement
+EXPORT_C void CSenBaseFragment::BaseConstructL( CSenXmlReader& aReader )
+    {
+    iXmlReader = &aReader;
+    }
+
+EXPORT_C CSenElement& CSenBaseFragment::AsElement()
+    {
+    __ASSERT_ALWAYS(ipElement != NULL, User::Panic(KSenXmlPanic, EFragmentElementNotInitialized));
+    return *ipElement;
+    }
+
+EXPORT_C CSenElement* CSenBaseFragment::ExtractElement()
+    {
+    CSenElement* pElement = ipElement;
+    ipElement = NULL;
+    return pElement;
+    }
+
+EXPORT_C CSenXmlReader* CSenBaseFragment::Reader()
+    {
+    return iXmlReader;
+    }
+
+EXPORT_C void CSenBaseFragment::SetReader( CSenXmlReader& aReader )
+    {
+    iXmlReader = &aReader;
+    }
+
+EXPORT_C TInt CSenBaseFragment::BuildFrom( const TDesC8& aBuf )
+    {
+    TRAPD(err, ParseL(aBuf));
+    return err;
+    }
+
+
+EXPORT_C void CSenBaseFragment::ParseL( const TDesC8& aBuf )
+    {
+    iState = KStateIgnore;
+    if(!iXmlReader)
+        {
+        User::Leave(KErrSenXmlReaderNotSet);
+        }
+    iXmlReader->SetContentHandler(*this);
+    iXmlReader->ParseL(aBuf);
+    }
+
+EXPORT_C void CSenBaseFragment::DelegateParsingL(MSenFragment& aDelegate)
+    {
+    // Delegate parsing to a new Fragment, until we encounter 
+    // the end of an element with the given qualified name
+    aDelegate.SetOwner(*this);
+
+    if(!iXmlReader)
+        {
+        User::Leave(KErrSenXmlReaderNotSet);
+        }
+    aDelegate.ParseWithL(*iXmlReader);
+    }
+
+EXPORT_C void CSenBaseFragment::DelegateParsingL( const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aQName,
+                                                  const RAttributeArray& aAttrs )
+    {
+    // Delegate parsing to a new Fragment, until we encounter the end of an
+    // element with the given qualified name
+    __ASSERT_ALWAYS( ipDelegate == NULL, User::Panic(KSenXmlPanic, EDelegatedFragmentAlreadySet) );
+    ipDelegate = CSenBaseFragment::NewL(aNsUri, aLocalName, aQName);
+
+    ipDelegate->SetAttributesL(aAttrs);
+    DelegateParsingL(*ipDelegate);
+    }
+
+EXPORT_C void CSenBaseFragment::ParseWithL(CSenXmlReader& aReader)
+    {
+    iXmlReader = &aReader;
+    iState = KStateSave;
+    iXmlReader->SetContentHandler(*this);
+    }
+
+EXPORT_C void CSenBaseFragment::SetOwner(MSenFragment& aFragment)
+    {
+    ipOwner = &aFragment;
+    AsElement().SetParent(&aFragment.AsElement());
+    }
+
+EXPORT_C void CSenBaseFragment::ResumeParsingFromL( const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aQName )
+    {
+    if(!iXmlReader)
+        {
+        User::Leave(KErrSenXmlReaderNotSet);
+        }
+
+    // listen to content handler
+    iXmlReader->SetContentHandler(*this);
+    
+    // Destroy delegate
+    if (ipDelegate)
+        {
+        CSenElement* pElement = ipDelegate->ExtractElement();
+        CleanupStack::PushL(pElement); // IOP
+        ipElement->AddElementL(*pElement);
+        CleanupStack::Pop(); // pElement;
+        delete ipDelegate; // free memory
+        ipDelegate = NULL;
+        }
+    
+    
+    TInt currentState = KStateNotSet; // == -1
+    if(ipElement)
+        {
+        const TDesC8& localName = ipElement->LocalName();
+        const TDesC8& nsUri = ipElement->NamespaceURI();
+    
+        if(localName == aLocalName  && nsUri == aNsUri)
+            {
+            currentState = iState;
+            // Before calling EndElementL, which may execute
+            // unpredictable amount of code in derivants, the
+            // the state must be set to "ignore"
+            iState = KStateResume;
+            }
+        }
+    
+    EndElementL(aNsUri, aLocalName, aQName); // 2004-07-17
+    // now check if current state was to be preserved
+    if(currentState!=KStateNotSet) // IOP
+        {
+        // restore the state preserved prior to
+        // "set ignore for endelement" -case
+        iState = currentState;
+        }
+    }
+
+EXPORT_C void CSenBaseFragment::StartElementL( const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aQName,
+                                               const RAttributeArray& aAttrs )
+    {
+    // 2004-09-10: check & alloc moved out
+    // from KStateIgnore case code segment below (where in Java)
+    if(!ipElement)
+        {
+        ipElement = CSenXmlElement::NewL( aNsUri, aLocalName, aQName );
+        }
+
+    // we can assume, that ipElement is not NULL
+    const TDesC8& localName = ipElement->LocalName();
+    const TDesC8& nsUri = ipElement->NamespaceURI();
+    if(iState == KStateIgnore)
+        {
+        if(localName == aLocalName && nsUri == aNsUri) 
+            {
+            iState = KStateSave;
+            SetAttributesL(aAttrs);
+            }
+        }
+    else if((iState & KStateSave) == KStateSave)
+        {
+        if(localName == aLocalName && nsUri == aNsUri)
+            {
+            // start a new BaseFragment otherwise we loose
+            // track of nested elements with the same name
+            DelegateParsingL(aNsUri, aLocalName, aQName, aAttrs);
+            }
+        else
+            {
+            WriteStartElementL(aNsUri, aLocalName, aQName, aAttrs);
+            }
+        }
+    }
+
+EXPORT_C void CSenBaseFragment::EndElementL( const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName )
+    {
+    AllocContentSaverL();
+    const TDesC8& localName = ipElement->LocalName();
+    const TDesC8& nsUri = ipElement->NamespaceURI();
+
+    if(localName == aLocalName && nsUri == aNsUri)
+        {
+        if(iState != KStateResume && ipOwner)
+            {
+            ipOwner->ResumeParsingFromL(aNsUri, aLocalName, aQName);
+            return; // This is mandatory, since ResumeParsingFromL 
+                    // de-allocates delegate fragment!
+            }
+        iState = KStateIgnore;
+        }
+    if((iState & KStateSave) == KStateSave)
+        {
+        WriteEndElementL(aNsUri, aLocalName, aQName);
+        }
+    }
+
+// Closely the same as the code in Java ref-impl's BaseElement.append()
+EXPORT_C void CSenBaseFragment::CharactersL( const TDesC8& aChars,
+                                             TInt /*aStart*/,
+                                             TInt /*aLength*/ )
+    {
+    if((iState & KStateSave) == KStateSave)
+        {
+        AllocContentSaverL(); // get iWs if it is NULL
+
+        HBufC8* pCharsCopy = NULL;
+
+        if (SenXmlUtils::EncodeHttpCharactersL(aChars, pCharsCopy))
+            {
+            CleanupStack::PushL(pCharsCopy);
+            iWs.WriteL(*pCharsCopy);
+            CleanupStack::PopAndDestroy(); // pCharsCopy
+            }
+        else
+            {
+            iWs.WriteL(aChars);
+            }
+        }
+    }
+
+EXPORT_C void CSenBaseFragment::SetAttributesL( const RAttributeArray& aAttrs )
+    {
+    SaveNamespacesL(aAttrs, ETrue);
+    // Otherwise ignore attributes, these are up to the subclass to deal with.
+    }
+
+EXPORT_C void CSenBaseFragment::AllocContentSaverL()
+    {
+    if(!hasContentWriteStream)
+        {
+        iWs = ipElement->ContentWriteStreamL();
+        hasContentWriteStream = ETrue;
+        }
+    }
+
+EXPORT_C TInt CSenBaseFragment::StartDocument()
+    {
+    return 1;
+    }
+
+EXPORT_C TInt CSenBaseFragment::EndDocument()
+    {
+    if ( hasContentWriteStream )
+        {
+        hasContentWriteStream = EFalse;
+        iWs.Close();
+        }
+        
+    if (ipElement) ((CSenXmlElement*)ipElement)->Compress();
+    return 1;
+    }
+
+EXPORT_C TInt CSenBaseFragment::StartElement( const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& aAttrs )
+    {
+    TRAPD(err, StartElementL(aNsUri, aLocalName, aQName, aAttrs));
+    return (err == KErrNone);
+    }
+
+EXPORT_C TInt CSenBaseFragment::EndElement( const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName )
+    {
+    TRAPD(err, EndElementL(aNsUri, aLocalName, aQName));
+    return (err == KErrNone);
+    }
+
+EXPORT_C TInt CSenBaseFragment::Characters( const TDesC8& aChars,
+                                            const TInt aStart,
+                                            const TInt aLength)
+    {
+    TRAPD(err, CharactersL(aChars, aStart, aLength));
+    return (err == KErrNone);
+    }
+
+EXPORT_C void CSenBaseFragment::ResetContentL()
+    {
+    AsElement().SetContentL(KNullDesC8);
+    // iPrefixes.Reset();   // contents not owned, clearing is enough // 2005-09-26: wouldn't this leak memory?
+    iPrefixes.ResetAndDestroy(); // owned copies from parsed values..
+    iNamespaces.Reset(); // contents not owned, clearing is enough
+    }
+
+EXPORT_C TPtrC8 CSenBaseFragment::Content()
+    {
+    TPtrC8 retVal;
+    TRAPD(err, retVal.Set(ContentL());)
+
+    if (err != KErrNone)
+        {
+        retVal.Set(KNullDesC8);
+        }
+    return retVal;
+    }
+
+TPtrC8 CSenBaseFragment::ContentL()
+    {
+    TPtrC8 content = AsElement().Content();
+
+    TInt nsCount(iNamespaces.Count());
+    if(nsCount>0)
+        {
+        TInt i = content.Locate('>');
+        if( i > -1 )
+            {
+            if(!ipContentWithNamespaces)
+                {
+                ipContentWithNamespaces = CBufFlat::NewL(KFlatBufSize);
+                }
+            else
+                {
+                ipContentWithNamespaces->Reset(); //discard the old data in buf
+                }
+
+            i--; // make sure we are before a possible "/>"
+            TInt cut = i;
+            RBufWriteStream ws;
+            CleanupClosePushL(ws);
+            ws.Open(*ipContentWithNamespaces);
+            ws.WriteL(content.Left(cut));
+            for(TInt n=0; n<nsCount; n++)
+                {
+                CSenNamespace* pNamespace = (CSenNamespace*)iNamespaces[i];
+                pNamespace->InsertL(ws);
+                }
+            ws.WriteL(content.Mid(cut));
+            CleanupStack::PopAndDestroy(); // RBufWriteStream.Close() for ws
+            TPtr8 p8 = ipContentWithNamespaces->Ptr(0);
+            return p8;
+            }
+        }
+        else
+            {
+            return content;
+            }
+    return content;
+    }
+
+EXPORT_C HBufC* CSenBaseFragment::AsXmlUnicodeL()
+    {
+    return AsElement().AsXmlUnicodeL();
+    }
+
+EXPORT_C HBufC8* CSenBaseFragment::AsXmlL()
+    {
+    return AsElement().AsXmlL();
+    }
+
+EXPORT_C void CSenBaseFragment::WriteAsXMLToL( RWriteStream& aWs )
+    {
+    AsElement().WriteAsXMLToL( aWs );
+    }
+
+EXPORT_C TPtrC8 CSenBaseFragment::ContentOf( const TDesC8& aLocalName )
+    {
+    CSenElement* child = this->AsElement().Element(aLocalName);
+    if(child)
+        {
+        return child->Content();
+        }
+    return KNullDesC8();
+    }
+
+EXPORT_C MSenElement& CSenBaseFragment::SetContentOfL( const TDesC8& aLocalName,
+                                                       const TDesC8& aContent )
+    {
+    CSenElement* pChildElement = AsElement().Element( aLocalName );
+    if(!pChildElement)
+        {
+        // Add new element
+        pChildElement =  &AsElement().AddElementL(aLocalName);
+        }
+    pChildElement->SetContentL(aContent);
+    return *pChildElement;
+    }
+
+EXPORT_C void CSenBaseFragment::WriteStartElementL( const TDesC8& /* aNsUri */,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aQName,
+                                                    const RAttributeArray& aAttrs )
+    {
+    AllocContentSaverL();
+
+    // Write element name with namespace
+    iWs.WriteL(KSenLessThan);
+    if (aQName != KNullDesC8)
+        {
+        iWs.WriteL(aQName);
+        }
+    else
+        {
+        iWs.WriteL(aLocalName);
+        }
+
+    // Write attributes, if any
+    HBufC8* pQName = NULL;
+    TInt attCount(aAttrs.Count());
+    for (TInt i = 0; i < attCount; i++)
+            {
+        TPtrC8 prefix = aAttrs[i].Attribute().Prefix().DesC();
+        TPtrC8 lAttName = aAttrs[i].Attribute().LocalName().DesC();
+        TPtrC8 attValue = aAttrs[i].Value().DesC();
+        
+        TPtrC8 qAttName = lAttName;
+        if(prefix!=KNullDesC8)
+            {
+            pQName = HBufC8::NewLC( prefix.Length()
+                        +KSenColon().Length()
+                        +lAttName.Length());
+            TPtr8 qname = pQName->Des();
+            qname.Append(prefix);
+            qname.Append(KSenColon);
+            qname.Append(lAttName);
+            qAttName.Set(qname);
+            }
+        
+        
+        iWs.WriteL(KSenSpace);
+        iWs.WriteL(qAttName); // this is localname if no qualifier is set
+        iWs.WriteL(KSenEqualsDblQuot);
+        iWs.WriteL(attValue);
+        iWs.WriteL(KSenDblQuot);
+        
+        TInt colon(KErrNotFound);
+        colon = qAttName.Locate(':');
+        // We check for namespaces declared here and for prefixes 
+        // in attribute names and values.
+        if (qAttName == KSenXmlns || lAttName == KSenXmlns)
+            {
+            // locally declared default namespace, 
+            // no need to do anything special
+            }
+        else if(prefix == KSenXmlns) // was SenXmlUtils::StartsWith(...)
+            {
+            //locally declared prefix, remember that this prefix is OK
+            HBufC8* pAttName = lAttName.AllocL();
+            CleanupStack::PushL(pAttName);
+#ifdef EKA2
+            iPrefixes.AppendL(pAttName);
+#else
+            User::LeaveIfError(iPrefixes.Append(pAttName));
+#endif
+            CleanupStack::Pop(); // pAttName
+            }
+        else if(colon != KErrNotFound)
+            {
+            //a qualified attribute name, ensure we have its namespace
+            EnsureNamespace(qAttName.Left(colon));
+            }
+        
+        colon = attValue.Locate(':');
+        if(colon != KErrNotFound)
+            {
+            //encountered a qualified value, should ensure the namespace for
+            //its prefix is included.
+            EnsureNamespace(attValue.Left(colon));
+            }
+        if(prefix!=KNullDesC8)
+            {       
+            CleanupStack::PopAndDestroy(); // qAttName
+            pQName = NULL;
+            }
+        }
+
+    iWs.WriteL(KSenGreaterThan);
+
+
+    if(aQName != KNullDesC8)
+        {
+        TInt colon(aQName.Locate(':'));
+        if(colon != KErrNotFound)
+            {
+            EnsureNamespace(aQName.Left(colon));
+            }
+        }
+
+    // Is this truly required!?
+    if(aLocalName != KNullDesC8)
+        {
+        TInt colon(aLocalName.Locate(':'));
+        if(colon != KErrNotFound)
+            {
+            EnsureNamespace(aLocalName.Left(colon));
+            }
+        }
+    
+    }
+
+EXPORT_C void CSenBaseFragment::WriteEndElementL( const TDesC8& /* aNsUri */,
+                                                  const TDesC8& /* aLocalName */,
+                                                  const TDesC8& aQName )
+    {
+    AllocContentSaverL();
+    iWs.WriteL(KSenLessThanSlash);
+    iWs.WriteL(aQName);
+    iWs.WriteL(KSenGreaterThan);
+    }
+
+EXPORT_C void CSenBaseFragment::EnsureNamespace( const TDesC8& aPrefix )
+    {
+    /* Check that the prefix has been declared.
+     * If not try to find a namespace declaration for it
+     * in the element.
+     */
+    TInt pos(KErrNotFound);
+    TInt count(iPrefixes.Count());
+    for(TInt i=0; i<count && pos == KErrNotFound; i++)
+        {
+        if(*iPrefixes[i] == aPrefix)
+            {
+            pos = i;
+            break;
+            }
+        }
+
+    if (pos == KErrNotFound)
+        {
+        const CSenNamespace* pNamespace = Namespace(aPrefix);
+        if (!pNamespace)
+            {
+            pNamespace = ipElement->Namespace(aPrefix);
+
+            if (pNamespace)
+                {
+                iNamespaces.Append(pNamespace); // no need for copying
+                }
+            }
+        }
+    }
+
+EXPORT_C CSenNamespace* CSenBaseFragment::Namespace( const TDesC8& aPrefix )
+    {
+    if (aPrefix.Length() == 0) return NULL;
+
+    CSenNamespace* pNamespace = NULL;
+    TInt count(iNamespaces.Count());
+    for (TInt i=0; i<count && !pNamespace; i++)
+        {
+        pNamespace = (CSenNamespace*) iNamespaces[i];
+        if (pNamespace->Prefix() != aPrefix) pNamespace = NULL;
+        }
+
+    return pNamespace;
+    }
+
+EXPORT_C void CSenBaseFragment::DetachL()
+    {
+    //First add all the namespaces referred to in the content.
+    if (iNamespaces.Count() > 0)
+        {
+        TInt count(iNamespaces.Count());
+        for (TInt i=0; i<count; i++)
+            {
+            CSenNamespace* pNamespace = (CSenNamespace*) iNamespaces[i];
+            ipElement->AddNamespaceL(*pNamespace, EFalse);
+            //TRAPD(err, ipElement->AddNamespaceL(*pNamespace, EFalse));
+            //if (err) ;
+            }
+        }
+    //Detach the element from its parent.
+    ipElement->DetachL();
+    }
+
+EXPORT_C void CSenBaseFragment::SaveNamespacesL( const RAttributeArray& aAttrs,
+                                                 TBool aEnsure )
+    {
+    // we check for namespace declarations in here
+    // for prefixes in attribute names and values.
+
+    if (ipElement)
+        {
+        CSenElement* pElement = (CSenXmlElement*)ipElement;
+
+        TInt colon = KErrNotFound;
+        TInt length(aAttrs.Count());
+
+        for (TInt i=0; i<length; i++)
+            {
+            TPtrC8 localName = aAttrs[i].Attribute().LocalName().DesC();
+            TPtrC8 value = aAttrs[i].Value().DesC();
+            TPtrC8 prefix = aAttrs[i].Attribute().Prefix().DesC();
+            
+            if (localName == KSenXmlns())
+                {
+                // this is a default name space declaration
+                pElement->SetNamespaceL(value);
+                }
+            else if (localName == pElement->NsPrefix())
+                {
+                //we have a new declaration for the namespace of this element
+                pElement->SetNamespaceL(localName,value);
+                }
+            else if (prefix == KSenXmlns())
+                {
+                // we have an additional namespace declaration
+                pElement->AddNamespaceL(localName,value);
+                }
+
+            if (aEnsure)
+                {
+                //colon = qualifiedName.Locate(':');
+                //if (colon > -1)
+                if(localName!=KNullDesC8)
+                    {
+                    // attribute name is prefixed so ensure we have its
+                    // namespace
+                    //EnsureNamespace(qualifiedName.Mid(0,colon));
+
+                    // attribute's name is elements prefix! // 2005-02-22
+                    EnsureNamespace(localName);
+                    }
+
+                colon = value.Locate(':');
+                if (colon > -1)
+                    {
+                    // attribute value is prefixed so ensure we have that
+                    // namespace
+                    EnsureNamespace(value.Mid(0,colon));
+                    }
+                }
+            }
+        }
+    }
+
+
+// New
+EXPORT_C const TDesC8& CSenBaseFragment::LocalName() const
+    {
+    __ASSERT_ALWAYS(ipElement != NULL, User::Panic(KSenXmlPanic, EFragmentElementNotInitialized));
+    return ipElement->LocalName();
+    }
+
+EXPORT_C const TDesC8& CSenBaseFragment::NsUri() const
+    {
+    __ASSERT_ALWAYS(ipElement != NULL, User::Panic(KSenXmlPanic, EFragmentElementNotInitialized));
+    return ipElement->NamespaceURI();
+    }
+
+EXPORT_C const TDesC8& CSenBaseFragment::NsPrefix() const
+    {
+    __ASSERT_ALWAYS(ipElement != NULL, User::Panic(KSenXmlPanic, EFragmentElementNotInitialized));
+    return ipElement->NsPrefix();
+    }
+
+// Do NOT change method signature; BC must be kept!
+EXPORT_C TInt CSenBaseFragment::StartEntity( TDesC8& aName )
+    {
+#ifndef SYMBIAN_SECURE_ECOM        
+    // This segment is required with Compact XML reader
+    TInt leaveCode(KErrNone);
+    if((iState & KStateSave) == KStateSave)
+        {
+        TRAP(leaveCode, AllocContentSaverL());
+        if(leaveCode==KErrNone)
+            {
+            TRAP(leaveCode, iWs.WriteL(aName));
+            }
+        }
+    if(leaveCode==KErrNone)
+        {
+        return ETrue; // success
+        }
+    else
+        {
+        return EFalse; // failure
+        }
+#else // SYMBIAN_SECURE_ECOM       
+    aName.Length();
+    return KErrNone; // signal was successfully handled
+#endif // SYMBIAN_SECURE_ECOM    
+    }
+
+
+EXPORT_C TInt CSenBaseFragment::Error( TInt /* aErrorCode */ )
+    {
+    //return aErrorCode;
+    return KErrNone; // Error was "successfully" handled
+    }
+
+EXPORT_C TBool CSenBaseFragment::ConsistsOfL( MSenFragment& aCandidate )
+    {
+    return AsElement().ConsistsOfL(aCandidate.AsElement());
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/sendomfragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,326 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenXmlElement.h"
+#include "SenDomFragment.h"
+#include "SenXmlConstants.h"
+#include "SenXmlUtils.h"
+#include "senxmldebug.h"
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL()
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL(const CSenElement& aElement)
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aElement);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL(const TDesC8& aLocalName)
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName
+    )
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttrs
+    )
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttrs);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    /* NOT IN JAVA */
+    const RAttributeArray& aAttrs,
+    CSenElement& aParent
+    )
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttrs, aParent);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment* CSenDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CSenDomFragment* pNew = new (ELeave) CSenDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    CleanupStack::Pop(); // delete pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenDomFragment::~CSenDomFragment()
+    {
+    if(ipDomDelegate)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipDomDelegate->ExtractElement();
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+    }
+
+EXPORT_C CSenDomFragment::CSenDomFragment()
+:ipDomDelegate(NULL)
+    {
+    }
+
+EXPORT_C void CSenDomFragment::BaseConstructL(const CSenElement& aElement)
+    {
+    CSenBaseFragment::BaseConstructL(aElement);
+    }
+
+EXPORT_C void CSenDomFragment::BaseConstructL(const TDesC8& aLocalName)
+    {
+    CSenBaseFragment::BaseConstructL(aLocalName);
+    }
+
+EXPORT_C void CSenDomFragment::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName
+    )
+    {
+    CSenBaseFragment::BaseConstructL(aNsUri, aLocalName);
+    }
+
+EXPORT_C void CSenDomFragment::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttrs
+    )
+    {
+    CSenBaseFragment::BaseConstructL(aNsUri, aLocalName, aQName, aAttrs);
+    }
+
+EXPORT_C void CSenDomFragment::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttrs,
+    CSenElement& aParent
+    )
+    {
+    CSenBaseFragment::BaseConstructL(   aNsUri,
+                                        aLocalName,
+                                        aQName,
+                                        aAttrs,
+                                        aParent);
+    }
+
+EXPORT_C void CSenDomFragment::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CSenBaseFragment::BaseConstructL(aNsUri, aLocalName, aQName);
+    }
+
+
+EXPORT_C void CSenDomFragment::BaseConstructL(CSenXmlReader& aReader)
+    {
+    CSenBaseFragment::BaseConstructL(aReader);
+    }
+
+
+EXPORT_C void CSenDomFragment::ParseWithL(CSenXmlReader& aReader) // IOP
+    {
+    CSenBaseFragment::ParseWithL(aReader);
+    iState = KStateSave; // IOP
+    }
+
+EXPORT_C void CSenDomFragment::StartElementL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttrs)
+    {
+
+    // 2004-09-10. moved out from KStateIgnore -code segment
+    if(!ipElement)
+        {
+        ipElement = CSenXmlElement::NewL(aNsUri, aLocalName, aQName);
+        }
+    AllocContentSaverL();
+
+    if(iState == KStateIgnore)
+        {
+        const TDesC8& localName = ipElement->LocalName();
+        const TDesC8& nsUri = ipElement->NamespaceURI();
+
+        if(localName == aLocalName && nsUri == aNsUri)
+            {
+            iState = KStateSave; // IOP
+            SetAttributesL(aAttrs);
+            }
+        }
+    else if((iState & KStateSave) == KStateSave)
+        {
+        ExpandL(aNsUri, aLocalName, aQName, aAttrs);
+        }
+    }
+
+EXPORT_C void CSenDomFragment::CharactersL(
+    const TDesC8& aChars,
+    const TInt /*aStart*/,
+    const TInt /*aLength*/
+    )
+    {
+    AllocContentSaverL();
+
+
+    HBufC8* pCharsCopy = NULL;
+    
+    if (SenXmlUtils::EncodeHttpCharactersL(aChars, pCharsCopy))
+        {
+        CleanupStack::PushL(pCharsCopy);
+        iWs.WriteL(*pCharsCopy);
+        CleanupStack::PopAndDestroy(); // pCharsCopy
+        }
+    else
+        {
+        iWs.WriteL(aChars);
+        }
+    }
+
+EXPORT_C void CSenDomFragment::SetAttributesL(const RAttributeArray& aAttrs)
+    {
+    CSenBaseFragment::SetAttributesL(aAttrs);
+    if(ipElement)
+        {
+        ((CSenXmlElement*)ipElement)->SetAttributesL(aAttrs);
+        }
+    }
+
+EXPORT_C void CSenDomFragment::ExpandL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttrs
+    )
+    {
+
+    if(ipDomDelegate)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipDomDelegate->ExtractElement();
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+
+    // delegate parsing to a new DOMFragment,
+    // until we encounter the end of an element with the given qualified name
+    ipDomDelegate = CSenDomFragment::NewL(  aNsUri,
+                                            aLocalName,
+                                            aQName,
+                                            aAttrs,
+                                            *ipElement);
+
+    ipElement->AddElementL(ipDomDelegate->AsElement());
+
+    DelegateParsingL(*ipDomDelegate); // note that the parsing is actually
+                                      // performed AFTER the StartElement()
+                                      // method, which called this ExpandL()
+                                      // has been fully executed (this is an
+                                      // async signal send to the _same_
+                                      // parser(!)
+    }
+
+
+EXPORT_C void CSenDomFragment::WriteStartElementL(
+                                               const TDesC8& /* aNsUri */,
+                                               const TDesC8& /* aLocalName */,
+                                               const TDesC8& /* aQName */,
+                                               const RAttributeArray& /*aAttrs*/
+                                                   )
+    {
+    // in DOM fragment: do nothing
+    }
+
+EXPORT_C void CSenDomFragment::WriteEndElementL(
+                                             const TDesC8& /* aNsUri */,
+                                             const TDesC8& /* aLocalName */,
+                                             const TDesC8& /* aQName */
+                                                 )
+    {
+    // in DOM fragment: do nothing
+    }
+
+
+// Overridden from CSenBaseFragment to be much more simple
+EXPORT_C void CSenDomFragment::ResumeParsingFromL( // IOP
+                                               const TDesC8& /*aNsUri*/,
+                                               const TDesC8& /*aLocalName*/,
+                                               const TDesC8& /*aQName*/
+                                                   )
+    {
+    iXmlReader->SetContentHandler(*this);
+    if(ipDomDelegate)
+        {
+        // We do not own the element, so remove it from the fragment.
+        ipDomDelegate->ExtractElement();
+        delete ipDomDelegate;
+        ipDomDelegate = NULL;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senfiltercondition.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDES
+
+#include "SenFilterCondition.h"
+
+#include "SenDebug.h"
+#include "SenLogger.h"
+
+
+_LIT(KLogFileDir, "WsLog");
+_LIT(KLogFileName, "SenXml.log");
+
+// -------------------------------------------
+//
+// Implementation of class CSenFilterCondition
+//
+// -------------------------------------------
+
+
+EXPORT_C CSenFilterCondition* CSenFilterCondition::NewL(TInt aIndex, 
+                                                        const TDesC8& aElement, 
+                                                        const TDesC8& aAttribute)
+{
+    CSenFilterCondition* pNew = new (ELeave) CSenFilterCondition;
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aIndex, 
+                     aElement, 
+                     aAttribute);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+}
+
+
+void CSenFilterCondition::ConstructL(TInt aIndex, 
+                                     const TDesC8& aElement, 
+                                     const TDesC8& aAttribute)
+{
+    iIndex = aIndex;
+    ipElement = aElement.AllocL();
+    ipAttribute = aAttribute.AllocL();
+}
+
+
+CSenFilterCondition::CSenFilterCondition()
+: ipElement(NULL),
+  ipAttribute(NULL)
+{
+		TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterCondition::CSenFilterCondition(): Log opened"));
+
+    iCurrentIndex = -1;
+    iIndex = 0;
+
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterCondition::CSenFilterCondition(): End"));
+}
+
+
+CSenFilterCondition::CSenFilterCondition(const CSenFilterCondition& aFilterCondition)
+{
+    iIndex = aFilterCondition.iIndex;
+    iCurrentIndex = aFilterCondition.iCurrentIndex;
+    
+    if (NULL == aFilterCondition.ipElement) {
+        ipElement = NULL;
+    } else {
+        ipElement = aFilterCondition.ipElement->Alloc();
+    }
+    
+    if (NULL == aFilterCondition.ipAttribute) {
+        ipAttribute = NULL;
+    } else {
+        ipAttribute = aFilterCondition.ipAttribute->Alloc();
+    }
+}
+
+
+EXPORT_C CSenFilterCondition::~CSenFilterCondition()
+{
+    delete ipElement;
+    delete ipAttribute;
+
+    // Close the log file and the connection to the server.
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L("Log file closed."));
+		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+EXPORT_C TBool CSenFilterCondition::Test()
+{
+    TBool test = EFalse;
+    if ( ++iCurrentIndex == iIndex )
+    {
+        test = ETrue;
+    }
+
+    return test;
+}
+
+
+RFileLogger* CSenFilterCondition::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senfilterfragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,278 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include "SenXmlUtils.h"
+
+#include "SenFilterFragment.h"
+
+#include "SenDebug.h"
+#include "SenLogger.h"
+
+
+_LIT(KLogFileDir, "WsLog");
+_LIT(KLogFileName, "SenXml.log");
+
+// ------------------------------------------
+//
+// Implementation of class CSenFilterFragment
+//
+// ------------------------------------------
+
+
+EXPORT_C CSenFilterFragment::CSenFilterFragment()
+: ipCollector(NULL),
+  //iRoot(NULL),
+  ipFsm(new CSenFilterStateMachine()),
+  ipPropertyName(NULL),
+  ipPropertyValue(NULL),
+  ipNewP(NULL),
+  ipPutP(NULL)
+{
+		TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterFragment::CSenFilterFragment(): Log opened"));
+
+    //ipPropertyValue = NULL;
+
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterFragment::CSenFilterFragment(): End"));
+}
+
+
+EXPORT_C CSenFilterFragment::~CSenFilterFragment()
+{
+    delete ipFsm;
+    delete ipPropertyName;
+    delete ipPropertyValue;
+    delete ipNewP;
+    delete ipPutP;
+
+    // Close the log file and the connection to the server.
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L("Log file closed."));
+		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+EXPORT_C void CSenFilterFragment::SetCollector(MSenFilterCollector& aCollector)
+{
+    ipCollector = &aCollector;
+
+    if ( ipNewP != NULL ) delete ipNewP;
+    ipNewP = new CSenFilterNewProperty(aCollector);
+
+    if ( ipPutP != NULL ) delete ipPutP;
+    ipPutP = new CSenFilterPutProperty(aCollector);
+}
+
+
+EXPORT_C void CSenFilterFragment::StartElementL(const TDesC8& aNamespaceURI, 
+                                                const TDesC8& aLocalName, 
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& aAttributes)
+{
+    ipFsm->StartElementL(aLocalName, aAttributes);
+}
+
+
+EXPORT_C void CSenFilterFragment::CharactersL(const TDesC8& aCh, 
+                                              TInt aStart, 
+                                              TInt aLength)
+{
+    HBufC8* buf;
+    TInt bufLen;
+
+    if ( NULL == ipPropertyValue )
+    {
+        bufLen = (KBufferAllocationBlocks > aLength) ? KBufferAllocationBlocks : aLength;
+        buf = HBufC8::NewLC(bufLen);
+    } else {
+
+        bufLen = ipPropertyValue->Length() + ((KBufferAllocationBlocks > aLength) ? KBufferAllocationBlocks : aLength);           
+        buf = ipPropertyValue->ReAllocL(bufLen);
+        CleanupStack::PushL(buf); 
+        //User::LeaveIfError(buf->Append(ipPropertyValue->Ptr(), ipPropertyValue->Length()));
+        //CleanupStack::Pop(buf);      
+        //delete ipPropertyValue;
+    }
+
+    ipPropertyValue = buf;
+
+    CleanupStack::Pop(); // buf
+
+    TPtr8 bufPtr = (ipPropertyValue->Des());
+    bufPtr.Append(aCh.Mid(aStart, aLength));
+
+}
+
+
+EXPORT_C void CSenFilterFragment::EndElementL(const TDesC8& aNamespaceURI, 
+                                              const TDesC8& aLocalName, 
+                                              const TDesC8& aQName)
+{
+    ipFsm->EndElementL(aLocalName);
+}
+
+
+EXPORT_C TInt CSenFilterFragment::BuildFrom(const TDesC8& aString)
+{
+    ipCollector->Initialize();
+    return CSenBaseFragment::BuildFrom(aString);
+}
+
+
+EXPORT_C CSenFilterStateNode& 
+CSenFilterFragment::AddFilterLC(CSenFilterStateNode& aNode, 
+                               const TDesC8& aLocalName)
+{
+    iRoot = ipFsm->AddChildLC(aNode, 
+                            aLocalName,
+                            *CSenFilterCondition::NewL(0, KNullDesC8(), KNullDesC8()), 
+                            (MSenFilterAction &)ipNewP,
+                            (MSenFilterAction &)ipPutP);
+    return *iRoot;
+}
+
+
+EXPORT_C CSenFilterStateNode& 
+CSenFilterFragment::AddRootFilterLC(const TDesC8& aLocalName)
+{
+    iRoot = ipFsm->AddParentLC(aLocalName,
+                            *CSenFilterCondition::NewL(0, KNullDesC8(), KNullDesC8()), 
+                            (MSenFilterAction &)ipNewP,
+                            (MSenFilterAction &)ipPutP);
+    return *iRoot;
+}
+
+
+EXPORT_C void CSenFilterFragment::CompileL()
+{
+    ipFsm->CompileL(*iRoot);
+}
+
+
+RFileLogger* CSenFilterFragment::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+// ---------------------------------------------
+//
+// Implementation of class CSenFilterNewProperty
+//
+// ---------------------------------------------
+
+EXPORT_C CSenFilterNewProperty::CSenFilterNewProperty(MSenFilterCollector& aCollector)
+:ipCol(&aCollector)
+{
+		TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterNewProperty::CSenFilterNewProperty(): Log opened"));
+
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterNewProperty::CSenFilterNewProperty(): End"));
+}
+
+
+EXPORT_C CSenFilterNewProperty::~CSenFilterNewProperty()
+{
+
+    // Close the log file and the connection to the server.
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , (_L("Log file closed.")));
+		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+EXPORT_C void CSenFilterNewProperty::PerformL(const TDesC8& aEvent, 
+                                              const RAttributeArray& aAttributes)
+{
+    //ipPropertyValue = new StringBuffer();
+    //System.out.println("Selected new property: " + aEvent);
+    ipCol->PutElementL(aEvent, aAttributes);
+}
+
+
+RFileLogger* CSenFilterNewProperty::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+// ---------------------------------------------
+//
+// Implementation of class CSenFilterPutProperty
+//
+// ---------------------------------------------
+
+CSenFilterPutProperty::CSenFilterPutProperty(MSenFilterCollector& aCollector)
+: ipCol(&aCollector),
+  ipPropertyValue(NULL)
+{
+		TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterPutProperty::CSenFilterPutProperty(): Log opened"));
+
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterPutProperty::CSenFilterPutProperty(): End"));
+}
+
+
+CSenFilterPutProperty::~CSenFilterPutProperty()
+{
+    delete ipPropertyValue;
+
+    // Close the log file and the connection to the server.
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , (_L("Log file closed.")));
+		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+void CSenFilterPutProperty::SetPropertyValueL(const TDesC8& aPropertyValue)
+{
+    ipPropertyValue = aPropertyValue.AllocL();
+} 
+
+
+void CSenFilterPutProperty::PerformL(const TDesC8& aEvent, 
+                                     const RAttributeArray& aAttributes)
+{
+    //System.out.println("Putting property: " + aEvent);
+    //TPtrC8 valueString = NULL;
+    //        if ( ipVal->Length() > 0 )
+    //{
+    //    valueString = ipVal->Des();
+    //  System.out.println("  Value is: " +  valueString);
+    //}
+
+    ipCol->PutL(aEvent, *ipPropertyValue);
+
+    if ( ipPropertyValue != NULL )
+    {
+        delete ipPropertyValue;
+        ipPropertyValue = NULL;
+    }
+} 
+
+
+RFileLogger* CSenFilterPutProperty::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senfilterstatemachine.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,430 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include "SenFilterCondition.h"
+
+#include "SenFilterStateMachine.h"
+
+#include "SenDebug.h"
+#include "SenLogger.h"
+
+
+_LIT(KLogFileDir, "WsLog");
+_LIT(KLogFileName, "SenXml.log");
+
+// ----------------------------------------------
+//
+// Implementation of class CSenFilterStateMachine
+//
+// ----------------------------------------------
+
+
+EXPORT_C CSenFilterStateMachine::CSenFilterStateMachine()
+: iStateTable(ETrue, ETrue)
+{
+    TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterStateMachine::CSenFilterStateMachine(): Log opened"));
+
+    iStates = 0;
+    iFilterState = 0;
+
+		TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel ,  _L8("CSenFilterStateMachine::CSenFilterStateMachine(): End"));
+} 
+
+
+EXPORT_C CSenFilterStateMachine::~CSenFilterStateMachine()
+{
+    iStateTable.Reset();
+
+    // Close the log file and the connection to the server.
+  	TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel ,  (_L("Log file closed.")));
+		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+/* Add a node to the state tree */
+EXPORT_C CSenFilterStateNode* 
+CSenFilterStateMachine::AddChildLC(CSenFilterStateNode& aStartState,
+                                 const TDesC8& aEvent, 
+                                 const CSenFilterCondition& aCondition,
+                                 MSenFilterAction& aStartAction,
+                                 MSenFilterAction& aEndAction)
+{
+    CSenFilterStateNode* newNode = new CSenFilterStateNode(aEvent, 
+                                                           aCondition, 
+                                                           aStartAction, 
+                                                           aEndAction, 
+                                                           *this);
+
+    CleanupStack::PushL(newNode);
+    newNode->SetParent(aStartState);
+
+    // Array takes care of memory deallocation
+    aStartState.Children().Append(newNode);
+
+    return newNode;
+}
+
+
+/* Add the root node to the state tree */
+EXPORT_C CSenFilterStateNode* 
+CSenFilterStateMachine::AddParentLC(const TDesC8& aEvent, 
+                                 const CSenFilterCondition& aCondition,
+                                 MSenFilterAction& aStartAction,
+                                 MSenFilterAction& aEndAction)
+{
+    CSenFilterStateNode* newNode = new CSenFilterStateNode(aEvent,
+                                                           aCondition, 
+                                                           aStartAction, 
+                                                           aEndAction, 
+                                                           *this);
+    CleanupStack::PushL(newNode);
+    return newNode;
+}
+
+
+/* Recursively compile the tree into a state table */
+EXPORT_C void CSenFilterStateMachine::CompileL(CSenFilterStateNode& aStartNode)
+{
+    TInt p = 0; // initial state
+
+    p = aStartNode.Parent().State();
+
+    AddEntryL(p, 
+             aStartNode.Event(), 
+             aStartNode.Condition(), 
+             aStartNode.State(), 
+             aStartNode.StartAction(), 
+             aStartNode.EndAction());
+
+    TInt count = aStartNode.Children().Count();
+    for ( TInt i=0; i < count; i++ )
+    {
+        CSenFilterStateNode* node = (aStartNode.Children())[i];
+        CompileL(*node);
+    }
+}
+
+
+EXPORT_C void CSenFilterStateMachine::StartElementL(const TDesC8& aName, 
+                                                    const RAttributeArray& aAttributes)
+{
+    TransitionL(iFilterState, aName, (TInt)EStart, aAttributes);
+}
+
+
+EXPORT_C void CSenFilterStateMachine::EndElementL(const TDesC8& aName)
+{
+    RAttributeArray attrs;
+    TransitionL(iFilterState, aName, (TInt)EEnd, attrs);
+}
+
+
+
+const TInt CSenFilterStateMachine::RegisterState()
+{
+    return ++iStates;
+}
+
+
+const TInt CSenFilterStateMachine::States() const
+{
+    return iStates;
+}
+
+
+void CSenFilterStateMachine::AddEntryL(TInt aInitialState, 
+                                      const TDesC8& aEvent, 
+                                      const CSenFilterCondition& aCondition, 
+                                      TInt aNextState, 
+                                      MSenFilterAction& aStartAction, 
+                                      MSenFilterAction& aEndAction)
+{
+    CSenFilterTableEntry *entry = NULL;
+    TUint16 c;
+
+
+    // Start node
+    c = GetStateKeyL(aInitialState, 
+                    aEvent, 
+                    (TInt)EStart);
+
+    entry = new CSenFilterTableEntry(aNextState, 
+                                     aCondition, 
+                                     aStartAction);
+    CleanupStack::PushL(entry);
+
+    // Map takes care of memory deallocation
+    iStateTable.Append(&c, entry);
+
+    CleanupStack::Pop(); // entry
+
+    // End node
+    c = GetStateKeyL(aNextState, 
+                    aEvent, 
+                    (TInt)EEnd);
+
+    entry = new CSenFilterTableEntry(aInitialState, 
+                                     aCondition, 
+                                     aEndAction);
+    CleanupStack::PushL(entry);
+
+    // Map takes care of memory deallocation
+    iStateTable.Append(&c, entry);
+
+    CleanupStack::Pop(); // entry
+
+}
+
+
+// Create an unique key for state table node
+const TUint16 CSenFilterStateMachine::GetStateKeyL(TInt aState, 
+                                                  const TDesC8& aEvent, 
+                                                  TInt aStart)
+{
+    TUint16 ret = 0;
+    TInt intMaxLen = 32;
+
+    TInt bufLen = aEvent.Size() + (2 * intMaxLen);
+    HBufC8* buf = HBufC8::NewLC(bufLen);
+    TPtr8 bufPtr = (buf->Des());
+    bufPtr.Append(aEvent);
+    bufPtr.AppendNum(aState);
+    bufPtr.AppendNum(aStart);
+
+    Mem::Crc(ret, (TAny *)bufPtr.Ptr(), bufPtr.Size());
+
+    CleanupStack::PopAndDestroy(); // buf
+
+    return(ret);
+}
+
+
+const TInt CSenFilterStateMachine::TransitionL(TInt aState, 
+                                              const TDesC8& aEvent, 
+                                              TInt start, 
+                                              const RAttributeArray& aAttributes)
+{
+
+    TUint16 c = GetStateKeyL(aState, aEvent, start);
+    TInt i = iStateTable.Find(c);
+    if ( KErrNotFound != i ) {
+        const CSenFilterTableEntry* entry = iStateTable.ValueAt(i);
+        if ( entry != NULL )
+        {
+            // Evaluate conditions
+            if ( !entry->Condition().Test() )
+            {
+                return iFilterState;
+            }
+            //Perform action
+            entry->Action().PerformL(aEvent, aAttributes);
+    
+            // Make the state transition
+            iFilterState = entry->NewState();
+        }
+    }
+    return iFilterState;
+}
+
+
+RFileLogger* CSenFilterStateMachine::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+// -------------------------------------
+//
+// Implementation of class CSenFilterStateNode
+//
+// -------------------------------------
+
+
+EXPORT_C CSenFilterStateNode::CSenFilterStateNode(const TDesC8& aEvent, 
+                                                  const CSenFilterCondition& aCondition, 
+                                                  MSenFilterAction& aStartAction, 
+                                                  MSenFilterAction& aEndAction,
+                                                  CSenFilterStateMachine& aStateMachine)
+: ipPrev(NULL),
+  iEvent(aEvent),
+  iCondition(aCondition),
+  iStartAction(aStartAction),
+  iEndAction(aEndAction)
+{
+    TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterStateNode::CSenFilterStateNode(): Log opened"));
+
+    iState = aStateMachine.RegisterState();
+
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterStateNode::CSenFilterStateNode(): End"));
+} 
+
+
+EXPORT_C CSenFilterStateNode::CSenFilterStateNode(const CSenFilterStateNode& aFilterStateNode)
+: ipPrev(NULL),
+  iEvent(aFilterStateNode.Event()),
+  iCondition(aFilterStateNode.Condition()),
+  iStartAction(aFilterStateNode.StartAction()),
+  iEndAction(aFilterStateNode.EndAction())
+{
+    TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterStateNode::CSenFilterStateNode(): Log opened"));
+
+    iState = aFilterStateNode.State();
+    
+
+    if (NULL != aFilterStateNode.ipPrev)
+    {
+        ipPrev = new CSenFilterStateNode(aFilterStateNode.Parent());
+    }
+    
+    for (TInt i = 0; i < aFilterStateNode.Children().Count(); i++)
+    {
+        iChildren.Append((const_cast<CSenFilterStateNode>(aFilterStateNode).Children())[i]);
+    }
+
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterStateNode::CSenFilterStateNode(): End"));
+}
+
+
+EXPORT_C CSenFilterStateNode::~CSenFilterStateNode()
+{
+    iChildren.ResetAndDestroy();
+
+    // Close the log file and the connection to the server.
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L("Log file closed."));
+ 		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+EXPORT_C TInt CSenFilterStateNode::State() const
+{
+    return iState;
+}
+
+
+EXPORT_C TDesC8 CSenFilterStateNode::Event() const
+{
+    return iEvent;
+}
+
+
+EXPORT_C CSenFilterCondition CSenFilterStateNode::Condition() const
+{
+    return iCondition;
+}
+
+
+EXPORT_C MSenFilterAction& CSenFilterStateNode::StartAction() const
+{
+    return iStartAction;
+}
+
+
+EXPORT_C MSenFilterAction& CSenFilterStateNode::EndAction() const
+{
+    return iEndAction;
+}
+
+
+EXPORT_C CSenFilterStateNode& CSenFilterStateNode::Parent() const
+{
+    return *ipPrev;
+}
+
+
+EXPORT_C RStateNodeArray CSenFilterStateNode::Children() const
+{
+    return iChildren;
+}
+
+
+EXPORT_C void CSenFilterStateNode::SetParent(CSenFilterStateNode& aNode)
+{
+    ipPrev = &aNode;
+}
+
+
+RFileLogger* CSenFilterStateNode::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+// --------------------------------------
+//
+// Implementation of class CSenFilterTableEntry
+//
+// --------------------------------------
+
+
+CSenFilterTableEntry::CSenFilterTableEntry(TInt aNewState, 
+                                           const CSenFilterCondition& aCondition,
+                                           MSenFilterAction& aAction)
+: iAction(aAction),
+  iCondition(aCondition)
+{
+    TLSLOG_OPEN(KSenXmlLogChannel, KSenXmlLogLevel, KSenXml, KSenXmlLog);
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterTableEntry::CSenFilterTableEntry(): Log opened"));
+
+    iNewState = aNewState;
+
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L8("CSenFilterTableEntry::CSenFilterTableEntry(): End"));
+}
+
+
+CSenFilterTableEntry::~CSenFilterTableEntry()
+{
+    // Close the log file and the connection to the server.
+    TLSLOG(KSenXmlLogChannel  , KSenXmlLogLevel , _L("Log file closed."));
+		TLSLOG_CLOSE(KSenXmlLogChannel);
+}
+
+
+TInt CSenFilterTableEntry::NewState() const
+{
+    return iNewState;
+}
+
+
+CSenFilterCondition CSenFilterTableEntry::Condition() const
+{
+    return iCondition;
+}
+
+
+MSenFilterAction& CSenFilterTableEntry::Action() const
+{
+    return iAction;
+}
+
+
+RFileLogger* CSenFilterTableEntry::Log() const
+    {
+    return (RFileLogger*) &iLog;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/sennamespace.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenNameSpace.h"
+#include "SenXmlConstants.h"
+
+EXPORT_C CSenNamespace* CSenNamespace::NewL(const TDesC8& aUri)
+    {
+    // Note: intentionally calling the other version of NewLC to leave out
+    // one call in call stack
+    CSenNamespace* pNew = CSenNamespace::NewLC(KNullDesC8, aUri);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenNamespace* CSenNamespace::NewLC(const TDesC8& aUri)
+    {
+    CSenNamespace* pNew = CSenNamespace::NewLC(KNullDesC8, aUri);
+    return pNew;
+    }
+
+EXPORT_C CSenNamespace* CSenNamespace::NewL(const TDesC8& aPrefix, const TDesC8& aUri)
+    {
+    CSenNamespace* pNew = CSenNamespace::NewLC(aPrefix, aUri);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenNamespace* CSenNamespace::NewLC(const TDesC8& aPrefix, const TDesC8& aUri)
+    {
+    CSenNamespace* pNew = new (ELeave) CSenNamespace();
+    CleanupStack::PushL(pNew);
+
+    pNew->ConstructL(aPrefix, aUri);
+    return pNew;
+    }
+
+
+CSenNamespace::CSenNamespace()
+:   ipPrefix(NULL),
+    ipUri(NULL)
+    {
+
+    }
+
+void CSenNamespace::ConstructL(const TDesC8& aPrefix, const TDesC8& aUri)
+    {
+    if (aPrefix.Length() > -1)
+        {
+        ipPrefix = aPrefix.AllocL();
+        }
+
+    if (aUri.Length() > 0)
+        {
+        ipUri = aUri.AllocL();
+        }
+    }
+
+EXPORT_C CSenNamespace::~CSenNamespace()
+    {
+    delete ipPrefix;
+    delete ipUri;
+    }
+
+EXPORT_C TBool CSenNamespace::Compare(const TDesC8& aOtherPrefix,
+                                       const TDesC8& aOtherUri) const
+    {
+    TBool retVal(EFalse);
+    if (aOtherUri == URI())
+        {
+        if (aOtherPrefix == KNullDesC8 || aOtherPrefix == Prefix())
+            {
+            retVal = ETrue;
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TBool CSenNamespace::Compare(
+                                const CSenNamespace& aOtherNamespace) const
+    {
+    return this->Compare(aOtherNamespace.Prefix(), aOtherNamespace.URI());
+    }
+
+EXPORT_C TBool CSenNamespace::MatchesL(
+                                const CSenNamespace& aOtherNamespace) const
+    {
+    return (*ipUri == aOtherNamespace.URI());
+    }
+
+EXPORT_C const TDesC8& CSenNamespace::URI() const
+    {
+    if(ipUri)
+        {
+        return *ipUri;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+
+EXPORT_C void CSenNamespace::SetUriL(const TDesC8& aUri)
+    {
+    HBufC8* pUri = NULL;
+    if(aUri!=KNullDesC8)
+        {
+        pUri = aUri.AllocL();
+        }
+    delete ipUri;
+    ipUri = pUri;
+    }
+
+EXPORT_C const TDesC8& CSenNamespace::Prefix() const
+    {
+    if(ipPrefix)
+        {
+        return *ipPrefix;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+
+EXPORT_C void CSenNamespace::SetPrefixL(const TDesC8& aPrefix)
+    {
+    HBufC8* pPrefix = NULL;
+    if(aPrefix!=KNullDesC8)
+        {
+        pPrefix = aPrefix.AllocL();
+        }
+    delete ipPrefix;
+    ipPrefix = pPrefix;
+    }
+
+
+
+EXPORT_C void CSenNamespace::InsertL(RBufWriteStream& aWs)
+    {
+    if(!ipUri)
+        {
+        //SENDEBUG((_L("CSenNamespace::InsertL illegal ns, it has no URI!")));
+        return;
+        }
+
+    aWs.WriteL(KSenSpaceXmlns);
+    if(ipPrefix && ipPrefix->Length()>0)
+        {
+        aWs.WriteL(KSenColon);
+        aWs.WriteL(*ipPrefix);
+        }
+    aWs.WriteL(KSenEquals);
+    aWs.WriteL(*ipUri);
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senxmldll.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#ifndef EKA2
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+    {
+    return(KErrNone);
+    }
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senxmlelement.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1615 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "SenXmlElement.h"
+#include "SenXmlConstants.h" // KSenColon, ++
+#include "SenXmlUtils.h"
+
+#include "senxmldebug.h"
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    // for 2.8, 3.0 or newer:
+    #include <xml/attribute.h> // needed for RAttributeArray
+#else // for 2.6 or older
+    #include "Attribute.h"
+#endif
+
+using namespace Xml;
+
+namespace
+    {
+
+//    _LIT8(KColon,            ":");
+//    _LIT8(KLessThan,         "<");
+//    _LIT8(KGreaterThan,      ">");
+//    _LIT8(KSpace,            " ");
+//    _LIT8(KDblQuot,          "\"");
+//    _LIT8(KEqualsDblQuot,    "=\"");
+//    _LIT8(KSlashGreaterThan, "/>");
+//    _LIT8(KSenLessThanSlash,    "</");
+//    _LIT8(KSpaceXmlns,       " xmlns");
+//    _LIT8(KXmlns,            "xmlns");
+//    _LIT8(KXmlNsAttNamePlusColon, "xmlns:"); 
+    const TInt KFlatBufSize        = 64;
+    }
+
+
+EXPORT_C CSenXmlElement* CSenXmlElement::NewL(const TDesC8& aLocalName)
+    {
+    CSenXmlElement* pNew = new (ELeave) CSenXmlElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aLocalName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenXmlElement* CSenXmlElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName)
+    {
+    CSenXmlElement* pNew = new (ELeave) CSenXmlElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenXmlElement* CSenXmlElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName)
+    {
+    CSenXmlElement* pNew = new (ELeave) CSenXmlElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenXmlElement* CSenXmlElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs)
+    {
+    CSenXmlElement* pNew = new (ELeave) CSenXmlElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, apAttrs);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+
+EXPORT_C CSenXmlElement* CSenXmlElement::NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs,
+                                                CSenElement& aParent)
+    {
+    CSenXmlElement* pNew = new (ELeave) CSenXmlElement;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, apAttrs, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+EXPORT_C CSenXmlElement::CSenXmlElement()
+: ipLocalName(NULL),
+  ipContentBuf(NULL),
+  ipParent(NULL),
+  ipNamespace(NULL)
+    {
+    }
+
+EXPORT_C CSenXmlElement::~CSenXmlElement()
+    {
+    if(ipContentWriteStream)
+        {
+        ipContentWriteStream->Close();
+        delete ipContentWriteStream;
+        ipContentWriteStream = NULL;
+        }
+
+    if(ipAttrs)
+        {
+        ipAttrs->ResetAndDestroy();
+        delete ipAttrs;
+        ipAttrs = NULL; // not required
+        }
+    if(ipElements)
+        {
+        ipElements->ResetAndDestroy();
+        delete ipElements;
+        ipElements = NULL; // not required
+        }
+    if(ipNamespaces)
+        {
+        ipNamespaces->ResetAndDestroy();
+        delete ipNamespaces;
+        ipNamespaces = NULL; // not required
+        }
+
+    delete ipLocalName;
+    ipLocalName = NULL; // not required
+
+
+    delete ipContentBuf;
+    ipContentBuf = NULL; // not required
+
+    }
+
+
+
+EXPORT_C void CSenXmlElement::BaseConstructL(const TDesC8& aLocalName)
+    {
+    SenXmlUtils::LeaveOnInvalidElementNameL(aLocalName);
+    ipLocalName = aLocalName.AllocL();
+    }
+
+EXPORT_C void CSenXmlElement::BaseConstructL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName)
+    {
+    SenXmlUtils::LeaveOnInvalidElementNameL(aLocalName);
+    if(aNsUri.Length()>0)
+        {
+        SetNamespaceL(aNsUri);
+        }
+    ipLocalName = aLocalName.AllocL();
+    }
+
+EXPORT_C void CSenXmlElement::BaseConstructL(   const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName)
+    {
+    SenXmlUtils::LeaveOnInvalidElementNameL(aLocalName);
+    SenXmlUtils::LeaveOnInvalidElementNameL(aQName);
+    ipLocalName = aLocalName.AllocL();
+    TPtrC8 ptrPrefix(KNullDesC8);
+
+    if (aQName.Length() > 0 )
+        {
+        TInt colon = aQName.Locate(':');
+        if (colon > 0) // Note: 0 also treated as no prefix
+            {
+            ptrPrefix.Set(aQName.Ptr(),colon);
+            }
+        }
+
+    SetNamespaceL(ptrPrefix, aNsUri);
+    }
+
+EXPORT_C void CSenXmlElement::BaseConstructL(   const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs)
+    {
+    BaseConstructL(aNsUri, aLocalName, aQName);
+    SetAttributesL(apAttrs);
+    }
+
+EXPORT_C void CSenXmlElement::BaseConstructL(   const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs,
+                                                CSenElement& aParent    )
+    {
+    // parent must be set here at first line, because
+    // namespace setting dependends of it(!)
+    ipParent = &aParent;
+
+    BaseConstructL(aNsUri, aLocalName, aQName);
+    SetAttributesL(apAttrs);
+    }
+
+EXPORT_C void CSenXmlElement::SetAttributesL(const RAttributeArray& apAttrs)
+    {
+    AddAttributesL(apAttrs);
+    }
+
+
+EXPORT_C void CSenXmlElement::AddAttributesL(const RAttributeArray& apAttrs)
+    {
+    TInt count(apAttrs.Count());
+    HBufC8* qName = NULL;
+    for(TInt i=0; i<count; i++)
+        {
+        const TPtrC8 localname = apAttrs[i].Attribute().LocalName().DesC();
+        const TPtrC8 prefix = apAttrs[i].Attribute().Prefix().DesC();
+        const TPtrC8 value = apAttrs[i].Value().DesC();
+
+        SenXmlUtils::BuildQNameL(prefix, localname, qName);
+
+        CleanupStack::PushL(qName);
+
+        HBufC8* encodedValue = NULL;
+        TBool encoded = 
+            SenXmlUtils::EncodeHttpCharactersL(value, encodedValue);
+
+        if (encoded)
+            {
+            CleanupStack::PushL(encodedValue);
+            AddAttributeL(*qName, localname, *encodedValue); 
+            // note: this intentionally
+            // skips the 2 param 
+            // AddAttributeL() function
+
+            CleanupStack::PopAndDestroy(); // encodedValue
+            }
+        else
+            {
+            AddAttributeL(*qName, localname, value); 
+            // note: this intentionally
+            // skips the 2 param 
+            // AddAttributeL() function
+            }
+
+        CleanupStack::PopAndDestroy(); // qName
+        }
+    }
+
+EXPORT_C const TDesC8& CSenXmlElement::AddAttributeL(const TDesC8& aQName,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aValue)
+    {
+    const TDesC8& nsPrefix = NsPrefix();
+    // first we check for possible namespace declarations...
+    if ( aQName == KSenXmlns || aLocalName == KSenXmlns)
+        {
+            if(nsPrefix.Length() > 0)
+                {
+                // we have an additional namespace declaration
+                AddNamespaceL(KNullDesC8(), aValue);
+                }
+            else
+                {
+                // this is a default name space declaration
+                SetNamespaceL(aValue);                
+                }
+                
+        }
+    else if (aLocalName == NsPrefix())
+        {
+        //we have a new declaration for the namespace of this element
+        SetNamespaceL(aLocalName, aValue);
+        }
+    else if(aQName.Find(KSenXmlNsAttNamePlusColon) == 0)
+        {
+        // we have an additional namespace declaration
+        AddNamespaceL(aLocalName, aValue);
+        }
+    else
+        {
+        // we have a real attribute!
+        CSenBaseAttribute* pAttribute = CSenBaseAttribute::NewL(aQName,
+                                                                aLocalName,
+                                                                aValue);
+        AddAttributeL(pAttribute);
+        }
+    return aValue;
+    }
+
+
+
+EXPORT_C const TDesC8& CSenXmlElement::AddAttributeL(const TDesC8& aAttrName,
+                                                      const TDesC8& aValue)
+    {
+    // note, the aAttrName may be a qualified name or simply localname
+    // strip off the possible prefix from possible qualified name:
+    TPtrC8 localName = SenXmlUtils::LocalName(aAttrName);
+    return AddAttributeL(aAttrName, localName, aValue);
+    }
+
+// takes the ownership of aAttribute
+EXPORT_C const TDesC8& CSenXmlElement::AddAttributeL(
+                                                CSenBaseAttribute* apAttribute)
+    {
+    CSenBaseAttribute* pOldAtt = FindAttr(apAttribute->Name());
+
+    // if attribute array is not yet allocated, instantiate here
+    if(!ipAttrs)
+        {
+        ipAttrs = new (ELeave) RPointerArray<CSenBaseAttribute>;
+        }
+
+    if(!pOldAtt)
+        {
+        // transfrer the ownership to this class:
+        ipAttrs->Append(apAttribute);
+        return apAttribute->Value();
+        }
+    else
+        {
+        pOldAtt->SetValueL(apAttribute->Value());
+        delete apAttribute;
+        apAttribute = NULL;
+        return pOldAtt->Value();
+        }
+    }
+
+
+EXPORT_C CSenBaseAttribute* CSenXmlElement::FindAttr(const TDesC8& aName)
+    {
+    if(ipAttrs)
+        {
+        TInt count(ipAttrs->Count());
+        for (TInt i = 0; i < count; i++)
+            {
+            CSenBaseAttribute* pAttribute = (*ipAttrs)[i];
+            if(pAttribute->Name() == aName)
+                {
+                return pAttribute;
+                }
+            }
+        }
+    return NULL;
+    }
+
+
+EXPORT_C TInt CSenXmlElement::IndexOfElement(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName) const
+    {
+    if(ipElements)
+        {
+        TInt count(ipElements->Count());
+
+        for (TInt i = 0; i < count; i++)
+            {
+            CSenElement* pElement = (*ipElements)[i];
+            const TDesC8& nsUri = pElement->NamespaceURI();
+            const TDesC8& localName = pElement->LocalName();
+            if ((nsUri == aNsUri) && (localName == aLocalName))
+                {
+                return i;
+                }
+            }
+        }
+    return KErrNotFound;
+    }
+
+EXPORT_C const TDesC8& CSenXmlElement::LocalName() const
+    {
+    if (ipLocalName == NULL)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return *ipLocalName;
+        }
+    }
+
+EXPORT_C const TDesC8& CSenXmlElement::NamespaceURI() const
+    {
+    if (ipNamespace)
+        {
+        return ipNamespace->URI();
+        }
+    else
+        {
+        return KNullDesC8();
+        }
+    }
+
+EXPORT_C const TDesC8& CSenXmlElement::NsPrefix() const
+    {
+    if (!ipNamespace)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return ipNamespace->Prefix();
+        }
+    }
+
+EXPORT_C TBool CSenXmlElement::HasContent() const
+    {
+    if (!ipContentBuf)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return (ipContentBuf->Size() > 0);
+        }
+    }
+
+EXPORT_C TPtrC8 CSenXmlElement::Content() const
+    {
+    if (!ipContentBuf)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        TPtrC8 p8 = ipContentBuf->Ptr(0);
+        return p8;
+        }
+    }
+
+
+EXPORT_C HBufC* CSenXmlElement::ContentUnicodeL() const
+    {
+    HBufC* pRet = SenXmlUtils::ToUnicodeLC(Content());
+    CleanupStack::Pop(); // pRet;
+    return pRet;
+    }
+
+EXPORT_C TPtrC8 CSenXmlElement::SetContentL(const TDesC8& aContent)
+    {
+    AllocContentBufL(); 
+	if(ipContentBuf)
+		{
+		ipContentBuf->ResizeL(aContent.Size());
+		ipContentBuf->Write(0,
+        TPtrC8(REINTERPRET_CAST(const TUint8*, aContent.Ptr()),
+                                                aContent.Size())
+        );
+		if(ipContentWriteStream)
+			{
+			// Reset stream
+			ipContentWriteStream->Open(*ipContentBuf);
+			}
+		}
+    return Content();
+    }
+
+EXPORT_C RWriteStream& CSenXmlElement::ContentWriteStreamL()
+    {
+    AllocContentBufL();
+    // Allocate stream
+    if(!ipContentWriteStream)
+        {
+        ipContentWriteStream = new (ELeave) RBufWriteStream;
+        }
+    ipContentWriteStream->Open(*ipContentBuf);
+    return *ipContentWriteStream;
+    }
+
+// NOTE: assumes(!) that the namespace is same(!)
+// Optimization 
+// RPointerArray<CSenElement>* or NULL if no elements have been added!
+EXPORT_C RPointerArray<CSenElement>& CSenXmlElement::ElementsL()
+    {
+    if(!ipElements)
+        {
+        ipElements = new (ELeave) RPointerArray<CSenElement>;
+        }
+    return *ipElements;
+    }
+
+EXPORT_C TInt CSenXmlElement::ElementsL(
+                                    RPointerArray<CSenElement>& aElementArray,
+                                    const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName)
+    {
+    TInt retVal(KErrNotFound);
+
+    if(ipElements) // return KErrNotFound, if zero elements have been added
+        {
+        TInt count(ipElements->Count());
+
+        if (count > 0) // return KErrNotFound, if owned array is empty
+            {
+            CSenElement* pElement = NULL;
+            for (TInt i=0; i<count; i++)
+                {
+                pElement = (*ipElements)[i];
+                if ( (aLocalName == pElement->LocalName()) &&
+                     (aNsUri == pElement->NamespaceURI()) )
+                    {
+                    aElementArray.Append(pElement);
+                    }
+                }
+            retVal = KErrNone;
+            }
+        }
+    return retVal;
+    }
+
+EXPORT_C TInt CSenXmlElement::ElementsL(
+                                    RPointerArray<CSenElement>& aElementArray,
+                                    const TDesC8& aLocalName)
+    {
+    return ElementsL(aElementArray,NamespaceURI(),aLocalName);
+    }
+
+EXPORT_C const TDesC8* CSenXmlElement::AttrValue(const TDesC8& aName)
+    {
+    CSenBaseAttribute* pAttr = FindAttr(aName);
+    if (pAttr == NULL)
+        {
+        return NULL;
+        }
+    else
+        {
+        return &(pAttr->Value());
+        }
+    }
+
+EXPORT_C void CSenXmlElement::AddAttrL(const TDesC8& aName,
+                                        const TDesC8& aValue)
+    {
+    CSenBaseAttribute* pAttr = FindAttr(aName);
+    if (!pAttr)
+        {
+        if(!ipAttrs)
+            {
+            ipAttrs = new (ELeave) RPointerArray<CSenBaseAttribute>;
+            }
+
+        User::LeaveIfError(ipAttrs->Append(CSenBaseAttribute::NewL(aName,
+                                                                 aValue)));
+        }
+    else
+        {
+        pAttr->SetValueL(aValue);
+        }
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::Parent()
+    {
+    return ipParent;
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::SetParent(CSenElement* apParent)  // IOP
+    {
+    if (apParent && ipParent != apParent)
+        {
+        ipParent = apParent;
+        if (!ipNamespace)
+            {
+            // check if there is a default namespace declared in the scope of
+            // the parent
+            const CSenNamespace* pParentNamespace =
+                ((CSenXmlElement*) ipParent)->Namespace(KNullDesC8,ETrue);
+            if (pParentNamespace && pParentNamespace->Prefix() == KNullDesC8)
+                {
+                ipNamespace = (CSenNamespace*)pParentNamespace;
+                }
+            }
+        else
+            {
+            //check if the parent already has a namespace for this element
+            // if so remove it from the local namespace table
+            const CSenNamespace* pNs = ipParent->Namespace(KNullDesC8,
+                                                    ipNamespace->URI());
+            if (pNs && pNs != ipNamespace)
+                {
+                if (ipNamespace->Compare(*pNs) ||
+                    ipNamespace->Prefix().Length() == 0)
+                    {
+                    //prefix is also identical or this element has no prefix
+                    if(ipNamespaces)
+                        {
+                        TInt nsIndex = ipNamespaces->Find(ipNamespace);
+                        if ( nsIndex != KErrNotFound)
+                            {
+                            ipNamespaces->Remove(nsIndex);
+                            }
+                        }
+                    delete ipNamespace;
+                    ipNamespace = NULL;
+                    ipNamespace = (CSenNamespace*)pNs;
+                    }
+                }
+
+            }
+        }
+    return apParent;
+    }
+
+EXPORT_C MSenElement& CSenXmlElement::Root()
+    {
+    if (ipParent == NULL)
+        {
+        return *this;
+        }
+    else
+        {
+        return ipParent->Root();
+        }
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::Element(const TDesC8& aLocalName)
+    {
+    return Element(NamespaceURI(), aLocalName);
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::Element(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName)
+    {
+    if(ipElements)
+        {
+        TInt idx = IndexOfElement(aNsUri, aLocalName);
+        if (idx < 0)
+            {
+            return NULL;
+            }
+        else
+            {
+            return (*ipElements)[idx];
+            }
+        }
+    return NULL;
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::CreateElementL(const TDesC8& aNsPrefix,
+                                                      const TDesC8& aLocalName)
+    {
+    CSenElement* pNewElement = NULL;
+
+    if (aNsPrefix.Length() > 0)
+        {
+        CSenNamespace* pNamespace = (CSenNamespace*)Namespace(aNsPrefix);
+        if (pNamespace)
+            {
+            HBufC8 *pQName =
+                HBufC8::NewLC(aNsPrefix.Length() + aLocalName.Length() +5);
+            TPtr8 ptr = pQName->Des();
+            ptr.Append(aNsPrefix);
+            ptr.Append(':');
+            ptr.Append(aLocalName);
+            pNewElement =
+                CSenXmlElement::NewL(pNamespace->URI(), aLocalName, *pQName);
+            CleanupStack::PopAndDestroy(); // pQName
+            }
+        }
+    else
+        {
+        pNewElement = CSenXmlElement::NewL(aLocalName);
+        }
+
+    return pNewElement; // Returns NULL if required namespace can not be found!
+    }
+
+EXPORT_C CSenElement& CSenXmlElement::InsertElementL(
+                                          CSenElement& aElement,
+                                          const CSenElement& aBeforeElement)
+    {
+    TInt index(KErrNotFound);
+
+    // allocate element array, if not already reserved
+    if(!ipElements)
+        {
+        ipElements = new (ELeave) RPointerArray<CSenElement>;
+        }
+    else
+        {
+        // search only if array is not brand new
+        index = ipElements->Find(&aBeforeElement);
+        }
+
+    if (index != KErrNotFound)
+        {
+        // repleace element
+        User::LeaveIfError(ipElements->Insert(&aElement,index));
+        }
+    else
+        {
+        // add new element
+        User::LeaveIfError(ipElements->Append(&aElement));
+        }
+    aElement.SetParent(this);
+    return aElement;
+    }
+
+EXPORT_C CSenElement& CSenXmlElement::AddElementL(CSenElement& aElement)
+    {
+    // allocate element array, if not already reserved
+    if(!ipElements)
+        {
+        ipElements = new (ELeave) RPointerArray<CSenElement>;
+        }
+
+    User::LeaveIfError(ipElements->Append(&aElement));
+    aElement.SetParent(this);
+    return aElement;
+    }
+
+EXPORT_C CSenElement& CSenXmlElement::AddElementL(const TDesC8& aNsUri,
+                                                   const TDesC8& aLocalName)
+    {
+    return AddElementL(*CSenXmlElement::NewL(aNsUri, aLocalName));
+    }
+
+EXPORT_C CSenElement& CSenXmlElement::AddElementL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    return AddElementL(*CSenXmlElement::NewL(aNsUri, aLocalName, aQName));
+    }
+
+EXPORT_C CSenElement& CSenXmlElement::AddElementL(const TDesC8& aLocalName)
+    {
+    return AddElementL(*CSenXmlElement::NewL(aLocalName));
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::RemoveElement(CSenElement& aElement)
+    {
+    CSenElement* pElement = NULL;
+
+    if(ipElements)
+        {
+        TInt idx = ipElements->Find(&aElement);
+        if (idx >= 0)
+            {
+            pElement = (*ipElements)[idx];
+            ipElements->Remove(idx);
+            pElement->SetParent(NULL);
+            return pElement;
+            }
+        }
+    return pElement;
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::RemoveElement(const TDesC8& aNsUri,
+                                                     const TDesC8& aLocalName)
+    {
+    TInt idx = IndexOfElement(aNsUri, aLocalName);
+    if (idx >= 0)
+        {
+        CSenElement* pElement = (*ipElements)[idx];
+        ipElements->Remove(idx);
+        pElement->SetParent(NULL);
+        return pElement;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::RemoveElement(const TDesC8& aLocalName)
+    {
+    return RemoveElement(NamespaceURI(), aLocalName);
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::ReplaceElementL(CSenElement& aElement)
+    {
+    CSenElement* pOldElement =
+                RemoveElement(aElement.NamespaceURI(), aElement.LocalName());
+    CleanupStack::PushL(pOldElement);
+    AddElementL(aElement);
+    CleanupStack::Pop(); // pOldElement;
+    return pOldElement;
+    }
+
+EXPORT_C HBufC8* CSenXmlElement::AsXmlL()
+    {
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    TPtrC8 p = WriteToBufL(*pBuf);
+    HBufC8* pRet = p.AllocL();
+    CleanupStack::PopAndDestroy(); // pBuf;
+    return pRet;
+
+    }
+
+EXPORT_C HBufC* CSenXmlElement::AsXmlUnicodeL()
+    {
+    CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+    CleanupStack::PushL(pBuf);
+    TPtrC8 p8 = WriteToBufL(*pBuf);
+    HBufC* pRet = SenXmlUtils::ToUnicodeLC(p8);
+    CleanupStack::Pop(); // pop pRet;
+    CleanupStack::PopAndDestroy(); // pBuf;
+    return pRet;
+    }
+
+EXPORT_C TPtrC8 CSenXmlElement::WriteToBufL(CBufBase& aBuf)
+    {
+    RBufWriteStream bufWs(aBuf);
+    CleanupClosePushL(bufWs);
+    this->WriteAsXMLToL(bufWs);
+    CleanupStack::PopAndDestroy(); // bufWs.Close();
+    return aBuf.Ptr(0);
+    }
+
+EXPORT_C void CSenXmlElement::WriteAsXMLToL(RWriteStream& aWriteStream)
+    {
+    // Find out whether we should declare the namespace
+    TPtrC8 nsPrefix = NsPrefix();
+
+    // Element name
+    aWriteStream.WriteL(KSenLessThan);
+    if (nsPrefix.Length() > 0)
+        {
+        aWriteStream.WriteL(nsPrefix);
+        aWriteStream.WriteL(KSenColon);
+        }
+    aWriteStream.WriteL(*ipLocalName);
+
+    
+    if ((ipAttrs && ipAttrs->Count() > 0) || 
+         (ipNamespaces && ipNamespaces->Count() > 0))
+        {
+        WriteNamespacesToL(aWriteStream);
+        WriteAttrsToL(aWriteStream);
+        }
+
+    // Elements and content
+    if ((ipElements && ipElements->Count() > 0) || HasContent())
+        {
+        aWriteStream.WriteL(KSenGreaterThan);
+
+        // Body
+        WriteElementsToL(aWriteStream);
+        WriteContentToL(aWriteStream);
+
+        // Closing element
+        aWriteStream.WriteL(KSenLessThanSlash);
+        if (nsPrefix.Length() > 0)
+            {
+            aWriteStream.WriteL(nsPrefix);
+            aWriteStream.WriteL(KSenColon);
+            }
+        aWriteStream.WriteL(*ipLocalName);
+        aWriteStream.WriteL(KSenGreaterThan);
+        }
+    else
+        {
+        aWriteStream.WriteL(KSenSlashGreaterThan);
+        }
+    }
+
+EXPORT_C void CSenXmlElement::WriteAttrToL(RWriteStream& aWriteStream,
+                                            const TDesC8& aName,
+                                            const TDesC8& aValue)
+    {
+    aWriteStream.WriteL(KSenSpace);
+    aWriteStream.WriteL(aName);
+    aWriteStream.WriteL(KSenEqualsDblQuot);
+    aWriteStream.WriteL(aValue);
+    aWriteStream.WriteL(KSenDblQuot);
+    }
+
+EXPORT_C void CSenXmlElement::WriteAttrsToL(RWriteStream& aWriteStream)
+    {
+    if(ipAttrs)
+        {
+        TInt count(ipAttrs->Count());
+        for (TInt i = 0; i < count; i++)
+            {
+            WriteAttrToL(aWriteStream, (*ipAttrs)[i]->Name(), (*ipAttrs)[i]->Value());
+            }
+        }
+    }
+
+EXPORT_C void CSenXmlElement::WriteNamespacesToL(RWriteStream& aWriteStream)
+    {
+    if(ipNamespaces)
+        {
+        CSenNamespace* ns = NULL;
+        TInt count = ipNamespaces->Count();
+        for (TInt i=0; i < count; i++)
+            {
+            ns = (*ipNamespaces)[i];
+            if (ns)
+                {
+                aWriteStream.WriteL(KSenSpaceXmlns);
+                if (ns->Prefix().Length() > 0)
+                    {
+                    aWriteStream.WriteL(KSenColon);
+                    aWriteStream.WriteL(ns->Prefix());
+                    }
+                aWriteStream.WriteL(KSenEqualsDblQuot);
+                aWriteStream.WriteL(ns->URI());
+                aWriteStream.WriteL(KSenDblQuot);
+                }
+            }
+        }
+    }
+
+EXPORT_C void CSenXmlElement::WriteElementsToL(RWriteStream& aWriteStream)
+    {
+    if(ipElements)
+        {
+        TInt elementCount(ipElements->Count());
+        for (TInt i=0; i<elementCount; i++)
+            {
+            (*ipElements)[i]->WriteAsXMLToL(aWriteStream);
+            }
+        }
+    }
+
+EXPORT_C void CSenXmlElement::WriteContentToL(RWriteStream& aWriteStream)
+    {
+    aWriteStream.WriteL(Content());
+    }
+
+EXPORT_C MSenElement* CSenXmlElement::AsElement()
+    {
+    return this;
+    }
+
+EXPORT_C void CSenXmlElement::AllocContentBufL()
+    {
+    if(!ipContentBuf)
+        {
+        ipContentBuf = CBufFlat::NewL(KFlatBufSize);
+        }
+    }
+
+EXPORT_C void CSenXmlElement::SetNamespaceL(const TDesC8& aNsUri)
+    {
+    SetNamespaceL(KNullDesC8, aNsUri);
+    }
+
+EXPORT_C void CSenXmlElement::SetNamespaceL(const TDesC8& aNsPrefix,
+                                            const TDesC8& aNsUri)
+    {
+    if (aNsUri.Length() > 0)
+        {
+        ipNamespace = (CSenNamespace*) Namespace(aNsPrefix, aNsUri);
+        if (!ipNamespace) // not already defined
+            {
+            // allocate array if not already reserved
+            if(!ipNamespaces)
+                {
+                ipNamespaces = new (ELeave) RPointerArray<CSenNamespace>;
+                }
+            ipNamespace = CSenNamespace::NewL(aNsPrefix, aNsUri);
+            ipNamespaces->Append(ipNamespace);
+            }
+        }
+    }
+
+EXPORT_C const CSenNamespace* CSenXmlElement::Namespace()
+    {
+    return ipNamespace;
+    }
+
+EXPORT_C const CSenNamespace* CSenXmlElement::Namespace(
+                                                    const TDesC8& aNsPrefix)
+    {
+    return Namespace(aNsPrefix,ETrue);
+    }
+
+EXPORT_C const CSenNamespace* CSenXmlElement::Namespace(
+                                                    const TDesC8& aNsPrefix,
+                                                    const TBool aCheckInParent)
+    {
+    if (aNsPrefix.Length() == 0) return NULL;
+
+    const CSenNamespace* pNamespace = NULL;
+
+    if(ipNamespaces)
+        {
+        TInt count(ipNamespaces->Count());
+        for (TInt i=0; i<count && pNamespace == NULL; i++)
+            {
+            pNamespace = (*ipNamespaces)[i];
+            if (pNamespace)
+                {
+                if (pNamespace->Prefix() != aNsPrefix) pNamespace = NULL;
+                }
+            }
+        }
+
+    if (pNamespace == NULL && ipParent && aCheckInParent)
+        {
+        pNamespace = ipParent->Namespace(aNsPrefix);
+        }
+
+    return pNamespace;
+    }
+
+
+EXPORT_C const CSenNamespace* CSenXmlElement::Namespace(
+                                                    const TDesC8& aNsPrefix,
+                                                    const TDesC8& aUri)
+    {
+    // If prefix == NULL, then any prefix is ok
+    const CSenNamespace* pNs = NULL;
+    // Check if the namespace has already been declared
+    
+    if(ipNamespaces)
+        {
+        TInt count = ipNamespaces->Count();
+        if (count != 0)
+            {
+            for (TInt i=0; i<count; i++)
+                {
+                pNs = (*ipNamespaces)[i];
+                if (!pNs->Compare(aNsPrefix, aUri))
+                    {
+                    pNs = NULL; // not equal
+                    }
+                else
+                    {
+                    break;
+                    }
+                }
+            }
+        }
+    if (pNs == NULL && ipParent != NULL)
+        {
+        // if no namespace defined, but there is a parent, ask its namespace
+        pNs = ipParent->Namespace(aNsPrefix, aUri);
+        }
+    return pNs;
+    }
+
+EXPORT_C RPointerArray<CSenBaseAttribute>& CSenXmlElement::AttributesL()
+    {
+    // if attribute array is not yet allocated, instantiate here
+    if(!ipAttrs)
+        {
+        ipAttrs = new (ELeave) RPointerArray<CSenBaseAttribute>;
+        }
+    return *ipAttrs;
+    }
+
+EXPORT_C RPointerArray<CSenNamespace>& CSenXmlElement::NamespacesL()
+    {
+    if(!ipNamespaces)
+        {
+        ipNamespaces = new (ELeave) RPointerArray<CSenNamespace>;
+        }
+    return *ipNamespaces;
+    }
+
+EXPORT_C void CSenXmlElement::CopyFromL(CSenElement& aSource)
+    {
+    TPtrC8 sourceContent = aSource.Content();
+    if (sourceContent.Length() > 0)
+        {
+        if (ipContentBuf == NULL)
+            {
+            SetContentL(sourceContent);
+            }
+        else
+            {
+            RBufWriteStream bufWs(*ipContentBuf);
+            CleanupClosePushL(bufWs);
+            bufWs.WriteL(sourceContent);
+            CleanupStack::PopAndDestroy(); // close bufWs
+            }
+        }
+
+    RPointerArray<CSenNamespace> sourceNamespaces = aSource.NamespacesL();
+    if (sourceNamespaces.Count() > 0)
+        {
+        for (TInt i=0;i<sourceNamespaces.Count(); i++)
+            {
+            CSenNamespace* pNamespace = sourceNamespaces[i];
+            CSenNamespace* pNewNamespace =
+                CSenNamespace::NewL(pNamespace->Prefix(),pNamespace->URI());
+            CleanupStack::PushL(pNewNamespace);
+
+            // allocate array if not already reserved
+            if(!ipNamespaces)
+                {
+                ipNamespaces = new (ELeave) RPointerArray<CSenNamespace>;
+                }
+            
+#ifdef EKA2
+            ipNamespaces->AppendL(pNewNamespace);
+#else
+            User::LeaveIfError(ipNamespaces->Append(pNewNamespace));
+#endif
+            CleanupStack::Pop(pNewNamespace);
+            }
+        }
+    SetNamespaceL(aSource.NsPrefix(), aSource.NamespaceURI());
+
+    RPointerArray<CSenBaseAttribute> sourceAttributes = aSource.AttributesL();
+    if (sourceAttributes.Count() > 0)
+        {
+        for (TInt i=0;i<sourceAttributes.Count(); i++)
+            {
+            CSenBaseAttribute* pBaseAttribute = sourceAttributes[i];
+
+            // 2005-04-28: check for duplicate and override existing value if
+            // attribute already exists.
+            CSenBaseAttribute* pOriginal = FindAttr(pBaseAttribute->Name());
+            if (pOriginal)
+                {
+                pOriginal->SetValueL(pBaseAttribute->Value());
+                continue;
+                }
+
+            CSenBaseAttribute* pNewBaseAttribute =
+                CSenBaseAttribute::NewL(pBaseAttribute->Name(),
+                                        pBaseAttribute->Value());
+            CleanupStack::PushL(pNewBaseAttribute);
+
+            // if attribute array is not yet allocated, instantiate here
+            if(!ipAttrs)
+                {
+                ipAttrs = new (ELeave) RPointerArray<CSenBaseAttribute>;
+                }
+
+#ifdef EKA2
+            ipAttrs->AppendL(pNewBaseAttribute);
+#else
+            User::LeaveIfError(ipAttrs->Append(pNewBaseAttribute));
+#endif
+            CleanupStack::Pop(pNewBaseAttribute);
+            }
+        }
+
+    RPointerArray<CSenElement> sourceElements = aSource.ElementsL();
+    if (sourceElements.Count() > 0)
+        {
+        for (TInt i=0;i<sourceElements.Count(); i++)
+            {
+            CSenElement* pElement = sourceElements[i];
+            CSenElement* pNewElement =
+                                CSenXmlElement::NewL(pElement->LocalName());
+            CleanupStack::PushL(pNewElement);
+            pNewElement->SetParent(this);
+            pNewElement->CopyFromL(*pElement);
+
+            if(!ipElements)
+                {
+                ipElements = new (ELeave) RPointerArray<CSenElement>;
+                }
+
+#ifdef EKA2
+            ipElements->AppendL(pNewElement);
+#else
+            User::LeaveIfError(ipElements->Append(pNewElement));
+#endif // EKA2
+            CleanupStack::Pop(pNewElement);
+            }
+        }
+    }
+
+EXPORT_C void CSenXmlElement::SetPrefixL(const TDesC8& aPrefix)
+    {
+    if (ipNamespaces && ipNamespaces->Find(ipNamespace) > -1)
+        {
+        //the namespace was locally declared
+
+        // Check if element already has a namespace with given prefix
+        CSenNamespace* pNamespace = NULL;
+        TInt count(ipNamespaces->Count());
+        for (TInt i=0; i<count && pNamespace == NULL; i++)
+            {
+            pNamespace = (*ipNamespaces)[i];
+            if (pNamespace->Prefix() != aPrefix) 
+                {
+                pNamespace = NULL;
+                }
+            }
+
+        if (pNamespace)
+            {
+            // Update existing namespace
+            const TDesC8& uri = ipNamespace->URI();
+            pNamespace->SetUriL(uri);
+            ipNamespace = pNamespace;
+            }
+        else
+            {
+            if(ipElements) // are there any child elements?
+                {
+                if (ipNamespace->Prefix().Length() > 0 && ipElements->Count() > 0)
+                    {
+                    // there may be children that depend on the old prefix in e.g. attribute names
+                    const TDesC8& uri = ipNamespace->URI();
+                    ipNamespace = CSenNamespace::NewL(aPrefix, uri);
+
+                    // append as new namespace
+                    ipNamespaces->Append(ipNamespace);
+                    }
+                }
+            ipNamespace->SetPrefixL(aPrefix);
+            }
+        }
+    }
+
+EXPORT_C const CSenNamespace* CSenXmlElement::AddNamespaceL(
+                                                CSenNamespace& aNewNamespace,
+                                                TBool aCheckInParent)
+    {
+    const CSenNamespace* pNamespace =
+                        Namespace(aNewNamespace.Prefix(), aCheckInParent);
+
+    if (pNamespace == NULL) // does not exist
+        {
+        CSenNamespace* pNewNamespace =
+            CSenNamespace::NewL(aNewNamespace.Prefix(), aNewNamespace.URI());
+
+        // allocate array if not already reserved
+        if(!ipNamespaces)
+            {
+            ipNamespaces = new (ELeave) RPointerArray<CSenNamespace>;
+            }
+        ipNamespaces->Append(pNewNamespace);
+        pNamespace = pNewNamespace;
+        }
+    return pNamespace;
+    }
+
+EXPORT_C const CSenNamespace* CSenXmlElement::AddNamespaceL(
+                                                         const TDesC8& aPrefix,
+                                                         const TDesC8& aUri)
+    {
+    CSenNamespace* pNamespace = (CSenNamespace*)Namespace(aPrefix);
+	if (!pNamespace)
+		{
+		if ( aUri.Length() > 0)
+			{
+				pNamespace = CSenNamespace::NewL(aPrefix, aUri);
+			// allocate array if not already reserved
+			if(!ipNamespaces)
+				{
+				ipNamespaces = new (ELeave) RPointerArray<CSenNamespace>;
+				}
+			ipNamespaces->Append(pNamespace);
+			}
+		}
+	    else
+	        {
+	        pNamespace->SetUriL(aUri); // override current namespace URI with new one
+	      
+			}
+
+    return pNamespace;
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::DetachL()
+    {
+    if (!ipParent)
+        {
+        return NULL;
+        }
+
+    // allocate array if not already reserved
+    if(!ipNamespaces)
+        {
+        ipNamespaces = new (ELeave) RPointerArray<CSenNamespace>;
+        }
+
+    AddNamespaceMissingFromL(*ipNamespaces);
+
+    // optimization: if nothing was added, free the array allocation
+    if(ipNamespaces && ipNamespaces->Count()==0)
+        {
+        ipNamespaces->ResetAndDestroy(); 
+        delete ipNamespaces; 
+                            
+        ipNamespaces = NULL;
+        }
+
+    ipParent->RemoveElement(*this);
+    return this;
+    }
+
+void CSenXmlElement::AddNamespaceMissingFromL( RPointerArray<CSenNamespace>& aNamespaces )
+    {
+    // Add namespace of this element (possibly copied from parent)
+    // if that namespace is not already defined in
+    // aNamespaces array.
+    if ( ipNamespace && aNamespaces.Find(ipNamespace) == -1)
+        {
+        // Check if namespace declaration of this element can
+        // be found from aNamespaces array
+        TInt count(aNamespaces.Count());
+        TBool found(EFalse);
+        TInt i = 0;
+        for (; i<count; i++)
+            {
+            if ( aNamespaces[i]->URI() == ipNamespace->URI() && 
+                 aNamespaces[i]->Prefix() == ipNamespace->Prefix() )
+                {
+                found = ETrue;
+                break;
+                }
+            }
+        if ( !found )
+            {
+            //If not found then check in namespace usage array that namspace declaration 
+            //is present or not. If yes then continue without adding.
+            if((ipNamespaces && ipNamespaces->Find(ipNamespace) == -1) || !ipNamespaces)
+	            {
+            
+	            // Not found 
+	            // => Create a copy of namespace declaration
+	            //    and append it into aNamespaces array
+	            CSenNamespace* pCopy =
+	                    CSenNamespace::NewL(ipNamespace->Prefix(), ipNamespace->URI());
+	            CleanupStack::PushL(pCopy);
+	#ifdef EKA2
+	            aNamespaces.AppendL(pCopy);
+	#else
+	            User::LeaveIfError(aNamespaces.Append(pCopy));
+	#endif
+	            CleanupStack::Pop(pCopy);
+
+	            // Change namespace object for this element to namespace object
+	            // which can be found from aNamespaces array
+	            ipNamespace = pCopy;
+	            }
+            }
+        else
+            {
+            // Change namespace object for this element to namespace object
+            // which can be found from aNamespaces array
+            ipNamespace = aNamespaces[i];
+            }
+        }
+
+    // Add namespaces from this element's attributes
+    // if those namespaces are not already defined in
+    // aNamespaces array.
+    if ( ipAttrs && ipAttrs->Count() > 0 )
+        {
+        TInt colon = -1;
+        const CSenNamespace* pNamespace = NULL;
+
+        TInt count(ipAttrs->Count());
+        for(TInt i=0; i<count; i++)
+            {
+            CSenBaseAttribute* pAttribute = (*ipAttrs)[i];
+
+            // Check namespace assigned to Name
+            colon = pAttribute->Name().Locate(':');
+            if ( colon > 0 )
+                {
+                pNamespace =
+                    Namespace(pAttribute->Name().Mid(0, colon), KNullDesC8);
+                }
+            if ( pNamespace && (aNamespaces.Find(pNamespace) == -1) )
+                {
+                // Check if namespace declaration for handled attribute
+                // _name_ can be found from aNamespaces array.
+                TInt count(aNamespaces.Count());
+                TBool found(EFalse);
+                for (TInt i = 0; i<count; i++)
+                    {
+                    if ( aNamespaces[i]->URI() == pNamespace->URI() && 
+                         aNamespaces[i]->Prefix() == pNamespace->Prefix() )
+                        {
+                        found = ETrue;
+                        break;
+                        }
+                    }
+                if ( !found )
+                    {
+		            //If not found then check in namespace usage array that 
+		            //namespace declaration is present or not. If yes then 
+		            //continue without adding.
+		            if((ipNamespaces && ipNamespaces->Find(pNamespace) == -1) || !ipNamespaces)
+			            {
+                    
+	                    // Not found 
+	                    // => Create a copy of namespace declaration
+	                    //    and append it into aNamespaces array
+	                    CSenNamespace* pCopy =
+	                            CSenNamespace::NewL(pNamespace->Prefix(),
+	                                                pNamespace->URI());
+	                    CleanupStack::PushL(pCopy);
+	#ifdef EKA2
+	                    aNamespaces.AppendL(pCopy);
+	#else
+	                    User::LeaveIfError(aNamespaces.Append(pCopy));
+	#endif
+	                    CleanupStack::Pop(pCopy);
+			            }
+                    }
+                }
+            pNamespace = NULL;
+
+            // Check namespace assigned to Value
+            colon = pAttribute->Value().Locate(':');
+            if ( colon > 0 )
+                {
+                pNamespace =
+                    Namespace(pAttribute->Value().Mid(0, colon), KNullDesC8);
+                }
+            if ( pNamespace && (aNamespaces.Find(pNamespace) == -1) )
+                {
+                // Check if namespace declaration for handled attribute
+                // _value_ can be found from aNamespaces array.
+                TInt count(aNamespaces.Count());
+                TBool found(EFalse);
+                for (TInt i = 0; i<count; i++)
+                    {
+                    if ( aNamespaces[i]->URI() == pNamespace->URI() && 
+                         aNamespaces[i]->Prefix() == pNamespace->Prefix() )
+                        {
+                        found = ETrue;
+                        break;
+                        }
+                    }
+                if ( !found )
+                    {
+					//If not found then check in namespace usage array that 
+		            //namspace declaration is present or not.If yes then 
+		            //continue without adding.
+		            if(ipNamespaces && ipNamespaces->Find(pNamespace) == -1)
+			            {
+
+	                    // Not found 
+	                    // => Create a copy of namespace declaration
+	                    //    and append it into aNamespaces array
+	                    CSenNamespace* pCopy =
+	                            CSenNamespace::NewL(pNamespace->Prefix(), 
+	                                                pNamespace->URI());
+	                    CleanupStack::PushL(pCopy);
+	#ifdef EKA2
+	                    aNamespaces.AppendL(pCopy);
+	#else
+	                    User::LeaveIfError(aNamespaces.Append(pCopy));
+	#endif
+	                    CleanupStack::Pop(pCopy);
+			            }
+                    }
+                }
+            pNamespace = NULL;
+            }
+        }
+
+    if(ipElements && ipElements->Count() > 0)
+        {
+        TInt count(ipElements->Count());
+        for(TInt i=0; i<count; i++)
+            {
+            CSenXmlElement* pElement = (CSenXmlElement*) (*ipElements)[i];
+            pElement->AddNamespaceMissingFromL(aNamespaces);
+            }
+        }
+    }
+
+
+EXPORT_C void CSenXmlElement::Set(const TDesC8& aNamespaceURI,
+                                   const TDesC8& aLocalName,
+                                   const TDesC8& aQName)
+    {
+    delete ipLocalName;
+    ipLocalName = NULL;
+    HBufC8* pTemp = aLocalName.Alloc();
+    if(pTemp)
+        {
+        ipLocalName = pTemp;
+        }
+
+    TPtrC8 prefix(KNullDesC8);
+
+    if(aQName != KNullDesC8)
+        {
+        TInt colon(KErrNotFound);
+        colon = aQName.Locate(':');
+        if(colon!=KErrNotFound)
+            {
+            prefix.Set(aQName.Left(colon));
+            }
+        }
+    TInt leaveCode(KErrNone);
+    TRAP(leaveCode, SetNamespaceL(prefix, aNamespaceURI);)
+    leaveCode=0;
+    
+    //if (err) ; 
+    }
+
+EXPORT_C CSenElement* CSenXmlElement::Child(TInt aIndex)
+    {
+    CSenElement* pElement = NULL;
+    if(ipElements && aIndex < ipElements->Count())
+        {
+        pElement = (CSenXmlElement*) (*ipElements)[aIndex];
+        }
+    return pElement;
+    }
+
+EXPORT_C TBool CSenXmlElement::ConsistsOfL(MSenElement& aCandidate)
+    {
+    // First check the names and namespaces
+    if (    aCandidate.LocalName() != this->LocalName()
+        ||  aCandidate.NamespaceURI() != this->NamespaceURI()
+        ||  aCandidate.NsPrefix() != this->NsPrefix()
+        )
+        {
+        return EFalse;
+        }
+
+    // Then check content if it exists
+    if (aCandidate.HasContent())
+        {
+        if (aCandidate.Content() != this->Content())
+            {
+            return EFalse;  // Content doesn't match => no match
+            }
+        }
+
+    // Then handle the children
+    RPointerArray<CSenElement>& children = aCandidate.ElementsL();
+    TInt childCount = children.Count();
+    TInt i=0;
+    while (i < childCount)
+        {
+        CSenElement* pMatchChild = children[i];
+        CSenElement* pChild = this->Element(pMatchChild->LocalName());
+        if (!pChild)
+            {
+            return EFalse;  // no child with same name found in children, 
+                            // => no match
+            }
+        else
+            {
+            if (!pChild->ConsistsOfL(*pMatchChild))
+                {
+                return EFalse; // a non matching child was found => No match
+                }
+            }
+        i++;
+        }
+    return ETrue;
+    }
+
+void CSenXmlElement::Compress()
+    {
+    if(ipContentWriteStream)
+        {
+        ipContentWriteStream->Close();
+        delete ipContentWriteStream;
+        ipContentWriteStream = NULL;
+        }
+    if (ipContentBuf) ipContentBuf->Compress();
+    if(ipElements)
+        {
+        TInt count(ipElements->Count());
+
+        for (TInt i = 0; i < count; i++)
+            {
+            CSenElement* pElement = (*ipElements)[i];
+            ((CSenXmlElement*)pElement)->Compress();
+            }
+        }
+    
+    }
+
+// New methods; problem: assume, that one cannot change CSenElement (abstract)
+// class definition (virtual function tables); therefore one must be cautious
+// and avoid class casting to internal element in base fragment layer(!) in
+// order to access these methods! What if someone added a baseelement? -> crash
+
+// Optimized variant
+// @return NULL if this element has no child elements
+/*
+RPointerArray<CSenElement>* CSenXmlElement::ElementsL()
+    {
+    return ipElements;
+    }
+
+// Optimized variant
+//@return NULL if this element has no attributes 
+RPointerArray<CSenBaseAttribute>* CSenXmlElement::AttributesL()
+    {
+    return ipAttrs;
+    }
+
+// Optimized variant
+// @return RPointerArray<CSenNamespace>* or NULL if there are no attributes in this element
+RPointerArray<CSenNamespace>& CSenXmlElement::NamespacesL()
+    {
+    return ipNamespaces;
+    }
+*/
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senxmlreader.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,771 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <xml/attribute.h> // From syslibs, needed for RAttributeArray
+
+#include <SenXmlReader.h>
+#include <SenXmlConstants.h>
+#include <SenXmlUtils.h>
+#include <MSenContentHandlerClient.h>
+#include "senxmldebug.h"
+
+#ifdef EKA2
+    #ifndef __SERIES60_30__
+        // S60 3.1 or newer
+        #include <xml/matchdata.h>
+    #endif
+#else
+    // Use fss with S60 2nd edition FP3 (2.8) - temp file is needed with expat
+    #include <s32file.h> // filestream
+#endif
+
+// DEBUG:
+#include "sendebug.h"
+
+using namespace Xml;
+
+namespace
+    {
+    const TInt KArraySize = 128;
+    
+    typedef struct
+        {
+        CSenXmlReader*  ipReader;
+        TInt            iEnabledFeature;
+        } TReaderData;
+    }
+    
+_LIT8(KDefaultMimeType, "");  // Expat is made default, so don't have to give mime type
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewL()
+    {
+    CSenXmlReader* pNew = NewLC();
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewLC()
+    {
+    
+    CSenXmlReader* pNew = new (ELeave) CSenXmlReader(KSenDefaultParserFeature);
+    CleanupStack::PushL(pNew);
+    
+    pNew->ConstructL(KDefaultMimeType);// KXmlParserMimeType : Defaulted to Expat
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewL(TInt aParserFeature)
+    {
+    CSenXmlReader* pNew = NewLC(aParserFeature);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewLC(TInt aParserFeature)
+    {
+    CSenXmlReader* pNew = new (ELeave) CSenXmlReader(aParserFeature);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(KDefaultMimeType);// KXmlParserMimeType : Defaulted to Expat
+    if(aParserFeature<0)
+        {
+        User::Leave(KErrArgument);
+        }
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewL(const TDesC8& aParserMimeType)
+    {
+    CSenXmlReader* pNew = NewLC(aParserMimeType);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewLC(const TDesC8& aParserMimeType)
+    {
+    CSenXmlReader* pNew = new (ELeave) CSenXmlReader(KSenDefaultParserFeature);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aParserMimeType);
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewL(const TDesC8& aParserMimeType,
+                                            TInt aParserFeature)
+    {
+    CSenXmlReader* pNew = NewLC(aParserMimeType, aParserFeature);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader* CSenXmlReader::NewLC(const TDesC8& aParserMimeType,
+                                             TInt aParserFeature)
+    {
+    CSenXmlReader* pNew = new (ELeave) CSenXmlReader(aParserFeature);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aParserMimeType);
+    if(aParserFeature<0)
+        {
+        User::Leave(KErrArgument);
+        }
+    return pNew;
+    }
+
+EXPORT_C CSenXmlReader::CSenXmlReader(TInt aEnabledFeature)
+:
+iParser(NULL),
+iContentHandler(NULL),
+ipNsPrefixes(NULL),
+ipNsUris(NULL),
+iEnabledFeature(aEnabledFeature)
+    {
+    }
+
+EXPORT_C CSenXmlReader::~CSenXmlReader()
+    {
+    delete iParser;
+    delete ipNsPrefixes;
+    delete ipNsUris;
+    iStringPool.Close();
+    }
+
+#if defined( __SERIES60_30__ )
+void CSenXmlReader::ConstructL(const TDesC8& aParserMimeType)
+    {
+    if(aParserMimeType.Length()==0)
+        {
+        // Use default MIME type
+        iParser = CParser::NewL(KXmlParserMimeType, *this);
+        }
+    else
+        {
+        // Pass aParserMimeType
+        iParser = CParser::NewL(aParserMimeType, *this);
+        }
+    iParser->EnableFeature(iEnabledFeature);
+    iStringPool.OpenL();
+    }
+#else
+void CSenXmlReader::ConstructL(const TDesC8& aParserMimeType)
+    {
+    CMatchData* pMatchData = CMatchData::NewL();
+    CleanupStack::PushL(pMatchData);
+    
+    if(aParserMimeType.Length()==0)
+        {
+        // Use default MIME type and variant
+        // for this parser instance (text/xml)
+        pMatchData->SetMimeTypeL(KXmlParserMimeType);
+        }
+    else
+        {
+        // Use specified aParserMimeType:
+        pMatchData->SetMimeTypeL(aParserMimeType);
+	    
+	    // Set the default variant type (libxml2)
+		pMatchData->SetVariantL(KXmlVariant);             
+        }
+    
+    iParser = CParser::NewL(*pMatchData, *this);
+    CleanupStack::PopAndDestroy(pMatchData);
+
+    iParser->EnableFeature(iEnabledFeature);
+    iStringPool.OpenL();
+    }
+#endif
+
+EXPORT_C void CSenXmlReader::SetContentHandler(
+                                    MSenContentHandlerClient& aContentHandler)
+    {
+    iContentHandler = &aContentHandler;
+    }
+
+#ifdef EKA2 
+// In S60 3rd edition platform there is a fixed version of expat parser which
+// can parse XML documents which size is 2048 bytes or greater. The previous 
+// versions crashed with larger documents.
+EXPORT_C void CSenXmlReader::ParseL(const TDesC8& aBuff)
+    {
+    CleanUp();
+
+#if defined(__SERIES60_30__)
+    RecreateParserL();
+#endif // __SERIES_30__ defined
+
+    // Note(!): Store the currently enabled feature, since the same member
+    // is used to carry a possible error code from OnErrorL() callback:
+    TInt feature(iEnabledFeature);
+
+    TReaderData* pData = new (ELeave) TReaderData;
+    pData->ipReader         = this;
+    pData->iEnabledFeature  = iEnabledFeature;
+    CleanupStack::PushL( TCleanupItem( CSenXmlReader::CleanupParser, pData ) );
+    // Parse the XML document:
+    iParser->ParseL(aBuff);
+    CleanupStack::Pop();
+    delete pData;
+
+    iParser->ParseEndL(); // Enables Symbian XML framework errors to propagete OnErrorL() callback
+
+    CleanUp();
+
+    // Check if iEnabledFeature member was used to carry an error from OnErrorL() callback..
+    if (iEnabledFeature < 0)
+        {
+        TInt error(iEnabledFeature);
+        SENDEBUG((_L("CSenXmlReader::ParserL: leaving (%d)"), error));
+        // Switch back the originally enabled feature
+        iEnabledFeature = feature;
+        User::Leave(error);
+        }
+    iContentHandler->EndDocument();
+    }
+#else 
+EXPORT_C void CSenXmlReader::ParseL(const TDesC8& aBuff)
+    {
+    // In S60 2nd edition FP3 (2.8) platform a temp file has to be used, since the
+    // underlying expat parser would crash when parsing a document which consists 
+    // of more that 2048 bytes of XML.
+
+    if (aBuff.Length() > 2048) // there is 2048 bytes limitation in expat parser!
+        {
+        SENDEBUG_L("CSenXmlReader::ParseL(): parsing over 2048 bytes of XML (EKA1)");
+        SENDEBUG((_L("- document size: %d bytes."), aBuff.Length() ));
+
+        // Parse large XML documents using file server
+        RFs fss;
+        User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+
+        // Now create a new temp file in the specified path using unique 
+        // file name which is generated by the file server. Since file 
+        // server is not responsible to delete this file, it must be done 
+        // after parsing is finished.
+
+        // Path for temp file
+        _LIT(KFilePath, "c:\\");
+
+        // Stores the temp file name when fileOutStream.Temp() returns:
+        TFileName tempFilename; 
+    
+        // Try to generate new temporary file, leave if it failes:
+        RFileWriteStream fileOutStream;
+        User::LeaveIfError(fileOutStream.Temp(fss, KFilePath, tempFilename, EFileWrite));
+        CleanupClosePushL(fileOutStream);
+        SENDEBUG((_L("CSenXmlReader::ParseL(): used temp file name: '%S'"), &tempFilename));
+
+        // Write XML document into the file:
+        fileOutStream.WriteL(aBuff);
+
+        // fileOutStream.Close(). Must be done prior ParseL()!
+        CleanupStack::PopAndDestroy(); 
+
+        // Parse the file:
+        ParseL(fss, tempFilename);
+
+        // Now delete the temporary file (when it is not in locked in parser's use)
+        fss.Delete(tempFilename);
+
+        // Finally close the file server session
+        CleanupStack::PopAndDestroy(); // fss.Close()
+        SENDEBUG_L("CSenXmlReader::ParseL() successfully parsed > 2048 bytes of XML.");
+        }
+    else
+        {
+        // Smaller documents may be parsed normally, even with older versions
+        // of Symbian XML framework's expat parser.
+        
+        CleanUp();
+        
+#if defined(__SERIES60_30__)
+    RecreateParserL();
+#endif // __SERIES_30__ defined
+
+        TInt feature(iEnabledFeature);
+
+        TReaderData* pData = new (ELeave) TReaderData;
+        pData->ipReader         = this;
+        pData->iEnabledFeature  = iEnabledFeature;
+        CleanupStack::PushL( TCleanupItem( CSenXmlReader::CleanupParser, pData ) );
+        // Parse the XML document:
+        iParser->ParseL(aBuff);
+        CleanupStack::Pop();
+        delete pData;
+        
+        iParser->ParseEndL(); // Enables Symbian XML framework errors to propagete OnErrorL() callback
+
+        CleanUp();
+
+        if (iEnabledFeature < 0) 
+            {
+            TInt error(iEnabledFeature);
+            iEnabledFeature = feature;
+            SENDEBUG((_L("CSenXmlReader::ParserL: leaving (%d)"), iEnabledFeature));
+            User::Leave(error);
+            }
+            
+        iContentHandler->EndDocument();
+        }
+    }
+#endif // not EKA2 
+
+
+EXPORT_C void CSenXmlReader::ParseL(RFs &aRFs, const TDesC& aFileToParse)
+    {
+    CleanUp();
+
+#if defined(__SERIES60_30__)
+    RecreateParserL();
+#endif // __SERIES_30__ defined
+    
+    TInt feature(iEnabledFeature);
+
+    TReaderData* pData = new (ELeave) TReaderData;
+    pData->ipReader         = this;
+    pData->iEnabledFeature  = iEnabledFeature;
+    CleanupStack::PushL( TCleanupItem( CSenXmlReader::CleanupParser, pData ) );
+    // Parse the XML document:
+    Xml::ParseL(*iParser, aRFs, aFileToParse); 
+    // Note: Xml::ParseL calls ParseL() and ParseEndL() internally:
+    CleanupStack::Pop();
+    delete pData;
+    
+    CleanUp();
+
+    if(iEnabledFeature < 0) 
+        {
+        TInt leaveError = iEnabledFeature;
+        iEnabledFeature = feature;
+        User::Leave(leaveError);
+        }
+        
+    iContentHandler->EndDocument();
+    }
+
+// protected helper
+void CSenXmlReader::RecreateParserL()
+    {
+    delete iParser;
+    iParser = NULL;
+
+    delete ipNsPrefixes;
+    ipNsPrefixes = NULL;
+    delete ipNsUris;
+    ipNsUris = NULL;
+
+#if defined(__SERIES60_30__)
+    // Use default MIME type
+    iParser = CParser::NewL(KXmlParserMimeType, *this);
+#else
+    CMatchData* pMatchData = CMatchData::NewL();
+    CleanupStack::PushL(pMatchData);
+    
+    pMatchData->SetMimeTypeL(KXmlParserMimeType);
+    pMatchData->SetVariantL(KXmlVariant);
+
+    iParser = CParser::NewL(*pMatchData, *this);
+    CleanupStack::PopAndDestroy(pMatchData);
+#endif
+
+    iParser->EnableFeature(iEnabledFeature);
+    }
+
+void CSenXmlReader::OnStartDocumentL(
+                                const RDocumentParameters& /* aDocParam */,
+                                TInt /* aErrorCode */)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnStartDocumentL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->StartDocument();
+    }
+
+void CSenXmlReader::OnEndDocumentL(TInt /* aErrorCode */)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnEndDocumentL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->EndDocument();
+    }
+
+
+void CSenXmlReader::OnStartElementL(const RTagInfo& aElement,
+                             const RAttributeArray& aAttributes,
+                             TInt /* aErrorCode */)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnStartElementL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+
+
+    const TPtrC8 localName = aElement.LocalName().DesC();
+    const TPtrC8 nsUri = aElement.Uri().DesC();
+    const TPtrC8 prefix = aElement.Prefix().DesC();
+
+    TPtrC8 qualifiedName = localName;
+
+    if (prefix != KNullDesC8)
+        {
+        HBufC8* pQName = HBufC8::NewLC(prefix.Length()+localName.Length()+
+                                        KSenColon().Length());
+        TPtr8 qName = pQName->Des();
+        qName.Append(prefix);
+        qName.Append(KSenColon);
+        qName.Append(localName);
+        qualifiedName.Set(qName);
+        }
+
+    if(ipNsPrefixes)
+        {
+        // there are namespaces to declare!
+
+        // make a new array for all attributes including namespace (to be added)
+        RAttributeArray attributesAndNamespaces;
+
+        CleanupClosePushL(attributesAndNamespaces);
+        TInt nsDeclarationCount(ipNsPrefixes->Count());
+        for(TInt i=0; i<nsDeclarationCount; i++)
+            {
+            // open and take ownership of RString - xmlnsAttrPrefix
+            RAttribute nsAttribute;
+            //CleanupClosePushL(nsAttribute);
+
+            TPtrC8 nsPrefix = ipNsPrefixes->MdcaPoint(i);
+            TPtrC8 nsURI =  ipNsUris->MdcaPoint(i);
+
+            if (nsPrefix != KNullDesC8)
+                {
+                nsAttribute.Open(iStringPool.OpenStringL(nsURI), 
+                                iStringPool.OpenStringL(KSenXmlns()),
+                                iStringPool.OpenStringL(nsPrefix),
+                                iStringPool.OpenStringL(nsURI) );
+
+                }
+            else
+                {
+                nsAttribute.Open(iStringPool.OpenStringL(nsURI),
+                            iStringPool.OpenStringL(KNullDesC8()),
+                            iStringPool.OpenStringL(KSenXmlns()),
+                            iStringPool.OpenStringL(nsURI) );
+
+                }   
+
+
+            // append the namespace attribute (declaration)
+            CleanupClosePushL(nsAttribute);
+            attributesAndNamespaces.AppendL(nsAttribute);
+            CleanupStack::Pop(); // nsAttribute
+            }
+
+        // the ns declarations have been done using NON-CANONIZING method
+        delete ipNsPrefixes;
+        ipNsPrefixes = NULL;
+        delete ipNsUris;
+        ipNsUris = NULL;
+
+
+
+        // append all other ("real") attributes
+        TInt count(aAttributes.Count());
+        for(TInt a=0; a<count; a++)
+            {
+            attributesAndNamespaces.AppendL(const_cast <RAttribute&> (aAttributes[a]).Copy());
+            }
+
+
+        // now give the stream content forward to the interested handler object.
+        // we have successfully added the namespace declaration as NON-canonized(!)
+        // attribute (if conditions have been met).
+        iContentHandler->StartElement(nsUri, localName, qualifiedName, attributesAndNamespaces);
+
+        // close the copied attributes previously added into this array as copies
+        count = attributesAndNamespaces.Count();
+        for(TInt j=0; j<count; j++)
+            {
+            attributesAndNamespaces[j].Close();
+            }
+        // close the actual array
+        CleanupStack::PopAndDestroy(); // attributesAndNamespaces.Close();
+        }
+    else
+        {
+        // give the original attributes to content handler (no new namespaces declared in attrs)
+        iContentHandler->StartElement(nsUri, localName, qualifiedName, aAttributes);
+        }
+    
+
+    // delete qualified element name, if one was allocated
+    if (prefix != KNullDesC8)
+        {
+        CleanupStack::PopAndDestroy(); // pQName
+        }
+
+
+    }
+
+
+
+void CSenXmlReader::OnEndElementL(const RTagInfo& aElement, TInt /* aErrorCode */)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnEndElementL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+
+
+    const TPtrC8 localName = aElement.LocalName().DesC();
+    const TPtrC8 nsUri = aElement.Uri().DesC();
+    const TPtrC8 prefix = aElement.Prefix().DesC();
+
+    TPtrC8 qualifiedName = localName;
+
+    if (prefix != KNullDesC8)
+        {
+        HBufC8* pQName = HBufC8::NewLC(prefix.Length()+localName.Length()+
+                                        KSenColon().Length());
+        TPtr8 qName = pQName->Des();
+        qName.Append(prefix);
+        qName.Append(KSenColon);
+        qName.Append(localName);
+        qualifiedName.Set(qName);
+        }
+
+
+    iContentHandler->EndElement(nsUri,
+                                localName,
+                                qualifiedName);
+
+    if (prefix != KNullDesC8)
+        {
+        CleanupStack::PopAndDestroy(); // pQName
+        }
+
+    }
+
+
+void CSenXmlReader::OnContentL(const TDesC8& aBytes, TInt /* aErrorCode */)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnContentL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->Characters(aBytes,0,aBytes.Length());
+    }
+
+
+void CSenXmlReader::OnStartPrefixMappingL(
+                                   const RString& aPrefix,
+                                   const RString& aUri,
+                                   TInt /*aErrorCode*/)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnStartPrefixMappingL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+
+    if(!ipNsPrefixes)
+        {
+        ipNsPrefixes = new (ELeave) CDesC8ArrayFlat(KArraySize);
+        }
+
+    if(!ipNsUris)
+        {
+        ipNsUris = new (ELeave) CDesC8ArrayFlat(KArraySize);
+        }
+
+    ipNsPrefixes->AppendL(aPrefix.DesC());
+    ipNsUris->AppendL(aUri.DesC());
+
+    iContentHandler->StartPrefixMappingL(aPrefix.DesC(), aUri.DesC());
+    }
+
+
+
+void CSenXmlReader::OnEndPrefixMappingL(const RString& aPrefix,
+                                        TInt /*aErrorCode*/)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnEndPrefixMappingL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->EndPrefixMappingL(aPrefix.DesC());
+    }
+
+
+void CSenXmlReader::OnIgnorableWhiteSpaceL(const TDesC8& aBytes,
+                                           TInt /*aErrorCode*/)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnIgnorableWhiteSpaceL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->OnIgnorableWhiteSpaceL(aBytes);
+    }
+
+
+void CSenXmlReader::OnSkippedEntityL(const RString& aName, TInt /*aErrorCode*/)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnSkippedEntityL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->SkippedEntity(aName.DesC());
+
+    //TInt retVal = iContentHandler->SkippedEntity(aName.DesC());
+    // content handler spesific code returned error
+    //User::LeaveIfError(retVal); 
+    }
+
+
+void CSenXmlReader::OnProcessingInstructionL(
+                                      const TDesC8& aTarget,
+                                      const TDesC8& aData,
+                                      TInt /*aErrorCode */)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("OnProcessingInstructionL: KErrSenXmlContentHandlerNotSet");
+        User::Leave(KErrSenXmlContentHandlerNotSet);
+        }
+    iContentHandler->ProcessingInstructions(aTarget, aData);
+    }
+
+// Note: Symbian XML framework error codes are listed in XmlFrameworkErrors.h
+void CSenXmlReader::OnError(TInt aErrorCode)
+    {
+#ifdef _SENDEBUG
+    // Symbian XML framework signals about some error:
+    SENDEBUG_L("CSenXmlReader::OnError");
+    SENDEBUG_L(" -Symbian XML framework signalled an error: ");
+    TBuf<32> buf;
+    buf.AppendNum(aErrorCode);
+    SENDEBUG((buf));
+#endif    
+ 
+     if(!iContentHandler)
+        {
+        SENDEBUG_L("OnError: KErrSenXmlContentHandlerNotSet");
+        // Cannot report any signalled error to content handler,
+        // since it has not been set. Force ParseL to leave by 
+        // setting spesific error code (KErrSenXmlContentHandlerNotSet)
+        iEnabledFeature = KErrSenXmlContentHandlerNotSet;
+        return;
+        }
+    TInt retVal(iContentHandler->Error(aErrorCode));
+
+#ifdef _SENDEBUG
+    // Symbian XML framework signals about some error:
+    SENDEBUG_L(" -Error() callback to content handler returned an error:");
+    TBuf<32> buf2;
+    buf2.AppendNum(retVal);
+    SENDEBUG((buf2));
+#endif    
+    retVal = 0; // not used in release builds
+
+    // In 3.0, iEnabledFeature member was used to indicate ParseL
+    // that it should leave(!). 
+    iEnabledFeature = aErrorCode;
+    }
+
+
+TAny* CSenXmlReader::GetExtendedInterface(const TInt32 aUid)
+    {
+    if(!iContentHandler)
+        {
+        SENDEBUG_L("GetExtendedInterface: KErrSenXmlContentHandlerNotSet");
+        return NULL;
+        }
+    return iContentHandler->GetExtendedInterface(aUid);
+    }
+
+
+EXPORT_C TInt CSenXmlReader::EnabledParserFeature()
+    {
+    return iEnabledFeature;
+    }
+
+
+TInt CSenXmlReader::SetParserFeature(TInt aParserFeature)
+    {
+    if(iParser)
+        {
+        iEnabledFeature = aParserFeature;
+        TInt retCode = iParser->EnableFeature(aParserFeature);
+        return retCode;
+        }
+    else
+        {
+        // internal error: iParser should always be available!
+        TInt leaveCode(KErrNone);
+        // try to re-instantiate the parser - once
+        TRAP(leaveCode, RecreateParserL());
+        if(leaveCode!=KErrNone)
+            {
+            return leaveCode;
+            }
+        iEnabledFeature = aParserFeature;
+        TInt retCode2 = iParser->EnableFeature(aParserFeature);
+        return retCode2;
+        }
+    }
+
+// DEPRECATED
+EXPORT_C TInt CSenXmlReader::ParserFeature()
+    {
+    return EnabledParserFeature();
+    }
+    
+void CSenXmlReader::CleanUp()
+    {
+    delete ipNsPrefixes;
+    ipNsPrefixes = NULL;
+    delete ipNsUris;
+    ipNsUris = NULL;
+#if defined(__SERIES60_30__)
+    delete iParser;
+    iParser = NULL;
+#endif // __SERIES_30__ defined
+    }
+
+void CSenXmlReader::CleanupParser(TAny* apReaderData)
+	{
+	TReaderData* pData = REINTERPRET_CAST(TReaderData*, apReaderData);
+	pData->ipReader->SetParserFeature(pData->iEnabledFeature);
+	delete pData;
+	}
+    
+// END OF FILE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webservices/wsxml/src/senxmlutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,525 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#include <utf.h>
+
+#include "SenXmlConstants.h"
+#include "SenXmlUtils.h"
+#include "SenElement.h"
+#include "SenBaseAttribute.h"
+
+#ifdef SYMBIAN_SECURE_ECOM 
+    // for 2.8, 3.0 or newer:
+    #include <xml/attribute.h> // needed for RAttributeArray
+#else // for 2.6 or olde
+    #include "Attribute.h"
+#endif
+
+using namespace Xml;
+
+EXPORT_C HBufC8* SenXmlUtils::ToUtf8LC(const TDesC16& aUnicodeString)
+    {
+    // 6 times multiplier is the worst case...
+    HBufC8* pBuf8 = HBufC8::NewLC(6 * aUnicodeString.Length());
+    TPtr8 des8 = pBuf8->Des();
+    TInt ret = CnvUtfConverter::ConvertFromUnicodeToUtf8(des8, aUnicodeString);
+    User::LeaveIfError(ret);
+
+    // Shrink allocated memory if possible
+    HBufC8* pReallocBuf8 = pBuf8->ReAlloc(pBuf8->Length());
+    if (pReallocBuf8 != NULL)
+        {
+        // It could reallocate
+        CleanupStack::Pop(); // pop pBuf8;
+        CleanupStack::PushL(pReallocBuf8);
+        pBuf8 = pReallocBuf8;
+        }
+    return pBuf8;
+    }
+
+EXPORT_C HBufC16* SenXmlUtils::ToUnicodeLC(const TDesC8& aUtf8String)
+    {
+    HBufC16* pBuf = HBufC16::NewLC(2 * aUtf8String.Length());
+    TPtr16 des = pBuf->Des();
+    TInt ret = CnvUtfConverter::ConvertToUnicodeFromUtf8(des, aUtf8String);
+    User::LeaveIfError(ret);
+    return pBuf;
+    }
+
+
+EXPORT_C TBool SenXmlUtils::StartsWith(const TDesC8& aDes,
+                                       const TDesC8& aPrefix)
+    {
+    if (aDes.Length() < aPrefix.Length())
+        {
+        return EFalse;
+        }
+    else
+        {
+        return (aDes.Left(aPrefix.Length()) == aPrefix);
+        }
+    }
+
+EXPORT_C TBool SenXmlUtils::EndsWith(const TDesC8& aDes,
+                                     const TDesC8& aPostfix)
+    {
+    if (aDes.Length() < aPostfix.Length())
+        {
+        return EFalse;
+        }
+    else
+        {
+        return (aDes.Right(aPostfix.Length()) == aPostfix);
+        }
+    }
+
+EXPORT_C TPtrC8 SenXmlUtils::NsPrefix(const TDesC8& aQName)
+    {
+    TInt colonPos = aQName.Find(KSenColon);
+    if (colonPos < 0)
+        {
+        return KNullDesC8();
+        }
+    else
+        {
+        return aQName.Left(colonPos);
+        }
+    }
+
+EXPORT_C TPtrC8 SenXmlUtils::LocalName(const TDesC8& aQName)
+    {
+    TInt colonPos = aQName.Find(KSenColon);
+    if (colonPos < 0)
+        {
+        return aQName;
+        }
+    else
+        {
+        return aQName.Mid(colonPos + 1);
+        }
+    }
+
+EXPORT_C TPtrC8 SenXmlUtils::AttrValue( const RAttributeArray& aAttributes,
+                                        const TDesC8& aAttrName)
+    {
+    TInt count(aAttributes.Count());
+    for (TInt i=0; i<count;i++)
+        {
+        if (aAttributes[i].Attribute().LocalName().DesC() == aAttrName)
+            {
+            return aAttributes[i].Value().DesC();
+            }
+        }
+    return KNullDesC8();
+    }
+
+//EXPORT_C TPtrC8 SenXmlUtils::AttrType(const RAttributeArray& aAttributes,
+//                                        const TDesC8& aAttrName)
+//  {
+//  TInt count(aAttributes.Count());
+//  for (TInt i=0; i<count;i++)
+//      {
+//      if (aAttributes[i].Attribute().LocalName().DesC() == aAttrName)
+//          {
+//          return aAttributes[i].Type().DesC();
+//          }
+//      }
+//  return KNullDesC8();
+//  }
+
+EXPORT_C void SenXmlUtils::BuildQNameL( const TDesC8& aPrefix,
+                                        const TDesC8& aLocalName,
+                                        HBufC8*& aQName)
+    {
+    aQName = HBufC8::NewLC( aPrefix.Length()+KSenColon().Length()
+                            +aLocalName.Length() );
+    if (aPrefix != KNullDesC8)
+        {
+        aQName->Des().Append(aPrefix);
+        aQName->Des().Append(KSenColon);
+        }
+    aQName->Des().Append(aLocalName);
+    CleanupStack::Pop();
+
+    }
+
+EXPORT_C TBool SenXmlUtils::EncodeHttpCharactersL(const TDesC8& aOriginal,
+                                                     HBufC8*& aEncoded)
+    {
+    TBool retVal = EFalse;
+    delete aEncoded;
+    aEncoded = NULL;
+
+    if (aOriginal == KNullDesC8)
+        {
+        return retVal;
+        }
+    TPtrC8 tokens[] =
+        {
+        KSenEscapedAmp(),
+        KSenEscapedApos(),
+        KSenEscapedDblQuot(),
+        KSenEscapedGt(),
+        KSenEscapedLt()
+        };
+    TText16 tokenChars[] =
+        {
+        '&',
+        '\'',
+        '\"',
+        '>',
+        '<'
+        };
+    
+    // Replace escaped characters, if any
+    for (TInt i = 0; i < aOriginal.Length(); i++)
+        {
+        TBool foundChar = EFalse;
+        for (TUint j = 0; j < (sizeof(tokenChars) / sizeof(TText16)); j++)
+            {
+            if (aOriginal[i] == tokenChars[j])
+                {
+                if (!aEncoded)
+                    {
+                    aEncoded =
+                        HBufC8::NewL(aOriginal.Length() * KSenMaxXmlEscapedLength);
+                    aEncoded->Des().Append(aOriginal.Left(i));
+                    }
+                foundChar = ETrue;
+                aEncoded->Des().Append(tokens[j]);
+                retVal = ETrue; // indicate, that encoding was done
+                break;
+                }
+            }
+        if (!foundChar)
+            {
+            if (aEncoded)
+                {
+                
+                aEncoded->Des().Append(aOriginal[i]);
+                }
+            }
+        }
+
+    return retVal;
+    }
+
+EXPORT_C HBufC8* SenXmlUtils::EncodeHttpCharactersLC( const TDesC8& aOriginal )
+    {
+    HBufC8* pDecoded = NULL;
+    if (!EncodeHttpCharactersL(aOriginal, pDecoded))
+        {
+        // if anything was allocated (never in current implementation)
+        delete pDecoded; 
+        pDecoded = NULL;
+
+        // make a copy of original, so that caller always knows that
+        // there is something from which to take ownership.
+        pDecoded = aOriginal.AllocL();
+        }
+    CleanupStack::PushL(pDecoded);
+    return pDecoded;
+    }
+
+TBool SenXmlUtils::ReplaceAll(TPtr8 aDestination,
+                              const TDesC8& aFrom,
+                              const TDesC8& aTo)
+    {
+    TInt retVal(EFalse);
+    
+    TInt pos = aDestination.Find(aFrom);
+    if (pos != KErrNotFound) retVal = ETrue;
+    
+    while (pos != KErrNotFound)
+        {
+        aDestination.Replace(pos,aFrom.Length(),aTo);
+        pos = aDestination.Find(aFrom);
+        }
+
+    return retVal;
+    }
+/**
+ * DecodeHttpCharactersL() returns ETrue, if any XML escaping
+ * (some Basic Entity) character-sequence was decoded.
+ *
+ * Note that aDecoded points to a copy of the original string
+ * even if there were no basic entities to decode. Otherwise,
+ * it points to a newly allocated descriptor, where some
+ * basic entity or entities has been decoded (replaced) from
+ * aOriginal descriptor.
+ * 
+ */
+EXPORT_C TBool SenXmlUtils::DecodeHttpCharactersL( const TDesC8& aOriginal,
+                                                   HBufC8*& aDecoded )
+    {
+    delete aDecoded;
+    aDecoded = NULL;
+
+    // make a copy of the original
+    aDecoded = aOriginal.AllocL();
+
+    TBool retVal(EFalse);
+
+
+    // replace all five basic entities with XML escaping counterpart,
+    // if found.
+    if (ReplaceAll(aDecoded->Des(), KSenEscapedAmp(), KSenAmpersandDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KSenEscapedApos(), KSenAposDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KSenEscapedDblQuot(), KSenDblQuotDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KSenEscapedGt(), KSenGtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KSenEscapedLt(), KSenLtDesC8()))
+        {
+        retVal = ETrue;
+        }
+
+    return retVal;
+    }
+
+/**
+* In Symbian OS v9.1, see
+* Location: EscapeUtils.h 
+* Link against: inetprotutil.lib 
+*
+*/
+EXPORT_C HBufC8* SenXmlUtils::DecodeHttpCharactersLC(const TDesC8& aOriginal)
+    {
+    HBufC8* pDecoded = NULL;
+
+    // Attempt to decode. Note, that even if no Basic Entities were
+    // decoded into XML escaping characters (&,',",< or >), this
+    // function will return a pointer to a copy of the original
+    // descriptor.
+    DecodeHttpCharactersL(aOriginal, pDecoded);
+
+    // Push to cleanup stack
+    CleanupStack::PushL(pDecoded);
+    return pDecoded;
+    }
+
+EXPORT_C HBufC8* SenXmlUtils::AllocAttrValueL(  const RAttributeArray& apAttrs,
+                                                const TDesC8& aAttrName )
+    {
+    TPtrC8 p = AttrValue(apAttrs, aAttrName);
+    if (p == KNullDesC8)
+        {
+        return NULL;
+        }
+    else
+        {
+        return p.AllocL();
+        }
+    }
+
+// the non-optimized version:
+/* 
+EXPORT_C void SenXmlUtils::LeaveOnXmlEscapesL(const TDesC8& aCandidate)
+    {
+    HBufC8* pValidator = NULL;
+    
+    // check if there are any XML escaping character by calling
+    // basic entity encoding function. 
+    TBool containsEscapes = SenXmlUtils::EncodeHttpCharactersL(aCandidate, pValidator);
+
+    delete pValidator;
+
+    if(containsEscapes)
+        {
+        // some XML-escaping character was found.
+        // Indicate with Leave, that the given 
+        // aChars descriptor is illegal, because
+        // it contained invalid characters
+        User::Leave(KErrSenInvalidCharacters);
+        }
+    }
+*/
+
+// Optimized, but not throughoutly tested version.
+// Based on UPnP project optimizations (2005-10-13).
+
+EXPORT_C void SenXmlUtils::LeaveOnXmlEscapesL(const TDesC8& aCandidate)
+    {
+    // these are the escapes which are searched after
+    TText16 tokenChars[] =
+        {
+        '&',
+        '\'',
+        '\"',
+        '>',
+        '<'
+        };
+    
+    // Search for XML escaping characters
+    for (TInt i=0; i<aCandidate.Length(); i++)
+        {
+        for (TUint j = 0; j < (sizeof(tokenChars) / sizeof(TText16)); j++)
+            {
+            if (aCandidate[i] == tokenChars[j])
+                {
+                // some XML-escaping character was found.
+                // Indicate with Leave, that the given 
+                // aChars descriptor is illegal, because
+                // it contained invalid characters
+                User::Leave(KErrSenInvalidCharacters);
+                }
+            }
+        }
+    }
+
+void SenXmlUtils::LeaveOnInvalidElementNameL(const TDesC8& aCandidate)
+    {
+    if (aCandidate == KNullDesC8)
+        {
+        User::Leave(KErrSenZeroLengthDescriptor);
+        }
+    SenXmlUtils::LeaveOnXmlEscapesL(aCandidate);
+    }
+
+EXPORT_C CSenBaseAttribute* SenXmlUtils::RemoveAttributeL(CSenElement& aElement,
+                                                          const TDesC8& aAttrName)
+    {
+    CSenBaseAttribute* pAttribute = SenXmlUtils::FindAttrL( aElement, aAttrName );
+    if ( pAttribute )
+        {
+        RPointerArray<CSenBaseAttribute>& attributes = aElement.AttributesL();
+        
+        TInt index(attributes.Find(pAttribute));
+        if ( index != KErrNotFound )
+            {
+            attributes.Remove(index); // release ownership
+            }
+        else
+            {
+            // should never occur:
+            pAttribute = NULL; // ownership could not be transferred..
+            }
+        }
+
+    return pAttribute;
+    }
+
+EXPORT_C CSenBaseAttribute* SenXmlUtils::RemoveAttributeL(CSenElement& aElement,
+                                                          CSenBaseAttribute* apAttribute)
+    {
+    return SenXmlUtils::RemoveAttributeL(aElement, apAttribute->Name());
+    }
+    
+CSenBaseAttribute* SenXmlUtils::FindAttrL( CSenElement& aElement,
+                                           const TDesC8& aName )
+    {
+    RPointerArray<CSenBaseAttribute>& attributes = aElement.AttributesL();
+    
+    TInt count(attributes.Count());
+    for (TInt i = 0; i < count; i++)
+        {
+        CSenBaseAttribute* pAttribute = attributes[i];
+        if ( pAttribute->Name() == aName )
+            {
+            return pAttribute;
+            }
+        }
+
+    return NULL;
+    }
+
+EXPORT_C const TDesC8& SenXmlUtils::AddAttributeL(CSenElement& aElement,
+                                                  const TDesC8& aQName,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aValue)
+    {
+    // first we check for possible namespace declarations...
+    if ( aQName == KSenXmlns || aLocalName == KSenXmlns)
+        {
+        // this is a default name space declaration
+        aElement.SetNamespaceL(aValue);
+        }
+    else if (aLocalName == aElement.NsPrefix())
+        {
+        //we have a new declaration for the namespace of this element
+        aElement.SetNamespaceL(aLocalName, aValue);
+        }
+    else if(aQName.Find(KSenXmlNsAttNamePlusColon) == 0)
+        {
+        // we have an additional namespace declaration
+        aElement.AddNamespaceL(aLocalName, aValue);
+        }
+    else
+        {
+        // we have a real attribute!
+        CSenBaseAttribute* pAttribute = CSenBaseAttribute::NewL(aQName,
+                                                                aLocalName,
+                                                                aValue);
+        AddAttributeL(aElement, pAttribute);
+        }
+    return aValue;
+    }
+
+EXPORT_C const TDesC8& SenXmlUtils::AddAttributeL(CSenElement& aElement,
+                                                  const TDesC8& aAttrName,
+                                                  const TDesC8& aValue)
+    {
+    // note, the aAttrName may be a qualified name or simply localname
+    // strip off the possible prefix from possible qualified name:
+    TPtrC8 localName = SenXmlUtils::LocalName(aAttrName);
+    return AddAttributeL(aElement, aAttrName, localName, aValue);
+    }
+    
+EXPORT_C const TDesC8& SenXmlUtils::AddAttributeL(CSenElement& aElement,
+                                                  CSenBaseAttribute* apAttribute)
+    {
+    CSenBaseAttribute* pOldAtt = FindAttrL( aElement, apAttribute->Name() );
+
+    if(!pOldAtt)
+        {
+        // transfrer the ownership to this class:
+        RPointerArray<CSenBaseAttribute>& attributes = aElement.AttributesL();
+#ifdef EKA2
+        attributes.AppendL(apAttribute);
+#else
+        User::LeaveIfError(attributes.Append(apAttribute));
+#endif // EKA2
+        return apAttribute->Value();
+        }
+    else
+        {
+        pOldAtt->SetValueL(apAttribute->Value());
+        delete apAttribute;
+        apAttribute = NULL;
+        return pOldAtt->Value();
+        }
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Includes all the SDK API specific bld.inf files, which 
+*                export files.
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "../web_service_description_api/group/bld.inf"
+#include "../web_service_connection_api/group/bld.inf"
+#include "../web_service_manager_api/group/bld.inf"
+#include "../hostlet_connection_api/group/bld.inf"
+#include "../web_service_messaging_api/group/bld.inf"
+#include "../xml_extensions_api/group/bld.inf"
+#include "../xml_fragment_api/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                Web Service Hostlet Connection API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_EXPORTS
+
+../inc/SenHostletConnection.h   	MW_LAYER_PUBLIC_EXPORT_PATH(SenHostletConnection.h)  
+../inc/MSenHostlet.h            	MW_LAYER_PUBLIC_EXPORT_PATH(MSenHostlet.h)
+../inc/MSenHostletRequest.h     	MW_LAYER_PUBLIC_EXPORT_PATH(MSenHostletRequest.h)
+../inc/MSenHostletResponse.h    	MW_LAYER_PUBLIC_EXPORT_PATH(MSenHostletResponse.h)    
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/hostlet_connection_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<api id="070c17dd2f853bdd42e9fd549ccb4de9" dataversion="1.0">
+<name>Hostlet Connection API</name>
+<description>API for applications to provide locally invocable services to service consumers. Any service provided by a hostlet is identified by unique endpoint and/or contract URI.</description>
+<type>c++</type>
+<collection>webservices</collection>
+<libs><lib name="senhostconn.lib"/>
+</libs>
+<release category="public" sinceversion="5.0"/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/inc/MSenHostlet.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Hostlet call back interface
+*
+*/
+
+
+#ifndef M_SEN_HOSTLET_H
+#define M_SEN_HOSTLET_H
+
+//  INCLUDES
+#include <e32base.h> // for CBase
+#include <badesca.h>
+
+#include <MSenHostletRequest.h>
+#include <MSenHostletResponse.h>
+#include <SenXmlServiceDescription.h>
+#include <SenServiceConnection.h> 
+
+// FORWARD DECLARE
+
+// CLASS DECLARATION
+class MSenHostlet
+    {
+    public:
+        /**
+         * Main method for receiving incoming messages, which are typically SOAP / XML,
+         * and for providing service for these requests.
+         *  @param aRequestUtf8 the request that needs to be be processed by the
+         *   hostlet application (local service provider).
+         *  @param aResponse is where response data is to be set. 
+         *   CSenHostletConnection::ResponsdL should be called 
+         *   in order to send the response back to the requester
+         *   (service consumer).
+         */
+        virtual TInt ServiceL(MSenHostletRequest& aRequest, MSenHostletResponse& aResponse) = 0;
+
+        /**
+        * Defines the service endpoint for this hostlet
+        * @return endpoint that this hostlet has specified. If hostlet
+        * implementation does not wish to define any endpoint, but to
+        * use contract only, it should return KNullDesC8 (zero-length descriptor).
+        * In such case, CSenHostletConnection constructor will attempt to resolve
+        * secure identifier (UID3) of the application, and use that to generate
+        * a locally unique endpoint. If the UID3 is not available, then the
+        * constructor of CSenHostletConnection will leave with the following
+        * error code: KErrSenNoContractNoEndPoint     
+        *
+        * Note: Hostlets, which don't provide endpoint and don't have UID3, cannot 
+        * create hostlet connection: instead, CSenHostletConnection constructor
+        * will leave with the following code: KErrSenNoContractNoEndPoint
+        *
+        * If endpoint is not specified, hostlet connection itself
+        * will generate an endpoint from applications secure ID (UID3) if such is available,
+        * and consumers can invoke the service via the provided contract ("service type" 
+        * identifier).
+        *
+        */
+        virtual TPtrC8 Endpoint() const = 0;
+
+        /**
+        * Defines the service constract URI for this hostlet
+        * @return the URI identifier for the provided service, for example
+        * "urn:liberty:id-sis-pp:2003-08". Note that there might be multiple
+        * hostlets (local service providers) which all share common service
+        * type, that is, they all have same service contract URI.
+        *
+        * Note: Hostlets, which don't provide endpoint and don't have UID3, cannot 
+        * create hostlet connection: instead, CSenHostletConnection constructor
+        * will leave with the following error code: KErrSenNoContractNoEndPoint
+        */
+        virtual TPtrC8 Contract() const = 0;
+
+        /**
+        * Defines the framework for this hostlet.
+        * @return the framework ID. Default inline implementation 
+        * returns RESTful service invocation framework ID, 
+        * KDefaultRestServicesFrameworkID, as defined in SenServiceConnection.h
+        */
+        inline virtual TPtrC8 FrameworkId() const { return KDefaultRestServicesFrameworkID(); }
+
+        /**
+        * Each Hostlet implementation may further describes its service via this callback.
+        * @param aSD is the description, where service specific attributes can be defined.
+        * Default, inline implementation sets the endpoint, contract and framework ID
+        * by calling the other, more simple callbacks.
+        *
+        * It is mandatory for each hostlet to define either endpoint or contract.
+        * Otherwise, the constuctor of CSenHostletConnection will leave with the
+        * following error code:
+        *     KErrSenNoContractNoEndPoint - neither endpoint or contract was 
+        *     specified. This is illegal, since the service would lack an identifier. 
+        * 
+        * @param aSD is the service description into which this hostlet may further
+        * define other service specific information, like facets. Note that this 
+        * call back is "stronger" than Endpoint() and Contract(), and thus any
+        * value specified in this method will be in effect for the hostlet connection.
+        */
+        inline virtual void DescribeServiceL(CSenXmlServiceDescription& aSD) 
+            { 
+            aSD.SetEndPointL(Endpoint());
+            aSD.SetContractL(Contract()); 
+            aSD.SetFrameworkIdL(FrameworkId());
+            } 
+
+        /**
+        * This callback function is invoked each time when any hostlet connection's
+        * asynchronous RespondL is completed. Method can be used to trigger the 
+        * release of some response releated system resources, as it is invoked 
+        * after the response has been delivered to the consumer (application
+        * may wish to close handles to reserved file or memory).
+        *
+        * @param aTxnId identifies what transaction (service message) was completed
+        * @param aCompletionCode indicates whether transaction completed ok (KErrNone)
+        * or not (error code).
+        * @param aDesc may provide additional information about completed transaction,
+        * typically this description is provided, if an error has occured.
+        * It is optional for hostlet implementation to implement this method. 
+        */
+        inline virtual void OnServiceCompleteL(TInt /* aTxnId */, 
+                                               TInt /* aCompletionCode */, 
+                                               const TDesC8& /* aDesc*/ ) { ; }
+                                             
+				/**
+        * Hostlet connection calls this method several times, passing a different
+        * UID per each call. If application wants to provide particular interface
+        * to hostlet connection (web services stack), it needs to return a pointer
+        * to such M-class as a return value of this method. For any interface, that
+        * application has not implemented, it is supposed to return NULL.
+        * @param aUID is the unique identifier of some interface
+        * @return value should be a valid (void) pointer to any interface implemented
+        * by the application. NULL signalizes that application does not provide interface
+        * for give UID. 
+        */    
+	    inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; };                                             
+    };
+
+
+#endif // M_SEN_HOSTLET_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/inc/MSenHostletRequest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Hostlet request call back interface      
+*
+*/
+
+#ifndef MSEN_HOSTLET_REQUEST_H
+#define MSEN_HOSTLET_REQUEST_H
+
+#include <e32base.h>
+
+#include <MSenProperties.h>
+
+// FORWARD DECLARATIONS
+class CSenIdentifier;
+
+class MSenHostletRequest
+    {
+    public:
+        /**
+        * Getter for the request - it may either be plain (SOAP) request body,
+        * or complete request including all the (SOAP) headers, depending
+        * of whether or not the provider wishes to receive complete client
+        * messages.
+        * @see MSenProvider for more information about complete client
+        *      messages facet.
+        */
+        virtual TPtrC8 RequestUtf8() const = 0;
+
+        /**
+        * Getter for requester's thread ID
+        */
+        virtual TPtrC ThreadId() const = 0;
+
+        /** 
+        * Getter for requester's consumer ID
+        */
+        virtual TPtrC8 ConsumerId() const = 0;
+
+        /** 
+        * Getter for request ID (transaction ID)
+        */
+        virtual TInt RequestId() const = 0;
+        
+        /**
+        * Getter for request's properties and properties type
+        * @param aType provides the (class) type of the retuned properties.
+        * This enum can be used to select corresponding properties class
+        * to de-serialize the properties descriptor into a more convenient
+        * properties class instance.
+        * @return the (transport) properties associated with this message.
+        */
+        virtual TPtrC8 Properties(MSenProperties::TSenPropertiesClassType& aType) const = 0;
+
+        //virtual const CSenIdentifier& Requester() const = 0;
+    };
+
+#endif // MSEN_HOSTLET_REQUEST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/inc/MSenHostletResponse.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Hostlet response call back interface        
+*
+*/
+
+
+#ifndef MSEN_HOSTLET_RESPONSE_H
+#define MSEN_HOSTLET_RESPONSE_H
+
+#include <e32base.h>
+
+// FORWARD DECLARE
+class MSenProperties;
+class MSenMessage;
+
+
+class MSenHostletResponse
+    {
+    public:
+        /**
+        *  Set the response
+        * @param aResponseUtf8 is the response that this hostlet is providing
+        * @param aCode can be set to error code, in case that request is not
+        * accepted by this hostlet.
+        * @param aResponseProperties may be provided in order to pass (transport)
+        * properties with the response.
+        * @param aResponseMessage may be provided in order to pass concrete
+        * message object with the response (like libxml2 based SOAP-ENV,
+        * CSenSoapEnvelope2)
+        */
+        virtual void SetResponseUtf8L(const TDesC8& aResponseUtf8, 
+                                      const TInt aResponseCode = KErrNone, 
+                                      MSenProperties* aResponseProperties = NULL,
+                                      MSenMessage* apMessage = NULL) = 0;
+        
+        /**
+        * Getter for request (transaction) ID
+        * @return the id of the request to which this is a response for
+        */ 
+        virtual TInt RequestId() const = 0;
+        
+        /**
+        * Getter for response data
+        * @return the set response as UTF-8 descriptor
+        */
+        virtual TPtrC8 ResponseUtf8() = 0;
+
+        /**
+        * Getter for response code
+        * @return the response code (KErrNone or some error) that hostlet has provided
+        */
+        virtual TInt ResponseCode() const = 0;
+        
+        /**
+        * Getter for response properties
+        */
+        virtual MSenProperties* ResponseProperties() = 0;
+    };
+
+#endif // MSEN_HOSTLET_RESPONSE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/inc/SenHostletConnection.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenHostletConnection offers public API for
+*                applications to to provide locally, invocable
+                 services (identified by unique endpoint URI)
+                 to service consumers.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_HOSTLET_CONNECTION_H
+#define SEN_HOSTLET_CONNECTION_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+
+#include <MSenHostlet.h>
+#include <MSenServiceDescription.h>
+#include <SenServiceConnection.h>
+#include <SenSoapEnvelope.h>
+#include <SenFragment.h>
+
+// CONSTANTS
+
+const TInt KErrSenEndpointReserved                   =  -30317;
+
+
+// FORWARD DECLARATIONS
+class CSenServicePattern;
+
+// CLASS DECLARATION
+class CSenHostletConnection : public CActive
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Constructs a new hostlet connection, utilizing the service description
+        * provided by MSenHostlet::ServiceDescriptionL() callback implementation.
+        * Leave codes:
+        * - KErrSenEndpointReserved if the endpoint specified in hostlet 
+        *   implementation already exists and is reserved for some other
+        *   use (hostlet).
+        * @return a pointer to a newly created hostlet connection
+        */
+        IMPORT_C static CSenHostletConnection* NewL(MSenHostlet& aProvider);
+
+        /**
+        * Constructs a new hostlet connection, utilizing the service description
+        * provided by MSenHostlet::ServiceDescriptionL() callback implementation.
+        * Leave codes:
+        * - KErrSenEndpointReserved if the endpoint specified in hostlet 
+        *   implementation already exists and is reserved for some other
+        *   use (hostlet).
+        * @return a pointer to a newly created hostlet connection, which is also
+        *  left on the cleanup stack.
+        */
+        IMPORT_C static CSenHostletConnection* NewLC(MSenHostlet& aProvider);
+
+        /**
+        * Method for responding to incoming message. This asynchronous method
+        * will send a response for the request that was received by the hostlet
+        * implementation in the ServiceL callback. After the response has been
+        * delivered to service consumer who made the request, the following
+        * callback will be invoked:
+        *       MSenHostlet::OnServiceCompleteL
+        * @return KErrNone, if response was successfully pre-processed by
+        * the hostlet connection - it does not mean, that it was yet 
+        * received by the consumer, as this method is asynchronous.
+        * If the response cannot be processed, some system-wide error
+        * code is returned.    
+        *         KErrAlreadyExists, if response was already provided 
+        *         for this request
+        */
+        virtual TInt RespondL(MSenHostletResponse& aResponse) = 0;
+        
+
+       /* Getter for full, (live) service desctiption for this hostlet connection */
+//       virtual TInt ServiceDescriptionL(CSenXmlServiceDescription*& apSessionDescription) = 0;
+
+        /**
+        * Getter for the identifier  of this connection.
+        * @return the identifier as integer.
+        */        
+        virtual TInt Identifier() = 0;
+
+           
+    protected:
+        /**
+        * C++ default constructor.
+        */
+        CSenHostletConnection();
+    
+    };
+
+#endif //SEN_HOSTLET_CONNECTION_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/bmarm/hostletconnectionu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2 @@
+EXPORTS
+	CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void)
Binary file websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/bwins/hostletconnectionbctestu.def has changed
Binary file websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/bwins/hostletconnectionu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/eabi/HostletConnectionBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI12CTestHostlet @ 3 NONAME ; #<TI>#
+	_ZTI13CTestConsumer @ 4 NONAME ; #<TI>#
+	_ZTV12CTestHostlet @ 5 NONAME ; #<VT>#
+	_ZTV13CTestConsumer @ 6 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+PRJ_EXPORTS
+testhc_c.bat		/epoc32/winscw/c/testhc_c.bat
+testhc_z.bat		/epoc32/winscw/c/testhc_z.bat
+testframework.ini		/epoc32/winscw/c/testframework/testframework_hostlet.ini
+
+PRJ_MMPFILES
+hostletconnection.mmp
+
+
+PRJ_TESTMMPFILES
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/hostletconnection.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for hostletconnection 
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          HostletConnectionBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY              ALL -TCB
+VENDORID        VID_DEFAULT  
+//VENDORID 0x70000001 
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+//TARGETPATH      ?target_path
+DEFFILE         HostletConnectionBCTest.def
+
+ 
+SOURCEPATH              ../src
+SOURCE          		hostletconnection.cpp
+SOURCE          		hostletconnectioncases.cpp
+SOURCE                  testconsumer.cpp
+SOURCE                  testhostlet.cpp
+
+USERINCLUDE	../inc
+
+SYSTEMINCLUDE       	/epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 stiftestinterface.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+//LIBRARY                 SenLogger.lib
+//LIBRARY                 SenProvider.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenHostConn.lib
+LIBRARY                 SenServConn.lib
+LIBRARY					avkon.lib 
+LANG            		SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= HostletConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\TestFramework_hostlet.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule HostletConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_HostConn.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_hostlet.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule HostletConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_HostConn.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/inc/senhostletconnectionbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,513 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenHostletConnection test module.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __SENHOSTLETCONNECTION_H__
+#define __SENHOSTLETCONNECTION_H__
+
+//  EXTERNAL INCLUDES
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+#include <MSenHostlet.h>
+#include <f32file.h>
+
+
+#include <SenXmlServiceDescription.h>
+#include <SenHostletConnection.h>
+
+
+#include <SenBaseElement.h>
+#include <SenSoapMessage.h>
+#include <SenDateUtils.h>
+
+//  INTERNAL INCLUDES
+
+//#include <e32def.h>
+//#ifndef NONSHARABLE_CLASS
+//    #define NONSHARABLE_CLASS(x) class x
+//#endif
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 50
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 6
+
+// Logging path
+_LIT( KSenHostletConnection_stifLogPath, "\\logs\\testframework\\SenHostletConnection_stif\\" ); 
+// Log file
+_LIT( KSenHostletConnection_stifLogFile, "SenHostletConnection_stif.txt" ); 
+
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenHostletConnection;
+class CSenHostletConnectionBCTest;
+class CTestConsumer;
+class CTestHostlet;
+
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenHostletConnectionBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenHostletConnectionBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+//  CLASS DEFINITIONS
+
+// FORWARD DECLARATIONS
+class CActiveConsumerTestTask;
+//class CSenHostletConnectionBCTest;
+
+NONSHARABLE_CLASS( TConsumerTestTask )
+    {
+    public:
+        enum TJob
+            {
+            ECreateConnAndSubmit = 0,
+            ESubmit,
+            EActiveSubmit
+            };
+    
+    
+        inline TConsumerTestTask(CSenServiceConnection& aConnection, const TDesC8& aWsRequest, const TDesC8& aFrameworkId, TJob aJob, HBufC8*& apResult)
+            : iConnection(aConnection),
+            iRequest(aWsRequest),
+            iFrameworkId(aFrameworkId),
+            iJob(aJob),
+            iStatusCode(KErrNone),
+            ipNotOwnedData(apResult),
+            ipSoapMsg(NULL)
+            {
+            }
+            
+        void Execute();
+
+
+    public: // Data (which is NOT OWNED, as this is a T-class)...      
+        CSenServiceConnection&      iConnection;
+        TPtrC8                      iRequest;
+        TPtrC8                      iFrameworkId;
+        TJob                        iJob;
+        TInt                        iStatusCode;
+        HBufC8*&                    ipNotOwnedData;
+        CActiveConsumerTestTask*    ipActive;
+        CSenHostletConnectionBCTest*       ipOwner;
+        TPtrC8                      iProperties;
+        TPtrC8                      iEndpoint;
+        CSenSoapMessage*            ipSoapMsg; // ... never & none owned.
+    };
+
+
+NONSHARABLE_CLASS( CActiveConsumerTestTask ) : public CActive
+    {
+    friend class CSenHostletConnectionBCTest;
+    
+    public:
+        enum TStatus
+            {
+            EInvokeService = 1,
+            EDeliverResponse
+            };    
+
+        static CActiveConsumerTestTask* NewL(TConsumerTestTask& aTask, const TDesC& aThreadName, CSenHostletConnectionBCTest& aOwner);
+        static CActiveConsumerTestTask* NewLC(TConsumerTestTask& aTask, const TDesC& aThreadName, CSenHostletConnectionBCTest& aOwner);
+        
+        ~CActiveConsumerTestTask();
+        
+        void RunL();
+        void DoCancel();
+
+    private:
+        void ConstructL(const TDesC& aThreadName);
+        CActiveConsumerTestTask(TConsumerTestTask& aTask, CSenHostletConnectionBCTest& aOwner);
+
+    public: // Data
+        TThreadId               iOwnerThreadId;
+
+
+    private: // Data
+        TConsumerTestTask&      iTask;
+        RThread                 iTaskThread;
+        CSenHostletConnectionBCTest&   iOwner;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  This a SenServiceManager_stif class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenHostletConnectionBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenHostletConnectionBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenHostletConnectionBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenServiceManager_stif. It is called once for every instance of 
+        *       TestModuleSenServiceManager_stif after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenServiceManager_stif.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenServiceManager_stif. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+         void StopActiveScheduler();
+         void StartActiveScheduler(TInt aNumberOfExpectedOperationsPriorStop);
+          				/**
+         * Method used to log version of test module
+         */
+        void SendTestModuleVersion();
+                              
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenHostletConnectionBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+
+
+	    friend class CTestConsumer;
+    	friend class CTestHostlet;
+    
+
+    public: // Public data => OK in testers, no benefit gained from getters => in real apps, these should be private:
+        CSenServiceConnection*      ipConnection;
+        CSenServiceConnection*      ipConnection1;
+        CSenHostletConnection*      ipHostletConnection;
+        CSenHostletConnection*      ipHostletConnection1;
+        CSenHostletConnection*		ipUsedHostletConnection;
+        
+
+    private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         static void UT_CSenHostletConnection_WSI_DescribeServiceL(CSenXmlServiceDescription&);
+         static void UT_CSenHostletConnection_WSI_DescribeService_2L(CSenXmlServiceDescription&);
+         static void UT_CSenHostletConnection_NewLL_SetStatus(CSenHostletConnectionBCTest* apTestSuite, TInt aStatus);
+         static void UT_CSenHostletConnection_NewLL_HandleMessageL(CSenHostletConnectionBCTest* apTestSuite, const TDesC8& aMessage );
+         static void UT_CSenHostletConnection_NewLL_HandleErrorL(CSenHostletConnectionBCTest* apTestSuite, const TInt aErrorCode, const TDesC8& aMessage );
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceL(CSenHostletConnectionBCTest* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceCompleteL(CSenHostletConnectionBCTest* apTestSuite, const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc );
+		 static TInt UT_CSenHostletConnection_NewLL_OnService1L(CSenHostletConnectionBCTest* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceComplete1L(CSenHostletConnectionBCTest* apTestSuite, const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc );
+		 static TInt UT_CSenHostletConnection_NewLL_OnService2L(CSenHostletConnectionBCTest* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+		 static TInt UT_CSenHostletConnection_NewLL_OnService3L(CSenHostletConnectionBCTest* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceComplete2L(CSenHostletConnectionBCTest* apTestSuite, const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc );                        
+         static void UT_CSenHostletConnection_NewLL_HandleError1L(CSenHostletConnectionBCTest* apTestSuite, const TInt aErrorCode, const TDesC8& aMessage );
+         static TInt UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL(CSenHostletConnectionBCTest* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+		 CSenSoapMessage* CreateAuthRequestLC();
+		         
+         TInt UT_CSenHostletConnection_NewLL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_NewLCL(TTestResult& aResult);
+        
+         TInt UT_CSenHostletConnection_NewLC_3InvokesL(TTestResult& aResult);
+        
+         TInt UT_CSenHostletConnection_RespondL1L(TTestResult& aResult);
+
+         TInt UT_CSenHostletConnection_RespondL2L(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_RespondL3L(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Negative_ResponseCodeL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_HC_SelfDef_URIL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Delete_HCL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Two_Equal_UID3L(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Two_Equal_EndpointsL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Two_HC_Two_SC1L(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Two_HC_Two_SC2L(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Two_HC_Two_SC3L(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_DeleteSC_before_HCRespondLL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_RespondL_4multipleTimesL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_SC_Cancel_After_RequestL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_Set_Expose_FacetL(TTestResult& aResult);
+         
+         TInt UT_CSenHostletConnection_RespondWithPropertiesL(TTestResult& aResult);
+
+         //TInt UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL(TTestResult& aResult);
+
+         TInt UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL(TTestResult& aResult);
+
+         TInt UT_CSenHostletConnection_Send_WSIL(TTestResult& aResult);
+
+         TInt UT_CSenHostletConnection_DescEndpoint_Send_WSIL(TTestResult& aResult);
+
+         TInt UT_CSenHostletConnection_2SC1HCL(TTestResult& aResult);
+
+         TInt UT_CSenHostletConnection_Submit_Rest_MultiThreadL(TTestResult& aResult); // Just for debugging, won't pass
+
+         TInt UT_CSenHostletConnection_Submit_Rest_ActiveL(TTestResult& aResult); // Just for debugging, won't pass
+         
+         // TInt UT_CSenHostletConnection_Submit_WSIL(TTestResult& aResult); // non-working version, just to keep note
+         TInt UT_CSenHostletConnection_IdentifierL(TTestResult& aResult);
+		 TInt UT_CSenHostletConnection_FrameworkIdL(TTestResult& aResult);
+		 TInt UT_CSenHostletConnection_RequestUtf8L(TTestResult& aResult);
+		 TInt UT_CSenHostletConnection_ThreadIdL(TTestResult& aResult);
+		 TInt UT_CSenHostletConnection_ConsumerIdL(TTestResult& aResult);
+		 TInt UT_CSenHostletConnection_RequestIdL(TTestResult& aResult);
+         
+
+    private:    // Data
+    
+        TInt                        iNumberOfPendingOps;
+        TInt                        iRespondRetCode;
+        TInt                        iNumOfReqs;
+        TBool                       iWas_HandleErrorL_Accessed;
+        TBool                       iWas_OnServiceL_Accessed;        
+        TInt                        iTxnID;       
+        
+        CTestConsumer*              ipConsumer;        
+        CTestConsumer*              ipConsumer1;        
+        CTestHostlet*               ipHostlet;
+		CTestHostlet*               ipHostlet1;   
+		
+		CActiveScheduler* iActiveScheduler;
+		
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+		// RThread                     iThread;
+    };
+
+#endif      //  __SENHOSTLETCONNECTION_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/inc/testconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  hostconn header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __TESTCONSUMER_H__
+#define __TESTCONSUMER_H__
+
+//  EXTERNAL INCLUDES
+#include <SenServiceConnection.h>
+
+//  INTERNAL INCLUDES
+
+//  FORWARD DECLARATIONS
+class CSenHostletConnectionBCTest;
+
+class CTestConsumer : public CBase, public MSenServiceConsumer
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static CTestConsumer* NewL(CSenHostletConnectionBCTest* aTestSuite,
+                                   void (*ap2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&) = NULL,
+                                   void (*ap2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&) = NULL,
+                                   void (*ap2SetStatus) (CSenHostletConnectionBCTest*, const TInt) = NULL);
+        static CTestConsumer* NewLC(CSenHostletConnectionBCTest* aTestSuite,
+                                   void (*ap2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&) = NULL,
+                                   void (*ap2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&) = NULL,
+                                   void (*ap2SetStatus) (CSenHostletConnectionBCTest*, const TInt) = NULL);
+        /**
+         * Destructor
+         */
+        ~CTestConsumer();
+
+        virtual void HandleMessageL(const TDesC8& aMessage);
+
+        virtual void HandleErrorL(const TInt aErrorCode,
+                                  const TDesC8& aMessage);
+
+        virtual void SetStatus(const TInt aStatus);
+
+    public: // Public data => OK in testers, no benefit gained from getters => in real apps, these should be private:
+        
+        RPointerArray<HBufC8>		iResponses; // ok/error => check iErrorCode to determine which
+        RPointerArray<CSenTransportProperties> iResponseProperties;
+        RArray<TInt> 				iResponseCodes;// either error code (if handle error) OR KErrNone (if handle message) 
+        TInt 						iConnectionStatus;
+        TInt 						iTxnId;
+        TInt                        iErrorCode;
+
+
+    private:    // Constructor
+        CTestConsumer(CSenHostletConnectionBCTest* aTestSuite,
+                      void (*ap2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&) = NULL,
+                      void (*ap2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&) = NULL,
+                      void (*ap2SetStatus) (CSenHostletConnectionBCTest*, const TInt) = NULL);
+
+    private:    // Data
+        CSenHostletConnectionBCTest*       ipTestSuite;
+        
+    private:    // Function pointers
+        void (*ip2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&);
+        void (*ip2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&);
+        void (*ip2SetStatus) (CSenHostletConnectionBCTest*, const TInt);
+    };
+
+#endif      //  __TESTCONSUMER_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/inc/testhostlet.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  hostconn header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __TESTHOSTLET_H__
+#define __TESTHOSTLET_H__
+
+//  EXTERNAL INCLUDES
+#include <senhostletconnectionbctest.h>
+
+#include <MSenProperties.h>
+
+//  INTERNAL INCLUDES
+
+//  FORWARD DECLARATIONS
+class CHostletConnectionBCTest;
+
+class CTestHostlet : public CBase, public MSenHostlet, public MSenHostletRequest
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static CTestHostlet* NewL(CSenHostletConnectionBCTest* aTestSuite,
+                                  TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&) = NULL,
+                                  TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&) = NULL,
+                                  void (*ap2DescribeServiceL) (CSenXmlServiceDescription&) = NULL);
+
+        static CTestHostlet* NewLC(CSenHostletConnectionBCTest* aTestSuite,
+                                   TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&) = NULL,
+                                   TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&) = NULL,
+                                   void (*ap2DescribeServiceL) (CSenXmlServiceDescription&) = NULL);
+
+        /**
+         * Destructor
+         */
+        ~CTestHostlet();
+        virtual void DescribeServiceL(CSenXmlServiceDescription& aSD);
+
+        virtual TPtrC8 Contract() const;
+
+        virtual TPtrC8 Endpoint() const;
+
+        virtual TInt ServiceL(MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+        virtual void OnServiceCompleteL(const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc);
+
+    public: // Public data => OK in testers, no benefit gained from getters => in real apps, these should be private:
+        CSenXmlServiceDescription*  ipHostletDescription;
+        RPointerArray<HBufC8>		iRequests;
+        RPointerArray<HBufC8>		iResponses;
+        RPointerArray<HBufC8>       iRequestProps;
+        RArray<MSenProperties::TSenPropertiesClassType> iRequestPropTypes;
+        RPointerArray<CSenTransportProperties> iResponseProps;
+        RArray<TInt>				iResponseCodes;
+        TInt                        iRespondRetCode; // direct retCode from RespondL (async)
+        RArray<TInt>                iCompletionCodes; // from OnServiceCompleteL => indicates how Respond operation was delivered
+        RArray<TInt>				iTxnIds;
+    
+    		inline virtual TPtrC8 FrameworkId() const 
+    		{ 
+    			return KDefaultRestServicesFrameworkID(); 
+    		}
+    //MSenHostletRequest
+            inline virtual TPtrC8 RequestUtf8() const 
+            {
+            	return _L8("");
+            }
+            inline virtual TPtrC ThreadId() const 
+            {
+            	return _L("");
+            }
+            inline virtual TPtrC8 ConsumerId() const 
+            {
+            	return _L8("");
+            }
+			inline virtual TInt RequestId() const 
+			{
+				return KErrNone;
+			}
+			inline virtual TPtrC8 Properties(MSenProperties::TSenPropertiesClassType& aType) const 
+			{
+				return _L8("");
+			}
+    private:    // Constructor
+        CTestHostlet(CSenHostletConnectionBCTest* aTestSuite,
+                     TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                     TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                     void (*ap2DescribeServiceL) (CSenXmlServiceDescription&));
+        void ConstructL();
+
+    private:    // Data
+        CSenHostletConnectionBCTest*       ipTestSuite;
+        
+    private:    // Function pointers
+        TInt (*ip2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&);
+        TInt (*ip2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&);
+        void (*ip2DescribeServiceL)(CSenXmlServiceDescription&);
+    };
+
+#endif      //  __TESTHOSTLET_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:        
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices hostlet"},(0x20015A25),3,0,0,TYPE=SA
+[0x101F7961],0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\HostletConnectionBCTest.dll"-"!:\sys\bin\HostletConnectionBCTest.dll"
+"\Epoc32\winscw\c\testhc_c.bat"-"!:\testHC.bat"
+"\Epoc32\winscw\c\testframework\testframework_hostlet.ini"-"!:\testframework\testframework_hostlet.ini"
\ No newline at end of file
Binary file websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,395 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenHostletConnection class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senhostletconnectionbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::CSenHostletConnectionBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenHostletConnectionBCTest::CSenHostletConnectionBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenHostletConnection_stifLogPath, 
+                          KSenHostletConnection_stifLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "KSenHostletConnection_stif logging starts!" );
+    iLog->Log( KLogStart );
+    
+    iActiveScheduler = new CActiveScheduler;
+	CActiveScheduler::Install( iActiveScheduler );
+
+    }
+//-----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::SendTestModuleVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("HostletConnectionBCTest.dll");
+	
+
+	TBool newVersionOfMethod = ETrue;
+	CTestModuleIf &test=TestModuleIf();
+	test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	test.SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenHostletConnectionBCTest* CSenHostletConnectionBCTest::NewL()
+    {
+    CSenHostletConnectionBCTest* self = new (ELeave) CSenHostletConnectionBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenHostletConnectionBCTest::~CSenHostletConnectionBCTest()
+    {
+    delete iLog;
+    
+    delete iActiveScheduler;
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenHostletConnectionBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenHostletConnectionBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenHostletConnectionBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+		SendTestModuleVersion();
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenHostletConnectionBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenHostletConnectionBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenHostletConnectionBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnectioncases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3186 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "senhostletconnectionbctest.h"
+
+#include <SenFacet.h>
+
+
+//  EXTERNAL INCLUDES
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+
+
+
+//  INTERNAL INCLUDES
+#include <SenHttpTransportProperties.h>
+#include "SenHostletConnection.h"
+#include "testconsumer.h"
+#include "testhostlet.h"
+
+#include <SenTransportProperties.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+#define LOCAL_VOID_ASSERT(expression)	{if(!(expression)){return ;}}
+
+namespace
+    {
+    _LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+    _LIT8(KHostletEndpoint1, "hostlet://UnitTestHostlet-1");
+    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+    _LIT8(KHostletContract1, "urn:nokia.com.serene:unit-test-hostlet-1");  
+    
+    void threadMainL(TAny* aPtr)
+        {
+        TConsumerTestTask* pTask = (TConsumerTestTask*) aPtr;
+        pTask->Execute();
+        // Go safely out of scope (will destroy this thread)
+        }
+    
+    TInt threadFunction(TAny* aPtr)
+        {
+        CTrapCleanup* pCleanup = CTrapCleanup::New();
+        CActiveScheduler::Install(NULL); // remove one
+        CActiveScheduler* pScheduler = new (ELeave) CActiveScheduler();
+        CActiveScheduler::Install(pScheduler);
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, threadMainL(aPtr));
+
+        CActiveScheduler::Install(NULL); // uninstall scheduler
+        delete pScheduler;
+        delete pCleanup;
+
+        return leaveCode;
+        }
+        
+        
+    TInt CreateThreadForConsumerTask(RThread& aThread, const TDesC& aThreadName, TConsumerTestTask& aTask)
+        {
+        TName threadName(aThreadName);
+        // Append a random number to make it unique
+        threadName.AppendNum(Math::Random(), EHex);
+                
+#ifdef EKA2
+        RAllocator& heap = User::Allocator(); // RHeap is deprecated in EKA2
+        return aThread.Create(threadName, // name
+                              threadFunction,
+                              KDefaultStackSize,
+                              &heap,
+                              &aTask);
+#else // EKA1
+        RHeap& heap = User::Heap();
+        return aThread.Create(threadName, // name
+                              threadFunction,
+                              KDefaultStackSize,
+                              &heap,
+                              &aTask);
+#endif // EKA        
+        }      
+    }   
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenHostletConnectionBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServiceManager_stif.cpp file and to SenServiceManager_stif.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServiceManagerBCTest::PrintTest. Otherwise the compiler
+        // gives errors.
+		ENTRY("NewL - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL),
+    
+		ENTRY("NewLC - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLCL),
+		
+		ENTRY("Identifier - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_IdentifierL), 
+		
+		ENTRY("FrameworkId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_FrameworkIdL), 
+		
+		ENTRY("RequestUtf8 - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestUtf8L), 
+		
+		ENTRY("ThreadId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_ThreadIdL), 
+
+		ENTRY("ConsumerId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_ConsumerIdL), 
+
+		ENTRY("RequestId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestIdL), 
+
+		ENTRY("NewLC - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLC_3InvokesL),
+
+		ENTRY("RespondL1 - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL1L),
+   
+		ENTRY("RespondL2 - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL2L),
+
+		ENTRY("RespondL3 - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL3L),
+
+		ENTRY("RespondL negative response code - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Negative_ResponseCodeL),
+    
+		ENTRY("RespondL self def URI - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_HC_SelfDef_URIL),
+/*    
+		ENTRY("RespondL delete HC after SC is created - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Delete_HCL),
+*/
+		ENTRY("NewL leaves with KErrSenEndpointReserved -CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_UID3L),
+         
+		ENTRY("RespondL Two HC with the same Endpoints UIDs - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_EndpointsL),    
+   
+		ENTRY("RespondL Two HC Two SC diff contracts - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC1L),    
+     
+		ENTRY("RespondL Two HC Two SC diff endpionts - CSenHostletConnectionBCTest",CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC2L),    
+
+		ENTRY("RespondL Two HC Two SC diff endpionts the same contract - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC3L),    
+      
+		ENTRY("RespondL Delete SC before calling HC::RespondL - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_DeleteSC_before_HCRespondLL),    
+
+		ENTRY("RespondL Call RespondL multipe times - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL_4multipleTimesL),    
+
+		ENTRY("RespondL SC::Cancel after request - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_SC_Cancel_After_RequestL),    
+    
+		ENTRY("RespondL Set Expose Facet - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Set_Expose_FacetL),    
+
+		ENTRY("HC responds with TP - ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL),    
+
+		//ENTRY("New REST SC + SubmitL Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL),    
+/*
+		ENTRY("New WS-I SC + SubmitL Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL),    
+
+
+		ENTRY("SendL WS-I Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Send_WSIL),    
+
+		ENTRY("Desc EP + SendL WS-I Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_DescEndpoint_Send_WSIL),    
+*/
+
+		ENTRY("SendL from 2 SCs to 1 HC - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_2SC1HCL), 
+
+/*
+// NOTE: following is used instead:
+// --> UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL 
+		ENTRY("SubmitL (multit.), Rest Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_MultiThreadL),    
+
+// NOTE: following is used instead:
+// --> UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL 
+		ENTRY("SubmitL (active), Rest Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_ActiveL),
+*/        
+	 	};
+
+	    // Verify that case number is valid
+	    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+	                               sizeof( TCaseInfoInternal ) )
+	        {
+	        // Invalid case, construct empty object
+	        TCaseInfo null( (const TText*) L"" );
+	        null.iMethod = NULL;
+	        null.iIsOOMTest = EFalse;
+	        null.iFirstMemoryAllocation = 0;
+	        null.iLastMemoryAllocation = 0;
+	        return null;
+	        } 
+
+	    // Construct TCaseInfo object and return it
+	    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+	    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+	    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+	    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+	    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+	    return tmp;
+
+	    }   
+
+//  METHODS
+
+void CSenHostletConnectionBCTest::SetupL ()
+    {
+    __UHEAP_MARK;
+    }
+
+void CSenHostletConnectionBCTest::Teardown ()
+    {
+//    User::After( 2 * 1000 * 1000 ); // temp tests
+    __UHEAP_MARKEND;
+    }
+
+void CSenHostletConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+void CSenHostletConnectionBCTest::StopActiveScheduler ()
+    {
+    iNumberOfPendingOps--;
+    if ( iNumberOfPendingOps == 0 )
+        {
+    	CActiveScheduler::Stop();
+        }
+    }
+
+void TConsumerTestTask::Execute()
+    {
+    switch(iJob)
+        {
+        case(ECreateConnAndSubmit): // this is a very oddly orientated, wild case..
+            {
+            if(ipOwner)
+                {
+                CTestConsumer* pConsumer = CTestConsumer::NewL(ipOwner); // uses the default implementations for setstatus, handlemessage, handleerror
+                CleanupStack::PushL(pConsumer);
+
+                // Note, if NOT set, iEndpoint is typically KNullDesC8 (zero-lenght), which is OK, too.
+                CSenServicePattern* pPattern = CSenServicePattern::NewLC(iEndpoint, KHostletContract);
+                if(iFrameworkId.Length()>0)
+                    {
+                    pPattern->SetFrameworkIdL(iFrameworkId);
+                    }
+                else
+                    {
+                    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);                        
+                    }
+                    
+                CSenServiceConnection* pConnection = CSenServiceConnection::NewL(*pConsumer, *pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                CleanupStack::PushL(pConnection);
+                
+                // Construct service connection by starting active scheduler..
+                ipOwner->StartActiveScheduler(1);
+                
+                // Check that NO HandleErrorL callback was received:
+                LOCAL_VOID_ASSERT( pConsumer->iErrorCode == KErrNone );
+                
+                
+                 // Check that the Status of the ServiceConnection
+                // is KSenConnectionStatusReady
+                LOCAL_VOID_ASSERT( pConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+                // execution returns here EITHER when HandleMessageL or HandleErrorL has been invoked..
+                if(iProperties.Length()==0)
+                    {
+                    if(ipSoapMsg)
+                        {
+                        iStatusCode = pConnection->SubmitL(*ipSoapMsg, ipNotOwnedData);
+                        }
+                    else
+                        {
+                        iStatusCode = pConnection->SubmitL(iRequest, ipNotOwnedData);
+                        }
+                    }
+                else
+                    {
+                    if(ipSoapMsg)
+                        {
+                        iStatusCode = pConnection->SubmitL(*ipSoapMsg, iProperties, ipNotOwnedData);
+                        }
+                    else
+                        {
+                        iStatusCode = pConnection->SubmitL(iRequest, iProperties, ipNotOwnedData);
+                        }
+                    }
+                CleanupStack::PopAndDestroy(pConnection);
+                CleanupStack::PopAndDestroy(pConsumer);
+                }
+           }
+           break;
+
+        case(ESubmit):
+            {
+            if(iProperties.Length()==0)
+                {
+                iStatusCode = iConnection.SubmitL(iRequest, ipNotOwnedData);
+                }
+            else
+                {
+                iStatusCode = iConnection.SubmitL(iRequest, iProperties, ipNotOwnedData);
+                }
+            }
+            break;
+
+        case(EActiveSubmit):
+            {
+            if ( ipActive)
+                {
+                // Perform blocking (sync) submit:
+                if(iProperties.Length()==0)
+                    {
+                    iStatusCode = iConnection.SubmitL(iRequest, ipNotOwnedData);
+                    }
+                else
+                    {
+                    iStatusCode = iConnection.SubmitL(iRequest, iProperties, ipNotOwnedData);
+                    }
+                    
+                // Notify "owner" that blocking operation has completed
+                TRequestStatus* status = &ipActive->iStatus;
+                RThread owner;
+                owner.Open(ipActive->iOwnerThreadId);
+                owner.RequestComplete(status, CActiveConsumerTestTask::EDeliverResponse );
+                }
+            }
+            break;
+           
+        }
+    }
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// HELPER CLASS for SC (active) tasks:
+// Public METHODS
+
+CActiveConsumerTestTask* CActiveConsumerTestTask::NewL(TConsumerTestTask& aTask, const TDesC& aThreadName, CSenHostletConnectionBCTest& aOwner)
+    {
+    CActiveConsumerTestTask* pNew = CActiveConsumerTestTask::NewLC(aTask, aThreadName, aOwner);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CActiveConsumerTestTask* CActiveConsumerTestTask::NewLC(TConsumerTestTask& aTask, const TDesC& aThreadName, CSenHostletConnectionBCTest& aOwner)
+    {
+    CActiveConsumerTestTask* pNew = new (ELeave) CActiveConsumerTestTask(aTask, aOwner);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aThreadName);
+    return pNew;
+    }
+
+CActiveConsumerTestTask::CActiveConsumerTestTask(TConsumerTestTask& aTask, CSenHostletConnectionBCTest& aOwner)
+    :   CActive(EPriorityStandard), 
+        iTask(aTask),
+        iOwner(aOwner)
+    {
+    CActiveScheduler::Add(this);    
+    }
+
+CActiveConsumerTestTask::~CActiveConsumerTestTask()
+    {
+    if(IsActive())
+        {
+        Cancel(); // issues DoCancel();
+        }
+    iTaskThread.Close();
+    }
+
+void CActiveConsumerTestTask::RunL()
+    {
+    switch(iStatus.Int())
+        {
+        case(EInvokeService):
+            {
+            iTaskThread.Resume();
+            }
+            break;
+            
+        case(EDeliverResponse):
+            {
+            iOwner.StopActiveScheduler(); // submit complete..
+            }
+            break;
+         /* case defaul: // unknown */
+        }
+    }
+void CActiveConsumerTestTask::DoCancel()
+    {
+    iOwner.StopActiveScheduler();
+    }
+    
+// Private METHODS
+void CActiveConsumerTestTask::ConstructL(const TDesC& aThreadName)
+    {
+    RThread thread;
+    iOwnerThreadId = thread.Id(); 
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(iTaskThread, aThreadName, iTask);        
+    User::LeaveIfError( createThreadRetVal );
+    SetActive();
+    }
+    
+    
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+void  CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeServiceL(CSenXmlServiceDescription& aSD)
+    {
+    aSD.SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    aSD.SetEndPointL(KHostletEndpoint);
+    aSD.SetContractL(KHostletContract);
+    }
+
+void  CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeService_2L(CSenXmlServiceDescription& aSD)
+    {
+    aSD.SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    aSD.SetContractL(KHostletContract);
+    }
+
+
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus(CSenHostletConnectionBCTest* apTestSuite,
+                                                                    TInt aStatus )
+   {
+    switch( aStatus )
+        {
+        case KSenConnectionStatusReady:
+            {
+            apTestSuite->StopActiveScheduler(); // otherwise failed SC construction is reported via HandleErrorL(!)
+            }
+            break;
+        case KSenConnectionStatusNew:
+        case KSenConnectionStatusExpired:
+        default:            
+            break;
+        }
+    }
+
+
+
+// not in use atm:
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL(CSenHostletConnectionBCTest* /* apTestSuite */, const TDesC8& /* aMessage*/ )
+    {
+    }
+
+//used by UT_CSenHostletConnection_Negative_ResponseCodeL
+//used by UT_CSenHostletConnection_Delete_HCL
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL(CSenHostletConnectionBCTest* apTestSuite, const TInt  /*aErrorCode*/ , const TDesC8& /* aMessage */)
+    {
+    apTestSuite->iWas_HandleErrorL_Accessed = ETrue;
+    }
+    
+//used by the UT_CSenHostletConnection_Negative_ResponseCodeL    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt alteredResponseCode = -148000;
+    _LIT8(KAlteredResponse, "<Response><ReplyMessage>Response Altered in UT_CSenHostletConnection_NewLL_OnServiceL.</ReplyMessage><Request>%S</Request></Response>");
+    apTestSuite->ipHostlet->iResponseCodes[apTestSuite->ipHostlet->iTxnIds.Count()-1] = alteredResponseCode;
+    aResponse.SetResponseUtf8L(KAlteredResponse, alteredResponseCode);
+    return KErrNone;
+    }
+    
+// not in use atm:    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL(CSenHostletConnectionBCTest* /* apTestSuite */, const TInt /* aTxnId */, TInt /* aCompletionCode */, const TDesC8& /* aDesc */ )
+    {
+    return KErrNone;
+    }    
+    
+//used by the UT_CSenHostletConnection_DeleteSC_before_HCRespondLL method
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService1L(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  /*aResponse*/ )
+    {
+    apTestSuite->ipConnection->Cancel();
+    delete apTestSuite->ipConnection;
+    apTestSuite->ipConnection = NULL;
+    return KErrNone;
+    }
+    
+//used by UT_CSenHostletConnection_DeleteSC_before_HCRespondLL
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete1L(CSenHostletConnectionBCTest* apTestSuite, const TInt /* aTxnId */, TInt /*aCompletionCode*/ , const TDesC8& /* aDesc */ )
+    {
+	apTestSuite->iWas_OnServiceL_Accessed = ETrue;
+    return KErrNone;
+    }        
+
+// used by the UT_CSenHostletConnection_RespondL_4multipleTimesL method
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService2L(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt respondRetCode = apTestSuite->ipHostletConnection->RespondL(aResponse);
+    TInt respondRetCode1 = apTestSuite->ipHostletConnection->RespondL(aResponse);
+	LOCAL_ASSERT(respondRetCode == KErrNone);    
+    LOCAL_ASSERT(respondRetCode1 == KErrAlreadyExists);
+    return KErrNone;
+    }
+    
+// to be used (currently does nothing) by the UT_CSenHostletConnection_RespondL_4multipleTimesL method    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete2L(CSenHostletConnectionBCTest* /* apTestSuite */, const TInt /* aTxnId */, TInt /*aCompletionCode*/ , const TDesC8& /* aDesc */ )
+    {
+    return KErrNone;
+    }        
+    
+//used by the UT_CSenHostletConnection_SC_Cancel_After_RequestL method
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleError1L(CSenHostletConnectionBCTest* apTestSuite, const TInt  /* aErrorCode */, const TDesC8& /* aMessage */)
+    {
+//    TInt a = aErrorCode;
+    apTestSuite->iWas_HandleErrorL_Accessed = ETrue;
+    }
+//used by the UT_CSenHostletConnection_SC_Cancel_After_RequestL method
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService3L(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  /*aResponse*/ )
+    {
+   // apTestSuite->ipConnection->Cancel();
+   //canceling request
+    apTestSuite->ipConnection->CancelTransaction(apTestSuite->iTxnID);
+    return KErrNone;
+    }
+
+
+//used by the UT_CSenHostletConnection_RespondWithPropertiesL method in order to provide transport properties with the response
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt txn =          apTestSuite->ipHostlet->iTxnIds.Count()-1;
+    TPtr8 response =    apTestSuite->ipHostlet->iResponses[txn]->Des();
+
+    TInt responseCode = apTestSuite->ipHostlet->iResponseCodes[txn];
+
+    CSenTransportProperties* pTransportProperties = CSenTransportProperties::NewLC();
+    _LIT8(KTestCid, "test:cid");
+    _LIT8(KTestFile, "c:\\test.file.txt");
+    pTransportProperties->SetFileAttachmentL( KTestCid, KTestFile );
+    
+    if( apTestSuite->ipHostlet->iResponseProps.Append( pTransportProperties ) )
+        {
+        // error:
+        CleanupStack::PopAndDestroy(pTransportProperties);
+        return KErrNoMemory;
+        }
+    else
+        {
+        // ok
+        CleanupStack::Pop(pTransportProperties);
+        aResponse.SetResponseUtf8L(response, responseCode, pTransportProperties); // by default, all requests are "accepted"
+        return KErrNone;
+        }
+    }
+
+
+
+//---------------------------------------------------------------
+// 							Test Cases
+//---------------------------------------------------------------
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLCL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewLC(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    CleanupStack::PopAndDestroy(ipHostletConnection);
+    //delete ipHostletConnection; 
+    //ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_IdentifierL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 framework = ipHostlet->FrameworkId();
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_FrameworkIdL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    _LIT8(KFramework, "REST");
+    TPtrC8 framework = ipHostlet->FrameworkId();
+    LOCAL_ASSERT( framework == KFramework);
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestUtf8L(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 request = ipHostlet->RequestUtf8();
+    LOCAL_ASSERT( request == _L8(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_ThreadIdL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC threadId = ipHostlet->ThreadId();
+    LOCAL_ASSERT( threadId == _L(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_ConsumerIdL(TTestResult& aResult)
+	{
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 consumerId = ipHostlet->ConsumerId();
+    LOCAL_ASSERT( consumerId == _L8(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestIdL(TTestResult& aResult)
+	{
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TInt requestId = ipHostlet->RequestId();
+    LOCAL_ASSERT( requestId == KErrNone);
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;		
+	}
+	
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLC_3InvokesL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send _two_ messages from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Abel\'] or containts[ab:N/ab:GIVEN,\'Abel\'] or containts[ab:TEL,\'Abel\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest2, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest3, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Clarice\'] or containts[ab:N/ab:GIVEN,\'Clarice\'] or containts[ab:TEL,\'Clarice\']]</ab:Select></ab:QueryItem></ab:Query>");
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+
+    // => Send first request to the Hostlet
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError2 = ipConnection->SendL(KRequest2);
+    
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError3 = ipConnection->SendL(KRequest3);
+
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  THREE TIMES (one call to ServiceL), respond to consumer THREE TIMES => six async calls:
+    StartActiveScheduler(6);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+	LOCAL_ASSERT(*ipHostlet->iRequests[0] == KRequest);
+	LOCAL_ASSERT(*ipHostlet->iRequests[1] == KRequest2);
+	LOCAL_ASSERT(*ipHostlet->iRequests[2] == KRequest3);
+	
+	// 2. Consumer receives response that hostlet provided
+	LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+	LOCAL_ASSERT( *ipConsumer->iResponses[1] == *ipHostlet->iResponses[1]);
+	LOCAL_ASSERT( *ipConsumer->iResponses[2] == *ipHostlet->iResponses[2]);
+
+    // 3. Hostlet receives completion code (delivery code)
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[1] == ipHostlet->iResponseCodes[1])
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[2] == ipHostlet->iResponseCodes[2])
+
+
+	LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError);
+	LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError2);
+	LOCAL_ASSERT( ipHostlet->iTxnIds[2] == transactionIdOrError3);
+
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL1L(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send _one_ message from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+    TPtrC8 propertiesAsXml = pPropsAsXml->Des();
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // 4. The properties that were sent via SC were received in HC
+    MSenProperties::TSenPropertiesClassType type = ipHostlet->iRequestPropTypes[0];
+    TPtrC8 properties = ipHostlet->iRequestProps[0]->Des();
+
+    LOCAL_ASSERT( properties == propertiesAsXml );
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    CleanupStack::PopAndDestroy( pProps );
+    
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL2L(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send _two_ messages from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+
+    // => Send first request to the Hostlet
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError2 = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  TWICE (one call to ServiceL), respond to consumer TWICE => four calls:
+    StartActiveScheduler(4);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+    LOCAL_ASSERT( *ipHostlet->iRequests[1] == KRequest);    
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( *ipConsumer->iResponses[1] == *ipHostlet->iResponses[1]);
+    
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[1] == ipHostlet->iResponseCodes[1])
+    
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError2)
+    
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[1] == KErrNone ); // true in this "OK" -test case   
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL3L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+    // Try to send _one_ message from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // Construct 2. ServiceConnection
+    CTestConsumer* pConsumer2 = CTestConsumer::NewLC(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    CSenServicePattern* pPattern2 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern2->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    CSenServiceConnection* pConnection2 = CSenServiceConnection::NewL(*pConsumer2, *pPattern2);
+    CleanupStack::PopAndDestroy(pPattern2);
+    CleanupStack::PushL(pConnection2);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( pConsumer2->iConnectionStatus == KSenConnectionStatusReady);
+    
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+    TPtrC8 propertiesAsXml = pPropsAsXml->Des();
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // 2. ServiceConnection is ready
+    // => Send 2. request to the Hostlet
+    TInt transactionIdOrError2 = pConnection2->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError2 > KErrNone);
+    
+    // Invoke service  TWICE (two calls to ServiceL), respond to consumer TWICE => four calls
+    StartActiveScheduler(4);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // 4. The properties that were sent via SC were received in HC
+    MSenProperties::TSenPropertiesClassType type = ipHostlet->iRequestPropTypes[0];
+    TPtrC8 properties = ipHostlet->iRequestProps[0]->Des();
+
+    LOCAL_ASSERT( properties == propertiesAsXml );
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    CleanupStack::PopAndDestroy( pProps );
+    
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    CleanupStack::PopAndDestroy(pConnection2);
+    CleanupStack::PopAndDestroy(pConsumer2);
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Negative_ResponseCodeL(TTestResult& aResult)
+    {
+	SetupL(); 
+       
+ 	iWas_HandleErrorL_Accessed = EFalse;
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+                                   NULL);
+
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+                                     NULL);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+	
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    
+    
+ 	// 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone );
+    
+    //4. HandleErrorL accesed after negative iResponseCodes
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+  
+    
+ 
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_HC_SelfDef_URIL(TTestResult& aResult)
+    {
+	SetupL(); 
+                                     
+  	ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+  	ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+  
+  	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);	
+  	ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+    
+
+  	CSenServicePattern* pPattern =
+		    CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);    
+   
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    
+    
+ 	// 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+   
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Delete_HCL(TTestResult& aResult)
+    {
+	SetupL(); 
+     
+    iWas_HandleErrorL_Accessed = EFalse;                              
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+                                     NULL);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    //delete Hostlet Connection
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    // ---- Following conditions MUST be met ----
+    LOCAL_ASSERT(transactionIdOrError == KErrSenHostNotAvailable);
+
+    // Start waiting for HandleError Callback which is caused
+    // by error in SendL
+    StartActiveScheduler(1);
+    // Callback was get => Check that callback was HandleError
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+  
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+*/
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_UID3L(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+ 	
+ 	//Check if CSenHostletConnection::NewL leaves with KErrSenEndpointReserved
+/*	EUNIT_ASSERT_SPECIFIC_LEAVE(ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet),KErrSenEndpointReserved);*/
+	TRAPD(res,ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet)) ;
+	User::LeaveIfError(res == KErrSenEndpointReserved);
+
+  
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+   
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_EndpointsL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+ 
+ 	//Check if CSenHostletConnection::NewL leaves with KErrSenEndpointReserved
+	/*EUNIT_ASSERT_SPECIFIC_LEAVE(ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet),KErrSenEndpointReserved);*/
+	TRAPD(res,ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet)) ;
+	User::LeaveIfError(res == KErrSenEndpointReserved);
+  
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+ 
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC1L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+	
+	
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+	ipHostlet1->ipHostletDescription->SetContractL(KHostletContract1);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract1);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1); 
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+      
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC2L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+	ipHostlet->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+	
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+	ipHostlet1->ipHostletDescription->SetEndPointL(KHostletEndpoint1);
+	ipHostlet1->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KHostletEndpoint1, KNullDesC8);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1);   
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC3L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+	ipHostlet->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 	
+    
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+	ipHostlet1->ipHostletDescription->SetEndPointL(KHostletEndpoint1);
+	ipHostlet1->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KHostletEndpoint1, KNullDesC8);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1);    
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady	
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady);     
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+    
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_DeleteSC_before_HCRespondLL(TTestResult& aResult)
+    {
+	SetupL(); 
+	iWas_OnServiceL_Accessed = false;     
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService1L,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete1L);
+
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(1);
+    
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+    
+	// 2. onServiceL accesed
+    LOCAL_ASSERT( iWas_OnServiceL_Accessed ); 
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] < KErrNone ); 
+
+    // --- Conditions END ---
+ 
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL; 
+    Teardown();
+    return KErrNone;
+    }
+
+      
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL_4multipleTimesL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService2L,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete2L);
+
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+   
+
+    // ---- Following conditions MUST be met ----
+    
+   
+    // --- Conditions END ---
+  
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL; 
+    Teardown();
+    return KErrNone;
+    }
+     
+
+
+
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_SC_Cancel_After_RequestL(TTestResult& aResult)
+ {
+	SetupL(); 
+ 	
+ 	iWas_HandleErrorL_Accessed = EFalse;
+ 	
+    
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService3L,
+                                   NULL);
+
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleError1L, 
+                                     NULL);
+                                     
+                                     
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    iTxnID=transactionIdOrError;
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    //ipConnection->Cancel(); 
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+	  	
+	  	
+    //
+    // ---- Following conditions MUST be met ----
+	
+    //1 KErrSenCancelled reported
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == KErrSenCancelled);
+    
+    //2. HandleErrorL accesed after negative iResponseCodes
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+    
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Set_Expose_FacetL(TTestResult& aResult)
+ {
+	SetupL(); 
+    
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    
+	CSenFacet* pExposed = CSenFacet::NewL();
+    CleanupStack::PushL(pExposed);
+    pExposed->SetNameL(KExposeLocalServiceFacet); // from MSenServiceDescription.h
+    ipHostlet->ipHostletDescription->SetFacetL(*pExposed);
+    CleanupStack::PopAndDestroy(); // pExposed
+    
+    RFacetArray facets;
+	ipHostlet->ipHostletDescription->FacetsL(facets);
+	
+	LOCAL_ASSERT(facets[0]->Name() == KExposeLocalServiceFacet);
+    
+    facets.ResetAndDestroy();
+    delete ipHostlet;
+    ipHostlet = NULL;
+      
+    Teardown();
+    return KErrNone;
+    }
+    
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // uses default implementations for servicel and onservicecompletel    
+    ipHostlet = CTestHostlet::NewL(this);   
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+   
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, 
+                            TConsumerTestTask::ECreateConnAndSubmit, 
+                            pResponseTo );
+    task.ipOwner = this;
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitRestFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    localThread.Resume(); // start the thread. 
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+ //   LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    CleanupStack::PopAndDestroy(pResponseTo);
+    
+    localThread.Close();
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+*/    
+    
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_MultiThreadL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, // not used by this test case..
+                            TConsumerTestTask::ESubmit, 
+                            pResponseTo);
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitRestFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    localThread.Resume(); // start the thread. 
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+    
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    LOCAL_ASSERT( task.iStatusCode == KErrNone ); 
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pResponseTo);    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_ActiveL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+  
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, // not used by this test case atm
+                            TConsumerTestTask::EActiveSubmit, 
+                            pResponseTo);
+
+    _LIT(KThreadName, "tSubmitRestFromAO_");
+    CActiveConsumerTestTask* pActiveTask = CActiveConsumerTestTask::NewLC(task, KThreadName(), *this); // push pActiveTask
+    task.ipActive = pActiveTask;
+    
+    if(!pActiveTask->IsActive())
+        {
+	SetupL(); 
+        pActiveTask->SetActive();
+        Teardown();
+    return KErrNone;
+    }
+
+    pActiveTask->iStatus = KRequestPending;
+    TRequestStatus* status = &pActiveTask->iStatus;
+    User::RequestComplete( status, CActiveConsumerTestTask::EInvokeService );
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Submit a single request (via help of an AO!), respond to consumer ONCE,  => two calls
+    StartActiveScheduler(2);
+
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pResponseTo);
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // This test case uses default implementations for servicel and onservicecompletel, 
+    // BUT(!) describeservicel has been overridden!
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeServiceL);   
+
+// variant point 1:
+//    ipHostlet = CTestHostlet::NewL(this);   
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+   
+	CSenSoapMessage* pSoapMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSoapMessage->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC(); // push pProps
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8L();
+	CleanupStack::PopAndDestroy(pProps);
+
+	CleanupStack::PushL(pPropsAsXml);
+	TPtrC8 properties = pPropsAsXml->Des();
+
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+
+    // NOTE-NOTE: if WS-I is used instead of REST, timing changes and race-codition occurs
+    
+    TConsumerTestTask task( *ipConnection, // not used in this test case
+                            request,       // not used in this test case
+                            KDefaultBasicWebServicesFrameworkID,
+                            TConsumerTestTask::ECreateConnAndSubmit, 
+                            pResponseTo);
+    task.ipOwner = this;
+
+    task.iEndpoint.Set(KHostletEndpoint);
+// variant point 2:
+    // -- comment out above line: task.iEndpoint.Set(KHostletEndpoint);
+
+    task.ipSoapMsg = pSoapMessage;
+
+    task.iProperties.Set(properties); 
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitWsiFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    // Now start the thread that will execute SubmitL:
+    localThread.Resume(); // start the thread
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    //LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    //LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    // Response received, de-alloc response, request properties, request as XML descs and SOAP-MSG obj
+    CleanupStack::PopAndDestroy( pResponseTo );
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+
+	CleanupStack::PopAndDestroy( pAsXml );
+
+	CleanupStack::PopAndDestroy( pSoapMessage );
+    
+    localThread.Close();
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+*/
+
+    
+
+/*    
+// DOES NOT WORK, submit blocks the single ActiveScheduler...    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_WSIL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+         CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+	
+	HBufC8* pResponseTo = NULL;
+	
+    TInt transactionIdOrError = ipConnection->SubmitL(*pSOAPMessage, *pPropsAsXml, pResponseTo);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == *pAsXml);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pProps);
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+	delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+*/
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Send_WSIL()
+    {
+	SetupL(); 
+   // This case uses default implementations for servicel and onservicecompletel:
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeService_2L);
+
+    // This case uses the default implementations for setstatus, handlemessage, handleerror:
+    ipConsumer = CTestConsumer::NewL(this); 
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    // Choose WS-I service invokation framework
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrSenHostNotAvailable );
+
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusCreateFailed); 
+    
+/*
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone );
+    
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+    TInt transactionIdOrError = ipConnection->SendL(*pSOAPMessage);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one SendL calling ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+   
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+     */
+     /*
+	delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+    */
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_DescEndpoint_Send_WSIL()
+    {
+	SetupL(); 
+    // This case uses default implementations for servicel and onservicecompletel:
+    // NOTE: for ALL OTHER BUT REST hostlets, one must DESCRIBE framework ID
+    // via MSenHostlet::DescribeServiceL(!)
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeServiceL);
+
+    // This case uses the default implementations for setstatus, handlemessage, handleerror:
+    ipConsumer = CTestConsumer::NewL(this); 
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KHostletEndpoint, KHostletContract);
+    // Choose WS-I service invokation framework
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone );
+    
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+    TInt transactionIdOrError = ipConnection->SendL(*pSOAPMessage);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one SendL calling ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+	delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+*/
+
+// Leaks memory
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_2SC1HCL(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
+	SetupL(); 
+   
+    // The only HC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+	
+	// First SC
+	ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+	    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+	// Second SC
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1); 
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    TInt transactionIdOrError1 = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError1 > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. The 1st Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code from 1st Consumer (delivery code)
+    //We should check TxnID as after Dispatcher Implementation VTxnID get return from SendL
+    //LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[1] == KRequest1);
+
+    // 2. The 2nd Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet->iResponses[1]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet->iResponseCodes[1])
+
+    // 3. Hostlet receives completion code from 2nd Consumer (delivery code)
+   // LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError1 );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[1] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+
+    delete ipHostlet;
+    ipHostlet = NULL;
+
+    delete ipConnection;
+    ipConnection = NULL;
+
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+ 
+    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send one message  from ServiceConnection to HostletConnection,
+    // which provides response (TRANSPORT) properties to the response message
+    
+    // Construct Hostlet
+    
+    ipHostlet = CTestHostlet::NewL(this, &CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    MSenProperties* pHostletProps = ipHostlet->iResponseProps[0];
+    
+    LOCAL_ASSERT( ipHostlet->iResponseProps[0] != NULL ); // The tp that was sent
+    LOCAL_ASSERT( ipConsumer->iResponseProperties[0] != NULL); // The tp that was received
+    
+    
+    
+    
+    HBufC8* pSerializedPropsSentByHC = ipHostlet->iResponseProps[0]->AsUtf8LC(); // push
+    HBufC8* pSerializedPropsReceivedBySC = ipConsumer->iResponseProperties[0]->AsUtf8LC(); // push
+
+    LOCAL_ASSERT( *pSerializedPropsSentByHC == *pSerializedPropsReceivedBySC );
+    
+    /*EUNIT_PRINT(_L("=> Properties that HC sent:"));*/
+    RDebug::Print (_L("=> Properties that HC sent:"));
+    RDebug::RawPrint(*pSerializedPropsSentByHC);
+    RDebug::Print(_L("=> Properties that SC received:"));
+    RDebug::RawPrint(*pSerializedPropsReceivedBySC);
+    
+    CleanupStack::PopAndDestroy(pSerializedPropsReceivedBySC); // SC's TP AsUtf8LC
+    CleanupStack::PopAndDestroy(pSerializedPropsSentByHC); // HC's TP AsUtf8LC
+    
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+   	Teardown();
+    return KErrNone;
+    }
+    
+           
+    
+CSenSoapMessage* CSenHostletConnectionBCTest::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(KHostletContract, _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/testconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+//  CLASS HEADER
+#include "testconsumer.h"
+
+//  INTERNAL INCLUDES
+#include "senhostletconnectionbctest.h"
+
+#include "SenTransportProperties.h"
+
+//namespace
+//    {
+//    _LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+//    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+//    }
+
+
+CTestConsumer* CTestConsumer::NewL(CSenHostletConnectionBCTest* aTestSuite,
+                                   void (*p2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&),
+                                   void (*p2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&),
+                                   void (*p2SetStatus) (CSenHostletConnectionBCTest*, const TInt))
+    {
+    CTestConsumer* pSelf = CTestConsumer::NewLC(aTestSuite, p2HandleMessageL,
+                                                p2HandleErrorL, p2SetStatus);
+    CleanupStack::Pop(pSelf);
+
+    return pSelf;
+    }
+
+CTestConsumer* CTestConsumer::NewLC(CSenHostletConnectionBCTest* aTestSuite,
+                                    void (*p2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&),
+                                    void (*p2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&),
+                                    void (*p2SetStatus) (CSenHostletConnectionBCTest*, const TInt))
+    {
+    CTestConsumer* pSelf = new (ELeave) CTestConsumer(aTestSuite, p2HandleMessageL,
+                                                      p2HandleErrorL, p2SetStatus);
+    CleanupStack::PushL(pSelf);
+
+    return pSelf;
+    }
+
+CTestConsumer::CTestConsumer(CSenHostletConnectionBCTest* aTestSuite,
+                             void (*p2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&),
+                             void (*p2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&),
+                             void (*p2SetStatus) (CSenHostletConnectionBCTest*, const TInt))
+    : ipTestSuite(aTestSuite),
+      ip2HandleMessageL(p2HandleMessageL),
+      ip2HandleErrorL(p2HandleErrorL),
+      ip2SetStatus(p2SetStatus)
+    {
+
+    }
+
+CTestConsumer::~CTestConsumer()
+    {
+    iResponses.ResetAndDestroy();
+    iResponseProperties.ResetAndDestroy();
+    iResponseCodes.Reset();
+    }
+
+void CTestConsumer::HandleMessageL(const TDesC8& aMessage)
+    {
+    iErrorCode = KErrNone;
+    iTxnId = ipTestSuite->ipConnection->TxnId();
+
+    MSenMessage* pResponse = ipTestSuite->ipConnection->Response();
+    if( pResponse )
+        {
+        MSenProperties* pProperties = pResponse->Properties();
+        if( pProperties )
+            {
+            CSenTransportProperties* pTransportProperties = NULL;
+            if( pProperties->IsSafeToCast(MSenProperties::ESenTransportProperties))
+                {
+                pTransportProperties = (CSenTransportProperties*)pProperties;
+                
+                CSenTransportProperties* pClone = (CSenTransportProperties*)pTransportProperties->CloneL();
+                if( pClone )
+                    {
+                    CleanupStack::PushL(pClone);
+                    TInt appendError = iResponseProperties.Append(pClone);
+                    if( appendError )
+                        {
+                        CleanupStack::PopAndDestroy(pClone);
+                        }
+                    else
+                        {
+                        // OK, pClone is now owned by ipResponseProperties
+                        CleanupStack::Pop(pClone);
+                        }
+                    }
+                }
+            }
+        }
+
+
+    iResponseCodes.Append(KErrNone);
+    iResponses.Append(aMessage.AllocL());
+    if ( ip2HandleMessageL )
+        {
+        (*ip2HandleMessageL)(ipTestSuite, aMessage);        
+        }
+    ipTestSuite->StopActiveScheduler();
+    }
+
+void CTestConsumer::HandleErrorL(const TInt aErrorCode, const TDesC8& aMessage)
+    {
+    iErrorCode = aErrorCode;
+    iTxnId = ipTestSuite->ipConnection->TxnId();
+
+    MSenMessage* pResponse = ipTestSuite->ipConnection->Response();
+    if( pResponse )
+        {
+        MSenProperties* pProperties = pResponse->Properties();
+        if( pProperties )
+            {
+            CSenTransportProperties* pTransportProperties = NULL;
+            if( pProperties->IsSafeToCast(MSenProperties::ESenTransportProperties))
+                {
+                pTransportProperties = (CSenTransportProperties*)pProperties;
+                
+                CSenTransportProperties* pClone = (CSenTransportProperties*)pTransportProperties->CloneL();
+                if( pClone )
+                    {
+                    CleanupStack::PushL(pClone);
+                    TInt appendError = iResponseProperties.Append(pClone);
+                    if( appendError )
+                        {
+                        CleanupStack::PopAndDestroy(pClone);
+                        }
+                    else
+                        {
+                        // OK, pClone is now owned by ipResponseProperties
+                        CleanupStack::Pop(pClone);
+                        }
+                    }
+                }
+            }
+        }
+
+    iResponseCodes.Append(aErrorCode);
+    HBufC8* pMessage = aMessage.AllocL();
+    CleanupStack::PushL(pMessage);
+    TInt appendError2 =  iResponses.Append(pMessage);
+    if( appendError2 )
+        {
+        CleanupStack::PopAndDestroy(pMessage);
+        }
+    else
+        {
+        CleanupStack::Pop(pMessage);
+        }        
+
+    if ( ip2HandleErrorL )
+        {
+        (*ip2HandleErrorL)(ipTestSuite, aErrorCode, aMessage);
+        }
+    ipTestSuite->StopActiveScheduler();
+    }
+
+void CTestConsumer::SetStatus(const TInt aStatus)
+    {
+    iConnectionStatus = aStatus;
+
+    
+    if ( ip2SetStatus )
+        {
+        (*ip2SetStatus)(ipTestSuite, aStatus); // func call via ptr
+        }
+    else
+        {
+        // Active Scheduler was NOT stopped by static function (func call via ptr above)
+        switch( aStatus )
+            {
+            case KSenConnectionStatusReady:
+                {
+                ipTestSuite->StopActiveScheduler(); // otherwise failed SC construction is reported via HandleErrorL(!)
+                }
+                break;
+            case KSenConnectionStatusNew:
+            case KSenConnectionStatusExpired:
+            default:            
+                break;
+            }
+        
+        }
+    }
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/testhostlet.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+//  CLASS HEADER
+#include "testhostlet.h"
+
+//  EXTERNAL INCLUDES
+#include <StifTestInterface.h>
+
+#include <SenTransportProperties.h>
+
+//  INTERNAL INCLUDES
+#include "senhostletconnectionbctest.h"
+
+namespace
+    {
+    //_LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+    }
+
+CTestHostlet* CTestHostlet::NewL(CSenHostletConnectionBCTest* aTestSuite,
+                                 TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                                 TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                                 void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    {
+    CTestHostlet* pSelf = CTestHostlet::NewLC(aTestSuite, ap2ServiceL, ap2OnServiceCompleteL, ap2DescribeServiceL);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CTestHostlet* CTestHostlet::NewLC(CSenHostletConnectionBCTest* aTestSuite,
+                                  TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                                  TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                                  void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    {
+    CTestHostlet* pSelf = new (ELeave) CTestHostlet(aTestSuite, ap2ServiceL, ap2OnServiceCompleteL, ap2DescribeServiceL);
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+	    
+    return pSelf;
+    }
+
+CTestHostlet::CTestHostlet(CSenHostletConnectionBCTest* aTestSuite,
+                           TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                           TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                           void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    : ipTestSuite(aTestSuite),
+      ip2ServiceL(ap2ServiceL),
+      ip2OnServiceCompleteL(ap2OnServiceCompleteL),
+      ip2DescribeServiceL(ap2DescribeServiceL)
+    {
+    }
+
+CTestHostlet::~CTestHostlet()
+    {
+    delete ipHostletDescription;
+    iRequests.ResetAndDestroy();
+    iResponses.ResetAndDestroy();
+    iRequestProps.ResetAndDestroy();
+    iRequestPropTypes.Reset();
+    iResponseProps.ResetAndDestroy();
+    iResponseCodes.Reset();
+    iTxnIds.Reset();
+    iCompletionCodes.Reset();
+    }
+
+void CTestHostlet::ConstructL()
+    {
+    ipHostletDescription = CSenXmlServiceDescription::NewL(KNullDesC8, KHostletContract);
+	//ipHostletDescription = CSenXmlServiceDescription::NewL(KHostletEndpoint, KNullDesC8);    	
+    ipHostletDescription->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    }
+    
+
+void CTestHostlet::DescribeServiceL(CSenXmlServiceDescription& aSD) 
+    { 
+    if( ip2DescribeServiceL ) 
+    	{
+   		(*ip2DescribeServiceL)(aSD);
+    	}
+        else
+            {
+            aSD.SetEndPointL(Endpoint());
+            aSD.SetContractL(Contract()); 
+            aSD.SetFrameworkIdL(FrameworkId());	
+            }
+    }
+
+TPtrC8 CTestHostlet::Contract() const
+    {
+    return ipHostletDescription->Contract();
+    }
+
+TPtrC8 CTestHostlet::Endpoint() const
+    {
+    return ipHostletDescription->Endpoint();
+    }
+
+TInt CTestHostlet::ServiceL(MSenHostletRequest& aRequest, MSenHostletResponse& aResponse)
+    {
+    
+
+    iTxnIds.Append(aRequest.RequestId());
+    iResponseCodes.Append(KErrNone);
+    
+
+    	
+    TInt retVal(KErrNone);
+    // Setup default response, can be overridden by test case:
+    // Dummy response
+    TPtrC8 request = aRequest.RequestUtf8();
+
+
+    iRequests.Append(request.AllocL());
+    
+    MSenProperties::TSenPropertiesClassType propType;
+    TPtrC8 requestProperties = aRequest.Properties(propType);
+    iRequestProps.Append(requestProperties.AllocL());
+    iRequestPropTypes.Append(propType);
+    
+//    _LIT8(KResponseFmt, "<Response><ReplyMessage>CSenHostletConnectionBCTest is alive.</ReplyMessage><Request>%S</Request></Response>");
+  	_LIT8(KResponseFmt, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header></S:Header><S:Body>testing text hostlet</S:Body></S:Envelope>");  
+    HBufC8* pResponse = HBufC8::NewLC(request.Length()+KResponseFmt().Length());
+    TInt appendError = iResponses.Append(pResponse);
+    if( appendError )
+        {
+        CleanupStack::PopAndDestroy(pResponse); // delete orphan HBufC8 / pResponse
+        }
+    else
+        {
+        CleanupStack::Pop(pResponse); // now owned by iResponses -array..
+        }        
+    
+    TPtr8 response = iResponses[iTxnIds.Count()-1]->Des();
+    response.Format(KResponseFmt, &request);
+    aResponse.SetResponseUtf8L(response, iResponseCodes[iTxnIds.Count()-1]); // by default, all requests are "accepted"
+      
+    if ( ip2ServiceL )
+        {
+        // NOTE(!): if RESPONSE CODE in aResponse is modified in YOUR test case,
+        // remember set iResponseCodes for this test hostlet instance in your test
+        //  case code (ServiceL callback)
+        retVal = (*ip2ServiceL)(ipTestSuite, aRequest, aResponse); 
+        }
+    TPtrC8 providedResponse = aResponse.ResponseUtf8();
+    
+    if ( iResponses[iTxnIds.Count()-1]->Compare(providedResponse) != 0 )
+        {
+        // response was altered by TEST CASE:
+        iResponses.Insert(aResponse.ResponseUtf8().AllocL(),iTxnIds.Count()-1);
+        }
+        
+        
+    RDebug::Print(_L("CTestHostlet::ServiceL received:"));
+    RDebug::RawPrint(request);
+    if (ipTestSuite->ipUsedHostletConnection)
+    {
+    	iRespondRetCode = ipTestSuite->ipUsedHostletConnection->RespondL(aResponse); 
+    }
+    else
+		iRespondRetCode = ipTestSuite->ipHostletConnection->RespondL(aResponse); 
+   return retVal;
+    }
+
+void CTestHostlet::OnServiceCompleteL(const TInt aTxnId, 
+                                      TInt aCompletionCode, 
+                                      const TDesC8& aDesc)
+    {
+  
+    iCompletionCodes.Append(aCompletionCode); 
+    if( ip2OnServiceCompleteL )
+        {
+        (*ip2OnServiceCompleteL)( ipTestSuite, aTxnId, aCompletionCode, aDesc );
+        }
+    ipTestSuite->StopActiveScheduler(); // service provided
+    }
+    
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for hostlet_connection_api  
+*
+*/
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+../hostconnTester/group/hostconnTester.mmp
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/bmarm/hostletconnectionu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2 @@
+EXPORTS
+	CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void)
Binary file websrv_pub/hostlet_connection_api/tsrc/hostconn/bwins/hostletconnectionbctestu.def has changed
Binary file websrv_pub/hostlet_connection_api/tsrc/hostconn/bwins/hostletconnectionu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/eabi/HostletConnectionBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,8 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI12CTestHostlet @ 3 NONAME ; #<TI>#
+	_ZTI13CTestConsumer @ 4 NONAME ; #<TI>#
+	_ZTV12CTestHostlet @ 5 NONAME ; #<VT>#
+	_ZTV13CTestConsumer @ 6 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+PRJ_EXPORTS
+../sis/testhc_c.bat		/epoc32/winscw/c/testhc_c.bat
+../sis/testhc_z.bat		/epoc32/winscw/c/testhc_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_hostlet.ini
+
+PRJ_MMPFILES
+
+
+
+PRJ_TESTMMPFILES
+hostletconnection.mmp
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/group/hostconn.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices HostletConnection"},(0x101FB3E7),3,0 ,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\HostletConnectionBCTest.dll"-"!:\sys\bin\HostletConnectionBCTest.dll"
+"..\init\HostletBCTest.ini"-"!:\testframework\HostletBCTest.ini"
+;"\Epoc32\winscw\c\testHC_c.bat"-"!:\testHC.bat"
+;"\Epoc32\winscw\c\testframework\testframework_HostConn.ini"-"!:\testframework\testframework_HostConn.ini"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/group/hostletconnection.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for hostletconnection 
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          HostletConnectionBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY              ALL -TCB
+VENDORID        VID_DEFAULT  
+//VENDORID 0x70000001 
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+//TARGETPATH      ?target_path
+DEFFILE         HostletConnectionBCTest.def
+
+ 
+SOURCEPATH              ../src
+SOURCE          		hostletconnection.cpp
+SOURCE          		hostletconnectioncases.cpp
+SOURCE                  testconsumer.cpp
+SOURCE                  testhostlet.cpp
+
+USERINCLUDE	../inc
+
+SYSTEMINCLUDE       	/epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 stiftestinterface.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+//LIBRARY                 SenLogger.lib
+//LIBRARY                 SenProvider.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenHostConn.lib
+LIBRARY                 SenServConn.lib
+LIBRARY					avkon.lib 
+LANG            		SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/init/HostletBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= HostletConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/rom/hostconn.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef HOSTCONN_IBY__
+#define HOSTCONN_IBY__
+
+file=ABI_DIR\BUILD_DIR\HostletConnectionBCTest.dll          PROGRAMS_DIR\HostletConnectionBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/HostletBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= HostletConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
Binary file websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/hostconn.pkg has changed
Binary file websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/hostconn.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= HostletConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/testhc_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\TestFramework_HostConn.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule HostletConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_HostConn.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/sis/testhc_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy z:\TestFramework\TestFramework_HostConn.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule HostletConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_HostConn.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/src/hostletconnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,374 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenHostletConnection class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senhostletconnectionbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::CSenHostletConnectionBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenHostletConnectionBCTest::CSenHostletConnectionBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenHostletConnection_stifLogPath, 
+                          KSenHostletConnection_stifLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "KSenHostletConnection_stif logging starts!" );
+    iLog->Log( KLogStart );
+    
+    iActiveScheduler = new CActiveScheduler;
+	CActiveScheduler::Install( iActiveScheduler );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenHostletConnectionBCTest* CSenHostletConnectionBCTest::NewL()
+    {
+    CSenHostletConnectionBCTest* self = new (ELeave) CSenHostletConnectionBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenHostletConnectionBCTest::~CSenHostletConnectionBCTest()
+    {
+    delete iLog;
+    
+    delete iActiveScheduler;
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenHostletConnectionBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenHostletConnectionBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenHostletConnectionBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenHostletConnectionBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenHostletConnectionBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenHostletConnectionBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenHostletConnectionBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenHostletConnectionBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/src/hostletconnectioncases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3186 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "senhostletconnectionbctest.h"
+
+#include <SenFacet.h>
+
+
+//  EXTERNAL INCLUDES
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+
+
+
+//  INTERNAL INCLUDES
+#include <SenHttpTransportProperties.h>
+#include "SenHostletConnection.h"
+#include "testconsumer.h"
+#include "testhostlet.h"
+
+#include <SenTransportProperties.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+#define LOCAL_VOID_ASSERT(expression)	{if(!(expression)){return ;}}
+
+namespace
+    {
+    _LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+    _LIT8(KHostletEndpoint1, "hostlet://UnitTestHostlet-1");
+    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+    _LIT8(KHostletContract1, "urn:nokia.com.serene:unit-test-hostlet-1");  
+    
+    void threadMainL(TAny* aPtr)
+        {
+        TConsumerTestTask* pTask = (TConsumerTestTask*) aPtr;
+        pTask->Execute();
+        // Go safely out of scope (will destroy this thread)
+        }
+    
+    TInt threadFunction(TAny* aPtr)
+        {
+        CTrapCleanup* pCleanup = CTrapCleanup::New();
+        CActiveScheduler::Install(NULL); // remove one
+        CActiveScheduler* pScheduler = new (ELeave) CActiveScheduler();
+        CActiveScheduler::Install(pScheduler);
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, threadMainL(aPtr));
+
+        CActiveScheduler::Install(NULL); // uninstall scheduler
+        delete pScheduler;
+        delete pCleanup;
+
+        return leaveCode;
+        }
+        
+        
+    TInt CreateThreadForConsumerTask(RThread& aThread, const TDesC& aThreadName, TConsumerTestTask& aTask)
+        {
+        TName threadName(aThreadName);
+        // Append a random number to make it unique
+        threadName.AppendNum(Math::Random(), EHex);
+                
+#ifdef EKA2
+        RAllocator& heap = User::Allocator(); // RHeap is deprecated in EKA2
+        return aThread.Create(threadName, // name
+                              threadFunction,
+                              KDefaultStackSize,
+                              &heap,
+                              &aTask);
+#else // EKA1
+        RHeap& heap = User::Heap();
+        return aThread.Create(threadName, // name
+                              threadFunction,
+                              KDefaultStackSize,
+                              &heap,
+                              &aTask);
+#endif // EKA        
+        }      
+    }   
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenHostletConnectionBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServiceManager_stif.cpp file and to SenServiceManager_stif.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServiceManagerBCTest::PrintTest. Otherwise the compiler
+        // gives errors.
+		ENTRY("NewL - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL),
+    
+		ENTRY("NewLC - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLCL),
+		
+		ENTRY("Identifier - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_IdentifierL), 
+		
+		ENTRY("FrameworkId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_FrameworkIdL), 
+		
+		ENTRY("RequestUtf8 - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestUtf8L), 
+		
+		ENTRY("ThreadId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_ThreadIdL), 
+
+		ENTRY("ConsumerId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_ConsumerIdL), 
+
+		ENTRY("RequestId - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestIdL), 
+
+		ENTRY("NewLC - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLC_3InvokesL),
+
+		ENTRY("RespondL1 - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL1L),
+   
+		ENTRY("RespondL2 - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL2L),
+
+		ENTRY("RespondL3 - CSenHostletConnectionBCTest ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL3L),
+
+		ENTRY("RespondL negative response code - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Negative_ResponseCodeL),
+    
+		ENTRY("RespondL self def URI - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_HC_SelfDef_URIL),
+/*    
+		ENTRY("RespondL delete HC after SC is created - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Delete_HCL),
+*/
+		ENTRY("NewL leaves with KErrSenEndpointReserved -CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_UID3L),
+         
+		ENTRY("RespondL Two HC with the same Endpoints UIDs - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_EndpointsL),    
+   
+		ENTRY("RespondL Two HC Two SC diff contracts - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC1L),    
+     
+		ENTRY("RespondL Two HC Two SC diff endpionts - CSenHostletConnectionBCTest",CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC2L),    
+
+		ENTRY("RespondL Two HC Two SC diff endpionts the same contract - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC3L),    
+      
+		ENTRY("RespondL Delete SC before calling HC::RespondL - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_DeleteSC_before_HCRespondLL),    
+
+		ENTRY("RespondL Call RespondL multipe times - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL_4multipleTimesL),    
+
+		ENTRY("RespondL SC::Cancel after request - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_SC_Cancel_After_RequestL),    
+    
+		ENTRY("RespondL Set Expose Facet - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Set_Expose_FacetL),    
+
+		ENTRY("HC responds with TP - ", CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL),    
+
+		//ENTRY("New REST SC + SubmitL Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL),    
+/*
+		ENTRY("New WS-I SC + SubmitL Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL),    
+
+
+		ENTRY("SendL WS-I Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Send_WSIL),    
+
+		ENTRY("Desc EP + SendL WS-I Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_DescEndpoint_Send_WSIL),    
+*/
+
+		ENTRY("SendL from 2 SCs to 1 HC - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_2SC1HCL), 
+
+/*
+// NOTE: following is used instead:
+// --> UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL 
+		ENTRY("SubmitL (multit.), Rest Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_MultiThreadL),    
+
+// NOTE: following is used instead:
+// --> UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL 
+		ENTRY("SubmitL (active), Rest Test - CSenHostletConnectionBCTest", CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_ActiveL),
+*/        
+	 	};
+
+	    // Verify that case number is valid
+	    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+	                               sizeof( TCaseInfoInternal ) )
+	        {
+	        // Invalid case, construct empty object
+	        TCaseInfo null( (const TText*) L"" );
+	        null.iMethod = NULL;
+	        null.iIsOOMTest = EFalse;
+	        null.iFirstMemoryAllocation = 0;
+	        null.iLastMemoryAllocation = 0;
+	        return null;
+	        } 
+
+	    // Construct TCaseInfo object and return it
+	    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+	    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+	    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+	    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+	    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+	    return tmp;
+
+	    }   
+
+//  METHODS
+
+void CSenHostletConnectionBCTest::SetupL ()
+    {
+    __UHEAP_MARK;
+    }
+
+void CSenHostletConnectionBCTest::Teardown ()
+    {
+//    User::After( 2 * 1000 * 1000 ); // temp tests
+    __UHEAP_MARKEND;
+    }
+
+void CSenHostletConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+void CSenHostletConnectionBCTest::StopActiveScheduler ()
+    {
+    iNumberOfPendingOps--;
+    if ( iNumberOfPendingOps == 0 )
+        {
+    	CActiveScheduler::Stop();
+        }
+    }
+
+void TConsumerTestTask::Execute()
+    {
+    switch(iJob)
+        {
+        case(ECreateConnAndSubmit): // this is a very oddly orientated, wild case..
+            {
+            if(ipOwner)
+                {
+                CTestConsumer* pConsumer = CTestConsumer::NewL(ipOwner); // uses the default implementations for setstatus, handlemessage, handleerror
+                CleanupStack::PushL(pConsumer);
+
+                // Note, if NOT set, iEndpoint is typically KNullDesC8 (zero-lenght), which is OK, too.
+                CSenServicePattern* pPattern = CSenServicePattern::NewLC(iEndpoint, KHostletContract);
+                if(iFrameworkId.Length()>0)
+                    {
+                    pPattern->SetFrameworkIdL(iFrameworkId);
+                    }
+                else
+                    {
+                    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);                        
+                    }
+                    
+                CSenServiceConnection* pConnection = CSenServiceConnection::NewL(*pConsumer, *pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                CleanupStack::PushL(pConnection);
+                
+                // Construct service connection by starting active scheduler..
+                ipOwner->StartActiveScheduler(1);
+                
+                // Check that NO HandleErrorL callback was received:
+                LOCAL_VOID_ASSERT( pConsumer->iErrorCode == KErrNone );
+                
+                
+                 // Check that the Status of the ServiceConnection
+                // is KSenConnectionStatusReady
+                LOCAL_VOID_ASSERT( pConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+                // execution returns here EITHER when HandleMessageL or HandleErrorL has been invoked..
+                if(iProperties.Length()==0)
+                    {
+                    if(ipSoapMsg)
+                        {
+                        iStatusCode = pConnection->SubmitL(*ipSoapMsg, ipNotOwnedData);
+                        }
+                    else
+                        {
+                        iStatusCode = pConnection->SubmitL(iRequest, ipNotOwnedData);
+                        }
+                    }
+                else
+                    {
+                    if(ipSoapMsg)
+                        {
+                        iStatusCode = pConnection->SubmitL(*ipSoapMsg, iProperties, ipNotOwnedData);
+                        }
+                    else
+                        {
+                        iStatusCode = pConnection->SubmitL(iRequest, iProperties, ipNotOwnedData);
+                        }
+                    }
+                CleanupStack::PopAndDestroy(pConnection);
+                CleanupStack::PopAndDestroy(pConsumer);
+                }
+           }
+           break;
+
+        case(ESubmit):
+            {
+            if(iProperties.Length()==0)
+                {
+                iStatusCode = iConnection.SubmitL(iRequest, ipNotOwnedData);
+                }
+            else
+                {
+                iStatusCode = iConnection.SubmitL(iRequest, iProperties, ipNotOwnedData);
+                }
+            }
+            break;
+
+        case(EActiveSubmit):
+            {
+            if ( ipActive)
+                {
+                // Perform blocking (sync) submit:
+                if(iProperties.Length()==0)
+                    {
+                    iStatusCode = iConnection.SubmitL(iRequest, ipNotOwnedData);
+                    }
+                else
+                    {
+                    iStatusCode = iConnection.SubmitL(iRequest, iProperties, ipNotOwnedData);
+                    }
+                    
+                // Notify "owner" that blocking operation has completed
+                TRequestStatus* status = &ipActive->iStatus;
+                RThread owner;
+                owner.Open(ipActive->iOwnerThreadId);
+                owner.RequestComplete(status, CActiveConsumerTestTask::EDeliverResponse );
+                }
+            }
+            break;
+           
+        }
+    }
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// HELPER CLASS for SC (active) tasks:
+// Public METHODS
+
+CActiveConsumerTestTask* CActiveConsumerTestTask::NewL(TConsumerTestTask& aTask, const TDesC& aThreadName, CSenHostletConnectionBCTest& aOwner)
+    {
+    CActiveConsumerTestTask* pNew = CActiveConsumerTestTask::NewLC(aTask, aThreadName, aOwner);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CActiveConsumerTestTask* CActiveConsumerTestTask::NewLC(TConsumerTestTask& aTask, const TDesC& aThreadName, CSenHostletConnectionBCTest& aOwner)
+    {
+    CActiveConsumerTestTask* pNew = new (ELeave) CActiveConsumerTestTask(aTask, aOwner);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aThreadName);
+    return pNew;
+    }
+
+CActiveConsumerTestTask::CActiveConsumerTestTask(TConsumerTestTask& aTask, CSenHostletConnectionBCTest& aOwner)
+    :   CActive(EPriorityStandard), 
+        iTask(aTask),
+        iOwner(aOwner)
+    {
+    CActiveScheduler::Add(this);    
+    }
+
+CActiveConsumerTestTask::~CActiveConsumerTestTask()
+    {
+    if(IsActive())
+        {
+        Cancel(); // issues DoCancel();
+        }
+    iTaskThread.Close();
+    }
+
+void CActiveConsumerTestTask::RunL()
+    {
+    switch(iStatus.Int())
+        {
+        case(EInvokeService):
+            {
+            iTaskThread.Resume();
+            }
+            break;
+            
+        case(EDeliverResponse):
+            {
+            iOwner.StopActiveScheduler(); // submit complete..
+            }
+            break;
+         /* case defaul: // unknown */
+        }
+    }
+void CActiveConsumerTestTask::DoCancel()
+    {
+    iOwner.StopActiveScheduler();
+    }
+    
+// Private METHODS
+void CActiveConsumerTestTask::ConstructL(const TDesC& aThreadName)
+    {
+    RThread thread;
+    iOwnerThreadId = thread.Id(); 
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(iTaskThread, aThreadName, iTask);        
+    User::LeaveIfError( createThreadRetVal );
+    SetActive();
+    }
+    
+    
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+void  CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeServiceL(CSenXmlServiceDescription& aSD)
+    {
+    aSD.SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    aSD.SetEndPointL(KHostletEndpoint);
+    aSD.SetContractL(KHostletContract);
+    }
+
+void  CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeService_2L(CSenXmlServiceDescription& aSD)
+    {
+    aSD.SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    aSD.SetContractL(KHostletContract);
+    }
+
+
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus(CSenHostletConnectionBCTest* apTestSuite,
+                                                                    TInt aStatus )
+   {
+    switch( aStatus )
+        {
+        case KSenConnectionStatusReady:
+            {
+            apTestSuite->StopActiveScheduler(); // otherwise failed SC construction is reported via HandleErrorL(!)
+            }
+            break;
+        case KSenConnectionStatusNew:
+        case KSenConnectionStatusExpired:
+        default:            
+            break;
+        }
+    }
+
+
+
+// not in use atm:
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL(CSenHostletConnectionBCTest* /* apTestSuite */, const TDesC8& /* aMessage*/ )
+    {
+    }
+
+//used by UT_CSenHostletConnection_Negative_ResponseCodeL
+//used by UT_CSenHostletConnection_Delete_HCL
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL(CSenHostletConnectionBCTest* apTestSuite, const TInt  /*aErrorCode*/ , const TDesC8& /* aMessage */)
+    {
+    apTestSuite->iWas_HandleErrorL_Accessed = ETrue;
+    }
+    
+//used by the UT_CSenHostletConnection_Negative_ResponseCodeL    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt alteredResponseCode = -148000;
+    _LIT8(KAlteredResponse, "<Response><ReplyMessage>Response Altered in UT_CSenHostletConnection_NewLL_OnServiceL.</ReplyMessage><Request>%S</Request></Response>");
+    apTestSuite->ipHostlet->iResponseCodes[apTestSuite->ipHostlet->iTxnIds.Count()-1] = alteredResponseCode;
+    aResponse.SetResponseUtf8L(KAlteredResponse, alteredResponseCode);
+    return KErrNone;
+    }
+    
+// not in use atm:    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL(CSenHostletConnectionBCTest* /* apTestSuite */, const TInt /* aTxnId */, TInt /* aCompletionCode */, const TDesC8& /* aDesc */ )
+    {
+    return KErrNone;
+    }    
+    
+//used by the UT_CSenHostletConnection_DeleteSC_before_HCRespondLL method
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService1L(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  /*aResponse*/ )
+    {
+    apTestSuite->ipConnection->Cancel();
+    delete apTestSuite->ipConnection;
+    apTestSuite->ipConnection = NULL;
+    return KErrNone;
+    }
+    
+//used by UT_CSenHostletConnection_DeleteSC_before_HCRespondLL
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete1L(CSenHostletConnectionBCTest* apTestSuite, const TInt /* aTxnId */, TInt /*aCompletionCode*/ , const TDesC8& /* aDesc */ )
+    {
+	apTestSuite->iWas_OnServiceL_Accessed = ETrue;
+    return KErrNone;
+    }        
+
+// used by the UT_CSenHostletConnection_RespondL_4multipleTimesL method
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService2L(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt respondRetCode = apTestSuite->ipHostletConnection->RespondL(aResponse);
+    TInt respondRetCode1 = apTestSuite->ipHostletConnection->RespondL(aResponse);
+	LOCAL_ASSERT(respondRetCode == KErrNone);    
+    LOCAL_ASSERT(respondRetCode1 == KErrAlreadyExists);
+    return KErrNone;
+    }
+    
+// to be used (currently does nothing) by the UT_CSenHostletConnection_RespondL_4multipleTimesL method    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete2L(CSenHostletConnectionBCTest* /* apTestSuite */, const TInt /* aTxnId */, TInt /*aCompletionCode*/ , const TDesC8& /* aDesc */ )
+    {
+    return KErrNone;
+    }        
+    
+//used by the UT_CSenHostletConnection_SC_Cancel_After_RequestL method
+void CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleError1L(CSenHostletConnectionBCTest* apTestSuite, const TInt  /* aErrorCode */, const TDesC8& /* aMessage */)
+    {
+//    TInt a = aErrorCode;
+    apTestSuite->iWas_HandleErrorL_Accessed = ETrue;
+    }
+//used by the UT_CSenHostletConnection_SC_Cancel_After_RequestL method
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService3L(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  /*aResponse*/ )
+    {
+   // apTestSuite->ipConnection->Cancel();
+   //canceling request
+    apTestSuite->ipConnection->CancelTransaction(apTestSuite->iTxnID);
+    return KErrNone;
+    }
+
+
+//used by the UT_CSenHostletConnection_RespondWithPropertiesL method in order to provide transport properties with the response
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL(CSenHostletConnectionBCTest*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt txn =          apTestSuite->ipHostlet->iTxnIds.Count()-1;
+    TPtr8 response =    apTestSuite->ipHostlet->iResponses[txn]->Des();
+
+    TInt responseCode = apTestSuite->ipHostlet->iResponseCodes[txn];
+
+    CSenTransportProperties* pTransportProperties = CSenTransportProperties::NewLC();
+    _LIT8(KTestCid, "test:cid");
+    _LIT8(KTestFile, "c:\\test.file.txt");
+    pTransportProperties->SetFileAttachmentL( KTestCid, KTestFile );
+    
+    if( apTestSuite->ipHostlet->iResponseProps.Append( pTransportProperties ) )
+        {
+        // error:
+        CleanupStack::PopAndDestroy(pTransportProperties);
+        return KErrNoMemory;
+        }
+    else
+        {
+        // ok
+        CleanupStack::Pop(pTransportProperties);
+        aResponse.SetResponseUtf8L(response, responseCode, pTransportProperties); // by default, all requests are "accepted"
+        return KErrNone;
+        }
+    }
+
+
+
+//---------------------------------------------------------------
+// 							Test Cases
+//---------------------------------------------------------------
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLCL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewLC(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    CleanupStack::PopAndDestroy(ipHostletConnection);
+    //delete ipHostletConnection; 
+    //ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_IdentifierL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 framework = ipHostlet->FrameworkId();
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_FrameworkIdL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    _LIT8(KFramework, "REST");
+    TPtrC8 framework = ipHostlet->FrameworkId();
+    LOCAL_ASSERT( framework == KFramework);
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestUtf8L(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 request = ipHostlet->RequestUtf8();
+    LOCAL_ASSERT( request == _L8(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_ThreadIdL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC threadId = ipHostlet->ThreadId();
+    LOCAL_ASSERT( threadId == _L(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_ConsumerIdL(TTestResult& aResult)
+	{
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 consumerId = ipHostlet->ConsumerId();
+    LOCAL_ASSERT( consumerId == _L8(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RequestIdL(TTestResult& aResult)
+	{
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TInt requestId = ipHostlet->RequestId();
+    LOCAL_ASSERT( requestId == KErrNone);
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;		
+	}
+	
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLC_3InvokesL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send _two_ messages from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Abel\'] or containts[ab:N/ab:GIVEN,\'Abel\'] or containts[ab:TEL,\'Abel\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest2, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest3, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Clarice\'] or containts[ab:N/ab:GIVEN,\'Clarice\'] or containts[ab:TEL,\'Clarice\']]</ab:Select></ab:QueryItem></ab:Query>");
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+
+    // => Send first request to the Hostlet
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError2 = ipConnection->SendL(KRequest2);
+    
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError3 = ipConnection->SendL(KRequest3);
+
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  THREE TIMES (one call to ServiceL), respond to consumer THREE TIMES => six async calls:
+    StartActiveScheduler(6);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+	LOCAL_ASSERT(*ipHostlet->iRequests[0] == KRequest);
+	LOCAL_ASSERT(*ipHostlet->iRequests[1] == KRequest2);
+	LOCAL_ASSERT(*ipHostlet->iRequests[2] == KRequest3);
+	
+	// 2. Consumer receives response that hostlet provided
+	LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+	LOCAL_ASSERT( *ipConsumer->iResponses[1] == *ipHostlet->iResponses[1]);
+	LOCAL_ASSERT( *ipConsumer->iResponses[2] == *ipHostlet->iResponses[2]);
+
+    // 3. Hostlet receives completion code (delivery code)
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[1] == ipHostlet->iResponseCodes[1])
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[2] == ipHostlet->iResponseCodes[2])
+
+
+	LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError);
+	LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError2);
+	LOCAL_ASSERT( ipHostlet->iTxnIds[2] == transactionIdOrError3);
+
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL1L(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send _one_ message from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+    TPtrC8 propertiesAsXml = pPropsAsXml->Des();
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // 4. The properties that were sent via SC were received in HC
+    MSenProperties::TSenPropertiesClassType type = ipHostlet->iRequestPropTypes[0];
+    TPtrC8 properties = ipHostlet->iRequestProps[0]->Des();
+
+    LOCAL_ASSERT( properties == propertiesAsXml );
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    CleanupStack::PopAndDestroy( pProps );
+    
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL2L(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send _two_ messages from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+
+    // => Send first request to the Hostlet
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError2 = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  TWICE (one call to ServiceL), respond to consumer TWICE => four calls:
+    StartActiveScheduler(4);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+    LOCAL_ASSERT( *ipHostlet->iRequests[1] == KRequest);    
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( *ipConsumer->iResponses[1] == *ipHostlet->iResponses[1]);
+    
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[1] == ipHostlet->iResponseCodes[1])
+    
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError2)
+    
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[1] == KErrNone ); // true in this "OK" -test case   
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL3L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+    // Try to send _one_ message from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // Construct 2. ServiceConnection
+    CTestConsumer* pConsumer2 = CTestConsumer::NewLC(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    CSenServicePattern* pPattern2 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern2->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    CSenServiceConnection* pConnection2 = CSenServiceConnection::NewL(*pConsumer2, *pPattern2);
+    CleanupStack::PopAndDestroy(pPattern2);
+    CleanupStack::PushL(pConnection2);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( pConsumer2->iConnectionStatus == KSenConnectionStatusReady);
+    
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+    TPtrC8 propertiesAsXml = pPropsAsXml->Des();
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // 2. ServiceConnection is ready
+    // => Send 2. request to the Hostlet
+    TInt transactionIdOrError2 = pConnection2->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError2 > KErrNone);
+    
+    // Invoke service  TWICE (two calls to ServiceL), respond to consumer TWICE => four calls
+    StartActiveScheduler(4);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // 4. The properties that were sent via SC were received in HC
+    MSenProperties::TSenPropertiesClassType type = ipHostlet->iRequestPropTypes[0];
+    TPtrC8 properties = ipHostlet->iRequestProps[0]->Des();
+
+    LOCAL_ASSERT( properties == propertiesAsXml );
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    CleanupStack::PopAndDestroy( pProps );
+    
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    CleanupStack::PopAndDestroy(pConnection2);
+    CleanupStack::PopAndDestroy(pConsumer2);
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Negative_ResponseCodeL(TTestResult& aResult)
+    {
+	SetupL(); 
+       
+ 	iWas_HandleErrorL_Accessed = EFalse;
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceL,
+                                   NULL);
+
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+                                     NULL);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+	
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    
+    
+ 	// 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone );
+    
+    //4. HandleErrorL accesed after negative iResponseCodes
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+  
+    
+ 
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_HC_SelfDef_URIL(TTestResult& aResult)
+    {
+	SetupL(); 
+                                     
+  	ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+  	ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+  
+  	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);	
+  	ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+    
+
+  	CSenServicePattern* pPattern =
+		    CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);    
+   
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    
+    
+ 	// 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+   
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Delete_HCL(TTestResult& aResult)
+    {
+	SetupL(); 
+     
+    iWas_HandleErrorL_Accessed = EFalse;                              
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+                                     NULL);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    //delete Hostlet Connection
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    // ---- Following conditions MUST be met ----
+    LOCAL_ASSERT(transactionIdOrError == KErrSenHostNotAvailable);
+
+    // Start waiting for HandleError Callback which is caused
+    // by error in SendL
+    StartActiveScheduler(1);
+    // Callback was get => Check that callback was HandleError
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+  
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+*/
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_UID3L(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+ 	
+ 	//Check if CSenHostletConnection::NewL leaves with KErrSenEndpointReserved
+/*	EUNIT_ASSERT_SPECIFIC_LEAVE(ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet),KErrSenEndpointReserved);*/
+	TRAPD(res,ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet)) ;
+	User::LeaveIfError(res == KErrSenEndpointReserved);
+
+  
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+   
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_Equal_EndpointsL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+ 
+ 	//Check if CSenHostletConnection::NewL leaves with KErrSenEndpointReserved
+	/*EUNIT_ASSERT_SPECIFIC_LEAVE(ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet),KErrSenEndpointReserved);*/
+	TRAPD(res,ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet)) ;
+	User::LeaveIfError(res == KErrSenEndpointReserved);
+  
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+ 
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC1L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+	
+	
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+	ipHostlet1->ipHostletDescription->SetContractL(KHostletContract1);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract1);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1); 
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+      
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC2L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+	ipHostlet->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+	
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+	ipHostlet1->ipHostletDescription->SetEndPointL(KHostletEndpoint1);
+	ipHostlet1->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KHostletEndpoint1, KNullDesC8);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1);   
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Two_HC_Two_SC3L(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	SetupL(); 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+	ipHostlet->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 	
+    
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+	ipHostlet1->ipHostletDescription->SetEndPointL(KHostletEndpoint1);
+	ipHostlet1->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KHostletEndpoint1, KNullDesC8);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1);    
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady	
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady);     
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+    
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_DeleteSC_before_HCRespondLL(TTestResult& aResult)
+    {
+	SetupL(); 
+	iWas_OnServiceL_Accessed = false;     
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService1L,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete1L);
+
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(1);
+    
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+    
+	// 2. onServiceL accesed
+    LOCAL_ASSERT( iWas_OnServiceL_Accessed ); 
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] < KErrNone ); 
+
+    // --- Conditions END ---
+ 
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL; 
+    Teardown();
+    return KErrNone;
+    }
+
+      
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondL_4multipleTimesL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService2L,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnServiceComplete2L);
+
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+   
+
+    // ---- Following conditions MUST be met ----
+    
+   
+    // --- Conditions END ---
+  
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL; 
+    Teardown();
+    return KErrNone;
+    }
+     
+
+
+
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_SC_Cancel_After_RequestL(TTestResult& aResult)
+ {
+	SetupL(); 
+ 	
+ 	iWas_HandleErrorL_Accessed = EFalse;
+ 	
+    
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_OnService3L,
+                                   NULL);
+
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &CSenHostletConnectionBCTest::UT_CSenHostletConnection_NewLL_HandleError1L, 
+                                     NULL);
+                                     
+                                     
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    iTxnID=transactionIdOrError;
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    //ipConnection->Cancel(); 
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+	  	
+	  	
+    //
+    // ---- Following conditions MUST be met ----
+	
+    //1 KErrSenCancelled reported
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == KErrSenCancelled);
+    
+    //2. HandleErrorL accesed after negative iResponseCodes
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+    
+ TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Set_Expose_FacetL(TTestResult& aResult)
+ {
+	SetupL(); 
+    
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    
+	CSenFacet* pExposed = CSenFacet::NewL();
+    CleanupStack::PushL(pExposed);
+    pExposed->SetNameL(KExposeLocalServiceFacet); // from MSenServiceDescription.h
+    ipHostlet->ipHostletDescription->SetFacetL(*pExposed);
+    CleanupStack::PopAndDestroy(); // pExposed
+    
+    RFacetArray facets;
+	ipHostlet->ipHostletDescription->FacetsL(facets);
+	
+	LOCAL_ASSERT(facets[0]->Name() == KExposeLocalServiceFacet);
+    
+    facets.ResetAndDestroy();
+    delete ipHostlet;
+    ipHostlet = NULL;
+      
+    Teardown();
+    return KErrNone;
+    }
+    
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // uses default implementations for servicel and onservicecompletel    
+    ipHostlet = CTestHostlet::NewL(this);   
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+   
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, 
+                            TConsumerTestTask::ECreateConnAndSubmit, 
+                            pResponseTo );
+    task.ipOwner = this;
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitRestFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    localThread.Resume(); // start the thread. 
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+ //   LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    CleanupStack::PopAndDestroy(pResponseTo);
+    
+    localThread.Close();
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+*/    
+    
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_MultiThreadL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, // not used by this test case..
+                            TConsumerTestTask::ESubmit, 
+                            pResponseTo);
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitRestFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    localThread.Resume(); // start the thread. 
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+    
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    LOCAL_ASSERT( task.iStatusCode == KErrNone ); 
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pResponseTo);    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_Rest_ActiveL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+  
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, // not used by this test case atm
+                            TConsumerTestTask::EActiveSubmit, 
+                            pResponseTo);
+
+    _LIT(KThreadName, "tSubmitRestFromAO_");
+    CActiveConsumerTestTask* pActiveTask = CActiveConsumerTestTask::NewLC(task, KThreadName(), *this); // push pActiveTask
+    task.ipActive = pActiveTask;
+    
+    if(!pActiveTask->IsActive())
+        {
+	SetupL(); 
+        pActiveTask->SetActive();
+        Teardown();
+    return KErrNone;
+    }
+
+    pActiveTask->iStatus = KRequestPending;
+    TRequestStatus* status = &pActiveTask->iStatus;
+    User::RequestComplete( status, CActiveConsumerTestTask::EInvokeService );
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Submit a single request (via help of an AO!), respond to consumer ONCE,  => two calls
+    StartActiveScheduler(2);
+
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pResponseTo);
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // This test case uses default implementations for servicel and onservicecompletel, 
+    // BUT(!) describeservicel has been overridden!
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeServiceL);   
+
+// variant point 1:
+//    ipHostlet = CTestHostlet::NewL(this);   
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+   
+	CSenSoapMessage* pSoapMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSoapMessage->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC(); // push pProps
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8L();
+	CleanupStack::PopAndDestroy(pProps);
+
+	CleanupStack::PushL(pPropsAsXml);
+	TPtrC8 properties = pPropsAsXml->Des();
+
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+
+    // NOTE-NOTE: if WS-I is used instead of REST, timing changes and race-codition occurs
+    
+    TConsumerTestTask task( *ipConnection, // not used in this test case
+                            request,       // not used in this test case
+                            KDefaultBasicWebServicesFrameworkID,
+                            TConsumerTestTask::ECreateConnAndSubmit, 
+                            pResponseTo);
+    task.ipOwner = this;
+
+    task.iEndpoint.Set(KHostletEndpoint);
+// variant point 2:
+    // -- comment out above line: task.iEndpoint.Set(KHostletEndpoint);
+
+    task.ipSoapMsg = pSoapMessage;
+
+    task.iProperties.Set(properties); 
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitWsiFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    // Now start the thread that will execute SubmitL:
+    localThread.Resume(); // start the thread
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    //LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    //LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    // Response received, de-alloc response, request properties, request as XML descs and SOAP-MSG obj
+    CleanupStack::PopAndDestroy( pResponseTo );
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+
+	CleanupStack::PopAndDestroy( pAsXml );
+
+	CleanupStack::PopAndDestroy( pSoapMessage );
+    
+    localThread.Close();
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+*/
+
+    
+
+/*    
+// DOES NOT WORK, submit blocks the single ActiveScheduler...    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Submit_WSIL(TTestResult& aResult)
+    {
+	SetupL(); 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+         CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+	
+	HBufC8* pResponseTo = NULL;
+	
+    TInt transactionIdOrError = ipConnection->SubmitL(*pSOAPMessage, *pPropsAsXml, pResponseTo);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == *pAsXml);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pProps);
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+	delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+*/
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_Send_WSIL()
+    {
+	SetupL(); 
+   // This case uses default implementations for servicel and onservicecompletel:
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeService_2L);
+
+    // This case uses the default implementations for setstatus, handlemessage, handleerror:
+    ipConsumer = CTestConsumer::NewL(this); 
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    // Choose WS-I service invokation framework
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrSenHostNotAvailable );
+
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusCreateFailed); 
+    
+/*
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone );
+    
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+    TInt transactionIdOrError = ipConnection->SendL(*pSOAPMessage);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one SendL calling ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+   
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+     */
+     /*
+	delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+    */
+/*
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_DescEndpoint_Send_WSIL()
+    {
+	SetupL(); 
+    // This case uses default implementations for servicel and onservicecompletel:
+    // NOTE: for ALL OTHER BUT REST hostlets, one must DESCRIBE framework ID
+    // via MSenHostlet::DescribeServiceL(!)
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, CSenHostletConnectionBCTest::UT_CSenHostletConnection_WSI_DescribeServiceL);
+
+    // This case uses the default implementations for setstatus, handlemessage, handleerror:
+    ipConsumer = CTestConsumer::NewL(this); 
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KHostletEndpoint, KHostletContract);
+    // Choose WS-I service invokation framework
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone );
+    
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+    TInt transactionIdOrError = ipConnection->SendL(*pSOAPMessage);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one SendL calling ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+	delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+*/
+
+// Leaks memory
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_2SC1HCL(TTestResult& aResult)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
+	SetupL(); 
+   
+    // The only HC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+	
+	// First SC
+	ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+	    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+	// Second SC
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1); 
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    TInt transactionIdOrError1 = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError1 > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. The 1st Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code from 1st Consumer (delivery code)
+    //We should check TxnID as after Dispatcher Implementation VTxnID get return from SendL
+    //LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[1] == KRequest1);
+
+    // 2. The 2nd Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet->iResponses[1]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet->iResponseCodes[1])
+
+    // 3. Hostlet receives completion code from 2nd Consumer (delivery code)
+   // LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError1 );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[1] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+
+    delete ipHostlet;
+    ipHostlet = NULL;
+
+    delete ipConnection;
+    ipConnection = NULL;
+
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+ 
+    
+TInt CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL(TTestResult& aResult)
+    {
+	SetupL(); 
+    // Try to send one message  from ServiceConnection to HostletConnection,
+    // which provides response (TRANSPORT) properties to the response message
+    
+    // Construct Hostlet
+    
+    ipHostlet = CTestHostlet::NewL(this, &CSenHostletConnectionBCTest::UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    MSenProperties* pHostletProps = ipHostlet->iResponseProps[0];
+    
+    LOCAL_ASSERT( ipHostlet->iResponseProps[0] != NULL ); // The tp that was sent
+    LOCAL_ASSERT( ipConsumer->iResponseProperties[0] != NULL); // The tp that was received
+    
+    
+    
+    
+    HBufC8* pSerializedPropsSentByHC = ipHostlet->iResponseProps[0]->AsUtf8LC(); // push
+    HBufC8* pSerializedPropsReceivedBySC = ipConsumer->iResponseProperties[0]->AsUtf8LC(); // push
+
+    LOCAL_ASSERT( *pSerializedPropsSentByHC == *pSerializedPropsReceivedBySC );
+    
+    /*EUNIT_PRINT(_L("=> Properties that HC sent:"));*/
+    RDebug::Print (_L("=> Properties that HC sent:"));
+    RDebug::RawPrint(*pSerializedPropsSentByHC);
+    RDebug::Print(_L("=> Properties that SC received:"));
+    RDebug::RawPrint(*pSerializedPropsReceivedBySC);
+    
+    CleanupStack::PopAndDestroy(pSerializedPropsReceivedBySC); // SC's TP AsUtf8LC
+    CleanupStack::PopAndDestroy(pSerializedPropsSentByHC); // HC's TP AsUtf8LC
+    
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+   	Teardown();
+    return KErrNone;
+    }
+    
+           
+    
+CSenSoapMessage* CSenHostletConnectionBCTest::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(KHostletContract, _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/src/testconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+//  CLASS HEADER
+#include "testconsumer.h"
+
+//  INTERNAL INCLUDES
+#include "senhostletconnectionbctest.h"
+
+#include "SenTransportProperties.h"
+
+//namespace
+//    {
+//    _LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+//    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+//    }
+
+
+CTestConsumer* CTestConsumer::NewL(CSenHostletConnectionBCTest* aTestSuite,
+                                   void (*p2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&),
+                                   void (*p2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&),
+                                   void (*p2SetStatus) (CSenHostletConnectionBCTest*, const TInt))
+    {
+    CTestConsumer* pSelf = CTestConsumer::NewLC(aTestSuite, p2HandleMessageL,
+                                                p2HandleErrorL, p2SetStatus);
+    CleanupStack::Pop(pSelf);
+
+    return pSelf;
+    }
+
+CTestConsumer* CTestConsumer::NewLC(CSenHostletConnectionBCTest* aTestSuite,
+                                    void (*p2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&),
+                                    void (*p2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&),
+                                    void (*p2SetStatus) (CSenHostletConnectionBCTest*, const TInt))
+    {
+    CTestConsumer* pSelf = new (ELeave) CTestConsumer(aTestSuite, p2HandleMessageL,
+                                                      p2HandleErrorL, p2SetStatus);
+    CleanupStack::PushL(pSelf);
+
+    return pSelf;
+    }
+
+CTestConsumer::CTestConsumer(CSenHostletConnectionBCTest* aTestSuite,
+                             void (*p2HandleMessageL) (CSenHostletConnectionBCTest*, const TDesC8&),
+                             void (*p2HandleErrorL) (CSenHostletConnectionBCTest*, const TInt, const TDesC8&),
+                             void (*p2SetStatus) (CSenHostletConnectionBCTest*, const TInt))
+    : ipTestSuite(aTestSuite),
+      ip2HandleMessageL(p2HandleMessageL),
+      ip2HandleErrorL(p2HandleErrorL),
+      ip2SetStatus(p2SetStatus)
+    {
+
+    }
+
+CTestConsumer::~CTestConsumer()
+    {
+    iResponses.ResetAndDestroy();
+    iResponseProperties.ResetAndDestroy();
+    iResponseCodes.Reset();
+    }
+
+void CTestConsumer::HandleMessageL(const TDesC8& aMessage)
+    {
+    iErrorCode = KErrNone;
+    iTxnId = ipTestSuite->ipConnection->TxnId();
+
+    MSenMessage* pResponse = ipTestSuite->ipConnection->Response();
+    if( pResponse )
+        {
+        MSenProperties* pProperties = pResponse->Properties();
+        if( pProperties )
+            {
+            CSenTransportProperties* pTransportProperties = NULL;
+            if( pProperties->IsSafeToCast(MSenProperties::ESenTransportProperties))
+                {
+                pTransportProperties = (CSenTransportProperties*)pProperties;
+                
+                CSenTransportProperties* pClone = (CSenTransportProperties*)pTransportProperties->CloneL();
+                if( pClone )
+                    {
+                    CleanupStack::PushL(pClone);
+                    TInt appendError = iResponseProperties.Append(pClone);
+                    if( appendError )
+                        {
+                        CleanupStack::PopAndDestroy(pClone);
+                        }
+                    else
+                        {
+                        // OK, pClone is now owned by ipResponseProperties
+                        CleanupStack::Pop(pClone);
+                        }
+                    }
+                }
+            }
+        }
+
+
+    iResponseCodes.Append(KErrNone);
+    iResponses.Append(aMessage.AllocL());
+    if ( ip2HandleMessageL )
+        {
+        (*ip2HandleMessageL)(ipTestSuite, aMessage);        
+        }
+    ipTestSuite->StopActiveScheduler();
+    }
+
+void CTestConsumer::HandleErrorL(const TInt aErrorCode, const TDesC8& aMessage)
+    {
+    iErrorCode = aErrorCode;
+    iTxnId = ipTestSuite->ipConnection->TxnId();
+
+    MSenMessage* pResponse = ipTestSuite->ipConnection->Response();
+    if( pResponse )
+        {
+        MSenProperties* pProperties = pResponse->Properties();
+        if( pProperties )
+            {
+            CSenTransportProperties* pTransportProperties = NULL;
+            if( pProperties->IsSafeToCast(MSenProperties::ESenTransportProperties))
+                {
+                pTransportProperties = (CSenTransportProperties*)pProperties;
+                
+                CSenTransportProperties* pClone = (CSenTransportProperties*)pTransportProperties->CloneL();
+                if( pClone )
+                    {
+                    CleanupStack::PushL(pClone);
+                    TInt appendError = iResponseProperties.Append(pClone);
+                    if( appendError )
+                        {
+                        CleanupStack::PopAndDestroy(pClone);
+                        }
+                    else
+                        {
+                        // OK, pClone is now owned by ipResponseProperties
+                        CleanupStack::Pop(pClone);
+                        }
+                    }
+                }
+            }
+        }
+
+    iResponseCodes.Append(aErrorCode);
+    HBufC8* pMessage = aMessage.AllocL();
+    CleanupStack::PushL(pMessage);
+    TInt appendError2 =  iResponses.Append(pMessage);
+    if( appendError2 )
+        {
+        CleanupStack::PopAndDestroy(pMessage);
+        }
+    else
+        {
+        CleanupStack::Pop(pMessage);
+        }        
+
+    if ( ip2HandleErrorL )
+        {
+        (*ip2HandleErrorL)(ipTestSuite, aErrorCode, aMessage);
+        }
+    ipTestSuite->StopActiveScheduler();
+    }
+
+void CTestConsumer::SetStatus(const TInt aStatus)
+    {
+    iConnectionStatus = aStatus;
+
+    
+    if ( ip2SetStatus )
+        {
+        (*ip2SetStatus)(ipTestSuite, aStatus); // func call via ptr
+        }
+    else
+        {
+        // Active Scheduler was NOT stopped by static function (func call via ptr above)
+        switch( aStatus )
+            {
+            case KSenConnectionStatusReady:
+                {
+                ipTestSuite->StopActiveScheduler(); // otherwise failed SC construction is reported via HandleErrorL(!)
+                }
+                break;
+            case KSenConnectionStatusNew:
+            case KSenConnectionStatusExpired:
+            default:            
+                break;
+            }
+        
+        }
+    }
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconn/src/testhostlet.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+//  CLASS HEADER
+#include "testhostlet.h"
+
+//  EXTERNAL INCLUDES
+#include <StifTestInterface.h>
+
+#include <SenTransportProperties.h>
+
+//  INTERNAL INCLUDES
+#include "senhostletconnectionbctest.h"
+
+namespace
+    {
+    //_LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+    }
+
+CTestHostlet* CTestHostlet::NewL(CSenHostletConnectionBCTest* aTestSuite,
+                                 TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                                 TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                                 void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    {
+    CTestHostlet* pSelf = CTestHostlet::NewLC(aTestSuite, ap2ServiceL, ap2OnServiceCompleteL, ap2DescribeServiceL);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CTestHostlet* CTestHostlet::NewLC(CSenHostletConnectionBCTest* aTestSuite,
+                                  TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                                  TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                                  void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    {
+    CTestHostlet* pSelf = new (ELeave) CTestHostlet(aTestSuite, ap2ServiceL, ap2OnServiceCompleteL, ap2DescribeServiceL);
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+	    
+    return pSelf;
+    }
+
+CTestHostlet::CTestHostlet(CSenHostletConnectionBCTest* aTestSuite,
+                           TInt (*ap2ServiceL) (CSenHostletConnectionBCTest*, MSenHostletRequest&, MSenHostletResponse&),
+                           TInt (*ap2OnServiceCompleteL) (CSenHostletConnectionBCTest*, const TInt, TInt, const TDesC8&),
+                           void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    : ipTestSuite(aTestSuite),
+      ip2ServiceL(ap2ServiceL),
+      ip2OnServiceCompleteL(ap2OnServiceCompleteL),
+      ip2DescribeServiceL(ap2DescribeServiceL)
+    {
+    }
+
+CTestHostlet::~CTestHostlet()
+    {
+    delete ipHostletDescription;
+    iRequests.ResetAndDestroy();
+    iResponses.ResetAndDestroy();
+    iRequestProps.ResetAndDestroy();
+    iRequestPropTypes.Reset();
+    iResponseProps.ResetAndDestroy();
+    iResponseCodes.Reset();
+    iTxnIds.Reset();
+    iCompletionCodes.Reset();
+    }
+
+void CTestHostlet::ConstructL()
+    {
+    ipHostletDescription = CSenXmlServiceDescription::NewL(KNullDesC8, KHostletContract);
+	//ipHostletDescription = CSenXmlServiceDescription::NewL(KHostletEndpoint, KNullDesC8);    	
+    ipHostletDescription->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    }
+    
+
+void CTestHostlet::DescribeServiceL(CSenXmlServiceDescription& aSD) 
+    { 
+    if( ip2DescribeServiceL ) 
+    	{
+   		(*ip2DescribeServiceL)(aSD);
+    	}
+        else
+            {
+            aSD.SetEndPointL(Endpoint());
+            aSD.SetContractL(Contract()); 
+            aSD.SetFrameworkIdL(FrameworkId());	
+            }
+    }
+
+TPtrC8 CTestHostlet::Contract() const
+    {
+    return ipHostletDescription->Contract();
+    }
+
+TPtrC8 CTestHostlet::Endpoint() const
+    {
+    return ipHostletDescription->Endpoint();
+    }
+
+TInt CTestHostlet::ServiceL(MSenHostletRequest& aRequest, MSenHostletResponse& aResponse)
+    {
+    
+
+    iTxnIds.Append(aRequest.RequestId());
+    iResponseCodes.Append(KErrNone);
+    
+
+    	
+    TInt retVal(KErrNone);
+    // Setup default response, can be overridden by test case:
+    // Dummy response
+    TPtrC8 request = aRequest.RequestUtf8();
+
+
+    iRequests.Append(request.AllocL());
+    
+    MSenProperties::TSenPropertiesClassType propType;
+    TPtrC8 requestProperties = aRequest.Properties(propType);
+    iRequestProps.Append(requestProperties.AllocL());
+    iRequestPropTypes.Append(propType);
+    
+//    _LIT8(KResponseFmt, "<Response><ReplyMessage>CSenHostletConnectionBCTest is alive.</ReplyMessage><Request>%S</Request></Response>");
+  	_LIT8(KResponseFmt, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header></S:Header><S:Body>testing text hostlet</S:Body></S:Envelope>");  
+    HBufC8* pResponse = HBufC8::NewLC(request.Length()+KResponseFmt().Length());
+    TInt appendError = iResponses.Append(pResponse);
+    if( appendError )
+        {
+        CleanupStack::PopAndDestroy(pResponse); // delete orphan HBufC8 / pResponse
+        }
+    else
+        {
+        CleanupStack::Pop(pResponse); // now owned by iResponses -array..
+        }        
+    
+    TPtr8 response = iResponses[iTxnIds.Count()-1]->Des();
+    response.Format(KResponseFmt, &request);
+    aResponse.SetResponseUtf8L(response, iResponseCodes[iTxnIds.Count()-1]); // by default, all requests are "accepted"
+      
+    if ( ip2ServiceL )
+        {
+        // NOTE(!): if RESPONSE CODE in aResponse is modified in YOUR test case,
+        // remember set iResponseCodes for this test hostlet instance in your test
+        //  case code (ServiceL callback)
+        retVal = (*ip2ServiceL)(ipTestSuite, aRequest, aResponse); 
+        }
+    TPtrC8 providedResponse = aResponse.ResponseUtf8();
+    
+    if ( iResponses[iTxnIds.Count()-1]->Compare(providedResponse) != 0 )
+        {
+        // response was altered by TEST CASE:
+        iResponses.Insert(aResponse.ResponseUtf8().AllocL(),iTxnIds.Count()-1);
+        }
+        
+        
+    RDebug::Print(_L("CTestHostlet::ServiceL received:"));
+    RDebug::RawPrint(request);
+    if (ipTestSuite->ipUsedHostletConnection)
+    {
+    	iRespondRetCode = ipTestSuite->ipUsedHostletConnection->RespondL(aResponse); 
+    }
+    else
+		iRespondRetCode = ipTestSuite->ipHostletConnection->RespondL(aResponse); 
+   return retVal;
+    }
+
+void CTestHostlet::OnServiceCompleteL(const TInt aTxnId, 
+                                      TInt aCompletionCode, 
+                                      const TDesC8& aDesc)
+    {
+  
+    iCompletionCodes.Append(aCompletionCode); 
+    if( ip2OnServiceCompleteL )
+        {
+        (*ip2OnServiceCompleteL)( ipTestSuite, aTxnId, aCompletionCode, aDesc );
+        }
+    ipTestSuite->StopActiveScheduler(); // service provided
+    }
+    
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/Bmarm/hostconnTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/Bwins/hostconnTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/conf/hostconnTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,161 @@
+[Test]
+title NewL-ChostconnTester
+create hostconnTester obj 
+obj NewL-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-ChostconnTester
+create hostconnTester obj 
+obj NewLC-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title Identifier-ChostconnTester
+create hostconnTester obj 
+obj Identifier-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title FrameworkId-ChostconnTester
+create hostconnTester obj 
+obj FrameworkId-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RequestUtf8-ChostconnTester
+create hostconnTester obj 
+obj RequestUtf8-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title ThreadId-ChostconnTester
+create hostconnTester obj 
+obj ThreadId-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-ChostconnTester
+create hostconnTester obj 
+obj NewLC-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL1-ChostconnTester 
+create hostconnTester obj 
+obj RespondL1-ChostconnTester  
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL2-ChostconnTester
+create hostconnTester obj 
+obj RespondL2-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL3-ChostconnTester
+create hostconnTester obj 
+obj RespondL3-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_negative_response_code-ChostconnTester
+create hostconnTester obj 
+obj RespondL_negative_response_code-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_self_def_URI-ChostconnTester
+create hostconnTester obj 
+obj RespondL_self_def_URI-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL_leaves_with_KErrSenEndpointReserved-ChostconnTester
+create hostconnTester obj 
+obj NewL_leaves_with_KErrSenEndpointReserved-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Two_HC_with_the_same_Endpoints_UIDs-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Two_HC_with_the_same_Endpoints_UIDs-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Two_HC_Two_SC_diff_contracts-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Two_HC_Two_SC_diff_contracts-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Two_HC_Two_SC_diff_endpionts-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Two_HC_Two_SC_diff_endpionts-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Two_HC_Two_SC_diff_endpionts_the_same_contract-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Two_HC_Two_SC_diff_endpionts_the_same_contract-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Delete_SC_before_calling_HC::RespondL-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Delete_SC_before_calling_HC::RespondL-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Call_RespondL_multipe_times-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Call_RespondL_multipe_times-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_SC::Cancel_after_request-ChostconnTester
+create hostconnTester obj 
+obj RespondL_SC::Cancel_after_request-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title RespondL_Set_Expose_Facet-ChostconnTester
+create hostconnTester obj 
+obj RespondL_Set_Expose_Facet-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title HC_responds_with_TP-ChostconnTester
+create hostconnTester obj 
+obj HC_responds_with_TP-ChostconnTester 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL_from_2_SCs_to_1_HC-ChostconnTester
+create hostconnTester obj 
+obj SendL_from_2_SCs_to_1_HC-ChostconnTester 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/eabi/hostconnTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for hostconntester
+*
+*/
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+hostconnTester.mmp
+
+PRJ_MMPFILES
+//hostconnTester.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for hostconntester 
+*
+*/
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          hostconnTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+
+DEFFILE         hostconnTester.def
+SOURCEPATH              ../src
+SOURCE                  TestConsumer.cpp
+SOURCE                  TestHostlet.cpp
+
+//USERINCLUDE             ../inc
+
+//SYSTEMINCLUDE           /epoc32/include
+SYSTEMINCLUDE       	/Epoc32/include/libc
+MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE
+
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          hostconnTester.cpp
+SOURCE          hostconnTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         stiftestengine.lib
+LIBRARY                 stiftestinterface.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 SenLogger.lib
+LIBRARY                 SenProvider.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenHostConn.lib
+LIBRARY                 SenServConn.lib
+LIBRARY					avkon.lib 
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,56 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\hostconnTester.dll"   -   "c:\Sys\Bin\hostconnTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\hostconnTester.cfg"-"c:\testing\conf\hostconnTester.cfg"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/inc/hostconnTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef HOSTCONNTESTER_H
+#define HOSTCONNTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <MSenHostlet.h>
+#include <f32file.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <SenXmlServiceDescription.h>
+#include <SenHostletConnection.h>
+
+
+#include <SenBaseElement.h>
+#include <SenSoapMessage.h>
+#include <SenDateUtils.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KSenHostletConnection_stifLogPath, "\\logs\\testframework\\SenHostletConnection_stif\\" ); 
+// Log file
+_LIT( KSenHostletConnection_stifLogFile, "SenHostletConnection_stif.txt" ); 
+
+
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenHostletConnection;
+class CTestConsumer;
+class CTestHostlet;
+class ChostconnTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+typedef TInt (ChostconnTester::* TestFunction)(CStifItemParser&);
+
+// CLASS DECLARATION
+
+/**
+*  ChostconnTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+//  CLASS DEFINITIONS
+
+// FORWARD DECLARATIONS
+class CActiveConsumerTestTask;
+//class ChostconnTester;
+
+NONSHARABLE_CLASS( TConsumerTestTask )
+    {
+    public:
+        enum TJob
+            {
+            ECreateConnAndSubmit = 0,
+            ESubmit,
+            EActiveSubmit
+            };
+    
+    
+        inline TConsumerTestTask(CSenServiceConnection& aConnection, const TDesC8& aWsRequest, const TDesC8& aFrameworkId, TJob aJob, HBufC8*& apResult)
+            : iConnection(aConnection),
+            iRequest(aWsRequest),
+            iFrameworkId(aFrameworkId),
+            iJob(aJob),
+            iStatusCode(KErrNone),
+            ipNotOwnedData(apResult),
+            ipSoapMsg(NULL)
+            {
+            }
+            
+        void Execute();
+
+
+    public: // Data (which is NOT OWNED, as this is a T-class)...      
+        CSenServiceConnection&      iConnection;
+        TPtrC8                      iRequest;
+        TPtrC8                      iFrameworkId;
+        TJob                        iJob;
+        TInt                        iStatusCode;
+        HBufC8*&                    ipNotOwnedData;
+        CActiveConsumerTestTask*    ipActive;
+        ChostconnTester*       ipOwner;
+        TPtrC8                      iProperties;
+        TPtrC8                      iEndpoint;
+        CSenSoapMessage*            ipSoapMsg; // ... never & none owned.
+    };
+NONSHARABLE_CLASS( CActiveConsumerTestTask ) : public CActive
+    {
+    friend class ChostconnTester;
+    
+    public:
+        enum TStatus
+            {
+            EInvokeService = 1,
+            EDeliverResponse
+            };    
+
+        static CActiveConsumerTestTask* NewL(TConsumerTestTask& aTask, const TDesC& aThreadName, ChostconnTester& aOwner);
+        static CActiveConsumerTestTask* NewLC(TConsumerTestTask& aTask, const TDesC& aThreadName, ChostconnTester& aOwner);
+        
+        ~CActiveConsumerTestTask();
+        
+        void RunL();
+        void DoCancel();
+
+    private:
+        void ConstructL(const TDesC& aThreadName);
+        CActiveConsumerTestTask(TConsumerTestTask& aTask, ChostconnTester& aOwner);
+
+    public: // Data
+        TThreadId               iOwnerThreadId;
+
+
+    private: // Data
+        TConsumerTestTask&      iTask;
+        RThread                 iTaskThread;
+        ChostconnTester&   iOwner;
+    };
+NONSHARABLE_CLASS(ChostconnTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static ChostconnTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~ChostconnTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+        void StopActiveScheduler();
+         void StartActiveScheduler(TInt aNumberOfExpectedOperationsPriorStop);
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+                                       
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        ChostconnTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        void Delete();
+        
+
+	    friend class CTestConsumer;
+    	friend class CTestHostlet;
+    public: // Public data => OK in testers, no benefit gained from getters => in real apps, these should be private:
+        CSenServiceConnection*      ipConnection;
+        CSenServiceConnection*      ipConnection1;
+        CSenHostletConnection*      ipHostletConnection;
+        CSenHostletConnection*      ipHostletConnection1;
+        CSenHostletConnection*		ipUsedHostletConnection;
+    private:    // New methods
+
+         static void UT_CSenHostletConnection_WSI_DescribeServiceL(CSenXmlServiceDescription&);
+         static void UT_CSenHostletConnection_WSI_DescribeService_2L(CSenXmlServiceDescription&);
+         static void UT_CSenHostletConnection_NewLL_SetStatus(ChostconnTester* apTestSuite, TInt aStatus);
+         static void UT_CSenHostletConnection_NewLL_HandleMessageL(ChostconnTester* apTestSuite, const TDesC8& aMessage );
+         static void UT_CSenHostletConnection_NewLL_HandleErrorL(ChostconnTester* apTestSuite, const TInt aErrorCode, const TDesC8& aMessage );
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceL(ChostconnTester* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceCompleteL(ChostconnTester* apTestSuite, const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc );
+				 static TInt UT_CSenHostletConnection_NewLL_OnService1L(ChostconnTester* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceComplete1L(ChostconnTester* apTestSuite, const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc );
+				 static TInt UT_CSenHostletConnection_NewLL_OnService2L(ChostconnTester* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+		 		 static TInt UT_CSenHostletConnection_NewLL_OnService3L(ChostconnTester* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+         static TInt UT_CSenHostletConnection_NewLL_OnServiceComplete2L(ChostconnTester* apTestSuite, const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc );                        
+         static void UT_CSenHostletConnection_NewLL_HandleError1L(ChostconnTester* apTestSuite, const TInt aErrorCode, const TDesC8& aMessage );
+         static TInt UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL(ChostconnTester* apTestSuite, MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+		 		 CSenSoapMessage* CreateAuthRequestLC();
+
+         TInt UT_CSenHostletConnection_NewLL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_NewLCL(CStifItemParser& aItem);
+        
+         TInt UT_CSenHostletConnection_NewLC_3InvokesL(CStifItemParser& aItem);
+        
+         TInt UT_CSenHostletConnection_RespondL1L(CStifItemParser& aItem);
+
+         TInt UT_CSenHostletConnection_RespondL2L(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_RespondL3L(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Negative_ResponseCodeL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_HC_SelfDef_URIL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Delete_HCL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Two_Equal_UID3L(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Two_Equal_EndpointsL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Two_HC_Two_SC1L(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Two_HC_Two_SC2L(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Two_HC_Two_SC3L(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_DeleteSC_before_HCRespondLL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_RespondL_4multipleTimesL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_SC_Cancel_After_RequestL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_Set_Expose_FacetL(CStifItemParser& aItem);
+         
+         TInt UT_CSenHostletConnection_RespondWithPropertiesL(CStifItemParser& aItem);
+
+         //TInt UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL(CStifItemParser& aItem);
+
+         TInt UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL(CStifItemParser& aItem);
+
+         TInt UT_CSenHostletConnection_Send_WSIL(CStifItemParser& aItem);
+
+         TInt UT_CSenHostletConnection_DescEndpoint_Send_WSIL(CStifItemParser& aItem);
+
+         TInt UT_CSenHostletConnection_2SC1HCL(CStifItemParser& aItem);
+
+         TInt UT_CSenHostletConnection_Submit_Rest_MultiThreadL(CStifItemParser& aItem); // Just for debugging, won't pass
+
+         TInt UT_CSenHostletConnection_Submit_Rest_ActiveL(CStifItemParser& aItem); // Just for debugging, won't pass
+         
+         // TInt UT_CSenHostletConnection_Submit_WSIL(CStifItemParser& aItem); // non-working version, just to keep note
+         TInt UT_CSenHostletConnection_IdentifierL(CStifItemParser& aItem );
+		 TInt UT_CSenHostletConnection_FrameworkIdL(CStifItemParser& aItem );
+		 TInt UT_CSenHostletConnection_RequestUtf8L(CStifItemParser& aItem );
+		 TInt UT_CSenHostletConnection_ThreadIdL(CStifItemParser& aItem );
+		 TInt UT_CSenHostletConnection_ConsumerIdL(CStifItemParser& aItem );
+		 TInt UT_CSenHostletConnection_RequestIdL(CStifItemParser& aItem );
+        /**
+        * Test methods are listed below. 
+        */
+
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        TInt                        iNumberOfPendingOps;
+        TInt                        iRespondRetCode;
+        TInt                        iNumOfReqs;
+        TBool                       iWas_HandleErrorL_Accessed;
+        TBool                       iWas_OnServiceL_Accessed;        
+        TInt                        iTxnID;       
+        
+        CTestConsumer*              ipConsumer;        
+        CTestConsumer*              ipConsumer1;        
+        CTestHostlet*               ipHostlet;
+				CTestHostlet*               ipHostlet1;   
+		
+				CActiveScheduler* iActiveScheduler;
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // HOSTCONNTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/inc/testconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef __TESTCONSUMER_H__
+#define __TESTCONSUMER_H__
+
+//  EXTERNAL INCLUDES
+#include <SenServiceConnection.h>
+
+//  INTERNAL INCLUDES
+
+//  FORWARD DECLARATIONS
+class ChostconnTester;
+
+class CTestConsumer : public CBase, public MSenServiceConsumer
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static CTestConsumer* NewL(ChostconnTester* aTestSuite,
+                                   void (*ap2HandleMessageL) (ChostconnTester*, const TDesC8&) = NULL,
+                                   void (*ap2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&) = NULL,
+                                   void (*ap2SetStatus) (ChostconnTester*, const TInt) = NULL);
+        static CTestConsumer* NewLC(ChostconnTester* aTestSuite,
+                                   void (*ap2HandleMessageL) (ChostconnTester*, const TDesC8&) = NULL,
+                                   void (*ap2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&) = NULL,
+                                   void (*ap2SetStatus) (ChostconnTester*, const TInt) = NULL);
+        /**
+         * Destructor
+         */
+        ~CTestConsumer();
+
+        virtual void HandleMessageL(const TDesC8& aMessage);
+
+        virtual void HandleErrorL(const TInt aErrorCode,
+                                  const TDesC8& aMessage);
+
+        virtual void SetStatus(const TInt aStatus);
+
+    public: // Public data => OK in testers, no benefit gained from getters => in real apps, these should be private:
+        
+        RPointerArray<HBufC8>		iResponses; // ok/error => check iErrorCode to determine which
+        RPointerArray<CSenTransportProperties> iResponseProperties;
+        RArray<TInt> 				iResponseCodes;// either error code (if handle error) OR KErrNone (if handle message) 
+        TInt 						iConnectionStatus;
+        TInt 						iTxnId;
+        TInt                        iErrorCode;
+
+
+    private:    // Constructor
+        CTestConsumer(ChostconnTester* aTestSuite,
+                      void (*ap2HandleMessageL) (ChostconnTester*, const TDesC8&) = NULL,
+                      void (*ap2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&) = NULL,
+                      void (*ap2SetStatus) (ChostconnTester*, const TInt) = NULL);
+
+    private:    // Data
+        ChostconnTester*       ipTestSuite;
+        
+    private:    // Function pointers
+        void (*ip2HandleMessageL) (ChostconnTester*, const TDesC8&);
+        void (*ip2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&);
+        void (*ip2SetStatus) (ChostconnTester*, const TInt);
+    };
+
+#endif      //  __TESTCONSUMER_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/inc/testhostlet.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef __TESTHOSTLET_H__
+#define __TESTHOSTLET_H__
+
+//  EXTERNAL INCLUDES
+#include "hostconnTester.h"
+#include <MSenProperties.h>
+
+//  INTERNAL INCLUDES
+
+//  FORWARD DECLARATIONS
+class CHostletConnectionBCTest;
+
+class CTestHostlet : public CBase, public MSenHostlet
+    {
+    public:
+
+        /**
+         * Two phase construction
+         */
+        static CTestHostlet* NewL(ChostconnTester* aTestSuite,
+                                  TInt (*ap2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&) = NULL,
+                                  TInt (*ap2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&) = NULL,
+                                  void (*ap2DescribeServiceL) (CSenXmlServiceDescription&) = NULL);
+
+        static CTestHostlet* NewLC(ChostconnTester* aTestSuite,
+                                   TInt (*ap2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&) = NULL,
+                                   TInt (*ap2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&) = NULL,
+                                   void (*ap2DescribeServiceL) (CSenXmlServiceDescription&) = NULL);
+
+        /**
+         * Destructor
+         */
+        ~CTestHostlet();
+        virtual void DescribeServiceL(CSenXmlServiceDescription& aSD);
+
+        virtual TPtrC8 Contract() const;
+
+        virtual TPtrC8 Endpoint() const;
+
+        virtual TInt ServiceL(MSenHostletRequest& aRequest, MSenHostletResponse& aResponse);
+        virtual void OnServiceCompleteL(const TInt aTxnId, TInt aCompletionCode, const TDesC8& aDesc);
+
+    public: // Public data => OK in testers, no benefit gained from getters => in real apps, these should be private:
+        CSenXmlServiceDescription*  ipHostletDescription;
+        RPointerArray<HBufC8>		iRequests;
+        RPointerArray<HBufC8>		iResponses;
+        RPointerArray<HBufC8>       iRequestProps;
+        RArray<MSenProperties::TSenPropertiesClassType> iRequestPropTypes;
+        RPointerArray<CSenTransportProperties> iResponseProps;
+        RArray<TInt>				iResponseCodes;
+        TInt                        iRespondRetCode; // direct retCode from RespondL (async)
+        RArray<TInt>                iCompletionCodes; // from OnServiceCompleteL => indicates how Respond operation was delivered
+        RArray<TInt>				iTxnIds;
+    //MSenHostlet
+    
+    		inline virtual TPtrC8 FrameworkId() const 
+    		{ 
+    			return KDefaultRestServicesFrameworkID(); 
+    		}
+    //MSenHostletRequest
+            inline virtual TPtrC8 RequestUtf8() const 
+            {
+            	return _L8("");
+            }
+            inline virtual TPtrC ThreadId() const 
+            {
+            	return _L("");
+            }
+            inline virtual TPtrC8 ConsumerId() const 
+            {
+            	return _L8("");
+            }
+			inline virtual TInt RequestId() const 
+			{
+				return KErrNone;
+			}
+			inline virtual TPtrC8 Properties(MSenProperties::TSenPropertiesClassType& aType) const 
+			{
+				return _L8("");
+			}
+    private:    // Constructor
+        CTestHostlet(ChostconnTester* aTestSuite,
+                     TInt (*ap2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&),
+                     TInt (*ap2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&),
+                     void (*ap2DescribeServiceL) (CSenXmlServiceDescription&));
+        void ConstructL();
+
+    private:    // Data
+        ChostconnTester*       ipTestSuite;
+        
+    private:    // Function pointers
+        TInt (*ip2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&);
+        TInt (*ip2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&);
+        void (*ip2DescribeServiceL)(CSenXmlServiceDescription&);
+    };
+
+#endif      //  __TESTHOSTLET_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\hostconnTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/hostconnTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "hostconnTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ChostconnTester::ChostconnTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+ChostconnTester::ChostconnTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// ChostconnTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void ChostconnTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    iLog = CStifLogger::NewL( KSenHostletConnection_stifLogPath, 
+                          KSenHostletConnection_stifLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "KSenHostletConnection_stif logging starts!" );
+    iLog->Log( KLogStart );
+    
+//    iActiveScheduler = new CActiveScheduler;
+//	  CActiveScheduler::Install( iActiveScheduler );
+    }
+
+// -----------------------------------------------------------------------------
+// ChostconnTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+ChostconnTester* ChostconnTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    ChostconnTester* self = new (ELeave) ChostconnTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+ChostconnTester::~ChostconnTester()
+    {
+    delete iLog;
+    
+    delete iActiveScheduler;
+   
+    }
+
+//-----------------------------------------------------------------------------
+// ChostconnTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void ChostconnTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("hostconnTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+// -----------------------------------------------------------------------------
+// ChostconnTester::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+//TInt ChostconnTester::RunTestCaseL( 
+//    const TInt aCaseNumber,   
+//    const TFileName& /*aConfig*/,
+//    TTestResult& aResult )
+//    {
+
+    // Return value
+//    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+//    TCaseInfo tmp = Case ( aCaseNumber );
+
+//    _LIT( KLogStartTC, "Starting testcase [%S]" );
+//    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+//    if ( tmp.iMethod != NULL )
+//        {
+        // Valid case was found, call it via function pointer
+//        iMethod = tmp.iMethod;        
+//        execStatus  = ( this->*iMethod )( aResult );
+//        }
+//    else
+//        {
+        // Valid case was not found, return error.
+//        execStatus = KErrNotFound;
+//        }
+
+    // Return case execution status (not the result of the case execution)
+//    return execStatus;
+
+//    }
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) ChostconnTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/hostconnTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3085 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <e32math.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+#include <SenHttpTransportProperties.h>
+#include "SenHostletConnection.h"
+#include "TestConsumer.h"
+#include "TestHostlet.h"
+#include <SenFacet.h>
+
+#include <SenTransportProperties.h>
+#include "hostconnTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+#define LOCAL_VOID_ASSERT(expression)	{if(!(expression)){return ;}}
+
+namespace
+    {
+    _LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+    _LIT8(KHostletEndpoint1, "hostlet://UnitTestHostlet-1");
+    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+    _LIT8(KHostletContract1, "urn:nokia.com.serene:unit-test-hostlet-1");  
+    
+    void threadMainL(TAny* aPtr)
+        {
+        TConsumerTestTask* pTask = (TConsumerTestTask*) aPtr;
+        pTask->Execute();
+        // Go safely out of scope (will destroy this thread)
+        }
+    
+    TInt threadFunction(TAny* aPtr)
+        {
+        CTrapCleanup* pCleanup = CTrapCleanup::New();
+        CActiveScheduler::Install(NULL); // remove one
+        CActiveScheduler* pScheduler = new (ELeave) CActiveScheduler();
+        CActiveScheduler::Install(pScheduler);
+
+        TInt leaveCode(KErrNone);
+        TRAP(leaveCode, threadMainL(aPtr));
+
+        CActiveScheduler::Install(NULL); // uninstall scheduler
+        delete pScheduler;
+        delete pCleanup;
+
+        return leaveCode;
+        }
+        
+        
+    TInt CreateThreadForConsumerTask(RThread& aThread, const TDesC& aThreadName, TConsumerTestTask& aTask)
+        {
+        TName threadName(aThreadName);
+        // Append a random number to make it unique
+        threadName.AppendNum(Math::Random(), EHex);
+                
+#ifdef EKA2
+        RAllocator& heap = User::Allocator(); // RHeap is deprecated in EKA2
+        return aThread.Create(threadName, // name
+                              threadFunction,
+                              KDefaultStackSize,
+                              &heap,
+                              &aTask);
+#else // EKA1
+        RHeap& heap = User::Heap();
+        return aThread.Create(threadName, // name
+                              threadFunction,
+                              KDefaultStackSize,
+                              &heap,
+                              &aTask);
+#endif // EKA        
+        }      
+    }   
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ChostconnTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void ChostconnTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// ChostconnTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt ChostconnTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("NewL-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_NewLL),
+    
+		ENTRY("NewLC-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_NewLCL),
+		ENTRY("Identifier-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_IdentifierL), 
+		
+		ENTRY("FrameworkId-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_FrameworkIdL), 
+		
+		ENTRY("RequestUtf8-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_RequestUtf8L), 
+		
+		ENTRY("ThreadId-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_ThreadIdL), 
+
+		ENTRY("NewLC-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_NewLC_3InvokesL),
+
+		ENTRY("RespondL1-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_RespondL1L),
+		ENTRY("NewLC-ChostconnTester ", ChostconnTester::UT_CSenHostletConnection_NewLC_3InvokesL),
+
+		ENTRY("RespondL1-ChostconnTester ", ChostconnTester::UT_CSenHostletConnection_RespondL1L),
+   
+		ENTRY("RespondL2-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_RespondL2L),
+
+		ENTRY("RespondL3-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_RespondL3L),
+
+		ENTRY("RespondL_negative_response_code-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Negative_ResponseCodeL),
+    
+		ENTRY("RespondL_self_def_URI-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_HC_SelfDef_URIL),
+    
+		//ENTRY("RespondL delete HC after SC is created-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Delete_HCL),
+
+		ENTRY("NewL_leaves_with_KErrSenEndpointReserved-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Two_Equal_UID3L),
+         
+		ENTRY("RespondL_Two_HC_with_the_same_Endpoints_UIDs-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Two_Equal_EndpointsL),    
+   
+		ENTRY("RespondL_Two_HC_Two_SC_diff_contracts-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Two_HC_Two_SC1L),    
+     
+		ENTRY("RespondL_Two_HC_Two_SC_diff_endpionts-ChostconnTester",ChostconnTester::UT_CSenHostletConnection_Two_HC_Two_SC2L),    
+
+		ENTRY("RespondL_Two_HC_Two_SC_diff_endpionts_the_same_contract-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Two_HC_Two_SC3L),    
+      
+		ENTRY("RespondL_Delete_SC_before_calling_HC::RespondL-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_DeleteSC_before_HCRespondLL),    
+
+		ENTRY("RespondL_Call_RespondL_multipe_times-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_RespondL_4multipleTimesL),    
+
+		ENTRY("RespondL_SC::Cancel_after_request-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_SC_Cancel_After_RequestL),    
+    
+		ENTRY("RespondL_Set_Expose_Facet-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Set_Expose_FacetL),    
+
+		ENTRY("HC_responds_with_TP-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_RespondWithPropertiesL),    
+
+		//ENTRY("New REST SC + SubmitL Test-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL),    
+
+		//ENTRY("New WS-I SC + SubmitL Test-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL),    
+
+
+		//ENTRY("SendL WS-I Test-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_Send_WSIL),    
+
+		//ENTRY("Desc EP + SendL-WS-I-Test-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_DescEndpoint_Send_WSIL),    
+
+		ENTRY("SendL_from_2_SCs_to_1_HC-ChostconnTester", ChostconnTester::UT_CSenHostletConnection_2SC1HCL)
+
+        };
+            const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+    } 
+
+// -----------------------------------------------------------------------------
+// ChostconnTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt ChostconnTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+//  METHODS
+
+void ChostconnTester::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+void ChostconnTester::StopActiveScheduler ()
+    {
+    iNumberOfPendingOps--;
+    if ( iNumberOfPendingOps == 0 )
+        {
+    	CActiveScheduler::Stop();
+        }
+    }
+
+void TConsumerTestTask::Execute()
+    {
+    switch(iJob)
+        {
+        case(ECreateConnAndSubmit): // this is a very oddly orientated, wild case..
+            {
+            if(ipOwner)
+                {
+                CTestConsumer* pConsumer = CTestConsumer::NewL(ipOwner); // uses the default implementations for setstatus, handlemessage, handleerror
+                CleanupStack::PushL(pConsumer);
+
+                // Note, if NOT set, iEndpoint is typically KNullDesC8 (zero-lenght), which is OK, too.
+                CSenServicePattern* pPattern = CSenServicePattern::NewLC(iEndpoint, KHostletContract);
+                if(iFrameworkId.Length()>0)
+                    {
+                    pPattern->SetFrameworkIdL(iFrameworkId);
+                    }
+                else
+                    {
+                    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);                        
+                    }
+                    
+                CSenServiceConnection* pConnection = CSenServiceConnection::NewL(*pConsumer, *pPattern);
+                CleanupStack::PopAndDestroy(pPattern);
+                CleanupStack::PushL(pConnection);
+                
+                // Construct service connection by starting active scheduler..
+                ipOwner->StartActiveScheduler(1);
+                
+                // Check that NO HandleErrorL callback was received:
+                LOCAL_VOID_ASSERT( pConsumer->iErrorCode == KErrNone );
+                
+                
+                 // Check that the Status of the ServiceConnection
+                // is KSenConnectionStatusReady
+                LOCAL_VOID_ASSERT( pConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+                // execution returns here EITHER when HandleMessageL or HandleErrorL has been invoked..
+                if(iProperties.Length()==0)
+                    {
+                    if(ipSoapMsg)
+                        {
+                        iStatusCode = pConnection->SubmitL(*ipSoapMsg, ipNotOwnedData);
+                        }
+                    else
+                        {
+                        iStatusCode = pConnection->SubmitL(iRequest, ipNotOwnedData);
+                        }
+                    }
+                else
+                    {
+                    if(ipSoapMsg)
+                        {
+                        iStatusCode = pConnection->SubmitL(*ipSoapMsg, iProperties, ipNotOwnedData);
+                        }
+                    else
+                        {
+                        iStatusCode = pConnection->SubmitL(iRequest, iProperties, ipNotOwnedData);
+                        }
+                    }
+                CleanupStack::PopAndDestroy(pConnection);
+                CleanupStack::PopAndDestroy(pConsumer);
+                }
+           }
+           break;
+
+        case(ESubmit):
+            {
+            if(iProperties.Length()==0)
+                {
+                iStatusCode = iConnection.SubmitL(iRequest, ipNotOwnedData);
+                }
+            else
+                {
+                iStatusCode = iConnection.SubmitL(iRequest, iProperties, ipNotOwnedData);
+                }
+            }
+            break;
+
+        case(EActiveSubmit):
+            {
+            if ( ipActive)
+                {
+                // Perform blocking (sync) submit:
+                if(iProperties.Length()==0)
+                    {
+                    iStatusCode = iConnection.SubmitL(iRequest, ipNotOwnedData);
+                    }
+                else
+                    {
+                    iStatusCode = iConnection.SubmitL(iRequest, iProperties, ipNotOwnedData);
+                    }
+                    
+                // Notify "owner" that blocking operation has completed
+                TRequestStatus* status = &ipActive->iStatus;
+                RThread owner;
+                owner.Open(ipActive->iOwnerThreadId);
+                owner.RequestComplete(status, CActiveConsumerTestTask::EDeliverResponse );
+                }
+            }
+            break;
+           
+        }
+    }
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// HELPER CLASS for SC (active) tasks:
+// Public METHODS
+
+CActiveConsumerTestTask* CActiveConsumerTestTask::NewL(TConsumerTestTask& aTask, const TDesC& aThreadName, ChostconnTester& aOwner)
+    {
+    CActiveConsumerTestTask* pNew = CActiveConsumerTestTask::NewLC(aTask, aThreadName, aOwner);
+    CleanupStack::Pop();
+    return pNew;
+    }
+
+CActiveConsumerTestTask* CActiveConsumerTestTask::NewLC(TConsumerTestTask& aTask, const TDesC& aThreadName, ChostconnTester& aOwner)
+    {
+    CActiveConsumerTestTask* pNew = new (ELeave) CActiveConsumerTestTask(aTask, aOwner);
+    CleanupStack::PushL(pNew);
+    pNew->ConstructL(aThreadName);
+    return pNew;
+    }
+
+CActiveConsumerTestTask::CActiveConsumerTestTask(TConsumerTestTask& aTask, ChostconnTester& aOwner)
+    :   CActive(EPriorityStandard), 
+        iTask(aTask),
+        iOwner(aOwner)
+    {
+    CActiveScheduler::Add(this);    
+    }
+
+CActiveConsumerTestTask::~CActiveConsumerTestTask()
+    {
+    if(IsActive())
+        {
+        Cancel(); // issues DoCancel();
+        }
+    iTaskThread.Close();
+    }
+
+void CActiveConsumerTestTask::RunL()
+    {
+    switch(iStatus.Int())
+        {
+        case(EInvokeService):
+            {
+            iTaskThread.Resume();
+            }
+            break;
+            
+        case(EDeliverResponse):
+            {
+            iOwner.StopActiveScheduler(); // submit complete..
+            }
+            break;
+         /* case defaul: // unknown */
+        }
+    }
+void CActiveConsumerTestTask::DoCancel()
+    {
+    iOwner.StopActiveScheduler();
+    }
+    
+// Private METHODS
+void CActiveConsumerTestTask::ConstructL(const TDesC& aThreadName)
+    {
+    RThread thread;
+    iOwnerThreadId = thread.Id(); 
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(iTaskThread, aThreadName, iTask);        
+    User::LeaveIfError( createThreadRetVal );
+    SetActive();
+    }
+    
+    
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+void  ChostconnTester::UT_CSenHostletConnection_WSI_DescribeServiceL(CSenXmlServiceDescription& aSD)
+    {
+    aSD.SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    aSD.SetEndPointL(KHostletEndpoint);
+    aSD.SetContractL(KHostletContract);
+    }
+
+void  ChostconnTester::UT_CSenHostletConnection_WSI_DescribeService_2L(CSenXmlServiceDescription& aSD)
+    {
+    aSD.SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    aSD.SetContractL(KHostletContract);
+    }
+
+
+void ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus(ChostconnTester* apTestSuite,
+                                                                    TInt aStatus )
+   {
+    switch( aStatus )
+        {
+        case KSenConnectionStatusReady:
+            {
+            apTestSuite->StopActiveScheduler(); // otherwise failed SC construction is reported via HandleErrorL(!)
+            }
+            break;
+        case KSenConnectionStatusNew:
+        case KSenConnectionStatusExpired:
+        default:            
+            break;
+        }
+    }
+
+
+
+// not in use atm:
+void ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL(ChostconnTester* /* apTestSuite */, const TDesC8& /* aMessage*/ )
+    {
+    }
+
+//used by UT_CSenHostletConnection_Negative_ResponseCodeL
+//used by UT_CSenHostletConnection_Delete_HCL
+void ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL(ChostconnTester* apTestSuite, const TInt  /*aErrorCode*/ , const TDesC8& /* aMessage */)
+    {
+    apTestSuite->iWas_HandleErrorL_Accessed = ETrue;
+    }
+    
+//used by the UT_CSenHostletConnection_Negative_ResponseCodeL    
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL(ChostconnTester*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt alteredResponseCode = -148000;
+    _LIT8(KAlteredResponse, "<Response><ReplyMessage>Response Altered in UT_CSenHostletConnection_NewLL_OnServiceL.</ReplyMessage><Request>%S</Request></Response>");
+    apTestSuite->ipHostlet->iResponseCodes[apTestSuite->ipHostlet->iTxnIds.Count()-1] = alteredResponseCode;
+    aResponse.SetResponseUtf8L(KAlteredResponse, alteredResponseCode);
+    return KErrNone;
+    }
+    
+// not in use atm:    
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL(ChostconnTester* /* apTestSuite */, const TInt /* aTxnId */, TInt /* aCompletionCode */, const TDesC8& /* aDesc */ )
+    {
+    return KErrNone;
+    }    
+    
+//used by the UT_CSenHostletConnection_DeleteSC_before_HCRespondLL method
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnService1L(ChostconnTester*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  /*aResponse*/ )
+    {
+    apTestSuite->ipConnection->Cancel();
+    delete apTestSuite->ipConnection;
+    apTestSuite->ipConnection = NULL;
+    return KErrNone;
+    }
+    
+//used by UT_CSenHostletConnection_DeleteSC_before_HCRespondLL
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceComplete1L(ChostconnTester* apTestSuite, const TInt /* aTxnId */, TInt /*aCompletionCode*/ , const TDesC8& /* aDesc */ )
+    {
+	apTestSuite->iWas_OnServiceL_Accessed = ETrue;
+    return KErrNone;
+    }        
+
+// used by the UT_CSenHostletConnection_RespondL_4multipleTimesL method
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnService2L(ChostconnTester*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt respondRetCode = apTestSuite->ipHostletConnection->RespondL(aResponse);
+    TInt respondRetCode1 = apTestSuite->ipHostletConnection->RespondL(aResponse);
+	LOCAL_ASSERT(respondRetCode == KErrNone);    
+    LOCAL_ASSERT(respondRetCode1 == KErrAlreadyExists);
+    return KErrNone;
+    }
+    
+// to be used (currently does nothing) by the UT_CSenHostletConnection_RespondL_4multipleTimesL method    
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceComplete2L(ChostconnTester* /* apTestSuite */, const TInt /* aTxnId */, TInt /*aCompletionCode*/ , const TDesC8& /* aDesc */ )
+    {
+    return KErrNone;
+    }        
+    
+//used by the UT_CSenHostletConnection_SC_Cancel_After_RequestL method
+void ChostconnTester::UT_CSenHostletConnection_NewLL_HandleError1L(ChostconnTester* apTestSuite, const TInt  /* aErrorCode */, const TDesC8& /* aMessage */)
+    {
+//    TInt a = aErrorCode;
+    apTestSuite->iWas_HandleErrorL_Accessed = ETrue;
+    }
+//used by the UT_CSenHostletConnection_SC_Cancel_After_RequestL method
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL_OnService3L(ChostconnTester*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  /*aResponse*/ )
+    {
+   // apTestSuite->ipConnection->Cancel();
+   //canceling request
+    apTestSuite->ipConnection->CancelTransaction(apTestSuite->iTxnID);
+    return KErrNone;
+    }
+
+
+//used by the UT_CSenHostletConnection_RespondWithPropertiesL method in order to provide transport properties with the response
+TInt ChostconnTester::UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL(ChostconnTester*  apTestSuite , MSenHostletRequest&  /*aRequest*/ , MSenHostletResponse&  aResponse )
+    {
+    TInt txn =          apTestSuite->ipHostlet->iTxnIds.Count()-1;
+    TPtr8 response =    apTestSuite->ipHostlet->iResponses[txn]->Des();
+
+    TInt responseCode = apTestSuite->ipHostlet->iResponseCodes[txn];
+
+    CSenTransportProperties* pTransportProperties = CSenTransportProperties::NewLC();
+    _LIT8(KTestCid, "test:cid");
+    _LIT8(KTestFile, "c:\\test.file.txt");
+    pTransportProperties->SetFileAttachmentL( KTestCid, KTestFile );
+    
+    if( apTestSuite->ipHostlet->iResponseProps.Append( pTransportProperties ) )
+        {
+        // error:
+        CleanupStack::PopAndDestroy(pTransportProperties);
+        return KErrNoMemory;
+        }
+    else
+        {
+        // ok
+        CleanupStack::Pop(pTransportProperties);
+        aResponse.SetResponseUtf8L(response, responseCode, pTransportProperties); // by default, all requests are "accepted"
+        return KErrNone;
+        }
+    }
+
+
+
+//---------------------------------------------------------------
+// 							Test Cases
+//---------------------------------------------------------------
+
+
+TInt ChostconnTester::UT_CSenHostletConnection_NewLL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+    
+TInt ChostconnTester::UT_CSenHostletConnection_NewLCL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewLC(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    CleanupStack::PopAndDestroy(ipHostletConnection);
+    //delete ipHostletConnection; 
+    //ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+TInt ChostconnTester::UT_CSenHostletConnection_IdentifierL(CStifItemParser& aItem )
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 framework = ipHostlet->FrameworkId();
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+TInt ChostconnTester::UT_CSenHostletConnection_FrameworkIdL(CStifItemParser& aItem )
+    {
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    _LIT8(KFramework, "REST");
+    TPtrC8 framework = ipHostlet->FrameworkId();
+    LOCAL_ASSERT( framework == KFramework);
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+TInt ChostconnTester::UT_CSenHostletConnection_RequestUtf8L(CStifItemParser& aItem )
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 request = ipHostlet->RequestUtf8();
+    LOCAL_ASSERT( request == _L8(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+TInt ChostconnTester::UT_CSenHostletConnection_ThreadIdL(CStifItemParser& aItem )
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC threadId = ipHostlet->ThreadId();
+    LOCAL_ASSERT( threadId == _L(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+TInt ChostconnTester::UT_CSenHostletConnection_ConsumerIdL(CStifItemParser& aItem )
+	{
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TPtrC8 consumerId = ipHostlet->ConsumerId();
+    LOCAL_ASSERT( consumerId == _L8(""));
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+TInt ChostconnTester::UT_CSenHostletConnection_RequestIdL(CStifItemParser& aItem )
+	{
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+//    ipHostlet = CTestHostlet::NewL(this,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+//                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceCompleteL);
+
+//    ipConsumer = CTestConsumer::NewL(this, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleMessageL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+//                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_SetStatus);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    TInt id;
+    id = ipHostletConnection->Identifier();
+    LOCAL_ASSERT( id  != KErrNotReady);
+    TInt requestId = ipHostlet->RequestId();
+    LOCAL_ASSERT( requestId == KErrNone);
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;		
+	}
+
+
+
+TInt ChostconnTester::UT_CSenHostletConnection_NewLC_3InvokesL(CStifItemParser& aItem)
+    {
+	 
+    // Try to send _two_ messages from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Abel\'] or containts[ab:N/ab:GIVEN,\'Abel\'] or containts[ab:TEL,\'Abel\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest2, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest3, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Clarice\'] or containts[ab:N/ab:GIVEN,\'Clarice\'] or containts[ab:TEL,\'Clarice\']]</ab:Select></ab:QueryItem></ab:Query>");
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+
+    // => Send first request to the Hostlet
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError2 = ipConnection->SendL(KRequest2);
+    
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError3 = ipConnection->SendL(KRequest3);
+
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  THREE TIMES (one call to ServiceL), respond to consumer THREE TIMES => six async calls:
+    StartActiveScheduler(6);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+	LOCAL_ASSERT(*ipHostlet->iRequests[0] == KRequest);
+	LOCAL_ASSERT(*ipHostlet->iRequests[1] == KRequest2);
+	LOCAL_ASSERT(*ipHostlet->iRequests[2] == KRequest3);
+	
+	// 2. Consumer receives response that hostlet provided
+	LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+	LOCAL_ASSERT( *ipConsumer->iResponses[1] == *ipHostlet->iResponses[1]);
+	LOCAL_ASSERT( *ipConsumer->iResponses[2] == *ipHostlet->iResponses[2]);
+
+    // 3. Hostlet receives completion code (delivery code)
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[1] == ipHostlet->iResponseCodes[1])
+	LOCAL_ASSERT( ipConsumer->iResponseCodes[2] == ipHostlet->iResponseCodes[2])
+
+
+	LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError);
+	LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError2);
+	LOCAL_ASSERT( ipHostlet->iTxnIds[2] == transactionIdOrError3);
+
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+
+TInt ChostconnTester::UT_CSenHostletConnection_RespondL1L(CStifItemParser& aItem)
+    {
+	 
+    // Try to send _one_ message from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+    TPtrC8 propertiesAsXml = pPropsAsXml->Des();
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // 4. The properties that were sent via SC were received in HC
+    MSenProperties::TSenPropertiesClassType type = ipHostlet->iRequestPropTypes[0];
+    TPtrC8 properties = ipHostlet->iRequestProps[0]->Des();
+
+    LOCAL_ASSERT( properties == propertiesAsXml );
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    CleanupStack::PopAndDestroy( pProps );
+    
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+
+TInt ChostconnTester::UT_CSenHostletConnection_RespondL2L(CStifItemParser& aItem)
+    {
+	 
+    // Try to send _two_ messages from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+
+    // => Send first request to the Hostlet
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+
+    // => Send second request to the Hostlet
+    TInt transactionIdOrError2 = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  TWICE (one call to ServiceL), respond to consumer TWICE => four calls:
+    StartActiveScheduler(4);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+    LOCAL_ASSERT( *ipHostlet->iRequests[1] == KRequest);    
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( *ipConsumer->iResponses[1] == *ipHostlet->iResponses[1]);
+    
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[1] == ipHostlet->iResponseCodes[1])
+    
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError2)
+    
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[1] == KErrNone ); // true in this "OK" -test case   
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+
+
+TInt ChostconnTester::UT_CSenHostletConnection_RespondL3L(CStifItemParser& aItem)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	 
+    // Try to send _one_ message from ServiceConnection to HostletConnection
+    // and check that everything goes OK.
+    
+    // Construct Hostlet
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // Construct 2. ServiceConnection
+    CTestConsumer* pConsumer2 = CTestConsumer::NewLC(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    CSenServicePattern* pPattern2 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern2->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    CSenServiceConnection* pConnection2 = CSenServiceConnection::NewL(*pConsumer2, *pPattern2);
+    CleanupStack::PopAndDestroy(pPattern2);
+    CleanupStack::PushL(pConnection2);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( pConsumer2->iConnectionStatus == KSenConnectionStatusReady);
+    
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+    TPtrC8 propertiesAsXml = pPropsAsXml->Des();
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // 2. ServiceConnection is ready
+    // => Send 2. request to the Hostlet
+    TInt transactionIdOrError2 = pConnection2->SendL(KRequest, propertiesAsXml);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError2 > KErrNone);
+    
+    // Invoke service  TWICE (two calls to ServiceL), respond to consumer TWICE => four calls
+    StartActiveScheduler(4);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // 4. The properties that were sent via SC were received in HC
+    MSenProperties::TSenPropertiesClassType type = ipHostlet->iRequestPropTypes[0];
+    TPtrC8 properties = ipHostlet->iRequestProps[0]->Des();
+
+    LOCAL_ASSERT( properties == propertiesAsXml );
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+    CleanupStack::PopAndDestroy( pProps );
+    
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    CleanupStack::PopAndDestroy(pConnection2);
+    CleanupStack::PopAndDestroy(pConsumer2);
+    
+    return KErrNone;
+    }
+
+
+TInt ChostconnTester::UT_CSenHostletConnection_Negative_ResponseCodeL(CStifItemParser& aItem)
+    {
+	 
+       
+ 	iWas_HandleErrorL_Accessed = EFalse;
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceL,
+                                   NULL);
+
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+                                     NULL);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+	
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    
+    
+ 	// 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone );
+    
+    //4. HandleErrorL accesed after negative iResponseCodes
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+  
+    
+ 
+TInt ChostconnTester::UT_CSenHostletConnection_HC_SelfDef_URIL(CStifItemParser& aItem)
+    {
+	 
+                                     
+  	ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+  	ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+  
+  	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);	
+  	ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+    
+
+  	CSenServicePattern* pPattern =
+		    CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);    
+   
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+    
+    
+ 	// 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+   
+/*
+TInt ChostconnTester::UT_CSenHostletConnection_Delete_HCL(CStifItemParser& aItem)
+    {
+	 
+     
+    iWas_HandleErrorL_Accessed = EFalse;                              
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleErrorL, 
+                                     NULL);
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    //delete Hostlet Connection
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+
+    // ---- Following conditions MUST be met ----
+    LOCAL_ASSERT(transactionIdOrError == KErrSenHostNotAvailable);
+
+    // Start waiting for HandleError Callback which is caused
+    // by error in SendL
+    StartActiveScheduler(1);
+    // Callback was get => Check that callback was HandleError
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+  
+    
+    return KErrNone;
+    }
+    
+    
+*/
+TInt ChostconnTester::UT_CSenHostletConnection_Two_Equal_UID3L(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+ 	
+ 	//Check if CSenHostletConnection::NewL leaves with KErrSenEndpointReserved
+/*	EUNIT_ASSERT_SPECIFIC_LEAVE(ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet),KErrSenEndpointReserved);*/
+	TRAPD(res,ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet)) ;
+	User::LeaveIfError(res == KErrSenEndpointReserved);
+
+  
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    return KErrNone;
+    }
+   
+TInt ChostconnTester::UT_CSenHostletConnection_Two_Equal_EndpointsL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+ 
+ 	//Check if CSenHostletConnection::NewL leaves with KErrSenEndpointReserved
+	/*EUNIT_ASSERT_SPECIFIC_LEAVE(ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet),KErrSenEndpointReserved);*/
+	TRAPD(res,ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet)) ;
+	User::LeaveIfError(res == KErrSenEndpointReserved);
+  
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    return KErrNone;
+    }
+ 
+
+TInt ChostconnTester::UT_CSenHostletConnection_Two_HC_Two_SC1L(CStifItemParser& aItem)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+	
+	
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+	ipHostlet1->ipHostletDescription->SetContractL(KHostletContract1);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract1);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1); 
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    
+    return KErrNone;
+    }
+
+      
+
+TInt ChostconnTester::UT_CSenHostletConnection_Two_HC_Two_SC2L(CStifItemParser& aItem)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+	ipHostlet->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+	
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+	ipHostlet1->ipHostletDescription->SetEndPointL(KHostletEndpoint1);
+	ipHostlet1->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KHostletEndpoint1, KNullDesC8);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1);   
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    
+    return KErrNone;
+    }
+
+
+ TInt ChostconnTester::UT_CSenHostletConnection_Two_HC_Two_SC3L(CStifItemParser& aItem)
+    {
+    	//Memory leak detection is not supported since Symbian 9.0 (EKA2 kernel) environments.
+    	//This this is added to handle thread handle leak in testmodule0
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles);
+	 
+   
+    //First pair of HC and SC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    
+	ipHostlet->ipHostletDescription->SetEndPointL(KHostletEndpoint);
+	ipHostlet->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHostletEndpoint, KNullDesC8);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 	
+    
+	//Second pair of HC and SC
+    ipHostlet1 = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+	ipHostlet1->ipHostletDescription->SetEndPointL(KHostletEndpoint1);
+	ipHostlet1->ipHostletDescription->SetContractL(KNullDesC8);
+    ipHostletConnection1 = CSenHostletConnection::NewL(*ipHostlet1);
+
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KHostletEndpoint1, KNullDesC8);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1);    
+ 	// Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady	
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady);     
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	ipUsedHostletConnection = ipHostletConnection;
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    ipUsedHostletConnection = ipHostletConnection1;
+    transactionIdOrError = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First pair of the HC and SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second pair of the HC and SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet1->iRequests[0] == KRequest1);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet1->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet1->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet1->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet1->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    
+	ipUsedHostletConnection = NULL;  
+	
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+    delete ipHostletConnection1; 
+    ipHostletConnection1 = NULL;
+    delete ipHostlet1;
+    ipHostlet1 = NULL;
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    return KErrNone;
+    }
+
+    
+
+TInt ChostconnTester::UT_CSenHostletConnection_DeleteSC_before_HCRespondLL(CStifItemParser& aItem)
+    {
+	 
+	iWas_OnServiceL_Accessed = false;     
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnService1L,
+                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceComplete1L);
+
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(1);
+    
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+    
+	// 2. onServiceL accesed
+    LOCAL_ASSERT( iWas_OnServiceL_Accessed ); 
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] < KErrNone ); 
+
+    // --- Conditions END ---
+ 
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL; 
+    
+    return KErrNone;
+    }
+
+      
+ TInt ChostconnTester::UT_CSenHostletConnection_RespondL_4multipleTimesL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnService2L,
+                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnServiceComplete2L);
+
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+   
+
+    // ---- Following conditions MUST be met ----
+    
+   
+    // --- Conditions END ---
+  
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL; 
+    
+    return KErrNone;
+    }
+     
+
+
+
+ TInt ChostconnTester::UT_CSenHostletConnection_SC_Cancel_After_RequestL(CStifItemParser& aItem)
+ {
+	 
+ 	
+ 	iWas_HandleErrorL_Accessed = EFalse;
+ 	
+    
+    ipHostlet = CTestHostlet::NewL(this,
+                                   &ChostconnTester::UT_CSenHostletConnection_NewLL_OnService3L,
+                                   NULL);
+
+    ipConsumer = CTestConsumer::NewL(this, 
+                                     NULL, 
+                                     &ChostconnTester::UT_CSenHostletConnection_NewLL_HandleError1L, 
+                                     NULL);
+                                     
+                                     
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    iTxnID=transactionIdOrError;
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    //ipConnection->Cancel(); 
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+	  	
+	  	
+    //
+    // ---- Following conditions MUST be met ----
+	
+    //1 KErrSenCancelled reported
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == KErrSenCancelled);
+    
+    //2. HandleErrorL accesed after negative iResponseCodes
+    LOCAL_ASSERT( iWas_HandleErrorL_Accessed );
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    
+    return KErrNone;
+    }
+
+    
+ TInt ChostconnTester::UT_CSenHostletConnection_Set_Expose_FacetL(CStifItemParser& aItem)
+ {
+	 
+    
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    
+	CSenFacet* pExposed = CSenFacet::NewL();
+    CleanupStack::PushL(pExposed);
+    pExposed->SetNameL(KExposeLocalServiceFacet); // from MSenServiceDescription.h
+    ipHostlet->ipHostletDescription->SetFacetL(*pExposed);
+    CleanupStack::PopAndDestroy(); // pExposed
+    
+    RFacetArray facets;
+	ipHostlet->ipHostletDescription->FacetsL(facets);
+	
+	LOCAL_ASSERT(facets[0]->Name() == KExposeLocalServiceFacet);
+    
+    facets.ResetAndDestroy();
+    delete ipHostlet;
+    ipHostlet = NULL;
+      
+    
+    return KErrNone;
+    }
+    
+/*
+TInt ChostconnTester::UT_CSenHostletConnection_CreateConnAndSubmit_Rest_MultiThreadL(CStifItemParser& aItem)
+    {
+	 
+    // uses default implementations for servicel and onservicecompletel    
+    ipHostlet = CTestHostlet::NewL(this);   
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+   
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, 
+                            TConsumerTestTask::ECreateConnAndSubmit, 
+                            pResponseTo );
+    task.ipOwner = this;
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitRestFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    localThread.Resume(); // start the thread. 
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+ //   LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    CleanupStack::PopAndDestroy(pResponseTo);
+    
+    localThread.Close();
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+*/    
+    
+
+TInt ChostconnTester::UT_CSenHostletConnection_Submit_Rest_MultiThreadL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, // not used by this test case..
+                            TConsumerTestTask::ESubmit, 
+                            pResponseTo);
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitRestFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    localThread.Resume(); // start the thread.
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+    
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    LOCAL_ASSERT( task.iStatusCode == KErrNone ); 
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pResponseTo);    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+    
+
+TInt ChostconnTester::UT_CSenHostletConnection_Submit_Rest_ActiveL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+  
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+    TConsumerTestTask task( *ipConnection, 
+                            KRequest, 
+                            KDefaultRestServicesFrameworkID, // not used by this test case atm
+                            TConsumerTestTask::EActiveSubmit, 
+                            pResponseTo);
+
+    _LIT(KThreadName, "tSubmitRestFromAO_");
+    CActiveConsumerTestTask* pActiveTask = CActiveConsumerTestTask::NewLC(task, KThreadName(), *this); // push pActiveTask
+    task.ipActive = pActiveTask;
+    
+    if(!pActiveTask->IsActive())
+        {
+	 
+        pActiveTask->SetActive();
+        
+    return KErrNone;
+    }
+
+    pActiveTask->iStatus = KRequestPending;
+    TRequestStatus* status = &pActiveTask->iStatus;
+    User::RequestComplete( status, CActiveConsumerTestTask::EInvokeService );
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Submit a single request (via help of an AO!), respond to consumer ONCE,  => two calls
+    StartActiveScheduler(2);
+
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pResponseTo);
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    
+    return KErrNone;
+    }
+    
+/*
+TInt ChostconnTester::UT_CSenHostletConnection_CreateConnAndSubmit_WSI_MultiThreadL(CStifItemParser& aItem)
+    {
+	 
+    // This test case uses default implementations for servicel and onservicecompletel, 
+    // BUT(!) describeservicel has been overridden!
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, ChostconnTester::UT_CSenHostletConnection_WSI_DescribeServiceL);   
+
+// variant point 1:
+//    ipHostlet = CTestHostlet::NewL(this);   
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+   
+	CSenSoapMessage* pSoapMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSoapMessage->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC(); // push pProps
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8L();
+	CleanupStack::PopAndDestroy(pProps);
+
+	CleanupStack::PushL(pPropsAsXml);
+	TPtrC8 properties = pPropsAsXml->Des();
+
+	
+	HBufC8* pResponseTo = NULL;
+
+    // Invoke service once. But, due this is performed synchronously within the SAME PROCESS, we need
+    // another thread (otherwise ActiveScheduler cannot serve this WS request, ServiceL is never invoked).
+    
+
+    // NOTE-NOTE: if WS-I is used instead of REST, timing changes and race-codition occurs
+    
+    TConsumerTestTask task( *ipConnection, // not used in this test case
+                            request,       // not used in this test case
+                            KDefaultBasicWebServicesFrameworkID,
+                            TConsumerTestTask::ECreateConnAndSubmit, 
+                            pResponseTo);
+    task.ipOwner = this;
+
+    task.iEndpoint.Set(KHostletEndpoint);
+// variant point 2:
+    // -- comment out above line: task.iEndpoint.Set(KHostletEndpoint);
+
+    task.ipSoapMsg = pSoapMessage;
+
+    task.iProperties.Set(properties); 
+    
+    RThread localThread;
+    _LIT(KThreadName, "tSubmitWsiFromThread_");
+    
+    TInt createThreadRetVal = CreateThreadForConsumerTask(localThread, KThreadName, task);
+    
+    LOCAL_ASSERT( createThreadRetVal == KErrNone );
+    
+    // Now start the thread that will execute SubmitL:
+    localThread.Resume(); // start the thread
+    
+    // Would NOT work: // TInt transactionIdOrError = ipConnection->SubmitL(KRequest, pResponseTo);
+                       // LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Respond to consumer ONCE => only one call..
+    StartActiveScheduler(1);
+
+    
+    // Push the local pointer to the response descriptor into cleanupstack:
+    CleanupStack::PushL(pResponseTo);
+
+    // ---- Following conditions MUST be met ----
+
+    // SubmitL must return KErrNone(!)
+    // Note: from Submit, one cannot get TXN ID, but either OK (KErrNone) or an error
+    //LOCAL_ASSERT( task.iStatusCode == KErrNone );
+
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    //LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    // Response received, de-alloc response, request properties, request as XML descs and SOAP-MSG obj
+    CleanupStack::PopAndDestroy( pResponseTo );
+
+    CleanupStack::PopAndDestroy( pPropsAsXml );
+
+	CleanupStack::PopAndDestroy( pAsXml );
+
+	CleanupStack::PopAndDestroy( pSoapMessage );
+    
+    localThread.Close();
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    return KErrNone;
+    }
+    
+*/
+
+    
+
+/*    
+// DOES NOT WORK, submit blocks the single ActiveScheduler...    
+TInt ChostconnTester::UT_CSenHostletConnection_Submit_WSIL(CStifItemParser& aItem)
+    {
+	 
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern =
+         CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	
+	CSenTransportProperties* pProps = CSenTransportProperties::NewLC();
+	pProps->SetPropertyL(_L8("KTestProperty"), _L8("KTestPropertyValue"));
+	HBufC8* pPropsAsXml = pProps->AsUtf8LC();
+	
+	HBufC8* pResponseTo = NULL;
+	
+    TInt transactionIdOrError = ipConnection->SubmitL(*pSOAPMessage, *pPropsAsXml, pResponseTo);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == *pAsXml);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *pResponseTo == *ipHostlet->iResponses[0]);
+    
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    // --- Conditions END ---
+    
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pProps);
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+	delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    
+    return KErrNone;
+    }
+    
+*/
+/*
+TInt ChostconnTester::UT_CSenHostletConnection_Send_WSIL()
+    {
+	 
+   // This case uses default implementations for servicel and onservicecompletel:
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, ChostconnTester::UT_CSenHostletConnection_WSI_DescribeService_2L);
+
+    // This case uses the default implementations for setstatus, handlemessage, handleerror:
+    ipConsumer = CTestConsumer::NewL(this); 
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    // Choose WS-I service invokation framework
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrSenHostNotAvailable );
+
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusCreateFailed); 
+    
+/*
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone );
+    
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+    TInt transactionIdOrError = ipConnection->SendL(*pSOAPMessage);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one SendL calling ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+   
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+     */
+     /*
+	delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    
+    return KErrNone;
+    }
+
+    */
+/*
+TInt ChostconnTester::UT_CSenHostletConnection_DescEndpoint_Send_WSIL()
+    {
+	 
+    // This case uses default implementations for servicel and onservicecompletel:
+    // NOTE: for ALL OTHER BUT REST hostlets, one must DESCRIBE framework ID
+    // via MSenHostlet::DescribeServiceL(!)
+    ipHostlet = CTestHostlet::NewL(this, NULL, NULL, ChostconnTester::UT_CSenHostletConnection_WSI_DescribeServiceL);
+
+    // This case uses the default implementations for setstatus, handlemessage, handleerror:
+    ipConsumer = CTestConsumer::NewL(this); 
+
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KHostletEndpoint, KHostletContract);
+    // Choose WS-I service invokation framework
+    pPattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+
+    // Check that NO HandleErrorL callback was received:
+    LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone );
+    
+    
+     // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+    
+	CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+	HBufC8* pAsXml = pSOAPMessage->AsXmlL(); 
+	CleanupStack::PushL(pAsXml);
+	TPtrC8 request = pAsXml->Des();
+	
+    TInt transactionIdOrError = ipConnection->SendL(*pSOAPMessage);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one SendL calling ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == request);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    
+    // --- Conditions END ---
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+	delete ipConnection;
+    ipConnection = NULL;
+    
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    
+    delete ipConsumer;
+    ipConsumer = NULL;
+    
+    delete ipHostlet;
+    ipHostlet = NULL;
+    
+    
+    return KErrNone;
+    }
+
+
+*/
+
+// Leaks memory
+TInt ChostconnTester::UT_CSenHostletConnection_2SC1HCL(CStifItemParser& aItem)
+    {
+    TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
+	 
+   
+    // The only HC
+    ipHostlet = CTestHostlet::NewL(this);   // uses default implementations for servicel and onservicecompletel
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+	
+	// First SC
+	ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+	    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    // Construct service connection
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady); 
+
+	// Second SC
+    ipConsumer1 = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern1 =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern1->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    ipConnection1 = CSenServiceConnection::NewL(*ipConsumer1, *pPattern1);
+    CleanupStack::PopAndDestroy(pPattern1);
+    
+    // Construct service connection
+    StartActiveScheduler(1); 
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer1->iConnectionStatus == KSenConnectionStatusReady); 
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    _LIT8(KRequest1, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob1\'] or containts[ab:N/ab:GIVEN,\'Bob1\'] or containts[ab:TEL,\'Bob1\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+	
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+    
+    TInt transactionIdOrError1 = ipConnection1->SendL(KRequest1);
+    LOCAL_ASSERT(transactionIdOrError1 > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+ 
+    // ---- Following conditions MUST be met ----
+	
+	// First SC
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. The 1st Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code from 1st Consumer (delivery code)
+    //We should check TxnID as after Dispatcher Implementation VTxnID get return from SendL
+//    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+	
+	// Second SC
+	// 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[1] == KRequest1);
+
+    // 2. The 2nd Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer1->iResponses[0] == *ipHostlet->iResponses[1]);
+    LOCAL_ASSERT( ipConsumer1->iResponseCodes[0] == ipHostlet->iResponseCodes[1])
+
+    // 3. Hostlet receives completion code from 2nd Consumer (delivery code)
+//    LOCAL_ASSERT( ipHostlet->iTxnIds[1] == transactionIdOrError1 );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[1] == KErrNone ); // true in this "OK" -test case
+	
+    // --- Conditions END ---
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+
+    delete ipHostlet;
+    ipHostlet = NULL;
+
+    delete ipConnection;
+    ipConnection = NULL;
+
+    delete ipConsumer;
+    ipConsumer = NULL;
+
+    delete ipConnection1;
+    ipConnection1 = NULL;
+
+    delete ipConsumer1;
+    ipConsumer1 = NULL;
+    
+    
+    return KErrNone;
+    }
+ 
+    
+TInt ChostconnTester::UT_CSenHostletConnection_RespondWithPropertiesL(CStifItemParser& aItem)
+    {
+	 
+    // Try to send one message  from ServiceConnection to HostletConnection,
+    // which provides response (TRANSPORT) properties to the response message
+    
+    // Construct Hostlet
+    
+    ipHostlet = CTestHostlet::NewL(this, &ChostconnTester::UT_CSenHostletConnection_RespondWithPropertiesL_OnServiceL);
+    ipHostletConnection = CSenHostletConnection::NewL(*ipHostlet);
+
+    // Construct ServiceConnection
+    ipConsumer = CTestConsumer::NewL(this); // uses the default implementations for setstatus, handlemessage, handleerror
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KNullDesC8, KHostletContract);
+    pPattern->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    
+    ipConnection = CSenServiceConnection::NewL(*ipConsumer, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    
+    // Check that the Status of the ServiceConnection
+    // is KSenConnectionStatusReady
+    LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusReady);
+    
+    // ServiceConnection is ready
+    // => Send request to the Hostlet
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    TInt transactionIdOrError = ipConnection->SendL(KRequest);
+    
+    // Check that SendL returned transaction Id
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    // Invoke service  ONCE (one call to ServiceL), respond to consumer ONCE => two calls
+    StartActiveScheduler(2);
+
+    // ---- Following conditions MUST be met ----
+
+    // 1. Hostlet receives request that consumer made
+    LOCAL_ASSERT( *ipHostlet->iRequests[0] == KRequest);
+
+    // 2. Consumer receives response that hostlet provided
+    LOCAL_ASSERT( *ipConsumer->iResponses[0] == *ipHostlet->iResponses[0]);
+    LOCAL_ASSERT( ipConsumer->iResponseCodes[0] == ipHostlet->iResponseCodes[0])
+
+    // 3. Hostlet receives completion code (delivery code)
+    LOCAL_ASSERT( ipHostlet->iTxnIds[0] == transactionIdOrError );
+    LOCAL_ASSERT( ipHostlet->iCompletionCodes[0] == KErrNone ); // true in this "OK" -test case
+    
+    MSenProperties* pHostletProps = ipHostlet->iResponseProps[0];
+    
+    LOCAL_ASSERT( ipHostlet->iResponseProps[0] != NULL ); // The tp that was sent
+    LOCAL_ASSERT( ipConsumer->iResponseProperties[0] != NULL); // The tp that was received
+    
+    
+    
+    
+    HBufC8* pSerializedPropsSentByHC = ipHostlet->iResponseProps[0]->AsUtf8LC(); // push
+    HBufC8* pSerializedPropsReceivedBySC = ipConsumer->iResponseProperties[0]->AsUtf8LC(); // push
+
+    LOCAL_ASSERT( *pSerializedPropsSentByHC == *pSerializedPropsReceivedBySC );
+    
+    /*EUNIT_PRINT(_L("=> Properties that HC sent:"));*/
+    RDebug::Print (_L("=> Properties that HC sent:"));
+    RDebug::RawPrint(*pSerializedPropsSentByHC);
+    RDebug::Print(_L("=> Properties that SC received:"));
+    RDebug::RawPrint(*pSerializedPropsReceivedBySC);
+    
+    CleanupStack::PopAndDestroy(pSerializedPropsReceivedBySC); // SC's TP AsUtf8LC
+    CleanupStack::PopAndDestroy(pSerializedPropsSentByHC); // HC's TP AsUtf8LC
+    
+    
+    // --- Conditions END ---
+    
+    delete ipConnection;
+    ipConnection = NULL;
+    delete ipHostletConnection; 
+    ipHostletConnection = NULL;
+    delete ipHostlet;
+    ipHostlet = NULL;
+    delete ipConsumer;
+    ipConsumer = NULL;
+   	
+    return KErrNone;
+    }
+    
+           
+    
+CSenSoapMessage* ChostconnTester::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(KHostletContract, _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/testconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+//  CLASS HEADER
+#include "TestConsumer.h"
+
+//  INTERNAL INCLUDES
+#include "hostconnTester.h"
+
+#include "SenTransportProperties.h"
+
+//namespace
+//    {
+//    _LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+//    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+//    }
+
+
+CTestConsumer* CTestConsumer::NewL(ChostconnTester* aTestSuite,
+                                   void (*p2HandleMessageL) (ChostconnTester*, const TDesC8&),
+                                   void (*p2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&),
+                                   void (*p2SetStatus) (ChostconnTester*, const TInt))
+    {
+    CTestConsumer* pSelf = CTestConsumer::NewLC(aTestSuite, p2HandleMessageL,
+                                                p2HandleErrorL, p2SetStatus);
+    CleanupStack::Pop(pSelf);
+
+    return pSelf;
+    }
+
+CTestConsumer* CTestConsumer::NewLC(ChostconnTester* aTestSuite,
+                                    void (*p2HandleMessageL) (ChostconnTester*, const TDesC8&),
+                                    void (*p2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&),
+                                    void (*p2SetStatus) (ChostconnTester*, const TInt))
+    {
+    CTestConsumer* pSelf = new (ELeave) CTestConsumer(aTestSuite, p2HandleMessageL,
+                                                      p2HandleErrorL, p2SetStatus);
+    CleanupStack::PushL(pSelf);
+
+    return pSelf;
+    }
+
+CTestConsumer::CTestConsumer(ChostconnTester* aTestSuite,
+                             void (*p2HandleMessageL) (ChostconnTester*, const TDesC8&),
+                             void (*p2HandleErrorL) (ChostconnTester*, const TInt, const TDesC8&),
+                             void (*p2SetStatus) (ChostconnTester*, const TInt))
+    : ipTestSuite(aTestSuite),
+      ip2HandleMessageL(p2HandleMessageL),
+      ip2HandleErrorL(p2HandleErrorL),
+      ip2SetStatus(p2SetStatus)
+    {
+
+    }
+
+CTestConsumer::~CTestConsumer()
+    {
+    iResponses.ResetAndDestroy();
+    iResponseProperties.ResetAndDestroy();
+    iResponseCodes.Reset();
+    }
+
+void CTestConsumer::HandleMessageL(const TDesC8& aMessage)
+    {
+    iErrorCode = KErrNone;
+    iTxnId = ipTestSuite->ipConnection->TxnId();
+
+    MSenMessage* pResponse = ipTestSuite->ipConnection->Response();
+    if( pResponse )
+        {
+        MSenProperties* pProperties = pResponse->Properties();
+        if( pProperties )
+            {
+            CSenTransportProperties* pTransportProperties = NULL;
+            if( pProperties->IsSafeToCast(MSenProperties::ESenTransportProperties))
+                {
+                pTransportProperties = (CSenTransportProperties*)pProperties;
+                
+                CSenTransportProperties* pClone = (CSenTransportProperties*)pTransportProperties->CloneL();
+                if( pClone )
+                    {
+                    CleanupStack::PushL(pClone);
+                    TInt appendError = iResponseProperties.Append(pClone);
+                    if( appendError )
+                        {
+                        CleanupStack::PopAndDestroy(pClone);
+                        }
+                    else
+                        {
+                        // OK, pClone is now owned by ipResponseProperties
+                        CleanupStack::Pop(pClone);
+                        }
+                    }
+                }
+            }
+        }
+
+
+    iResponseCodes.Append(KErrNone);
+    iResponses.Append(aMessage.AllocL());
+    if ( ip2HandleMessageL )
+        {
+        (*ip2HandleMessageL)(ipTestSuite, aMessage);        
+        }
+    ipTestSuite->StopActiveScheduler();
+    }
+
+void CTestConsumer::HandleErrorL(const TInt aErrorCode, const TDesC8& aMessage)
+    {
+    iErrorCode = aErrorCode;
+    iTxnId = ipTestSuite->ipConnection->TxnId();
+
+    MSenMessage* pResponse = ipTestSuite->ipConnection->Response();
+    if( pResponse )
+        {
+        MSenProperties* pProperties = pResponse->Properties();
+        if( pProperties )
+            {
+            CSenTransportProperties* pTransportProperties = NULL;
+            if( pProperties->IsSafeToCast(MSenProperties::ESenTransportProperties))
+                {
+                pTransportProperties = (CSenTransportProperties*)pProperties;
+                
+                CSenTransportProperties* pClone = (CSenTransportProperties*)pTransportProperties->CloneL();
+                if( pClone )
+                    {
+                    CleanupStack::PushL(pClone);
+                    TInt appendError = iResponseProperties.Append(pClone);
+                    if( appendError )
+                        {
+                        CleanupStack::PopAndDestroy(pClone);
+                        }
+                    else
+                        {
+                        // OK, pClone is now owned by ipResponseProperties
+                        CleanupStack::Pop(pClone);
+                        }
+                    }
+                }
+            }
+        }
+
+    iResponseCodes.Append(aErrorCode);
+    HBufC8* pMessage = aMessage.AllocL();
+    CleanupStack::PushL(pMessage);
+    TInt appendError2 =  iResponses.Append(pMessage);
+    if( appendError2 )
+        {
+        CleanupStack::PopAndDestroy(pMessage);
+        }
+    else
+        {
+        CleanupStack::Pop(pMessage);
+        }        
+
+    if ( ip2HandleErrorL )
+        {
+        (*ip2HandleErrorL)(ipTestSuite, aErrorCode, aMessage);
+        }
+    ipTestSuite->StopActiveScheduler();
+    }
+
+void CTestConsumer::SetStatus(const TInt aStatus)
+    {
+    iConnectionStatus = aStatus;
+
+    
+    if ( ip2SetStatus )
+        {
+        (*ip2SetStatus)(ipTestSuite, aStatus); // func call via ptr
+        }
+    else
+        {
+        // Active Scheduler was NOT stopped by static function (func call via ptr above)
+        switch( aStatus )
+            {
+            case KSenConnectionStatusReady:
+                {
+                ipTestSuite->StopActiveScheduler(); // otherwise failed SC construction is reported via HandleErrorL(!)
+                }
+                break;
+            case KSenConnectionStatusNew:
+            case KSenConnectionStatusExpired:
+            default:            
+                break;
+            }
+        
+        }
+    }
+
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/src/testhostlet.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+//  CLASS HEADER
+#include "TestHostlet.h"
+
+//  EXTERNAL INCLUDES
+#include <Stiftestinterface.h>
+
+#include <SenTransportProperties.h>
+
+//  INTERNAL INCLUDES
+#include "hostconnTester.h"
+
+namespace
+    {
+    //_LIT8(KHostletEndpoint, "hostlet://UnitTestHostlet");
+    _LIT8(KHostletContract, "urn:nokia.com.serene:unit-test-hostlet");
+    }
+
+CTestHostlet* CTestHostlet::NewL(ChostconnTester* aTestSuite,
+                                 TInt (*ap2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&),
+                                 TInt (*ap2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&),
+                                 void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    {
+    CTestHostlet* pSelf = CTestHostlet::NewLC(aTestSuite, ap2ServiceL, ap2OnServiceCompleteL, ap2DescribeServiceL);
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+    }
+
+CTestHostlet* CTestHostlet::NewLC(ChostconnTester* aTestSuite,
+                                  TInt (*ap2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&),
+                                  TInt (*ap2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&),
+                                  void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    {
+    CTestHostlet* pSelf = new (ELeave) CTestHostlet(aTestSuite, ap2ServiceL, ap2OnServiceCompleteL, ap2DescribeServiceL);
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+	    
+    return pSelf;
+    }
+
+CTestHostlet::CTestHostlet(ChostconnTester* aTestSuite,
+                           TInt (*ap2ServiceL) (ChostconnTester*, MSenHostletRequest&, MSenHostletResponse&),
+                           TInt (*ap2OnServiceCompleteL) (ChostconnTester*, const TInt, TInt, const TDesC8&),
+                           void (*ap2DescribeServiceL)(CSenXmlServiceDescription&))
+    : ipTestSuite(aTestSuite),
+      ip2ServiceL(ap2ServiceL),
+      ip2OnServiceCompleteL(ap2OnServiceCompleteL),
+      ip2DescribeServiceL(ap2DescribeServiceL)
+    {
+    }
+
+CTestHostlet::~CTestHostlet()
+    {
+    delete ipHostletDescription;
+    iRequests.ResetAndDestroy();
+    iResponses.ResetAndDestroy();
+    iRequestProps.ResetAndDestroy();
+    iRequestPropTypes.Reset();
+    iResponseProps.ResetAndDestroy();
+    iResponseCodes.Reset();
+    iTxnIds.Reset();
+    iCompletionCodes.Reset();
+    }
+
+void CTestHostlet::ConstructL()
+    {
+    ipHostletDescription = CSenXmlServiceDescription::NewL(KNullDesC8, KHostletContract);
+	//ipHostletDescription = CSenXmlServiceDescription::NewL(KHostletEndpoint, KNullDesC8);    	
+    ipHostletDescription->SetFrameworkIdL(KDefaultRestServicesFrameworkID);
+    }
+    
+
+void CTestHostlet::DescribeServiceL(CSenXmlServiceDescription& aSD) 
+    { 
+    if( ip2DescribeServiceL ) 
+    	{
+   		(*ip2DescribeServiceL)(aSD);
+    	}
+        else
+            {
+            aSD.SetEndPointL(Endpoint());
+            aSD.SetContractL(Contract()); 
+            aSD.SetFrameworkIdL(FrameworkId());	
+            }
+    }
+
+TPtrC8 CTestHostlet::Contract() const
+    {
+    return ipHostletDescription->Contract();
+    }
+
+TPtrC8 CTestHostlet::Endpoint() const
+    {
+    return ipHostletDescription->Endpoint();
+    }
+
+TInt CTestHostlet::ServiceL(MSenHostletRequest& aRequest, MSenHostletResponse& aResponse)
+    {
+    
+
+    iTxnIds.Append(aRequest.RequestId());
+    iResponseCodes.Append(KErrNone);
+    
+
+    	
+    TInt retVal(KErrNone);
+    // Setup default response, can be overridden by test case:
+    // Dummy response
+    TPtrC8 request = aRequest.RequestUtf8();
+
+
+    iRequests.Append(request.AllocL());
+    
+    MSenProperties::TSenPropertiesClassType propType;
+    TPtrC8 requestProperties = aRequest.Properties(propType);
+    iRequestProps.Append(requestProperties.AllocL());
+    iRequestPropTypes.Append(propType);
+    
+//    _LIT8(KResponseFmt, "<Response><ReplyMessage>ChostconnTester is alive.</ReplyMessage><Request>%S</Request></Response>");
+  	_LIT8(KResponseFmt, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header></S:Header><S:Body>testing text hostlet</S:Body></S:Envelope>");  
+    HBufC8* pResponse = HBufC8::NewLC(request.Length()+KResponseFmt().Length());
+    TInt appendError = iResponses.Append(pResponse);
+    if( appendError )
+        {
+        CleanupStack::PopAndDestroy(pResponse); // delete orphan HBufC8 / pResponse
+        }
+    else
+        {
+        CleanupStack::Pop(pResponse); // now owned by iResponses -array..
+        }        
+    
+    TPtr8 response = iResponses[iTxnIds.Count()-1]->Des();
+    response.Format(KResponseFmt, &request);
+    aResponse.SetResponseUtf8L(response, iResponseCodes[iTxnIds.Count()-1]); // by default, all requests are "accepted"
+      
+    if ( ip2ServiceL )
+        {
+        // NOTE(!): if RESPONSE CODE in aResponse is modified in YOUR test case,
+        // remember set iResponseCodes for this test hostlet instance in your test
+        //  case code (ServiceL callback)
+        retVal = (*ip2ServiceL)(ipTestSuite, aRequest, aResponse); 
+        }
+    TPtrC8 providedResponse = aResponse.ResponseUtf8();
+    
+    if ( iResponses[iTxnIds.Count()-1]->Compare(providedResponse) != 0 )
+        {
+        // response was altered by TEST CASE:
+        iResponses.Insert(aResponse.ResponseUtf8().AllocL(),iTxnIds.Count()-1);
+        }
+        
+        
+    RDebug::Print(_L("CTestHostlet::ServiceL received:"));
+    RDebug::RawPrint(request);
+    if (ipTestSuite->ipUsedHostletConnection)
+    {
+    	iRespondRetCode = ipTestSuite->ipUsedHostletConnection->RespondL(aResponse);
+    }
+    else
+		iRespondRetCode = ipTestSuite->ipHostletConnection->RespondL(aResponse); 
+   return retVal;
+    }
+
+void CTestHostlet::OnServiceCompleteL(const TInt aTxnId, 
+                                      TInt aCompletionCode, 
+                                      const TDesC8& aDesc)
+    {
+  
+    iCompletionCodes.Append(aCompletionCode); 
+    if( ip2OnServiceCompleteL )
+        {
+        (*ip2OnServiceCompleteL)( ipTestSuite, aTxnId, aCompletionCode, aDesc );
+        }
+    ipTestSuite->StopActiveScheduler(); // service provided
+    }
+    
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                Web Service Connection API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SenSoapFault.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapFault.h)
+../inc/SenDateUtils.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenDateUtils.h)
+../inc/SenWsSecurityHeader.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenWsSecurityHeader.h)
+../inc/SenSoapMessage.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapMessage.h)
+../inc/SenServiceConnection.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenServiceConnection.h)
+../inc/MSenServiceConsumer.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenServiceConsumer.h)
+../inc/SenSoapEnvelope.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapEnvelope.h)
+../inc/SenSoapConstants.h             MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapConstants.h)
+../inc/MSenAuthenticationProvider.h   MW_LAYER_PUBLIC_EXPORT_PATH(MSenAuthenticationProvider.h)
+../inc/MSenProperties.h								MW_LAYER_PUBLIC_EXPORT_PATH(MSenProperties.h)               
+../inc/SenXmlProperties.h  						MW_LAYER_PUBLIC_EXPORT_PATH(SenXmlProperties.h)
+../inc/SenTransportProperties.h       MW_LAYER_PUBLIC_EXPORT_PATH(SenTransportProperties.h)
+../inc/SenHttpTransportProperties.h 	MW_LAYER_PUBLIC_EXPORT_PATH(SenHttpTransportProperties.h)
+../inc/MSenProperty.h   MW_LAYER_PUBLIC_EXPORT_PATH(MSenProperty.h)
+../inc/sencryptoutils.h		MW_LAYER_PUBLIC_EXPORT_PATH(sencryptoutils.h)
+../inc/senpointermap.h		MW_LAYER_PUBLIC_EXPORT_PATH(senpointermap.h)
+../inc/msencobrandinginterface.h		MW_LAYER_PUBLIC_EXPORT_PATH(msencobrandinginterface.h)
+../inc/senserviceconnectioninterfaces.h		MW_LAYER_PUBLIC_EXPORT_PATH(senserviceconnectioninterfaces.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/MSenAuthenticationProvider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Callback interface through which (web service consumer/management)
+*                applications can provide userinfo / account (username & password)
+*                to WS-stack. This information can be used in actual authentication
+*                with (remote) web service (Liberty Authentication Service or 
+*                WS-* STS), or locally (in device) to allow secure access to private
+*                information (like credentials to the service, etc).
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_AUTHENTICATION_PROVIDER_H
+#define M_SEN_AUTHENTICATION_PROVIDER_H
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class CSenIdentityProvider;
+
+/**
+* Interface description:
+*
+* The applications can register this callback interface, through which they will receive
+* userinfo callbacks (when data like username and password is needed).
+*
+* Both Service Connection and Service Manager APIs utilize this interface.
+*
+* In practice, service consumer applications often integrate these callbacks to their UI 
+* events, allowing them a control point end-user (login) prompts. 
+*
+* Furthermore, (remote) service management applications can provide identity (user account)
+* spesific "secret", in order to manipulate associated credentials stored in Web Services
+* -stack database(s).
+*/
+class MSenAuthenticationProvider
+    {
+    public: 
+        /**
+        * If (consumer) application needs to access protected information or service
+        * (behind some identity / account / sing-in process), it may choose to override
+        * this method. Returned object represents XML containing all required information
+        * that is required to securely authenticate the identity in question.
+        * In case that only username & password  -pair is needed, application may 
+        * alternatively implement UsernameL() and PasswordL() callbacks.
+        * @returs the identity provider description that contains "credentials", like
+        * like username and password of some identity (user's account), or other (binary)
+        * secret, like fingerprint. 
+ 
+        */
+        virtual const CSenIdentityProvider* IdentityProviderL() { return NULL; }
+
+        /**
+        * Callback type getter for username.
+        * through this method an application may choose to provide the username of
+        * an account it wishes to use. 
+        * In cases where the username (login ID) is in simple text format (descriptor),
+        * this may be the most convenient method to be overridden. Alternatively,
+        * in complex cases, applications may choose to provide identity provider (IDP)
+        * description, a piece of XML through IdentityProviderL() callback; that
+        * XML could contain extended amount of (binary) information, like fingerprint.
+        * Consumer application is supposed to decide, whether or not to show a GUI
+        * dialog when this callback is issued: in many cases, that is a common
+        * approach to prompt userinfo directly from end-user (unless data is cached
+        * elsewhere).
+        * @return Password as string (UTF-8 descriptor)
+        */
+        virtual const TPtrC8 UsernameL() { return TPtrC8(KNullDesC8); }
+
+        /**
+        * Callback type getter for password.
+        * Application may choose to provide the passport of an account through this
+        * method. In cases where the "secret" is in simple text format (descriptor),
+        * this may be the most convenient method to be overridden. Alternatively,
+        * in complex cases, applications may choose to provide identity provider (IDP)
+        * description, a piece of XML through IdentityProviderL() callback; that
+        * XML could contain extended amount of (binary) information, like fingerprint.
+        * Consumer application is supposed to decide, whether or not to show a GUI
+        * dialog when this callback is issued: in many cases, that is a common
+        * approach to prompt userinfo directly from end-user (unless data is cached
+        * elsewhere).
+        * @return Password as string (UTF-8 descriptor)
+        */
+        virtual const TPtrC8 PasswordL() { return TPtrC8(KNullDesC8); }
+        
+        /**
+        * This method obtains the callback interface matching the specified uid.
+        * @param				aUid the uid identifying the required interface.
+        * @return				NULL if no interface matching the uid is found.
+        * 					    Otherwise, attempt to dynamically cast this pointer
+        *                       to that interface will be made.
+        */
+    	inline virtual TAny* ExtendedInterface(const TInt32 /* aUid */) { return NULL; }
+    };
+
+#endif // M_SEN_PROPERTIES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/MSenProperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Transport and Xml properies interface declaration     
+*
+*/
+
+#ifndef M_SEN_PROPERTIES_H
+#define M_SEN_PROPERTIES_H
+
+const TInt KErrSenOmitted = 10;
+
+// INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class CSenXmlReader;
+
+class MSenProperties
+    {
+    public:
+        /**
+        * PropertiesClassType enumeration. 
+        */
+        enum TSenPropertiesClassType
+        	{
+        	ENotInUse                           = 0,
+        	ESenXmlProperties                   = 1,
+        	ESenTransportProperties             = 2,
+        	ESenHttpTransportProperties         = 3,    
+            ESenVtcpTransportProperties         = 4,    
+        	ESenLayeredXmlProperties            = 5,
+        	ESenLayeredTransportProperties      = 6,
+        	ESenLayeredHttpTransportProperties  = 7,
+        	ESenLayeredVtcpTransportProperties  = 8
+        	};
+
+        /**
+        *  Sets the XML reader to be used for parsing.
+        *  @param aReader:     the reader to be used. 
+        *                      Ownership is NOT transferred.
+        */
+        virtual void SetReader(CSenXmlReader& aReader) = 0;
+             
+        /**
+        * Get an integer identifying properties class type.
+        * All subclasses MUST return use unique integer value.
+        * @return unique TInt identifying this properties class type
+        */
+        virtual TSenPropertiesClassType PropertiesClassType() = 0;
+
+        /**
+        * Writes this properties object as descriptor into a stream.
+        * UTF-8 charset encoding will be used.
+        * @since Series60
+        * @param aWriteStream The stream to write to.
+        */
+        virtual void WriteToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+        * Reads this properties object from the descriptor.
+        * UTF-8 charset encoding should be used.
+        * @since Series60
+        * @param aBuffer The buffer to read from.
+        */
+        virtual void ReadFromL(const TDesC8& aBuffer) = 0;
+
+        /**
+        * Get these properties as UTF-8 charset encoded descriptor.
+        * @since Series60
+        * @return a pointer to UTF-8 encoded descriptor.
+        * Caller takes ownership.
+        */
+        virtual HBufC8* AsUtf8L() = 0;
+
+        /**
+        * Get these properties as UTF-8 charset encoded descriptor.
+        * @since Series60
+        * @return a pointer to UTF-8 encoded descriptor, which is
+        * has been left on cleanup stack.
+        * Caller takes ownership.
+        */
+        virtual HBufC8* AsUtf8LC() = 0;
+        
+        /**
+        * Sets new property. 
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of 
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used to
+        *                      refer the given value.
+        * @param aValue        Is the value of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        * Leave codes:
+        *                      According to implementing classes. 
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName,
+                                  const TDesC8& aValue) = 0;
+        
+        /**
+        * Gets the value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   The value of the property, or KNullDesC8 if
+        *                 property is not found.
+        * @return KErrNone on success, KErrSenOmitted if property
+        * has been omitted, or some of the system-wide error codes
+        * otherwise.                  
+        */
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue) = 0;
+        
+        /**
+        * Sets new integer property.
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        Is the integer value of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        * Leave codes:
+        *                      According to implementing classes. 
+        */
+        virtual TInt SetIntPropertyL(const TDesC8& aName,
+                                     const TInt aValue) = 0;
+        
+        /**
+        * Gets the integer value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TInt reference to be filled in with the value of
+        *                 the property.
+        * @return KErrNone on success, KErrSenOmitted if property
+        * has been omitted, or some of the system-wide error codes
+        * otherwise.                  
+        */
+        virtual TInt IntPropertyL(const TDesC8& aName,
+                                  TInt& aValue) = 0;
+        
+        /**
+        * Sets new boolean property.
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used
+        *                      to refer the given value.
+        * @param aValue        The boolean value of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        * Leave codes:
+        *                      According to implementing classes. 
+        */
+        virtual TInt SetBoolPropertyL(const TDesC8& aName,
+                                      const TBool aValue) = 0;
+        
+        /**
+        * Gets the boolean value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TBool reference to be filled in with the value of
+        *                 the property.
+        * @return KErrNone on success, KErrSenOmitted if property
+        * has been omitted, or some of the system-wide error codes
+        * otherwise.                  
+        */
+        virtual TInt BoolPropertyL(const TDesC8& aName,
+                                   TBool& aValue) = 0;
+                                   
+        /**
+        * Method creates exact copy of the properties, preserving
+        * the real, concrete subclass type (this can be resolved
+        * via PropertiesClassType() method. Furthermore, the
+        * IsSafeToCast() method can be used to reflect the returned
+        * pointer to a concrete class. NOTE: one must cast the
+        * returned pointer to concrete class in order to safely
+        * de-allocate any memory allocated by this method.
+        * @param aOkOrError is KErrNone when clone is successfully
+        * allocated, or some system-wide error otherwise.
+        * @return pointer to *concrete* properties object, which
+        * MUST be class cast to known subclass(!).
+        */                                   
+		virtual MSenProperties* Clone(TInt& aOkOrError) const = 0;
+
+        /**
+        * Method provies reflection support for properties classes,
+        * enabling safe class-casts to concrete subclass objects.
+        * @return ETrue, if object is of a known subclass type
+        *         EFalse, if the object cannot be cast to given type.
+        */
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass) = 0;
+        
+        /**
+        * Method creates exact copy of the properties, preserving
+        * the real, concrete subclass type (this can be resolved
+        * via PropertiesClassType() method. Furthermore, the
+        * IsSafeToCast() method can be used to reflect the returned
+        * pointer to a concrete class. NOTE: one must cast the
+        * returned pointer to concrete class in order to safely
+        * de-allocate any memory allocated by this method.
+        * @return pointer to *concrete* properties object, which
+        * MUST be class cast to known subclass(!).
+        */                                   
+        virtual MSenProperties* CloneL() const = 0;
+    };
+
+#endif // M_SEN_PROPERTIES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/MSenProperty.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Serene property interface declaration      
+*
+*/
+
+#ifndef M_SEN_PROPERTY_H
+#define M_SEN_PROPERTY_H
+
+// INCLUDES
+#include <e32std.h>
+
+class MSenProperty
+    {
+    public:
+        /**
+        * Gets the name of the property
+        *
+        * @return TPtrC8 containing name
+        */
+        virtual TPtrC8 Name() = 0;
+
+        /**
+        * Gets the type of the property
+        *
+        * @return TPtrC8 containing type
+        */
+        virtual TPtrC8 Type() = 0;
+
+        /**
+        * Gets the value of the property
+        *
+        * @return TPtrC8 containing value
+        */
+        virtual TPtrC8 Value() = 0;
+
+        /**
+        * Gets the integer value of the property
+        *
+        * @param aValue   A TInt reference to be filled in with the value of
+        *                 the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        virtual TInt IntValue(TInt& aValue) = 0;
+
+        /**
+        * Gets the boolean value of the property
+        *
+        * @param aValue   A TBool reference to be filled in with the value of
+        *                 the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.
+        */
+        virtual TInt BoolValue(TBool& aValue) = 0;
+        
+        /**
+        * Populates given array with the tokens delimited by given delimiter.
+        * Note! Ownership of the TPtrC8 pointers is transfered to the caller.
+        * @param aDelimiter Used delimiter.
+        * @param aTokens    Array which will be populated by tokens.
+        * @return           KErrNone if tokens were found.
+        *                   KErrNotFound if tokens were not found.
+        */
+        virtual TInt ValueTokensL(const TDesC8& aDelimiter,
+                                  RPointerArray<TPtrC8>& aTokens) = 0;
+        
+    };
+
+#endif // M_SEN_PROPERTY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/MSenServiceConsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Callback interface for service consumers        
+*
+*/
+
+
+
+
+#ifndef M_SEN_SERVICE_CONSUMER_H
+#define M_SEN_SERVICE_CONSUMER_H
+
+const TUid KSenInterfaceUidFilesObserver            = { 0x101F9742 }; // MSenFilesObserver
+const TUid KSenInterfaceUidCoBrandingObserver       = { 0x10282C6C }; // MSenCoBrandingObserver
+const TUid KSenInterfaceUidAlrObserver              = { 0x10282C6D }; // MMobilityProtocolResp
+const TUid KSenInterfaceUidUserinfoProvider         = { 0x10282C6E }; // MSenUserInfoProvider
+const TUid KSenInterfaceUidAuthenticationProvider   = { 0x10282C6F }; // MSenAuthenticationProvider
+const TUid KSenInterfaceUidHostletConsumer          = { 0xE760F697 }; // MSenAuthenticationProvider 
+
+
+// CLASS DECLARATION
+
+/**
+ * Callback interface for service consumers
+ */
+class MSenServiceConsumer
+    {
+    public: 
+        
+        // New functions
+        
+        /**
+        * Callback, which is invoked when a message is received from invoked service.
+        * Inside this method, it is guarenteed, that the TxnId() getter provided by
+        * CSenServiceConnection class will return valid transaction ID. This allows 
+        * one to map the ID of sent request, returned from CSenServiceConnection::SendL
+        * with the response that is provided in this callback.
+        * @param aMessage incoming message.
+        */
+        virtual void HandleMessageL(const TDesC8& aMessage) = 0;
+
+        /**
+        * Callback, which is invoked when an error message is received from invoked service.
+        * Inside this method, it is guarenteed, that the TxnId() getter provided by
+        * CSenServiceConnection class will return valid transaction ID. This allows 
+        * one to map the ID of sent request, returned from CSenServiceConnection::SendL
+        * with the response that is provided in this callback.
+        * @param aErrorCode is the error code (negative number)
+        * Error codes are some of the following:
+        * KErrSenNotInitialized             Connection hasn't been initialized.
+        * KErrConnectionInitializing        Connection is still initializing.
+        * KErrSubmitting                    Submitting a message failed, 
+        *                                   e.g. tried to send a NULL message.
+        * KErrConnectionExpired             Connection has expired and needs to be
+        *                                   renewed.
+        * KErrSenSoapFault                  A SOAP fault occurred, aErrorMessage should 
+        *                                   contain more detailed information.
+        * KErrSenInternal                   Internal error in Web Services 
+        *                                   framework
+        * KErrUnknown                       An unexpected major error has occurred
+        *                                   and cause is unknown.
+        * Other possible error codes can be HTTP error codes or 
+        * system-wide Symbian error codes.
+        * @param aErrorMessage contains the error message data; with SOAP based services,
+        * possibly a SOAP fault as XML.
+        */
+        virtual void HandleErrorL(const TInt aErrorCode, 
+                                  const TDesC8& aErrorMessage) = 0;
+
+        /**
+        * This method is called when the status of the connection
+        * to the service changes.
+        * @param aStatus is connection state indicator, which
+        * could be specified by the actual service invocation framework
+        * implementation. The following status codes are possible for
+        * any installed framework:
+        * KSenConnectionStatusNew              Connection is being initialized, but not yet ready.
+        * KSenConnectionStatusReady            Connection is ready to be used. For example, SubmitL()
+        *                                      and SendL() methods (depending of framework) are in
+        *                                      invocable state.
+        * KSenConnectionStatusExpired          Connection is expired. Typically, a new connection
+        *                                      needs next to be initialized in order to communicate
+        *                                      with the underlying service behind this service
+        *                                      connection.
+        */
+        virtual void SetStatus(const TInt aStatus) = 0;
+    };
+
+/**
+ * Callback interface for transfer progress observer. Typically,
+ * this interface is implemented by applications that want to 
+ * monitor how many bytes (of a file, request, or response) have
+ * been sent or received during a transaction. Callback is thus
+ * often integrated to progress bar implementations in UI layer.
+ * Note: UID of this interface is KSenInterfaceUidFilesObserver.
+ */
+class MSenFilesObserver
+    {
+    public:
+    /**
+    * This method is called when new part of BLOB is sent or received.
+    *
+    * @param aTxnId Transaction ID.
+    * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
+    * @param aMessage SOAP message for incoming messages with BLOBs.
+    * @param aCid CID of current BLOB.
+    * @param aProgress Count of sent/received BLOB bytes.
+    */
+    virtual void TransferProgress( TInt aTxnId, 
+                                   TBool aIncoming, 
+                                   const TDesC8& aMessage,
+                                   const TDesC8& aCid, 
+                                   TInt aProgress) = 0;
+    };
+class MSenHostletConsumer
+    {
+    public:
+    virtual void SetConnectionId( TInt aConnectionId ) = 0; 
+    };    
+/**
+ * Callback interface for extended consumer interface.
+ * When this interface is provided to service connection as constructor
+ * argument, the service connection (web services stack) can later on 
+ * query for a variety of different interfaces, extensions, from the
+ * application. Each extension (interface) is has unique identifier (UID).
+ */    
+class MSenExtendedConsumerInterface
+    {       
+    public: 
+        /**
+        * Service connection calls this method several times, passing a different
+        * UID per each call. If application wants to provide particular interface
+        * to service connection (web services stack), it needs to return a pointer
+        * to such M-class as a return value of this method. For any interface, that
+        * application has not implemented, it is supposed to return NULL.
+        * @param aUID is the unique identifier of some interface
+        * @return value should be a valid (void) pointer to any interface implemented
+        * by the application. NULL signalizes that application does not provide interface
+        * for give UID. 
+        */    
+	    inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; };
+    };
+
+#endif // M_SEN_SERVICE_CONSUMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenDateUtils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This utility class provides static methods for conversions
+*                between Symbian class types and XSD time-date type
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_DATE_UTILS_H
+#define SEN_DATE_UTILS_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+* This utility class provides static methods for conversions between Symbian 
+* class types and XSD time-date type.
+*  @lib SenUtils.lib
+*  @since Series60 3.0
+*/
+class SenDateUtils
+    {
+    public: 
+        enum { KXmlDateTimeMaxLength = 31 };
+
+        // New functions
+        /**
+        * Convert dateTime (from XML schema) to Symbian TTime. 
+        * A panic will occur if an attempt is made to set an invalid 
+        * value for any of the fields. 
+        * Panics: User 3 if illegal date.
+        * Leave codes:  KErrUnderflow   Not enough data given or 
+        *                               negative values
+        *               KErrOverflow    Too big values for e.g. month
+        *               KErrGeneral     Invalid date structure
+        * No check is made upon the validity of the year.
+        * @since Series60 3.0
+        * @param aXmlDateTime   source datetime to convert from
+        * @return The returned time will be in UTC.
+        */
+        IMPORT_C static TTime FromXmlDateTimeL(const TDesC8& aXmlDateTime);
+
+        /**
+        * Convert Symbian TTime to dateTime (from XML schema).
+        * Leave codes:  KErrOverflow    target descriptor is less than
+        *               KXmlDateTimeMaxLength (25 bytes)
+        * @since Series60 3.0
+        * @param aDest (UTF8) result will be written here. It must be at least
+        *                KXmlDateTimeMaxLength long.
+        * @param TTime in UTC.
+        */
+        IMPORT_C static void ToXmlDateTimeUtf8L(TDes8& aDest, 
+                                                const TTime& aSrc);
+
+        /**
+        * Convert Symbian TTime to dateTime (from XML schema).
+        * Leave codes:  KErrOverflow    target descriptor is less than
+        *               KXmlDateTimeMaxLength (25 bytes)
+        * @since Series60 5.0
+        * @param aDest (UTF8) result will be written here. It must be at least
+        *                KXmlDateTimeMaxLength long.
+        * @param TTime in UTC.
+        */
+	IMPORT_C static void ToXmlDateTimeUtf82L(TDes8& aDest, const TTime& aSrc) ;
+
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        SenDateUtils() { }
+
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        SenDateUtils( const SenDateUtils& );
+
+        /**
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        SenDateUtils& operator=( const SenDateUtils& );
+    };
+
+#endif // SEN_DATE_UTILS_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenHttpTransportProperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,465 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: 
+*
+* Description: Http transport properties class declaration     
+*
+*/
+
+#ifndef SEN_HTTP_TRANSPORT_PROPERTIES_H
+#define SEN_HTTP_TRANSPORT_PROPERTIES_H
+
+// INCLUDE
+#include <SenTransportProperties.h>
+
+// CONSTANTS
+_LIT8(KSenHttpAcceptHeaderDelimiter, ",");
+
+// Supported Http properties:
+
+//// -- session properties:
+_LIT8(KHttpMethodLocalName,     "HttpMethod");
+_LIT8(KHttpVersionLocalName,    "HttpVersion");
+
+//// -- HTTP headers names:
+_LIT8(KContentTypeLocalName,    "Content-Type");
+_LIT8(KAcceptLocalName,         "Accept");
+_LIT8(KSlugLocalName,           "Slug");
+
+// Supported Http methods:
+_LIT8(KHttpGet,                 "Get");
+_LIT8(KHttpPost,                "Post");
+_LIT8(KHttpPut,                 "Put");
+_LIT8(KHttpDelete,              "Delete");
+
+// Supported Http versions:
+_LIT8(KHttp10,                  "Http1.0");
+_LIT8(KHttp11,                  "Http1.1");
+
+//NOTE:
+/**	In SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties)
+ *	or
+ *	SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufc8*& aResponseTO)  
+ *	aProperties could be "HTTP GET" or "HTTP DELETE"
+ *  aMessage is a soap message or serialized XML.
+ *	This scenario is not supported. 
+ *
+ *	These are the function calls get called during this scenario
+ *	iHttpProperties->SetHttpHeaderL(const TDesC8& aHeaderName, const TDesC8& aValue);
+ *	iHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+ *	SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties);
+**/
+
+// CLASS DECLARATION
+class CSenHttpTransportProperties : public CSenTransportProperties
+    {
+    public:
+		/**
+		 * HttpMethod Enumeration
+		 */    		
+        enum TSenHttpMethod
+        	{
+        	ESenHttpPut,
+        	ESenHttpDelete,
+        	ESenHttpGet,
+            ESenHttpPost        	
+            };
+		/**
+		 * HttpVersion Enumeration
+		 */    		            
+        enum TSenHttpVersion
+        	{
+        	ESenHttp10,
+        	ESenHttp11
+            };            
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenHttpTransportProperties class instance.
+        */
+        IMPORT_C static CSenHttpTransportProperties* NewL();
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenHttpTransportProperties class instance.
+        */
+        IMPORT_C static CSenHttpTransportProperties* NewLC();
+
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenHttpTransportProperties class instance.
+        */
+        IMPORT_C static CSenHttpTransportProperties* NewL(const TDesC8& aXmlUtf8,
+                                                          CSenXmlReader& aParser);
+
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenHttpTransportProperties class instance.
+        */
+        IMPORT_C static CSenHttpTransportProperties* NewLC(const TDesC8& aXmlUtf8,
+                                                           CSenXmlReader& aParser);
+
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenHttpTransportProperties class instance.
+        */
+        IMPORT_C static CSenHttpTransportProperties* NewL(const CSenElement& aElement);
+        /**
+        * Basic constructor.
+		* @param aElement 
+        * @return a pointer to new CSenHttpTransportProperties class instance.
+        */
+        IMPORT_C static CSenHttpTransportProperties* NewLC(const CSenElement& aElement);
+         
+        /**
+        * Gets the IAP ID.
+        * @param aCurrentIapId  A TUint32 reference to be filled in with the
+        *                       value of the IAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        virtual TInt IapIdL(TUint32& aCurrentIapId);
+
+        /**
+        * Sets the IAP ID.
+        * @param aIapId is the new IAP ID.
+        */
+        virtual void SetIapIdL(TUint32 aIapId);
+
+        /**
+        * Gets the Proxy Port.
+        * @param aProxyPort  A TInt reference to be filled in with the
+        *                    value of the Proxy Port.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyPortL(TInt& aProxyPort);
+
+        /**
+        * Sets the Proxy Port.
+        * @param aProxyPort is the new Proxy Port.
+        */
+        virtual void SetProxyPortL(TInt aProxyPort);
+
+        /**
+        * Gets the Proxy Host.
+        * @param aProxyHost  A TPtrC8 reference to be filled in with the
+        *                    value of the Proxy Host.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyHostL(TPtrC8& aProxyHost);
+
+        /**
+        * Sets the Proxy Host.
+        * @param aProxyHost is the new Proxy Host.
+        */
+        virtual void SetProxyHostL(const TDesC8& aProxyHost);
+        
+        /**
+        * Gets the Proxy Usage flag.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the Proxy Usage.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt ProxyUsageL(TBool& aProxyUsage);
+
+        /**
+        * Sets the Proxy Usage flag.
+        * @param aProxyUsage is the new value for Proxy Usage.
+        */
+        virtual void SetProxyUsageL(TBool aProxyUsage);
+
+        /**
+        * Gets the information if SecureDialog is shown or not.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the SecureDialog flag.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SecureDialogL(TBool& aSecureDialog);
+
+        /**
+        * Sets the flag which controls showing of SecureDialog.
+        * @param aSecureDialog is the new value for SecureDialog flag.
+        */
+        virtual void SetSecureDialogL(TBool aSecureDialog);
+        
+        /**
+        * Gets the information if IAPDialog is shown or not.
+        * @param aIAPDialog A TBool reference to be filled in with the
+        *                   value of the IAPDialog flag.
+        * @return           KErrNone if no error, or some of the system
+        *                   wide error codes.
+        */
+//        virtual TInt IAPDialogL(TBool& aIAPDialog);
+
+        /**
+        * Sets the flag which controls showing of IAPDialog.
+        * @param aIAPDialog is the new value for IAPDialog flag.
+        */
+//        virtual void SetIAPDialogL(TBool aIAPDialog);
+
+        /**
+        * Gets the Content Type.
+        * @param aContentType A TPtrC8 reference to be filled in with the
+        *                     value of the Content Type.
+        * @return             KErrNone if no error, or some of the system
+        *                     wide error codes.
+        */
+        virtual TInt ContentTypeL(TPtrC8& aContentType);
+        
+        /**
+        * Sets the Content Type.
+        * @param aContentType is the new Content Type.
+        */
+        virtual void SetContentTypeL(const TDesC8& aContentType);
+        
+        /**
+        * Gets the SoapAction.
+        * @param aSoapAction A TPtrC8 reference to be filled in with the
+        *                    value of the SoapAction.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SoapActionL(TPtrC8& aSoapAction);
+        
+        /**
+        * Sets the Soap Action.
+        * @param aSoapAction is the new Soap Action.
+        */
+        virtual void SetSoapActionL(const TDesC8& aSoapAction);
+        
+        /**
+        * Gets the UserAgent.
+        * @param aUserAgent  A TPtrC8 reference to be filled in with the
+        *                    value of the UserAgent.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt UserAgentL(TPtrC8& aUserAgent);
+        
+        /**
+        * Sets the UserAgent.
+        * @param aUserAgent is the new User Agent.
+        */
+        virtual void SetUserAgentL(const TDesC8& aUserAgent);
+
+        /**
+        * Gets the Accept.
+        * @param aAccept     A TPtrC8 reference to be filled in with the
+        *                    value of the Accept.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt AcceptL(TPtrC8& aAccept);
+        
+        /**
+        * Sets the Accept.
+        * @param aAccept is the new Accept value.
+        */
+        virtual void SetAcceptL(const TDesC8& aAccept);
+        
+        /**
+        * Gets the Http method.
+        * @param aHttpMethod A TSenHttpMethod reference to be filled in with
+        *                    the value of the Http method.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt HttpMethodL(TSenHttpMethod& aHttpMethod);
+        
+        /**
+        * Sets the Http method.
+        * @param aHttpMethod is the new Http method.
+        */
+        virtual void SetHttpMethodL(TSenHttpMethod aHttpMethod);
+
+        /**
+        * Gets the Http version.
+        * @param aHttpVersion A TSenHttpVersion reference to be filled in with
+        *                     the value of the Http version.
+        * @return             KErrNone if no error, or some of the system
+        *                     wide error codes.
+        */
+        virtual TInt HttpVersionL(TSenHttpVersion& aHttpVersion);
+        
+        /**
+        * Sets the Http version.
+        * @param aHttpVersion is the new Http version.
+        */
+        virtual void SetHttpVersionL(TSenHttpVersion aHttpVersion);        
+
+        /**
+        * Gets the Http header.
+        * @param aHeaderName  Name of the Http header.
+        * @param aValue       A TPtrC8 reference to be filled in with the
+        *                     value of the Http header.
+        * @return             KErrNone if no error, or some of the system
+        *                     wide error codes.
+        */
+        virtual TInt HttpHeaderL(const TDesC8& aHeaderName, TPtrC8& aValue);
+        
+        /**
+        * Sets the Http header.
+        * @param aHeaderName  Name of the Http header.
+        * @param aValue       Value of the Http header
+        */
+        virtual void SetHttpHeaderL(const TDesC8& aHeaderName,
+                                    const TDesC8& aValue);
+
+
+        /**
+        * Gets the device ID
+        * @param aDeviceID  A TPtrC8 reference to be filled in with the
+        *                    value of the Device ID.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DeviceIDL(TPtrC8& aDeviceID);
+
+        /**
+        * Sets the Device ID.
+        * @param aDeviceID is the new Device ID.
+        */
+        virtual void SetDeviceIDL(const TDesC8& aDeviceID);
+
+        /**
+        * Gets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
+        *                    value of the shared, public folder for downloaded 
+        *                    content
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
+        
+        /**
+        * Sets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - shared, public folder for downloaded content
+        */
+        virtual void SetDownloadFolderL(const TDesC8& aDownloadFolder);
+             
+        /**
+        * Gets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
+        
+        /**
+        * Sets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName);
+
+        /**
+        * Apply binding.
+        * @param aSoapVersion is a soap1.2 or soap1.1.
+        */
+        virtual void ApplyBindingL(TSOAPVersion aSoapVersion);
+
+        /**
+        * Gets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace 
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
+        
+        /**
+        * Sets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        virtual void SetMwsNamespaceL(const TDesC8& aMwsNamespace);
+
+        // From MSenProperties
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual TSenPropertiesClassType PropertiesClassType();
+        virtual void WriteToL(RWriteStream& aWriteStream);
+        virtual void ReadFromL(const TDesC8& aBuffer);
+        virtual HBufC8* AsUtf8L();
+        virtual HBufC8* AsUtf8LC();
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+        virtual MSenProperties* CloneL() const;
+        
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);        
+        virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aType);
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue, TPtrC8& aType);
+        virtual TInt SetIntPropertyL(const TDesC8& aName, const TInt aValue);
+        virtual TInt IntPropertyL(const TDesC8& aName, TInt& aValue);
+        virtual TInt SetBoolPropertyL(const TDesC8& aName, const TBool aValue);        
+        virtual TInt BoolPropertyL(const TDesC8& aName, TBool& aValue);
+        virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue);
+        virtual TInt RemovePropertyL(const TDesC8& aName);
+
+       /**
+        * Destructor.
+        */
+        virtual ~CSenHttpTransportProperties();
+
+    protected: // base class functions
+
+        virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aQualifiedName, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const CSenElement& aElement);
+
+	public:
+        /**
+        * Sets the SNAP ID.
+        * @param aSnapId is the new SNAP ID.
+        */
+		virtual void SetSnapIdL(TUint32 aSnapId);
+
+        /**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        virtual TInt SnapIdL(TUint32& aCurrentSnapId);
+    protected:
+        /**
+        * Constructor.
+        */
+        CSenHttpTransportProperties();
+    private:
+        HBufC8* AdaptDblQutesLC(const TDesC8& aValue);
+    };
+
+#endif // SEN_HTTP_TRANSPORT_PROPERTIES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenServiceConnection.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1325 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           CSenServiceConnection offers public API for
+*                service consumers to access invocable services, 
+*                as a part of the Web Services Framework (WSF).
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_CONNECTION_H
+#define SEN_SERVICE_CONNECTION_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <MSenServiceConsumer.h>
+#include <MSenServiceDescription.h>
+
+#include <MSenAuthenticationProvider.h>
+
+#include <SenSoapMessage.h>
+#include <SenSoapMessage2.h>
+//#include <SenAtomEntry.h>
+
+
+#include <MSenMessage.h>
+
+// CONSTANTS
+const TInt KErrSenNotInitialized                    =   -30291;
+const TInt KErrSenServiceConnectionBusy             =   -30292;
+const TInt KErrConnectionInitializing               =   -30293;
+const TInt KErrConnectionExpired                    =   -30294;
+const TInt KErrSubmitting                           =   -30295;
+const TInt KErrSenSoapFault                         =   -30296; 
+const TInt KErrSenInternal                          =   -30297;
+const TInt KErrSenNoEndpoint                        =   -30298;
+const TInt KErrSenNoContract                        =   -30299;
+
+const TInt KErrSenProviderIdInUseByAnotherEndpoint  =   -30305;
+const TInt KErrSenNoContractNoEndPoint              =   -30306;
+
+const TInt KErrSenBrokenSoapEnvelope                =   -30307;
+const TInt KErrSenBrokenSoapFault                   =   -30308;
+const TInt KErrSenCancelled                         =   -30309;
+
+
+// HTTP transport error codes:
+const TInt KErrSenNoHttpResponseBody                =   -30310;
+const TInt KErrSenNoHttpContentType                 =   -30311;
+const TInt KErrSenHttpRedirectRequiresConfirmation  =   -30312;
+
+// SOAP message verification error codes:
+const TInt KErrSenNoSoapBody                        =   -30313;
+const TInt KErrSenNoSoapHeader                      =   -30314;
+const TInt KErrSenNoPermission                      =   -30315; 
+
+const TInt KErrSenHostNotAvailable                  =   -30318;
+
+const TInt KErrSenAuthenticationFault               =   -30319;
+const TInt KErrSenNoEndUserPermission               =   -30321;
+const TInt KErrSenBrandNotSupported                 =   -30322;
+
+const TInt KSenConnectionStatusCreateFailed         =  -1; // post-state
+const TInt KSenConnectionStatusNew                  =   0; // post-state
+const TInt KSenConnectionStatusReady                =   1; // post-state
+const TInt KSenConnectionStatusExpired              =   2; // post-state
+const TInt KSenConnectionStatusAuthentication       =   3; // pre-state
+const TInt KSenConnectionStatusDiscovery            =   4; // pre-state
+const TInt KSenConnectionStatusMetadataExchange     =   5; // pre-state
+
+_LIT8(KDefaultBasicWebServicesFrameworkID,          "WS-I");
+_LIT8(KDefaultIdWsfFrameworkID,                     "ID-WSF"); 
+_LIT8(KDefaultRestServicesFrameworkID,              "REST");
+_LIT8(KDefaultWSStarFrameworkID,                    "WS-STAR");
+_LIT8(KDefaultAtomPubFrameworkID,                   "ATOM-PUB");
+_LIT8(KDefaultOviFrameworkID,                       "OVI");
+
+const TInt KSenTransportStatusCodeOffsetBaseHttp = 1000;
+const TInt KSenTransportStatusCodeOffsetBaseVtcp = 2000;
+
+const TInt KSenTransportStatusCodeVtcpInit =        2001; // KSenTransportStatusCodeOffsetBaseVtcp +1 
+const TInt KSenTransportStatusCodeVtcpActive =      2002; // KSenTransportStatusCodeOffsetBaseVtcp +2 
+const TInt KSenTransportStatusCodeVtcpSuspended =   2003; // KSenTransportStatusCodeOffsetBaseVtcp +3 
+const TInt KSenTransportStatusCodeVtcpInactive =    2004; // KSenTransportStatusCodeOffsetBaseVtcp +4
+const TInt KSenTransportStatusCodeVtcpUnavailable = 2005; // KSenTransportStatusCodeOffsetBaseVtcp +5
+
+// FORWARD DECLARATIONS
+class CSenServicePattern;
+class CSenIdentityProvider;
+
+struct TSenDataTrafficDetails 
+{
+public:
+   	
+   	TSenDataTrafficDetails():iTotalBytesSent(0),
+   							 iTotalBytesRecieved(0)
+	{
+	}   						
+	
+	TBool operator==(TSenDataTrafficDetails& rhs)
+	{
+		if( (this->iTotalBytesSent == rhs.iTotalBytesSent) &&
+			(this->iTotalBytesRecieved == rhs.iTotalBytesRecieved) )
+			return ETrue;
+		else
+			return EFalse;
+	}
+	
+	TSenDataTrafficDetails& operator=(TSenDataTrafficDetails& rhs)
+	{
+		if(*this == rhs)
+			return *this;
+		this->iTotalBytesSent = rhs.iTotalBytesSent;
+		this->iTotalBytesRecieved = rhs.iTotalBytesRecieved;
+		return *this;
+	}
+	
+	TSenDataTrafficDetails& operator+=(TSenDataTrafficDetails& rhs)	
+	{
+		this->iTotalBytesSent += rhs.iTotalBytesSent;
+		this->iTotalBytesRecieved += rhs.iTotalBytesRecieved;
+		return *this;
+	}
+   	
+   	TUint iTotalBytesSent ; 
+   	TUint iTotalBytesRecieved ; 
+private:	   
+   	TAny* iReserved;
+};
+
+struct TSenDataTrafficOperations 
+{
+public:
+	TSenDataTrafficOperations(): iReset(EFalse)
+	{
+	}
+   	TBool iReset;
+private:   	
+   	TAny* iReserved;
+};
+
+// CLASS DECLARATION
+
+/**
+  * The class for connecting to service providers
+  * through Web Services Framework (WSF). 
+  *
+  * The class offers asynchronous construction of a
+  * service connection. Further, there are asynchronous
+  * and synchronous interaction methods for e.g. sending 
+  * and receiving data from (possibly remote) service.
+  * 
+  * WSF offers two default frameworks:
+  *
+  *   1. Identity Based Web Services Framework
+  *      (ID-WSF). The framework ID for this is 
+  *      KDefaultIdWsfFrameworkID ("ID-WSF").
+  * 
+  *   2. Basic Web Services Framework. Framework
+  *      ID is KDefaultBasicWebServicesFrameworkID
+  *      ("WS-I").
+  * 
+  * The most typical use of CSenServiceConnection
+  * is to interact with a service of certain type
+  * through some invocable framework and submitting
+  * and receiving messages.
+  *
+  * In case of WebServices, the actual service is remote
+  * and submitted messages are SOAP envelopes. However,
+  * CSenServiceConnection supports accessing any
+  * ServiceInvocationFramework which ECOM plug-in
+  * implementation is present. These plug-ins may
+  * further communicate with some service, including
+  * local services. 
+  * 
+  * The link between CSenServiceConnection and any plug-in
+  * implementation interacting with some service is the
+  * framework ID, which is a property of ServiceDescription (SD)
+  * and accessible via MSenServiceDescription interface, which
+  * each SD class must implement. 
+  * 
+  * When creating a connection, one offers predefined SD as
+  * an argument for asynchronous constructor. Or, optionally 
+  * only a Liberty Alliance ID-WSF specific contract string 
+  * - typically some URN. If only contract is offered, then
+  * the created connection defaults to ID-WSF service and 
+  * ID-WSF framework (ID) will be used.
+  * 
+  * The WSF further uses the offered framework ID while looking
+  * up any matching framework plug-in implementation. As a
+  * result the SD might be offered to several plug-ins.
+* 
+* @lib SenServConn.lib
+*  @since Series60 3.0
+*/
+
+class CSenServiceConnection : public CActive, public MSenFragment
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor intended for Identity based service 
+        * consumers (like ID-WSF). The pointer is left on the cleanup stack.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is performed
+        * with a status value KSenConnectionStatusReady (1).
+        * Contract of the service (typically some URN) is provided.
+        * Authentication for the Web Service Provider (WSP) connection 
+        * is resolved using one of the identity providers which have 
+        * been associated with this contract (typically an URN).
+        *
+        * This constructor is ASYNCHRONOUS and the actual state of newly
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, a SetStatus call-back with value
+        * KSenConnectionStatusReady (1) is executed.
+        * If some error occurs, HandleErrorL() will be called to inform the
+        * creator of this connection (service consumer application)
+        *
+        *    For example, if service is not found, a system wide error
+        *    code of -1 is deliver via HandleErrorL() to WSC.
+        *
+        *    Second example: server response HTTP 501 means, that this error
+        *    code. 501 will be delivered via HandleErrorL() to WSC.
+        *    This can happen in ID-WSF connection being initialized, if
+        *    either Authentication Service (AS) or Discovery Service (DS)
+        *    cannot be reached.
+        *
+        * @param aConsumer      (web) service consumer (for call-backs)
+        * @param aContract      contract of the service, typically an URI.
+        * @return a pointer to a CSenServiceConnection instance.
+        *
+        */
+        IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
+                                                    const TDesC8& aContract);
+
+        /**
+        * Two-phased constructor intended for Identity based service 
+        * consumers (like ID-WSF). 
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is performed
+        * with a status value KSenConnectionStatusReady (1).
+        * Contract of the service (typically some URN) is provided.
+        * Authentication for the Web Service Provider (WSP) connection 
+        * is resolved using one of the identity providers which have 
+        * been associated with this contract (typically an URN).
+        * This constructor is ASYNCHRONOUS and the actual state of newly
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, a SetStatus call-back with value
+        * KSenConnectionStatusReady (1) is executed.
+        * If some error occurs, HandleErrorL() will be called to inform the
+        * creator of this connection (service consumer application)
+        *
+        *    For example, if service is not found, a system wide error
+        *    code of -1 is deliver via HandleErrorL() to WSC.
+        *
+        *    Second example: server response HTTP 501 means, that this error
+        *    code. 501 will be delivered via HandleErrorL() to WSC.
+        *    This can happen in ID-WSF connection being initialized, if
+        *    either Authentication Service (AS) or Discovery Service (DS)
+        *    cannot be reached.
+        *
+        * @param aConsumer      (web) service consumer (for call-backs)
+        * @param aContract      contract of the service, typically an URI.
+        * @return a pointer to a CSenServiceConnection instance.
+        *                       The pointer is left on the cleanup stack.
+        */
+        IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
+                                                     const TDesC8& aContract);
+
+        /**
+        * Two-phased constructor using a service description.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aObserver connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection.
+        * @return   a pointer to a CSenServiceConnection instance.
+        */
+        IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aObserver,
+                                                    MSenServiceDescription& aServiceDescription);
+
+        /**
+        * Two-phased constructor using a service description. The pointer
+        * is left on the cleanup stack.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aObserver connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection.
+        * @return   a pointer to a CSenServiceConnection instance.
+        *               The pointer is left on the cleanup stack.
+        */
+        IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
+                                                     MSenServiceDescription& aServiceDescription);
+
+        /*
+        * The ServicePattern version of two phased constructor. 
+        * Note, that this method is intended to be used by service consumers
+        * wishing to initialize connection in specific context called
+        * consumer policy. In consumer policy, certain properties 
+        * can be set to further define what kind of connection is acceptable
+        * and how the connection interacts with transport (for example, which
+        * Internet Access Point (IAP) will be used).
+        * However, any ConsumerPolicy feature is applicable in 
+        * one-policy-per-client scope and not used as a common policy.
+        * To set permanent information about known WSP, please use the
+        * CSenXmlServiceDescription, which implements MSenProviderPolicy
+        * interface.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aObserver connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection. 
+        * @return   a pointer to a CSenServiceConnection instance.
+        */
+        IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aObserver,
+                                                    CSenServicePattern& aServicePattern);
+    
+        /*
+        * The ServicePattern version of two phased constructor. 
+        * Note, that this method is intended to be used by service consumers
+        * wishing to initialize connection in specific context called
+        * consumer policy. In consumer policy, certain properties 
+        * can be set to further define what kind of connection is acceptable
+        * and how the connection interacts with transport (for example, which
+        * Internet Access Point (IAP) will be used).
+        * However, any ConsumerPolicy feature is applicable in 
+        * one-policy-per-client scope and not used as a common policy.
+        * To set permanent information about known WSP, please use the
+        * CSenXmlServiceDescription, which implements MSenProviderPolicy
+        * interface.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aObserver connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection. 
+        * @return   a pointer to a CSenServiceConnection instance.
+        *               The pointer is left on the cleanup stack.
+        */
+        IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
+                                                     CSenServicePattern& aServicePattern);
+        
+        /**
+        * Two-phased constructor intended for Identity based service 
+        * consumers (like ID-WSF). The pointer is left on the cleanup stack.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is performed
+        * with a status value KSenConnectionStatusReady (1).
+        * Contract of the service (typically some URN) is provided.
+        * Authentication for the Web Service Provider (WSP) connection 
+        * is resolved using one of the identity providers which have 
+        * been associated with this contract (typically an URN).
+        *
+        * This constructor is ASYNCHRONOUS and the actual state of newly
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, a SetStatus call-back with value
+        * KSenConnectionStatusReady (1) is executed.
+        * If some error occurs, HandleErrorL() will be called to inform the
+        * creator of this connection (service consumer application)
+        *
+        *    For example, if service is not found, a system wide error
+        *    code of -1 is deliver via HandleErrorL() to WSC.
+        *
+        *    Second example: server response HTTP 501 means, that this error
+        *    code. 501 will be delivered via HandleErrorL() to WSC.
+        *    This can happen in ID-WSF connection being initialized, if
+        *    either Authentication Service (AS) or Discovery Service (DS)
+        *    cannot be reached.
+        *
+        * @param aConsumer      (web) service consumer (for call-backs)
+        * @param aContract      contract of the service, typically an URI.
+        * @return a pointer to a CSenServiceConnection instance.
+        * @param aAuthProvider      Authentication Provider
+        */        
+        IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
+                                                    const TDesC8& aContract,
+                                                    MSenExtendedConsumerInterface& aExtendedConsumer);
+        /**
+        * Two-phased constructor intended for Identity based service 
+        * consumers (like ID-WSF). 
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is performed
+        * with a status value KSenConnectionStatusReady (1).
+        * Contract of the service (typically some URN) is provided.
+        * Authentication for the Web Service Provider (WSP) connection 
+        * is resolved using one of the identity providers which have 
+        * been associated with this contract (typically an URN).
+        * This constructor is ASYNCHRONOUS and the actual state of newly
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, a SetStatus call-back with value
+        * KSenConnectionStatusReady (1) is executed.
+        * If some error occurs, HandleErrorL() will be called to inform the
+        * creator of this connection (service consumer application)
+        *
+        *    For example, if service is not found, a system wide error
+        *    code of -1 is deliver via HandleErrorL() to WSC.
+        *
+        *    Second example: server response HTTP 501 means, that this error
+        *    code. 501 will be delivered via HandleErrorL() to WSC.
+        *    This can happen in ID-WSF connection being initialized, if
+        *    either Authentication Service (AS) or Discovery Service (DS)
+        *    cannot be reached.
+        *
+        * @param aConsumer      (web) service consumer (for call-backs)
+        * @param aContract      contract of the service, typically an URI.
+        * @param aAuthProvider      Authentication Provider        
+        * @return a pointer to a CSenServiceConnection instance.
+        *                       The pointer is left on the cleanup stack.
+        */    
+        IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
+                                                     const TDesC8& aContract,
+                                                     MSenExtendedConsumerInterface& aExtendedConsumer);
+    
+        /**
+        * Two-phased constructor using a service description.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aConsumer connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection.
+        * @param 	aAuthProvider      Authentication Provider                
+        * @return   a pointer to a CSenServiceConnection instance.
+        */    
+        IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
+                                                    MSenServiceDescription& aServiceDescription,
+                                                    MSenExtendedConsumerInterface& aExtendedConsumer);
+    
+        /**
+        * Two-phased constructor using a service description. The pointer
+        * is left on the cleanup stack.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() AND
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aConsumer connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection.
+        * @param 	aAuthProvider      Authentication Provider                        
+        * @return   a pointer to a CSenServiceConnection instance.
+        *               The pointer is left on the cleanup stack.
+        */    
+        IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
+                                                     MSenServiceDescription& aServiceDescription,
+                                                     MSenExtendedConsumerInterface& aExtendedConsumer);
+    
+        /*
+        * The ServicePattern version of two phased constructor. 
+        * Note, that this method is intended to be used by service consumers
+        * wishing to initialize connection in specific context called
+        * consumer policy. In consumer policy, certain properties 
+        * can be set to further define what kind of connection is acceptable
+        * and how the connection interacts with transport (for example, which
+        * Internet Access Point (IAP) will be used).
+        * However, any ConsumerPolicy feature is applicable in 
+        * one-policy-per-client scope and not used as a common policy.
+        * To set permanent information about known WSP, please use the
+        * CSenXmlServiceDescription, which implements MSenProviderPolicy
+        * interface.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aConsumer connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection.
+        * @param 	aAuthProvider      Authentication Provider                                 
+        * @return   a pointer to a CSenServiceConnection instance.
+        */    
+        IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
+                                                    CSenServicePattern& aServicePattern,
+                                                    MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        /*
+        * The ServicePattern version of two phased constructor. 
+        * Note, that this method is intended to be used by service consumers
+        * wishing to initialize connection in specific context called
+        * consumer policy. In consumer policy, certain properties 
+        * can be set to further define what kind of connection is acceptable
+        * and how the connection interacts with transport (for example, which
+        * Internet Access Point (IAP) will be used).
+        * However, any ConsumerPolicy feature is applicable in 
+        * one-policy-per-client scope and not used as a common policy.
+        * To set permanent information about known WSP, please use the
+        * CSenXmlServiceDescription, which implements MSenProviderPolicy
+        * interface.
+        * This constructor is ASYNCHRONOUS and the actual state of
+        * created connection has to be observed from SetStatus() and
+        * HandleErrorL() functions.
+        * If service is found, the SetStatus() call-back is executed
+        * with a status value KSenConnectionStatusReady (1)
+        * For ID-WSF connections, the authentication for the Web Service
+        * Provider (WSP) connection is resolved using one of the identity 
+        * providers which have been associated with the contract found in 
+        * the SD. At minimum, the contract of the service (typically some URN)
+        * has to provided in the SD.
+        * Basic Web Service consumers instantiate a SD where an endpoint
+        * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
+        * @param    aConsumer connection observer.
+        * @param    aServiceDescription is the description used to
+        *               obtain a service connection.
+        * @param 	aAuthProvider      Authentication Provider                                          
+        * @return   a pointer to a CSenServiceConnection instance.
+        *               The pointer is left on the cleanup stack.
+        */
+        IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
+                                                     CSenServicePattern& aServicePattern,
+                                                     MSenExtendedConsumerInterface& aExtendedConsumer);
+
+        // New functions
+
+        /**
+        * Send an ASYNCHRONOUS request to a service.
+        * In ID-WSF, the request data is a SOAP Body.
+        * Response message is received either via 
+        * HandleMessageL() or HandleErrorL() callback.
+        * There are two default frameworks available - 
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that Basic Web Services framework does NOT support this method.
+        * Instead, one should send complete SOAP envelopes using SendL(CSenSoapEnvelope&).
+        * So, currently this method is supported only in ID-WSF.
+        * @param aRequest outgoing request message.
+        * @return Transaction ID (positive integer) or error code, if method fails.
+        * Transaction ids:
+        * Positive integers                 SendL returns transaction ID of the request,
+        *                                   which can be later on utilized inside
+        *                                   HandleMessageL and HandleErrorL methods,
+        *                                   in order to map request and its response
+        *                                   together.
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Credential for the connection is 
+        *                                   expired and needs to be renewed. 
+        *                                   This can be done by instantiating a new
+        *                                   ServiceConnection.
+        * KErrSubmitting                    An error occurred
+        * KErrNoMemory                      Not enough memory to process the message.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SendL(const TDesC8& aRequest) = 0;
+
+
+        /**
+        * Submit a synchronous request to a service
+        * (in ID-WSF, the SOAP message Body) and receive a response as XML.
+        * There are two default frameworks available -
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that Basic Web Services framework does NOT support this method.
+        * Instead, one must send complete SOAP envelopes using SubmitL(CSenSoapEnvelope&).
+        * So, currently this method is supported only in ID-WSF.
+        * @param aRequest outgoing request message.
+        * @param aResponse the resolved response message.
+        *        The ownership of the aResponse is transfered to the caller.
+        *        The response is service specific part of the response. 
+        *        For ID-WSF services response contents is the SOAP Body, or complete SOAP 
+        *        envelope as XML, depending on the complete server messages on/off setting 
+        *       (default is off).
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Credential for the connection is 
+        *                                   expired and needs to be renewed. 
+        *                                   This can be done by instantiating a new
+        *                                   ServiceConnection.
+        * KErrSubmitting                    An internal error occurred.
+        * KErrSenInternal                   Internal state is invalid.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) = 0;
+
+        
+        /**
+        * Consumer application can use this method to check that 
+        * service connection is in ready state.
+        * In ID-WSF, this means that WSF interprets that credentials 
+        * for the service connection are valid (not expired).
+        * @param aReady indicates that the connection is ready to be used.
+        * @return           status/error code.
+        * Status codes:
+        * KErrNone               ok
+        * Error codes are system-wide Symbian error codes.
+        */
+        virtual TInt IsReady(TBool& aReady) = 0;
+
+
+        /**
+        * Check if the underlying service connection has a certain characteristic
+        * called a facet.
+        * Currently, only ID-WSF framework supports facets.
+        * For example, if consumer application is interested to resolve if 
+        * initialized service connection has a facet indicating that service
+        * is free of charge (for e.g. "urn:framework.com.free:cost"), the 
+        * method used to check this would be:
+        * _LIT8(KFacetOfFreeService, "urn:some.service.free:cost");
+        * int err = HasFacetL(KFacetOfFreeService, hasFacet);
+        *
+        * In the service session of initialed connection, this would be the form 
+        * of the facet element:
+        * <Facet name="urn:framework.com.free:cost"/>
+        *
+        * If there is no facet in the service connection then the element is not
+        * present.
+        * @param aURI           the name of the facet
+        * @param aHasFacet      will indicate if underlying service has a certain
+        *                       characteristic.
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrBadDescriptor                 The aUri parameter was an invalid
+        *                                   descriptor.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) = 0;
+
+
+        /**
+        * Consumer application can use this method to set flag which defines
+        * whether or not the consumer wishes to receive complete SOAP envelope 
+        * from the service.
+        * If complete server messages mode is off, then only the <Body> element
+        * is received from the SOAP envelope, otherwise full SOAP envelope.
+        * Note: Calling this function must not be done before connection is 
+        * initialized (the observer's SetStatus() has been called with value 
+        * KSenConnectionStatusReady).
+        * Calling this function should be done before sending or submitting
+        * anything.
+        * @param aCompleteOnOff defines the content of HandleMessageL() callback.   
+        *              If set to ETrue (ON), then complete SOAP envelopes are
+        *              received, including <Header> element.
+        *              If set to EFalse (OFF), only the service specific
+        *              content - SOAP envelope <Body> element - is received.
+        *              In WSF frameworks the default settings are:
+        *              1. In ID-WSF, the complete server messages is OFF.
+        *              2. In Basic Web Services, the default is ON.
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) = 0;
+
+
+        /*
+        * Sends a SOAP message to the service. The SOAP envelope may contain
+        * proprietary headers. The system will augment the message with the
+        * appropriate headers specified in the service invocation framework,
+        * so a client application should add only non-standard headers; and
+        * if it doesn't need to set such headers it is strongly recommended
+        * to use SendL(TDesC8&), which is meant for that.
+        * This is an asynchronous function, that returns immediately.
+        * When the service responds, the SOAP envelope content will
+        * be received via HandleMessageL() callback. In case of an
+        * error - like a SOAP fault - HandleErrorL() will be called
+        * with appropriate error code.
+        * There are two default frameworks available -
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+        * Instead, one should send SOAP envelope Bodies using 
+        * SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        * @param aMessage  The service specific message - a full SOAP envelope 
+        * @return Transaction ID (positive integer) or error code, if method fails.
+        * Transaction ids:
+        * Positive integers                 SendL returns transaction ID of the request,
+        *                                   which can be later on utilized inside
+        *                                   HandleMessageL and HandleErrorL methods,
+        *                                   in order to map request and its response
+        *                                   together.
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SendL(CSenSoapEnvelope& aMessage) = 0;
+
+
+        /*
+        * Submits a SOAP message to the service. This is a synchronous call,
+        * returning  a SOAP envelope that was received from the service.
+        * There are two default frameworks available:
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+        * Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        * @param    aMessage SOAPEnvelope with the service specific message
+        *                    without any framework wrapping
+        * @param    aResponseTo  This is a ref-to-pointer where response 
+        *                        from the service will be allocated. If the
+        *                        complete server messages mode is set to OFF,
+        *                        then only <Body> element will be returned, 
+        *                        otherwise a complete SOAP envelope.
+        *                        The ownership of aResponse is transfered to 
+        *                        the caller.
+        * @return status/error code
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * KErrSenInternal                   Internal state is invalid.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) = 0;
+
+
+        /**
+        * Gets service description of current connection.
+        * @param aServiceDescription Contains the service description on return
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrUnderFlow                     Server side returned invalid service
+        *                                   description.
+        * KErrUnknown                       Client-Server request mismatch.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt ServiceDescriptionL(HBufC8*& aServiceDescription) = 0;
+
+
+        /**
+        * Starts an application level transaction. The consumer may now start 
+        * to communicate with some service withing a chain of correlated messages.
+        * When responding to a certain SOAP message inside a transaction, the last
+        * received message ID is used as "refToMessageId". 
+        * From default frameworks, only ID-WSF supports transactions.
+        * @return   KErrNone if no errors occur.
+        *           Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt StartTransaction() = 0;
+
+
+        /**
+        * Stops application level transaction by resetting the "refToMessageId".
+        * After stopping a transaction the next message will have no 
+        * "refToMessageId"
+        * @return   KErrNone if no errors occur.
+        *           Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt TransactionCompleted() = 0;
+
+
+        /*
+        * Returns the transasction ID of this message or error. Id is guaranteed
+        * to return unique ID  when called from inside HandleMessageL() or 
+        * HandleErrorL callback. This transasction ID may be used to map the 
+        * response with the preceedeing SendL() call (a request).
+        * @return TInt transaction ID, or KErrNotFound, if no transaction is
+        * on-going.
+        */
+        virtual TInt TxnId() = 0;
+
+
+        /**
+        * Sets transport specific properties which apply as long as this connection
+        * is alive (session). Furthermore, the properties are effective for this session
+        * in cumulative manner: each property has unique key (name) which is associated
+        * to the actual value of that property. When SetTransportPropertiesL method is 
+        * called multiple times - in sequence - the last value for each key overrides any
+        * previous definitions. If any latter call introduces new keys (property names),
+        * they are appended to the list of currently effective properties. 
+        * Also note, that it is also possible to set message specific properties when making
+        * a SendL/SubmitL call. If such transport properties for message are provided, and
+        * those include updates to some properties, the new ones are effective only for that
+        * certain message, i.e. those are transaction specific. For any following message,
+        * that is sent over a service connection, the session specific properties apply,
+        * assuming that the new message does not (again) override some of the property values.
+        * @param aProperties contains the transport properties in serialized (UTF-8) form.
+        * With HTTP, this descriptor is typically created by utilizing CSenHttpProperties class.
+        * @return KErrNone if successful or otherwise some system-wide error code.
+        */
+        virtual TInt SetTransportPropertiesL(const TDesC8& aProperties) = 0;
+
+
+        /*
+        * Method returns currently effective transport properties as a serialized
+        * descriptor. With HTTP, one may utilize CSenHttpProperities class in
+        * order to read this data into properties object. Note that returned 
+        * list of properties also includes properties, which are defined as default
+        * for certain transport in the webservice framework.
+        */
+        virtual TInt TransportPropertiesL(HBufC8*& aProperties) = 0;
+
+
+        /**
+        * Send an ASYNCHRONOUS request to a service.
+        * In ID-WSF, the request data is a SOAP Body.
+        * Response message is received either via 
+        * HandleMessageL() or HandleErrorL() callback.
+        * There are two default frameworks available - 
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that Basic Web Services framework does NOT support this method.
+        * Instead, one should send complete SOAP envelopes using SendL(CSenSoapEnvelope&).
+        * So, currently this method is supported only in ID-WSF.
+        * @param aRequest outgoing request message.
+        * @param aProperties contains transport spesific properties, serialized
+        * into descriptor. With HTTP, one can create this by utilizing specialized
+        * CSenHttpProperties class.
+        * @return Transaction ID (positive integer) or error code, if method fails.
+        * Transaction ids:
+        * Positive integers                 SendL returns transaction ID of the request,
+        *                                   which can be later on utilized inside
+        *                                   HandleMessageL and HandleErrorL methods,
+        *                                   in order to map request and its response
+        *                                   together.
+        * Error codes
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Credential for the connection is 
+        *                                   expired and needs to be renewed. 
+        *                                   This can be done by instantiating a new
+        *                                   ServiceConnection.
+        * KErrSubmitting                    An error occurred
+        * KErrNoMemory                      Not enough memory to process the message.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SendL(const TDesC8& aRequest, const TDesC8& aProperties) = 0;
+
+        
+        /**
+        * Submit a request via SYNCHRONOUS call to a service
+        * (in ID-WSF, the SOAP message Body) and receive a response as XML.
+        * There are two default frameworks available -
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that Basic Web Services framework does NOT support this method.
+        * Instead, one must send complete SOAP envelopes using SubmitL(CSenSoapEnvelope&).
+        * So, currently this method is supported only in ID-WSF.
+        * @param aRequest outgoing request message.
+        * @param aResponse the resolved response message.
+        *        The ownership of the aResponse is transfered to the caller.
+        *        The response is service specific part of the response. 
+        *        For ID-WSF services response contents is the SOAP Body, or complete SOAP 
+        *        envelope as XML, depending on the complete server messages on/off setting 
+        *       (default is off).
+        * @param aProperties contains transport spesific properties, serialized
+        * into descriptor. With HTTP, one can create this by utilizing specialized
+        * CSenHttpProperties class.
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Credential for the connection is 
+        *                                   expired and needs to be renewed. 
+        *                                   This can be done by instantiating a new
+        *                                   ServiceConnection.
+        * KErrSubmitting                    An internal error occurred.
+        * KErrSenInternal                   Internal state is invalid.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) = 0;
+
+
+        /*
+        * Sends a SOAP message to the service. The SOAP envelope may contain
+        * proprietary headers. The system will augment the message with the
+        * appropriate headers specified in the service invocation framework,
+        * so a client application should add only non-standard headers; and
+        * if it doesn't need to set such headers it is strongly recommended
+        * to use SendL(TDesC8&), which is meant for this.
+        * This is an asynchronous function, that returns immediately.
+        * When the service responds, the SOAP envelope content will
+        * be received via HandleMessageL() callback. In case of an
+        * error - like a SOAP fault - HandleErrorL() will be called
+        * with appropriate error code.
+        * There are two default frameworks available -
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+        * Instead, one should send SOAP envelope Bodies using 
+        * SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        *
+        * NOTE:
+        * Message is send as serialized XML or Soap message to SendL 
+        * aProperties could be "HTTP GET" or "HTTP DELETE"  
+        * HTTP GET or HTTP DELETE transport property has been enabled via CSenHttpTransportProperties. 
+        * This scenario is not supported  
+        *
+        * @param aMessage  The service specific message - a full SOAP envelope 
+        * @param aProperties contains transport spesific properties, serialized
+        * into descriptor. With HTTP, one can create this by utilizing specialized
+        * CSenHttpProperties class.
+        * @return Transaction ID (positive integer) or error code, if method fails.
+        * Transaction ids:
+        * Positive integers                 SendL returns transaction ID of the request,
+        *                                   which can be later on utilized inside
+        *                                   HandleMessageL and HandleErrorL methods,
+        *                                   in order to map request and its response
+        *                                   together.
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * KErrNotSupported					HTTP GET or HTTP DELETE is enabled        
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) = 0;
+
+        /*
+        * Submits a SOAP message to the service. This is a synchronous call,
+        * returning  a SOAP envelope that was received from the service.
+        * There are two default frameworks available:
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+        * Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        *
+        * NOTE:
+        * Message is send as serialized XML or Soap message to SubmitL 
+        * aProperties could be "HTTP GET" or "HTTP DELETE"  
+        * HTTP GET or HTTP DELETE transport property has been enabled via CSenHttpTransportProperties. 
+        * This scenario is not supported
+        *
+        * @param aMessage SOAPEnvelope with the service specific message
+        * without any framework wrapping
+        * @param aProperties contains transport spesific properties, serialized
+        * into descriptor. With HTTP, one can create this by utilizing specialized
+        * CSenHttpProperties class.
+        * @param    aResponseTo  This is a ref-to-pointer where response 
+        *                        from the service will be allocated. If the
+        *                        complete server messages mode is set to OFF,
+        *                        then only <Body> element will be returned, 
+        *                        otherwise a complete SOAP envelope.
+        *                        The ownership of aResponse is transfered to 
+        *                        the caller.
+        * @return status/error code
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * KErrSenInternal                   Internal state is invalid.
+        * KErrNotSupported					HTTP GET or HTTP DELETE is enabled        
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) = 0;
+
+        /*
+        * Sends a SOAP message to the service. The SOAP envelope may contain
+        * proprietary headers. The system will augment the message with the
+        * appropriate headers specified in the service invocation framework,
+        * so a client application should add only non-standard headers.
+        * This is an asynchronous function, that returns immediately.
+        * When the service responds, the SOAP envelope content will
+        * be received via HandleMessageL() callback. In case of an
+        * error - like a SOAP fault - HandleErrorL() will be called
+        * with appropriate error code.
+        * There are two default frameworks available -
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+        * Instead, one should send SOAP envelope Bodies using 
+        * SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        *
+        * @param aMessage  The service specific message - a full SOAP envelope 
+        * @return Transaction ID (positive integer) or error code, if method fails.
+        * Transaction ids:
+        * Positive integers                 SendL returns transaction ID of the request,
+        *                                   which can be later on utilized inside
+        *                                   HandleMessageL and HandleErrorL methods,
+        *                                   in order to map request and its response
+        *                                   together.
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * KErrNotSupported					HTTP GET or HTTP DELETE is enabled
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SendL(MSenMessage& aMessage) = 0;
+
+        /*
+        * Submits a SOAP message to the service. This is a synchronous call,
+        * returning  a SOAP envelope that was received from the service.
+        * There are two default frameworks available:
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+        * Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        *
+        * @param aMessage SOAPEnvelope with the service specific message
+        * without any framework wrapping
+        * @param    aResponseTo  This is a ref-to-pointer where response 
+        *                        from the service will be allocated. If the
+        *                        complete server messages mode is set to OFF,
+        *                        then only <Body> element will be returned, 
+        *                        otherwise a complete SOAP envelope.
+        *                        The ownership of aResponse is transfered to 
+        *                        the caller.
+        * @return status/error code
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * KErrSenInternal                   Internal state is invalid.
+        * KErrNotSupported					HTTP GET or HTTP DELETE is enabled
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) = 0;
+        
+        /**
+        * Getter for currently active transaction (service response) that is
+        * being handled by the service consumer.
+        * @return a pointer to currently active transaction (service response).
+        *         It is guarenteed, that the method returns a pointer to
+        *         transaction only when called inside HandleMessageL or
+        *         HandleErrorL callback methods of MSenServiceConsumer,
+        *         otherwise it will return NULL.
+        */
+        virtual MSenMessage* Response() = 0;
+        
+        /**
+        * Cancels any active request, if pending transaction 
+        * (txn) can be found with given txn ID.
+        * @param aTransactionID is the transaction ID to be cancelled. This id has earlier been
+        * acquired from a call to some of the asynchronous SendL variants.
+
+        * @return KErrNone on success
+        *         KErrNotFound, if there is no pending transaction (active request),
+        *         or some of the system-wide error codes otheriwise.
+        */
+        virtual TInt CancelTransaction(TInt aTransactionID) = 0;
+        
+        /**
+        * Getter for the identity provider (XML) service description. 
+        * @param apIdentityProvider will point to a new IDP instance,
+        * if such is associated with this connection (and this connection
+        * was ready before calling this method), or NULL otherwise.
+        * @return KErrNone if IDP description can be found, or some
+        * of the system wide error code otherwise.
+        */
+        virtual TInt IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) = 0;
+
+        /**
+        * Getter for the identifier  of this connection.
+        * @return the identifier as integer.
+        */
+        virtual TInt Identifier() = 0;
+        
+        /**
+        * Registers observer of BLOBs transfer progress.
+        *
+        * @param aFilesObserver Implementation of transfer progress observer.
+        */
+    
+		virtual void DataTrafficDetails(TSenDataTrafficDetails& aDetails,
+    									TSenDataTrafficOperations& aOperations) = 0;     
+		
+        /**
+        * Service Consumer can call this method to acquire a new interface,
+        * which is identified by unique ID (UID).
+        * @param aUID is the UID of the interface being requested
+        * @return TAny* pointer to the interface, or if no interface to 
+        * given UID exists, function returns NULL. In typical cases, returned
+        * pointer should be cast to some preknown M-class pointer (the actual
+        * new interface).
+        *
+        * List of currently supported interfaces:
+        * KSenInterfaceUidAlrServiceConnection      => MSenAlrServiceConnection
+        */    
+	    virtual TAny* InterfaceByUid( TUid aUID ) = 0;
+		
+        /*
+        * Sends a RFile Handle to the service. 
+        * the Identity Based Web Service Framework (which ID is "ID-WSF") 
+        * and the Basic Web Services Framework (which ID is "WS-I"). 
+        * Please note, that ID-WSF does NOT support this method. 
+				* SendL(const TDesC8&).
+        * So, currently this method is supported only in Basic Web Services framework.
+        * @param aMessage  The service specific message - a full SOAP envelope 
+        * @return Transaction ID (positive integer) or error code, if method fails.
+        * Transaction ids:
+        * Positive integers                 SendL returns transaction ID of the request,
+        *                                   which can be later on utilized inside
+        *                                   HandleMessageL and HandleErrorL methods,
+        *                                   in order to map request and its response
+        *                                   together.
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrArgument                      RFile handle is NULL ( Specified file doesnot exist)
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * Other error codes are system-wide Symbian error codes.
+        */
+				virtual TInt SendL(RFile& aFileHandle) = 0;
+				
+				/*
+        * Submits a RFile Handle to the service. This is a synchronous call,
+        * returning  a SOAP envelope that was received from the service.
+        * There are two default frameworks available:
+        * @param    aResponseTo  This is a ref-to-pointer where response 
+        *                        from the service will be allocated. If the
+        *                        complete server messages mode is set to OFF,
+        *                        then only <Body> element will be returned, 
+        *                        otherwise a complete SOAP envelope.
+        *                        The ownership of aResponse is transfered to 
+        *                        the caller.
+        * @return status/error code
+        * Status codes:
+        * KErrNone                          ok
+        * Error codes:
+        * KErrSenNotInitialized             Connection has not been initialized.
+        * KErrSenServiceConnectionBusy      Connection is already busy with another
+        *                                   request.
+        * KErrConnectionInitializing        Connection is still initializing and
+        *                                   cannot yet process commands.
+        * KErrConnectionExpired             Connection is expired and needs to be
+        *                                   renewed.
+        * KErrSubmitting                    An internal error has occurred.
+        * KErrNoMemory                      Not enough memory to process the 
+        *                                   message.
+        * KErrArgument                      RFile handle is NULL ( Specified file doesnot exist)
+        * KErrSenInternal                   Internal state is invalid.
+        * Other error codes are system-wide Symbian error codes.
+        */
+		virtual TInt SubmitL(RFile& aFileHandle, HBufC8*& aResponseTo) = 0;
+		   
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceConnection();
+    
+    };
+
+#endif //SEN_SERVICE_CONNECTION_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenSoapConstants.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This header provides SOAP specific constants.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_CONSTANTS_H
+#define SEN_SOAP_CONSTANTS_H
+
+// CONSTANTS
+
+/// Envelope:
+_LIT8(KSenSoap12ContentTypeHeaderValue, "application/soap+xml; charset=utf-8");
+_LIT8(KSenSoap12AcceptHeaderValue,      "application/soap+xml");
+_LIT8(KSenSoapEnvelopeName,             "Envelope");
+_LIT8(KSenSoapEnvelopePrefix,   	    "S");
+_LIT8(KSenSoapEnvelopeQName,            "S:Envelope");
+
+_LIT8(KSenSoapEnvelopeXmlns,            "http://schemas.xmlsoap.org/soap/envelope/");
+_LIT8(KSenSoap12EnvelopeXmlns,          "http://www.w3.org/2003/05/soap-envelope");
+_LIT8(KSenSoapEnvelopeHeaderName,       "Header");
+_LIT8(KSenSoapEnvelopeHeaderQName,      "S:Header");
+_LIT8(KSenSoapEnvelopeBodyName,         "Body");
+_LIT8(KSenSoapEnvelopeBodyQName,        "S:Body");
+_LIT8(KSenSoapFaultName,                "Fault");
+
+/// Action
+_LIT8(KSenSoapActionHeaderName,         "SOAPAction");
+_LIT8(KSenSoapActionHeaderValueEmpty,   "\"\""); 
+
+/// Security
+_LIT8(KSecurityName,                "Security");
+_LIT8(KBinarySecurityToken,         "BinarySecurityToken");
+_LIT8(KSecurityXmlNs,               "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+_LIT8(KSecuritySchemeXmlNs,         "http://schemas.xmlsoap.org/ws/2003/06/secext");
+_LIT8(KSecurityXmlNsPrefix,         "wsse");
+
+_LIT8(KSecurityAttrType,            "Type");           // name of the XML attribute 
+_LIT8(KSecurityAttrTypeText,        "PasswordText");   // for default type: wsse:PasswordText
+_LIT8(KSecurityAttrTypeDigest,      "PasswordDigest"); // digest type: wsse:Digest
+
+_LIT8(KSecurityTokenReference,      "SecurityTokenReference");
+_LIT8(KSecurityUtilityXmlNs,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
+_LIT8(KSecurityUtilityXmlNsPrefix,  "wsu");
+
+_LIT8(KSecurityUtilityId, "Id");
+_LIT8(KSecurityUtilityWsuId, "wsu:Id");
+
+
+const TInt KStateParsingSoapHeader  = 20; // ignore state   (even number)
+const TInt KStateParsingSoapBody    = 40; // ignore state   (even number)
+const TInt KStateParsingSoapFault   = 5;  // save state     (odd number)
+
+/// Fault
+// CONSTANTS
+_LIT8(KFaultCodeLocalname,      "faultcode");   // "faultcode" is intended for use by software to
+                                                // provide an algorithmic mechanism for
+                                                // identifying the fault.
+
+_LIT8(KFaultStringLocalname,    "faultstring"); // "faultstring" is intended to provide a human
+                                                // readable explanation of the fault and is not
+                                                // intended for algorithmic processing.
+
+_LIT8(KFaultActorLocalname,     "faultactor");  // "faultactor" is intended to provide information
+                                                // about which SOAP node on the SOAP message path
+                                                // caused the fault to happen.
+                                                // The value of the "faultactor" is a URI
+                                                // identifying the source of the fault.
+                                                
+_LIT8(KDetailLocalname,         "detail");      // "detail" is intended for carrying application
+                                                // specific error information related to the SOAP
+                                                // Body. It MUST be present when the contents of
+                                                // the SOAP Body could not be processed
+                                                // successfully.
+                                                
+// SOAP 1.2 (http://www.w3.org/TR/soap12-part1/):
+_LIT8(KFault12CodeLocalname,	"Code");		// "Code" has a mandatory "Value" element
+                                                // information item and may have an optional
+                                                // Subcode element information item.
+
+_LIT8(KFault12SubcodeLocalname,	"Subcode");		// "Subcode" has a mandatory "Value" element
+                                                // information item and may have an optional
+                                                // Subcode element information item.
+
+_LIT8(KFault12ValueLocalname,	"Value");		// In "Code" element:
+                                                //    The type of the Value element information
+                                                //    item is env:faultCodeEnum. SOAP defines a
+                                                //    small set of SOAP fault codes covering high
+                                                //    level SOAP faults.
+                                                // In "Subcode" element:
+                                                //    The type of the Value element information
+                                                //    item is xs:QName. The value of this element
+                                                //    is an application defined subcategory of
+                                                //    the value of the Value child element
+                                                //    information item of the Subcode element
+                                                //    information item's parent element information
+                                                //    item.
+                                                
+_LIT8(KFault12ReasonLocalname,	"Reason");		// "Reason" has one or more "Text" element
+                                                // information item children. Each child "Text"
+                                                // element information item SHOULD have a
+                                                // different value for its "xml:lang" attribute
+                                                // information item.
+                                                
+_LIT8(KFault12TextLocalname,	"Text");		// "Text" has a mandatory attribute information
+                                                // item  with a [local name] of lang and
+                                                // [namespace name] of 
+                                                // "http://www.w3.org/XML/1998/namespace".
+                                                // Note that the definition in of the lang
+                                                // attribute information item requires that the
+                                                // [prefix] is "xml" or any capitalization thereof.
+                                                //
+                                                // "Text" is similar to the 'Reason-Phrase' defined
+                                                // by HTTP [RFC 2616] and SHOULD provide
+                                                // information explaining the nature of the fault.
+                                                // It is not intended for algorithmic processing.
+
+_LIT8(KFault12NodeLocalname,	"Node");		// "Node" is intended to provide information about
+                                                // which SOAP node on the SOAP message path caused
+                                                // the fault to happen.
+                                                // "Node" contains the URI of the SOAP node that
+                                                // generated the fault.
+
+_LIT8(KFault12DetailLocalname,	"Detail");		// "Detail" MAY be present in a SOAP fault in
+                                                // which case it carries additional information
+                                                // relative to the SOAP fault codes describing
+                                                // the fault. For example, the Detail element
+                                                // information item might contain information about
+                                                // a message not containing the proper credentials,
+                                                // a timeout, etc. The presence of the Detail
+                                                // element information item has no significance as
+                                                // to which parts of the faulty SOAP message were
+                                                // processed.
+
+// SOAP Fault Codes in SOAP 1.2 (http://www.w3.org/TR/soap12-part1/):
+_LIT8(KDataEncodingUnknown,     "DataEncodingUnknown");
+                                                // A SOAP header block or SOAP body child element 
+                                                // information item targeted at the faulting SOAP
+                                                // node is scoped (see 5.1.1 SOAP encodingStyle
+                                                // Attribute) with a data encoding that the
+                                                // faulting node does not support.
+
+_LIT8(KMustUnderstand,          "MustUnderstand");
+                                                // An immediate child element information item of
+                                                // the SOAP Header element information item
+                                                // targeted at the faulting node that was not
+                                                // understood by the faulting node contained a SOAP
+                                                // mustUnderstand attribute information item with a
+                                                // value of "true".
+                                                
+_LIT8(KReceiver,                "Receiver");    // The message could not be processed for reasons
+                                                // attributable to the processing of the message
+                                                // rather than to the contents of the message
+                                                // itself. For example, processing could include
+                                                // communicating with an upstream SOAP node, which
+                                                // did not respond. The message could succeed if
+                                                // resent at a later point in time.
+                                                
+_LIT8(KSender,                  "Sender");      // The message was incorrectly formed or did not
+                                                // contain the appropriate information in order to
+                                                // succeed. For example, the message could lack the
+                                                // proper authentication or payment information. It
+                                                // is generally an indication that the message is
+                                                // not to be resent without change.
+
+_LIT8(KVersionMismatch,         "VersionMismatch");
+                                                // The faulting node found an invalid element
+                                                // information item instead of the expected
+                                                // Envelope element information item. The namespace,
+                                                // local name or both did not match the Envelope
+                                                // element information item required by this
+                                                // recommendation.
+
+enum TSOAPVersion
+        {
+        ESOAP11 = 1,
+        ESOAP12
+        };
+
+#endif // SEN_SOAP_CONSTANTS_H
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenSoapEnvelope.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,321 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenSoapEnvelope is an utility class offering capability to 
+*                 parse XML SOAP envelope and manipulation methods to alter its
+*                 contents.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_ENVELOPE_H
+#define SEN_SOAP_ENVELOPE_H
+
+//  INCLUDES
+#include <SenBaseFragment.h>
+#include <SenSoapConstants.h>
+
+// CONSTANTS
+_LIT8(KSoapActionHeaderValueEmpty,	"\"\""); // default, if not set
+
+/*
+// Now declared in <SenSoapConstants.h>
+_LIT8(KSenSoap12ContentTypeHeaderValue, "application/soap+xml; charset=\"UTF-8\"");
+_LIT8(KSenSoap12AcceptHeaderValue,      "application/soap+xml");
+_LIT8(KSenSoapEnvelopeName,             "Envelope");
+_LIT8(KSenSoapEnvelopeQName,            "S:Envelope");
+
+_LIT8(KSenSoapEnvelopeXmlns,            "http://schemas.xmlsoap.org/soap/envelope/");
+_LIT8(KSenSoap12EnvelopeXmlns,          "http://www.w3.org/2003/05/soap-envelope");
+_LIT8(KSenSoapEnvelopeHeaderName,       "Header");
+_LIT8(KSenSoapEnvelopeHeaderQName,      "S:Header");
+_LIT8(KSenSoapEnvelopeBodyName,         "Body");
+_LIT8(KSenSoapEnvelopeBodyQName,        "S:Body");
+_LIT8(KSenSoapFaultName,                "Fault");
+
+_LIT8(KSenSoapActionHeaderName,         "SOAPAction");
+_LIT8(KSenSoapActionHeaderValueEmpty,   "\"\"");
+
+
+const TInt KStateParsingSoapHeader  = 20; // ignore state   (even number)
+const TInt KStateParsingSoapBody    = 40; // ignore state   (even number)
+const TInt KStateParsingSoapFault   = 5;  // save state     (odd number)
+
+enum TSOAPVersion
+        {
+        ESOAP11 = 1,
+        ESOAP12
+        };
+*/
+
+// FORWARD DECLARATIONS
+class CSenSoapFault;
+
+// CLASS DECLARATION
+
+/**
+* CSenSoapEnvelope is an utility class offering capability to parse
+* XML SOAP envelope and manipulation methods to alter its contents.
+* Typically WSC uses this class to parse messages received through
+* WSF HandleMessageL() and HandleErrorL() callbacks.
+* Class has convenience methods for checking if a SOAP envelope body
+* contains a fault and functionality to detach SOAP Fault object out
+* from it. Also possibility to set SOAPAction HTTP header is supported.
+*  @lib SenUtils.lib
+*  @since Series60 3.0
+*/
+class CSenSoapEnvelope : public CSenBaseFragment
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope* NewL();
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapEnvelope();
+
+        // New functions
+        
+        /**
+        * Sets body of the envelope.
+        * @since Series60 3.0 
+        * @param aBody      Body (content) to be set.
+        * @return SOAP body (content) which was just set
+        */
+        IMPORT_C virtual TPtrC8 SetBodyL(const TDesC8& aBody);
+
+        /**
+        * Getter for envelopes body
+        * @since Series60 3.0 
+        * @return body as CSenElement
+        */
+        IMPORT_C virtual CSenElement& BodyL();
+
+        /**
+        * Getter for envelopes header
+        * @since Series60 3.0 
+        * @return header as CSenElement
+        */
+        IMPORT_C virtual CSenElement& HeaderL();
+
+        /**
+        * Adds an element to the header.
+        * @since Series60 3.0 
+        * @param aHeaderElement new child element to be
+        *        added inside Header  element. Ownership
+        *        is always transferred to CSenSoapEnvelope.
+        * @return added CSenElement
+        */
+        IMPORT_C virtual CSenElement& AddHeaderL(CSenElement& aHeaderElement);
+
+        /**
+        * Getter for the envelope body as a UTF-8 form XML string.
+        * @since Series60 3.0 
+        * @return body as a HBufC8 pointer. Ownership is transferred to caller.
+        */
+        IMPORT_C virtual HBufC8* BodyAsStringL();
+
+        /**
+        * Checks if this SOAP envelope body contains SOAP fault or not.
+        * @since Series60 3.0 
+        * @return TBool ETrue if there is a fault, EFalse if not.
+        */
+        IMPORT_C virtual TBool IsFault();
+
+        /**
+        * Detaches the <Fault> element from the envelope, removing the element
+        * from the envelope.
+        * @since Series60 3.0 
+        * @return pointer to the soap fault. Caller takes the ownership. 
+        *         NULL if <Fault> element is non-existent.
+        */
+        IMPORT_C virtual CSenSoapFault* DetachFaultL();
+        
+        /**
+        * Gets the <Fault> element. Ownership is not transferred. 
+        * NULL if not a fault.
+        * @since Series60 3.0 
+        * @return reference to SOAP fault object owned by this SOAP envelope
+        */
+        IMPORT_C virtual CSenSoapFault* FaultL();
+
+        /**
+        * Sets the SOAP action HTTP header. WSF will use this value
+        * while submitting this SOAP envelope request over HTTP/S transport.
+        * @since Series60 3.0 
+        * @param aSoapAction    the SOAP Action HTTP header to be set.
+        * The default value is KSenSoapActionHeaderValueEmpty, which is
+        * two double quotation marks - "" - without any character in between.
+        * SOAP specification requires double quotation marks, even if action
+        * is empty.
+        * If a string without double quotation marks is passed, it will be 
+        * wrapped inside double quotation marks, added in the beginning and 
+        * at the end of the actual SOAP Action string.
+        *
+        * @return newly set SOAP action header. String might have been
+        * extended to include double quotation marks, if those were missing 
+        * from the argument. 
+        */
+        IMPORT_C virtual TPtrC8 SetSoapActionL(const TDesC8& aSoapAction);
+
+        /**
+        * Gets the soap action header.
+        * @since Series60 3.0 
+        * @return   current SOAP action header, which is always wrapped
+        * inside double quotation marks. If SOAPAction has not been set
+        * for this SOAP envelope, function will return zero-length 
+        * descriptor (KNullDesC8)
+        */
+        IMPORT_C virtual TPtrC8 SoapAction();      
+
+        /**
+        * Gets the soap action header.
+        * @since Series60 5.0 
+        * @return   current SOAP action header, which is always wrapped
+        * inside double quotation marks. If SOAPAction has not been set
+        * for this SOAP envelope, function will return zero-length 
+        * descriptor (KNullDesC8)
+        */
+			IMPORT_C TPtrC8 SoapAction2() ;
+        
+        /**
+        * Method parses given piece of XML into this SOAP envelope
+        */
+        IMPORT_C void ParseL(const TDesC8& aXml); 
+
+        /*
+        * Getter for checking whether this message has at least one
+        * valid <Header> element
+        * @return ETrue, if <Header> element exists, EFalse otherwise.
+        */
+        IMPORT_C TBool HasHeader();
+
+        /*
+        * Getter for checking whether this message has valid <Body> element
+        * @return ETrue, if <Body> element exists, EFalse otherwise.
+        */
+        IMPORT_C TBool HasBody();
+
+        /**
+        * Getter for currently effecitve SOAP version.
+        * @return enumeration which dictates SOAP version.
+        */
+        IMPORT_C TSOAPVersion SoapVersion();
+
+
+    protected:  
+            
+        /**
+         *    Constructor.
+         */
+        CSenSoapEnvelope();
+        
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods. 
+        * @since Series60 3.0
+        */
+        IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
+
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods. 
+        * @since Series60 3.0
+        */
+        IMPORT_C void BaseConstructL();
+        
+        // New functions
+        
+        /**
+        * This method should be overridden by subclasses. 
+        * Implements functionality to parse SOAP header if one is found
+        * during parsing the envelope.
+        * Parses all elements found under top <Header> element by
+        * using DOM fragment.
+        * @since Series60 3.0 
+        * @param aNsUri            The namespace URI of the new element
+        * @param aLocalName        The local name of the new element
+        * @param aQName            The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C virtual void ParseHeaderL( const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+                                            
+        // Functions from base classes
+        
+        // From CSenBaseFragment 
+        
+        /**
+        * Callback function which implement the XML content handler interface.
+        * This callback will occur on each start element tag found in the XML
+        * document.
+        * The SOAP envelope recognizes and parses the following elements and
+        * their corresponding attributes inside namespace defined in 
+        * KSenSoapEnvelopeXmlns:
+        *  KSenSoapEnvelopeName,    "Envelope"
+        *  KSenSoapHeaderName,      "Header"
+        *  KSenSoapBodyName,        "Body"
+        *  KSenSoapFault,           "Fault" (only if found inside Body element)
+        *
+        * @since Series60 3.0 
+        * @param aNsUri            The namespace URI of the new element
+        * @param aLocalName        The local name of the new element
+        * @param aQName            The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+        /**
+        * Callback function which implement the XML content handler interface.
+        * This callback will occur on each end element tag found in the XML
+        * document.
+        * @since Series60 3.0 
+        * @param aNsUri        The namespace URI of the new element
+        * @param aLocalName    The local name of the new element
+        * @param aQName        The qualified name of the new element
+        */
+        IMPORT_C virtual void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName);
+
+    protected: // Data
+        // Internal members, protected so that deriving classes have access to them.
+        CSenBaseFragment* ipBodyFragment;
+        CSenBaseFragment* ipHeaderFragment;
+        HBufC8* ipSoapAction;
+
+    private: // Data
+        TBool iFault;
+       };
+
+#endif // SEN_SOAP_ENVELOPE_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenSoapFault.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This utility class represents SOAP fault element according to
+*                SOAP fault specification. 
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_FAULT_H
+#define SEN_SOAP_FAULT_H
+
+//  INCLUDES
+#include <SenBaseElement.h>
+#include <SenSoapConstants.h>
+
+
+// CLASS DECLARATION
+
+/**
+* This utility class represents SOAP fault element according to SOAP fault 
+* specification. 
+* SOAP fault element has following child elements: 
+*  faultcode, 
+*  faultstring, 
+*  faultactor 
+*  detail
+*
+*  @lib SenUtils.lib
+*  @since Series60 3.0
+*/
+class CSenSoapFault : public CSenBaseElement
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Copy constructor, making a copy of the original source element.
+        * @since Series60 3.0
+        * @param aCopiedSource  Element where source will be copied.
+        */
+        IMPORT_C static CSenSoapFault* NewL(CSenElement& aCopiedSource);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace of this SOAP fault
+        * @param aLocalName is the localname for this SOAP fault
+        * @param aQName is the qualifiedname for this SOAP fault
+        * @param aAttributes are the XML attributes for this SOAP fault
+        * Parameters are used to construct the soap fault.
+        */
+        IMPORT_C static CSenSoapFault* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+            
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapFault();
+
+        // New functions
+        
+        /**
+        * @since Series60 3.0
+        * @return the content of <faultcode> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 FaultCode();
+
+		/**
+		* @since Series60 4.0
+		* @return the content of <Subcode> element as UTF-8 form string
+		* or KNullDesC8, if element is not available
+		*/
+		IMPORT_C TPtrC8 FaultSubcode();
+
+		/**
+        * @since Series60 3.0
+        * @return the content of <faultstring> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 FaultString();
+
+        /**
+        * @since Series60 3.0
+        * @return the content of <faultactor> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 FaultActor();
+
+        /**
+        * @since Series60 3.0
+        * @return the content of <detail> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 Detail();
+        
+    protected:  
+        
+        /**
+        * C++ default constructor
+        */
+        IMPORT_C CSenSoapFault();
+        
+        /**
+        * Basic ConstructL function
+        * @since Series60 3.0
+        * @param aCopiedSource is the CSenElement from which data to this
+        *        SOAP fault object is to be copied.
+        */
+        IMPORT_C void ConstructL(CSenElement& aCopiedSource);
+
+        /**
+        * Basic ConstructL function
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace URI of this SOAP fault
+        * @param aLocalName is the XML localname URI of this SOAP fault
+        * @param aQName is the XML qualifiedname URI of this SOAP fault
+        * @param aAttributes are the XML attributes for this SOAP fault
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes);
+    };
+
+#endif // SEN_SOAP_ENVELOPE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenSoapMessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenSoapMessage is an utility class offering capability to
+*                 parse XML SOAP envelope and manipulation methods to alter its
+*                 contents.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_MESSAGE_H
+#define SEN_SOAP_MESSAGE_H
+
+//  INCLUDES
+#include <SenWsSecurityHeader.h>
+#include <SenSoapEnvelope.h>
+
+// CLASS DECLARATION
+
+/**
+* CSenSoapMessage extends basic SOAP envelope functionality by
+* offering methods to set the security header and security token.
+* @lib SenUtils.lib
+* @since Series60 3.0
+*/
+class CSenSoapMessage : public CSenSoapEnvelope
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage* NewL();
+
+        /**
+        * Two-phase constructor.
+        * @param    aVersion version of SOAP (1.1 or 1.2)
+        * @since Series60 4.0
+        */
+        IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion);
+        
+        /**
+        * Two-phase constructor.
+        * @param    aVersion version of SOAP (1.1 or 1.2)
+        * @param    aSecurityNs seurity namespace version . 
+        *           KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
+        * @since Series60 4.0
+        */
+        IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapMessage();
+
+        // New functions
+        
+        /**
+        * Sets a new security header for the soap message. If existant, the
+        * old security header is deleted and new one with given data is added.
+        * @since Series60 3.0
+        * @param    aData    Data to be used in the security header.
+        */
+        IMPORT_C void SetSecurityHeaderL(const TDesC8& aData);
+        
+        /**
+        * Adds new token (content) to current security header, 
+        * appending to existing. The token is appended after the
+        * current content of security token. Method instantiates
+        * and adds default security header (without data), if 
+        * such was not set in beforehand.
+        * @since Series60 3.0
+        * @param    aNewToken    Token to be inserted.
+        * @return    KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken);    
+        
+    protected:  
+    
+        /**
+         *    C++ default constructor.
+         */
+        IMPORT_C CSenSoapMessage::CSenSoapMessage();
+
+        // New functions
+        
+        /**
+        * Helper function to make a new security header.
+        * @since Series60 3.0
+        * @param    aData    Default=NULL. Data to be set in the security header.
+        * @return    new security header, which is located in the cleanup stack.
+        *            Caller takes ownership.
+        */
+        IMPORT_C virtual CSenWsSecurityHeader* NewSecurityHeaderLC(
+                                                    const TDesC8* aData=NULL);
+
+        // Functions from base classes
+        
+        // From CSenSoapEnvelope 
+        
+        /**
+        * Implements functionality to parse SOAP header if one is found
+        * during parsing the envelope.
+        * Extends basic functionality from SOAP envelope by recognizing
+        * and parsing <Security> element under following namespace:
+        * http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
+        * All other headers are parsed using superclass (SOAP envelope)
+        * functionality.
+        * @since Series60 3.0
+        * @param aNsUri            The namespace URI of the new element
+        * @param aLocalName        The local name of the new element
+        * @param aQName            The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C virtual void ParseHeaderL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& aAttributes);
+
+        /**
+        * This method should be called from the deriving classes ConstructL() methods. 
+        * @since Series60 3.0
+        */
+        IMPORT_C void BaseConstructL();
+
+        /**
+        * This method should be called from the deriving classes ConstructL() methods. 
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
+        
+        /**
+        * This method should be called from the deriving classes ConstructL() methods.
+        * @param    aVersion version of SOAP (1.1 or 1.2)
+        * @param    aSecurityNs seurity namespace version . 
+        *           KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
+
+    protected: // Data
+        // Owned, but element not owned
+        CSenWsSecurityHeader* ipSecurityHeader; 
+    };
+
+#endif // SEN_SOAP_MESSAGE_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenTransportProperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,574 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Transport properties class declaration     
+*
+*/
+
+
+
+
+#ifndef SEN_TRANSPORT_PROPERTIES_H
+#define SEN_TRANSPORT_PROPERTIES_H
+
+#include <SenXmlProperties.h>
+#include <SenSoapEnvelope.h>
+
+// CONSTANTS
+_LIT8( KIapIdLocalName,              "IapId"            );
+_LIT8( KSnapIdLocalName,              "SnapId"            );
+_LIT8( KProxyHostLocalName,          "ProxyHost"        );
+_LIT8( KProxyPortLocalName,          "ProxyPort"        );
+_LIT8( KProxyUsageLocalName,         "ProxyUsage"       );
+_LIT8( KSecureDialogLocalName,       "SecureDialog"     );
+_LIT8( KDeviceIDLocalName,           "DeviceID"         );
+_LIT8( KSoapActionLocalName,         "SOAPAction"       );
+_LIT8( KUserAgentLocalName,          "User-Agent"       );
+_LIT8( KDownloadFolderLocalName,     "DownloadFolder"   );
+_LIT8( KFileAttachmentsLocalName,    "FileAttachments"  );
+_LIT8( KMwsNamespaceLocalName,       "MwsNamespace"     );
+_LIT8( KSenClientGeneratedMessageId, "MessageID"        );
+_LIT8( KSenOnewayMessageOnOff,       "OneWayMessage"    );
+
+_LIT8( KSenConnectionHeartbeat,      "Heartbeat"        );
+_LIT8( KSenConnectionHeartbeatMaxTTL,"MaxTTL"           );
+_LIT8( KSenConnectionHeartbeatMinTTL,"MinTTL"           );
+_LIT8( KSenEndpointResource,         "EndpointResource" );
+_LIT8( KSenConnectionProxyUrl,"ProxyUrl"           );
+
+_LIT8( KNCIMConsumerKeyId,      "ConsumerKeyId"         );
+_LIT8( KNCIMConsumerSecret,     "ConsumerSecret"        );
+_LIT8( KNCIMConsumerServiceId,  "ConsumerServiceId"     );
+_LIT8( KNCIMEndpoint,				"NCIMEndpoint"     );
+_LIT8( KSenConnectionRetryDelta,     "RetryDelta" );
+_LIT8( KSenConnectionRetryMaxTTL,    "RetryMaxTTL");
+_LIT8( KSenConnectionRetryMinTTL,    "RetryMinTTL");
+_LIT8( KNCIMCountry,				"mcc"     );
+
+
+/*
+* Use Bool property to hold value. You can use convenient methods SetBoolPropertyL/BoolPropertyL.
+* Value ETrue  - means NO dialog. If any problem occurs, then just an error is returned to the application. 
+* Value EFalse - system IAP dialog is shown if any problem occurs
+*/
+_LIT8( KSenIAPDoNotPrompt,           "IAPDoNotPrompt"   );
+_LIT8( KSenSNAPDoNotPrompt,           "SNAPDoNotPrompt"   );
+
+// Property type attribute's name for HTTP headers:
+_LIT8( KHttpHeaderType,              "HttpHeader"       );
+_LIT8( KAttachmentFileType,          "FileAttachment"   );
+
+/* Property type attribute's name for Deflate Filters:
+   Set this http transport property for the enabling of
+   http compression.Http data Compression works from 
+   server to client side.
+ */
+_LIT8( KWsPropertyValueHttpFilterDeflate, "HttpFilterDeflate"     );
+
+class CSenTransportProperties : public CSenXmlProperties
+    {
+    public:
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenTransportProperties* NewL();
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenTransportProperties* NewLC();
+
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenTransportProperties* NewL(const TDesC8& aXmlUtf8,
+                                                          CSenXmlReader& aParser);
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenTransportProperties* NewLC(const TDesC8& aXmlUtf8,
+                                                           CSenXmlReader& aParser);
+
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenTransportProperties* NewL(const CSenElement& aElement);
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenTransportProperties* NewLC(const CSenElement& aElement);
+    
+        // From MSenProperties
+        IMPORT_C virtual void SetReader(CSenXmlReader& aReader);
+        IMPORT_C virtual TSenPropertiesClassType PropertiesClassType();
+        IMPORT_C virtual void WriteToL(RWriteStream& aWriteStream);
+        IMPORT_C virtual void ReadFromL(const TDesC8& aBuffer);
+        IMPORT_C virtual HBufC8* AsUtf8L();
+        IMPORT_C virtual HBufC8* AsUtf8LC();
+        IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName,
+                                           const TDesC8& aValue);
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+        IMPORT_C virtual TInt SetIntPropertyL(const TDesC8& aName,
+                                              const TInt aValue);
+        IMPORT_C virtual TInt IntPropertyL(const TDesC8& aName,
+                                           TInt& aValue);
+        IMPORT_C virtual TInt SetBoolPropertyL(const TDesC8& aName,
+                                               const TBool aValue);        
+        IMPORT_C virtual TInt BoolPropertyL(const TDesC8& aName,
+                                                TBool& aValue);
+        IMPORT_C virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue);
+        IMPORT_C virtual TInt RemovePropertyL(const TDesC8& aName);
+        IMPORT_C virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+        IMPORT_C virtual MSenProperties* CloneL() const;
+        IMPORT_C virtual MSenProperties* Clone(TInt& aOkOrError) const;
+
+       /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenTransportProperties();
+        
+        IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName,
+                                           const TDesC8& aValue,
+                                           const TDesC8& aType);
+
+        IMPORT_C virtual TInt PropertyL(const TDesC8& aName,
+                                        TPtrC8& aValue,
+                                        TPtrC8& aType);
+                                        
+        /**
+        * Gets the (connection) heartbeat property value as int.
+        * @param aDelta     A TInt reference to be filled in with the
+        *                       value of the heartbeat (in seconds).
+        *                       Positive value means that a heartbeat
+        *                       messages are sent to backend, keeping
+        *                       the socket connection open (longlived
+        *                       connection). Keeping heartbeat may be
+        *                       costy, but increases performance in
+        *                       scenarios, where multiple network
+        *                       transactions take place within short
+        *                       period (time window).
+        * @return             KErrNone if no error, or some of the system
+        *                       wide error codes.
+        *                     KErrNotFound if shortlive connection defined
+        */
+        IMPORT_C virtual TInt HeartbeatL(TInt& aDelta);
+
+        /**
+        * Sets the (connection) heartbeat property value as int.
+        * Note, that with some transports, like vTCP, the heartbeat
+        * can also be used to control connection modes (longlive
+        * vs. shortlive connection). 
+        * Hertbeat value is called also as delta.
+        * 
+        * Together with delta You can also set parameters Min & Max TTL
+        * Long and short connection is set in different way, below guider.
+        *
+        * To setup longlive connection:
+        *   delta   : user defined
+        *   min TTL : If not specified then the default value of 90 sec will be used
+        *   max TTL : If not specified then the default value 1800 sec will be used
+        *
+        * To setup shortlive connection:
+        *   delta   : -1
+        *   min TTL : If not specified then the default value of 90 sec will be used
+        *   max TTL : ignored
+        *
+        * So, providing a negative value
+        * (-1) can be utilized to disable heartbeat and to switch
+        * the connection mode to a short lived state. With vTCP
+        * transport, if heartbeat of -1 is set, the socket will be
+        * kept open only for effective timeout value (shortlived), 
+        * 
+        * @param aDelta    TInt reference to be filled in with 
+        *                      the value of the heartbeat (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                      wide error codes.
+        */
+        IMPORT_C virtual TInt SetHeartbeatL(TInt aDelta);
+        
+        /**
+        * Gets the IAP ID.
+        * @param aCurrentIapId  A TUint32 reference to be filled in with the
+        *                       value of the IAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt IapIdL(TUint32& aCurrentIapId);
+
+        /**
+        * Sets the IAP ID.
+        * @param aIapId is the new IAP ID.
+        */
+        IMPORT_C virtual void SetIapIdL(TUint32 aIapId);
+
+        /**
+        * Gets the Proxy Port.
+        * @param aProxyPort  A TInt reference to be filled in with the
+        *                    value of the Proxy Port.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt ProxyPortL(TInt& aProxyPort);
+
+        /**
+        * Sets the Proxy Port.
+        * @param aProxyPort is the new Proxy Port.
+        */
+        IMPORT_C virtual void SetProxyPortL(TInt aProxyPort);
+
+        /**
+        * Gets the Proxy Host.
+        * @param aProxyHost  A TPtrC8 reference to be filled in with the
+        *                    value of the Proxy Host.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt ProxyHostL(TPtrC8& aProxyHost);
+
+        /**
+        * Sets the Proxy Host.
+        * @param aProxyHost is the new Proxy Host.
+        */
+        IMPORT_C virtual void SetProxyHostL(const TDesC8& aProxyHost);
+        
+        /**
+        * Gets the Proxy Usage flag.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the Proxy Usage.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt ProxyUsageL(TBool& aProxyUsage);
+
+        /**
+        * Sets the Proxy Usage flag.
+        * @param aProxyUsage is the new value for Proxy Usage.
+        */
+        IMPORT_C virtual void SetProxyUsageL(TBool aProxyUsage);
+
+        /**
+        * Gets the information if SecureDialog is shown or not.
+        * @param aProxyUsage A TBool reference to be filled in with the
+        *                    value of the SecureDialog flag.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt SecureDialogL(TBool& aSecureDialog);
+
+        /**
+        * Sets the flag which controls showing of SecureDialog.
+        * @param aSecureDialog is the new value for SecureDialog flag.
+        */
+        IMPORT_C virtual void SetSecureDialogL(TBool aSecureDialog);
+        
+        /**
+        * Gets the information if IAPDialog is shown or not.
+        * @param aIAPDialog A TBool reference to be filled in with the
+        *                   value of the SecureDialog flag.
+        * @return           KErrNone if no error, or some of the system
+        *                   wide error codes.
+        */
+//        IMPORT_C virtual TInt IAPDialogL(TBool& aIAPDialog);
+
+        /**
+        * Sets the flag which controls showing of IAPDialog.
+        * @param aIAPDialog is the new value for IAPDialog flag.
+        */
+//        IMPORT_C virtual void SetIAPDialogL(TBool aIAPDialog);
+
+        /**
+        * Gets the UserAgent.
+        * @param aUserAgent  A TPtrC8 reference to be filled in with the
+        *                    value of the UserAgent.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt UserAgentL(TPtrC8& aUserAgent);
+        
+        /**
+        * Sets the UserAgent.
+        * @param aUserAgent is the new User Agent.
+        */
+        IMPORT_C virtual void SetUserAgentL(const TDesC8& aUserAgent);
+        
+        /**
+        * Gets the device ID
+        * @param aDeviceID  A TPtrC8 reference to be filled in with the
+        *                    value of the Device ID.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt DeviceIDL(TPtrC8& aDeviceID);
+
+        /**
+        * Sets the Device ID.
+        * @param aDeviceID is the new Device ID.
+        */
+        IMPORT_C virtual void SetDeviceIDL(const TDesC8& aDeviceID);
+        
+        /**
+        * Gets the Action of message
+        * @param aAction A TPtrC8 reference to be filled in with the
+        *                    value of the Action.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt SoapActionL(TPtrC8& aAction);
+        
+        /**
+        * Sets the Action.
+        * @param aAction is the new Soap Action.
+        */
+        IMPORT_C virtual void SetSoapActionL(const TDesC8& aAction);
+        
+        /**
+        * Apply binding.
+        * @param aSoapVersion is the version of Soap (1.1 or 1.2).
+        */
+        IMPORT_C virtual void ApplyBindingL(TSOAPVersion aSoapVersion);
+
+        /**
+        * Gets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder - A TPtrC8 reference to be filled in with the
+        *                    value of the shared, public folder for downloaded 
+        *                    content
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt DownloadFolderL(TPtrC8& aDownloadFolder);
+        
+        /**
+        * Sets download folder for incoming BLOB (binary large objects)
+        * @param aDownloadFolder shared, public folder for downloaded content
+        */
+        IMPORT_C virtual void SetDownloadFolderL(const TDesC8& aDownloadFolder);
+        
+        /**
+        * Gets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName);
+        
+        /**
+        * Sets filename of file attachment
+        * @param aCid - cid for filename
+        * @param aFileName - filename of file attachment with current cid
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName);
+
+        /**
+        * Gets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt MwsNamespaceL(TPtrC8& aMwsNamespace);
+        
+        /**
+        * Sets namespace of Microsoft schema
+        * @param aMwsNamespace - namespace
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual void SetMwsNamespaceL(const TDesC8& aMwsNamespace);
+
+
+        /**
+        * Gets message ID
+        * @param aMessageId - is the id of the message
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt MessageIdL(TPtrC8& aMessageId);
+
+        /**
+        * Sets message ID. Typically, this property is set per each message, instead of
+        * applying the same message ID for whole consumer session (service connection)
+        * @param aMessageID - is the ID of the message
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual void SetMessageIdL(const TDesC8& aMessageId);
+
+        /**
+        * Gets one-way message mode.
+        * @param aOnewayMsgOnOff A TBool reference to be filled in with the
+        *                    value of the one-way message mode.
+        * @return            KErrNone if no error, or some of the system
+        *                    wide error codes.
+        */
+        IMPORT_C virtual TInt OnewayMessageOnOffL(TBool& aOnewayMessageOnOff);
+
+        /**
+        * Sets the one-way message mode on/off. Typically, one-way
+        * messages are rarely used by default: instead, a request-
+        * response pair (consumer[request]<->[response]provider)
+        * transaction takes place.
+        * However, if one-way message mode is enabled, sending such
+        * message will typically result immediate callback from
+        * the transport (plug-in) itself. This means, that the
+        * actual service response from the provider is not being
+        * waited. 
+        * Common use case to enable one-way message is when service
+        * connection is used in transmitting *responses* to notification
+        * request(s) that some remote consumer (from outside device) has 
+        * sent earlier.
+        * Such notification requests may thus be received via hostlet 
+        * connection (hc), and by enabling one-way message, once can reply
+        * via service connection, instead of calling hc->RespondL method.
+        * Furthermore, application might wish to enable one-way message
+        * mode to hostlet connection, if it is not interested of replying
+        * to these two-way notifications via hostlet connection, but wishes
+        * to use service connection instead.
+        * @param aOnewayMessageOnOff is the new value of one-way message mode.
+        */
+        IMPORT_C virtual void SetOnewayMessageOnOffL(TBool aOnewayMessageOnOff);
+
+        /**
+        * Sets the (connection) Max TTL for longlive connection.
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the max TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SetMaxTimeToLiveL(TInt aMaxTTL);
+        
+        /**
+        * Gets the (connection) max TTL property value as int.
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMaxTTL       A TInt reference to be filled in with the
+        *                       value of the max TTL (in seconds).
+        *
+        * @return           KErrNotFound if shortlive connection defined
+        *                   KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt MaxTimeToLiveL(TInt& aMaxTTL);
+
+        /**
+        * Sets the (connection) Min TTL
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMaxTTL      TInt reference to be filled in with 
+        *                      the value of the min TTL (in seconds)
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SetMinTimeToLiveL(TInt aMinTTL);
+
+        /**
+        * Gets the (connection) min TTL property value as int.
+        *
+        * @see SetHeartbeatL(TInt aDelta)
+        *
+        * @param aMinTTL     A TInt reference to be filled in with the
+        *                       value of the min TTL (in seconds).
+        *
+        * @return           KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt MinTimeToLiveL(TInt& aMinTTL);
+
+
+
+        /**
+        * Sets resource property value  for endpoint
+        *
+        *
+        * @param aEndpointResource - is the suffix for endpoint
+        *                      
+        * @return              KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt SetEndpointResourceL(const TDesC8& aEndpointResource);
+
+        /**
+        * Gets resource property value for endpoint
+        *
+        *
+        * @param aEndpointResource - is the suffix for endpoint
+        *                      
+        *
+        * @return           KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C virtual TInt EndpointResourceL(TPtrC8& aEndpointResource);
+
+
+    protected: // base class functions
+
+        IMPORT_C virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        IMPORT_C virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        IMPORT_C virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aQualifiedName, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        IMPORT_C virtual void BaseConstructL(const CSenElement& aElement);
+        
+	public:
+        /**
+        * Sets the SNAP ID.
+        * @param aSnapId is the new SNAP ID.
+        */
+        IMPORT_C void SetSnapIdL(TUint32 aSnapId); 
+
+        /**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C TInt SnapIdL(TUint32& aCurrentSnapId); 
+    protected:
+        /**
+        * Constructor.
+        */
+        IMPORT_C CSenTransportProperties();
+        
+    private:
+        TInt iFileAttachmentNum;        
+    };
+
+#endif // SEN_TRANSPORT_PROPERTIES_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenWsSecurityHeader.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,363 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenWsSecurityHeader represents security header functionality
+*                according to oasis wss spesifications (2004/01)
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_WS_SECURITY_HEADER_H
+#define SEN_WS_SECURITY_HEADER_H
+
+//  INCLUDES
+#include <SenBaseFragment.h>
+#include <SenSoapConstants.h>
+
+
+// FORWARD DECLARATIONS
+class CSenIdentityProvider;
+
+// CLASS DECLARATION
+
+/**
+* CSenWsSecurityHeader represents security header functionality according to 
+* oasis web services security (WSS) specifications (2004/01) or older (2003/06)
+* @lib SenUtils.lib
+* @since Series60 3.0
+*/
+class CSenWsSecurityHeader : public CSenBaseFragment
+    {
+    public:  // Constructors and destructor
+
+		/**
+		* PasswordType Enumeration
+		*/
+        enum TPasswordType
+            {
+            EText = 1,        // default, wsse:PasswordText
+            EDigest           // wsse:Digest
+            };
+
+        
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenWsSecurityHeader class instance.
+        */
+        IMPORT_C static CSenWsSecurityHeader* NewL();
+        
+        /**
+        * Basic constructor.
+        * @return a new CSenWsSecurityHeader class instance, which pointer
+        * is left on cleanup stack.
+        */
+        IMPORT_C static CSenWsSecurityHeader* NewLC();
+
+        
+        /**
+        * Basic constructor.
+        * @param    aData   Data to be set as header's content.
+        * @return a pointer to new CSenWsSecurityHeader class instance.
+        */
+        IMPORT_C static CSenWsSecurityHeader* NewL(const TDesC8& aData);
+
+        /**
+        * Basic constructor.
+        * @param    aData   Data to be set as header's content.
+        * @return a new CSenWsSecurityHeader class instance, which pointer
+        * is left on cleanup stack.
+        */
+        IMPORT_C static CSenWsSecurityHeader* NewLC(const TDesC8& aData);
+        
+        /**
+        * Basic constructor.
+        * @param    aData           Data to be set as header's content.
+        * @param    aSecurityNs     A namespace to be set to the header.
+        * @return a pointer to new CSenWsSecurityHeader class instance.
+        */
+        IMPORT_C static CSenWsSecurityHeader* NewL(const TDesC8& aData, const TDesC8& aSecurityNs);
+
+        /**
+        * Basic constructor.
+        * @param    aData           Data to be set as header's content.
+        * @param    aSecurityNs     A namespace to be set to the header.
+        * @return a new CSenWsSecurityHeader class instance, which pointer
+        * is left on cleanup stack.
+        */
+        IMPORT_C static CSenWsSecurityHeader* NewLC(const TDesC8& aData, const TDesC8& aSecurityNs);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenWsSecurityHeader();
+
+        // New functions
+    
+        /**
+        * Constructs a username token.
+        * @since Series60 3.0
+        * @param  aIdentityProvider  Identity provider which is used to get
+        * the authorization ID used in username token. Method takes the
+        * AuthzID out from aIdentityProvider, and uses it as username for
+        * this token.
+        * Format of the token is as follows:
+        *
+        * <wsse:UsernameToken>
+        *   <wsse:Username>
+        *       username
+        *   </wsse:Username>
+        * </wsse:UsernameToken>"
+        *
+        * The above token assumes, that wsse namespace is declared in 
+        * top level of the security header.
+        * @return a pointer to buffer containing the username token. Does not
+        * return NULL. Ownership is transferred to the caller. Method leaves
+        * with value KErrNotSupported, if a password type is not supported.
+        */
+        IMPORT_C HBufC8* UsernameTokenL(CSenIdentityProvider &aIdentityProvider);
+
+        /**
+        * Constructs a username token.
+        * @since Series60 3.0
+        * @param  aIdentityProvider  Identity provider which is used to get
+        * the authorization ID used in username token. Method takes the
+        * AuthzID out from aIdentityProvider, and uses it as username for
+        * this token. Password is also fetched from aIdentityProvider via
+        * calling Password() getter, which must return a Base64 [XML-Schema]
+        * encoded, SHA-1 hash value, of the UTF8 encoded password.
+        * @param  aType Specifies the type of the password, either
+        * wsse:PasswordText or wsse:PasswordDigest
+        *
+        * Format of the token is as follows (if password type is wsse:PasswordText):
+        *
+        * <wsse:UsernameToken>
+        *   <wsse:Username>
+        *       username
+        *   </wsse:Username>
+        *   <wsse:Password>
+        *       password
+        *   </wsse:Password>
+        * </wsse:UsernameToken>"
+        *
+        * If the password type is wsse:Password:Digest, then the password element
+        * will be declared as follows:
+        *
+        *   <wsse:Password Type="wsse:PasswordDigest">
+        *
+        * The above token assumes, that wsse namespace is declared in 
+        * top level of the security header.
+        * @return a pointer to buffer containing the username token. Does not
+        * return NULL. Ownership is transferred to the caller. Method leaves
+        * with value KErrNotSupported, if a password type is not supported.
+        */
+        IMPORT_C HBufC8* UsernameTokenL(CSenIdentityProvider &aIdentityProvider,
+                                        CSenWsSecurityHeader::TPasswordType aType);
+
+        // Static methods:
+
+        /**
+        * Constructs a username token. This method does not add the <Password>
+        * element, since it is optional for basic username tokens.
+        * @since Series60 3.0
+        * @param  aUsername     User name which is used in the username 
+        *                       token.
+        * @param  aToken        Ref-to-pointer where the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt UsernameTokenL(const TDesC8& aUsername,
+                                            HBufC8*& aToken);
+
+        /**
+        * Constructs a username token using a password, too.
+        * @since Series60 5.0
+        * @param  aUsername     User name which is to be used in new token.
+        * @param  aPassword     Password which is to be use in new token.
+        *                       The type will be set to default: wsse:PasswordDigest,
+        *                       defined in KSecurityAttrTypeText. This is
+        *                       a Base64 [XML-Schema] encoded, SHA-1 hash value, 
+        *                       of the UTF8 encoded password.
+        * @param  aToken        Ref-to-pointer in which the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt UsernameTokenL(const TDesC8& aUsername,
+                                            const TDesC8& aPassword,
+                                            HBufC8*& aToken);
+
+       /**
+        * Constructs a username token using a password, too.
+        * @since Series60 5.0
+        * @param  aUsername     User name which is to be used in new token.
+        * @param  aPassword     Password which is to be use in new token
+        *                       This is a Base64 [XML-Schema] encoded, SHA-1 
+        *                       hash value, of the UTF8 encoded password.
+        * @param  aType         Specifies the type of the password:
+        *                       - EText, being default refers to wsse:PasswordText,
+        *                       but this method does not add this, since it can
+        *                       be omitted.
+        *                       - EDigest: will add wsse:PasswordDigest attribute
+        *                       to the <Password> -element, as in here:
+        *
+        *                        <wsse:UsernameToken>
+        *                           <wsse:Username>
+        *                               username
+        *                           </wsse:Username>
+        *                           <wsse:Password Type="wsse:PasswordDigest">
+        *                               password
+        *                           </wsse:Password>
+        *                         </wsse:UsernameToken>"
+        *                        
+        * @param  aToken        Ref-to-pointer where the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt UsernameTokenL(const TDesC8& aUsername,
+                                            const TDesC8& aPassword,
+                                            CSenWsSecurityHeader::TPasswordType aType,
+                                            HBufC8*& aToken);
+
+
+       /**
+        * Constructs a BinarySecurityToken.
+        * @since Series60 5.0
+        *                        
+        * @param  aContent      Encoded EncryptedData which is to be used in token.
+        * @param  aToken        Ref-to-pointer where the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt BinarySecurityTokenL(const TDesC8& aContent,
+                                                  HBufC8*& aToken);
+        /**
+        * Constructs a BinarySecurityToken.
+        * @since Series60 5.0
+        *                        
+        * @param  aContent      Encoded EncryptedData which is to be used in token.
+        * @param  aValueType  Indicates what the security token is
+        * @param  aToken        Ref-to-pointer where the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt BinarySecurityTokenL(const TDesC8& aContent,
+                                                  const TDesC8& aValueType,
+                                                  HBufC8*& aToken);
+
+        /**
+        * Constructs a timestamp.
+        * @since Series60 5.0
+        * Format of the timestamp is as follows:
+        *   <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+        *       <wsu:Created>2001-09-13T08:42:00Z</wsu:Created>
+        *       <wsu:Expires>2002-09-13T08:42:00Z</wsu:Expires>
+        *   </wsu:Timestamp>
+        * The wsu namespace is declared inside this element.
+        *   Based on chapter 10 from WS-Security 2004
+        * @param aCreated - creation time of token
+        * @param aExpires - end of validation time for token
+        * @param aTimestamp - a pointer to buffer containing the timestamp. Does not
+        *         return NULL. Ownership is transferred to the caller.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt TimestampL(const TDesC8& aCreated, const TDesC8& aExpires, HBufC8*& aTimestamp);
+        
+        /**
+        * Constructs a timestamp.
+        * @since Series60 5.0
+        * Format of the timestamp is as follows:
+        *   <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+        *       <wsu:Created>2001-09-13T08:42:00Z</wsu:Created>
+        *   </wsu:Timestamp>
+        * The wsu namespace is declared inside this element.
+        *   Based on chapter 10 from WS-Security 2004
+        * @param aCreated - creation time of token
+        * @param aTimestamp - a pointer to buffer containing the timestamp. Does not
+        *         return NULL. Ownership is transferred to the caller.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt TimestampL(const TDesC8& aCreated, HBufC8*& aTimestamp);
+
+        /**
+        * Constructs a security token reference.
+        * @since Series60 5.0
+        * Format of the token reference is as follows:
+        *   <wsse:SecurityTokenReference wsu:Id="...">
+        *       <wsse:Reference URI="..."/>
+        *   </wsse:SecurityTokenReference>
+        *
+        * The above token assumes, that wsse namespace is declared in 
+        * top level of the security header.
+        * @param  
+        * @param aSTR - a pointer to buffer containing the token reference. Does not
+        *         return NULL. Ownership is transferred to the caller.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+//        IMPORT_C static TInt SecurityTokenReferenceL(const TDesC8& aURI, HBufC8*& aSTR); 
+
+       
+        // Virtual methods: 
+
+        /** Basic getter for XML namespace of the WS security header.
+        * Subclasses should override this to use different namespace 
+        * @since Series60 3.0
+        * @return the WS security header namespace as string
+        */
+        IMPORT_C virtual TPtrC8 XmlNs();
+        
+        /**
+        * Basic getter for XML namespace prefix of the WS security header.
+        * Subclasses should override this to use different namespace prefix
+        * @since Series60 3.0
+        * @return the WS security header namespace prefix as string
+        */
+        IMPORT_C virtual TPtrC8 XmlNsPrefix();    
+        
+    protected:  
+        
+        /**
+        * C++ default constructor
+        */
+        IMPORT_C CSenWsSecurityHeader();
+        
+        /**
+        * Basic BaseConstructL function 
+        */
+        IMPORT_C void BaseConstructL();
+        
+        // Functions from base classes
+        
+        /**
+        * From CSenBaseFragment Basic BaseConstructL function 
+        * @since Series60 3.0
+        * @param aData will be used as current token (content) of this security 
+        *        header
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aData);
+        IMPORT_C void BaseConstructL(const TDesC8& aData, const TDesC8& aSecurityNs);
+    };
+
+#endif // SEN_WS_SECURITY_HEADER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/SenXmlProperties.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Xml properties class declaration     
+*
+*/
+
+
+#ifndef SEN_XML_PROPERTIES_H
+#define SEN_XML_PROPERTIES_H
+
+#include <e32std.h>
+#include <SenDomFragment.h>
+#include <MSenProperties.h>
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+class CSenXmlReader;
+class CSenPropertiesFragment;
+
+// CONSTANTS
+_LIT8(KSenXmlPropertiesLocalname,       "Properties");
+_LIT8(KSenTypeAttributeName,            "Type");
+_LIT8(KSenOmittedAttributeName,         "Omitted");
+_LIT8(KSenOmittedTrueNoValue,            "");
+_LIT8(KSenPropertyTrue,                 "true");
+_LIT8(KSenPropertyFalse,                "false");
+
+
+//_LIT8(KSenXmlPropertiesQualifiedname,  "props:Properties);
+//_LIT8(KSenXmlPropertiesNamespace,      "urn:com.nokia.Sen.properties.1.0");
+
+// CLASS DESCRIPTION
+
+/*
+* 
+* This class provides XML based implementation, which is mainly targetted
+* for further evolved subclasses, which extend this to more concrete classes,
+* like CSenHttpTransportProperties. Class provides serialization of properties
+* into XML.
+* 
+* Please bear in mind the following limitations:
+* 
+* 1. It is illegal to provide following property names as argument to 
+*    any of the setter methods, as they become XML tags - local element
+*    names - when properties object is serialized:
+*      (a) zero-length descriptor
+*      (b) descriptor starts with number and
+*      c descriptor contains any of the 5 basic XML entities in 
+*          unencoded form (&, ', ", <, >)
+* 
+* 2. It is illegal to provide following property values as argument to 
+*    any of the setter methods, as they become XML element content when 
+*    properties object is serialized:
+*      (a) descriptor contains any of the 5 basic XML entities in
+*      unencoded form (&, ', ", <, >)
+* @lib SenUtils.lib
+* @since Series60 5.0
+*/
+
+class CSenXmlProperties : public CBase, public MSenProperties
+    {
+    public:
+
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenXmlProperties class instance.
+        */
+        IMPORT_C static CSenXmlProperties* NewL();
+        /**
+        * Basic constructor.
+        * @return a pointer to new CSenXmlProperties class instance.
+        */        
+        IMPORT_C static CSenXmlProperties* NewLC();
+
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenXmlProperties* NewL(const TDesC8& aXmlUtf8,
+                                       CSenXmlReader& aParser);
+        /**
+        * Basic constructor.
+		* @param aXmlUtf8 
+    	* @param aParser It is a XML reader        
+        * @return a pointer to new CSenTransportProperties class instance.
+        */
+        IMPORT_C static CSenXmlProperties* NewLC(const TDesC8& aXmlUtf8,
+                                        CSenXmlReader& aParser);
+
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenXmlProperties class instance.
+        */
+        IMPORT_C static CSenXmlProperties* NewL(const CSenElement& aElement);
+        /**
+        * Basic constructor.
+		* @param aElement
+        * @return a pointer to new CSenXmlProperties class instance.
+        */        
+        IMPORT_C static CSenXmlProperties* NewLC(const CSenElement& aElement);
+
+        // From MSenProperties
+        virtual void SetReader(CSenXmlReader& aReader);
+        virtual TSenPropertiesClassType PropertiesClassType();
+        virtual void WriteToL(RWriteStream& aWriteStream);
+        virtual void ReadFromL(const TDesC8& aBuffer);
+        virtual HBufC8* AsUtf8L();
+        virtual HBufC8* AsUtf8LC();
+        virtual TBool IsSafeToCast(TSenPropertiesClassType aClass);
+        
+        virtual MSenProperties* Clone(TInt& aOkOrError) const;
+        virtual MSenProperties* CloneL() const;
+
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName,
+                                  const TDesC8& aValue);
+
+        virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+        
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetIntPropertyL(const TDesC8& aName,
+                                     const TInt aValue);
+                                     
+        virtual TInt IntPropertyL(const TDesC8& aName,
+                                  TInt& aValue);
+        /**
+        * @see MSenProperties
+        * Leave codes: 
+        *      KErrSenInvalidCharacters if aName contains illegal characters.     
+        *      KErrSenZeroLengthDescriptor if aName is zero length.
+        */
+        virtual TInt SetBoolPropertyL(const TDesC8& aName,
+                                      const TBool aValue);
+                                      
+        virtual TInt BoolPropertyL(const TDesC8& aName,
+                                   TBool& aValue);        
+        virtual TInt SetOmittedL(const TDesC8& aName, TBool aValue);
+
+        virtual TInt RemovePropertyL(const TDesC8& aName);
+        /**
+        * Destructor.
+        */
+        virtual ~CSenXmlProperties();
+        
+        /**
+        * Sets new property. 
+        *
+        * If property with given name does not exist, 
+        * new property with given value will be added. Otherwise the value of 
+        * existing property will be updated.
+        *
+        * @since Series60
+        * @param aName         Name of the property, which can be later used to
+        *                      refer the given value.
+        * @param aValue        Is the value of this property.
+        * @param aType         Is the type of this property.
+        * @return              KErrNone if no error, or some of the system wide
+        *                      error codes.
+        */
+        virtual TInt SetPropertyL(const TDesC8& aName, 
+                                  const TDesC8& aValue,
+                                  const TDesC8& aType);
+
+        /**
+        * Gets the value of the property behind certain name.
+        * @since Series60
+        * @param aName    The name identifying this property.
+        * @param aValue   A TPtrC8 reference to be filled in with the value of
+        *                 the property.
+        * @param aType    A TPtrC8 reference to be filled in with the type of
+        *                 the property.
+        * @return         KErrNone if no error, or some of the system wide
+        *                 error codes.     
+        */
+        virtual TInt PropertyL(const TDesC8& aName, 
+                               TPtrC8& aValue,
+                               TPtrC8& aType);
+    
+    protected: // base class functions
+
+        virtual void BaseConstructL(const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const TDesC8& aNamespace, 
+                                    const TDesC8& aLocalname, 
+                                    const TDesC8& aQualifiedName, 
+                                    const TDesC8& aXml,
+                                    CSenXmlReader* aParser = NULL);
+
+        virtual void BaseConstructL(const CSenElement& aElement);
+
+    protected:
+        /**
+        * Constructor.
+        */
+        CSenXmlProperties();
+
+    protected:
+        CSenPropertiesFragment*     ipFragment; // owned
+        CSenXmlReader*              ipReader;   // owned
+    };
+
+#endif // SEN_XML_PROPERTIES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/msencobrandinginterface.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Callback interface for co-branding interface.
+*
+*/
+
+
+
+
+#ifndef M_SEN_COBRANDING_INTERFACE_H
+#define M_SEN_COBRANDING_INTERFACE_H
+
+// CLASS DECLARATION
+/**
+ * Callback interface for co-branding.
+ * Note: UID for this interface is KSenInterfaceUidCoBrandingObserver.
+ *
+ * Application that wishes to enable billing also needs to enable
+ * following properties of client policy by calling
+ * CSenXmlServiceDescription::SetPolicy( const TDesC8& aName, const TDesC8& aValue ):
+ *
+ *  - Application Info      [ <AppInfo/>,       KSenLocalnameAppInfo ]
+ *  - WAP gateway address   [ <WAPGW"/>,        KSenLocalnameWAPGW   ] 
+ *  - MWS namespace         [ <MwsNamespace/>,  KSenLocalnameMwsNamespace   ]
+ *
+ * If application does not provide WAP GW address as part of client policy,
+ * it signalizes that application wants to skip communication with WAP GW
+ * and talk directly with billing gateway instead. Typically, this depends
+ * on operator spesific environment.
+ */
+class MSenCoBrandingObserver
+    {
+    public:
+    /**
+    * This method is called when list of co-branding IDs is receieved during authentication.
+    * @param aBrandIdListAsXmlSnippet is the list of brand IDs in form of XML snippet
+    * @param aSelectedBrandId is supposed to point to the brand ID selected by the application
+    * when this callback returns.
+    * @return TBool indicates whether or not the application wants to proceed (enable)
+    * the use of billing ecosystem or stop the whole progress.
+    */
+    virtual TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId) = 0;
+    };
+#endif // M_SEN_COBRANDING_INTERFACE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/sencryptoutils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Crypto graphy utils api declaration
+*
+*/
+
+#ifndef C_SEN_CRYPTO_UTILS_H
+#define C_SEN_CRYPTO_UTILS_H
+
+#include <hash.h>
+
+
+/**
+ * Set of static convenience methods to help in cryptography
+ */
+class SenCryptoUtils
+    {
+    public:
+        /**
+        * Algorithm taken from of TLS specification RFC 2246 - 5.HMAC and the pseudorandom function  
+        *           
+        *           P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
+        *                              HMAC_hash(secret, A(2) + seed) +
+        *                              HMAC_hash(secret, A(3) + seed) + ...
+        *
+        *               Where + indicates concatenation.
+        *
+        *               A() is defined as:
+        *                   A(0) = seed
+        *                   A(i) = HMAC_hash(secret, A(i-1))
+        *
+        *       P_hash can be iterated as many times as is necessary to produce the
+        *       required quantity of data. For example, if P_SHA-1 was being used to
+        *       create 64 bytes of data, it would have to be iterated 4 times
+        *       (through A(4)), creating 80 bytes of output data; the last 16 bytes
+        *       of the final iteration would then be discarded, leaving 64 bytes of
+        *       output data.
+        * @param aSecret - secret
+        * @param aSeed - seed
+        * @param aLength - length of new secret
+        * @since Series60 4.0
+        */
+        IMPORT_C static HBufC8* GetPSHA1HashL( const TDesC8& aSecret, 
+                                               const TDesC8& aSeed, 
+                                               const TInt aLength );
+    
+        /*
+        * Encode data into Base64 format
+        * @param aData - source data
+        * @return encoded data, if some problem occurs, NULL is returned
+        * @since Series60 4.0
+        */
+        IMPORT_C static HBufC8* EncodeBase64L(const TDesC8& aData);
+    
+        /*
+        * Decode data from Base64 format
+        * @param aData - source data
+        * @return decoded data, if some problem occurs, NULL is returned
+        * @since Series60 4.0
+        */
+        IMPORT_C static HBufC8* DecodeBase64L(const TDesC8& aData);
+    
+        /*
+        * Randomize some data and hash it using MD5 digest algorithm.
+        * @return hashed randomized data (constant length of hash according to MD5 specification)
+        * @since Series60 4.0
+        */
+        IMPORT_C static HBufC8* RandomAndHashMd5LC();
+        
+        /*
+        * Create <BinarySecret> tag from security token.
+        * @param aSecret security context token.
+        * @param aValueType Indicates what the security token is
+        * @return <BinarySecret> tag with encoded (base64) token.
+        */
+        IMPORT_C static HBufC8* CreateEncodedBinarySecretL( const TDesC8& aSecret, 
+                                                            const TDesC8& aValueType );
+        
+        /*
+        * Timestamp as number of seconds since 1 january 1970 
+        *   Calculated for present phone time.
+        * @return timestamp value
+        * @since Series60 5.0
+        */
+        IMPORT_C static HBufC8* GetTimestampL();
+
+
+        /*
+        * Timestamp as number of seconds since 1 january 1970.
+        *   Calculated for provided time.
+        * @param aTime base for generated timestamp
+        * @return timestamp value
+        * @since Series60 5.0
+        */
+        IMPORT_C static HBufC8* GetTimestampL(TTime aTime);
+        
+        /*
+        * Randomize some data (based on time) and hash it using MD5 digest algorithm, 
+        * convert each byte to hex nember representation
+        * @return hashed randomized data (constant length of hash according to MD5 specification
+        * doubled during hex conversion)
+        * @since Series60 5.0
+        */
+        IMPORT_C static HBufC8* GetRandomNonceL();
+        
+    private:
+        /**
+        * Hide default C++ constructor.
+        */
+        SenCryptoUtils();
+    };
+
+#endif // C_SEN_CRYPTO_UTILS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/senpointermap.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,272 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Pointermap class declaration        
+*
+*/
+
+
+
+
+#ifndef POINTERMAP_H
+#define POINTERMAP_H
+
+// INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+template <typename K, typename V>
+class RSenPointerMap
+    {
+    public: // Constructors and destructor
+        
+    RSenPointerMap(TBool aTakeOwnershipKey, TBool aTakeOwnershipValue)
+        :
+        iTakeOwnershipKey(aTakeOwnershipKey),
+        iTakeOwnershipValue(aTakeOwnershipValue)
+        {}
+
+    ~RSenPointerMap()
+        {
+        Reset();
+        }
+
+        // New functions
+        
+    TInt Append(const K* aKey, const V* aValue)
+        {
+        TInt err = iKeys.Append(aKey);
+        if (err == KErrNone)
+            {
+            err = iValues.Append(aValue);
+            if (err != KErrNone)
+                {
+                // last element of iKeys should be removed
+                TInt lastElementIndex = iKeys.Count() - 1;
+                iKeys.Remove(lastElementIndex);
+                }
+            }
+        return err;
+        }
+
+    TInt Find(const K& aKey) const
+        {
+        TInt index( KErrNotFound );
+        for (TInt i = 0; i < iKeys.Count(); i++)
+            {
+            if (*iKeys[i] == aKey)
+                {
+                index = i;
+                break;
+                }
+            }
+        return index;
+        }
+
+    TInt FindReverse(const K& aKey) const
+        {
+        TInt index( KErrNotFound );
+        TInt count( iKeys.Count() );
+        for (TInt i = count-1; i >=0 ; i--)
+            {
+            if (*iKeys[i] == aKey)
+                {
+                index = i;
+                break;
+                }
+            }
+        return index;
+        }
+        
+        
+    TInt RemoveAt( TInt aIndex ) 
+        {
+        K* key = KeyAt( aIndex );
+    	return RemoveByKey( *key );
+    	}
+
+    // @return the index of removed key-value pair, or
+    // KErrNotFound, if such key was not found
+    TInt RemoveByKey(const K& aKey)
+        {
+        TInt index = Find(aKey);
+        if (index != KErrNotFound)
+            {
+            if(iTakeOwnershipKey)
+                {
+                K* key = KeyAt(index);
+                delete key;
+                }
+            if(iTakeOwnershipValue)
+                {
+                V* value = iValues[index];
+                delete value;
+                }
+            iKeys.Remove(index);
+            iValues.Remove(index);
+            }
+        return index;
+        }
+
+    // @return the index of removed key-value pair, or
+    // KErrNotFound, if such key was not found
+    TInt Remove(const V& aValue)
+        {
+        TInt index = FindValue(aValue);
+        if (index != KErrNotFound)
+            {
+            if (iTakeOwnershipValue)
+                {
+                V* value = iValues[index];
+                delete value;
+                }
+            if (iTakeOwnershipKey)
+                {
+                K* key = iKeys[index];
+                delete key;
+                }
+            iValues.Remove(index);
+            iKeys.Remove(index);
+            }
+        return index; 
+        }
+
+    TInt FindValue(const V& aValue) const
+        {
+        TInt index = KErrNotFound;
+        for (TInt i = 0; i < iValues.Count(); i++)
+            {
+            if ((iValues[i]) && (*iValues[i] == aValue))
+                {
+                index = i;
+                break;
+                }
+            }
+        return index;
+        }
+
+
+    // Note: deletes the current value of this key
+    TInt UpdateValue(const K* aKey, const V* aValue)
+        {
+        TInt index=Find(*aKey);
+        if (index==KErrNotFound)
+            {
+            return Append(aKey, aValue);
+            }
+
+        V* bValue=iValues[index];
+        if (iTakeOwnershipValue)
+            {
+            // Since OWNED value is going to be replaced with aValue,
+            // destroy old value instance first:
+            delete bValue;  
+            }
+
+        iValues[index]=(V*)aValue;
+        return KErrNone;
+        }
+
+
+    K* KeyAt(TInt aIndex)
+        {
+        return iKeys[aIndex];
+        }
+
+    const V* ValueAt(TInt aIndex) const
+        {
+        return iValues[aIndex];
+        }
+
+    TInt Count() const
+        {
+        return iKeys.Count();
+        }
+
+    void Reset()
+        {
+        if ( iTakeOwnershipKey )
+            {
+            iKeys.ResetAndDestroy();
+            }
+        else
+            {
+            iKeys.Reset();
+            }
+
+        if ( iTakeOwnershipValue )
+            {
+            iValues.ResetAndDestroy();
+            }
+        else
+            {
+            iValues.Reset();
+            }
+        }
+        
+    TInt Insert(const K* aKey, const V* aValue)
+        {
+        TInt count=iKeys.Count();
+        TInt err=KErrNone;
+		TBool inserted=EFalse;
+
+        for(TInt i=0; i<count; i++)
+        	{
+        	 if(*iKeys[i] >= *aKey)
+        	 {
+	        err = iKeys.Insert(aKey, i);
+	        if (err == KErrNone)
+	            {
+	            err = iValues.Insert(aValue, i);
+	            if (err != KErrNone)
+	                {
+	                // inserted element of iKeys should be removed
+	                iKeys.Remove(i);
+	                }
+				    else
+					{
+					inserted=ETrue;
+					}
+            	}
+			break;  	 	
+        	 }
+			}
+
+        if(!inserted)
+        	{
+	        err = iKeys.Append(aKey);
+	        if (err == KErrNone)
+	            {
+	            err = iValues.Append(aValue);
+	            if (err != KErrNone)
+	                {
+	                // last element of iKeys should be removed
+	                TInt lastElementIndex = iKeys.Count() - 1;
+	                iKeys.Remove(lastElementIndex);
+	                }
+            	}
+        	}
+	return err;
+        }
+        
+    private: // Data
+    TBool iTakeOwnershipKey;
+    TBool iTakeOwnershipValue;
+    RPointerArray<K> iKeys;
+    RPointerArray<V> iValues;
+    };
+
+#endif // POINTERMAP_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/inc/senserviceconnectioninterfaces.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    In case that Service Consumer (owner of SC instance) needs
+*                some special, even properietary interface, it can request
+*                an implementation of such interface by calling
+*                CSenServiceConnection::InterfaceByUid(UID) and acquire
+*                on of the M-class interfaces defined in this file.
+*
+*/
+
+
+
+
+#ifndef M_SEN_SERVICE_CONNNECTION_INTERFACES_H
+#define M_SEN_SERVICE_CONNNECTION_INTERFACES_H
+
+// CONST
+// UIDs for the supported, new *service connection interfaces*:
+const TUid KSenInterfaceUidAlrServiceConnection      = { 0xE760F699 }; // MSenAlrServiceConnection
+
+
+// CLASS DECLARATION
+/**
+ * Callback interface for service consumers
+ */
+    
+class MSenAlrServiceConnection
+    {
+    public: 
+        /**
+        * With this method client can indicate that it wants to start using a new preferred 
+        * connection as a response to PreferredCarrierAvailable() callback.
+        *
+        * @param aUserChoice TRUE(Yes) FALSE (No)
+        * if UserChoice is TRUE then connection will migrated to new carrier
+        * available,         
+        * if UserChoice is FALSE connection will not migrate to new carrier        
+        */
+	    virtual void MigrateToPrefferedCarrierL(TBool &aUserChoice) = 0 ;
+
+        /**
+        * With this method client can indicate that it accepts to use a new preferred 
+        * connection as a response to NewCarrierActive() callback.
+        * 
+        * Earlier the client has received MigrateToPrefferedCarrierL()
+        * callback. Once it has agreed to migrate through NewCarrierAvailable(),
+        * newCarrierActive() callback will be invoked in order
+        * to get acceptance from the application.
+        *
+        * @param aUserChoice TRUE(Yes) FALSE (No)
+        * if UserChoice is TRUE then new Carrier will be accepted
+        * if UserChoice is FALSE connection will not accept the new carrier        
+        */
+	    virtual void NewCarrierAcceptedL(TBool &aUserChoice) = 0 ;		
+    };    
+    
+#endif //  M_SEN_SERVICE_CONNNECTION_INTERFACES_H   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/Bmarm/SenConnectionTimeoutsTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/Bwins/SenConnectionTimeoutsTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/conf/SenConnectionTimeoutsTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+[Test]
+title SendL_TPAsync1Test_CSenServiceConnection_SendLconnectionisnotinitialized
+create SenConnectionTimeoutsTester obj 
+obj SendL_TPAsync1Test_CSenServiceConnection_SendLconnectionisnotinitialized 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL_TPAsync2Test_CSenServiceConnection_SendLconnectionisnotinitialized
+create SenConnectionTimeoutsTester obj 
+obj SendL_TPAsync2Test_CSenServiceConnection_SendLconnectionisnotinitialized 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/eabi/SenConnectionTimeoutsTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/group/SenConnectionTimeoutsTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senconnectiontimeoutstester 
+*
+*/
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          SenConnectionTimeoutsTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+// Enables Nokia intra hosted AB service endpoint to be used:
+MACRO           VALIMO_ADDRESSBOOK_SERVICE 
+
+//TARGETPATH      ?target_path
+DEFFILE         SenConnectionTimeoutsTester.def
+
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE 
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+USERINCLUDE     ../src
+
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+
+SYSTEMINCLUDE   /epoc32/include/xml
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   /epoc32/include/libc
+SYSTEMINCLUDE   /epoc32/include/libc/sys
+
+USERINCLUDE     ../../../../../inc
+
+SOURCE          SenConnectionTimeoutsTester.cpp
+SOURCE          SenConnectionTimeoutsTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+
+LIBRARY         apparc.lib 
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         eikcoctl.lib 
+LIBRARY         avkon.lib 
+LIBRARY         bafl.lib 
+LIBRARY         eikctl.lib
+LIBRARY         egul.lib 
+LIBRARY         fbscli.lib 
+LIBRARY         PBKENG.LIB 
+LIBRARY         cntmodel.lib 
+LIBRARY         aknskins.lib //for skin sbackground
+LIBRARY         gdi.lib
+
+LIBRARY         XMLFRAMEWORK.lib
+LIBRARY         ecom.lib
+LIBRARY         commdb.lib
+LIBRARY         efsrv.lib
+LIBRARY         estor.lib
+LANG            SC
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+		LIBRARY SenServConn.lib
+		LIBRARY SenServMgr.lib
+		LIBRARY SenMessages.lib
+		LIBRARY SenServDesc.lib
+		LIBRARY SenUtils.lib
+		LIBRARY SenXml.lib
+#else
+		LIBRARY wsServConn.lib
+		LIBRARY wsServMgr.lib
+		LIBRARY wsMessages.lib
+		LIBRARY wsServDesc.lib
+		LIBRARY wsUtils.lib
+		LIBRARY wsXml.lib
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineSerializer.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineSerializer.lib
+#endif
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/group/SenConnectionTimeoutsTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\SenConnectionTimeoutsTester.dll"   -   "c:\Sys\Bin\SenConnectionTimeoutsTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\SenConnectionTimeoutsTester.cfg"-"c:\testing\conf\SenConnectionTimeoutsTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senconnectiontimeoutstester
+*
+*/
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+SenConnectionTimeoutsTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/inc/SenConnectionTimeoutsTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,304 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENCONNECTIONTIMEOUTSTESTER_H
+#define SENCONNECTIONTIMEOUTSTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <MSenServiceConsumer.h>
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenXmlReader.h>
+
+#include <f32file.h>
+#include <e32base.h> // for CActive
+#include <e32std.h>
+#include <unistd.h>
+#include <aknnotewrappers.h> 
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+//  INTERNAL INCLUDES
+namespace
+    {
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    }
+
+enum TUT_CSenConnectionTimeoutsTester
+    {
+    ENotInitialized = 1,
+    EConnectionNotReady,
+    };
+//  FORWARD DECLARATIONS
+class CSenBaseFragment;
+class CSenBaseElement;
+class CSenSoapEnvelope;
+class SenXmlUtils;
+class CSenServiceConnection;
+class CSenXmlReader;
+class CSenDomFragment;
+class CSenXmlServiceDescription;
+class CSenServicePattern;
+class CSenServiceManager;
+class CSenSoapMessage;
+class CSenSoapMessage2;
+
+#include <e32def.h>
+#ifndef NONSHARABLE_CLASS
+    #define NONSHARABLE_CLASS(x) class x
+#endif
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KSenConnectionTimeoutsTesterLogPath, "\\logs\\testframework\\SenConnectionTimeoutsTester\\" ); 
+// Log file
+_LIT( KSenConnectionTimeoutsTesterLogFile, "SenConnectionTimeoutsTester.txt" ); 
+_LIT( KSenConnectionTimeoutsTesterLogFileWithTitle, "SenConnectionTimeoutsTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenConnectionTimeoutsTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+typedef TInt (CSenConnectionTimeoutsTester::* TestFunction)( CStifItemParser&);
+
+// CLASS DECLARATION
+
+/**
+*  CSenConnectionTimeoutsTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenConnectionTimeoutsTester) : public CScriptBase, public MSenServiceConsumer 
+    {
+    public:
+        enum TCallback
+            {
+            ECallbackNone = 0,
+            ECallbackHandleMessage,
+            ECallbackHandleError
+            };
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenConnectionTimeoutsTester* NewL( CTestModuleIf& aTestModuleIf );
+        static CSenConnectionTimeoutsTester* NewL();
+        static CSenConnectionTimeoutsTester* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenConnectionTimeoutsTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenConnectionTimeoutsTester( CTestModuleIf& aTestModuleIf );
+        CSenConnectionTimeoutsTester();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+    private:    // New methods
+    
+            // MService Consumer implementation
+        void HandleMessageL(const TDesC8& aMessage);        
+        void HandleErrorL(const int aErrorCode, const TDesC8& aError);
+        void SetStatus(const TInt aStatus);
+
+        void SetupL();
+
+        void Teardown();
+
+        void ErrorL(TInt aCode);
+
+
+        TInt CSenConnectionTimeoutsTester_TP_Async1(CStifItemParser& aItem);
+        
+        TInt CSenConnectionTimeoutsTester_TP_Async2(CStifItemParser& aItem);     
+        
+        
+        
+        TInt CSenConnectionTimeoutsTester_TP_Send(const TDesC8& aLogFileName,
+                                              const TDesC8& aCustomHttpHeader,
+                                              const TDesC8& aCustomHttpHeaderValue,
+                                              CSenServiceConnection* iServiceConnection);
+                                              
+        TInt CSenConnectionTimeoutsTester_TP_CheckLogs(const TDesC& aLogFilePath,
+                                                   const TDesC8& aCustomHttpHeader,
+                                                   const TDesC8& aCustomHttpHeaderValue);                                    
+                                                   
+        TUint32 SearchIAPIdByName(const TDesC& aIAPName);
+        
+        CSenSoapMessage* CreateAuthRequestLC();
+        
+        CSenSoapMessage2* CreateNewAuthRequestLC();
+        
+        HBufC8* ReadFileL(const TDesC& aFilename);
+        
+        HBufC8* HttpMethodValueFromXmlLC(const TDesC8& aXml);
+        
+        HBufC8* HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                           const TDesC8& aPropertyName);
+                                           
+        void StartActiveScheduler(TInt aNumberOfSentMessages);
+        void StopActiveScheduler();
+
+    private:    // Data
+    TestFunction iMethod;
+        // Pointer to logger
+        CStifLogger * iLog; 
+        
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenXmlServiceDescription*  iSession;
+        CSenServiceConnection*      iServiceConnection;
+        CSenServiceManager*         iManager;
+        CSenXmlReader*              iXmlReader;
+        
+        TInt                        iTransactionId;
+        TInt                        iConnectionState;
+        TBool                       iInitialized;
+        TBool                       iReady;
+        
+        TCallback                   iCallback;
+        HBufC8*                     ipMessage;
+        
+        TInt                        iNumberOfPendingOps;
+        HBufC8*                     ipFrameworkID;
+        
+        TInt                        iErrorCode;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENCONNECTIONTIMEOUTSTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\all_webservices_ido.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/src/SenConnectionTimeoutsTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "SenConnectionTimeoutsTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSenConnectionTimeoutsTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KSenConnectionTimeoutsTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KSenConnectionTimeoutsTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KSenConnectionTimeoutsTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenConnectionTimeoutsTester* CSenConnectionTimeoutsTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CSenConnectionTimeoutsTester* self = new (ELeave) CSenConnectionTimeoutsTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenConnectionTimeoutsTester::~CSenConnectionTimeoutsTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenConnectionTimeoutsTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("SenConnectionTimeoutsTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CSenConnectionTimeoutsTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/src/SenConnectionTimeoutsTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,797 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "SenConnectionTimeoutsTester.h"
+
+//  EXTERNAL INCLUDES
+#include <http.h>
+#include <httperr.h>
+
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenDomFragment.h>
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenSoapEnvelope2.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenXmlUtils.h>
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenHttpTransportProperties.h>
+#include <SenSoapMessage.h>
+#include <SenSoapMessage2.h>
+#include <SenDateUtils.h>
+#include <SenTransportProperties.h>
+
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+#include <xmlengserializer.h>
+
+#include <e32base.h> // for CActive
+#include <aknnotewrappers.h> 
+
+#include <commdb.h>
+
+#include <s32file.h>    // filestream
+#include <e32svr.h>     // fileman
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+namespace 
+    {
+        
+#ifdef AOL_RADIO_SERVICE
+    // AOL redio.etenee.net:9080
+    _LIT8(KWSPContract,         "urn:aol-com:services:radio");
+    _LIT8(KAuthServEndpoint,    "http://radio.etenee.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://radio.etenee.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#elif VALIMO_ADDRESSBOOK_SERVICE
+    // Addressbook service hosted inside Nokia intra by ASP / testing team
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://10.21.32.110/tfs/IDPSSO_IDWSF10");
+    _LIT8(KASProviderID,        "provider01");
+    _LIT8(KTestAuthzID,         "john");
+    _LIT8(KTestPassword,        "password");
+#elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://ys01liw022.partner.yomi.com:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#else // == default (no MACROs defined in .mmp)
+    // Addressbook service hosted by Forum Nokia (accessible from external network)
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09"); aa
+    _LIT8(KAuthServEndpoint,    "http://selma.ndhub.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://selma.ndhub.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "testuser1");
+    _LIT8(KTestPassword,        "testuser1");
+#endif // FN_ADDRESSBOOK_SERVICE
+
+
+    _LIT8(KASContract,              "urn:liberty:as:2004-04");
+    _LIT8(KHttpsEndPoint,           "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" );    
+    
+    _LIT8(KWSIFrameworkID,          "WS-I");
+    _LIT8(KIDWSFFrameworkID,        "ID-WSF");
+    _LIT8(KRESTFrameworkID,         "REST");       
+//    _LIT8(KWsStarFrameworkID,       "WS-STAR");       
+#ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KAddressBookServiceId,    "http://radio.aol.com/xsd/2.0/ns/");
+    _LIT8(KAddressBookContract,     "http://radio.aol.com/xsd/2.0/ns/");
+#else
+    _LIT8(KAddressBookServiceId,    "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAddressBookContract,     "urn:nokia:test:addrbook:2004-09");
+#endif
+    
+#ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+#else
+    //_LIT(KIAPName,                  "Ethernet with Daemon Dynamic IP");
+    //_LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+    _LIT(KIAPName,                  "Ethernet with Daemon Dynamic IP");
+#endif
+    _LIT8(KLoggerFileNameProperty,  "HttpLoggerFileName");
+
+    _LIT(KFileToRead,               "c:\\Logs\\LoggingHttpFilter\\httptrace.xml");
+    _LIT8(KFileName,                "httptrace.xml");
+
+    _LIT8(KHTTPMethodGet,           "GET");
+    _LIT8(KHTTPMethodPost,          "POST");
+    
+//    const TBool MultipleSimultanousRHttpSessionsSupported = EFalse;
+    // If IAP changes all previously sent messages will be canceled.
+    
+    
+    _LIT8(KProxyHost,               "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com
+    const TInt KProxyPort =         8080;
+    
+    }
+
+
+// MACROS
+//#define ?macro ?macro_def
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CSenConnectionTimeoutsTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CSenConnectionTimeoutsTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("SendL_TPAsync1Test_CSenServiceConnection_SendLconnectionisnotinitialized", CSenConnectionTimeoutsTester_TP_Async1),
+		ENTRY("SendL_TPAsync2Test_CSenServiceConnection_SendLconnectionisnotinitialized", CSenConnectionTimeoutsTester_TP_Async2),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+
+// CONSTRUCTION
+//CSenConnectionTimeoutsTester* CSenConnectionTimeoutsTester::NewL()
+//    {
+//    CSenConnectionTimeoutsTester* self = CSenConnectionTimeoutsTester::NewLC();
+//    CleanupStack::Pop();
+
+//    return self;
+//    }
+
+//CSenConnectionTimeoutsTester* CSenConnectionTimeoutsTester::NewLC()
+//    {
+//    CSenConnectionTimeoutsTester* self = new( ELeave ) CSenConnectionTimeoutsTester();
+//    CleanupStack::PushL( self );
+
+//    self->ConstructL();
+
+//    return self;
+//    }
+
+
+// Default constructor
+//CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester():iInitialized(FALSE)
+//    {
+//    }
+      
+// Second phase construct
+//void CSenConnectionTimeoutsTester::ConstructL()
+//    {
+    // The ConstructL from the base class CEUnitTestSuiteClass must be called.
+    // It generates the test case table.
+//    CEUnitTestSuiteClass::ConstructL();
+//    }
+
+//  METHODS
+
+void CSenConnectionTimeoutsTester::HandleMessageL(const TDesC8& aMessage)
+    {
+    iCallback = ECallbackHandleMessage;
+    if ( ipMessage )
+        {
+        delete ipMessage;
+        ipMessage = NULL;
+        }
+    ipMessage = aMessage.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+
+    StopActiveScheduler();
+    }
+
+void CSenConnectionTimeoutsTester::HandleErrorL(const int aErrorCode, const TDesC8& aError)
+    {
+    iCallback = ECallbackHandleError;
+    iErrorCode = aErrorCode;
+    
+    // debugging only - START
+    if( HTTPStatus::IsInformational( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EContinue) && (aStatus < HTTPStatus::EOk))
+        RDebug::Print(_L("- HTTP error code: IS INFORMATION."));
+        }
+    if( HTTPStatus::IsSuccessful( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EOk) && (aStatus < HTTPStatus::EMultipleChoices))
+        RDebug::Print(_L("- HTTP error code: IS SUCCESSFUL."));
+        }
+    if( HTTPStatus::IsRedirection( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EMultipleChoices) && (aStatus < HTTPStatus::EBadRequest))
+        RDebug::Print(_L("- HTTP error code: IS REDIRECTION."));
+        }
+    if( HTTPStatus::IsClientError( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EBadRequest) && (aStatus < HTTPStatus::EInternalServerError))
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }
+    if( HTTPStatus::IsServerError( this->iErrorCode ) )
+        {
+        // if(aStatus >= HTTPStatus::EInternalServerError)
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }    
+    // debuggin only - END
+    
+    if ( ipMessage )
+        {
+        delete ipMessage;
+        ipMessage = NULL;
+        }
+    ipMessage = aError.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+    
+    TBuf<70> errorMessage;
+    _LIT(KErrNotInitialized, "Connection isn't initialized.");
+    
+    switch(aErrorCode) 
+        {
+        case KErrSubmitting:
+            errorMessage = KErrNotInitialized;
+            break;
+        default:
+            break;
+        }   
+
+    StopActiveScheduler();
+    }
+
+void CSenConnectionTimeoutsTester::ErrorL(TInt aCode)
+    {
+    _LIT(KNotReady, "Connection is not ready.");
+    
+    TBuf<70> errorMessage;
+    switch(aCode) 
+        {
+        case EConnectionNotReady:
+            errorMessage = KNotReady;
+            break;
+        default:
+            break;
+        }
+    }
+
+void CSenConnectionTimeoutsTester::SetStatus(const TInt aStatus)
+    {
+    switch(aStatus)
+        {
+        case KSenConnectionStatusNew:
+            break;
+        case KSenConnectionStatusReady:
+            iInitialized = ETrue;
+            break;
+        case KSenConnectionStatusExpired:
+            break;
+        default:
+            TBuf<32> num;
+            num.AppendNum(aStatus);
+            break;
+        }
+
+    if ( aStatus >= KSenConnectionStatusCreateFailed && aStatus <= KSenConnectionStatusMetadataExchange )
+        {
+        if(!iInitialized)
+            {
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, ErrorL(EConnectionNotReady));
+            leaveCode = 0; // not used
+            }
+        iConnectionState = aStatus;
+        StopActiveScheduler();
+        }
+    }
+
+
+void CSenConnectionTimeoutsTester::SetupL(  )
+    {
+    __UHEAP_MARK;
+
+    RFile file;
+    RFs iFsSession;
+    _LIT(KFileName,"c:\\testing\\data\\rest.on");
+    
+   
+    User::LeaveIfError(iFsSession.Connect());
+        
+    TInt fileOP = file.Open(iFsSession,KFileName,EFileRead);
+    if (fileOP == KErrNone) 
+        {
+        RDebug::Print(_L( "Found rest.on file => using RESTful framework" ) ); 
+        file.Close();
+        ipFrameworkID = HBufC8::NewL(KRESTFrameworkID().Length());
+        ipFrameworkID->Des().Append(KRESTFrameworkID);
+        }
+    else
+        {
+        RDebug::Print(_L( "File rest.on not found => defaulting to WS-I" ) ); 
+        ipFrameworkID = HBufC8::NewL(KWSIFrameworkID().Length());
+        ipFrameworkID->Des().Append(KWSIFrameworkID);
+        }
+    iFsSession.Close();
+    
+    iCallback = ECallbackNone;
+    }
+
+void CSenConnectionTimeoutsTester::Teardown(  )
+    {
+    delete ipFrameworkID;
+    ipFrameworkID = NULL;
+    delete ipMessage;
+    ipMessage = NULL;
+    __UHEAP_MARKEND;
+    }
+
+
+
+    
+
+//Befor executing this TC remember to set big enought TimeOut value (10 min.)
+
+TInt CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester_TP_Async1(CStifItemParser& aItem)
+{
+
+    
+    
+    _LIT8(KAsyncEndPoint,           "http://10.21.32.110/sereneHardCoded/WS_Async_002");
+    _LIT8(KCustomHttpHeader,        "CustomHeader");
+    
+    _LIT8(KLogFile,                "httptrace");
+    _LIT(KFileExtension,          ".xml");
+    _LIT8(KCustomHttpHeaderValue,  "AsyncTest_");
+    _LIT(KLogFileToRead,           "c:\\Logs\\LoggingHttpFilter\\httptrace");
+    
+    SetupL();
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAsyncEndPoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+     
+     
+    TBuf8<255> tempLogFile;     
+    TBuf8<255> tempCustomHttpHeaderValue;
+    TBuf<255> tempLogFileToRead;
+    
+    for (TInt i = 1; i <= 8; i++)
+    {
+        tempLogFile.Copy(KLogFile);
+        tempLogFile.AppendNum(i);
+        tempLogFile.Append(KFileExtension);
+    
+        tempCustomHttpHeaderValue.Copy(KCustomHttpHeaderValue);
+        tempCustomHttpHeaderValue.AppendNum(i);
+        
+        tempLogFileToRead.Copy(KLogFileToRead);
+        tempLogFileToRead.AppendNum(i);
+        tempLogFileToRead.Append(KFileExtension);
+        
+        TL(CSenConnectionTimeoutsTester_TP_Send(tempLogFile,KCustomHttpHeader,tempCustomHttpHeaderValue,iServiceConnection) == KErrNone) ;    
+        TL(CSenConnectionTimeoutsTester_TP_CheckLogs( tempLogFileToRead,  KCustomHttpHeader, tempCustomHttpHeaderValue) == KErrNone);     
+        
+    }//for i
+                                                  
+    
+        delete iServiceConnection;
+        iServiceConnection = NULL;
+        Teardown();
+		return KErrNone;    
+    }    
+
+
+
+//Before executing this TC remember to set big enought TimeOut value (10 min.)
+TInt CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester_TP_Async2(CStifItemParser& aItem)
+    {
+    _LIT8(KAsyncEndPoint,           "http://10.21.32.110/sereneHardCoded/WS_Async_002");
+    _LIT8(KCustomHttpHeader,        "CustomHeader");
+    
+    _LIT8(KLogFile,                "httptrace");
+    _LIT(KFileExtension,          ".xml");
+    _LIT8(KCustomHttpHeaderValue,  "AsyncTest_");
+    _LIT(KLogFileToRead,           "c:\\Logs\\LoggingHttpFilter\\httptrace");
+    
+	SetupL();
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAsyncEndPoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    TBuf8<255> tempLogFile;     
+    TBuf8<255> tempCustomHttpHeader;
+    TBuf8<255> tempCustomHttpHeaderValue;
+    TBuf<255> tempLogFileToRead;
+    
+    for (TInt i = 1; i <= 8; i++)
+    {
+        tempLogFile.Copy(KLogFile);
+        tempLogFile.AppendNum(i);
+        tempLogFile.Append(KFileExtension);
+        
+        tempCustomHttpHeader.Copy(KCustomHttpHeader);
+        tempCustomHttpHeader.AppendNum(i);
+    
+        tempCustomHttpHeaderValue.Copy(KCustomHttpHeaderValue);
+        tempCustomHttpHeaderValue.AppendNum(i);
+        
+        tempLogFileToRead.Copy(KLogFileToRead);
+        tempLogFileToRead.AppendNum(i);
+        tempLogFileToRead.Append(KFileExtension);
+        
+        TL(CSenConnectionTimeoutsTester_TP_Send(tempLogFile,tempCustomHttpHeader,tempCustomHttpHeaderValue,iServiceConnection) == KErrNone) ; 
+        TL(CSenConnectionTimeoutsTester_TP_CheckLogs( tempLogFileToRead,  tempCustomHttpHeader, tempCustomHttpHeaderValue) == KErrNone);      
+        
+    }//for i
+                                                  
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+		return KErrNone;     
+     
+    }    
+
+
+TInt CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester_TP_Send(const TDesC8& aLogFileName, const TDesC8& aCustomHttpHeader,
+                                                                const TDesC8& aCustomHttpHeaderValue, CSenServiceConnection* iServiceConnection)
+    {
+    TInt result = KErrNone;
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, aLogFileName);
+    pHttpProperties->SetHttpHeaderL(aCustomHttpHeader, aCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByName(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //RDebug::Print(_L(iCallback == ECallbackHandleMessage);
+    if(iCallback != ECallbackHandleMessage) return KErrGeneral;
+   
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    return result;
+    }  
+    
+    
+TInt CSenConnectionTimeoutsTester::CSenConnectionTimeoutsTester_TP_CheckLogs(const TDesC& aLogFilePath,  const TDesC8& aCustomHttpHeader, const TDesC8& aCustomHttpHeaderValue)
+    {
+    TInt result = KErrNone;
+    HBufC8* pFileContent = ReadFileL(aLogFilePath);
+    //RDebug::Print(_L(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, aCustomHttpHeader);
+    //RDebug::Print(_L(*pValue == aCustomHttpHeaderValue);
+    if (*pValue != aCustomHttpHeaderValue) return KErrNotFound;
+    
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    return result;
+    }
+
+
+HBufC8* CSenConnectionTimeoutsTester::HttpMethodValueFromXmlLC(const TDesC8& aXml)
+    {
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    CSenElement* pTPElement = pRequestElement->Element(_L8("Method"));
+    
+    HBufC8* pRetBuf = pTPElement->Content().AllocL();
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    
+    CleanupStack::PushL(pRetBuf);
+    
+    return pRetBuf;
+    }
+
+HBufC8* CSenConnectionTimeoutsTester::HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                                             const TDesC8& aPropertyName)
+    {
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    HBufC8* pRetBuf = NULL;
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    if ( pRequestElement )
+        {
+        CSenElement* pTPElement = pRequestElement->Element(_L8("TranportProperties"));
+        if ( pTPElement )
+            {
+            CSenElement* pElement = pTPElement->Element(aPropertyName);
+            if ( pElement )
+                {
+                pRetBuf = pElement->Content().AllocL();
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    CleanupStack::PushL(pRetBuf);
+    return pRetBuf;
+    }
+    
+HBufC8* CSenConnectionTimeoutsTester::ReadFileL(const TDesC& aFilename)
+    {
+    RFs fsSession;
+    CleanupClosePushL(fsSession);
+    User::LeaveIfError(fsSession.Connect() == NULL);
+    TEntry entry;
+    User::LeaveIfError(fsSession.Entry(aFilename,entry));
+    HBufC8* pFileContent = NULL;
+    RFileReadStream fileInStream;
+    CleanupClosePushL(fileInStream);
+    if (fileInStream.Open(fsSession,aFilename,EFileRead) == KErrNone)
+        {
+        HBufC8* pTempFileContent = HBufC8::NewLC(entry.iSize+10);
+        TRAPD(error,
+            fileInStream.ReadL((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            );
+            
+        if (!error)
+            {
+            TPtrC8 fileContent((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            pFileContent = fileContent.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pTempFileContent);
+        }
+    CleanupStack::PopAndDestroy(&fileInStream);
+    CleanupStack::PopAndDestroy(&fsSession);
+    return pFileContent;
+    }
+    
+TUint32 CSenConnectionTimeoutsTester::SearchIAPIdByName(const TDesC& aIAPName)
+    {
+    TBool found = EFalse;
+    CCommsDatabase* pDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(pDB);
+    
+    //open internet accesspoint table
+    CCommsDbTableView* pDbTView = pDB->OpenTableLC(TPtrC(IAP));
+    TInt retVal = pDbTView->GotoFirstRecord();
+    TBuf<128> name; 
+    TUint32 id = 0;
+    //Find the correct record
+    while ( retVal == KErrNone && found == EFalse )
+        {
+        pDbTView->ReadTextL(TPtrC(COMMDB_NAME), name);
+        pDbTView->ReadUintL(TPtrC(COMMDB_ID), id);
+        found = ( name == aIAPName ); 
+        if ( !found )
+            {
+            retVal = pDbTView->GotoNextRecord();
+            }
+        }
+    CleanupStack::PopAndDestroy(pDbTView);
+    CleanupStack::PopAndDestroy(pDB);
+    return id;
+    }
+    
+CSenSoapMessage* CSenConnectionTimeoutsTester::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+     
+CSenSoapMessage2* CSenConnectionTimeoutsTester::CreateNewAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    /*CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    //pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);*/
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+    
+void CSenConnectionTimeoutsTester::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+void CSenConnectionTimeoutsTester::StopActiveScheduler()
+    {
+    iNumberOfPendingOps--;
+    if ( iNumberOfPendingOps == 0 )
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSenConnectionTimeoutsTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CSenConnectionTimeoutsTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/Bmarm/SenLayeredPropertiesTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/Bwins/SenLayeredPropertiesTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/conf/SenLayeredPropertiesTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,532 @@
+[Test]
+title HTTPTPP-CloneL-test_CSenLayeredXmlProperties_CloneL
+create SenLayeredPropertiesTester obj 
+obj HTTPTPP-CloneL-test_CSenLayeredXmlProperties_CloneL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewL-test_CSenLayeredHttpTransportProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj TPP-NewL-test_CSenLayeredHttpTransportProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewL-test_CSenLayeredTransportProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj TPP-NewL-test_CSenLayeredTransportProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewLC-test_CSenLayeredTransportProperties_NewLC
+create SenLayeredPropertiesTester obj 
+obj TPP-NewLC-test_CSenLayeredTransportProperties_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewL-test_CSenLayeredTransportProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj TPP-NewL-test_CSenLayeredTransportProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewLC-test_CSenLayeredTransportProperties_NewLC
+create SenLayeredPropertiesTester obj 
+obj TPP-NewLC-test_CSenLayeredTransportProperties_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewL-test_CSenLayeredTransportProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj TPP-NewL-test_CSenLayeredTransportProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-NewLC-test_CSenLayeredTransportProperties_NewLC
+create SenLayeredPropertiesTester obj 
+obj TPP-NewLC-test_CSenLayeredTransportProperties_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetReader-test_CSenLayeredTransportProperties_SetReader
+create SenLayeredPropertiesTester obj 
+obj TPP-SetReader-test_CSenLayeredTransportProperties_SetReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertiesClassType-test_CSenLayeredTransportProperties_PropertiesClassType
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertiesClassType-test_CSenLayeredTransportProperties_PropertiesClassType 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-WriteToL-test_CSenLayeredTransportProperties_WriteToL
+create SenLayeredPropertiesTester obj 
+obj TPP-WriteToL-test_CSenLayeredTransportProperties_WriteToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-ReadFromL-test_CSenLayeredTransportProperties_ReadFromL
+create SenLayeredPropertiesTester obj 
+obj TPP-ReadFromL-test_CSenLayeredTransportProperties_ReadFromL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-AsUtf8L-test_CSenLayeredTransportProperties_AsUtf8L
+create SenLayeredPropertiesTester obj 
+obj TPP-AsUtf8L-test_CSenLayeredTransportProperties_AsUtf8L 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-AsUtf8LC-test_CSenLayeredTransportProperties_AsUtf8LC
+create SenLayeredPropertiesTester obj 
+obj TPP-AsUtf8LC-test_CSenLayeredTransportProperties_AsUtf8LC 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetIntPropertyL-test_CSenLayeredTransportProperties_SetIntPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetIntPropertyL-test_CSenLayeredTransportProperties_SetIntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-IntPropertyL-test_CSenLayeredTransportProperties_IntPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-IntPropertyL-test_CSenLayeredTransportProperties_IntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetBoolPropertyL-test_CSenLayeredTransportProperties_SetBoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetBoolPropertyL-test_CSenLayeredTransportProperties_SetBoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-BoolPropertyL-test_CSenLayeredTransportProperties_BoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-BoolPropertyL-test_CSenLayeredTransportProperties_BoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-WriteToL-test_CSenLayeredTransportProperties_WriteToL
+create SenLayeredPropertiesTester obj 
+obj TPP-WriteToL-test_CSenLayeredTransportProperties_WriteToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-ReadFromL-test_CSenLayeredTransportProperties_ReadFromL
+create SenLayeredPropertiesTester obj 
+obj TPP-ReadFromL-test_CSenLayeredTransportProperties_ReadFromL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-AsUtf8L-test_CSenLayeredTransportProperties_AsUtf8L
+create SenLayeredPropertiesTester obj 
+obj TPP-AsUtf8L-test_CSenLayeredTransportProperties_AsUtf8L 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-AsUtf8LC-test_CSenLayeredTransportProperties_AsUtf8LC
+create SenLayeredPropertiesTester obj 
+obj TPP-AsUtf8LC-test_CSenLayeredTransportProperties_AsUtf8LC 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-ShrinkTo-test_CSenLayeredTransportProperties_ShrinkTo
+create SenLayeredPropertiesTester obj 
+obj TPP-ShrinkTo-test_CSenLayeredTransportProperties_ShrinkTo 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-ExpandToL-test_CSenLayeredTransportProperties_ExpandToL
+create SenLayeredPropertiesTester obj 
+obj TPP-ExpandToL-test_CSenLayeredTransportProperties_ExpandToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-TopLayer-test_CSenLayeredTransportProperties_TopLayer
+create SenLayeredPropertiesTester obj 
+obj TPP-TopLayer-test_CSenLayeredTransportProperties_TopLayer 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertiesByTypeL-test_CSenLayeredTransportProperties_PropertiesByTypeL
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertiesByTypeL-test_CSenLayeredTransportProperties_PropertiesByTypeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetIntPropertyL-test_CSenLayeredTransportProperties_SetIntPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetIntPropertyL-test_CSenLayeredTransportProperties_SetIntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-IntPropertyL-test_CSenLayeredTransportProperties_IntPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-IntPropertyL-test_CSenLayeredTransportProperties_IntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetBoolPropertyL-test_CSenLayeredTransportProperties_SetBoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetBoolPropertyL-test_CSenLayeredTransportProperties_SetBoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-BoolPropertyL-test_CSenLayeredTransportProperties_BoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-BoolPropertyL-test_CSenLayeredTransportProperties_BoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title TPP-CloneL-test_CSenLayeredXmlProperties_CloneL
+create SenLayeredPropertiesTester obj 
+obj TPP-CloneL-test_CSenLayeredXmlProperties_CloneL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-NewL-test_CSenLayeredXmlProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj XmlP-NewL-test_CSenLayeredXmlProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-NewLC-test_CSenLayeredXmlProperties_NewLC
+create SenLayeredPropertiesTester obj 
+obj XmlP-NewLC-test_CSenLayeredXmlProperties_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-NewL1-test_CSenLayeredXmlProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj XmlP-NewL1-test_CSenLayeredXmlProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-NewLC1-test_CSenLayeredXmlProperties_NewLC
+create SenLayeredPropertiesTester obj 
+obj XmlP-NewLC1-test_CSenLayeredXmlProperties_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-NewL2-test_CSenLayeredXmlProperties_NewL
+create SenLayeredPropertiesTester obj 
+obj XmlP-NewL2-test_CSenLayeredXmlProperties_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-NewLC2-test_CSenLayeredXmlProperties_NewLC
+create SenLayeredPropertiesTester obj 
+obj XmlP-NewLC2-test_CSenLayeredXmlProperties_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetReader-test_CSenLayeredXmlProperties_SetReader
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetReader-test_CSenLayeredXmlProperties_SetReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertiesClassType-test_CSenLayeredXmlProperties_PropertiesClassType
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertiesClassType-test_CSenLayeredXmlProperties_PropertiesClassType 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-WriteToL-test_CSenLayeredXmlProperties_WriteToL
+create SenLayeredPropertiesTester obj 
+obj XmlP-WriteToL-test_CSenLayeredXmlProperties_WriteToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-ReadFromL-test_CSenLayeredXmlProperties_ReadFromL
+create SenLayeredPropertiesTester obj 
+obj XmlP-ReadFromL-test_CSenLayeredXmlProperties_ReadFromL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-AsUtf8L-test_CSenLayeredXmlProperties_AsUtf8L
+create SenLayeredPropertiesTester obj 
+obj XmlP-AsUtf8L-test_CSenLayeredXmlProperties_AsUtf8L 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-AsUtf8LC-test_CSenLayeredXmlProperties_AsUtf8LC
+create SenLayeredPropertiesTester obj 
+obj XmlP-AsUtf8LC-test_CSenLayeredXmlProperties_AsUtf8LC 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetIntPropertyL-test_CSenLayeredXmlProperties_SetIntPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetIntPropertyL-test_CSenLayeredXmlProperties_SetIntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-IntPropertyL-test_CSenLayeredXmlProperties_IntPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-IntPropertyL-test_CSenLayeredXmlProperties_IntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetBoolPropertyL-test_CSenLayeredXmlProperties_SetBoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetBoolPropertyL-test_CSenLayeredXmlProperties_SetBoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-BoolPropertyL-test_CSenLayeredXmlProperties_BoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-BoolPropertyL-test_CSenLayeredXmlProperties_BoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-WriteToL-test_CSenLayeredXmlProperties_WriteToL
+create SenLayeredPropertiesTester obj 
+obj XmlP-WriteToL-test_CSenLayeredXmlProperties_WriteToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-ReadFromL-test_CSenLayeredXmlProperties_ReadFromL
+create SenLayeredPropertiesTester obj 
+obj XmlP-ReadFromL-test_CSenLayeredXmlProperties_ReadFromL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-AsUtf8L-test_CSenLayeredXmlProperties_AsUtf8L
+create SenLayeredPropertiesTester obj 
+obj XmlP-AsUtf8L-test_CSenLayeredXmlProperties_AsUtf8L 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-AsUtf8LC-test_CSenLayeredXmlProperties_AsUtf8LC
+create SenLayeredPropertiesTester obj 
+obj XmlP-AsUtf8LC-test_CSenLayeredXmlProperties_AsUtf8LC 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-ShrinkTo-test_CSenLayeredXmlProperties_ShrinkTo
+create SenLayeredPropertiesTester obj 
+obj XmlP-ShrinkTo-test_CSenLayeredXmlProperties_ShrinkTo 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-ExpandToL-test_CSenLayeredXmlProperties_ExpandToL
+create SenLayeredPropertiesTester obj 
+obj XmlP-ExpandToL-test_CSenLayeredXmlProperties_ExpandToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-TopLayer-test_CSenLayeredXmlProperties_TopLayer
+create SenLayeredPropertiesTester obj 
+obj XmlP-TopLayer-test_CSenLayeredXmlProperties_TopLayer 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-PropertiesByTypeL-test_CSenLayeredXmlProperties_PropertiesByTypeL
+create SenLayeredPropertiesTester obj 
+obj XmlP-PropertiesByTypeL-test_CSenLayeredXmlProperties_PropertiesByTypeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetIntPropertyL-test_CSenLayeredXmlProperties_SetIntPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetIntPropertyL-test_CSenLayeredXmlProperties_SetIntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-IntPropertyL-test_CSenLayeredXmlProperties_IntPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-IntPropertyL-test_CSenLayeredXmlProperties_IntPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-CloneL-test_CSenLayeredXmlProperties_CloneL
+create SenLayeredPropertiesTester obj 
+obj XmlP-CloneL-test_CSenLayeredXmlProperties_CloneL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-SetBoolPropertyL-test_CSenLayeredXmlProperties_SetBoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-SetBoolPropertyL-test_CSenLayeredXmlProperties_SetBoolPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlP-BoolPropertyL-test_CSenLayeredXmlProperties_BoolPropertyL
+create SenLayeredPropertiesTester obj 
+obj XmlP-BoolPropertyL-test_CSenLayeredXmlProperties_BoolPropertyL 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/eabi/SenLayeredPropertiesTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI24CSenLayeredXmlProperties @ 2 NONAME ; #<TI>#
+	_ZTV24CSenLayeredXmlProperties @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/group/SenLayeredPropertiesTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senlayeredpropertiestester 
+*
+*/
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+TARGET          SenLayeredPropertiesTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+#ifdef EKA2
+		    EPOCALLOWDLLDATA
+#endif // EKA2
+//TARGETPATH      ?target_path
+DEFFILE         SenLayeredPropertiesTester.def
+// Sources needed by the test
+SOURCEPATH              ../../../../../webservices/wsframework/src
+//SOURCE                  SenLayeredTransportProperties.cpp
+//SOURCE                  SenLayeredHttpTransportProperties.cpp
+SOURCE                  senlayeredxmlproperties.cpp
+
+USERINCLUDE             ../../../../../webservices/wsframework/inc
+USERINCLUDE             ../../../../../webservices/wsutils/inc
+USERINCLUDE             ../../../../../webservices/wsxml/inc
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE 
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE
+SOURCE          SenLayeredPropertiesTester.cpp
+SOURCE          SenLayeredPropertiesTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY                 ecom.lib
+LIBRARY                 estor.lib
+LIBRARY                 flogger.lib
+LIBRARY                 bafl.lib    // RStringPool
+LIBRARY   efsrv.lib 
+LANG            SC
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+		LIBRARY SenServDesc.lib
+		LIBRARY SenUtils.lib
+		LIBRARY SenXml.lib
+		LIBRARY SenFramework.lib
+#else
+		LIBRARY wsServDesc.lib
+		LIBRARY wsUtils.lib
+		LIBRARY wsXml.lib
+		LIBRARY wsFramework.lib
+#endif
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/group/SenLayeredPropertiesTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\SenLayeredPropertiesTester.dll"   -   "c:\Sys\Bin\SenLayeredPropertiesTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\SenLayeredPropertiesTester.cfg"-"c:\testing\conf\SenLayeredPropertiesTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senlayeredpropertiestester
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+SenLayeredPropertiesTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/inc/SenLayeredPropertiesTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,397 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENLAYEREDPROPERTIESTESTER_H
+#define SENLAYEREDPROPERTIESTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KSenLayeredPropertiesTesterLogPath, "\\logs\\testframework\\SenLayeredPropertiesTester\\" ); 
+// Log file
+_LIT( KSenLayeredPropertiesTesterLogFile, "SenLayeredPropertiesTester.txt" ); 
+_LIT( KSenLayeredPropertiesTesterLogFileWithTitle, "SenLayeredPropertiesTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+class CSenLayeredHttpTransportProperties;
+class CSenLayeredXmlProperties;
+class CSenLayeredTransportProperties;
+
+#include <e32def.h>
+#ifndef NONSHARABLE_CLASS
+    #define NONSHARABLE_CLASS(x) class x
+#endif
+//class ?FORWARD_CLASSNAME;
+class CSenLayeredPropertiesTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CSenLayeredPropertiesTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenLayeredPropertiesTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenLayeredPropertiesTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenLayeredPropertiesTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenLayeredPropertiesTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+
+         TInt UT_CSenLayeredHttpTransportProperties_CloneLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredHttpTransportProperties_NewLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_NewLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_NewLCL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_NewL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_NewLC_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_NewL_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_NewLC_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetReaderL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertiesClassTypeL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_WriteToLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_ReadFromLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_AsUtf8LL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_AsUtf8LCL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetIntPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_IntPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetBoolPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_BoolPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_WriteToL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_ReadFromL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_AsUtf8L_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_AsUtf8LC_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_ShrinkToL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_ExpandToLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_TopLayerL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertyL_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertyL_3L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertiesByTypeLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetIntPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_IntPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetBoolPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_BoolPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_SetPropertyL_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_PropertyL_4L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredTransportProperties_CloneLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_NewLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_NewLCL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_NewL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_NewLC_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_NewL_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_NewLC_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetReaderL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertiesClassTypeL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_WriteToLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_ReadFromLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_AsUtf8LL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_AsUtf8LCL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetIntPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_IntPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetBoolPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_BoolPropertyLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_WriteToL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_ReadFromL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_AsUtf8L_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_AsUtf8LC_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_ShrinkToL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_ExpandToLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_TopLayerL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertyL_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertyL_3L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetPropertyL_2L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertyL_4L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_PropertiesByTypeLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetIntPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_IntPropertyL_1L(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_CloneLL(CStifItemParser& aItem);
+
+
+         TInt UT_CSenLayeredXmlProperties_SetBoolPropertyL_1L(CStifItemParser& aItem);
+
+
+         void UT_CSenLayeredXmlProperties_BoolPropertyL_1L(CStifItemParser& aItem);
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    };
+
+#endif      // SENLAYEREDPROPERTIESTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\SenLayeredPropertiesTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/src/SenLayeredPropertiesTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "SenLayeredPropertiesTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::CSenLayeredPropertiesTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenLayeredPropertiesTester::CSenLayeredPropertiesTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSenLayeredPropertiesTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KSenLayeredPropertiesTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KSenLayeredPropertiesTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KSenLayeredPropertiesTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenLayeredPropertiesTester* CSenLayeredPropertiesTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CSenLayeredPropertiesTester* self = new (ELeave) CSenLayeredPropertiesTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenLayeredPropertiesTester::~CSenLayeredPropertiesTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenLayeredPropertiesTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("SenLayeredPropertiesTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CSenLayeredPropertiesTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/SenLayeredPropertiesTester/src/SenLayeredPropertiesTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1134 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+//  INTERNAL INCLUDES
+#include <e32debug.h>
+#include <e32base.h>
+#include <StifTestInterface.h>
+#include "senlayeredhttptransportproperties.h"
+#include "senlayeredtransportproperties.h"
+#include "senlayeredxmlproperties.h"
+#include "SenLayeredPropertiesTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CSenLayeredPropertiesTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CSenLayeredPropertiesTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("HTTPTPP-CloneL-test_CSenLayeredXmlProperties_CloneL", CSenLayeredPropertiesTester::UT_CSenLayeredHttpTransportProperties_CloneLL),
+		ENTRY("TPP-NewL-test_CSenLayeredHttpTransportProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredHttpTransportProperties_NewLL),
+		ENTRY("TPP-NewL-test_CSenLayeredTransportProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLL),
+		ENTRY("TPP-NewLC-test_CSenLayeredTransportProperties_NewLC", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLCL),
+		ENTRY("TPP-NewL-test_CSenLayeredTransportProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewL_1L),
+		ENTRY("TPP-NewLC-test_CSenLayeredTransportProperties_NewLC", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLC_1L),
+		ENTRY("TPP-NewL-test_CSenLayeredTransportProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewL_2L),
+		ENTRY("TPP-NewLC-test_CSenLayeredTransportProperties_NewLC", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLC_2L),
+		ENTRY("TPP-SetReader-test_CSenLayeredTransportProperties_SetReader", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetReaderL),
+		ENTRY("TPP-PropertiesClassType-test_CSenLayeredTransportProperties_PropertiesClassType", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertiesClassTypeL),
+		ENTRY("TPP-WriteToL-test_CSenLayeredTransportProperties_WriteToL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_WriteToLL),
+		ENTRY("TPP-ReadFromL-test_CSenLayeredTransportProperties_ReadFromL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ReadFromLL),
+		ENTRY("TPP-AsUtf8L-test_CSenLayeredTransportProperties_AsUtf8L", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8LL),
+		ENTRY("TPP-AsUtf8LC-test_CSenLayeredTransportProperties_AsUtf8LC", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8LCL),
+		ENTRY("TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetPropertyLL),
+		ENTRY("TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyLL),
+		ENTRY("TPP-SetIntPropertyL-test_CSenLayeredTransportProperties_SetIntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetIntPropertyLL),
+		ENTRY("TPP-IntPropertyL-test_CSenLayeredTransportProperties_IntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_IntPropertyLL),
+		ENTRY("TPP-SetBoolPropertyL-test_CSenLayeredTransportProperties_SetBoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetBoolPropertyLL),
+		ENTRY("TPP-BoolPropertyL-test_CSenLayeredTransportProperties_BoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_BoolPropertyLL),
+		ENTRY("TPP-WriteToL-test_CSenLayeredTransportProperties_WriteToL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_WriteToL_1L),
+		ENTRY("TPP-ReadFromL-test_CSenLayeredTransportProperties_ReadFromL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ReadFromL_1L),
+		ENTRY("TPP-AsUtf8L-test_CSenLayeredTransportProperties_AsUtf8L", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8L_1L),
+		ENTRY("TPP-AsUtf8LC-test_CSenLayeredTransportProperties_AsUtf8LC", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8LC_1L),
+		ENTRY("TPP-ShrinkTo-test_CSenLayeredTransportProperties_ShrinkTo", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ShrinkToL),
+		ENTRY("TPP-ExpandToL-test_CSenLayeredTransportProperties_ExpandToL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ExpandToLL),
+		ENTRY("TPP-TopLayer-test_CSenLayeredTransportProperties_TopLayer", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_TopLayerL),
+		ENTRY("TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetPropertyL_1L),
+		ENTRY("TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_1L),
+		ENTRY("TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_2L),
+		ENTRY("TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_3L),
+		ENTRY("TPP-PropertiesByTypeL-test_CSenLayeredTransportProperties_PropertiesByTypeL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertiesByTypeLL),
+		ENTRY("TPP-SetIntPropertyL-test_CSenLayeredTransportProperties_SetIntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetIntPropertyL_1L),
+		ENTRY("TPP-IntPropertyL-test_CSenLayeredTransportProperties_IntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_IntPropertyL_1L),
+		ENTRY("TPP-SetBoolPropertyL-test_CSenLayeredTransportProperties_SetBoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetBoolPropertyL_1L),
+		ENTRY("TPP-BoolPropertyL-test_CSenLayeredTransportProperties_BoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_BoolPropertyL_1L),
+		ENTRY("TPP-SetPropertyL-test_CSenLayeredTransportProperties_SetPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetPropertyL_2L),
+		ENTRY("TPP-PropertyL-test_CSenLayeredTransportProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_4L),
+		ENTRY("TPP-CloneL-test_CSenLayeredXmlProperties_CloneL", CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_CloneLL),
+		ENTRY("XmlP-NewL-test_CSenLayeredXmlProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLL),
+		ENTRY("XmlP-NewLC-test_CSenLayeredXmlProperties_NewLC", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLCL),
+		ENTRY("XmlP-NewL1-test_CSenLayeredXmlProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewL_1L),
+		ENTRY("XmlP-NewLC1-test_CSenLayeredXmlProperties_NewLC", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLC_1L),
+		ENTRY("XmlP-NewL2-test_CSenLayeredXmlProperties_NewL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewL_2L),
+		ENTRY("XmlP-NewLC2-test_CSenLayeredXmlProperties_NewLC", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLC_2L),
+		ENTRY("XmlP-SetReader-test_CSenLayeredXmlProperties_SetReader", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetReaderL),
+		ENTRY("XmlP-PropertiesClassType-test_CSenLayeredXmlProperties_PropertiesClassType", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertiesClassTypeL),
+		ENTRY("XmlP-WriteToL-test_CSenLayeredXmlProperties_WriteToL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_WriteToLL),
+		ENTRY("XmlP-ReadFromL-test_CSenLayeredXmlProperties_ReadFromL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ReadFromLL),
+		ENTRY("XmlP-AsUtf8L-test_CSenLayeredXmlProperties_AsUtf8L", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8LL),
+		ENTRY("XmlP-AsUtf8LC-test_CSenLayeredXmlProperties_AsUtf8LC", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8LCL),
+		ENTRY("XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetPropertyLL),
+		ENTRY("XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyLL),
+		ENTRY("XmlP-SetIntPropertyL-test_CSenLayeredXmlProperties_SetIntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetIntPropertyLL),
+		ENTRY("XmlP-IntPropertyL-test_CSenLayeredXmlProperties_IntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_IntPropertyLL),
+		ENTRY("XmlP-SetBoolPropertyL-test_CSenLayeredXmlProperties_SetBoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetBoolPropertyLL),
+		ENTRY("XmlP-BoolPropertyL-test_CSenLayeredXmlProperties_BoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_BoolPropertyLL),
+		ENTRY("XmlP-WriteToL-test_CSenLayeredXmlProperties_WriteToL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_WriteToL_1L),
+		ENTRY("XmlP-ReadFromL-test_CSenLayeredXmlProperties_ReadFromL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ReadFromL_1L),
+		ENTRY("XmlP-AsUtf8L-test_CSenLayeredXmlProperties_AsUtf8L", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8L_1L),
+		ENTRY("XmlP-AsUtf8LC-test_CSenLayeredXmlProperties_AsUtf8LC", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8LC_1L),
+		ENTRY("XmlP-ShrinkTo-test_CSenLayeredXmlProperties_ShrinkTo", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ShrinkToL),
+		ENTRY("XmlP-ExpandToL-test_CSenLayeredXmlProperties_ExpandToL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ExpandToLL),
+		ENTRY("XmlP-TopLayer-test_CSenLayeredXmlProperties_TopLayer", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_TopLayerL),
+		ENTRY("XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetPropertyL_1L),
+		ENTRY("XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_1L),
+		ENTRY("XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_2L),
+		ENTRY("XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_3L),
+		ENTRY("XmlP-SetPropertyL-test_CSenLayeredXmlProperties_SetPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetPropertyL_2L),
+		ENTRY("XmlP-PropertyL-test_CSenLayeredXmlProperties_PropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_4L),
+		ENTRY("XmlP-PropertiesByTypeL-test_CSenLayeredXmlProperties_PropertiesByTypeL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertiesByTypeLL),
+		ENTRY("XmlP-SetIntPropertyL-test_CSenLayeredXmlProperties_SetIntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetIntPropertyL_1L),
+		ENTRY("XmlP-IntPropertyL-test_CSenLayeredXmlProperties_IntPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_IntPropertyL_1L),
+		ENTRY("XmlP-CloneL-test_CSenLayeredXmlProperties_CloneL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_CloneLL),
+		ENTRY("XmlP-SetBoolPropertyL-test_CSenLayeredXmlProperties_SetBoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetBoolPropertyL_1L),
+		ENTRY("XmlP-BoolPropertyL-test_CSenLayeredXmlProperties_BoolPropertyL", CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_BoolPropertyL_1L),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+//  METHODS
+
+    
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredHttpTransportProperties_CloneLL(CStifItemParser& aItem)
+    {
+    _LIT8(KOutputString, "<Properties><PropertyName6>PropertyValue6</PropertyName6>\
+<PropertyName5>PropertyValue5</PropertyName5>\
+<PropertyName4>PropertyValue4</PropertyName4>\
+<PropertyName3>PropertyValue3</PropertyName3>\
+<PropertyName2>PropertyValue2</PropertyName2>\
+<PropertyName1>PropertyValue1</PropertyName1></Properties>");
+    
+    CSenLayeredHttpTransportProperties* pProperties = CSenLayeredHttpTransportProperties::NewLC();
+    
+    // Create properties for all 6 leayers
+    pProperties->SetPropertyL(_L8("PropertyName1"), _L8("PropertyValue1"),
+                              MSenLayeredProperties::ESenTransportLayer);
+    pProperties->SetPropertyL(_L8("PropertyName2"), _L8("PropertyValue2"),
+                              MSenLayeredProperties::ESenSereneLayer);
+    pProperties->SetPropertyL(_L8("PropertyName3"), _L8("PropertyValue3"),
+                              MSenLayeredProperties::ESenFrameworkLayer);
+    pProperties->SetPropertyL(_L8("PropertyName4"), _L8("PropertyValue4"),
+                              MSenLayeredProperties::ESenProviderSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName5"), _L8("PropertyValue5"),
+                              MSenLayeredProperties::ESenConsumerSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName6"), _L8("PropertyValue6"),
+                              MSenLayeredProperties::ESenMessageLayer);
+                              
+    HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CSenLayeredHttpTransportProperties* pProperties2 = (CSenLayeredHttpTransportProperties*)pProperties->CloneL();
+    // Destroy cloned properties immediately after cloning
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PushL(pProperties2);
+
+    pAsXml = pProperties2->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pProperties2);
+    
+    // Test Layered Properties and StringPool
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+    pProperties = CSenLayeredHttpTransportProperties::NewLC(stringPool);
+    
+    // Create properties for all 6 leayers
+    pProperties->SetPropertyL(_L8("PropertyName1"), _L8("PropertyValue1"),
+                              MSenLayeredProperties::ESenTransportLayer);
+    pProperties->SetPropertyL(_L8("PropertyName2"), _L8("PropertyValue2"),
+                              MSenLayeredProperties::ESenSereneLayer);
+    pProperties->SetPropertyL(_L8("PropertyName3"), _L8("PropertyValue3"),
+                              MSenLayeredProperties::ESenFrameworkLayer);
+    pProperties->SetPropertyL(_L8("PropertyName4"), _L8("PropertyValue4"),
+                              MSenLayeredProperties::ESenProviderSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName5"), _L8("PropertyValue5"),
+                              MSenLayeredProperties::ESenConsumerSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName6"), _L8("PropertyValue6"),
+                              MSenLayeredProperties::ESenMessageLayer);
+
+    TPtrC8 propertyValue;                              
+    pProperties->PropertyL(_L8("PropertyName1"), propertyValue);
+                              
+    pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TInt error;
+    pProperties2 = (CSenLayeredHttpTransportProperties*)pProperties->Clone(error);
+    LOCAL_ASSERT( error == KErrNone );
+    // Destroy cloned properties immediately after cloning
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PushL(pProperties2);
+
+    pAsXml = pProperties2->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties2);
+    
+    CleanupStack::PopAndDestroy(&stringPool);
+    
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredHttpTransportProperties_NewLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLCL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLC_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewL_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_NewLC_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetReaderL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertiesClassTypeL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_WriteToLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ReadFromLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8LL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8LCL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetIntPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_IntPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetBoolPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_BoolPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_WriteToL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ReadFromL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8L_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_AsUtf8LC_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ShrinkToL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_ExpandToLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_TopLayerL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_3L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertiesByTypeLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetIntPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_IntPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetBoolPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_BoolPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_SetPropertyL_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_PropertyL_4L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+    
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredTransportProperties_CloneLL(CStifItemParser& aItem)
+    {
+    _LIT8(KOutputString, "<Properties><PropertyName6>PropertyValue6</PropertyName6>\
+<PropertyName5>PropertyValue5</PropertyName5>\
+<PropertyName4>PropertyValue4</PropertyName4>\
+<PropertyName3>PropertyValue3</PropertyName3>\
+<PropertyName2>PropertyValue2</PropertyName2>\
+<PropertyName1>PropertyValue1</PropertyName1></Properties>"); 
+    
+    CSenLayeredTransportProperties* pProperties = CSenLayeredTransportProperties::NewLC();
+    
+    // Create properties for all 6 leayers
+    pProperties->SetPropertyL(_L8("PropertyName1"), _L8("PropertyValue1"),
+                              MSenLayeredProperties::ESenTransportLayer);
+    pProperties->SetPropertyL(_L8("PropertyName2"), _L8("PropertyValue2"),
+                              MSenLayeredProperties::ESenSereneLayer);
+    pProperties->SetPropertyL(_L8("PropertyName3"), _L8("PropertyValue3"),
+                              MSenLayeredProperties::ESenFrameworkLayer);
+    pProperties->SetPropertyL(_L8("PropertyName4"), _L8("PropertyValue4"),
+                              MSenLayeredProperties::ESenProviderSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName5"), _L8("PropertyValue5"),
+                              MSenLayeredProperties::ESenConsumerSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName6"), _L8("PropertyValue6"),
+                              MSenLayeredProperties::ESenMessageLayer);
+                              
+    HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CSenLayeredTransportProperties* pProperties2 = (CSenLayeredTransportProperties*)pProperties->CloneL();
+    // Destroy cloned properties immediately after cloning
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PushL(pProperties2);
+
+    pAsXml = pProperties2->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pProperties2);
+    
+    // Test Layered Properties and StringPool
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+    pProperties = CSenLayeredTransportProperties::NewLC(stringPool);
+    
+    // Create properties for all 6 leayers
+    pProperties->SetPropertyL(_L8("PropertyName1"), _L8("PropertyValue1"),
+                              MSenLayeredProperties::ESenTransportLayer);
+    pProperties->SetPropertyL(_L8("PropertyName2"), _L8("PropertyValue2"),
+                              MSenLayeredProperties::ESenSereneLayer);
+    pProperties->SetPropertyL(_L8("PropertyName3"), _L8("PropertyValue3"),
+                              MSenLayeredProperties::ESenFrameworkLayer);
+    pProperties->SetPropertyL(_L8("PropertyName4"), _L8("PropertyValue4"),
+                              MSenLayeredProperties::ESenProviderSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName5"), _L8("PropertyValue5"),
+                              MSenLayeredProperties::ESenConsumerSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName6"), _L8("PropertyValue6"),
+                              MSenLayeredProperties::ESenMessageLayer);
+
+    TPtrC8 propertyValue;                              
+    pProperties->PropertyL(_L8("PropertyName1"), propertyValue);
+                              
+    pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    pProperties2 = (CSenLayeredTransportProperties*)pProperties->CloneL();
+    // Destroy cloned properties immediately after cloning
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PushL(pProperties2);
+
+    pAsXml = pProperties2->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties2);
+    
+    CleanupStack::PopAndDestroy(&stringPool);
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLL(CStifItemParser& aItem)
+    {
+    _LIT8(KInputString, "<Properties>\
+<Element1>öKissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KOutputString, "<Properties>\
+<Element1>öKissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KInputString1, "<Properties>\
+<Element1>äveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KOutputString1, "<Properties>\
+<Element1>äveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+	CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewL();
+	CleanupStack::PushL(pProperties);
+	
+	pProperties->ReadFromL(KInputString);
+	
+	HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+    // Test CSenLayeredXmlProperties when RStringPool is used
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+	pProperties = CSenLayeredXmlProperties::NewL(stringPool);
+	CleanupStack::PushL(pProperties);
+	
+	pProperties->ReadFromL(KInputString);
+	
+	pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+    CleanupStack::PopAndDestroy(&stringPool);
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLCL(CStifItemParser& aItem)
+    {
+    _LIT8(KInputString, "<Properties>\
+<Element1>öKissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KOutputString, "<Properties>\
+<Element1>öKissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+	CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewLC();
+	
+	pProperties->ReadFromL(KInputString);
+	
+	HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+	pProperties = CSenLayeredXmlProperties::NewLC(stringPool);
+	
+	pProperties->ReadFromL(KInputString);
+	
+	pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+    CleanupStack::PopAndDestroy(&stringPool);
+    
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewL_1L(CStifItemParser& aItem)
+    {
+    _LIT8(KInputString, "<Properties>\
+<Element1>Kissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KOutputString, "<Properties>\
+<Element1>Kissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    CSenXmlReader* pReader = CSenXmlReader::NewLC();
+
+	CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewL(KInputString, *pReader);
+	CleanupStack::PushL(pProperties);
+	
+	HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+    // Test CSenLayeredXmlProperties when RStringPool is used
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+	pProperties = CSenLayeredXmlProperties::NewL(KInputString, *pReader, stringPool);
+	CleanupStack::PushL(pProperties);
+	
+	pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(pReader);
+    
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLC_1L(CStifItemParser& aItem)
+    {
+    _LIT8(KInputString, "<Properties>\
+<Element1>Kissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KOutputString, "<Properties>\
+<Element1>Kissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    CSenXmlReader* pReader = CSenXmlReader::NewLC();
+
+	CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewLC(KInputString, *pReader);
+	
+	HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+    // Test CSenLayeredXmlProperties when RStringPool is used
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+	pProperties = CSenLayeredXmlProperties::NewLC(KInputString, *pReader, stringPool);
+	
+	pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(pReader);
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewL_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_NewLC_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetReaderL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertiesClassTypeL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_WriteToLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ReadFromLL(CStifItemParser& aItem)
+    {
+    _LIT8(KInputString, "<Properties>\
+<Element1>öKissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+    _LIT8(KOutputString, "<Properties>\
+<Element1>öKissa käveli öisellä kadulla</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></Properties>");
+
+	CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewLC();
+	
+	pProperties->ReadFromL(KInputString);
+	
+	HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+	pProperties = CSenLayeredXmlProperties::NewLC(stringPool);
+	
+	pProperties->ReadFromL(KInputString);
+	
+	pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties);
+
+    CleanupStack::PopAndDestroy(&stringPool);
+    
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8LL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8LCL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetIntPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_IntPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetBoolPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_BoolPropertyLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_WriteToL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ReadFromL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8L_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_AsUtf8LC_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ShrinkToL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_ExpandToLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_TopLayerL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_3L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetPropertyL_2L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertyL_4L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_PropertiesByTypeLL(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetIntPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_IntPropertyL_1L(CStifItemParser& aItem)
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_CloneLL(CStifItemParser& aItem)
+    {
+    _LIT8(KOutputString, "<Properties><PropertyName6>PropertyValue6</PropertyName6>\
+<PropertyName5>PropertyValue5</PropertyName5>\
+<PropertyName4>PropertyValue4</PropertyName4>\
+<PropertyName3>PropertyValue3</PropertyName3>\
+<PropertyName2>PropertyValue2</PropertyName2>\
+<PropertyName1>PropertyValue1</PropertyName1></Properties>"); 
+    
+    CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewLC();
+    
+    // Create properties for all 6 leayers
+    pProperties->SetPropertyL(_L8("PropertyName1"), _L8("PropertyValue1"),
+                              MSenLayeredProperties::ESenTransportLayer);
+    pProperties->SetPropertyL(_L8("PropertyName2"), _L8("PropertyValue2"),
+                              MSenLayeredProperties::ESenSereneLayer);
+    pProperties->SetPropertyL(_L8("PropertyName3"), _L8("PropertyValue3"),
+                              MSenLayeredProperties::ESenFrameworkLayer);
+    pProperties->SetPropertyL(_L8("PropertyName4"), _L8("PropertyValue4"),
+                              MSenLayeredProperties::ESenProviderSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName5"), _L8("PropertyValue5"),
+                              MSenLayeredProperties::ESenConsumerSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName6"), _L8("PropertyValue6"),
+                              MSenLayeredProperties::ESenMessageLayer);
+                              
+    HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CSenLayeredXmlProperties* pProperties2 = (CSenLayeredXmlProperties*)pProperties->CloneL();
+    // Destroy cloned properties immediately after cloning
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PushL(pProperties2);
+
+    pAsXml = pProperties2->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pProperties2);
+    
+    // Test Layered Properties and StringPool
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+    pProperties = CSenLayeredXmlProperties::NewLC(stringPool);
+    
+    // Create properties for all 6 leayers
+    pProperties->SetPropertyL(_L8("PropertyName1"), _L8("PropertyValue1"),
+                              MSenLayeredProperties::ESenTransportLayer);
+    pProperties->SetPropertyL(_L8("PropertyName2"), _L8("PropertyValue2"),
+                              MSenLayeredProperties::ESenSereneLayer);
+    pProperties->SetPropertyL(_L8("PropertyName3"), _L8("PropertyValue3"),
+                              MSenLayeredProperties::ESenFrameworkLayer);
+    pProperties->SetPropertyL(_L8("PropertyName4"), _L8("PropertyValue4"),
+                              MSenLayeredProperties::ESenProviderSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName5"), _L8("PropertyValue5"),
+                              MSenLayeredProperties::ESenConsumerSessionLayer);
+    pProperties->SetPropertyL(_L8("PropertyName6"), _L8("PropertyValue6"),
+                              MSenLayeredProperties::ESenMessageLayer);
+
+    TPtrC8 propertyValue;                              
+    pProperties->PropertyL(_L8("PropertyName1"), propertyValue);
+                              
+    pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    pProperties2 = (CSenLayeredXmlProperties*)pProperties->CloneL();
+    // Destroy cloned properties immediately after cloning
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PushL(pProperties2);
+
+    pAsXml = pProperties2->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pProperties2);
+    
+    CleanupStack::PopAndDestroy(&stringPool);
+    return KErrNone;
+    }
+
+TInt CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetBoolPropertyL_1L(CStifItemParser& aItem)
+    {
+    TBool value;
+    CSenLayeredXmlProperties* pProperties = CSenLayeredXmlProperties::NewLC();
+    
+    pProperties->SetBoolPropertyL(_L8("PropertyName"), EFalse);
+    pProperties->BoolPropertyL(_L8("PropertyName"), value);
+    LOCAL_ASSERT( value == EFalse );
+
+    HBufC8* pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == _L8("<Properties><PropertyName>false</PropertyName></Properties>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    pProperties->SetBoolPropertyL(_L8("PropertyName"), ETrue);
+    pProperties->BoolPropertyL(_L8("PropertyName"), value);
+    LOCAL_ASSERT( value != EFalse );
+    
+    pAsXml = pProperties->AsUtf8LC();
+    LOCAL_ASSERT( *pAsXml == _L8("<Properties><PropertyName>true</PropertyName></Properties>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pProperties);
+    
+    return KErrNone;
+    }
+
+void CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_BoolPropertyL_1L(CStifItemParser& aItem)
+    {
+    CSenLayeredPropertiesTester::UT_CSenLayeredXmlProperties_SetBoolPropertyL_1L(aItem);    
+    }
+
+// -----------------------------------------------------------------------------
+// CSenLayeredPropertiesTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CSenLayeredPropertiesTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/Bmarm/WsStarMessageHandlerTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/Bwins/WsStarMessageHandlerTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/conf/WsStarMessageHandlerTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,245 @@
+[Test]
+title NewL-test_CWSStarAddressingHandler_NewL
+create WsStarMessageHandlerTester obj 
+obj NewL-test_CWSStarAddressingHandler_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test1_CWSStarAddressingHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test1_CWSStarAddressingHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test2_CWSStarAddressingHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test2_CWSStarAddressingHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test3_CWSStarAddressingHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test3_CWSStarAddressingHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test4_CWSStarAddressingHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test4_CWSStarAddressingHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test5_CWSStarAddressingHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test5_CWSStarAddressingHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test6_CWSStarAddressingHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test6_CWSStarAddressingHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title Direction-test_CWSStarAddressingHandler_Direction
+create WsStarMessageHandlerTester obj 
+obj Direction-test_CWSStarAddressingHandler_Direction 
+delete obj 
+[Endtest] 
+
+[Test]
+title Phase-test_CWSStarAddressingHandler_Phase
+create WsStarMessageHandlerTester obj 
+obj Phase-test_CWSStarAddressingHandler_Phase 
+delete obj 
+[Endtest] 
+
+[Test]
+title InitL-test_CWSStarAddressingHandler_InitL
+create WsStarMessageHandlerTester obj 
+obj InitL-test_CWSStarAddressingHandler_InitL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSStarEnveloperHandler_NewL
+create WsStarMessageHandlerTester obj 
+obj NewL-test_CWSStarEnveloperHandler_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test1_CWSStarEnveloperHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test1_CWSStarEnveloperHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test2_CWSStarEnveloperHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test2_CWSStarEnveloperHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title Direction-test_CWSStarEnveloperHandler_Direction
+create WsStarMessageHandlerTester obj 
+obj Direction-test_CWSStarEnveloperHandler_Direction 
+delete obj 
+[Endtest] 
+
+[Test]
+title Phase-test_CWSStarEnveloperHandler_Phase
+create WsStarMessageHandlerTester obj 
+obj Phase-test_CWSStarEnveloperHandler_Phase 
+delete obj 
+[Endtest] 
+
+[Test]
+title InitL-test_CWSStarEnveloperHandler_InitL
+create WsStarMessageHandlerTester obj 
+obj InitL-test_CWSStarEnveloperHandler_InitL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSStarCredentialCollectorHandler_NewL
+create WsStarMessageHandlerTester obj 
+obj NewL-test_CWSStarCredentialCollectorHandler_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test1_CWSStarCredentialCollectorHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test1_CWSStarCredentialCollectorHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test2_CWSStarCredentialCollectorHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test2_CWSStarCredentialCollectorHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test3_CWSStarCredentialCollectorHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test3_CWSStarCredentialCollectorHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title Direction-test_CWSStarCredentialCollectorHandler_Direction
+create WsStarMessageHandlerTester obj 
+obj Direction-test_CWSStarCredentialCollectorHandler_Direction 
+delete obj 
+[Endtest] 
+
+[Test]
+title Phase-test_CWSStarCredentialCollectorHandler_Phase
+create WsStarMessageHandlerTester obj 
+obj Phase-test_CWSStarCredentialCollectorHandler_Phase 
+delete obj 
+[Endtest] 
+
+[Test]
+title InitL-test_CWSStarCredentialCollectorHandler_InitL
+create WsStarMessageHandlerTester obj 
+obj InitL-test_CWSStarCredentialCollectorHandler_InitL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSStarPassportHandler_NewL
+create WsStarMessageHandlerTester obj 
+obj NewL-test_CWSStarPassportHandler_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test1_CWSStarPassportHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test1_CWSStarPassportHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test2_CWSStarPassportHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test2_CWSStarPassportHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title Direction-test_CWSStarPassportHandler_Direction
+create WsStarMessageHandlerTester obj 
+obj Direction-test_CWSStarPassportHandler_Direction 
+delete obj 
+[Endtest] 
+
+[Test]
+title Phase-test_CWSStarPassportHandler_Phase
+create WsStarMessageHandlerTester obj 
+obj Phase-test_CWSStarPassportHandler_Phase 
+delete obj 
+[Endtest] 
+
+[Test]
+title InitL-test_CWSStarPassportHandler_InitL
+create WsStarMessageHandlerTester obj 
+obj InitL-test_CWSStarPassportHandler_InitL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSStarSecurityHandler_NewL
+create WsStarMessageHandlerTester obj 
+obj NewL-test_CWSStarSecurityHandler_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test1_CWSStarSecurityHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test1_CWSStarSecurityHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title InvokeL-test2_CWSStarSecurityHandler_InvokeL
+create WsStarMessageHandlerTester obj 
+obj InvokeL-test2_CWSStarSecurityHandler_InvokeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title Direction-test_CWSStarSecurityHandler_Direction
+create WsStarMessageHandlerTester obj 
+obj Direction-test_CWSStarSecurityHandler_Direction 
+delete obj 
+[Endtest] 
+
+[Test]
+title Phase-test_CWSStarSecurityHandler_Phase
+create WsStarMessageHandlerTester obj 
+obj Phase-test_CWSStarSecurityHandler_Phase 
+delete obj 
+[Endtest] 
+
+[Test]
+title InitL-test_CWSStarSecurityHandler_InitL
+create WsStarMessageHandlerTester obj 
+obj InitL-test_CWSStarSecurityHandler_InitL 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/eabi/WsStarMessageHandlerTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,21 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI20CWSStarAddressingEPR @ 2 NONAME ; #<TI>#
+	_ZTI21CWSStarHandlerContext @ 3 NONAME ; #<TI>#
+	_ZTI21CWSStarMessageContext @ 4 NONAME ; #<TI>#
+	_ZTI22CWSStarPassportHandler @ 5 NONAME ; #<TI>#
+	_ZTI22CWSStarSecurityHandler @ 6 NONAME ; #<TI>#
+	_ZTI23CWSStarEnveloperHandler @ 7 NONAME ; #<TI>#
+	_ZTI24CWSStarAddressingHandler @ 8 NONAME ; #<TI>#
+	_ZTI30CWSStarAddressingHeaderInbound @ 9 NONAME ; #<TI>#
+	_ZTI33CWSStarCredentialCollectorHandler @ 10 NONAME ; #<TI>#
+	_ZTV20CWSStarAddressingEPR @ 11 NONAME ; #<VT>#
+	_ZTV21CWSStarHandlerContext @ 12 NONAME ; #<VT>#
+	_ZTV21CWSStarMessageContext @ 13 NONAME ; #<VT>#
+	_ZTV22CWSStarPassportHandler @ 14 NONAME ; #<VT>#
+	_ZTV22CWSStarSecurityHandler @ 15 NONAME ; #<VT>#
+	_ZTV23CWSStarEnveloperHandler @ 16 NONAME ; #<VT>#
+	_ZTV24CWSStarAddressingHandler @ 17 NONAME ; #<VT>#
+	_ZTV30CWSStarAddressingHeaderInbound @ 18 NONAME ; #<VT>#
+	_ZTV33CWSStarCredentialCollectorHandler @ 19 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/group/WsStarMessageHandlerTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for wsstarmessagehandlertester 
+*
+*/
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          WsStarMessageHandlerTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         WsStarMessageHandlerTester.def
+
+#ifdef EKA2
+		EPOCALLOWDLLDATA
+#endif
+
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+// Sources needed by the test
+SOURCEPATH              ../../../../../webservices/wsstar/wsstarmessagehandlers/src
+SOURCE                  wsstaraddressinghandler.cpp
+SOURCE                  wsstaraddressingheaderinbound.cpp
+SOURCE                  wsstarmessageutils.cpp
+SOURCE                  wsstaraddressingepr.cpp
+
+SOURCE                  wsstarenveloperhandler.cpp
+
+SOURCE                  wsstarcredentialcollectorhandler.cpp
+
+SOURCE                  wsstarpassporthandler.cpp
+
+SOURCE                  wsstarsecurityhandler.cpp
+
+
+SOURCEPATH              ../../../../../webservices/wsstar/wsstarplugin/src
+SOURCE                  wsstarmessagecontext.cpp
+SOURCE                  wsstarhandlercontext.cpp
+
+
+USERINCLUDE             ../../../../../webservices/wsframework/inc
+USERINCLUDE             ../../../../../webservices/wsidentitymanager/inc
+USERINCLUDE             ../../../../../webservices/wsutils/inc
+USERINCLUDE             ../../../../../webservices/wslogger/inc
+USERINCLUDE             ../../../../../webservices/wsxml/inc
+USERINCLUDE             ../../../../../webservices/wsstar/wsstarplugin/inc
+USERINCLUDE             ../../../../../webservices/wsfragment/inc
+//wsstarmessagehandlers
+USERINCLUDE             ../../../../../webservices/wsstar/wsstarmessagehandlers/inc
+USERINCLUDE     				../../../../../webservices/inc
+
+USERINCLUDE             ../inc
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+SYSTEMINCLUDE           /epoc32/include/libc
+
+SOURCEPATH      	../src
+
+SOURCE          WsStarMessageHandlerTester.cpp
+SOURCE          WsStarMessageHandlerTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY                 ecom.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 inetprotutil.lib
+LIBRARY                 estlib.lib
+LIBRARY                 imut.lib
+LIBRARY                 xmlsecwrapper.lib
+
+LANG            SC
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+		LIBRARY SenFramework.lib
+		LIBRARY SenXml.lib
+		LIBRARY SenUtils.lib
+		LIBRARY SenFragment.lib
+		LIBRARY SenLogger.lib
+#else
+		LIBRARY wsFramework.lib
+		LIBRARY wsXml.lib
+		LIBRARY wsUtils.lib
+		LIBRARY wsFragment.lib
+		LIBRARY wsLogger.lib
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/group/WsStarMessageHandlerTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\WsStarMessageHandlerTester.dll"   -   "c:\Sys\Bin\WsStarMessageHandlerTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\WsStarMessageHandlerTester.cfg"-"c:\testing\conf\WsStarMessageHandlerTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wsstarmessagehandkertester
+*
+*/
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+WsStarMessageHandlerTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/inc/WsStarMessageHandlerTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,278 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef WSSTARMESSAGEHANDLERTESTER_H
+#define WSSTARMESSAGEHANDLERTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+//  EXTERNAL INCLUDES
+#include "wsstarmessagecontext.h"
+#include "wsstarhandlercontext.h"
+#include "wsstartrustclient.h"
+#include <SenXmlReader.h>
+#include "msencontext.h"
+#include "senmessagehandler.h"
+#include "wsstaraddressinghandler.h"
+#include "wsstarenveloperhandler.h"
+#include "wsstarcredentialcollectorhandler.h"
+#include "wsstarpassporthandler.h"
+#include "wsstarsecurityhandler.h"
+#include <e32def.h>
+//  INTERNAL INCLUDES
+
+_LIT8(KFaultMessage12,"<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"><S:Body><S:Fault><S:Code><S:Value>S:Receiver</S:Value><S:Subcode><S:Value>wsa:EndpointUnavailable</S:Value></S:Subcode></S:Code><S:Detail><wsa:RetryAfter>500</wsa:RetryAfter></S:Detail></S:Fault></S:Body></S:Envelope>");
+_LIT8(KFaultMessage11,"<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><S:Header><wsa:ReplyTo>replyTo</wsa:ReplyTo></S:Header><S:Body><S:Fault><faultcode>wsa:MessageInformationHeaderRequired</faultcode></S:Fault></S:Body></S:Envelope>");
+_LIT8(KFaultMessage11_1,"<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><S:Header><wsa:FaultTo>faultTo</wsa:FaultTo></S:Header><S:Body><S:Fault><faultcode>wsa:InvalidMessageInformationHeader</faultcode></S:Fault></S:Body></S:Envelope>");
+_LIT8(KFaultMessage11_2,"<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><S:Body><S:Fault><faultcode>wsa:DestinationUnreachable</faultcode></S:Fault></S:Body></S:Envelope>");
+_LIT8(KFaultMessage11_3,"<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><S:Body><S:Fault><faultcode>wsa:ActionNotSupported</faultcode></S:Fault></S:Body></S:Envelope>");
+// Logging path
+_LIT( KWsStarMessageHandlerTesterLogPath, "\\logs\\testframework\\WsStarMessageHandlerTester\\" ); 
+// Log file
+_LIT( KWsStarMessageHandlerTesterLogFile, "WsStarMessageHandlerTester.txt" ); 
+_LIT( KWsStarMessageHandlerTesterLogFileWithTitle, "WsStarMessageHandlerTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CWsStarMessageHandlerTester;
+
+// DATA TYPES
+typedef TInt (CWsStarMessageHandlerTester::* TestFunction)(CStifItemParser&);
+
+// CLASS DECLARATION
+
+/**
+*  CWsStarMessageHandlerTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CWsStarMessageHandlerTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CWsStarMessageHandlerTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CWsStarMessageHandlerTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CWsStarMessageHandlerTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+
+         void SetupL();
+
+         void SetupAddressingL();
+
+         void SetupEnveloperL();
+
+         void SetupCredentialCollectorL();
+
+         void SetupPassportL();
+
+         void SetupSecurityL();
+                        
+         void Teardown();
+        
+//addressing
+         TInt MT_CWSStarAddressingHandler_NewLL();
+        
+         TInt MT_CWSStarAddressingHandler_InvokeL1L();
+
+         TInt MT_CWSStarAddressingHandler_InvokeL2L();
+
+         TInt MT_CWSStarAddressingHandler_InvokeL3L();
+
+         TInt MT_CWSStarAddressingHandler_InvokeL4L();
+
+         TInt MT_CWSStarAddressingHandler_InvokeL5L();
+
+         TInt MT_CWSStarAddressingHandler_InvokeL6L();
+        
+         TInt MT_CWSStarAddressingHandler_DirectionL();
+        
+         TInt MT_CWSStarAddressingHandler_PhaseL();
+        
+         TInt MT_CWSStarAddressingHandler_InitLL();
+        
+//enveloper
+         TInt MT_CWSStarEnveloperHandler_NewLL();
+        
+         TInt MT_CWSStarEnveloperHandler_InvokeL1L();
+
+         TInt MT_CWSStarEnveloperHandler_InvokeL2L();
+
+         TInt MT_CWSStarEnveloperHandler_DirectionL();
+        
+         TInt MT_CWSStarEnveloperHandler_PhaseL();
+        
+         TInt MT_CWSStarEnveloperHandler_InitLL();
+
+//credential collector
+         TInt MT_CWSStarCredentialCollectorHandler_NewLL();
+        
+         TInt MT_CWSStarCredentialCollectorHandler_InvokeL1L();
+
+         TInt MT_CWSStarCredentialCollectorHandler_InvokeL2L();
+
+         TInt MT_CWSStarCredentialCollectorHandler_InvokeL3L();
+
+         TInt MT_CWSStarCredentialCollectorHandler_DirectionL();
+        
+         TInt MT_CWSStarCredentialCollectorHandler_PhaseL();
+        
+         TInt MT_CWSStarCredentialCollectorHandler_InitLL();
+
+//passport        
+         TInt MT_CWSStarPassportHandler_NewLL();
+        
+         TInt MT_CWSStarPassportHandler_InvokeL1L();
+
+         TInt MT_CWSStarPassportHandler_InvokeL2L();
+
+         TInt MT_CWSStarPassportHandler_DirectionL();
+        
+         TInt MT_CWSStarPassportHandler_PhaseL();
+        
+         TInt MT_CWSStarPassportHandler_InitLL();
+
+//security        
+         TInt MT_CWSStarSecurityHandler_NewLL();
+        
+         TInt MT_CWSStarSecurityHandler_InvokeL1L();
+
+         TInt MT_CWSStarSecurityHandler_InvokeL2L();
+
+         TInt MT_CWSStarSecurityHandler_DirectionL();
+        
+         TInt MT_CWSStarSecurityHandler_PhaseL();
+        
+         TInt MT_CWSStarSecurityHandler_InitLL();
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+        
+
+    private:    // Data
+        CWSStarMessageContext* iMessageContextOut;
+        CWSStarMessageContext* iMessageContextIn;
+        CSenXmlReader* iParser;
+        RFileLogger* iLogger;
+        CSenMessageHandler* iHandler; 
+        CWSStarHandlerContext* iHandlerCtx;
+        RPointerArray<HBufC8> iSignedParts;
+        
+
+
+
+    };
+
+#endif      // WSSTARMESSAGEHANDLERTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\WsStarMessageHandlerTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/src/WsStarMessageHandlerTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "WsStarMessageHandlerTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::CWsStarMessageHandlerTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWsStarMessageHandlerTester::CWsStarMessageHandlerTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWsStarMessageHandlerTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KWsStarMessageHandlerTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KWsStarMessageHandlerTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KWsStarMessageHandlerTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWsStarMessageHandlerTester* CWsStarMessageHandlerTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CWsStarMessageHandlerTester* self = new (ELeave) CWsStarMessageHandlerTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CWsStarMessageHandlerTester::~CWsStarMessageHandlerTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CWsStarMessageHandlerTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("WsStarMessageHandlerTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CWsStarMessageHandlerTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/WsStarMessageHandlerTester/src/WsStarMessageHandlerTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,861 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "WsStarMessageHandlerTester.h"
+#include <SenXmlUtils.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CWsStarMessageHandlerTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CWsStarMessageHandlerTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("NewL-test_CWSStarAddressingHandler_NewL", MT_CWSStarAddressingHandler_NewLL),
+		ENTRY("InvokeL-test1_CWSStarAddressingHandler_InvokeL", MT_CWSStarAddressingHandler_InvokeL1L),
+		ENTRY("InvokeL-test2_CWSStarAddressingHandler_InvokeL", MT_CWSStarAddressingHandler_InvokeL2L),
+		ENTRY("InvokeL-test3_CWSStarAddressingHandler_InvokeL", MT_CWSStarAddressingHandler_InvokeL3L),
+		ENTRY("InvokeL-test4_CWSStarAddressingHandler_InvokeL", MT_CWSStarAddressingHandler_InvokeL4L),
+		ENTRY("InvokeL-test5_CWSStarAddressingHandler_InvokeL", MT_CWSStarAddressingHandler_InvokeL5L),
+		ENTRY("InvokeL-test6_CWSStarAddressingHandler_InvokeL", MT_CWSStarAddressingHandler_InvokeL6L),
+		ENTRY("Direction-test_CWSStarAddressingHandler_Direction", MT_CWSStarAddressingHandler_DirectionL),
+		ENTRY("Phase-test_CWSStarAddressingHandler_Phase", MT_CWSStarAddressingHandler_PhaseL),
+		ENTRY("InitL-test_CWSStarAddressingHandler_InitL", MT_CWSStarAddressingHandler_InitLL),
+		ENTRY("NewL-test_CWSStarEnveloperHandler_NewL", MT_CWSStarEnveloperHandler_NewLL),
+		ENTRY("InvokeL-test1_CWSStarEnveloperHandler_InvokeL", MT_CWSStarEnveloperHandler_InvokeL1L),
+		ENTRY("InvokeL-test2_CWSStarEnveloperHandler_InvokeL", MT_CWSStarEnveloperHandler_InvokeL2L),
+		ENTRY("Direction-test_CWSStarEnveloperHandler_Direction", MT_CWSStarEnveloperHandler_DirectionL),
+		ENTRY("Phase-test_CWSStarEnveloperHandler_Phase", MT_CWSStarEnveloperHandler_PhaseL),
+		ENTRY("InitL-test_CWSStarEnveloperHandler_InitL", MT_CWSStarEnveloperHandler_InitLL),
+		ENTRY("NewL-test_CWSStarCredentialCollectorHandler_NewL", MT_CWSStarCredentialCollectorHandler_NewLL),
+		ENTRY("InvokeL-test1_CWSStarCredentialCollectorHandler_InvokeL", MT_CWSStarCredentialCollectorHandler_InvokeL1L),
+		ENTRY("InvokeL-test2_CWSStarCredentialCollectorHandler_InvokeL", MT_CWSStarCredentialCollectorHandler_InvokeL2L),
+		ENTRY("InvokeL-test3_CWSStarCredentialCollectorHandler_InvokeL", MT_CWSStarCredentialCollectorHandler_InvokeL3L),
+		ENTRY("Direction-test_CWSStarCredentialCollectorHandler_Direction", MT_CWSStarCredentialCollectorHandler_DirectionL),
+		ENTRY("Phase-test_CWSStarCredentialCollectorHandler_Phase", MT_CWSStarCredentialCollectorHandler_PhaseL),
+		ENTRY("InitL-test_CWSStarCredentialCollectorHandler_InitL", MT_CWSStarCredentialCollectorHandler_InitLL),
+		ENTRY("NewL-test_CWSStarPassportHandler_NewL", MT_CWSStarPassportHandler_NewLL),
+		ENTRY("InvokeL-test1_CWSStarPassportHandler_InvokeL", MT_CWSStarPassportHandler_InvokeL1L),
+		ENTRY("InvokeL-test2_CWSStarPassportHandler_InvokeL", MT_CWSStarPassportHandler_InvokeL2L),
+		ENTRY("Direction-test_CWSStarPassportHandler_Direction", MT_CWSStarPassportHandler_DirectionL),
+		ENTRY("Phase-test_CWSStarPassportHandler_Phase", MT_CWSStarPassportHandler_PhaseL),
+		ENTRY("InitL-test_CWSStarPassportHandler_InitL", MT_CWSStarPassportHandler_InitLL),
+		ENTRY("NewL-test_CWSStarSecurityHandler_NewL", MT_CWSStarSecurityHandler_NewLL),
+		ENTRY("InvokeL-test1_CWSStarSecurityHandler_InvokeL", MT_CWSStarSecurityHandler_InvokeL1L),
+		ENTRY("InvokeL-test2_CWSStarSecurityHandler_InvokeL", MT_CWSStarSecurityHandler_InvokeL2L),
+		ENTRY("Direction-test_CWSStarSecurityHandler_Direction", MT_CWSStarSecurityHandler_DirectionL),
+		ENTRY("Phase-test_CWSStarSecurityHandler_Phase", MT_CWSStarSecurityHandler_PhaseL),
+		ENTRY("InitL-test_CWSStarSecurityHandler_InitL", MT_CWSStarSecurityHandler_InitLL),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+void CWsStarMessageHandlerTester::SetupL()
+    {
+        if (iLogger!=NULL)
+        {
+            delete iLogger;
+            iLogger = NULL;
+        }
+        iLogger = new (ELeave)RFileLogger();
+        iLogger->Connect();
+        iLogger->CreateLog(_L("CWsStarMessageHandlerTester"),_L("CWsStarMessageHandlerTester.log"),
+                                                EFileLoggingModeOverwrite);
+        if ( iParser!= NULL )
+        {
+            delete iParser;
+    	    iParser = NULL;
+        }
+        iParser = CSenXmlReader::NewL();
+        User::LeaveIfNull(iParser);
+
+        if ( iMessageContextOut!= NULL )
+        {
+            delete iMessageContextOut;
+    	    iMessageContextOut = NULL;
+        }
+        iMessageContextOut = CWSStarMessageContext::NewL(SenContext::EOutgoing, iParser);
+        User::LeaveIfNull(iMessageContextOut);
+
+        if ( iMessageContextIn!= NULL )
+        {
+            delete iMessageContextIn;
+    	    iMessageContextIn = NULL;
+        }
+        iMessageContextIn = CWSStarMessageContext::NewL(SenContext::EIncoming, iParser);
+        User::LeaveIfNull(iMessageContextIn);
+    }
+
+void CWsStarMessageHandlerTester::SetupAddressingL()
+    {
+        SetupL();
+        if ( iHandler!= NULL )
+        {
+            delete iHandler;
+    	    iHandler = NULL;
+        }
+        if ( iHandlerCtx!= NULL )
+        {
+            delete iHandlerCtx;
+    	    iHandlerCtx = NULL;
+        }
+        iHandlerCtx = CWSStarHandlerContext::NewL();
+        iHandlerCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*iHandlerCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        iHandler = CWSStarAddressingHandler::NewL(param);
+    }
+
+
+void CWsStarMessageHandlerTester::SetupEnveloperL()
+    {
+        SetupL();
+        if ( iHandler!= NULL )
+        {
+            delete iHandler;
+    	    iHandler = NULL;
+        }
+        if ( iHandlerCtx!= NULL )
+        {
+            delete iHandlerCtx;
+    	    iHandlerCtx = NULL;
+        }
+        iHandlerCtx = CWSStarHandlerContext::NewL();
+        iHandlerCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*iHandlerCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        iHandler = CWSStarEnveloperHandler::NewL(param);
+    }
+
+
+void CWsStarMessageHandlerTester::SetupCredentialCollectorL()
+    {
+        SetupL();
+        if ( iHandler!= NULL )
+        {
+            delete iHandler;
+    	    iHandler = NULL;
+        }
+        if ( iHandlerCtx!= NULL )
+        {
+            delete iHandlerCtx;
+    	    iHandlerCtx = NULL;
+        }
+        iHandlerCtx = CWSStarHandlerContext::NewL();
+        iHandlerCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*iHandlerCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        iHandler = CWSStarCredentialCollectorHandler::NewL(param);
+    }
+
+void CWsStarMessageHandlerTester::SetupPassportL()
+    {
+        SetupL();
+        if ( iHandler!= NULL )
+        {
+            delete iHandler;
+    	    iHandler = NULL;
+        }
+        if ( iHandlerCtx!= NULL )
+        {
+            delete iHandlerCtx;
+    	    iHandlerCtx = NULL;
+        }
+        iHandlerCtx = CWSStarHandlerContext::NewL();
+        iHandlerCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*iHandlerCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        iHandler = CWSStarPassportHandler::NewL(param);
+    }
+
+void CWsStarMessageHandlerTester::SetupSecurityL()
+    {
+        SetupL();
+        if ( iHandler!= NULL )
+        {
+            delete iHandler;
+    	    iHandler = NULL;
+        }
+        if ( iHandlerCtx!= NULL )
+        {
+            delete iHandlerCtx;
+    	    iHandlerCtx = NULL;
+        }
+        iHandlerCtx = CWSStarHandlerContext::NewL();
+        iHandlerCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        iHandler = CWSStarSecurityHandler::NewL(iHandlerCtx);
+    }
+
+void CWsStarMessageHandlerTester::Teardown(  )
+    {
+        if (iHandler!= NULL)
+        {
+            delete iHandler;
+            iHandler = NULL;
+        }
+        if (iHandlerCtx!=NULL)
+        {
+            delete iHandlerCtx;
+            iHandlerCtx = NULL;
+        }
+        if ( iParser!= NULL )
+        {
+            delete iParser;
+        	iParser = NULL;
+        }
+        if ( iMessageContextOut!= NULL )
+        {
+            delete iMessageContextOut;
+        	iMessageContextOut = NULL;
+        }
+        if ( iMessageContextIn!= NULL )
+        {
+            delete iMessageContextIn;
+    	    iMessageContextIn = NULL;
+        }
+        if (iLogger!=NULL)
+        {
+            iLogger->CloseLog();
+            iLogger->Close();
+            delete iLogger;
+            iLogger = NULL;    
+        }
+    }
+
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_NewLL(  )
+    {
+        CWSStarAddressingHandler* handler = NULL; 
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(handler = CWSStarAddressingHandler::NewL(param));
+        TL(handler != (CWSStarAddressingHandler*)NULL);
+        __ASSERT_ALWAYS_NO_LEAVE(delete handler);
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        handler = NULL;
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InvokeL1L()
+    {
+        SetupAddressingL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        iMessageContextOut->Update(WSStarContextKeys::KTo,_L8("endpoint"));
+        iMessageContextOut->Update(WSStarContextKeys::KAction,_L8("action"));
+        iMessageContextOut->Update(WSStarContextKeys::KRelatesTo,_L8("relatesTo"));
+        iMessageContextOut->Update(WSStarContextKeys::KFrom,_L8("from"));
+        iMessageContextOut->Update(WSStarContextKeys::KReplyTo,_L8("replyTo"));
+        iMessageContextOut->Update(WSStarContextKeys::KFaultTo,_L8("faultTo"));
+        TL(iHandler->InvokeL(*iMessageContextOut)== KErrNone);
+
+        message->SetReader(*iParser);
+        message->BuildFrom(KFaultMessage12);
+        iMessageContextIn->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextIn) == KErrNone);
+        LOCAL_ASSERT(iMessageContextIn->GetDesC8L(WSStarContextKeys::KTo)->Compare(_L8("endpoint"))==0);
+        LOCAL_ASSERT(iMessageContextIn->GetDesC8L(WSStarContextKeys::KAction)->Compare(_L8("action"))==0);
+        LOCAL_ASSERT(iMessageContextIn->GetDesC8L(WSStarContextKeys::KRelatesTo)->Compare(_L8("relatesTo"))==0);
+        LOCAL_ASSERT(iMessageContextIn->GetDesC8L(WSStarContextKeys::KFrom)->Compare(_L8("from"))==0);
+        LOCAL_ASSERT(iMessageContextIn->GetDesC8L(WSStarContextKeys::KReplyTo)->Compare(_L8("replyTo"))==0);
+        LOCAL_ASSERT(iMessageContextIn->GetDesC8L(WSStarContextKeys::KFaultTo)->Compare(_L8("faultTo"))==0);
+        LOCAL_ASSERT(*iMessageContextIn->GetIntL(WSStarSession::KErrorLayer) == WSStarSession::EAddressing);
+        LOCAL_ASSERT(*iMessageContextIn->GetIntL(WSStarContextKeys::KRetryAfter) == 500);
+        
+        iMessageContextOut->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InvokeL2L()
+    {
+    	SetupAddressingL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        TL(iHandler->InvokeL(*iMessageContextOut)== KErrNotFound);
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextOut)== KErrNotFound);
+        iMessageContextOut->Update(WSStarContextKeys::KTo,_L8("endpoint"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNotFound);
+        iMessageContextOut->Update(WSStarContextKeys::KAction,_L8("action"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        TL(*iMessageContextOut->GetDesC8L(WSStarContextKeys::KReplyTo) == WSStarAddressing::KReplyToAnonymous200508);
+        CSenElement& body = message->BodyL();
+        CSenElement& applies = body.AddElementL(WSPolicy::KPolicyNamespace200409,
+                                                        WSPolicy::KAppliesToTag,
+                                                        WSPolicy::KAppliesToQTag);
+        SenXmlUtils::AddAttributeL(applies, WSStarContextKeys::KAddressAttrMark, _L8("appliesTo"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        iMessageContextOut->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+        }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InvokeL3L()
+    {
+    	SetupAddressingL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP11);
+        message->SetReader(*iParser);
+        message->BuildFrom(KFaultMessage11);
+        iMessageContextIn->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextIn) == KErrNone);
+        LOCAL_ASSERT(*iMessageContextIn->GetIntL(WSStarSession::KErrorLayer) == WSStarSession::EAddressing);
+        iMessageContextIn->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InvokeL4L()
+    {
+    	SetupAddressingL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP11);
+        message->SetReader(*iParser);
+        message->BuildFrom(KFaultMessage11_1);
+        iMessageContextIn->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextIn) == KErrNone);
+        LOCAL_ASSERT(*iMessageContextIn->GetIntL(WSStarSession::KErrorLayer) == WSStarSession::EAddressing);
+        iMessageContextIn->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InvokeL5L()
+    {
+    	SetupAddressingL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP11);
+        message->SetReader(*iParser);
+        message->BuildFrom(KFaultMessage11_2);
+        iMessageContextIn->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextIn) == KErrNone);
+        LOCAL_ASSERT(*iMessageContextIn->GetIntL(WSStarSession::KErrorLayer) == WSStarSession::EAddressing);
+        iMessageContextIn->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InvokeL6L()
+    {
+    	SetupAddressingL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP11);
+        message->SetReader(*iParser);
+        message->BuildFrom(KFaultMessage11_3);
+        iMessageContextIn->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextIn) == KErrNone);
+        LOCAL_ASSERT(*iMessageContextIn->GetIntL(WSStarSession::KErrorLayer) == WSStarSession::EAddressing);
+        iMessageContextIn->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_DirectionL(  )
+    {
+    	SetupAddressingL();
+        LOCAL_ASSERT(iHandler->Direction() == SenHandler::EBoth);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_PhaseL(  )
+    {
+    	SetupAddressingL();
+        LOCAL_ASSERT(iHandler->Phase() == SenHandler::EMessage);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarAddressingHandler_InitLL(  )
+    {
+        SetupAddressingL();  
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(iHandler->InitL(hCtx));
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        Teardown();
+        return KErrNone;
+    }
+
+//enveloper
+
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarEnveloperHandler_NewLL(  )
+    {
+    	SetupEnveloperL();
+        CWSStarEnveloperHandler* handler = NULL; 
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(handler = CWSStarEnveloperHandler::NewL(param));
+        TL(handler != (CWSStarEnveloperHandler*)NULL);
+        __ASSERT_ALWAYS_NO_LEAVE(delete handler);
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        handler = NULL;
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarEnveloperHandler_InvokeL1L()
+    {
+    	SetupEnveloperL();
+        iMessageContextOut->Update(WSStarContextKeys::KSoapVersion,ESOAP11);
+        iHandlerCtx->Update(HandlerContextKey::KVersion,KSecurityXmlNs);
+        CSenBaseElement* element = CSenBaseElement::NewL(_L8("elementBody")); 
+        iMessageContextOut->Update(WSStarContextKeys::KBodyElement,element);
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+
+        CSenSoapMessage* message = iMessageContextOut->GetCurrentSoapMessage();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        iMessageContextOut->Reset();
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarEnveloperHandler_InvokeL2L()
+    {
+    	SetupEnveloperL();
+        iHandlerCtx->Update(HandlerContextKey::KVersion,KSecuritySchemeXmlNs);
+        iMessageContextOut->Update(WSStarContextKeys::KBody,_L8("body content"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+
+        CSenSoapMessage* message = iMessageContextOut->GetCurrentSoapMessage();
+
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        iMessageContextOut->Reset();
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarEnveloperHandler_DirectionL(  )
+    {
+    	SetupEnveloperL();
+        LOCAL_ASSERT(iHandler->Direction() == SenHandler::EOutgoing);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarEnveloperHandler_PhaseL(  )
+    {
+    	SetupEnveloperL();
+        LOCAL_ASSERT(iHandler->Phase() == SenHandler::EMessage);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarEnveloperHandler_InitLL(  )
+    {
+    	SetupEnveloperL();
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(iHandler->InitL(hCtx));
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        Teardown();
+        return KErrNone;        
+    }
+
+//credential collector
+
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_NewLL(  )
+    {
+    	SetupCredentialCollectorL();
+        CWSStarCredentialCollectorHandler* handler = NULL; 
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(handler = CWSStarCredentialCollectorHandler::NewL(param));
+        TL(handler != (CWSStarCredentialCollectorHandler*)NULL);
+        __ASSERT_ALWAYS_NO_LEAVE(delete handler);
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        handler = NULL;
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_InvokeL1L()
+    {
+    	SetupCredentialCollectorL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        iMessageContextOut->Update(WSStarContextKeys::KSecurityToken,_L8("security token"));
+        iMessageContextOut->Update(WSStarContextKeys::KTimestampCreated,_L8("2007-02-22T15:30:00Z"));
+        iMessageContextOut->Update(WSStarContextKeys::KTimestampExpires,_L8("timestamp expired"));
+        iMessageContextOut->Update(WSStarContextKeys::KPhoneTimeWhenMTResolved,_L8("2007-02-22T15:31:00Z"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        iMessageContextOut->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_InvokeL2L()
+    {
+    	SetupCredentialCollectorL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        iMessageContextOut->Update(WSStarContextKeys::KSecurityToken,_L8("security token"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+
+        iMessageContextOut->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_InvokeL3L()
+    {
+    	SetupCredentialCollectorL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNotFound);
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+
+        iMessageContextOut->Reset();
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_DirectionL(  )
+    {
+    	SetupCredentialCollectorL();
+        LOCAL_ASSERT(iHandler->Direction() == SenHandler::EOutgoing);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_PhaseL(  )
+    {
+    	SetupCredentialCollectorL();
+        LOCAL_ASSERT(iHandler->Phase() == SenHandler::EMessage);
+        Teardown();
+        return KErrNone;    
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarCredentialCollectorHandler_InitLL(  )
+    {
+    	SetupCredentialCollectorL();
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(iHandler->InitL(hCtx));
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        Teardown();
+        return KErrNone;
+    }
+
+//passport
+
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarPassportHandler_NewLL(  )
+    {
+    	SetupPassportL();
+        CWSStarPassportHandler* handler = NULL; 
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        TAny* param = reinterpret_cast<TAny*>(&hCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(handler = CWSStarPassportHandler::NewL(param));
+        TL(handler != (CWSStarPassportHandler*)NULL);
+        __ASSERT_ALWAYS_NO_LEAVE(delete handler);
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        handler = NULL;
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarPassportHandler_InvokeL1L()
+    {
+    	SetupPassportL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP11);
+        CSenElement& body = message->BodyL();
+        body.AddElementL(WSStarContextKeys::KMultiReqTagMark);
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        iMessageContextOut->Update(WSStarContextKeys::KPassportEnabled,ETrue);
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+
+        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        iMessageContextOut->Reset();
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarPassportHandler_InvokeL2L()
+    {
+    	SetupPassportL();
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNotFound);
+        iMessageContextOut->Reset();
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarPassportHandler_DirectionL(  )
+    {
+    	SetupPassportL();
+        LOCAL_ASSERT(iHandler->Direction() == SenHandler::EOutgoing);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarPassportHandler_PhaseL(  )
+    {
+    	SetupPassportL();
+        LOCAL_ASSERT(iHandler->Phase() == SenHandler::EMessage);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarPassportHandler_InitLL(  )
+    {
+    	SetupPassportL();
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(iHandler->InitL(hCtx));
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        Teardown();
+        return KErrNone;    
+    }
+
+//security
+
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarSecurityHandler_NewLL(  )
+    {
+    	SetupSecurityL();
+        CWSStarSecurityHandler* handler = NULL; 
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        __ASSERT_ALWAYS_NO_LEAVE(handler = CWSStarSecurityHandler::NewL(pCtx));
+        TL(handler != (CWSStarSecurityHandler*)NULL);
+        __ASSERT_ALWAYS_NO_LEAVE(delete handler);
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        handler = NULL;
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarSecurityHandler_InvokeL1L()
+    {
+    	SetupSecurityL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        CSenElement& header = message->HeaderL();
+        CSenElement& security = header.AddElementL(_L8("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"),
+                                                   _L8("Security"),
+                                                   _L8("wsse"));  
+        security.AddElementL(_L8("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"),
+                             _L8("Timestamp"),
+                             _L8("wsu"));
+        CSenElement& body = message->BodyL();
+        iMessageContextOut->Update(WSStarContextKeys::KPOPBase64,_L8("WmPjJkStecgGm0SlT7ORuQ=="));
+        iMessageContextOut->Update(WSStarContextKeys::KBinaryType,WSStarContextValues::KPOPTypeSimmetric);
+        iMessageContextOut->Update(WSStarContextKeys::KSTR,
+                                   _L8("<wsse:SecurityTokenReference xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"><wsse:KeyIdentifier ValueType=\"http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID\">uuid-8222b7a2-3874-4884-bdb5-9c2ddd4b86b5-16</wsse:KeyIdentifier></wsse:SecurityTokenReference>"));
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        iMessageContextOut->SetOwnedEnvelope();
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+
+//        __ASSERT_ALWAYS_NO_LEAVE(delete message);
+        iMessageContextOut->Reset();
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarSecurityHandler_InvokeL2L()
+    {
+    	SetupSecurityL();
+        CSenSoapMessage* message = CSenSoapMessage::NewL(ESOAP12);
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        iMessageContextOut->Update(WSStarContextKeys::KPOPBase64,_L8("abcd!%@"));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        iMessageContextOut->Update(WSStarContextKeys::KPOPBase64,_L8("WmPjJkStecgGm0SlT7ORuQ=="));
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        iMessageContextOut->SetOwnedEnvelope();
+        iMessageContextOut->Add(SenContext::KSenCurrentSoapMessageCtxKey,message);
+        iMessageContextOut->Update(WSStarContextKeys::KBinaryType,_L8("adcedf"));
+        *((RPointerArray<HBufC8>*)iMessageContextOut->GetAnyL(WSStarContextKeys::KSignedPartsArray)) = 	
+                iSignedParts;	//codescannerwarnings
+        TL(iHandler->InvokeL(*iMessageContextOut) == KErrNone);
+        CSenElement& body = message->BodyL();
+        body.AddNamespaceL(_L8("wsu"),_L8("abscderf"));
+        SenXmlUtils::AddAttributeL(body, _L8("wsu:qqq"), _L8("qqq"));
+        //EUNIT_ASSERT_SPECIFIC_LEAVE(iHandler->InvokeL(*iMessageContextOut), KErrCorrupt);
+        TRAPD(leave, iHandler->InvokeL(*iMessageContextOut));
+        if(leave != KErrCorrupt)
+        	User::Leave(KErrGeneral);
+        
+        iMessageContextOut->Reset();
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarSecurityHandler_DirectionL(  )
+    {
+    	SetupSecurityL();
+        LOCAL_ASSERT(iHandler->Direction() == SenHandler::EBoth);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarSecurityHandler_PhaseL(  )
+    {
+    	SetupSecurityL();
+        LOCAL_ASSERT(iHandler->Phase() == SenHandler::EMessage);
+        Teardown();
+        return KErrNone;
+    }
+
+TInt CWsStarMessageHandlerTester::MT_CWSStarSecurityHandler_InitLL(  )
+    {
+    	SetupSecurityL();
+        CWSStarHandlerContext* pCtx = CWSStarHandlerContext::NewL();
+        pCtx->Add(HandlerContextKey::KLogger(), iLogger);
+        MSenHandlerContext& hCtx = (MSenHandlerContext&)(*pCtx);
+        __ASSERT_ALWAYS_NO_LEAVE(iHandler->InitL(hCtx));
+        __ASSERT_ALWAYS_NO_LEAVE(delete pCtx);
+        pCtx = NULL;
+        Teardown();
+        return KErrNone;    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CWsStarMessageHandlerTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CWsStarMessageHandlerTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/bmarm/SenServiceConnectionBCTest.def has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/bwins/SenServiceConnectionBCTest.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/bwins/SenServiceConnectionBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void)
+	?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &)
+
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/Thumbs.db has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/sunset.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/sunset2.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/testpic3.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/testpic4.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/winter.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/data/winter2.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/eabi/SenServiceConnectionBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI13CTestConsumer @ 3 NONAME ; #<TI>#
+	_ZTI13CTestProperty @ 4 NONAME ; #<TI>#
+	_ZTI13CTestProvider @ 5 NONAME ; #<TI>#
+	_ZTI15CTestConnection @ 6 NONAME ; #<TI>#
+	_ZTI17CTestFileObserver @ 7 NONAME ; #<TI>#
+	_ZTV13CTestConsumer @ 8 NONAME ; #<VT>#
+	_ZTV13CTestProperty @ 9 NONAME ; #<VT>#
+	_ZTV13CTestProvider @ 10 NONAME ; #<VT>#
+	_ZTV15CTestConnection @ 11 NONAME ; #<VT>#
+	_ZTV17CTestFileObserver @ 12 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+testsc_c.bat		/epoc32/winscw/c/testsc_c.bat
+testsc_z.bat		/epoc32/winscw/c/testsc_z.bat	
+testframework.ini		/epoc32/winscw/c/testframework/testframework_connection.ini
+
+PRJ_MMPFILES
+senserviceconnection.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/senserviceconnection.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senserviceconnection
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          CSenServiceConnectionBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY              ALL -TCB
+VENDORID        VID_DEFAULT        
+//VENDORID 0x70000001 
+// Enables Nokia intra hosted AB service endpoint to be used:
+MACRO           VALIMO_ADDRESSBOOK_SERVICE 
+
+// Activates Radio@AOL ID-WSF service endpoint to be used:
+//MACRO        AOL_RADIO_SERVICE 
+
+
+// Enables usage of old namespaces 
+// => Needed when WBXML Compression is used.
+//MACRO           OLD_MSN_NAMESPACE_2005_08
+
+SOURCEPATH      ../src
+SOURCE          senserviceconnectioncases.cpp
+SOURCE          senserviceconnection.cpp
+SOURCE          TestConnection.cpp
+SOURCE          testproperty.cpp
+SOURCE          testprovider.cpp
+SOURCE          testfileobserver.cpp
+SOURCE          testconsumer.cpp
+
+
+       //TARGETPATH      ?target_path
+DEFFILE         SenServiceConnectionBCTest.def
+
+USERINCLUDE     ../inc
+
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+
+SYSTEMINCLUDE   /epoc32/include/libc
+SYSTEMINCLUDE   /epoc32/include/libc/sys
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         stiftestinterface.lib
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+LIBRARY         apparc.lib 
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         eikcoctl.lib 
+LIBRARY         avkon.lib 
+LIBRARY         bafl.lib 
+LIBRARY         eikctl.lib
+LIBRARY         egul.lib 
+LIBRARY         fbscli.lib 
+LIBRARY         PBKENG.LIB 
+LIBRARY         cntmodel.lib 
+LIBRARY         aknskins.lib //for skin sbackground
+LIBRARY         gdi.lib
+
+LIBRARY         ecom.lib
+LIBRARY         commdb.lib
+LIBRARY         efsrv.lib
+LIBRARY         estor.lib
+
+LIBRARY         XMLFRAMEWORK.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenServConn.lib
+LIBRARY         SenServMgr.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenXml.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenMessages.lib
+#else 
+// for .SIS target
+LIBRARY         wsServConn.lib
+LIBRARY         wsServMgr.lib
+LIBRARY         wsServDesc.lib
+LIBRARY         wsXml.lib
+LIBRARY         wsUtils.lib
+LIBRARY         wsMessages.lib
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+LIBRARY                 XmlEngineDOM.lib
+LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= CSenServiceConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\testframework_connection.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule CSenServiceConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_ServiceConnection.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_connection.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule CSenServiceConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_ServiceConnection.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/SenServiceConnectionBCTest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,631 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenFragment test module.
+*
+*/
+
+
+#ifndef __SENSERVICECONNECTION_H__
+#define __SENSERVICECONNECTION_H__
+
+//#define __ENABLE_ALR__
+
+//  EXTERNAL INCLUDES
+#include <StifTestModule.h>
+#include <StifLogger.h>
+
+#include <MSenServiceConsumer.h>
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenXmlReader.h>
+#include <SenServiceConnection.h>
+
+#include <f32file.h>
+#include <e32base.h> // for CActive
+#include <e32std.h>
+#include <unistd.h>
+#include <aknnotewrappers.h> 
+#include <SenIdentityProvider.h>
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 50
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 6
+
+#ifdef __ENABLE_ALR__
+	#include <comms-infras/cs_mobility_apiext.h>
+	#include <senserviceconnectioninterfaces.h>
+#endif //__ENABLE_ALR__
+
+#include <msencobrandinginterface.h>
+
+// Logging path
+_LIT( KSenServiceConnectionLogPath, "\\logs\\testframework\\SenServiceConnectionBCTest\\" ); 
+// Log file
+_LIT( KSenServiceConnectionLogFile, "SenServiceConnectionBCTest.txt" ); 
+
+//  INTERNAL INCLUDES
+namespace
+    {
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    }
+
+enum TUT_CSenServiceConnection
+    {
+    ENotInitialized = 1,
+    EConnectionNotReady,
+    };
+    
+enum TMSCommands
+    {
+    EMSNMessengerRegister,
+    EMSNMessengerInvite,
+    EMSNMessengerSend,
+    EMSNMessengerUnRegister,
+    };
+
+//  FORWARD DECLARATIONS
+class CSenBaseFragment;
+class CSenBaseElement;
+class CSenSoapEnvelope;
+class SenXmlUtils;
+class CSenServiceConnection;
+class CSenXmlReader;
+class CSenDomFragment;
+class CSenXmlServiceDescription;
+class CSenServicePattern;
+class CSenServiceManager;
+class CSenSoapMessage;
+class CSenSoapMessage2;
+class CSenVtcpTransportProperties;
+
+/*
+#include <e32def.h>
+#ifndef NONSHARABLE_CLASS
+    #define NONSHARABLE_CLASS(x) class x
+#endif
+*/
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenServiceConnectionBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenFragmentBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenServiceConnectionBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+
+//  CLASS DEFINITION
+/**
+ *
+ * EUnitWizard generated test class. 
+ *
+ */
+NONSHARABLE_CLASS( CSenServiceConnectionBCTest )
+#ifdef __ENABLE_ALR__
+     : public CTestModuleBase, public MSenServiceConsumer, public MSenAuthenticationProvider, public MSenExtendedConsumerInterface, public MSenCoBrandingObserver, MSenHostletConsumer, public MMobilityProtocolResp
+#else
+     : public CTestModuleBase, public MSenServiceConsumer, public MSenAuthenticationProvider, public MSenExtendedConsumerInterface, public MSenCoBrandingObserver, MSenHostletConsumer
+#endif //__ENABLE_ALR__     
+    {
+    public:
+        enum TCallback
+            {
+            ECallbackNone = 0,
+            ECallbackHandleMessage,
+            ECallbackHandleError
+            };
+    
+        public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenServiceConnectionBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenServiceConnectionBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenFragment. It is called once for every instance of 
+        *       TestModuleSenFragment after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenFragment.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenFragment. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+ 				/**
+         * Method used to log version of test module
+         */
+        void SendTestModuleVersion();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceConnectionBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+           // MService Consumer implementation
+        void HandleMessageL(const TDesC8& aMessage);        
+        void HandleErrorL(const int aErrorCode, const TDesC8& aError);
+        void SetStatus(const TInt aStatus);
+
+        void SetupL();
+        void Teardown();
+        void ErrorL(TInt aCode);
+
+        TInt UT_CSenServiceConnection_RegisterIdentityProviderLL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_NewL_ContractL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ContractL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_PatternL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_PatternL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_ID_WSF_PatternL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ID_WSF_PatternL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_NewL_ContractL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ContractL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_DescriptionL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_DescriptionL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_PatternL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_PatternL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnectionSnapIdL( TTestResult& aResult );
+        TInt UT_CSenServiceConnectionSetSnapIdL( TTestResult& aResult );
+
+    	TInt UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SendL_RFileL_IPCBigrequest( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SubmitL_RFileL_IPCBigrequest( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SubmitL_RFileL_MTOM( TTestResult& aResult );
+    
+        TInt UT_CSenServiceConnection_SendL_NoErrorL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_CancelL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_ConNotInitialL( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_SendMultipleMessagesL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Get_Post1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Get_Post2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Proxy1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Proxy2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Pattern_IAP1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Pattern_IAP2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Pattern_IAP3L( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ContentType1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_ContentType2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_UserAgent1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_UserAgent2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_MessageSoapActionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_SoapAction1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_SoapAction2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_CustomHttpHeaderL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ConBusyL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ConInitializingL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ConExpiredL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ErrSubmitL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ErrNoMemoryL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SubmitLL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_IsReadyL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_HasFacetLL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_CompleteServerMessagesOnOffL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_1L( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SubmitL_1L( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_StartTransactionL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_TransactionCompletedL( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries1( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries2( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries3( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries4( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries5( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries6( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries7( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries8( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries9( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_TP_SecDialog( TTestResult& aResult );     
+        
+        TInt UT_CSenServiceConnection_TP_Omitted_True( TTestResult& aResult );     
+
+        TInt UT_CSenServiceConnection_TP_Omitted_False( TTestResult& aResult );           
+        
+        TInt UT_CSenServiceConnection_TP_Removed( TTestResult& aResult );     
+        
+        TInt UT_CSenServiceConnection_TP_Omit_Rem( TTestResult& aResult );
+        
+        
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_L( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_TestMessengerL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger3L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger4L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger5L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger6L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger7L( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Custom_Header(const TDesC8& KCustomHttpHeader,
+                                                       const TDesC8& KCustomHttpHeaderValue);
+                                    
+        TInt UT_CSenServiceConnection_TP_Send(const TDesC8& aLogFileName,
+                                              const TDesC8& aCustomHttpHeader,
+                                              const TDesC8& aCustomHttpHeaderValue,
+                                              CSenServiceConnection* iServiceConnection);
+                                              
+        TInt UT_CSenServiceConnection_TP_CheckLogs(const TDesC& aLogFilePath,
+                                                   const TDesC8& aCustomHttpHeader,
+                                                   const TDesC8& aCustomHttpHeaderValue);                                    
+                                                   
+        TUint32 SearchIAPIdByNameL( const TDesC& aIAPName );
+        
+        CSenSoapMessage* CreateAuthRequestLC();
+        
+        CSenSoapMessage2* CreateNewAuthRequestLC();
+        
+        HBufC8* ReadFileL(const TDesC& aFilename);
+        
+        TInt Find(const TDesC8& aDestination, const TDesC8& aDescToFind, TInt aStartingPos);
+        TBool ReplaceAll(TPtr8 aDestination, const TDesC8& aFrom, const TDesC8& aTo);
+        TBool DecodeHttpCharactersL(const TDesC8& aOriginal, HBufC8*& aDecoded);
+        
+        HBufC8* HttpMethodValueFromXmlLC(const TDesC8& aXml);
+        
+        HBufC8* HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                           const TDesC8& aPropertyName);
+                                           
+        TInt StartActiveScheduler(TInt aNumberOfSentMessages);
+        TInt StopActiveScheduler();
+        
+        CSenVtcpTransportProperties* CreateMSTransportPropertiesL(TMSCommands aCommand);
+        CSenSoapMessage2* CreateMSSoapMessage(TMSCommands aCommand);
+        TInt RegisterSTSL();
+        TInt RegisterSTSInvalidPasswordL();
+        TInt UnregisterSTSL( );
+        TInt SetPolicyL(CSenXmlServiceDescription* pServDesc, const TDesC8& pName,
+                                                              const TDesC8& pValue);
+		const CSenIdentityProvider* IdentityProviderL() const ;
+        TInt CreateConnectionToMessengerServiceL();
+        TInt CreateConnectionToMessengerServiceWithoutCallbackL();
+        
+        TInt AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage);
+        TInt AddApplicationHeader2L(CSenSoapMessage2& aMessage);
+        
+        TInt SendL( TTestResult& aResult );                                                                   
+        TInt SubmitL( TTestResult& aResult );                                                                         
+        TInt IsReady( TTestResult& aResult ) ;                                                                        
+        TInt HasFacetL( TTestResult& aResult );                                                                       
+                                                             
+        TInt CompleteServerMessagesOnOff( TTestResult& aResult ) ;                                                    
+        TInt Send2L( TTestResult& aResult ) ;                                                                         
+        TInt Submit2L( TTestResult& aResult ) ;                                                                       
+        TInt ServiceDescriptionL( TTestResult& aResult ) ;                                                            
+        TInt StartTransaction( TTestResult& aResult ) ;                                                               
+        TInt TransactionCompleted( TTestResult& aResult ) ;                                                           
+        TInt TxnId( TTestResult& aResult ) ;                                                                          
+        TInt SetTransportPropertiesL( TTestResult& aResult ) ;                                                        
+        TInt TransportPropertiesL( TTestResult& aResult ) ;                                                           
+        TInt Send3L( TTestResult& aResult ) ;                                                                         
+        TInt Submit3L( TTestResult& aResult ) ;                                                                       
+        TInt Send4L( TTestResult& aResult ) ;                                                                         
+        TInt Submit4L( TTestResult& aResult ) ;                                                                       
+        TInt Send5L( TTestResult& aResult ) ;                                                                         
+        TInt Submit5L( TTestResult& aResult ) ;                                                                       
+        TInt Response( TTestResult& aResult ) ;                                                                       
+        TInt CancelTransaction( TTestResult& aResult ) ;                                                              
+        TInt IdentityProvider1L( TTestResult& aResult ) ;                                                              
+        TInt Identifier( TTestResult& aResult ) ;                                                                     
+        TInt Name( TTestResult& aResult );
+        TInt Value( TTestResult& aResult );
+        TInt IntValue( TTestResult& aResult );
+        TInt BoolValue( TTestResult& aResult );
+        TInt Type( TTestResult& aResult );
+        TInt ValueTokensL( TTestResult& aResult );
+        TInt IdentityProvider2L( TTestResult& aResult ) ;
+        TInt Username1L( TTestResult& aResult ) ;
+        TInt Password1L( TTestResult& aResult ) ;
+        TInt ExtendedInterface1L( TTestResult& aResult ) ;                                  
+        TInt TransferProgress(TTestResult& aResult );
+        TInt HandleMeassage(TTestResult& aResult);
+        TInt HandleErrorL(TTestResult& aResult);
+        TInt SetStatus(TTestResult& aResult);
+        TAny* GetInterfaceByUid( TUid aUID );
+        		
+        #ifdef __ENABLE_ALR__
+            TInt ALRL(TTestResult& aResult);
+           
+            //mobility methods
+            virtual void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+                                                         TAccessPointInfo aNewAPInfo,
+                                                         TBool aIsUpgrade,
+                                                         TBool aIsSeamless ) ;
+            virtual void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ) ;
+            
+            virtual void Error(TInt aError) ;
+        #endif //__ENABLE_ALR__
+            TInt CoBrandL(TTestResult& aResult);
+            virtual TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId);
+            TInt HostletConsumerL(TTestResult& aResult);
+            virtual void SetConnectionId( TInt aConnectionId );
+            TInt DataTrafficDetailsL(TTestResult& aResult);
+    private:    // Data
+        
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenXmlServiceDescription*  iSession;
+        CSenServiceConnection*      iServiceConnection;
+        CSenSoapMessage* iSOAPMessage;
+        #ifdef __ENABLE_ALR__       
+            MSenAlrServiceConnection* iALRSC;
+        #endif //__ENABLE_ALR__
+        TBool iUseALR;
+        TInt iAlrCallBackRetryCount;
+        TBool iCoBrandingCallbackOption;
+        TBool iHostletConsumerOption;
+        TBool iGetDataTrafficDetails;
+        TBool isNewCarrierAccepted;
+        TBool isMigratedToPrefferedCarrier;
+        CSenServiceManager*         iManager;
+        CSenXmlReader*              iXmlReader;
+        
+        TInt                        iTransactionId;
+        TInt                        iConnectionState;
+        TBool                       iInitialized;
+        TBool                       iReady;
+        
+        TCallback                   iCallback;
+        HBufC8*                     ipMessage;
+        
+        TInt                        iNumberOfPendingOps;
+        HBufC8*                     ipFrameworkID;
+        
+        TInt                        iErrorCode;
+  
+        CSenIdentityProvider*       ipProviderForAuthProvider;
+        TInt                        iAuthInfoAskCounter;
+        RFs							iFsSessionHandle;
+        RFile 						iRFileHandle;
+        
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+		CActiveScheduler* iActiveScheduler;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+        
+        
+    };
+
+#endif      //  __SENSERVICECONNECTION_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/TestConnection.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef TESTCONNECTION_H
+#define TESTCONNECTION_H
+
+#include <SenServiceConnection.h>
+
+
+
+class CTestConnection : public CBase //:public CSenServiceConnection
+{
+    public: // Constructors and destructor
+
+        static CTestConnection* NewL();//MSenServiceConsumer& aConsumer);
+        void ConstructL();//MSenServiceConsumer& aConsumer);
+		 ~CTestConnection();
+		 CTestConnection();
+		 TInt SendL(const TDesC8& aRequest);
+		 TInt SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) ;
+         TInt IsReady(TBool& aReady) ;
+         TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) ;
+         TInt CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) ;
+         TInt SendL(CSenSoapEnvelope& aMessage) ;
+         TInt SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) ;
+         TInt ServiceDescriptionL(HBufC8*& aServiceDescription) ;
+         TInt StartTransaction() ;
+         TInt TransactionCompleted() ;
+         TInt TxnId() ;
+         TInt SetTransportPropertiesL(const TDesC8& aProperties) ;
+         TInt TransportPropertiesL(HBufC8*& aProperties) ;
+         TInt SendL(const TDesC8& aRequest, const TDesC8& aProperties) ;
+         TInt SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) ;
+         TInt SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) ;
+         TInt SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) ;
+         TInt SendL(MSenMessage& aMessage) ;
+      	 TInt SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) ;
+      	 MSenMessage* Response() ;
+    	 TInt CancelTransaction(TInt aTransactionID) ;
+    	 TInt IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) ;
+    	 TInt Identifier() ;
+    	 void RegisterFilesObserverL(MSenFilesObserver& aFilesObserver) ;
+    		
+    		
+    		
+    		
+    		
+    		
+    	//MSENFRAGMENT
+         CSenElement& AsElement() ;
+         CSenElement* ExtractElement() ;
+         void SetReader(CSenXmlReader& aReader) ;
+         CSenXmlReader* Reader() ;
+         void ParseL(const TDesC8& aBuf) ;
+         TInt BuildFrom(const TDesC8& aBuf) ;
+         void DelegateParsingL(MSenFragment& aDelegate) ;
+         void DelegateParsingL(  const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) ;
+
+         void ParseWithL(CSenXmlReader& aReader) ;
+         void SetOwner(MSenFragment& aFragment) ;
+         void ResumeParsingFromL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName) ;
+
+         void SetAttributesL(const RAttributeArray& aAttrs) ;
+
+         void WriteStartElementL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) ;
+
+         void WriteEndElementL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName) ;
+
+         const TDesC8& LocalName() const ;
+        
+         const TDesC8& NsUri() const ;
+
+         const TDesC8& NsPrefix() const ;
+
+         void WriteAsXMLToL(RWriteStream& aWriteStream) ;
+
+         HBufC* AsXmlUnicodeL() ;
+         HBufC8* AsXmlL() ;
+
+         TBool ConsistsOfL(MSenFragment& aCandidate) ;
+    	
+    	//CActive
+    	 void DoCancel() ;
+    	
+    	 void RunL() ;
+    		
+    
+    		
+    		
+
+        
+//        CTestProperty* iProp;
+	//	CSenServiceConnection* iConn;
+    private:
+	//	CSenServiceConnection* iConn;
+};
+
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TestConsumer_H
+#define TestConsumer_H
+
+// INCLUDES
+
+
+#include <MSenServiceConsumer.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestConsumer: public MSenServiceConsumer, public CBase
+{
+ 	public:
+	 	static CTestConsumer* NewL();
+	 	static CTestConsumer* NewLC();
+		void HandleMessageL(const TDesC8& aMessage = KNullDesC8) ;
+		void HandleErrorL(const TInt aErrorCode = 0, 
+                                  const TDesC8& aErrorMessage= KNullDesC8);
+ 		void SetStatus(const TInt aStatus = 0);
+		
+//	private:
+		CTestConsumer();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testfileobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TestFileObserver_H
+#define TestFileObserver_H
+
+// INCLUDES
+
+
+#include <MSenServiceConsumer.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestFileObserver: public MSenFilesObserver, public CBase
+{
+ 	public:
+	 	static CTestFileObserver* NewL();
+	 	static CTestFileObserver* NewLC();
+		void TransferProgress(TInt aTxnId = 0, TBool aIncoming = 0, const TDesC8& aMessage= KNullDesC8,
+            const TDesC8& aCid = KNullDesC8, TInt aProgress = 0)    ;         
+		
+//	private:
+		CTestFileObserver();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testproperty.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef TestProperty_H
+#define TestProperty_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MSenProperty.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestProperty: public MSenProperty, public CBase
+    {
+ 	public:
+	 	static CTestProperty* NewL();
+	 	static CTestProperty* NewLC();
+		TPtrC8 Name() ;
+
+		TPtrC8 Type() ;
+
+		TPtrC8 Value();
+
+		TInt IntValue(TInt& aValue) ;
+
+		TInt BoolValue(TBool& aValue) ;
+
+		TInt ValueTokensL(const TDesC8& aDelimiter,
+		              RPointerArray<TPtrC8>& aTokens) ;
+		              
+	private:
+		CTestProperty();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/testprovider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TestProvider_H
+#define TestProvider_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <MSenAuthenticationProvider.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestProvider: public MSenAuthenticationProvider, public CBase
+{
+ 	public:
+	 	static CTestProvider* NewL();
+	 	static CTestProvider* NewLC();
+		              
+		const CSenIdentityProvider* IdentityProviderL() ;
+		const TPtrC8 UsernameL() ;
+		const TPtrC8 PasswordL() ;
+		TAny* ExtendedInterface(const TInt32 /* aUid */) ;     
+	private:
+		CTestProvider();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:        
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Connection"},(0x20016BAA),3,0,0,TYPE=SA
+[0x101F7961],0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\CSenServiceConnectionBCTest.dll"-"!:\sys\bin\CSenServiceConnectionBCTest.dll"
+"\Epoc32\winscw\c\testSC_c.bat"-"!:\testSC.bat"
+"\Epoc32\winscw\c\testframework\testframework_connection.ini"-"!:\testframework\testframework_connection.ini"
\ No newline at end of file
Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/TestConnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "TestConnection.h"
+#include <SenElement.h>
+#include <SenXmlReader.h>
+
+CTestConnection::CTestConnection()//:CSenServiceConnection(iProp)
+{
+	
+}
+  
+void CTestConnection::ConstructL()//MSenServiceConsumer& aConsumer)
+{
+//	iConn = CSenServiceConnection::NewL();//aConsumer,_L8(""));
+}
+
+CTestConnection::~CTestConnection()
+{
+//	delete iConn;
+}
+/*
+CTestConnection* CTestConnection::NewL(MSenServiceConsumer& aConsumer)
+{
+	CTestConnection* pTest = new(ELeave) CTestConnection();
+	CleanupStack::PushL(pTest);
+	pTest->ConstructL(aConsumer);
+	CleanupStack::Pop(pTest);
+	return pTest;
+}
+*/
+CTestConnection* CTestConnection::NewL()//MSenServiceConsumer& aConsumer)
+{
+	CTestConnection* pTest = new(ELeave) CTestConnection();
+	CleanupStack::PushL(pTest);
+	//pTest->ConstructL(aConsumer);
+	CleanupStack::Pop(pTest);
+	return pTest;
+}
+
+TInt CTestConnection::SendL(const TDesC8& aRequest)
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aRequest);
+	return retval;
+}
+TInt CTestConnection::SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aRequest, aResponse) ;
+	return retval;
+}
+TInt CTestConnection::IsReady(TBool& aReady) 
+{
+	TInt retval(0);
+//	retval = iConn->IsReady(aReady);
+	return retval;
+}
+TInt CTestConnection::HasFacetL(const TDesC8& aURI, TBool& aHasFacet) 
+{
+	TInt retval(0);
+//	retval = iConn->HasFacetL(aURI, aHasFacet) ;
+	return retval;
+}
+TInt CTestConnection::CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) 
+{
+	TInt retval(0);
+//	retval = iConn->CompleteServerMessagesOnOff(aCompleteOnOff);
+	return retval;
+}
+TInt CTestConnection::SendL(CSenSoapEnvelope& aMessage) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aMessage);
+	return retval;
+}
+TInt CTestConnection::SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aMessage, aResponseTo);
+	return retval;
+}
+TInt CTestConnection::ServiceDescriptionL(HBufC8*& aServiceDescription) 
+{
+	TInt retval(0);
+//	retval = iConn->ServiceDescriptionL(aServiceDescription) ;
+	return retval;
+}
+TInt CTestConnection::StartTransaction() 
+{
+	TInt retval(0);
+//	retval = iConn->StartTransaction();
+	return retval;
+}
+TInt CTestConnection::TransactionCompleted() 
+{
+	TInt retval(0);
+//	retval = iConn->TransactionCompleted() ;
+	return retval;
+}
+TInt CTestConnection::TxnId() 
+{
+	TInt retval(0);
+//	retval = iConn->TxnId() ;
+	return retval;
+}
+TInt CTestConnection::SetTransportPropertiesL(const TDesC8& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->SetTransportPropertiesL(aProperties);
+	return retval;
+}
+TInt CTestConnection::TransportPropertiesL(HBufC8*& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->TransportPropertiesL(aProperties) ;
+	return retval;
+}
+TInt CTestConnection::SendL(const TDesC8& aRequest, const TDesC8& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aRequest, aProperties) ;
+	return retval;
+}
+TInt CTestConnection::SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aRequest, aProperties, aResponse) ;
+	return retval;
+}
+TInt CTestConnection::SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aMessage, aProperties) ;
+	return retval;
+}
+TInt CTestConnection::SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aMessage, aProperties, aResponseTo) ;
+	return retval;
+}
+TInt CTestConnection::SendL(MSenMessage& aMessage) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aMessage) ;
+	return retval;
+}
+TInt CTestConnection::SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aMessage, aResponseTo) ;
+	return retval;
+}
+MSenMessage* CTestConnection::Response() 
+{
+	TInt retval(0);
+//	TRAP(retval, iConn->Response());
+	return NULL;
+}
+TInt CTestConnection::CancelTransaction(TInt aTransactionID) 
+{
+	TInt retval(0);
+//	retval = iConn->CancelTransaction(aTransactionID) ;
+	return retval;
+}
+TInt CTestConnection::IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) 
+{
+	TInt retval(0);
+//	retval = iConn->IdentityProviderL(apIdentityProvider);
+	return retval;
+}
+TInt CTestConnection::Identifier() 
+{
+	TInt retval(0);
+//	retval = iConn->Identifier() ;
+	return retval;
+}
+
+void CTestConnection::RegisterFilesObserverL(MSenFilesObserver& aFilesObserver) 
+{}
+
+
+//MSenFragment
+
+CSenElement& CTestConnection::AsElement() 
+{
+	
+}
+CSenElement* CTestConnection::ExtractElement() 
+{
+	
+}
+void CTestConnection::SetReader(CSenXmlReader& aReader) 
+{
+	
+}
+CSenXmlReader* CTestConnection::Reader() 
+{
+	
+}
+void CTestConnection::ParseL(const TDesC8& aBuf) 
+{
+	
+}
+TInt CTestConnection::BuildFrom(const TDesC8& aBuf) 
+{
+	
+}
+void CTestConnection::DelegateParsingL(MSenFragment& aDelegate) 
+{
+	
+}
+void CTestConnection::DelegateParsingL(  const TDesC8& aNsUri,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName,
+                        const RAttributeArray& aAttrs) 
+{
+	
+}
+
+void CTestConnection::ParseWithL(CSenXmlReader& aReader) 
+{
+	
+}
+void CTestConnection::SetOwner(MSenFragment& aFragment) 
+{
+	
+}
+void CTestConnection::ResumeParsingFromL(const TDesC8& aNsUri,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName) 
+{
+	
+}
+
+void CTestConnection::SetAttributesL(const RAttributeArray& aAttrs) 
+{
+	
+}
+void CTestConnection::WriteStartElementL(const TDesC8& aNsUri,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName,
+                        const RAttributeArray& aAttrs) 
+{
+	
+}
+
+void CTestConnection::WriteEndElementL(const TDesC8& aNsUri,
+                      const TDesC8& aLocalName,
+                      const TDesC8& aQName) 
+{
+	
+}
+
+const TDesC8& CTestConnection::LocalName()  const
+{
+	
+}
+
+const TDesC8& CTestConnection::NsUri()  const
+{
+	
+}
+
+const TDesC8& CTestConnection::NsPrefix()  const
+{
+	
+}
+
+void CTestConnection::WriteAsXMLToL(RWriteStream& aWriteStream) 
+{
+	
+}
+
+HBufC* CTestConnection::AsXmlUnicodeL() 
+{
+	
+}
+HBufC8* CTestConnection::AsXmlL() 
+{
+	
+}
+
+TBool CTestConnection::ConsistsOfL(MSenFragment& aCandidate) 
+{
+	
+}
+
+//CACTIVE
+
+
+void CTestConnection::DoCancel() 
+{
+	
+}
+
+void CTestConnection::RunL() 
+{
+	
+}
+
+//Msenserviceconsumer
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,429 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenHostletConnection class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "SenServiceConnectionBCTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::CSenServiceConnectionBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenServiceConnectionBCTest::CSenServiceConnectionBCTest()
+    {
+    iUseALR = EFalse;
+    iCoBrandingCallbackOption = EFalse;
+    iHostletConsumerOption = EFalse;
+    iGetDataTrafficDetails = EFalse;
+    isMigratedToPrefferedCarrier = EFalse;
+    isNewCarrierAccepted = EFalse;
+    iAlrCallBackRetryCount = 0;
+    iSOAPMessage = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::ConstructL()
+    {
+    
+    
+    iLog = CStifLogger::NewL( KSenServiceConnectionLogPath, 
+                          KSenServiceConnectionLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "CSenServiceConnectionBCTest logging starts!" );
+    iLog->Log( KLogStart );
+    
+    iActiveScheduler = new CActiveScheduler;
+	CActiveScheduler::Install( iActiveScheduler );
+
+    }
+//-----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::SendTestModuleVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("CSenServiceConnectionBCTest.dll");
+	
+
+	TBool newVersionOfMethod = ETrue;
+	CTestModuleIf &test=TestModuleIf();
+	test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	test.SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenServiceConnectionBCTest* CSenServiceConnectionBCTest::NewL()
+    {
+    CSenServiceConnectionBCTest* self = new (ELeave) CSenServiceConnectionBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenServiceConnectionBCTest::~CSenServiceConnectionBCTest()
+    {
+    if(iServiceConnection!=NULL)
+        {
+        delete iServiceConnection;
+        iServiceConnection = NULL;
+        }
+
+    if(iSOAPMessage!=NULL)
+        {
+        delete iSOAPMessage;
+        iSOAPMessage = NULL;
+        }
+		        
+    delete iLog;
+    if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close();
+    delete iActiveScheduler;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceConnectionBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceConnectionBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceConnectionBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+		SendTestModuleVersion();
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenServiceConnectionBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenServiceConnectionBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenServiceConnectionBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnectioncases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,7084 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+// INCLUDE FILES
+#include "SenServiceConnectionBCTest.h"
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+
+//  EXTERNAL INCLUDES
+#include <http.h>
+#include <httperr.h>
+
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenDomFragment.h>
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenSoapEnvelope2.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenXmlUtils.h>
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenHttpTransportProperties.h>
+#include <SenSoapMessage.h>
+#include <SenSoapMessage2.h>
+#include <SenDateUtils.h>
+#include <SenTransportProperties.h>
+
+//#include <SenVtcpTransportProperties.h>
+#include "testproperty.h"
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+//#include <XmlEngSerializer.h>
+
+#include <e32base.h> // for CActive
+#include <aknnotewrappers.h> 
+
+#include <commdb.h>
+
+#include <s32file.h>    // filestream
+#include <e32svr.h>     // fileman
+#include "TestConnection.h"
+#include "testprovider.h"
+#include "testfileobserver.h"
+#include "testconsumer.h"
+//  INTERNAL INCLUDES
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+#define STIFF_ASSERT_DESC(expression, desc)	{if(!(expression)){RDebug::Print(_L(desc)) ;return KErrArgument;}}
+#define STIFF_ASSERT_NOT_EQUALS_DESC(expression1, expression2, desc) \
+	{TL((expression1) != (expression2)){RDebug::Print(_L(desc)) ;}}
+
+
+// CONSTANTS
+namespace 
+    {
+        
+#ifdef AOL_RADIO_SERVICE
+    // AOL redio.etenee.net:9080
+    _LIT8(KWSPContract,         "urn:aol-com:services:radio");
+    _LIT8(KAuthServEndpoint,    "http://radio.etenee.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://radio.etenee.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#elif VALIMO_ADDRESSBOOK_SERVICE
+    // Addressbook service hosted inside Nokia intra by ASP / testing team
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://10.21.32.110/tfs/IDPSSO_IDWSF10");
+    _LIT8(KASProviderID,        "provider01");
+    _LIT8(KTestAuthzID,         "john");
+    _LIT8(KTestPassword,        "password");
+#elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://ys01liw022.partner.yomi.com:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#else // == default (no MACROs defined in .mmp)
+    // Addressbook service hosted by Forum Nokia (accessible from external network)
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09"); 
+    _LIT8(KAuthServEndpoint,    "http://selma.ndhub.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://selma.ndhub.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "testuser1");
+    _LIT8(KTestPassword,        "testuser1");
+#endif // FN_ADDRESSBOOK_SERVICE
+
+
+    _LIT8(KASContract,              "urn:liberty:as:2004-04");
+    _LIT8(KHttpsEndPoint,           "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" );    
+    
+    _LIT8(KWSIFrameworkID,          "WS-I");
+    _LIT8(KIDWSFFrameworkID,        "ID-WSF");
+    _LIT8(KRESTFrameworkID,         "REST");       
+//    _LIT8(KWsStarFrameworkID,       "WS-STAR");       
+#ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KAddressBookServiceId,    "http://radio.aol.com/xsd/2.0/ns/");
+    _LIT8(KAddressBookContract,     "http://radio.aol.com/xsd/2.0/ns/");
+#else
+   	_LIT8(KAddressBookServiceId,    "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KIPCServiceEndPoint,    "http://125.16.213.244//sereneHardCoded//WS_IPCImpr_001");
+    _LIT8(KMtomEndPoint,    "http://10.21.32.20:8080//mtom//servlet//MtomRequest");
+    
+    _LIT8(KAddressBookContract,     "urn:nokia:test:addrbook:2004-09");
+#endif
+    
+#ifdef __WINS__    
+  #ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+  #else
+    //_LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+    _LIT(KIAPName,                  "Ethernet with Daemon Dynamic IP");
+  #endif
+#else
+// ARMv5
+    _LIT(KIAPName,                  "Internet");
+#endif  
+    _LIT8(KLoggerFileNameProperty,  "HttpLoggerFileName");
+
+    _LIT(KFileToRead,               "c:\\Logs\\LoggingHttpFilter\\httptrace.xml");
+    _LIT8(KFileName,                "httptrace.xml");
+
+    _LIT8(KHTTPMethodGet,           "GET");
+    _LIT8(KHTTPMethodPost,          "POST");
+    
+//    const TBool MultipleSimultanousRHttpSessionsSupported = EFalse;
+    // If IAP changes all previously sent messages will be canceled.
+    
+    
+    //_LIT8(KProxyHost,             "esprx00.nokia.com"); 
+    _LIT8(KProxyHost,               "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com
+    const TInt KProxyPort =         8080;
+
+    //MSN Constants :
+    //---------------
+    _LIT8(KPassportUser,        "m_minkkis@hotmail.com");
+    _LIT8(KPassportPass,        "M1nkk1s");
+
+    _LIT8(KStsEndpoint,         "https://login.live.com/rst2.srf");
+    _LIT8(KMSNProxy,            "tcp.mws.mobile.live.com");
+    //_LIT8(KMetadataEndpoint,    "http://10.132.11.31/WSStar/secpolicy/secpol.xml");
+    _LIT8(KMetadataEndpoint, "https://http.mws.mobile.live.com/2006/10/MWP2007_02/SecurityPolicy/Default.aspx");   
+
+    _LIT8(KPolicyAdr,           "Addressing");
+    _LIT8(KPolicyMT,            "MetadataEndpoint");
+    _LIT8(KPolicyTLS,           "UsernameTokenOverTLS");
+    _LIT8(KPolicySOAP12,        "SOAP12");
+    _LIT8(KPolicyPassExt,       "PassportExtensions");
+    _LIT8(KProviderId,          "provider01");
+
+#ifdef OLD_MSN_NAMESPACE_2005_08
+    _LIT8(KMessagingEndpoint,   "tcp://schemas.live.com/mws/2005/08/messaging");
+    _LIT8(KMessagingContract,   "http://schemas.live.com/mws/2005/08/messaging");
+    _LIT8(KMessagingNameSpace,  "http://schemas.live.com/mws/2005/08/core");
+#else
+    _LIT8(KMessagingEndpoint,   "tcp://schemas.live.com/mws/2006/10/messaging");
+    _LIT8(KMessagingContract,   "http://schemas.live.com/mws/2006/10/messaging");
+    _LIT8(KMessagingNameSpace,  "http://schemas.live.com/mws/2006/10/core");
+#endif
+    }
+    
+// CONSTRUCTION
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenServiceConnectionBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServiceManager_stif.cpp file and to SenServiceManager_stif.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServiceManagerBCTest::PrintTest. Otherwise the compiler
+        // gives errors.
+//  TEST TABLE
+
+		//ENTRY("RegisterIdentityProviderL CSenServiceConnection RegisterIdentityProviderL", CSenServiceConnectionBCTest::UT_CSenServiceConnection_RegisterIdentityProviderLL),
+
+		
+		//ENTRY("SendL, Pattern, IAP1 Test  CSenServiceConnection SendL, Pattern, IAP1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP1L),
+
+		//ENTRY("SendL, Pattern, IAP2 Test  CSenServiceConnection SendL, Pattern, IAP2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP2L),
+
+		//ENTRY("SendL, Pattern, IAP3 Test  CSenServiceConnection SendL, Pattern, IAP3 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP3L),
+
+		ENTRY( "NewL - contract test  CSenServiceConnection NewL contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL),
+		ENTRY("NewLC - contract test  CSenServiceConnection NewLC contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL),
+
+		ENTRY("NewL - description test for WS-I  CSenServiceConnection NewL description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL),
+
+		ENTRY("NewLC - description test for WS-I CSenServiceConnection NewLC description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL),
+
+		ENTRY("NewL - description test for ID-WSF CSenServiceConnection NewL description for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL),
+
+		ENTRY("NewLC - description test for ID-WSF CSenServiceConnection NewLC description for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL),
+
+		ENTRY("NewL - pattern test for WS-I  CSenServiceConnection NewL pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL),
+
+		ENTRY("NewLC - pattern test for WS-I CSenServiceConnection NewLC pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL),
+
+		ENTRY("NewL - pattern test for ID-WSF CSenServiceConnection NewL pattern for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_PatternL),
+
+		ENTRY("NewLC - pattern test for ID-WSF CSenServiceConnection NewLC pattern for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL),
+		
+		ENTRY( "NewL1 - contract test  CSenServiceConnection NewL contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL1),
+
+		ENTRY("NewLC1 - contract test  CSenServiceConnection NewLC contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL1),
+
+		ENTRY("NewL1 - description test for WS-I  CSenServiceConnection NewL description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL1),
+
+		ENTRY("NewLC1 - description test for WS-I CSenServiceConnection NewLC description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL1),
+
+
+		ENTRY("NewL1 - pattern test for WS-I  CSenServiceConnection NewL pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL1),
+
+		ENTRY("NewLC1 - pattern test for WS-I CSenServiceConnection NewLC pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL1),
+
+/*
+		ENTRY("SendL - no error test  CSenServiceConnection SendL no error",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_NoErrorL),
+		ENTRY("SendL - cancel test  CSenServiceConnection SendL no error",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CancelL),
+
+		ENTRY("SendL - connection is not initialized test  CSenServiceConnection SendL connection is not initialized",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ConNotInitialL),
+
+		ENTRY("SendL - Multiple Messages  CSenServiceConnection SendL Multiple Messages",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendMultipleMessagesL),
+		ENTRY("SendL, Get,Post 1 Test  CSenServiceConnection SendL, Get,Post 1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post1L),
+
+		ENTRY("SendL, Get,Post 2 Test  CSenServiceConnection SendL, Get,Post 2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post2L),
+
+		ENTRY("SendL, Post, Proxy 1 Test  CSenServiceConnection SendL, Post, Proxy 1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy1L),
+
+		ENTRY("SendL, Post, Proxy 2 Test  CSenServiceConnection SendL connection is not initialized",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy2L),
+
+		ENTRY("SendL, ContentType1 Test  CSenServiceConnection SendL, ContentType1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType1L),
+
+		ENTRY("SendL, ContentType2 Test  CSenServiceConnection SendL, ContentType2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType2L),
+		ENTRY("SendL, UserAgent1 Test  CSenServiceConnection SendL, UserAgent1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent1L),
+
+		ENTRY("SendL, UserAgent2 Test  CSenServiceConnection SendL, UserAgent2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent2L),
+		ENTRY("SendL, Message SoapAction Test  CSenServiceConnection SendL, Message SoapAction Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_MessageSoapActionL),
+		ENTRY("SendL, SoapAction1 Test  CSenServiceConnection SendL, SoapAction1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction1L),
+
+		ENTRY("SendL, SoapAction2 Test  CSenServiceConnection SendL, SoapAction2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction2L),
+		ENTRY("SendL, CustomHttpHeader Test  CSenServiceConnection SendL, CustomHttpHeader Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CustomHttpHeaderL),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection SendL, TP boundaries Test", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries1),
+
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries2),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries3),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries4),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries5),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries6),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries7),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries8),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries9),
+		ENTRY("SendL, TP SecDialog Test  CSenServiceConnection SendL connection is not initialized",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_SecDialog),  
+		ENTRY("SendL, TP Omitted True Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_True),  
+		ENTRY("SendL, TP Omitted False Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_False),  
+		ENTRY("SendL, TP Removed Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Removed),  
+		ENTRY("SendL, TP Omit/Rem Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omit_Rem),  
+		ENTRY("SubmitL, LibXml2  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_L),  
+		ENTRY("SubmitL, LibXml2 + props  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L),  
+		ENTRY("SubmitL, BLOB 20KB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL), 
+		ENTRY("SubmitL, BLOB 200KB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL), 
+		ENTRY("SubmitL, BLOB less1MB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL),
+		ENTRY("SubmitL, BLOB more1MB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL),
+		ENTRY("MSN - Basic case CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessengerL), 
+		ENTRY("MSN - ReUse Credential CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger2L), 
+		ENTRY("MSN - AuthCallback success CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger3L), 
+		ENTRY("MSN - AuthCallback fail CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger4L), 
+		ENTRY("MSN - UserInfoPrompt CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger5L), 
+		ENTRY("MSN - show prompt CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger6L), 
+		ENTRY("MSN - Invalid password CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger7L),
+    */
+    	ENTRY("SendL- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SendL),
+		ENTRY("Send2L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send2L),
+		ENTRY("Send3L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send3L),
+		ENTRY("Send4L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send4L),
+		ENTRY("Send5L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send5L),
+		ENTRY("SubmitL- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SubmitL),
+		ENTRY("Submit2L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit2L),
+		ENTRY("Submit3L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit3L),
+		ENTRY("Submit4L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit4L),
+		ENTRY("Submit5L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit5L),
+		ENTRY("IsReady- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IsReady),
+		ENTRY("HasFacetL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HasFacetL),
+		ENTRY("CompleteServerMessagesOnOff-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::CompleteServerMessagesOnOff),
+		ENTRY("ServiceDescriptionL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ServiceDescriptionL),
+		ENTRY("StartTransaction-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::StartTransaction),
+		ENTRY("TransactionCompleted-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TransactionCompleted),
+		ENTRY("TxnId-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TxnId),
+		ENTRY("SetTransportPropertiesL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SetTransportPropertiesL),
+		ENTRY("TransportPropertiesL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TransportPropertiesL),
+		ENTRY("Response-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Response),
+		ENTRY("CancelTransaction-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::CancelTransaction),
+		ENTRY("IdentityProviderL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IdentityProvider1L),
+		ENTRY("Identifier-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Identifier),
+		ENTRY("Name-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Name),
+		ENTRY("Type-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Type),
+		ENTRY("Value-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Value),
+		ENTRY("IntValue-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IntValue),
+		ENTRY("BoolValue-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::BoolValue),
+		ENTRY("ValueTokensL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ValueTokensL),
+		ENTRY("IdentityProviderL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IdentityProvider2L),
+		ENTRY("UsernameL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Username1L),
+		ENTRY("PasswordL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Password1L),
+		ENTRY("ExtendedInterface-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ExtendedInterface1L),
+		ENTRY("TransferProgress-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TransferProgress),
+		ENTRY("HandleMeassage-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HandleMeassage),
+		ENTRY("HandleErrorL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HandleErrorL),
+		ENTRY("SetStatus-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SetStatus),
+		 // ENTRY("SendL - RfileHandle - Test for sending 4.4M jpg file to the server ",CSenServiceConnectionBCTest::UT_CSenServiceConnectionSnapIdL),
+		ENTRY("SendL - RfileHandle - IPCImpBigRequest ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL_IPCBigrequest),
+		ENTRY("SendL - RfileHandle - Simple Request ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL),
+		ENTRY("SubmitL - RfileHandle - Simple Request ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL),
+		//ENTRY("SubmitL - RfileHandle -IPCImpBigRequest ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_IPCBigrequest),
+	//	ENTRY("SubmitL - RfileHandle -MTOM ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_MTOM),
+    #ifdef __ENABLE_ALR__
+		ENTRY("ALR-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ALRL),
+    #endif //__ENABLE_ALR__
+		ENTRY("CoBrand-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::CoBrandL),
+		ENTRY("HostletConsumer-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HostletConsumerL),
+		ENTRY("DataTrafficDetails-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::DataTrafficDetailsL),
+ 	};
+
+	    // Verify that case number is valid
+	    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+	                               sizeof( TCaseInfoInternal ) )
+	        {
+	        // Invalid case, construct empty object
+	        TCaseInfo null( (const TText*) L"" );
+	        null.iMethod = NULL;
+	        null.iIsOOMTest = EFalse;
+	        null.iFirstMemoryAllocation = 0;
+	        null.iLastMemoryAllocation = 0;
+	        return null;
+	        } 
+
+	    // Construct TCaseInfo object and return it
+	    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+	    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+	    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+	    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+	    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+	    return tmp;
+
+	    }   
+
+//  METHODS
+/*
+CSenVtcpTransportProperties* CSenServiceConnectionBCTest::CreateMSTransportPropertiesL(TMSCommands aCommand)
+    {
+#ifdef OLD_MSN_NAMESPACE_2005_08
+    _LIT8(KRegisterAct, "http://schemas.live.com/mws/2005/08/messaging/Register");
+    _LIT8(KInviteReqAct,"http://schemas.live.com/mws/2005/08/messaging/Invite");
+    _LIT8(KSendReqAct,"http://schemas.live.com/mws/2005/08/messaging/Message");
+#else
+    _LIT8(KRegisterAct, "http://schemas.live.com/mws/2006/10/messaging/Register");    
+    _LIT8(KInviteReqAct,"http://schemas.live.com/mws/2006/10/messaging/Invite");
+    _LIT8(KSendReqAct,"http://schemas.live.com/mws/2006/10/messaging/Message");          
+    
+#endif
+
+    CSenVtcpTransportProperties* pVtcpProperties = CSenVtcpTransportProperties::NewLC();
+    pVtcpProperties->SetProxyHostL(KMSNProxy);
+    //pVtcpProperties->SetOnewayMessageOnOffL(TRUE);
+    
+    pVtcpProperties->SetMwsNamespaceL(KMessagingNameSpace);
+        
+    switch (aCommand)
+        {
+        case EMSNMessengerRegister:
+            {    
+            pVtcpProperties->SetSoapActionL(KRegisterAct);
+            break;
+            }
+        case EMSNMessengerUnRegister:
+            {    
+            pVtcpProperties->SetSoapActionL(KRegisterAct);
+            break;
+            }
+        case EMSNMessengerInvite:
+            {    
+            pVtcpProperties->SetSoapActionL(KInviteReqAct);
+            break;
+            }
+        case EMSNMessengerSend:
+            {    
+            pVtcpProperties->SetSoapActionL(KSendReqAct);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    CleanupStack::Pop(pVtcpProperties);
+    
+    return pVtcpProperties;
+    }
+  */  
+CSenSoapMessage2* CSenServiceConnectionBCTest::CreateMSSoapMessage(TMSCommands aCommand)
+    {
+#ifdef OLD_MSN_NAMESPACE_2005_08    
+    _LIT8(KReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+    <sip:Expires>240</sip:Expires>\
+    <sip:AutoOffline>0</sip:AutoOffline>\
+    <sip:Capabilities>1074003969</sip:Capabilities>\
+    <sip:SubscribedNotifications>31</sip:SubscribedNotifications>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KUnReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+    <sip:Expires>0</sip:Expires>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KInviteReq,
+        "<sip:InviteRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+            <sip:Call>\
+                <mc:To xmlns:mc=\"http://schemas.live.com/mws/2005/08/contacts\">7553</mc:To>\
+            </sip:Call>\
+        </sip:InviteRequest>");
+    
+    _LIT8(KSendReq,          
+    "<sip:MessageRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+            <sip:Call>\
+                <sip:CallID>1</sip:CallID>\
+            </sip:Call>\
+            <sip:MessageObject sip:ContentType=\"text/plain\">\
+                <sip:MessageBody>lalamido</sip:MessageBody>\
+            </sip:MessageObject>\
+        </sip:MessageRequest>");
+#else
+    _LIT8(KReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+    <sip:Expires>240</sip:Expires>\
+    <sip:AutoOffline>0</sip:AutoOffline>\
+    <sip:Capabilities>1074003969</sip:Capabilities>\
+    <sip:SubscribedNotifications>31</sip:SubscribedNotifications>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+     
+    _LIT8(KUnReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+    <sip:Expires>0</sip:Expires>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KInviteReq,  
+        "<sip:InviteRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+            <sip:Call>\
+                <mc:To xmlns:mc=\"http://schemas.live.com/mws/2006/10/contacts\">4878</mc:To>\
+            </sip:Call>\
+        </sip:InviteRequest>");
+    
+    _LIT8(KSendReq,          
+    "<sip:MessageRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+            <sip:Call>\
+                <sip:CallID>1</sip:CallID>\
+            </sip:Call>\
+            <sip:MessageObject sip:ContentType=\"text/plain\">\
+                <sip:MessageBody>lalamido</sip:MessageBody>\
+            </sip:MessageObject>\
+        </sip:MessageRequest>");
+#endif    
+
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewLC(ESOAP12);
+
+    AddDeviceOptionsHeader2L(*pMessage);
+    
+    AddApplicationHeader2L(*pMessage);
+    
+    switch (aCommand)
+        {
+        case EMSNMessengerRegister:
+            {    
+            pMessage->SetBodyL(KReristerReq);
+            break;
+            }
+        case EMSNMessengerUnRegister:
+            {    
+            pMessage->SetBodyL(KUnReristerReq);
+            break;
+            }
+        case EMSNMessengerInvite:
+            {    
+            pMessage->SetBodyL(KInviteReq);
+            break;
+            }
+        case EMSNMessengerSend:
+            {    
+            pMessage->SetBodyL(KSendReq);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    CleanupStack::Pop(pMessage);
+        
+    return pMessage;
+    }
+
+TInt CSenServiceConnectionBCTest::RegisterSTSL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);                                           
+    manager->RegisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+
+TInt CSenServiceConnectionBCTest::RegisterSTSInvalidPasswordL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, _L8("Invalid"));                                           
+    manager->RegisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+
+TInt CSenServiceConnectionBCTest::UnregisterSTSL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //Unregister Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);                                           
+    manager->UnregisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //Unregister SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->UnregisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+    
+TInt CSenServiceConnectionBCTest::SetPolicyL( CSenXmlServiceDescription* pServDesc,
+                                           const TDesC8& pName,
+                                           const TDesC8& pValue)
+    {
+    CSenElement* servicePolicy = pServDesc->AsElement().Element(_L8("ServicePolicy")); 
+    CSenElement* clientPolicy = servicePolicy->Element(_L8("ClientPolicy"));     
+    if(!clientPolicy)
+        servicePolicy->AddElementL(_L8("ClientPolicy"));
+    clientPolicy = servicePolicy->Element(_L8("ClientPolicy"));
+
+    if(pValue==KNullDesC8())
+        {
+        clientPolicy->AddElementL(pName);
+        }
+        else
+        {
+        clientPolicy->AddElementL(pName).SetContentL(pValue);
+        }
+    }
+    
+TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceL()
+    {
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    CSenXmlServiceDescription* pServiceDesc = CSenXmlServiceDescription::NewLC(KMessagingEndpoint, KMessagingContract);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pServiceDesc->SetIapIdL(iapId);
+    
+    pServiceDesc->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pServiceDesc->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pServiceDesc, KPolicySOAP12, KNullDesC8);
+    SetPolicyL(pServiceDesc, KPolicyAdr,    KAddressing);
+    
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc, *this);
+    CleanupStack::PopAndDestroy(pServiceDesc);
+    }
+
+TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceWithoutCallbackL()
+    {
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    CSenXmlServiceDescription* pServiceDesc = CSenXmlServiceDescription::NewLC(KMessagingEndpoint, KMessagingContract);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pServiceDesc->SetIapIdL(iapId);
+
+
+    pServiceDesc->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pServiceDesc->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pServiceDesc, KPolicySOAP12, KNullDesC8);
+    SetPolicyL(pServiceDesc, KPolicyAdr,    KAddressing);
+    
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc);
+    CleanupStack::PopAndDestroy(pServiceDesc);
+    }
+
+TInt CSenServiceConnectionBCTest::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage)
+    {
+    TXmlEngElement header = aMessage.HeaderL();
+
+    TXmlEngElement deviceOp = header.AddNewElementL(_L8("DeviceOptions"),
+                                                    KMessagingNameSpace,
+                                                    _L8("mws"));
+
+    TXmlEngElement child = deviceOp.AddNewElementSameNsL(_L8("Locale"));
+    child.AddTextL(_L8("1033"));
+
+    TXmlEngElement child1 = deviceOp.AddNewElementSameNsL(_L8("UserAgent"));
+
+    TXmlEngElement child1_1 = child1.AddNewElementSameNsL(_L8("Manufacturer"));
+    child1_1.AddTextL(_L8("NO_UserAgent"));
+
+    TXmlEngElement child1_2 = child1.AddNewElementSameNsL(_L8("Model"));
+    child1_2.AddTextL(_L8("NO_Model"));
+
+    TXmlEngElement child1_3 = child1.AddNewElementSameNsL(_L8("OS"));
+
+    TXmlEngElement child1_3_1 = child1_3.AddNewElementSameNsL(_L8("Name"));
+    child1_3_1.AddTextL(_L8("NO_OS"));
+
+    TXmlEngElement child1_3_2 = child1_3.AddNewElementSameNsL(_L8("Version"));
+    child1_3_2.AddTextL(_L8("NO_Version"));
+    }
+
+TInt CSenServiceConnectionBCTest::AddApplicationHeader2L(CSenSoapMessage2& aMessage)
+    {
+    TXmlEngElement header = aMessage.HeaderL();
+
+    TXmlEngElement application = header.AddNewElementL(_L8("Application"),KMessagingNameSpace,_L8("mws"));
+
+    TXmlEngElement child = application.AddNewElementSameNsL(_L8("Name"));
+    child.AddTextL(_L8("NO_CLIENT"));
+
+    TXmlEngElement child1 = application.AddNewElementSameNsL(_L8("Vendor"));
+    child1.AddTextL(_L8("NO_VENDOR"));
+
+    TXmlEngElement child2 = application.AddNewElementSameNsL(_L8("Version"));
+    child2.AddTextL(_L8("NO_VERSION"));
+    }
+    
+TInt CSenServiceConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+TInt CSenServiceConnectionBCTest::StopActiveScheduler()
+    {
+  	iNumberOfPendingOps--;
+  	if ( iNumberOfPendingOps == 0 )
+      {
+      CActiveScheduler::Stop();
+      }	
+    }
+
+const CSenIdentityProvider* CSenServiceConnectionBCTest::IdentityProviderL() const
+    {
+    ((CSenServiceConnectionBCTest*)this)->iAuthInfoAskCounter++;
+    return ipProviderForAuthProvider;
+    }
+    
+void CSenServiceConnectionBCTest::HandleMessageL(const TDesC8& aMessage)
+    {
+    iLog->Log(_L("BCTest::HandleMessageL->> start"));  
+    iCallback = ECallbackHandleMessage;
+    
+    if ( ipMessage )
+    {
+    delete ipMessage;
+    ipMessage = NULL;
+    }
+    ipMessage = aMessage.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+    //Alr retry logic
+    if( iUseALR && (!isNewCarrierAccepted || !isMigratedToPrefferedCarrier) && iAlrCallBackRetryCount < 5 )
+        { 
+        TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+        iAlrCallBackRetryCount++;
+        iLog->Log(_L("BCTest::HandleMessageL->>Alr Retry SendL is called"));
+        return;
+        }
+    else if( (iUseALR && isNewCarrierAccepted && isMigratedToPrefferedCarrier) || iAlrCallBackRetryCount >= 5 )
+        {
+        iAlrCallBackRetryCount = 0;
+        iUseALR = EFalse;
+        iLog->Log(_L("BCTest::HandleMessageL->>Alr retry Done "));  
+        }
+    // Cobranding callback
+    if (iCoBrandingCallbackOption)
+        {
+        iCoBrandingCallbackOption=EFalse;
+        iLog->Log(_L("BCTest::HandleMessageL->>CoBrandingCallbackOption "));  
+        }
+    if(iGetDataTrafficDetails)
+        {
+        TSenDataTrafficDetails details;
+        TSenDataTrafficOperations operations;
+        iServiceConnection->DataTrafficDetails(details,operations);
+        TInt BytesSent = details.iTotalBytesSent;
+        TInt BytesRecieved = details.iTotalBytesRecieved;
+        }
+    
+    StopActiveScheduler();
+    iLog->Log(_L("BCTest::HandleMessageL->>End"));  
+    }
+
+void CSenServiceConnectionBCTest::HandleErrorL(const int aErrorCode, const TDesC8& aError)
+    {
+    iLog->Log(_L("BCTest::HandleErrorL->> start"));  
+    iCallback = ECallbackHandleError;
+    iErrorCode = aErrorCode;
+    
+    // debugging only - START
+    if( HTTPStatus::IsInformational( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EContinue) && (aStatus < HTTPStatus::EOk))
+        RDebug::Print(_L("- HTTP error code: IS INFORMATION."));
+        }
+    if( HTTPStatus::IsSuccessful( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EOk) && (aStatus < HTTPStatus::EMultipleChoices))
+        RDebug::Print(_L("- HTTP error code: IS SUCCESSFUL."));
+        }
+    if( HTTPStatus::IsRedirection( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EMultipleChoices) && (aStatus < HTTPStatus::EBadRequest))
+        RDebug::Print(_L("- HTTP error code: IS REDIRECTION."));
+        }
+    if( HTTPStatus::IsClientError( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EBadRequest) && (aStatus < HTTPStatus::EInternalServerError))
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }
+    if( HTTPStatus::IsServerError( this->iErrorCode ) )
+        {
+        // if(aStatus >= HTTPStatus::EInternalServerError)
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }    
+    // debuggin only - END
+    
+    if ( ipMessage )
+        {
+        delete ipMessage;
+        ipMessage = NULL;
+        }
+    ipMessage = aError.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+    
+    TBuf<70> errorMessage;
+    _LIT(KErrNotInitialized, "Connection isn't initialized.");
+    
+    switch(aErrorCode) 
+        {
+        case KErrSubmitting:
+            errorMessage = KErrNotInitialized;
+            break;
+        default:
+            break;
+        }
+    iUseALR = EFalse;
+    StopActiveScheduler();
+    
+    iLog->Log(_L("BCTest::HandleErrorL->>End"));  
+    }
+
+void CSenServiceConnectionBCTest::ErrorL(TInt aCode)
+    {
+    _LIT(KNotReady, "Connection is not ready.");
+    
+    TBuf<70> errorMessage;
+    switch(aCode) 
+        {
+        case EConnectionNotReady:
+            errorMessage = KNotReady;
+            break;
+        default:
+            break;
+        }
+    }
+
+void CSenServiceConnectionBCTest::SetStatus(const TInt aStatus)
+    {
+    iLog->Log(_L("BCTest::SetStatus-->start"));  
+    switch(aStatus)
+        {
+        case KSenConnectionStatusNew:
+        break;
+        case KSenConnectionStatusReady:
+            iInitialized = ETrue;
+            iLog->Log(_L("BCTest::SetStatus-->SenConnectionStatusReady"));  
+        break;
+        case KSenConnectionStatusExpired:
+        break;
+        default:
+        TBuf<32> num;
+        num.AppendNum(aStatus);
+        break;
+        }
+    if ( aStatus >= KSenConnectionStatusCreateFailed && aStatus <= KSenConnectionStatusMetadataExchange )
+        {
+        iConnectionState = aStatus;
+        if(!iInitialized)
+            {
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, ErrorL(EConnectionNotReady));
+            leaveCode = 0; // not used
+            }
+        StopActiveScheduler();
+        iLog->Log(_L("BCTest::SetStatus-->StopActiveScheduler()"));  
+        }
+    iLog->Log(_L("BCTest::SetStatus-->End"));  
+    }
+
+TInt CSenServiceConnectionBCTest::Find(const TDesC8& aDestination,
+                                    const TDesC8& aDescToFind,
+                                    TInt aStartingPos )
+    {
+    TInt descLength = aDescToFind.Length();
+    TInt length = aDestination.Length() - descLength + 1;
+    for (TInt i = aStartingPos; i < length ; i++)
+        {
+        if (  aDestination.Mid(i,descLength) == aDescToFind )
+            {
+            return i;
+            }
+        }
+        
+    return KErrNotFound;
+	}
+
+    
+TBool CSenServiceConnectionBCTest::ReplaceAll(TPtr8 aDestination,
+                                           const TDesC8& aFrom,
+                                           const TDesC8& aTo)
+    {
+    TInt retVal(EFalse);
+    
+    TInt pos = Find(aDestination, aFrom, 0);
+    if (pos != KErrNotFound) retVal = ETrue;
+    
+    while (pos != KErrNotFound)
+        {
+        aDestination.Replace(pos,aFrom.Length(),aTo);
+        pos = Find(aDestination, aFrom, pos+1);
+        }
+
+    return retVal;
+	}
+  
+    
+TBool CSenServiceConnectionBCTest::DecodeHttpCharactersL(const TDesC8& aOriginal,
+                                                      HBufC8*& aDecoded)
+    {
+    // Five basic entities as descriptors
+    _LIT8(KEscapedApos,     "&apos;");
+    _LIT8(KEscapedDblQuot,  "&quot;");
+    _LIT8(KEscapedGt,       "&gt;");
+    _LIT8(KEscapedLt,       "&lt;");
+    _LIT8(KEscapedAmp,      "&amp;");
+    
+    // XML-escaping chars as descriptors
+    _LIT8(KAmpersandDesC8,  "&");
+    _LIT8(KAposDesC8,       "\'");
+    _LIT8(KDblQuotDesC8,    "\"");
+    _LIT8(KGtDesC8,         ">");
+    _LIT8(KLtDesC8,         "<");
+    
+    delete aDecoded;
+    aDecoded = NULL;
+
+    // make a copy of the original
+    aDecoded = aOriginal.AllocL();
+
+    TBool retVal(EFalse);
+
+    // replace all five basic entities with XML escaping counterpart,
+    // if found.
+    if (ReplaceAll(aDecoded->Des(), KEscapedApos(), KAposDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedDblQuot(), KDblQuotDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedGt(), KGtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedLt(), KLtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedAmp(), KAmpersandDesC8()))
+        {
+        retVal = ETrue;
+        }
+
+    return retVal;
+    }
+
+HBufC8* CSenServiceConnectionBCTest::HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                                             const TDesC8& aPropertyName)
+    {
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    HBufC8* pRetBuf = NULL;
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    if ( pRequestElement )
+        {
+        CSenElement* pTPElement = pRequestElement->Element(_L8("TranportProperties"));
+        if ( pTPElement )
+            {
+            CSenElement* pElement = pTPElement->Element(aPropertyName);
+            if ( pElement )
+                {
+                pRetBuf = pElement->Content().AllocL();
+                CleanupStack::PushL(pRetBuf);
+                HBufC8* pNew = NULL;
+                DecodeHttpCharactersL(*pRetBuf, pNew);
+                CleanupStack::PopAndDestroy(pRetBuf);
+                pRetBuf = pNew;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    CleanupStack::PushL(pRetBuf);
+    return pRetBuf;
+    }
+    
+HBufC8* CSenServiceConnectionBCTest::ReadFileL(const TDesC& aFilename)
+    {
+    RFs fsSession;
+    CleanupClosePushL(fsSession);
+    User::LeaveIfError(fsSession.Connect() == NULL);
+    TEntry entry;
+    User::LeaveIfError(fsSession.Entry(aFilename,entry));
+    HBufC8* pFileContent = NULL;
+    RFileReadStream fileInStream;
+    CleanupClosePushL(fileInStream);
+    if (fileInStream.Open(fsSession,aFilename,EFileRead) == KErrNone)
+        {
+        HBufC8* pTempFileContent = HBufC8::NewLC(entry.iSize+10);
+        TRAPD(error,
+            fileInStream.ReadL((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            );
+            
+        if (!error)
+            {
+            TPtrC8 fileContent((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            pFileContent = fileContent.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pTempFileContent);
+        }
+    CleanupStack::PopAndDestroy(&fileInStream);
+    CleanupStack::PopAndDestroy(&fsSession);
+    return pFileContent;
+    }
+    
+TUint32 CSenServiceConnectionBCTest::SearchIAPIdByNameL( const TDesC& aIAPName )
+    {
+    TBool found = EFalse;
+    CCommsDatabase* pDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(pDB);
+    
+    //open internet accesspoint table
+    CCommsDbTableView* pDbTView = pDB->OpenTableLC(TPtrC(IAP));
+    TInt retVal = pDbTView->GotoFirstRecord();
+    TBuf<128> name; 
+    TUint32 id = 0;
+    //Find the correct record
+    while ( retVal == KErrNone && found == EFalse )
+        {
+        pDbTView->ReadTextL(TPtrC(COMMDB_NAME), name);
+        pDbTView->ReadUintL(TPtrC(COMMDB_ID), id);
+        found = ( name == aIAPName ); 
+        if ( !found )
+            {
+            retVal = pDbTView->GotoNextRecord();
+            }
+        }
+    CleanupStack::PopAndDestroy(pDbTView);
+    CleanupStack::PopAndDestroy(pDB);
+    return id;
+    }
+    
+CSenSoapMessage* CSenServiceConnectionBCTest::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+    
+CSenSoapMessage2* CSenServiceConnectionBCTest::CreateNewAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    /*CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    //pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);*/
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+
+void CSenServiceConnectionBCTest::SetupL(  )
+    {
+    __UHEAP_MARK;
+
+    RFile file;
+    RFs iFsSession;
+    _LIT(KFileName,"c:\\testing\\data\\rest.on");
+    
+   
+    User::LeaveIfError(iFsSession.Connect());
+        
+    TInt fileOP = file.Open(iFsSession,KFileName,EFileRead);
+    if (fileOP == KErrNone) 
+        {
+        RDebug::Print( _L( "Found rest.on file => using RESTful framework" ) ); 
+        file.Close();
+        ipFrameworkID = HBufC8::NewL(KRESTFrameworkID().Length());
+        ipFrameworkID->Des().Append(KRESTFrameworkID);
+        }
+    else
+        {
+        RDebug::Print( _L( "File rest.on not found => defaulting to WS-I" ) ); 
+        ipFrameworkID = HBufC8::NewL(KWSIFrameworkID().Length());
+        ipFrameworkID->Des().Append(KWSIFrameworkID);
+        }
+    iFsSession.Close();
+    
+    iCallback = ECallbackNone;
+    }
+
+void CSenServiceConnectionBCTest::Teardown(  )
+    {
+    delete ipFrameworkID;
+    ipFrameworkID = NULL;
+    delete ipMessage;
+    ipMessage = NULL;
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    
+    if(iServiceConnection!=NULL)
+        {
+        delete iServiceConnection;
+        iServiceConnection=NULL;
+        }
+    
+    if(iSOAPMessage!=NULL)
+        {
+        delete iSOAPMessage;
+        iSOAPMessage=NULL;
+        }    
+    
+    __UHEAP_MARKEND;
+    }
+
+/*
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_RegisterIdentityProviderLL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iManager = CSenServiceManager::NewL();
+    STIFF_ASSERT_NOT_EQUALS_DESC(iManager, (CSenServiceManager*)NULL, "The test is failed.");
+
+    CSenIdentityProvider* idp = CSenIdentityProvider::NewLC(
+        KAuthServEndpoint, KASContract);
+
+    // Set the Provider ID
+    idp->SetProviderID(KASProviderID);
+
+    // Associate Forum Nokia's Addressbook service ID (contract)
+    // to this Identity Provider
+    idp->SetServiceID(KWSPContract);
+
+    // Set Liberty ID-WSF framework ID
+    idp->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+
+    // ------------------------------------------------------------------------
+    // The following username/password properties will be used for
+    // authentication. Please note, that use advisory authentication
+    // id "IMEI" would result device ID to be directly fetched from phone.
+    // ------------------------------------------------------------------------
+    //
+    
+#if SYSOPENDIGIA_ADDRESSBOOK_SERVICE    
+    idp->SetUserInfoL(KNullDesC8, KTestAuthzID, KTestPassword);
+#else
+    idp->SetUserInfoL(KTestAuthzID, KNullDesC8, KTestPassword);
+#endif    
+    
+    TL((iManager->RegisterIdentityProviderL(*idp)) == KErrNone);
+    TL((iManager->RegisterServiceDescriptionL(*idp)) == KErrNone);
+
+    CleanupStack::PopAndDestroy(idp); 
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete iManager);
+    iManager = NULL;
+    Teardown();
+    return KErrNone;
+	}
+*/
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookContract);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL( TTestResult& aResult )
+    {
+    
+    SetupL() ;
+    iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookContract);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+    
+    
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pSenServicePattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //pSenServicePattern->SetContractL(KAuthServEndpoint);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pSenServicePattern);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pSenServicePattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSenServicePattern);
+    pSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* aSenServicePattern = CSenServicePattern::NewL(KAuthServEndpoint, KNullDesC8());
+    aSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //aSenServicePattern->SetContractL(KAuthServEndpoint);
+
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *aSenServicePattern);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    delete aSenServicePattern;
+    aSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAddressBookServiceId, KNullDesC8());
+    pPattern->SetFrameworkIdL(KIDWSFFrameworkID);    
+    pPattern->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pPattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pPattern);
+    pPattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAddressBookServiceId, KNullDesC8());
+    pPattern->SetFrameworkIdL(KIDWSFFrameworkID);    
+    pPattern->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *pPattern);
+    StartActiveScheduler(1);
+    
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pPattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pPattern);
+    pPattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookContract, provider);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL1( TTestResult& aResult )
+    {
+    
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookContract, provider);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+    
+    
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    CSenServicePattern* pSenServicePattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //pSenServicePattern->SetContractL(KAuthServEndpoint);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pSenServicePattern, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pSenServicePattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSenServicePattern);
+    pSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    CSenServicePattern* aSenServicePattern = CSenServicePattern::NewL(KAuthServEndpoint, KNullDesC8());
+    aSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //aSenServicePattern->SetContractL(KAuthServEndpoint);
+
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *aSenServicePattern, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    delete aSenServicePattern;
+    aSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL_IPCBigrequest( TTestResult& aResult )
+{
+	SetupL() ;
+	 TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenServicePattern::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KIPCServiceEndPoint);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	//iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+		User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+
+	retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead);
+	
+	CleanupClosePushL(iRFileHandle);
+	TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle);
+	//LOCAL_ASSERT(transactionIdOrError2 > KErrNone);
+	if (transactionIdOrError!=KErrArgument)
+	StartActiveScheduler(1);
+	CleanupStack::Pop(&iRFileHandle);
+		if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	iSenXmlServiceDescription = NULL;
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	Teardown();
+	return KErrNone;
+		
+}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_IPCBigrequest( TTestResult& aResult )
+{
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenServicePattern::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KIPCServiceEndPoint);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+		User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+
+	retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead);
+	
+	CleanupClosePushL(iRFileHandle);
+	HBufC8 *pMsgBuf = NULL;// Buffer to get response
+	TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf);
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	if(pMsgBuf)
+		{
+	//	CleanupStack::PopAndDestroy(pMsgBuf);//clean response
+		delete pMsgBuf;
+		pMsgBuf = NULL;
+		}
+	CleanupStack::PopAndDestroy(&iRFileHandle);
+		if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	iSenXmlServiceDescription = NULL;
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	Teardown();
+	return KErrNone;
+		
+}
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_MTOM( TTestResult& aResult )
+{
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenServicePattern::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KMtomEndPoint);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+		User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+
+	retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\testPic9.jpg"), EFileStream|EFileRead);
+	
+	CleanupClosePushL(iRFileHandle);
+	HBufC8 *pMsgBuf = NULL;// Buffer to get response
+	TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf);
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	if(pMsgBuf)
+		{
+		RFs logSession;
+		RFile Mtomlog;
+		User::LeaveIfError(logSession.Connect());//ani
+
+	//	CleanupStack::PopAndDestroy(pMsgBuf);//clean response
+		TInt err = Mtomlog.Create(iFsSessionHandle, _L("c:\\private\\101FB3E7\\MTOM.txt"), EFileWrite);
+		TInt pos=0 ;
+	    Mtomlog.Seek(ESeekEnd,pos);
+	   // _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	    TBuf8<4096> temp=pMsgBuf->Des();
+		Mtomlog.Write(temp);
+	 	Mtomlog.Close();
+	 	CleanupStack::PopAndDestroy(&Mtomlog);
+		if(logSession.Handle())
+    	logSession.Close(); 
+
+	 	
+		delete pMsgBuf;
+		pMsgBuf = NULL;
+		}
+	CleanupStack::PopAndDestroy(&iRFileHandle);
+		if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	iSenXmlServiceDescription = NULL;
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	Teardown();
+	return KErrNone;
+		
+}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult )
+    {
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	TInt err(KErrNone);
+
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+	User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+	err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead);
+	CleanupClosePushL(iRFileHandle);
+	HBufC8 *pMsgBuf = NULL;
+	TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf);
+	if(pMsgBuf)
+	{
+	//	CleanupStack::PopAndDestroy(pMsgBuf);//clean response
+	delete pMsgBuf;
+	pMsgBuf = NULL;
+	
+	}
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	//StartActiveScheduler(1);
+	CleanupStack::Pop(&iRFileHandle);
+	if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+    
+	CleanupStack::Pop(iServiceConnection);
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+		
+	 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	 iSenXmlServiceDescription = NULL;
+
+//	iRFileHandle.Close();
+	Teardown();
+	return KErrNone;
+	}
+	
+		//New Test Case SendL with RFile
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult )
+    {
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	TInt err(KErrNone);
+
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+	/*
+	_LIT16(KRFileSrc,"c\\private\\101FB3E7\\Test.txt");
+ 	TInt err = iRFileHandle.Open(iFsSessionHandle,_L("c:\\private\\101FB3E7\\Test.txt"),EFileWrite);
+    if(err !=KErrNone)
+	err = iRFileHandle.Create(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileWrite);
+	TInt pos=0 ;
+    iRFileHandle.Seek(ESeekEnd,pos);
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	iRFileHandle.Write(KRequest);
+ 	iRFileHandle.Close();
+ 	*/
+ 	User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+	err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead);
+	CleanupClosePushL(iRFileHandle);
+	TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle);
+	if (transactionIdOrError == KErrNone)
+	    StartActiveScheduler(1);
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	
+	CleanupStack::PopAndDestroy(&iRFileHandle);
+	if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+	CleanupStack::Pop(iServiceConnection);
+		__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	 iSenXmlServiceDescription = NULL;
+
+
+	Teardown();
+	return KErrNone;
+	}
+	
+	
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnectionSnapIdL( TTestResult& aResult )
+{
+    SetupL() ;
+    
+    TUint32 snapId=11;
+     TUint32 retSnapId;
+    
+	CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();
+     pHttpProperties->SetSnapIdL(snapId);               
+     pHttpProperties->SnapIdL(retSnapId);
+     TL(retSnapId==snapId);
+      CleanupStack::PopAndDestroy(pHttpProperties) ;//   
+	Teardown();
+	return KErrNone;
+}	
+TAny* CSenServiceConnectionBCTest::GetInterfaceByUid( TUid aUID )
+	{
+		iLog->Log(_L("GetInterfaceByUid()->start"));
+#ifdef __ENABLE_ALR__		
+	if ( (aUID == KSenInterfaceUidAlrObserver) && iUseALR)
+        {
+        MSenAlrServiceConnection* observer = (MSenAlrServiceConnection*) this;
+        	iLog->Log(_L("Alr observer is set "));
+        return observer;
+        }
+#endif //__ENABLE_ALR__        
+	if ( (aUID == KSenInterfaceUidCoBrandingObserver) && iCoBrandingCallbackOption)
+        {
+        // return this; // wrong, please cast first to M-class  (if same C-class implements multiple extended interfaces (M-classes))
+        MSenCoBrandingObserver* observer = (MSenCoBrandingObserver*) this;
+        iLog->Log(_L("CoBrand observer is set "));
+        return observer;
+        }
+   if ( (aUID == KSenInterfaceUidHostletConsumer) && iHostletConsumerOption)
+        {
+        // return this; // wrong, please cast first to M-class  (if same C-class implements multiple extended interfaces (M-classes))
+        MSenHostletConsumer* observer = (MSenHostletConsumer*) this;
+        iLog->Log(_L("Hostlet Consumer is set "));
+        return observer;
+        }
+	        
+	   iLog->Log(_L("GetInterfaceByUid()->End with out set observer "));      
+	return NULL;
+	}
+
+
+/*
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_NoErrorL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = iServiceConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    StartActiveScheduler(1);
+
+    TL(iTransactionId == transactionIdOrError);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CancelL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = iServiceConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    iServiceConnection->CancelTransaction(transactionIdOrError);
+    
+    StartActiveScheduler(1);
+
+    TL(iTransactionId == transactionIdOrError);
+    LOCAL_ASSERT(iErrorCode == KErrSenCancelled);
+    
+    User::After(2000000);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ConNotInitialL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TL((iServiceConnection->SendL(KRequest)) == KErrSenNotInitialized);
+    StartActiveScheduler(1);
+    
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendMultipleMessagesL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Get (using SetTransportPropertiesL)
+    // ****************************************
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    
+    CleanupStack::PushL(pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    //pHttpProperties->SetOmittedL(KIapIdLocalName, ETrue);
+    //pSerializedProperties = pHttpProperties->AsUtf8L();
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(10);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // 1. SendL(MSG [SC::POST by default])  
+    // 2. SendL(MSG, TP::GET),
+    // 3. SendL(MSG, TP::POST)
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Get
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+    
+    // Check from HTTP Transaction logger log that GET method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    // Http Post
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // 1. SetTransportPropertiesL(TP::GET)
+    // 2. SendL(MSG) - Send(MSG, TP::POST)
+    // 3. SendL (MSG [SC::GET])
+    // 4. SetTransportPropertiesL(TP:POST)
+    // 5. SendL(MSG [SC:POST]
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Get (using SetTransportPropertiesL)
+    // ****************************************
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+
+    // Check from HTTP Transaction logger log that GET method were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Post (using TransportProperties in SendL parameters)
+    // *********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that Post method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Get (using TransportProperties in SendL parameters)
+    // ********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+    
+    // Check from HTTP Transaction logger log that GET method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    // Http Post (using SetTransportPropertiesL)
+    // *****************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that Post method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);        
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Post (using TransportProperties in SendL parameters)
+    // *********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetProxy via Set(TP)
+    // ********************
+    // 1. SetTransportProperties(TP::PROXY)
+    // 2. SendL(MSG)    _LIT8(KSoapAction,              "SOAPAction");
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "SoapEnvelopeAction");
+    _LIT8(KSoapActionReturnValue,   "\"SoapEnvelopeAction\"");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+
+
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    
+    // Now the code execution has returned in here (either HandleMessageL or HandleErrorL was invoked)
+    
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetProxyHostL(KProxyHost);
+    pHttpProperties->SetProxyPortL(KProxyPort);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetProxy via SendL(MSG, TP)
+    // ***************************
+    // 1. SendL(MSG, TP::PROXY)
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "SoapEnvelopeAction");
+    _LIT8(KSoapActionReturnValue,   "\"SoapEnvelopeAction\"");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetProxyHostL(KProxyHost);
+    pHttpProperties->SetProxyPortL(KProxyPort);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // ServicePattern::SetConsumerIapIdL(IAP_ID)
+    // *****************************************
+    // 1. Create new Service Pattern (SPatt)
+    // 2. SPatt::SetConsumerIapIdL(IAP_ID)
+    // 3. Instantiate new SC, wait for SetStatus(READY)
+    // 4. SendL(MSG)  using selected IAP
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+    
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP:IAP_ID)         NOTE: this test case requires user interaction!!!
+    // *******************************************************************************
+    // 1. Instantiate new SC, wait for SetStatus(READY) [IAP is prompted from end user!]
+    // 2. TP::SetIapIdL(IAP_ID)
+    // 3. SendL(MSG, TP::IAP_ID)  using selected IAP
+    // 4. SendL(MSG)  -- should prompt the IAP from the end-user
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+    
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP3L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetTransportPropertiesL(TP::IAP_ID)
+    // 1. SetTransportPropertiesL(TP::IAP_ID)
+    // 2. SendL(MSG)  using selected IAP
+    // 3. TP:SetOmittedL(IAP_ID)
+    // 4. SendL(MSG, TP::IAP_ID-Omitted) -- should prompt the IAP from the end-user    
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 1. SetTransportPropertiesL(TP::IAP_ID)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    // 2. SendL(MSG)  using selected IAP
+    iServiceConnection->SendL(*pSOAPMessage);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    // 3. TP:SetOmittedL(IAP_ID)
+    //pHttpProperties->SetOmittedL(KIapIdLocalName, ETrue);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    // 4. SendL(MSG, TP::IAP_ID-Omitted) -- should prompt the IAP from the end-user    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP::Content-Type)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective content-type
+    // 2. TP::SetContentTypeIdL(Content-Type)
+    // 3. SendL(MSG, TP::Content-Type)  // check that selected Content-Type is used
+    // 4. SendL(MSG) // original content type should be used (from step 1)
+
+    _LIT8(KContentTypeValue, "text");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    HBufC8* pOriginalContentType = NULL; 
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective content-type
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 contentType;
+        TInt retVal = pReadHttpProperties->ContentTypeL(contentType);
+        if ( retVal == KErrNone )
+            {
+            pOriginalContentType = contentType.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+        
+    LOCAL_ASSERT(pOriginalContentType != NULL); // Content-type is a MUST for every transport
+        
+    if ( pOriginalContentType )
+        {
+        CleanupStack::PushL(pOriginalContentType);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. TP::SetContentTypeIdL(Content-Type)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetContentTypeL(KContentTypeValue);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+
+    // 3. SendL(MSG, TP::Content-Type)  // check that selected Content-Type is used
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+       
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    // 4. SendL(MSG) // original content type should be used (from step 1)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue && pOriginalContentType )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalContentType);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+
+    if ( pOriginalContentType )
+        {
+        CleanupStack::PopAndDestroy(pOriginalContentType);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;    
+    }
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetTransportPropertiesL(TP::Content-Type)
+    // 1. Get TP via SC:TransportPropertiesL()
+    // 2. SendL(MSG), Content-Type got from step 1 should be effective
+    // 3. SetTransportPropertiesL(TP::Content-Type) // change content-type
+    // 4. SendL(MSG)  // check new content-type
+    // 5. SendL(MSG, TP:Content-Type)  // check *third* kind of content-type
+
+    _LIT8(KContentTypeValue1, "text");
+    _LIT8(KContentTypeValue2, "xml");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL()
+    TPtrC8 contentType;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->ContentTypeL(contentType);
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG), Content-Type got from step 1 should be effective
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // 3. SetTransportPropertiesL(TP::Content-Type) // change content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetContentTypeL(KContentTypeValue1);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 4. SendL(MSG)  // check new content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue1);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. SendL(MSG, TP:Content-Type)  // check *third* kind of content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetContentTypeL(KContentTypeValue2);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue2);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP::User-Agent)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective User-Agent
+    // 2. TP::SetUserAgentL(User-Agent)
+    // 3. SendL(MSG, TP::User-Agent)  // check that selected User-Agentis used
+    // 4. SendL(MSG) // original User-Agent should be used (from step 1)
+
+    _LIT8(KUserAgentValue, "TestAgent");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective User-Agent
+    HBufC8* pOriginalUserAgent = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        TPtrC8 userAgent;
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->UserAgentL(userAgent);
+        pOriginalUserAgent = userAgent.AllocL();
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        CleanupStack::PushL(pOriginalUserAgent);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. TP::SetUserAgentL(User-Agent)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+
+    // 3. SendL(MSG, TP::User-Agent)  // check that selected User-Agent is used
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that selected User-Agent were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SendL(MSG) // original User-Agent should be used (from step 1)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    if ( pValue && pOriginalUserAgent )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalUserAgent);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalUserAgent )
+        {
+        CleanupStack::PopAndDestroy(pOriginalUserAgent);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetTransportPropertiesL(TP:User-Agent)
+    // 1. Get TP via SC:TransportPropertiesL() // store original user-agent
+    // 2. SendL(MSG); // check User-Agent from step 1 is sent/used
+    // 3. SetTransportPropertiesL(TP::User-Agent) // change user-agent
+    // 4. SendL(MSG, TP::User-Agent) // change user agent, check that it is used
+    // 5. SendL(MSG); // check that set User-Agent is used, from step 3
+
+    _LIT8(KUserAgentValue1, "TestAgent1");
+    _LIT8(KUserAgentValue2, "TestAgent2");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store original user-agent
+    HBufC8* pOriginalUserAgent = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        TPtrC8 userAgent;
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->UserAgentL(userAgent);
+        pOriginalUserAgent = userAgent.AllocL();
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        CleanupStack::PushL(pOriginalUserAgent);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG); // check User-Agent from step 1 is sent/used
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that original User-Agent were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+
+    if ( pValue && pOriginalUserAgent )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalUserAgent);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 3. SetTransportPropertiesL(TP::User-Agent) // change user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue1);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 4. SendL(MSG, TP::User-Agent) // change user agent, check that it is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue2);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that defined User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue2);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. SendL(MSG); // check that set User-Agent is used, from step 3
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that defined (in step 3) User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue1);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalUserAgent )
+        {
+        CleanupStack::PopAndDestroy(pOriginalUserAgent);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_MessageSoapActionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "MessageAction");
+    _LIT8(KSoapActionReturnValue,   "\"MessageAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP:SOAPAction)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective SOAPAction
+    // 2. TP::SetSoapActionL(SOAPAction)
+    // 3. SendL(MSG, TP::SOAPAction)  // check that selected SOAPAction is used
+    // 4. SendL(MSG) // original SOAPAction should be used (from step 1)    
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "MessagePropertyAction");
+    _LIT8(KSoapActionReturnValue,   "\"MessagePropertyAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective SOAPAction
+    HBufC8* pOriginalSoapAction = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 soapAction(KNullDesC8);
+        TInt retVal = pReadHttpProperties->SoapActionL(soapAction);
+        if ( retVal == KErrNone )
+            {
+            pOriginalSoapAction = soapAction.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+        
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PushL(pOriginalSoapAction);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    
+    // 2. TP::SetSoapActionL(SOAPAction)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KSoapActionValue);
+    
+    // 3. SendL(MSG, TP::SOAPAction)  // check that selected SOAPAction is used
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // 4. SendL(MSG) // original SOAPAction should be used (from step 1)    
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original SoapAction is used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    
+    if( pValue && pOriginalSoapAction )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalSoapAction);
+        }
+//    else if ( pValue )
+//        {
+        // This is temporary: the default "" SOAPAction value has been removed from HTTPC:
+        // also WS-I, REST and ID-WSF define this "" -value only on ::SendL (in message layer!)
+        // This means, that "original soap action" from SC does not CURRENTLY yet provide the
+        // framework default(!)
+//        LOCAL_ASSERT( *pValue ==  KSenSoapActionHeaderValueEmpty ) // default from framework.
+//        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PopAndDestroy(pOriginalSoapAction);
+        }    
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(SOAP-ENV::SOAPAction)
+    // 1. Get TP via SC:TransportPropertiesL() // store original soap-action
+    // 2. SendL(SOAP-ENV::SOAPAction); // check SOAPAction from SoapEnvelope is sent/used
+    // 3. SendL(MSG); // check that original SOAPACtion is used, from step 1
+    // 4. SetTransportProperties(TP::SOAPAction2);
+    // 5. SendL(MSG); // check that previous SC::SOAPAction is used, from step 4
+    // 6. SendL(MSG, TP:SOAPAction); // check that TP:SOAPAction is used
+    // 7. SendL(SOAP-ENV::SOAPAction); // check that SOAP-ENV:SOAPAction is used
+    // 8. SendL(SOAP-ENV); // check that previous SC::SOAPAction is used, from step 4
+    // 9. SendL(SOAP-ENV, TP::SOAPAction); // check that new TP::SOAPAction is used
+    // 10. SendL(SOAP-ENV:SOAPAction, TP::SOAPAction ); // both are set: check that SOAP-ENV:SOAPAction is used, over-riding TP
+    // 11. SendL(SOAP-ENV:SOAPAction ); SC::SOAPAction // only SOAP-ENV::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // 12. SendL(MSG, TP:SOAPAction ); SC::SOAPAction // only TP::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    
+    _LIT8(KSoapAction,                      "SOAPAction");
+    _LIT8(KEnvelopeSoapActionValue,         "EnvelopeAction");
+    _LIT8(KEnvelopeSoapActionReturnValue,   "\"EnvelopeAction\"");
+    _LIT8(KSessionSoapActionValue,          "SessionAction");
+    _LIT8(KSessionSoapActionReturnValue,    "\"SessionAction\"");
+    _LIT8(KMessageSoapActionValue,          "MessageAction");
+    _LIT8(KMessageSoapActionReturnValue,    "\"MessageAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Get TP via SC:TransportPropertiesL() // store original soap-action
+    HBufC8* pOriginalSoapAction = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 soapAction(KNullDesC8);
+        TInt retVal = pReadHttpProperties->SoapActionL(soapAction);
+        if ( retVal == KErrNone )
+            {
+            pOriginalSoapAction = soapAction.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PushL(pOriginalSoapAction);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    
+    // 2. SendL(SOAP-ENV::SOAPAction); // check SOAPAction from SoapEnvelope is sent/used
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG); // check that original SOAPACtion is used, from step 1
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue && pOriginalSoapAction )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalSoapAction);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SetTransportProperties(TP::SOAPAction2);
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KSessionSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // 5. SendL(MSG); // check that previous SC::SOAPAction is used, from step 4
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+    
+    // Check from HTTP Transaction logger log that defined (in step 4.) SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSessionSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    // 6. SendL(MSG, TP:SOAPAction); // check that TP:SOAPAction is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 7. SendL(SOAP-ENV::SOAPAction); // check that SOAP-ENV:SOAPAction is used
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+    
+    // 8. SendL(SOAP-ENV); // check that previous SC::SOAPAction is used, from step 4
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined (in step 4.) SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSessionSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 9. SendL(SOAP-ENV, TP::SOAPAction); // check that new TP::SOAPAction is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 10. SendL(SOAP-ENV:SOAPAction, TP::SOAPAction); // both are set: check that SOAP-ENV:SOAPAction is used, over-riding TP
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+
+    // 11. SendL(SOAP-ENV:SOAPAction ); SC::SOAPAction // only SOAP-ENV::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // Note: SOAPAction for ServiceConnection was defined in step 4.
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+    
+    // 12. SendL(MSG, TP:SOAPAction ); SC::SOAPAction // only TP::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // Note: SOAPAction for ServiceConnection was defined in step 4.
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PopAndDestroy(pOriginalSoapAction);
+        }    
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CustomHttpHeaderL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Set custom HTTP header
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE  (value should include Scandic characters, like Ä and Ö)
+    // 2. Get TP using SC:TransportPropertiesL()
+    // 3. SendL(MSG) // see that CUSTOM_HTTP_HEADER -field is not present
+    // 4. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that http filter logs CUSTOM_HTTP_HEADER
+    // 5. Define TP::CUSTOM_HTTP_HEADER_VALUE2 (for already existing CUSTOM_HTTP_HEADER_NAME)
+    // 6. Call SC::SetTransportPropertiesL(TP::CUSTOM_HTTP_HEADER_VALUE2) // VALUE2 should containt basic XML entities -- escapes like &, <, >, '   etc..
+    // 7. SendL(MSG) // see that TP::CUSTOM_HTTP_HEADER_VALUE2 is effective
+
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE  (value should include Scandic characters, like Ä and Ö)
+    _LIT8(KCustomHttpHeader,        "CustomHeader");
+    _LIT8(KCustomHttpHeaderValue1,  "CustomHeaderValue1ÅÄÖåäö"); // UTF8 String which contains: "CustomHeaderValue1ÅÄÖåäö"
+    _LIT8(KCustomHttpHeaderValue2,  "CustomHeaderValue2<>&");
+    HBufC8* pEncoded = SenXmlUtils::EncodeHttpCharactersLC(KCustomHttpHeaderValue2);
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG) // see that CUSTOM_HTTP_HEADER -field is not present
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was not used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(pValue == NULL);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that http filter logs CUSTOM_HTTP_HEADER
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, KCustomHttpHeaderValue1);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KCustomHttpHeaderValue1);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. Define TP::CUSTOM_HTTP_HEADER_VALUE2 (for already existing CUSTOM_HTTP_HEADER_NAME)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, *pEncoded);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    // 6. Call SC::SetTransportPropertiesL(TP::CUSTOM_HTTP_HEADER_VALUE2) // VALUE2 should containt basic XML entities -- escapes like &, <, >, '   etc..
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 7. SendL(MSG) // see that TP::CUSTOM_HTTP_HEADER_VALUE2 is effective
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    RDebug::RawPrint( *pValue );
+    if ( pValue )
+        {
+        RDebug::Print( _L("ENCODED:") );
+        RDebug::RawPrint( *pEncoded );
+        RDebug::Print( _L("OUTPUT:") );
+        RDebug::RawPrint( *pValue );
+        LOCAL_ASSERT(*pValue == *pEncoded);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(pEncoded);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries1( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    //_LIT8(KCustomHttpHeaderValue, ); // NULL cannot be used as descriptor literal value in Symbian
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KNullDesC8);
+    //TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries2( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    // _LIT8(KCustomHttpHeader,); // NULL cannot be used as descriptor literal value in Symbian => it is more important to test KNullDesC8 (zero-length inputs etc)
+    _LIT8(KCustomHttpHeader, "X"); // property name's length = 1
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue"); 
+    
+    // Note: XML specs do not allow <Element> (tag name) to have zero-length.
+
+    // It is not a bad idea to create such a test case, where GOAL is actually test the http property class 
+    // itself (public DLL which is run by client app process); Utils DLL should maybe leave after it has been made to 
+    // regocnize illegal inputs. All the might check special chars, BUT --NOTE-- it would make the setters quite much 
+    // heavier (in terms of performance) if the key names (xml tag names) are first validated.
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KNullDesC8, KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries3( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader, "CustomHeader");
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KNullDesC8);
+    //NOTE: --> we could create test case for length==1 case: _LIT8(KCustomHttpHeaderValue, "Y"); // property value's length = 1
+    // _LIT8(KCustomHttpHeaderValue,  ""); // == KNullDesC8 
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries4( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    //_LIT8(KCustomHttpHeader,""); // == KNullDesC8
+    _LIT8(KCustomHttpHeader, "X"); // property name's length = 1
+    _LIT8(KCustomHttpHeaderValue, "CustomHeaderValue"); 
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KNullDesC8, KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+   
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries5( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8(KCustomHttpHeaderValue,  "256HeaderValuexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries6( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    // Note: property name used to start with number here => changed, since it is against XML specs (property names are XML tags, parser does not accept tags which start by a number)
+
+    // It is not a bad idea to create such a test case, where GOAL is actually test the http property class 
+    // itself (public DLL which is run by client app process); Utils DLL should maybe leave after it has been made to 
+    // regocnize illegal inputs. All the might check special chars, BUT --NOTE-- it would make the setters quite much 
+    // heavier (in terms of performance) if the key names (xml tag names) are first validated.
+    _LIT8(KCustomHttpHeader,"Header256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries7( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"Header256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    _LIT8(KCustomHttpHeaderValue,  "256HeaderValuexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries8( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8( KCRLFSP,       "\r\n " );
+    //_LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue55"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCRLFSP);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries9( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue1, CustomHeaderValue2"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+//Befor executing this TL remember to set big enought TimeOut value (10 min.)
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_SecDialog(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+               
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHttpsEndPoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+   
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL(ETrue);
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSecureDialogL(EFalse);
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial == EFalse);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_True(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL( ETrue );
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    pHttpProperties->SetOmittedL(KSecureDialogLocalName,ETrue);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog Omitted=\"true\">true</SecureDialog>"));
+    TL(cmpVal != KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_False(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL( ETrue );
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    pHttpProperties->SetOmittedL(KSecureDialogLocalName, EFalse);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog Omitted=\"false\">true</SecureDialog>"));
+    TL(cmpVal != KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Removed(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL(ETrue);
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    pHttpProperties->RemovePropertyL(KSecureDialogLocalName);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog>"));
+    TL(cmpVal == KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omit_Rem(TTestResult& aResult)
+    {
+    SetupL() ;
+    _LIT8(KUserAgentValue,          "TestAgent");
+    _LIT8(KUserAgentDefaultValue,   "Serene");
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG) // with set user-agent
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //3. Check from HTTP Transaction logger log that user-agent was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    
+    // 4. SendL(MSG) // with removed user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->RemovePropertyL(KUserAgentLocalName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //5. Check from HTTP Transaction logger log that user-agent was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue != KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);        
+    
+    
+    // 6. SendL(MSG) // with omitted set to EFalse for user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->SetOmittedL(KUserAgentLocalName, EFalse);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //7. Check from HTTP Transaction logger log that given user-agent
+    //   was used (when EFalse was given as Omitted value).
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);            
+    
+    // 8. SendL(MSG) // with omitted set to ETrue for user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->SetOmittedL(KUserAgentLocalName, ETrue);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //9. Check from HTTP Transaction logger log that 
+    //   default user-agent for HTTP Transport plugin was
+    //   used instead of user-agent which was set together
+    //   with omitted value ETrue.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentDefaultValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);                
+
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\fileContainer.txt" );
+    _LIT8(  KFileContent,  "Test FileContainer1" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Replace(rfs, KTestFileName, EFileWrite));
+    User::LeaveIfError(file.Write(KFileContent));
+    file.Flush();
+    file.Close();
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    // Check from HTTP Transaction logger log that POST method was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;    
+    }
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\fileContainer.txt" );
+    _LIT8(  KFileContent,  "Test FileContainer1" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Replace(rfs, KTestFileName, EFileWrite));
+    User::LeaveIfError(file.Write(KFileContent));
+    file.Flush();
+    file.Close();
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+                                                                               _L8("xmlmime"));
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pSOAPMessage->SetProperties(pHttpProperties);
+    CleanupStack::Pop(pHttpProperties); // ownership was transferred to message
+        
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    // Check from HTTP Transaction logger log that POST method was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset2.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\Winter2.jpg" );
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\Winter.jpg" );
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");    
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\testPic3.jpg");
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+   
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");    
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\testPic4.jpg");
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+   
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessengerL( TTestResult& aResult )
+    {
+    SetupL() ;
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    CSenServiceManager* pManager = CSenServiceManager::NewLC();
+
+    // Get used IdentityProvider from ServiceConnection
+    CSenIdentityProvider* pIdp = NULL;
+    iServiceConnection->IdentityProviderL(pIdp);
+    CleanupStack::PushL(pIdp);
+        
+    // Get used Credential from Credentials DB
+    RCredentialArray credentialArray;
+    CleanupClosePushL(credentialArray);
+    RCredentialPropertiesArray credentialPropertiesArray;
+    CleanupClosePushL(credentialPropertiesArray);
+    LOCAL_ASSERT((pManager->CredentialsL(KMessagingEndpoint, *pIdp,
+                                         credentialArray,
+                                         credentialPropertiesArray)) == KErrNone);
+                                         
+    // Check that atleast one Credential were found.
+    LOCAL_ASSERT(credentialArray.Count() > 0);
+    
+    CleanupStack::Pop(&credentialPropertiesArray);
+    CleanupStack::Pop(&credentialArray);
+    CleanupStack::Pop(pIdp);
+    CleanupStack::PopAndDestroy(pManager);   
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+
+    CleanupStack::PushL(pIdp);
+    CleanupClosePushL(credentialArray);
+    CleanupClosePushL(credentialPropertiesArray);
+
+    // Clean DBs STARTS
+    //      1) Unregister STS ServiceDescription and
+    //                 STS IdentityProvider
+    //         => Unregistering IdentityProvider removes
+    //            related Credentials from Credentials DB
+    //
+    UnregisterSTSL();
+    
+    //      2) Unregister actual Service (= Messaging) ServiceDescription
+    pManager = CSenServiceManager::NewLC();
+    CSenXmlServiceDescription* pPattern = CSenXmlServiceDescription::NewLC();
+    pPattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pPattern->SetEndPointL(KMessagingEndpoint);
+    pPattern->SetContractL(KMessagingContract);
+    TInt error = pManager->UnregisterServiceDescriptionL( *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    CleanupStack::PopAndDestroy(pManager);   
+    // Clean DBs ENDS
+    
+    RegisterSTSL();
+    
+    pManager = CSenServiceManager::NewLC();
+
+    // Add Credential to Credentials DB
+    // => When Connection is initialized, working Credential
+    //    should be found from Credentials DB
+    // => Working Credential should be used and
+    //    request to get new SecurityToken should NOT be sent.
+    LOCAL_ASSERT((pManager->AddCredentialL(KMessagingEndpoint,
+                                           *pIdp,
+                                           *credentialArray[0],
+                                           *credentialPropertiesArray[0])) == KErrNone);
+
+    CleanupStack::PopAndDestroy(pManager);   
+    credentialPropertiesArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(&credentialPropertiesArray);
+    credentialArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(&credentialArray);
+    CleanupStack::PopAndDestroy(pIdp);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    // Send Register message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger3L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    //pInvalidStsProvider->AsElement().AddAttrL(_L8("promptUserInfo"),_L8("false"));
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT(iAuthInfoAskCounter == 1);
+
+    // 
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady );
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger4L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT(iAuthInfoAskCounter == 3);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusCreateFailed );
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger5L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    pInvalidStsProvider->AsElement().AddAttrL(_L8("promptUserInfo"),_L8("false"));
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT( iAuthInfoAskCounter == 0 );
+
+    LOCAL_ASSERT( iConnectionState == KSenConnectionStatusCreateFailed );
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger6L( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceWithoutCallbackL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger7L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create one "fake" ServiceManager instance which keeps
+    // Serene server up and running through whole test case.
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    
+    UnregisterSTSL();
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+
+    // Clean DBs STARTS
+    //      1) Unregister STS IdentityProvider
+    //         => Unregistering IdentityProvider removes
+    //            related Credentials from Credentials DB
+    //
+    UnregisterSTSL();
+    // Clean DBs ENDS
+    
+    RegisterSTSInvalidPasswordL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT( iConnectionState == KSenConnectionStatusCreateFailed );
+    LOCAL_ASSERT( iCallback        == ECallbackHandleError );
+    LOCAL_ASSERT( iErrorCode       == -30320 ); // -30320 = KErrSenFailedAuthentication
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    CleanupStack::PopAndDestroy(manager);
+    Teardown();
+    return KErrNone;
+	}
+
+    
+int CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Custom_Header(const TDesC8& KCustomHttpHeader,
+                                    const TDesC8& KCustomHttpHeaderValue)
+    {
+    SetupL() ;
+    // Set custom HTTP header
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE
+    // 2. Get TP using SC:TransportPropertiesL()
+    // 3. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that CUSTOM_HTTP_HEADER -field is present
+    // 4. Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+               
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    if(iConnectionState != KSenConnectionStatusReady) return KErrCouldNotConnect;
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //4. Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    //LOCAL_ASSERT(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    //LOCAL_ASSERT(pValue == NULL);
+    if(pValue == NULL) return KErrNotFound;
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    return KErrNone;    
+    Teardown();
+    return KErrNone;
+	}
+    
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Send(const TDesC8& aLogFileName, const TDesC8& aCustomHttpHeader,
+                                                                const TDesC8& aCustomHttpHeaderValue, CSenServiceConnection* iServiceConnection)
+    {
+    SetupL() ;
+    TInt result = KErrNone;
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, aLogFileName);
+    pHttpProperties->SetHttpHeaderL(aCustomHttpHeader, aCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    if(iCallback != ECallbackHandleMessage) return KErrGeneral;
+   
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    return result;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_CheckLogs(const TDesC& aLogFilePath,  const TDesC8& aCustomHttpHeader, const TDesC8& aCustomHttpHeaderValue)
+    {
+    SetupL() ;
+    TInt result = KErrNone;
+    HBufC8* pFileContent = ReadFileL(aLogFilePath);
+    //LOCAL_ASSERT(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, aCustomHttpHeader);
+    //LOCAL_ASSERT(*pValue == aCustomHttpHeaderValue);
+    if (*pValue != aCustomHttpHeaderValue) return KErrNotFound;
+    
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    return result;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+HBufC8* CSenServiceConnectionBCTest::HttpMethodValueFromXmlLC(const TDesC8& aXml)
+    {
+    SetupL() ;
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    CSenElement* pTPElement = pRequestElement->Element(_L8("Method"));
+    
+    HBufC8* pRetBuf = pTPElement->Content().AllocL();
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    
+    CleanupStack::PushL(pRetBuf);
+    
+    return pRetBuf;
+    Teardown();
+    return KErrNone;
+	}   
+*/
+TInt CSenServiceConnectionBCTest::SendL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->SendL(KReq);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+}       
+TInt CSenServiceConnectionBCTest::SubmitL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	CTestConnection* pTest = CTestConnection::NewL();//*this);
+	
+	HBufC8* pBuf = HBufC8::NewL(256);
+	res = pTest->SubmitL(KReq,pBuf);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pBuf;
+	return res;
+}       
+TInt CSenServiceConnectionBCTest::IsReady( TTestResult& aResult )             {
+	TInt res;
+	TBool ready;
+	CTestConnection* pTest = CTestConnection::NewL();
+	res = pTest->IsReady(ready);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::HasFacetL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KUri,"test uri");
+	TBool HasFacet;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->HasFacetL(KUri,HasFacet);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::CompleteServerMessagesOnOff( TTestResult& aResult )   {
+	TInt res;
+	TBool CompleteOnOff(TRUE);
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->CompleteServerMessagesOnOff(CompleteOnOff);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send2L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	res = pTest->SendL(*pEnv);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Submit2L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	HBufC8* pBuf = HBufC8::NewL(256);
+	res = pTest->SubmitL(*pEnv,pBuf);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	delete pBuf;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::ServiceDescriptionL( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	HBufC8* pSD = HBufC8::NewL(256);
+	res = pTest->ServiceDescriptionL(pSD);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pSD;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::StartTransaction( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->StartTransaction();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::TransactionCompleted( TTestResult& aResult )    {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->TransactionCompleted();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::TxnId( TTestResult& aResult )            {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->TxnId();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::SetTransportPropertiesL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KProperties,"properties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->SetTransportPropertiesL(KProperties);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::TransportPropertiesL( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	HBufC8* pProps = HBufC8::NewL(256);
+	res = pTest->TransportPropertiesL(pProps);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pProps ;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send3L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->SendL(KReq,KProps);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+}       
+TInt CSenServiceConnectionBCTest::Submit3L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	HBufC8* pRes = HBufC8::NewL(256);
+	
+	res = pTest->SubmitL(KReq,KProps,pRes);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pRes;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send4L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	
+	res = pTest->SendL(*pEnv,KProps);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Submit4L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	
+	HBufC8* pRes = HBufC8::NewL(256);
+	res = pTest->SubmitL(*pEnv,KProps,pRes);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send5L( TTestResult& aResult )    {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	MSenMessage* pMsg = NULL;
+	res = pTest->SendL(*pMsg );
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Submit5L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	MSenMessage* pMsg = NULL;
+	CSenSoapEnvelope2* pEnv = NULL;
+	res = pTest->SubmitL(*pMsg, pEnv);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Response( TTestResult& aResult )                  {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	MSenMessage* pMsg;
+	TRAP(res, pTest->Response());
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::CancelTransaction( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->CancelTransaction(1)   ;
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::IdentityProvider1L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	CSenIdentityProvider* pProv = NULL;
+	res = pTest->IdentityProviderL(pProv )   ;
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Identifier( TTestResult& aResult )    {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->Identifier();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+
+TInt CSenServiceConnectionBCTest::Name( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TPtrC8 name = pTest->Name();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(name == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::Type( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TPtrC8 type = pTest->Type();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(type == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::Value( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TPtrC8 value = pTest->Value();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(value == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::IntValue( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	TInt value(1);
+	TInt val = pTest->IntValue(value);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return val;
+}
+
+TInt CSenServiceConnectionBCTest::BoolValue( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	TBool value(TRUE);
+	TInt val = pTest->BoolValue(value);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return val;
+}
+
+TInt CSenServiceConnectionBCTest::ValueTokensL( TTestResult& aResult )    {
+	RPointerArray<TPtrC8>  tokens;
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TInt val = pTest->ValueTokensL(_L8(""),tokens);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return val;
+}
+
+TInt CSenServiceConnectionBCTest::IdentityProvider2L( TTestResult& aResult ) 
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	
+	TRAPD(ret,pTest->IdentityProviderL());
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+//	delete Pprov ;
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::Username1L( TTestResult& aResult ) 
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	
+	TPtrC8 uname = pTest->UsernameL();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(uname == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::Password1L( TTestResult& aResult )                                           
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	
+	TPtrC8 pwd = pTest->PasswordL();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(pwd == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+TInt CSenServiceConnectionBCTest::ExtendedInterface1L( TTestResult& aResult )                                   
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	TRAPD(ret,pTest->ExtendedInterface(10));
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::TransferProgress( TTestResult& aResult )                                   
+{
+	CTestFileObserver* pTest = CTestFileObserver::NewL();
+	TRAPD(ret,pTest->TransferProgress());
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::HandleMeassage(TTestResult& aResult)
+{
+	CTestConsumer* pTest = CTestConsumer::NewL();
+	TRAPD(ret,pTest->HandleMessageL());
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::HandleErrorL(TTestResult& aResult)
+{
+	CTestConsumer* pTest = CTestConsumer::NewL();
+	TRAPD(ret,pTest->HandleErrorL());
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::SetStatus(TTestResult& aResult)
+{
+	CTestConsumer* pTest = CTestConsumer::NewL();
+	TRAPD(ret,pTest->SetStatus());
+
+	delete pTest;
+
+	return ret;
+}
+
+#ifdef __ENABLE_ALR__
+TInt CSenServiceConnectionBCTest::ALRL(TTestResult& aResult)
+    {
+    iLog->Log(_L("ALR->start"));
+    SetupL();
+    
+    iUseALR = ETrue;
+    iAlrCallBackRetryCount =0;
+    isNewCarrierAccepted = EFalse;
+    isMigratedToPrefferedCarrier= EFalse;
+    	 
+    TInt retVal(KErrNone);
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>");
+    _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001");
+    
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+    iSenXmlServiceDescription->SetEndPointL(KEndPoint);
+    
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("ALR->TL(iServiceConnection != (CSenServiceConnection*)NULL);"));
+    StartActiveScheduler(1);
+    iLog->Log(_L("ALR->CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);"));
+    
+    iALRSC = (MSenAlrServiceConnection*) iServiceConnection->InterfaceByUid(KSenInterfaceUidAlrServiceConnection);  
+    iLog->Log(_L("iServiceConnection->InterfaceByUid(KSenInterfaceUidAlrServiceConnection")); 
+    
+    TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+    StartActiveScheduler(1);
+    
+     __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    iUseALR = EFalse;
+    iAlrCallBackRetryCount =0;
+    isNewCarrierAccepted = EFalse;
+    isMigratedToPrefferedCarrier= EFalse;
+    
+    Teardown();
+    iLog->Log(_L("ALR->End"));
+    }
+
+//mobility methods
+void CSenServiceConnectionBCTest::PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+                                                     TAccessPointInfo aNewAPInfo,
+                                                     TBool aIsUpgrade,
+                                                     TBool aIsSeamless )
+    {
+    iLog->Log(_L("PreferredCarrierAvailable."));
+    iLog->Log(_L("PreferredCarrierAvailable Callback received"));
+    
+    TBuf<32> oldBuff;
+    oldBuff.Append(_L("With Old IAPID: "));
+    oldBuff.AppendNum(aOldAPInfo.AccessPoint());   
+    
+    TBuf<32> newBuff;
+    newBuff.Append(_L("With New IAPID: "));
+    newBuff.AppendNum(aNewAPInfo.AccessPoint());   
+     
+    TBool userChoice(EFalse) ;
+    if(aIsUpgrade)
+        {
+        iLog->Log(_L("it is upgrade")); 
+        }
+    else
+        {
+        iLog->Log(_L("it is not upgrade")); 
+        }       
+    if(aIsSeamless)
+        {
+        iLog->Log(_L("it is seemless"));
+        iLog->Log(_L("in S60 3.2, this situation cannot occur")); 
+        }
+    else
+        {
+        iLog->Log(_L("it is not seemless"));
+        iLog->Log(_L("calling MigrateToPrefferedCarrierL() with user choice ETrue")); 
+        
+        userChoice = ETrue ;// pressed yes, accept
+                              //pressed no, reject
+        iALRSC->MigrateToPrefferedCarrierL(userChoice);
+        isMigratedToPrefferedCarrier = ETrue;
+        if (userChoice != EFalse)
+            {
+            iLog->Log(_L("userChoice is Yes")); 
+            iLog->Log(_L("Migrating to New Carrier"));
+            }
+        else
+            {
+            iLog->Log(_L("userChoice is No"));  
+            iLog->Log(_L("Ignoring  New Carrier"));                
+            }
+        }
+    }
+
+void CSenServiceConnectionBCTest::NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless )
+    {
+    iLog->Log(_L("NewCarrierActive Callback received")); 
+    
+    TBuf<32> buff;
+    buff.Append(_L("With New IAPID: "));
+    buff.AppendNum(aNewAPInfo.AccessPoint()); 
+        
+           
+    TBool userChoice(EFalse) ;
+    if (aIsSeamless)
+        {
+         // in S60 3.2, this situation cannot occur.
+        iLog->Log(_L("it is seemless")); 
+        iLog->Log(_L("in S60 3.2, this situation cannot occur"));  
+        }
+    else
+        {
+        iLog->Log(_L("it is not seemless")); 
+        iLog->Log(_L("calling NewCarrierAcceptedL() with user choice ETrue"));      
+        userChoice = ETrue ;// pressed yes, accept
+                            // pressed no, reject
+  
+        iALRSC->NewCarrierAcceptedL(userChoice);
+        isNewCarrierAccepted = ETrue;
+        if (userChoice != EFalse)
+            {
+            iLog->Log(_L("userChoice is Yes")); 
+            iLog->Log(_L("New Carrier is accepted"));                            
+            }
+        else
+            {
+            iLog->Log(_L("userChoice is No")); 
+            iLog->Log(_L("New Carrier is rejected"));   
+            }
+        }        
+    }
+        
+void CSenServiceConnectionBCTest::Error(TInt aError)
+    {
+    iLog->Log(_L("mobility Error()"));
+    TBuf<24> numbuf;
+    numbuf.Append(_L("With Error: "));
+    numbuf.AppendNum(aError);   
+    iLog->Log(_L("mobility Error() received"));
+    }
+#endif //__ENABLE_ALR__
+
+TInt CSenServiceConnectionBCTest::CoBrandL(TTestResult& aResult)
+    {
+    	
+    iLog->Log(_L("CoBrand->start"));
+    SetupL();
+    
+    TInt retVal(0);
+    iCoBrandingCallbackOption = ETrue;    
+
+    _LIT8(KFramework, "WS-STAR");
+    _LIT8(KIdpEndPoint, "http://10.21.32.20/wsstar/cobranding/STS_CB_001.aspx");
+    _LIT8(KSdEndPoint, "http://10.21.32.20/WSStar/Trust/WSService.aspx");
+    _LIT8(KIdpContract, "urn:wstar:sts:2004-04");
+    _LIT8(KSmSdContract, "urn:wstar:sts");
+    _LIT8(KSdContract, "messenger.msn.com");
+    
+    _LIT8(KProviderId, "provider01");
+    _LIT8(KPassportUser, "john");
+    _LIT8(KPassportPass, "password");
+    
+    _LIT8(KTokenType, "TokenType");
+    _LIT8(KTokenTypeVal, "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1");
+    _LIT8(KPassportExtensions, "PassportExtensions ");
+
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">test request</ab:Query>");
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    TL(manager != (CSenServiceManager*)NULL);
+    iLog->Log(_L("CSenServiceManager* manager = CSenServiceManager::NewLC()"));
+    //register Identity provider for STS 
+    CSenIdentityProvider* idp = CSenIdentityProvider::NewLC(KIdpEndPoint);
+    idp->SetContractL(KIdpContract);
+    idp->SetFrameworkIdL(KFramework);
+    idp->SetProviderID(KProviderId);
+    idp->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);   
+    iLog->Log(_L("CSenIdentityProvider::NewLC(KIdpEndPoint)"));                                        
+    manager->RegisterIdentityProviderL( *idp);
+    iLog->Log(_L("manager->RegisterIdentityProviderL( *idp)"));
+    
+    CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC();
+    pSmSd->SetFrameworkIdL(KFramework);
+    pSmSd->SetContractL(KSmSdContract);
+    pSmSd->SetEndPointL(KIdpEndPoint);
+    pSmSd->AsElement().AddElementL(_L8("ProviderID")).SetContentL(_L8("provider01"));
+    SetPolicyL(pSmSd, KPolicySOAP12,  KNullDesC8);
+    SetPolicyL(pSmSd, KTokenType,  KTokenTypeVal);
+    SetPolicyL(pSmSd, KPassportExtensions,  KNullDesC8);
+	iLog->Log(_L("CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC()"));
+    TInt error = manager->RegisterServiceDescriptionL( *pSmSd);
+    iLog->Log(_L("manager->RegisterServiceDescriptionL( *pSmSd);"));
+    
+    CSenXmlServiceDescription* pScSd = CSenServicePattern::NewLC();
+    pScSd->SetFrameworkIdL(KFramework);
+    pScSd->SetContractL(KSdContract);
+    pScSd->SetEndPointL(KSdEndPoint);
+    pScSd->AsElement().AddElementL(_L8("ProviderID")).SetContentL(_L8("provider01"));
+    iLog->Log(_L("CSenXmlServiceDescription* pScSd = CSenXmlServiceDescription::NewLC();"));
+
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pScSd, *this);
+    iLog->Log(_L("Starting ----->StartActiveScheduler(1);"));
+    StartActiveScheduler(1);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("iServiceConnection = CSenServiceConnection::NewL(*this, *pScSd, *this);"));
+    
+    TBool isReady(EFalse);
+    TInt ret = iServiceConnection->IsReady(isReady);
+    if(isReady)
+    	{
+    	ret = iServiceConnection->SendL(*iSOAPMessage);
+
+			iLog->Log(_L("iServiceConnection->SendL(*iSOAPMessage);"));
+
+  	  StartActiveScheduler(1);	
+    	}
+    iLog->Log(_L("StartActiveScheduler(1);"));
+    
+    CleanupStack::PopAndDestroy(pScSd);
+    CleanupStack::PopAndDestroy(pSmSd);
+    CleanupStack::PopAndDestroy(idp);
+    CleanupStack::PopAndDestroy(manager);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    iCoBrandingCallbackOption = EFalse;
+    Teardown();
+    iLog->Log(_L("CoBrand->End"));
+    return KErrNone;
+    }
+
+TBool CSenServiceConnectionBCTest::OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId)
+    {
+    iLog->Log(_L("CSenServiceConnectionBCTest::OnGetBrandIdL()-----> Start"));
+    if(iCoBrandingCallbackOption && (aBrandIdListAsXmlSnippet != _L8("")))
+        {
+        iLog->Log(_L("CSenServiceConnectionBCTest::OnGetBrandIdL()True----->End "));  
+        return  ETrue;
+        }
+    else
+        {
+        iLog->Log(_L("CSenServiceConnectionBCTest::OnGetBrandIdL() False----->End "));  
+        return EFalse;
+        }  
+    }
+
+TInt CSenServiceConnectionBCTest::HostletConsumerL(TTestResult& aResult)
+    {
+    iLog->Log(_L("HostletConsumer->start"));
+    SetupL();
+    
+    iHostletConsumerOption = ETrue;
+         
+    TInt retVal(KErrNone);
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>");
+    _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001");
+    
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+    iSenXmlServiceDescription->SetEndPointL(KEndPoint);
+    
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("HostletConsumer->TL(iServiceConnection != (CSenServiceConnection*)NULL);"));
+    StartActiveScheduler(1);
+    iLog->Log(_L("HostletConsumer->CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);"));
+    
+    TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+    StartActiveScheduler(1);
+    
+     __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    iHostletConsumerOption = EFalse;
+    
+    Teardown();
+    iLog->Log(_L("HostletConsumer->End"));
+    }
+
+void CSenServiceConnectionBCTest::SetConnectionId( TInt aConnectionId )
+    {
+    TInt connectonId = 0;
+    connectonId = aConnectionId;
+    }
+
+TInt CSenServiceConnectionBCTest::DataTrafficDetailsL(TTestResult& aResult)
+    {
+    iLog->Log(_L("DataTrafficDetails->start"));
+    SetupL();
+    
+    iGetDataTrafficDetails = ETrue;
+         
+    TInt retVal(KErrNone);
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>");
+    _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001");
+    
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+    iSenXmlServiceDescription->SetEndPointL(KEndPoint);
+    
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("DataTrafficDetails->TL(iServiceConnection != (CSenServiceConnection*)NULL);"));
+    StartActiveScheduler(1);
+    iLog->Log(_L("DataTrafficDetails->CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);"));
+    
+    TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+    StartActiveScheduler(1);
+    
+     __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    iGetDataTrafficDetails = EFalse;
+    
+    Teardown();
+    iLog->Log(_L("HostletConsumer->End"));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include "testconsumer.h"
+
+ 	CTestConsumer* CTestConsumer::NewL()
+ 	{
+ 		CTestConsumer* pTest = new (ELeave) CTestConsumer();
+ 		return pTest;
+ 	}
+ 	CTestConsumer* CTestConsumer::NewLC()
+ 	{
+ 		CTestConsumer* pTest = new (ELeave) CTestConsumer();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestConsumer::CTestConsumer()
+ 	{
+ 		
+ 	}
+ 	void CTestConsumer::HandleMessageL(const TDesC8& aMessage) 
+ 	{
+ 	}
+	void CTestConsumer::HandleErrorL(const TInt aErrorCode, 
+                                  const TDesC8& aErrorMessage)
+	{
+	}
+ 	void CTestConsumer::SetStatus(const TInt aStatus)
+ 	{
+ 	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testfileobserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include "testfileobserver.h"
+
+ 	CTestFileObserver* CTestFileObserver::NewL()
+ 	{
+ 		CTestFileObserver* pTest = new (ELeave) CTestFileObserver();
+ 		return pTest;
+ 	}
+ 	CTestFileObserver* CTestFileObserver::NewLC()
+ 	{
+ 		CTestFileObserver* pTest = new (ELeave) CTestFileObserver();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestFileObserver::CTestFileObserver()
+ 	{
+ 		
+ 	}
+ 	void CTestFileObserver::TransferProgress(TInt aTxnId , TBool aIncoming , const TDesC8& aMessage,
+            const TDesC8& aCid , TInt aProgress )
+  	{
+  	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testproperty.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "testproperty.h"
+#include <SenIdentityProvider.h>
+#include <e32base.h>
+
+ 	CTestProperty* CTestProperty::NewL()
+ 	{
+ 		CTestProperty* pTest = new (ELeave) CTestProperty();
+ 		return pTest;
+ 	}
+ 	CTestProperty* CTestProperty::NewLC()
+ 	{
+ 		CTestProperty* pTest = new (ELeave) CTestProperty();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestProperty::CTestProperty()
+ 	{
+ 		
+ 	}
+ 	
+ 	TPtrC8 CTestProperty::Name() 
+	{
+		return _L8("");
+	}
+	TPtrC8 CTestProperty::Type() 
+	{
+	return _L8("");
+	}
+	TPtrC8 CTestProperty::Value()
+	{
+	return _L8("");
+	}
+	TInt CTestProperty::IntValue(TInt& aValue) 
+	{
+	return KErrNone;
+	}
+	TInt CTestProperty::BoolValue(TBool& aValue) 
+	{
+	return KErrNone;	
+	}
+
+
+	TInt CTestProperty::ValueTokensL(const TDesC8& aDelimiter,
+	                              RPointerArray<TPtrC8>& aTokens) 
+	{
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/testprovider.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "testprovider.h"
+#include <e32base.h>
+
+ 	CTestProvider* CTestProvider::NewL()
+ 	{
+ 		CTestProvider* pTest = new (ELeave) CTestProvider();
+ 		return pTest;
+ 	}
+ 	CTestProvider* CTestProvider::NewLC()
+ 	{
+ 		CTestProvider* pTest = new (ELeave) CTestProvider();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestProvider::CTestProvider()
+ 	{
+ 		
+ 	}
+
+	const CSenIdentityProvider* CTestProvider::IdentityProviderL() 
+	{
+		return NULL;
+	}
+	const TPtrC8 CTestProvider::UsernameL() 
+	{
+		return _L8("");
+	}
+	const TPtrC8 CTestProvider::PasswordL() 
+	{
+		return _L8("");
+	}
+	TAny* CTestProvider::ExtendedInterface(const TInt32 /* aUid */) 
+	{
+		 return NULL;
+	}
+	
\ No newline at end of file
Binary file websrv_pub/web_service_connection_api/tsrc/bc/senutils/bmarm/senutilsbctestu.def has changed
Binary file websrv_pub/web_service_connection_api/tsrc/bc/senutils/bwins/senutilsbctestu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/eabi/SenUtilsBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+testsu_c.bat		/epoc32/winscw/c/TestSU_c.bat
+testsu_z.bat		/epoc32/winscw/c/TestSU_z.bat
+testframework.ini		/epoc32/winscw/c/testframework/testframework_senutils.ini
+
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+senutils.mmp
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/senutils.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senutils
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          SenUtilsBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+#if defined(EKA2)
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+VENDORID        VID_DEFAULT        
+//VENDORID 			0x70000001 
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+#endif
+
+//TARGETPATH      ?target_path
+DEFFILE         SenUtilsBCTest.def
+
+SOURCEPATH      ../src
+SOURCE          senutils.cpp
+SOURCE          senutilscases.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+SYSTEMINCLUDE   /epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenXml.lib
+LIBRARY					SenServDesc.lib
+LIBRARY                 SenFragment.lib
+LIBRARY                 SenXml.lib
+
+
+LANG            SC
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    //LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    //LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenUtilsBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\TestFramework_senutils.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule SenUtilsBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenUtils.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_senutils.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule SenUtilsBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenUtils.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/inc/senutilsbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,577 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenUtils test module.
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENUTILS_H
+#define SENUTILS_H
+
+// INCLUDES
+#include <StifTestModule.h>
+#include <StifLogger.h>
+#include <SenParser.h>
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+#include <SenIdentityProvider.h>
+#include <SenNameSpace.h>
+#include <SenSoapEnvelope.h>
+#include <SenSoapFault.h>
+#include <SenSoapMessage.h>
+#include <SenWsSecurityHeader.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+#include <SenTransportProperties.h>
+#include <SenHttpTransportProperties.h>
+//#include <SenVtcpTransportProperties.h>
+#include <f32file.h>
+//#include <S32FILE.H>
+//#include <e32std.h>
+
+//  FORWARD DECLARATIONS
+class CSenBaseAttribute;
+class CSenBaseFragment;
+class CSenSoapMessage;
+class CSenIdentityProvider;
+class CSenGuidGen;
+class CSenDomFragment;
+class CSenSoapFault;
+class CSenXmlServiceDescription;
+class CSenSoapEnvelope;
+class CSenWsSecurityHeader;
+class SenXmlUtils;
+class CSenBaseElement;
+class MSenElement;
+class CSenXmlReader;
+class SenDateUtils;
+class CSenNamespace;
+
+namespace{
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+    _LIT8(KXmlSpecific, "\"&<>");
+    _LIT8(KFaultMessage, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault></S:Body></S:Envelope>");
+    _LIT8(KSOAPMessageNS, "<tns:Envelope xmlns:tns=\"http://schemas.xmlsoap.org/soap/envelope/\"><tns:Header/><tns:Body><ab:QueryResponse xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:Status code=\"OK\"/><ab:Data>Hard Coded response, alway the same</ab:Data></ab:QueryResponse></tns:Body></tns:Envelope>");
+    _LIT8(KSOAPMessageNSInside, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><ab:QueryResponse xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:Status code=\"OK\"/><ab:Data>Hard Coded response, alway the same</ab:Data></ab:QueryResponse></S:Body></S:Envelope>");
+    _LIT8(KSOAPMessage,  "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+
+}
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 50
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 6
+// Logging path
+_LIT( KSenUtilsLogPath, "\\logs\\testframework\\SenUtilsBCTest\\" ); 
+// Log file
+_LIT( KSenUtilsLogFile, "SenUtilsBCTest.txt" ); 
+
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenUtilsBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenUtilsBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenUtilsBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a SenUtils class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenUtilsBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenUtilsBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenUtilsBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenUtils. It is called once for every instance of 
+        *       TestModuleSenUtils after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenUtils.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenUtils. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+				/**
+         * Method used to log version of test module
+         */
+        void SendTestModuleVersion();
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenUtilsBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+        void SetupL();
+        void Teardown();
+
+        TPtr16 ConvertToPtr16LC(CSenBaseFragment &fragment);
+        TPtr16 ConvertToPtr16LC(MSenElement &element);
+
+        /**
+        * Actual Hardcoded test case functions are listed below.
+        */
+/*
+ 		TInt CSenSoapEnvelope_NewLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_AddHeaderLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_BodyLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_BodyAsStringLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_DetachFaultLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_HeaderLL( TTestResult& aResult );
+		TInt CSenSoapEnvelope_SetBodyLL( TTestResult& aResult );
+		TInt CSenSoapEnvelope_SoapActionL( TTestResult& aResult );
+		TInt CSenSoapEnvelope_FaultLL( TTestResult& aResult );
+		TInt CSenSoapFault_NewLL( TTestResult& aResult );
+		TInt CSenSoapFault_NewL_1L( TTestResult& aResult );
+		TInt CSenSoapFault_FaultCodeL( TTestResult& aResult );
+		TInt CSenSoapFault_FaultStringL( TTestResult& aResult );
+		TInt CSenSoapFault_FaultActorL( TTestResult& aResult );
+		TInt CSenSoapFault_DetailL( TTestResult& aResult );
+		TInt CSenSoapMessage_NewLL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_NewLL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_NewL_1L( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_UsernameTokenLL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_UsernameTokenL_1L( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_XmlNsL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_XmlNsPrefixL( TTestResult& aResult );
+		TInt SenDateUtils_FromXmlDateTimeLL( TTestResult& aResult );
+		TInt SenDateUtils_ToXmlDateTimeUtf8LL( TTestResult& aResult );
+		TInt CSenSoapMessage_SetSecurityHeaderLL( TTestResult& aResult );
+		TInt CSenSoapMessage_AddSecurityTokenLL( TTestResult& aResult );
+*/
+
+         TInt CSenSoapEnvelope_NewLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SetBodyLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_BodyLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_HeaderLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_AddHeaderLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_BodyAsStringLL(TTestResult& aResult);
+         
+         TInt CSenSoapEnvelope_DetachFaultLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_FaultLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SetSoapActionLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SoapActionL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SoapAction2L(TTestResult& aResult);
+         TInt CSenSoapEnvelope_HasHeaderL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SoapVersionL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_HasBodyL(TTestResult& aResult);
+		 TInt CSenSoapEnvelope_IsFaultL(TTestResult& aResult);
+		 TInt CSenSoapEnvelope_ParseLL(TTestResult& aResult);
+        
+         TInt CSenSoapFault_NewLL(TTestResult& aResult);
+         TInt CSenSoapFault_NewL_1L(TTestResult& aResult);
+         TInt CSenSoapFault_FaultCodeL(TTestResult& aResult);
+         TInt CSenSoapFault_FaultSubcodeL(TTestResult& aResult);
+         TInt CSenSoapFault_FaultStringL(TTestResult& aResult);
+         TInt CSenSoapFault_FaultActorL(TTestResult& aResult);
+         TInt CSenSoapFault_DetailL(TTestResult& aResult);
+
+         TInt CSenSoapMessage_NewLL(TTestResult& aResult);
+         TInt CSenSoapMessage_NewL_1L(TTestResult& aResult);
+         TInt CSenSoapMessage_NewL_2L(TTestResult& aResult);
+         TInt CSenSoapMessage_SetSecurityHeaderLL(TTestResult& aResult);
+         TInt CSenSoapMessage_AddSecurityTokenLL(TTestResult& aResult);
+		 TInt CSenSoapMessage_ParseLL(TTestResult& aResult);
+         
+
+         TInt CSenWsSecurityHeader_NewLL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewLCL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewLC_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewL_2L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewLC_2L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_BinarySecurityTokenL_L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_BinarySecurityTokenL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_TimestampL_L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_TimestampL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenLL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_2L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_3L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_4L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_XmlNsL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_XmlNsPrefixL(TTestResult& aResult);
+        
+         TInt SenDateUtils_FromXmlDateTimeLL(TTestResult& aResult);
+         TInt SenDateUtils_ToXmlDateTimeUtf8LL(TTestResult& aResult);
+         TInt SenDateUtils_ToXmlDateTimeUtf82LL(TTestResult& aResult);
+        
+         TInt SenTransportProperties_FileAttachmentLL(TTestResult& aResult);
+         //TInt SenTransportProperties_SetFileAttachmentsLL(TTestResult& aResult);
+         
+         TInt SenXmlProperties_NewLL(TTestResult& aResult);
+         TInt SenXmlProperties_NewLCL(TTestResult& aResult);
+		 TInt SenXmlProperties_NewL_1L(TTestResult& aResult);
+		 TInt SenXmlProperties_NewLC_1L(TTestResult& aResult);
+         TInt SenXmlProperties_NewL_2L(TTestResult& aResult);
+         TInt SenXmlProperties_NewLC_2L(TTestResult& aResult);
+         
+        TInt SenTransportProperties_NewLL(TTestResult& aResult);
+        TInt SenTransportProperties_NewLCL(TTestResult& aResult);
+        TInt SenTransportProperties_NewL_1L(TTestResult& aResult);
+        TInt SenTransportProperties_NewLC_1L(TTestResult& aResult);
+        TInt SenTransportProperties_NewL_2L(TTestResult& aResult);
+        TInt SenTransportProperties_NewLC_2L(TTestResult& aResult);
+		TInt SenTransportProperties_SetReaderL(TTestResult& aResult);
+        TInt SenTransportProperties_PropertiesClassTypeL(TTestResult& aResult);
+        TInt SenTransportProperties_WriteToLL(TTestResult& aResult);
+        TInt SenTransportProperties_ReadFromLL(TTestResult& aResult);
+        TInt SenTransportProperties_AsUtf8LL(TTestResult& aResult);
+        TInt SenTransportProperties_AsUtf8LCL(TTestResult& aResult);
+        TInt SenTransportProperties_SetPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_PropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_SetIntPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_IntPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_SetBoolPropertyLL(TTestResult& aResult);        
+        TInt SenTransportProperties_BoolPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_SetOmittedLL(TTestResult& aResult);
+        TInt SenTransportProperties_RemovePropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_IsSafeToCastL(TTestResult& aResult);
+		TInt SenTransportProperties_CloneLL(TTestResult& aResult);
+        TInt SenTransportProperties_CloneL(TTestResult& aResult);
+        TInt SenTransportProperties_ApplyBindingLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_HeartbeatLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetHeartbeatLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_IapIdLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetIapIdLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_ProxyPortLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetProxyPortLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_ProxyHostLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetProxyHostLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_ProxyUsageLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetProxyUsageLL(TTestResult& aResult);
+
+				TInt SenTransportProperties_SecureDialogLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetSecureDialogLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_UserAgentLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SetUserAgentLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_DeviceIDLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetDeviceIDLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SoapActionLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SetSoapActionLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_DownloadFolderLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SetDownloadFolderLL(TTestResult& aResult );
+               
+        TInt SenTransportProperties_SetFileAttachmentLL( TTestResult& aResult);
+
+        TInt SenTransportProperties_MwsNamespaceLL(TTestResult& aResult );
+        
+        TInt SenTransportProperties_SetMwsNamespaceLL(TTestResult& aResult );
+
+        TInt SenTransportProperties_MessageIdLL(TTestResult& aResult );
+
+        TInt SenTransportProperties_SetMessageIdLL( TTestResult& aResult);
+
+        TInt SenTransportProperties_OnewayMessageOnOffLL( TTestResult& aResult);
+
+        TInt SenTransportProperties_SetOnewayMessageOnOffLL(TTestResult& aResult );
+        
+        TInt SenTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult);
+        
+		TInt SenTransportProperties_MaxTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenTransportProperties_MinTimeToLiveLL(TTestResult& aResult);
+
+		TInt SenHttpTransportProperties_NewLL(TTestResult& aResult);
+		
+		TInt SenHttpTransportProperties_NewLCL(TTestResult& aResult);
+
+		TInt SenHttpTransportProperties_NewL_1L(TTestResult& aResult);
+		
+		TInt SenHttpTransportProperties_NewLC_1L(TTestResult& aResult);
+
+		TInt SenHttpTransportProperties_NewL_2L(TTestResult& aResult);
+		
+		TInt SenHttpTransportProperties_NewLC_2L(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLL(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLCL(TTestResult& aResult);
+
+		TInt SenVtcpTransportProperties_NewL_1L(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLC_1L(TTestResult& aResult);
+
+		TInt SenVtcpTransportProperties_NewL_2L(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLC_2L(TTestResult& aResult);
+
+        TInt SenVtcpTransportProperties_OnewayMessageOnOffLL( TTestResult& aResult);
+
+        TInt SenVtcpTransportProperties_SetOnewayMessageOnOffLL(TTestResult& aResult );
+        
+        TInt SenVtcpTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult);
+        
+		TInt SenVtcpTransportProperties_MaxTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_MinTimeToLiveLL(TTestResult& aResult);
+
+     public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENUTILS_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:        
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Utils"},(0x20016BAB),3,0,0,TYPE=SA
+[0x101F7961],0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenUtilsBCTest.dll"-"!:\sys\bin\SenUtilsBCTest.dll"
+"\Epoc32\winscw\c\testSU_c.bat"-"!:\testSU.bat"
+"\Epoc32\winscw\c\testframework\testframework_senutils.ini"-"!:\testframework\testframework_senutils.ini"
\ No newline at end of file
Binary file websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,411 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenUtils class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senutilsbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::CSenUtilsBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenUtilsBCTest::CSenUtilsBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenUtilsLogPath, 
+                          KSenUtilsLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "SenUtils logging starts!" );
+    iLog->Log( KLogStart );
+    
+   // if ( iXmlReader ){
+    //    delete iXmlReader;
+    //}
+    //iXmlReader = CSenXmlReader::NewL();
+
+    }
+//-----------------------------------------------------------------------------
+// CSenUtilsBCTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::SendTestModuleVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("SenUtilsBCTest.dll");
+	
+
+	TBool newVersionOfMethod = ETrue;
+	CTestModuleIf &test=TestModuleIf();
+	test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	test.SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenUtilsBCTest* CSenUtilsBCTest::NewL()
+    {
+    CSenUtilsBCTest* self = new (ELeave) CSenUtilsBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenUtilsBCTest::~CSenUtilsBCTest()
+    {
+    if (iLog)  delete iLog;
+    //if ( iXmlReader)
+    	//{
+        //delete iXmlReader;
+      //  iXmlReader = NULL;
+    //  }
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenUtilsBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenUtilsBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenUtilsBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+		SendTestModuleVersion();
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+		iLog->Log( _L("-------------------------------------------------------------"));
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenUtilsBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenUtilsBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenUtilsBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutilscases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3124 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include "senutilsbctest.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenUtilsBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenUtils.cpp file and to SenUtils.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        
+        ENTRY( "NewL - CSenSoapEnvelope", CSenUtilsBCTest::CSenSoapEnvelope_NewLL ),
+        ENTRY( "SetBodyL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SetBodyLL ),
+        ENTRY( "BodyL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_BodyLL ),
+        ENTRY( "HeaderL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_HeaderLL ),        
+        ENTRY( "AddHeaderL - CSenSoapEnvelope", CSenUtilsBCTest::CSenSoapEnvelope_AddHeaderLL ),
+        ENTRY( "BodyAsStringL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_BodyAsStringLL ),
+        ENTRY( "DetachFaultL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_DetachFaultLL ),
+        ENTRY( "FaultL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_FaultLL ),
+        ENTRY( "SoapAction - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SoapActionL ),
+ //       ENTRY( "SoapAction2 - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SoapAction2L ),
+        ENTRY( "HasHeader - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_HasHeaderL ),
+        ENTRY( "SoapVersion - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SoapVersionL ),
+        ENTRY( "HasBody - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_HasBodyL ),
+        ENTRY( "IsFault - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_IsFaultL ),
+        ENTRY( "ParseL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_ParseLL ),
+        
+        ENTRY( "NewL - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_NewLL ),
+        ENTRY( "NewL - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_NewL_1L ),
+        ENTRY( "FaultCode - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultCodeL ),
+        ENTRY( "FaultSubcode - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultSubcodeL ),
+        
+        ENTRY( "FaultString - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultStringL ),
+        ENTRY( "FaultActor - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultActorL ),
+        ENTRY( "Detail - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_DetailL ),
+        ENTRY( "NewL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_NewLL ),
+        ENTRY( "SetSecurityHeaderL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_SetSecurityHeaderLL ),
+        ENTRY( "AddSecurityTokenL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_AddSecurityTokenLL ),
+        ENTRY( "NewL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLL ),
+        ENTRY( "ParseL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_ParseLL ),
+        
+        ENTRY( "NewLC - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLCL ),
+        ENTRY( "NewL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewL_1L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_1L ),
+        ENTRY( "NewL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewL_2L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_2L ),
+        ENTRY( "BinarySecurityToken - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_L ),
+        ENTRY( "BinarySecurityToken1 - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_1L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenLL ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_L ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_1L ),        
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_1L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_2L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_3L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_4L ),
+        ENTRY( "XmlNs - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsL ),
+        ENTRY( "XmlNsPrefix - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsPrefixL ),
+        ENTRY( "FromXmlDateTimeL - SenDateUtils ", CSenUtilsBCTest::SenDateUtils_FromXmlDateTimeLL ),
+        ENTRY( "ToXmlDateTimeUtf8L - SenDateUtils ", CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf8LL ),
+        ENTRY( "ToXmlDateTimeUtf82L - SenDateUtils ", CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf82LL ),
+        
+        ENTRY( "FileAttachmentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_FileAttachmentLL ),
+        ENTRY( "NewL - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLL ),
+        ENTRY( "NewLC - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLCL ),
+        ENTRY( "NewL - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewL_1L ),
+        ENTRY( "NewLC - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLC_1L ),
+        ENTRY( "NewL - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewL_2L ),
+        ENTRY( "NewLC - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLC_2L ),
+        ENTRY( "NewL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLL ),
+        ENTRY( "NewLC - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLCL ),
+        ENTRY( "NewL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewL_1L ),
+        ENTRY( "NewLC - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLC_1L ),
+        ENTRY( "NewL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewL_2L ),
+        ENTRY( "NewLC - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLC_2L ),
+        ENTRY( "AsUtf8L - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_AsUtf8LL ),
+        ENTRY( "SetPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetPropertyLL ),
+        ENTRY( "PropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_PropertyLL ),
+        ENTRY( "SetIntPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetIntPropertyLL ),
+        ENTRY( "IntPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_IntPropertyLL ),
+        ENTRY( "SetBoolPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetBoolPropertyLL ),
+        ENTRY( "BoolPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_BoolPropertyLL ),
+        ENTRY( "SetOmittedL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetOmittedLL ),
+        ENTRY( "RemovePropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_RemovePropertyLL ),
+        ENTRY( "HeartbeatL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_HeartbeatLL ),
+        ENTRY( "SetHeartbeatL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetHeartbeatLL ),
+        ENTRY( "IapIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_IapIdLL ),
+        ENTRY( "SetIapIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetIapIdLL ),
+        ENTRY( "ProxyPortL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ProxyPortLL ),
+        ENTRY( "SetProxyPortL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetProxyPortLL ),
+        ENTRY( "ProxyHostL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ProxyHostLL ),
+        ENTRY( "SetProxyHostL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetProxyHostLL ),
+        ENTRY( "ProxyUsageL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ProxyUsageLL ),
+        ENTRY( "SetProxyUsageL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetProxyUsageLL ),
+        ENTRY( "SecureDialogL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SecureDialogLL ),
+        ENTRY( "SetSecureDialogL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetSecureDialogLL ),
+        ENTRY( "UserAgentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_UserAgentLL ),
+        ENTRY( "SetUserAgentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetUserAgentLL ),
+        ENTRY( "DeviceIDL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_DeviceIDLL ),
+        ENTRY( "SetDeviceIDL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetDeviceIDLL ),
+        ENTRY( "SoapActionL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SoapActionLL ),
+        ENTRY( "SetSoapActionL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetSoapActionLL ),
+        ENTRY( "DownloadFolderL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_DownloadFolderLL ),
+        ENTRY( "SetDownloadFolderL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetDownloadFolderLL ),
+        ENTRY( "SetFileAttachmentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetFileAttachmentLL ),
+        ENTRY( "MwsNamespaceL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MwsNamespaceLL ),
+        ENTRY( "SetMwsNamespaceL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMwsNamespaceLL ),
+        ENTRY( "MessageIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MessageIdLL ),
+        ENTRY( "SetMessageIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMessageIdLL ),
+        ENTRY( "OnewayMessageOnOffL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_OnewayMessageOnOffLL ),
+        ENTRY( "SetOnewayMessageOnOffL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetOnewayMessageOnOffLL ),
+        ENTRY( "SetMaxTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMaxTimeToLiveLL ),
+        ENTRY( "MaxTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MaxTimeToLiveLL ),
+        ENTRY( "SetMaxTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMaxTimeToLiveLL),
+        ENTRY( "MinTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MinTimeToLiveLL ),
+        ENTRY( "SetMinTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMinTimeToLiveLL ),
+        ENTRY( "SetReaderL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetReaderL ),
+        ENTRY( "PropertiesClassTypeL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_PropertiesClassTypeL ),
+        ENTRY( "WriteToLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_WriteToLL ),
+        ENTRY( "ReadFromLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ReadFromLL ),
+        ENTRY( "CloneL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_CloneL ),
+        ENTRY( "IsSafeToCastL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_IsSafeToCastL ),
+        ENTRY( "CloneLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_CloneLL ),
+        ENTRY( "ApplyBindingLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ApplyBindingLL ),
+        
+        ENTRY( "NewL - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLL ),
+        ENTRY( "NewLC - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLCL ),
+        ENTRY( "NewL - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewL_1L ),
+        ENTRY( "NewLC - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLC_1L ),
+        ENTRY( "NewL - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewL_2L ),
+        ENTRY( "NewLC - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLC_2L),
+        //ENTRY( "NewL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLL ),
+        //ENTRY( "NewLC - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLCL ),
+        //ENTRY( "NewL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewL_1L ),
+        //ENTRY( "NewLC - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_1L ),
+        //ENTRY( "NewL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewL_2L ),
+        //ENTRY( "NewLC - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_2L ),
+        //ENTRY( "OnewayMessageOnOffL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_OnewayMessageOnOffLL ),
+        //ENTRY( "SetOnewayMessageOnOffL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_SetOnewayMessageOnOffLL ),
+        //ENTRY( "SetMaxTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_SetMaxTimeToLiveLL ),
+        //ENTRY( "MaxTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_MaxTimeToLiveLL ),
+        //ENTRY( "MinTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_MinTimeToLiveLL ),
+        //ENTRY( "SetMinTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_SetMinTimeToLiveLL ),*/
+        
+
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CSenUtilsBCTest::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CSenUtilsBCTest::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CSenUtilsBCTest::SetupL(  ){
+    if ( iXmlReader ){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+    iXmlReader = CSenXmlReader::NewL();
+} 
+
+void CSenUtilsBCTest::Teardown(  ){
+    if ( iXmlReader){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+}
+
+
+TPtr16 CSenUtilsBCTest::ConvertToPtr16LC(CSenBaseFragment &fragment){
+    HBufC16* xmlBuffer = fragment.AsElement().AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length()){
+        RDebug::Print( _L( "WSModTester: xmlBuffer length [%d]"),ptr.Length());
+        if (ptr.Length()<=254){//below string must be =< max byte value
+            RDebug::Print( _L( "WSModTester: xmlBuffer #START#"));
+            RDebug::Print( _L( "[%S]"),&ptr);
+            RDebug::Print( _L( "WSModTester: xmlBuffer #END#"));
+        }
+        else
+            RDebug::Print( _L( "WSModTester: xmlBuffer too long to display, must be <=256- 2//[]"));
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TPtr16 CSenUtilsBCTest::ConvertToPtr16LC(MSenElement &element){
+    HBufC16* xmlBuffer = element.AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer length [%d]"),ptr.Length());
+        if (ptr.Length()<=254){//below string must be =< max byte value
+            RDebug::Print( _L( "WSModTester: xmlBuffer #START#"));
+            RDebug::Print( _L( "[%S]"),&ptr);
+            RDebug::Print( _L( "WSModTester: xmlBuffer #END#"));
+        }
+        else
+            RDebug::Print( _L( "WSModTester: xmlBuffer too long to display, must be <=256- 2//[]"));
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    CleanupStack::PushL(env);
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL);*/
+    TL(env != (CSenSoapEnvelope*)NULL);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    TPtrC16 ptrRef = KRef();
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*env), ptrRef);*/
+    TL(ConvertToPtr16LC(*env) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(env);
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SetBodyLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    _LIT8(KBody,"ComarchBody");
+    TPtrC8 result = env->SetBodyL(KBody);
+    
+    _LIT16(KRef2, "ComarchBody");
+    TPtrC16 result16(reinterpret_cast<const TUint16*>(result.Ptr()),(result.Size()/2));
+    RDebug::Print( _L( "WSModTester: body [%S]"),&result16);
+    /*EUNIT_ASSERT_EQUALS(result, KBody);*/
+    TL(result == KBody);
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body>ComarchBody</S:Body></S:Envelope>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*env), KRef);*/
+    TL(ConvertToPtr16LC(*env) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_BodyLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    _LIT8(KBody,"ComarchBody");
+    env->SetBodyL(KBody);
+    
+    CSenElement& element = env->BodyL();
+    
+    _LIT16(KRef, "<S:Body>ComarchBody</S:Body>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(element), KRef);*/
+    TL(ConvertToPtr16LC(element) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_HeaderLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    env->AddHeaderL(*el);
+    el = &(CSenBaseElement&)env->HeaderL();
+    
+    _LIT16(KRef, "<S:Header><text/></S:Header>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*el), KRef);*/
+    TL(ConvertToPtr16LC(*el)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_AddHeaderLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    //el = &(CSenBaseElement&) env->AddHeaderL(*el);//ok
+    el = &(CSenBaseElement&) env->AddHeaderL(*el);//ok
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><text/></S:Header><S:Body/></S:Envelope>");
+    TL(ConvertToPtr16LC(*env) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    _LIT16(KRef2, "<text/>");
+    TL(ConvertToPtr16LC(*el)== KRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_BodyAsStringLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KBody,"ComarchBody");
+    env->SetBodyL(KBody);
+    HBufC8* str = env->BodyAsStringL();
+    
+    _LIT8(KRef, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">ComarchBody</S:Body>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptr = str->Des();
+    TL(ptr == ptrRef);
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete str);
+    str = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_DetachFaultLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+
+    //checking Envelope without Fault
+    _LIT16(KRefEnvFault, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body/></S:Envelope>");
+    TPtrC16 ptrRefEnvFault = KRefEnvFault();
+    TL(ConvertToPtr16LC(*env) == ptrRefEnvFault);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    //checking Fault
+    _LIT16(KRefFault, "<S:Fault xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault>");
+    TPtrC16 ptrRefFault = KRefFault();
+    TL(ConvertToPtr16LC(*fault) == ptrRefFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    
+
+    env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KSOAPMessage);
+    TL(env->DetachFaultL() == (CSenSoapFault* )NULL);
+    //checking Envelope not touched should be
+    _LIT16(KRefEnv, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+    TPtrC16 ptrRefEnv = KRefEnv();
+    TL(ConvertToPtr16LC(*env) == ptrRefEnv);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_FaultLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+
+
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->FaultL();
+
+    //checking Envelope, still Fault exist
+    _LIT16(KRefEnvFault, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault></S:Body></S:Envelope>");
+    TL(ConvertToPtr16LC(*env)== KRefEnvFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    //checking Fault
+    _LIT16(KRefFault, "<S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault>");
+    TL(ConvertToPtr16LC(*fault) == KRefFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    
+    env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KSOAPMessage);
+    TL(env->FaultL() == (CSenSoapFault* )NULL);
+    //checking Envelope not touched should be
+    _LIT16(KRefEnv, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+    TL(ConvertToPtr16LC(*env) == KRefEnv);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SoapActionL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KRef, "\"\"");
+    _LIT8(KRef2, "\"URI-referenceRFC2396\"");
+    _LIT8(KRef3, "");
+    TL(env->SoapAction() == KRef);
+    env->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TL(env->SoapAction() == KRef2);
+    env->SetSoapActionL(KRef2);
+    TL(env->SoapAction() == KRef2);
+    
+    env->SetSoapActionL(KRef3);
+    TL(env->SoapAction() == KRef3);
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SoapAction2L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KRef, "");
+    _LIT8(KRef2, "\"URI-referenceRFC2396\"");
+
+    TL(env->SoapAction2() == KRef);
+    env->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TL(env->SoapAction2() == KRef2);
+    env->SetSoapActionL(KRef2);
+    TL(env->SoapAction2() == KRef2);
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_HasHeaderL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    
+    if(!( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    pEnvelope->AddHeaderL(*el);
+    if(( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope);
+    pEnvelope = NULL;
+    Teardown();
+    return KErrNone;
+    
+    //EUNIT_ASSERT_NO_LEAVE(delete el);
+    //el = NULL;
+    }
+   
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SoapVersionL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    TSOAPVersion var = ESOAP11;
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    CleanupStack::PushL(pEnvelope);
+    
+    TL(var ==  pEnvelope->SoapVersion());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CSenUtilsBCTest::CSenSoapEnvelope_HasBodyL( TTestResult& aResult )
+	{
+    SetupL();
+	
+	CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KBody,"ComarchBody");
+    TPtrC8 result = env->SetBodyL(KBody);
+    if(( env->HasBody() == EFalse )) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    CSenSoapEnvelope* env1 = CSenSoapEnvelope::NewL();
+    TL(env1 != (CSenSoapEnvelope*)NULL);
+
+    if(!( env1->HasBody() == EFalse )) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env1);
+    env1 = NULL;
+    Teardown();
+    return KErrNone;
+    
+	}
+    
+TInt CSenUtilsBCTest::CSenSoapEnvelope_IsFaultL( TTestResult& aResult )
+	{
+    SetupL();
+	
+	CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env!= (CSenSoapEnvelope*)NULL);
+    if(!( env->IsFault() == EFalse )) return KErrArgument;
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    
+	}
+	
+TInt CSenUtilsBCTest::CSenSoapEnvelope_ParseLL( TTestResult& aResult )
+	{
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+	pEnvelope->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*pEnvelope);
+    
+    CleanupStack::PushL(pEnvelope);
+    
+	
+	pEnvelope->ParseL(KInputString);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+
+TInt CSenUtilsBCTest::CSenSoapFault_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    RAttributeArray attributeArray;
+    _LIT8(KFault, "Fault");
+    CSenSoapFault* soapFault = CSenSoapFault::NewL(KFault, KFault, KFault, attributeArray);
+    CleanupStack::PushL(soapFault);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(soapFault != (CSenSoapFault*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Fault xmlns=\"Fault\"/>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*soapFault) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(soapFault);
+    attributeArray.Close();
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete soapFault);
+    soapFault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    RAttributeArray attributeArray;
+    _LIT8(KFault, "Fault");
+    CSenSoapFault* orgSoapFault = CSenSoapFault::NewL(KFault, KFault, KFault, attributeArray);
+    CSenSoapFault* soapFault = CSenSoapFault::NewL(*orgSoapFault);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(soapFault != (CSenSoapFault*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Fault xmlns=\"Fault\"/>");
+    TL(ConvertToPtr16LC(*soapFault) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete orgSoapFault);
+    orgSoapFault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete soapFault);
+    soapFault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_FaultCodeL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KCode, "VersionMismatch");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultCode());
+    TL(fault->FaultCode()== KCode);
+    //TPtrC16 result16(reinterpret_cast<const TUint16*>(fault->FaultCode().Ptr()),(fault->FaultCode().Size()/2));
+    //RDebug::Print( _L( "WSModTester: faultCode [%S]"),&result16);
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultCode());
+    TL(fault->FaultCode() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenSoapFault_FaultSubcodeL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+    
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultSubcode());
+    TL(fault->FaultSubcode() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_FaultStringL( TTestResult& aResult )
+    {
+    	SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KString, "some string");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultString());
+    TL(fault->FaultString() == KString);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultString());
+    TL(fault->FaultString() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_FaultActorL( TTestResult& aResult )
+    {
+    	SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KActor, "some actor");
+    /*EUNIT_ASSERT_NO_LEAVEP*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultActor());
+    TL(fault->FaultActor() == KActor);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultActor());
+    TL(fault->FaultActor() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_DetailL( TTestResult& aResult )
+    {
+    	SetupL();
+CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KDetail, "bla bla");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->Detail());
+    TL(fault->Detail() == KDetail);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->Detail());
+    TL(fault->Detail() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_NewLL( TTestResult& aResult )
+    {
+    	SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    TL(ConvertToPtr16LC(*msg) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_SetSecurityHeaderLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    
+    msg->SetSecurityHeaderL(KText);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*msg) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    msg->SetSecurityHeaderL(KText2);
+    //checking xml
+    _LIT16(KRef2, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text2</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef2 = KRef2();
+    TL(ConvertToPtr16LC(*msg) == ptrRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_AddSecurityTokenLL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    
+    /*EUNIT_ASSERT*/TL(msg->AddSecurityTokenL(KText)==KErrNone);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*msg) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT*/TL(msg->AddSecurityTokenL(KText2)==KErrNone);
+    //checking xml
+    _LIT16(KRef2, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">texttext2</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef2 = KRef2();
+    TL(ConvertToPtr16LC(*msg) == ptrRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_ParseLL( TTestResult& aResult )
+	{
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenParser* pParser = CSenParser::NewLC();
+	CSenSoapMessage* pMessage = CSenSoapMessage::NewL();
+	pMessage->SetReader( *iXmlReader );	
+    iXmlReader->SetContentHandler(*pMessage);
+    
+    CleanupStack::PushL(pMessage);
+    
+	
+	pMessage->ParseL(KInputString);
+
+    CleanupStack::PopAndDestroy(pMessage);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    CleanupStack::PushL(hdr);
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*hdr) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(hdr);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC();
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+    
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);//Ptr
+    Teardown();
+    return KErrNone;
+    }
+
+  
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC(KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);
+    
+    //EUNIT_ASSERT_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText, KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+	CleanupStack::PushL(hdr);
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"text\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2); 
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_2L( TTestResult& aResult )
+    {
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC(KText, KText);
+    TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"text\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"></wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">text</wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_1L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KNullDesC8, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:BinarySecurityToken wsu:Id=\"token\" ValueType=\"\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"></wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KText, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:BinarySecurityToken wsu:Id=\"token\" ValueType=\"text\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">text</wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* timestamp=NULL;
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created></wsu:Timestamp>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::TimestampL(KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created></wsu:Timestamp>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_1L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* timestamp=NULL;
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+
+     
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created><wsu:Expires>text</wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    
+    TL(CSenWsSecurityHeader::TimestampL(KText, KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::TimestampL(KText, KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created><wsu:Expires>text</wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_2L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+     
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_3L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader::TPasswordType aType = CSenWsSecurityHeader::EText;
+
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KNullDesC8, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+  
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KText, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+ 
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KNullDesC8, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KText, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_4L( TTestResult& aResult )
+    {
+    SetupL();
+   
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+
+	CSenWsSecurityHeader::TPasswordType aType = CSenWsSecurityHeader::EText;
+
+//testing NULL
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText, KText);
+    HBufC8* token=NULL;
+    token = hdr->UsernameTokenL(*provider, aType);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    provider = CSenIdentityProvider::NewL(KText, KText);
+    provider->SetUserInfoL(KText, KText2, KText);
+    token = hdr->UsernameTokenL(*provider, aType);
+    TL(token != (HBufC8*)NULL);
+    //checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    TPtr8 ptrToken2 = token->Des();
+    TL(ptrToken2 == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewL_1L( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*hdr) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenLL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+//testing NULL
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText, KText);
+    HBufC8* token=NULL;
+    token = hdr->UsernameTokenL(*provider);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    provider = CSenIdentityProvider::NewL(KText, KText);
+    provider->SetUserInfoL(KText, KText2, KText);
+    token = hdr->UsernameTokenL(*provider);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef2 = KRef2();
+    TPtr8 ptrToken2 = token->Des();
+    TL(ptrToken2 == ptrRef2);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_1L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    /*EUNIT_ASSERT*/TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, token)==KErrNone);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    /*EUNIT_ASSERT*/TL(CSenWsSecurityHeader::UsernameTokenL(KText, token)==KErrNone);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef2 = KRef2();
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    _LIT8(KSecurityXmlNsRef, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+        /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(hdr->XmlNs());
+    TL(hdr->XmlNs() == KSecurityXmlNsRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsPrefixL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    _LIT8(KSecurityXmlNsPrefixRef, "wsse");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(hdr->XmlNsPrefix());
+    TL(hdr->XmlNsPrefix() == KSecurityXmlNsPrefixRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenUtilsBCTest::SenDateUtils_FromXmlDateTimeLL( TTestResult& aResult )
+    {
+    	    SetupL();
+    //normal
+    TTime ttime, ttime2;
+    _LIT8(KIn1, "2005-02-28T13:20:05Z");
+    _LIT(KDateTimeString1, "28-feb/05 01:20.05pm");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn1);
+    ttime2.Parse(KDateTimeString1);
+    TL(ttime == ttime2);
+    
+    //-5
+    _LIT8(KIn2, "2005-02-28T13:20:05-05:00");
+    _LIT(KDateTimeString2, "28-feb/05 08:20.05am");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn2);
+    ttime2.Parse(KDateTimeString2);
+    TL(ttime == ttime2);
+    
+    //+5
+    _LIT8(KIn3, "2005-02-28T13:20:05+05:00");
+    _LIT(KDateTimeString3, "28-feb/05 06:20.05pm");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn3);
+    ttime2.Parse(KDateTimeString3);
+    TL(ttime == ttime2);
+    
+    //1 increase precision
+    _LIT8(KIn4, "2005-02-28T13:20:05.5Z");
+    _LIT(KDateTimeString4, "20050127:132005.500000");//The month and day values are offset from zero.
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn4);
+    ttime2 = TTime(KDateTimeString4);
+    TL(ttime == ttime2);
+    
+    
+    //3 increase precision
+    _LIT8(KIn5, "2005-02-28T13:20:05.231Z");
+    _LIT(KDateTimeString5, "20050127:132005.231000");//The month and day values are offset from zero.
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn5);
+    ttime2 = TTime(KDateTimeString5);
+    TL(ttime == ttime2);
+
+    //-----------wrong
+	
+    //month
+    _LIT8(KIn6, "2005-55-28T13:20:05Z");
+    TRAPD( err, SenDateUtils::FromXmlDateTimeL(KIn6));
+    if(err != KErrOverflow) return err;
+    
+  //day
+    _LIT8(KIn7, "2005-02-58T13:20:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn7));
+    if(err != KErrOverflow) return err;
+
+    
+    //hour
+    _LIT8(KIn9, "2005-02-28T33:20:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn9));
+    if(err != KErrOverflow) return err;
+
+    //minute
+    _LIT8(KIn10, "2005-02-28T13:70:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn10));
+    if(err != KErrOverflow) return err;
+
+    //second
+    _LIT8(KIn11, "2005-02-28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn11));
+    if(err != KErrOverflow) return err;
+
+    //+hour
+    _LIT8(KIn12, "2005-02-28T13:20:05+88:00");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn12));
+    if(err != KErrOverflow) return err;
+
+    //UTC wrong designator
+    _LIT8(KIn13, "2005-02-28T13:20:65Z05:00");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn13));
+    if(err != KErrOverflow) return err;
+
+    
+    //short garbage
+    _LIT8(KIn14, "xx");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn14));
+    if(err != KErrUnderflow) return err;
+
+    //garbage year
+    _LIT8(KIn15, "xxxx-02-28T13:20:65Z");
+    //EUNIT_ASSERT_LEAVE
+    //ASSERT(SenDateUtils::FromXmlDateTimeL(KIn15));
+
+    //"-"
+    _LIT8(KIn16, "2005x02-28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn16));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn17, "2005-02x28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn17));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn18, "2005-02-28X13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn18));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn19, "2005-02-28X13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn19));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn20, "2005-02-28T13-20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn20));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn21, "2005-02-28T13:20-65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn21));
+        if(err != KErrGeneral) return err;
+
+    //31 II
+    _LIT8(KIn8, "2005-02-31T13:20:05Z");
+//    EUNIT_ASSERT_PANIC(SenDateUtils::FromXmlDateTimeL(KIn8),"USER", 3 );
+		TestModuleIf().SetExitReason (TestModuleIf(). EPanic, ETDateTimeBadDateTime);
+		SenDateUtils::FromXmlDateTimeL(KIn8);
+				
+    Teardown();
+    return KErrNone;
+}
+
+TInt CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf8LL( TTestResult& aResult )
+    {
+    SetupL();
+    //KXmlDateTimeMaxLength = 25
+    _LIT(KDate, "23:34.56");
+    _LIT8(KRef, "0000-01-01T23:34:56Z");
+    TTime ttime;
+    TInt res(0);
+    HBufC8* writeBuf;
+    TInt error  = ttime.Parse(KDate);
+    
+		//OK, more
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength+10);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult2 = writeBuf->Des();
+    // EUNIT_ASSERT_NO_LEAVE 
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf8L(ptrResult2, ttime));
+    TL(ptrResult2 == KRef);
+    delete writeBuf;
+	  writeBuf = NULL; 
+
+    //OK,equal
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult3 = writeBuf->Des();
+    //EUNIT_ASSERT_NO_LEAVE
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf8L(ptrResult3, ttime));
+    TL(ptrResult3 == KRef);
+    delete writeBuf;
+	  writeBuf = NULL; 
+		Teardown();
+		
+		TRAP(res,
+					//SetupL();
+    			//CleanupStack::PushL(iXmlReader);
+    	    //KErrOverflow
+    	    writeBuf=HBufC8::NewLC(SenDateUtils::KXmlDateTimeMaxLength - 20);
+    	    TPtr8 ptrResult = writeBuf->Des();
+    	    SenDateUtils::ToXmlDateTimeUtf8L(ptrResult, ttime);
+    	    CleanupStack::PopAndDestroy();//writeBuf
+    	    //CleanupStack::Pop();//iXmlReader
+    	    //Teardown();
+    	    );
+    if(res != KErrOverflow) 
+    	return res;
+			   
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf82LL( TTestResult& aResult )
+    {
+    SetupL();
+
+    //KXmlDateTimeMaxLength = 25
+    _LIT(KDate, "23:34.56");
+    _LIT8(KRef, "0000-01-01T23:34:56.000000Z");
+    TTime ttime;
+    TInt res(0);
+    HBufC8* writeBuf;
+    TInt error  = ttime.Parse(KDate);
+    
+    //OK, more
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength+10);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult2 = writeBuf->Des();
+    // EUNIT_ASSERT_NO_LEAVE 
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf82L(ptrResult2, ttime));
+    TL(ptrResult2 == KRef);
+    delete writeBuf;
+	  writeBuf = NULL; 
+
+    //OK,equal
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult3 = writeBuf->Des();
+    //EUNIT_ASSERT_NO_LEAVE
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf82L(ptrResult3, ttime));
+    TL(ptrResult3 == KRef);
+    delete writeBuf;
+		writeBuf = NULL; 
+		Teardown();
+		
+		TRAP(res,
+    	    //KErrOverflow
+    	    writeBuf=HBufC8::NewLC(SenDateUtils::KXmlDateTimeMaxLength - 20);
+    	    TPtr8 ptrResult = writeBuf->Des();
+    	    SenDateUtils::ToXmlDateTimeUtf82L(ptrResult, ttime);
+    	    CleanupStack::PopAndDestroy();//writeBuf
+    	    );    				
+    if(res != KErrOverflow) 
+    	return res;
+    	
+
+    
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::SenTransportProperties_FileAttachmentLL(TTestResult& aResult )
+{
+    SetupL();
+
+	CSenTransportProperties* transProp = CSenTransportProperties::NewLC();
+    HBufC8* value = NULL;
+    TL(transProp->FileAttachmentL(_L8("1"),value) == KErrNotFound);
+    TL(value == (HBufC8*)NULL);
+    
+    transProp->SetFileAttachmentL(_L8("1"),_L8("abcd"));
+    TL(transProp->FileAttachmentL(_L8("1"),value) == KErrNone);
+    TL(*value ==  _L8("abcd"));
+
+    delete value;
+    CleanupStack::PopAndDestroy(transProp);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL();
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewLCL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC();
+
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewL_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenXmlProperties_NewLC_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC(KString,*pParser);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewL_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL(*pElement);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewLC_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC(*pElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_NewLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);	
+	if(pElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewLCL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewLC();
+	if(pElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewL_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewLC_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewLC(KString,*pParser);
+
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewL_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewL(*pElement);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewLC_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewLC(*pElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+
+TInt CSenUtilsBCTest::SenTransportProperties_AsUtf8LL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>value</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    HBufC8* Utf8Buf=pElement->AsUtf8L();
+    TL(*Utf8Buf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);    
+    delete Utf8Buf;
+    Teardown();
+    return KErrNone;
+	}
+	        
+TInt CSenUtilsBCTest::SenTransportProperties_SetPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>value</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenUtilsBCTest::SenTransportProperties_PropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KValue,"Value");
+	TPtrC8 ValuePtr;
+	TPtrC8 ValuePtr1;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    
+    //true case
+    TInt retval=pElement->PropertyL(_L8("Property"),ValuePtr);
+    TL(retval == KErrNone);
+      
+    //false case
+    retval=pElement->PropertyL(_L8("NoProperty"),ValuePtr1);
+    TL(retval == KErrNotFound);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_SetIntPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>10</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetIntPropertyL(_L8("Property"),10);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval==KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_IntPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	TInt PropValue;
+	TInt PropValue1;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIntPropertyL(_L8("Property"),10);
+    //true case
+    TInt retval=pElement->IntPropertyL(_L8("Property"),PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    //false case
+    retval=pElement->IntPropertyL(_L8("NoProperty"),PropValue1);
+    TL(retval == KErrNotFound);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_SetBoolPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>true</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetBoolPropertyL(_L8("Property"),1);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);		
+	delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_BoolPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool BoolValue=1;
+	TBool BoolValue1;
+	TBool BoolValue2;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetBoolPropertyL(_L8("Property"),BoolValue);
+    //true case
+    TInt retval=pElement->BoolPropertyL(_L8("Property"),BoolValue1);
+    TL(retval == KErrNone);
+    TL(BoolValue == BoolValue1);
+    //false case
+    retval=pElement->BoolPropertyL(_L8("NoProperty"),BoolValue2);
+    TL(retval == KErrNotFound);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_SetOmittedLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KText,"<Properties><Property Omitted=\"true\">value</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    TInt retval=pElement->SetOmittedL(_L8("Property"),1);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_RemovePropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KText,"<Properties><Property1>value</Property1><Property2>value</Property2></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property1"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property2"),_L8("value"));
+    //True
+    TInt retval=pElement->RemovePropertyL(_L8("Property"));
+    HBufC8* ElementBuf=pElement->AsUtf8L(); 
+    TL(retval == KErrNone);
+    //False
+    retval=pElement->RemovePropertyL(_L8("NoProperty"));
+    TL(retval == KErrNotFound);
+    TL(*ElementBuf == KText);
+    CleanupStack::PopAndDestroy(pElement);	
+	delete ElementBuf;			
+	ElementBuf=NULL;
+    Teardown();
+    return KErrNone;
+   	}
+   	/*
+TInt CSenUtilsBCTest::SenTransportProperties_CloneLL()
+	{
+	_LIT8(KCloneText,"<Properties><Property>value</Property><Property1>value</Property1></Properties>");
+	TInt okRnotok;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property1"),_L8("value"));
+    MSenProperties* pCloneElement=pElement->Clone(okRnotok);
+    CleanupStack::PushL(pCloneElement);
+    HBufC8* CloneElementBuf=pCloneElement->AsUtf8L();
+    EUNIT_ASSERT_EQUALS(*CloneElementBuf,KCloneText);
+    EUNIT_ASSERT_EQUALS(okRnotok,KErrNone);
+	delete CloneElementBuf;				
+	CleanupStack::PopAndDestroy(pCloneElement);
+	CleanupStack::PopAndDestroy(pElement);
+	}
+*/
+TInt CSenUtilsBCTest::SenTransportProperties_HeartbeatLL(TTestResult& aResult )
+{
+    SetupL();
+	TInt Delta=10;
+	TInt Delta1;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetHeartbeatL(Delta);
+    TInt retval=pElement->HeartbeatL(Delta1);
+    TL(retval == KErrNone);
+    TL(Delta1 == Delta);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetHeartbeatLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Heartbeat>10</Heartbeat></Properties>");
+	TInt Delta=10;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetHeartbeatL(Delta);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);	
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_IapIdLL(TTestResult& aResult )
+{
+    SetupL();
+	TUint32 Delta;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIapIdL(101);
+    TInt retval=pElement->IapIdL(Delta);
+	TL(retval == KErrNone);
+    TL(Delta == 101);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetIapIdLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><IapId>101</IapId></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIapIdL(101);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ProxyPortLL(TTestResult& aResult )
+{
+    SetupL();
+	TInt PortNum;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyPortL(8080);
+    TInt retval=pElement->ProxyPortL(PortNum);
+    TL(retval == KErrNone);
+    TL(PortNum == 8080);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetProxyPortLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><ProxyPort>8080</ProxyPort></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyPortL(8080);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ProxyHostLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 host;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyHostL(_L8("tcp.mws.mobile.msn-ppe.com"));
+    TInt retval=pElement->ProxyHostL(host);
+    TL(retval == KErrNone);
+    TL(host == _L8("tcp.mws.mobile.msn-ppe.com"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetProxyHostLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><ProxyHost>tcp.mws.mobile.msn-ppe.com</ProxyHost></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyHostL(_L8("tcp.mws.mobile.msn-ppe.com"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}	
+        
+TInt CSenUtilsBCTest::SenTransportProperties_ProxyUsageLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Usage;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyUsageL(TRUE);
+    TInt retval=pElement->ProxyUsageL(Usage);
+    TL(retval == KErrNone);
+    TL(Usage == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetProxyUsageLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><ProxyUsage>true</ProxyUsage></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyUsageL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SecureDialogLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Security;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSecureDialogL(TRUE);
+    TInt retval=pElement->SecureDialogL(Security);
+    TL(retval == KErrNone);
+    TL(Security == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetSecureDialogLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><SecureDialog>true</SecureDialog></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSecureDialogL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_UserAgentLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 UserAgent;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetUserAgentL(_L8("TestAgent"));
+    TInt retval=pElement->UserAgentL(UserAgent);
+    TL(retval == KErrNone);
+    TL(UserAgent ==_L8("TestAgent"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetUserAgentLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><User-Agent>TestAgent</User-Agent></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetUserAgentL(_L8("TestAgent"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_DeviceIDLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 DeviceID;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDeviceIDL(_L8("TestDevice"));
+    TInt retval=pElement->DeviceIDL(DeviceID);
+    TL(retval == KErrNone);
+    TL(DeviceID == _L8("TestDevice"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetDeviceIDLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><DeviceID>TestDevice</DeviceID></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDeviceIDL(_L8("TestDevice"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SoapActionLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 SoapURI;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TInt retval=pElement->SoapActionL(SoapURI);
+    TL(retval == KErrNone);
+	TL(SoapURI == _L8("URI-referenceRFC2396"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SetSoapActionLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><SOAPAction>URI-referenceRFC2396</SOAPAction></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_DownloadFolderLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 Download;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDownloadFolderL(_L8("Download"));
+    TInt retval=pElement->DownloadFolderL(Download);
+    TL(retval == KErrNone);
+	TL(Download ==_L8("Download"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SetDownloadFolderLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><DownloadFolder>Download</DownloadFolder></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDownloadFolderL(_L8("Download"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf==KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+        
+   
+TInt CSenUtilsBCTest::SenTransportProperties_SetFileAttachmentLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><FileAttachments>&lt;Attachments&gt;&lt;Attachment0 cid=&quot;test:cid&quot;&gt;c:\\test.file.txt&lt;/Attachment0&gt;&lt;/Attachments&gt;</FileAttachments></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetFileAttachmentL(_L8("test:cid"),_L8("c:\\test.file.txt"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf==KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_MwsNamespaceLL(TTestResult& aResult )
+{
+    SetupL();
+	
+	TPtrC8 NameSpace;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMwsNamespaceL(_L8("Mwsnsuri"));
+    TInt retval=pElement->MwsNamespaceL(NameSpace);
+    TL(retval == KErrNone);
+	TL(NameSpace == _L8("Mwsnsuri"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SetMwsNamespaceLL(TTestResult& aResult )
+{
+    SetupL();
+
+	
+	_LIT8(KElementText,"<Properties><MwsNamespace>Mwsnsuri</MwsNamespace></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMwsNamespaceL(_L8("Mwsnsuri"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_MessageIdLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TPtrC8 MsgId;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMessageIdL(_L8("test-message"));
+    TInt retval=pElement->MessageIdL(MsgId);
+    TL(retval == KErrNone);
+	TL(MsgId == _L8("test-message"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetMessageIdLL(TTestResult& aResult )
+{
+    SetupL();
+
+	_LIT8(KElementText,"<Properties><MessageID>test-message</MessageID></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMessageIdL(_L8("test-message"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_OnewayMessageOnOffLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TBool OnRoff;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    TInt retval=pElement->OnewayMessageOnOffL(OnRoff);
+    TL(retval == KErrNone);
+	TL(OnRoff == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetOnewayMessageOnOffLL( TTestResult& aResult)
+{
+
+    SetupL();
+
+	_LIT8(KElementText,"<Properties><OneWayMessage>true</OneWayMessage></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMaxTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MaxTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_MaxTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenTransportProperties_SetMaxTimeToLiveLL( Result);
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMinTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MinTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetReaderL(TTestResult& aResult )
+{
+    SetupL();
+
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetReader(*iXmlReader);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_PropertiesClassTypeL(TTestResult& aResult )
+{
+    SetupL();
+	MSenProperties::TSenPropertiesClassType var = MSenProperties::ESenTransportProperties;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TL(var == pElement->PropertiesClassType());
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_WriteToLL(TTestResult& aResult )
+{
+    SetupL();
+
+    TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	
+	CSenTransportProperties* pElement1= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement1);
+    pElement1->WriteToL(ElemntStream);
+    
+    CleanupStack::PopAndDestroy(pElement1);
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ReadFromLL(TTestResult& aResult )
+{
+    SetupL();
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->ReadFromL(_L8(""));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_CloneL(TTestResult& aResult )
+{
+	SetupL();
+	TBool Flag;
+	TInt var;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties* pClone = NULL;
+    pClone = (CSenTransportProperties*)pElement->Clone(var); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_IsSafeToCastL(TTestResult& aResult )
+{
+	SetupL();
+	TBool Flag, retVal;
+	MSenProperties::TSenPropertiesClassType pVar = MSenProperties::ESenTransportProperties;
+	
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+	
+    retVal = pElement->IsSafeToCast(pVar); 
+    if(retVal != EFalse)
+    	Flag = 1;
+    else 
+   	    Flag = 0; 
+
+	MSenProperties::TSenPropertiesClassType xVar = MSenProperties::ESenXmlProperties;
+    retVal = pElement->IsSafeToCast(xVar); 
+    if(retVal != EFalse)
+    	Flag = 1;
+    else 
+   	    return KErrArgument; 
+    
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_CloneLL(TTestResult& aResult )
+{
+	SetupL();
+	TBool Flag;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties* pClone = NULL;
+    pClone = (CSenTransportProperties*)pElement->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ApplyBindingLL(TTestResult& aResult )
+{
+	SetupL();
+	TSOAPVersion var = ESOAP11;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+    pElement->ApplyBindingL(var); 
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_MinTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenTransportProperties_SetMinTimeToLiveLL(Result);
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenHttpTransportProperties	*pProperties = CSenHttpTransportProperties::NewL();
+	CleanupStack::PushL(pProperties );
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLCL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenHttpTransportProperties	*pProperties = CSenHttpTransportProperties::NewLC();
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewL_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLC_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewLC(KString,*pParser);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewL_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewL(*pElement);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+		
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLC_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewLC(*pElement);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	
+}
+/*
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenVtcpTransportProperties	*pProperties = CSenVtcpTransportProperties::NewL();
+	CleanupStack::PushL(pProperties );
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLCL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenVtcpTransportProperties	*pProperties = CSenVtcpTransportProperties::NewLC();
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewL_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content plus some other content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+		
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content plus some other content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewLC(KString,*pParser);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewL_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewL(*pElement);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+		 
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewLC(*pElement);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);	 
+    Teardown();
+    return KErrNone;
+	
+}
+    
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_OnewayMessageOnOffLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TBool OnRoff;
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    TInt retval=pElement->OnewayMessageOnOffL(OnRoff);
+    TL(retval == KErrNone);
+	TL(OnRoff == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_SetOnewayMessageOnOffLL( TTestResult& aResult)
+{
+
+    SetupL();
+
+	_LIT8(KElementText,"<Properties><OneWayMessage>true</OneWayMessage></Properties>");
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMaxTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MaxTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_MaxTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenVtcpTransportProperties_SetMaxTimeToLiveLL( Result);
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMinTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MinTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_MinTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenVtcpTransportProperties_SetMinTimeToLiveLL(Result);
+}
+*/
+//  End of File
Binary file websrv_pub/web_service_connection_api/tsrc/connection/bmarm/SenServiceConnectionBCTest.def has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/bwins/SenServiceConnectionBCTest.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/bwins/SenServiceConnectionBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void)
+	?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &)
+
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/Thumbs.db has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/sunset.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/sunset2.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/testpic3.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/testpic4.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/winter.jpg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/data/winter2.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/eabi/SenServiceConnectionBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI13CTestConsumer @ 3 NONAME ; #<TI>#
+	_ZTI13CTestProperty @ 4 NONAME ; #<TI>#
+	_ZTI13CTestProvider @ 5 NONAME ; #<TI>#
+	_ZTI15CTestConnection @ 6 NONAME ; #<TI>#
+	_ZTI17CTestFileObserver @ 7 NONAME ; #<TI>#
+	_ZTV13CTestConsumer @ 8 NONAME ; #<VT>#
+	_ZTV13CTestProperty @ 9 NONAME ; #<VT>#
+	_ZTV13CTestProvider @ 10 NONAME ; #<VT>#
+	_ZTV15CTestConnection @ 11 NONAME ; #<VT>#
+	_ZTV17CTestFileObserver @ 12 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Build information file for connection 
+*
+*/
+
+
+
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+../sis/testsc_c.bat		/epoc32/winscw/c/testsc_c.bat
+../sis/testsc_z.bat		/epoc32/winscw/c/testsc_z.bat	
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_connection.ini
+
+PRJ_TESTMMPFILES
+senserviceconnection.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/group/connection.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+;Header
+#{"Connection test Suite"},(0x01700000),0,0,2
+
+;Localised Vendor name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Supports Series 60 v 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"} 
+
+;Files to install
+"\epoc32\release\armv5\urel\CSenServiceConnectionBCTest.dll"-"!:\sys\bin\CSenServiceConnectionBCTest.dll"
+"..\init\ConnectionBCTest.ini"-"!:\testframework\ConnectionBCTest.ini"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/group/senserviceconnection.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senserviceconnection
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          CSenServiceConnectionBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY              ALL -TCB
+VENDORID        VID_DEFAULT        
+//VENDORID 0x70000001 
+// Enables Nokia intra hosted AB service endpoint to be used:
+MACRO           VALIMO_ADDRESSBOOK_SERVICE 
+
+// Activates Radio@AOL ID-WSF service endpoint to be used:
+//MACRO        AOL_RADIO_SERVICE 
+
+
+// Enables usage of old namespaces 
+// => Needed when WBXML Compression is used.
+//MACRO           OLD_MSN_NAMESPACE_2005_08
+
+SOURCEPATH      ../src
+SOURCE          senserviceconnectioncases.cpp
+SOURCE          senserviceconnection.cpp
+SOURCE          TestConnection.cpp
+SOURCE          testproperty.cpp
+SOURCE          testprovider.cpp
+SOURCE          testfileobserver.cpp
+SOURCE          testconsumer.cpp
+
+
+       //TARGETPATH      ?target_path
+DEFFILE         SenServiceConnectionBCTest.def
+
+USERINCLUDE     ../inc
+
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+
+SYSTEMINCLUDE   /epoc32/include/libc
+SYSTEMINCLUDE   /epoc32/include/libc/sys
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         stiftestinterface.lib
+LIBRARY         euser.lib
+LIBRARY         flogger.lib
+LIBRARY         apparc.lib 
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         eikcoctl.lib 
+LIBRARY         avkon.lib 
+LIBRARY         bafl.lib 
+LIBRARY         eikctl.lib
+LIBRARY         egul.lib 
+LIBRARY         fbscli.lib 
+LIBRARY         PBKENG.LIB 
+LIBRARY         cntmodel.lib 
+LIBRARY         aknskins.lib //for skin sbackground
+LIBRARY         gdi.lib
+
+LIBRARY         ecom.lib
+LIBRARY         commdb.lib
+LIBRARY         efsrv.lib
+LIBRARY         estor.lib
+
+LIBRARY         XMLFRAMEWORK.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenServConn.lib
+LIBRARY         SenServMgr.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenXml.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenMessages.lib
+#else 
+// for .SIS target
+LIBRARY         wsServConn.lib
+LIBRARY         wsServMgr.lib
+LIBRARY         wsServDesc.lib
+LIBRARY         wsXml.lib
+LIBRARY         wsUtils.lib
+LIBRARY         wsMessages.lib
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+LIBRARY                 XmlEngineDOM.lib
+LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/inc/SenServiceConnectionBCTest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,627 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenFragment test module.
+*
+*/
+
+
+#ifndef __SENSERVICECONNECTION_H__
+#define __SENSERVICECONNECTION_H__
+
+//#define __ENABLE_ALR__
+
+//  EXTERNAL INCLUDES
+#include <StifTestModule.h>
+#include <StifLogger.h>
+
+#include <MSenServiceConsumer.h>
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenXmlReader.h>
+#include <SenServiceConnection.h>
+
+#include <f32file.h>
+#include <e32base.h> // for CActive
+#include <e32std.h>
+#include <unistd.h>
+#include <aknnotewrappers.h> 
+#include <SenIdentityProvider.h>
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 50
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 6
+
+#ifdef __ENABLE_ALR__
+	#include <comms-infras/cs_mobility_apiext.h>
+	#include <senserviceconnectioninterfaces.h>
+#endif //__ENABLE_ALR__
+
+#include <msencobrandinginterface.h>
+
+// Logging path
+_LIT( KSenServiceConnectionLogPath, "\\logs\\testframework\\SenServiceConnectionBCTest\\" ); 
+// Log file
+_LIT( KSenServiceConnectionLogFile, "SenServiceConnectionBCTest.txt" ); 
+
+//  INTERNAL INCLUDES
+namespace
+    {
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    }
+
+enum TUT_CSenServiceConnection
+    {
+    ENotInitialized = 1,
+    EConnectionNotReady,
+    };
+    
+enum TMSCommands
+    {
+    EMSNMessengerRegister,
+    EMSNMessengerInvite,
+    EMSNMessengerSend,
+    EMSNMessengerUnRegister,
+    };
+
+//  FORWARD DECLARATIONS
+class CSenBaseFragment;
+class CSenBaseElement;
+class CSenSoapEnvelope;
+class SenXmlUtils;
+class CSenServiceConnection;
+class CSenXmlReader;
+class CSenDomFragment;
+class CSenXmlServiceDescription;
+class CSenServicePattern;
+class CSenServiceManager;
+class CSenSoapMessage;
+class CSenSoapMessage2;
+class CSenVtcpTransportProperties;
+
+/*
+#include <e32def.h>
+#ifndef NONSHARABLE_CLASS
+    #define NONSHARABLE_CLASS(x) class x
+#endif
+*/
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenServiceConnectionBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenFragmentBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenServiceConnectionBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+
+//  CLASS DEFINITION
+/**
+ *
+ * EUnitWizard generated test class. 
+ *
+ */
+NONSHARABLE_CLASS( CSenServiceConnectionBCTest )
+#ifdef __ENABLE_ALR__
+     : public CTestModuleBase, public MSenServiceConsumer, public MSenAuthenticationProvider, public MSenExtendedConsumerInterface, public MSenCoBrandingObserver, MSenHostletConsumer, public MMobilityProtocolResp
+#else
+     : public CTestModuleBase, public MSenServiceConsumer, public MSenAuthenticationProvider, public MSenExtendedConsumerInterface, public MSenCoBrandingObserver, MSenHostletConsumer
+#endif //__ENABLE_ALR__     
+    {
+    public:
+        enum TCallback
+            {
+            ECallbackNone = 0,
+            ECallbackHandleMessage,
+            ECallbackHandleError
+            };
+    
+        public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenServiceConnectionBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenServiceConnectionBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenFragment. It is called once for every instance of 
+        *       TestModuleSenFragment after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenFragment.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenFragment. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceConnectionBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+           // MService Consumer implementation
+        void HandleMessageL(const TDesC8& aMessage);        
+        void HandleErrorL(const int aErrorCode, const TDesC8& aError);
+        void SetStatus(const TInt aStatus);
+
+        void SetupL();
+        void Teardown();
+        void ErrorL(TInt aCode);
+
+        TInt UT_CSenServiceConnection_RegisterIdentityProviderLL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_NewL_ContractL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ContractL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_PatternL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_PatternL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_ID_WSF_PatternL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ID_WSF_PatternL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_NewL_ContractL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_ContractL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_DescriptionL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_DescriptionL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewL_WS_I_PatternL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_NewLC_WS_I_PatternL1( TTestResult& aResult );
+        TInt UT_CSenServiceConnectionSnapIdL( TTestResult& aResult );
+        TInt UT_CSenServiceConnectionSetSnapIdL( TTestResult& aResult );
+
+    	TInt UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SendL_RFileL_IPCBigrequest( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SubmitL_RFileL_IPCBigrequest( TTestResult& aResult );
+    	TInt UT_CSenServiceConnection_SubmitL_RFileL_MTOM( TTestResult& aResult );
+    
+        TInt UT_CSenServiceConnection_SendL_NoErrorL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_CancelL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_ConNotInitialL( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_SendMultipleMessagesL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Get_Post1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Get_Post2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Proxy1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Proxy2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Pattern_IAP1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Pattern_IAP2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_Pattern_IAP3L( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ContentType1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_ContentType2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_UserAgent1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_UserAgent2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_MessageSoapActionL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_SoapAction1L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_SoapAction2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SendL_CustomHttpHeaderL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ConBusyL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ConInitializingL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ConExpiredL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ErrSubmitL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_ErrNoMemoryL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SubmitLL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_IsReadyL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_HasFacetLL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_CompleteServerMessagesOnOffL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SendL_1L( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_SubmitL_1L( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_StartTransactionL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_TransactionCompletedL( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries1( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries2( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries3( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries4( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries5( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries6( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries7( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries8( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Boundaries9( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_TP_SecDialog( TTestResult& aResult );     
+        
+        TInt UT_CSenServiceConnection_TP_Omitted_True( TTestResult& aResult );     
+
+        TInt UT_CSenServiceConnection_TP_Omitted_False( TTestResult& aResult );           
+        
+        TInt UT_CSenServiceConnection_TP_Removed( TTestResult& aResult );     
+        
+        TInt UT_CSenServiceConnection_TP_Omit_Rem( TTestResult& aResult );
+        
+        
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_L( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL( TTestResult& aResult );
+
+        TInt UT_CSenServiceConnection_TestMessengerL( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger2L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger3L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger4L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger5L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger6L( TTestResult& aResult );
+        TInt UT_CSenServiceConnection_TestMessenger7L( TTestResult& aResult );
+        
+        TInt UT_CSenServiceConnection_TP_Custom_Header(const TDesC8& KCustomHttpHeader,
+                                                       const TDesC8& KCustomHttpHeaderValue);
+                                    
+        TInt UT_CSenServiceConnection_TP_Send(const TDesC8& aLogFileName,
+                                              const TDesC8& aCustomHttpHeader,
+                                              const TDesC8& aCustomHttpHeaderValue,
+                                              CSenServiceConnection* iServiceConnection);
+                                              
+        TInt UT_CSenServiceConnection_TP_CheckLogs(const TDesC& aLogFilePath,
+                                                   const TDesC8& aCustomHttpHeader,
+                                                   const TDesC8& aCustomHttpHeaderValue);                                    
+                                                   
+        TUint32 SearchIAPIdByNameL( const TDesC& aIAPName );
+        
+        CSenSoapMessage* CreateAuthRequestLC();
+        
+        CSenSoapMessage2* CreateNewAuthRequestLC();
+        
+        HBufC8* ReadFileL(const TDesC& aFilename);
+        
+        TInt Find(const TDesC8& aDestination, const TDesC8& aDescToFind, TInt aStartingPos);
+        TBool ReplaceAll(TPtr8 aDestination, const TDesC8& aFrom, const TDesC8& aTo);
+        TBool DecodeHttpCharactersL(const TDesC8& aOriginal, HBufC8*& aDecoded);
+        
+        HBufC8* HttpMethodValueFromXmlLC(const TDesC8& aXml);
+        
+        HBufC8* HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                           const TDesC8& aPropertyName);
+                                           
+        TInt StartActiveScheduler(TInt aNumberOfSentMessages);
+        TInt StopActiveScheduler();
+        
+        CSenVtcpTransportProperties* CreateMSTransportPropertiesL(TMSCommands aCommand);
+        CSenSoapMessage2* CreateMSSoapMessage(TMSCommands aCommand);
+        TInt RegisterSTSL();
+        TInt RegisterSTSInvalidPasswordL();
+        TInt UnregisterSTSL( );
+        TInt SetPolicyL(CSenXmlServiceDescription* pServDesc, const TDesC8& pName,
+                                                              const TDesC8& pValue);
+		const CSenIdentityProvider* IdentityProviderL() const ;
+        TInt CreateConnectionToMessengerServiceL();
+        TInt CreateConnectionToMessengerServiceWithoutCallbackL();
+        
+        TInt AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage);
+        TInt AddApplicationHeader2L(CSenSoapMessage2& aMessage);
+        
+        TInt SendL( TTestResult& aResult );                                                                   
+        TInt SubmitL( TTestResult& aResult );                                                                         
+        TInt IsReady( TTestResult& aResult ) ;                                                                        
+        TInt HasFacetL( TTestResult& aResult );                                                                       
+                                                             
+        TInt CompleteServerMessagesOnOff( TTestResult& aResult ) ;                                                    
+        TInt Send2L( TTestResult& aResult ) ;                                                                         
+        TInt Submit2L( TTestResult& aResult ) ;                                                                       
+        TInt ServiceDescriptionL( TTestResult& aResult ) ;                                                            
+        TInt StartTransaction( TTestResult& aResult ) ;                                                               
+        TInt TransactionCompleted( TTestResult& aResult ) ;                                                           
+        TInt TxnId( TTestResult& aResult ) ;                                                                          
+        TInt SetTransportPropertiesL( TTestResult& aResult ) ;                                                        
+        TInt TransportPropertiesL( TTestResult& aResult ) ;                                                           
+        TInt Send3L( TTestResult& aResult ) ;                                                                         
+        TInt Submit3L( TTestResult& aResult ) ;                                                                       
+        TInt Send4L( TTestResult& aResult ) ;                                                                         
+        TInt Submit4L( TTestResult& aResult ) ;                                                                       
+        TInt Send5L( TTestResult& aResult ) ;                                                                         
+        TInt Submit5L( TTestResult& aResult ) ;                                                                       
+        TInt Response( TTestResult& aResult ) ;                                                                       
+        TInt CancelTransaction( TTestResult& aResult ) ;                                                              
+        TInt IdentityProvider1L( TTestResult& aResult ) ;                                                              
+        TInt Identifier( TTestResult& aResult ) ;                                                                     
+        TInt Name( TTestResult& aResult );
+        TInt Value( TTestResult& aResult );
+        TInt IntValue( TTestResult& aResult );
+        TInt BoolValue( TTestResult& aResult );
+        TInt Type( TTestResult& aResult );
+        TInt ValueTokensL( TTestResult& aResult );
+        TInt IdentityProvider2L( TTestResult& aResult ) ;
+        TInt Username1L( TTestResult& aResult ) ;
+        TInt Password1L( TTestResult& aResult ) ;
+        TInt ExtendedInterface1L( TTestResult& aResult ) ;                                  
+        TInt TransferProgress(TTestResult& aResult );
+        TInt HandleMeassage(TTestResult& aResult);
+        TInt HandleErrorL(TTestResult& aResult);
+        TInt SetStatus(TTestResult& aResult);
+        TAny* GetInterfaceByUid( TUid aUID );
+        		
+        #ifdef __ENABLE_ALR__
+            TInt ALRL(TTestResult& aResult);
+           
+            //mobility methods
+            virtual void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+                                                         TAccessPointInfo aNewAPInfo,
+                                                         TBool aIsUpgrade,
+                                                         TBool aIsSeamless ) ;
+            virtual void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ) ;
+            
+            virtual void Error(TInt aError) ;
+        #endif //__ENABLE_ALR__
+            TInt CoBrandL(TTestResult& aResult);
+            virtual TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId);
+            TInt HostletConsumerL(TTestResult& aResult);
+            virtual void SetConnectionId( TInt aConnectionId );
+            TInt DataTrafficDetailsL(TTestResult& aResult);
+    private:    // Data
+        
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenXmlServiceDescription*  iSession;
+        CSenServiceConnection*      iServiceConnection;
+        CSenSoapMessage* iSOAPMessage;
+        #ifdef __ENABLE_ALR__       
+            MSenAlrServiceConnection* iALRSC;
+        #endif //__ENABLE_ALR__
+        TBool iUseALR;
+        TInt iAlrCallBackRetryCount;
+        TBool iCoBrandingCallbackOption;
+        TBool iHostletConsumerOption;
+        TBool iGetDataTrafficDetails;
+        TBool isNewCarrierAccepted;
+        TBool isMigratedToPrefferedCarrier;
+        CSenServiceManager*         iManager;
+        CSenXmlReader*              iXmlReader;
+        
+        TInt                        iTransactionId;
+        TInt                        iConnectionState;
+        TBool                       iInitialized;
+        TBool                       iReady;
+        
+        TCallback                   iCallback;
+        HBufC8*                     ipMessage;
+        
+        TInt                        iNumberOfPendingOps;
+        HBufC8*                     ipFrameworkID;
+        
+        TInt                        iErrorCode;
+  
+        CSenIdentityProvider*       ipProviderForAuthProvider;
+        TInt                        iAuthInfoAskCounter;
+        RFs							iFsSessionHandle;
+        RFile 						iRFileHandle;
+        
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+		CActiveScheduler* iActiveScheduler;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+        
+        
+    };
+
+#endif      //  __SENSERVICECONNECTION_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/inc/TestConnection.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef TESTCONNECTION_H
+#define TESTCONNECTION_H
+
+#include <SenServiceConnection.h>
+
+
+
+class CTestConnection : public CBase //:public CSenServiceConnection
+{
+    public: // Constructors and destructor
+
+        static CTestConnection* NewL();//MSenServiceConsumer& aConsumer);
+        void ConstructL();//MSenServiceConsumer& aConsumer);
+		 ~CTestConnection();
+		 CTestConnection();
+		 TInt SendL(const TDesC8& aRequest);
+		 TInt SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) ;
+         TInt IsReady(TBool& aReady) ;
+         TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) ;
+         TInt CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) ;
+         TInt SendL(CSenSoapEnvelope& aMessage) ;
+         TInt SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) ;
+         TInt ServiceDescriptionL(HBufC8*& aServiceDescription) ;
+         TInt StartTransaction() ;
+         TInt TransactionCompleted() ;
+         TInt TxnId() ;
+         TInt SetTransportPropertiesL(const TDesC8& aProperties) ;
+         TInt TransportPropertiesL(HBufC8*& aProperties) ;
+         TInt SendL(const TDesC8& aRequest, const TDesC8& aProperties) ;
+         TInt SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) ;
+         TInt SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) ;
+         TInt SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) ;
+         TInt SendL(MSenMessage& aMessage) ;
+      	 TInt SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) ;
+      	 MSenMessage* Response() ;
+    	 TInt CancelTransaction(TInt aTransactionID) ;
+    	 TInt IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) ;
+    	 TInt Identifier() ;
+    	 void RegisterFilesObserverL(MSenFilesObserver& aFilesObserver) ;
+    		
+    		
+    		
+    		
+    		
+    		
+    	//MSENFRAGMENT
+         CSenElement& AsElement() ;
+         CSenElement* ExtractElement() ;
+         void SetReader(CSenXmlReader& aReader) ;
+         CSenXmlReader* Reader() ;
+         void ParseL(const TDesC8& aBuf) ;
+         TInt BuildFrom(const TDesC8& aBuf) ;
+         void DelegateParsingL(MSenFragment& aDelegate) ;
+         void DelegateParsingL(  const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) ;
+
+         void ParseWithL(CSenXmlReader& aReader) ;
+         void SetOwner(MSenFragment& aFragment) ;
+         void ResumeParsingFromL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName) ;
+
+         void SetAttributesL(const RAttributeArray& aAttrs) ;
+
+         void WriteStartElementL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) ;
+
+         void WriteEndElementL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName) ;
+
+         const TDesC8& LocalName() const ;
+        
+         const TDesC8& NsUri() const ;
+
+         const TDesC8& NsPrefix() const ;
+
+         void WriteAsXMLToL(RWriteStream& aWriteStream) ;
+
+         HBufC* AsXmlUnicodeL() ;
+         HBufC8* AsXmlL() ;
+
+         TBool ConsistsOfL(MSenFragment& aCandidate) ;
+    	
+    	//CActive
+    	 void DoCancel() ;
+    	
+    	 void RunL() ;
+    		
+    
+    		
+    		
+
+        
+//        CTestProperty* iProp;
+	//	CSenServiceConnection* iConn;
+    private:
+	//	CSenServiceConnection* iConn;
+};
+
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/inc/testconsumer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TestConsumer_H
+#define TestConsumer_H
+
+// INCLUDES
+
+
+#include <MSenServiceConsumer.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestConsumer: public MSenServiceConsumer, public CBase
+{
+ 	public:
+	 	static CTestConsumer* NewL();
+	 	static CTestConsumer* NewLC();
+		void HandleMessageL(const TDesC8& aMessage = KNullDesC8) ;
+		void HandleErrorL(const TInt aErrorCode = 0, 
+                                  const TDesC8& aErrorMessage= KNullDesC8);
+ 		void SetStatus(const TInt aStatus = 0);
+		
+//	private:
+		CTestConsumer();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/inc/testfileobserver.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TestFileObserver_H
+#define TestFileObserver_H
+
+// INCLUDES
+
+
+#include <MSenServiceConsumer.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestFileObserver: public MSenFilesObserver, public CBase
+{
+ 	public:
+	 	static CTestFileObserver* NewL();
+	 	static CTestFileObserver* NewLC();
+		void TransferProgress(TInt aTxnId = 0, TBool aIncoming = 0, const TDesC8& aMessage= KNullDesC8,
+            const TDesC8& aCid = KNullDesC8, TInt aProgress = 0)    ;         
+		
+//	private:
+		CTestFileObserver();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/inc/testproperty.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef TestProperty_H
+#define TestProperty_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MSenProperty.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestProperty: public MSenProperty, public CBase
+    {
+ 	public:
+	 	static CTestProperty* NewL();
+	 	static CTestProperty* NewLC();
+		TPtrC8 Name() ;
+
+		TPtrC8 Type() ;
+
+		TPtrC8 Value();
+
+		TInt IntValue(TInt& aValue) ;
+
+		TInt BoolValue(TBool& aValue) ;
+
+		TInt ValueTokensL(const TDesC8& aDelimiter,
+		              RPointerArray<TPtrC8>& aTokens) ;
+		              
+	private:
+		CTestProperty();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/inc/testprovider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  connection header declaration      
+*
+*/
+
+
+
+
+
+
+
+
+
+
+#ifndef TestProvider_H
+#define TestProvider_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <MSenAuthenticationProvider.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestProvider: public MSenAuthenticationProvider, public CBase
+{
+ 	public:
+	 	static CTestProvider* NewL();
+	 	static CTestProvider* NewLC();
+		              
+		const CSenIdentityProvider* IdentityProviderL() ;
+		const TPtrC8 UsernameL() ;
+		const TPtrC8 PasswordL() ;
+		TAny* ExtendedInterface(const TInt32 /* aUid */) ;     
+	private:
+		CTestProvider();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/init/ConnectionBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= CSenServiceConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/rom/connection.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __CONNECTION_IBY__
+#define __CONNECTION_IBY__
+
+file=ABI_DIR\BUILD_DIR\CSenServiceConnectionBCTest.dll         PROGRAMS_DIR\CSenServiceConnectionBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/sis/ConnectionBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= CSenServiceConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/sis/connection.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,33 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+;Header
+#{"Connection test Suite"},(0x01700000),0,0,2
+
+;Localised Vendor name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Supports Series 60 v 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"} 
+
+;Files to install
+"\epoc32\release\armv5\urel\CSenServiceConnectionBCTest.dll"      -"!:\sys\bin\CSenServiceConnectionBCTest.dll"
+"\Epoc32\winscw\c\testsc_c.bat"-"!:\testsc.bat"
+"\Epoc32\winscw\c\testframework\testframework_connection.ini"-"!:\testframework\testframework_connection.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/sis/sis.cmd	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,19 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+makesis UT_Connection.pkg
+signsis UT_Connection.SIS UT_ConnectionX.SIS ..\..\..\sis\rd.cer ..\..\..\sis\rd-key.pem
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= CSenServiceConnectionBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/sis/testsc_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\testframework_connection.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule CSenServiceConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_ServiceConnection.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/sis/testsc_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy z:\TestFramework\testframework_connection.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule CSenServiceConnectionBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_ServiceConnection.txt
\ No newline at end of file
Binary file websrv_pub/web_service_connection_api/tsrc/connection/sis/ut_connection.sis has changed
Binary file websrv_pub/web_service_connection_api/tsrc/connection/sis/ut_connectionx.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/TestConnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+#include "TestConnection.h"
+#include <SenElement.h>
+#include <SenXmlReader.h>
+
+CTestConnection::CTestConnection()//:CSenServiceConnection(iProp)
+{
+	
+}
+  
+void CTestConnection::ConstructL()//MSenServiceConsumer& aConsumer)
+{
+//	iConn = CSenServiceConnection::NewL();//aConsumer,_L8(""));
+}
+
+CTestConnection::~CTestConnection()
+{
+//	delete iConn;
+}
+/*
+CTestConnection* CTestConnection::NewL(MSenServiceConsumer& aConsumer)
+{
+	CTestConnection* pTest = new(ELeave) CTestConnection();
+	CleanupStack::PushL(pTest);
+	pTest->ConstructL(aConsumer);
+	CleanupStack::Pop(pTest);
+	return pTest;
+}
+*/
+CTestConnection* CTestConnection::NewL()//MSenServiceConsumer& aConsumer)
+{
+	CTestConnection* pTest = new(ELeave) CTestConnection();
+	CleanupStack::PushL(pTest);
+	//pTest->ConstructL(aConsumer);
+	CleanupStack::Pop(pTest);
+	return pTest;
+}
+
+TInt CTestConnection::SendL(const TDesC8& aRequest)
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aRequest);
+	return retval;
+}
+TInt CTestConnection::SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aRequest, aResponse) ;
+	return retval;
+}
+TInt CTestConnection::IsReady(TBool& aReady) 
+{
+	TInt retval(0);
+//	retval = iConn->IsReady(aReady);
+	return retval;
+}
+TInt CTestConnection::HasFacetL(const TDesC8& aURI, TBool& aHasFacet) 
+{
+	TInt retval(0);
+//	retval = iConn->HasFacetL(aURI, aHasFacet) ;
+	return retval;
+}
+TInt CTestConnection::CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) 
+{
+	TInt retval(0);
+//	retval = iConn->CompleteServerMessagesOnOff(aCompleteOnOff);
+	return retval;
+}
+TInt CTestConnection::SendL(CSenSoapEnvelope& aMessage) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aMessage);
+	return retval;
+}
+TInt CTestConnection::SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aMessage, aResponseTo);
+	return retval;
+}
+TInt CTestConnection::ServiceDescriptionL(HBufC8*& aServiceDescription) 
+{
+	TInt retval(0);
+//	retval = iConn->ServiceDescriptionL(aServiceDescription) ;
+	return retval;
+}
+TInt CTestConnection::StartTransaction() 
+{
+	TInt retval(0);
+//	retval = iConn->StartTransaction();
+	return retval;
+}
+TInt CTestConnection::TransactionCompleted() 
+{
+	TInt retval(0);
+//	retval = iConn->TransactionCompleted() ;
+	return retval;
+}
+TInt CTestConnection::TxnId() 
+{
+	TInt retval(0);
+//	retval = iConn->TxnId() ;
+	return retval;
+}
+TInt CTestConnection::SetTransportPropertiesL(const TDesC8& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->SetTransportPropertiesL(aProperties);
+	return retval;
+}
+TInt CTestConnection::TransportPropertiesL(HBufC8*& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->TransportPropertiesL(aProperties) ;
+	return retval;
+}
+TInt CTestConnection::SendL(const TDesC8& aRequest, const TDesC8& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aRequest, aProperties) ;
+	return retval;
+}
+TInt CTestConnection::SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aRequest, aProperties, aResponse) ;
+	return retval;
+}
+TInt CTestConnection::SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aMessage, aProperties) ;
+	return retval;
+}
+TInt CTestConnection::SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aMessage, aProperties, aResponseTo) ;
+	return retval;
+}
+TInt CTestConnection::SendL(MSenMessage& aMessage) 
+{
+	TInt retval(0);
+//	retval = iConn->SendL(aMessage) ;
+	return retval;
+}
+TInt CTestConnection::SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) 
+{
+	TInt retval(0);
+//	retval = iConn->SubmitL(aMessage, aResponseTo) ;
+	return retval;
+}
+MSenMessage* CTestConnection::Response() 
+{
+	TInt retval(0);
+//	TRAP(retval, iConn->Response());
+	return NULL;
+}
+TInt CTestConnection::CancelTransaction(TInt aTransactionID) 
+{
+	TInt retval(0);
+//	retval = iConn->CancelTransaction(aTransactionID) ;
+	return retval;
+}
+TInt CTestConnection::IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) 
+{
+	TInt retval(0);
+//	retval = iConn->IdentityProviderL(apIdentityProvider);
+	return retval;
+}
+TInt CTestConnection::Identifier() 
+{
+	TInt retval(0);
+//	retval = iConn->Identifier() ;
+	return retval;
+}
+
+void CTestConnection::RegisterFilesObserverL(MSenFilesObserver& aFilesObserver) 
+{}
+
+
+//MSenFragment
+
+CSenElement& CTestConnection::AsElement() 
+{
+	
+}
+CSenElement* CTestConnection::ExtractElement() 
+{
+	
+}
+void CTestConnection::SetReader(CSenXmlReader& aReader) 
+{
+	
+}
+CSenXmlReader* CTestConnection::Reader() 
+{
+	
+}
+void CTestConnection::ParseL(const TDesC8& aBuf) 
+{
+	
+}
+TInt CTestConnection::BuildFrom(const TDesC8& aBuf) 
+{
+	
+}
+void CTestConnection::DelegateParsingL(MSenFragment& aDelegate) 
+{
+	
+}
+void CTestConnection::DelegateParsingL(  const TDesC8& aNsUri,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName,
+                        const RAttributeArray& aAttrs) 
+{
+	
+}
+
+void CTestConnection::ParseWithL(CSenXmlReader& aReader) 
+{
+	
+}
+void CTestConnection::SetOwner(MSenFragment& aFragment) 
+{
+	
+}
+void CTestConnection::ResumeParsingFromL(const TDesC8& aNsUri,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName) 
+{
+	
+}
+
+void CTestConnection::SetAttributesL(const RAttributeArray& aAttrs) 
+{
+	
+}
+void CTestConnection::WriteStartElementL(const TDesC8& aNsUri,
+                        const TDesC8& aLocalName,
+                        const TDesC8& aQName,
+                        const RAttributeArray& aAttrs) 
+{
+	
+}
+
+void CTestConnection::WriteEndElementL(const TDesC8& aNsUri,
+                      const TDesC8& aLocalName,
+                      const TDesC8& aQName) 
+{
+	
+}
+
+const TDesC8& CTestConnection::LocalName()  const
+{
+	
+}
+
+const TDesC8& CTestConnection::NsUri()  const
+{
+	
+}
+
+const TDesC8& CTestConnection::NsPrefix()  const
+{
+	
+}
+
+void CTestConnection::WriteAsXMLToL(RWriteStream& aWriteStream) 
+{
+	
+}
+
+HBufC* CTestConnection::AsXmlUnicodeL() 
+{
+	
+}
+HBufC8* CTestConnection::AsXmlL() 
+{
+	
+}
+
+TBool CTestConnection::ConsistsOfL(MSenFragment& aCandidate) 
+{
+	
+}
+
+//CACTIVE
+
+
+void CTestConnection::DoCancel() 
+{
+	
+}
+
+void CTestConnection::RunL() 
+{
+	
+}
+
+//Msenserviceconsumer
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/senserviceconnection.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,407 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenHostletConnection class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "SenServiceConnectionBCTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::CSenServiceConnectionBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenServiceConnectionBCTest::CSenServiceConnectionBCTest()
+    {
+    iUseALR = EFalse;
+    iCoBrandingCallbackOption = EFalse;
+    iHostletConsumerOption = EFalse;
+    iGetDataTrafficDetails = EFalse;
+    isMigratedToPrefferedCarrier = EFalse;
+    isNewCarrierAccepted = EFalse;
+    iAlrCallBackRetryCount = 0;
+    iSOAPMessage = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::ConstructL()
+    {
+    
+    
+    iLog = CStifLogger::NewL( KSenServiceConnectionLogPath, 
+                          KSenServiceConnectionLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "CSenServiceConnectionBCTest logging starts!" );
+    iLog->Log( KLogStart );
+    
+    iActiveScheduler = new CActiveScheduler;
+	CActiveScheduler::Install( iActiveScheduler );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenServiceConnectionBCTest* CSenServiceConnectionBCTest::NewL()
+    {
+    CSenServiceConnectionBCTest* self = new (ELeave) CSenServiceConnectionBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenServiceConnectionBCTest::~CSenServiceConnectionBCTest()
+    {
+    if(iServiceConnection!=NULL)
+        {
+        delete iServiceConnection;
+        iServiceConnection = NULL;
+        }
+
+    if(iSOAPMessage!=NULL)
+        {
+        delete iSOAPMessage;
+        iSOAPMessage = NULL;
+        }
+		        
+    delete iLog;
+    if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close();
+    delete iActiveScheduler;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceConnectionBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceConnectionBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceConnectionBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenServiceConnectionBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenServiceConnectionBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceConnectionBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenServiceConnectionBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/senserviceconnectioncases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,7084 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// INCLUDE FILES
+#include "SenServiceConnectionBCTest.h"
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+
+//  EXTERNAL INCLUDES
+#include <http.h>
+#include <httperr.h>
+
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenDomFragment.h>
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenSoapEnvelope2.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenXmlUtils.h>
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenHttpTransportProperties.h>
+#include <SenSoapMessage.h>
+#include <SenSoapMessage2.h>
+#include <SenDateUtils.h>
+#include <SenTransportProperties.h>
+
+//#include <SenVtcpTransportProperties.h>
+#include "testproperty.h"
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+//#include <XmlEngSerializer.h>
+
+#include <e32base.h> // for CActive
+#include <aknnotewrappers.h> 
+
+#include <commdb.h>
+
+#include <s32file.h>    // filestream
+#include <e32svr.h>     // fileman
+#include "TestConnection.h"
+#include "testprovider.h"
+#include "testfileobserver.h"
+#include "testconsumer.h"
+//  INTERNAL INCLUDES
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+#define STIFF_ASSERT_DESC(expression, desc)	{if(!(expression)){RDebug::Print(_L(desc)) ;return KErrArgument;}}
+#define STIFF_ASSERT_NOT_EQUALS_DESC(expression1, expression2, desc) \
+	{TL((expression1) != (expression2)){RDebug::Print(_L(desc)) ;}}
+
+
+// CONSTANTS
+namespace 
+    {
+        
+#ifdef AOL_RADIO_SERVICE
+    // AOL redio.etenee.net:9080
+    _LIT8(KWSPContract,         "urn:aol-com:services:radio");
+    _LIT8(KAuthServEndpoint,    "http://radio.etenee.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://radio.etenee.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#elif VALIMO_ADDRESSBOOK_SERVICE
+    // Addressbook service hosted inside Nokia intra by ASP / testing team
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://10.21.32.110/tfs/IDPSSO_IDWSF10");
+    _LIT8(KASProviderID,        "provider01");
+    _LIT8(KTestAuthzID,         "john");
+    _LIT8(KTestPassword,        "password");
+#elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://ys01liw022.partner.yomi.com:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#else // == default (no MACROs defined in .mmp)
+    // Addressbook service hosted by Forum Nokia (accessible from external network)
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09"); 
+    _LIT8(KAuthServEndpoint,    "http://selma.ndhub.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://selma.ndhub.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "testuser1");
+    _LIT8(KTestPassword,        "testuser1");
+#endif // FN_ADDRESSBOOK_SERVICE
+
+
+    _LIT8(KASContract,              "urn:liberty:as:2004-04");
+    _LIT8(KHttpsEndPoint,           "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" );    
+    
+    _LIT8(KWSIFrameworkID,          "WS-I");
+    _LIT8(KIDWSFFrameworkID,        "ID-WSF");
+    _LIT8(KRESTFrameworkID,         "REST");       
+//    _LIT8(KWsStarFrameworkID,       "WS-STAR");       
+#ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KAddressBookServiceId,    "http://radio.aol.com/xsd/2.0/ns/");
+    _LIT8(KAddressBookContract,     "http://radio.aol.com/xsd/2.0/ns/");
+#else
+   	_LIT8(KAddressBookServiceId,    "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KIPCServiceEndPoint,    "http://125.16.213.244//sereneHardCoded//WS_IPCImpr_001");
+    _LIT8(KMtomEndPoint,    "http://10.21.32.20:8080//mtom//servlet//MtomRequest");
+    
+    _LIT8(KAddressBookContract,     "urn:nokia:test:addrbook:2004-09");
+#endif
+    
+#ifdef __WINS__    
+  #ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+  #else
+    //_LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+    _LIT(KIAPName,                  "Ethernet with Daemon Dynamic IP");
+  #endif
+#else
+// ARMv5
+    _LIT(KIAPName,                  "Internet");
+#endif  
+    _LIT8(KLoggerFileNameProperty,  "HttpLoggerFileName");
+
+    _LIT(KFileToRead,               "c:\\Logs\\LoggingHttpFilter\\httptrace.xml");
+    _LIT8(KFileName,                "httptrace.xml");
+
+    _LIT8(KHTTPMethodGet,           "GET");
+    _LIT8(KHTTPMethodPost,          "POST");
+    
+//    const TBool MultipleSimultanousRHttpSessionsSupported = EFalse;
+    // If IAP changes all previously sent messages will be canceled.
+    
+    
+    //_LIT8(KProxyHost,             "esprx00.nokia.com"); 
+    _LIT8(KProxyHost,               "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com
+    const TInt KProxyPort =         8080;
+
+    //MSN Constants :
+    //---------------
+    _LIT8(KPassportUser,        "m_minkkis@hotmail.com");
+    _LIT8(KPassportPass,        "M1nkk1s");
+
+    _LIT8(KStsEndpoint,         "https://login.live.com/rst2.srf");
+    _LIT8(KMSNProxy,            "tcp.mws.mobile.live.com");
+    //_LIT8(KMetadataEndpoint,    "http://10.132.11.31/WSStar/secpolicy/secpol.xml");
+    _LIT8(KMetadataEndpoint, "https://http.mws.mobile.live.com/2006/10/MWP2007_02/SecurityPolicy/Default.aspx");   
+
+    _LIT8(KPolicyAdr,           "Addressing");
+    _LIT8(KPolicyMT,            "MetadataEndpoint");
+    _LIT8(KPolicyTLS,           "UsernameTokenOverTLS");
+    _LIT8(KPolicySOAP12,        "SOAP12");
+    _LIT8(KPolicyPassExt,       "PassportExtensions");
+    _LIT8(KProviderId,          "provider01");
+
+#ifdef OLD_MSN_NAMESPACE_2005_08
+    _LIT8(KMessagingEndpoint,   "tcp://schemas.live.com/mws/2005/08/messaging");
+    _LIT8(KMessagingContract,   "http://schemas.live.com/mws/2005/08/messaging");
+    _LIT8(KMessagingNameSpace,  "http://schemas.live.com/mws/2005/08/core");
+#else
+    _LIT8(KMessagingEndpoint,   "tcp://schemas.live.com/mws/2006/10/messaging");
+    _LIT8(KMessagingContract,   "http://schemas.live.com/mws/2006/10/messaging");
+    _LIT8(KMessagingNameSpace,  "http://schemas.live.com/mws/2006/10/core");
+#endif
+    }
+    
+// CONSTRUCTION
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceConnectionBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenServiceConnectionBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServiceManager_stif.cpp file and to SenServiceManager_stif.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServiceManagerBCTest::PrintTest. Otherwise the compiler
+        // gives errors.
+//  TEST TABLE
+
+		//ENTRY("RegisterIdentityProviderL CSenServiceConnection RegisterIdentityProviderL", CSenServiceConnectionBCTest::UT_CSenServiceConnection_RegisterIdentityProviderLL),
+
+		
+		//ENTRY("SendL, Pattern, IAP1 Test  CSenServiceConnection SendL, Pattern, IAP1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP1L),
+
+		//ENTRY("SendL, Pattern, IAP2 Test  CSenServiceConnection SendL, Pattern, IAP2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP2L),
+
+		//ENTRY("SendL, Pattern, IAP3 Test  CSenServiceConnection SendL, Pattern, IAP3 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP3L),
+
+		ENTRY( "NewL - contract test  CSenServiceConnection NewL contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL),
+		ENTRY("NewLC - contract test  CSenServiceConnection NewLC contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL),
+
+		ENTRY("NewL - description test for WS-I  CSenServiceConnection NewL description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL),
+
+		ENTRY("NewLC - description test for WS-I CSenServiceConnection NewLC description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL),
+
+		ENTRY("NewL - description test for ID-WSF CSenServiceConnection NewL description for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL),
+
+		ENTRY("NewLC - description test for ID-WSF CSenServiceConnection NewLC description for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL),
+
+		ENTRY("NewL - pattern test for WS-I  CSenServiceConnection NewL pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL),
+
+		ENTRY("NewLC - pattern test for WS-I CSenServiceConnection NewLC pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL),
+
+		ENTRY("NewL - pattern test for ID-WSF CSenServiceConnection NewL pattern for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_PatternL),
+
+		ENTRY("NewLC - pattern test for ID-WSF CSenServiceConnection NewLC pattern for ID-WSF",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL),
+		
+		ENTRY( "NewL1 - contract test  CSenServiceConnection NewL contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL1),
+
+		ENTRY("NewLC1 - contract test  CSenServiceConnection NewLC contract",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL1),
+
+		ENTRY("NewL1 - description test for WS-I  CSenServiceConnection NewL description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL1),
+
+		ENTRY("NewLC1 - description test for WS-I CSenServiceConnection NewLC description for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL1),
+
+
+		ENTRY("NewL1 - pattern test for WS-I  CSenServiceConnection NewL pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL1),
+
+		ENTRY("NewLC1 - pattern test for WS-I CSenServiceConnection NewLC pattern for WS-I",CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL1),
+
+/*
+		ENTRY("SendL - no error test  CSenServiceConnection SendL no error",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_NoErrorL),
+		ENTRY("SendL - cancel test  CSenServiceConnection SendL no error",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CancelL),
+
+		ENTRY("SendL - connection is not initialized test  CSenServiceConnection SendL connection is not initialized",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ConNotInitialL),
+
+		ENTRY("SendL - Multiple Messages  CSenServiceConnection SendL Multiple Messages",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendMultipleMessagesL),
+		ENTRY("SendL, Get,Post 1 Test  CSenServiceConnection SendL, Get,Post 1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post1L),
+
+		ENTRY("SendL, Get,Post 2 Test  CSenServiceConnection SendL, Get,Post 2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post2L),
+
+		ENTRY("SendL, Post, Proxy 1 Test  CSenServiceConnection SendL, Post, Proxy 1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy1L),
+
+		ENTRY("SendL, Post, Proxy 2 Test  CSenServiceConnection SendL connection is not initialized",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy2L),
+
+		ENTRY("SendL, ContentType1 Test  CSenServiceConnection SendL, ContentType1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType1L),
+
+		ENTRY("SendL, ContentType2 Test  CSenServiceConnection SendL, ContentType2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType2L),
+		ENTRY("SendL, UserAgent1 Test  CSenServiceConnection SendL, UserAgent1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent1L),
+
+		ENTRY("SendL, UserAgent2 Test  CSenServiceConnection SendL, UserAgent2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent2L),
+		ENTRY("SendL, Message SoapAction Test  CSenServiceConnection SendL, Message SoapAction Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_MessageSoapActionL),
+		ENTRY("SendL, SoapAction1 Test  CSenServiceConnection SendL, SoapAction1 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction1L),
+
+		ENTRY("SendL, SoapAction2 Test  CSenServiceConnection SendL, SoapAction2 Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction2L),
+		ENTRY("SendL, CustomHttpHeader Test  CSenServiceConnection SendL, CustomHttpHeader Test",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CustomHttpHeaderL),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection SendL, TP boundaries Test", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries1),
+
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries2),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries3),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries4),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries5),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries6),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries7),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries8),
+		ENTRY("SendL, TP boundaries Test  CSenServiceConnection", CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries9),
+		ENTRY("SendL, TP SecDialog Test  CSenServiceConnection SendL connection is not initialized",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_SecDialog),  
+		ENTRY("SendL, TP Omitted True Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_True),  
+		ENTRY("SendL, TP Omitted False Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_False),  
+		ENTRY("SendL, TP Removed Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Removed),  
+		ENTRY("SendL, TP Omit/Rem Test  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omit_Rem),  
+		ENTRY("SubmitL, LibXml2  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_L),  
+		ENTRY("SubmitL, LibXml2 + props  CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L),  
+		ENTRY("SubmitL, BLOB 20KB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL), 
+		ENTRY("SubmitL, BLOB 200KB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL), 
+		ENTRY("SubmitL, BLOB less1MB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL),
+		ENTRY("SubmitL, BLOB more1MB CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL),
+		ENTRY("MSN - Basic case CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessengerL), 
+		ENTRY("MSN - ReUse Credential CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger2L), 
+		ENTRY("MSN - AuthCallback success CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger3L), 
+		ENTRY("MSN - AuthCallback fail CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger4L), 
+		ENTRY("MSN - UserInfoPrompt CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger5L), 
+		ENTRY("MSN - show prompt CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger6L), 
+		ENTRY("MSN - Invalid password CSenServiceConnection",CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger7L),
+    */
+    	ENTRY("SendL- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SendL),
+		ENTRY("Send2L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send2L),
+		ENTRY("Send3L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send3L),
+		ENTRY("Send4L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send4L),
+		ENTRY("Send5L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Send5L),
+		ENTRY("SubmitL- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SubmitL),
+		ENTRY("Submit2L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit2L),
+		ENTRY("Submit3L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit3L),
+		ENTRY("Submit4L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit4L),
+		ENTRY("Submit5L- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Submit5L),
+		ENTRY("IsReady- CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IsReady),
+		ENTRY("HasFacetL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HasFacetL),
+		ENTRY("CompleteServerMessagesOnOff-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::CompleteServerMessagesOnOff),
+		ENTRY("ServiceDescriptionL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ServiceDescriptionL),
+		ENTRY("StartTransaction-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::StartTransaction),
+		ENTRY("TransactionCompleted-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TransactionCompleted),
+		ENTRY("TxnId-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TxnId),
+		ENTRY("SetTransportPropertiesL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SetTransportPropertiesL),
+		ENTRY("TransportPropertiesL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TransportPropertiesL),
+		ENTRY("Response-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Response),
+		ENTRY("CancelTransaction-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::CancelTransaction),
+		ENTRY("IdentityProviderL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IdentityProvider1L),
+		ENTRY("Identifier-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Identifier),
+		ENTRY("Name-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Name),
+		ENTRY("Type-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Type),
+		ENTRY("Value-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Value),
+		ENTRY("IntValue-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IntValue),
+		ENTRY("BoolValue-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::BoolValue),
+		ENTRY("ValueTokensL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ValueTokensL),
+		ENTRY("IdentityProviderL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::IdentityProvider2L),
+		ENTRY("UsernameL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Username1L),
+		ENTRY("PasswordL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::Password1L),
+		ENTRY("ExtendedInterface-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ExtendedInterface1L),
+		ENTRY("TransferProgress-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::TransferProgress),
+		ENTRY("HandleMeassage-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HandleMeassage),
+		ENTRY("HandleErrorL-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HandleErrorL),
+		ENTRY("SetStatus-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::SetStatus),
+		 // ENTRY("SendL - RfileHandle - Test for sending 4.4M jpg file to the server ",CSenServiceConnectionBCTest::UT_CSenServiceConnectionSnapIdL),
+		ENTRY("SendL - RfileHandle - IPCImpBigRequest ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL_IPCBigrequest),
+		ENTRY("SendL - RfileHandle - Simple Request ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL),
+		ENTRY("SubmitL - RfileHandle - Simple Request ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL),
+		//ENTRY("SubmitL - RfileHandle -IPCImpBigRequest ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_IPCBigrequest),
+	//	ENTRY("SubmitL - RfileHandle -MTOM ",CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_MTOM),
+    #ifdef __ENABLE_ALR__
+		ENTRY("ALR-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::ALRL),
+    #endif //__ENABLE_ALR__
+		ENTRY("CoBrand-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::CoBrandL),
+		ENTRY("HostletConsumer-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::HostletConsumerL),
+		ENTRY("DataTrafficDetails-CSenServiceConnectionBCTest",CSenServiceConnectionBCTest::DataTrafficDetailsL),
+ 	};
+
+	    // Verify that case number is valid
+	    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+	                               sizeof( TCaseInfoInternal ) )
+	        {
+	        // Invalid case, construct empty object
+	        TCaseInfo null( (const TText*) L"" );
+	        null.iMethod = NULL;
+	        null.iIsOOMTest = EFalse;
+	        null.iFirstMemoryAllocation = 0;
+	        null.iLastMemoryAllocation = 0;
+	        return null;
+	        } 
+
+	    // Construct TCaseInfo object and return it
+	    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+	    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+	    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+	    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+	    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+	    return tmp;
+
+	    }   
+
+//  METHODS
+/*
+CSenVtcpTransportProperties* CSenServiceConnectionBCTest::CreateMSTransportPropertiesL(TMSCommands aCommand)
+    {
+#ifdef OLD_MSN_NAMESPACE_2005_08
+    _LIT8(KRegisterAct, "http://schemas.live.com/mws/2005/08/messaging/Register");
+    _LIT8(KInviteReqAct,"http://schemas.live.com/mws/2005/08/messaging/Invite");
+    _LIT8(KSendReqAct,"http://schemas.live.com/mws/2005/08/messaging/Message");
+#else
+    _LIT8(KRegisterAct, "http://schemas.live.com/mws/2006/10/messaging/Register");    
+    _LIT8(KInviteReqAct,"http://schemas.live.com/mws/2006/10/messaging/Invite");
+    _LIT8(KSendReqAct,"http://schemas.live.com/mws/2006/10/messaging/Message");          
+    
+#endif
+
+    CSenVtcpTransportProperties* pVtcpProperties = CSenVtcpTransportProperties::NewLC();
+    pVtcpProperties->SetProxyHostL(KMSNProxy);
+    //pVtcpProperties->SetOnewayMessageOnOffL(TRUE);
+    
+    pVtcpProperties->SetMwsNamespaceL(KMessagingNameSpace);
+        
+    switch (aCommand)
+        {
+        case EMSNMessengerRegister:
+            {    
+            pVtcpProperties->SetSoapActionL(KRegisterAct);
+            break;
+            }
+        case EMSNMessengerUnRegister:
+            {    
+            pVtcpProperties->SetSoapActionL(KRegisterAct);
+            break;
+            }
+        case EMSNMessengerInvite:
+            {    
+            pVtcpProperties->SetSoapActionL(KInviteReqAct);
+            break;
+            }
+        case EMSNMessengerSend:
+            {    
+            pVtcpProperties->SetSoapActionL(KSendReqAct);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    CleanupStack::Pop(pVtcpProperties);
+    
+    return pVtcpProperties;
+    }
+  */  
+CSenSoapMessage2* CSenServiceConnectionBCTest::CreateMSSoapMessage(TMSCommands aCommand)
+    {
+#ifdef OLD_MSN_NAMESPACE_2005_08    
+    _LIT8(KReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+    <sip:Expires>240</sip:Expires>\
+    <sip:AutoOffline>0</sip:AutoOffline>\
+    <sip:Capabilities>1074003969</sip:Capabilities>\
+    <sip:SubscribedNotifications>31</sip:SubscribedNotifications>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KUnReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+    <sip:Expires>0</sip:Expires>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KInviteReq,
+        "<sip:InviteRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+            <sip:Call>\
+                <mc:To xmlns:mc=\"http://schemas.live.com/mws/2005/08/contacts\">7553</mc:To>\
+            </sip:Call>\
+        </sip:InviteRequest>");
+    
+    _LIT8(KSendReq,          
+    "<sip:MessageRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+            <sip:Call>\
+                <sip:CallID>1</sip:CallID>\
+            </sip:Call>\
+            <sip:MessageObject sip:ContentType=\"text/plain\">\
+                <sip:MessageBody>lalamido</sip:MessageBody>\
+            </sip:MessageObject>\
+        </sip:MessageRequest>");
+#else
+    _LIT8(KReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+    <sip:Expires>240</sip:Expires>\
+    <sip:AutoOffline>0</sip:AutoOffline>\
+    <sip:Capabilities>1074003969</sip:Capabilities>\
+    <sip:SubscribedNotifications>31</sip:SubscribedNotifications>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+     
+    _LIT8(KUnReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+    <sip:Expires>0</sip:Expires>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KInviteReq,  
+        "<sip:InviteRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+            <sip:Call>\
+                <mc:To xmlns:mc=\"http://schemas.live.com/mws/2006/10/contacts\">4878</mc:To>\
+            </sip:Call>\
+        </sip:InviteRequest>");
+    
+    _LIT8(KSendReq,          
+    "<sip:MessageRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+            <sip:Call>\
+                <sip:CallID>1</sip:CallID>\
+            </sip:Call>\
+            <sip:MessageObject sip:ContentType=\"text/plain\">\
+                <sip:MessageBody>lalamido</sip:MessageBody>\
+            </sip:MessageObject>\
+        </sip:MessageRequest>");
+#endif    
+
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewLC(ESOAP12);
+
+    AddDeviceOptionsHeader2L(*pMessage);
+    
+    AddApplicationHeader2L(*pMessage);
+    
+    switch (aCommand)
+        {
+        case EMSNMessengerRegister:
+            {    
+            pMessage->SetBodyL(KReristerReq);
+            break;
+            }
+        case EMSNMessengerUnRegister:
+            {    
+            pMessage->SetBodyL(KUnReristerReq);
+            break;
+            }
+        case EMSNMessengerInvite:
+            {    
+            pMessage->SetBodyL(KInviteReq);
+            break;
+            }
+        case EMSNMessengerSend:
+            {    
+            pMessage->SetBodyL(KSendReq);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    CleanupStack::Pop(pMessage);
+        
+    return pMessage;
+    }
+
+TInt CSenServiceConnectionBCTest::RegisterSTSL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);                                           
+    manager->RegisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+
+TInt CSenServiceConnectionBCTest::RegisterSTSInvalidPasswordL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, _L8("Invalid"));                                           
+    manager->RegisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+
+TInt CSenServiceConnectionBCTest::UnregisterSTSL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //Unregister Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);                                           
+    manager->UnregisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //Unregister SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->UnregisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+    
+TInt CSenServiceConnectionBCTest::SetPolicyL( CSenXmlServiceDescription* pServDesc,
+                                           const TDesC8& pName,
+                                           const TDesC8& pValue)
+    {
+    CSenElement* servicePolicy = pServDesc->AsElement().Element(_L8("ServicePolicy")); 
+    CSenElement* clientPolicy = servicePolicy->Element(_L8("ClientPolicy"));     
+    if(!clientPolicy)
+        servicePolicy->AddElementL(_L8("ClientPolicy"));
+    clientPolicy = servicePolicy->Element(_L8("ClientPolicy"));
+
+    if(pValue==KNullDesC8())
+        {
+        clientPolicy->AddElementL(pName);
+        }
+        else
+        {
+        clientPolicy->AddElementL(pName).SetContentL(pValue);
+        }
+    }
+    
+TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceL()
+    {
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    CSenXmlServiceDescription* pServiceDesc = CSenXmlServiceDescription::NewLC(KMessagingEndpoint, KMessagingContract);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pServiceDesc->SetIapIdL(iapId);
+    
+    pServiceDesc->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pServiceDesc->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pServiceDesc, KPolicySOAP12, KNullDesC8);
+    SetPolicyL(pServiceDesc, KPolicyAdr,    KAddressing);
+    
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc, *this);
+    CleanupStack::PopAndDestroy(pServiceDesc);
+    }
+
+TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceWithoutCallbackL()
+    {
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    CSenXmlServiceDescription* pServiceDesc = CSenXmlServiceDescription::NewLC(KMessagingEndpoint, KMessagingContract);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pServiceDesc->SetIapIdL(iapId);
+
+
+    pServiceDesc->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pServiceDesc->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pServiceDesc, KPolicySOAP12, KNullDesC8);
+    SetPolicyL(pServiceDesc, KPolicyAdr,    KAddressing);
+    
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc);
+    CleanupStack::PopAndDestroy(pServiceDesc);
+    }
+
+TInt CSenServiceConnectionBCTest::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage)
+    {
+    TXmlEngElement header = aMessage.HeaderL();
+
+    TXmlEngElement deviceOp = header.AddNewElementL(_L8("DeviceOptions"),
+                                                    KMessagingNameSpace,
+                                                    _L8("mws"));
+
+    TXmlEngElement child = deviceOp.AddNewElementSameNsL(_L8("Locale"));
+    child.AddTextL(_L8("1033"));
+
+    TXmlEngElement child1 = deviceOp.AddNewElementSameNsL(_L8("UserAgent"));
+
+    TXmlEngElement child1_1 = child1.AddNewElementSameNsL(_L8("Manufacturer"));
+    child1_1.AddTextL(_L8("NO_UserAgent"));
+
+    TXmlEngElement child1_2 = child1.AddNewElementSameNsL(_L8("Model"));
+    child1_2.AddTextL(_L8("NO_Model"));
+
+    TXmlEngElement child1_3 = child1.AddNewElementSameNsL(_L8("OS"));
+
+    TXmlEngElement child1_3_1 = child1_3.AddNewElementSameNsL(_L8("Name"));
+    child1_3_1.AddTextL(_L8("NO_OS"));
+
+    TXmlEngElement child1_3_2 = child1_3.AddNewElementSameNsL(_L8("Version"));
+    child1_3_2.AddTextL(_L8("NO_Version"));
+    }
+
+TInt CSenServiceConnectionBCTest::AddApplicationHeader2L(CSenSoapMessage2& aMessage)
+    {
+    TXmlEngElement header = aMessage.HeaderL();
+
+    TXmlEngElement application = header.AddNewElementL(_L8("Application"),KMessagingNameSpace,_L8("mws"));
+
+    TXmlEngElement child = application.AddNewElementSameNsL(_L8("Name"));
+    child.AddTextL(_L8("NO_CLIENT"));
+
+    TXmlEngElement child1 = application.AddNewElementSameNsL(_L8("Vendor"));
+    child1.AddTextL(_L8("NO_VENDOR"));
+
+    TXmlEngElement child2 = application.AddNewElementSameNsL(_L8("Version"));
+    child2.AddTextL(_L8("NO_VERSION"));
+    }
+    
+TInt CSenServiceConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+TInt CSenServiceConnectionBCTest::StopActiveScheduler()
+    {
+  	iNumberOfPendingOps--;
+  	if ( iNumberOfPendingOps == 0 )
+      {
+      CActiveScheduler::Stop();
+      }	
+    }
+
+const CSenIdentityProvider* CSenServiceConnectionBCTest::IdentityProviderL() const
+    {
+    ((CSenServiceConnectionBCTest*)this)->iAuthInfoAskCounter++;
+    return ipProviderForAuthProvider;
+    }
+    
+void CSenServiceConnectionBCTest::HandleMessageL(const TDesC8& aMessage)
+    {
+    iLog->Log(_L("BCTest::HandleMessageL->> start"));  
+    iCallback = ECallbackHandleMessage;
+    
+    if ( ipMessage )
+    {
+    delete ipMessage;
+    ipMessage = NULL;
+    }
+    ipMessage = aMessage.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+    //Alr retry logic
+    if( iUseALR && (!isNewCarrierAccepted || !isMigratedToPrefferedCarrier) && iAlrCallBackRetryCount < 5 )
+        { 
+        TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+        iAlrCallBackRetryCount++;
+        iLog->Log(_L("BCTest::HandleMessageL->>Alr Retry SendL is called"));
+        return;
+        }
+    else if( (iUseALR && isNewCarrierAccepted && isMigratedToPrefferedCarrier) || iAlrCallBackRetryCount >= 5 )
+        {
+        iAlrCallBackRetryCount = 0;
+        iUseALR = EFalse;
+        iLog->Log(_L("BCTest::HandleMessageL->>Alr retry Done "));  
+        }
+    // Cobranding callback
+    if (iCoBrandingCallbackOption)
+        {
+        iCoBrandingCallbackOption=EFalse;
+        iLog->Log(_L("BCTest::HandleMessageL->>CoBrandingCallbackOption "));  
+        }
+    if(iGetDataTrafficDetails)
+        {
+        TSenDataTrafficDetails details;
+        TSenDataTrafficOperations operations;
+        iServiceConnection->DataTrafficDetails(details,operations);
+        TInt BytesSent = details.iTotalBytesSent;
+        TInt BytesRecieved = details.iTotalBytesRecieved;
+        }
+    
+    StopActiveScheduler();
+    iLog->Log(_L("BCTest::HandleMessageL->>End"));  
+    }
+
+void CSenServiceConnectionBCTest::HandleErrorL(const int aErrorCode, const TDesC8& aError)
+    {
+    iLog->Log(_L("BCTest::HandleErrorL->> start"));  
+    iCallback = ECallbackHandleError;
+    iErrorCode = aErrorCode;
+    
+    // debugging only - START
+    if( HTTPStatus::IsInformational( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EContinue) && (aStatus < HTTPStatus::EOk))
+        RDebug::Print(_L("- HTTP error code: IS INFORMATION."));
+        }
+    if( HTTPStatus::IsSuccessful( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EOk) && (aStatus < HTTPStatus::EMultipleChoices))
+        RDebug::Print(_L("- HTTP error code: IS SUCCESSFUL."));
+        }
+    if( HTTPStatus::IsRedirection( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EMultipleChoices) && (aStatus < HTTPStatus::EBadRequest))
+        RDebug::Print(_L("- HTTP error code: IS REDIRECTION."));
+        }
+    if( HTTPStatus::IsClientError( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EBadRequest) && (aStatus < HTTPStatus::EInternalServerError))
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }
+    if( HTTPStatus::IsServerError( this->iErrorCode ) )
+        {
+        // if(aStatus >= HTTPStatus::EInternalServerError)
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }    
+    // debuggin only - END
+    
+    if ( ipMessage )
+        {
+        delete ipMessage;
+        ipMessage = NULL;
+        }
+    ipMessage = aError.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+    
+    TBuf<70> errorMessage;
+    _LIT(KErrNotInitialized, "Connection isn't initialized.");
+    
+    switch(aErrorCode) 
+        {
+        case KErrSubmitting:
+            errorMessage = KErrNotInitialized;
+            break;
+        default:
+            break;
+        }
+    iUseALR = EFalse;
+    StopActiveScheduler();
+    
+    iLog->Log(_L("BCTest::HandleErrorL->>End"));  
+    }
+
+void CSenServiceConnectionBCTest::ErrorL(TInt aCode)
+    {
+    _LIT(KNotReady, "Connection is not ready.");
+    
+    TBuf<70> errorMessage;
+    switch(aCode) 
+        {
+        case EConnectionNotReady:
+            errorMessage = KNotReady;
+            break;
+        default:
+            break;
+        }
+    }
+
+void CSenServiceConnectionBCTest::SetStatus(const TInt aStatus)
+    {
+    iLog->Log(_L("BCTest::SetStatus-->start"));  
+    switch(aStatus)
+        {
+        case KSenConnectionStatusNew:
+        break;
+        case KSenConnectionStatusReady:
+            iInitialized = ETrue;
+            iLog->Log(_L("BCTest::SetStatus-->SenConnectionStatusReady"));  
+        break;
+        case KSenConnectionStatusExpired:
+        break;
+        default:
+        TBuf<32> num;
+        num.AppendNum(aStatus);
+        break;
+        }
+    if ( aStatus >= KSenConnectionStatusCreateFailed && aStatus <= KSenConnectionStatusMetadataExchange )
+        {
+        iConnectionState = aStatus;
+        if(!iInitialized)
+            {
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, ErrorL(EConnectionNotReady));
+            leaveCode = 0; // not used
+            }
+        StopActiveScheduler();
+        iLog->Log(_L("BCTest::SetStatus-->StopActiveScheduler()"));  
+        }
+    iLog->Log(_L("BCTest::SetStatus-->End"));  
+    }
+
+TInt CSenServiceConnectionBCTest::Find(const TDesC8& aDestination,
+                                    const TDesC8& aDescToFind,
+                                    TInt aStartingPos )
+    {
+    TInt descLength = aDescToFind.Length();
+    TInt length = aDestination.Length() - descLength + 1;
+    for (TInt i = aStartingPos; i < length ; i++)
+        {
+        if (  aDestination.Mid(i,descLength) == aDescToFind )
+            {
+            return i;
+            }
+        }
+        
+    return KErrNotFound;
+	}
+
+    
+TBool CSenServiceConnectionBCTest::ReplaceAll(TPtr8 aDestination,
+                                           const TDesC8& aFrom,
+                                           const TDesC8& aTo)
+    {
+    TInt retVal(EFalse);
+    
+    TInt pos = Find(aDestination, aFrom, 0);
+    if (pos != KErrNotFound) retVal = ETrue;
+    
+    while (pos != KErrNotFound)
+        {
+        aDestination.Replace(pos,aFrom.Length(),aTo);
+        pos = Find(aDestination, aFrom, pos+1);
+        }
+
+    return retVal;
+	}
+  
+    
+TBool CSenServiceConnectionBCTest::DecodeHttpCharactersL(const TDesC8& aOriginal,
+                                                      HBufC8*& aDecoded)
+    {
+    // Five basic entities as descriptors
+    _LIT8(KEscapedApos,     "&apos;");
+    _LIT8(KEscapedDblQuot,  "&quot;");
+    _LIT8(KEscapedGt,       "&gt;");
+    _LIT8(KEscapedLt,       "&lt;");
+    _LIT8(KEscapedAmp,      "&amp;");
+    
+    // XML-escaping chars as descriptors
+    _LIT8(KAmpersandDesC8,  "&");
+    _LIT8(KAposDesC8,       "\'");
+    _LIT8(KDblQuotDesC8,    "\"");
+    _LIT8(KGtDesC8,         ">");
+    _LIT8(KLtDesC8,         "<");
+    
+    delete aDecoded;
+    aDecoded = NULL;
+
+    // make a copy of the original
+    aDecoded = aOriginal.AllocL();
+
+    TBool retVal(EFalse);
+
+    // replace all five basic entities with XML escaping counterpart,
+    // if found.
+    if (ReplaceAll(aDecoded->Des(), KEscapedApos(), KAposDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedDblQuot(), KDblQuotDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedGt(), KGtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedLt(), KLtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedAmp(), KAmpersandDesC8()))
+        {
+        retVal = ETrue;
+        }
+
+    return retVal;
+    }
+
+HBufC8* CSenServiceConnectionBCTest::HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                                             const TDesC8& aPropertyName)
+    {
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    HBufC8* pRetBuf = NULL;
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    if ( pRequestElement )
+        {
+        CSenElement* pTPElement = pRequestElement->Element(_L8("TranportProperties"));
+        if ( pTPElement )
+            {
+            CSenElement* pElement = pTPElement->Element(aPropertyName);
+            if ( pElement )
+                {
+                pRetBuf = pElement->Content().AllocL();
+                CleanupStack::PushL(pRetBuf);
+                HBufC8* pNew = NULL;
+                DecodeHttpCharactersL(*pRetBuf, pNew);
+                CleanupStack::PopAndDestroy(pRetBuf);
+                pRetBuf = pNew;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    CleanupStack::PushL(pRetBuf);
+    return pRetBuf;
+    }
+    
+HBufC8* CSenServiceConnectionBCTest::ReadFileL(const TDesC& aFilename)
+    {
+    RFs fsSession;
+    CleanupClosePushL(fsSession);
+    User::LeaveIfError(fsSession.Connect() == NULL);
+    TEntry entry;
+    User::LeaveIfError(fsSession.Entry(aFilename,entry));
+    HBufC8* pFileContent = NULL;
+    RFileReadStream fileInStream;
+    CleanupClosePushL(fileInStream);
+    if (fileInStream.Open(fsSession,aFilename,EFileRead) == KErrNone)
+        {
+        HBufC8* pTempFileContent = HBufC8::NewLC(entry.iSize+10);
+        TRAPD(error,
+            fileInStream.ReadL((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            );
+            
+        if (!error)
+            {
+            TPtrC8 fileContent((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            pFileContent = fileContent.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pTempFileContent);
+        }
+    CleanupStack::PopAndDestroy(&fileInStream);
+    CleanupStack::PopAndDestroy(&fsSession);
+    return pFileContent;
+    }
+    
+TUint32 CSenServiceConnectionBCTest::SearchIAPIdByNameL( const TDesC& aIAPName )
+    {
+    TBool found = EFalse;
+    CCommsDatabase* pDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(pDB);
+    
+    //open internet accesspoint table
+    CCommsDbTableView* pDbTView = pDB->OpenTableLC(TPtrC(IAP));
+    TInt retVal = pDbTView->GotoFirstRecord();
+    TBuf<128> name; 
+    TUint32 id = 0;
+    //Find the correct record
+    while ( retVal == KErrNone && found == EFalse )
+        {
+        pDbTView->ReadTextL(TPtrC(COMMDB_NAME), name);
+        pDbTView->ReadUintL(TPtrC(COMMDB_ID), id);
+        found = ( name == aIAPName ); 
+        if ( !found )
+            {
+            retVal = pDbTView->GotoNextRecord();
+            }
+        }
+    CleanupStack::PopAndDestroy(pDbTView);
+    CleanupStack::PopAndDestroy(pDB);
+    return id;
+    }
+    
+CSenSoapMessage* CSenServiceConnectionBCTest::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+    
+CSenSoapMessage2* CSenServiceConnectionBCTest::CreateNewAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    /*CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    //pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);*/
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+
+void CSenServiceConnectionBCTest::SetupL(  )
+    {
+    __UHEAP_MARK;
+
+    RFile file;
+    RFs iFsSession;
+    _LIT(KFileName,"c:\\testing\\data\\rest.on");
+    
+   
+    User::LeaveIfError(iFsSession.Connect());
+        
+    TInt fileOP = file.Open(iFsSession,KFileName,EFileRead);
+    if (fileOP == KErrNone) 
+        {
+        RDebug::Print( _L( "Found rest.on file => using RESTful framework" ) ); 
+        file.Close();
+        ipFrameworkID = HBufC8::NewL(KRESTFrameworkID().Length());
+        ipFrameworkID->Des().Append(KRESTFrameworkID);
+        }
+    else
+        {
+        RDebug::Print( _L( "File rest.on not found => defaulting to WS-I" ) ); 
+        ipFrameworkID = HBufC8::NewL(KWSIFrameworkID().Length());
+        ipFrameworkID->Des().Append(KWSIFrameworkID);
+        }
+    iFsSession.Close();
+    
+    iCallback = ECallbackNone;
+    }
+
+void CSenServiceConnectionBCTest::Teardown(  )
+    {
+    delete ipFrameworkID;
+    ipFrameworkID = NULL;
+    delete ipMessage;
+    ipMessage = NULL;
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    
+    if(iServiceConnection!=NULL)
+        {
+        delete iServiceConnection;
+        iServiceConnection=NULL;
+        }
+    
+    if(iSOAPMessage!=NULL)
+        {
+        delete iSOAPMessage;
+        iSOAPMessage=NULL;
+        }    
+    
+    __UHEAP_MARKEND;
+    }
+
+/*
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_RegisterIdentityProviderLL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iManager = CSenServiceManager::NewL();
+    STIFF_ASSERT_NOT_EQUALS_DESC(iManager, (CSenServiceManager*)NULL, "The test is failed.");
+
+    CSenIdentityProvider* idp = CSenIdentityProvider::NewLC(
+        KAuthServEndpoint, KASContract);
+
+    // Set the Provider ID
+    idp->SetProviderID(KASProviderID);
+
+    // Associate Forum Nokia's Addressbook service ID (contract)
+    // to this Identity Provider
+    idp->SetServiceID(KWSPContract);
+
+    // Set Liberty ID-WSF framework ID
+    idp->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+
+    // ------------------------------------------------------------------------
+    // The following username/password properties will be used for
+    // authentication. Please note, that use advisory authentication
+    // id "IMEI" would result device ID to be directly fetched from phone.
+    // ------------------------------------------------------------------------
+    //
+    
+#if SYSOPENDIGIA_ADDRESSBOOK_SERVICE    
+    idp->SetUserInfoL(KNullDesC8, KTestAuthzID, KTestPassword);
+#else
+    idp->SetUserInfoL(KTestAuthzID, KNullDesC8, KTestPassword);
+#endif    
+    
+    TL((iManager->RegisterIdentityProviderL(*idp)) == KErrNone);
+    TL((iManager->RegisterServiceDescriptionL(*idp)) == KErrNone);
+
+    CleanupStack::PopAndDestroy(idp); 
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete iManager);
+    iManager = NULL;
+    Teardown();
+    return KErrNone;
+	}
+*/
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookContract);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL( TTestResult& aResult )
+    {
+    
+    SetupL() ;
+    iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookContract);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+    
+    
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pSenServicePattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //pSenServicePattern->SetContractL(KAuthServEndpoint);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pSenServicePattern);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pSenServicePattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSenServicePattern);
+    pSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* aSenServicePattern = CSenServicePattern::NewL(KAuthServEndpoint, KNullDesC8());
+    aSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //aSenServicePattern->SetContractL(KAuthServEndpoint);
+
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *aSenServicePattern);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    delete aSenServicePattern;
+    aSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ID_WSF_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAddressBookServiceId, KNullDesC8());
+    pPattern->SetFrameworkIdL(KIDWSFFrameworkID);    
+    pPattern->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pPattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pPattern);
+    pPattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAddressBookServiceId, KNullDesC8());
+    pPattern->SetFrameworkIdL(KIDWSFFrameworkID);    
+    pPattern->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *pPattern);
+    StartActiveScheduler(1);
+    
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pPattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pPattern);
+    pPattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_ContractL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookContract, provider);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_ContractL1( TTestResult& aResult )
+    {
+    
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookContract, provider);
+    StartActiveScheduler(1);
+    
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+    
+    
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_DescriptionL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewL_WS_I_PatternL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    CSenServicePattern* pSenServicePattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //pSenServicePattern->SetContractL(KAuthServEndpoint);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pSenServicePattern, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pSenServicePattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSenServicePattern);
+    pSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_NewLC_WS_I_PatternL1( TTestResult& aResult )
+    {
+    SetupL() ;
+    MSenExtendedConsumerInterface provider;
+    
+    CSenServicePattern* aSenServicePattern = CSenServicePattern::NewL(KAuthServEndpoint, KNullDesC8());
+    aSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //aSenServicePattern->SetContractL(KAuthServEndpoint);
+
+    CSenServiceConnection* iServiceConnection = CSenServiceConnection::NewLC(*this, *aSenServicePattern, provider);
+    StartActiveScheduler(1);
+    
+    //STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      //"Could not initialize ServiceConnection");
+
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    delete aSenServicePattern;
+    aSenServicePattern = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL_IPCBigrequest( TTestResult& aResult )
+{
+	SetupL() ;
+	 TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenServicePattern::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KIPCServiceEndPoint);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	//iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+		User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+
+	retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead);
+	
+	CleanupClosePushL(iRFileHandle);
+	TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle);
+	//LOCAL_ASSERT(transactionIdOrError2 > KErrNone);
+	if (transactionIdOrError!=KErrArgument)
+	StartActiveScheduler(1);
+	CleanupStack::Pop(&iRFileHandle);
+		if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	iSenXmlServiceDescription = NULL;
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	Teardown();
+	return KErrNone;
+		
+}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_IPCBigrequest( TTestResult& aResult )
+{
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenServicePattern::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KIPCServiceEndPoint);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+		User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+
+	retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead);
+	
+	CleanupClosePushL(iRFileHandle);
+	HBufC8 *pMsgBuf = NULL;// Buffer to get response
+	TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf);
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	if(pMsgBuf)
+		{
+	//	CleanupStack::PopAndDestroy(pMsgBuf);//clean response
+		delete pMsgBuf;
+		pMsgBuf = NULL;
+		}
+	CleanupStack::PopAndDestroy(&iRFileHandle);
+		if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	iSenXmlServiceDescription = NULL;
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	Teardown();
+	return KErrNone;
+		
+}
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL_MTOM( TTestResult& aResult )
+{
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenServicePattern::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KMtomEndPoint);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+		User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+
+	retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\testPic9.jpg"), EFileStream|EFileRead);
+	
+	CleanupClosePushL(iRFileHandle);
+	HBufC8 *pMsgBuf = NULL;// Buffer to get response
+	TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf);
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	if(pMsgBuf)
+		{
+		RFs logSession;
+		RFile Mtomlog;
+		User::LeaveIfError(logSession.Connect());//ani
+
+	//	CleanupStack::PopAndDestroy(pMsgBuf);//clean response
+		TInt err = Mtomlog.Create(iFsSessionHandle, _L("c:\\private\\101FB3E7\\MTOM.txt"), EFileWrite);
+		TInt pos=0 ;
+	    Mtomlog.Seek(ESeekEnd,pos);
+	   // _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	    TBuf8<4096> temp=pMsgBuf->Des();
+		Mtomlog.Write(temp);
+	 	Mtomlog.Close();
+	 	CleanupStack::PopAndDestroy(&Mtomlog);
+		if(logSession.Handle())
+    	logSession.Close(); 
+
+	 	
+		delete pMsgBuf;
+		pMsgBuf = NULL;
+		}
+	CleanupStack::PopAndDestroy(&iRFileHandle);
+		if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	iSenXmlServiceDescription = NULL;
+
+	__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	Teardown();
+	return KErrNone;
+		
+}
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult )
+    {
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	TInt err(KErrNone);
+
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+	User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+	err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead);
+	CleanupClosePushL(iRFileHandle);
+	HBufC8 *pMsgBuf = NULL;
+	TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf);
+	if(pMsgBuf)
+	{
+	//	CleanupStack::PopAndDestroy(pMsgBuf);//clean response
+	delete pMsgBuf;
+	pMsgBuf = NULL;
+	
+	}
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	//StartActiveScheduler(1);
+	CleanupStack::Pop(&iRFileHandle);
+	if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+    
+	CleanupStack::Pop(iServiceConnection);
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+		
+	 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	 iSenXmlServiceDescription = NULL;
+
+//	iRFileHandle.Close();
+	Teardown();
+	return KErrNone;
+	}
+	
+		//New Test Case SendL with RFile
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult )
+    {
+	SetupL() ;
+	TInt retVal(KErrNone);
+	iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+	iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+	iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId);
+	TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+	iSenXmlServiceDescription->SetIapIdL(iapId);
+	TInt err(KErrNone);
+
+	//iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId());
+	iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+
+	StartActiveScheduler(1);
+	/*
+	_LIT16(KRFileSrc,"c\\private\\101FB3E7\\Test.txt");
+ 	TInt err = iRFileHandle.Open(iFsSessionHandle,_L("c:\\private\\101FB3E7\\Test.txt"),EFileWrite);
+    if(err !=KErrNone)
+	err = iRFileHandle.Create(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileWrite);
+	TInt pos=0 ;
+    iRFileHandle.Seek(ESeekEnd,pos);
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+	iRFileHandle.Write(KRequest);
+ 	iRFileHandle.Close();
+ 	*/
+ 	User::LeaveIfError(this->iFsSessionHandle.Connect());//anil
+    User::LeaveIfError(this->iFsSessionHandle.ShareProtected());
+	err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead);
+	CleanupClosePushL(iRFileHandle);
+	TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle);
+	if (transactionIdOrError == KErrNone)
+	    StartActiveScheduler(1);
+//	LOCAL_ASSERT(transactionIdOrError > KErrNone);
+	
+	CleanupStack::PopAndDestroy(&iRFileHandle);
+	if(iFsSessionHandle.Handle())
+    	iFsSessionHandle.Close(); 
+
+	CleanupStack::Pop(iServiceConnection);
+		__ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+	iServiceConnection = NULL;
+	 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+	 iSenXmlServiceDescription = NULL;
+
+
+	Teardown();
+	return KErrNone;
+	}
+	
+	
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnectionSnapIdL( TTestResult& aResult )
+{
+    SetupL() ;
+    
+    TUint32 snapId=11;
+     TUint32 retSnapId;
+    
+	CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();
+     pHttpProperties->SetSnapIdL(snapId);               
+     pHttpProperties->SnapIdL(retSnapId);
+     TL(retSnapId==snapId);
+      CleanupStack::PopAndDestroy(pHttpProperties) ;//   
+	Teardown();
+	return KErrNone;
+}	
+TAny* CSenServiceConnectionBCTest::GetInterfaceByUid( TUid aUID )
+	{
+		iLog->Log(_L("GetInterfaceByUid()->start"));
+#ifdef __ENABLE_ALR__		
+	if ( (aUID == KSenInterfaceUidAlrObserver) && iUseALR)
+        {
+        MSenAlrServiceConnection* observer = (MSenAlrServiceConnection*) this;
+        	iLog->Log(_L("Alr observer is set "));
+        return observer;
+        }
+#endif //__ENABLE_ALR__        
+	if ( (aUID == KSenInterfaceUidCoBrandingObserver) && iCoBrandingCallbackOption)
+        {
+        // return this; // wrong, please cast first to M-class  (if same C-class implements multiple extended interfaces (M-classes))
+        MSenCoBrandingObserver* observer = (MSenCoBrandingObserver*) this;
+        iLog->Log(_L("CoBrand observer is set "));
+        return observer;
+        }
+   if ( (aUID == KSenInterfaceUidHostletConsumer) && iHostletConsumerOption)
+        {
+        // return this; // wrong, please cast first to M-class  (if same C-class implements multiple extended interfaces (M-classes))
+        MSenHostletConsumer* observer = (MSenHostletConsumer*) this;
+        iLog->Log(_L("Hostlet Consumer is set "));
+        return observer;
+        }
+	        
+	   iLog->Log(_L("GetInterfaceByUid()->End with out set observer "));      
+	return NULL;
+	}
+
+
+/*
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_NoErrorL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = iServiceConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    StartActiveScheduler(1);
+
+    TL(iTransactionId == transactionIdOrError);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CancelL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = iServiceConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    iServiceConnection->CancelTransaction(transactionIdOrError);
+    
+    StartActiveScheduler(1);
+
+    TL(iTransactionId == transactionIdOrError);
+    LOCAL_ASSERT(iErrorCode == KErrSenCancelled);
+    
+    User::After(2000000);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ConNotInitialL( TTestResult& aResult )
+    {
+    SetupL() ;
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TL((iServiceConnection->SendL(KRequest)) == KErrSenNotInitialized);
+    StartActiveScheduler(1);
+    
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendMultipleMessagesL( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Get (using SetTransportPropertiesL)
+    // ****************************************
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    
+    CleanupStack::PushL(pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    //pHttpProperties->SetOmittedL(KIapIdLocalName, ETrue);
+    //pSerializedProperties = pHttpProperties->AsUtf8L();
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(10);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // 1. SendL(MSG [SC::POST by default])  
+    // 2. SendL(MSG, TP::GET),
+    // 3. SendL(MSG, TP::POST)
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Get
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+    
+    // Check from HTTP Transaction logger log that GET method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    // Http Post
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Get_Post2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // 1. SetTransportPropertiesL(TP::GET)
+    // 2. SendL(MSG) - Send(MSG, TP::POST)
+    // 3. SendL (MSG [SC::GET])
+    // 4. SetTransportPropertiesL(TP:POST)
+    // 5. SendL(MSG [SC:POST]
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Get (using SetTransportPropertiesL)
+    // ****************************************
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+
+    // Check from HTTP Transaction logger log that GET method were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Post (using TransportProperties in SendL parameters)
+    // *********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that Post method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Get (using TransportProperties in SendL parameters)
+    // ********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+    
+    // Check from HTTP Transaction logger log that GET method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    // Http Post (using SetTransportPropertiesL)
+    // *****************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that Post method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);        
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Post (using TransportProperties in SendL parameters)
+    // *********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetProxy via Set(TP)
+    // ********************
+    // 1. SetTransportProperties(TP::PROXY)
+    // 2. SendL(MSG)    _LIT8(KSoapAction,              "SOAPAction");
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "SoapEnvelopeAction");
+    _LIT8(KSoapActionReturnValue,   "\"SoapEnvelopeAction\"");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+
+
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    
+    // Now the code execution has returned in here (either HandleMessageL or HandleErrorL was invoked)
+    
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetProxyHostL(KProxyHost);
+    pHttpProperties->SetProxyPortL(KProxyPort);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Proxy2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetProxy via SendL(MSG, TP)
+    // ***************************
+    // 1. SendL(MSG, TP::PROXY)
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "SoapEnvelopeAction");
+    _LIT8(KSoapActionReturnValue,   "\"SoapEnvelopeAction\"");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetProxyHostL(KProxyHost);
+    pHttpProperties->SetProxyPortL(KProxyPort);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // ServicePattern::SetConsumerIapIdL(IAP_ID)
+    // *****************************************
+    // 1. Create new Service Pattern (SPatt)
+    // 2. SPatt::SetConsumerIapIdL(IAP_ID)
+    // 3. Instantiate new SC, wait for SetStatus(READY)
+    // 4. SendL(MSG)  using selected IAP
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+    
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP:IAP_ID)         NOTE: this test case requires user interaction!!!
+    // *******************************************************************************
+    // 1. Instantiate new SC, wait for SetStatus(READY) [IAP is prompted from end user!]
+    // 2. TP::SetIapIdL(IAP_ID)
+    // 3. SendL(MSG, TP::IAP_ID)  using selected IAP
+    // 4. SendL(MSG)  -- should prompt the IAP from the end-user
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+    
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_Pattern_IAP3L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetTransportPropertiesL(TP::IAP_ID)
+    // 1. SetTransportPropertiesL(TP::IAP_ID)
+    // 2. SendL(MSG)  using selected IAP
+    // 3. TP:SetOmittedL(IAP_ID)
+    // 4. SendL(MSG, TP::IAP_ID-Omitted) -- should prompt the IAP from the end-user    
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 1. SetTransportPropertiesL(TP::IAP_ID)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    // 2. SendL(MSG)  using selected IAP
+    iServiceConnection->SendL(*pSOAPMessage);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    // 3. TP:SetOmittedL(IAP_ID)
+    //pHttpProperties->SetOmittedL(KIapIdLocalName, ETrue);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    // 4. SendL(MSG, TP::IAP_ID-Omitted) -- should prompt the IAP from the end-user    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP::Content-Type)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective content-type
+    // 2. TP::SetContentTypeIdL(Content-Type)
+    // 3. SendL(MSG, TP::Content-Type)  // check that selected Content-Type is used
+    // 4. SendL(MSG) // original content type should be used (from step 1)
+
+    _LIT8(KContentTypeValue, "text");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    HBufC8* pOriginalContentType = NULL; 
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective content-type
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 contentType;
+        TInt retVal = pReadHttpProperties->ContentTypeL(contentType);
+        if ( retVal == KErrNone )
+            {
+            pOriginalContentType = contentType.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+        
+    LOCAL_ASSERT(pOriginalContentType != NULL); // Content-type is a MUST for every transport
+        
+    if ( pOriginalContentType )
+        {
+        CleanupStack::PushL(pOriginalContentType);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. TP::SetContentTypeIdL(Content-Type)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetContentTypeL(KContentTypeValue);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+
+    // 3. SendL(MSG, TP::Content-Type)  // check that selected Content-Type is used
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+       
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    // 4. SendL(MSG) // original content type should be used (from step 1)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue && pOriginalContentType )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalContentType);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+
+    if ( pOriginalContentType )
+        {
+        CleanupStack::PopAndDestroy(pOriginalContentType);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;    
+    }
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_ContentType2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetTransportPropertiesL(TP::Content-Type)
+    // 1. Get TP via SC:TransportPropertiesL()
+    // 2. SendL(MSG), Content-Type got from step 1 should be effective
+    // 3. SetTransportPropertiesL(TP::Content-Type) // change content-type
+    // 4. SendL(MSG)  // check new content-type
+    // 5. SendL(MSG, TP:Content-Type)  // check *third* kind of content-type
+
+    _LIT8(KContentTypeValue1, "text");
+    _LIT8(KContentTypeValue2, "xml");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL()
+    TPtrC8 contentType;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->ContentTypeL(contentType);
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG), Content-Type got from step 1 should be effective
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // 3. SetTransportPropertiesL(TP::Content-Type) // change content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetContentTypeL(KContentTypeValue1);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 4. SendL(MSG)  // check new content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue1);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. SendL(MSG, TP:Content-Type)  // check *third* kind of content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetContentTypeL(KContentTypeValue2);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue2);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP::User-Agent)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective User-Agent
+    // 2. TP::SetUserAgentL(User-Agent)
+    // 3. SendL(MSG, TP::User-Agent)  // check that selected User-Agentis used
+    // 4. SendL(MSG) // original User-Agent should be used (from step 1)
+
+    _LIT8(KUserAgentValue, "TestAgent");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective User-Agent
+    HBufC8* pOriginalUserAgent = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        TPtrC8 userAgent;
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->UserAgentL(userAgent);
+        pOriginalUserAgent = userAgent.AllocL();
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        CleanupStack::PushL(pOriginalUserAgent);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. TP::SetUserAgentL(User-Agent)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+
+    // 3. SendL(MSG, TP::User-Agent)  // check that selected User-Agent is used
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that selected User-Agent were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SendL(MSG) // original User-Agent should be used (from step 1)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    if ( pValue && pOriginalUserAgent )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalUserAgent);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalUserAgent )
+        {
+        CleanupStack::PopAndDestroy(pOriginalUserAgent);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_UserAgent2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SetTransportPropertiesL(TP:User-Agent)
+    // 1. Get TP via SC:TransportPropertiesL() // store original user-agent
+    // 2. SendL(MSG); // check User-Agent from step 1 is sent/used
+    // 3. SetTransportPropertiesL(TP::User-Agent) // change user-agent
+    // 4. SendL(MSG, TP::User-Agent) // change user agent, check that it is used
+    // 5. SendL(MSG); // check that set User-Agent is used, from step 3
+
+    _LIT8(KUserAgentValue1, "TestAgent1");
+    _LIT8(KUserAgentValue2, "TestAgent2");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store original user-agent
+    HBufC8* pOriginalUserAgent = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        TPtrC8 userAgent;
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->UserAgentL(userAgent);
+        pOriginalUserAgent = userAgent.AllocL();
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        CleanupStack::PushL(pOriginalUserAgent);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG); // check User-Agent from step 1 is sent/used
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that original User-Agent were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+
+    if ( pValue && pOriginalUserAgent )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalUserAgent);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 3. SetTransportPropertiesL(TP::User-Agent) // change user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue1);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 4. SendL(MSG, TP::User-Agent) // change user agent, check that it is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue2);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that defined User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue2);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. SendL(MSG); // check that set User-Agent is used, from step 3
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that defined (in step 3) User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue1);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalUserAgent )
+        {
+        CleanupStack::PopAndDestroy(pOriginalUserAgent);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_MessageSoapActionL( TTestResult& aResult )
+    {
+    SetupL() ;
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "MessageAction");
+    _LIT8(KSoapActionReturnValue,   "\"MessageAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction1L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(MSG, TP:SOAPAction)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective SOAPAction
+    // 2. TP::SetSoapActionL(SOAPAction)
+    // 3. SendL(MSG, TP::SOAPAction)  // check that selected SOAPAction is used
+    // 4. SendL(MSG) // original SOAPAction should be used (from step 1)    
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "MessagePropertyAction");
+    _LIT8(KSoapActionReturnValue,   "\"MessagePropertyAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective SOAPAction
+    HBufC8* pOriginalSoapAction = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 soapAction(KNullDesC8);
+        TInt retVal = pReadHttpProperties->SoapActionL(soapAction);
+        if ( retVal == KErrNone )
+            {
+            pOriginalSoapAction = soapAction.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+        
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PushL(pOriginalSoapAction);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    
+    // 2. TP::SetSoapActionL(SOAPAction)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KSoapActionValue);
+    
+    // 3. SendL(MSG, TP::SOAPAction)  // check that selected SOAPAction is used
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // 4. SendL(MSG) // original SOAPAction should be used (from step 1)    
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original SoapAction is used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    
+    if( pValue && pOriginalSoapAction )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalSoapAction);
+        }
+//    else if ( pValue )
+//        {
+        // This is temporary: the default "" SOAPAction value has been removed from HTTPC:
+        // also WS-I, REST and ID-WSF define this "" -value only on ::SendL (in message layer!)
+        // This means, that "original soap action" from SC does not CURRENTLY yet provide the
+        // framework default(!)
+//        LOCAL_ASSERT( *pValue ==  KSenSoapActionHeaderValueEmpty ) // default from framework.
+//        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PopAndDestroy(pOriginalSoapAction);
+        }    
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_SoapAction2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // SendL(SOAP-ENV::SOAPAction)
+    // 1. Get TP via SC:TransportPropertiesL() // store original soap-action
+    // 2. SendL(SOAP-ENV::SOAPAction); // check SOAPAction from SoapEnvelope is sent/used
+    // 3. SendL(MSG); // check that original SOAPACtion is used, from step 1
+    // 4. SetTransportProperties(TP::SOAPAction2);
+    // 5. SendL(MSG); // check that previous SC::SOAPAction is used, from step 4
+    // 6. SendL(MSG, TP:SOAPAction); // check that TP:SOAPAction is used
+    // 7. SendL(SOAP-ENV::SOAPAction); // check that SOAP-ENV:SOAPAction is used
+    // 8. SendL(SOAP-ENV); // check that previous SC::SOAPAction is used, from step 4
+    // 9. SendL(SOAP-ENV, TP::SOAPAction); // check that new TP::SOAPAction is used
+    // 10. SendL(SOAP-ENV:SOAPAction, TP::SOAPAction ); // both are set: check that SOAP-ENV:SOAPAction is used, over-riding TP
+    // 11. SendL(SOAP-ENV:SOAPAction ); SC::SOAPAction // only SOAP-ENV::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // 12. SendL(MSG, TP:SOAPAction ); SC::SOAPAction // only TP::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    
+    _LIT8(KSoapAction,                      "SOAPAction");
+    _LIT8(KEnvelopeSoapActionValue,         "EnvelopeAction");
+    _LIT8(KEnvelopeSoapActionReturnValue,   "\"EnvelopeAction\"");
+    _LIT8(KSessionSoapActionValue,          "SessionAction");
+    _LIT8(KSessionSoapActionReturnValue,    "\"SessionAction\"");
+    _LIT8(KMessageSoapActionValue,          "MessageAction");
+    _LIT8(KMessageSoapActionReturnValue,    "\"MessageAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Get TP via SC:TransportPropertiesL() // store original soap-action
+    HBufC8* pOriginalSoapAction = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 soapAction(KNullDesC8);
+        TInt retVal = pReadHttpProperties->SoapActionL(soapAction);
+        if ( retVal == KErrNone )
+            {
+            pOriginalSoapAction = soapAction.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PushL(pOriginalSoapAction);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    
+    // 2. SendL(SOAP-ENV::SOAPAction); // check SOAPAction from SoapEnvelope is sent/used
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG); // check that original SOAPACtion is used, from step 1
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue && pOriginalSoapAction )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalSoapAction);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SetTransportProperties(TP::SOAPAction2);
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KSessionSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // 5. SendL(MSG); // check that previous SC::SOAPAction is used, from step 4
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+    
+    // Check from HTTP Transaction logger log that defined (in step 4.) SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSessionSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    // 6. SendL(MSG, TP:SOAPAction); // check that TP:SOAPAction is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 7. SendL(SOAP-ENV::SOAPAction); // check that SOAP-ENV:SOAPAction is used
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+    
+    // 8. SendL(SOAP-ENV); // check that previous SC::SOAPAction is used, from step 4
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined (in step 4.) SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSessionSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 9. SendL(SOAP-ENV, TP::SOAPAction); // check that new TP::SOAPAction is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 10. SendL(SOAP-ENV:SOAPAction, TP::SOAPAction); // both are set: check that SOAP-ENV:SOAPAction is used, over-riding TP
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+
+    // 11. SendL(SOAP-ENV:SOAPAction ); SC::SOAPAction // only SOAP-ENV::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // Note: SOAPAction for ServiceConnection was defined in step 4.
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+    
+    // 12. SendL(MSG, TP:SOAPAction ); SC::SOAPAction // only TP::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // Note: SOAPAction for ServiceConnection was defined in step 4.
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PopAndDestroy(pOriginalSoapAction);
+        }    
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_CustomHttpHeaderL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Set custom HTTP header
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE  (value should include Scandic characters, like Ä and Ö)
+    // 2. Get TP using SC:TransportPropertiesL()
+    // 3. SendL(MSG) // see that CUSTOM_HTTP_HEADER -field is not present
+    // 4. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that http filter logs CUSTOM_HTTP_HEADER
+    // 5. Define TP::CUSTOM_HTTP_HEADER_VALUE2 (for already existing CUSTOM_HTTP_HEADER_NAME)
+    // 6. Call SC::SetTransportPropertiesL(TP::CUSTOM_HTTP_HEADER_VALUE2) // VALUE2 should containt basic XML entities -- escapes like &, <, >, '   etc..
+    // 7. SendL(MSG) // see that TP::CUSTOM_HTTP_HEADER_VALUE2 is effective
+
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE  (value should include Scandic characters, like Ä and Ö)
+    _LIT8(KCustomHttpHeader,        "CustomHeader");
+    _LIT8(KCustomHttpHeaderValue1,  "CustomHeaderValue1ÅÄÖåäö"); // UTF8 String which contains: "CustomHeaderValue1ÅÄÖåäö"
+    _LIT8(KCustomHttpHeaderValue2,  "CustomHeaderValue2<>&");
+    HBufC8* pEncoded = SenXmlUtils::EncodeHttpCharactersLC(KCustomHttpHeaderValue2);
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG) // see that CUSTOM_HTTP_HEADER -field is not present
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was not used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(pValue == NULL);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that http filter logs CUSTOM_HTTP_HEADER
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, KCustomHttpHeaderValue1);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KCustomHttpHeaderValue1);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. Define TP::CUSTOM_HTTP_HEADER_VALUE2 (for already existing CUSTOM_HTTP_HEADER_NAME)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, *pEncoded);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    // 6. Call SC::SetTransportPropertiesL(TP::CUSTOM_HTTP_HEADER_VALUE2) // VALUE2 should containt basic XML entities -- escapes like &, <, >, '   etc..
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 7. SendL(MSG) // see that TP::CUSTOM_HTTP_HEADER_VALUE2 is effective
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    RDebug::RawPrint( *pValue );
+    if ( pValue )
+        {
+        RDebug::Print( _L("ENCODED:") );
+        RDebug::RawPrint( *pEncoded );
+        RDebug::Print( _L("OUTPUT:") );
+        RDebug::RawPrint( *pValue );
+        LOCAL_ASSERT(*pValue == *pEncoded);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(pEncoded);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries1( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    //_LIT8(KCustomHttpHeaderValue, ); // NULL cannot be used as descriptor literal value in Symbian
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KNullDesC8);
+    //TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries2( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    // _LIT8(KCustomHttpHeader,); // NULL cannot be used as descriptor literal value in Symbian => it is more important to test KNullDesC8 (zero-length inputs etc)
+    _LIT8(KCustomHttpHeader, "X"); // property name's length = 1
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue"); 
+    
+    // Note: XML specs do not allow <Element> (tag name) to have zero-length.
+
+    // It is not a bad idea to create such a test case, where GOAL is actually test the http property class 
+    // itself (public DLL which is run by client app process); Utils DLL should maybe leave after it has been made to 
+    // regocnize illegal inputs. All the might check special chars, BUT --NOTE-- it would make the setters quite much 
+    // heavier (in terms of performance) if the key names (xml tag names) are first validated.
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KNullDesC8, KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries3( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader, "CustomHeader");
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KNullDesC8);
+    //NOTE: --> we could create test case for length==1 case: _LIT8(KCustomHttpHeaderValue, "Y"); // property value's length = 1
+    // _LIT8(KCustomHttpHeaderValue,  ""); // == KNullDesC8 
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries4( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    //_LIT8(KCustomHttpHeader,""); // == KNullDesC8
+    _LIT8(KCustomHttpHeader, "X"); // property name's length = 1
+    _LIT8(KCustomHttpHeaderValue, "CustomHeaderValue"); 
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KNullDesC8, KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+   
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries5( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8(KCustomHttpHeaderValue,  "256HeaderValuexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries6( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    // Note: property name used to start with number here => changed, since it is against XML specs (property names are XML tags, parser does not accept tags which start by a number)
+
+    // It is not a bad idea to create such a test case, where GOAL is actually test the http property class 
+    // itself (public DLL which is run by client app process); Utils DLL should maybe leave after it has been made to 
+    // regocnize illegal inputs. All the might check special chars, BUT --NOTE-- it would make the setters quite much 
+    // heavier (in terms of performance) if the key names (xml tag names) are first validated.
+    _LIT8(KCustomHttpHeader,"Header256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries7( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"Header256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    _LIT8(KCustomHttpHeaderValue,  "256HeaderValuexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries8( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8( KCRLFSP,       "\r\n " );
+    //_LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue55"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCRLFSP);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Boundaries9( TTestResult& aResult )
+    {
+    SetupL() ;
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue1, CustomHeaderValue2"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    Teardown();
+    return KErrNone;
+	}
+
+
+//Befor executing this TL remember to set big enought TimeOut value (10 min.)
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_SecDialog(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+               
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHttpsEndPoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+   
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL(ETrue);
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSecureDialogL(EFalse);
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial == EFalse);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_True(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL( ETrue );
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    pHttpProperties->SetOmittedL(KSecureDialogLocalName,ETrue);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog Omitted=\"true\">true</SecureDialog>"));
+    TL(cmpVal != KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omitted_False(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL( ETrue );
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    pHttpProperties->SetOmittedL(KSecureDialogLocalName, EFalse);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog Omitted=\"false\">true</SecureDialog>"));
+    TL(cmpVal != KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Removed(TTestResult& aResult)
+    {
+    SetupL() ;
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL(ETrue);
+    pHttpProperties->SecureDialogL(secDial);
+    TL(secDial != EFalse);
+    pHttpProperties->RemovePropertyL(KSecureDialogLocalName);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog>"));
+    TL(cmpVal == KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Omit_Rem(TTestResult& aResult)
+    {
+    SetupL() ;
+    _LIT8(KUserAgentValue,          "TestAgent");
+    _LIT8(KUserAgentDefaultValue,   "Serene");
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG) // with set user-agent
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //3. Check from HTTP Transaction logger log that user-agent was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    
+    // 4. SendL(MSG) // with removed user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->RemovePropertyL(KUserAgentLocalName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //5. Check from HTTP Transaction logger log that user-agent was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue != KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);        
+    
+    
+    // 6. SendL(MSG) // with omitted set to EFalse for user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->SetOmittedL(KUserAgentLocalName, EFalse);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //7. Check from HTTP Transaction logger log that given user-agent
+    //   was used (when EFalse was given as Omitted value).
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);            
+    
+    // 8. SendL(MSG) // with omitted set to ETrue for user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->SetOmittedL(KUserAgentLocalName, ETrue);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //9. Check from HTTP Transaction logger log that 
+    //   default user-agent for HTTP Transport plugin was
+    //   used instead of user-agent which was set together
+    //   with omitted value ETrue.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentDefaultValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);                
+
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\fileContainer.txt" );
+    _LIT8(  KFileContent,  "Test FileContainer1" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Replace(rfs, KTestFileName, EFileWrite));
+    User::LeaveIfError(file.Write(KFileContent));
+    file.Flush();
+    file.Close();
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    // Check from HTTP Transaction logger log that POST method was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;    
+    }
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\fileContainer.txt" );
+    _LIT8(  KFileContent,  "Test FileContainer1" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Replace(rfs, KTestFileName, EFileWrite));
+    User::LeaveIfError(file.Write(KFileContent));
+    file.Flush();
+    file.Close();
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+                                                                               _L8("xmlmime"));
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pSOAPMessage->SetProperties(pHttpProperties);
+    CleanupStack::Pop(pHttpProperties); // ownership was transferred to message
+        
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    // Check from HTTP Transaction logger log that POST method was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset2.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\Winter2.jpg" );
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\Winter.jpg" );
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");    
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\testPic3.jpg");
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+   
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");    
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "c:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "c:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "c:\\testing\\data\\testPic4.jpg");
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+   
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessengerL( TTestResult& aResult )
+    {
+    SetupL() ;
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger2L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    CSenServiceManager* pManager = CSenServiceManager::NewLC();
+
+    // Get used IdentityProvider from ServiceConnection
+    CSenIdentityProvider* pIdp = NULL;
+    iServiceConnection->IdentityProviderL(pIdp);
+    CleanupStack::PushL(pIdp);
+        
+    // Get used Credential from Credentials DB
+    RCredentialArray credentialArray;
+    CleanupClosePushL(credentialArray);
+    RCredentialPropertiesArray credentialPropertiesArray;
+    CleanupClosePushL(credentialPropertiesArray);
+    LOCAL_ASSERT((pManager->CredentialsL(KMessagingEndpoint, *pIdp,
+                                         credentialArray,
+                                         credentialPropertiesArray)) == KErrNone);
+                                         
+    // Check that atleast one Credential were found.
+    LOCAL_ASSERT(credentialArray.Count() > 0);
+    
+    CleanupStack::Pop(&credentialPropertiesArray);
+    CleanupStack::Pop(&credentialArray);
+    CleanupStack::Pop(pIdp);
+    CleanupStack::PopAndDestroy(pManager);   
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+
+    CleanupStack::PushL(pIdp);
+    CleanupClosePushL(credentialArray);
+    CleanupClosePushL(credentialPropertiesArray);
+
+    // Clean DBs STARTS
+    //      1) Unregister STS ServiceDescription and
+    //                 STS IdentityProvider
+    //         => Unregistering IdentityProvider removes
+    //            related Credentials from Credentials DB
+    //
+    UnregisterSTSL();
+    
+    //      2) Unregister actual Service (= Messaging) ServiceDescription
+    pManager = CSenServiceManager::NewLC();
+    CSenXmlServiceDescription* pPattern = CSenXmlServiceDescription::NewLC();
+    pPattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pPattern->SetEndPointL(KMessagingEndpoint);
+    pPattern->SetContractL(KMessagingContract);
+    TInt error = pManager->UnregisterServiceDescriptionL( *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    CleanupStack::PopAndDestroy(pManager);   
+    // Clean DBs ENDS
+    
+    RegisterSTSL();
+    
+    pManager = CSenServiceManager::NewLC();
+
+    // Add Credential to Credentials DB
+    // => When Connection is initialized, working Credential
+    //    should be found from Credentials DB
+    // => Working Credential should be used and
+    //    request to get new SecurityToken should NOT be sent.
+    LOCAL_ASSERT((pManager->AddCredentialL(KMessagingEndpoint,
+                                           *pIdp,
+                                           *credentialArray[0],
+                                           *credentialPropertiesArray[0])) == KErrNone);
+
+    CleanupStack::PopAndDestroy(pManager);   
+    credentialPropertiesArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(&credentialPropertiesArray);
+    credentialArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(&credentialArray);
+    CleanupStack::PopAndDestroy(pIdp);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    // Send Register message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger3L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    //pInvalidStsProvider->AsElement().AddAttrL(_L8("promptUserInfo"),_L8("false"));
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT(iAuthInfoAskCounter == 1);
+
+    // 
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady );
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger4L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT(iAuthInfoAskCounter == 3);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusCreateFailed );
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger5L( TTestResult& aResult )
+    {
+    SetupL() ;
+    UnregisterSTSL();
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    pInvalidStsProvider->AsElement().AddAttrL(_L8("promptUserInfo"),_L8("false"));
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT( iAuthInfoAskCounter == 0 );
+
+    LOCAL_ASSERT( iConnectionState == KSenConnectionStatusCreateFailed );
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger6L( TTestResult& aResult )
+    {
+    SetupL() ;
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceWithoutCallbackL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TestMessenger7L( TTestResult& aResult )
+    {
+    SetupL() ;
+    // Create one "fake" ServiceManager instance which keeps
+    // Serene server up and running through whole test case.
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    
+    UnregisterSTSL();
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+
+    // Clean DBs STARTS
+    //      1) Unregister STS IdentityProvider
+    //         => Unregistering IdentityProvider removes
+    //            related Credentials from Credentials DB
+    //
+    UnregisterSTSL();
+    // Clean DBs ENDS
+    
+    RegisterSTSInvalidPasswordL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT( iConnectionState == KSenConnectionStatusCreateFailed );
+    LOCAL_ASSERT( iCallback        == ECallbackHandleError );
+    LOCAL_ASSERT( iErrorCode       == -30320 ); // -30320 = KErrSenFailedAuthentication
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    CleanupStack::PopAndDestroy(manager);
+    Teardown();
+    return KErrNone;
+	}
+
+    
+int CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Custom_Header(const TDesC8& KCustomHttpHeader,
+                                    const TDesC8& KCustomHttpHeaderValue)
+    {
+    SetupL() ;
+    // Set custom HTTP header
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE
+    // 2. Get TP using SC:TransportPropertiesL()
+    // 3. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that CUSTOM_HTTP_HEADER -field is present
+    // 4. Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+               
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    if(iConnectionState != KSenConnectionStatusReady) return KErrCouldNotConnect;
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //4. Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    //LOCAL_ASSERT(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    //LOCAL_ASSERT(pValue == NULL);
+    if(pValue == NULL) return KErrNotFound;
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    return KErrNone;    
+    Teardown();
+    return KErrNone;
+	}
+    
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_Send(const TDesC8& aLogFileName, const TDesC8& aCustomHttpHeader,
+                                                                const TDesC8& aCustomHttpHeaderValue, CSenServiceConnection* iServiceConnection)
+    {
+    SetupL() ;
+    TInt result = KErrNone;
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, aLogFileName);
+    pHttpProperties->SetHttpHeaderL(aCustomHttpHeader, aCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    if(iCallback != ECallbackHandleMessage) return KErrGeneral;
+   
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    return result;
+    Teardown();
+    return KErrNone;
+	}
+
+    
+    
+TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_TP_CheckLogs(const TDesC& aLogFilePath,  const TDesC8& aCustomHttpHeader, const TDesC8& aCustomHttpHeaderValue)
+    {
+    SetupL() ;
+    TInt result = KErrNone;
+    HBufC8* pFileContent = ReadFileL(aLogFilePath);
+    //LOCAL_ASSERT(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, aCustomHttpHeader);
+    //LOCAL_ASSERT(*pValue == aCustomHttpHeaderValue);
+    if (*pValue != aCustomHttpHeaderValue) return KErrNotFound;
+    
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    return result;
+    Teardown();
+    return KErrNone;
+	}
+
+
+
+HBufC8* CSenServiceConnectionBCTest::HttpMethodValueFromXmlLC(const TDesC8& aXml)
+    {
+    SetupL() ;
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    CSenElement* pTPElement = pRequestElement->Element(_L8("Method"));
+    
+    HBufC8* pRetBuf = pTPElement->Content().AllocL();
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    
+    CleanupStack::PushL(pRetBuf);
+    
+    return pRetBuf;
+    Teardown();
+    return KErrNone;
+	}   
+*/
+TInt CSenServiceConnectionBCTest::SendL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->SendL(KReq);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+}       
+TInt CSenServiceConnectionBCTest::SubmitL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	CTestConnection* pTest = CTestConnection::NewL();//*this);
+	
+	HBufC8* pBuf = HBufC8::NewL(256);
+	res = pTest->SubmitL(KReq,pBuf);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pBuf;
+	return res;
+}       
+TInt CSenServiceConnectionBCTest::IsReady( TTestResult& aResult )             {
+	TInt res;
+	TBool ready;
+	CTestConnection* pTest = CTestConnection::NewL();
+	res = pTest->IsReady(ready);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::HasFacetL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KUri,"test uri");
+	TBool HasFacet;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->HasFacetL(KUri,HasFacet);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::CompleteServerMessagesOnOff( TTestResult& aResult )   {
+	TInt res;
+	TBool CompleteOnOff(TRUE);
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->CompleteServerMessagesOnOff(CompleteOnOff);
+	//CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send2L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	res = pTest->SendL(*pEnv);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Submit2L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	HBufC8* pBuf = HBufC8::NewL(256);
+	res = pTest->SubmitL(*pEnv,pBuf);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	delete pBuf;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::ServiceDescriptionL( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	HBufC8* pSD = HBufC8::NewL(256);
+	res = pTest->ServiceDescriptionL(pSD);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pSD;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::StartTransaction( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->StartTransaction();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::TransactionCompleted( TTestResult& aResult )    {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->TransactionCompleted();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::TxnId( TTestResult& aResult )            {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->TxnId();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::SetTransportPropertiesL( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KProperties,"properties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->SetTransportPropertiesL(KProperties);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::TransportPropertiesL( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	HBufC8* pProps = HBufC8::NewL(256);
+	res = pTest->TransportPropertiesL(pProps);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pProps ;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send3L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->SendL(KReq,KProps);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+}       
+TInt CSenServiceConnectionBCTest::Submit3L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KReq,"request");
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	HBufC8* pRes = HBufC8::NewL(256);
+	
+	res = pTest->SubmitL(KReq,KProps,pRes);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pRes;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send4L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	
+	res = pTest->SendL(*pEnv,KProps);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Submit4L( TTestResult& aResult )   {
+	TInt res;
+	_LIT8(KProps,"PRoperties");
+	CTestConnection* pTest = CTestConnection::NewL();
+	CSenSoapEnvelope* pEnv= CSenSoapEnvelope::NewL();
+	
+	HBufC8* pRes = HBufC8::NewL(256);
+	res = pTest->SubmitL(*pEnv,KProps,pRes);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	delete pEnv;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Send5L( TTestResult& aResult )    {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	MSenMessage* pMsg = NULL;
+	res = pTest->SendL(*pMsg );
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Submit5L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	MSenMessage* pMsg = NULL;
+	CSenSoapEnvelope2* pEnv = NULL;
+	res = pTest->SubmitL(*pMsg, pEnv);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Response( TTestResult& aResult )                  {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	MSenMessage* pMsg;
+	TRAP(res, pTest->Response());
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::CancelTransaction( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->CancelTransaction(1)   ;
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::IdentityProvider1L( TTestResult& aResult )   {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	CSenIdentityProvider* pProv = NULL;
+	res = pTest->IdentityProviderL(pProv )   ;
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+TInt CSenServiceConnectionBCTest::Identifier( TTestResult& aResult )    {
+	TInt res;
+	CTestConnection* pTest = CTestConnection::NewL();
+	
+	res = pTest->Identifier();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return res;
+
+}       
+
+TInt CSenServiceConnectionBCTest::Name( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TPtrC8 name = pTest->Name();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(name == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::Type( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TPtrC8 type = pTest->Type();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(type == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::Value( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TPtrC8 value = pTest->Value();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(value == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::IntValue( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	TInt value(1);
+	TInt val = pTest->IntValue(value);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return val;
+}
+
+TInt CSenServiceConnectionBCTest::BoolValue( TTestResult& aResult )    {
+	CTestProperty* pTest = CTestProperty::NewL();
+	TBool value(TRUE);
+	TInt val = pTest->BoolValue(value);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return val;
+}
+
+TInt CSenServiceConnectionBCTest::ValueTokensL( TTestResult& aResult )    {
+	RPointerArray<TPtrC8>  tokens;
+	CTestProperty* pTest = CTestProperty::NewL();
+	
+	TInt val = pTest->ValueTokensL(_L8(""),tokens);
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	return val;
+}
+
+TInt CSenServiceConnectionBCTest::IdentityProvider2L( TTestResult& aResult ) 
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	
+	TRAPD(ret,pTest->IdentityProviderL());
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+//	delete Pprov ;
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::Username1L( TTestResult& aResult ) 
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	
+	TPtrC8 uname = pTest->UsernameL();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(uname == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+
+TInt CSenServiceConnectionBCTest::Password1L( TTestResult& aResult )                                           
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	
+	TPtrC8 pwd = pTest->PasswordL();
+//	CleanupStack::Pop(pTest);
+	delete pTest;
+	if(pwd == _L8(""))
+		return KErrNone;
+	else
+		return KErrArgument;
+}
+TInt CSenServiceConnectionBCTest::ExtendedInterface1L( TTestResult& aResult )                                   
+{
+	CTestProvider* pTest = CTestProvider::NewL();
+	TRAPD(ret,pTest->ExtendedInterface(10));
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::TransferProgress( TTestResult& aResult )                                   
+{
+	CTestFileObserver* pTest = CTestFileObserver::NewL();
+	TRAPD(ret,pTest->TransferProgress());
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::HandleMeassage(TTestResult& aResult)
+{
+	CTestConsumer* pTest = CTestConsumer::NewL();
+	TRAPD(ret,pTest->HandleMessageL());
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::HandleErrorL(TTestResult& aResult)
+{
+	CTestConsumer* pTest = CTestConsumer::NewL();
+	TRAPD(ret,pTest->HandleErrorL());
+
+	delete pTest;
+
+	return ret;
+}
+TInt CSenServiceConnectionBCTest::SetStatus(TTestResult& aResult)
+{
+	CTestConsumer* pTest = CTestConsumer::NewL();
+	TRAPD(ret,pTest->SetStatus());
+
+	delete pTest;
+
+	return ret;
+}
+
+#ifdef __ENABLE_ALR__
+TInt CSenServiceConnectionBCTest::ALRL(TTestResult& aResult)
+    {
+    iLog->Log(_L("ALR->start"));
+    SetupL();
+    
+    iUseALR = ETrue;
+    iAlrCallBackRetryCount =0;
+    isNewCarrierAccepted = EFalse;
+    isMigratedToPrefferedCarrier= EFalse;
+    	 
+    TInt retVal(KErrNone);
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>");
+    _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001");
+    
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+    iSenXmlServiceDescription->SetEndPointL(KEndPoint);
+    
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("ALR->TL(iServiceConnection != (CSenServiceConnection*)NULL);"));
+    StartActiveScheduler(1);
+    iLog->Log(_L("ALR->CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);"));
+    
+    iALRSC = (MSenAlrServiceConnection*) iServiceConnection->InterfaceByUid(KSenInterfaceUidAlrServiceConnection);  
+    iLog->Log(_L("iServiceConnection->InterfaceByUid(KSenInterfaceUidAlrServiceConnection")); 
+    
+    TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+    StartActiveScheduler(1);
+    
+     __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    iUseALR = EFalse;
+    iAlrCallBackRetryCount =0;
+    isNewCarrierAccepted = EFalse;
+    isMigratedToPrefferedCarrier= EFalse;
+    
+    Teardown();
+    iLog->Log(_L("ALR->End"));
+    }
+
+//mobility methods
+void CSenServiceConnectionBCTest::PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo,
+                                                     TAccessPointInfo aNewAPInfo,
+                                                     TBool aIsUpgrade,
+                                                     TBool aIsSeamless )
+    {
+    iLog->Log(_L("PreferredCarrierAvailable."));
+    iLog->Log(_L("PreferredCarrierAvailable Callback received"));
+    
+    TBuf<32> oldBuff;
+    oldBuff.Append(_L("With Old IAPID: "));
+    oldBuff.AppendNum(aOldAPInfo.AccessPoint());   
+    
+    TBuf<32> newBuff;
+    newBuff.Append(_L("With New IAPID: "));
+    newBuff.AppendNum(aNewAPInfo.AccessPoint());   
+     
+    TBool userChoice(EFalse) ;
+    if(aIsUpgrade)
+        {
+        iLog->Log(_L("it is upgrade")); 
+        }
+    else
+        {
+        iLog->Log(_L("it is not upgrade")); 
+        }       
+    if(aIsSeamless)
+        {
+        iLog->Log(_L("it is seemless"));
+        iLog->Log(_L("in S60 3.2, this situation cannot occur")); 
+        }
+    else
+        {
+        iLog->Log(_L("it is not seemless"));
+        iLog->Log(_L("calling MigrateToPrefferedCarrierL() with user choice ETrue")); 
+        
+        userChoice = ETrue ;// pressed yes, accept
+                              //pressed no, reject
+        iALRSC->MigrateToPrefferedCarrierL(userChoice);
+        isMigratedToPrefferedCarrier = ETrue;
+        if (userChoice != EFalse)
+            {
+            iLog->Log(_L("userChoice is Yes")); 
+            iLog->Log(_L("Migrating to New Carrier"));
+            }
+        else
+            {
+            iLog->Log(_L("userChoice is No"));  
+            iLog->Log(_L("Ignoring  New Carrier"));                
+            }
+        }
+    }
+
+void CSenServiceConnectionBCTest::NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless )
+    {
+    iLog->Log(_L("NewCarrierActive Callback received")); 
+    
+    TBuf<32> buff;
+    buff.Append(_L("With New IAPID: "));
+    buff.AppendNum(aNewAPInfo.AccessPoint()); 
+        
+           
+    TBool userChoice(EFalse) ;
+    if (aIsSeamless)
+        {
+         // in S60 3.2, this situation cannot occur.
+        iLog->Log(_L("it is seemless")); 
+        iLog->Log(_L("in S60 3.2, this situation cannot occur"));  
+        }
+    else
+        {
+        iLog->Log(_L("it is not seemless")); 
+        iLog->Log(_L("calling NewCarrierAcceptedL() with user choice ETrue"));      
+        userChoice = ETrue ;// pressed yes, accept
+                            // pressed no, reject
+  
+        iALRSC->NewCarrierAcceptedL(userChoice);
+        isNewCarrierAccepted = ETrue;
+        if (userChoice != EFalse)
+            {
+            iLog->Log(_L("userChoice is Yes")); 
+            iLog->Log(_L("New Carrier is accepted"));                            
+            }
+        else
+            {
+            iLog->Log(_L("userChoice is No")); 
+            iLog->Log(_L("New Carrier is rejected"));   
+            }
+        }        
+    }
+        
+void CSenServiceConnectionBCTest::Error(TInt aError)
+    {
+    iLog->Log(_L("mobility Error()"));
+    TBuf<24> numbuf;
+    numbuf.Append(_L("With Error: "));
+    numbuf.AppendNum(aError);   
+    iLog->Log(_L("mobility Error() received"));
+    }
+#endif //__ENABLE_ALR__
+
+TInt CSenServiceConnectionBCTest::CoBrandL(TTestResult& aResult)
+    {
+    	
+    iLog->Log(_L("CoBrand->start"));
+    SetupL();
+    
+    TInt retVal(0);
+    iCoBrandingCallbackOption = ETrue;    
+
+    _LIT8(KFramework, "WS-STAR");
+    _LIT8(KIdpEndPoint, "http://10.21.32.20/wsstar/cobranding/STS_CB_001.aspx");
+    _LIT8(KSdEndPoint, "http://10.21.32.20/WSStar/Trust/WSService.aspx");
+    _LIT8(KIdpContract, "urn:wstar:sts:2004-04");
+    _LIT8(KSmSdContract, "urn:wstar:sts");
+    _LIT8(KSdContract, "messenger.msn.com");
+    
+    _LIT8(KProviderId, "provider01");
+    _LIT8(KPassportUser, "john");
+    _LIT8(KPassportPass, "password");
+    
+    _LIT8(KTokenType, "TokenType");
+    _LIT8(KTokenTypeVal, "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1");
+    _LIT8(KPassportExtensions, "PassportExtensions ");
+
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">test request</ab:Query>");
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    TL(manager != (CSenServiceManager*)NULL);
+    iLog->Log(_L("CSenServiceManager* manager = CSenServiceManager::NewLC()"));
+    //register Identity provider for STS 
+    CSenIdentityProvider* idp = CSenIdentityProvider::NewLC(KIdpEndPoint);
+    idp->SetContractL(KIdpContract);
+    idp->SetFrameworkIdL(KFramework);
+    idp->SetProviderID(KProviderId);
+    idp->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);   
+    iLog->Log(_L("CSenIdentityProvider::NewLC(KIdpEndPoint)"));                                        
+    manager->RegisterIdentityProviderL( *idp);
+    iLog->Log(_L("manager->RegisterIdentityProviderL( *idp)"));
+    
+    CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC();
+    pSmSd->SetFrameworkIdL(KFramework);
+    pSmSd->SetContractL(KSmSdContract);
+    pSmSd->SetEndPointL(KIdpEndPoint);
+    pSmSd->AsElement().AddElementL(_L8("ProviderID")).SetContentL(_L8("provider01"));
+    SetPolicyL(pSmSd, KPolicySOAP12,  KNullDesC8);
+    SetPolicyL(pSmSd, KTokenType,  KTokenTypeVal);
+    SetPolicyL(pSmSd, KPassportExtensions,  KNullDesC8);
+	iLog->Log(_L("CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC()"));
+    TInt error = manager->RegisterServiceDescriptionL( *pSmSd);
+    iLog->Log(_L("manager->RegisterServiceDescriptionL( *pSmSd);"));
+    
+    CSenXmlServiceDescription* pScSd = CSenServicePattern::NewLC();
+    pScSd->SetFrameworkIdL(KFramework);
+    pScSd->SetContractL(KSdContract);
+    pScSd->SetEndPointL(KSdEndPoint);
+    pScSd->AsElement().AddElementL(_L8("ProviderID")).SetContentL(_L8("provider01"));
+    iLog->Log(_L("CSenXmlServiceDescription* pScSd = CSenXmlServiceDescription::NewLC();"));
+
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pScSd, *this);
+    iLog->Log(_L("Starting ----->StartActiveScheduler(1);"));
+    StartActiveScheduler(1);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("iServiceConnection = CSenServiceConnection::NewL(*this, *pScSd, *this);"));
+    
+    TBool isReady(EFalse);
+    TInt ret = iServiceConnection->IsReady(isReady);
+    if(isReady)
+    	{
+    	ret = iServiceConnection->SendL(*iSOAPMessage);
+
+			iLog->Log(_L("iServiceConnection->SendL(*iSOAPMessage);"));
+
+  	  StartActiveScheduler(1);	
+    	}
+    iLog->Log(_L("StartActiveScheduler(1);"));
+    
+    CleanupStack::PopAndDestroy(pScSd);
+    CleanupStack::PopAndDestroy(pSmSd);
+    CleanupStack::PopAndDestroy(idp);
+    CleanupStack::PopAndDestroy(manager);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    iCoBrandingCallbackOption = EFalse;
+    Teardown();
+    iLog->Log(_L("CoBrand->End"));
+    return KErrNone;
+    }
+
+TBool CSenServiceConnectionBCTest::OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId)
+    {
+    iLog->Log(_L("CSenServiceConnectionBCTest::OnGetBrandIdL()-----> Start"));
+    if(iCoBrandingCallbackOption && (aBrandIdListAsXmlSnippet != _L8("")))
+        {
+        iLog->Log(_L("CSenServiceConnectionBCTest::OnGetBrandIdL()True----->End "));  
+        return  ETrue;
+        }
+    else
+        {
+        iLog->Log(_L("CSenServiceConnectionBCTest::OnGetBrandIdL() False----->End "));  
+        return EFalse;
+        }  
+    }
+
+TInt CSenServiceConnectionBCTest::HostletConsumerL(TTestResult& aResult)
+    {
+    iLog->Log(_L("HostletConsumer->start"));
+    SetupL();
+    
+    iHostletConsumerOption = ETrue;
+         
+    TInt retVal(KErrNone);
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>");
+    _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001");
+    
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+    iSenXmlServiceDescription->SetEndPointL(KEndPoint);
+    
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("HostletConsumer->TL(iServiceConnection != (CSenServiceConnection*)NULL);"));
+    StartActiveScheduler(1);
+    iLog->Log(_L("HostletConsumer->CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);"));
+    
+    TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+    StartActiveScheduler(1);
+    
+     __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    iHostletConsumerOption = EFalse;
+    
+    Teardown();
+    iLog->Log(_L("HostletConsumer->End"));
+    }
+
+void CSenServiceConnectionBCTest::SetConnectionId( TInt aConnectionId )
+    {
+    TInt connectonId = 0;
+    connectonId = aConnectionId;
+    }
+
+TInt CSenServiceConnectionBCTest::DataTrafficDetailsL(TTestResult& aResult)
+    {
+    iLog->Log(_L("DataTrafficDetails->start"));
+    SetupL();
+    
+    iGetDataTrafficDetails = ETrue;
+         
+    TInt retVal(KErrNone);
+    _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>");
+    _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001");
+    
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID);    
+    iSenXmlServiceDescription->SetEndPointL(KEndPoint);
+    
+    iSOAPMessage = CSenSoapMessage::NewL(ESOAP11);
+    iSOAPMessage->SetBodyL(KReq);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    iLog->Log(_L("DataTrafficDetails->TL(iServiceConnection != (CSenServiceConnection*)NULL);"));
+    StartActiveScheduler(1);
+    iLog->Log(_L("DataTrafficDetails->CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription, *this);"));
+    
+    TInt ret = iServiceConnection->SendL(*iSOAPMessage);
+    StartActiveScheduler(1);
+    
+     __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSOAPMessage);
+    iSOAPMessage = NULL;    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    iGetDataTrafficDetails = EFalse;
+    
+    Teardown();
+    iLog->Log(_L("HostletConsumer->End"));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/testconsumer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include "testconsumer.h"
+
+ 	CTestConsumer* CTestConsumer::NewL()
+ 	{
+ 		CTestConsumer* pTest = new (ELeave) CTestConsumer();
+ 		return pTest;
+ 	}
+ 	CTestConsumer* CTestConsumer::NewLC()
+ 	{
+ 		CTestConsumer* pTest = new (ELeave) CTestConsumer();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestConsumer::CTestConsumer()
+ 	{
+ 		
+ 	}
+ 	void CTestConsumer::HandleMessageL(const TDesC8& aMessage) 
+ 	{
+ 	}
+	void CTestConsumer::HandleErrorL(const TInt aErrorCode, 
+                                  const TDesC8& aErrorMessage)
+	{
+	}
+ 	void CTestConsumer::SetStatus(const TInt aStatus)
+ 	{
+ 	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/testfileobserver.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include "testfileobserver.h"
+
+ 	CTestFileObserver* CTestFileObserver::NewL()
+ 	{
+ 		CTestFileObserver* pTest = new (ELeave) CTestFileObserver();
+ 		return pTest;
+ 	}
+ 	CTestFileObserver* CTestFileObserver::NewLC()
+ 	{
+ 		CTestFileObserver* pTest = new (ELeave) CTestFileObserver();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestFileObserver::CTestFileObserver()
+ 	{
+ 		
+ 	}
+ 	void CTestFileObserver::TransferProgress(TInt aTxnId , TBool aIncoming , const TDesC8& aMessage,
+            const TDesC8& aCid , TInt aProgress )
+  	{
+  	}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/testproperty.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "testproperty.h"
+#include <SenIdentityProvider.h>
+#include <e32base.h>
+
+ 	CTestProperty* CTestProperty::NewL()
+ 	{
+ 		CTestProperty* pTest = new (ELeave) CTestProperty();
+ 		return pTest;
+ 	}
+ 	CTestProperty* CTestProperty::NewLC()
+ 	{
+ 		CTestProperty* pTest = new (ELeave) CTestProperty();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestProperty::CTestProperty()
+ 	{
+ 		
+ 	}
+ 	
+ 	TPtrC8 CTestProperty::Name() 
+	{
+		return _L8("");
+	}
+	TPtrC8 CTestProperty::Type() 
+	{
+	return _L8("");
+	}
+	TPtrC8 CTestProperty::Value()
+	{
+	return _L8("");
+	}
+	TInt CTestProperty::IntValue(TInt& aValue) 
+	{
+	return KErrNone;
+	}
+	TInt CTestProperty::BoolValue(TBool& aValue) 
+	{
+	return KErrNone;	
+	}
+
+
+	TInt CTestProperty::ValueTokensL(const TDesC8& aDelimiter,
+	                              RPointerArray<TPtrC8>& aTokens) 
+	{
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/connection/src/testprovider.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "testprovider.h"
+#include <e32base.h>
+
+ 	CTestProvider* CTestProvider::NewL()
+ 	{
+ 		CTestProvider* pTest = new (ELeave) CTestProvider();
+ 		return pTest;
+ 	}
+ 	CTestProvider* CTestProvider::NewLC()
+ 	{
+ 		CTestProvider* pTest = new (ELeave) CTestProvider();
+ 		CleanupStack::PushL(pTest);
+ 		return pTest;
+ 	}
+ 	CTestProvider::CTestProvider()
+ 	{
+ 		
+ 	}
+
+	const CSenIdentityProvider* CTestProvider::IdentityProviderL() 
+	{
+		return NULL;
+	}
+	const TPtrC8 CTestProvider::UsernameL() 
+	{
+		return _L8("");
+	}
+	const TPtrC8 CTestProvider::PasswordL() 
+	{
+		return _L8("");
+	}
+	TAny* CTestProvider::ExtendedInterface(const TInt32 /* aUid */) 
+	{
+		 return NULL;
+	}
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for web_service_connection_api test source  
+*
+*/
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+../SenConnectionTimeoutsTester/group/SenConnectionTimeoutsTester.mmp
+../SenLayeredPropertiesTester/group/SenLayeredPropertiesTester.mmp 
+../senutilsTestCases/group/senutilsTestCases.mmp
+../wsPolicyTester/group/wsPolicyTester.mmp
+../WsStarMessageHandlerTester/group/WsStarMessageHandlerTester.mmp
+../wsstarPluginTester/group/wsstarPluginTester.mmp
+../senConnectionTester/group/senConnectionTester.mmp
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/Bmarm/senConnectionTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/Bwins/senConnectionTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/conf/senConnectionTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,399 @@
+[Test]
+title RegisterIdentityProviderL_CSenServiceConnection_RegisterIdentityProviderL
+create SenConnectionTester obj 
+obj RegisterIdentityProviderL_CSenServiceConnection_RegisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-contracttest_CSenServiceConnection_NewLcontract
+create SenConnectionTester obj 
+obj NewL-contracttest_CSenServiceConnection_NewLcontract 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Pattern,IAP1Test_CSenServiceConnection_SendL,Pattern,IAP1Test
+create SenConnectionTester obj 
+obj SendL,Pattern,IAP1Test_CSenServiceConnection_SendL,Pattern,IAP1Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Pattern,IAP2Test_CSenServiceConnection_SendL,Pattern,IAP2Test
+create SenConnectionTester obj 
+obj SendL,Pattern,IAP2Test_CSenServiceConnection_SendL,Pattern,IAP2Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Pattern,IAP3Test_CSenServiceConnection_SendL,Pattern,IAP3Test
+create SenConnectionTester obj 
+obj SendL,Pattern,IAP3Test_CSenServiceConnection_SendL,Pattern,IAP3Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-contracttest_CSenServiceConnection_NewLCcontract
+create SenConnectionTester obj 
+obj NewLC-contracttest_CSenServiceConnection_NewLCcontract 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-descriptiontestforWS-I_CSenServiceConnection_NewLdescriptionforWS-I
+create SenConnectionTester obj 
+obj NewL-descriptiontestforWS-I_CSenServiceConnection_NewLdescriptionforWS-I 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-descriptiontestforWS-I_CSenServiceConnection_NewLCdescriptionforWS-I
+create SenConnectionTester obj 
+obj NewLC-descriptiontestforWS-I_CSenServiceConnection_NewLCdescriptionforWS-I 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-descriptiontestforID-WSF_CSenServiceConnection_NewLdescriptionforID-WSF
+create SenConnectionTester obj 
+obj NewL-descriptiontestforID-WSF_CSenServiceConnection_NewLdescriptionforID-WSF 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-descriptiontestforID-WSF_CSenServiceConnection_NewLCdescriptionforID-WSF
+create SenConnectionTester obj 
+obj NewLC-descriptiontestforID-WSF_CSenServiceConnection_NewLCdescriptionforID-WSF 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-patterntestforWS-I_CSenServiceConnection_NewLpatternforWS-I
+create SenConnectionTester obj 
+obj NewL-patterntestforWS-I_CSenServiceConnection_NewLpatternforWS-I 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-patterntestforWS-I_CSenServiceConnection_NewLCpatternforWS-I
+create SenConnectionTester obj 
+obj NewLC-patterntestforWS-I_CSenServiceConnection_NewLCpatternforWS-I 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-patterntestforID-WSF_CSenServiceConnection_NewLpatternforID-WSF
+create SenConnectionTester obj 
+obj NewL-patterntestforID-WSF_CSenServiceConnection_NewLpatternforID-WSF 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-patterntestforID-WSF_CSenServiceConnection_NewLCpatternforID-WSF
+create SenConnectionTester obj 
+obj NewLC-patterntestforID-WSF_CSenServiceConnection_NewLCpatternforID-WSF 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL-noerrortest_CSenServiceConnection_SendLnoerror
+create SenConnectionTester obj 
+obj SendL-noerrortest_CSenServiceConnection_SendLnoerror 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL-canceltest_CSenServiceConnection_SendLnoerror
+create SenConnectionTester obj 
+obj SendL-canceltest_CSenServiceConnection_SendLnoerror 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL-connectionisnotinitializedtest_CSenServiceConnection_SendLconnectionisnotinitialized
+create SenConnectionTester obj 
+obj SendL-connectionisnotinitializedtest_CSenServiceConnection_SendLconnectionisnotinitialized 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL-MultipleMessages_CSenServiceConnection_SendLMultipleMessages
+create SenConnectionTester obj 
+obj SendL-MultipleMessages_CSenServiceConnection_SendLMultipleMessages 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Get,Post1Test_CSenServiceConnection_SendL,Get,Post1Test
+create SenConnectionTester obj 
+obj SendL,Get,Post1Test_CSenServiceConnection_SendL,Get,Post1Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Get,Post2Test_CSenServiceConnection_SendL,Get,Post2Test
+create SenConnectionTester obj 
+obj SendL,Get,Post2Test_CSenServiceConnection_SendL,Get,Post2Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Post,Proxy1Test_CSenServiceConnection_SendL,Post,Proxy1Test
+create SenConnectionTester obj 
+obj SendL,Post,Proxy1Test_CSenServiceConnection_SendL,Post,Proxy1Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,Post,Proxy2Test_CSenServiceConnection_SendLconnectionisnotinitialized
+create SenConnectionTester obj 
+obj SendL,Post,Proxy2Test_CSenServiceConnection_SendLconnectionisnotinitialized 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,ContentType1Test_CSenServiceConnection_SendL,ContentType1Test
+create SenConnectionTester obj 
+obj SendL,ContentType1Test_CSenServiceConnection_SendL,ContentType1Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,ContentType2Test_CSenServiceConnection_SendL,ContentType2Test
+create SenConnectionTester obj 
+obj SendL,ContentType2Test_CSenServiceConnection_SendL,ContentType2Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,UserAgent1Test_CSenServiceConnection_SendL,UserAgent1Test
+create SenConnectionTester obj 
+obj SendL,UserAgent1Test_CSenServiceConnection_SendL,UserAgent1Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,UserAgent2Test_CSenServiceConnection_SendL,UserAgent2Test
+create SenConnectionTester obj 
+obj SendL,UserAgent2Test_CSenServiceConnection_SendL,UserAgent2Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,MessageSoapActionTest_CSenServiceConnection_SendL,MessageSoapActionTest
+create SenConnectionTester obj 
+obj SendL,MessageSoapActionTest_CSenServiceConnection_SendL,MessageSoapActionTest 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,SoapAction1Test_CSenServiceConnection_SendL,SoapAction1Test
+create SenConnectionTester obj 
+obj SendL,SoapAction1Test_CSenServiceConnection_SendL,SoapAction1Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,SoapAction2Test_CSenServiceConnection_SendL,SoapAction2Test
+create SenConnectionTester obj 
+obj SendL,SoapAction2Test_CSenServiceConnection_SendL,SoapAction2Test 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,CustomHttpHeaderTest_CSenServiceConnection_SendL,CustomHttpHeaderTest
+create SenConnectionTester obj 
+obj SendL,CustomHttpHeaderTest_CSenServiceConnection_SendL,CustomHttpHeaderTest 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_SendL,TPboundariesTest
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_SendL,TPboundariesTest 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPboundariesTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPboundariesTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPSecDialogTest_CSenServiceConnection_SendLconnectionisnotinitialized
+create SenConnectionTester obj 
+obj SendL,TPSecDialogTest_CSenServiceConnection_SendLconnectionisnotinitialized 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPOmittedTrueTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPOmittedTrueTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPOmittedFalseTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPOmittedFalseTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPRemovedTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPRemovedTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SendL,TPOmit/RemTest_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SendL,TPOmit/RemTest_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SubmitL,LibXml2_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SubmitL,LibXml2_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SubmitL,LibXml2+props_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SubmitL,LibXml2+props_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SubmitL,BLOB20KB_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SubmitL,BLOB20KB_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SubmitL,BLOB200KB_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SubmitL,BLOB200KB_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SubmitL,BLOBless1MB_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SubmitL,BLOBless1MB_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title SubmitL,BLOBmore1MB_CSenServiceConnection_
+create SenConnectionTester obj 
+obj SubmitL,BLOBmore1MB_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-Basiccase_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-Basiccase_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-ReUseCredential_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-ReUseCredential_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-AuthCallbacksuccess_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-AuthCallbacksuccess_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-AuthCallbackfail_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-AuthCallbackfail_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-UserInfoPrompt_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-UserInfoPrompt_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-showprompt_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-showprompt_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
+[Test]
+title MSN-Invalidpassword_CSenServiceConnection_
+create SenConnectionTester obj 
+obj MSN-Invalidpassword_CSenServiceConnection_ 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/eabi/senConnectionTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Build specification file for SenConectionTester
+*
+*/
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+senConnectionTester.mmp
+
+PRJ_MMPFILES
+//senConnectionTester_nrm.mmp
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/group/senConnectionTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          senConnectionTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         senConnectionTester.def
+#ifdef EKA2
+    EPOCALLOWDLLDATA
+#endif
+
+// Enables Nokia intra hosted AB service endpoint to be used:
+MACRO           VALIMO_ADDRESSBOOK_SERVICE 
+SOURCEPATH      ../src
+SOURCE          senConnectionTester.cpp
+SOURCE          senConnectionTesterBlocks.cpp
+        
+USERINCLUDE     ../src
+USERINCLUDE     ../inc
+
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+
+SYSTEMINCLUDE   /epoc32/include/libc
+SYSTEMINCLUDE   /epoc32/include/libc/sys
+
+SYSTEMINCLUDE   ../../../../../webservices/wsutils/inc
+
+USERINCLUDE     ../../../../../webservices/inc
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         flogger.lib
+
+LIBRARY         apparc.lib 
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         eikcoctl.lib 
+LIBRARY         avkon.lib 
+LIBRARY         bafl.lib 
+LIBRARY         eikctl.lib
+LIBRARY         egul.lib 
+LIBRARY         fbscli.lib 
+LIBRARY         PBKENG.LIB 
+LIBRARY         cntmodel.lib 
+LIBRARY         aknskins.lib //for skin sbackground
+LIBRARY         gdi.lib
+
+LIBRARY         ecom.lib
+LIBRARY         commdb.lib
+LIBRARY         efsrv.lib
+LIBRARY         estor.lib
+LIBRARY					StifTestInterface.lib
+LIBRARY         XMLFRAMEWORK.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY         SenServConn.lib
+LIBRARY         SenServMgr.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenXml.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenMessages.lib
+#else 
+// for .SIS target
+LIBRARY         wsServConn.lib
+LIBRARY         wsServMgr.lib
+LIBRARY         wsServDesc.lib
+LIBRARY         wsXml.lib
+LIBRARY         wsUtils.lib
+LIBRARY         wsMessages.lib
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/group/senConnectionTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,56 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+;
+; Installation file for STIF
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\senConnectionTester.dll"   -   "c:\Sys\Bin\senConnectionTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\senConnectionTester.cfg"-"c:\testing\conf\senConnectionTester.cfg"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/inc/senConnectionTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,396 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+#ifndef SENCONNECTIONTESTER_H
+#define SENCONNECTIONTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <MSenServiceConsumer.h>
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenXmlReader.h>
+#include <SenServiceConnection.h>
+#include <f32file.h>
+#include <e32base.h> // for CActivef
+#include <e32std.h>
+#include <unistd.h>
+#include <e32def.h>
+#include <aknnotewrappers.h> 
+
+//  INTERNAL INCLUDES
+namespace
+    {
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    }
+
+enum TUT_CSenServiceConnection
+    {
+    ENotInitialized = 1,
+    EConnectionNotReady,
+    };
+    
+enum TMSCommands
+    {
+    EMSNMessengerRegister,
+    EMSNMessengerInvite,
+    EMSNMessengerSend,
+    EMSNMessengerUnRegister,
+    };
+
+//  FORWARD DECLARATIONS
+class CSenBaseFragment;
+class CSenBaseElement;
+class CSenSoapEnvelope;
+class SenXmlUtils;
+class CSenServiceConnection;
+class CSenXmlReader;
+class CSenDomFragment;
+class CSenXmlServiceDescription;
+class CSenServicePattern;
+class CSenServiceManager;
+class CSenSoapMessage;
+class CSenSoapMessage2;
+class CSenVtcpTransportProperties;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KsenConnectionTesterLogPath, "\\logs\\testframework\\senConnectionTester\\" ); 
+// Log file
+_LIT( KsenConnectionTesterLogFile, "senConnectionTester.txt" ); 
+_LIT( KsenConnectionTesterLogFileWithTitle, "senConnectionTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CsenConnectionTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+typedef TInt (CsenConnectionTester::* TestFunction)(TTestResult&);
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CsenConnectionTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+
+NONSHARABLE_CLASS(CsenConnectionTester) : public CScriptBase, public MSenServiceConsumer, public MSenAuthenticationProvider, public MSenExtendedConsumerInterface
+    {
+    public:
+        enum TCallback
+            {
+            ECallbackNone = 0,
+            ECallbackHandleMessage,
+            ECallbackHandleError
+            };
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CsenConnectionTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CsenConnectionTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CsenConnectionTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        void CsenConnectionTester::HandleMessageL(const TDesC8& aMessage);        
+        void CsenConnectionTester::HandleErrorL(const int aErrorCode, const TDesC8& aError);
+        void CsenConnectionTester::SetStatus(const TInt aStatus);
+
+        void CsenConnectionTester::SetupL();
+
+        void CsenConnectionTester::Teardown();
+
+        void CsenConnectionTester::ErrorL(TInt aCode);
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_RegisterIdentityProviderLL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_ContractL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_ContractL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_WS_I_DescriptionL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_WS_I_PatternL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_WS_I_PatternL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_ID_WSF_PatternL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_NoErrorL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_CancelL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ConNotInitialL(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendMultipleMessagesL(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Get_Post1L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Get_Post2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Proxy1L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Proxy2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP1L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP3L(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ContentType1L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ContentType2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_UserAgent1L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_UserAgent2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_MessageSoapActionL(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_SoapAction1L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_SoapAction2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_CustomHttpHeaderL(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ConBusyL(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ConInitializingL(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ConExpiredL(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ErrSubmitL(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ErrNoMemoryL(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitLL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_IsReadyL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_HasFacetLL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_CompleteServerMessagesOnOffL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_1L();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_1L();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_StartTransactionL();
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TransactionCompletedL();
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries1(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries2(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries3(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries4(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries5(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries6(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries7(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries8(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries9(  );
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_SecDialog();     
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Omitted_True();     
+
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Omitted_False();           
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Removed();     
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Omit_Rem();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_L();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL();
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessengerL(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger2L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger3L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger4L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger5L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger6L(  );
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger7L(  );
+        
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Custom_Header(const TDesC8& KCustomHttpHeader,
+                                                       const TDesC8& KCustomHttpHeaderValue);
+                                    
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Send(const TDesC8& aLogFileName,
+                                              const TDesC8& aCustomHttpHeader,
+                                              const TDesC8& aCustomHttpHeaderValue,
+                                              CSenServiceConnection* iServiceConnection);
+                                              
+        TInt CsenConnectionTester::UT_CSenServiceConnection_TP_CheckLogs(const TDesC& aLogFilePath,
+                                                   const TDesC8& aCustomHttpHeader,
+                                                   const TDesC8& aCustomHttpHeaderValue);                                    
+                                                   
+        TUint32 CsenConnectionTester::SearchIAPIdByNameL( const TDesC& aIAPName );
+        
+        CSenSoapMessage* CsenConnectionTester::CreateAuthRequestLC();
+        
+        CSenSoapMessage2* CsenConnectionTester::CreateNewAuthRequestLC();
+        
+        HBufC8* CsenConnectionTester::ReadFileL(const TDesC& aFilename);
+        
+        TInt CsenConnectionTester::Find(const TDesC8& aDestination, const TDesC8& aDescToFind, TInt aStartingPos);
+        TBool CsenConnectionTester::ReplaceAll(TPtr8 aDestination, const TDesC8& aFrom, const TDesC8& aTo);
+        TBool CsenConnectionTester::DecodeHttpCharactersL(const TDesC8& aOriginal, HBufC8*& aDecoded);
+        
+        HBufC8* CsenConnectionTester::HttpMethodValueFromXmlLC(const TDesC8& aXml);
+        
+        HBufC8* CsenConnectionTester::HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                           const TDesC8& aPropertyName);
+                                           
+        void CsenConnectionTester::StartActiveScheduler(TInt aNumberOfSentMessages);
+        void CsenConnectionTester::StopActiveScheduler();
+        
+        CSenVtcpTransportProperties* CsenConnectionTester::CreateMSTransportPropertiesL(TMSCommands aCommand);
+        CSenSoapMessage2* CsenConnectionTester::CreateMSSoapMessage(TMSCommands aCommand);
+        void CsenConnectionTester::RegisterSTSL();
+        void CsenConnectionTester::RegisterSTSInvalidPasswordL();
+        void CsenConnectionTester::UnregisterSTSL();
+        void CsenConnectionTester::SetPolicyL(CSenXmlServiceDescription* pServDesc, const TDesC8& pName,
+                                                              const TDesC8& pValue);
+        void CsenConnectionTester::CreateConnectionToMessengerServiceL();
+        void CsenConnectionTester::CreateConnectionToMessengerServiceWithoutCallbackL();
+        
+        void CsenConnectionTester::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage);
+        void CsenConnectionTester::AddApplicationHeader2L(CSenSoapMessage2& aMessage);
+        TAny* CsenConnectionTester::GetInterfaceByUid( TUid aUID );
+        const CSenIdentityProvider* IdentityProviderL() const ;
+
+    private:    // Data
+        
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenXmlServiceDescription*  iSession;
+        CSenServiceConnection*      iServiceConnection;
+        CSenServiceManager*         iManager;
+        CSenXmlReader*              iXmlReader;
+        
+        TInt                        iTransactionId;
+        TInt                        iConnectionState;
+        TBool                       iInitialized;
+        TBool                       iReady;
+        
+        TCallback                   iCallback;
+        HBufC8*                     ipMessage;
+        
+        TInt                        iNumberOfPendingOps;
+        HBufC8*                     ipFrameworkID;
+        
+        TInt                        iErrorCode;
+  
+        CSenIdentityProvider*       ipProviderForAuthProvider;
+        TInt                        iAuthInfoAskCounter;
+        
+
+
+    };
+
+#endif      // SENCONNECTIONTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,179 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\senConnectionTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/src/senConnectionTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senConnectionTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenConnectionTester::CsenConnectionTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CsenConnectionTester::CsenConnectionTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CsenConnectionTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CsenConnectionTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KsenConnectionTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KsenConnectionTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KsenConnectionTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CsenConnectionTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CsenConnectionTester* CsenConnectionTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CsenConnectionTester* self = new (ELeave) CsenConnectionTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CsenConnectionTester::~CsenConnectionTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CsenConnectionTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CsenConnectionTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("senConnectionTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CsenConnectionTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senConnectionTester/src/senConnectionTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,5584 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "senConnectionTester.h"
+
+//  EXTERNAL INCLUDES
+#include <http.h>
+#include <httperr.h>
+
+#include <SenBaseFragment.h>
+#include <SenBaseElement.h>
+#include <SenDomFragment.h>
+#include <SenServiceConnection.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenSoapEnvelope2.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenXmlUtils.h>
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenHttpTransportProperties.h>
+#include <SenSoapMessage.h>
+#include <SenSoapMessage2.h>
+#include <SenDateUtils.h>
+#include <SenTransportProperties.h>
+
+#include <senvtcptransportproperties.h>
+
+#include <xmlengchunkcontainer.h>
+#include <xmlengfilecontainer.h>
+#include <xmlengserializer.h>
+
+#include <e32base.h> // for CActive
+#include <aknnotewrappers.h> 
+
+#include <commdb.h>
+
+#include <s32file.h>    // filestream
+#include <e32svr.h>     // fileman
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+namespace 
+    {
+        
+#ifdef AOL_RADIO_SERVICE
+    // AOL redio.etenee.net:9080
+    _LIT8(KWSPContract,         "urn:aol-com:services:radio");
+    _LIT8(KAuthServEndpoint,    "http://radio.etenee.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://radio.etenee.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#elif VALIMO_ADDRESSBOOK_SERVICE
+    // Addressbook service hosted inside Nokia intra by ASP / testing team
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://10.21.32.110/tfs/IDPSSO_IDWSF10");
+    _LIT8(KASProviderID,        "provider01");
+    _LIT8(KTestAuthzID,         "john");
+    _LIT8(KTestPassword,        "password");
+#elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAuthServEndpoint,    "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://ys01liw022.partner.yomi.com:9080/tfs/");
+    _LIT8(KTestAuthzID,         "012345678901234");
+    _LIT8(KTestPassword,        "012345678901234");
+#else // == default (no MACROs defined in .mmp)
+    // Addressbook service hosted by Forum Nokia (accessible from external network)
+    _LIT8(KWSPContract,         "urn:nokia:test:addrbook:2004-09"); 
+    _LIT8(KAuthServEndpoint,    "http://selma.ndhub.net:9080/tfs/IDPSSO_IDWSF");
+    _LIT8(KASProviderID,        "http://selma.ndhub.net:9080/tfs/");
+    _LIT8(KTestAuthzID,         "testuser1");
+    _LIT8(KTestPassword,        "testuser1");
+#endif // FN_ADDRESSBOOK_SERVICE
+
+
+    _LIT8(KASContract,              "urn:liberty:as:2004-04");
+    _LIT8(KHttpsEndPoint,           "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" );    
+    
+    _LIT8(KWSIFrameworkID,          "WS-I");
+    _LIT8(KIDWSFFrameworkID,        "ID-WSF");
+    _LIT8(KRESTFrameworkID,         "REST");       
+//    _LIT8(KWsStarFrameworkID,       "WS-STAR");       
+#ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT8(KAddressBookServiceId,    "http://radio.aol.com/xsd/2.0/ns/");
+    _LIT8(KAddressBookContract,     "http://radio.aol.com/xsd/2.0/ns/");
+#else
+    _LIT8(KAddressBookServiceId,    "urn:nokia:test:addrbook:2004-09");
+    _LIT8(KAddressBookContract,     "urn:nokia:test:addrbook:2004-09");
+#endif
+    
+#ifdef __WINS__    
+  #ifdef SYSOPENDIGIA_ADDRESSBOOK_SERVICE
+    _LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+  #else
+    //_LIT(KIAPName,                  "Ethernet No Daemon Static IP");
+    _LIT(KIAPName,                  "Ethernet with Daemon Dynamic IP");
+  #endif
+#else
+// ARMv5
+    _LIT(KIAPName,                  "Internet");
+#endif  
+    _LIT8(KLoggerFileNameProperty,  "HttpLoggerFileName");
+
+    _LIT(KFileToRead,               "e:\\Logs\\LoggingHttpFilter\\httptrace.xml");
+    _LIT8(KFileName,                "httptrace.xml");
+
+    _LIT8(KHTTPMethodGet,           "GET");
+    _LIT8(KHTTPMethodPost,          "POST");
+    
+//    const TBool MultipleSimultanousRHttpSessionsSupported = EFalse;
+    // If IAP changes all previously sent messages will be canceled.
+    
+    
+    //_LIT8(KProxyHost,             "esprx00.nokia.com"); 
+    _LIT8(KProxyHost,               "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com
+    const TInt KProxyPort =         8080;
+
+    //MSN Constants :
+    //---------------
+    _LIT8(KPassportUser,        "m_minkkis@hotmail.com");
+    _LIT8(KPassportPass,        "M1nkk1s");
+
+    _LIT8(KStsEndpoint,         "https://login.live.com/rst2.srf");
+    _LIT8(KMSNProxy,            "tcp.mws.beta.mobile.live.com");
+    //_LIT8(KMetadataEndpoint,    "http://10.132.11.31/WSStar/secpolicy/secpol.xml");
+    _LIT8(KMetadataEndpoint, "https://http.mws.mobile.live.com/2006/10/MWP2007_02/SecurityPolicy/Default.aspx");   
+
+    _LIT8(KPolicyAdr,           "Addressing");
+    _LIT8(KPolicyMT,            "MetadataEndpoint");
+    _LIT8(KPolicyTLS,           "UsernameTokenOverTLS");
+    _LIT8(KPolicySOAP12,        "SOAP12");
+    _LIT8(KPolicyPassExt,       "PassportExtensions");
+    _LIT8(KProviderId,          "provider01");
+
+#ifdef OLD_MSN_NAMESPACE_2005_08
+    _LIT8(KMessagingEndpoint,   "tcp://schemas.live.com/mws/2005/08/messaging");
+    _LIT8(KMessagingContract,   "http://schemas.live.com/mws/2005/08/messaging");
+    _LIT8(KMessagingNameSpace,  "http://schemas.live.com/mws/2005/08/core");
+#else
+    _LIT8(KMessagingEndpoint,   "tcp://schemas.live.com/mws/2006/10/messaging");
+    _LIT8(KMessagingContract,   "http://schemas.live.com/mws/2006/10/messaging");
+    _LIT8(KMessagingNameSpace,  "http://schemas.live.com/mws/2006/10/core");
+#endif
+    }
+
+// MACROS
+//#define ?macro ?macro_def
+#define STIFF_ASSERT_NOT_EQUALS_DESC(expression1, expression2, desc) \
+	{TL((expression1) != (expression2)){RDebug::Print(_L(desc)) ;}}
+
+#define STIFF_ASSERT_DESC(expression, desc)	{if(!(expression)){RDebug::Print(_L(desc)) ;return KErrArgument;}}
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenConnectionTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CsenConnectionTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenConnectionTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CsenConnectionTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("RegisterIdentityProviderL_CSenServiceConnection_RegisterIdentityProviderL",CsenConnectionTester::UT_CSenServiceConnection_RegisterIdentityProviderLL),
+		ENTRY("NewL-contracttest_CSenServiceConnection_NewLcontract",CsenConnectionTester::UT_CSenServiceConnection_NewL_ContractL),
+		ENTRY("SendL,Pattern,IAP1Test_CSenServiceConnection_SendL,Pattern,IAP1Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP1L),
+		ENTRY("SendL,Pattern,IAP2Test_CSenServiceConnection_SendL,Pattern,IAP2Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP2L),
+		ENTRY("SendL,Pattern,IAP3Test_CSenServiceConnection_SendL,Pattern,IAP3Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP3L),
+		ENTRY("NewLC-contracttest_CSenServiceConnection_NewLCcontract",CsenConnectionTester::UT_CSenServiceConnection_NewLC_ContractL),
+		ENTRY("NewL-descriptiontestforWS-I_CSenServiceConnection_NewLdescriptionforWS-I",CsenConnectionTester::UT_CSenServiceConnection_NewL_WS_I_DescriptionL),
+		ENTRY("NewLC-descriptiontestforWS-I_CSenServiceConnection_NewLCdescriptionforWS-I",CsenConnectionTester::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL),
+		ENTRY("NewL-descriptiontestforID-WSF_CSenServiceConnection_NewLdescriptionforID-WSF",CsenConnectionTester::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL),
+		ENTRY("NewLC-descriptiontestforID-WSF_CSenServiceConnection_NewLCdescriptionforID-WSF",CsenConnectionTester::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL),
+		ENTRY("NewL-patterntestforWS-I_CSenServiceConnection_NewLpatternforWS-I",CsenConnectionTester::UT_CSenServiceConnection_NewL_WS_I_PatternL),
+		ENTRY("NewLC-patterntestforWS-I_CSenServiceConnection_NewLCpatternforWS-I",CsenConnectionTester::UT_CSenServiceConnection_NewLC_WS_I_PatternL),
+		ENTRY("NewL-patterntestforID-WSF_CSenServiceConnection_NewLpatternforID-WSF",CsenConnectionTester::UT_CSenServiceConnection_NewL_ID_WSF_PatternL),
+		ENTRY("NewLC-patterntestforID-WSF_CSenServiceConnection_NewLCpatternforID-WSF",CsenConnectionTester::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL),
+		ENTRY("SendL-noerrortest_CSenServiceConnection_SendLnoerror",CsenConnectionTester::UT_CSenServiceConnection_SendL_NoErrorL),
+		ENTRY("SendL-canceltest_CSenServiceConnection_SendLnoerror",CsenConnectionTester::UT_CSenServiceConnection_SendL_CancelL),
+		ENTRY("SendL-connectionisnotinitializedtest_CSenServiceConnection_SendLconnectionisnotinitialized",CsenConnectionTester::UT_CSenServiceConnection_SendL_ConNotInitialL),
+		ENTRY("SendL-MultipleMessages_CSenServiceConnection_SendLMultipleMessages",CsenConnectionTester::UT_CSenServiceConnection_SendMultipleMessagesL),
+		ENTRY("SendL,Get,Post1Test_CSenServiceConnection_SendL,Get,Post1Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_Get_Post1L),
+		ENTRY("SendL,Get,Post2Test_CSenServiceConnection_SendL,Get,Post2Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_Get_Post2L),
+		ENTRY("SendL,Post,Proxy1Test_CSenServiceConnection_SendL,Post,Proxy1Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_Proxy1L),
+		ENTRY("SendL,Post,Proxy2Test_CSenServiceConnection_SendLconnectionisnotinitialized",CsenConnectionTester::UT_CSenServiceConnection_SendL_Proxy2L),
+		ENTRY("SendL,ContentType1Test_CSenServiceConnection_SendL,ContentType1Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_ContentType1L),
+		ENTRY("SendL,ContentType2Test_CSenServiceConnection_SendL,ContentType2Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_ContentType2L),
+		ENTRY("SendL,UserAgent1Test_CSenServiceConnection_SendL,UserAgent1Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_UserAgent1L),
+		ENTRY("SendL,UserAgent2Test_CSenServiceConnection_SendL,UserAgent2Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_UserAgent2L),
+		ENTRY("SendL,MessageSoapActionTest_CSenServiceConnection_SendL,MessageSoapActionTest",CsenConnectionTester::UT_CSenServiceConnection_SendL_MessageSoapActionL),
+		ENTRY("SendL,SoapAction1Test_CSenServiceConnection_SendL,SoapAction1Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_SoapAction1L),
+		ENTRY("SendL,SoapAction2Test_CSenServiceConnection_SendL,SoapAction2Test",CsenConnectionTester::UT_CSenServiceConnection_SendL_SoapAction2L),
+		ENTRY("SendL,CustomHttpHeaderTest_CSenServiceConnection_SendL,CustomHttpHeaderTest",CsenConnectionTester::UT_CSenServiceConnection_SendL_CustomHttpHeaderL),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_SendL,TPboundariesTest",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries1),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries2),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries3),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries4),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries5),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries6),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries7),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries8),
+		ENTRY("SendL,TPboundariesTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries9),
+		ENTRY("SendL,TPSecDialogTest_CSenServiceConnection_SendLconnectionisnotinitialized",CsenConnectionTester::UT_CSenServiceConnection_TP_SecDialog),
+		ENTRY("SendL,TPOmittedTrueTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Omitted_True),
+		ENTRY("SendL,TPOmittedFalseTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Omitted_False),
+		ENTRY("SendL,TPRemovedTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Removed),
+		ENTRY("SendL,TPOmit/RemTest_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TP_Omit_Rem),
+		ENTRY("SubmitL,LibXml2_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_L),
+		ENTRY("SubmitL,LibXml2+props_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L),
+		ENTRY("SubmitL,BLOB20KB_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL),
+		ENTRY("SubmitL,BLOB200KB_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL),
+		ENTRY("SubmitL,BLOBless1MB_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL),
+		ENTRY("SubmitL,BLOBmore1MB_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL),
+		ENTRY("MSN-Basiccase_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessengerL),
+		ENTRY("MSN-ReUseCredential_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessenger2L),
+		ENTRY("MSN-AuthCallbacksuccess_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessenger3L),
+		ENTRY("MSN-AuthCallbackfail_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessenger4L),
+		ENTRY("MSN-UserInfoPrompt_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessenger5L),
+		ENTRY("MSN-showprompt_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessenger6L),
+		ENTRY("MSN-Invalidpassword_CSenServiceConnection_",CsenConnectionTester::UT_CSenServiceConnection_TestMessenger7L),
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+//  METHODS
+// -----------------------------------------------------------------------------
+void CsenConnectionTester::HandleMessageL(const TDesC8& aMessage)
+    {
+    iCallback = ECallbackHandleMessage;
+    if ( ipMessage )
+        {
+        delete ipMessage;
+        ipMessage = NULL;
+        }
+    ipMessage = aMessage.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+
+    StopActiveScheduler();
+    }
+
+void CsenConnectionTester::HandleErrorL(const int aErrorCode, const TDesC8& aError)
+    {
+    iCallback = ECallbackHandleError;
+    iErrorCode = aErrorCode;
+    
+    // debugging only - START
+    if( HTTPStatus::IsInformational( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EContinue) && (aStatus < HTTPStatus::EOk))
+        RDebug::Print(_L("- HTTP error code: IS INFORMATION."));
+        }
+    if( HTTPStatus::IsSuccessful( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EOk) && (aStatus < HTTPStatus::EMultipleChoices))
+        RDebug::Print(_L("- HTTP error code: IS SUCCESSFUL."));
+        }
+    if( HTTPStatus::IsRedirection( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EMultipleChoices) && (aStatus < HTTPStatus::EBadRequest))
+        RDebug::Print(_L("- HTTP error code: IS REDIRECTION."));
+        }
+    if( HTTPStatus::IsClientError( this->iErrorCode ) )
+        {
+        // if((aStatus >= HTTPStatus::EBadRequest) && (aStatus < HTTPStatus::EInternalServerError))
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }
+    if( HTTPStatus::IsServerError( this->iErrorCode ) )
+        {
+        // if(aStatus >= HTTPStatus::EInternalServerError)
+        RDebug::Print(_L("- HTTP error code: IS CLIENT ERROR."));
+        }    
+    // debuggin only - END
+    
+    if ( ipMessage )
+        {
+        delete ipMessage;
+        ipMessage = NULL;
+        }
+    ipMessage = aError.AllocL();
+    iTransactionId = iServiceConnection->TxnId();
+    
+    TBuf<70> errorMessage;
+    _LIT(KErrNotInitialized, "Connection isn't initialized.");
+    
+    switch(aErrorCode) 
+        {
+        case KErrSubmitting:
+            errorMessage = KErrNotInitialized;
+            break;
+        default:
+            break;
+        }   
+
+    StopActiveScheduler();
+    }
+
+void CsenConnectionTester::ErrorL(TInt aCode)
+    {
+    _LIT(KNotReady, "Connection is not ready.");
+    
+    TBuf<70> errorMessage;
+    switch(aCode) 
+        {
+        case EConnectionNotReady:
+            errorMessage = KNotReady;
+            break;
+        default:
+            break;
+        }
+    }
+
+void CsenConnectionTester::SetStatus(const TInt aStatus)
+    {
+    switch(aStatus)
+        {
+        case KSenConnectionStatusNew:
+            break;
+        case KSenConnectionStatusReady:
+            iInitialized = ETrue;
+            break;
+        case KSenConnectionStatusExpired:
+            break;
+        default:
+            TBuf<32> num;
+            num.AppendNum(aStatus);
+            break;
+        }
+    if ( aStatus >= KSenConnectionStatusCreateFailed && aStatus <= KSenConnectionStatusMetadataExchange )
+        {
+        iConnectionState = aStatus;
+        if(!iInitialized)
+            {
+            TInt leaveCode(KErrNone);
+            TRAP(leaveCode, ErrorL(EConnectionNotReady));
+            leaveCode = 0; // not used
+            }
+        StopActiveScheduler();
+        }
+    }
+
+void CsenConnectionTester::SetupL(  )
+    {
+    __UHEAP_MARK;
+
+    RFile file;
+    RFs iFsSession;
+    _LIT(KFileName,"e:\\testing\\data\\rest.on");
+    
+   
+    User::LeaveIfError(iFsSession.Connect());
+        
+    TInt fileOP = file.Open(iFsSession,KFileName,EFileRead);
+    if (fileOP == KErrNone) 
+        {
+        RDebug::Print(_L( "Found rest.on file => using RESTful framework" ) ); 
+        file.Close();
+        ipFrameworkID = HBufC8::NewL(KRESTFrameworkID().Length());
+        ipFrameworkID->Des().Append(KRESTFrameworkID);
+        }
+    else
+        {
+        RDebug::Print(_L( "File rest.on not found => defaulting to WS-I" ) ); 
+        ipFrameworkID = HBufC8::NewL(KWSIFrameworkID().Length());
+        ipFrameworkID->Des().Append(KWSIFrameworkID);
+        }
+    iFsSession.Close();
+    
+    iCallback = ECallbackNone;
+    }
+
+void CsenConnectionTester::Teardown(  )
+    {
+    delete ipFrameworkID;
+    ipFrameworkID = NULL;
+    delete ipMessage;
+    ipMessage = NULL;
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    __UHEAP_MARKEND;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_RegisterIdentityProviderLL()
+    {
+    iManager = CSenServiceManager::NewL();
+    STIFF_ASSERT_NOT_EQUALS_DESC(iManager, (CSenServiceManager*)NULL, "The test is failed.");
+
+    CSenIdentityProvider* idp = CSenIdentityProvider::NewLC(
+        KAuthServEndpoint, KASContract);
+
+    // Set the Provider ID
+    idp->SetProviderID(KASProviderID);
+
+    // Associate Forum Nokia's Addressbook service ID (contract)
+    // to this Identity Provider
+    idp->SetServiceID(KWSPContract);
+
+    // Set Liberty ID-WSF framework ID
+    idp->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+
+    // ------------------------------------------------------------------------
+    // The following username/password properties will be used for
+    // authentication. Please note, that use advisory authentication
+    // id "IMEI" would result device ID to be directly fetched from phone.
+    // ------------------------------------------------------------------------
+    //
+    
+#if SYSOPENDIGIA_ADDRESSBOOK_SERVICE    
+    idp->SetUserInfoL(KNullDesC8, KTestAuthzID, KTestPassword);
+#else
+    idp->SetUserInfoL(KTestAuthzID, KNullDesC8, KTestPassword);
+#endif    
+    
+    TL((iManager->RegisterIdentityProviderL(*idp)) == KErrNone);
+    TL((iManager->RegisterServiceDescriptionL(*idp)) == KErrNone);
+
+    CleanupStack::PopAndDestroy(idp); 
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete iManager);
+    iManager = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_ContractL(  )
+    {
+        iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookContract);
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_ContractL(  )
+    {
+    iServiceConnection = CSenServiceConnection::NewLC(*this, KAddressBookContract);
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL(iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CleanupStack::Pop(iServiceConnection);
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_WS_I_DescriptionL(  )
+    {
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      "Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_WS_I_DescriptionL(  )
+    {
+    // Only Endpoint and FrameworkId needs to be defined in WS-I case.
+    // There is no need to define Contract. => KNullDesC8 is passed as a Contract.
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(KAuthServEndpoint, KNullDesC8());
+    iSenXmlServiceDescription->SetFrameworkIdL(*ipFrameworkID);    
+    
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      "Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(iServiceConnection);
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_ID_WSF_DescriptionL(  )
+    {
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      "Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_ID_WSF_DescriptionL(  )
+    {
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      "Could not initialize ServiceConnection");
+    
+    CleanupStack::Pop(iServiceConnection);
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_WS_I_PatternL(  )
+    {
+    CSenServicePattern* pSenServicePattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //pSenServicePattern->SetContractL(KAuthServEndpoint);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pSenServicePattern);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      "Could not initialize ServiceConnection");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pSenServicePattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSenServicePattern);
+    pSenServicePattern = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_WS_I_PatternL(  )
+    {
+    CSenServicePattern* aSenServicePattern = CSenServicePattern::NewL(KAuthServEndpoint, KNullDesC8());
+    aSenServicePattern->SetFrameworkIdL(*ipFrameworkID);    
+    //aSenServicePattern->SetContractL(KAuthServEndpoint);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *aSenServicePattern);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_DESC(iConnectionState == KSenConnectionStatusReady,
+                      "Could not initialize ServiceConnection");
+
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    delete aSenServicePattern;
+    aSenServicePattern = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewL_ID_WSF_PatternL(  )
+    {
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAddressBookServiceId, KNullDesC8());
+    pPattern->SetFrameworkIdL(KIDWSFFrameworkID);    
+    pPattern->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pPattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pPattern);
+    pPattern = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_NewLC_ID_WSF_PatternL(  )
+    {
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAddressBookServiceId, KNullDesC8());
+    pPattern->SetFrameworkIdL(KIDWSFFrameworkID);    
+    pPattern->SetContractL(KAddressBookServiceId);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewLC(*this, *pPattern);
+    StartActiveScheduler(1);
+    
+    TL (iServiceConnection != (CSenServiceConnection*)NULL);
+    CleanupStack::Pop(); //iServiceConnection
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    
+    CleanupStack::Pop(pPattern);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pPattern);
+    pPattern = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_NoErrorL(  )
+    {
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = iServiceConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    StartActiveScheduler(1);
+
+    TL (iTransactionId == transactionIdOrError);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_CancelL(  )
+    {
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    StartActiveScheduler(1);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TInt transactionIdOrError = iServiceConnection->SendL(KRequest);
+    LOCAL_ASSERT(transactionIdOrError > KErrNone);
+    
+    iServiceConnection->CancelTransaction(transactionIdOrError);
+    
+    StartActiveScheduler(1);
+
+    TL (iTransactionId == transactionIdOrError);
+    LOCAL_ASSERT(iErrorCode == KErrSenCancelled);
+    
+    User::After(2000000);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription);
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ConNotInitialL(  )
+    {
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID);    
+    iSenXmlServiceDescription->SetContractL(KAddressBookServiceId);
+        
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    iSenXmlServiceDescription->SetIapIdL(iapId);
+
+    iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+    
+    STIFF_ASSERT_NOT_EQUALS_DESC(iServiceConnection,(CSenServiceConnection*)NULL, "The test is failed.");
+    
+    _LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[containts[ab:N/ab:FAMILY,\'Bob\'] or containts[ab:N/ab:GIVEN,\'Bob\'] or containts[ab:TEL,\'Bob\']]</ab:Select></ab:QueryItem></ab:Query>");
+
+    TL((iServiceConnection->SendL(KRequest)) == KErrSenNotInitialized);
+    StartActiveScheduler(1);
+    
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection);
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendMultipleMessagesL(  )
+    {
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Get (using SetTransportPropertiesL)
+    // ****************************************
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    
+    CleanupStack::PushL(pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    //CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    //pHttpProperties->SetOmittedL(KIapIdLocalName, ETrue);
+    //pSerializedProperties = pHttpProperties->AsUtf8L();
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(10);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Get_Post1L(  )
+    {
+    // 1. SendL(MSG [SC::POST by default])  
+    // 2. SendL(MSG, TP::GET),
+    // 3. SendL(MSG, TP::POST)
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Get
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+    
+    // Check from HTTP Transaction logger log that GET method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    // Http Post
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Get_Post2L(  )
+    {
+    // 1. SetTransportPropertiesL(TP::GET)
+    // 2. SendL(MSG) - Send(MSG, TP::POST)
+    // 3. SendL (MSG [SC::GET])
+    // 4. SetTransportPropertiesL(TP:POST)
+    // 5. SendL(MSG [SC:POST]
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // Http Get (using SetTransportPropertiesL)
+    // ****************************************
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+
+    // Check from HTTP Transaction logger log that GET method were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Post (using TransportProperties in SendL parameters)
+    // *********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that Post method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Get (using TransportProperties in SendL parameters)
+    // ********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpGet);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleError);
+    
+    // Check from HTTP Transaction logger log that GET method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodGet);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    // Http Post (using SetTransportPropertiesL)
+    // *****************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that Post method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);        
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // Http Post (using TransportProperties in SendL parameters)
+    // *********************************************************
+    pHttpProperties->SetHttpMethodL(CSenHttpTransportProperties::ESenHttpPost);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that POST method were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Proxy1L(  )
+    {
+    // SetProxy via Set(TP)
+    // ********************
+    // 1. SetTransportProperties(TP::PROXY)
+    // 2. SendL(MSG)    _LIT8(KSoapAction,              "SOAPAction");
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "SoapEnvelopeAction");
+    _LIT8(KSoapActionReturnValue,   "\"SoapEnvelopeAction\"");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+
+
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    
+    // Now the code execution has returned in here (either HandleMessageL or HandleErrorL was invoked)
+    
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetProxyHostL(KProxyHost);
+    pHttpProperties->SetProxyPortL(KProxyPort);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Proxy2L(  )
+    {
+    // SetProxy via SendL(MSG, TP)
+    // ***************************
+    // 1. SendL(MSG, TP::PROXY)
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "SoapEnvelopeAction");
+    _LIT8(KSoapActionReturnValue,   "\"SoapEnvelopeAction\"");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetProxyHostL(KProxyHost);
+    pHttpProperties->SetProxyPortL(KProxyPort);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP1L(  )
+    {
+    // ServicePattern::SetConsumerIapIdL(IAP_ID)
+    // *****************************************
+    // 1. Create new Service Pattern (SPatt)
+    // 2. SPatt::SetConsumerIapIdL(IAP_ID)
+    // 3. Instantiate new SC, wait for SetStatus(READY)
+    // 4. SendL(MSG)  using selected IAP
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }    
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP2L(  )
+    {
+    // SendL(MSG, TP:IAP_ID)         NOTE: this test case requires user interaction!!!
+    // *******************************************************************************
+    // 1. Instantiate new SC, wait for SetStatus(READY) [IAP is prompted from end user!]
+    // 2. TP::SetIapIdL(IAP_ID)
+    // 3. SendL(MSG, TP::IAP_ID)  using selected IAP
+    // 4. SendL(MSG)  -- should prompt the IAP from the end-user
+            
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }    
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_Pattern_IAP3L(  )
+    {
+    // SetTransportPropertiesL(TP::IAP_ID)
+    // 1. SetTransportPropertiesL(TP::IAP_ID)
+    // 2. SendL(MSG)  using selected IAP
+    // 3. TP:SetOmittedL(IAP_ID)
+    // 4. SendL(MSG, TP::IAP_ID-Omitted) -- should prompt the IAP from the end-user    
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 1. SetTransportPropertiesL(TP::IAP_ID)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    // 2. SendL(MSG)  using selected IAP
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    // 3. TP:SetOmittedL(IAP_ID)
+    //pHttpProperties->SetOmittedL(KIapIdLocalName, ETrue);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    // 4. SendL(MSG, TP::IAP_ID-Omitted) -- should prompt the IAP from the end-user    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ContentType1L(  )
+    {
+    // SendL(MSG, TP::Content-Type)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective content-type
+    // 2. TP::SetContentTypeIdL(Content-Type)
+    // 3. SendL(MSG, TP::Content-Type)  // check that selected Content-Type is used
+    // 4. SendL(MSG) // original content type should be used (from step 1)
+
+    _LIT8(KContentTypeValue, "text");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    HBufC8* pOriginalContentType = NULL; 
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective content-type
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 contentType;
+        TInt retVal = pReadHttpProperties->ContentTypeL(contentType);
+        if ( retVal == KErrNone )
+            {
+            pOriginalContentType = contentType.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+        
+    LOCAL_ASSERT(pOriginalContentType != NULL); // Content-type is a MUST for every transport
+        
+    if ( pOriginalContentType )
+        {
+        CleanupStack::PushL(pOriginalContentType);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. TP::SetContentTypeIdL(Content-Type)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetContentTypeL(KContentTypeValue);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+
+    // 3. SendL(MSG, TP::Content-Type)  // check that selected Content-Type is used
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+       
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    // 4. SendL(MSG) // original content type should be used (from step 1)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue && pOriginalContentType )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalContentType);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+
+    if ( pOriginalContentType )
+        {
+        CleanupStack::PopAndDestroy(pOriginalContentType);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_ContentType2L(  )
+    {
+    // SetTransportPropertiesL(TP::Content-Type)
+    // 1. Get TP via SC:TransportPropertiesL()
+    // 2. SendL(MSG), Content-Type got from step 1 should be effective
+    // 3. SetTransportPropertiesL(TP::Content-Type) // change content-type
+    // 4. SendL(MSG)  // check new content-type
+    // 5. SendL(MSG, TP:Content-Type)  // check *third* kind of content-type
+
+    _LIT8(KContentTypeValue1, "text");
+    _LIT8(KContentTypeValue2, "xml");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL()
+    TPtrC8 contentType;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->ContentTypeL(contentType);
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG), Content-Type got from step 1 should be effective
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // 3. SetTransportPropertiesL(TP::Content-Type) // change content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetContentTypeL(KContentTypeValue1);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 4. SendL(MSG)  // check new content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue1);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. SendL(MSG, TP:Content-Type)  // check *third* kind of content-type
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetContentTypeL(KContentTypeValue2);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that correct ContentType were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("Content-Type"));
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KContentTypeValue2);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_UserAgent1L(  )
+    {
+    // SendL(MSG, TP::User-Agent)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective User-Agent
+    // 2. TP::SetUserAgentL(User-Agent)
+    // 3. SendL(MSG, TP::User-Agent)  // check that selected User-Agentis used
+    // 4. SendL(MSG) // original User-Agent should be used (from step 1)
+
+    _LIT8(KUserAgentValue, "TestAgent");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective User-Agent
+    HBufC8* pOriginalUserAgent = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        TPtrC8 userAgent;
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->UserAgentL(userAgent);
+        pOriginalUserAgent = userAgent.AllocL();
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        CleanupStack::PushL(pOriginalUserAgent);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. TP::SetUserAgentL(User-Agent)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+
+    // 3. SendL(MSG, TP::User-Agent)  // check that selected User-Agent is used
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that selected User-Agent were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SendL(MSG) // original User-Agent should be used (from step 1)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    if ( pValue && pOriginalUserAgent )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalUserAgent);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalUserAgent )
+        {
+        CleanupStack::PopAndDestroy(pOriginalUserAgent);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_UserAgent2L(  )
+    {
+    // SetTransportPropertiesL(TP:User-Agent)
+    // 1. Get TP via SC:TransportPropertiesL() // store original user-agent
+    // 2. SendL(MSG); // check User-Agent from step 1 is sent/used
+    // 3. SetTransportPropertiesL(TP::User-Agent) // change user-agent
+    // 4. SendL(MSG, TP::User-Agent) // change user agent, check that it is used
+    // 5. SendL(MSG); // check that set User-Agent is used, from step 3
+
+    _LIT8(KUserAgentValue1, "TestAgent1");
+    _LIT8(KUserAgentValue2, "TestAgent2");
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP via SC:TransportPropertiesL() // store original user-agent
+    HBufC8* pOriginalUserAgent = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        TPtrC8 userAgent;
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        pReadHttpProperties->UserAgentL(userAgent);
+        pOriginalUserAgent = userAgent.AllocL();
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        CleanupStack::PushL(pOriginalUserAgent);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG); // check User-Agent from step 1 is sent/used
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that original User-Agent were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+
+    if ( pValue && pOriginalUserAgent )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalUserAgent);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 3. SetTransportPropertiesL(TP::User-Agent) // change user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue1);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 4. SendL(MSG, TP::User-Agent) // change user agent, check that it is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetUserAgentL(KUserAgentValue2);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that defined User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue2);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. SendL(MSG); // check that set User-Agent is used, from step 3
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that defined (in step 3) User-Agent were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, _L8("User-Agent"));
+    LOCAL_ASSERT(*pValue == KUserAgentValue1);
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalUserAgent )
+        {
+        CleanupStack::PopAndDestroy(pOriginalUserAgent);
+        }
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_MessageSoapActionL(  )
+    {
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "MessageAction");
+    _LIT8(KSoapActionReturnValue,   "\"MessageAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Read HTTP Transaction from file
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    
+    LOCAL_ASSERT(pFileContent != NULL);
+
+    CleanupStack::PushL(pFileContent);
+    
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+    CleanupStack::PopAndDestroy(pValue);
+    
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_SoapAction1L(  )
+    {
+    // SendL(MSG, TP:SOAPAction)
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective SOAPAction
+    // 2. TP::SetSoapActionL(SOAPAction)
+    // 3. SendL(MSG, TP::SOAPAction)  // check that selected SOAPAction is used
+    // 4. SendL(MSG) // original SOAPAction should be used (from step 1)    
+    
+    _LIT8(KSoapAction,              "SOAPAction");
+    _LIT8(KSoapActionValue,         "MessagePropertyAction");
+    _LIT8(KSoapActionReturnValue,   "\"MessagePropertyAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Get TP via SC:TransportPropertiesL() // store currently effective SOAPAction
+    HBufC8* pOriginalSoapAction = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 soapAction(KNullDesC8);
+        TInt retVal = pReadHttpProperties->SoapActionL(soapAction);
+        if ( retVal == KErrNone )
+            {
+            pOriginalSoapAction = soapAction.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+        
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PushL(pOriginalSoapAction);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    
+    // 2. TP::SetSoapActionL(SOAPAction)
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KSoapActionValue);
+    
+    // 3. SendL(MSG, TP::SOAPAction)  // check that selected SOAPAction is used
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    // 4. SendL(MSG) // original SOAPAction should be used (from step 1)    
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original SoapAction is used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    
+    if( pValue && pOriginalSoapAction )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalSoapAction);
+        }
+//    else if ( pValue )
+//        {
+        // This is temporary: the default "" SOAPAction value has been removed from HTTPC:
+        // also WS-I, REST and ID-WSF define this "" -value only on ::SendL (in message layer!)
+        // This means, that "original soap action" from SC does not CURRENTLY yet provide the
+        // framework default(!)
+//        LOCAL_ASSERT( *pValue ==  KSenSoapActionHeaderValueEmpty ) // default from framework.
+//        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PopAndDestroy(pOriginalSoapAction);
+        }    
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_SoapAction2L(  )
+    {
+    // SendL(SOAP-ENV::SOAPAction)
+    // 1. Get TP via SC:TransportPropertiesL() // store original soap-action
+    // 2. SendL(SOAP-ENV::SOAPAction); // check SOAPAction from SoapEnvelope is sent/used
+    // 3. SendL(MSG); // check that original SOAPACtion is used, from step 1
+    // 4. SetTransportProperties(TP::SOAPAction2);
+    // 5. SendL(MSG); // check that previous SC::SOAPAction is used, from step 4
+    // 6. SendL(MSG, TP:SOAPAction); // check that TP:SOAPAction is used
+    // 7. SendL(SOAP-ENV::SOAPAction); // check that SOAP-ENV:SOAPAction is used
+    // 8. SendL(SOAP-ENV); // check that previous SC::SOAPAction is used, from step 4
+    // 9. SendL(SOAP-ENV, TP::SOAPAction); // check that new TP::SOAPAction is used
+    // 10. SendL(SOAP-ENV:SOAPAction, TP::SOAPAction ); // both are set: check that SOAP-ENV:SOAPAction is used, over-riding TP
+    // 11. SendL(SOAP-ENV:SOAPAction ); SC::SOAPAction // only SOAP-ENV::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // 12. SendL(MSG, TP:SOAPAction ); SC::SOAPAction // only TP::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    
+    _LIT8(KSoapAction,                      "SOAPAction");
+    _LIT8(KEnvelopeSoapActionValue,         "EnvelopeAction");
+    _LIT8(KEnvelopeSoapActionReturnValue,   "\"EnvelopeAction\"");
+    _LIT8(KSessionSoapActionValue,          "SessionAction");
+    _LIT8(KSessionSoapActionReturnValue,    "\"SessionAction\"");
+    _LIT8(KMessageSoapActionValue,          "MessageAction");
+    _LIT8(KMessageSoapActionReturnValue,    "\"MessageAction\"");
+    
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Get TP via SC:TransportPropertiesL() // store original soap-action
+    HBufC8* pOriginalSoapAction = NULL;
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        CleanupStack::PushL(pTransportPropertiesAsXml);
+        CSenXmlReader* pParser = CSenXmlReader::NewLC();
+        CSenHttpTransportProperties* pReadHttpProperties = 
+                    CSenHttpTransportProperties::NewLC(*pTransportPropertiesAsXml,
+                                                       *pParser);
+        TPtrC8 soapAction(KNullDesC8);
+        TInt retVal = pReadHttpProperties->SoapActionL(soapAction);
+        if ( retVal == KErrNone )
+            {
+            pOriginalSoapAction = soapAction.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pReadHttpProperties);
+        CleanupStack::PopAndDestroy(pParser);
+        CleanupStack::PopAndDestroy(pTransportPropertiesAsXml);
+        }
+
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PushL(pOriginalSoapAction);
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+    
+    // 2. SendL(SOAP-ENV::SOAPAction); // check SOAPAction from SoapEnvelope is sent/used
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);    
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG); // check that original SOAPACtion is used, from step 1
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // Check from HTTP Transaction logger log that original SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue && pOriginalSoapAction )
+        {
+        LOCAL_ASSERT(*pValue == *pOriginalSoapAction);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SetTransportProperties(TP::SOAPAction2);
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KSessionSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // 5. SendL(MSG); // check that previous SC::SOAPAction is used, from step 4
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+    
+    // Check from HTTP Transaction logger log that defined (in step 4.) SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSessionSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    // 6. SendL(MSG, TP:SOAPAction); // check that TP:SOAPAction is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 7. SendL(SOAP-ENV::SOAPAction); // check that SOAP-ENV:SOAPAction is used
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+    
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+    
+    // 8. SendL(SOAP-ENV); // check that previous SC::SOAPAction is used, from step 4
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined (in step 4.) SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KSessionSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 9. SendL(SOAP-ENV, TP::SOAPAction); // check that new TP::SOAPAction is used
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 10. SendL(SOAP-ENV:SOAPAction, TP::SOAPAction); // both are set: check that SOAP-ENV:SOAPAction is used, over-riding TP
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+
+    // 11. SendL(SOAP-ENV:SOAPAction ); SC::SOAPAction // only SOAP-ENV::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // Note: SOAPAction for ServiceConnection was defined in step 4.
+    pSOAPMessage->SetSoapActionL(KEnvelopeSoapActionValue);    
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KEnvelopeSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    // Create a new Soap message because old one contains defined SoapAction
+    pSOAPMessage = CreateAuthRequestLC();
+    
+    // 12. SendL(MSG, TP:SOAPAction ); SC::SOAPAction // only TP::SOAPAction is set: check that it is effective, instead of SC::SOAPAction
+    // Note: SOAPAction for ServiceConnection was defined in step 4.
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSoapActionL(KMessageSoapActionValue);
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);    
+
+    // Check from HTTP Transaction logger log that defined SoapAction were used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KSoapAction);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KMessageSoapActionReturnValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    if ( pOriginalSoapAction )
+        {
+        CleanupStack::PopAndDestroy(pOriginalSoapAction);
+        }    
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_SendL_CustomHttpHeaderL(  )
+    {
+    // Set custom HTTP header
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE  (value should include Scandic characters, like Ä and Ö)
+    // 2. Get TP using SC:TransportPropertiesL()
+    // 3. SendL(MSG) // see that CUSTOM_HTTP_HEADER -field is not present
+    // 4. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that http filter logs CUSTOM_HTTP_HEADER
+    // 5. Define TP::CUSTOM_HTTP_HEADER_VALUE2 (for already existing CUSTOM_HTTP_HEADER_NAME)
+    // 6. Call SC::SetTransportPropertiesL(TP::CUSTOM_HTTP_HEADER_VALUE2) // VALUE2 should containt basic XML entities -- escapes like &, <, >, '   etc..
+    // 7. SendL(MSG) // see that TP::CUSTOM_HTTP_HEADER_VALUE2 is effective
+
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE  (value should include Scandic characters, like Ä and Ö)
+    _LIT8(KCustomHttpHeader,        "CustomHeader");
+    _LIT8(KCustomHttpHeaderValue1,  "CustomHeaderValue1ÅÄÖåäö"); // UTF8 String which contains: "CustomHeaderValue1ÅÄÖåäö"
+    _LIT8(KCustomHttpHeaderValue2,  "CustomHeaderValue2<>&");
+    HBufC8* pEncoded = SenXmlUtils::EncodeHttpCharactersLC(KCustomHttpHeaderValue2);
+           
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG) // see that CUSTOM_HTTP_HEADER -field is not present
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was not used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(pValue == NULL);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 4. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that http filter logs CUSTOM_HTTP_HEADER
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, KCustomHttpHeaderValue1);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KCustomHttpHeaderValue1);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    // 5. Define TP::CUSTOM_HTTP_HEADER_VALUE2 (for already existing CUSTOM_HTTP_HEADER_NAME)
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetIapIdL(iapId);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, *pEncoded);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    // 6. Call SC::SetTransportPropertiesL(TP::CUSTOM_HTTP_HEADER_VALUE2) // VALUE2 should containt basic XML entities -- escapes like &, <, >, '   etc..
+    iServiceConnection->SetTransportPropertiesL(*pSerializedProperties);
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    // 7. SendL(MSG) // see that TP::CUSTOM_HTTP_HEADER_VALUE2 is effective
+    iServiceConnection->SendL(*pSOAPMessage);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    // Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    RDebug::RawPrint( *pValue );
+    if ( pValue )
+        {
+        RDebug::Print(_L("ENCODED:") );
+        RDebug::RawPrint( *pEncoded );
+        RDebug::Print(_L("OUTPUT:") );
+        RDebug::RawPrint( *pValue );
+        LOCAL_ASSERT(*pValue == *pEncoded);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(pEncoded);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries1(  )
+    {
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    //_LIT8(KCustomHttpHeaderValue, ); // NULL cannot be used as descriptor literal value in Symbian
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KNullDesC8);
+    TL(result == KErrNone);
+    return KErrNone;
+    }
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries2(  )
+    {
+    TInt result;
+    // _LIT8(KCustomHttpHeader,); // NULL cannot be used as descriptor literal value in Symbian => it is more important to test KNullDesC8 (zero-length inputs etc)
+    _LIT8(KCustomHttpHeader, "X"); // property name's length = 1
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue"); 
+    
+    // Note: XML specs do not allow <Element> (tag name) to have zero-length.
+
+    // It is not a bad idea to create such a test case, where GOAL is actually test the http property class 
+    // itself (public DLL which is run by client app process); Utils DLL should maybe leave after it has been made to 
+    // regocnize illegal inputs. All the might check special chars, BUT --NOTE-- it would make the setters quite much 
+    // heavier (in terms of performance) if the key names (xml tag names) are first validated.
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KNullDesC8, KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries3(  )
+    {
+    TInt result;
+    _LIT8(KCustomHttpHeader, "CustomHeader");
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KNullDesC8);
+    //NOTE: --> we could create test case for length==1 case: _LIT8(KCustomHttpHeaderValue, "Y"); // property value's length = 1
+    // _LIT8(KCustomHttpHeaderValue,  ""); // == KNullDesC8 
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TL(result == KErrNone);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries4(  )
+    {
+    TInt result;
+    //_LIT8(KCustomHttpHeader,""); // == KNullDesC8
+    _LIT8(KCustomHttpHeader, "X"); // property name's length = 1
+    _LIT8(KCustomHttpHeaderValue, "CustomHeaderValue"); 
+    //result = UT_CSenServiceConnection_TP_Custom_Header(KNullDesC8, KCustomHttpHeaderValue);
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader, KCustomHttpHeaderValue);
+    
+    TL(result == KErrNone);
+    return KErrNone;
+    }   
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries5(  )
+    {
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8(KCustomHttpHeaderValue,  "256HeaderValuexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL (result == KErrNone);
+    return KErrNone;
+    }
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries6(  )
+    {
+    TInt result;
+    // Note: property name used to start with number here => changed, since it is against XML specs (property names are XML tags, parser does not accept tags which start by a number)
+
+    // It is not a bad idea to create such a test case, where GOAL is actually test the http property class 
+    // itself (public DLL which is run by client app process); Utils DLL should maybe leave after it has been made to 
+    // regocnize illegal inputs. All the might check special chars, BUT --NOTE-- it would make the setters quite much 
+    // heavier (in terms of performance) if the key names (xml tag names) are first validated.
+    _LIT8(KCustomHttpHeader,"Header256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL (result == KErrNone);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries7(  )
+    {
+    TInt result;
+    _LIT8(KCustomHttpHeader,"Header256xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    _LIT8(KCustomHttpHeaderValue,  "256HeaderValuexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL (result == KErrNone);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries8(  )
+    {
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8( KCRLFSP,       "\r\n " );
+    //_LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue55"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCRLFSP);
+    TL (result == KErrNone);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Boundaries9(  )
+    {
+    TInt result;
+    _LIT8(KCustomHttpHeader,"CustomHeader");
+    _LIT8(KCustomHttpHeaderValue,  "CustomHeaderValue1, CustomHeaderValue2"); 
+    result = UT_CSenServiceConnection_TP_Custom_Header(KCustomHttpHeader,KCustomHttpHeaderValue);
+    TL (result == KErrNone);
+    return KErrNone;
+    }
+
+//Befor executing this TC remember to set big enought TimeOut value (10 min.)
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_SecDialog()
+    {
+    TBool secDial;
+               
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KHttpsEndPoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+   
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL(ETrue);
+    pHttpProperties->SecureDialogL(secDial);
+    TL (secDial != EFalse);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetSecureDialogL(EFalse);
+    pHttpProperties->SecureDialogL(secDial);
+    TL (secDial == EFalse);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Omitted_True()
+    {
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL( ETrue );
+    pHttpProperties->SecureDialogL(secDial);
+    TL (secDial != EFalse);
+    pHttpProperties->SetOmittedL(KSecureDialogLocalName,ETrue);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog Omitted=\"true\">true</SecureDialog>"));
+    TL (cmpVal != KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Omitted_False()
+    {
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL( ETrue );
+    pHttpProperties->SecureDialogL(secDial);
+    TL (secDial != EFalse);
+    pHttpProperties->SetOmittedL(KSecureDialogLocalName, EFalse);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog Omitted=\"false\">true</SecureDialog>"));
+    TL (cmpVal != KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    return KErrNone;
+    }
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Removed()
+    {
+    TBool secDial;
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+
+    pHttpProperties->SetSecureDialogL(ETrue);
+    pHttpProperties->SecureDialogL(secDial);
+    TL (secDial != EFalse);
+    pHttpProperties->RemovePropertyL(KSecureDialogLocalName);
+    
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);   
+    
+    TInt cmpVal = pSerializedProperties->Find(_L8("<SecureDialog>"));
+    TL(cmpVal == KErrNotFound)
+    
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Omit_Rem()
+    {
+    _LIT8(KUserAgentValue,          "TestAgent");
+    _LIT8(KUserAgentDefaultValue,   "Serene");
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+    
+    // 1. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 2. SendL(MSG) // with set user-agent
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //3. Check from HTTP Transaction logger log that user-agent was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+    
+    // 4. SendL(MSG) // with removed user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->RemovePropertyL(KUserAgentLocalName);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //5. Check from HTTP Transaction logger log that user-agent was used.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue != KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);        
+    
+    
+    // 6. SendL(MSG) // with omitted set to EFalse for user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->SetOmittedL(KUserAgentLocalName, EFalse);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //7. Check from HTTP Transaction logger log that given user-agent
+    //   was used (when EFalse was given as Omitted value).
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);            
+    
+    // 8. SendL(MSG) // with omitted set to ETrue for user-agent
+    pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetUserAgentL(KUserAgentValue);
+    pHttpProperties->SetOmittedL(KUserAgentLocalName, ETrue);
+    pHttpProperties->SetIapIdL(iapId);
+    pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //9. Check from HTTP Transaction logger log that 
+    //   default user-agent for HTTP Transport plugin was
+    //   used instead of user-agent which was set together
+    //   with omitted value ETrue.
+    pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    pValue = HttpPropertyValueFromXmlLC(*pFileContent, KUserAgentLocalName);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KUserAgentDefaultValue);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);                
+
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_L(  )
+    {
+    // Create ServiceConnection
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "e:\\testing\\data\\fileContainer.txt" );
+    _LIT8(  KFileContent,  "Test FileContainer1" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Replace(rfs, KTestFileName, EFileWrite));
+    User::LeaveIfError(file.Write(KFileContent));
+    file.Flush();
+    file.Close();
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "e:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    // Check from HTTP Transaction logger log that POST method was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_with_Properties_L(  )
+    {
+    // Create ServiceConnection
+    CSenServicePattern* pPattern =
+        CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "e:\\testing\\data\\fileContainer.txt" );
+    _LIT8(  KFileContent,  "Test FileContainer1" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Replace(rfs, KTestFileName, EFileWrite));
+    User::LeaveIfError(file.Write(KFileContent));
+    file.Flush();
+    file.Close();
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "e:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+                                                                               _L8("xmlmime"));
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pSOAPMessage->SetProperties(pHttpProperties);
+    CleanupStack::Pop(pHttpProperties); // ownership was transferred to message
+        
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    // Check from HTTP Transaction logger log that POST method was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    LOCAL_ASSERT(pFileContent != NULL);
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpMethodValueFromXmlLC(*pFileContent);
+    if ( pValue )
+        {
+        LOCAL_ASSERT(*pValue == KHTTPMethodPost);
+        }
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_20KBL(  )
+    {
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1" );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    14;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "e:\\testing\\data\\Sunset2.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "e:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "e:\\testing\\data\\Winter2.jpg" );
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_200KBL(  )
+    {
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");
+    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "e:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "e:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "e:\\testing\\data\\Winter.jpg" );
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_Less1MBL(  )
+    {
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");    
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "e:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "e:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "e:\\testing\\data\\testPic3.jpg");
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+   
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_SubmitL_LibXml2_MTOM_More1MBL(  )
+    {
+    // Create ServiceConnection
+
+//    _LIT8(KSHCEndPoint, "http://172.21.10.144:8080/mtom/servlet/MtomServlet");    
+    _LIT8(KSHCEndPoint, "http://4FID02268.NOE.Nokia.com:8080/mtom/servlet/MtomServlet");    
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KSHCEndPoint, KNullDesC8());
+//  pPattern->SetFrameworkIdL(*ipFrameworkID);
+    pPattern->SetFrameworkIdL(KRESTFrameworkID);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pPattern->SetConsumerIapIdL(iapId);
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    StartActiveScheduler(1);
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    // Connection is ready to be used.
+
+    // 1. Chunk declaration
+    _LIT8(  cid,            "123456789@123456789" );
+    _LIT(   chunkName,      "test chunk" );
+    _LIT8(  chunkContent,   "Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1.Testing chunk1." );
+    TInt chunkSize =        1000;
+    TInt chunkMaxSize =     5000;
+    TInt chunkOffset =      100;
+    TInt chunkDataSize =    150;
+    RChunk binaryDataChunk;
+    binaryDataChunk.CreateGlobal(chunkName(), chunkSize, chunkMaxSize);
+    CleanupClosePushL(binaryDataChunk);
+    TUint8* heapPtr = binaryDataChunk.Base();
+    heapPtr = heapPtr + chunkOffset;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr-sizeof(TPtr8)) TPtr8(heapPtr, 0, chunkDataSize);
+    // Set the descriptor
+    TPtr8* pDes = reinterpret_cast<TPtr8*>(heapPtr-sizeof(TPtr8));
+    pDes->Zero();
+    pDes->Append(chunkContent);
+
+    // 2. Chunk declaration
+    _LIT8(  cid2,           "xyz" );
+    _LIT(   chunkName2,     "test chunk2" );
+    _LIT8(  chunkContent2,  "Testing chunk2" );
+    TInt chunkSize2 =       3000;
+    TInt chunkMaxSize2 =    10000;
+    TInt chunkOffset2 =     112;
+    TInt chunkDataSize2 =   14;
+    
+    RChunk binaryDataChunk2;
+    binaryDataChunk2.CreateGlobal(chunkName2(), chunkSize2, chunkMaxSize2);
+    CleanupClosePushL(binaryDataChunk2);
+    TUint8* heapPtr2 = binaryDataChunk2.Base();
+    heapPtr2 = heapPtr2 + chunkOffset2;
+    // Place a new descriptor in the chunk to initialize it
+    new (heapPtr2-sizeof(TPtr8)) TPtr8(heapPtr2, 0, chunkDataSize2);
+    // Set the descriptor
+    TPtr8* pDes2 = reinterpret_cast<TPtr8*>(heapPtr2-sizeof(TPtr8));
+    pDes2->Zero();
+    pDes2->Append(chunkContent2);
+    
+    // 1. File declaration
+    _LIT8(  cid3,           "999999999@123456789" );
+    _LIT(   KTestFileName,  "e:\\testing\\data\\Sunset.jpg" );
+	RFs rfs;
+	User::LeaveIfError(rfs.Connect());
+	CleanupClosePushL(rfs);
+	TInt retVal = rfs.ShareProtected();
+    RFile file;
+    CleanupClosePushL(file);
+    User::LeaveIfError(file.Open(rfs, KTestFileName, EFileRead));
+
+    // 2. File declaration
+    _LIT8(  cid4,           "1z2" );
+    _LIT(   KTestFileName2, "e:\\testing\\data\\fileContainer2.txt" );
+    _LIT8(  KFileContent2,  "Test FileContainer2" );
+	RFs rfs2;
+	User::LeaveIfError(rfs2.Connect());
+	CleanupClosePushL(rfs2);
+	retVal = rfs2.ShareProtected();
+    RFile file2;
+    CleanupClosePushL(file2);
+    User::LeaveIfError(file2.Replace(rfs2, KTestFileName2, EFileWrite));
+    User::LeaveIfError(file2.Write(KFileContent2));
+    file2.Flush();
+    file2.Close();
+    User::LeaveIfError(file2.Open(rfs2, KTestFileName2, EFileRead));
+
+    // 3. File declaration
+    _LIT8(  cid5,           "999999999@12789" );
+    _LIT(   KTestFileName3,  "e:\\testing\\data\\testPic4.jpg");
+	RFs rfs3;
+	User::LeaveIfError(rfs3.Connect());
+	CleanupClosePushL(rfs3);
+	retVal = rfs3.ShareProtected();
+    RFile file3;
+    CleanupClosePushL(file3);
+    User::LeaveIfError(file3.Open(rfs3, KTestFileName3, EFileRead));
+
+ 
+    // Create SOAPMessage
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(ESOAP12);
+    _LIT8(   KSoapActionValue,  "http://schemas.live.com/mws/2005/08/contacts/Sync" );
+    pSOAPMessage->SetSoapActionL(KSoapActionValue);
+//  CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL(); // ESOAP11
+  	CleanupStack::PushL(pSOAPMessage);
+    
+    RSenDocument document = pSOAPMessage->AsDocumentL();
+    
+    // Create BinaryContainers
+	TXmlEngChunkContainer chunkContainer = document.CreateChunkContainerL(
+	                                                               cid,
+	                                                               binaryDataChunk,
+	                                                               chunkOffset,
+	                                                               chunkDataSize);
+	TXmlEngChunkContainer chunkContainer2 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+	TXmlEngChunkContainer chunkContainer3 = document.CreateChunkContainerL(
+	                                                               cid2,
+	                                                               binaryDataChunk2,
+	                                                               chunkOffset2,
+	                                                               chunkDataSize2);
+    TXmlEngFileContainer fileContainer = document.CreateFileContainerL(cid3, file);
+    TXmlEngFileContainer fileContainer2 = document.CreateFileContainerL(cid4, file2);
+    TXmlEngFileContainer fileContainer3 = document.CreateFileContainerL(cid5, file3);
+   
+    
+    // Get Envelope element
+    TXmlEngElement envelopeElement = pSOAPMessage->AsElementL();
+    
+    // Create mime namespace declaration into Envelope element
+    // xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
+
+
+    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2005/05/xmlmime"),
+                                                                               _L8("xmlmime"));
+
+//    TXmlEngNamespace mimeNamespace = envelopeElement. AddNamespaceDeclarationL(_L8("http://www.w3.org/2004/11/xmlmime"),
+//                                                                               _L8("mime")); // IE does not render XML where attribute name startes with "xml" (xmlmime)
+
+
+    // Create service specific namespace declaration into Body element                                                                               
+    // xmlns:m="http://example.org/stuff"
+    TXmlEngNamespace serviceNamespace = pSOAPMessage->BodyL().AddNamespaceDeclarationL(
+                                                                               _L8("http://example.org/stuff"),
+                                                                               _L8("m"));
+    // Add data element into Body
+    // <S:Body xmlns:m="http://example.org/stuff">
+    //     <m:data>
+    //         ...
+    //     </m:data>
+    // </S:Body>
+    TXmlEngElement dataElement = pSOAPMessage->BodyL().AddNewElementL(_L8("data"),
+                                                                      serviceNamespace);
+    
+    // Add 1. attachment element into data element
+    // <m:data>
+    //     <m:textAttachment1 xmlmime:contentType="text">
+    //         <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:123456789@123456789"/>
+    //     </m:textAttachment1>
+    //     ...
+    // </m:data>
+    TXmlEngElement attachmentElement1 = dataElement.AddNewElementL(_L8("textAttachment1"),
+                                                                   serviceNamespace);
+    attachmentElement1.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement1.AppendChildL(chunkContainer);
+	
+    // Add 2. attachment element into data element
+    TXmlEngElement attachmentElement2 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement2.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement2.AppendChildL(fileContainer);
+	
+    // Add 3. attachment element into data element
+    TXmlEngElement attachmentElement3 = dataElement.AddNewElementL(_L8("textAttachment3"),
+                                                                   serviceNamespace);
+    attachmentElement3.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement3.AppendChildL(chunkContainer2);
+
+    // Add 4. attachment element into data element
+    TXmlEngElement attachmentElement4 = dataElement.AddNewElementL(_L8("textAttachment4"),
+                                                                   serviceNamespace);
+    attachmentElement4.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement4.AppendChildL(fileContainer2);
+
+    // Add 5. attachment element inside data element
+    TXmlEngElement attachmentElement5 = dataElement.AddNewElementL(_L8("textAttachment5"),
+                                                                   serviceNamespace);
+    attachmentElement5.AddNewAttributeL(_L8("contentType"), _L8("text/plain"), mimeNamespace);
+	attachmentElement5.AppendChildL(chunkContainer3);
+
+    // Add 6. attachment element into data element
+    TXmlEngElement attachmentElement6 = dataElement.AddNewElementL(_L8("textAttachment2"),
+                                                                   serviceNamespace);
+    attachmentElement6.AddNewAttributeL(_L8("contentType"), _L8("image/png"), mimeNamespace);
+	attachmentElement6.AppendChildL(fileContainer3);
+    
+    
+    // Http Post
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    HBufC8* pPropsAsXml = pHttpProperties->AsUtf8LC();
+    iServiceConnection->SetTransportPropertiesL(*pPropsAsXml);
+    CleanupStack::PopAndDestroy(pPropsAsXml);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+
+   
+    CSenSoapEnvelope2* pRetMessage = NULL;
+    iServiceConnection->SubmitL(*pSOAPMessage, pRetMessage);
+    delete pRetMessage;
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    CleanupStack::PopAndDestroy(&file3);
+    CleanupStack::PopAndDestroy(&rfs3);
+    CleanupStack::PopAndDestroy(&file2);
+    CleanupStack::PopAndDestroy(&rfs2);
+    CleanupStack::PopAndDestroy(&file);
+    CleanupStack::PopAndDestroy(&rfs);
+    CleanupStack::PopAndDestroy(&binaryDataChunk2);
+    CleanupStack::PopAndDestroy(&binaryDataChunk);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessengerL(  )
+    {
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL (iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger2L(  )
+    {
+    UnregisterSTSL();
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL (iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    CSenServiceManager* pManager = CSenServiceManager::NewLC();
+
+    // Get used IdentityProvider from ServiceConnection
+    CSenIdentityProvider* pIdp = NULL;
+    iServiceConnection->IdentityProviderL(pIdp);
+    CleanupStack::PushL(pIdp);
+        
+    // Get used Credential from Credentials DB
+    RCredentialArray credentialArray;
+    CleanupClosePushL(credentialArray);
+    RCredentialPropertiesArray credentialPropertiesArray;
+    CleanupClosePushL(credentialPropertiesArray);
+    LOCAL_ASSERT((pManager->CredentialsL(KMessagingEndpoint, *pIdp,
+                                         credentialArray,
+                                         credentialPropertiesArray)) == KErrNone);
+                                         
+    // Check that atleast one Credential were found.
+    LOCAL_ASSERT(credentialArray.Count() > 0);
+    
+    CleanupStack::Pop(&credentialPropertiesArray);
+    CleanupStack::Pop(&credentialArray);
+    CleanupStack::Pop(pIdp);
+    CleanupStack::PopAndDestroy(pManager);   
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+
+    CleanupStack::PushL(pIdp);
+    CleanupClosePushL(credentialArray);
+    CleanupClosePushL(credentialPropertiesArray);
+
+    // Clean DBs STARTS
+    //      1) Unregister STS ServiceDescription and
+    //                 STS IdentityProvider
+    //         => Unregistering IdentityProvider removes
+    //            related Credentials from Credentials DB
+    //
+    UnregisterSTSL();
+    
+    //      2) Unregister actual Service (= Messaging) ServiceDescription
+    pManager = CSenServiceManager::NewLC();
+    CSenXmlServiceDescription* pPattern = CSenXmlServiceDescription::NewLC();
+    pPattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pPattern->SetEndPointL(KMessagingEndpoint);
+    pPattern->SetContractL(KMessagingContract);
+    TInt error = pManager->UnregisterServiceDescriptionL( *pPattern);
+    CleanupStack::PopAndDestroy(pPattern);
+    CleanupStack::PopAndDestroy(pManager);   
+    // Clean DBs ENDS
+    
+    RegisterSTSL();
+    
+    pManager = CSenServiceManager::NewLC();
+
+    // Add Credential to Credentials DB
+    // => When Connection is initialized, working Credential
+    //    should be found from Credentials DB
+    // => Working Credential should be used and
+    //    request to get new SecurityToken should NOT be sent.
+    LOCAL_ASSERT((pManager->AddCredentialL(KMessagingEndpoint,
+                                           *pIdp,
+                                           *credentialArray[0],
+                                           *credentialPropertiesArray[0])) == KErrNone);
+
+    CleanupStack::PopAndDestroy(pManager);   
+    credentialPropertiesArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(&credentialPropertiesArray);
+    credentialArray.ResetAndDestroy();
+    CleanupStack::PopAndDestroy(&credentialArray);
+    CleanupStack::PopAndDestroy(pIdp);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL (iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    // Send Register message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger3L(  )
+    {
+    UnregisterSTSL();
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    //pInvalidStsProvider->AsElement().AddAttrL(_L8("promptUserInfo"),_L8("false"));
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT(iAuthInfoAskCounter == 1);
+
+    // 
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady );
+    TL (iServiceConnection !=  (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger4L(  )
+    {
+    UnregisterSTSL();
+    
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT(iAuthInfoAskCounter == 3);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusCreateFailed );
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger5L(  )
+    {
+    UnregisterSTSL();
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    iAuthInfoAskCounter = 0;
+    //Create Identity provider for STS 
+    ipProviderForAuthProvider = CSenIdentityProvider::NewL(KStsEndpoint);
+    ipProviderForAuthProvider->SetContractL(KWsStarContract);//(TDesC8)
+    ipProviderForAuthProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    ipProviderForAuthProvider->SetProviderID(KProviderId);
+    ipProviderForAuthProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+       
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    pInvalidStsProvider->AsElement().AddAttrL(_L8("promptUserInfo"),_L8("false"));
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+    
+    // Check that authentication info were asked exactly 3 times.
+    LOCAL_ASSERT( iAuthInfoAskCounter == 0 );
+
+    LOCAL_ASSERT( iConnectionState == KSenConnectionStatusCreateFailed );
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    delete ipProviderForAuthProvider;
+    ipProviderForAuthProvider = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger6L(  )
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract,      "urn:wstar:sts");
+    _LIT8(KAddressing,          "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+    _LIT8(KInvalidPassportPass, "Invalid");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* pInvalidStsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    pInvalidStsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    pInvalidStsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pInvalidStsProvider->SetProviderID(KProviderId);
+    pInvalidStsProvider->SetUserInfoL( KPassportUser, KPassportUser, KInvalidPassportPass);
+    manager->RegisterIdentityProviderL( *pInvalidStsProvider );
+    CleanupStack::PopAndDestroy(pInvalidStsProvider);
+
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    
+    CreateConnectionToMessengerServiceWithoutCallbackL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL (iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    return KErrNone;
+    }
+
+TInt CsenConnectionTester::UT_CSenServiceConnection_TestMessenger7L(  )
+    {
+    // Create one "fake" ServiceManager instance which keeps
+    // Serene server up and running through whole test case.
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    
+    UnregisterSTSL();
+    RegisterSTSL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    TL (iServiceConnection != (CSenServiceConnection*)NULL);
+    
+    CSenVtcpTransportProperties* pProperties = CreateMSTransportPropertiesL(EMSNMessengerRegister);
+    CleanupStack::PushL(pProperties);
+    iServiceConnection->SetTransportPropertiesL(*pProperties->AsUtf8LC());
+    CleanupStack::PopAndDestroy(); //pVtcpProperties->AsUtf8LC()
+    CleanupStack::PopAndDestroy(pProperties);
+
+    TInt sendRetCode(KErrNone);
+    
+    // Send Register message to Messenger
+    CSenSoapMessage2* pSoapMessage = CreateMSSoapMessage(EMSNMessengerRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+    
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // Send UnRegister message to Messenger
+    pSoapMessage = CreateMSSoapMessage(EMSNMessengerUnRegister);
+    CleanupStack::PushL(pSoapMessage);
+    
+    sendRetCode = iServiceConnection->SendL(*pSoapMessage);
+    LOCAL_ASSERT(sendRetCode > KErrNone);
+
+    StartActiveScheduler(1);
+    
+    LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+
+    // Clean DBs STARTS
+    //      1) Unregister STS IdentityProvider
+    //         => Unregistering IdentityProvider removes
+    //            related Credentials from Credentials DB
+    //
+    UnregisterSTSL();
+    // Clean DBs ENDS
+    
+    RegisterSTSInvalidPasswordL();
+    
+    CreateConnectionToMessengerServiceL();
+    
+    StartActiveScheduler(1);
+
+    LOCAL_ASSERT( iConnectionState == KSenConnectionStatusCreateFailed );
+    LOCAL_ASSERT( iCallback        == ECallbackHandleError );
+    LOCAL_ASSERT( iErrorCode       == -30320 ); // -30320 = KErrSenFailedAuthentication
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    CleanupStack::PopAndDestroy(manager);
+    return KErrNone;
+    }
+    
+int CsenConnectionTester::UT_CSenServiceConnection_TP_Custom_Header(const TDesC8& KCustomHttpHeader,
+                                    const TDesC8& KCustomHttpHeaderValue)
+    {
+    // Set custom HTTP header
+    // 1. Declare CUSTOM_HTTP_HEADER_NAME and CUSTOM_HTTP_HEADER_VALUE
+    // 2. Get TP using SC:TransportPropertiesL()
+    // 3. SendL(MSG, TP::CUSTOM_HTTP_HEADER) // see that CUSTOM_HTTP_HEADER -field is present
+    // 4. Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+               
+    CSenServicePattern* pPattern = CSenServicePattern::NewLC(KAuthServEndpoint, KNullDesC8());
+    pPattern->SetFrameworkIdL(*ipFrameworkID);
+    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pPattern);
+    
+    CleanupStack::PopAndDestroy(pPattern);
+    
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iConnectionState == KSenConnectionStatusReady);
+    if(iConnectionState != KSenConnectionStatusReady) return KErrCouldNotConnect;
+    // Connection is ready to be used.
+    
+    // 2. Get TP using SC:TransportPropertiesL()
+    HBufC8* pTransportPropertiesAsXml = NULL;
+    iServiceConnection->TransportPropertiesL(pTransportPropertiesAsXml);
+    if ( pTransportPropertiesAsXml )
+        {
+        delete pTransportPropertiesAsXml;
+        }
+
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // 3. SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, KFileName);
+    pHttpProperties->SetHttpHeaderL(KCustomHttpHeader, KCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    
+    //4. Check from HTTP Transaction logger log that CUSTOM_HTTP_HEADER was used.
+    HBufC8* pFileContent = ReadFileL(KFileToRead);
+    //LOCAL_ASSERT(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, KCustomHttpHeader);
+    //LOCAL_ASSERT(pValue == NULL);
+    if(pValue == NULL) return KErrNotFound;
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+    
+
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+
+    
+    delete iServiceConnection;
+    iServiceConnection = NULL;
+    
+    return KErrNone;    
+    }    
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_Send(const TDesC8& aLogFileName, const TDesC8& aCustomHttpHeader,
+                                                                const TDesC8& aCustomHttpHeaderValue, CSenServiceConnection* iServiceConnection)
+    {
+    TInt result = KErrNone;
+    CSenSoapMessage* pSOAPMessage = CreateAuthRequestLC();
+
+    // SendL(MSG) // with custom header
+    CSenHttpTransportProperties* pHttpProperties = CSenHttpTransportProperties::NewLC();    
+    pHttpProperties->SetHttpHeaderL(KLoggerFileNameProperty, aLogFileName);
+    pHttpProperties->SetHttpHeaderL(aCustomHttpHeader, aCustomHttpHeaderValue);
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pHttpProperties->SetIapIdL(iapId);
+    HBufC8* pSerializedProperties = pHttpProperties->AsUtf8L();
+    CleanupStack::PushL(pSerializedProperties);
+    iServiceConnection->SendL(*pSOAPMessage, *pSerializedProperties);
+    StartActiveScheduler(1);
+    //LOCAL_ASSERT(iCallback == ECallbackHandleMessage);
+    if(iCallback != ECallbackHandleMessage) return KErrGeneral;
+   
+    CleanupStack::PopAndDestroy(pSerializedProperties);
+    CleanupStack::PopAndDestroy(pHttpProperties);
+    CleanupStack::PopAndDestroy(pSOAPMessage);
+    return result;
+    }
+    
+    
+TInt CsenConnectionTester::UT_CSenServiceConnection_TP_CheckLogs(const TDesC& aLogFilePath,  const TDesC8& aCustomHttpHeader, const TDesC8& aCustomHttpHeaderValue)
+    {
+    TInt result = KErrNone;
+    HBufC8* pFileContent = ReadFileL(aLogFilePath);
+    //LOCAL_ASSERT(pFileContent != NULL);
+    if (pFileContent == NULL) return KErrNotFound;
+    
+    CleanupStack::PushL(pFileContent);
+    HBufC8* pValue = HttpPropertyValueFromXmlLC(*pFileContent, aCustomHttpHeader);
+    //LOCAL_ASSERT(*pValue == aCustomHttpHeaderValue);
+    if (*pValue != aCustomHttpHeaderValue) return KErrNotFound;
+    
+    CleanupStack::PopAndDestroy(pValue);
+    CleanupStack::PopAndDestroy(pFileContent);    
+
+    return result;
+    }
+
+
+HBufC8* CsenConnectionTester::HttpMethodValueFromXmlLC(const TDesC8& aXml)
+    {
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    CSenElement* pTPElement = pRequestElement->Element(_L8("Method"));
+    
+    HBufC8* pRetBuf = pTPElement->Content().AllocL();
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    
+    CleanupStack::PushL(pRetBuf);
+    
+    return pRetBuf;
+    }
+    
+TInt CsenConnectionTester::Find(const TDesC8& aDestination,
+                                    const TDesC8& aDescToFind,
+                                    TInt aStartingPos )
+    {
+    TInt descLength = aDescToFind.Length();
+    TInt length = aDestination.Length() - descLength + 1;
+    for (TInt i = aStartingPos; i < length ; i++)
+        {
+        if (  aDestination.Mid(i,descLength) == aDescToFind )
+            {
+            return i;
+            }
+        }
+        
+    return KErrNotFound;
+    }
+    
+TBool CsenConnectionTester::ReplaceAll(TPtr8 aDestination,
+                                           const TDesC8& aFrom,
+                                           const TDesC8& aTo)
+    {
+    TInt retVal(EFalse);
+    
+    TInt pos = Find(aDestination, aFrom, 0);
+    if (pos != KErrNotFound) retVal = ETrue;
+    
+    while (pos != KErrNotFound)
+        {
+        aDestination.Replace(pos,aFrom.Length(),aTo);
+        pos = Find(aDestination, aFrom, pos+1);
+        }
+
+    return retVal;
+    }    
+    
+TBool CsenConnectionTester::DecodeHttpCharactersL(const TDesC8& aOriginal,
+                                                      HBufC8*& aDecoded)
+    {
+    // Five basic entities as descriptors
+    _LIT8(KEscapedApos,     "&apos;");
+    _LIT8(KEscapedDblQuot,  "&quot;");
+    _LIT8(KEscapedGt,       "&gt;");
+    _LIT8(KEscapedLt,       "&lt;");
+    _LIT8(KEscapedAmp,      "&amp;");
+    
+    // XML-escaping chars as descriptors
+    _LIT8(KAmpersandDesC8,  "&");
+    _LIT8(KAposDesC8,       "\'");
+    _LIT8(KDblQuotDesC8,    "\"");
+    _LIT8(KGtDesC8,         ">");
+    _LIT8(KLtDesC8,         "<");
+    
+    delete aDecoded;
+    aDecoded = NULL;
+
+    // make a copy of the original
+    aDecoded = aOriginal.AllocL();
+
+    TBool retVal(EFalse);
+
+    // replace all five basic entities with XML escaping counterpart,
+    // if found.
+    if (ReplaceAll(aDecoded->Des(), KEscapedApos(), KAposDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedDblQuot(), KDblQuotDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedGt(), KGtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedLt(), KLtDesC8()))
+        {
+        retVal = ETrue;
+        }
+    if (ReplaceAll(aDecoded->Des(), KEscapedAmp(), KAmpersandDesC8()))
+        {
+        retVal = ETrue;
+        }
+
+    return retVal;
+    }
+
+HBufC8* CsenConnectionTester::HttpPropertyValueFromXmlLC(const TDesC8& aXml,
+                                                             const TDesC8& aPropertyName)
+    {
+    CSenXmlReader* pReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(pReader);
+    CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+    pReader->SetContentHandler(*pDom);
+    pDom->SetReader(*pReader);
+    pReader->ParseL(aXml);
+    
+    HBufC8* pRetBuf = NULL;
+    
+    CSenElement& element = pDom->AsElement();
+    CSenElement* pRequestElement = element.Element(_L8("Request"));
+    if ( pRequestElement )
+        {
+        CSenElement* pTPElement = pRequestElement->Element(_L8("TranportProperties"));
+        if ( pTPElement )
+            {
+            CSenElement* pElement = pTPElement->Element(aPropertyName);
+            if ( pElement )
+                {
+                pRetBuf = pElement->Content().AllocL();
+                CleanupStack::PushL(pRetBuf);
+                HBufC8* pNew = NULL;
+                DecodeHttpCharactersL(*pRetBuf, pNew);
+                CleanupStack::PopAndDestroy(pRetBuf);
+                pRetBuf = pNew;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy(pDom);
+    CleanupStack::PopAndDestroy(pReader);
+    CleanupStack::PushL(pRetBuf);
+    return pRetBuf;
+    }
+    
+HBufC8* CsenConnectionTester::ReadFileL(const TDesC& aFilename)
+    {
+    RFs fsSession;
+    CleanupClosePushL(fsSession);
+    User::LeaveIfError(fsSession.Connect() == NULL);
+    TEntry entry;
+    User::LeaveIfError(fsSession.Entry(aFilename,entry));
+    HBufC8* pFileContent = NULL;
+    RFileReadStream fileInStream;
+    CleanupClosePushL(fileInStream);
+    if (fileInStream.Open(fsSession,aFilename,EFileRead) == KErrNone)
+        {
+        HBufC8* pTempFileContent = HBufC8::NewLC(entry.iSize+10);
+        TRAPD(error,
+            fileInStream.ReadL((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            );
+            
+        if (!error)
+            {
+            TPtrC8 fileContent((TUint8*)pTempFileContent->Ptr(),entry.iSize);
+            pFileContent = fileContent.AllocL();
+            }
+        CleanupStack::PopAndDestroy(pTempFileContent);
+        }
+    CleanupStack::PopAndDestroy(&fileInStream);
+    CleanupStack::PopAndDestroy(&fsSession);
+    return pFileContent;
+    }
+    
+TUint32 CsenConnectionTester::SearchIAPIdByNameL( const TDesC& aIAPName )
+    {
+    TBool found = EFalse;
+    CCommsDatabase* pDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(pDB);
+    
+    //open internet accesspoint table
+    CCommsDbTableView* pDbTView = pDB->OpenTableLC(TPtrC(IAP));
+    TInt retVal = pDbTView->GotoFirstRecord();
+    TBuf<128> name; 
+    TUint32 id = 0;
+    //Find the correct record
+    while ( retVal == KErrNone && found == EFalse )
+        {
+        pDbTView->ReadTextL(TPtrC(COMMDB_NAME), name);
+        pDbTView->ReadUintL(TPtrC(COMMDB_ID), id);
+        found = ( name == aIAPName ); 
+        if ( !found )
+            {
+            retVal = pDbTView->GotoNextRecord();
+            }
+        }
+    CleanupStack::PopAndDestroy(pDbTView);
+    CleanupStack::PopAndDestroy(pDB);
+    return id;
+    }
+    
+CSenSoapMessage* CsenConnectionTester::CreateAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage* pSOAPMessage = CSenSoapMessage::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+    
+CSenSoapMessage2* CsenConnectionTester::CreateNewAuthRequestLC()
+    {
+    _LIT8(KRequest, "<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"PLAIN ANONYMOUS\" advisoryAuthnID=\"012345678901234\"/>");
+    CSenSoapMessage2* pSOAPMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSOAPMessage);
+
+    //xxxxxxxx*************** CorrelationHeader starts ***************************
+    /*CSenBaseElement* pElement = CSenBaseElement::NewL(_L8("urn:liberty:sb:2003-08"), _L8("Correlation"), _L8("sb:Correlation"));
+    CleanupStack::PushL(pElement);
+
+    pElement->AddAttrL(_L8("messageID"),_L8(""));
+    pElement->AddAttrL(_L8("refToMessageID"),_L8(""));
+
+    TTime t;
+    t.HomeTime();
+    TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts;
+    SenDateUtils::ToXmlDateTimeUtf8L(ts, t);
+    pElement->AddAttrL(_L8("timestamp"), ts);
+
+    //pSOAPMessage->AddHeaderL(*pElement); // pElement will be owned by pSOAPMessage
+    CleanupStack::Pop(pElement);*/
+    //************************ CorrelationHeader ends ****************************
+
+    pSOAPMessage->SetBodyL(KRequest);
+    return pSOAPMessage;    
+    }
+    
+CSenVtcpTransportProperties* CsenConnectionTester::CreateMSTransportPropertiesL(TMSCommands aCommand)
+    {
+#ifdef OLD_MSN_NAMESPACE_2005_08
+    _LIT8(KRegisterAct, "http://schemas.live.com/mws/2005/08/messaging/Register");
+    _LIT8(KInviteReqAct,"http://schemas.live.com/mws/2005/08/messaging/Invite");
+    _LIT8(KSendReqAct,"http://schemas.live.com/mws/2005/08/messaging/Message");
+#else
+    _LIT8(KRegisterAct, "http://schemas.live.com/mws/2006/10/messaging/Register");    
+    _LIT8(KInviteReqAct,"http://schemas.live.com/mws/2006/10/messaging/Invite");
+    _LIT8(KSendReqAct,"http://schemas.live.com/mws/2006/10/messaging/Message");          
+    
+#endif
+
+    CSenVtcpTransportProperties* pVtcpProperties = CSenVtcpTransportProperties::NewLC();
+    pVtcpProperties->SetProxyHostL(KMSNProxy);
+    //pVtcpProperties->SetOnewayMessageOnOffL(TRUE);
+    
+    pVtcpProperties->SetMwsNamespaceL(KMessagingNameSpace);
+        
+    switch (aCommand)
+        {
+        case EMSNMessengerRegister:
+            {    
+            pVtcpProperties->SetSoapActionL(KRegisterAct);
+            break;
+            }
+        case EMSNMessengerUnRegister:
+            {    
+            pVtcpProperties->SetSoapActionL(KRegisterAct);
+            break;
+            }
+        case EMSNMessengerInvite:
+            {    
+            pVtcpProperties->SetSoapActionL(KInviteReqAct);
+            break;
+            }
+        case EMSNMessengerSend:
+            {    
+            pVtcpProperties->SetSoapActionL(KSendReqAct);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    CleanupStack::Pop(pVtcpProperties);
+    
+    return pVtcpProperties;
+    }
+    
+CSenSoapMessage2* CsenConnectionTester::CreateMSSoapMessage(TMSCommands aCommand)
+    {
+#ifdef OLD_MSN_NAMESPACE_2005_08    
+    _LIT8(KReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+    <sip:Expires>240</sip:Expires>\
+    <sip:AutoOffline>0</sip:AutoOffline>\
+    <sip:Capabilities>1074003969</sip:Capabilities>\
+    <sip:SubscribedNotifications>31</sip:SubscribedNotifications>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KUnReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+    <sip:Expires>0</sip:Expires>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KInviteReq,
+        "<sip:InviteRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+            <sip:Call>\
+                <mc:To xmlns:mc=\"http://schemas.live.com/mws/2005/08/contacts\">7553</mc:To>\
+            </sip:Call>\
+        </sip:InviteRequest>");
+    
+    _LIT8(KSendReq,          
+    "<sip:MessageRequest xmlns:sip=\"http://schemas.live.com/mws/2005/08/messaging\">\
+            <sip:Call>\
+                <sip:CallID>1</sip:CallID>\
+            </sip:Call>\
+            <sip:MessageObject sip:ContentType=\"text/plain\">\
+                <sip:MessageBody>lalamido</sip:MessageBody>\
+            </sip:MessageObject>\
+        </sip:MessageRequest>");
+#else
+    _LIT8(KReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+    <sip:Expires>240</sip:Expires>\
+    <sip:AutoOffline>0</sip:AutoOffline>\
+    <sip:Capabilities>1074003969</sip:Capabilities>\
+    <sip:SubscribedNotifications>31</sip:SubscribedNotifications>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+     
+    _LIT8(KUnReristerReq, "<sip:RegisterRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+    <sip:Expires>0</sip:Expires>\
+    <sip:MessengerArgot sip:Status=\"Online\" sip:PresenceUpdates=\"All\"/>\
+    </sip:RegisterRequest>");
+    
+    _LIT8(KInviteReq,  
+        "<sip:InviteRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+            <sip:Call>\
+                <mc:To xmlns:mc=\"http://schemas.live.com/mws/2006/10/contacts\">4878</mc:To>\
+            </sip:Call>\
+        </sip:InviteRequest>");
+    
+    _LIT8(KSendReq,          
+    "<sip:MessageRequest xmlns:sip=\"http://schemas.live.com/mws/2006/10/messaging\">\
+            <sip:Call>\
+                <sip:CallID>1</sip:CallID>\
+            </sip:Call>\
+            <sip:MessageObject sip:ContentType=\"text/plain\">\
+                <sip:MessageBody>lalamido</sip:MessageBody>\
+            </sip:MessageObject>\
+        </sip:MessageRequest>");
+#endif    
+
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewLC(ESOAP12);
+
+    AddDeviceOptionsHeader2L(*pMessage);
+    
+    AddApplicationHeader2L(*pMessage);
+    
+    switch (aCommand)
+        {
+        case EMSNMessengerRegister:
+            {    
+            pMessage->SetBodyL(KReristerReq);
+            break;
+            }
+        case EMSNMessengerUnRegister:
+            {    
+            pMessage->SetBodyL(KUnReristerReq);
+            break;
+            }
+        case EMSNMessengerInvite:
+            {    
+            pMessage->SetBodyL(KInviteReq);
+            break;
+            }
+        case EMSNMessengerSend:
+            {    
+            pMessage->SetBodyL(KSendReq);
+            break;
+            }
+        default:
+            break;
+        }
+    
+    CleanupStack::Pop(pMessage);
+        
+    return pMessage;
+    }
+
+void CsenConnectionTester::RegisterSTSL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);                                           
+    manager->RegisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+
+void CsenConnectionTester::RegisterSTSInvalidPasswordL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //register Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, _L8("Invalid"));                                           
+    manager->RegisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //register SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->RegisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+
+void CsenConnectionTester::UnregisterSTSL() 
+    {
+    CSenServiceManager* manager = CSenServiceManager::NewLC();
+    _LIT8(KWsStarContract, "urn:wstar:sts");
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2006/10/addressing");
+
+    //Unregister Identity provider for STS 
+    CSenIdentityProvider* stsProvider = CSenIdentityProvider::NewLC(KStsEndpoint);
+    stsProvider->SetContractL(KWsStarContract);//(TDesC8)
+    stsProvider->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    stsProvider->SetProviderID(KProviderId);
+    stsProvider->SetUserInfoL( KPassportUser, KPassportUser, KPassportPass);                                           
+    manager->UnregisterIdentityProviderL( *stsProvider);
+    CleanupStack::PopAndDestroy(stsProvider);
+       
+    //Unregister SD for STS 
+    CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();//KNullDesC8(), KWsStarContract); 
+    pattern->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pattern->SetContractL(KWsStarContract);
+    pattern->SetEndPointL(KStsEndpoint);
+    pattern->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pattern, KPolicyAdr,     KAddressing); //this RST2
+    SetPolicyL(pattern, KPolicySOAP12,  KNullDesC8);   //this RST2
+
+    SetPolicyL(pattern, KPolicyMT,      KMetadataEndpoint);
+    SetPolicyL(pattern, KPolicyPassExt, KNullDesC8);
+    SetPolicyL(pattern, KPolicyTLS,     KNullDesC8);
+    TInt error = manager->UnregisterServiceDescriptionL( *pattern);
+
+    CleanupStack::PopAndDestroy(pattern);
+    CleanupStack::PopAndDestroy(manager);
+    }
+    
+void CsenConnectionTester::SetPolicyL( CSenXmlServiceDescription* pServDesc,
+                                           const TDesC8& pName,
+                                           const TDesC8& pValue)
+    {
+    CSenElement* servicePolicy = pServDesc->AsElement().Element(_L8("ServicePolicy")); 
+    CSenElement* clientPolicy = servicePolicy->Element(_L8("ClientPolicy"));     
+    if(!clientPolicy)
+        servicePolicy->AddElementL(_L8("ClientPolicy"));
+    clientPolicy = servicePolicy->Element(_L8("ClientPolicy"));
+
+    if(pValue==KNullDesC8())
+        {
+        clientPolicy->AddElementL(pName);
+        }
+        else
+        {
+        clientPolicy->AddElementL(pName).SetContentL(pValue);
+        }
+    }
+    
+void CsenConnectionTester::CreateConnectionToMessengerServiceL()
+    {
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    CSenXmlServiceDescription* pServiceDesc = CSenXmlServiceDescription::NewLC(KMessagingEndpoint, KMessagingContract);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pServiceDesc->SetIapIdL(iapId);
+    
+    pServiceDesc->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pServiceDesc->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pServiceDesc, KPolicySOAP12, KNullDesC8);
+    SetPolicyL(pServiceDesc, KPolicyAdr,    KAddressing);
+    
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc, *this);
+    CleanupStack::PopAndDestroy(pServiceDesc);
+    }
+
+void CsenConnectionTester::CreateConnectionToMessengerServiceWithoutCallbackL()
+    {
+    _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing");
+    CSenXmlServiceDescription* pServiceDesc = CSenXmlServiceDescription::NewLC(KMessagingEndpoint, KMessagingContract);
+
+    TUint32 iapId = SearchIAPIdByNameL(KIAPName);
+    pServiceDesc->SetIapIdL(iapId);
+
+
+    pServiceDesc->SetFrameworkIdL(KDefaultWSStarFrameworkID);
+    pServiceDesc->AsElement().AddElementL(_L8("ProviderID")).SetContentL(KProviderId);
+    SetPolicyL(pServiceDesc, KPolicySOAP12, KNullDesC8);
+    SetPolicyL(pServiceDesc, KPolicyAdr,    KAddressing);
+    
+    // create connection    
+    iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc);
+    CleanupStack::PopAndDestroy(pServiceDesc);
+    }
+
+void CsenConnectionTester::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage)
+    {
+    TXmlEngElement header = aMessage.HeaderL();
+
+    TXmlEngElement deviceOp = header.AddNewElementL(_L8("DeviceOptions"),
+                                                    KMessagingNameSpace,
+                                                    _L8("mws"));
+
+    TXmlEngElement child = deviceOp.AddNewElementSameNsL(_L8("Locale"));
+    child.AddTextL(_L8("1033"));
+
+    TXmlEngElement child1 = deviceOp.AddNewElementSameNsL(_L8("UserAgent"));
+
+    TXmlEngElement child1_1 = child1.AddNewElementSameNsL(_L8("Manufacturer"));
+    child1_1.AddTextL(_L8("NO_UserAgent"));
+
+    TXmlEngElement child1_2 = child1.AddNewElementSameNsL(_L8("Model"));
+    child1_2.AddTextL(_L8("NO_Model"));
+
+    TXmlEngElement child1_3 = child1.AddNewElementSameNsL(_L8("OS"));
+
+    TXmlEngElement child1_3_1 = child1_3.AddNewElementSameNsL(_L8("Name"));
+    child1_3_1.AddTextL(_L8("NO_OS"));
+
+    TXmlEngElement child1_3_2 = child1_3.AddNewElementSameNsL(_L8("Version"));
+    child1_3_2.AddTextL(_L8("NO_Version"));
+    }
+
+void CsenConnectionTester::AddApplicationHeader2L(CSenSoapMessage2& aMessage)
+    {
+    TXmlEngElement header = aMessage.HeaderL();
+
+    TXmlEngElement application = header.AddNewElementL(_L8("Application"),KMessagingNameSpace,_L8("mws"));
+
+    TXmlEngElement child = application.AddNewElementSameNsL(_L8("Name"));
+    child.AddTextL(_L8("NO_CLIENT"));
+
+    TXmlEngElement child1 = application.AddNewElementSameNsL(_L8("Vendor"));
+    child1.AddTextL(_L8("NO_VENDOR"));
+
+    TXmlEngElement child2 = application.AddNewElementSameNsL(_L8("Version"));
+    child2.AddTextL(_L8("NO_VERSION"));
+    }
+    
+void CsenConnectionTester::StartActiveScheduler(TInt aNumberOfPendingOps)
+    {
+    iNumberOfPendingOps = aNumberOfPendingOps;
+    CActiveScheduler::Start();
+    }
+       
+void CsenConnectionTester::StopActiveScheduler()
+    {
+    iNumberOfPendingOps--;
+    if ( iNumberOfPendingOps == 0 )
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+const CSenIdentityProvider* CsenConnectionTester::IdentityProviderL() const
+    {
+    //((UT_CSenServiceConnection*)this)->iAuthInfoAskCounter++;
+    ((CsenConnectionTester*)this)->iAuthInfoAskCounter++;
+    
+    return ipProviderForAuthProvider;
+    }
+TAny* CsenConnectionTester::GetInterfaceByUid( TUid aUID )
+	{
+	return;
+	}
+
+// -----------------------------------------------------------------------------
+// CsenConnectionTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CsenConnectionTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
Binary file websrv_pub/web_service_connection_api/tsrc/senutils/bmarm/senutilsbctestu.def has changed
Binary file websrv_pub/web_service_connection_api/tsrc/senutils/bwins/senutilsbctestu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/eabi/SenUtilsBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/group/SenUtilsBCTest_UID_.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x1000008d,0x101fb3e7,EPriorityForeground,0x000ffffeu,0x00000000u,0x101fb3e7,0x00000000,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+../sis/testsu_c.bat		/epoc32/winscw/c/TestSU_c.bat
+../sis/testsu_z.bat		/epoc32/winscw/c/TestSU_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_senutils.ini
+
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+senutils.mmp
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/group/senutils.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senutils
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          SenUtilsBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+#if defined(EKA2)
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+VENDORID        VID_DEFAULT        
+//VENDORID 			0x70000001 
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+#endif
+
+//TARGETPATH      ?target_path
+DEFFILE         SenUtilsBCTest.def
+
+SOURCEPATH      ../src
+SOURCE          senutils.cpp
+SOURCE          senutilscases.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+SYSTEMINCLUDE   /epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         SenUtils.lib
+LIBRARY         SenXml.lib
+LIBRARY					SenServDesc.lib
+LIBRARY                 SenFragment.lib
+LIBRARY                 SenXml.lib
+
+
+LANG            SC
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    //LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    //LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/group/senutils.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Utils"},(0x101FB3E7),3,0,0,TYPE=SA
+ x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenUtilsBCTest.dll"-"!:\sys\bin\SenUtilsBCTest.dll"
+"..\init\SenUtilsBCTest.ini"-"!:\testframework\SenUtilsBCTest.ini"
+;"\Epoc32\winscw\c\testSU_c.bat"-"!:\testSU.bat"
+;"\Epoc32\winscw\c\testframework\testframework_senutils.ini"-"!:\testframework\testframework_senutils.ini"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/inc/senutilsbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,570 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenUtils test module.
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENUTILS_H
+#define SENUTILS_H
+
+// INCLUDES
+#include <StifTestModule.h>
+#include <StifLogger.h>
+#include <SenParser.h>
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+#include <SenIdentityProvider.h>
+#include <SenNameSpace.h>
+#include <SenSoapEnvelope.h>
+#include <SenSoapFault.h>
+#include <SenSoapMessage.h>
+#include <SenWsSecurityHeader.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+#include <SenTransportProperties.h>
+#include <SenHttpTransportProperties.h>
+//#include <SenVtcpTransportProperties.h>
+#include <f32file.h>
+//#include <S32FILE.H>
+//#include <e32std.h>
+
+//  FORWARD DECLARATIONS
+class CSenBaseAttribute;
+class CSenBaseFragment;
+class CSenSoapMessage;
+class CSenIdentityProvider;
+class CSenGuidGen;
+class CSenDomFragment;
+class CSenSoapFault;
+class CSenXmlServiceDescription;
+class CSenSoapEnvelope;
+class CSenWsSecurityHeader;
+class SenXmlUtils;
+class CSenBaseElement;
+class MSenElement;
+class CSenXmlReader;
+class SenDateUtils;
+class CSenNamespace;
+
+namespace{
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+    _LIT8(KXmlSpecific, "\"&<>");
+    _LIT8(KFaultMessage, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault></S:Body></S:Envelope>");
+    _LIT8(KSOAPMessageNS, "<tns:Envelope xmlns:tns=\"http://schemas.xmlsoap.org/soap/envelope/\"><tns:Header/><tns:Body><ab:QueryResponse xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:Status code=\"OK\"/><ab:Data>Hard Coded response, alway the same</ab:Data></ab:QueryResponse></tns:Body></tns:Envelope>");
+    _LIT8(KSOAPMessageNSInside, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><ab:QueryResponse xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:Status code=\"OK\"/><ab:Data>Hard Coded response, alway the same</ab:Data></ab:QueryResponse></S:Body></S:Envelope>");
+    _LIT8(KSOAPMessage,  "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+
+}
+
+// Logging path
+_LIT( KSenUtilsLogPath, "\\logs\\testframework\\SenUtilsBCTest\\" ); 
+// Log file
+_LIT( KSenUtilsLogFile, "SenUtilsBCTest.txt" ); 
+
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenUtilsBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenUtilsBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenUtilsBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a SenUtils class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenUtilsBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenUtilsBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenUtilsBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenUtils. It is called once for every instance of 
+        *       TestModuleSenUtils after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenUtils.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenUtils. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenUtilsBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+        void SetupL();
+        void Teardown();
+
+        TPtr16 ConvertToPtr16LC(CSenBaseFragment &fragment);
+        TPtr16 ConvertToPtr16LC(MSenElement &element);
+
+        /**
+        * Actual Hardcoded test case functions are listed below.
+        */
+/*
+ 		TInt CSenSoapEnvelope_NewLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_AddHeaderLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_BodyLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_BodyAsStringLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_DetachFaultLL( TTestResult& aResult );
+ 		TInt CSenSoapEnvelope_HeaderLL( TTestResult& aResult );
+		TInt CSenSoapEnvelope_SetBodyLL( TTestResult& aResult );
+		TInt CSenSoapEnvelope_SoapActionL( TTestResult& aResult );
+		TInt CSenSoapEnvelope_FaultLL( TTestResult& aResult );
+		TInt CSenSoapFault_NewLL( TTestResult& aResult );
+		TInt CSenSoapFault_NewL_1L( TTestResult& aResult );
+		TInt CSenSoapFault_FaultCodeL( TTestResult& aResult );
+		TInt CSenSoapFault_FaultStringL( TTestResult& aResult );
+		TInt CSenSoapFault_FaultActorL( TTestResult& aResult );
+		TInt CSenSoapFault_DetailL( TTestResult& aResult );
+		TInt CSenSoapMessage_NewLL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_NewLL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_NewL_1L( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_UsernameTokenLL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_UsernameTokenL_1L( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_XmlNsL( TTestResult& aResult );
+		TInt CSenWsSecurityHeader_XmlNsPrefixL( TTestResult& aResult );
+		TInt SenDateUtils_FromXmlDateTimeLL( TTestResult& aResult );
+		TInt SenDateUtils_ToXmlDateTimeUtf8LL( TTestResult& aResult );
+		TInt CSenSoapMessage_SetSecurityHeaderLL( TTestResult& aResult );
+		TInt CSenSoapMessage_AddSecurityTokenLL( TTestResult& aResult );
+*/
+
+         TInt CSenSoapEnvelope_NewLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SetBodyLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_BodyLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_HeaderLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_AddHeaderLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_BodyAsStringLL(TTestResult& aResult);
+         
+         TInt CSenSoapEnvelope_DetachFaultLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_FaultLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SetSoapActionLL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SoapActionL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SoapAction2L(TTestResult& aResult);
+         TInt CSenSoapEnvelope_HasHeaderL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_SoapVersionL(TTestResult& aResult);
+         TInt CSenSoapEnvelope_HasBodyL(TTestResult& aResult);
+		 TInt CSenSoapEnvelope_IsFaultL(TTestResult& aResult);
+		 TInt CSenSoapEnvelope_ParseLL(TTestResult& aResult);
+        
+         TInt CSenSoapFault_NewLL(TTestResult& aResult);
+         TInt CSenSoapFault_NewL_1L(TTestResult& aResult);
+         TInt CSenSoapFault_FaultCodeL(TTestResult& aResult);
+         TInt CSenSoapFault_FaultSubcodeL(TTestResult& aResult);
+         TInt CSenSoapFault_FaultStringL(TTestResult& aResult);
+         TInt CSenSoapFault_FaultActorL(TTestResult& aResult);
+         TInt CSenSoapFault_DetailL(TTestResult& aResult);
+
+         TInt CSenSoapMessage_NewLL(TTestResult& aResult);
+         TInt CSenSoapMessage_NewL_1L(TTestResult& aResult);
+         TInt CSenSoapMessage_NewL_2L(TTestResult& aResult);
+         TInt CSenSoapMessage_SetSecurityHeaderLL(TTestResult& aResult);
+         TInt CSenSoapMessage_AddSecurityTokenLL(TTestResult& aResult);
+		 TInt CSenSoapMessage_ParseLL(TTestResult& aResult);
+         
+
+         TInt CSenWsSecurityHeader_NewLL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewLCL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewLC_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewL_2L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_NewLC_2L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_BinarySecurityTokenL_L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_BinarySecurityTokenL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_TimestampL_L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_TimestampL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenLL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_1L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_2L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_3L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_UsernameTokenL_4L(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_XmlNsL(TTestResult& aResult);
+         TInt CSenWsSecurityHeader_XmlNsPrefixL(TTestResult& aResult);
+        
+         TInt SenDateUtils_FromXmlDateTimeLL(TTestResult& aResult);
+         TInt SenDateUtils_ToXmlDateTimeUtf8LL(TTestResult& aResult);
+         TInt SenDateUtils_ToXmlDateTimeUtf82LL(TTestResult& aResult);
+        
+         TInt SenTransportProperties_FileAttachmentLL(TTestResult& aResult);
+         //TInt SenTransportProperties_SetFileAttachmentsLL(TTestResult& aResult);
+         
+         TInt SenXmlProperties_NewLL(TTestResult& aResult);
+         TInt SenXmlProperties_NewLCL(TTestResult& aResult);
+		 TInt SenXmlProperties_NewL_1L(TTestResult& aResult);
+		 TInt SenXmlProperties_NewLC_1L(TTestResult& aResult);
+         TInt SenXmlProperties_NewL_2L(TTestResult& aResult);
+         TInt SenXmlProperties_NewLC_2L(TTestResult& aResult);
+         
+        TInt SenTransportProperties_NewLL(TTestResult& aResult);
+        TInt SenTransportProperties_NewLCL(TTestResult& aResult);
+        TInt SenTransportProperties_NewL_1L(TTestResult& aResult);
+        TInt SenTransportProperties_NewLC_1L(TTestResult& aResult);
+        TInt SenTransportProperties_NewL_2L(TTestResult& aResult);
+        TInt SenTransportProperties_NewLC_2L(TTestResult& aResult);
+		TInt SenTransportProperties_SetReaderL(TTestResult& aResult);
+        TInt SenTransportProperties_PropertiesClassTypeL(TTestResult& aResult);
+        TInt SenTransportProperties_WriteToLL(TTestResult& aResult);
+        TInt SenTransportProperties_ReadFromLL(TTestResult& aResult);
+        TInt SenTransportProperties_AsUtf8LL(TTestResult& aResult);
+        TInt SenTransportProperties_AsUtf8LCL(TTestResult& aResult);
+        TInt SenTransportProperties_SetPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_PropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_SetIntPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_IntPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_SetBoolPropertyLL(TTestResult& aResult);        
+        TInt SenTransportProperties_BoolPropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_SetOmittedLL(TTestResult& aResult);
+        TInt SenTransportProperties_RemovePropertyLL(TTestResult& aResult);
+        TInt SenTransportProperties_IsSafeToCastL(TTestResult& aResult);
+		TInt SenTransportProperties_CloneLL(TTestResult& aResult);
+        TInt SenTransportProperties_CloneL(TTestResult& aResult);
+        TInt SenTransportProperties_ApplyBindingLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_HeartbeatLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetHeartbeatLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_IapIdLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetIapIdLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_ProxyPortLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetProxyPortLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_ProxyHostLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetProxyHostLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_ProxyUsageLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetProxyUsageLL(TTestResult& aResult);
+
+				TInt SenTransportProperties_SecureDialogLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetSecureDialogLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_UserAgentLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SetUserAgentLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_DeviceIDLL(TTestResult& aResult);
+
+        TInt SenTransportProperties_SetDeviceIDLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SoapActionLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SetSoapActionLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_DownloadFolderLL(TTestResult& aResult);
+        
+        TInt SenTransportProperties_SetDownloadFolderLL(TTestResult& aResult );
+               
+        TInt SenTransportProperties_SetFileAttachmentLL( TTestResult& aResult);
+
+        TInt SenTransportProperties_MwsNamespaceLL(TTestResult& aResult );
+        
+        TInt SenTransportProperties_SetMwsNamespaceLL(TTestResult& aResult );
+
+        TInt SenTransportProperties_MessageIdLL(TTestResult& aResult );
+
+        TInt SenTransportProperties_SetMessageIdLL( TTestResult& aResult);
+
+        TInt SenTransportProperties_OnewayMessageOnOffLL( TTestResult& aResult);
+
+        TInt SenTransportProperties_SetOnewayMessageOnOffLL(TTestResult& aResult );
+        
+        TInt SenTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult);
+        
+		TInt SenTransportProperties_MaxTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenTransportProperties_MinTimeToLiveLL(TTestResult& aResult);
+
+		TInt SenHttpTransportProperties_NewLL(TTestResult& aResult);
+		
+		TInt SenHttpTransportProperties_NewLCL(TTestResult& aResult);
+
+		TInt SenHttpTransportProperties_NewL_1L(TTestResult& aResult);
+		
+		TInt SenHttpTransportProperties_NewLC_1L(TTestResult& aResult);
+
+		TInt SenHttpTransportProperties_NewL_2L(TTestResult& aResult);
+		
+		TInt SenHttpTransportProperties_NewLC_2L(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLL(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLCL(TTestResult& aResult);
+
+		TInt SenVtcpTransportProperties_NewL_1L(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLC_1L(TTestResult& aResult);
+
+		TInt SenVtcpTransportProperties_NewL_2L(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_NewLC_2L(TTestResult& aResult);
+
+        TInt SenVtcpTransportProperties_OnewayMessageOnOffLL( TTestResult& aResult);
+
+        TInt SenVtcpTransportProperties_SetOnewayMessageOnOffLL(TTestResult& aResult );
+        
+        TInt SenVtcpTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult);
+        
+		TInt SenVtcpTransportProperties_MaxTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult);
+		
+		TInt SenVtcpTransportProperties_MinTimeToLiveLL(TTestResult& aResult);
+
+     public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENUTILS_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/init/SenUtilsBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenUtilsBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/rom/senutils.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SENUTILS_IBY__
+#define SENUTILS_IBY__
+
+file=ABI_DIR\BUILD_DIR\SenUtilsBCTest.dll          PROGRAMS_DIR\SenUtilsBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/sis/SenUtilsBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenUtilsBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
Binary file websrv_pub/web_service_connection_api/tsrc/senutils/sis/senutils.pkg has changed
Binary file websrv_pub/web_service_connection_api/tsrc/senutils/sis/senutils.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenUtilsBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/sis/testsu_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\TestFramework_senutils.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule SenUtilsBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenUtils.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/sis/testsu_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy z:\TestFramework\TestFramework_senutils.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule SenUtilsBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenUtils.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/src/senutils.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,391 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenUtils class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senutilsbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::CSenUtilsBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenUtilsBCTest::CSenUtilsBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenUtilsLogPath, 
+                          KSenUtilsLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "SenUtils logging starts!" );
+    iLog->Log( KLogStart );
+    
+   // if ( iXmlReader ){
+    //    delete iXmlReader;
+    //}
+    //iXmlReader = CSenXmlReader::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenUtilsBCTest* CSenUtilsBCTest::NewL()
+    {
+    CSenUtilsBCTest* self = new (ELeave) CSenUtilsBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenUtilsBCTest::~CSenUtilsBCTest()
+    {
+    if (iLog)  delete iLog;
+    //if ( iXmlReader)
+    	//{
+        //delete iXmlReader;
+      //  iXmlReader = NULL;
+    //  }
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenUtilsBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenUtilsBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenUtilsBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+		iLog->Log( _L("-------------------------------------------------------------"));
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenUtilsBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenUtilsBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenUtilsBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenUtilsBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutils/src/senutilscases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3120 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include "senutilsbctest.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenUtilsBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenUtils.cpp file and to SenUtils.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        
+        ENTRY( "NewL - CSenSoapEnvelope", CSenUtilsBCTest::CSenSoapEnvelope_NewLL ),
+        ENTRY( "SetBodyL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SetBodyLL ),
+        ENTRY( "BodyL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_BodyLL ),
+        ENTRY( "HeaderL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_HeaderLL ),        
+        ENTRY( "AddHeaderL - CSenSoapEnvelope", CSenUtilsBCTest::CSenSoapEnvelope_AddHeaderLL ),
+        ENTRY( "BodyAsStringL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_BodyAsStringLL ),
+        ENTRY( "DetachFaultL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_DetachFaultLL ),
+        ENTRY( "FaultL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_FaultLL ),
+        ENTRY( "SoapAction - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SoapActionL ),
+ //       ENTRY( "SoapAction2 - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SoapAction2L ),
+        ENTRY( "HasHeader - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_HasHeaderL ),
+        ENTRY( "SoapVersion - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_SoapVersionL ),
+        ENTRY( "HasBody - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_HasBodyL ),
+        ENTRY( "IsFault - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_IsFaultL ),
+        ENTRY( "ParseL - CSenSoapEnvelope ", CSenUtilsBCTest::CSenSoapEnvelope_ParseLL ),
+        
+        ENTRY( "NewL - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_NewLL ),
+        ENTRY( "NewL - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_NewL_1L ),
+        ENTRY( "FaultCode - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultCodeL ),
+        ENTRY( "FaultSubcode - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultSubcodeL ),
+        
+        ENTRY( "FaultString - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultStringL ),
+        ENTRY( "FaultActor - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_FaultActorL ),
+        ENTRY( "Detail - CSenSoapFault ", CSenUtilsBCTest::CSenSoapFault_DetailL ),
+        ENTRY( "NewL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_NewLL ),
+        ENTRY( "SetSecurityHeaderL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_SetSecurityHeaderLL ),
+        ENTRY( "AddSecurityTokenL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_AddSecurityTokenLL ),
+        ENTRY( "NewL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLL ),
+        ENTRY( "ParseL - CSenSoapMessage ", CSenUtilsBCTest::CSenSoapMessage_ParseLL ),
+        
+        ENTRY( "NewLC - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLCL ),
+        ENTRY( "NewL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewL_1L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_1L ),
+        ENTRY( "NewL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewL_2L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_2L ),
+        ENTRY( "BinarySecurityToken - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_L ),
+        ENTRY( "BinarySecurityToken1 - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_1L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenLL ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_L ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_1L ),        
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_1L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_2L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_3L ),
+//        ENTRY( "UsernameTokenL - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_4L ),
+        ENTRY( "XmlNs - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsL ),
+        ENTRY( "XmlNsPrefix - CSenWsSecurityHeader ", CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsPrefixL ),
+        ENTRY( "FromXmlDateTimeL - SenDateUtils ", CSenUtilsBCTest::SenDateUtils_FromXmlDateTimeLL ),
+        ENTRY( "ToXmlDateTimeUtf8L - SenDateUtils ", CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf8LL ),
+        ENTRY( "ToXmlDateTimeUtf82L - SenDateUtils ", CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf82LL ),
+        
+        ENTRY( "FileAttachmentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_FileAttachmentLL ),
+        ENTRY( "NewL - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLL ),
+        ENTRY( "NewLC - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLCL ),
+        ENTRY( "NewL - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewL_1L ),
+        ENTRY( "NewLC - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLC_1L ),
+        ENTRY( "NewL - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewL_2L ),
+        ENTRY( "NewLC - CSenXmlProperties", CSenUtilsBCTest::SenXmlProperties_NewLC_2L ),
+        ENTRY( "NewL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLL ),
+        ENTRY( "NewLC - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLCL ),
+        ENTRY( "NewL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewL_1L ),
+        ENTRY( "NewLC - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLC_1L ),
+        ENTRY( "NewL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewL_2L ),
+        ENTRY( "NewLC - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_NewLC_2L ),
+        ENTRY( "AsUtf8L - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_AsUtf8LL ),
+        ENTRY( "SetPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetPropertyLL ),
+        ENTRY( "PropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_PropertyLL ),
+        ENTRY( "SetIntPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetIntPropertyLL ),
+        ENTRY( "IntPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_IntPropertyLL ),
+        ENTRY( "SetBoolPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetBoolPropertyLL ),
+        ENTRY( "BoolPropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_BoolPropertyLL ),
+        ENTRY( "SetOmittedL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetOmittedLL ),
+        ENTRY( "RemovePropertyL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_RemovePropertyLL ),
+        ENTRY( "HeartbeatL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_HeartbeatLL ),
+        ENTRY( "SetHeartbeatL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetHeartbeatLL ),
+        ENTRY( "IapIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_IapIdLL ),
+        ENTRY( "SetIapIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetIapIdLL ),
+        ENTRY( "ProxyPortL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ProxyPortLL ),
+        ENTRY( "SetProxyPortL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetProxyPortLL ),
+        ENTRY( "ProxyHostL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ProxyHostLL ),
+        ENTRY( "SetProxyHostL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetProxyHostLL ),
+        ENTRY( "ProxyUsageL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ProxyUsageLL ),
+        ENTRY( "SetProxyUsageL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetProxyUsageLL ),
+        ENTRY( "SecureDialogL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SecureDialogLL ),
+        ENTRY( "SetSecureDialogL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetSecureDialogLL ),
+        ENTRY( "UserAgentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_UserAgentLL ),
+        ENTRY( "SetUserAgentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetUserAgentLL ),
+        ENTRY( "DeviceIDL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_DeviceIDLL ),
+        ENTRY( "SetDeviceIDL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetDeviceIDLL ),
+        ENTRY( "SoapActionL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SoapActionLL ),
+        ENTRY( "SetSoapActionL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetSoapActionLL ),
+        ENTRY( "DownloadFolderL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_DownloadFolderLL ),
+        ENTRY( "SetDownloadFolderL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetDownloadFolderLL ),
+        ENTRY( "SetFileAttachmentL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetFileAttachmentLL ),
+        ENTRY( "MwsNamespaceL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MwsNamespaceLL ),
+        ENTRY( "SetMwsNamespaceL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMwsNamespaceLL ),
+        ENTRY( "MessageIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MessageIdLL ),
+        ENTRY( "SetMessageIdL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMessageIdLL ),
+        ENTRY( "OnewayMessageOnOffL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_OnewayMessageOnOffLL ),
+        ENTRY( "SetOnewayMessageOnOffL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetOnewayMessageOnOffLL ),
+        ENTRY( "SetMaxTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMaxTimeToLiveLL ),
+        ENTRY( "MaxTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MaxTimeToLiveLL ),
+        ENTRY( "SetMaxTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMaxTimeToLiveLL),
+        ENTRY( "MinTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_MinTimeToLiveLL ),
+        ENTRY( "SetMinTimeToLiveL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetMinTimeToLiveLL ),
+        ENTRY( "SetReaderL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_SetReaderL ),
+        ENTRY( "PropertiesClassTypeL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_PropertiesClassTypeL ),
+        ENTRY( "WriteToLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_WriteToLL ),
+        ENTRY( "ReadFromLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ReadFromLL ),
+        ENTRY( "CloneL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_CloneL ),
+        ENTRY( "IsSafeToCastL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_IsSafeToCastL ),
+        ENTRY( "CloneLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_CloneLL ),
+        ENTRY( "ApplyBindingLL - CSenTransportProperties", CSenUtilsBCTest::SenTransportProperties_ApplyBindingLL ),
+        
+        ENTRY( "NewL - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLL ),
+        ENTRY( "NewLC - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLCL ),
+        ENTRY( "NewL - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewL_1L ),
+        ENTRY( "NewLC - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLC_1L ),
+        ENTRY( "NewL - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewL_2L ),
+        ENTRY( "NewLC - CSenHttpTransportProperties", CSenUtilsBCTest::SenHttpTransportProperties_NewLC_2L),
+        //ENTRY( "NewL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLL ),
+        //ENTRY( "NewLC - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLCL ),
+        //ENTRY( "NewL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewL_1L ),
+        //ENTRY( "NewLC - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_1L ),
+        //ENTRY( "NewL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewL_2L ),
+        //ENTRY( "NewLC - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_2L ),
+        //ENTRY( "OnewayMessageOnOffL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_OnewayMessageOnOffLL ),
+        //ENTRY( "SetOnewayMessageOnOffL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_SetOnewayMessageOnOffLL ),
+        //ENTRY( "SetMaxTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_SetMaxTimeToLiveLL ),
+        //ENTRY( "MaxTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_MaxTimeToLiveLL ),
+        //ENTRY( "MinTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_MinTimeToLiveLL ),
+        //ENTRY( "SetMinTimeToLiveL - CSenVtcpTransportProperties", CSenUtilsBCTest::SenVtcpTransportProperties_SetMinTimeToLiveLL ),*/
+        
+
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CSenUtilsBCTest::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CSenUtilsBCTest::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CSenUtilsBCTest::SetupL(  ){
+    if ( iXmlReader ){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+    iXmlReader = CSenXmlReader::NewL();
+} 
+
+void CSenUtilsBCTest::Teardown(  ){
+    if ( iXmlReader){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+}
+
+
+TPtr16 CSenUtilsBCTest::ConvertToPtr16LC(CSenBaseFragment &fragment){
+    HBufC16* xmlBuffer = fragment.AsElement().AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length()){
+        RDebug::Print( _L( "WSModTester: xmlBuffer length [%d]"),ptr.Length());
+        if (ptr.Length()<=254){//below string must be =< max byte value
+            RDebug::Print( _L( "WSModTester: xmlBuffer #START#"));
+            RDebug::Print( _L( "[%S]"),&ptr);
+            RDebug::Print( _L( "WSModTester: xmlBuffer #END#"));
+        }
+        else
+            RDebug::Print( _L( "WSModTester: xmlBuffer too long to display, must be <=256- 2//[]"));
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TPtr16 CSenUtilsBCTest::ConvertToPtr16LC(MSenElement &element){
+    HBufC16* xmlBuffer = element.AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer length [%d]"),ptr.Length());
+        if (ptr.Length()<=254){//below string must be =< max byte value
+            RDebug::Print( _L( "WSModTester: xmlBuffer #START#"));
+            RDebug::Print( _L( "[%S]"),&ptr);
+            RDebug::Print( _L( "WSModTester: xmlBuffer #END#"));
+        }
+        else
+            RDebug::Print( _L( "WSModTester: xmlBuffer too long to display, must be <=256- 2//[]"));
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    CleanupStack::PushL(env);
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL);*/
+    TL(env != (CSenSoapEnvelope*)NULL);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    TPtrC16 ptrRef = KRef();
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*env), ptrRef);*/
+    TL(ConvertToPtr16LC(*env) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(env);
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SetBodyLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    _LIT8(KBody,"ComarchBody");
+    TPtrC8 result = env->SetBodyL(KBody);
+    
+    _LIT16(KRef2, "ComarchBody");
+    TPtrC16 result16(reinterpret_cast<const TUint16*>(result.Ptr()),(result.Size()/2));
+    RDebug::Print( _L( "WSModTester: body [%S]"),&result16);
+    /*EUNIT_ASSERT_EQUALS(result, KBody);*/
+    TL(result == KBody);
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body>ComarchBody</S:Body></S:Envelope>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*env), KRef);*/
+    TL(ConvertToPtr16LC(*env) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_BodyLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    _LIT8(KBody,"ComarchBody");
+    env->SetBodyL(KBody);
+    
+    CSenElement& element = env->BodyL();
+    
+    _LIT16(KRef, "<S:Body>ComarchBody</S:Body>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(element), KRef);*/
+    TL(ConvertToPtr16LC(element) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_HeaderLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    env->AddHeaderL(*el);
+    el = &(CSenBaseElement&)env->HeaderL();
+    
+    _LIT16(KRef, "<S:Header><text/></S:Header>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*el), KRef);*/
+    TL(ConvertToPtr16LC(*el)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_AddHeaderLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    //el = &(CSenBaseElement&) env->AddHeaderL(*el);//ok
+    el = &(CSenBaseElement&) env->AddHeaderL(*el);//ok
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><text/></S:Header><S:Body/></S:Envelope>");
+    TL(ConvertToPtr16LC(*env) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    _LIT16(KRef2, "<text/>");
+    TL(ConvertToPtr16LC(*el)== KRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_BodyAsStringLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KBody,"ComarchBody");
+    env->SetBodyL(KBody);
+    HBufC8* str = env->BodyAsStringL();
+    
+    _LIT8(KRef, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">ComarchBody</S:Body>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptr = str->Des();
+    TL(ptr == ptrRef);
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete str);
+    str = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_DetachFaultLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+
+    //checking Envelope without Fault
+    _LIT16(KRefEnvFault, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body/></S:Envelope>");
+    TPtrC16 ptrRefEnvFault = KRefEnvFault();
+    TL(ConvertToPtr16LC(*env) == ptrRefEnvFault);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    //checking Fault
+    _LIT16(KRefFault, "<S:Fault xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault>");
+    TPtrC16 ptrRefFault = KRefFault();
+    TL(ConvertToPtr16LC(*fault) == ptrRefFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    
+
+    env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KSOAPMessage);
+    TL(env->DetachFaultL() == (CSenSoapFault* )NULL);
+    //checking Envelope not touched should be
+    _LIT16(KRefEnv, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+    TPtrC16 ptrRefEnv = KRefEnv();
+    TL(ConvertToPtr16LC(*env) == ptrRefEnv);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_FaultLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+
+
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->FaultL();
+
+    //checking Envelope, still Fault exist
+    _LIT16(KRefEnvFault, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault></S:Body></S:Envelope>");
+    TL(ConvertToPtr16LC(*env)== KRefEnvFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    //checking Fault
+    _LIT16(KRefFault, "<S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault>");
+    TL(ConvertToPtr16LC(*fault) == KRefFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    
+    env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KSOAPMessage);
+    TL(env->FaultL() == (CSenSoapFault* )NULL);
+    //checking Envelope not touched should be
+    _LIT16(KRefEnv, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+    TL(ConvertToPtr16LC(*env) == KRefEnv);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SoapActionL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KRef, "\"\"");
+    _LIT8(KRef2, "\"URI-referenceRFC2396\"");
+    _LIT8(KRef3, "");
+    TL(env->SoapAction() == KRef);
+    env->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TL(env->SoapAction() == KRef2);
+    env->SetSoapActionL(KRef2);
+    TL(env->SoapAction() == KRef2);
+    
+    env->SetSoapActionL(KRef3);
+    TL(env->SoapAction() == KRef3);
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SoapAction2L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KRef, "");
+    _LIT8(KRef2, "\"URI-referenceRFC2396\"");
+
+    TL(env->SoapAction2() == KRef);
+    env->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TL(env->SoapAction2() == KRef2);
+    env->SetSoapActionL(KRef2);
+    TL(env->SoapAction2() == KRef2);
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapEnvelope_HasHeaderL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    
+    if(!( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    pEnvelope->AddHeaderL(*el);
+    if(( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope);
+    pEnvelope = NULL;
+    Teardown();
+    return KErrNone;
+    
+    //EUNIT_ASSERT_NO_LEAVE(delete el);
+    //el = NULL;
+    }
+   
+TInt CSenUtilsBCTest::CSenSoapEnvelope_SoapVersionL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    TSOAPVersion var = ESOAP11;
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    CleanupStack::PushL(pEnvelope);
+    
+    TL(var ==  pEnvelope->SoapVersion());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CSenUtilsBCTest::CSenSoapEnvelope_HasBodyL( TTestResult& aResult )
+	{
+    SetupL();
+	
+	CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KBody,"ComarchBody");
+    TPtrC8 result = env->SetBodyL(KBody);
+    if(( env->HasBody() == EFalse )) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    CSenSoapEnvelope* env1 = CSenSoapEnvelope::NewL();
+    TL(env1 != (CSenSoapEnvelope*)NULL);
+
+    if(!( env1->HasBody() == EFalse )) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env1);
+    env1 = NULL;
+    Teardown();
+    return KErrNone;
+    
+	}
+    
+TInt CSenUtilsBCTest::CSenSoapEnvelope_IsFaultL( TTestResult& aResult )
+	{
+    SetupL();
+	
+	CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env!= (CSenSoapEnvelope*)NULL);
+    if(!( env->IsFault() == EFalse )) return KErrArgument;
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    
+	}
+	
+TInt CSenUtilsBCTest::CSenSoapEnvelope_ParseLL( TTestResult& aResult )
+	{
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+	pEnvelope->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*pEnvelope);
+    
+    CleanupStack::PushL(pEnvelope);
+    
+	
+	pEnvelope->ParseL(KInputString);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+
+TInt CSenUtilsBCTest::CSenSoapFault_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    RAttributeArray attributeArray;
+    _LIT8(KFault, "Fault");
+    CSenSoapFault* soapFault = CSenSoapFault::NewL(KFault, KFault, KFault, attributeArray);
+    CleanupStack::PushL(soapFault);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(soapFault != (CSenSoapFault*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Fault xmlns=\"Fault\"/>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*soapFault) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(soapFault);
+    attributeArray.Close();
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete soapFault);
+    soapFault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    RAttributeArray attributeArray;
+    _LIT8(KFault, "Fault");
+    CSenSoapFault* orgSoapFault = CSenSoapFault::NewL(KFault, KFault, KFault, attributeArray);
+    CSenSoapFault* soapFault = CSenSoapFault::NewL(*orgSoapFault);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(soapFault != (CSenSoapFault*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Fault xmlns=\"Fault\"/>");
+    TL(ConvertToPtr16LC(*soapFault) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete orgSoapFault);
+    orgSoapFault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete soapFault);
+    soapFault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_FaultCodeL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KCode, "VersionMismatch");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultCode());
+    TL(fault->FaultCode()== KCode);
+    //TPtrC16 result16(reinterpret_cast<const TUint16*>(fault->FaultCode().Ptr()),(fault->FaultCode().Size()/2));
+    //RDebug::Print( _L( "WSModTester: faultCode [%S]"),&result16);
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultCode());
+    TL(fault->FaultCode() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenSoapFault_FaultSubcodeL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+    
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultSubcode());
+    TL(fault->FaultSubcode() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_FaultStringL( TTestResult& aResult )
+    {
+    	SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KString, "some string");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultString());
+    TL(fault->FaultString() == KString);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultString());
+    TL(fault->FaultString() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_FaultActorL( TTestResult& aResult )
+    {
+    	SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KActor, "some actor");
+    /*EUNIT_ASSERT_NO_LEAVEP*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultActor());
+    TL(fault->FaultActor() == KActor);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultActor());
+    TL(fault->FaultActor() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapFault_DetailL( TTestResult& aResult )
+    {
+    	SetupL();
+CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+	env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KDetail, "bla bla");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->Detail());
+    TL(fault->Detail() == KDetail);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->Detail());
+    TL(fault->Detail() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_NewLL( TTestResult& aResult )
+    {
+    	SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    TL(ConvertToPtr16LC(*msg) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_SetSecurityHeaderLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    
+    msg->SetSecurityHeaderL(KText);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*msg) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    msg->SetSecurityHeaderL(KText2);
+    //checking xml
+    _LIT16(KRef2, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text2</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef2 = KRef2();
+    TL(ConvertToPtr16LC(*msg) == ptrRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_AddSecurityTokenLL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    
+    /*EUNIT_ASSERT*/TL(msg->AddSecurityTokenL(KText)==KErrNone);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*msg) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT*/TL(msg->AddSecurityTokenL(KText2)==KErrNone);
+    //checking xml
+    _LIT16(KRef2, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">texttext2</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef2 = KRef2();
+    TL(ConvertToPtr16LC(*msg) == ptrRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenSoapMessage_ParseLL( TTestResult& aResult )
+	{
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenParser* pParser = CSenParser::NewLC();
+	CSenSoapMessage* pMessage = CSenSoapMessage::NewL();
+	pMessage->SetReader( *iXmlReader );	
+    iXmlReader->SetContentHandler(*pMessage);
+    
+    CleanupStack::PushL(pMessage);
+    
+	
+	pMessage->ParseL(KInputString);
+
+    CleanupStack::PopAndDestroy(pMessage);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    CleanupStack::PushL(hdr);
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*hdr) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(hdr);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC();
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+    
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);//Ptr
+    Teardown();
+    return KErrNone;
+    }
+
+  
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC(KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);
+    
+    //EUNIT_ASSERT_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText, KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+	CleanupStack::PushL(hdr);
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"text\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2); 
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewLC_2L( TTestResult& aResult )
+    {
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC(KText, KText);
+    TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"text\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"></wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">text</wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_BinarySecurityTokenL_1L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KNullDesC8, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:BinarySecurityToken wsu:Id=\"token\" ValueType=\"\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"></wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KText, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:BinarySecurityToken wsu:Id=\"token\" ValueType=\"text\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">text</wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* timestamp=NULL;
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created></wsu:Timestamp>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::TimestampL(KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created></wsu:Timestamp>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_TimestampL_1L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* timestamp=NULL;
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+
+     
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created><wsu:Expires>text</wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    
+    TL(CSenWsSecurityHeader::TimestampL(KText, KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::TimestampL(KText, KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created><wsu:Expires>text</wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_2L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+     
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_3L( TTestResult& aResult )
+    {
+    SetupL();
+    CSenWsSecurityHeader::TPasswordType aType = CSenWsSecurityHeader::EText;
+
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KNullDesC8, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+  
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KText, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+ 
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KNullDesC8, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KText, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_4L( TTestResult& aResult )
+    {
+    SetupL();
+   
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+
+	CSenWsSecurityHeader::TPasswordType aType = CSenWsSecurityHeader::EText;
+
+//testing NULL
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText, KText);
+    HBufC8* token=NULL;
+    token = hdr->UsernameTokenL(*provider, aType);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    provider = CSenIdentityProvider::NewL(KText, KText);
+    provider->SetUserInfoL(KText, KText2, KText);
+    token = hdr->UsernameTokenL(*provider, aType);
+    TL(token != (HBufC8*)NULL);
+    //checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    TPtr8 ptrToken2 = token->Des();
+    TL(ptrToken2 == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_NewL_1L( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*hdr) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenLL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+//testing NULL
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText, KText);
+    HBufC8* token=NULL;
+    token = hdr->UsernameTokenL(*provider);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    provider = CSenIdentityProvider::NewL(KText, KText);
+    provider->SetUserInfoL(KText, KText2, KText);
+    token = hdr->UsernameTokenL(*provider);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef2 = KRef2();
+    TPtr8 ptrToken2 = token->Des();
+    TL(ptrToken2 == ptrRef2);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_UsernameTokenL_1L( TTestResult& aResult )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    /*EUNIT_ASSERT*/TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, token)==KErrNone);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    /*EUNIT_ASSERT*/TL(CSenWsSecurityHeader::UsernameTokenL(KText, token)==KErrNone);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef2 = KRef2();
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    _LIT8(KSecurityXmlNsRef, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+        /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(hdr->XmlNs());
+    TL(hdr->XmlNs() == KSecurityXmlNsRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenUtilsBCTest::CSenWsSecurityHeader_XmlNsPrefixL( TTestResult& aResult )
+    {
+    	    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    _LIT8(KSecurityXmlNsPrefixRef, "wsse");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(hdr->XmlNsPrefix());
+    TL(hdr->XmlNsPrefix() == KSecurityXmlNsPrefixRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenUtilsBCTest::SenDateUtils_FromXmlDateTimeLL( TTestResult& aResult )
+    {
+    	    SetupL();
+    //normal
+    TTime ttime, ttime2;
+    _LIT8(KIn1, "2005-02-28T13:20:05Z");
+    _LIT(KDateTimeString1, "28-feb/05 01:20.05pm");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn1);
+    ttime2.Parse(KDateTimeString1);
+    TL(ttime == ttime2);
+    
+    //-5
+    _LIT8(KIn2, "2005-02-28T13:20:05-05:00");
+    _LIT(KDateTimeString2, "28-feb/05 08:20.05am");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn2);
+    ttime2.Parse(KDateTimeString2);
+    TL(ttime == ttime2);
+    
+    //+5
+    _LIT8(KIn3, "2005-02-28T13:20:05+05:00");
+    _LIT(KDateTimeString3, "28-feb/05 06:20.05pm");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn3);
+    ttime2.Parse(KDateTimeString3);
+    TL(ttime == ttime2);
+    
+    //1 increase precision
+    _LIT8(KIn4, "2005-02-28T13:20:05.5Z");
+    _LIT(KDateTimeString4, "20050127:132005.500000");//The month and day values are offset from zero.
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn4);
+    ttime2 = TTime(KDateTimeString4);
+    TL(ttime == ttime2);
+    
+    
+    //3 increase precision
+    _LIT8(KIn5, "2005-02-28T13:20:05.231Z");
+    _LIT(KDateTimeString5, "20050127:132005.231000");//The month and day values are offset from zero.
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn5);
+    ttime2 = TTime(KDateTimeString5);
+    TL(ttime == ttime2);
+
+    //-----------wrong
+	
+    //month
+    _LIT8(KIn6, "2005-55-28T13:20:05Z");
+    TRAPD( err, SenDateUtils::FromXmlDateTimeL(KIn6));
+    if(err != KErrOverflow) return err;
+    
+  //day
+    _LIT8(KIn7, "2005-02-58T13:20:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn7));
+    if(err != KErrOverflow) return err;
+
+    
+    //hour
+    _LIT8(KIn9, "2005-02-28T33:20:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn9));
+    if(err != KErrOverflow) return err;
+
+    //minute
+    _LIT8(KIn10, "2005-02-28T13:70:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn10));
+    if(err != KErrOverflow) return err;
+
+    //second
+    _LIT8(KIn11, "2005-02-28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn11));
+    if(err != KErrOverflow) return err;
+
+    //+hour
+    _LIT8(KIn12, "2005-02-28T13:20:05+88:00");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn12));
+    if(err != KErrOverflow) return err;
+
+    //UTC wrong designator
+    _LIT8(KIn13, "2005-02-28T13:20:65Z05:00");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn13));
+    if(err != KErrOverflow) return err;
+
+    
+    //short garbage
+    _LIT8(KIn14, "xx");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn14));
+    if(err != KErrUnderflow) return err;
+
+    //garbage year
+    _LIT8(KIn15, "xxxx-02-28T13:20:65Z");
+    //EUNIT_ASSERT_LEAVE
+    //ASSERT(SenDateUtils::FromXmlDateTimeL(KIn15));
+
+    //"-"
+    _LIT8(KIn16, "2005x02-28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn16));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn17, "2005-02x28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn17));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn18, "2005-02-28X13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn18));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn19, "2005-02-28X13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn19));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn20, "2005-02-28T13-20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn20));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn21, "2005-02-28T13:20-65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn21));
+        if(err != KErrGeneral) return err;
+
+    //31 II
+    _LIT8(KIn8, "2005-02-31T13:20:05Z");
+//    EUNIT_ASSERT_PANIC(SenDateUtils::FromXmlDateTimeL(KIn8),"USER", 3 );
+		TestModuleIf().SetExitReason (TestModuleIf(). EPanic, ETDateTimeBadDateTime);
+		SenDateUtils::FromXmlDateTimeL(KIn8);
+				
+    Teardown();
+    return KErrNone;
+}
+
+TInt CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf8LL( TTestResult& aResult )
+    {
+    SetupL();
+    //KXmlDateTimeMaxLength = 25
+    _LIT(KDate, "23:34.56");
+    _LIT8(KRef, "0000-01-01T23:34:56Z");
+    TTime ttime;
+    TInt res(0);
+    HBufC8* writeBuf;
+    TInt error  = ttime.Parse(KDate);
+    
+    //OK, more
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength+10);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult2 = writeBuf->Des();
+    // EUNIT_ASSERT_NO_LEAVE 
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf8L(ptrResult2, ttime));
+    TL(ptrResult2 == KRef);
+    delete writeBuf;
+	writeBuf = NULL; 
+
+    //OK,equal
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult3 = writeBuf->Des();
+    //EUNIT_ASSERT_NO_LEAVE
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf8L(ptrResult3, ttime));
+    TL(ptrResult3 == KRef);
+    delete writeBuf;
+	writeBuf = NULL; 
+
+    Teardown();
+		
+		TRAP(res,
+					//SetupL();
+    			//CleanupStack::PushL(iXmlReader);
+    	    //KErrOverflow
+    	    writeBuf=HBufC8::NewLC(SenDateUtils::KXmlDateTimeMaxLength - 20);
+    	    TPtr8 ptrResult = writeBuf->Des();
+    	    SenDateUtils::ToXmlDateTimeUtf8L(ptrResult, ttime);
+    	    CleanupStack::PopAndDestroy();//writeBuf
+    	    //CleanupStack::Pop();//iXmlReader
+    	    //Teardown();
+    	    );
+    if(res != KErrOverflow) 
+    	return res;
+    return KErrNone;
+    }
+
+    
+TInt CSenUtilsBCTest::SenDateUtils_ToXmlDateTimeUtf82LL( TTestResult& aResult )
+    {
+    SetupL();
+    //KXmlDateTimeMaxLength = 25
+    _LIT(KDate, "23:34.56");
+    _LIT8(KRef, "0000-01-01T23:34:56.000000Z");
+    TTime ttime;
+    TInt res(0);
+    HBufC8* writeBuf;
+    TInt error  = ttime.Parse(KDate);
+    
+    //OK, more
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength+10);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult2 = writeBuf->Des();
+    // EUNIT_ASSERT_NO_LEAVE 
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf82L(ptrResult2, ttime));
+    TL(ptrResult2 == KRef);
+    delete writeBuf;
+	writeBuf = NULL; 
+
+    //OK,equal
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult3 = writeBuf->Des();
+    //EUNIT_ASSERT_NO_LEAVE
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf82L(ptrResult3, ttime));
+    TL(ptrResult3 == KRef);
+    delete writeBuf;
+	writeBuf = NULL; 
+
+    Teardown();
+		TRAP(res,
+    	    //KErrOverflow
+    	    writeBuf=HBufC8::NewLC(SenDateUtils::KXmlDateTimeMaxLength - 20);
+    	    TPtr8 ptrResult = writeBuf->Des();
+    	    SenDateUtils::ToXmlDateTimeUtf82L(ptrResult, ttime);
+    	    CleanupStack::PopAndDestroy();//writeBuf
+    	    );    				
+    if(res != KErrOverflow) 
+    	return res;
+    return KErrNone;
+    }
+    
+TInt CSenUtilsBCTest::SenTransportProperties_FileAttachmentLL(TTestResult& aResult )
+{
+    SetupL();
+
+	CSenTransportProperties* transProp = CSenTransportProperties::NewLC();
+    HBufC8* value = NULL;
+    TL(transProp->FileAttachmentL(_L8("1"),value) == KErrNotFound);
+    TL(value == (HBufC8*)NULL);
+    
+    transProp->SetFileAttachmentL(_L8("1"),_L8("abcd"));
+    TL(transProp->FileAttachmentL(_L8("1"),value) == KErrNone);
+    TL(*value ==  _L8("abcd"));
+
+    delete value;
+    CleanupStack::PopAndDestroy(transProp);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL();
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewLCL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC();
+
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewL_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenXmlProperties_NewLC_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC(KString,*pParser);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewL_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL(*pElement);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenXmlProperties_NewLC_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC(*pElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_NewLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);	
+	if(pElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewLCL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewLC();
+	if(pElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewL_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewLC_1L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewLC(KString,*pParser);
+
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewL_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewL(*pElement);
+	CleanupStack::PushL(pXmlElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+TInt CSenUtilsBCTest::SenTransportProperties_NewLC_2L(TTestResult& aResult )
+{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties *pXmlElement=CSenTransportProperties::NewLC(*pElement);
+	if(pXmlElement)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) KErrArgument;
+	CleanupStack::PopAndDestroy(pXmlElement);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+	
+
+TInt CSenUtilsBCTest::SenTransportProperties_AsUtf8LL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>value</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    HBufC8* Utf8Buf=pElement->AsUtf8L();
+    TL(*Utf8Buf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);    
+    delete Utf8Buf;
+    Teardown();
+    return KErrNone;
+	}
+	        
+TInt CSenUtilsBCTest::SenTransportProperties_SetPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>value</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenUtilsBCTest::SenTransportProperties_PropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KValue,"Value");
+	TPtrC8 ValuePtr;
+	TPtrC8 ValuePtr1;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    
+    //true case
+    TInt retval=pElement->PropertyL(_L8("Property"),ValuePtr);
+    TL(retval == KErrNone);
+      
+    //false case
+    retval=pElement->PropertyL(_L8("NoProperty"),ValuePtr1);
+    TL(retval == KErrNotFound);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_SetIntPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>10</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetIntPropertyL(_L8("Property"),10);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval==KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_IntPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	TInt PropValue;
+	TInt PropValue1;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIntPropertyL(_L8("Property"),10);
+    //true case
+    TInt retval=pElement->IntPropertyL(_L8("Property"),PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    //false case
+    retval=pElement->IntPropertyL(_L8("NoProperty"),PropValue1);
+    TL(retval == KErrNotFound);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_SetBoolPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Property>true</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetBoolPropertyL(_L8("Property"),1);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);		
+	delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_BoolPropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool BoolValue=1;
+	TBool BoolValue1;
+	TBool BoolValue2;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetBoolPropertyL(_L8("Property"),BoolValue);
+    //true case
+    TInt retval=pElement->BoolPropertyL(_L8("Property"),BoolValue1);
+    TL(retval == KErrNone);
+    TL(BoolValue == BoolValue1);
+    //false case
+    retval=pElement->BoolPropertyL(_L8("NoProperty"),BoolValue2);
+    TL(retval == KErrNotFound);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_SetOmittedLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KText,"<Properties><Property Omitted=\"true\">value</Property></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    TInt retval=pElement->SetOmittedL(_L8("Property"),1);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+TInt CSenUtilsBCTest::SenTransportProperties_RemovePropertyLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KText,"<Properties><Property1>value</Property1><Property2>value</Property2></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property1"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property2"),_L8("value"));
+    //True
+    TInt retval=pElement->RemovePropertyL(_L8("Property"));
+    HBufC8* ElementBuf=pElement->AsUtf8L(); 
+    TL(retval == KErrNone);
+    //False
+    retval=pElement->RemovePropertyL(_L8("NoProperty"));
+    TL(retval == KErrNotFound);
+    TL(*ElementBuf == KText);
+    CleanupStack::PopAndDestroy(pElement);	
+	delete ElementBuf;			
+	ElementBuf=NULL;
+    Teardown();
+    return KErrNone;
+   	}
+   	/*
+TInt CSenUtilsBCTest::SenTransportProperties_CloneLL()
+	{
+	_LIT8(KCloneText,"<Properties><Property>value</Property><Property1>value</Property1></Properties>");
+	TInt okRnotok;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property1"),_L8("value"));
+    MSenProperties* pCloneElement=pElement->Clone(okRnotok);
+    CleanupStack::PushL(pCloneElement);
+    HBufC8* CloneElementBuf=pCloneElement->AsUtf8L();
+    EUNIT_ASSERT_EQUALS(*CloneElementBuf,KCloneText);
+    EUNIT_ASSERT_EQUALS(okRnotok,KErrNone);
+	delete CloneElementBuf;				
+	CleanupStack::PopAndDestroy(pCloneElement);
+	CleanupStack::PopAndDestroy(pElement);
+	}
+*/
+TInt CSenUtilsBCTest::SenTransportProperties_HeartbeatLL(TTestResult& aResult )
+{
+    SetupL();
+	TInt Delta=10;
+	TInt Delta1;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetHeartbeatL(Delta);
+    TInt retval=pElement->HeartbeatL(Delta1);
+    TL(retval == KErrNone);
+    TL(Delta1 == Delta);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetHeartbeatLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><Heartbeat>10</Heartbeat></Properties>");
+	TInt Delta=10;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetHeartbeatL(Delta);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);	
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_IapIdLL(TTestResult& aResult )
+{
+    SetupL();
+	TUint32 Delta;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIapIdL(101);
+    TInt retval=pElement->IapIdL(Delta);
+	TL(retval == KErrNone);
+    TL(Delta == 101);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetIapIdLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><IapId>101</IapId></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIapIdL(101);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ProxyPortLL(TTestResult& aResult )
+{
+    SetupL();
+	TInt PortNum;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyPortL(8080);
+    TInt retval=pElement->ProxyPortL(PortNum);
+    TL(retval == KErrNone);
+    TL(PortNum == 8080);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetProxyPortLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><ProxyPort>8080</ProxyPort></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyPortL(8080);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ProxyHostLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 host;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyHostL(_L8("tcp.mws.mobile.msn-ppe.com"));
+    TInt retval=pElement->ProxyHostL(host);
+    TL(retval == KErrNone);
+    TL(host == _L8("tcp.mws.mobile.msn-ppe.com"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetProxyHostLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><ProxyHost>tcp.mws.mobile.msn-ppe.com</ProxyHost></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyHostL(_L8("tcp.mws.mobile.msn-ppe.com"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}	
+        
+TInt CSenUtilsBCTest::SenTransportProperties_ProxyUsageLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Usage;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyUsageL(TRUE);
+    TInt retval=pElement->ProxyUsageL(Usage);
+    TL(retval == KErrNone);
+    TL(Usage == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetProxyUsageLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><ProxyUsage>true</ProxyUsage></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyUsageL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SecureDialogLL(TTestResult& aResult )
+{
+    SetupL();
+	TBool Security;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSecureDialogL(TRUE);
+    TInt retval=pElement->SecureDialogL(Security);
+    TL(retval == KErrNone);
+    TL(Security == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetSecureDialogLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><SecureDialog>true</SecureDialog></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSecureDialogL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_UserAgentLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 UserAgent;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetUserAgentL(_L8("TestAgent"));
+    TInt retval=pElement->UserAgentL(UserAgent);
+    TL(retval == KErrNone);
+    TL(UserAgent ==_L8("TestAgent"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetUserAgentLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><User-Agent>TestAgent</User-Agent></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetUserAgentL(_L8("TestAgent"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+	}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_DeviceIDLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 DeviceID;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDeviceIDL(_L8("TestDevice"));
+    TInt retval=pElement->DeviceIDL(DeviceID);
+    TL(retval == KErrNone);
+    TL(DeviceID == _L8("TestDevice"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetDeviceIDLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><DeviceID>TestDevice</DeviceID></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDeviceIDL(_L8("TestDevice"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SoapActionLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 SoapURI;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TInt retval=pElement->SoapActionL(SoapURI);
+    TL(retval == KErrNone);
+	TL(SoapURI == _L8("URI-referenceRFC2396"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SetSoapActionLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><SOAPAction>URI-referenceRFC2396</SOAPAction></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_DownloadFolderLL(TTestResult& aResult )
+{
+    SetupL();
+	TPtrC8 Download;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDownloadFolderL(_L8("Download"));
+    TInt retval=pElement->DownloadFolderL(Download);
+    TL(retval == KErrNone);
+	TL(Download ==_L8("Download"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SetDownloadFolderLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><DownloadFolder>Download</DownloadFolder></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDownloadFolderL(_L8("Download"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf==KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+        
+   
+TInt CSenUtilsBCTest::SenTransportProperties_SetFileAttachmentLL(TTestResult& aResult )
+{
+    SetupL();
+	_LIT8(KElementText,"<Properties><FileAttachments>&lt;Attachments&gt;&lt;Attachment0 cid=&quot;test:cid&quot;&gt;c:\\test.file.txt&lt;/Attachment0&gt;&lt;/Attachments&gt;</FileAttachments></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetFileAttachmentL(_L8("test:cid"),_L8("c:\\test.file.txt"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf==KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_MwsNamespaceLL(TTestResult& aResult )
+{
+    SetupL();
+	
+	TPtrC8 NameSpace;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMwsNamespaceL(_L8("Mwsnsuri"));
+    TInt retval=pElement->MwsNamespaceL(NameSpace);
+    TL(retval == KErrNone);
+	TL(NameSpace == _L8("Mwsnsuri"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+        
+TInt CSenUtilsBCTest::SenTransportProperties_SetMwsNamespaceLL(TTestResult& aResult )
+{
+    SetupL();
+
+	
+	_LIT8(KElementText,"<Properties><MwsNamespace>Mwsnsuri</MwsNamespace></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMwsNamespaceL(_L8("Mwsnsuri"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_MessageIdLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TPtrC8 MsgId;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMessageIdL(_L8("test-message"));
+    TInt retval=pElement->MessageIdL(MsgId);
+    TL(retval == KErrNone);
+	TL(MsgId == _L8("test-message"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetMessageIdLL(TTestResult& aResult )
+{
+    SetupL();
+
+	_LIT8(KElementText,"<Properties><MessageID>test-message</MessageID></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMessageIdL(_L8("test-message"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_OnewayMessageOnOffLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TBool OnRoff;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    TInt retval=pElement->OnewayMessageOnOffL(OnRoff);
+    TL(retval == KErrNone);
+	TL(OnRoff == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetOnewayMessageOnOffLL( TTestResult& aResult)
+{
+
+    SetupL();
+
+	_LIT8(KElementText,"<Properties><OneWayMessage>true</OneWayMessage></Properties>");
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMaxTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MaxTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_MaxTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenTransportProperties_SetMaxTimeToLiveLL( Result);
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMinTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MinTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_SetReaderL(TTestResult& aResult )
+{
+    SetupL();
+
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetReader(*iXmlReader);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_PropertiesClassTypeL(TTestResult& aResult )
+{
+    SetupL();
+	MSenProperties::TSenPropertiesClassType var = MSenProperties::ESenTransportProperties;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TL(var == pElement->PropertiesClassType());
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_WriteToLL(TTestResult& aResult )
+{
+    SetupL();
+
+    TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	
+	CSenTransportProperties* pElement1= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement1);
+    pElement1->WriteToL(ElemntStream);
+    
+    CleanupStack::PopAndDestroy(pElement1);
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ReadFromLL(TTestResult& aResult )
+{
+    SetupL();
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->ReadFromL(_L8(""));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_CloneL(TTestResult& aResult )
+{
+	SetupL();
+	TBool Flag;
+	TInt var;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties* pClone = NULL;
+    pClone = (CSenTransportProperties*)pElement->Clone(var); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_IsSafeToCastL(TTestResult& aResult )
+{
+	SetupL();
+	TBool Flag, retVal;
+	MSenProperties::TSenPropertiesClassType pVar = MSenProperties::ESenTransportProperties;
+	
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+	
+    retVal = pElement->IsSafeToCast(pVar); 
+    if(retVal != EFalse)
+    	Flag = 1;
+    else 
+   	    Flag = 0; 
+
+	MSenProperties::TSenPropertiesClassType xVar = MSenProperties::ESenXmlProperties;
+    retVal = pElement->IsSafeToCast(xVar); 
+    if(retVal != EFalse)
+    	Flag = 1;
+    else 
+   	    return KErrArgument; 
+    
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_CloneLL(TTestResult& aResult )
+{
+	SetupL();
+	TBool Flag;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+	CSenTransportProperties* pClone = NULL;
+    pClone = (CSenTransportProperties*)pElement->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+TInt CSenUtilsBCTest::SenTransportProperties_ApplyBindingLL(TTestResult& aResult )
+{
+	SetupL();
+	TSOAPVersion var = ESOAP11;
+	CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+	CleanupStack::PushL(pElement);
+    pElement->ApplyBindingL(var); 
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+
+TInt CSenUtilsBCTest::SenTransportProperties_MinTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenTransportProperties_SetMinTimeToLiveLL(Result);
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenHttpTransportProperties	*pProperties = CSenHttpTransportProperties::NewL();
+	CleanupStack::PushL(pProperties );
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLCL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenHttpTransportProperties	*pProperties = CSenHttpTransportProperties::NewLC();
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewL_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLC_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewLC(KString,*pParser);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewL_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewL(*pElement);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+		
+}
+
+TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLC_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewLC(*pElement);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+	
+}
+/*
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenVtcpTransportProperties	*pProperties = CSenVtcpTransportProperties::NewL();
+	CleanupStack::PushL(pProperties );
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLCL(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenVtcpTransportProperties	*pProperties = CSenVtcpTransportProperties::NewLC();
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(! Flag) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+	
+}
+
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewL_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content plus some other content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewL(KString,*pParser);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+		
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_1L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	_LIT8(KString,"<parent><element1/><element2/><element3/>parent content plus some other content</parent>");
+	CSenXmlReader* pParser = CSenXmlReader::NewL();
+	CleanupStack::PushL(pParser);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewLC(KString,*pParser);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+	
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewL_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewL(*pElement);
+	CleanupStack::PushL(pProperties);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+		 
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_NewLC_2L(TTestResult& aResult)
+{
+    SetupL();
+
+	TBool Flag;
+	CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	CSenVtcpTransportProperties *pProperties=CSenVtcpTransportProperties::NewLC(*pElement);
+	if(pProperties)
+		Flag=1;
+	else
+		Flag=0;
+	if(!( Flag )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pProperties);
+	CleanupStack::PopAndDestroy(pElement);	 
+    Teardown();
+    return KErrNone;
+	
+}
+    
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_OnewayMessageOnOffLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TBool OnRoff;
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    TInt retval=pElement->OnewayMessageOnOffL(OnRoff);
+    TL(retval == KErrNone);
+	TL(OnRoff == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_SetOnewayMessageOnOffLL( TTestResult& aResult)
+{
+
+    SetupL();
+
+	_LIT8(KElementText,"<Properties><OneWayMessage>true</OneWayMessage></Properties>");
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_SetMaxTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMaxTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MaxTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_MaxTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenVtcpTransportProperties_SetMaxTimeToLiveLL( Result);
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult )
+{
+    SetupL();
+
+	TInt PropValue;
+	CSenVtcpTransportProperties* pElement= CSenVtcpTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMinTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MinTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CSenUtilsBCTest::SenVtcpTransportProperties_MinTimeToLiveLL(TTestResult& aResult )
+{
+	TTestResult Result;
+	SenVtcpTransportProperties_SetMinTimeToLiveLL(Result);
+}
+*/
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/BWINSCW/senutilsTestCasesU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/conf/senutilsTestCases.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,805 @@
+[Test]
+title NewL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj NewL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetBodyL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj SetBodyL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title BodyL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj BodyL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title HeaderL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj HeaderL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddHeaderL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj AddHeaderL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title BodyAsStringL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj BodyAsStringL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title DetachFaultL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj DetachFaultL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj FaultL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title SoapAction-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj SoapAction-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title SoapAction2-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj SoapAction2-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasHeader-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj HasHeader-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title SoapVersion-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj SoapVersion-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasBody-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj HasBody-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsFault-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj IsFault-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParseL-CSenSoapEnvelope
+create senutilsTestCases obj 
+obj ParseL-CSenSoapEnvelope 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapFault
+create senutilsTestCases obj 
+obj NewL-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapFault
+create senutilsTestCases obj 
+obj NewL-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultCode-CSenSoapFault
+create senutilsTestCases obj 
+obj FaultCode-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultSubcode-CSenSoapFault
+create senutilsTestCases obj 
+obj FaultSubcode-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultString-CSenSoapFault
+create senutilsTestCases obj 
+obj FaultString-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultActor-CSenSoapFault
+create senutilsTestCases obj 
+obj FaultActor-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title Detail-CSenSoapFault
+create senutilsTestCases obj 
+obj Detail-CSenSoapFault 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapMessage
+create senutilsTestCases obj 
+obj NewL-CSenSoapMessage 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetSecurityHeaderL-CSenSoapMessage
+create senutilsTestCases obj 
+obj SetSecurityHeaderL-CSenSoapMessage 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddSecurityTokenL-CSenSoapMessage
+create senutilsTestCases obj 
+obj AddSecurityTokenL-CSenSoapMessage 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj NewL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParseL-CSenSoapMessage
+create senutilsTestCases obj 
+obj ParseL-CSenSoapMessage 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj NewLC-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj NewL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj NewLC-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj NewL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj NewLC-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title BinarySecurityToken-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj BinarySecurityToken-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title BinarySecurityToken1-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj BinarySecurityToken1-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj UsernameTokenL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title TimestampL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj TimestampL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title TimestampL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj TimestampL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj UsernameTokenL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj UsernameTokenL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj UsernameTokenL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj UsernameTokenL-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlNs-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj XmlNs-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlNsPrefix-CSenWsSecurityHeader
+create senutilsTestCases obj 
+obj XmlNsPrefix-CSenWsSecurityHeader 
+delete obj 
+[Endtest] 
+
+[Test]
+title FromXmlDateTimeL-SenDateUtils
+create senutilsTestCases obj 
+obj FromXmlDateTimeL-SenDateUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title ToXmlDateTimeUtf8L-SenDateUtils
+create senutilsTestCases obj 
+obj ToXmlDateTimeUtf8L-SenDateUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title ToXmlDateTimeUtf82L-SenDateUtils
+create senutilsTestCases obj 
+obj ToXmlDateTimeUtf82L-SenDateUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title FileAttachmentL-CSenTransportProperties
+create senutilsTestCases obj 
+obj FileAttachmentL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlProperties
+create senutilsTestCases obj 
+obj NewL-CSenXmlProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlProperties
+create senutilsTestCases obj 
+obj NewLC-CSenXmlProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlProperties
+create senutilsTestCases obj 
+obj NewL-CSenXmlProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlProperties
+create senutilsTestCases obj 
+obj NewLC-CSenXmlProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlProperties
+create senutilsTestCases obj 
+obj NewL-CSenXmlProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlProperties
+create senutilsTestCases obj 
+obj NewLC-CSenXmlProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenTransportProperties
+create senutilsTestCases obj 
+obj NewL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenTransportProperties
+create senutilsTestCases obj 
+obj NewLC-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenTransportProperties
+create senutilsTestCases obj 
+obj NewL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenTransportProperties
+create senutilsTestCases obj 
+obj NewLC-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenTransportProperties
+create senutilsTestCases obj 
+obj NewL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenTransportProperties
+create senutilsTestCases obj 
+obj NewLC-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsUtf8L-CSenTransportProperties
+create senutilsTestCases obj 
+obj AsUtf8L-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetPropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title PropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj PropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetIntPropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetIntPropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title PropertyL1-CSenTransportProperties
+create senutilsTestCases obj 
+obj PropertyL1-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title IntPropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj IntPropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetBoolPropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetBoolPropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title BoolPropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj BoolPropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetOmittedL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetOmittedL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemovePropertyL-CSenTransportProperties
+create senutilsTestCases obj 
+obj RemovePropertyL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title HeartbeatL_CSenTransportProperties
+create senutilsTestCases obj 
+obj HeartbeatL_CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetHeartbeatL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetHeartbeatL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title IapIdL-CSenTransportProperties
+create senutilsTestCases obj 
+obj IapIdL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetIapIdL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetIapIdL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title ProxyPortL-CSenTransportProperties
+create senutilsTestCases obj 
+obj ProxyPortL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetProxyPortL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetProxyPortL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title ProxyHostL-CSenTransportProperties
+create senutilsTestCases obj 
+obj ProxyHostL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetProxyHostL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetProxyHostL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title ProxyUsageL-CSenTransportProperties
+create senutilsTestCases obj 
+obj ProxyUsageL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetProxyUsageL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetProxyUsageL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SecureDialogL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SecureDialogL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetSecureDialogL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetSecureDialogL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title UserAgentL-CSenTransportProperties
+create senutilsTestCases obj 
+obj UserAgentL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetUserAgentL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetUserAgentL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title DeviceIDL-CSenTransportProperties
+create senutilsTestCases obj 
+obj DeviceIDL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetDeviceIDL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetDeviceIDL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SoapActionL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SoapActionL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetSoapActionL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetSoapActionL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title DownloadFolderL-CSenTransportProperties
+create senutilsTestCases obj 
+obj DownloadFolderL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetDownloadFolderL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetDownloadFolderL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetFileAttachmentL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetFileAttachmentL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title MwsNamespaceL-CSenTransportProperties
+create senutilsTestCases obj 
+obj MwsNamespaceL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetMwsNamespaceL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetMwsNamespaceL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title MessageIdL-CSenTransportProperties
+create senutilsTestCases obj 
+obj MessageIdL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetMessageIdL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetMessageIdL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title OnewayMessageOnOffL-CSenTransportProperties
+create senutilsTestCases obj 
+obj OnewayMessageOnOffL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetOnewayMessageOnOffL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetOnewayMessageOnOffL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetMaxTimeToLiveL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetMaxTimeToLiveL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title MaxTimeToLiveL-CSenTransportProperties
+create senutilsTestCases obj 
+obj MaxTimeToLiveL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetMaxTimeToLiveL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetMaxTimeToLiveL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title MinTimeToLiveL-CSenTransportProperties
+create senutilsTestCases obj 
+obj MinTimeToLiveL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetMinTimeToLiveL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetMinTimeToLiveL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetReaderL-CSenTransportProperties
+create senutilsTestCases obj 
+obj SetReaderL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title PropertiesClassTypeL-CSenTransportProperties
+create senutilsTestCases obj 
+obj PropertiesClassTypeL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title WriteToLL-CSenTransportProperties
+create senutilsTestCases obj 
+obj WriteToLL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title ReadFromLL-CSenTransportProperties
+create senutilsTestCases obj 
+obj ReadFromLL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title CloneL-CSenTransportProperties
+create senutilsTestCases obj 
+obj CloneL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsSafeToCastL-CSenTransportProperties
+create senutilsTestCases obj 
+obj IsSafeToCastL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title CloneLL-CSenTransportProperties
+create senutilsTestCases obj 
+obj CloneLL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title ApplyBindingLL-CSenTransportProperties
+create senutilsTestCases obj 
+obj ApplyBindingLL-CSenTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenHttpTransportProperties
+create senutilsTestCases obj 
+obj NewL-CSenHttpTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenHttpTransportProperties
+create senutilsTestCases obj 
+obj NewLC-CSenHttpTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenHttpTransportProperties
+create senutilsTestCases obj 
+obj NewL-CSenHttpTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenHttpTransportProperties
+create senutilsTestCases obj 
+obj NewLC-CSenHttpTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenHttpTransportProperties
+create senutilsTestCases obj 
+obj NewL-CSenHttpTransportProperties 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenHttpTransportProperties
+create senutilsTestCases obj 
+obj NewLC-CSenHttpTransportProperties 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/eabi/senutilsTestCasesu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senutilscases
+*
+*/
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+senutilsTestCases.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senutilstestcases 
+*
+*/
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          senutilsTestCases.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         senutilsTestCases.def
+
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          senutilsTestCases.cpp
+SOURCE          senutilsTestCasesBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/xml
+SYSTEMINCLUDE   /epoc32/include/libc
+
+LIBRARY     euser.lib
+LIBRARY     stiftestinterface.lib
+LIBRARY		efsrv.lib
+LIBRARY		imut.lib // base64 enc/dec
+LIBRARY		estor.lib
+LIBRARY		XMLFRAMEWORK.lib
+LIBRARY 	bafl.lib
+LIBRARY 	commdb.lib
+LIBRARY 	flogger.lib
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+LIBRARY   SENSERVCONN.lib
+LIBRARY		SENSERVDESC.LIB
+LIBRARY		SenXml.lib
+LIBRARY		SenServMgr.lib
+//LIBRARY		SenXmlInterface.lib // after Symbian XML integration it has to be removed
+LIBRARY		SenUtils.lib
+LIBRARY		SenMessages.lib
+LIBRARY 	SenHostConn.lib
+LIBRARY 	SenFragment.lib
+#else
+LIBRARY   wsservconn.lib
+LIBRARY		wsservdesc.lib
+LIBRARY		wsxml.lib
+LIBRARY		wsservmgr.lib
+//LIBRARY		SenXmlInterface.lib // after Symbian XML integration it has to be removed
+LIBRARY		wsutils.lib
+LIBRARY		wsmessages.lib
+LIBRARY 	wshostconn.lib
+LIBRARY 	wsfragment.lib
+#endif
+LIBRARY         stiftestengine.lib
+
+LANG            SC
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+LIBRARY                 XmlEngine.lib
+LIBRARY                 XmlEngineDOM.lib
+LIBRARY                 XmlEngineUtils.lib
+#else
+LIBRARY         WsStarXmlEngine.lib
+LIBRARY         WsStarXmlEngineDOM.lib
+LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\senutilsTestCases.dll"   -   "c:\Sys\Bin\senutilsTestCases.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\senutilsTestCases.cfg"-"c:\testing\conf\senutilsTestCases.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/inc/senutilsTestCases.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,427 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENUTILSTESTCASES_H
+#define SENUTILSTESTCASES_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+#include <SenParser.h>
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+#include <SenIdentityProvider.h>
+#include <SenNameSpace.h>
+//#include <SenSoapEnvelope.h>
+#include <SenSoapFault.h>
+#include <SenSoapMessage.h>
+#include <SenWsSecurityHeader.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+#include <SenTransportProperties.h>
+#include <SenHttpTransportProperties.h>
+//#include <SenVtcpTransportProperties.h>
+#include <f32file.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KsenutilsTestCasesLogPath, "\\logs\\testframework\\senutilsTestCases\\" ); 
+// Log file
+_LIT( KsenutilsTestCasesLogFile, "senutilsTestCases.txt" ); 
+_LIT( KsenutilsTestCasesLogFileWithTitle, "senutilsTestCases_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CsenutilsTestCases;
+class CSenBaseAttribute;
+class CSenBaseFragment;
+class CSenSoapMessage;
+class CSenIdentityProvider;
+class CSenGuidGen;
+class CSenDomFragment;
+class CSenSoapFault;
+class CSenXmlServiceDescription;
+class CSenSoapEnvelope;
+class CSenWsSecurityHeader;
+class SenXmlUtils;
+class CSenBaseElement;
+class MSenElement;
+class CSenXmlReader;
+class SenDateUtils;
+class CSenNamespace;
+
+namespace{
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+    _LIT8(KXmlSpecific, "\"&<>");
+    _LIT8(KFaultMessage, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault></S:Body></S:Envelope>");
+    _LIT8(KSOAPMessageNS, "<tns:Envelope xmlns:tns=\"http://schemas.xmlsoap.org/soap/envelope/\"><tns:Header/><tns:Body><ab:QueryResponse xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:Status code=\"OK\"/><ab:Data>Hard Coded response, alway the same</ab:Data></ab:QueryResponse></tns:Body></tns:Envelope>");
+    _LIT8(KSOAPMessageNSInside, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><ab:QueryResponse xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:Status code=\"OK\"/><ab:Data>Hard Coded response, alway the same</ab:Data></ab:QueryResponse></S:Body></S:Envelope>");
+    _LIT8(KSOAPMessage,  "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+}
+typedef TInt (CsenutilsTestCases::* TestFunction)( CStifItemParser&);
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CsenutilsTestCases test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CsenutilsTestCases) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CsenutilsTestCases* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CsenutilsTestCases();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CsenutilsTestCases( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        
+        void SetupL();
+        void Teardown();
+
+        TPtr16 ConvertToPtr16LC(CSenBaseFragment &fragment);
+        TPtr16 ConvertToPtr16LC(MSenElement &element);
+         TInt CSenSoapEnvelope_NewLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_SetBodyLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_BodyLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_HeaderLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_AddHeaderLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_BodyAsStringLL(CStifItemParser& aItem);
+         
+         TInt CSenSoapEnvelope_DetachFaultLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_FaultLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_SetSoapActionLL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_SoapActionL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_SoapAction2L(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_HasHeaderL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_SoapVersionL(CStifItemParser& aItem);
+         TInt CSenSoapEnvelope_HasBodyL(CStifItemParser& aItem);
+		 TInt CSenSoapEnvelope_IsFaultL(CStifItemParser& aItem);
+		 TInt CSenSoapEnvelope_ParseLL(CStifItemParser& aItem);
+        
+         TInt CSenSoapFault_NewLL(CStifItemParser& aItem);
+         TInt CSenSoapFault_NewL_1L(CStifItemParser& aItem);
+         TInt CSenSoapFault_FaultCodeL(CStifItemParser& aItem);
+         TInt CSenSoapFault_FaultSubcodeL(CStifItemParser& aItem);
+         TInt CSenSoapFault_FaultStringL(CStifItemParser& aItem);
+         TInt CSenSoapFault_FaultActorL(CStifItemParser& aItem);
+         TInt CSenSoapFault_DetailL(CStifItemParser& aItem);
+
+         TInt CSenSoapMessage_NewLL(CStifItemParser& aItem);
+         TInt CSenSoapMessage_NewL_1L(CStifItemParser& aItem);
+         TInt CSenSoapMessage_NewL_2L(CStifItemParser& aItem);
+         TInt CSenSoapMessage_SetSecurityHeaderLL(CStifItemParser& aItem);
+         TInt CSenSoapMessage_AddSecurityTokenLL(CStifItemParser& aItem);
+		 TInt CSenSoapMessage_ParseLL(CStifItemParser& aItem);
+         
+
+         TInt CSenWsSecurityHeader_NewLL(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_NewLCL(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_NewL_1L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_NewLC_1L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_NewL_2L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_NewLC_2L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_BinarySecurityTokenL_L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_BinarySecurityTokenL_1L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_TimestampL_L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_TimestampL_1L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_UsernameTokenLL(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_UsernameTokenL_1L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_UsernameTokenL_2L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_UsernameTokenL_3L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_UsernameTokenL_4L(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_XmlNsL(CStifItemParser& aItem);
+         TInt CSenWsSecurityHeader_XmlNsPrefixL(CStifItemParser& aItem);
+        
+         TInt SenDateUtils_FromXmlDateTimeLL(CStifItemParser& aItem);
+         TInt SenDateUtils_ToXmlDateTimeUtf8LL(CStifItemParser& aItem);
+         TInt SenDateUtils_ToXmlDateTimeUtf82LL(CStifItemParser& aItem);
+        
+         TInt SenTransportProperties_FileAttachmentLL(CStifItemParser& aItem);
+         //TInt SenTransportProperties_SetFileAttachmentsLL(CStifItemParser& aItem);
+         
+         TInt SenXmlProperties_NewLL(CStifItemParser& aItem);
+         TInt SenXmlProperties_NewLCL(CStifItemParser& aItem);
+		 TInt SenXmlProperties_NewL_1L(CStifItemParser& aItem);
+		 TInt SenXmlProperties_NewLC_1L(CStifItemParser& aItem);
+         TInt SenXmlProperties_NewL_2L(CStifItemParser& aItem);
+         TInt SenXmlProperties_NewLC_2L(CStifItemParser& aItem);
+         
+        TInt SenTransportProperties_NewLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_NewLCL(CStifItemParser& aItem);
+        TInt SenTransportProperties_NewL_1L(CStifItemParser& aItem);
+        TInt SenTransportProperties_NewLC_1L(CStifItemParser& aItem);
+        TInt SenTransportProperties_NewL_2L(CStifItemParser& aItem);
+        TInt SenTransportProperties_NewLC_2L(CStifItemParser& aItem);
+		TInt SenTransportProperties_SetReaderL(CStifItemParser& aItem);
+        TInt SenTransportProperties_PropertiesClassTypeL(CStifItemParser& aItem);
+        TInt SenTransportProperties_WriteToLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_ReadFromLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_AsUtf8LL(CStifItemParser& aItem);
+        TInt SenTransportProperties_AsUtf8LCL(CStifItemParser& aItem);
+        TInt SenTransportProperties_SetPropertyLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_PropertyLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_SetIntPropertyLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_PropertyL1L(CStifItemParser& aItem);
+        TInt SenTransportProperties_IntPropertyLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_SetBoolPropertyLL(CStifItemParser& aItem);        
+        TInt SenTransportProperties_BoolPropertyLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_SetOmittedLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_RemovePropertyLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_IsSafeToCastL(CStifItemParser& aItem);
+		TInt SenTransportProperties_CloneLL(CStifItemParser& aItem);
+        TInt SenTransportProperties_CloneL(CStifItemParser& aItem);
+        TInt SenTransportProperties_ApplyBindingLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_HeartbeatLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetHeartbeatLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_IapIdLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetIapIdLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_ProxyPortLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetProxyPortLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_ProxyHostLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetProxyHostLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_ProxyUsageLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetProxyUsageLL(CStifItemParser& aItem);
+
+				TInt SenTransportProperties_SecureDialogLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetSecureDialogLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_UserAgentLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_SetUserAgentLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_DeviceIDLL(CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetDeviceIDLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_SoapActionLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_SetSoapActionLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_DownloadFolderLL(CStifItemParser& aItem);
+        
+        TInt SenTransportProperties_SetDownloadFolderLL(CStifItemParser& aItem );
+               
+        TInt SenTransportProperties_SetFileAttachmentLL( CStifItemParser& aItem);
+
+        TInt SenTransportProperties_MwsNamespaceLL(CStifItemParser& aItem );
+        
+        TInt SenTransportProperties_SetMwsNamespaceLL(CStifItemParser& aItem );
+
+        TInt SenTransportProperties_MessageIdLL(CStifItemParser& aItem );
+
+        TInt SenTransportProperties_SetMessageIdLL( CStifItemParser& aItem);
+
+        TInt SenTransportProperties_OnewayMessageOnOffLL( CStifItemParser& aItem);
+
+        TInt SenTransportProperties_SetOnewayMessageOnOffLL(CStifItemParser& aItem );
+        
+        TInt SenTransportProperties_SetMaxTimeToLiveLL(CStifItemParser& aItem);
+        
+		TInt SenTransportProperties_MaxTimeToLiveLL(CStifItemParser& aItem);
+		
+		TInt SenTransportProperties_SetMinTimeToLiveLL(CStifItemParser& aItem);
+		
+		TInt SenTransportProperties_MinTimeToLiveLL(CStifItemParser& aItem);
+
+		TInt SenHttpTransportProperties_NewLL(CStifItemParser& aItem);
+		
+		TInt SenHttpTransportProperties_NewLCL(CStifItemParser& aItem);
+
+		TInt SenHttpTransportProperties_NewL_1L(CStifItemParser& aItem);
+		
+		TInt SenHttpTransportProperties_NewLC_1L(CStifItemParser& aItem);
+
+		TInt SenHttpTransportProperties_NewL_2L(CStifItemParser& aItem);
+		
+		TInt SenHttpTransportProperties_NewLC_2L(CStifItemParser& aItem);
+		
+		TInt SenVtcpTransportProperties_NewLL(CStifItemParser& aItem);
+		
+		TInt SenVtcpTransportProperties_NewLCL(CStifItemParser& aItem);
+
+		TInt SenVtcpTransportProperties_NewL_1L(CStifItemParser& aItem);
+		
+		TInt SenVtcpTransportProperties_NewLC_1L(CStifItemParser& aItem);
+
+		TInt SenVtcpTransportProperties_NewL_2L(CStifItemParser& aItem);
+		
+		TInt SenVtcpTransportProperties_NewLC_2L(CStifItemParser& aItem);
+
+        TInt SenVtcpTransportProperties_OnewayMessageOnOffLL( CStifItemParser& aItem);
+
+        TInt SenVtcpTransportProperties_SetOnewayMessageOnOffLL(CStifItemParser& aItem );
+        
+        TInt SenVtcpTransportProperties_SetMaxTimeToLiveLL(CStifItemParser& aItem);
+        
+		TInt SenVtcpTransportProperties_MaxTimeToLiveLL(CStifItemParser& aItem);
+		
+		TInt SenVtcpTransportProperties_SetMinTimeToLiveLL(CStifItemParser& aItem);
+		
+		TInt SenVtcpTransportProperties_MinTimeToLiveLL(CStifItemParser& aItem);
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+    TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENUTILSTESTCASES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\senutilsTestCases.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/src/senutilsTestCases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senutilsTestCases.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenutilsTestCases::CsenutilsTestCases
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CsenutilsTestCases::CsenutilsTestCases( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CsenutilsTestCases::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CsenutilsTestCases::ConstructL()
+    {
+
+    iLog = CStifLogger::NewL( KsenutilsTestCasesLogPath, 
+                          KsenutilsTestCasesLogFile,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+//    User::LeaveIfError(this->iFsSession.Connect());
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CsenutilsTestCases::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CsenutilsTestCases* CsenutilsTestCases::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CsenutilsTestCases* self = new (ELeave) CsenutilsTestCases( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CsenutilsTestCases::~CsenutilsTestCases()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CsenutilsTestCases::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CsenutilsTestCases::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("senutilsTestCases.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CsenutilsTestCases::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/src/senutilsTestCasesBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2915 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "senutilsTestCases.h"
+#include <SenSoapEnvelope.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenutilsTestCases::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CsenutilsTestCases::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenutilsTestCases::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CsenutilsTestCases::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "NewL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_NewLL ),
+        ENTRY( "SetBodyL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_SetBodyLL ),
+        ENTRY( "BodyL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_BodyLL ),
+        ENTRY( "HeaderL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_HeaderLL ),        
+        ENTRY( "AddHeaderL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_AddHeaderLL ),
+        ENTRY( "BodyAsStringL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_BodyAsStringLL ),
+        ENTRY( "DetachFaultL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_DetachFaultLL ),
+        ENTRY( "FaultL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_FaultLL ),
+        ENTRY( "SoapAction-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_SoapActionL ),
+        ENTRY( "SoapAction2-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_SoapAction2L ),
+        ENTRY( "HasHeader-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_HasHeaderL ),
+        ENTRY( "SoapVersion-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_SoapVersionL ),
+        ENTRY( "HasBody-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_HasBodyL ),
+        ENTRY( "IsFault-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_IsFaultL ),
+        ENTRY( "ParseL-CSenSoapEnvelope", CsenutilsTestCases::CSenSoapEnvelope_ParseLL ),
+        
+        ENTRY( "NewL-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_NewLL ),
+        ENTRY( "NewL-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_NewL_1L ),
+        ENTRY( "FaultCode-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_FaultCodeL ),
+        ENTRY( "FaultSubcode-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_FaultSubcodeL ),
+        
+        ENTRY( "FaultString-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_FaultStringL ),
+        ENTRY( "FaultActor-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_FaultActorL ),
+        ENTRY( "Detail-CSenSoapFault", CsenutilsTestCases::CSenSoapFault_DetailL ),
+        ENTRY( "NewL-CSenSoapMessage", CsenutilsTestCases::CSenSoapMessage_NewLL ),
+        ENTRY( "SetSecurityHeaderL-CSenSoapMessage", CsenutilsTestCases::CSenSoapMessage_SetSecurityHeaderLL ),
+        ENTRY( "AddSecurityTokenL-CSenSoapMessage", CsenutilsTestCases::CSenSoapMessage_AddSecurityTokenLL ),
+        ENTRY( "NewL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_NewLL ),
+        ENTRY( "ParseL-CSenSoapMessage", CsenutilsTestCases::CSenSoapMessage_ParseLL ),
+        ENTRY( "NewLC-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_NewLCL ),
+        ENTRY( "NewL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_NewL_1L ),
+        ENTRY( "NewLC-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_NewLC_1L ),
+        ENTRY( "NewL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_NewL_2L ),
+        ENTRY( "NewLC-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_NewLC_2L ),
+        ENTRY( "BinarySecurityToken-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_BinarySecurityTokenL_L ),
+        ENTRY( "BinarySecurityToken1-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_BinarySecurityTokenL_1L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenLL ),
+        ENTRY( "TimestampL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_TimestampL_L ),
+        ENTRY( "TimestampL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_TimestampL_1L ),        
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_1L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_2L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_3L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_4L ),
+        ENTRY( "XmlNs-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_XmlNsL ),
+        ENTRY( "XmlNsPrefix-CSenWsSecurityHeader", CsenutilsTestCases::CSenWsSecurityHeader_XmlNsPrefixL ),
+        ENTRY( "FromXmlDateTimeL-SenDateUtils", CsenutilsTestCases::SenDateUtils_FromXmlDateTimeLL ),
+        ENTRY( "ToXmlDateTimeUtf8L-SenDateUtils", CsenutilsTestCases::SenDateUtils_ToXmlDateTimeUtf8LL ),
+        ENTRY( "ToXmlDateTimeUtf82L-SenDateUtils", CsenutilsTestCases::SenDateUtils_ToXmlDateTimeUtf82LL ),
+        
+        ENTRY( "FileAttachmentL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_FileAttachmentLL ),
+        ENTRY( "NewL-CSenXmlProperties", CsenutilsTestCases::SenXmlProperties_NewLL ),
+        ENTRY( "NewLC-CSenXmlProperties", CsenutilsTestCases::SenXmlProperties_NewLCL ),
+        ENTRY( "NewL-CSenXmlProperties", CsenutilsTestCases::SenXmlProperties_NewL_1L ),
+        ENTRY( "NewLC-CSenXmlProperties", CsenutilsTestCases::SenXmlProperties_NewLC_1L ),
+        ENTRY( "NewL-CSenXmlProperties", CsenutilsTestCases::SenXmlProperties_NewL_2L ),
+        ENTRY( "NewLC-CSenXmlProperties", CsenutilsTestCases::SenXmlProperties_NewLC_2L ),
+        ENTRY( "NewL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_NewLL ),
+        ENTRY( "NewLC-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_NewLCL ),
+        ENTRY( "NewL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_NewL_1L ),
+        ENTRY( "NewLC-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_NewLC_1L ),
+        ENTRY( "NewL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_NewL_2L ),
+        ENTRY( "NewLC-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_NewLC_2L ),
+        ENTRY( "AsUtf8L-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_AsUtf8LL ),
+        ENTRY( "SetPropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetPropertyLL ),
+        ENTRY( "PropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_PropertyLL ),
+        ENTRY( "SetIntPropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetIntPropertyLL ),
+        ENTRY( "PropertyL1-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_PropertyL1L ),
+        ENTRY( "IntPropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_IntPropertyLL ),
+        ENTRY( "SetBoolPropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetBoolPropertyLL ),
+        ENTRY( "BoolPropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_BoolPropertyLL ),
+        ENTRY( "SetOmittedL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetOmittedLL ),
+        ENTRY( "RemovePropertyL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_RemovePropertyLL ),
+        ENTRY( "HeartbeatL_CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_HeartbeatLL ),
+        ENTRY( "SetHeartbeatL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetHeartbeatLL ),
+        ENTRY( "IapIdL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_IapIdLL ),
+        ENTRY( "SetIapIdL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetIapIdLL ),
+        ENTRY( "ProxyPortL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_ProxyPortLL ),
+        ENTRY( "SetProxyPortL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetProxyPortLL ),
+        ENTRY( "ProxyHostL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_ProxyHostLL ),
+        ENTRY( "SetProxyHostL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetProxyHostLL ),
+        ENTRY( "ProxyUsageL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_ProxyUsageLL ),
+        ENTRY( "SetProxyUsageL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetProxyUsageLL ),
+        ENTRY( "SecureDialogL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SecureDialogLL ),
+        ENTRY( "SetSecureDialogL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetSecureDialogLL ),
+        ENTRY( "UserAgentL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_UserAgentLL ),
+        ENTRY( "SetUserAgentL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetUserAgentLL ),
+        ENTRY( "DeviceIDL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_DeviceIDLL ),
+        ENTRY( "SetDeviceIDL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetDeviceIDLL ),
+        ENTRY( "SoapActionL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SoapActionLL ),
+        ENTRY( "SetSoapActionL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetSoapActionLL ),
+        ENTRY( "DownloadFolderL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_DownloadFolderLL ),
+        ENTRY( "SetDownloadFolderL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetDownloadFolderLL ),
+        ENTRY( "SetFileAttachmentL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetFileAttachmentLL ),
+        ENTRY( "MwsNamespaceL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_MwsNamespaceLL ),
+        ENTRY( "SetMwsNamespaceL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetMwsNamespaceLL ),
+        ENTRY( "MessageIdL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_MessageIdLL ),
+        ENTRY( "SetMessageIdL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetMessageIdLL ),
+        ENTRY( "OnewayMessageOnOffL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_OnewayMessageOnOffLL ),
+        ENTRY( "SetOnewayMessageOnOffL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetOnewayMessageOnOffLL ),
+        ENTRY( "SetMaxTimeToLiveL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetMaxTimeToLiveLL ),
+        ENTRY( "MaxTimeToLiveL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_MaxTimeToLiveLL ),
+        ENTRY( "SetMaxTimeToLiveL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetMaxTimeToLiveLL),
+        ENTRY( "MinTimeToLiveL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_MinTimeToLiveLL ),
+        ENTRY( "SetMinTimeToLiveL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetMinTimeToLiveLL ),
+        ENTRY( "SetReaderL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_SetReaderL ),
+        ENTRY( "PropertiesClassTypeL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_PropertiesClassTypeL ),
+        ENTRY( "WriteToLL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_WriteToLL ),
+        ENTRY( "ReadFromLL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_ReadFromLL ),
+        ENTRY( "CloneL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_CloneL ),
+        ENTRY( "IsSafeToCastL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_IsSafeToCastL ),
+        ENTRY( "CloneLL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_CloneLL ),
+        ENTRY( "ApplyBindingLL-CSenTransportProperties", CsenutilsTestCases::SenTransportProperties_ApplyBindingLL ),
+        ENTRY( "NewL-CSenHttpTransportProperties", CsenutilsTestCases::SenHttpTransportProperties_NewLL ),
+        ENTRY( "NewLC-CSenHttpTransportProperties", CsenutilsTestCases::SenHttpTransportProperties_NewLCL ),
+        ENTRY( "NewL-CSenHttpTransportProperties", CsenutilsTestCases::SenHttpTransportProperties_NewL_1L ),
+        ENTRY( "NewLC-CSenHttpTransportProperties", CsenutilsTestCases::SenHttpTransportProperties_NewLC_1L ),
+        ENTRY( "NewL-CSenHttpTransportProperties", CsenutilsTestCases::SenHttpTransportProperties_NewL_2L ),
+        ENTRY( "NewLC-CSenHttpTransportProperties", CsenutilsTestCases::SenHttpTransportProperties_NewLC_2L),
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenutilsTestCases::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CsenutilsTestCases::SetupL(  ){
+    if ( iXmlReader ){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+    iXmlReader = CSenXmlReader::NewL();
+} 
+
+void CsenutilsTestCases::Teardown(  ){
+    if ( iXmlReader){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+}
+
+
+TPtr16 CsenutilsTestCases::ConvertToPtr16LC(CSenBaseFragment &fragment){
+    HBufC16* xmlBuffer = fragment.AsElement().AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length()){
+        RDebug::Print( _L( "WSModTester: xmlBuffer length [%d]"),ptr.Length());
+        if (ptr.Length()<=254){//below string must be =< max byte value
+            RDebug::Print( _L( "WSModTester: xmlBuffer #START#"));
+            RDebug::Print( _L( "[%S]"),&ptr);
+            RDebug::Print( _L( "WSModTester: xmlBuffer #END#"));
+        }
+        else
+            RDebug::Print( _L( "WSModTester: xmlBuffer too long to display, must be <=256- 2//[]"));
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TPtr16 CsenutilsTestCases::ConvertToPtr16LC(MSenElement &element){
+    HBufC16* xmlBuffer = element.AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer length [%d]"),ptr.Length());
+        if (ptr.Length()<=254){//below string must be =< max byte value
+            RDebug::Print( _L( "WSModTester: xmlBuffer #START#"));
+            RDebug::Print( _L( "[%S]"),&ptr);
+            RDebug::Print( _L( "WSModTester: xmlBuffer #END#"));
+        }
+        else
+            RDebug::Print( _L( "WSModTester: xmlBuffer too long to display, must be <=256- 2//[]"));
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_NewLL( CStifItemParser& aItem )
+    {
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    CleanupStack::PushL(env);
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL);*/
+    TL(env != (CSenSoapEnvelope*)NULL);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    TPtrC16 ptrRef = KRef();
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*env), ptrRef);*/
+    TL(ConvertToPtr16LC(*env) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(env);
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+  //  Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_SetBodyLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    _LIT8(KBody,"ComarchBody");
+    TPtrC8 result = env->SetBodyL(KBody);
+    
+    _LIT16(KRef2, "ComarchBody");
+    TPtrC16 result16(reinterpret_cast<const TUint16*>(result.Ptr()),(result.Size()/2));
+    RDebug::Print( _L( "WSModTester: body [%S]"),&result16);
+    /*EUNIT_ASSERT_EQUALS(result, KBody);*/
+    TL(result == KBody);
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body>ComarchBody</S:Body></S:Envelope>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*env), KRef);*/
+    TL(ConvertToPtr16LC(*env) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_BodyLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    _LIT8(KBody,"ComarchBody");
+    env->SetBodyL(KBody);
+    
+    CSenElement& element = env->BodyL();
+    
+    _LIT16(KRef, "<S:Body>ComarchBody</S:Body>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(element), KRef);*/
+    TL(ConvertToPtr16LC(element) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    /*EUNIT_ASSERT_NO_LEAVE(delete env);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_HeaderLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS(env, (CSenSoapEnvelope*)NULL); */
+    TL(env != (CSenSoapEnvelope*)NULL);
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    env->AddHeaderL(*el);
+    el = &(CSenBaseElement&)env->HeaderL();
+    
+    _LIT16(KRef, "<S:Header><text/></S:Header>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*el), KRef);*/
+    TL(ConvertToPtr16LC(*el)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_AddHeaderLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    //el = &(CSenBaseElement&) env->AddHeaderL(*el);//ok
+    el = &(CSenBaseElement&) env->AddHeaderL(*el);//ok
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><text/></S:Header><S:Body/></S:Envelope>");
+    TL(ConvertToPtr16LC(*env) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    _LIT16(KRef2, "<text/>");
+    TL(ConvertToPtr16LC(*el)== KRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_BodyAsStringLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KBody,"ComarchBody");
+    env->SetBodyL(KBody);
+    HBufC8* str = env->BodyAsStringL();
+    
+    _LIT8(KRef, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">ComarchBody</S:Body>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptr = str->Des();
+    TL(ptr == ptrRef);
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete str);
+    str = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_DetachFaultLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+
+    //checking Envelope without Fault
+    _LIT16(KRefEnvFault, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body/></S:Envelope>");
+    TPtrC16 ptrRefEnvFault = KRefEnvFault();
+    TL(ConvertToPtr16LC(*env) == ptrRefEnvFault);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    //checking Fault
+    _LIT16(KRefFault, "<S:Fault xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault>");
+    TPtrC16 ptrRefFault = KRefFault();
+    TL(ConvertToPtr16LC(*fault) == ptrRefFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    
+
+    env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KSOAPMessage);
+    TL(env->DetachFaultL() == (CSenSoapFault* )NULL);
+    //checking Envelope not touched should be
+    _LIT16(KRefEnv, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+    TPtrC16 ptrRefEnv = KRefEnv();
+    TL(ConvertToPtr16LC(*env) == ptrRefEnv);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_FaultLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+
+
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->FaultL();
+
+    //checking Envelope, still Fault exist
+    _LIT16(KRefEnvFault, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault></S:Body></S:Envelope>");
+    TL(ConvertToPtr16LC(*env)== KRefEnvFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    //checking Fault
+    _LIT16(KRefFault, "<S:Fault><faultcode>VersionMismatch</faultcode><faultstring>some string</faultstring><faultactor>some actor</faultactor><detail>bla bla</detail></S:Fault>");
+    TL(ConvertToPtr16LC(*fault) == KRefFault);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    
+    env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KSOAPMessage);
+    TL(env->FaultL() == (CSenSoapFault* )NULL);
+    //checking Envelope not touched should be
+    _LIT16(KRefEnv, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header/><S:Body><QueryResponse><Data>Hard Coded response, alway the same</Data></QueryResponse></S:Body></S:Envelope>");
+    TL(ConvertToPtr16LC(*env) == KRefEnv);
+    CleanupStack::PopAndDestroy();//Ptr
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_SoapActionL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KRef, "\"\"");
+    _LIT8(KRef2, "\"URI-referenceRFC2396\"");
+    _LIT8(KRef3, "");
+    TL(env->SoapAction() == KRef);
+    env->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TL(env->SoapAction() == KRef2);
+    env->SetSoapActionL(KRef2);
+    TL(env->SoapAction() == KRef2);
+    
+    env->SetSoapActionL(KRef3);
+    TL(env->SoapAction() == KRef3);
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_SoapAction2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KRef, "");
+    _LIT8(KRef2, "\"URI-referenceRFC2396\"");
+
+    TL(env->SoapAction2() == KRef);
+    env->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TL(env->SoapAction2() == KRef2);
+    env->SetSoapActionL(KRef2);
+    TL(env->SoapAction2() == KRef2);
+    
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapEnvelope_HasHeaderL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    
+    if(!( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+    CSenBaseElement* el = CSenBaseElement::NewL(KText);
+    pEnvelope->AddHeaderL(*el);
+    if(( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope);
+    pEnvelope = NULL;
+    Teardown();
+    return KErrNone;
+    
+    //EUNIT_ASSERT_NO_LEAVE(delete el);
+    //el = NULL;
+    }
+   
+TInt CsenutilsTestCases::CSenSoapEnvelope_SoapVersionL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    TSOAPVersion var = ESOAP11;
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    CleanupStack::PushL(pEnvelope);
+    
+    TL(var ==  pEnvelope->SoapVersion());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CsenutilsTestCases::CSenSoapEnvelope_HasBodyL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env != (CSenSoapEnvelope*)NULL);
+
+    _LIT8(KBody,"ComarchBody");
+    TPtrC8 result = env->SetBodyL(KBody);
+    if(( env->HasBody() == EFalse )) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    CSenSoapEnvelope* env1 = CSenSoapEnvelope::NewL();
+    TL(env1 != (CSenSoapEnvelope*)NULL);
+
+    if(!( env1->HasBody() == EFalse )) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete env1);
+    env1 = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CsenutilsTestCases::CSenSoapEnvelope_IsFaultL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    TL(env!= (CSenSoapEnvelope*)NULL);
+    if(!( env->IsFault() == EFalse )) return KErrArgument;
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CsenutilsTestCases::CSenSoapEnvelope_ParseLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL();
+    pEnvelope->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*pEnvelope);
+    
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    pEnvelope->ParseL(KInputString);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+    }
+    
+
+
+TInt CsenutilsTestCases::CSenSoapFault_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    RAttributeArray attributeArray;
+    _LIT8(KFault, "Fault");
+    CSenSoapFault* soapFault = CSenSoapFault::NewL(KFault, KFault, KFault, attributeArray);
+    CleanupStack::PushL(soapFault);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(soapFault != (CSenSoapFault*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Fault xmlns=\"Fault\"/>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*soapFault) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(soapFault);
+    attributeArray.Close();
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete soapFault);
+    soapFault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapFault_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    RAttributeArray attributeArray;
+    _LIT8(KFault, "Fault");
+    CSenSoapFault* orgSoapFault = CSenSoapFault::NewL(KFault, KFault, KFault, attributeArray);
+    CSenSoapFault* soapFault = CSenSoapFault::NewL(*orgSoapFault);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(soapFault != (CSenSoapFault*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Fault xmlns=\"Fault\"/>");
+    TL(ConvertToPtr16LC(*soapFault) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete orgSoapFault);
+    orgSoapFault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete soapFault);
+    soapFault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapFault_FaultCodeL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KCode, "VersionMismatch");
+    
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultCode());
+    TL(fault->FaultCode()== KCode);
+    //TPtrC16 result16(reinterpret_cast<const TUint16*>(fault->FaultCode().Ptr()),(fault->FaultCode().Size()/2));
+    //RDebug::Print( _L( "WSModTester: faultCode [%S]"),&result16);
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultCode());
+    TL(fault->FaultCode() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::CSenSoapFault_FaultSubcodeL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+    
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultSubcode());
+    TL(fault->FaultSubcode() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapFault_FaultStringL( CStifItemParser& aItem )
+    {
+        SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KString, "some string");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultString());
+    TL(fault->FaultString() == KString);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultString());
+    TL(fault->FaultString() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapFault_FaultActorL( CStifItemParser& aItem )
+    {
+        SetupL();
+    CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KActor, "some actor");
+    /*EUNIT_ASSERT_NO_LEAVEP*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultActor());
+    TL(fault->FaultActor() == KActor);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->FaultActor());
+    TL(fault->FaultActor() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapFault_DetailL( CStifItemParser& aItem )
+    {
+        SetupL();
+CSenSoapEnvelope* env = CSenSoapEnvelope::NewL();
+    env->SetReader( *iXmlReader );
+    iXmlReader->SetContentHandler(*env);
+    env->ParseL(KFaultMessage);
+    CSenSoapFault* fault = env->DetachFaultL();
+//not empty
+    _LIT8(KDetail, "bla bla");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->Detail());
+    TL(fault->Detail() == KDetail);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete env);
+    env = NULL;
+
+//empty
+    RAttributeArray attributeArray;
+    fault = CSenSoapFault::NewL(KText, KText, KText, attributeArray);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(fault->Detail());
+    TL(fault->Detail() == KNullDesC8);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete fault);
+    fault = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapMessage_NewLL( CStifItemParser& aItem )
+    {
+        SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    TL(ConvertToPtr16LC(*msg) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapMessage_SetSecurityHeaderLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    
+    msg->SetSecurityHeaderL(KText);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*msg) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    msg->SetSecurityHeaderL(KText2);
+    //checking xml
+    _LIT16(KRef2, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text2</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef2 = KRef2();
+    TL(ConvertToPtr16LC(*msg) == ptrRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapMessage_AddSecurityTokenLL( CStifItemParser& aItem )
+    {
+            SetupL();
+    CSenSoapMessage* msg = CSenSoapMessage::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(msg != (CSenSoapMessage*)NULL);
+
+    
+    /*EUNIT_ASSERT*/TL(msg->AddSecurityTokenL(KText)==KErrNone);
+    //checking xml
+    _LIT16(KRef, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*msg) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT*/TL(msg->AddSecurityTokenL(KText2)==KErrNone);
+    //checking xml
+    _LIT16(KRef2, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">texttext2</wsse:Security></S:Header><S:Body/></S:Envelope>");
+    TPtrC16 ptrRef2 = KRef2();
+    TL(ConvertToPtr16LC(*msg) == ptrRef2);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete msg);
+    msg = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenSoapMessage_ParseLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+    
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapMessage* pMessage = CSenSoapMessage::NewL();
+    pMessage->SetReader( *iXmlReader ); 
+    iXmlReader->SetContentHandler(*pMessage);
+    
+    CleanupStack::PushL(pMessage);
+    
+    
+    pMessage->ParseL(KInputString);
+
+    CleanupStack::PopAndDestroy(pMessage);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+    }
+
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    CleanupStack::PushL(hdr);
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*hdr) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop(hdr);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CsenutilsTestCases::CSenWsSecurityHeader_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC();
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+    
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);//Ptr
+    Teardown();
+    return KErrNone;
+    }
+
+  
+TInt CsenutilsTestCases::CSenWsSecurityHeader_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC(KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);
+    
+    //EUNIT_ASSERT_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_NewL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText, KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+    CleanupStack::PushL(hdr);
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"text\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2); 
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_NewLC_2L( CStifItemParser& aItem )
+    {
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewLC(KText, KText);
+    TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"text\">text</wsse:Security>");
+    TPtrC16 ptrRef(KRef);
+    TL(ConvertToPtr16LC(*hdr)== ptrRef);
+    CleanupStack::PopAndDestroy(2);
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_BinarySecurityTokenL_L( CStifItemParser& aItem )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"></wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:BinarySecurityToken wsu:Id=\"token\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">text</wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_BinarySecurityTokenL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KNullDesC8, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:BinarySecurityToken wsu:Id=\"token\" wsse:ValueType=\"\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"></wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::BinarySecurityTokenL(KText, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:BinarySecurityToken wsu:Id=\"token\" wsse:ValueType=\"text\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">text</wsse:BinarySecurityToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_TimestampL_L( CStifItemParser& aItem )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* timestamp=NULL;
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created></wsu:Timestamp>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::TimestampL(KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created></wsu:Timestamp>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_TimestampL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* timestamp=NULL;
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+
+     
+    TL(CSenWsSecurityHeader::TimestampL(KNullDesC8, KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created></wsu:Created><wsu:Expires>text</wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    
+    TL(CSenWsSecurityHeader::TimestampL(KText, KNullDesC8, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::TimestampL(KText, KText, timestamp)==KErrNone);
+    TL(timestamp != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><wsu:Created>text</wsu:Created><wsu:Expires>text</wsu:Expires></wsu:Timestamp>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = timestamp->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete timestamp);
+    timestamp = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+     
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KNullDesC8, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KText, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_3L( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenWsSecurityHeader::TPasswordType aType = CSenWsSecurityHeader::EText;
+
+//testing NULL
+    HBufC8* token=NULL;
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KNullDesC8, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+  
+    TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, KText, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+ 
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KNullDesC8, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef3, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef3(KRef3);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef3);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    
+//testing normal    
+    TL(CSenWsSecurityHeader::UsernameTokenL(KText, KText, aType, token)==KErrNone);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef4, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef4(KRef4);
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef4);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_4L( CStifItemParser& aItem )
+    {
+    SetupL();
+   
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    TL(hdr!= (CSenWsSecurityHeader*)NULL);
+
+    CSenWsSecurityHeader::TPasswordType aType = CSenWsSecurityHeader::EText;
+
+//testing NULL
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText, KText);
+    HBufC8* token=NULL;
+    token = hdr->UsernameTokenL(*provider, aType);
+    TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef(KRef);
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    provider = CSenIdentityProvider::NewL(KText, KText);
+    provider->SetUserInfoL(KText, KText2, KText);
+    token = hdr->UsernameTokenL(*provider, aType);
+    TL(token != (HBufC8*)NULL);
+    //checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username><wsse:Password>text</wsse:Password></wsse:UsernameToken>");
+    TPtrC8 ptrRef2(KRef2);
+    TPtr8 ptrToken2 = token->Des();
+    TL(ptrToken2 == ptrRef2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_NewL_1L( CStifItemParser& aItem )
+    {
+            SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">text</wsse:Security>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*hdr) == ptrRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenLL( CStifItemParser& aItem )
+    {
+            SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+
+//testing NULL
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText, KText);
+    HBufC8* token=NULL;
+    token = hdr->UsernameTokenL(*provider);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    provider = CSenIdentityProvider::NewL(KText, KText);
+    provider->SetUserInfoL(KText, KText2, KText);
+    token = hdr->UsernameTokenL(*provider);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef2 = KRef2();
+    TPtr8 ptrToken2 = token->Des();
+    TL(ptrToken2 == ptrRef2);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete provider);
+    provider = NULL;
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_UsernameTokenL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+//testing NULL
+    HBufC8* token=NULL;
+    /*EUNIT_ASSERT*/TL(CSenWsSecurityHeader::UsernameTokenL(KNullDesC8, token)==KErrNone);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef, "<wsse:UsernameToken><wsse:Username></wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef = KRef();
+    TPtr8 ptrToken = token->Des();
+    TL(ptrToken == ptrRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+
+    
+//testing normal    
+    /*EUNIT_ASSERT*/TL(CSenWsSecurityHeader::UsernameTokenL(KText, token)==KErrNone);
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(token != (HBufC8*)NULL);
+    //-----checking xml
+    _LIT8(KRef2, "<wsse:UsernameToken><wsse:Username>text</wsse:Username></wsse:UsernameToken>");
+    TPtrC8 ptrRef2 = KRef2();
+    ptrToken = token->Des();
+    TL(ptrToken == ptrRef2);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete token);
+    token = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_XmlNsL( CStifItemParser& aItem )
+    {
+            SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    _LIT8(KSecurityXmlNsRef, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+        /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(hdr->XmlNs());
+    TL(hdr->XmlNs() == KSecurityXmlNsRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::CSenWsSecurityHeader_XmlNsPrefixL( CStifItemParser& aItem )
+    {
+            SetupL();
+    CSenWsSecurityHeader* hdr = CSenWsSecurityHeader::NewL();
+    /*EUNIT_ASSERT_NOT_EQUALS*/TL(hdr != (CSenWsSecurityHeader*)NULL);
+    _LIT8(KSecurityXmlNsPrefixRef, "wsse");
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(hdr->XmlNsPrefix());
+    TL(hdr->XmlNsPrefix() == KSecurityXmlNsPrefixRef);
+    /*EUNIT_ASSERT_NO_LEAVE*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete hdr);
+    hdr = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CsenutilsTestCases::SenDateUtils_FromXmlDateTimeLL( CStifItemParser& aItem )
+    {
+            SetupL();
+    //normal
+    TTime ttime, ttime2;
+    _LIT8(KIn1, "2005-02-28T13:20:05Z");
+    _LIT(KDateTimeString1, "28-feb/05 01:20.05pm");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn1);
+    ttime2.Parse(KDateTimeString1);
+    TL(ttime == ttime2);
+    
+    //-5
+    _LIT8(KIn2, "2005-02-28T13:20:05-05:00");
+    _LIT(KDateTimeString2, "28-feb/05 08:20.05am");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn2);
+    ttime2.Parse(KDateTimeString2);
+    TL(ttime == ttime2);
+    
+    //+5
+    _LIT8(KIn3, "2005-02-28T13:20:05+05:00");
+    _LIT(KDateTimeString3, "28-feb/05 06:20.05pm");
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn3);
+    ttime2.Parse(KDateTimeString3);
+    TL(ttime == ttime2);
+    
+    //1 increase precision
+    _LIT8(KIn4, "2005-02-28T13:20:05.5Z");
+    _LIT(KDateTimeString4, "20050127:132005.500000");//The month and day values are offset from zero.
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn4);
+    ttime2 = TTime(KDateTimeString4);
+    TL(ttime == ttime2);
+    
+    
+    //3 increase precision
+    _LIT8(KIn5, "2005-02-28T13:20:05.231Z");
+    _LIT(KDateTimeString5, "20050127:132005.231000");//The month and day values are offset from zero.
+    ttime = SenDateUtils::FromXmlDateTimeL(KIn5);
+    ttime2 = TTime(KDateTimeString5);
+    TL(ttime == ttime2);
+
+    //-----------wrong
+    
+    //month
+    _LIT8(KIn6, "2005-55-28T13:20:05Z");
+    TRAPD( err, SenDateUtils::FromXmlDateTimeL(KIn6));
+    if(err != KErrOverflow) return err;
+    
+  //day
+    _LIT8(KIn7, "2005-02-58T13:20:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn7));
+    if(err != KErrOverflow) return err;
+
+    
+    //hour
+    _LIT8(KIn9, "2005-02-28T33:20:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn9));
+    if(err != KErrOverflow) return err;
+
+    //minute
+    _LIT8(KIn10, "2005-02-28T13:70:05Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn10));
+    if(err != KErrOverflow) return err;
+
+    //second
+    _LIT8(KIn11, "2005-02-28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn11));
+    if(err != KErrOverflow) return err;
+
+    //+hour
+    _LIT8(KIn12, "2005-02-28T13:20:05+88:00");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn12));
+    if(err != KErrOverflow) return err;
+
+    //UTC wrong designator
+    _LIT8(KIn13, "2005-02-28T13:20:65Z05:00");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn13));
+    if(err != KErrOverflow) return err;
+
+    
+    //short garbage
+    _LIT8(KIn14, "xx");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn14));
+    if(err != KErrUnderflow) return err;
+
+    //garbage year
+    _LIT8(KIn15, "xxxx-02-28T13:20:65Z");
+    //EUNIT_ASSERT_LEAVE
+    //ASSERT(SenDateUtils::FromXmlDateTimeL(KIn15));
+
+    //"-"
+    _LIT8(KIn16, "2005x02-28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn16));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn17, "2005-02x28T13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn17));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn18, "2005-02-28X13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn18));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn19, "2005-02-28X13:20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn19));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn20, "2005-02-28T13-20:65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn20));
+        if(err != KErrGeneral) return err;
+
+    _LIT8(KIn21, "2005-02-28T13:20-65Z");
+    TRAP(err, SenDateUtils::FromXmlDateTimeL(KIn21));
+        if(err != KErrGeneral) return err;
+
+    //31 II
+    _LIT8(KIn8, "2005-02-31T13:20:05Z");
+//    EUNIT_ASSERT_PANIC(SenDateUtils::FromXmlDateTimeL(KIn8),"USER", 3 );
+        TestModuleIf().SetExitReason (TestModuleIf(). EPanic, ETDateTimeBadDateTime);
+        SenDateUtils::FromXmlDateTimeL(KIn8);
+                
+    Teardown();
+    return KErrNone;
+}
+
+TInt CsenutilsTestCases::SenDateUtils_ToXmlDateTimeUtf8LL( CStifItemParser& aItem )
+    {
+    SetupL();
+    //KXmlDateTimeMaxLength = 25
+    _LIT(KDate, "23:34.56");
+    _LIT8(KRef, "0000-01-01T23:34:56Z");
+    TTime ttime;
+    TInt error  = ttime.Parse(KDate);
+
+    //KErrOverflow
+    HBufC8* writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength - 20);
+    TPtr8 ptrResult = writeBuf->Des();
+    TRAPD(err, SenDateUtils::ToXmlDateTimeUtf8L(ptrResult, ttime));
+    if(err != KErrOverflow) return err;
+    delete writeBuf;
+    writeBuf = NULL;
+    
+    //OK, more
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength+10);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult2 = writeBuf->Des();
+    // EUNIT_ASSERT_NO_LEAVE 
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf8L(ptrResult2, ttime));
+    TL(ptrResult2 == KRef);
+    delete writeBuf;
+    writeBuf = NULL; 
+
+    //OK,equal
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult3 = writeBuf->Des();
+    //EUNIT_ASSERT_NO_LEAVE
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf8L(ptrResult3, ttime));
+    TL(ptrResult3 == KRef);
+    delete writeBuf;
+    writeBuf = NULL; 
+
+    Teardown();
+    return KErrNone;
+    }
+
+    
+TInt CsenutilsTestCases::SenDateUtils_ToXmlDateTimeUtf82LL( CStifItemParser& aItem )
+    {
+    SetupL();
+    //KXmlDateTimeMaxLength = 25
+    _LIT(KDate, "23:34.56");
+    _LIT8(KRef, "0000-01-01T23:34:56.000000Z");
+    TTime ttime;
+    TInt error  = ttime.Parse(KDate);
+
+    //KErrOverflow
+    HBufC8* writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength - 20);
+    TPtr8 ptrResult = writeBuf->Des();
+    TRAPD(err, SenDateUtils::ToXmlDateTimeUtf82L(ptrResult, ttime));
+    if(err != KErrOverflow) return err;
+    delete writeBuf;
+    writeBuf = NULL;
+    
+    //OK, more
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength+10);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult2 = writeBuf->Des();
+    // EUNIT_ASSERT_NO_LEAVE 
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf82L(ptrResult2, ttime));
+    TL(ptrResult2 == KRef);
+    delete writeBuf;
+    writeBuf = NULL; 
+
+    //OK,equal
+    writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+    //ptrResult = writeBuf->Des(); it wrong, becouse = operator will only copy, creation has been done in previous case
+    TPtr8 ptrResult3 = writeBuf->Des();
+    //EUNIT_ASSERT_NO_LEAVE
+    __ASSERT_ALWAYS_NO_LEAVE(SenDateUtils::ToXmlDateTimeUtf82L(ptrResult3, ttime));
+    TL(ptrResult3 == KRef);
+    delete writeBuf;
+    writeBuf = NULL; 
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenTransportProperties_FileAttachmentLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    CSenTransportProperties* transProp = CSenTransportProperties::NewLC();
+    HBufC8* value = NULL;
+    TL(transProp->FileAttachmentL(_L8("1"),value) == KErrNotFound);
+    TL(value == (HBufC8*)NULL);
+    
+    transProp->SetFileAttachmentL(_L8("1"),_L8("abcd"));
+    TL(transProp->FileAttachmentL(_L8("1"),value) == KErrNone);
+    TL(*value ==  _L8("abcd"));
+
+    delete value;
+    CleanupStack::PopAndDestroy(transProp);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenXmlProperties_NewLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL();
+    CleanupStack::PushL(pXmlElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenXmlProperties_NewLCL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC();
+
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenXmlProperties_NewL_1L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlReader* pParser = CSenXmlReader::NewL();
+    CleanupStack::PushL(pParser);
+    CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL(KString,*pParser);
+    CleanupStack::PushL(pXmlElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenXmlProperties_NewLC_1L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlReader* pParser = CSenXmlReader::NewL();
+    CleanupStack::PushL(pParser);
+    CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC(KString,*pParser);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenXmlProperties_NewL_2L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlProperties *pXmlElement=CSenXmlProperties::NewL(*pElement);
+    CleanupStack::PushL(pXmlElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenXmlProperties_NewLC_2L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlProperties *pXmlElement=CSenXmlProperties::NewLC(*pElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_NewLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);  
+    if(pElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenTransportProperties_NewLCL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewLC();
+    if(pElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenTransportProperties_NewL_1L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlReader* pParser = CSenXmlReader::NewL();
+    CleanupStack::PushL(pParser);
+    CSenTransportProperties *pXmlElement=CSenTransportProperties::NewL(KString,*pParser);
+    CleanupStack::PushL(pXmlElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenTransportProperties_NewLC_1L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlReader* pParser = CSenXmlReader::NewL();
+    CleanupStack::PushL(pParser);
+    CSenTransportProperties *pXmlElement=CSenTransportProperties::NewLC(KString,*pParser);
+
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenTransportProperties_NewL_2L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenTransportProperties *pXmlElement=CSenTransportProperties::NewL(*pElement);
+    CleanupStack::PushL(pXmlElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenutilsTestCases::SenTransportProperties_NewLC_2L(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenTransportProperties *pXmlElement=CSenTransportProperties::NewLC(*pElement);
+    if(pXmlElement)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) KErrArgument;
+    CleanupStack::PopAndDestroy(pXmlElement);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CsenutilsTestCases::SenTransportProperties_AsUtf8LL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><Property>value</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    HBufC8* Utf8Buf=pElement->AsUtf8L();
+    TL(*Utf8Buf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);    
+    delete Utf8Buf;
+    Teardown();
+    return KErrNone;
+    }
+            
+TInt CsenutilsTestCases::SenTransportProperties_SetPropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><Property>value</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenutilsTestCases::SenTransportProperties_PropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KValue,"Value");
+    TPtrC8 ValuePtr;
+    TPtrC8 ValuePtr1;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    
+    //true case
+    TInt retval=pElement->PropertyL(_L8("Property"),ValuePtr);
+    TL(retval == KErrNone);
+      
+    //false case
+    retval=pElement->PropertyL(_L8("NoProperty"),ValuePtr1);
+    TL(retval == KErrNotFound);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+
+    }
+TInt CsenutilsTestCases::SenTransportProperties_PropertyL1L(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KValue,"Value");
+    TPtrC8 ValuePtr;
+    TPtrC8 ValuePtr1;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"), _L8("type"));
+    
+    //true case
+    TInt retval=pElement->PropertyL(_L8("Property"),ValuePtr, ValuePtr1);
+    TL(retval == KErrNone);
+      
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetIntPropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><Property>10</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetIntPropertyL(_L8("Property"),10);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval==KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenutilsTestCases::SenTransportProperties_IntPropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TInt PropValue;
+    TInt PropValue1;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIntPropertyL(_L8("Property"),10);
+    //true case
+    TInt retval=pElement->IntPropertyL(_L8("Property"),PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    //false case
+    retval=pElement->IntPropertyL(_L8("NoProperty"),PropValue1);
+    TL(retval == KErrNotFound);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenutilsTestCases::SenTransportProperties_SetBoolPropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><Property>true</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetBoolPropertyL(_L8("Property"),1);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);      
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenutilsTestCases::SenTransportProperties_BoolPropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool BoolValue=1;
+    TBool BoolValue1;
+    TBool BoolValue2;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetBoolPropertyL(_L8("Property"),BoolValue);
+    //true case
+    TInt retval=pElement->BoolPropertyL(_L8("Property"),BoolValue1);
+    TL(retval == KErrNone);
+    TL(BoolValue == BoolValue1);
+    //false case
+    retval=pElement->BoolPropertyL(_L8("NoProperty"),BoolValue2);
+    TL(retval == KErrNotFound);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenutilsTestCases::SenTransportProperties_SetOmittedLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KText,"<Properties><Property Omitted=\"true\">value</Property></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    TInt retval=pElement->SetOmittedL(_L8("Property"),1);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenutilsTestCases::SenTransportProperties_RemovePropertyLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KText,"<Properties><Property1>value</Property1><Property2>value</Property2></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property1"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property2"),_L8("value"));
+    //True
+    TInt retval=pElement->RemovePropertyL(_L8("Property"));
+    HBufC8* ElementBuf=pElement->AsUtf8L(); 
+    TL(retval == KErrNone);
+    //False
+    retval=pElement->RemovePropertyL(_L8("NoProperty"));
+    TL(retval == KErrNotFound);
+    TL(*ElementBuf == KText);
+    CleanupStack::PopAndDestroy(pElement);  
+    delete ElementBuf;          
+    ElementBuf=NULL;
+    Teardown();
+    return KErrNone;
+    }
+    /*
+TInt CsenutilsTestCases::SenTransportProperties_CloneLL()
+    {
+    _LIT8(KCloneText,"<Properties><Property>value</Property><Property1>value</Property1></Properties>");
+    TInt okRnotok;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetPropertyL(_L8("Property"),_L8("value"));
+    pElement->SetPropertyL(_L8("Property1"),_L8("value"));
+    MSenProperties* pCloneElement=pElement->Clone(okRnotok);
+    CleanupStack::PushL(pCloneElement);
+    HBufC8* CloneElementBuf=pCloneElement->AsUtf8L();
+    EUNIT_ASSERT_EQUALS(*CloneElementBuf,KCloneText);
+    EUNIT_ASSERT_EQUALS(okRnotok,KErrNone);
+    delete CloneElementBuf;             
+    CleanupStack::PopAndDestroy(pCloneElement);
+    CleanupStack::PopAndDestroy(pElement);
+    }
+*/
+TInt CsenutilsTestCases::SenTransportProperties_HeartbeatLL( CStifItemParser& aItem )
+{
+    SetupL();
+    TInt Delta;;
+    TInt Delta1;
+    aItem.GetNextInt( Delta );
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetHeartbeatL(Delta);
+    TInt retval=pElement->HeartbeatL(Delta1);
+    TL(retval == KErrNone);
+    TL(Delta1 == Delta);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetHeartbeatLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><Heartbeat>10</Heartbeat></Properties>");
+    TInt Delta=10;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TInt retval=pElement->SetHeartbeatL(Delta);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(retval == KErrNone);
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);  
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+        
+TInt CsenutilsTestCases::SenTransportProperties_IapIdLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TUint32 Delta;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIapIdL(101);
+    TInt retval=pElement->IapIdL(Delta);
+    TL(retval == KErrNone);
+    TL(Delta == 101);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetIapIdLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><IapId>101</IapId></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetIapIdL(101);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_ProxyPortLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TInt PortNum;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyPortL(8080);
+    TInt retval=pElement->ProxyPortL(PortNum);
+    TL(retval == KErrNone);
+    TL(PortNum == 8080);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetProxyPortLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><ProxyPort>8080</ProxyPort></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyPortL(8080);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_ProxyHostLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TPtrC8 host;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyHostL(_L8("tcp.mws.mobile.msn-ppe.com"));
+    TInt retval=pElement->ProxyHostL(host);
+    TL(retval == KErrNone);
+    TL(host == _L8("tcp.mws.mobile.msn-ppe.com"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetProxyHostLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><ProxyHost>tcp.mws.mobile.msn-ppe.com</ProxyHost></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyHostL(_L8("tcp.mws.mobile.msn-ppe.com"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }   
+        
+TInt CsenutilsTestCases::SenTransportProperties_ProxyUsageLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Usage;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyUsageL(TRUE);
+    TInt retval=pElement->ProxyUsageL(Usage);
+    TL(retval == KErrNone);
+    TL(Usage == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetProxyUsageLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><ProxyUsage>true</ProxyUsage></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetProxyUsageL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SecureDialogLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Security;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSecureDialogL(TRUE);
+    TInt retval=pElement->SecureDialogL(Security);
+    TL(retval == KErrNone);
+    TL(Security == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetSecureDialogLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><SecureDialog>true</SecureDialog></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSecureDialogL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+        
+TInt CsenutilsTestCases::SenTransportProperties_UserAgentLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TPtrC8 UserAgent;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetUserAgentL(_L8("TestAgent"));
+    TInt retval=pElement->UserAgentL(UserAgent);
+    TL(retval == KErrNone);
+    TL(UserAgent ==_L8("TestAgent"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetUserAgentLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><User-Agent>TestAgent</User-Agent></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetUserAgentL(_L8("TestAgent"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+        
+TInt CsenutilsTestCases::SenTransportProperties_DeviceIDLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TPtrC8 DeviceID;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDeviceIDL(_L8("TestDevice"));
+    TInt retval=pElement->DeviceIDL(DeviceID);
+    TL(retval == KErrNone);
+    TL(DeviceID == _L8("TestDevice"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenutilsTestCases::SenTransportProperties_SetDeviceIDLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><DeviceID>TestDevice</DeviceID></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDeviceIDL(_L8("TestDevice"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CsenutilsTestCases::SenTransportProperties_SoapActionLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TPtrC8 SoapURI;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    TInt retval=pElement->SoapActionL(SoapURI);
+    TL(retval == KErrNone);
+    TL(SoapURI == _L8("URI-referenceRFC2396"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CsenutilsTestCases::SenTransportProperties_SetSoapActionLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><SOAPAction>URI-referenceRFC2396</SOAPAction></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetSoapActionL(_L8("URI-referenceRFC2396"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_DownloadFolderLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TPtrC8 Download;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDownloadFolderL(_L8("Download"));
+    TInt retval=pElement->DownloadFolderL(Download);
+    TL(retval == KErrNone);
+    TL(Download ==_L8("Download"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+}
+        
+TInt CsenutilsTestCases::SenTransportProperties_SetDownloadFolderLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><DownloadFolder>Download</DownloadFolder></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetDownloadFolderL(_L8("Download"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf==KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+        
+   
+TInt CsenutilsTestCases::SenTransportProperties_SetFileAttachmentLL(CStifItemParser& aItem )
+{
+    SetupL();
+    _LIT8(KElementText,"<Properties><FileAttachments>&lt;Attachments&gt;&lt;Attachment0 cid=&quot;test:cid&quot;&gt;c:\\test.file.txt&lt;/Attachment0&gt;&lt;/Attachments&gt;</FileAttachments></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetFileAttachmentL(_L8("test:cid"),_L8("c:\\test.file.txt"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf==KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+}
+
+
+
+TInt CsenutilsTestCases::SenTransportProperties_MwsNamespaceLL(CStifItemParser& aItem )
+{
+    SetupL();
+    
+    TPtrC8 NameSpace;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMwsNamespaceL(_L8("Mwsnsuri"));
+    TInt retval=pElement->MwsNamespaceL(NameSpace);
+    TL(retval == KErrNone);
+    TL(NameSpace == _L8("Mwsnsuri"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+        
+TInt CsenutilsTestCases::SenTransportProperties_SetMwsNamespaceLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    
+    _LIT8(KElementText,"<Properties><MwsNamespace>Mwsnsuri</MwsNamespace></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMwsNamespaceL(_L8("Mwsnsuri"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+
+}
+
+
+TInt CsenutilsTestCases::SenTransportProperties_MessageIdLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    TPtrC8 MsgId;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMessageIdL(_L8("test-message"));
+    TInt retval=pElement->MessageIdL(MsgId);
+    TL(retval == KErrNone);
+    TL(MsgId == _L8("test-message"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_SetMessageIdLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    _LIT8(KElementText,"<Properties><MessageID>test-message</MessageID></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMessageIdL(_L8("test-message"));
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_OnewayMessageOnOffLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    TBool OnRoff;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    TInt retval=pElement->OnewayMessageOnOffL(OnRoff);
+    TL(retval == KErrNone);
+    TL(OnRoff == TRUE);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_SetOnewayMessageOnOffLL( CStifItemParser& aItem)
+{
+
+    SetupL();
+
+    _LIT8(KElementText,"<Properties><OneWayMessage>true</OneWayMessage></Properties>");
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetOnewayMessageOnOffL(TRUE);
+    HBufC8* ElementBuf=pElement->AsUtf8L();
+    TL(*ElementBuf == KElementText);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_SetMaxTimeToLiveLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    TInt PropValue;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMaxTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MaxTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_MaxTimeToLiveLL(CStifItemParser& aItem )
+{
+    //TTestResult Result;
+    //SenTransportProperties_SetMaxTimeToLiveLL( Result);
+    SenTransportProperties_SetMaxTimeToLiveLL( aItem);
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_SetMinTimeToLiveLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    TInt PropValue;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetMinTimeToLiveL(10);
+    //true case
+    TInt retval=pElement->MinTimeToLiveL(PropValue);
+    TL(retval == KErrNone);
+    TL(PropValue == 10);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_SetReaderL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->SetReader(*iXmlReader);
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+
+TInt CsenutilsTestCases::SenTransportProperties_PropertiesClassTypeL(CStifItemParser& aItem )
+{
+    SetupL();
+    MSenProperties::TSenPropertiesClassType var = MSenProperties::ESenTransportProperties;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    TL(var == pElement->PropertiesClassType());
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_WriteToLL(CStifItemParser& aItem )
+{
+    SetupL();
+
+    TBuf8<50> StreamBuf;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddElementL(_L8("webservices"));
+    RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+    
+    CSenTransportProperties* pElement1= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement1);
+    pElement1->WriteToL(ElemntStream);
+    
+    CleanupStack::PopAndDestroy(pElement1);
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_ReadFromLL(CStifItemParser& aItem )
+{
+    SetupL();
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->ReadFromL(_L8(""));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_CloneL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    TInt var;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    CSenTransportProperties* pClone = NULL;
+    pClone = (CSenTransportProperties*)pElement->Clone(var); 
+    if(pClone != NULL)
+        Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+    delete pClone;
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_IsSafeToCastL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag, retVal;
+    MSenProperties::TSenPropertiesClassType pVar = MSenProperties::ESenTransportProperties;
+    
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    
+    retVal = pElement->IsSafeToCast(pVar); 
+    if(retVal != EFalse)
+        Flag = 1;
+    else 
+        Flag = 0; 
+
+    MSenProperties::TSenPropertiesClassType xVar = MSenProperties::ESenXmlProperties;
+    retVal = pElement->IsSafeToCast(xVar); 
+    if(retVal != EFalse)
+        Flag = 1;
+    else 
+        return KErrArgument; 
+    
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+
+TInt CsenutilsTestCases::SenTransportProperties_CloneLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TBool Flag;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    CSenTransportProperties* pClone = NULL;
+    pClone = (CSenTransportProperties*)pElement->CloneL(); 
+    if(pClone != NULL)
+        Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+    delete pClone;
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+TInt CsenutilsTestCases::SenTransportProperties_ApplyBindingLL(CStifItemParser& aItem )
+{
+    SetupL();
+    TSOAPVersion var = ESOAP11;
+    CSenTransportProperties* pElement= CSenTransportProperties::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->ApplyBindingL(var); 
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;    
+    
+}
+
+
+TInt CsenutilsTestCases::SenTransportProperties_MinTimeToLiveLL(CStifItemParser& aItem )
+{
+    //TTestResult Result;
+    //SenTransportProperties_SetMinTimeToLiveLL(Result);
+    SenTransportProperties_SetMinTimeToLiveLL(aItem);
+}
+
+TInt CsenutilsTestCases::SenHttpTransportProperties_NewLL(CStifItemParser& aItem)
+{
+    SetupL();
+
+    TBool Flag;
+    CSenHttpTransportProperties *pProperties = CSenHttpTransportProperties::NewL();
+    CleanupStack::PushL(pProperties );
+    if(pProperties)
+        Flag=1;
+    else
+        Flag=0;
+    if(! Flag) return KErrArgument;
+    CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenHttpTransportProperties_NewLCL(CStifItemParser& aItem)
+{
+    SetupL();
+
+    TBool Flag;
+    CSenHttpTransportProperties *pProperties = CSenHttpTransportProperties::NewLC();
+    if(pProperties)
+        Flag=1;
+    else
+        Flag=0;
+    if(! Flag) return KErrArgument;
+    CleanupStack::PopAndDestroy(pProperties );
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenHttpTransportProperties_NewL_1L(CStifItemParser& aItem)
+{
+    SetupL();
+
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlReader* pParser = CSenXmlReader::NewL();
+    CleanupStack::PushL(pParser);
+    CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewL(KString,*pParser);
+    CleanupStack::PushL(pProperties);
+    if(pProperties)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenHttpTransportProperties_NewLC_1L(CStifItemParser& aItem)
+{
+    SetupL();
+
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlReader* pParser = CSenXmlReader::NewL();
+    CleanupStack::PushL(pParser);
+    CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewLC(KString,*pParser);
+    if(pProperties)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;
+    
+}
+
+TInt CsenutilsTestCases::SenHttpTransportProperties_NewL_2L(CStifItemParser& aItem)
+{
+    SetupL();
+
+    
+    TBool Flag;
+    CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewL(*pElement);
+    CleanupStack::PushL(pProperties);
+    if(pProperties)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+        
+}
+
+TInt CsenutilsTestCases::SenHttpTransportProperties_NewLC_2L(CStifItemParser& aItem)
+{
+    SetupL();
+
+    
+    TBool Flag;
+    CSenBaseElement* pElement= CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenHttpTransportProperties *pProperties=CSenHttpTransportProperties::NewLC(*pElement);
+    if(pProperties)
+        Flag=1;
+    else
+        Flag=0;
+    if(!( Flag )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pProperties);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/Bmarm/wsPolicyTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/Bwins/wsPolicyTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/conf/wsPolicyTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,434 @@
+[Test]
+title NewL-test_CWSPolicyUtils_PolicyIdL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicyUtils_PolicyIdL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicyUtils_PolicyNameL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicyUtils_PolicyNameL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicyUtils_IsExpiredPolicyL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicyUtils_IsExpiredPolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicyUtils_IsExpiredPolicyL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicyUtils_IsExpiredPolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CPolicyRegistry_NewL
+create wsPolicyTester obj 
+obj NewL-test_CPolicyRegistry_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CPolicyRegistry_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CPolicyRegistry_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title LookupPolicy-test_CPolicyRegistry_LookupPolicy
+create wsPolicyTester obj 
+obj LookupPolicy-test_CPolicyRegistry_LookupPolicy 
+delete obj 
+[Endtest] 
+
+[Test]
+title LookupPolicyByName-test_CPolicyRegistry_LookupPolicyByName
+create wsPolicyTester obj 
+obj LookupPolicyByName-test_CPolicyRegistry_LookupPolicyByName 
+delete obj 
+[Endtest] 
+
+[Test]
+title RegisterPolicy-test_CPolicyRegistry_RegisterPolicy
+create wsPolicyTester obj 
+obj RegisterPolicy-test_CPolicyRegistry_RegisterPolicy 
+delete obj 
+[Endtest] 
+
+[Test]
+title UnregisterPolicy-test_CPolicyRegistry_UnregisterPolicy
+create wsPolicyTester obj 
+obj UnregisterPolicy-test_CPolicyRegistry_UnregisterPolicy 
+delete obj 
+[Endtest] 
+
+[Test]
+title PopulateRegistry-test_CPolicyRegistry_PopulateRegistry
+create wsPolicyTester obj 
+obj PopulateRegistry-test_CPolicyRegistry_PopulateRegistry 
+delete obj 
+[Endtest] 
+
+[Test]
+title ResetRegistry-test_CPolicyRegistry_ResetRegistry
+create wsPolicyTester obj 
+obj ResetRegistry-test_CPolicyRegistry_ResetRegistry 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicy_NewL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicy_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CWSPolicy_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CWSPolicy_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicy_NewL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicy_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CWSPolicy_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CWSPolicy_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NormalizePolicyL-test_CWSPolicy_NormalizePolicyL
+create wsPolicyTester obj 
+obj NormalizePolicyL-test_CWSPolicy_NormalizePolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title IntersectPolicyL-test_CWSPolicy_IntersectPolicyL
+create wsPolicyTester obj 
+obj IntersectPolicyL-test_CWSPolicy_IntersectPolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title MergePolicyL-test_CWSPolicy_MergePolicyL
+create wsPolicyTester obj 
+obj MergePolicyL-test_CWSPolicy_MergePolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title Normalized-test_CWSPolicy_Normalized
+create wsPolicyTester obj 
+obj Normalized-test_CWSPolicy_Normalized 
+delete obj 
+[Endtest] 
+
+[Test]
+title Policy-test_CWSPolicy_Policy
+create wsPolicyTester obj 
+obj Policy-test_CWSPolicy_Policy 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlL-test_CWSPolicy_AsXmlL
+create wsPolicyTester obj 
+obj AsXmlL-test_CWSPolicy_AsXmlL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NormalizedPolicy-test_CWSPolicy_NormalizedPolicy
+create wsPolicyTester obj 
+obj NormalizedPolicy-test_CWSPolicy_NormalizedPolicy 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsExpiredPolicy-test_CWSPolicy_IsExpiredPolicy
+create wsPolicyTester obj 
+obj IsExpiredPolicy-test_CWSPolicy_IsExpiredPolicy 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CSenInternalWsPolicy_NewL
+create wsPolicyTester obj 
+obj NewL-test_CSenInternalWsPolicy_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenInternalWsPolicy_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenInternalWsPolicy_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CSenInternalWsPolicy_NewL
+create wsPolicyTester obj 
+obj NewL-test_CSenInternalWsPolicy_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenInternalWsPolicy_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenInternalWsPolicy_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenInternalWsPolicy_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenInternalWsPolicy_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenInternalWsPolicy_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenInternalWsPolicy_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL
+create wsPolicyTester obj 
+obj IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL
+create wsPolicyTester obj 
+obj IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL
+create wsPolicyTester obj 
+obj IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL 
+delete obj 
+[Endtest] 
+
+[Test]
+title UpdateMetadataEndpointL-test_CSenInternalWsPolicy_UpdateMetadataEndpointL
+create wsPolicyTester obj 
+obj UpdateMetadataEndpointL-test_CSenInternalWsPolicy_UpdateMetadataEndpointL 
+delete obj 
+[Endtest] 
+
+[Test]
+title UpdateMetadataEndpointL-test_CSenInternalWsPolicy_AddMetadataPolicyL
+create wsPolicyTester obj 
+obj UpdateMetadataEndpointL-test_CSenInternalWsPolicy_AddMetadataPolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title UpdateMetadataEndpointL-test_CSenInternalWsPolicy_RemoveMetadataPolicyL
+create wsPolicyTester obj 
+obj UpdateMetadataEndpointL-test_CSenInternalWsPolicy_RemoveMetadataPolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title WsPolicyByUriL-test_CSenInternalWsPolicy_WsPolicyByUriL
+create wsPolicyTester obj 
+obj WsPolicyByUriL-test_CSenInternalWsPolicy_WsPolicyByUriL 
+delete obj 
+[Endtest] 
+
+[Test]
+title WsPolicyByName-test_CSenInternalWsPolicy_WsPolicyByName
+create wsPolicyTester obj 
+obj WsPolicyByName-test_CSenInternalWsPolicy_WsPolicyByName 
+delete obj 
+[Endtest] 
+
+[Test]
+title ValidUntilL-test_CSenInternalWsPolicy_ValidUntilL
+create wsPolicyTester obj 
+obj ValidUntilL-test_CSenInternalWsPolicy_ValidUntilL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CSenWSPolicyIdentifier_NewL
+create wsPolicyTester obj 
+obj NewL-test_CSenWSPolicyIdentifier_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenWSPolicyIdentifier_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenWSPolicyIdentifier_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CSenWSPolicyIdentifier_NewL
+create wsPolicyTester obj 
+obj NewL-test_CSenWSPolicyIdentifier_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenWSPolicyIdentifier_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenWSPolicyIdentifier_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CSenWSPolicyIdentifier_NewL
+create wsPolicyTester obj 
+obj NewL-test_CSenWSPolicyIdentifier_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CSenWSPolicyIdentifier_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CSenWSPolicyIdentifier_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPropertyL-test_CSenWSPolicyIdentifier_SetPropertyL
+create wsPolicyTester obj 
+obj SetPropertyL-test_CSenWSPolicyIdentifier_SetPropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title PropertyL-test_CSenWSPolicyIdentifier_PropertyL
+create wsPolicyTester obj 
+obj PropertyL-test_CSenWSPolicyIdentifier_PropertyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetIdL-test_CSenWSPolicyIdentifier_SetIdL
+create wsPolicyTester obj 
+obj SetIdL-test_CSenWSPolicyIdentifier_SetIdL 
+delete obj 
+[Endtest] 
+
+[Test]
+title IdL-test_CSenWSPolicyIdentifier_IdL
+create wsPolicyTester obj 
+obj IdL-test_CSenWSPolicyIdentifier_IdL 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddMetadataEndpointL-test_CSenWSPolicyIdentifier_AddMetadataEndpointL
+create wsPolicyTester obj 
+obj AddMetadataEndpointL-test_CSenWSPolicyIdentifier_AddMetadataEndpointL 
+delete obj 
+[Endtest] 
+
+[Test]
+title MetadataEndpointL-test_CSenWSPolicyIdentifier_MetadataEndpointL
+create wsPolicyTester obj 
+obj MetadataEndpointL-test_CSenWSPolicyIdentifier_MetadataEndpointL 
+delete obj 
+[Endtest] 
+
+[Test]
+title MetadataEndpointElementL-test_CSenWSPolicyIdentifier_MetadataEndpointElementL
+create wsPolicyTester obj 
+obj MetadataEndpointElementL-test_CSenWSPolicyIdentifier_MetadataEndpointElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title ElementAttribValueL-test_CSenWSPolicyIdentifier_ElementAttribValueL
+create wsPolicyTester obj 
+obj ElementAttribValueL-test_CSenWSPolicyIdentifier_ElementAttribValueL 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasAttributeL-test_CSenWSPolicyIdentifier_HasAttributeL
+create wsPolicyTester obj 
+obj HasAttributeL-test_CSenWSPolicyIdentifier_HasAttributeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicyWriter_NewL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicyWriter_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CWSPolicyWriter_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CWSPolicyWriter_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test_CWSPolicyReader_NewL
+create wsPolicyTester obj 
+obj NewL-test_CWSPolicyReader_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test_CWSPolicyReader_NewLC
+create wsPolicyTester obj 
+obj NewLC-test_CWSPolicyReader_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title GetPolicyL-test_CWSPolicyReader_GetPolicyL
+create wsPolicyTester obj 
+obj GetPolicyL-test_CWSPolicyReader_GetPolicyL 
+delete obj 
+[Endtest] 
+
+[Test]
+title WriteToFileAllL-test_CWSPolicyWriter_WriteToFileAllL
+create wsPolicyTester obj 
+obj WriteToFileAllL-test_CWSPolicyWriter_WriteToFileAllL 
+delete obj 
+[Endtest] 
+
+[Test]
+title WriteToFileAllL-test_CWSPolicyWriter_WriteToFileAllL
+create wsPolicyTester obj 
+obj WriteToFileAllL-test_CWSPolicyWriter_WriteToFileAllL 
+delete obj 
+[Endtest] 
+
+[Test]
+title WriteAllAsXmlL-test_CWSPolicyWriter_WriteAllAsXmlL
+create wsPolicyTester obj 
+obj WriteAllAsXmlL-test_CWSPolicyWriter_WriteAllAsXmlL 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/eabi/wsPolicyTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZN14CWSPolicyUtils10PolicyUriLEP11CSenElement @ 2 NONAME
+	_ZN14CWSPolicyUtils11PolicyNameLEP11CSenElement @ 3 NONAME
+	_ZN14CWSPolicyUtils16IsExpiredPolicyLEP11CSenElement @ 4 NONAME
+	_ZN14CWSPolicyUtils9PolicyIdLEP11CSenElement @ 5 NONAME
+	_ZTI10CAssertion @ 6 NONAME ; #<TI>#
+	_ZTI15CWSPolicyReader @ 7 NONAME ; #<TI>#
+	_ZTI15CWSPolicyWriter @ 8 NONAME ; #<TI>#
+	_ZTI16CPolicyAssertion @ 9 NONAME ; #<TI>#
+	_ZTI19CPrimitiveAssertion @ 10 NONAME ; #<TI>#
+	_ZTI20CSenInternalWsPolicy @ 11 NONAME ; #<TI>#
+	_ZTI21CTestInternalWSPolicy @ 12 NONAME ; #<TI>#
+	_ZTI22CAndCompositeAssertion @ 13 NONAME ; #<TI>#
+	_ZTI22CSenWSPolicyIdentifier @ 14 NONAME ; #<TI>#
+	_ZTI22CSenWSPolicyProperties @ 15 NONAME ; #<TI>#
+	_ZTI22CXorCompositeAssertion @ 16 NONAME ; #<TI>#
+	_ZTI25CPolicyReferenceAssertion @ 17 NONAME ; #<TI>#
+	_ZTI6CQName @ 18 NONAME ; #<TI>#
+	_ZTI9CMyXmlEle @ 19 NONAME ; #<TI>#
+	_ZTV10CAssertion @ 20 NONAME ; #<VT>#
+	_ZTV15CWSPolicyReader @ 21 NONAME ; #<VT>#
+	_ZTV15CWSPolicyWriter @ 22 NONAME ; #<VT>#
+	_ZTV16CPolicyAssertion @ 23 NONAME ; #<VT>#
+	_ZTV19CPrimitiveAssertion @ 24 NONAME ; #<VT>#
+	_ZTV20CSenInternalWsPolicy @ 25 NONAME ; #<VT>#
+	_ZTV21CTestInternalWSPolicy @ 26 NONAME ; #<VT>#
+	_ZTV22CAndCompositeAssertion @ 27 NONAME ; #<VT>#
+	_ZTV22CSenWSPolicyIdentifier @ 28 NONAME ; #<VT>#
+	_ZTV22CSenWSPolicyProperties @ 29 NONAME ; #<VT>#
+	_ZTV22CXorCompositeAssertion @ 30 NONAME ; #<VT>#
+	_ZTV25CPolicyReferenceAssertion @ 31 NONAME ; #<VT>#
+	_ZTV6CQName @ 32 NONAME ; #<VT>#
+	_ZTV9CMyXmlEle @ 33 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for wspolicytester
+*
+*/
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+wsPolicyTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/group/wsPolicyTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for wspolicytester 
+*
+*/
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          wsPolicyTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+
+//TARGETPATH      ?target_path
+DEFFILE         wsPolicyTester.def
+SOURCEPATH              ../src
+SOURCE			myxml.cpp
+SOURCE			testinternalwspolicy.cpp
+
+SOURCEPATH		../../../../../webservices/wsstar/wsstarpolicy/src
+SOURCE 			seninternalwspolicy.cpp
+SOURCE			wspolicywriter.cpp
+SOURCE			wspolicyreader.cpp
+SOURCE			policyassertion.cpp
+SOURCE			assertion.cpp
+SOURCE			andcompositeassertion.cpp
+SOURCE			xorcompositeassertion.cpp
+SOURCE			compositeassertion.cpp
+SOURCE			policyreferenceassertion.cpp
+SOURCE			primitiveassertion.cpp
+SOURCE			wspolicyutils.cpp
+
+USERINCLUDE             ../src
+USERINCLUDE     ../inc 
+
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+
+SYSTEMINCLUDE           ../../../../../webservices/wsutils/inc
+SYSTEMINCLUDE           ../../../../../webservices/wsstar/wsstarpolicy/inc
+SYSTEMINCLUDE           ../../../../../webservices/wsframework/inc
+SYSTEMINCLUDE           ../../../../../webservices/wsdescription/inc
+SYSTEMINCLUDE           /epoc32/include/libc
+SYSTEMINCLUDE           /epoc32/include/xml
+
+
+	
+#ifdef SBSV2
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          	wsPolicyTester.cpp
+SOURCE          	wsPolicyTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         	stiftestinterface.lib
+LIBRARY         	stiftestengine.lib
+LIBRARY			flogger.lib
+LIBRARY                 ecom.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 estlib.lib
+LIBRARY                 estor.lib
+LIBRARY                 euser.lib
+LIBRARY                 bafl.lib 
+LIBRARY                 flogger.lib
+LIBRARY                 WSPolicy.lib
+LIBRARY                 XMLFRAMEWORK.lib
+
+LANG            SC
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+LIBRARY 		SenFramework.lib
+LIBRARY 		SenLogger.lib
+LIBRARY 		SenServDesc.lib
+LIBRARY 		SenUtils.lib
+LIBRARY 		SenXml.lib
+#else
+LIBRARY 		wsFramework.lib
+LIBRARY 		wsLogger.lib
+LIBRARY 		wsServDesc.lib
+LIBRARY 		wsUtils.lib
+LIBRARY 		wsXml.lib
+#endif
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+LIBRARY                 XmlEngine.lib
+LIBRARY                 XmlEngineDOM.lib
+LIBRARY                 XmlEngineUtils.lib
+#else
+LIBRARY         	WsStarXmlEngine.lib
+LIBRARY         	WsStarXmlEngineDOM.lib
+LIBRARY         	WsStarXmlEngineUtils.lib
+#endif
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/group/wsPolicyTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\wsPolicyTester.dll"   -   "c:\Sys\Bin\wsPolicyTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\wsPolicyTester.cfg"-"c:\testing\conf\wsPolicyTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/inc/myxml.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef MYXMLELE_H
+#define MYXMLELE_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenDomFragment.h"
+
+
+class CMyXmlEle :public CSenDomFragment
+{
+public:    
+    static CMyXmlEle* NewL();
+    static CMyXmlEle* NewLC();
+    ~CMyXmlEle();
+    
+    void ReadFileL(TFileName aPath);
+    void WriteAllL(CSenElement* aXml);
+    CSenElement* XMLDocL();
+private:
+
+    CMyXmlEle();
+    void ConstructL();
+    TInt count;
+
+};
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/inc/testinternalwspolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef CTESTINTERNALWSPOLICY_H
+#define CTESTINTERNALWSPOLICY_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenDomFragment.h"
+#include <seninternalwspolicy.h>
+#include <wspolicywriter.h>
+#include <wspolicyreader.h>
+#include <policyassertion.h>
+
+//#include <SenWSPolicyIdentifier.h>
+
+
+class CTestInternalWSPolicy :public CSenInternalWsPolicy//, CSenWSPolicyIdentifier
+{
+public:    
+    static CTestInternalWSPolicy* NewL();
+    static CTestInternalWSPolicy* NewLC();
+    static CTestInternalWSPolicy* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+    static CTestInternalWSPolicy* NewLC(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+	static CTestInternalWSPolicy* NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes,
+                                                           CSenElement& aParent);
+    static CTestInternalWSPolicy* NewLC(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes,
+                                                           CSenElement& aParent);
+	TBool IsApplicableL(const TDesC8& aPolicyEndpoint);
+	TBool IsApplicableL(CSenInternalWsPolicy* aInternalPolicy);
+	TBool IsApplicableL(CSenWSDescription& aPattern);
+	
+	TBool UpdateMetadataEndpointL(CSenInternalWsPolicy* aInternalPolicy, TInt& aExist);
+	
+	TInt AddMetadataPolicyL(CSenElement* aElement);
+	TInt RemoveMetadataPolicyL(const TDesC8& aUri);
+    CSenElement* WsPolicyByUriL(const TDesC8& aUri);
+    CSenElement* WsPolicyByName(const TDesC8& aName);
+	TTime ValidUntilL(const TDesC8& aUri);
+        
+    ~CTestInternalWSPolicy();
+    //CTestInternalWSPolicy();
+    
+    
+};
+
+/////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class CTestWSPolicyIdentifier : public CSenWSPolicyIdentifier
+{
+public:
+	static CTestWSPolicyIdentifier* NewL();
+	static CTestWSPolicyIdentifier* NewLC();
+	static CTestWSPolicyIdentifier* NewL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes);
+	static CTestWSPolicyIdentifier* NewLC(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes);
+	static CTestWSPolicyIdentifier* NewL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes,
+                                         CSenElement& aParent);
+	static CTestWSPolicyIdentifier* NewLC(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes,
+                                         CSenElement& aParent);
+
+	TInt SetPropertyL(const TDesC8& aName,const TDesC8& aValue);
+	TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
+	void SetIdL(TInt aId);
+	TInt IdL();
+	TInt AddMetadataEndpointL(CSenElement* aElement);
+	TPtrC8 MetadataEndpointL();
+	CSenElement* MetadataEndpointElementL();
+	TPtrC8 ElementAttribValueL(CSenElement* aElement, const TDesC8& aName);
+	TBool HasAttributeL(CSenElement* aElement, const TDesC8& aName);
+
+
+};
+
+/////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class CTestPolicyWriter : public CWSPolicyWriter
+{
+	public:
+	
+	static CTestPolicyWriter* NewL();
+	static CTestPolicyWriter* NewLC();
+	void WriteToFileAllL(CSenElement* aXml);
+	void WriteToFileAllL(TDesC8& aXml);
+	HBufC8* WriteAllAsXmlL(CPolicyAssertion* aXml);
+};
+
+
+/////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class CTestPolicyReader : public CWSPolicyReader
+{
+	public:
+	
+	static CTestPolicyReader* NewL();
+	static CTestPolicyReader* NewLC();
+	CPolicyAssertion* GetPolicyL(CSenElement* aEle);
+};
+
+#endif
+
+/////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
+class CTestPolicyAssertion : public CPolicyAssertion
+{
+	public:
+	
+	static CPolicyAssertion* NewL();
+	static CTestPolicyAssertion* NewLC();
+};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/inc/wsPolicyTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,321 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef WSPOLICYTESTER_H
+#define WSPOLICYTESTER_H
+
+//  EXTERNAL INCLUDES
+#include "SenBaseFragment.h"
+#include "SenBaseElement.h"
+#include "SenDomFragment.h"
+#include<flogger.h>
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KwsPolicyTesterLogPath, "\\logs\\testframework\\wsPolicyTester\\" ); 
+// Log file
+_LIT( KwsPolicyTesterLogFile, "wsPolicyTester.txt" ); 
+_LIT( KwsPolicyTesterLogFileWithTitle, "wsPolicyTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CwsPolicyTester;
+class CPolicyRegistry;
+class CWSPolicy;
+
+#include <e32def.h>
+#include <e32std.h>
+#include <f32file.h>
+#ifndef NONSHARABLE_CLASS
+    #define NONSHARABLE_CLASS(x) class x
+#endif
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CwsPolicyTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CwsPolicyTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CwsPolicyTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CwsPolicyTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CwsPolicyTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+    private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+
+         TInt MT_CWSPolicyUtils_PolicyIdLL(CStifItemParser& aItem);
+
+         TInt MT_CWSPolicyUtils_PolicyNameLL(CStifItemParser& aItem );
+         TInt MT_CWSPolicyUtils_PolicyUriLL(CStifItemParser& aItem );
+
+         TInt MT_CWSPolicyUtils_IsExpiredPolicyLL(CStifItemParser& aItem );
+         
+                                    
+         TInt MT_CPolicyRegistry_NewLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_NewLCL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_SetParentL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_ParentL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_LookupPolicyL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_LookupPolicyByNameL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_RegisterPolicyL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_UnregisterPolicyL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_PopulateRegistryL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CPolicyRegistry_ResetRegistryL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NewLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NewLCL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NewL_1L(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NewLC_1L(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NormalizePolicyLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_IntersectPolicyLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_MergePolicyLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NormalizedL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_PolicyNormalizerL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_PolicyAsXmlLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_Policy(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NormalizedAsXmlLL(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_NormalizedPolicy(CStifItemParser& aItem );
+        
+        
+         TInt MT_CWSPolicy_IsExpiredPolicyL(CStifItemParser& aItem );
+         
+         TInt MT_CSenInternalWsPolicy_NewLL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_NewLCL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_NewL_1L(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_NewLC_1L(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_NewL_2L(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_NewLC_2L(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_IsApplicableLL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_IsApplicableL_1L(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_IsApplicableL_2L(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_UpdateMetadataEndpointLL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_AddMetadataPolicyLL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_RemoveMetadataPolicyLL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_WsPolicyByUriLL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_WsPolicyByNameL(CStifItemParser& aItem );
+         TInt MT_CSenInternalWsPolicy_ValidUntilLL(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_NewLL(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_NewLCL(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_NewL_1L(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_NewLC_1L(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_NewL_2L(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_NewLC_2L(CStifItemParser& aItem );
+         TInt MT_CSenWSPolicyIdentifier_SetPropertyLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_PropertyLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_SetIdLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_IdLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_AddMetadataEndpointLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_MetadataEndpointLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_MetadataEndpointElementLL(CStifItemParser& aItem );    
+         TInt MT_CSenWSPolicyIdentifier_ElementAttribValueLL(CStifItemParser& aItem );         
+         TInt MT_CSenWSPolicyIdentifier_HasAttributeLL(CStifItemParser& aItem ); 
+         TInt MT_CWSPolicyWriter_NewLL(CStifItemParser& aItem );
+         TInt MT_CWSPolicyWriter_NewLCL(CStifItemParser& aItem );
+         TInt MT_CWSPolicyWriter_WriteToFileAllLL(CStifItemParser& aItem );
+         TInt MT_CWSPolicyWriter_WriteToFileAllL_1L(CStifItemParser& aItem );
+         TInt MT_CWSPolicyWriter_WriteAllAsXmlLL(CStifItemParser& aItem );
+         
+         
+         TInt MT_CWSPolicyReader_NewLL(CStifItemParser& aItem );
+         TInt MT_CWSPolicyReader_NewLCL(CStifItemParser& aItem );
+         TInt MT_CWSPolicyReader_GetPolicyLL(CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+        void DoNormalizePolicyL(TFileName aFile, TInt count);
+        void TestIntersectPolicyL(TInt i, TInt j);
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+//        RFs iFss;
+//		RFileLogger fL;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // WSPOLICYTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\wsPolicyTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/myxml.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include "myxml.h"
+#include "SenBaseAttribute.h"
+
+namespace
+{
+  _LIT8( KWsuId , "wsu:Id");                       // Prefix ID
+}
+CMyXmlEle* CMyXmlEle::NewL()
+{
+     CMyXmlEle* pSelf = CMyXmlEle::NewLC();
+    CleanupStack::Pop(pSelf);
+    return pSelf;
+}
+CMyXmlEle* CMyXmlEle::NewLC()
+{
+       CMyXmlEle* pSelf = new (ELeave) CMyXmlEle();
+    CleanupStack::PushL(pSelf);
+    pSelf->ConstructL();
+    return pSelf;
+  
+}
+CMyXmlEle::~CMyXmlEle()
+{
+  delete iXmlReader;
+}
+CMyXmlEle::CMyXmlEle()
+{
+    
+}
+void CMyXmlEle::ConstructL()
+{
+  iXmlReader = CSenXmlReader::NewL();
+}
+
+CSenElement* CMyXmlEle::XMLDocL()
+{
+CSenElement* ele = &AsElement();
+    if(ele)
+        return ele;
+    else
+        return NULL;
+}
+void CMyXmlEle::ReadFileL(TFileName aPath)
+{
+      RFs fss;
+       User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+
+    TFileName iFileName1(aPath);
+    RFile  xmlFile;
+    xmlFile.Open(fss , iFileName1, EFileRead );
+
+
+    TInt size;
+    xmlFile.Size(size);
+
+    HBufC8 *iBuf=HBufC8::NewL(size);
+
+    TPtr8 buf8ptr(iBuf->Des());
+    xmlFile.Read(buf8ptr,size);
+    xmlFile.Close();
+    size = iBuf->Length();
+    if(size > 0)
+        {
+        TPtr8 buf8ptr(iBuf->Des());
+        
+        TRAPD (err, ParseL(buf8ptr));
+        
+        }
+    delete iBuf;        
+    CleanupStack::PopAndDestroy(1); // fss        
+}
+
+void CMyXmlEle::WriteAllL(CSenElement* aXml)
+{
+      RFs fss;
+       User::LeaveIfError(fss.Connect());
+        CleanupClosePushL(fss);
+        
+    TBuf<255> file;
+    _LIT( KFileName, "e:\\testing\\data\\normalizer%d.xml");
+    file.Format(KFileName, count);
+    count++;
+    TPtrC OutputFile(file);
+    
+   RFile  xmlFile;
+   xmlFile.Replace(fss , OutputFile, EFileWrite );
+   HBufC8* temp = aXml->AsXmlL();
+   xmlFile.Write(temp->Des());
+   xmlFile.Close();
+   delete temp;
+    
+   CleanupStack::PopAndDestroy(1); // fss
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/testinternalwspolicy.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include "testinternalwspolicy.h"
+
+CTestInternalWSPolicy* CTestInternalWSPolicy::NewL()
+{
+	return((CTestInternalWSPolicy*)CSenInternalWsPolicy::NewL());
+}
+
+CTestInternalWSPolicy* CTestInternalWSPolicy::NewLC()
+{
+	return((CTestInternalWSPolicy*)CSenInternalWsPolicy::NewLC());
+}
+
+CTestInternalWSPolicy* CTestInternalWSPolicy::NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+{
+	return((CTestInternalWSPolicy*)CSenInternalWsPolicy::NewL(aNsUri,aLocalName,aQName,aAttributes));
+}
+
+CTestInternalWSPolicy* CTestInternalWSPolicy::NewLC(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes)
+{
+	return((CTestInternalWSPolicy*)CSenInternalWsPolicy::NewLC(aNsUri,aLocalName,aQName,aAttributes));
+}
+
+CTestInternalWSPolicy* CTestInternalWSPolicy::NewL(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes,
+                                                           CSenElement& aParent)
+{
+	return((CTestInternalWSPolicy*)CSenInternalWsPolicy::NewL(aNsUri,aLocalName,aQName,aAttributes,aParent));
+}                                                           
+
+CTestInternalWSPolicy* CTestInternalWSPolicy::NewLC(const TDesC8& aNsUri,
+                                                           const TDesC8& aLocalName,
+                                                           const TDesC8& aQName,
+                                                           const RAttributeArray& aAttributes,
+                                                           CSenElement& aParent)
+{
+	return((CTestInternalWSPolicy*)CSenInternalWsPolicy::NewLC(aNsUri,aLocalName,aQName,aAttributes,aParent));
+}
+    
+CTestInternalWSPolicy::~CTestInternalWSPolicy()
+{
+	
+}
+
+TBool CTestInternalWSPolicy::IsApplicableL(const TDesC8& aPolicyEndpoint)
+{
+	return(CSenInternalWsPolicy::IsApplicableL(aPolicyEndpoint));
+}
+
+TBool CTestInternalWSPolicy::IsApplicableL(CSenInternalWsPolicy* aInternalPolicy)
+{
+	return(CSenInternalWsPolicy::IsApplicableL(aInternalPolicy));
+}
+
+TBool CTestInternalWSPolicy::IsApplicableL(CSenWSDescription& aPattern)
+{
+	return(CSenInternalWsPolicy::IsApplicableL(aPattern));
+}
+
+TBool CTestInternalWSPolicy::UpdateMetadataEndpointL(CSenInternalWsPolicy* aInternalPolicy, TInt& aExist)
+{
+	return(CSenInternalWsPolicy::UpdateMetadataEndpointL(aInternalPolicy,aExist));
+}
+
+TInt CTestInternalWSPolicy::AddMetadataPolicyL(CSenElement* aElement)
+{
+	return(CSenInternalWsPolicy::AddMetadataPolicyL(aElement));
+}
+TInt CTestInternalWSPolicy::RemoveMetadataPolicyL(const TDesC8& aUri)
+{
+	return(CSenInternalWsPolicy::RemoveMetadataPolicyL(aUri));
+}
+CSenElement* CTestInternalWSPolicy::WsPolicyByUriL(const TDesC8& aUri)
+{
+	return(CSenInternalWsPolicy::WsPolicyByUriL(aUri));
+}
+CSenElement* CTestInternalWSPolicy::WsPolicyByName(const TDesC8& aName)
+{
+	return(CSenInternalWsPolicy::WsPolicyByName(aName));
+}
+TTime CTestInternalWSPolicy::ValidUntilL(const TDesC8& aUri)
+{
+	return(CSenInternalWsPolicy::ValidUntilL(aUri));
+}
+    
+
+////////////////////////////////////////////////////////////////////////
+/////////////////////CTestWSPolicyIdentifier///////////////////////////
+//////////////////////////////////////////////////////////////////////
+
+
+CTestWSPolicyIdentifier* CTestWSPolicyIdentifier::NewL()
+{
+	return ((CTestWSPolicyIdentifier*)CSenWSPolicyIdentifier::NewL());
+}
+
+CTestWSPolicyIdentifier* CTestWSPolicyIdentifier::NewLC()
+{
+	return ((CTestWSPolicyIdentifier*)CSenWSPolicyIdentifier::NewLC());
+}
+	
+CTestWSPolicyIdentifier* CTestWSPolicyIdentifier::NewL(const TDesC8& aNsUri,
+                                         				const TDesC8& aLocalName,
+                                         				const TDesC8& aQName,
+                                         				const RAttributeArray& aAttributes)
+{
+	return ((CTestWSPolicyIdentifier*)CSenWSPolicyIdentifier::NewL(aNsUri,aLocalName,aQName,aAttributes));
+}
+
+CTestWSPolicyIdentifier* CTestWSPolicyIdentifier::NewLC(const TDesC8& aNsUri,
+                                         				const TDesC8& aLocalName,
+                                         				const TDesC8& aQName,
+                                         				const RAttributeArray& aAttributes)
+{
+	return ((CTestWSPolicyIdentifier*)CSenWSPolicyIdentifier::NewLC(aNsUri,aLocalName,aQName,aAttributes));
+}
+	
+CTestWSPolicyIdentifier* CTestWSPolicyIdentifier::NewL(const TDesC8& aNsUri,
+                                         				const TDesC8& aLocalName,
+                                         				const TDesC8& aQName,
+                                         				const RAttributeArray& aAttributes,
+                                         				CSenElement& aParent)
+{
+	return ((CTestWSPolicyIdentifier*)CSenWSPolicyIdentifier::NewL(aNsUri,aLocalName,aQName,aAttributes,aParent));
+}
+
+CTestWSPolicyIdentifier* CTestWSPolicyIdentifier::NewLC(const TDesC8& aNsUri,
+                                         				const TDesC8& aLocalName,
+                                         				const TDesC8& aQName,
+                                         				const RAttributeArray& aAttributes,
+                                         				CSenElement& aParent)
+{
+	return ((CTestWSPolicyIdentifier*)CSenWSPolicyIdentifier::NewLC(aNsUri,aLocalName,aQName,aAttributes,aParent));
+}
+
+TInt CTestWSPolicyIdentifier::SetPropertyL(const TDesC8& aName,const TDesC8& aValue)
+{
+	return(CSenWSPolicyProperties::SetPropertyL(aName,aValue));
+}
+                                                         
+TInt CTestWSPolicyIdentifier::PropertyL(const TDesC8& aName, TPtrC8& aValue)
+{
+	return(CSenWSPolicyProperties::PropertyL(aName,aValue));
+}
+void CTestWSPolicyIdentifier::SetIdL(TInt aId)
+{
+	return(CSenWSPolicyIdentifier::SetIdL(aId));
+}
+TInt CTestWSPolicyIdentifier::IdL()
+{
+	return(CSenWSPolicyIdentifier::IdL());
+}
+
+TInt CTestWSPolicyIdentifier::AddMetadataEndpointL(CSenElement* aElement)
+{
+	return(CSenWSPolicyIdentifier::AddMetadataEndpointL(aElement));
+}
+
+TPtrC8 CTestWSPolicyIdentifier::MetadataEndpointL()
+{
+	return(CSenWSPolicyIdentifier::MetadataEndpointL());
+}
+
+CSenElement* CTestWSPolicyIdentifier::MetadataEndpointElementL()
+{
+	return(CSenWSPolicyIdentifier::MetadataEndpointElementL());
+}
+
+TPtrC8 CTestWSPolicyIdentifier::ElementAttribValueL(CSenElement* aElement, const TDesC8& aName)
+{
+	return(CSenWSPolicyIdentifier::ElementAttribValueL(aElement,aName));
+}
+
+TBool CTestWSPolicyIdentifier::HasAttributeL(CSenElement* aElement, const TDesC8& aName)
+{
+	return(CSenWSPolicyIdentifier::HasAttributeL(aElement,aName));
+}
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////CTestPolicyWriter///////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+CTestPolicyWriter* CTestPolicyWriter::NewL()
+{
+	return ((CTestPolicyWriter*)CWSPolicyWriter::NewL());
+}
+
+CTestPolicyWriter* CTestPolicyWriter::NewLC()
+{
+	return ((CTestPolicyWriter*)CWSPolicyWriter::NewLC());
+}
+void CTestPolicyWriter::WriteToFileAllL(CSenElement* aXml)
+{
+	return (CWSPolicyWriter::WriteToFileAllL(aXml));
+}
+void CTestPolicyWriter::WriteToFileAllL(TDesC8& aXml)
+{
+	return (CWSPolicyWriter::WriteToFileAllL(aXml));
+}
+HBufC8* CTestPolicyWriter::WriteAllAsXmlL(CPolicyAssertion* aPolicy)
+{
+//	return (CWSPolicyWriter::WriteAllAsXmlL(aPolicy));
+}
+/////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////CTestPolicyReader/////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+CTestPolicyReader* CTestPolicyReader::NewL()
+{
+	return ((CTestPolicyReader*)CWSPolicyReader::NewL());
+}
+
+CTestPolicyReader* CTestPolicyReader::NewLC()
+{
+	return ((CTestPolicyReader*)CWSPolicyReader::NewLC());
+}
+CPolicyAssertion* CTestPolicyReader::GetPolicyL(CSenElement* aPolicy)
+{
+	return (CWSPolicyReader::GetPolicyL(aPolicy));
+}
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////CTestPolicyAssertion///////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+CPolicyAssertion* CTestPolicyAssertion::NewL()
+{
+	return (CPolicyAssertion::NewL());
+}
+
+CTestPolicyAssertion* CTestPolicyAssertion::NewLC()
+{
+	return ((CTestPolicyAssertion*)CPolicyAssertion::NewLC());
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/wsPolicyTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "wsPolicyTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CwsPolicyTester::CwsPolicyTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CwsPolicyTester::CwsPolicyTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CwsPolicyTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CwsPolicyTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KwsPolicyTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KwsPolicyTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KwsPolicyTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CwsPolicyTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CwsPolicyTester* CwsPolicyTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CwsPolicyTester* self = new (ELeave) CwsPolicyTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CwsPolicyTester::~CwsPolicyTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CwsPolicyTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CwsPolicyTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("wsPolicyTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CwsPolicyTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsPolicyTester/src/wsPolicyTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2069 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+//  CLASS HEADER
+#include "myxml.h"
+//  EXTERNAL INCLUDES
+#include <wspolicyregistry.h>
+#include <wspolicy.h>
+#include <wspolicyutils.h>
+#include <TestInternalWSPolicy.h>
+#include <stringpool.h>
+#include <senwsdescription.h>
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "wsPolicyTester.h"
+#include <StifTestModule.h>
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+namespace
+{
+
+_LIT8( KWsPolicyNsUri , "http://schemas.xmlsoap.org/ws/2004/09/policy"); // Namespace of WS-Policy
+_LIT8( KWsPolicy , "Policy");                       // Tag name of Policy
+_LIT8( KWsPolicyPrefix , "wsp");                    // Prefix of WS-Policy namespace
+_LIT8( KWsPolicyQName , "wsp:Policy");                    // Prefix of WS-Policy namespace
+
+//registry resources
+_LIT(KReg1, "c:\\testing\\data\\registry1.xml");
+_LIT(KReg2, "c:\\testing\\data\\registry2.xml");
+_LIT(KReg3, "c:\\testing\\data\\registry3.xml");
+_LIT8(KID1, "ID1");
+_LIT8(KID2, "ID2");
+_LIT8(KID3, "ID3");
+_LIT8(KP1, "P1");
+_LIT8(KP2, "P2");
+_LIT8(KP3, "P3");
+_LIT8(KURI1, "URI1");
+_LIT8(KURI2, "URI2");
+_LIT8(KURI3, "URI3");
+
+//WSPolicy resource
+_LIT(KPolicy1, "c:\\testing\\data\\policy1.xml");
+_LIT(KPolicy2, "c:\\testing\\data\\policy2.xml"); //
+_LIT(KExpPolicy1, "c:\\testing\\data\\expiry1.xml"); //for expiry tag validation
+_LIT(KPolicy3, "c:\\testing\\data\\policy3.xml"); //for optional element = true
+_LIT(KPolicy3Ref, "c:\\testing\\data\\policy3Ref.xml");
+_LIT(KPolicy4, "c:\\testing\\data\\policy4.xml"); //for nesting
+_LIT(KPolicy4Ref,"c:\\testing\\data\\policy4Ref.xml");
+_LIT(KPolicy5, "c:\\testing\\data\\policy5.xml"); //for multiple nesting
+_LIT(KPolicy5Ref,"c:\\testing\\data\\policy5Ref.xml");
+
+// Policy, name and its normalized reference    
+_LIT8(KPolicyName, "P1");
+_LIT8(KPolicy,   "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" Name=\"P1\" wsu:Id=\"ID1\" MetadataEndpoint=\"URI1\"><wsp:ExactlyOne><wsp:All/></wsp:ExactlyOne></wsp:Policy>");
+_LIT8(KPolicyRef,"<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" Name=\"P1\" wsu:Id=\"ID1\" MetadataEndpoint=\"URI1\"><wsp:ExactlyOne><wsp:All/></wsp:ExactlyOne></wsp:Policy>");
+const TInt KRefLength = 267;
+
+}
+
+
+// MACROS
+#define LOCAL_ASSERT(expression)  {if(!(expression)){return KErrArgument;}}
+#define LOCAL_VOID_ASSERT(expression)	{if(!(expression)){return ;}}
+#define STIFF_ASSERT_NOT_EQUALS_DESC(expression1, expression2, desc){TL((expression1) != (expression2)){RDebug::Print(_L(desc)) ;}}
+#define STIFF_ASSERT_DESC(expression, desc)	{if(!(expression)){RDebug::Print(_L(desc)) ;return KErrArgument;}}
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CwsPolicyTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CwsPolicyTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CwsPolicyTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CwsPolicyTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+  
+        ENTRY("NewL-test_CWSPolicyUtils_PolicyIdL", CwsPolicyTester::MT_CWSPolicyUtils_PolicyIdLL),
+        ENTRY("NewL-test_CWSPolicyUtils_PolicyNameL", CwsPolicyTester::MT_CWSPolicyUtils_PolicyNameLL),
+        ENTRY("NewL-test_CWSPolicyUtils_IsExpiredPolicyL", CwsPolicyTester::MT_CWSPolicyUtils_PolicyUriLL),
+        ENTRY("NewL-test_CWSPolicyUtils_IsExpiredPolicyL", CwsPolicyTester::MT_CWSPolicyUtils_IsExpiredPolicyLL),
+        ENTRY("NewL-test_CPolicyRegistry_NewL", CwsPolicyTester::MT_CPolicyRegistry_NewLL),
+        ENTRY("NewLC-test_CPolicyRegistry_NewLC", CwsPolicyTester::MT_CPolicyRegistry_NewLCL),
+        ENTRY("LookupPolicy-test_CPolicyRegistry_LookupPolicy", CwsPolicyTester::MT_CPolicyRegistry_LookupPolicyL),
+        ENTRY("LookupPolicyByName-test_CPolicyRegistry_LookupPolicyByName", CwsPolicyTester::MT_CPolicyRegistry_LookupPolicyByNameL),
+        ENTRY("RegisterPolicy-test_CPolicyRegistry_RegisterPolicy", CwsPolicyTester::MT_CPolicyRegistry_RegisterPolicyL),
+        ENTRY("UnregisterPolicy-test_CPolicyRegistry_UnregisterPolicy", CwsPolicyTester::MT_CPolicyRegistry_UnregisterPolicyL),
+        ENTRY("PopulateRegistry-test_CPolicyRegistry_PopulateRegistry", CwsPolicyTester::MT_CPolicyRegistry_PopulateRegistryL),
+        ENTRY("ResetRegistry-test_CPolicyRegistry_ResetRegistry", CwsPolicyTester::MT_CPolicyRegistry_ResetRegistryL),
+        ENTRY("NewL-test_CWSPolicy_NewL", CwsPolicyTester::MT_CWSPolicy_NewLL),
+        ENTRY("NewLC-test_CWSPolicy_NewLC", CwsPolicyTester::MT_CWSPolicy_NewLCL),
+        ENTRY("NewL-test_CWSPolicy_NewL", CwsPolicyTester::MT_CWSPolicy_NewL_1L),
+        ENTRY("NewLC-test_CWSPolicy_NewLC", CwsPolicyTester::MT_CWSPolicy_NewLC_1L),
+        ENTRY("NormalizePolicyL-test_CWSPolicy_NormalizePolicyL", CwsPolicyTester::MT_CWSPolicy_NormalizePolicyLL),
+        ENTRY("IntersectPolicyL-test_CWSPolicy_IntersectPolicyL", CwsPolicyTester::MT_CWSPolicy_IntersectPolicyLL),
+        ENTRY("MergePolicyL-test_CWSPolicy_MergePolicyL", CwsPolicyTester::MT_CWSPolicy_MergePolicyLL),
+        ENTRY("Normalized-test_CWSPolicy_Normalized", CwsPolicyTester::MT_CWSPolicy_NormalizedL),
+        ENTRY("Policy-test_CWSPolicy_Policy", CwsPolicyTester::MT_CWSPolicy_Policy),
+        ENTRY("AsXmlL-test_CWSPolicy_AsXmlL", CwsPolicyTester::MT_CWSPolicy_NormalizedAsXmlLL),
+        ENTRY("NormalizedPolicy-test_CWSPolicy_NormalizedPolicy", CwsPolicyTester::MT_CWSPolicy_NormalizedPolicy),
+        ENTRY("IsExpiredPolicy-test_CWSPolicy_IsExpiredPolicy", CwsPolicyTester::MT_CWSPolicy_IsExpiredPolicyL),
+        ENTRY("NewL-test_CSenInternalWsPolicy_NewL", CwsPolicyTester::MT_CSenInternalWsPolicy_NewLL),
+        ENTRY("NewLC-test_CSenInternalWsPolicy_NewLC", CwsPolicyTester::MT_CSenInternalWsPolicy_NewLCL),
+        ENTRY("NewL-test_CSenInternalWsPolicy_NewL", CwsPolicyTester::MT_CSenInternalWsPolicy_NewL_1L),
+        ENTRY("NewLC-test_CSenInternalWsPolicy_NewLC", CwsPolicyTester::MT_CSenInternalWsPolicy_NewLC_1L),
+        ENTRY("NewLC-test_CSenInternalWsPolicy_NewLC", CwsPolicyTester::MT_CSenInternalWsPolicy_NewL_2L),
+        ENTRY("NewLC-test_CSenInternalWsPolicy_NewLC", CwsPolicyTester::MT_CSenInternalWsPolicy_NewLC_2L),
+        ENTRY("IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL", CwsPolicyTester::MT_CSenInternalWsPolicy_IsApplicableLL),
+        ENTRY("IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL", CwsPolicyTester::MT_CSenInternalWsPolicy_IsApplicableL_1L),
+        ENTRY("IsApplicableL-test_CSenInternalWsPolicy_IsApplicableL", CwsPolicyTester::MT_CSenInternalWsPolicy_IsApplicableL_2L),
+        ENTRY("UpdateMetadataEndpointL-test_CSenInternalWsPolicy_UpdateMetadataEndpointL", CwsPolicyTester::MT_CSenInternalWsPolicy_UpdateMetadataEndpointLL),
+        ENTRY("UpdateMetadataEndpointL-test_CSenInternalWsPolicy_AddMetadataPolicyL", CwsPolicyTester::MT_CSenInternalWsPolicy_AddMetadataPolicyLL),
+        ENTRY("UpdateMetadataEndpointL-test_CSenInternalWsPolicy_RemoveMetadataPolicyL", CwsPolicyTester::MT_CSenInternalWsPolicy_RemoveMetadataPolicyLL),
+        ENTRY("WsPolicyByUriL-test_CSenInternalWsPolicy_WsPolicyByUriL", CwsPolicyTester::MT_CSenInternalWsPolicy_WsPolicyByUriLL),
+        ENTRY("WsPolicyByName-test_CSenInternalWsPolicy_WsPolicyByName", CwsPolicyTester::MT_CSenInternalWsPolicy_WsPolicyByNameL),
+        ENTRY("ValidUntilL-test_CSenInternalWsPolicy_ValidUntilL", CwsPolicyTester::MT_CSenInternalWsPolicy_ValidUntilLL),
+        ENTRY("NewL-test_CSenWSPolicyIdentifier_NewL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLL),
+        ENTRY("NewLC-test_CSenWSPolicyIdentifier_NewLC", CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLCL),
+        ENTRY("NewL-test_CSenWSPolicyIdentifier_NewL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewL_1L),
+        ENTRY("NewLC-test_CSenWSPolicyIdentifier_NewLC", CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLC_1L),
+        ENTRY("NewL-test_CSenWSPolicyIdentifier_NewL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewL_2L),
+        ENTRY("NewLC-test_CSenWSPolicyIdentifier_NewLC", CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLC_2L),
+        ENTRY("SetPropertyL-test_CSenWSPolicyIdentifier_SetPropertyL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_SetPropertyLL),
+        ENTRY("PropertyL-test_CSenWSPolicyIdentifier_PropertyL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_PropertyLL),
+        ENTRY("SetIdL-test_CSenWSPolicyIdentifier_SetIdL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_SetIdLL),
+        ENTRY("IdL-test_CSenWSPolicyIdentifier_IdL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_IdLL),
+        ENTRY("AddMetadataEndpointL-test_CSenWSPolicyIdentifier_AddMetadataEndpointL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_AddMetadataEndpointLL),
+        ENTRY("MetadataEndpointL-test_CSenWSPolicyIdentifier_MetadataEndpointL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_MetadataEndpointLL),
+        ENTRY("MetadataEndpointElementL-test_CSenWSPolicyIdentifier_MetadataEndpointElementL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_MetadataEndpointElementLL),
+        ENTRY("ElementAttribValueL-test_CSenWSPolicyIdentifier_ElementAttribValueL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_ElementAttribValueLL),
+        ENTRY("HasAttributeL-test_CSenWSPolicyIdentifier_HasAttributeL", CwsPolicyTester::MT_CSenWSPolicyIdentifier_HasAttributeLL),
+        ENTRY("NewL-test_CWSPolicyWriter_NewL", CwsPolicyTester::MT_CWSPolicyWriter_NewLL),
+        ENTRY("NewLC-test_CWSPolicyWriter_NewLC", CwsPolicyTester::MT_CWSPolicyWriter_NewLCL),
+        ENTRY("NewL-test_CWSPolicyReader_NewL", CwsPolicyTester::MT_CWSPolicyReader_NewLL),
+        ENTRY("NewLC-test_CWSPolicyReader_NewLC", CwsPolicyTester::MT_CWSPolicyReader_NewLCL),
+        ENTRY("GetPolicyL-test_CWSPolicyReader_GetPolicyL", CwsPolicyTester::MT_CWSPolicyReader_GetPolicyLL),
+        ENTRY("WriteToFileAllL-test_CWSPolicyWriter_WriteToFileAllL", CwsPolicyTester::MT_CWSPolicyWriter_WriteToFileAllLL),
+        ENTRY("WriteToFileAllL-test_CWSPolicyWriter_WriteToFileAllL", CwsPolicyTester::MT_CWSPolicyWriter_WriteToFileAllL_1L),
+        ENTRY("WriteAllAsXmlL-test_CWSPolicyWriter_WriteAllAsXmlL", CwsPolicyTester::MT_CWSPolicyWriter_WriteAllAsXmlLL),
+
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+void CwsPolicyTester::SetupL(  )
+    {
+//    _LIT(KDir,"XML_App");
+//    TBufC<30> aDirBuf(KDir);
+//    _LIT(KFile,"WSPolicy_Test.txt");
+//    TBufC<30> aNameBuf(KFile);
+//    TInt connectRes=fL.Connect();
+//    TRAPD(createRes,fL.CreateLog(aDirBuf,aNameBuf,EFileLoggingModeOverwrite));
+
+    }
+
+void CwsPolicyTester::Teardown(  )
+    {
+//      fL.CloseLog();
+//    fL.Close();
+
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicyUtils_PolicyIdLL(CStifItemParser& aItem)
+{  
+     TPtrC8 p1(KID1);
+     TPtrC8 p2(KID2);
+     TPtrC8 p3(KID3);
+
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(KPolicy1);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    TL(policy1 != (CSenElement*)NULL);
+    TPtrC8 id1(CWSPolicyUtils::PolicyIdL(policy1));
+    TL(id1 == p1);
+    
+    CMyXmlEle* doc2 = CMyXmlEle::NewL();
+    TFileName name2(KPolicy2);
+    doc2->ReadFileL(name2);
+    CSenElement* policy2 = doc2->XMLDocL();
+    TL(policy2 != (CSenElement*)NULL);
+    TPtrC8 id2(CWSPolicyUtils::PolicyIdL(policy2));
+    TL(id2 == p2);
+    
+     delete doc1;
+     delete doc2;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyUtils_PolicyNameLL(CStifItemParser& aItem )
+{
+     TPtrC8 p1(KP1);
+     TPtrC8 p2(KP2);
+     TPtrC8 p3(KP3);
+
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(KPolicy1);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    TL(policy1 != (CSenElement*)NULL);
+    TPtrC8 id1(CWSPolicyUtils::PolicyNameL(policy1));
+    TL(id1 == p1);
+    
+    CMyXmlEle* doc2 = CMyXmlEle::NewL();
+    TFileName name2(KPolicy2);
+    doc2->ReadFileL(name2);
+    CSenElement* policy2 = doc2->XMLDocL();
+    TL(policy2 != (CSenElement*)NULL);
+    TPtrC8 id2(CWSPolicyUtils::PolicyNameL(policy2));
+    TL(id2 == p2);
+    
+    delete doc1;
+    delete doc2;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyUtils_PolicyUriLL(CStifItemParser& aItem)
+{
+     TPtrC8 p1(KURI1);
+     TPtrC8 p2(KURI2);
+     TPtrC8 p3(KURI3);
+
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(KPolicy1);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    TL(policy1 != (CSenElement*)NULL);
+    TPtrC8 uri1(CWSPolicyUtils::PolicyUriL(policy1));
+    TL(uri1 == p1);
+    
+    CMyXmlEle* doc2 = CMyXmlEle::NewL();
+    TFileName name2(KPolicy2);
+    doc2->ReadFileL(name2);
+    CSenElement* policy2 = doc2->XMLDocL();
+    TL(policy2 != (CSenElement*)NULL);
+    TPtrC8 uri2(CWSPolicyUtils::PolicyUriL(policy2));
+    TL(uri2 == p2);
+    
+    delete doc1;
+    delete doc2;
+    return KErrNone;
+}
+TInt CwsPolicyTester::MT_CWSPolicyUtils_IsExpiredPolicyLL(CStifItemParser& aItem)
+{
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(KExpPolicy1);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    TBool result = EFalse;
+    result = CWSPolicyUtils::IsExpiredPolicyL(policy1);
+    TL(result == EFalse);
+
+    delete doc1;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_NewLL( CStifItemParser& aItem  )
+    {
+     CPolicyRegistry* registry = CPolicyRegistry::NewL();
+     TL(registry != (CPolicyRegistry*)NULL);
+
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_NewLCL( CStifItemParser& aItem  )
+    {
+     CPolicyRegistry* registry = CPolicyRegistry::NewLC();
+     TL(registry != (CPolicyRegistry*)NULL);
+     
+     CleanupStack::Pop();
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_LookupPolicyL( CStifItemParser& aItem  )
+    {
+    CPolicyRegistry* registry = CPolicyRegistry::NewL();
+    TL(registry != (CPolicyRegistry*)NULL);
+         
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name(KReg1);
+    doc1->ReadFileL(name);
+    CSenElement* policy = doc1->XMLDocL();
+    
+    registry->PopulateRegistryL(policy);  //codescannerwarnings
+     
+     TPtrC8 p1(KID1);
+     TPtrC8 p2(KID2);
+     TPtrC8 p3(KID3);
+     
+     CSenElement* ele1 = registry->LookupPolicy(p1);
+     TPtrC8 policyId1(CWSPolicyUtils::PolicyIdL(ele1));
+     TL(policyId1 == p1);
+
+     CSenElement* ele2 = registry->LookupPolicy(p2);
+     TPtrC8 policyId2(CWSPolicyUtils::PolicyIdL(ele2));
+     TL(policyId2 == p2);
+          
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     delete doc1;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_LookupPolicyByNameL( CStifItemParser& aItem  )
+    {
+    CPolicyRegistry* registry = CPolicyRegistry::NewL();
+    TL(registry != (CPolicyRegistry*)NULL);
+         
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name(KReg1);
+    doc1->ReadFileL(name);
+    CSenElement* policy = doc1->XMLDocL();
+    
+    registry->PopulateRegistryL(policy);  //codescannerwarnings
+     
+     TPtrC8 p1Name(KP1);
+     TPtrC8 p2Name(KP2);
+     TPtrC8 p3Name(KP3);
+     
+     CSenElement* ele1 = registry->LookupPolicyByNameL(p1Name); //codescannerwarnings
+     TL(ele1 != (CSenElement*)NULL);
+
+     CSenElement* ele2 = registry->LookupPolicyByNameL(p2Name); //codescannerwarnings
+     TL(ele2  != (CSenElement*)NULL);
+
+     CSenElement* ele3 = registry->LookupPolicyByNameL(p3Name); //codescannerwarnings
+     TL(ele3 == (CSenElement*)NULL);
+          
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     delete doc1;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_RegisterPolicyL( CStifItemParser& aItem  )
+    {
+    CPolicyRegistry* registry = CPolicyRegistry::NewL();
+    TL(registry != (CPolicyRegistry*)NULL);
+    
+  
+    CMyXmlEle* doc2 = CMyXmlEle::NewL();
+    TFileName name2(KReg1);
+    doc2->ReadFileL(name2);
+    CSenElement* policy2 = doc2->XMLDocL();
+
+    CMyXmlEle* doc3 = CMyXmlEle::NewL();
+    TFileName name3(KReg3);
+    doc3->ReadFileL(name3);
+    CSenElement* policy3 = doc3->XMLDocL();
+    
+     TPtrC8 p1(KID1);
+     TPtrC8 p2(KID2);
+     TPtrC8 p3(KID3);
+    
+    registry->RegisterPolicy(p1,policy2);
+
+    
+     CSenElement* ele2 = registry->LookupPolicy(p1);
+     TL(ele2 != (CSenElement*)NULL);
+     CSenElement* ele3 = registry->LookupPolicy(p2);
+     TL(ele3 == (CSenElement*)NULL);
+
+    registry->RegisterPolicy(p2,policy3);
+
+     CSenElement* ele2_1 = registry->LookupPolicy(p1);
+     TL(ele2_1 != (CSenElement*)NULL);
+     CSenElement* ele3_1 = registry->LookupPolicy(p2);
+     TL(ele3_1 != (CSenElement*)NULL);
+     
+          
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     delete doc2;
+     delete doc3;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_UnregisterPolicyL( CStifItemParser& aItem  )
+    {
+   CPolicyRegistry* registry = CPolicyRegistry::NewL();
+    TL(registry != (CPolicyRegistry*)NULL);
+         
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name(KReg1);
+    doc1->ReadFileL(name);
+    CSenElement* policy = doc1->XMLDocL();
+    
+    registry->PopulateRegistryL(policy);  //codescannerwarnings
+     
+     TPtrC8 p1(KID1);
+     TPtrC8 p2(KID2);
+     TPtrC8 p3(KID3);
+     
+     CSenElement* ele1 = registry->LookupPolicy(p1);
+     TL(ele1 != (CSenElement*)NULL);
+     CSenElement* ele2 = registry->LookupPolicy(p2);
+     TL(ele2 != (CSenElement*)NULL);
+     registry->UnregisterPolicy(p2);
+     ele1 = NULL;
+     ele2 = NULL;
+
+     ele1 = registry->LookupPolicy(p1);
+     TL(ele1 != (CSenElement*)NULL);
+     ele2 = registry->LookupPolicy(p2);
+     TL(ele2 == (CSenElement*)NULL);
+     registry->UnregisterPolicy(p1);
+     
+     ele1 = NULL;
+     ele2 = NULL;
+     ele1 = registry->LookupPolicy(p1);
+     TL(ele1 == (CSenElement*)NULL);
+     ele2 = registry->LookupPolicy(p2);
+     TL(ele2 == (CSenElement*)NULL);
+
+          
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     delete doc1;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_PopulateRegistryL( CStifItemParser& aItem  )
+    {
+    
+    CPolicyRegistry* registry = CPolicyRegistry::NewL();
+    TL(registry != (CPolicyRegistry*)NULL);
+         
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name(KReg1);
+    doc1->ReadFileL(name);
+    CSenElement* policy = doc1->XMLDocL();
+    
+    registry->PopulateRegistryL(policy);  //codescannerwarnings
+     
+     TPtrC8 p1(KID1);
+     TPtrC8 p2(KID2);
+     TPtrC8 p3(KID3);
+     
+     CSenElement* ele1 = registry->LookupPolicy(p1);
+     TL(ele1 != (CSenElement*)NULL);
+     CSenElement* ele2 = registry->LookupPolicy(p2);
+     TL(ele2 != (CSenElement*)NULL);
+     CSenElement* ele3 = registry->LookupPolicy(p3);
+     TL(ele3 == (CSenElement*)NULL);
+          
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     delete doc1;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CPolicyRegistry_ResetRegistryL( CStifItemParser& aItem  )
+    {
+    
+    CPolicyRegistry* registry = CPolicyRegistry::NewL();
+    TL(registry != (CPolicyRegistry*)NULL);
+    
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name(KReg1);
+    doc1->ReadFileL(name);
+    CSenElement* policy = doc1->XMLDocL();
+    
+    registry->PopulateRegistryL(policy);  //codescannerwarnings
+     
+     TPtrC8 p1(KID1);
+     TPtrC8 p2(KID2);
+          
+     CSenElement* ele1 = registry->LookupPolicy(p1);
+     TL(ele1 != (CSenElement*)NULL);
+     CSenElement* ele2 = registry->LookupPolicy(p2);
+     TL(ele2 != (CSenElement*)NULL);
+     
+     registry->ResetRegistry();
+     
+     CSenElement* ele3 = registry->LookupPolicy(p1);
+     TL(ele3 == (CSenElement*)NULL);
+     CSenElement* ele4 = registry->LookupPolicy(p2);
+     TL(ele4 == (CSenElement*)NULL);
+          
+     __ASSERT_ALWAYS_NO_LEAVE(delete registry);
+     registry = NULL;
+     delete doc1;
+     return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NewLL( CStifItemParser& aItem  )
+    {
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL();
+    LOCAL_ASSERT(xmlPolicy);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NewLCL( CStifItemParser& aItem  )
+    {
+    CWSPolicy* xmlPolicy = CWSPolicy::NewLC(); 
+    LOCAL_ASSERT(xmlPolicy);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NewL_1L( CStifItemParser& aItem  )
+    {
+    TPtrC8 name(KPolicyName);
+    TPtrC8 policy(KPolicy);
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy);
+    LOCAL_ASSERT(xmlPolicy);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NewLC_1L( CStifItemParser& aItem  )
+    {
+    TPtrC8 name(KPolicyName);
+    TPtrC8 policy(KPolicy);
+    CWSPolicy* xmlPolicy = CWSPolicy::NewLC(name, policy); //KText
+    LOCAL_ASSERT(xmlPolicy);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+void CwsPolicyTester::DoNormalizePolicyL(TFileName aFile, TInt count)
+{
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(aFile);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    
+    HBufC8* policyBuf = policy1->AsXmlL();
+    
+    TPtrC8 name(CWSPolicyUtils::PolicyNameL(policy1));
+    TPtrC8 policy(policyBuf->Des());
+    
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy); //KText
+    
+    //LOCAL_ASSERT(xmlPolicy->NormalizePolicyL(NULL) == TRUE);
+    HBufC8* xmlBuffer = xmlPolicy->PolicyAsXmlL();
+    
+    CleanupStack::PushL( xmlBuffer );
+    TPtr8 ptr = xmlBuffer->Des();
+    
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( " xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( " xmlBuffer empty"));
+    
+    switch (count)
+    {
+        case (3):
+        {
+            CMyXmlEle* doc3 = CMyXmlEle::NewL();
+            TFileName name3(KPolicy3Ref);
+            doc3->ReadFileL(name3);
+            CSenElement* policy3 = doc3->XMLDocL();
+            HBufC8* policyBuf3 = policy3->AsXmlL();
+            TPtr8 policy3Ptr = policyBuf3->Des();
+            TL(ptr == policy3Ptr);
+            delete policyBuf3;
+            delete doc3;
+            break;            
+        }
+        case 4:
+        {
+            CMyXmlEle* doc4 = CMyXmlEle::NewL();
+            TFileName name4(KPolicy4Ref);
+            doc4->ReadFileL(name4);
+            CSenElement* policy4 = doc4->XMLDocL();
+            HBufC8* policyBuf4 = policy4->AsXmlL();
+            TPtr8 policy4Ptr = policyBuf4->Des();
+            TL(ptr == policy4Ptr);
+            delete policyBuf4;
+            delete doc4;
+            break;            
+        }
+        case 5:
+        {
+            CMyXmlEle* doc5 = CMyXmlEle::NewL();
+            TFileName name5(KPolicy5Ref);
+            doc5->ReadFileL(name5);
+            CSenElement* policy5 = doc5->XMLDocL();
+            HBufC8* policyBuf5 = policy5->AsXmlL();
+            TPtr8 policy5Ptr = policyBuf5->Des();
+            TL(ptr == policy5Ptr);
+            delete policyBuf5;
+            delete doc5;
+            break;            
+        }
+
+    }
+
+    CleanupStack::PopAndDestroy();
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    delete policyBuf;
+    delete doc1;
+    
+}
+TInt CwsPolicyTester::MT_CWSPolicy_NormalizePolicyLL( CStifItemParser& aItem  )
+    {
+    
+    TBuf<255> file;
+    _LIT( KFileName, "c:\\testing\\data\\Policy%d.xml");
+    for(TInt i = 3; i< 6 ; i++)
+    {
+        file.Format(KFileName, i);
+        RDebug::Print( _L( "NormalizePolicyL: File [%S]"),&file);
+        DoNormalizePolicyL(file, i);
+    }
+    return KErrNone;
+
+    }
+    
+void CwsPolicyTester::TestIntersectPolicyL(TInt i, TInt j)
+{
+
+    _LIT(KFile, "c:\\testing\\data\\Policy%d.xml"); //BigSecurityPolicy3.xml");
+    _LIT( KresultFile, "c:\\testing\\data\\inter%d-%d.xml");
+    TBuf<50> file1;
+    file1.Format(KFile, i);
+    TBuf<50> file2;
+    file2.Format(KFile, j);
+//Read first file
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(file1);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    HBufC8* policyBuf1 = policy1->AsXmlL();
+    TPtrC8 uri1(CWSPolicyUtils::PolicyUriL(policy1));
+    TPtrC8 policyPtr1(policyBuf1->Des());
+    
+    CWSPolicy* xmlPolicy1 = CWSPolicy::NewL(uri1, policyPtr1); //KText
+    xmlPolicy1->NormalizePolicyL(NULL);
+    CSenElement* normPolicy1 = xmlPolicy1->PolicyL(); //codescannerwarnings
+    delete policyBuf1;
+    delete doc1;
+
+//Read second file  
+    CMyXmlEle* doc2 = CMyXmlEle::NewL();
+    TFileName name2(file2);
+    doc2->ReadFileL(name2);
+    CSenElement* policy2 = doc2->XMLDocL();
+    HBufC8* policyBuf2 = policy2->AsXmlL();
+    TPtrC8 uri2(CWSPolicyUtils::PolicyUriL(policy2));
+    TPtrC8 policyPtr2(policyBuf2->Des());
+    
+    CWSPolicy* xmlPolicy2 = CWSPolicy::NewL(uri2, policyPtr2); //KText
+    xmlPolicy2->NormalizePolicyL(NULL);
+    CSenElement* normPolicy2 = xmlPolicy2->PolicyL(); //codescannerwarnings
+    delete policyBuf2;
+    delete doc2;
+
+////Intersecting
+
+    CWSPolicy* mergedPolicy = xmlPolicy2->IntersectPolicyL(xmlPolicy1);
+    if(mergedPolicy)
+    {
+
+        TBuf<50> resfile;
+        resfile.Format(KresultFile, i, j);
+
+        CSenElement* intpolicy = mergedPolicy->PolicyL(); //codescannerwarnings
+        HBufC8* xmlBuffer = intpolicy->AsXmlL();       
+        CleanupStack::PushL( xmlBuffer );
+        TPtr8 ptr = xmlBuffer->Des();
+
+        CMyXmlEle* doc3 = CMyXmlEle::NewL();
+        TFileName name3(resfile);
+        doc3->ReadFileL(name3);
+        CSenElement* policy3 = doc3->XMLDocL();
+        HBufC8* policyBuf3 = policy3->AsXmlL();
+        TPtr8 policy3Ptr = policyBuf3->Des();
+        TL(ptr.Length() == policy3Ptr.Length());
+        delete policyBuf3;
+        delete doc3;
+        
+        CleanupStack::PopAndDestroy(xmlBuffer);
+    }
+    delete mergedPolicy;
+    delete xmlPolicy2;  
+    delete xmlPolicy1;    
+}
+TInt CwsPolicyTester::MT_CWSPolicy_IntersectPolicyLL( CStifItemParser& aItem  )
+    {
+    
+    TInt start = 3;
+    TInt last = 5;
+
+    for (TInt i = start; i < last+1; i++)
+    {
+        for (TInt j = start; j < last+1; j++)
+        {
+             TestIntersectPolicyL(i , j) ;  
+        }
+        
+    }
+    return KErrNone;
+    }
+
+void TestMergePolicyL(TInt i, TInt j)
+{
+
+    _LIT(KFile, "c:\\testing\\data\\Policy%d.xml"); //BigSecurityPolicy3.xml");
+    _LIT( KresultFile, "c:\\testing\\data\\merge%d-%d.xml");
+    TBuf<50> file1;
+    file1.Format(KFile, i);
+    TBuf<50> file2;
+    file2.Format(KFile, j);
+//Read first file
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(file1);
+    doc1->ReadFileL(name1);
+    CSenElement* policy1 = doc1->XMLDocL();
+    HBufC8* policyBuf1 = policy1->AsXmlL();
+    TPtrC8 uri1(CWSPolicyUtils::PolicyUriL(policy1));
+    TPtrC8 policyPtr1(policyBuf1->Des());
+    
+    CWSPolicy* xmlPolicy1 = CWSPolicy::NewL(uri1, policyPtr1); //KText
+    xmlPolicy1->NormalizePolicyL(NULL);
+    CSenElement* normPolicy1 = xmlPolicy1->PolicyL(); //codescannerwarnings
+    delete policyBuf1;
+    delete doc1;
+
+//Read second file  
+    CMyXmlEle* doc2 = CMyXmlEle::NewL();
+    TFileName name2(file2);
+    doc2->ReadFileL(name2);
+    CSenElement* policy2 = doc2->XMLDocL();
+    HBufC8* policyBuf2 = policy2->AsXmlL();
+    TPtrC8 uri2(CWSPolicyUtils::PolicyUriL(policy2));
+    TPtrC8 policyPtr2(policyBuf2->Des());
+    
+    CWSPolicy* xmlPolicy2 = CWSPolicy::NewL(uri2, policyPtr2); //KText
+    xmlPolicy2->NormalizePolicyL(NULL);
+    CSenElement* normPolicy2 = xmlPolicy2->PolicyL(); //codescannerwarnings
+    delete policyBuf2;
+    delete doc2;
+
+////Intersecting
+
+    CWSPolicy* mergedPolicy = xmlPolicy2->MergePolicyL(xmlPolicy1);
+    if(mergedPolicy)
+    {
+
+        TBuf<50> resfile;
+        resfile.Format(KresultFile, i, j);
+
+        CSenElement* intpolicy = mergedPolicy->PolicyL(); //codescannerwarnings
+        HBufC8* xmlBuffer = intpolicy->AsXmlL();       
+        CleanupStack::PushL( xmlBuffer );
+        TPtr8 ptr = xmlBuffer->Des();
+
+        CMyXmlEle* doc3 = CMyXmlEle::NewL();
+        TFileName name3(resfile);
+        doc3->ReadFileL(name3);
+        CSenElement* policy3 = doc3->XMLDocL();
+        HBufC8* policyBuf3 = policy3->AsXmlL();
+        TPtr8 policy3Ptr = policyBuf3->Des();
+     //   TL(ptr.Length() == policy3Ptr.Length());
+        delete policyBuf3;
+        delete doc3;
+        
+        CleanupStack::PopAndDestroy(xmlBuffer);
+    }
+    delete mergedPolicy;
+    delete xmlPolicy2;  
+    delete xmlPolicy1;    
+    
+}
+TInt CwsPolicyTester::MT_CWSPolicy_MergePolicyLL( CStifItemParser& aItem  )
+    {
+    TInt start = 3;
+    TInt last = 5;
+
+    for (TInt i = start; i < last+1; i++)
+    {
+        for (TInt j = start; j < last+1; j++)
+        {
+             TestMergePolicyL(i , j) ;  
+        }
+        
+    }
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NormalizedL( CStifItemParser& aItem  )
+    {
+    
+    TPtrC8 name(KPolicyName);
+    TPtrC8 policy(KPolicy);
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy); //KText
+   
+    TL( xmlPolicy->Normalized() == FALSE);
+    LOCAL_ASSERT(xmlPolicy->NormalizePolicyL(NULL) == TRUE);
+    TL( xmlPolicy->Normalized() == TRUE);     
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_Policy( CStifItemParser& aItem )
+    {
+    TPtrC8 name(KPolicyName);
+    TPtrC8 policy(KPolicy);
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy); //KText
+
+    CSenElement* origPolicy = xmlPolicy->PolicyL();     //codescannerwarnings
+    TL( origPolicy != (CSenElement*)NULL);     
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NormalizedAsXmlLL( CStifItemParser& aItem  )
+    {
+    TPtrC8 name(KPolicyName);
+    TPtrC8 policy(KPolicy);
+    
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy); //KText
+    
+    LOCAL_ASSERT(xmlPolicy->NormalizePolicyL(NULL) == TRUE);
+    
+    CSenElement* normPolicy = xmlPolicy->PolicyL();         //codescannerwarnings
+    HBufC8* xmlBuffer = normPolicy->AsXmlL();    
+    CleanupStack::PushL( xmlBuffer );
+    
+    TInt data = xmlBuffer->Length();
+    TInt ref_data(KRefLength);
+    
+    TPtr8 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "xmlBuffer empty"));
+    
+  
+    TL(data == ref_data);
+    
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_NormalizedPolicy( CStifItemParser& aItem  )
+    {
+    TPtrC8 name(KPolicyName);
+    TPtrC8 policy(KPolicy);
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy); //KText
+
+    TL( xmlPolicy->PolicyL() != (CSenElement*)NULL);      //codescannerwarnings
+    LOCAL_ASSERT(xmlPolicy->NormalizePolicyL(NULL) == TRUE);
+    TL( xmlPolicy->PolicyL() != (CSenElement*)NULL);     //codescannerwarnings
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CWSPolicy_IsExpiredPolicyL( CStifItemParser& aItem  )
+    {
+
+    CMyXmlEle* doc1 = CMyXmlEle::NewL();
+    TFileName name1(KExpPolicy1);
+    doc1->ReadFileL(name1);
+    
+    CSenElement* policy1 = doc1->XMLDocL();
+    TPtrC8 name(CWSPolicyUtils::PolicyNameL(policy1));
+
+    HBufC8* policyBuf = policy1->AsXmlL();
+    CleanupStack::PushL( policyBuf );
+    TPtrC8 policy(policyBuf->Des());
+    
+    CWSPolicy* xmlPolicy = CWSPolicy::NewL(name, policy);
+    
+    CleanupStack::PopAndDestroy();
+    LOCAL_ASSERT(xmlPolicy);
+    TBool result = EFalse;
+    result = xmlPolicy->IsExpiredPolicyL(); //codescannerwarnings
+    TL(result == EFalse);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlPolicy);
+    xmlPolicy = NULL;
+    delete doc1;
+    return KErrNone;
+    }
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_NewLL( CStifItemParser& aItem )
+{
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    LOCAL_ASSERT( pInternalPolicy );
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_NewLCL( CStifItemParser& aItem )
+{
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewLC();
+    LOCAL_ASSERT( pInternalPolicy );
+    CleanupStack::Pop(pInternalPolicy);
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_NewL_1L( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+  
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray);
+    LOCAL_ASSERT( pInternalPolicy );
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_NewLC_1L( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+  
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewLC(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray);
+    LOCAL_ASSERT( pInternalPolicy );
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_NewL_2L( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray,*pParentElement);
+    LOCAL_ASSERT( pInternalPolicy );
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_NewLC_2L( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewLC(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray,*pParentElement);
+    LOCAL_ASSERT( pInternalPolicy );
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_IsApplicableLL( CStifItemParser& aItem )
+{
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    LOCAL_ASSERT( pInternalPolicy );
+    TBool avail=pInternalPolicy->IsApplicableL(_L8(""));
+    TL(avail == TRUE);
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_IsApplicableL_1L( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    TBool avail=pInternalPolicy->IsApplicableL(pInternalWSPolicy);
+    TL(avail == TRUE);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_IsApplicableL_2L( CStifItemParser& aItem )
+{
+    CSenWSDescription* pPattern = CSenWSDescription::NewL(_L8("http://radio.etenee.net:9080/tfs/IDPSSO_IDWSF"),_L8("urn:liberty:as:2004-04"));
+    CleanupStack::PushL(pPattern);
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy);
+    LOCAL_ASSERT( pInternalPolicy );
+    TBool avail=pInternalPolicy->IsApplicableL(*pPattern);
+    TL(avail == FALSE);
+    CleanupStack::PopAndDestroy(pInternalPolicy);
+    CleanupStack::PopAndDestroy(pPattern);
+    return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_UpdateMetadataEndpointLL( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    TInt num(1);
+    TBool avail=pInternalPolicy->UpdateMetadataEndpointL(pInternalWSPolicy,num);
+    TL(avail == TRUE);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_AddMetadataPolicyLL( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("MetadataEndpoint"),_L8("a:MetadataEndpoint"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    //CSenElement* pMetaElement = CSenBaseElement::NewL(_L8("MetadataEndpoint"));
+    //CleanupStack::PushL(pMetaElement );
+    CSenElement* pElement = CSenBaseElement::NewL(_L8("Element"));
+    CleanupStack::PushL(pElement );
+    TInt avail=pInternalPolicy->AddMetadataPolicyL(pElement );
+    CleanupStack::PopAndDestroy(pElement);
+    //CleanupStack::Pop(pMetaElement);
+    TL(avail == -1);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_RemoveMetadataPolicyLL(CStifItemParser& aItem)
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("nsuri"),_L8("MetadataEndpoint"),_L8("a:MetadataEndpoint"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    TInt avail=pInternalWSPolicy->RemoveMetadataPolicyL(_L8("nsuri"));
+    TL(avail == 1);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_WsPolicyByUriLL(CStifItemParser& aItem)
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("MetadataEndpoint"),_L8("a:MetadataEndpoint"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    CSenElement* pPolicy =pInternalPolicy->WsPolicyByUriL(_L8(""));
+    LOCAL_ASSERT(!pPolicy);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_WsPolicyByNameL( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("MetadataEndpoint"),_L8("a:MetadataEndpoint"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    CSenElement* pPolicy =pInternalPolicy->WsPolicyByName(_L8(""));
+    LOCAL_ASSERT(!pPolicy);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenInternalWsPolicy_ValidUntilLL( CStifItemParser& aItem )
+{
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParentElement);
+    CTestInternalWSPolicy* pInternalWSPolicy = CTestInternalWSPolicy::NewL(_L8("ansuri"),_L8("MetadataEndpoint"),_L8("a:MetadataEndpoint"),attrArray,*pParentElement);
+    CleanupStack::PushL(pInternalWSPolicy );
+    CTestInternalWSPolicy* pInternalPolicy = CTestInternalWSPolicy::NewL();
+    CleanupStack::PushL(pInternalPolicy );
+    LOCAL_ASSERT( pInternalPolicy );
+    TTime validTime = pInternalPolicy->ValidUntilL(_L8(""));
+    TTime tempTime = Time::NullTTime();
+    TL(validTime == tempTime);
+    CleanupStack::Pop(pInternalPolicy);
+    CleanupStack::Pop(pInternalWSPolicy);
+    CleanupStack::PopAndDestroy(pParentElement);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    delete pInternalWSPolicy ;
+    pInternalWSPolicy = NULL;
+    delete pInternalPolicy ;
+    pInternalPolicy = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLL( CStifItemParser& aItem )
+{
+    CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+    LOCAL_ASSERT( pPolicyId );
+    delete pPolicyId;
+    pPolicyId = NULL;
+    return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLCL( CStifItemParser& aItem )
+{
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewLC();
+  LOCAL_ASSERT( pPolicyId );
+  CleanupStack::Pop(pPolicyId);
+  delete pPolicyId;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewL_1L( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+  
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray);
+  LOCAL_ASSERT( pPolicyId );
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLC_1L( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+  
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewLC(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray);
+  LOCAL_ASSERT( pPolicyId );
+  CleanupStack::Pop( pPolicyId );
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewL_2L( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+  CleanupStack::PushL(pParentElement);
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray,*pParentElement);
+  LOCAL_ASSERT( pPolicyId );
+  CleanupStack::PopAndDestroy(pParentElement);
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+ 
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_NewLC_2L( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+  CleanupStack::PushL(pParentElement);
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewLC(_L8("ansuri"),_L8("Nokia"),_L8("a:Nokia"),attrArray,*pParentElement);
+  LOCAL_ASSERT( pPolicyId );
+  CleanupStack::Pop(pPolicyId );
+  CleanupStack::PopAndDestroy(pParentElement);
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_SetPropertyLL( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+  CleanupStack::PushL(pParentElement);
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL(_L8("ansuri"),_L8("Property1"),_L8("a:Nokia"),attrArray,*pParentElement);
+  LOCAL_ASSERT( pPolicyId );
+  TInt val = pPolicyId->SetPropertyL(_L8("Property1"),_L8("1"));
+  TL( val == KErrNone);
+  CleanupStack::PopAndDestroy(pParentElement);
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_PropertyLL( CStifItemParser& aItem )
+{
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+  CleanupStack::PushL(pParentElement);
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL(_L8("ansuri"),_L8("Property1"),_L8("a:Nokia"),attrArray,*pParentElement);
+  LOCAL_ASSERT( pPolicyId );
+  TInt val = pPolicyId->SetPropertyL(_L8("Property1"),_L8("1"));
+  TL( val == KErrNone);
+  TPtrC8 value;
+  val = pPolicyId->PropertyL(_L8("Property1"),value);
+  TL( val == KErrNotFound);
+  CleanupStack::PopAndDestroy(pParentElement);
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_SetIdLL( CStifItemParser& aItem )
+{
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+  TInt val(1);
+  TRAPD(res,pPolicyId ->SetIdL(val));
+  TL(res == KErrNone);
+  delete pPolicyId;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_IdLL( CStifItemParser& aItem )
+{
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+  TInt val(1);
+  TRAPD(res,pPolicyId ->SetIdL(val));
+  TL(res  == KErrNone);
+  TInt id=pPolicyId ->IdL();
+  TL(id == val);
+  delete pPolicyId;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_AddMetadataEndpointLL( CStifItemParser& aItem )
+{
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+  CSenElement* pElement = CSenBaseElement::NewL(_L8("MetadataElement"));
+  CleanupStack::PushL(pElement);
+  pElement->SetContentL(_L8("metacontent"));
+  TInt retVal = pPolicyId ->AddMetadataEndpointL( pElement);
+  TL(retVal == KErrNone);
+  CleanupStack::PopAndDestroy(pElement);
+
+  delete pPolicyId;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_MetadataEndpointLL( CStifItemParser& aItem )      
+{
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+  CSenElement* pElement = CSenBaseElement::NewL(_L8("MetadataElement"));
+  CleanupStack::PushL(pElement);
+  pElement->SetContentL(_L8("metacontent"));
+  TInt retVal = pPolicyId ->AddMetadataEndpointL( pElement);
+  TL (retVal == KErrNone);
+  
+  //HBufC8* pPolXML = (pPolicyId->AsElement()).AsXmlL();
+  //fL.Write(*pPolXML);
+  
+  CleanupStack::PopAndDestroy(pElement);
+  TPtrC8 metaEndPoint = pPolicyId ->MetadataEndpointL();
+  TL(metaEndPoint == KNullDesC8);
+  delete pPolicyId;
+  pPolicyId = NULL;
+  //delete pPolXML ;
+  //pPolXML = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_MetadataEndpointElementLL( CStifItemParser& aItem )        
+{
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+  CSenElement* pElement = CSenBaseElement::NewL(_L8("MetadataElement"));
+  CleanupStack::PushL(pElement);
+  pElement->SetContentL(_L8("metacontent"));
+  TInt retVal = pPolicyId ->AddMetadataEndpointL( pElement);
+  TL(retVal == KErrNone);
+  CleanupStack::PopAndDestroy(pElement);
+  CSenElement* pMetaElement = pPolicyId->MetadataEndpointElementL();
+  LOCAL_ASSERT(!pMetaElement);
+  delete pPolicyId;
+  pPolicyId = NULL;
+  if(pMetaElement)
+  {
+    delete pMetaElement;
+    pMetaElement = NULL;
+  }
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_ElementAttribValueLL( CStifItemParser& aItem )
+{
+
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+  CleanupStack::PushL(pParentElement);
+  CSenElement* pElement = CSenBaseElement::NewL(_L8("ansuri"),_L8("Property1"),_L8("a:Nokia"),attrArray,*pParentElement);
+  CleanupStack::PushL(pElement);
+  
+//  HBufC8* elementBuf = pElement->AsXmlL();
+//  fL.Write(*elementBuf);
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+    
+  
+  TPtrC8 val = pPolicyId->ElementAttribValueL(pElement ,_L8("pr:LocalName"));
+  TL( val  == _L8("Value"));
+  CleanupStack::PopAndDestroy(pElement);
+  CleanupStack::PopAndDestroy(pParentElement);
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CSenWSPolicyIdentifier_HasAttributeLL( CStifItemParser& aItem )
+{
+
+  RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+    
+    CSenElement* pParentElement = CSenBaseElement::NewL(_L8("Parent"));
+  CleanupStack::PushL(pParentElement);
+  CSenElement* pElement = CSenBaseElement::NewL(_L8("ansuri"),_L8("Property1"),_L8("a:Nokia"),attrArray,*pParentElement);
+  CleanupStack::PushL(pElement);
+  
+//  HBufC8* elementBuf = pElement->AsXmlL();
+//  fL.Write(*elementBuf);
+  CTestWSPolicyIdentifier* pPolicyId = CTestWSPolicyIdentifier::NewL();
+  LOCAL_ASSERT( pPolicyId );
+    
+  
+  TBool has= pPolicyId->HasAttributeL(pElement ,_L8("pr:LocalName"));
+  LOCAL_ASSERT( has );
+  CleanupStack::PopAndDestroy(pElement);
+  CleanupStack::PopAndDestroy(pParentElement);
+  CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+  delete pPolicyId ;
+  pPolicyId = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyWriter_NewLL( CStifItemParser& aItem )
+{
+  CTestPolicyWriter* pPolicyWriter = CTestPolicyWriter::NewL();
+  LOCAL_ASSERT( pPolicyWriter );
+  delete pPolicyWriter;
+  pPolicyWriter = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyWriter_NewLCL( CStifItemParser& aItem )
+{
+  CTestPolicyWriter* pPolicyWriter = CTestPolicyWriter::NewLC();
+  LOCAL_ASSERT( pPolicyWriter );
+  CleanupStack::Pop(pPolicyWriter);
+  delete pPolicyWriter;
+  pPolicyWriter = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyReader_NewLL( CStifItemParser& aItem )
+{
+  CTestPolicyReader* pPolicyReader = CTestPolicyReader::NewL();
+  LOCAL_ASSERT( pPolicyReader );
+  delete pPolicyReader ;
+  pPolicyReader = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyReader_NewLCL( CStifItemParser& aItem )
+{
+  CTestPolicyReader* pPolicyReader = CTestPolicyReader::NewLC();
+  LOCAL_ASSERT( pPolicyReader );
+  CleanupStack::Pop(pPolicyReader);
+  delete pPolicyReader ;
+  pPolicyReader = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CWSPolicyReader_GetPolicyLL( CStifItemParser& aItem )
+{
+  CTestPolicyReader* pPolicyReader = CTestPolicyReader::NewLC();
+  LOCAL_ASSERT( pPolicyReader );
+  
+  CSenElement* pPolicy = CSenBaseElement::NewL(_L8("http://schemas.xmlsoap.org/ws/2004/09/policy"),_L8("Policy"),_L8("wsp:Policy"));
+  CleanupStack::PushL(pPolicy);
+  pPolicy->AddAttrL(_L8("wsu:Id"),_L8("ID1"));
+  CPolicyAssertion* pPolicyAsserton = pPolicyReader->GetPolicyL(pPolicy);
+  LOCAL_ASSERT( pPolicyAsserton );
+  CleanupStack::PopAndDestroy(pPolicy);
+  CleanupStack::Pop(pPolicyReader);
+  delete pPolicyReader ;
+  pPolicyReader = NULL;
+  delete pPolicyAsserton;
+  pPolicyAsserton = NULL;
+  return KErrNone;
+}
+
+TInt CwsPolicyTester::MT_CWSPolicyWriter_WriteToFileAllLL( CStifItemParser& aItem )
+{
+  CTestPolicyWriter* pPolicyWriter = CTestPolicyWriter::NewLC();
+  LOCAL_ASSERT( pPolicyWriter );
+  
+  CSenElement* pPolicy = CSenBaseElement::NewL(_L8("http://schemas.xmlsoap.org/ws/2004/09/policy"),_L8("Policy"),_L8("wsp:Policy"));
+  CleanupStack::PushL(pPolicy);
+  pPolicy->AddAttrL(_L8("wsu:Id"),_L8("ID1"));
+  TRAPD(res,pPolicyWriter->WriteToFileAllL(pPolicy));
+  TL(res == KErrNone);
+  CleanupStack::PopAndDestroy(pPolicy);
+  CleanupStack::Pop(pPolicyWriter);
+  delete pPolicyWriter ;
+  pPolicyWriter = NULL;
+  return KErrNone;
+}
+TInt CwsPolicyTester::MT_CWSPolicyWriter_WriteToFileAllL_1L( CStifItemParser& aItem )
+{
+  _LIT8(KXml,"<Parent><t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/></Parent>");
+  TBuf8<100> XmlBuf(KXml);
+  CTestPolicyWriter* pPolicyWriter = CTestPolicyWriter::NewLC();
+  LOCAL_ASSERT( pPolicyWriter );
+  TRAPD(res,pPolicyWriter->WriteToFileAllL(XmlBuf));
+  TL(res == KErrNone);
+  delete pPolicyWriter ;
+  pPolicyWriter = NULL;
+  return KErrNone; 
+}
+TInt CwsPolicyTester::MT_CWSPolicyWriter_WriteAllAsXmlLL( CStifItemParser& aItem )         
+{
+/*  CPolicyAssertion* pPolicyAssertion = CTestPolicyAssertion::NewL();
+  CleanupStack::PushL(pPolicyAssertion );
+  CTestPolicyWriter* pPolicyWriter = CTestPolicyWriter::NewLC();
+  LOCAL_ASSERT( pPolicyWriter );
+  HBufC8* pPolicyBuf = pPolicyWriter->WriteAllAsXmlL(pPolicyAssertion);
+  fL.Write(*pPolicyBuf );
+  CleanupStack::PopAndDestroy( pPolicyAssertion );
+  delete pPolicyWriter ;
+  pPolicyWriter = NULL;
+  delete pPolicyBuf ;
+  pPolicyBuf = NULL;*/
+  return KErrNone;
+}
+//  TEST TABLE
+
+
+// -----------------------------------------------------------------------------
+// CwsPolicyTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CwsPolicyTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/tsrc/wsstarPluginTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,179 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\wsstarPluginTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_connection_api/web_service_connection_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" ?>
+<api id="7fb19ae8c3c54334b8a015d954c209bc" dataversion="1.0">
+  <name>Web Service Connection API</name>
+  <description>This API offers ways to establish new web service connections and to send messages using an established connection.</description>
+  <type>c++</type>
+  <collection>webservices</collection>
+  <libs>
+    <lib name="SenServConn.LIB" />
+    <lib name="SenUtils.LIB" />
+  </libs>
+  <release category="public" sinceversion="3.0"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                Web Service Description API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SenIdentityProvider.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenIdentityProvider.h)
+../inc/SenIdentityProviderIdArray8.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenIdentityProviderIdArray8.h)
+../inc/SenXmlServiceDescription.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenXmlServiceDescription.h)
+../inc/MSenServiceDescription.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenServiceDescription.h)
+../inc/MSenConsumerPolicy.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenConsumerPolicy.h)
+../inc/SenCredential.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenCredential.h)
+../inc/SenServicePattern.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenServicePattern.h)
+../inc/MSenIdentityProviderIdArray.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenIdentityProviderIdArray.h)
+../inc/MSenProviderPolicy.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenProviderPolicy.h)
+../inc/SenFacet.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenFacet.h)
+../inc/MSenServicePolicy.h								MW_LAYER_PUBLIC_EXPORT_PATH(MSenServicePolicy.h)
+../inc/SenCredential2.h										MW_LAYER_PUBLIC_EXPORT_PATH(SenCredential2.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/MSenConsumerPolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This abstract class defines consumer policy interface.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_CONSUMER_POLICY_H
+#define M_SEN_CONSUMER_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+#include <SenDomFragment.h>
+
+// FORWARD DECLARATIONS
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+*  This abstract class defines consumer policy interface.
+*  The consumer policy sets the conditions in which some service provider 
+*  is capable to operate in. It is defining context, through which these
+*  (possibly remote) services may be contacted and used.
+*  The actual properties may include transport layer settings, like 
+*  predefined Internet Access Point (IAP) ID. In addition, consumer policy
+*  may declare, that certain service should only be contacted using certain
+*  identity provider (in ID-WSF). This can be achieved by mapping certain 
+*  list of IDP IDs to a consumer policy. 
+*  A consumer policy is effective only for a single session, and thus it
+*  applies to one service connection only. This means, that this policy
+*  information is "private", and not shared between different WSC applications
+*  using WSF, event though they might be using the same (remote) service at the
+*  same time. Consumer policy properties are not serialized in any WSF
+*  database, but resides in memory only.
+*
+*   Example structure of ConsumerPolicy XML fragment:
+*
+*   <ConsumerPolicy>
+*       <Transport>
+*           <IapId>
+*               2
+*           </IapId>
+*       </Transport>
+*       <IdentityProviderIDs strict="false">
+*           <IdentityProviderID>
+*             urn:first.example.idp.com
+*           </IdentityProviderID>
+*           <IdentityProviderID>
+*             urn:second.example.idp.com
+*           </IdentityProviderID>
+*       </IdentityProviderIDs>
+*   </ConsumerPolicy>
+*
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class MSenConsumerPolicy
+    {
+    public: // New functions
+        
+        /**
+        * Setter for Internet Access Point (IAP) ID existing in CommDB.
+        * @since Series60 3.0
+        * @param aIapId IAP ID
+        */ 
+        virtual void SetConsumerIapIdL(TUint32 aIapId) = 0;
+
+        /**
+        * Getter for IAP ID.
+        * @since Series60 3.0
+        * @param aCurrentIapId  will contain the current 
+        *                       Internet Access Point ID
+        * @return
+        *  - KErrNone if <IapId> element is found and has valid content
+        *  - KErrNotFound if no <IapId> element has been found or it has
+        *       no content
+        *  - TLex error codes, if <IapId> element has non-numeric value,
+        *    which cannot be resolved
+        */ 
+        virtual TInt ConsumerIapId(TUint32& aCurrentIapId) = 0;
+
+        /**
+        * Setter for consumer identity provider IDs. Overrides current values 
+        * with the given values from the array. If an ID does not exist, it
+        * will be added. 
+        * @since Series60 3.0
+        * @param aList  list of identity provider IDs.
+        */ 
+        virtual void SetConsumerIdentityProviderIdsL(
+                                        CSenIdentityProviderIdArray8& aList) = 0;
+
+        /**
+        * Adds a new Identity provider ID value at the end of the current list
+        * values. 
+        * @since Series60 3.0
+        * @param aProviderId unique ProviderID as UTF-8 descriptor
+        * @return   KErrAlreadyExists, if a duplicate is tried to add
+        *           KErrArgument if a zero-length descriptor is tried to add
+        *           (aProviderId.Length() == 0)
+        */
+        virtual TInt AddConsumerIdentityProviderIdL(const TDesC8& aProviderId) = 0;
+
+        /**
+        * Rebuilds the consumer policy of this service pattern from the given
+        * consumer policy.
+        * @since Series60 3.0
+        * @param aTemplate  the consumer policy to rebuild from.
+        * @return KErrNone or other system-wide Symbian error codes.
+        */
+        virtual TInt RebuildFromConsumerPolicy(MSenConsumerPolicy& aTemplate) = 0;
+
+        /**
+        * Getter for Identity provider IDs.
+        * @since Series60 3.0
+        * @return a list of IDP arrays if such value(s) have been set
+        *         or an empty array if no IDP:s have been specified.
+        */ 
+        virtual const CSenIdentityProviderIdArray8& 
+                                            ConsumerIdentityProviderIds8L() = 0;
+
+        /**
+        * Checks if the policy of this service pattern accepts given policy.
+        * @since Series60 3.0
+        * @param aPolicyPattern the consumer policy to check.
+        * @return ETrue if accepts, EFalse if not
+        */
+        virtual TBool AcceptsConsumerPolicy(MSenConsumerPolicy& aPolicyPattern) = 0;        
+    };
+
+#endif //M_SEN_CONSUMER_POLICY_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/MSenIdentityProviderIdArray.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        An abstract class used to reference to some
+*                CSenIdentityProviderIdArray owned elsewhere.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_IDENTITY_PROVIDER_ID_ARRAY_H
+#define M_SEN_IDENTITY_PROVIDER_ID_ARRAY_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <e32des8.h>
+
+// CLASS DECLARATION
+
+/**
+* Abstract interface for ProviderID array classes
+* @lib SenServDesc.lib
+* @since Series60 3.0
+*/
+class MSenIdentityProviderIdArray
+    {
+    public: // New functions
+        
+        /**
+        * Method to check if the array is defined as strict.
+        * @since Series60 3.0
+        * @return ETrue if array is strict, EFalse if not
+        */
+        IMPORT_C virtual TBool IsStrict() const = 0;
+
+        /**
+        * Method for setting the strict flag.
+        * @since Series60 3.0
+        * @param aStrict the value the flag should be set.
+        */
+        virtual void SetStrict(TBool aStrict) = 0; // check: altered in 3.0 BC FIX
+        //IMPORT_C virtual void SetStrict(TBool aStrict) = 0;
+    };
+
+#endif // M_SEN_IDENTITY_PROVIDER_ID_ARRAY_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/MSenProviderPolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This abstract class defines provider policy interface.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_PROVIDER_POLICY_H
+#define M_SEN_PROVIDER_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+#include <SenDomFragment.h>
+
+// FORWARD DECLARATIONS
+class CSenIdentityProviderIdArray8;
+
+// CLASS DECLARATION
+
+/**
+*  This abstract class defines provider policy interface.
+*  The provider policy sets the conditions in which some service provider 
+*  is capable to operate in. It is defining context, through which these
+*  (possibly remote) services may be contacted and used.
+*  The actual properties may include transport layer settings, like 
+*  predefined Internet Access Point (IAP) ID. In addition, provider policy
+*  may declare, that certain service should only be contacted using certain
+*  identity provider (in ID-WSF). This can be achieved by mapping certain 
+*  list of IDP IDs to a provider policy. 
+*  Provider Policies are WSF wide settings, which are stored in WSF
+*  databases, and thus they are shared with all the actual Web Service
+*  Consumers (WSCs) accessing same services.
+*
+*   Example structure of ProviderPolicy XML fragment:
+*
+*   <ProviderPolicy>
+*       <Transport>
+*           <IapId>
+*               1
+*           </IapId>
+*       </Transport>
+*       <IdentityProviderIDs strict="true">
+*           <IdentityProviderID>
+*             urn:first.id.example.com
+*           </IdentityProviderID>
+*           <IdentityProviderID>
+*             urn:second.id.example.com
+*           </IdentityProviderID>
+*       </IdentityProviderIDs>
+*   </ProviderPolicy>
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class MSenProviderPolicy
+    {
+    public: // New functions
+        /**
+        * Setter for Internet Access Point (IAP) ID.
+        * Method is used to define default access point
+        * to avoid IAP selection dialog prompt.
+        * @since Series60 3.0
+        * @param aIapId is the ID found from CommDB.
+        */ 
+        virtual void SetIapIdL(TUint32 aIapId) = 0;
+
+        /**
+        * Getter for IAP ID
+        * @since Series60 3.0
+        * @param aCurrentIapId will contain the current 
+        *        Internet Access Point ID
+        * @return
+        *  - KErrNone if <IapId> element is found and has valid content
+        *  - KErrNotFound if no <IapId> element has been found or it has
+        *       no content
+        *  - TLex error codes, if <IapId> element has non-numeric value,
+        *    which cannot be resolved
+        */ 
+        virtual TInt IapId(TUint32& aCurrentIapId) = 0;
+
+        /**
+        * Setter for IdentityProvider IDs. Overrides 
+        * current values with the given values from the array.
+        * When initiating a new service connection, this list of
+        * ProviderIDs define, which IdentityProviders are preferred
+        * OR which are strictly acceptable ones.
+        * @since Series60 3.0
+        * @param aList  list of IdentityProvider IDs.
+        */ 
+        virtual void SetIdentityProviderIdsL(
+                                        CSenIdentityProviderIdArray8& aList) = 0;
+
+        /**
+        * Adds a new IdentityProviderID value at the end of the current list 
+        * values.
+        * @since Series60 3.0
+        * @param aProviderID defines, which IdentityProvider is preferred
+        * OR which is strictly acceptable one, when initiating a new 
+        * service connection.
+        * @return   KErrAlreadyExists, if a duplicate is tried to add
+        *           KErrArgument if a zero-length descriptor is tried to add
+        *           (aProviderId.Length() == 0)
+        */
+        virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId) = 0;
+
+        /**
+        * Method reads provider policy class instance values from given
+        * template. Values may include an IAP ID, preferred IdentityProvider
+        * IDs etc.
+        * @since Series60 3.0
+        * @param aTemplate from which the values are read.
+        * @return       KErrNone            Everything went ok.
+        *               KErrAlreadyExists   Duplicates were found
+        *               KErrArgument        Invalid providerIds were found
+        *               Other error codes are system-wide Symbian error codes.
+        */ 
+        virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate) = 0;
+
+        /**
+        * Getter for IdentityProvider IDs.
+        * @since Series60 3.0
+        * @return a list of IDP arrays if such value(s) have been set
+        *           or an empty array if no IDP:s have been specified.
+        */ 
+        virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0;
+
+        /**
+        * Checks if some policy is accepted by current policy.
+        * @since    Series60 3.0
+        * @param    aPolicyPattern is the policy being compared 
+        *           with this instance.
+        * @return   ETrue if policy candidate is accepted by current policy
+        *           definition, EFalse if not.
+        */
+        virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern) = 0;
+        
+        void SetSnapIdL(TUint32 /*aSnapId*/)
+        {
+        }
+        TInt SnapId(TUint32& /*aCurrentSnapId*/)
+        {
+        	return KErrNotFound;
+        }
+    };
+
+#endif //M_SEN_PROVIDER_POLICY_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/MSenServiceDescription.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,312 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Interface (abstract) class for subclasses implementing the 
+*                most common value objects used in WSF, which are used to
+*                describe some invocable service. 
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_SERVICE_DESCRIPTION_H
+#define M_SEN_SERVICE_DESCRIPTION_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32des8.h>    
+#include <s32strm.h>
+
+// CONSTANTS
+_LIT8(KSenFacetValFalse,                "false");
+_LIT8(KSenFacetValTrue,                 "true");
+
+// Facet identifier (URN) constants:
+_LIT8(KCompleteMessagesFacet,           "urn:nokia.com.serene:complete-messages");
+_LIT8(KExposeLocalServiceFacet,         "urn:nokia.com.serene:expose");
+_LIT8(KProviderSharableFacet,           "urn:nokia.com.serene.provider:sharable");
+_LIT8(KProviderCompleteClientMsgsFacet, "urn:nokia.com.serene.provider:complete-client-messages") ;
+_LIT8(KProviderLoadOnStartupFacet,      "urn:nokia.com.serene.provider:load-on-startup") ;
+_LIT8(KProviderThreadsafeFacet,         "urn:nokia.com.serene.provider:threadsafe") ;
+_LIT8(KProviderReinitializableFacet,    "urn:nokia.com.serene.provider:re-initializable") ;
+_LIT8(KProviderStayOnBackgroundFacet,   "urn:nokia.com.serene.provider:stay-on-background") ;
+_LIT8(KTransportClassFacet,             "urn:nokia.com:serene:transport:class");
+
+// Transport plug-in types (ECOM cues / class types):
+_LIT8(KSenTransportCueHTTP,              "com.nokia.wsf.transport.plugin.httpchannel");
+_LIT8(KSenTransportCueVirtualTCP,        "com.nokia.wsf.transport.plugin.virtualtcp"); 
+_LIT8(KSenTransportCueLocalEcom,         "com.nokia.wsf.transport.plugin.local");  
+_LIT8(KSenTransportCueHostletConnection, "com.nokia.wsf.transport.plugin.hostlet");
+
+// Transport schemes
+_LIT8(KSenTransportSchemeHTTP,              "http");
+_LIT8(KSenTransportSchemeTCP,               "tcp");
+_LIT8(KSenTransportSchemeLocal,             "local");
+_LIT8(KSenTransportSchemeHostlet,           "hostlet");
+//_LIT8(KSenTransportSchemeVirtualTCP,        "vtcp"); 
+
+const TInt KSenServiceDescriptionBaseScore = 100;
+
+// FORWARD DECLARATIONS
+class CSenFacet;
+
+// DATA TYPES
+typedef RPointerArray<CSenFacet> RFacetArray;
+
+// CLASS DECLARATION
+
+/**
+* Interface (abstract) class for subclasses implementing the  most common value
+* objects used in WSF, which are used to describe some invocable service. 
+* All of the subclasses are capable of representing themselves in XML.
+* @lib SenServDesc.lib
+* @since Series60 3.0
+*/
+class MSenServiceDescription
+    {
+    public: 
+        
+        /**
+        * DescriptionClassType enumeration.
+        */
+        IMPORT_C enum TDescriptionClassType
+            {
+            ERoot                               = 0, // not in use
+            EBaseServiceDescription             = 1, // not in use
+            EXmlServiceDescription              = 2,
+            EIdentityProvider                   = 3, 
+            EServicePattern                     = 4, 
+            EServiceSession                     = 5,
+            EWebServiceSession                  = 6,
+            EBasicWebServiceSession             = 7,
+            EIdWSFServiceSession                = 8,
+            EIdWsfServiceInstance               = 9, 
+            ECoreServiceConsumer                = 10,
+            ESenInternalServiceConsumer         = 11,
+            EIdWsfAuthenticationServiceClient   = 12,
+            EIdWsfDiscoveryServiceClient        = 13,
+            ERestServiceSession                 = 14,
+            EWSStarServiceSession               = 15,
+            EWSStarSTSClient                    = 16,
+            EWSStarPolicyClient                 = 17,
+            EWSDescription                      = 18,
+            EWSPattern                          = 19,
+            EAtomPubServiceSession              = 20,
+            EAtomPubAuthClient                  = 21,
+            EAccount                            = 22,
+            EOviServiceSession                  = 23,
+            EOviOAuthClient                     = 24
+            };
+
+        // New functions
+    
+        /**
+        * The DescriptionClassType() method is used to resolve the real
+        * subclass type in cases where instance of that class is seen
+        * through one of its superclass interfaces. 
+        * @since Series60 3.0
+        * @return TDescriptionClassType enumeration identifying the class.
+        */
+        virtual TDescriptionClassType DescriptionClassType() = 0;
+
+        /**
+        * Method returns ETrue if this service description matches the given 
+        * pattern.
+        * The bits of information that are in the pattern are read and compared
+        * to corresponding fields in this service description. Note that a pattern
+        * may have far fewer fields and that only the non-null and non-zero-length
+        * fields are compared.
+        * For example, assume that a pattern with only a contract was defined;
+        * with  the contract set to "urn:example.com:service". Each
+        * service description with the same contract will match the pattern,
+        * even if such a service description has non-null/non-zero-length fields
+        * for other aspects.
+        * @since Series60 3.0
+        * @param    aPattern is a Service Description, typically with partial
+        *           information.
+        * @return TBool ETrue if match, EFalse otherwise. If the value is
+        * not found from current instance, it is not used in comparison
+        * (even if offered in the given pattern).
+        */
+        virtual TBool Matches(MSenServiceDescription& aPattern) = 0;
+
+        /**
+        * Getter for contract, which is typically some URI.
+        * @since Series60 3.0
+        * @return the Contract
+        */
+        virtual TPtrC8 Contract() = 0;
+
+        /**
+        * Method for checking if service description has a certain facet.
+        * @since Series60 3.0
+        * @param aURI       the facet to check, typically some URI.
+        * @param aHasFacet  is ETrue if facet is found and EFalse, if not.
+        * @return       KErrNone or other system-wide Symbian error codes.
+        */
+        virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) = 0;
+
+        /*
+        * Method for getting a facet value  from the service description 
+        * @since Series60 3.0
+        * @param aURI           the facet to get
+        * @param aValueTo       a ref-to-pointer into which the value will
+        *                       be allocated, which ownership is transferred
+        *                       to the caller.
+        * @return       KErrNone 
+        *               KErrNoMemory value couldn't be allocated due to lack 
+        *               of memory
+        *               KErrNotFound if the wanted facet was not found.
+        *               Other system-wide Symbian error codes.
+        */
+        virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo) = 0;
+
+        /**
+        * Method for adding a facet. Will NOT override an already
+        * existing facet with a same name.
+        * @since Series60 3.0
+        * @param        aFacet is the one to be added. A copy of the 
+        *               the original facet instance will be added.
+        * @return       KErrNone or other system-wide Symbian error codes.
+        *               KErrAlreadyExists if a facet with same name exists
+        */
+        virtual TInt AddFacetL(const CSenFacet& aFacet) = 0;
+
+        /**
+        * Method for setting a facet.Adds a new facet, if non-existent.
+        * But, if a facet with same name exists, it will be overridden.
+        * @since Series60 3.0
+        * @param        aFacet to be set. A copy of the original will be
+        *               created.
+        * @return       KErrNotFound if facet can not be found
+        *               KErrNone     if facet was found
+        *               KErrNoMemory if no memory could be allocated for the value
+        *               Other system-wide Symbian error codes.
+        */
+        virtual TInt SetFacetL(const CSenFacet& aFacet) = 0;
+
+        /**
+        * Removes a characteristic (Facet) from the description
+        * @since Series60 3.0
+        * @param        aURI of the facet to be removed. 
+        * @return       KErrNone     if a Facet was successfully removed
+        *               KErrNotFound if a Facet could not be found
+        *               Other system-wide Symbian error codes.
+        */
+        virtual TInt RemoveFacet(const TDesC8& aURI) = 0;
+
+        /**
+        * Method for getting all facets. Copies characteristics (Facets)
+        * from the description into array. For each characteristic (Facet)
+        * found in array the HasFacetL() method should return "ETrue".
+        * @since Series60 3.0
+        * @param        aFacetArray is typically an empty array, into where 
+        *               copies of facets will be added. Ownership of the 
+        *               items in this array is transferred to the caller.
+        * @return       KErrNone or other system-wide Symbian error codes.
+        */
+        virtual TInt FacetsL(RFacetArray& aFacetArray) = 0;
+
+        /**
+        * This leaving variant of ScoreMatch() always returns a positive integer 
+        * if this service description matches with the given pattern in at
+        * least one aspect. Higher numbers mean closer match.
+        *
+        * In case of system error, method leaves.
+        *
+        * The bits of information that are in the pattern are read and compared
+        * to corresponding fields in this ServiceDescription. Note that a pattern
+        * may have far fewer fields and that only the non-null fields are compared.
+        * For example, assume that a pattern with only a contract was defined;
+        * with the contract set to "urn:example.com:service". 
+        * Each ServiceDescription with the same contract will match the pattern,
+        * even if such a ServiceDescription has non-null fields for other aspects.
+        * @since Series60 3.0
+        * @param    aPattern a ServiceDescription, typically with partial
+        *           information.
+        * @return the score. If nothing matches, returns 0
+        */
+        virtual TInt ScoreMatchL(MSenServiceDescription& aPattern) = 0;
+
+        /**
+        * Getter for endpoint.
+        * @since Series60 3.0
+        * @return The endpoint.
+        */
+        virtual TPtrC8 Endpoint() = 0;
+
+        /**
+        * Getter for the framework ID.
+        * @since Series60 3.0
+        * @return The framework ID or KNullDesC8 if no framework is set
+        */
+        virtual TPtrC8 FrameworkId() = 0;
+
+        /**
+        * Getter for the framework version.
+        * @since Series60 3.0
+        * @return The framework version or KNullDesC8 if not set.
+        */
+        virtual TPtrC8 FrameworkVersion() = 0;
+
+        /**
+        * Setter for contract.
+        * @since Series60 3.0
+        * @param aContract  the contract to be set.
+        */
+        virtual void SetContractL(const TDesC8& aContract) = 0;
+
+        /**
+        * Setter for endpoint.
+        * @since Series60 3.0
+        * @param aEndpoint to the service. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        */
+        virtual void SetEndPointL(const TDesC8& aEndPoint) = 0;
+
+        /**
+        * Gets the service description as XML fragment in UTF-8 format.
+        * @since Series60 3.0
+        * @return the service description as XML, which ownership is
+        *         transferred to the caller.
+        */
+        virtual HBufC8* AsXmlL() = 0;
+
+        /**
+        * Gets the service description as XML, in Unicode (UCS-2)
+        * @since Series60 3.0
+        * @return the service description as XML, in Unicode (UCS-2)
+        *         encoding form.
+        */
+        virtual HBufC* AsXmlUnicodeL() = 0;
+
+        /**
+        * Writes this service description as XML, in UTF-8 form to a stream
+        * @since Series60 3.0
+        * @param aWriteStream   to write into.
+        */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+    };
+
+#endif // M_SEN_SERVICE_DESCRIPTION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/MSenServicePolicy.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Service policy interface for serene   
+*
+*/
+
+#ifndef M_SEN_SERVICE_POLICY_H
+#define M_SEN_SERVICE_POLICY_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <badesca.h>
+
+#include "SenDomFragment.h"
+
+typedef RPointerArray<CSenElement> RPolicyArray;
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+/*
+*   <ServicePolicy>
+*       <ClientPolicy>
+*			<MetadataEndpoint>uri.1</MetadataEndpoint>
+*			<MetadataEndpoint>uri.2</MetadataEndpoint>
+*			<MetadataEndpoint>uri.3</MetadataEndpoint>
+*           <PolicyValue1/>				
+*           <PolicyValue2/>				
+*       </ClientPolicy>
+*       <PolicyArrray>
+*			<wsp:Policy1/>
+*			<wsp:Policy2/>
+*       </PolicyArrray>
+*   </ServicePolicy>
+*/
+class MSenServicePolicy
+    {
+    public: // New functions
+
+        /**
+        * Adds a policy in SD
+        * Method is used to add a RAW policy obtained 
+        * by Network or some dynamic means
+        * @since Series60 4.0
+        * @param aPolicy is the Policy Element
+        */ 
+        virtual TInt AddPolicyL(CSenElement* aPolicy) = 0;
+
+        /**
+        * Remove  a Policy from SD
+        * @param aPolicyName , Policy with this name will be removed from SD
+        * @return
+        *  - KErrNone 
+        
+        */ 
+        virtual TInt RemovePolicyL(TDesC8& aPolicyName) = 0;
+
+        /**
+        * Method reads provider policy class instance values from given
+        * template. 
+        * @since Series60 4.0
+        * @param aTemplate from which the values are read.
+        * @return   
+        *           
+        */ 
+        virtual TInt RebuildServicePolicyFrom(MSenServicePolicy& aTemplate) = 0;
+        
+        /**
+        * Checks if policies match.
+        * @return ETrue if policies match, EFalse if not.
+        */
+        virtual TBool Accepts(MSenServicePolicy& aPolicyPattern) = 0;
+       
+        /**
+        * Getter for ServicePolicies
+        * @since Series60 4.0
+        * @return 
+        *           
+        */ 
+
+		/**
+		* Return all of the Services polices from SD only <wsp:Policy> tags
+		* @param aPolicies
+		* @return KErrNone
+		*		  KErrNotFound	
+		*/
+        virtual TInt ServicePolicies(RPolicyArray& aPolicies) = 0;
+        /**
+        * Gets the Client Policy
+        */
+        virtual CSenElement* ClientPolicy() = 0;
+        /**
+        * Searches for the Client Policy with the given key value
+        * @param aKey
+        * @return ETrue If the Client Policy is present with the given key value
+        *		  EFalse If the Client Policy is not present with the given key value  
+        */
+        virtual TBool ClientPolicy(const TDesC8& aKey) = 0;
+        /**
+        * Gets the Client Policy with the given key value
+        * @param aKey
+        * @return Client Policy Value is returned
+        */
+        virtual HBufC8* ClientPolicyValue(const TDesC8& aKey) = 0;
+    };
+
+#endif //M_SEN_POLICY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenCredential.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,255 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements (web) service credential functionality
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CREDENTIAL_H
+#define SEN_CREDENTIAL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <SenBaseFragment.h>
+
+// CONSTANTS
+_LIT8(KCredentialsName,     "Credentials");
+_LIT8(KEndpointName,        "Endpoint");
+_LIT8(KSecurityMechIdName,  "SecurityMechID");
+_LIT8(KNotOnOrAfterName,    "NotOnOrAfter");
+_LIT8(KConditionsName,      "Conditions");
+
+// FORWARD DECLARATIONS
+class SenDateUtils;
+
+// CLASS DECLARATION
+
+/**
+* Class implements (web) service credential functionality
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenCredential : public CSenBaseFragment
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phase constructor.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        * @return new CSenCredential instance pointer
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenCredential* NewL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes);
+            
+        /**
+        * Two-phase constructor.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        * @return new CSenCredential instance pointer, which is left on
+        *         cleanup stack.
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenCredential* NewLC(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& aAttributes);
+
+        /**
+        * Constructor with a possibility to set a parent.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        * @param aParent        The parent element of the new element
+        * @return new CSenCredential instance pointer
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenCredential* NewL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& aAttributes,
+                                             CSenElement& aParent);
+
+        /**
+        * Constructor with a possibility to set a parent.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        * @param aParent        The parent element of the new element
+        * @return new CSenCredential instance pointer, which is left on
+        *         cleanup stack.
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenCredential* NewLC(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& aAttributes,
+                                              CSenElement& aParent);
+
+        /**
+        * Constructor which copies itself from another credential.
+        * @since Series60 3.0
+        * @param    aCredential     credential to copy from.
+        * @return new CSenCredential instance pointer
+        */
+        IMPORT_C static CSenCredential* NewL(const CSenCredential& aCredential);
+
+        /**
+        * Constructor which copies itself from another credential.
+        * @since Series60 3.0
+        * @param    aCredential     credential to copy from.
+        * @return new CSenCredential instance pointer, which is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenCredential* NewLC(const CSenCredential& aCredential);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenCredential();        
+
+        // New functions
+        
+        /**
+        * Getter for the credential ID.
+        * @since Series60 3.0
+        * @return the ID
+        */
+        IMPORT_C const TDesC8& Id();
+
+        /**
+        * Getter for the credential expiration time.
+        * @since Series60 3.0
+        * @return the the expiration time
+        */
+        IMPORT_C TTime& ValidUntil();
+
+        /**
+        * Setter for the credential expiration time.
+        * @since Series60 3.0
+        * @param aTime  The new expiration time
+        */
+        IMPORT_C void SetValidUntil(TTime& aTime);
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CSenDomFragment Callback function which implement the XML content handler interface.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+        
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenCredential();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        * @param aParent is the parent element, which may declare other
+        *        namespaces.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8&  aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes,
+                                 CSenElement& aParent);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @since Series60 3.0
+        * @param aCredential is the source credential to be copied.
+        */
+        IMPORT_C void ConstructL(CSenCredential& aCredential);
+
+        // New functions
+
+        /**
+        * Setter for Credential ID
+        * @since Series60 3.0
+        * @param aId is the unique ID for this Credential
+        */
+        void SetIdL(const TDesC8& aId);
+
+    private: // Data
+        // Unique ID for this credential. Owned.
+        HBufC8* iId;
+        // One may use SenDateUtils to convert from XML date descrtor to TTime
+        TTime iNotOnOrAfter;    
+    };
+
+#endif // SEN_CREDENTIAL_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenCredential2.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements (web) service credential functionality
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_CREDENTIAL2_H
+#define SEN_CREDENTIAL2_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <SenFragmentBase.h>
+#include <SenDomFragmentBase.h>
+
+// CONSTANTS
+_LIT8(KCredentialsName2,     "Credentials");
+_LIT8(KEndpointName2,        "Endpoint");
+_LIT8(KSecurityMechIdName2,  "SecurityMechID");
+_LIT8(KNotOnOrAfterName2,    "NotOnOrAfter");
+_LIT8(KConditionsName2,      "Conditions");
+
+_LIT8(KSenCredentialId,                 "CredentialId");
+_LIT8(KSenCredentialValidUntil,         "ValidUntil");
+_LIT8(KSenCredentialIdentifierLocalname,"Identifier");
+_LIT8(KSenCredentialProperteisLocalname,"Properties");
+
+// FORWARD DECLARATIONS
+class SenDateUtils;
+class CSenCredentialIdentifier;
+class CSenXmlServiceDescription;
+class CSenIdentityProvider;
+class CSenServiceSession;
+class CSenFacet;
+
+// CLASS DECLARATION
+
+/**
+* Class implements (web) service credential functionality
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenCredential2 : public CSenFragmentBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        IMPORT_C static CSenCredential2* NewL();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        */
+        IMPORT_C static CSenCredential2* NewLC();
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        */
+        IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName,
+                                      const RAttributeArray& aAttributes);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttributes,
+                                     TXmlEngElement& aParent);
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this credential
+        * @param aLocalName is the XML localname of this credential
+        * @param aPrefix    is the prefix of this credential
+        * @param aAttrs     are the XML attributes of this credential
+        * @param aParent    is the parent XML element of this credential
+        */
+        IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName,
+                                      const RAttributeArray& aAttributes,
+                                      TXmlEngElement& aParent);
+
+         /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttrs,
+                                     TXmlEngElement& aParent,
+                                     RSenDocument& aOwnerDocument);                                         
+
+        /**
+        * Basic constructor.
+        *
+        * @since Series60 4.0
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& aAttrs,
+                                           TXmlEngElement& aParent,
+                                           RSenDocument& aOwnerDocument);
+
+        /**
+        * Constructor which copies itself from another credential.
+        *
+        * @since Series60 4.0
+        * @param    aCredential     credential to copy from.
+        * @return new CSenCredential instance pointer
+        */
+        IMPORT_C static CSenCredential2* NewL(const CSenCredential2& aCredential);
+
+        /**
+        * Constructor which copies itself from another credential.
+        *
+        * @since Series60 4.0
+        * @param    aCredential     credential to copy from.
+        * @return new CSenCredential instance pointer, which is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenCredential2* NewLC(const CSenCredential2& aCredential);
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenCredential2();        
+
+        // New functions
+        
+        /**
+        * Getter for the credential ID.
+        *
+        * @since Series60 4.0
+        * @return the ID
+        */
+        IMPORT_C virtual const TDesC8& Id();
+
+        /**
+        * Getter for the credential expiration time.
+        * @since Series60 3.0
+        * @return the the expiration time
+        */
+        IMPORT_C virtual TTime& ValidUntil();
+
+        /**
+        * Setter for the credential expiration time.
+        *
+        * @since Series60 4.0
+        * @param aTime  The new expiration time
+        */
+        IMPORT_C virtual void SetValidUntil(TTime& aTime);
+
+    protected:  // Functions from base classes
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenCredential2();
+
+
+        IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
+        							          const RAttributeArray& aAttributes,
+        						 	          TInt aErrorCode);
+        
+        /**
+        * @since Series60 4.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttributes);
+
+        /**
+        * @since Series60 4.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        * @param aParent is the parent element, which may declare other
+        *        namespaces.
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8&  aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttributes,
+                                     TXmlEngElement& aParent);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 4.0
+        * @param aNsUri is the XML namespace as UTF-8 descriptor
+        * @param aLocalName is the XML localname as UTF-8 descriptor
+        * @param aQName is the XML qualifiedname as UTF-8 descriptor
+        * @param aAttributes is the list of XML attributes
+        * @param aParent is the parent element, which may declare other
+        *        namespaces.
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this credential
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8&  aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttributes,
+                                     TXmlEngElement& aParent,
+                                     RSenDocument& aOwnerDocument);                                         
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * @since Series60 4.0
+        * @param aCredential is the source credential to be copied.
+        */
+        IMPORT_C void BaseConstructL(CSenCredential2& aCredential);
+
+
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        *
+        * BaseConstructL for setting XML localname for this Credential.
+        * @since Series60 4.0
+        * @param aLocalName XML localname for this Credential
+        */
+        IMPORT_C void ConstructL(const TDesC8& aLocalName);
+
+        // New functions
+
+        /**
+        * Setter for Credential ID
+        *
+        * @since Series60 4.0
+        * @param aId is the unique ID for this Credential
+        */
+        void SetIdL(const TDesC8& aId);
+
+    private: // Data
+        // Unique ID for this credential. Owned.
+        HBufC8*                     iId;
+        // One may use SenDateUtils to convert from XML date descrtor to TTime
+        TTime                       iNotOnOrAfter;    
+    };
+
+#endif // SEN_CREDENTIAL2_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenFacet.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Parser base element class declaration        
+*
+*/
+
+
+
+
+
+#ifndef SEN_FACET_H
+#define SEN_FACET_H
+
+// INCLUDES
+#include <SenBaseElement.h>
+
+// CONSTANTS
+_LIT8(KSenFacet,        "Facet");
+_LIT8(KFacetAttrName,   "name");
+_LIT8(KFacetAttrType,   "type");
+
+// CLASS DECLARATION
+class CSenFacet : public CSenBaseElement
+    {
+    public:
+        
+        /**
+        * Basic constructor.
+        */
+        IMPORT_C static CSenFacet* NewL();
+
+        /**
+        * Basic constructor.
+        * @param    aCopiedSource   source to copy facet data from.
+        */
+        IMPORT_C static CSenFacet* NewL(CSenElement& aCopiedSource);
+
+        /**
+        * Basic constructor.
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenFacet* NewL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttributes);
+
+        IMPORT_C virtual ~CSenFacet();
+
+        // New functions
+        
+        /**
+        * Setter for name.
+        * @param aName  the name to be set.
+        */
+        IMPORT_C virtual void SetNameL(const TDesC8& aName);
+
+        /**
+        * Setter for type.
+        * @param aType  the type to be set.
+        */
+        IMPORT_C virtual void SetTypeL(const TDesC8& aType);
+
+        /**
+        * Setter for value.
+        * @param aValue the value to be set.
+        */
+        IMPORT_C virtual void SetValueL(const TDesC8& aValue);
+
+        /**
+        * Getter for name.
+        * @return the name of the facet
+        */
+        IMPORT_C virtual TPtrC8 Name();
+
+        /**
+        * Getter for type.
+        * @return the type of the facet
+        */
+        IMPORT_C virtual TPtrC8 Type();
+    
+        /**
+        * Getter for value.
+        * @return the value of the facet
+        */
+        IMPORT_C virtual TPtrC8 Value();
+
+        virtual void CopyFromL(CSenElement& aSource);
+
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenFacet();
+        
+        /**
+        * By default Symbian 2nd phase constructors are private.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aLocalName);
+        IMPORT_C void ConstructL(CSenElement& aCopiedSource);
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aQName,
+                                 const RAttributeArray& aAttributes);
+    };
+
+#endif // SEN_FACET_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenIdentityProvider.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,488 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class describes some IdentityProvider service
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDENTITY_PROVIDER_H
+#define SEN_IDENTITY_PROVIDER_H
+
+//  INCLUDES
+#include <SenXmlServiceDescription.h>
+
+// CONSTANTS
+const TInt KSenAuthMaxUsernameLength = 32;
+const TInt KSenAuthMaxPasswordLength = 16;
+
+_LIT8(KIdentityProvider8, "IdentityProvider"); 	//@depricated
+_LIT8(KFakeIMEI8, "012345678901234");		//@depricated
+_LIT8(KContract8, "urn:liberty:as:2004-04");		//@depricated
+_LIT8(KSenIdpLocalname,                 "IdentityProvider");
+_LIT8(KSenIdpLibertyIdWsfAsContract,            "urn:liberty:as:2004-04");
+_LIT8(KWSAtomPubAuthenticationServiceContract,  "urn:atompub:as");
+_LIT8(KWSOviAuthenticationServiceContract,      "urn:ovi:as");
+_LIT8(KWSStarSTSContract,                       "urn:wstar:sts");
+_LIT8(KImei, "IMEI");		//@depricated
+_LIT8(KType, "type");		//@depricated
+
+_LIT8(KAuthzID8, "AuthzID");		//@depricated
+_LIT8(KAdvisoryAuthnID8, "AdvisoryAuthnID");			//@depricated	
+_LIT8(KPassword8, "Password");		//@depricated
+_LIT8(KProviderID8, "ProviderID");		//@depricated
+_LIT8(KSenIdpAuthzIDLocalname,          "AuthzID");
+_LIT8(KSenIdpAdvisoryAuthnIdLocalname,  "AdvisoryAuthnID");
+_LIT8(KSenIdpPasswordLocalname,         "Password");
+_LIT8(KSenIdpProviderIdLocalname,       "ProviderID");
+_LIT8(KSenAccountExtensions,            "AccountExtensions");
+_LIT8(KSenAccAutoSignIn,                "AutoSignIn");
+                
+// DATA TYPES
+class TSenAuthentication
+    {
+    public:
+        TBuf8<KSenAuthMaxUsernameLength> iUsername;
+        TBuf8<KSenAuthMaxPasswordLength> iPassword;
+    };
+
+// FORWARD DECLARATIONS
+class MSenIdentityManager;
+
+// CLASS DECLARATION
+
+/**
+*  Class describes some IdentityProvider service
+*  Class is intented to be used when registrating
+*  information about some identity providing service.
+*  In case of ID-WSF framework, the IdentityProvider
+*  and Authentication Service are behind same endpoint.
+*  Typically, ID-WSF service consumers call both
+*  RegisterIdentityProviderL() and 
+*  RegisterServiceDescriptionL() methods as defined
+*  in Service Management API (CSenServiceManager).
+*  Basic Web Service consumers use this class to register
+*  BASIC-AUTH credentials to certain pre-known service endpoint.
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenIdentityProvider : public CSenXmlServiceDescription
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * Note: contract defaults here to "urn:liberty:as:2004-04"
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @return a new CSenIdentityProvider
+        */
+        IMPORT_C static CSenIdentityProvider* NewL( const TDesC8& aEndpoint );
+
+        /**
+        * Two-phased constructor.
+        * Note: contract defaults here to "urn:liberty:as:2004-04"
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @return a new CSenIdentityProvider, which pointer is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenIdentityProvider* NewLC( const TDesC8& aEndpoint );
+
+        /**
+        * Two-phased constructor.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default is Liberty ID-WSF Authentication Service contract:
+        *        -- urn:liberty:as:2004-04
+        * @return a new CSenIdentityProvider
+        */
+        IMPORT_C static CSenIdentityProvider* NewL( const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract );
+
+        /**
+        * Two-phased constructor.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default is Liberty ID-WSF Authentication Service contract:
+        *        -- urn:liberty:as:2004-04
+        * @return a new CSenIdentityProvider, which pointer is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenIdentityProvider* NewLC(const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract );
+        
+        /**
+        * Two-phased constructor.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default is Liberty ID-WSF Authentication Service contract:
+        *        -- urn:liberty:as:2004-04
+        * @param aProviderID is identifier of this IdentityProvider. It is a
+        *        unique key pointing to some known endpoint.
+        * @return a new CSenIdentityProvider
+        */
+        IMPORT_C static CSenIdentityProvider* NewL( const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID);
+
+        /**
+        * Two-phased constructor.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default is Liberty ID-WSF Authentication Service contract:
+        *        -- urn:liberty:as:2004-04
+        * @param aProviderID is identifier of this IdentityProvider. It is a
+        *        unique key pointing to some known endpoint. Required only
+        *        for ID-WSF framework.
+        * @return a new CSenIdentityProvider, which pointer is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenIdentityProvider* NewLC(const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID);
+
+        /**
+        * Two-phased constructor.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default is Liberty ID-WSF Authentication Service contract:
+        *        -- urn:liberty:as:2004-04
+        * @param aProviderID is identifier of this IdentityProvider. It is a
+        *        unique key pointing to some known endpoint. Required only
+        *        for ID-WSF framework.
+        * @param aServiceID is a unique contract to some invocable service.
+        *        Typically some URN. If this IDP is registered to ID-WSF 
+        *        framework, this ServiceID will be appended into list of
+        *        services which trust this IDP, and the actual IDP "knows".
+        * @return a new CSenIdentityProvider
+        */
+        IMPORT_C static CSenIdentityProvider* NewL( const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID,
+                                                    const TDesC8& aServiceID);
+
+        /**
+        * Two-phased constructor.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aProviderID is identifier of this IdentityProvider. It is a
+        *        unique key pointing to some known endpoint. Required only
+        *        for ID-WSF framework.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default is Liberty ID-WSF Authentication Service contract:
+        *        -- urn:liberty:as:2004-04
+        * @param aServiceID is a unique contract to some invocable service.
+        *        Typically some URN. If this IDP is registered to ID-WSF 
+        *        framework, this ServiceID will be appended into list of
+        *        services which trust this IDP, and the actual IDP "knows".
+        * @return a new CSenIdentityProvider, which pointer is left on
+        *         cleanup stack.
+        */
+        IMPORT_C static CSenIdentityProvider* NewLC(const TDesC8& aEndpoint,
+                                                    const TDesC8& aContract,
+                                                    const TDesC8& aProviderID,
+                                                    const TDesC8& aServiceID);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenIdentityProvider();
+
+        // New functions
+
+        /**
+        * A getter.
+        * @since Series60 3.0
+        * @return a pointer to authorization id
+        */
+        IMPORT_C virtual TPtrC8 AuthzID();
+
+        /**
+        * A getter.
+        * @since Series60 3.0
+        * @return a pointer to advisory authentication id
+        */
+        IMPORT_C virtual TPtrC8 AdvisoryAuthnID();
+
+        /**
+        * A getter.
+        * @since Series60 3.0
+        * @return a pointer to provider id
+        */
+        IMPORT_C TPtrC8 ProviderID();
+
+        /**
+        * A getter.
+        * @since Series60 3.0
+        * @return a pointer to password
+        */
+        IMPORT_C virtual TPtrC8 Password();
+
+        /**
+        * A getter.
+        * @since Series60 3.0
+        * @return a pointer to IMEI
+        */
+        IMPORT_C const TDesC8& IMEI();
+
+        /**
+        * A getter.
+        * @since Series60 3.0
+        * @return a pointer to username
+        */
+        IMPORT_C TPtrC8 UserName();
+
+        /**
+        * Setter
+        * @since Series60 3.0
+        * @param aProviderID the set id
+        * @return KErrNone or other system-wide Symbian error codes.
+        */
+        IMPORT_C TInt SetProviderID( const TDesC8& aProviderID );
+
+        /**
+        * Setter for ServiceID. ServiceID is the contract of some
+        * invocable service, typically some URN.
+        * Note, that when registering an IDP the possibly existing
+        * list of ServiceIDs is not cleared, but the ServiceID set
+        * via this method is added as new entry into that list, if
+        * it was non-existent.
+        * @since Series60 3.0
+        * @param aServiceID the set id
+        * @return KErrNone or other system-wide Symbian error codes.
+        */
+        IMPORT_C TInt SetServiceID( const TDesC8& aServiceID );
+
+        /**
+        * @since Series60 3.0
+        * @param aServiceDescription the service description to check
+        * @return   ETrue if the ServiceDescription, i.e. its endpoint
+        *                 or contract, is associated to this IdentityProvider.
+        *                 Or if the ServiceDescription is about this
+        *                 IdentityProvider.
+        *           EFalse otherwise
+        */
+        IMPORT_C TBool IsTrustedByL( MSenServiceDescription& aServiceDescription );
+
+        /**
+        * @since Series60 3.0
+        * @param aProviderIdOrServiceId    IdentityProvider ID, or Service ID
+        *                 which is being checked. Service ID is typically URI
+        *                 (service contract or service endpoint).
+        * @return   ETrue if the ServiceDescription, i.e. its endpoint
+        *                 or contract, is associated to this IdentityProvider.
+        *                 Or if the ServiceDescription is about this
+        *                 IdentityProvider.
+        *           EFalse otherwise
+        */
+        IMPORT_C TBool IsTrustedByL( const TDesC8& aProviderIdOrServiceId );
+
+        /**
+        * Checks if this identity provider is set as default .
+        * @since Series60 3.0
+        * @return ETrue if default-attribute was set, EFalse otherwise
+        */
+        IMPORT_C TBool IsDefault();
+
+        /**
+        * Sets the user information.
+        *   Status codes:
+        *   KErrNone        ok
+        *   Other codes are system error codes.
+        * @since Series60 3.0
+        * @param aAuthzID Authorization id.
+        * @param aAdvisoryAuthnID Advisory authorization id.
+        * @param aPassword Password.
+        * @return status/error code.
+        */
+        IMPORT_C TInt SetUserInfoL( const TDesC8& aAuthzID,
+                                    const TDesC8& aAdvisoryAuthnID,
+                                    const TDesC8& aPassword );
+
+        /**
+        * @deprecated. This method is no longer in use.
+        * Creates http-credentials by making password-username pair 
+        * and encoding it with BASE-64.
+        * @since Series60 3.0
+        * @param    aIdMgr  Identitymanager which is used to obtain a password
+        *                   if no password for this identityprovider was set.
+        * @return   a newly allocated credentialbuffer. Ownership is transferred 
+        *           to the caller.
+        */
+        IMPORT_C HBufC8* HttpCredentialsL( MSenIdentityManager& aIdMgr );
+    
+        // Functions from base classes
+    
+        // From CSenXmlServiceDescription
+        
+        /**
+        * @since Series60 3.0
+        * @return Descriptor containing service description local name
+        *                    for this service description.
+        *                    This is the localname of the element, when this class is
+        *                    represented as an XML element. 
+        */
+        IMPORT_C const TDesC8& NewElementName();
+
+        /**
+        * Setter for (identity) provider ID (leaving variant)
+        * @since Series60 4.0
+        * @param aProviderID the unique identifier of the (identity) provider
+        * @return KErrNone on success, KErrArgument if aProviderID is a
+        * zero-length descriptor, or one of the system-wide error codes
+        * otherwise.
+        */
+        IMPORT_C TInt SetProviderIdL( const TDesC8& aProviderID );
+        
+        IMPORT_C TInt SetAccountExtensionsL(const TDesC8& aDetail);
+        
+        IMPORT_C TPtrC8 AccountExtensions(CSenElement*& aAccExt);
+
+    protected:  
+    
+        /*
+          C++ default constructor
+        */
+        IMPORT_C CSenIdentityProvider( TDescriptionClassType aType );
+        
+
+        // Functions from base classes
+    
+        // From CSenXmlServiceDescription
+        
+        /**
+        * Standard 2nd phase constructor.   
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aEndPoint);
+        
+        /**
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default contract is Liberty ID-WSF Authentication Service
+        *        - "urn:liberty:as:2004-04".
+        */
+        IMPORT_C void ConstructL(const TDesC8& aEndPoint,
+                                 const TDesC8& aContract);
+
+        /**
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default contract is Liberty ID-WSF Authentication Service
+        *        - "urn:liberty:as:2004-04".
+        * @param aProviderID is identifier of this IdentityProvider. It is a
+        *        unique key pointing to some known endpoint. Required only
+        *        for ID-WSF framework.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aEndPoint,
+                                 const TDesC8& aContract,
+                                 const TDesC8& aProviderID);
+
+        /**
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. Typically some URN.
+        *        Default contract is Liberty ID-WSF Authentication Service
+        *        - "urn:liberty:as:2004-04".
+        * @param aProviderID is identifier of this IdentityProvider. It is a
+        *        unique key pointing to some known endpoint. Required only
+        *        for ID-WSF framework.
+        * @param aServiceID is a unique contract to some invocable service.
+        *        Typically some URN. If this IDP is registered to ID-WSF 
+        *        framework, this ServiceID will be appended into list of
+        *        services which trust this IDP, and the actual IDP "knows".
+        */
+        IMPORT_C void ConstructL( const TDesC8& aEndPoint,
+                                  const TDesC8& aContract,
+                                  const TDesC8& aProviderID,
+                                  const TDesC8& aServiceID );
+    };
+
+#endif // SEN_IDENTITY_PROVIDER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenIdentityProviderIdArray8.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Array utility class for listing pre-known ProviderIDs
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_IDENTITY_PROVIDER_ID_ARRAY_8_H
+#define SEN_IDENTITY_PROVIDER_ID_ARRAY_8_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <e32std.h>
+#include <MSenIdentityProviderIdArray.h>
+
+// CLASS DECLARATION
+
+/**
+*  Array utility class for listing pre-known ProviderIDs
+*  Typical use of this class is to define a strict list
+*  of ProviderIDs pointing to certain IDPs, which are to
+*  be accepted as only suitable services when initiating
+*  an new service connection.
+*  Other possiblity is to instantiate a non-strict array,
+*  which only acts as "recommendation" of those Identity
+*  Providers, that should be first checked when initiating
+*  new service connection. In such case, because it is a
+*  non-strict list, also other IDPs may be used, if none
+*  matching with this "recommendation" is found.
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenIdentityProviderIdArray8 :    public CDesC8ArraySeg,
+                                        public MSenIdentityProviderIdArray
+{
+    public:  // Constructors and destructor
+        
+        /**
+        *   Constructor with no arguments create non-strict arrays.. 
+        *   (iStrict = EFalse)
+        */ 
+        IMPORT_C static CSenIdentityProviderIdArray8* NewL();
+
+        /**
+        *   Constructor with no arguments create non-strict arrays.. 
+        *   (iStrict = EFalse)
+        */ 
+        IMPORT_C static CSenIdentityProviderIdArray8* NewLC();
+
+        /**
+        * Basic constructor with a default value for iStrict.
+        * @since Series60 3.0
+        * @param aStrict the value to be set to iStrict
+        */
+        IMPORT_C static CSenIdentityProviderIdArray8* NewL(const TBool aStrict);
+
+        /**
+        * Basic constructor with a default value for iStrict.
+        * @since Series60 3.0
+        * @param aStrict the value to be set to iStrict
+        */
+        IMPORT_C static CSenIdentityProviderIdArray8* NewLC(const TBool aStrict);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenIdentityProviderIdArray8();
+
+        // Functions from base classes
+
+        // From MSenIdentityProviderIdArray
+        
+        /**
+        * Getter for iStrict
+        * @since Series60 3.0
+        * @return ETrue if iStrict is true, otherwise EFalse
+        */
+        IMPORT_C virtual TBool IsStrict() const;
+        
+        /**
+        * Setter for iStrict
+        * @since Series60 3.0
+        * @param aStrict the value to be set to iStrict
+        */
+        IMPORT_C void SetStrict(TBool aStrict);
+        
+    protected:  // New functions
+        
+        /**
+        * C++ default constructor.
+        */
+        CSenIdentityProviderIdArray8(const TBool aStrict);  
+        
+        /**
+        * Default 2nd phase constructor
+        * @since Series60 3.0
+        */
+        void ConstructL();
+
+    private:    // Data
+        TBool iStrict;         
+    };
+    
+#endif // SEN_IDENTITY_PROVIDER_ID_ARRAY_8_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenServicePattern.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,232 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class derives the XML service description and further extends
+*                it by adding consumer policy interface implementation.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_PATTERN_H
+#define SEN_SERVICE_PATTERN_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <SenXmlServiceDescription.h>
+#include <MSenConsumerPolicy.h>
+
+// FORWARD DECLARATIONS
+class CSenConsumerPolicy;
+
+// CLASS DECLARATION
+
+/**
+* Class derives the XML service description and further extends
+* it by implementing consumer policy interface.
+*
+* Service pattern is typically used by Basic Web Service consumers,
+* which often know, which policy to use in the communication with 
+* certain Web Service Provider (WSP). 
+*
+* For example, a Basic Web Service consumer application might want 
+* strictly define certain Internet Access Point (IAP) to be used when
+* initializing new service connection. Such an application can simply
+* instantiate new ServicePattern and set pre-known IAP ID into it.
+*
+* The main purpose of this class is to simplify the initialization
+* of service connections for Basic Web Services.
+*
+* It is important to note, that all the consumer policy information entered
+* via ServicePattern extending the MSenConsumerPolicy is treated
+* in "policy-per-client" terms. In other words, any consumer
+* policy information will not be stored for latter use of other
+* applications (even they might happen to use same WSP and contract!).
+*
+* This is due the nature of Service Pattern: it acts as a consumer
+* originated filter, after which a service will be resolved.
+*
+* Any service which "meets" the Service Pattern "constraints", is
+* considered as a "match", because such service accepts this
+* (search) pattern.
+*
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenServicePattern : public CSenXmlServiceDescription, public MSenConsumerPolicy
+
+    {
+    public:  // Constructors and destructor
+        
+        /**
+         *  Standard 2 phase constructors
+         */
+        IMPORT_C static CSenServicePattern* NewL();
+
+        /**
+         *  Standard 2 phase constructors
+         */
+        IMPORT_C static CSenServicePattern* NewLC();
+
+        /**
+         *  Standard 2 phase constructor
+         *  @param aNamespaceURI    namespace URI for the service pattern.
+         */
+        IMPORT_C static CSenServicePattern* NewL(const TDesC8& aNamespaceURI);
+
+        /**
+         *  Standard 2 phase constructor
+         *  @param aNamespaceURI    namespace URI for the service pattern.
+         */
+        IMPORT_C static CSenServicePattern* NewLC(const TDesC8& aNamespaceURI);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aEndPoint    service pattern endpoint.
+         *  @param aContract    service pattern contract.
+         */
+        IMPORT_C static CSenServicePattern* NewL(   const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract );
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aEndPoint    service pattern endpoint.
+         *  @param aContract    service pattern contract.
+         */
+        IMPORT_C static CSenServicePattern* NewLC(  const TDesC8& aEndPoint,
+                                                    const TDesC8& aContract );
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenServicePattern();
+
+        // New functions
+        
+        /**
+        * Convenience method for writing out the consumer policy as XML
+        * in UTF-8 form.
+        * @since Series60 3.0
+        * @return consumer policy as UTF-8 form XML.
+        */ 
+        IMPORT_C HBufC8* ConsumerPolicyAsXmlL();
+        
+        // Functions from base classes
+        
+        // From CSenXmlServiceDescription 
+        
+        /**
+        * Compares that both service description and possible
+        * policy inside of it matches with this instance.
+        * @since Series60 3.0
+        * @param aPattern   the service description to compare to
+        * @return ETrue both service description and policy information
+        *         matches, otherwise EFalse. If some value is not set 
+        *         in current instance, it is not compared.
+        */
+        IMPORT_C TBool Matches(MSenServiceDescription& aServicePattern);
+        
+        /**
+        * Callback function which implements the XML content handler interface.
+        * Parses the consumer policies independently.
+        * @since Series60 3.0
+        * @param aNsUri         The namespace URI of the new element
+        * @param aLocalName     The local name of the new element
+        * @param aQName         The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C void StartElementL(const TDesC8& aNsUri,
+                                    const TDesC8& aLocalName,
+                                    const TDesC8& aQName,
+                                    const RAttributeArray& aAttributes);
+                                
+        // From MSenConsumerPolicy 
+        IMPORT_C virtual void SetConsumerIapIdL(TUint32 aIapId);
+        IMPORT_C virtual TInt ConsumerIapId(TUint32& aCurrentIapId);
+        IMPORT_C virtual void SetConsumerIdentityProviderIdsL(
+                                    CSenIdentityProviderIdArray8& aList);
+    
+        IMPORT_C virtual TInt AddConsumerIdentityProviderIdL(
+                                                        const TDesC8& aProviderId);
+
+        IMPORT_C virtual const CSenIdentityProviderIdArray8&
+                                                ConsumerIdentityProviderIds8L();
+
+        IMPORT_C virtual TBool AcceptsConsumerPolicy(
+                                            MSenConsumerPolicy& aPolicyPattern);
+
+        IMPORT_C virtual TInt RebuildFromConsumerPolicy(
+                                                    MSenConsumerPolicy& aTemplate);
+        
+    protected:  // New functions
+        
+        /**
+        * C++ constructor.
+        * @since Series60 3.0
+        * @param aType enumeration defininng the type of this class.
+        */
+        IMPORT_C CSenServicePattern(
+                            MSenServiceDescription::TDescriptionClassType aType);
+        
+        /**
+        * Base constructor offered to sub class implementations.
+        * @since Series60 3.0
+        */
+        IMPORT_C void BaseConstructL();
+
+        /**
+        * Base constructor offered to sub class implementations.
+        * @since Series60 3.0
+        * @param aNamespaceURI the localname for XML element representation
+        *        of this class.
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNamespaceURI);
+
+        /**
+        * Base constructor offered to sub class implementations.
+        * @since Series60 3.0
+        * @param aEndPoint is the actual endpoint to the service
+        * @param aContract of the service, typically some URI
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aEndPoint, const TDesC8& aContract);
+        
+	public:
+		/**
+        * Sets the Consumer SNAP ID.
+        * @param aSnapId  A TUint32 Snap ID
+        */
+        IMPORT_C void SetConsumerSnapIdL(TUint32 aSnapId);
+		/**
+        * Gets the Consumer SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C TInt ConsumerSnapId(TUint32& aCurrentSnapId);
+		
+    protected:  // Data
+    
+        // Consumer policy class instance, used as a delegate in parsing
+        CSenConsumerPolicy* iConsumerPolicy;
+    };
+
+#endif SEN_SERVICE_PATTERN_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/inc/SenXmlServiceDescription.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,584 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:           Class implements the most common value object used in WSF, 
+*                which is used to  describe some invocable service. 
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef SEN_XML_SERVICE_DESCRIPTION_H
+#define SEN_XML_SERVICE_DESCRIPTION_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32des8.h>
+#include <e32std.h>
+#include <MSenServiceDescription.h>
+#include <MSenProviderPolicy.h>
+#include <SenDomFragment.h>
+
+// CONSTANTS
+const TInt KStateParsingCredentials         = 12;
+const TInt KStateParsingSingleCredential    = 122;
+const TInt KStateParsingProviderPolicy      = 1222;
+const TInt KStateParsingServicePolicy       = 12222;
+
+_LIT8( KSenAttrSoap12,                  "SOAP12"               );
+_LIT8( KSenAttrAddressing,              "Addressing"           );
+_LIT8( KSenAttrClientEntropy,           "ClientEntropy"        );
+_LIT8( KSenAttrTokenType,               "TokenType"            );
+_LIT8( KSenAttrPassportExtensions,      "PassportExtensions"   );
+_LIT8( KSenAttrMetadataEndpoint,        "MetadataEndpoint"     );
+_LIT8( KSenAttrUsernameTokenOverTLS,    "UsernameTokenOverTLS" );
+_LIT8( KSenAttrPromptUserInfo,          "promptUserInfo"       );
+
+_LIT8( KSenLocalnameAppInfo,            "AppInfo"               );
+_LIT8( KSenLocalnameWAPGW,              "WAPGW"                 );
+_LIT8( KSenLocalnameMwsNamespace,       "MwsNamespace"          );
+// FORWARD DECLARATIONS
+class CSenCredential;
+class CSenProviderPolicy;
+class CSenServicePolicy;
+class MSenServicePolicy;
+
+// DATA TYPES
+typedef RPointerArray<CSenCredential> RCredentialList;
+
+// CLASS DECLARATION
+
+/**
+* CSenXmlServiceDescription class implements the most
+* common value object used in WSF, which is used to 
+* describe some invocable service. 
+*
+* Class offers basic properties which describe some
+* service and methods to manipulate this info. These
+* properties are stored in XML fragment format and 
+* a class instance can be represented as one XML tree.
+*
+* The main properties for service description are:
+*    - contract (typically some URI)
+*    - endpoint (typically some URL)
+*    - frameworkID
+*
+*  @lib SenServDesc.lib
+*  @since Series60 3.0
+*/
+class CSenXmlServiceDescription : public CSenDomFragment,
+                                  public MSenServiceDescription,
+                                  public MSenProviderPolicy
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Standard 2 phase constructor
+        * @return a pointer to a new CSenXmlServiceDescription instance.
+        */
+        IMPORT_C static CSenXmlServiceDescription* NewL();
+
+        /**
+        * Standard 2 phase constructor
+        * @return a pointer to a new CSenXmlServiceDescription instance,
+        *        which is left on cleanup stack.
+        */
+        IMPORT_C static CSenXmlServiceDescription* NewLC();
+
+        /**
+        * Standard 2 phase constructor
+        * @param aNamespaceURI namespace URI for the service description.
+        * @return a pointer to a new CSenXmlServiceDescription instance
+        */
+        IMPORT_C static CSenXmlServiceDescription* NewL(const TDesC8& aNamespaceURI);
+
+        /**
+        * Standard 2 phase constructor
+        * @param aNamespaceURI namespace URI for the service description.
+        * @return a pointer to a new CSenXmlServiceDescription instance,
+        *        which is left on cleanup stack.
+        */
+        IMPORT_C static CSenXmlServiceDescription* NewLC(const TDesC8& aNamespaceURI);
+
+        /**
+        * Standard 2 phase constructors
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. 
+        * @return a pointer to a new CSenXmlServiceDescription instance
+        */
+        IMPORT_C static CSenXmlServiceDescription* NewL(const TDesC8& aEndPoint,
+                                                        const TDesC8& aContract);
+
+        /**
+        * Standard 2 phase constructors
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type. 
+        * @return a pointer to a new CSenXmlServiceDescription instance,
+        *        which is left on cleanup stack.
+        */
+        IMPORT_C static CSenXmlServiceDescription* NewLC(const TDesC8& aEndPoint,
+                                                         const TDesC8& aContract);
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenXmlServiceDescription();
+
+        // New functions
+
+        /**
+        * Setter for the framework ID.
+        * The developer may use a FrameworkID to search for a session of    
+        * (i.e. connection to) a certain service invocation framework.
+        * @since Series60 3.0
+        * @param aFrameworkId
+        * If set to KNullDesC8, then any matching framework may be used.
+        * The default frameworkID in WSF is "ID-WSF" 
+        * (KDefaultIdWsfFrameworkID).
+        * Note that Basic Web Services MUST use "WS-I" 
+        * (KDefaultBasicWebServicesFrameworkID).
+        */
+        IMPORT_C void SetFrameworkIdL(const TDesC8& aFrameworkID);
+
+        /**
+        * Method returns the localname for this service description.
+        * This is the localname of the element, when this class is
+        * represented as an XML element.
+        * @since Series60 3.0
+        * @return descriptor to XML localname of this service description
+        */
+        IMPORT_C virtual const TDesC8& NewElementName();
+        
+        /**
+        * Returns list of credentials. Ownership is not transferred, any
+        * modifications to the contents of the list modify the real objects.
+        * @since Series60 3.0
+        * @return the list of credentials (CSenCredential objects).
+        */
+        IMPORT_C  RCredentialList& Credentials();        
+
+        // Functions from base classes
+    
+        // From MSenProviderPolicy
+        IMPORT_C virtual void SetIapIdL(TUint32 aIapId);
+        IMPORT_C virtual TInt IapId(TUint32& aCurrentIapId);
+        IMPORT_C virtual void SetIdentityProviderIdsL(
+                                        CSenIdentityProviderIdArray8& aList);
+		IMPORT_C TInt SetTransportPropertiesL(const TDesC8& aProperties);
+
+        IMPORT_C virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId);
+        IMPORT_C virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate);
+        IMPORT_C virtual const CSenIdentityProviderIdArray8&
+                                                    IdentityProviderIds8L();
+	    IMPORT_C TInt TransportPropertiesL(HBufC8*& aProperties);
+        
+        IMPORT_C virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern);
+        
+        // From MSenServiceDescription:
+        IMPORT_C TDescriptionClassType DescriptionClassType();
+        IMPORT_C TBool Matches(MSenServiceDescription& aPattern);
+        IMPORT_C TPtrC8 Contract();
+
+        // New method
+         /**
+        * Method for checking if service description has a certain facet.
+        * @since Series60 3.0
+        * @param aURI       the facet to check, typically some URI.
+        * @param aHasFacet  is ETrue if facet is found and EFalse, if not.
+        * @return       KErrNone or other system-wide Symbian error codes.
+        */
+        IMPORT_C virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet);
+        
+        // From MSenServiceDescription
+        IMPORT_C virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo);
+        IMPORT_C virtual TInt AddFacetL(const CSenFacet& aFacet);
+        IMPORT_C virtual TInt SetFacetL(const CSenFacet& aFacet);
+        IMPORT_C virtual TInt RemoveFacet(const TDesC8& aURI);
+        IMPORT_C virtual TInt FacetsL(RFacetArray& aFacetArray);
+        
+        // New method
+        /**
+        * On success, this method returns a positive integer if this 
+        * service description matches with the given pattern in at 
+        * least one aspect. Higher numbers mean a closer match.
+        *
+        * The bits of information that are in the pattern are read and compared
+        * to corresponding fields in this ServiceDescription. Note that a pattern
+        * may have far fewer fields and that only the non-null fields are compared.
+        * For example, assume that a pattern with only a contract was defined;
+        * with the contract set to "urn:example.com:service". 
+        * Each ServiceDescription with the same contract will match the pattern,
+        * even if such a ServiceDescription has non-null fields for other aspects.
+        * @since Series60 3.0
+        * @param    aPattern a ServiceDescription, typically with partial
+        *           information.
+        * @return the score or error. If nothing matches, returns 0. In case of 
+        *  any error, a negative value is returned. 
+        */
+        IMPORT_C virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
+
+        // From MSenServiceDescription
+
+        IMPORT_C TPtrC8 Endpoint();
+        IMPORT_C TPtrC8 FrameworkId();
+        IMPORT_C TPtrC8 FrameworkVersion();
+        IMPORT_C void SetContractL(const TDesC8& aContract);
+        IMPORT_C void SetEndPointL(const TDesC8& aEndPoint);
+        
+        // From CSenBaseFragment 
+        
+        /** 
+        * Gets the service description as XML fragment in UTF-8 format.
+        * @since Series60 3.0
+        * @return the service description as XML, which ownership is
+        *         transferred to the caller.
+        */
+        IMPORT_C virtual HBufC8* AsXmlL();
+
+        /**
+        * Gets the service description as XML, in Unicode (UCS-2)
+        * @since Series60 3.0
+        * @return the service description as XML, in Unicode (UCS-2)
+        *         encoding form.
+        */
+        IMPORT_C virtual HBufC* AsXmlUnicodeL();
+
+        /**
+        * Writes this service description as XML, in UTF-8 form to a stream
+        * @since Series60 3.0
+        * @param aWriteStream   to write into.
+        */
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+
+
+        // From CSenDomFragment 
+        
+        /**
+        * Method looks for FrameworkID attribute from the given XML attribute
+        * array and if one is found, sets its value for this instance. In
+        * addition, all the namespace attributes are copied. All other
+        * attributes are discarded.
+        * @since Series60 3.0
+        * @param aAttributes    the attribute list.
+        */
+        IMPORT_C void SetAttributesL(const RAttributeArray& aAttributes);
+
+        /**
+        * Resumes the parsing. Called by the delegate fragment 
+        * in order to notify owner, which needs to regain 
+        * (take over) parsing. For example, when a policy fragment
+        * is parsed, the service description fragment should
+        * resume parsing the rest of its own XML document 
+        * representation.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the current element
+        * @param aLocalName The local name of the current element
+        * @param aQName     The qualified name of the current element
+        */
+        IMPORT_C void ResumeParsingFromL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName);
+                
+    protected:  // New functions
+        
+        /**
+        * C++ default constructor.
+        * @param aType enumeration defining the type of this class.
+        */
+        IMPORT_C CSenXmlServiceDescription(TDescriptionClassType aType);
+        
+        /**
+         * Basic ConstructL function.
+         */
+        IMPORT_C void ConstructL();
+
+        /**
+        * Basic ConstructL function.
+        * @since Series60 3.0
+        * @param aNamespaceURI for this service description, which is
+        *        also an XML element.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNamespaceURI);
+
+        /**
+        * Basic ConstructL function.
+        * @since Series60 3.0
+        * @param aEndpoint the service endpoint. Note that endpoint cannot 
+        *        include characters which are illegal in XML. If endpoint
+        *        is an URL which contains illegal characters (like '&'-char),
+        *        those need to be encoded into XML entity form (like &amp;).
+        *        EncodeHttpCharactersLC() method from XmlUtils can be used
+        *        for encoding of basic XML entities.
+        * @param aContract identifies the service type, typically some URN.
+        */
+        IMPORT_C void ConstructL(const TDesC8& aEndPoint, const TDesC8& aContract);
+
+        // Functions from base classes
+        
+        // From CSenDomFragment 
+        
+        /**
+        * Callback function which implements the XML content handler interface.
+        * @since Series60 3.0
+        * @param aNsURI     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+        // From CSenBaseFragment 
+        /**
+        * Callback function which implement the XML content handler interface.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        */
+        IMPORT_C virtual void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                      const TDesC8& aQName);
+                                          
+    public:
+        /**
+        * Method returns ETrue if the primary keys of this service description
+        * are equal. Definition of primary keys varies on concrete implementations.
+        *
+        * In a typical XML sub class implementation the primary keys are Contract 
+        * and Endpoint elements. 
+        *
+        * Difference to Match() method is that primary keys - often descriptors - 
+        * MUST be equal both in this service description and in aCandidate, unlike
+        * in Match(), where argument is more like wildcard pattern matching even
+        * in cases where it includes fewer fields (less information).
+        *
+        * @since Series60
+        * @param    aCandidate is a service description, which primary keys are
+        *           checked in this comparison.
+        *
+        * @return TBool ETrue if primary keys are equal, EFalse otherwise. 
+        */
+        IMPORT_C TBool HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate);
+
+        /*
+        * Method checks specific pieces of information to determine, whether this
+        * service description is local or not. Typically this is defined by the
+        * endpoint's scheme, which is KSenTransportSchemeLocal in most of the cases,
+        * when this method returns true.
+        * @return boolean indicating whether this endpoint is local or not.
+        */
+        IMPORT_C TBool IsLocalL(); 
+
+
+        /*
+        * Method for binding transport plug-in type with the endpoint in question.
+        * Function adds/sets XML attribute called "cue" for <Endpoint> element:
+        *  
+        *  <ServiceDescription>
+        *    <Endpoint cue="com.nokia.wsf.transport.plugin.hostlet">
+        *        local://urn:nokia.com.test.hostlet
+        *    </Endpoint>
+        *  </ServiceDescription>
+        *
+        * In above example, eventhough endpoint scheme "local://" would normally
+        * invoke different type of plug-in (ECOM hostlet), the "cue" attribute 
+        * overrides this, and forces hostlet connection transport plug-in to be
+        * loaded.
+        *
+        * Transport plug-in types (cues):
+        *
+        *    _LIT8(KSenTransportCueHTTP,              "com.nokia.wsf.transport.plugin.httpchannel");
+        *    _LIT8(KSenTransportCueVirtualTCP,        "com.nokia.wsf.transport.plugin.virtualtcp");
+        *    _LIT8(KSenTransportCueLocalEcom,         "com.nokia.wsf.transport.plugin.local");  
+        *    _LIT8(KSenTransportCueHostletConnection, "com.nokia.wsf.transport.plugin.hostlet");
+        *
+        *
+        * Note that this method does not attempt to load the plug-in - it might not
+        * even exist in the system. Neither is this attribute checked when XML service
+        * description is parsed. As a conclusion, if non-existant plug-ins are bind 
+        * to endpoints, they will be ignored, and the transport is created in normal
+        * way and plug-in is chosen based on endpoint scheme and/or defaults.
+        * 
+        * @param aTransportCue is the ECOM cue of CSenTransport implementation.
+        * In ECOM resource files, cue is the value of "default_data" property.
+        * @return KErrNone on success
+        *         KErrSenNoEndpoint, if  endpoint element does not exist in this XML
+        *         service description.
+        */
+        IMPORT_C TInt SetTransportCueL(const TDesC8& aTransportCue);
+
+
+        /**
+        * Getter for transport cue, assuming that attribute has been set,
+        * and that has "cue" -attribute.
+        * @return transport plug-in ECOM cue, or KNullDesC8, if it has
+        * not been set in this service description. In each ECOM resource
+        * file the cue is defined by "default_data" property.
+        */
+        IMPORT_C TPtrC8 TransportCue();
+
+        /**
+        * Getter for (web) service policy
+        * @return pointer to service policy, or NULL, if it is not available
+        */
+        IMPORT_C MSenServicePolicy* ServicePolicy();
+
+        /**
+        * Method provides convenient way to add a new value in Client Policy
+        * This method will add elements such as <SOAP12> or <UsernameTokenOverTLS>
+        * in the Policy to be used by stack. Infact this method adds a new element 
+        * in xml representation of ServicePolicy.
+        * @param aName is the Name of the attribute.
+        * @return KErrNone on success, KErrArgument if any of the arguments 
+        * (descriptors) is of zero-length, or one of the system-wide 
+        * error codes otherwise.
+        */
+        IMPORT_C TInt SetPolicyL(const TDesC8& aName);
+
+        /**
+        * Method provides convenient way to add a new value in Client Policy
+        * This method will add elements such as <Addressing>
+        * in the Policy to be used by stack. Infact this method adds a new element 
+        * in xml representation of ServicePolicy and adds its value as contents of the element.
+        * <Addressing>http://schemas.xmlsoap.org/ws/2004/03/addressing</Addressing>
+        * @param aName is the Name of the Policy attribute.
+        * @param aValue is the Contents of the Policy attribute.
+        * @return KErrNone on success, KErrArgument if any of the arguments 
+        * (descriptors) is of zero-length, or one of the system-wide 
+        * error codes otherwise.
+        */
+        IMPORT_C TInt SetPolicyL(const TDesC8& aName, const TDesC8& aValue);
+
+        /**
+        * Method provides convenient way to add a new value in Client Policy
+        * This method will add elements such as <Addressing>
+        * in the Policy to be used by stack, plus it will add one specified
+        * attribute (name and value) for that element. Infact this method adds
+        * a new element - and it's attribute - in the xml representation of 
+        * ServicePolicy element, which is direct child to ServiceDescription
+        * (root element) document.
+        * <MetadataEndpoint method = "GET">http://www.mypolicyendpoint.com/policy2/</MetadataEndpoint>
+        * @param aName is the Name of the Policy attribute.
+        * @param aValue is the Contents of the Policy attribute.
+        * @param aAttribName is the Name of the attribute in element aName
+        * @param aAttribValue is the Contents of the aAttribName attribute.
+        * @return KErrNone on success, KErrArgument if any of the arguments 
+        * (descriptors) is of zero-length, or one of the system-wide 
+        * error codes otherwise.
+        */
+        IMPORT_C TInt SetPolicyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aAttribName, const TDesC8& aAttribValue);
+
+        /**
+        * Setter for (identity) provider ID
+        * @since Series60 5.0
+        * @param aProviderID the unique identifier of the (identity) provider
+        * @return KErrNone on success, KErrArgument if aProviderID is of zero-length,
+        * or one of the system-wide Symbian error codes otherwise.
+        */
+        IMPORT_C TInt SetProviderIdL( const TDesC8& aProviderID );
+        
+        /**
+        * Getter for (identity) provider ID
+        * @since Series60 5.0
+        * @return the (locally) unique identifier of the (identity) provider
+        * @return KErrNone on success, KErrArgument if aProviderID is of zero-length,
+        * or one of the system-wide Symbian error codes otherwise.
+        */
+        IMPORT_C TPtrC8 ProviderId();
+
+        /**
+        * Setter for userinfo (KSenAttrPromptUserInfo) attribute, which 
+        * - password notifier dialog is shown to end-user or not, when 
+        * authentication fails (due wrong, or incomplete userinfo).
+        * @param aPromptUserInfoMode 
+        *  EFalse dictates that an error must be returned when creating
+        *         a service connection and userinfo is not accepted by 
+        *         (remote) authentication, instead of showing the dialog.
+        *  ETrue (or if attribute does not exist in this XML SD) means that
+        *         end-user should be prompted (default behaviour). The number
+        *         of retry attempts (each showing a dialog) is service invocation
+        *         framework spesific; typically 3 retries are permitted.     
+        */
+        IMPORT_C void CSenXmlServiceDescription::SetPromptUserInfoL( TBool aPromptUserInfoMode );
+
+        /**
+        * Getter for current userinfo mode (KSenAttrPromptUserInfo attribute).
+        * @return Boolean that indicates the mode:
+        *  EFalse means that end-user prompts (notifier dialogs) have been 
+        *  explicitely surpressed, and thus will not be shown to end-user:
+        *  attribute value is exactly as follows: "false"
+        *  ETrue means that attribute named as KSenAttrPromptUserInfo 
+        *  does not exist (default), or it has ANY value OTHER than "false"
+        */
+        IMPORT_C TBool PromptUserInfo();
+
+	public:
+		/**
+        * Sets the SNAP ID.
+        * @param aIapId  A TUint32 Snap ID
+        */
+        IMPORT_C void SetSnapIdL(TUint32 aIapId); 
+		/**
+        * Gets the SNAP ID.
+        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
+        *                       value of the SNAP ID.
+        * @return               KErrNone if no error, or some of the system
+        *                       wide error codes.
+        */
+        IMPORT_C TInt SnapId(TUint32& aCurrentIapId); 
+		
+    private:
+        TInt FacetValueL(TDesC8& aURI, HBufC8*& aValueTo);
+        TInt RemoveFacetL(const TDesC8& aURI);
+
+    protected: // Data
+        // the type of this class instance
+        const TDescriptionClassType iType;
+
+    private: // Data
+        CSenServicePolicy* iServicePolicy;
+        CSenCredential* iCredential;
+        RCredentialList iCredentialList;
+
+        // Timestamp indicating validity of credentials. Using SenDateUtils 
+        // FromXmlDateTimeL and ToXmlDateTimeUtf8L is recommended for conversions.
+        TTime iNotOnOrAfter;
+        CSenProviderPolicy* iProviderPolicy;
+    };
+
+#endif // SEN_XML_SERVICE_DESCRIPTION_H
+
+// End of File
+
+
Binary file websrv_pub/web_service_description_api/tsrc/bc/senservdesc/bmarm/SenServDescBCTestU.DEF has changed
Binary file websrv_pub/web_service_description_api/tsrc/bc/senservdesc/bwins/SenServDescBCTestU.DEF has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/eabi/SenServDescBCTestu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZN15CTestCredential13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 3 NONAME
+	_ZN23CTestServiceDescription11EndElementLERK6TDesC8S2_S2_ @ 4 NONAME
+	_ZN23CTestServiceDescription13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 5 NONAME
+	_ZTI15CTestCredential @ 6 NONAME ; #<TI>#
+	_ZTI23CTestServiceDescription @ 7 NONAME ; #<TI>#
+	_ZTV15CTestCredential @ 8 NONAME ; #<VT>#
+	_ZTV23CTestServiceDescription @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/group/SenServDesc.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Project specification file for senservdesc
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+TARGET          SenServDescBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+VENDORID        VID_DEFAULT
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         SenServDescBCTest.def
+
+SOURCEPATH      ../src
+SOURCE          SenServDesc.cpp
+SOURCE          SenServDescCases.cpp
+SOURCE 					TestServiceDescription.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         		euser.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+
+LIBRARY         		stiftestinterface.lib
+LIBRARY                 bafl.lib
+LIBRARY         		charconv.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenMessages.lib
+LIBRARY                 SenFragment.lib
+
+
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LIBRARY                 XMLFRAMEWORK.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senservdesc
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+../sis/TestSD_c.bat		/epoc32/winscw/c/TestSD_c.bat
+../sis/TestSD_z.bat		/epoc32/winscw/c/TestSD_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_senservdesc.ini
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+//SenServDesc.mmp
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+SenServDesc.mmp
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/inc/SenServDescBCTest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,543 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenServDesc test module.
+*
+*/
+
+
+#ifndef SENSERVDESCBCTEST_H
+#define SENSERVDESCBCTEST_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+
+#include "TestServiceDescription.h"
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+//#include <SenConsumerPolicy.h>
+#include <SenCredential.h>
+#include <SenCredential2.h>
+#include <RSenDocument.h>
+#include <SenDomFragment.h>
+#include <SenFacet.h>
+#include <SenIdentityProvider.h>
+#include <SenIdentityProviderIdArray8.h>
+#include <SenNamespace.h>
+//#include <SenPolicy.h>
+//#include <SenProviderPolicy.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <MSenIdentityProviderIdArray.h>
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+#include <e32debug.h>
+
+
+
+class CSenConsumerPolicy;
+class CSenBaseElement;
+class CSenBaseFragment;
+class CSenIdentityProvider;
+class CSenIdentityProviderIdArray8;
+class CSenSoapEnvelope;
+class CSenPolicy;
+class CSenCredential;
+class CSenCredential2;
+
+class CSenBaseAttribute;
+class CSenServicePattern;
+class CSenDomFragment;
+class CSenNamespace;
+class CSenFacet;
+class MSenIdentityProviderIdArray;
+class CSenXmlReader;
+class CSenXmlServiceDescription;
+class CSenProviderPolicy;
+class SenXmlUtils;
+class SenDateUtils;
+class TXmlEngElement;
+class RSenDocument;
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+
+namespace{
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+    _LIT8(KXmlSpecific, "\"&<>");
+}
+
+// Logging path
+_LIT( KSenServDescLogPath, "\\logs\\testframework\\SenServDesc\\" ); 
+// Log file
+_LIT( KSenServDescLogFile, "SenServDesc.txt" ); 
+
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenServDesc;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenServDesc::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenServDesc::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a SenServDesc class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenServDesc) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenServDesc* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenServDesc();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenServDesc. It is called once for every instance of 
+        *       TestModuleSenServDesc after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenServDesc.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenServDesc. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServDesc();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+     private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         
+         TPtr16 ConvertToPtr16LC(CSenBaseFragment &fragment);
+         TPtr16 ConvertToPtr16LC(CSenBaseElement &element);
+                 
+        
+         TInt MT_CSenConsumerPolicy_NewLL( TTestResult& aResult );
+         TInt MT_CSenConsumerPolicy_NewLCL(TTestResult& aResult);
+         TInt MT_CSenConsumerPolicy_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenConsumerPolicy_NewLC_1L(TTestResult& aResult);
+         void MT_CSenConsumerPolicy_RebuildFromL();
+         void MT_CSenConsumerPolicy_AcceptsL();
+
+         TInt MT_CSenCredential_NewLL(TTestResult& aResult);
+         TInt MT_CSenCredential_NewLCL(TTestResult& aResults);
+         TInt MT_CSenCredential_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenCredential_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenCredential_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenCredential_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenCredential_IdL(TTestResult& aResult);
+         TInt MT_CSenCredential_ValidUntilL(TTestResult& aResult);
+         TInt MT_CSenCredential_SetValidUntilL(TTestResult& aResult);
+         TInt MT_CSenCredential_StartElementLL(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLL(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLCL(TTestResult& aResults);
+         TInt MT_CSenCredential2_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewL_3L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_3L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewL_4L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_4L(TTestResult& aResult);
+         TInt MT_CSenCredential2_IdL(TTestResult& aResult);
+         TInt MT_CSenCredential2_ValidUntilL(TTestResult& aResult);
+         TInt MT_CSenCredential2_SetValidUntilL(TTestResult& aResult);
+         
+         TInt MT_CSenFacet_NewLL( TTestResult& aResult );
+         TInt MT_CSenFacet_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenFacet_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenFacet_SetNameLL( TTestResult& aResult );
+         TInt MT_CSenFacet_SetTypeLL(TTestResult& aResult);
+         TInt MT_CSenFacet_SetValueLL(TTestResult& aResult);
+         TInt MT_CSenFacet_NameL(TTestResult& aResult);
+         TInt MT_CSenFacet_TypeL(TTestResult& aResult);
+         TInt MT_CSenFacet_ValueL(TTestResult& aResult);
+
+         TInt MT_CSenIdentityProvider_NewL_L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLCL( TTestResult& aResult );
+         TInt MT_CSenIdentityProvider_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewL_3L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLC_3L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_AuthzIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_AdvisoryAuthnIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_ProviderIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_PasswordL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IMEIL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_UserNameL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_SetProviderIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_SetServiceIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IsTrustedByLL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IsTrustedByL1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IsDefaultL(TTestResult& aResult);
+         void MT_CSenIdentityProvider_SetUserInfoLL();
+         TInt MT_CSenIdentityProvider_HttpCredentialsLL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewElementNameL(TTestResult& aResult);
+
+         TInt MT_CSenIdentityProviderIdArray8_NewLL(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_NewLCL(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_IsStrictL(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_SetStrictL(TTestResult& aResult);
+
+         void MT_CSenPolicy_NewLL();
+         void MT_CSenPolicy_NewLCL();
+         void MT_CSenPolicy_NewL_1L();
+         void MT_CSenPolicy_NewLC_1L();
+         void MT_CSenPolicy_SetIapIdLL();
+         void MT_CSenPolicy_IapIdL();
+         void MT_CSenPolicy_SetIdentityProviderIdsLL( TTestResult& aResult );
+         void MT_CSenPolicy_AddIdentityProviderIdLL( TTestResult& aResult );
+         void MT_CSenPolicy_RebuildFromL();
+         void MT_CSenPolicy_IdentityProviderIds8LL();
+         void MT_CSenPolicy_AcceptsL();
+
+         void MT_CSenProviderPolicy_NewLL();
+         void MT_CSenProviderPolicy_NewLCL();
+         void MT_CSenProviderPolicy_NewL_1L();
+         void MT_CSenProviderPolicy_NewLC_1L();
+         void MT_CSenProviderPolicy_AcceptsL();
+         void MT_CSenProviderPolicy_RebuildFromL();
+
+         TInt MT_CSenServicePattern_NewLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewLCL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_ConsumerPolicyAsXmlLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_MatchesL(TTestResult& aResult);
+//         void MT_CSenServicePattern_StartElementLL();//need parsing some xml file
+         TInt MT_CSenServicePattern_SetConsumerIapIdLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_ConsumerIapIdL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_SetConsumerSnapIdLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_ConsumerSnapIdL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_AddConsumerIdentityProviderIdLL(TTestResult& aResult);
+         //TInt MT_CSenServicePattern_ConsumerPolicyAsXmlLL(TTestResult& aResult);
+         
+         TInt MT_CSenServicePattern_ConsumerIdentityProviderIds8LL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_AcceptsConsumerPolicyL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_RebuildFromConsumerPolicyL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_StartElementLL(TTestResult& aResult);
+
+
+         TInt MT_CSenXmlServiceDescription_NewLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewLCL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetFrameworkIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewElementNameL(TTestResult& aResult);
+//         void MT_CSenXmlServiceDescription_CredentialsL();//need parsing some xml file
+         TInt MT_CSenXmlServiceDescription_SetIapIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_IapIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetSnapIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SnapIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AddIdentityProviderIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_RebuildFromL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_IdentityProviderIds8LL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AcceptsL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_DescriptionClassTypeL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_MatchesL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetProviderIDL( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyLL( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyL_1L( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyL_2L( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_ContractL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_HasFacetLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FacetValueL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AddFacetLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetFacetLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_RemoveFacetL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FacetsLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_ScoreMatchLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_EndpointL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FrameworkIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FrameworkVersionL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetContractLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetEndPointLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AsXmlLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_WriteAsXMLToLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetAttributesLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_CredentialsL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AsXmlUnicodeLL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_IsLocalLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetTransportCueLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_TransportCueL(TTestResult& aResult);
+         //TInt MT_CSenXmlServiceDescription_ServicePolicyL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_ProviderIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetPromptUserInfoLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_PromptUserInfoL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_StartEndElementLL(TTestResult& aResult);
+         
+//       void MT_CSenXmlServiceDescription_ResumeParsingFromLL();//need parsing some xml file
+         TInt MT_CSenXmlServiceDescription_CopyFromLL( TTestResult& aResult );
+        
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENSERVDESCBCTEST_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/inc/TestServiceDescription.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+
+
+
+
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+#ifndef TESTSERVICEDESCRIPTION_H
+#define TESTSERVICEDESCRIPTION_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenXmlServiceDescription.h"
+#include "SenCredential.h"
+#include "SenServicePattern.h"
+
+
+class CTestServiceDescription :public CSenXmlServiceDescription
+{
+public:    
+    static CTestServiceDescription* NewL();
+    static CTestServiceDescription* NewLC();
+    IMPORT_C void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+                                            
+	IMPORT_C void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                      		const TDesC8& aQName);                                            
+
+
+};
+
+
+
+class CTestCredential :public CSenCredential
+{
+public:    
+    static CTestCredential* NewL();
+    static CTestCredential* NewLC();
+    IMPORT_C  void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+    
+
+
+};
+
+
+#endif
\ No newline at end of file
Binary file websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:        
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Description"},(0x10282CAB),3,0,0,TYPE=SA
+[0x101F7961],0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenServDescBCTest.dll"-"!:\sys\bin\SenServDescBCTest.dll"
+"\Epoc32\winscw\c\testSD_c.bat"-"!:\testSD.bat"
+"\Epoc32\winscw\c\testframework\testframework_senservdesc.ini"-"!:\testframework\testframework_senservdesc.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\TestFramework_senservdesc.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServDescBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSDescription.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_senservdesc.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServDescBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSDescription.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServDescBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDesc.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenServDesc class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "SenServDescBCTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::CSenServDesc
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenServDesc::CSenServDesc()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenServDescLogPath, 
+                          KSenServDescLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "SenServDesc logging starts!" );
+    iLog->Log( KLogStart );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenServDesc* CSenServDesc::NewL()
+    {
+    CSenServDesc* self = new (ELeave) CSenServDesc;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenServDesc::~CSenServDesc()
+    {
+    delete iLog;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServDesc::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenServDesc::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServDesc::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenServDesc::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenServDesc::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenServDesc::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDescCases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3145 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "SenServDescBCTest.h"
+#include <senxmlelement.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenServDesc::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServDesc.cpp file and to SenServDesc.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServDesc::PrintTest. Otherwise the compiler
+        // gives errors.
+        
+  //      FUNCENTRY( CSenServDesc::PrintTest ),
+  //    ENTRY( "Loop test", CSenServDesc::LoopTest ),
+		ENTRY("NewL - CSenCredential",  CSenServDesc::MT_CSenCredential_NewLL),
+		ENTRY("NewLC - CSenCredential",  CSenServDesc::MT_CSenCredential_NewLCL),
+		ENTRY("NewL - CSenCredential baseElement",  CSenServDesc::MT_CSenCredential_NewL_1L),
+		ENTRY("NewLC - CSenCredential baseElement",  CSenServDesc::MT_CSenCredential_NewLC_1L),
+		ENTRY("NewL - CSenCredential copy",  CSenServDesc::MT_CSenCredential_NewL_2L),
+		ENTRY("NewLC - CSenCredential copy",  CSenServDesc::MT_CSenCredential_NewLC_2L),
+		ENTRY("ValidUntil - CSenCredential ValidUntil",  CSenServDesc::MT_CSenCredential_ValidUntilL),
+		ENTRY("SetValidUntil - CSenCredential SetValidUntil",  CSenServDesc::MT_CSenCredential_SetValidUntilL),
+		//ENTRY("NewLC - CSenCredential Id",  CSenServDesc::MT_CSenCredential_IdL),
+		ENTRY("StartElement - CSenCredential StartElement",  CSenServDesc::MT_CSenCredential_StartElementLL),
+
+		ENTRY("NewL - CSenCredential2",  CSenServDesc::MT_CSenCredential2_NewLL),
+		ENTRY("NewLC - CSenCredential2",  CSenServDesc::MT_CSenCredential2_NewLCL),
+		ENTRY("NewL - CSenCredential2 baseElement",  CSenServDesc::MT_CSenCredential2_NewL_1L),
+		ENTRY("NewLC - CSenCredential2 baseElement",  CSenServDesc::MT_CSenCredential2_NewLC_1L),
+		ENTRY("NewL - CSenCredential2 ",  CSenServDesc::MT_CSenCredential2_NewL_2L),
+		ENTRY("NewLC - CSenCredential2 ",  CSenServDesc::MT_CSenCredential2_NewLC_2L),
+		ENTRY("NewL - CSenCredential2 copy",  CSenServDesc::MT_CSenCredential2_NewL_3L),
+		ENTRY("NewLC - CSenCredential2 copy",  CSenServDesc::MT_CSenCredential2_NewLC_3L),
+		ENTRY("NewL - CSenCredential2 document",  CSenServDesc::MT_CSenCredential2_NewL_4L),
+		ENTRY("NewLC - CSenCredential2 document",  CSenServDesc::MT_CSenCredential2_NewLC_4L),
+		ENTRY("Id - CSenCredential2 Id",  CSenServDesc::MT_CSenCredential2_IdL),
+		ENTRY("ValidUntil - CSenCredential2 ValidUntil",  CSenServDesc::MT_CSenCredential2_ValidUntilL),
+		ENTRY("SetValidUntil - CSenCredential2 SetValidUntil",  CSenServDesc::MT_CSenCredential2_SetValidUntilL),
+		ENTRY("NewL - CSenFacet",  CSenServDesc::MT_CSenFacet_NewLL),
+		ENTRY("NewL - CSenFacet copy",  CSenServDesc::MT_CSenFacet_NewL_1L),
+		ENTRY("NewL - CSenFacet attribute",  CSenServDesc::MT_CSenFacet_NewL_2L),
+		ENTRY("SetNameL - CSenFacet",  CSenServDesc::MT_CSenFacet_SetNameLL),
+		ENTRY("SetTypeL - CSenFacet",  CSenServDesc::MT_CSenFacet_SetTypeLL),
+		ENTRY("SetValueL - CSenFacet",  CSenServDesc::MT_CSenFacet_SetValueLL),
+		ENTRY("Name - CSenFacet",  CSenServDesc::MT_CSenFacet_NameL),
+		ENTRY("Type - CSenFacet",  CSenServDesc::MT_CSenFacet_TypeL),
+		ENTRY("Value - CSenFacet",  CSenServDesc::MT_CSenFacet_ValueL),
+		ENTRY("NewL - Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewL_L),
+		ENTRY("NewLC - Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewLCL),
+		ENTRY("NewL - Enpoint + Contract",  CSenServDesc::MT_CSenIdentityProvider_NewL_1L),
+		ENTRY("NewLC - Enpoint + Contract",  CSenServDesc::MT_CSenIdentityProvider_NewLC_1L),
+		ENTRY("NewL - Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewL_2L),
+		ENTRY("NewLC - Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewLC_2L),
+		ENTRY("NewL - ServiceID + Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewL_3L),
+		ENTRY("NewLC - ServiceID + Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewLC_3L),
+		ENTRY("AuthzID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_AuthzIDL),
+		ENTRY("AdvisoryAuthnID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_AdvisoryAuthnIDL),
+		ENTRY("ProviderID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_ProviderIDL),
+		ENTRY("Password - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_PasswordL),
+		ENTRY("IMEI - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IMEIL),
+		ENTRY("UserName - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_UserNameL),
+		ENTRY("SetProviderID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_SetProviderIDL),
+		ENTRY("SetServiceID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_SetServiceIDL),
+		ENTRY("IsTrustedByL - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IsTrustedByLL),
+		ENTRY("IsTrustedByL1 - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IsTrustedByL1L),		
+		ENTRY("HttpCredentialsL - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_HttpCredentialsLL),
+		ENTRY("IsDefault - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IsDefaultL),		
+		
+		ENTRY("NewElementName - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_NewElementNameL),
+		ENTRY("NewL - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLL),
+		ENTRY("NewLC - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLCL),
+		ENTRY("NewL - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewL_1L),
+		ENTRY("NewLC - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLC_1L),
+		ENTRY("IsStrict - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_IsStrictL),
+		ENTRY("SetStrict - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_SetStrictL),
+		ENTRY("NewL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLL),
+		ENTRY("NewLC - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLCL),
+		ENTRY("NewL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewL_1L),
+		ENTRY("NewLC - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLC_1L),
+		ENTRY("NewL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewL_2L),
+		ENTRY("NewLC - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLC_2L),
+		ENTRY("MatchesL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_MatchesL),		
+		ENTRY("SetConsumerIapIdL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_SetConsumerIapIdLL),
+		ENTRY("ConsumerIapId - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerIapIdL),
+		ENTRY("SetConsumerSnapId - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_SetConsumerSnapIdLL),
+		ENTRY("ConsumerSnapId - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerSnapIdL),
+		ENTRY("SetConsumerIdentityProviderIdsL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL),
+		ENTRY("ConsumerPolicyAsXmlL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerPolicyAsXmlLL),
+		ENTRY("StartElementL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_StartElementLL),
+		
+		
+		ENTRY("AddConsumerIdentityProviderIdL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_AddConsumerIdentityProviderIdLL),
+		ENTRY("ConsumerIdentityProviderIds8L - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerIdentityProviderIds8LL),
+		ENTRY("AcceptsConsumerPolicy - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_AcceptsConsumerPolicyL),
+		ENTRY("RebuildFromConsumerPolicy - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_RebuildFromConsumerPolicyL),		
+		ENTRY("NewL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLL),
+		ENTRY("NewLC - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLCL),
+		ENTRY("NewL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewL_1L),
+		ENTRY("NewLC - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLC_1L),
+		ENTRY("NewL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewL_2L),
+		ENTRY("NewLC - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLC_2L),
+		ENTRY("SetFrameworkIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetFrameworkIdLL),
+		ENTRY("NewElementName - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewElementNameL),
+		ENTRY("SetIapIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetIapIdLL),
+		ENTRY("IapId - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_IapIdL),
+		ENTRY("SetSnapIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetSnapIdLL),
+		ENTRY("SnapId - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SnapIdL),
+		ENTRY("SetIdentityProviderIdsL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL),
+		ENTRY("AddIdentityProviderIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_AddIdentityProviderIdLL),
+		ENTRY("RebuildFrom - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_RebuildFromL),
+		ENTRY("IdentityProviderIds8L - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_IdentityProviderIds8LL),
+		ENTRY("Accepts - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_AcceptsL),
+		ENTRY("DescriptionClassType - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_DescriptionClassTypeL),
+		ENTRY("MatchesL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_MatchesL),
+		ENTRY("SetProviderIDL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetProviderIDL),
+		ENTRY("SetPolicyLL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyLL),
+		ENTRY("SetPolicyL_1L - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_1L),
+		ENTRY("SetPolicyL_2L - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_2L),	
+    	ENTRY("Contract - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_ContractL),
+		ENTRY("HasFacetL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_HasFacetLL),
+		ENTRY("FacetValue - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FacetValueL),
+		ENTRY("AddFacetL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_AddFacetLL),
+		ENTRY("SetFacetL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetFacetLL),
+		ENTRY("RemoveFacet - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_RemoveFacetL),
+		ENTRY("FacetsL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FacetsLL),
+		ENTRY("ScoreMatchL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_ScoreMatchLL),
+		ENTRY("Endpoint - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_EndpointL),
+		ENTRY("FrameworkId - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FrameworkIdL),
+		ENTRY("FrameworkVersion - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FrameworkVersionL),
+		ENTRY("SetContractL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetContractLL),
+		ENTRY("SetEndPointL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetEndPointLL),
+		ENTRY("SetAttributesL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetAttributesLL),		
+		ENTRY("AsXmlL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_AsXmlLL),
+		ENTRY("WriteAsXMLToL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_WriteAsXMLToLL),
+		ENTRY("AsXmlUnicodeL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_AsXmlUnicodeLL),
+		ENTRY("Credentials - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_CredentialsL),
+
+		ENTRY("HasEqualPrimaryKeysL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL),
+		ENTRY("IsLocalL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_IsLocalLL),
+		ENTRY("SetTransportCueL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_SetTransportCueLL),
+		ENTRY("TransportCue - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_TransportCueL),
+		//ENTRY("ServicePolicy - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_ServicePolicyL),
+		ENTRY("ProviderId - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_ProviderIdL),
+		ENTRY("SetPromptUserInfoL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_SetPromptUserInfoLL),
+		ENTRY("PromptUserInfo - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_PromptUserInfoL),
+		ENTRY("StartElementL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_StartEndElementLL),
+		ENTRY("CopyFromLL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_CopyFromLL),
+	
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CSenServDesc::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CSenServDesc::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+//  METHODS
+
+
+
+void CSenServDesc::SetupL(  )
+    {
+
+    } 
+
+void CSenServDesc::Teardown(  )
+    {
+
+    }
+TPtr16 CSenServDesc::ConvertToPtr16LC(CSenBaseFragment &fragment){
+    HBufC16* xmlBuffer = fragment.AsElement().AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+TPtr16 CSenServDesc::ConvertToPtr16LC(CSenBaseElement &element){
+    HBufC16* xmlBuffer = element.AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TInt CSenServDesc::MT_CSenCredential_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential*)NULL);
+  
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    //checking xml
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+ 
+	{TRAPD(err, CSenCredential::NewL(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+   
+ 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+TInt CSenServDesc::MT_CSenCredential_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential = CSenCredential::NewLC(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential*)NULL);
+  
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+
+	  {TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 		{TRAPD(err, CSenCredential::NewLC(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 		{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+     Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenBaseElement* senBaseElement = CSenBaseElement::NewL(KText);
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributeArray, *senBaseElement);
+    TL(senCredential != (CSenCredential*)NULL);
+
+    //checking xml, parent we will not see so ref the same as previous NewL ctr 
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete senBaseElement;
+    senBaseElement = NULL;
+
+    senBaseElement = CSenBaseElement::NewL(KText);
+	 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KText, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KText, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KText, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KText, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+    delete senBaseElement;
+    senBaseElement = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenBaseElement* senBaseElement = CSenBaseElement::NewL(KText);
+    CSenCredential* senCredential = CSenCredential::NewLC(KText, KText, KText, attributeArray, *senBaseElement);
+    TL(senCredential != (CSenCredential*)NULL);
+   
+    //checking xml, parent we will not see so ref the same as previous Newl ctr
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential)== KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete senBaseElement;
+    senBaseElement = NULL;
+
+    senBaseElement = CSenBaseElement::NewL(KText);
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KText, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KText, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+    delete senBaseElement;
+    senBaseElement = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential, *orgSenCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    
+    senCredential = CSenCredential::NewL(*orgSenCredential);
+    
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(senCredential != (CSenCredential*)NULL);
+    
+   __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential, *orgSenCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    
+    senCredential = CSenCredential::NewLC(*orgSenCredential);
+    TL(senCredential != (CSenCredential*)NULL);
+    
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+   
+TInt CSenServDesc::MT_CSenCredential_ValidUntilL( TTestResult& aResult )
+    {
+    SetupL();    
+    RAttributeArray attributes;
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributes);
+    TTime time;
+    _LIT(KTimeString1,"23:34.56");
+    time.Parse(KTimeString1);
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));*/
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));	
+    LOCAL_ASSERT(senCredential->ValidUntil() == time); 
+
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil()); */
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil());	
+
+    //checking xml
+	//_LIT16(KRef, "<text xmlns=\"text\" some valid stuff/>");
+    //_LIT16(KRef, "<text xmlns=\"text\" >");
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*senCredential), KRef);*/
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    delete senCredential;
+    senCredential = NULL;
+    attributes.Reset();
+    attributes.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenCredential_SetValidUntilL( TTestResult& aResult )
+    {
+    return MT_CSenCredential_ValidUntilL(aResult);
+    }
+TInt CSenServDesc::MT_CSenCredential_StartElementLL(TTestResult& aResult)
+	{
+	/*
+	_LIT8(KCredential, "<Credentials CredentialsMaxID=\"1\">
+						<CredentialContainer>
+						<Identifier><garbage>1</garbage><Endpoint>http://10.21.32.20/WSStar/CredMan/WSService.aspx</Endpoint><ProviderID>provider01</ProviderID></Identifier>
+						<Properties>
+						<ServiceInterval>-60540625</ServiceInterval><ValidUntil>2020-06-19T10:28:31.000000Z</ValidUntil>
+						<Created>2007-06-18T10:23:52Z</Created><PhoneTimeWhenMTResolved>2007-06-18T10:24:52.504375Z</PhoneTimeWhenMTResolved>
+						<POP>cnqlXcxDmY4h4tjbgNssLMwhCkOnc+4c</POP>
+						<TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</TokenType>\
+						<BinaryType>simmetric</BinaryType>
+						</Properties></CredentialContainer></Credentials>");
+    */	
+    
+	_LIT8(KCredential, "<Credentials CredentialsMaxID=\"1\">\
+						</Credentials>");
+    					
+	RAttributeArray attributes;
+	CSenCredential* pCredential = CSenCredential::NewL(_L8(""),_L8("Credentials"),_L8("Credentials"),attributes);
+	CleanupStack::PushL(pCredential);
+	CSenXmlReader *pXmlReader = CSenXmlReader::NewL();
+	CleanupStack::PushL(pXmlReader);
+	pCredential->SetReader(*pXmlReader );
+	TRAPD(retVal,pCredential->ParseL(KCredential));
+	CleanupStack::PopAndDestroy(pXmlReader);
+	CleanupStack::PopAndDestroy(pCredential);
+	return retVal;
+	}
+	
+
+TInt CSenServDesc::MT_CSenCredential2_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenCredential2* senCredential = CSenCredential2::NewL();
+    TL(senCredential != (CSenCredential2*)NULL);
+  
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+TInt CSenServDesc::MT_CSenCredential2_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenCredential2* senCredential = CSenCredential2::NewLC();
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+	//CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential2_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential2*)NULL);
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential2_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential2*)NULL);
+
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	//CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+   }
+   
+   
+TInt CSenServDesc::MT_CSenCredential2_NewL_2L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray, bodyElement);
+    TL(senCredential != (CSenCredential2*)NULL);
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    
+    Teardown();
+    return KErrNone;
+	}
+      
+TInt CSenServDesc::MT_CSenCredential2_NewLC_2L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray, bodyElement);
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServDesc::MT_CSenCredential2_NewL_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2  *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewL(*orgSenCredential);
+    
+    
+   __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential2_NewLC_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2 *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewLC(*orgSenCredential);
+    TL(senCredential != (CSenCredential2*)NULL);
+    
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential2_NewL_4L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray, bodyElement, document);
+    TL(senCredential != (CSenCredential2*)NULL);
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    
+    Teardown();
+    return KErrNone;
+	}
+      
+TInt CSenServDesc::MT_CSenCredential2_NewLC_4L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray, bodyElement, document);
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServDesc::MT_CSenCredential2_IdL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2 *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewL(*orgSenCredential);
+    senCredential->Id();
+    TL(senCredential != (CSenCredential2*)NULL);
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential2_ValidUntilL( TTestResult& aResult )
+    {
+    SetupL();    
+    RAttributeArray attributes;
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributes);
+    TTime time;
+    _LIT(KTimeString1,"23:34.56");
+    time.Parse(KTimeString1);
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));*/
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));	
+    LOCAL_ASSERT(senCredential->ValidUntil() == time); 
+
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil()); */
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil());	
+
+    //checking xml
+	//_LIT16(KRef, "<text xmlns=\"text\" some valid stuff/>");
+    //_LIT16(KRef, "<text xmlns=\"text\" >");
+    //_LIT16(KRef, "<text xmlns=\"text\"/>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*senCredential), KRef);*/
+    //TL(ConvertToPtr16LC(*senCredential) == KRef);
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    delete senCredential;
+    senCredential = NULL;
+    attributes.Reset();
+    attributes.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenCredential2_SetValidUntilL( TTestResult& aResult )
+    {
+    return MT_CSenCredential2_ValidUntilL(aResult);
+    }
+
+	
+TInt CSenServDesc::MT_CSenFacet_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenFacet* senFacet = CSenFacet::NewL();
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Facet/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenFacet_NewL_1L(TTestResult& aResult)
+    {
+    SetupL();
+    
+    CSenFacet *senFacet;
+    CSenFacet *senFacetOrg = CSenFacet::NewL();
+    
+    senFacet = CSenFacet::NewL(*senFacetOrg);
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Facet/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    delete senFacetOrg;
+    senFacetOrg = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenFacet_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenFacet* senFacet = CSenFacet::NewL(KText, KText, KText, attributeArray);
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenFacet_SetNameLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Name() == KNullDesC8))return KErrArgument;
+    
+    senFacet->SetNameL(KText);
+    if(!(senFacet->Name() == KText))return KErrArgument;
+    
+    //checking xml
+    _LIT16(KRef, "<Facet name=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+     if(!(senFacet->Name() == KText))return KErrArgument;
+
+   __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenFacet_SetTypeLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Type() == KNullDesC8))return KErrArgument;
+
+    senFacet->SetTypeL(KText);
+    if(!(senFacet->Type() == KText))return KErrArgument;
+   
+    //checking xml
+    _LIT16(KRef, "<Facet type=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    if(!(senFacet->Type() == KText))return KErrArgument;
+
+    delete senFacet;
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenFacet_SetValueLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Value() == KNullDesC8))return KErrArgument;
+
+    senFacet->SetValueL(KText);
+    if(!(senFacet->Value() == KText))return KErrArgument;
+
+    
+    //checking xml
+    _LIT16(KRef, "<Facet>text</Facet>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    if(!(senFacet->Value() == KText))return KErrArgument;
+
+    delete senFacet;
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenFacet_NameL( TTestResult& aResult )
+    {
+    return MT_CSenFacet_SetNameLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenFacet_TypeL( TTestResult& aResult )
+    {
+    return MT_CSenFacet_SetTypeLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenFacet_ValueL( TTestResult& aResult )
+    {
+    return MT_CSenFacet_SetValueLL(aResult);
+    }
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS(idProvider, (CSenIdentityProvider*)NULL);*/
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+ 	/*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*idProvider), KRef);*/
+ 	TL(ConvertToPtr16LC(*idProvider) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    
+    /*__ASSERT_ALWAYS_NO_LEAVE(delete idProvider);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);	
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID><ServiceID>text</ServiceID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLC_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID><ServiceID>text</ServiceID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_AuthzIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->AuthzID() == KNullDesC8);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->AuthzID());
+    idProvider->SetUserInfoL(KText2, KNullDesC8, KNullDesC8);
+    idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+    
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><AuthzID>text</AuthzID></IdentityProvider>");
+
+    TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<AuthzID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->AuthzID() == KText);
+    
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_AdvisoryAuthnIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->AdvisoryAuthnID() == KNullDesC8);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->AdvisoryAuthnID());
+    idProvider->SetUserInfoL(KNullDesC8, KText2, KNullDesC8);
+    idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8);
+    
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><AdvisoryAuthnID>text</AdvisoryAuthnID></IdentityProvider>");
+
+   // TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<AdvisoryAuthnID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->AdvisoryAuthnID() == KText);
+
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_ProviderIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->ProviderID());
+    TL(idProvider->ProviderID() == KText2);
+
+    delete idProvider;
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_PasswordL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->Password());
+    TL(idProvider->Password() == KNullDesC8);
+
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText2);
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText);
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><Password>text</Password></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+   //CleanupStack::PopAndDestroy();//Ptr
+    TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Password>"));
+    TL(posId != -1);
+   CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->Password() == KText);
+
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IMEIL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->IMEI());
+    idProvider->IMEI();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_UserNameL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->UserName());
+    TL(idProvider->UserName() == KNullDesC8);
+
+    idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8);
+    TL(idProvider->UserName()== KText);
+
+    idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+    TL(idProvider->UserName() == KText);
+
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_SetProviderIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText)); 
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+	TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<ProviderID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_SetServiceIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText)); 
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><ServiceID>text</ServiceID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+	TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<ServiceID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IsTrustedByLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* serviceDesc = CSenXmlServiceDescription::NewL(KText, KText2) ;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(_L8("endpoint"), _L8("contract"), KText, KText2);
+    retVal = idProvider->IsTrustedByL(*serviceDesc); 
+	
+	if(retVal);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete serviceDesc);
+    serviceDesc = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IsTrustedByL1L( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(_L8("endpoint"), _L8("contract"), KText, KText2);
+    retVal = idProvider->IsTrustedByL(KText); 
+
+    if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IsDefaultL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    retVal = idProvider->IsDefault(); 
+	
+	if(retVal);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+TInt CSenServDesc::MT_CSenIdentityProvider_HttpCredentialsLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    //retVal = idProvider->HttpCredentialsL(); 
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewElementNameL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->NewElementName() == _L8("IdentityProvider"));
+
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->NewElementName());
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewLC();
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL(FALSE);
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    
+    array = CSenIdentityProviderIdArray8::NewL(TRUE);
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+        
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewLC(FALSE);
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    
+    array = CSenIdentityProviderIdArray8::NewLC(TRUE);
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_IsStrictL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    __ASSERT_ALWAYS_NO_LEAVE(array->SetStrict(TRUE));
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(array->SetStrict(FALSE));
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_SetStrictL( TTestResult& aResult )
+    {
+    return MT_CSenIdentityProviderIdArray8_IsStrictL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC();
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL(KText);
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC(KText);
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL(KText, KText);
+    
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC(KText, KText);
+    
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_MatchesL( TTestResult& aResult )
+    {
+     SetupL();
+    CSenServicePattern *pattern2;
+    CSenServicePattern *pattern;
+    
+    pattern = CSenServicePattern::NewL();
+    //EUNIT_ASSERT_EQUALS(pattern->Matches(*pattern2), FALSE);
+    
+    pattern2 = CSenServicePattern::NewL();
+    //checking xml
+    TL(pattern->Matches(*pattern2) == TRUE);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    pattern2 = NULL;
+    
+    CSenXmlServiceDescription* xmlDescr = CSenXmlServiceDescription::NewL();
+    TL(pattern->Matches(*xmlDescr) == FALSE);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlDescr);
+    xmlDescr = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;    
+    Teardown();
+    return KErrNone;    
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_SetConsumerIapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    
+    TUint32 iap(0);
+    TL(pattern->ConsumerIapId(iap) == KErrNotFound);
+
+    
+    pattern->SetConsumerIapIdL(1);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerIapId(iap));
+    TL(pattern->ConsumerIapId(iap) == KErrNone);
+
+    TL(iap == 1);
+    pattern->SetConsumerIapIdL(2);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerIapId(iap));
+    TL(pattern->ConsumerIapId(iap) == KErrNone);
+
+    TL(iap == 2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerIapIdL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    MT_CSenServicePattern_SetConsumerIapIdLL(aResult);
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServDesc::MT_CSenServicePattern_SetConsumerSnapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    
+    TUint32 iap(0);
+    TL(pattern->ConsumerSnapId(iap) == KErrNotFound);
+
+    
+    pattern->SetConsumerSnapIdL(1);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerSnapId(iap));
+    TL(pattern->ConsumerSnapId(iap) == KErrNone);
+
+    TL(iap == 1);
+
+    pattern->SetConsumerSnapIdL(0);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerSnapId(iap));
+    TL(pattern->ConsumerSnapId(iap) == KErrNotFound);
+
+   // TL(iap == 0);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerSnapIdL( TTestResult& aResult )
+    {
+    
+    SetupL();
+    
+    MT_CSenServicePattern_SetConsumerSnapIdLL(aResult);
+    Teardown();
+    
+    return KErrNone;
+    }
+
+
+TInt CSenServDesc::MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    pattern->AddConsumerIdentityProviderIdL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    array->AppendL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    array->AppendL(KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    
+    TL((pattern->ConsumerIdentityProviderIds8L()).Count() == 2);
+
+    TInt pos(0);
+    if(!((pattern->ConsumerIdentityProviderIds8L()).Find(KText, pos)==KErrNone))return KErrArgument;
+
+    if(!((pattern->ConsumerIdentityProviderIds8L()).Find(KText2, pos)==KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_AddConsumerIdentityProviderIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KNullDesC8) == KErrArgument))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText) == KErrNone))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText2) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerIdentityProviderIds8LL( TTestResult& aResult )
+    {
+    return MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_AcceptsConsumerPolicyL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    pattern->SetConsumerIapIdL(1);
+    array->AppendL(KText);
+    
+    CSenServicePattern* pattern2 = CSenServicePattern::NewL();
+    if(!(pattern2->RebuildFromConsumerPolicy(*pattern)==KErrNone))return KErrArgument;
+
+    if(!(pattern2->AcceptsConsumerPolicy(*pattern)==TRUE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    array = NULL;
+    pattern2 = NULL;
+//false
+    pattern2 = CSenServicePattern::NewL();
+    pattern2->SetConsumerIapIdL(2);
+    if(!(pattern2->AcceptsConsumerPolicy(*pattern)==FALSE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern2 = NULL;
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_RebuildFromConsumerPolicyL( TTestResult& aResult )
+    {
+    return MT_CSenServicePattern_AcceptsConsumerPolicyL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerPolicyAsXmlLL( TTestResult& aResult )
+    {
+    SetupL();
+    HBufC8* retVal;
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    
+    retVal = pattern->ConsumerPolicyAsXmlL();
+    
+    if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_StartElementLL( TTestResult& aResult )
+    {
+    SetupL();
+    //HBufC8* retVal;
+    _LIT8(KText, "text");
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    RAttributeArray array;
+    pattern->StartElementL(KText, KText, KText, array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    if(xmlService == NULL)
+     return KErrNoMemory;
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC();
+    if(xmlService == NULL)
+     return KErrNoMemory;
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC(KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+     //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+     //checking xml
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC(KText, KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+     //checking xml
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetFrameworkIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+
+    TL(xmlService->FrameworkId() == KNullDesC8);
+
+    _LIT8(KFr, "ID-WSF");
+    xmlService->SetFrameworkIdL(KFr);
+    //checking xml
+    _LIT16(KRef1, "<ServiceDescription framework=\"ID-WSF\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef1);
+
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("framework=\"ID-WSF\""));
+	TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->FrameworkId() == KFr);
+
+    //again
+    xmlService->SetFrameworkIdL(KFr);
+    //checking xml
+    //_LIT16(KRef2, "<ServiceDescription framework=\"ID-WSF\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+	TPtr16 ptr1 = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr1);
+	posId = messageToParse.Find(_L("framework=\"ID-WSF\""));
+	TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr1
+    TL(xmlService->FrameworkId() == KFr);
+
+    //again
+    xmlService->SetFrameworkIdL(KText);
+    //checking xml
+    //_LIT16(KRef3, "<ServiceDescription framework=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef3);
+	TPtr16 ptr2 = ConvertToPtr16LC(*xmlService);
+	posId =-1;
+    messageToParse.Set(ptr2);
+    posId = messageToParse.Find(_L("framework=\"text\""));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr2
+    TL(xmlService->FrameworkId() == KText);
+
+    //clear
+    xmlService->SetFrameworkIdL(KNullDesC8);
+    //checking xml
+    //_LIT16(KRef4, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef4);
+	TPtr16 ptr3 = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr3);
+    posId = messageToParse.Find(_L("ServiceDescription"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr3
+    TL(xmlService->FrameworkId() == KNullDesC8);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewElementNameL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    _LIT8(KRef, "ServiceDescription");
+    if(!(xmlService ->NewElementName() == KRef))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetIapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TUint32 iap(0);
+    if(!((xmlService ->IapId(iap)) == KErrNotFound))return KErrArgument;
+
+    xmlService ->SetIapIdL(1);
+    if(!(xmlService ->IapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(1))return KErrArgument;
+
+    xmlService ->SetIapIdL(2);
+    if(!(xmlService ->IapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_IapIdL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetIapIdLL(aResult);
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetSnapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TUint32 iap(0);
+    if(!((xmlService ->SnapId(iap)) == KErrNotFound))return KErrArgument;
+
+    xmlService ->SetSnapIdL(1);
+    if(!(xmlService ->SnapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(1))return KErrArgument;
+
+    xmlService ->SetSnapIdL(2);
+    if(!(xmlService ->SnapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SnapIdL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetSnapIdLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    
+    TPtrC8 ptrText = KText();
+    xmlService->AddIdentityProviderIdL(ptrText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    array->AppendL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    array->AppendL(KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    
+    TL((xmlService->IdentityProviderIds8L()).Count() == 2);
+
+    TInt pos(0);
+    if(!((xmlService->IdentityProviderIds8L()).Find(KText, pos)==KErrNone))return KErrArgument;
+
+    if(!((xmlService->IdentityProviderIds8L()).Find(KText2, pos)==KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AddIdentityProviderIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TPtrC8 ptr = KNullDesC8();
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrArgument))return KErrArgument;
+
+    ptr.Set(KText);
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrAlreadyExists))return KErrArgument;
+
+    ptr.Set(KText2);
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument;
+
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy><IdentityProviderIDs><IdentityProviderID>text</IdentityProviderID><IdentityProviderID>text2</IdentityProviderID></IdentityProviderIDs></ProviderPolicy><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_RebuildFromL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    xmlService->SetIapIdL(1);
+    array->AppendL(KText);
+    
+    CSenXmlServiceDescription* xmlService2 = CSenXmlServiceDescription::NewL();
+    if(!(xmlService2->RebuildFrom(*xmlService)==KErrNone))return KErrArgument;
+
+    if(!(xmlService2->Accepts(*xmlService)==TRUE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    array = NULL;
+    xmlService2 = NULL;
+//false
+    xmlService2 = CSenServicePattern::NewL();
+    xmlService2->SetIapIdL(2);
+    if(!(xmlService2->Accepts(*xmlService)==FALSE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService2 = NULL;
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_IdentityProviderIds8LL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AcceptsL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_RebuildFromL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_DescriptionClassTypeL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    if(!(xmlService ->DescriptionClassType() == MSenServiceDescription::EXmlServiceDescription))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_MatchesL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription *xmlService;
+    CSenXmlServiceDescription *xmlService2(NULL);
+    
+    xmlService = CSenXmlServiceDescription::NewL();
+    //EUNIT_ASSERT_EQUALS(xmlService->Matches(*xmlService2), FALSE);
+    
+    xmlService2 = CSenXmlServiceDescription::NewL();
+    //checking xml
+    TL(xmlService ->Matches(*xmlService2) == TRUE);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //EUNIT_ASSERT_EQUALS(xmlService->Matches(*pattern), FALSE);
+    TL(xmlService->Matches(*pattern) == TRUE);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;  
+    Teardown();
+    return KErrNone;
+      
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetProviderIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+     
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetProviderIdL(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetProviderIdL(KText)); 
+   
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8("")) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text/></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText, KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8(""), KText) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text>text</text></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText, KText, KText, KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8(""), _L8(""), KText, KText) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text text=\"text\">text</text></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ContractL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    xmlService ->SetContractL(KText);
+     //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Contract>text</Contract></ServiceDescription>");
+    
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Contract>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->Contract() == KText);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   
+    //2nd time
+    xmlService ->SetContractL(KText);
+     //checking xml
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+	ptr = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Contract>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->Contract() == KText);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   
+    xmlService ->SetContractL(KText2);
+     //checking xml
+    _LIT16(KRef2, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Contract>text2</Contract></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    TL(xmlService->Contract() == KText2);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+//================Facets
+TInt CSenServDesc::MT_CSenXmlServiceDescription_HasFacetLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_RemoveFacetL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FacetValueL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet* senFacet;
+    senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet->SetValueL(KText2);
+    
+
+    xmlService->AddFacetL(*senFacet);
+    TPtrC8 ptr=KText();
+    HBufC8* valueTo = NULL;
+    
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNone))return KErrArgument;
+
+    TL(*valueTo == KText2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete valueTo );
+    valueTo = NULL;
+    
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNone))return KErrArgument;
+
+    TL(*valueTo == KText2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete valueTo );
+    valueTo = NULL;
+    
+    ptr.Set(KText2);
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNotFound))return KErrArgument;
+
+     __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AddFacetLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet *senFacet;
+    CSenFacet *senFacet2;
+    
+    senFacet = CSenFacet::NewL();
+    senFacet2 = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet2->SetNameL(KText2);
+    RFacetArray array;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet2) == KErrNone))return KErrArgument;
+
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Facet name=\"text\"/><Facet name=\"text2\"/></ServiceDescription>");
+    //TPtrC16 ptrRef = KRef();
+    //TL(ConvertToPtr16LC(*xmlService) == ptrRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Facet name=\"text\"/><Facet name=\"text2\"/>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet2);
+    senFacet2 = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetFacetLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet* senFacet;
+    senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet->SetValueL(KText);
+    
+    RFacetArray array;
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    senFacet->SetValueL(KText2);
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Facet name=\"text\">text2</Facet></ServiceDescription>");
+    //TPtrC16 ptrRef = KRef();
+    //TL(ConvertToPtr16LC(*xmlService) == ptrRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	 TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Facet name=\"text\">text2</Facet>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_RemoveFacetL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet *senFacet;
+    CSenFacet *senFacet2;
+    
+    senFacet = CSenFacet::NewL();
+    senFacet2 = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet2->SetNameL(KText2);
+    RFacetArray array;
+
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet2) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 2))return KErrArgument;
+
+    array.ResetAndDestroy();
+//removing, haFacet
+    TBool has(FALSE);
+    if(!(xmlService->HasFacetL(KText, has) == KErrNone))return KErrArgument;
+
+    if(!(has == TRUE))return KErrArgument;
+
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == TRUE))return KErrArgument;
+
+    if(!(xmlService->RemoveFacet(KText2) == KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->RemoveFacet(KText2));
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == FALSE))return KErrArgument;
+
+    if(!(xmlService->RemoveFacet(KText2) == KErrNotFound))return KErrArgument;
+
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == FALSE))return KErrArgument;
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet2);
+    senFacet2 = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FacetsLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_AddFacetLL(aResult);
+    }
+//------------end facet
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AsXmlLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    HBufC8* xmlBuffer = xmlService->AsXmlL();
+    CleanupStack::PushL( xmlBuffer );
+    TPtr8 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    _LIT8(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/
+    //TL(ptr == KRef);
+    TInt posId(-1);
+    TPtrC8 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L8("<facet>"));
+    TL(posId == -1);
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_WriteAsXMLToLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    CleanupStack::PushL(xmlService);
+    xmlService->WriteAsXMLToL(ElemntStream);
+    
+    CleanupStack::PopAndDestroy(xmlService);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone ;
+    }
+
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_CredentialsL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->Credentials();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AsXmlUnicodeLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    HBufC* xmlBuffer = xmlService->AsXmlUnicodeL();
+    CleanupStack::PushL( xmlBuffer );
+    TPtr ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    _LIT(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/
+    TL(ptr == KRef);
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetFrameworkIdL(KText);
+    CSenXmlServiceDescription* xmlService1= CSenXmlServiceDescription::NewL();
+    
+    retVal = xmlService->HasEqualPrimaryKeysL(*xmlService);
+    //TL(retVal == ETrue)
+	if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService1);
+    xmlService1 = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_IsLocalLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    retVal = xmlService->IsLocalL();
+    //TL(retVal == ETrue)
+	if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetTransportCueLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    retVal = xmlService->SetTransportCueL(KText);
+    if(!(retVal == 0)) return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_TransportCueL( TTestResult& aResult )
+    {
+    SetupL();
+    //TBool retVal;
+    //HBufC8* xmlBuffer;
+    //TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetTransportCueL(KText);
+    xmlService->TransportCue();
+    //ptr = xmBuffer.Desc(;)
+    //TL(ptr == KText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+/*    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ServicePolicyL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CServicePolicy* policy = CSenServicePolicy::NewL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    policy = (CServicePolicy)xmlService->ServicePolicyL();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+*/    
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ProviderIdL( TTestResult& aResult )
+    {
+    SetupL();
+    //TBool retVal;
+    //TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->ProviderId();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPromptUserInfoLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool var = ETrue;
+    TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetPromptUserInfoL(var);
+		
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_PromptUserInfoL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;;
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    retVal = xmlService->PromptUserInfo();
+	
+	if(retVal);
+		
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+TInt CSenServDesc::MT_CSenXmlServiceDescription_StartEndElementLL(TTestResult& aResult)
+	{
+/*_LIT8(KServiceDescription, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">&ltContent2&quot&gt</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+*/	
+
+
+_LIT8(KServiceDescription, "<ServiceDescription framework=\"WS-STAR\">\
+		<Contract>urn:wstar:sts</Contract>\
+		<Endpoint>http://10.21.32.20/WSStar/BgRsp/STS.aspx</Endpoint>\
+		<ProviderID>provider01</ProviderID>\
+		</ServiceDescription>");		
+/*
+	_LIT8(KServiceDescription, "<ServiceDescription framework=\"WS-STAR\">
+		<Contract>urn:wstar:sts</Contract>
+		<Endpoint>http://10.21.32.20/WSStar/BgRsp/STS.aspx</Endpoint>
+		<ProviderID>provider01</ProviderID>
+		<ProviderPolicy>
+       <Transport>
+           <IapId>
+               1234567890
+           </IapId>
+       </Transport>
+       <IdentityProviderIDs strict=\"true\">
+           <IdentityProviderID>
+             urn:first.id.example.com
+           </IdentityProviderID>
+           <IdentityProviderID>
+             urn:second.id.example.com
+           </IdentityProviderID>
+       </IdentityProviderIDs>
+   		</ProviderPolicy>
+		<Credentials CredentialsMaxID=\"1\">
+						<CredentialContainer>
+						<Identifier><garbage>1</garbage><Endpoint>http://10.21.32.20/WSStar/CredMan/WSService.aspx</Endpoint><ProviderID>provider01</ProviderID></Identifier>
+						<Properties>
+						<ServiceInterval>-60540625</ServiceInterval><ValidUntil>2020-06-19T10:28:31.000000Z</ValidUntil>
+						<Created>2007-06-18T10:23:52Z</Created><PhoneTimeWhenMTResolved>2007-06-18T10:24:52.504375Z</PhoneTimeWhenMTResolved>
+						<POP>cnqlXcxDmY4h4tjbgNssLMwhCkOnc+4c</POP>
+						<TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</TokenType>\
+						<BinaryType>simmetric</BinaryType>
+						</Properties></CredentialContainer></Credentials>
+		</ServiceDescription>");*/
+
+	CSenXmlServiceDescription* pDescription = CSenXmlServiceDescription::NewL(_L8("ServiceDescription"));
+	CleanupStack::PushL(pDescription);
+	CSenXmlReader *pXmlReader = CSenXmlReader::NewL();
+	CleanupStack::PushL(pXmlReader);
+	pDescription->SetReader(*pXmlReader );
+	TRAPD(retVal,pDescription->ParseL(KServiceDescription));
+	CleanupStack::PopAndDestroy(pXmlReader);
+	CleanupStack::PopAndDestroy(pDescription);
+	return retVal;
+	}
+
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ScoreMatchLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription *xmlService;
+    CSenXmlServiceDescription *xmlService2;
+    
+    xmlService = CSenXmlServiceDescription::NewL();
+    xmlService2 = CSenXmlServiceDescription::NewL();
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 0))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText, KText2);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText2, KText);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 0))return KErrArgument;
+
+   __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText2, KText);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+    CSenFacet* senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    xmlService->AddFacetL(*senFacet);
+    xmlService2->AddFacetL(*senFacet);
+    
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_EndpointL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    
+    xmlService ->SetEndPointL(KText);
+     //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Endpoint>text</Endpoint></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    TL(xmlService->Endpoint() == KText);
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Endpoint>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    //2nd time
+    xmlService ->SetEndPointL(KText);
+     //checking xml
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+	ptr = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Endpoint>"));
+    TL(posId != -1);
+    TL(xmlService->Endpoint() == KText);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+
+    xmlService ->SetEndPointL(KText2);
+     //checking xml
+    _LIT16(KRef2, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Endpoint>text2</Endpoint></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    TL(xmlService->Endpoint() == KText2);
+	ptr = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Endpoint>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FrameworkIdL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetFrameworkIdLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FrameworkVersionL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService ->FrameworkVersion());
+    if(!(xmlService ->FrameworkVersion() == KNullDesC8))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetContractLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_ContractL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetEndPointLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_EndpointL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetAttributesLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    RAttributeArray attributeArray;
+    xmlService->SetAttributesL(attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_CopyFromLL( TTestResult& aResult )
+    {
+    SetupL();
+    _LIT8(KContent, "content");
+    _LIT8(KFacet, "Facet");
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    TL(senFacet != (CSenFacet*)NULL);
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+    
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);    
+    
+    CSenXmlElement* xmlElem = CSenXmlElement::NewL(KText, KText, KText);
+    CSenXmlElement* xmlElem2 = CSenXmlElement::NewL(KText2);
+    xmlElem->AddElementL(*xmlElem2);
+    TL (xmlElem->SetContentL(KContent) == KContent);
+    xmlElem->SetAttributesL(attrArray);
+    
+    senFacet->CopyFromL(*xmlElem);
+    
+    TL (senFacet->LocalName() == KFacet);
+    TL (senFacet->NamespaceURI() == KNullDesC8);
+    TL (senFacet->NsPrefix() == KNullDesC8);
+    TL (senFacet->Content() == KContent);
+    RPointerArray<CSenElement>& xmlElemList = senFacet->ElementsL();
+    TL (xmlElemList.Count() == 1);
+    RPointerArray<CSenBaseAttribute>& xmlElemAttrList = senFacet->AttributesL();
+    TL (xmlElemAttrList.Count() == 1);    
+    
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlElem);
+    xmlElem = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    
+    Teardown();    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// ?classname::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?classname::?member_function(
+   ?arg_type arg,
+   ?arg_type arg )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ?function_name implements...
+// ?implementation_description.
+// Returns: ?value_1: ?description
+//          ?value_n: ?description
+//                    ?description
+// -----------------------------------------------------------------------------
+//
+/*
+?type  ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg )  // ?description
+    {
+
+    ?code
+
+    }
+*/
+//  End of File
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/TestServiceDescription.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+#include <e32std.h>
+#include <f32file.h>
+#include "TestServiceDescription.h"
+
+
+//TestServiceDescription//
+
+CTestServiceDescription* CTestServiceDescription::NewL()
+{
+     return((CTestServiceDescription*)CSenXmlServiceDescription::NewL());
+}
+CTestServiceDescription* CTestServiceDescription::NewLC()
+{
+     return((CTestServiceDescription*)CSenXmlServiceDescription::NewLC());
+  
+}
+
+EXPORT_C void CTestServiceDescription::StartElementL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttributes)
+{
+		 
+	return(CSenXmlServiceDescription::StartElementL(aNsUri,aLocalName,aQName,aAttributes));
+    
+}
+
+EXPORT_C void CTestServiceDescription::EndElementL(const TDesC8& aNsUri,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aQName )
+{
+	
+	return(CSenXmlServiceDescription::EndElementL(aNsUri,aLocalName,aQName ));
+    
+}
+
+
+///Credential///
+
+CTestCredential* CTestCredential::NewL()
+{
+	_LIT8(KText, "text");
+	RAttributeArray array;
+    return((CTestCredential*)CSenCredential::NewL(KText, KText, KText, array));
+}
+
+
+CTestCredential* CTestCredential::NewLC()
+{
+	_LIT8(KText, "text");
+	RAttributeArray array;
+    return((CTestCredential*)CSenCredential::NewLC(KText, KText, KText, array));
+  
+}
+
+
+
+
+EXPORT_C void CTestCredential::StartElementL(const TDesC8& aNsUri,
+    											const TDesC8& aLocalName,
+    											const TDesC8& aQName,
+    											const RAttributeArray& aAttributes)
+{
+	return(CSenCredential::StartElementL(aNsUri,aLocalName,aQName,aAttributes));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for web_service_description_api test source
+*
+*/
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+../senservdescTester/group/senservdescTester.mmp
+
+
+// End of file
Binary file websrv_pub/web_service_description_api/tsrc/senservdesc/bmarm/senservdescbctestu.def has changed
Binary file websrv_pub/web_service_description_api/tsrc/senservdesc/bwins/senservdescbctestu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/eabi/SenServDescBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,11 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZN15CTestCredential13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 3 NONAME
+	_ZN23CTestServiceDescription11EndElementLERK6TDesC8S2_S2_ @ 4 NONAME
+	_ZN23CTestServiceDescription13StartElementLERK6TDesC8S2_S2_RK6RArrayIN3Xml10RAttributeEE @ 5 NONAME
+	_ZTI15CTestCredential @ 6 NONAME ; #<TI>#
+	_ZTI23CTestServiceDescription @ 7 NONAME ; #<TI>#
+	_ZTV15CTestCredential @ 8 NONAME ; #<VT>#
+	_ZTV23CTestServiceDescription @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/group/SenServDescBCTest_UID_.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x1000008d,0x101fb3e7,EPriorityForeground,0x000ffffeu,0x00000000u,0x101fb3e7,0,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senservdesc
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+../sis/testsd_c.bat		/epoc32/winscw/c/TestSD_c.bat
+../sis/testsd_z.bat		/epoc32/winscw/c/TestSD_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_senservdesc.ini
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+senservdesc.mmp
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/group/senservdesc.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:     Project specification file for senservdesc
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+TARGET          SenServDescBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+VENDORID        VID_DEFAULT
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         SenServDescBCTest.def
+
+SOURCEPATH      ../src
+SOURCE          senservdesc.cpp
+SOURCE          senservdesccases.cpp
+SOURCE 					TestServiceDescription.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         		euser.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+
+LIBRARY         		stiftestinterface.lib
+LIBRARY                 bafl.lib
+LIBRARY         		charconv.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenMessages.lib
+LIBRARY                 SenFragment.lib
+
+
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LIBRARY                 XMLFRAMEWORK.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/group/senservdesc.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Description"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenServDescBCTest.dll"-"!:\sys\bin\SenServDescBCTest.dll"
+;"\Epoc32\winscw\c\testSD_c.bat"-"!:\testSD.bat"
+"..\init\SenServDescBCTest.ini"-"!:\testframework\SenServDescBCTest.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/inc/TestServiceDescription.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+
+
+
+
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+#ifndef TESTSERVICEDESCRIPTION_H
+#define TESTSERVICEDESCRIPTION_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenXmlServiceDescription.h"
+#include "SenCredential.h"
+#include "SenServicePattern.h"
+
+
+class CTestServiceDescription :public CSenXmlServiceDescription
+{
+public:    
+    static CTestServiceDescription* NewL();
+    static CTestServiceDescription* NewLC();
+    IMPORT_C void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+                                            
+	IMPORT_C void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                      		const TDesC8& aQName);                                            
+
+
+};
+
+
+
+class CTestCredential :public CSenCredential
+{
+public:    
+    static CTestCredential* NewL();
+    static CTestCredential* NewLC();
+    IMPORT_C  void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+    
+
+
+};
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/inc/senservdescbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,543 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenServDesc test module.
+*
+*/
+
+
+#ifndef SENSERVDESCBCTEST_H
+#define SENSERVDESCBCTEST_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+
+#include "TestServiceDescription.h"
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+//#include <SenConsumerPolicy.h>
+#include <SenCredential.h>
+#include <SenCredential2.h>
+#include <RSenDocument.h>
+#include <SenDomFragment.h>
+#include <SenFacet.h>
+#include <SenIdentityProvider.h>
+#include <SenIdentityProviderIdArray8.h>
+#include <SenNameSpace.h>
+//#include <SenPolicy.h>
+//#include <SenProviderPolicy.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <MSenIdentityProviderIdArray.h>
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+#include <e32debug.h>
+
+
+
+class CSenConsumerPolicy;
+class CSenBaseElement;
+class CSenBaseFragment;
+class CSenIdentityProvider;
+class CSenIdentityProviderIdArray8;
+class CSenSoapEnvelope;
+class CSenPolicy;
+class CSenCredential;
+class CSenCredential2;
+
+class CSenBaseAttribute;
+class CSenServicePattern;
+class CSenDomFragment;
+class CSenNamespace;
+class CSenFacet;
+class MSenIdentityProviderIdArray;
+class CSenXmlReader;
+class CSenXmlServiceDescription;
+class CSenProviderPolicy;
+class SenXmlUtils;
+class SenDateUtils;
+class TXmlEngElement;
+class RSenDocument;
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+
+namespace{
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+    _LIT8(KXmlSpecific, "\"&<>");
+}
+
+// Logging path
+_LIT( KSenServDescLogPath, "\\logs\\testframework\\SenServDesc\\" ); 
+// Log file
+_LIT( KSenServDescLogFile, "SenServDesc.txt" ); 
+
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenServDesc;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenServDesc::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenServDesc::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a SenServDesc class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenServDesc) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenServDesc* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenServDesc();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenServDesc. It is called once for every instance of 
+        *       TestModuleSenServDesc after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenServDesc.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenServDesc. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServDesc();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+     private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         
+         TPtr16 ConvertToPtr16LC(CSenBaseFragment &fragment);
+         TPtr16 ConvertToPtr16LC(CSenBaseElement &element);
+                 
+        
+         TInt MT_CSenConsumerPolicy_NewLL( TTestResult& aResult );
+         TInt MT_CSenConsumerPolicy_NewLCL(TTestResult& aResult);
+         TInt MT_CSenConsumerPolicy_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenConsumerPolicy_NewLC_1L(TTestResult& aResult);
+         void MT_CSenConsumerPolicy_RebuildFromL();
+         void MT_CSenConsumerPolicy_AcceptsL();
+
+         TInt MT_CSenCredential_NewLL(TTestResult& aResult);
+         TInt MT_CSenCredential_NewLCL(TTestResult& aResults);
+         TInt MT_CSenCredential_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenCredential_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenCredential_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenCredential_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenCredential_IdL(TTestResult& aResult);
+         TInt MT_CSenCredential_ValidUntilL(TTestResult& aResult);
+         TInt MT_CSenCredential_SetValidUntilL(TTestResult& aResult);
+         TInt MT_CSenCredential_StartElementLL(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLL(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLCL(TTestResult& aResults);
+         TInt MT_CSenCredential2_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewL_3L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_3L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewL_4L(TTestResult& aResult);
+         TInt MT_CSenCredential2_NewLC_4L(TTestResult& aResult);
+         TInt MT_CSenCredential2_IdL(TTestResult& aResult);
+         TInt MT_CSenCredential2_ValidUntilL(TTestResult& aResult);
+         TInt MT_CSenCredential2_SetValidUntilL(TTestResult& aResult);
+         
+         TInt MT_CSenFacet_NewLL( TTestResult& aResult );
+         TInt MT_CSenFacet_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenFacet_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenFacet_SetNameLL( TTestResult& aResult );
+         TInt MT_CSenFacet_SetTypeLL(TTestResult& aResult);
+         TInt MT_CSenFacet_SetValueLL(TTestResult& aResult);
+         TInt MT_CSenFacet_NameL(TTestResult& aResult);
+         TInt MT_CSenFacet_TypeL(TTestResult& aResult);
+         TInt MT_CSenFacet_ValueL(TTestResult& aResult);
+
+         TInt MT_CSenIdentityProvider_NewL_L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLCL( TTestResult& aResult );
+         TInt MT_CSenIdentityProvider_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewL_3L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewLC_3L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_AuthzIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_AdvisoryAuthnIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_ProviderIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_PasswordL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IMEIL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_UserNameL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_SetProviderIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_SetServiceIDL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IsTrustedByLL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IsTrustedByL1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_IsDefaultL(TTestResult& aResult);
+         void MT_CSenIdentityProvider_SetUserInfoLL();
+         TInt MT_CSenIdentityProvider_HttpCredentialsLL(TTestResult& aResult);
+         TInt MT_CSenIdentityProvider_NewElementNameL(TTestResult& aResult);
+
+         TInt MT_CSenIdentityProviderIdArray8_NewLL(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_NewLCL(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_IsStrictL(TTestResult& aResult);
+         TInt MT_CSenIdentityProviderIdArray8_SetStrictL(TTestResult& aResult);
+
+         void MT_CSenPolicy_NewLL();
+         void MT_CSenPolicy_NewLCL();
+         void MT_CSenPolicy_NewL_1L();
+         void MT_CSenPolicy_NewLC_1L();
+         void MT_CSenPolicy_SetIapIdLL();
+         void MT_CSenPolicy_IapIdL();
+         void MT_CSenPolicy_SetIdentityProviderIdsLL( TTestResult& aResult );
+         void MT_CSenPolicy_AddIdentityProviderIdLL( TTestResult& aResult );
+         void MT_CSenPolicy_RebuildFromL();
+         void MT_CSenPolicy_IdentityProviderIds8LL();
+         void MT_CSenPolicy_AcceptsL();
+
+         void MT_CSenProviderPolicy_NewLL();
+         void MT_CSenProviderPolicy_NewLCL();
+         void MT_CSenProviderPolicy_NewL_1L();
+         void MT_CSenProviderPolicy_NewLC_1L();
+         void MT_CSenProviderPolicy_AcceptsL();
+         void MT_CSenProviderPolicy_RebuildFromL();
+
+         TInt MT_CSenServicePattern_NewLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewLCL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenServicePattern_ConsumerPolicyAsXmlLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_MatchesL(TTestResult& aResult);
+//         void MT_CSenServicePattern_StartElementLL();//need parsing some xml file
+         TInt MT_CSenServicePattern_SetConsumerIapIdLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_ConsumerIapIdL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_SetConsumerSnapIdLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_ConsumerSnapIdL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_AddConsumerIdentityProviderIdLL(TTestResult& aResult);
+         //TInt MT_CSenServicePattern_ConsumerPolicyAsXmlLL(TTestResult& aResult);
+         
+         TInt MT_CSenServicePattern_ConsumerIdentityProviderIds8LL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_AcceptsConsumerPolicyL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_RebuildFromConsumerPolicyL(TTestResult& aResult);
+         TInt MT_CSenServicePattern_StartElementLL(TTestResult& aResult);
+
+
+         TInt MT_CSenXmlServiceDescription_NewLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewLCL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewL_1L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewLC_1L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewL_2L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewLC_2L(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetFrameworkIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_NewElementNameL(TTestResult& aResult);
+//         void MT_CSenXmlServiceDescription_CredentialsL();//need parsing some xml file
+         TInt MT_CSenXmlServiceDescription_SetIapIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_IapIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetSnapIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SnapIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AddIdentityProviderIdLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_RebuildFromL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_IdentityProviderIds8LL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AcceptsL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_DescriptionClassTypeL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_MatchesL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetProviderIDL( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyLL( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyL_1L( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyL_2L( TTestResult& aResult ) ;
+         TInt MT_CSenXmlServiceDescription_ContractL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_HasFacetLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FacetValueL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AddFacetLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetFacetLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_RemoveFacetL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FacetsLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_ScoreMatchLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_EndpointL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FrameworkIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_FrameworkVersionL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetContractLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetEndPointLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AsXmlLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_WriteAsXMLToLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetAttributesLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_CredentialsL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_AsXmlUnicodeLL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_IsLocalLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetTransportCueLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_TransportCueL(TTestResult& aResult);
+         //TInt MT_CSenXmlServiceDescription_ServicePolicyL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_ProviderIdL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_SetPromptUserInfoLL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_PromptUserInfoL(TTestResult& aResult);
+         TInt MT_CSenXmlServiceDescription_StartEndElementLL(TTestResult& aResult);
+         
+//       void MT_CSenXmlServiceDescription_ResumeParsingFromLL();//need parsing some xml file
+         TInt MT_CSenXmlServiceDescription_CopyFromLL( TTestResult& aResult );
+        
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENSERVDESCBCTEST_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/init/SenServDescBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServDescBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/rom/senservdesc.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SENSERVDESC_IBY__
+#define SENSERVDESC_IBY__
+
+file=ABI_DIR\BUILD_DIR\SenServDescBCTest.dll          PROGRAMS_DIR\SenServDescBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/sis/SenServDescBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServDescBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/sis/senservdesc.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Description"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenServDescBCTest.dll"-"!:\sys\bin\SenServDescBCTest.dll"
+"\Epoc32\winscw\c\testSD_c.bat"-"!:\testSD.bat"
+"\Epoc32\winscw\c\testframework\testframework_senservdesc.ini"-"!:\testframework\testframework_senservdesc.ini"
Binary file websrv_pub/web_service_description_api/tsrc/senservdesc/sis/senservdesc.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServDescBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/sis/testsd_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\TestFramework_senservdesc.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServDescBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSDescription.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/sis/testsd_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_senservdesc.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServDescBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSDescription.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/src/TestServiceDescription.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+#include <e32std.h>
+#include <f32file.h>
+#include "TestServiceDescription.h"
+
+
+//TestServiceDescription//
+
+CTestServiceDescription* CTestServiceDescription::NewL()
+{
+     return((CTestServiceDescription*)CSenXmlServiceDescription::NewL());
+}
+CTestServiceDescription* CTestServiceDescription::NewLC()
+{
+     return((CTestServiceDescription*)CSenXmlServiceDescription::NewLC());
+  
+}
+
+EXPORT_C void CTestServiceDescription::StartElementL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttributes)
+{
+		 
+	return(CSenXmlServiceDescription::StartElementL(aNsUri,aLocalName,aQName,aAttributes));
+    
+}
+
+EXPORT_C void CTestServiceDescription::EndElementL(const TDesC8& aNsUri,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aQName )
+{
+	
+	return(CSenXmlServiceDescription::EndElementL(aNsUri,aLocalName,aQName ));
+    
+}
+
+
+///Credential///
+
+CTestCredential* CTestCredential::NewL()
+{
+	_LIT8(KText, "text");
+	RAttributeArray array;
+    return((CTestCredential*)CSenCredential::NewL(KText, KText, KText, array));
+}
+
+
+CTestCredential* CTestCredential::NewLC()
+{
+	_LIT8(KText, "text");
+	RAttributeArray array;
+    return((CTestCredential*)CSenCredential::NewLC(KText, KText, KText, array));
+  
+}
+
+
+
+
+EXPORT_C void CTestCredential::StartElementL(const TDesC8& aNsUri,
+    											const TDesC8& aLocalName,
+    											const TDesC8& aQName,
+    											const RAttributeArray& aAttributes)
+{
+	return(CSenCredential::StartElementL(aNsUri,aLocalName,aQName,aAttributes));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/src/senservdesc.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenServDesc class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senservdescbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::CSenServDesc
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenServDesc::CSenServDesc()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenServDescLogPath, 
+                          KSenServDescLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "SenServDesc logging starts!" );
+    iLog->Log( KLogStart );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenServDesc* CSenServDesc::NewL()
+    {
+    CSenServDesc* self = new (ELeave) CSenServDesc;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenServDesc::~CSenServDesc()
+    {
+    delete iLog;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServDesc::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenServDesc::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServDesc::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenServDesc::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenServDesc::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServDesc::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenServDesc::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdesc/src/senservdesccases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3145 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "senservdescbctest.h"
+#include <SenXmlElement.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServDesc::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenServDesc::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServDesc.cpp file and to SenServDesc.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServDesc::PrintTest. Otherwise the compiler
+        // gives errors.
+        
+  //      FUNCENTRY( CSenServDesc::PrintTest ),
+  //    ENTRY( "Loop test", CSenServDesc::LoopTest ),
+		ENTRY("NewL - CSenCredential",  CSenServDesc::MT_CSenCredential_NewLL),
+		ENTRY("NewLC - CSenCredential",  CSenServDesc::MT_CSenCredential_NewLCL),
+		ENTRY("NewL - CSenCredential baseElement",  CSenServDesc::MT_CSenCredential_NewL_1L),
+		ENTRY("NewLC - CSenCredential baseElement",  CSenServDesc::MT_CSenCredential_NewLC_1L),
+		ENTRY("NewL - CSenCredential copy",  CSenServDesc::MT_CSenCredential_NewL_2L),
+		ENTRY("NewLC - CSenCredential copy",  CSenServDesc::MT_CSenCredential_NewLC_2L),
+		ENTRY("ValidUntil - CSenCredential ValidUntil",  CSenServDesc::MT_CSenCredential_ValidUntilL),
+		ENTRY("SetValidUntil - CSenCredential SetValidUntil",  CSenServDesc::MT_CSenCredential_SetValidUntilL),
+		//ENTRY("NewLC - CSenCredential Id",  CSenServDesc::MT_CSenCredential_IdL),
+		ENTRY("StartElement - CSenCredential StartElement",  CSenServDesc::MT_CSenCredential_StartElementLL),
+
+		ENTRY("NewL - CSenCredential2",  CSenServDesc::MT_CSenCredential2_NewLL),
+		ENTRY("NewLC - CSenCredential2",  CSenServDesc::MT_CSenCredential2_NewLCL),
+		ENTRY("NewL - CSenCredential2 baseElement",  CSenServDesc::MT_CSenCredential2_NewL_1L),
+		ENTRY("NewLC - CSenCredential2 baseElement",  CSenServDesc::MT_CSenCredential2_NewLC_1L),
+		ENTRY("NewL - CSenCredential2 ",  CSenServDesc::MT_CSenCredential2_NewL_2L),
+		ENTRY("NewLC - CSenCredential2 ",  CSenServDesc::MT_CSenCredential2_NewLC_2L),
+		ENTRY("NewL - CSenCredential2 copy",  CSenServDesc::MT_CSenCredential2_NewL_3L),
+		ENTRY("NewLC - CSenCredential2 copy",  CSenServDesc::MT_CSenCredential2_NewLC_3L),
+		ENTRY("NewL - CSenCredential2 document",  CSenServDesc::MT_CSenCredential2_NewL_4L),
+		ENTRY("NewLC - CSenCredential2 document",  CSenServDesc::MT_CSenCredential2_NewLC_4L),
+		ENTRY("Id - CSenCredential2 Id",  CSenServDesc::MT_CSenCredential2_IdL),
+		ENTRY("ValidUntil - CSenCredential2 ValidUntil",  CSenServDesc::MT_CSenCredential2_ValidUntilL),
+		ENTRY("SetValidUntil - CSenCredential2 SetValidUntil",  CSenServDesc::MT_CSenCredential2_SetValidUntilL),
+		ENTRY("NewL - CSenFacet",  CSenServDesc::MT_CSenFacet_NewLL),
+		ENTRY("NewL - CSenFacet copy",  CSenServDesc::MT_CSenFacet_NewL_1L),
+		ENTRY("NewL - CSenFacet attribute",  CSenServDesc::MT_CSenFacet_NewL_2L),
+		ENTRY("SetNameL - CSenFacet",  CSenServDesc::MT_CSenFacet_SetNameLL),
+		ENTRY("SetTypeL - CSenFacet",  CSenServDesc::MT_CSenFacet_SetTypeLL),
+		ENTRY("SetValueL - CSenFacet",  CSenServDesc::MT_CSenFacet_SetValueLL),
+		ENTRY("Name - CSenFacet",  CSenServDesc::MT_CSenFacet_NameL),
+		ENTRY("Type - CSenFacet",  CSenServDesc::MT_CSenFacet_TypeL),
+		ENTRY("Value - CSenFacet",  CSenServDesc::MT_CSenFacet_ValueL),
+		ENTRY("NewL - Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewL_L),
+		ENTRY("NewLC - Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewLCL),
+		ENTRY("NewL - Enpoint + Contract",  CSenServDesc::MT_CSenIdentityProvider_NewL_1L),
+		ENTRY("NewLC - Enpoint + Contract",  CSenServDesc::MT_CSenIdentityProvider_NewLC_1L),
+		ENTRY("NewL - Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewL_2L),
+		ENTRY("NewLC - Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewLC_2L),
+		ENTRY("NewL - ServiceID + Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewL_3L),
+		ENTRY("NewLC - ServiceID + Provider + Contract+ Endpoint",  CSenServDesc::MT_CSenIdentityProvider_NewLC_3L),
+		ENTRY("AuthzID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_AuthzIDL),
+		ENTRY("AdvisoryAuthnID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_AdvisoryAuthnIDL),
+		ENTRY("ProviderID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_ProviderIDL),
+		ENTRY("Password - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_PasswordL),
+		ENTRY("IMEI - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IMEIL),
+		ENTRY("UserName - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_UserNameL),
+		ENTRY("SetProviderID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_SetProviderIDL),
+		ENTRY("SetServiceID - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_SetServiceIDL),
+		ENTRY("IsTrustedByL - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IsTrustedByLL),
+		ENTRY("IsTrustedByL1 - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IsTrustedByL1L),		
+		ENTRY("HttpCredentialsL - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_HttpCredentialsLL),
+		ENTRY("IsDefault - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_IsDefaultL),		
+		
+		ENTRY("NewElementName - IdentityProvider",  CSenServDesc::MT_CSenIdentityProvider_NewElementNameL),
+		ENTRY("NewL - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLL),
+		ENTRY("NewLC - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLCL),
+		ENTRY("NewL - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewL_1L),
+		ENTRY("NewLC - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLC_1L),
+		ENTRY("IsStrict - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_IsStrictL),
+		ENTRY("SetStrict - CSenIdentityProviderIdArray8",  CSenServDesc::MT_CSenIdentityProviderIdArray8_SetStrictL),
+		ENTRY("NewL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLL),
+		ENTRY("NewLC - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLCL),
+		ENTRY("NewL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewL_1L),
+		ENTRY("NewLC - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLC_1L),
+		ENTRY("NewL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewL_2L),
+		ENTRY("NewLC - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_NewLC_2L),
+		ENTRY("MatchesL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_MatchesL),		
+		ENTRY("SetConsumerIapIdL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_SetConsumerIapIdLL),
+		ENTRY("ConsumerIapId - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerIapIdL),
+		ENTRY("SetConsumerSnapId - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_SetConsumerSnapIdLL),
+		ENTRY("ConsumerSnapId - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerSnapIdL),
+		ENTRY("SetConsumerIdentityProviderIdsL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL),
+		ENTRY("ConsumerPolicyAsXmlL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerPolicyAsXmlLL),
+		ENTRY("StartElementL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_StartElementLL),
+		
+		
+		ENTRY("AddConsumerIdentityProviderIdL - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_AddConsumerIdentityProviderIdLL),
+		ENTRY("ConsumerIdentityProviderIds8L - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_ConsumerIdentityProviderIds8LL),
+		ENTRY("AcceptsConsumerPolicy - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_AcceptsConsumerPolicyL),
+		ENTRY("RebuildFromConsumerPolicy - CSenServicePattern",  CSenServDesc::MT_CSenServicePattern_RebuildFromConsumerPolicyL),		
+		ENTRY("NewL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLL),
+		ENTRY("NewLC - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLCL),
+		ENTRY("NewL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewL_1L),
+		ENTRY("NewLC - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLC_1L),
+		ENTRY("NewL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewL_2L),
+		ENTRY("NewLC - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewLC_2L),
+		ENTRY("SetFrameworkIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetFrameworkIdLL),
+		ENTRY("NewElementName - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_NewElementNameL),
+		ENTRY("SetIapIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetIapIdLL),
+		ENTRY("IapId - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_IapIdL),
+		ENTRY("SetSnapIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetSnapIdLL),
+		ENTRY("SnapId - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SnapIdL),
+		ENTRY("SetIdentityProviderIdsL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL),
+		ENTRY("AddIdentityProviderIdL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_AddIdentityProviderIdLL),
+		ENTRY("RebuildFrom - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_RebuildFromL),
+		ENTRY("IdentityProviderIds8L - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_IdentityProviderIds8LL),
+		ENTRY("Accepts - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_AcceptsL),
+		ENTRY("DescriptionClassType - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_DescriptionClassTypeL),
+		ENTRY("MatchesL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_MatchesL),
+		ENTRY("SetProviderIDL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetProviderIDL),
+		ENTRY("SetPolicyLL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyLL),
+		ENTRY("SetPolicyL_1L - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_1L),
+		ENTRY("SetPolicyL_2L - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_2L),	
+    	ENTRY("Contract - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_ContractL),
+		ENTRY("HasFacetL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_HasFacetLL),
+		ENTRY("FacetValue - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FacetValueL),
+		ENTRY("AddFacetL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_AddFacetLL),
+		ENTRY("SetFacetL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetFacetLL),
+		ENTRY("RemoveFacet - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_RemoveFacetL),
+		ENTRY("FacetsL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FacetsLL),
+		ENTRY("ScoreMatchL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_ScoreMatchLL),
+		ENTRY("Endpoint - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_EndpointL),
+		ENTRY("FrameworkId - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FrameworkIdL),
+		ENTRY("FrameworkVersion - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_FrameworkVersionL),
+		ENTRY("SetContractL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetContractLL),
+		ENTRY("SetEndPointL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetEndPointLL),
+		ENTRY("SetAttributesL - CSenXmlServiceDescription",  CSenServDesc::MT_CSenXmlServiceDescription_SetAttributesLL),		
+		ENTRY("AsXmlL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_AsXmlLL),
+		ENTRY("WriteAsXMLToL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_WriteAsXMLToLL),
+		ENTRY("AsXmlUnicodeL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_AsXmlUnicodeLL),
+		ENTRY("Credentials - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_CredentialsL),
+
+		ENTRY("HasEqualPrimaryKeysL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL),
+		ENTRY("IsLocalL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_IsLocalLL),
+		ENTRY("SetTransportCueL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_SetTransportCueLL),
+		ENTRY("TransportCue - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_TransportCueL),
+		//ENTRY("ServicePolicy - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_ServicePolicyL),
+		ENTRY("ProviderId - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_ProviderIdL),
+		ENTRY("SetPromptUserInfoL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_SetPromptUserInfoLL),
+		ENTRY("PromptUserInfo - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_PromptUserInfoL),
+		ENTRY("StartElementL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_StartEndElementLL),
+		ENTRY("CopyFromLL - CSenXmlServiceDescription ", CSenServDesc::MT_CSenXmlServiceDescription_CopyFromLL),
+	
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CSenServDesc::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CSenServDesc::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+//  METHODS
+
+
+
+void CSenServDesc::SetupL(  )
+    {
+
+    } 
+
+void CSenServDesc::Teardown(  )
+    {
+
+    }
+TPtr16 CSenServDesc::ConvertToPtr16LC(CSenBaseFragment &fragment){
+    HBufC16* xmlBuffer = fragment.AsElement().AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+TPtr16 CSenServDesc::ConvertToPtr16LC(CSenBaseElement &element){
+    HBufC16* xmlBuffer = element.AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TInt CSenServDesc::MT_CSenCredential_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential*)NULL);
+  
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    //checking xml
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+ 
+	{TRAPD(err, CSenCredential::NewL(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+   
+ 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+TInt CSenServDesc::MT_CSenCredential_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential = CSenCredential::NewLC(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential*)NULL);
+  
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+
+	  {TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 		{TRAPD(err, CSenCredential::NewLC(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 		{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+     Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenBaseElement* senBaseElement = CSenBaseElement::NewL(KText);
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributeArray, *senBaseElement);
+    TL(senCredential != (CSenCredential*)NULL);
+
+    //checking xml, parent we will not see so ref the same as previous NewL ctr 
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete senBaseElement;
+    senBaseElement = NULL;
+
+    senBaseElement = CSenBaseElement::NewL(KText);
+	 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KText, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KText, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KText, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KText, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+    delete senBaseElement;
+    senBaseElement = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenBaseElement* senBaseElement = CSenBaseElement::NewL(KText);
+    CSenCredential* senCredential = CSenCredential::NewLC(KText, KText, KText, attributeArray, *senBaseElement);
+    TL(senCredential != (CSenCredential*)NULL);
+   
+    //checking xml, parent we will not see so ref the same as previous Newl ctr
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential)== KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete senBaseElement;
+    senBaseElement = NULL;
+
+    senBaseElement = CSenBaseElement::NewL(KText);
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KText, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KText, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+    delete senBaseElement;
+    senBaseElement = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential, *orgSenCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    
+    senCredential = CSenCredential::NewL(*orgSenCredential);
+    
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(senCredential != (CSenCredential*)NULL);
+    
+   __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential, *orgSenCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    
+    senCredential = CSenCredential::NewLC(*orgSenCredential);
+    TL(senCredential != (CSenCredential*)NULL);
+    
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+   
+TInt CSenServDesc::MT_CSenCredential_ValidUntilL( TTestResult& aResult )
+    {
+    SetupL();    
+    RAttributeArray attributes;
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributes);
+    TTime time;
+    _LIT(KTimeString1,"23:34.56");
+    time.Parse(KTimeString1);
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));*/
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));	
+    LOCAL_ASSERT(senCredential->ValidUntil() == time); 
+
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil()); */
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil());	
+
+    //checking xml
+	//_LIT16(KRef, "<text xmlns=\"text\" some valid stuff/>");
+    //_LIT16(KRef, "<text xmlns=\"text\" >");
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*senCredential), KRef);*/
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    delete senCredential;
+    senCredential = NULL;
+    attributes.Reset();
+    attributes.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenCredential_SetValidUntilL( TTestResult& aResult )
+    {
+    return MT_CSenCredential_ValidUntilL(aResult);
+    }
+TInt CSenServDesc::MT_CSenCredential_StartElementLL(TTestResult& aResult)
+	{
+	/*
+	_LIT8(KCredential, "<Credentials CredentialsMaxID=\"1\">
+						<CredentialContainer>
+						<Identifier><garbage>1</garbage><Endpoint>http://10.21.32.20/WSStar/CredMan/WSService.aspx</Endpoint><ProviderID>provider01</ProviderID></Identifier>
+						<Properties>
+						<ServiceInterval>-60540625</ServiceInterval><ValidUntil>2020-06-19T10:28:31.000000Z</ValidUntil>
+						<Created>2007-06-18T10:23:52Z</Created><PhoneTimeWhenMTResolved>2007-06-18T10:24:52.504375Z</PhoneTimeWhenMTResolved>
+						<POP>cnqlXcxDmY4h4tjbgNssLMwhCkOnc+4c</POP>
+						<TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</TokenType>\
+						<BinaryType>simmetric</BinaryType>
+						</Properties></CredentialContainer></Credentials>");
+    */	
+    
+	_LIT8(KCredential, "<Credentials CredentialsMaxID=\"1\">\
+						</Credentials>");
+    					
+	RAttributeArray attributes;
+	CSenCredential* pCredential = CSenCredential::NewL(_L8(""),_L8("Credentials"),_L8("Credentials"),attributes);
+	CleanupStack::PushL(pCredential);
+	CSenXmlReader *pXmlReader = CSenXmlReader::NewL();
+	CleanupStack::PushL(pXmlReader);
+	pCredential->SetReader(*pXmlReader );
+	TRAPD(retVal,pCredential->ParseL(KCredential));
+	CleanupStack::PopAndDestroy(pXmlReader);
+	CleanupStack::PopAndDestroy(pCredential);
+	return retVal;
+	}
+	
+
+TInt CSenServDesc::MT_CSenCredential2_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenCredential2* senCredential = CSenCredential2::NewL();
+    TL(senCredential != (CSenCredential2*)NULL);
+  
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+TInt CSenServDesc::MT_CSenCredential2_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenCredential2* senCredential = CSenCredential2::NewLC();
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+	//CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential2_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential2*)NULL);
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential2_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential2*)NULL);
+
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	//CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+   }
+   
+   
+TInt CSenServDesc::MT_CSenCredential2_NewL_2L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray, bodyElement);
+    TL(senCredential != (CSenCredential2*)NULL);
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    
+    Teardown();
+    return KErrNone;
+	}
+      
+TInt CSenServDesc::MT_CSenCredential2_NewLC_2L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray, bodyElement);
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CSenServDesc::MT_CSenCredential2_NewL_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2  *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewL(*orgSenCredential);
+    
+    
+   __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenCredential2_NewLC_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2 *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewLC(*orgSenCredential);
+    TL(senCredential != (CSenCredential2*)NULL);
+    
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential2_NewL_4L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray, bodyElement, document);
+    TL(senCredential != (CSenCredential2*)NULL);
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    
+    Teardown();
+    return KErrNone;
+	}
+      
+TInt CSenServDesc::MT_CSenCredential2_NewLC_4L( TTestResult& aResult )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray, bodyElement, document);
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CSenServDesc::MT_CSenCredential2_IdL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2 *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewL(*orgSenCredential);
+    senCredential->Id();
+    TL(senCredential != (CSenCredential2*)NULL);
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CSenServDesc::MT_CSenCredential2_ValidUntilL( TTestResult& aResult )
+    {
+    SetupL();    
+    RAttributeArray attributes;
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributes);
+    TTime time;
+    _LIT(KTimeString1,"23:34.56");
+    time.Parse(KTimeString1);
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));*/
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));	
+    LOCAL_ASSERT(senCredential->ValidUntil() == time); 
+
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil()); */
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil());	
+
+    //checking xml
+	//_LIT16(KRef, "<text xmlns=\"text\" some valid stuff/>");
+    //_LIT16(KRef, "<text xmlns=\"text\" >");
+    //_LIT16(KRef, "<text xmlns=\"text\"/>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*senCredential), KRef);*/
+    //TL(ConvertToPtr16LC(*senCredential) == KRef);
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    delete senCredential;
+    senCredential = NULL;
+    attributes.Reset();
+    attributes.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenCredential2_SetValidUntilL( TTestResult& aResult )
+    {
+    return MT_CSenCredential2_ValidUntilL(aResult);
+    }
+
+	
+TInt CSenServDesc::MT_CSenFacet_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenFacet* senFacet = CSenFacet::NewL();
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Facet/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenFacet_NewL_1L(TTestResult& aResult)
+    {
+    SetupL();
+    
+    CSenFacet *senFacet;
+    CSenFacet *senFacetOrg = CSenFacet::NewL();
+    
+    senFacet = CSenFacet::NewL(*senFacetOrg);
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Facet/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    delete senFacetOrg;
+    senFacetOrg = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenFacet_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenFacet* senFacet = CSenFacet::NewL(KText, KText, KText, attributeArray);
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CSenServDesc::MT_CSenFacet_SetNameLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Name() == KNullDesC8))return KErrArgument;
+    
+    senFacet->SetNameL(KText);
+    if(!(senFacet->Name() == KText))return KErrArgument;
+    
+    //checking xml
+    _LIT16(KRef, "<Facet name=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+     if(!(senFacet->Name() == KText))return KErrArgument;
+
+   __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenFacet_SetTypeLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Type() == KNullDesC8))return KErrArgument;
+
+    senFacet->SetTypeL(KText);
+    if(!(senFacet->Type() == KText))return KErrArgument;
+   
+    //checking xml
+    _LIT16(KRef, "<Facet type=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    if(!(senFacet->Type() == KText))return KErrArgument;
+
+    delete senFacet;
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenFacet_SetValueLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Value() == KNullDesC8))return KErrArgument;
+
+    senFacet->SetValueL(KText);
+    if(!(senFacet->Value() == KText))return KErrArgument;
+
+    
+    //checking xml
+    _LIT16(KRef, "<Facet>text</Facet>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    if(!(senFacet->Value() == KText))return KErrArgument;
+
+    delete senFacet;
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenFacet_NameL( TTestResult& aResult )
+    {
+    return MT_CSenFacet_SetNameLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenFacet_TypeL( TTestResult& aResult )
+    {
+    return MT_CSenFacet_SetTypeLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenFacet_ValueL( TTestResult& aResult )
+    {
+    return MT_CSenFacet_SetValueLL(aResult);
+    }
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS(idProvider, (CSenIdentityProvider*)NULL);*/
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+ 	/*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*idProvider), KRef);*/
+ 	TL(ConvertToPtr16LC(*idProvider) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    
+    /*__ASSERT_ALWAYS_NO_LEAVE(delete idProvider);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);	
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewL_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID><ServiceID>text</ServiceID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewLC_3L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    //_LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID><ServiceID>text</ServiceID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_AuthzIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->AuthzID() == KNullDesC8);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->AuthzID());
+    idProvider->SetUserInfoL(KText2, KNullDesC8, KNullDesC8);
+    idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+    
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><AuthzID>text</AuthzID></IdentityProvider>");
+
+    TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<AuthzID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->AuthzID() == KText);
+    
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_AdvisoryAuthnIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->AdvisoryAuthnID() == KNullDesC8);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->AdvisoryAuthnID());
+    idProvider->SetUserInfoL(KNullDesC8, KText2, KNullDesC8);
+    idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8);
+    
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><AdvisoryAuthnID>text</AdvisoryAuthnID></IdentityProvider>");
+
+   // TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<AdvisoryAuthnID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->AdvisoryAuthnID() == KText);
+
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_ProviderIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->ProviderID());
+    TL(idProvider->ProviderID() == KText2);
+
+    delete idProvider;
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_PasswordL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->Password());
+    TL(idProvider->Password() == KNullDesC8);
+
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText2);
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText);
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><Password>text</Password></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+   //CleanupStack::PopAndDestroy();//Ptr
+    TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Password>"));
+    TL(posId != -1);
+   CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->Password() == KText);
+
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IMEIL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->IMEI());
+    idProvider->IMEI();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_UserNameL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->UserName());
+    TL(idProvider->UserName() == KNullDesC8);
+
+    idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8);
+    TL(idProvider->UserName()== KText);
+
+    idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+    TL(idProvider->UserName() == KText);
+
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_SetProviderIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText)); 
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+	TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<ProviderID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_SetServiceIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText)); 
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><ServiceID>text</ServiceID></IdentityProvider>");
+    //TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+	TPtr16 ptr = ConvertToPtr16LC(*idProvider);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<ServiceID>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IsTrustedByLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* serviceDesc = CSenXmlServiceDescription::NewL(KText, KText2) ;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(_L8("endpoint"), _L8("contract"), KText, KText2);
+    retVal = idProvider->IsTrustedByL(*serviceDesc); 
+	
+	if(retVal);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete serviceDesc);
+    serviceDesc = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IsTrustedByL1L( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(_L8("endpoint"), _L8("contract"), KText, KText2);
+    retVal = idProvider->IsTrustedByL(KText); 
+
+    if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CSenServDesc::MT_CSenIdentityProvider_IsDefaultL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    retVal = idProvider->IsDefault(); 
+	
+	if(retVal);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+TInt CSenServDesc::MT_CSenIdentityProvider_HttpCredentialsLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    //retVal = idProvider->HttpCredentialsL(); 
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProvider_NewElementNameL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->NewElementName() == _L8("IdentityProvider"));
+
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->NewElementName());
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewLC();
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL(FALSE);
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    
+    array = CSenIdentityProviderIdArray8::NewL(TRUE);
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+        
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewLC(FALSE);
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    
+    array = CSenIdentityProviderIdArray8::NewLC(TRUE);
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_IsStrictL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    __ASSERT_ALWAYS_NO_LEAVE(array->SetStrict(TRUE));
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(array->SetStrict(FALSE));
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenIdentityProviderIdArray8_SetStrictL( TTestResult& aResult )
+    {
+    return MT_CSenIdentityProviderIdArray8_IsStrictL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC();
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL(KText);
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC(KText);
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL(KText, KText);
+    
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC(KText, KText);
+    
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_MatchesL( TTestResult& aResult )
+    {
+     SetupL();
+    CSenServicePattern *pattern2;
+    CSenServicePattern *pattern;
+    
+    pattern = CSenServicePattern::NewL();
+    //EUNIT_ASSERT_EQUALS(pattern->Matches(*pattern2), FALSE);
+    
+    pattern2 = CSenServicePattern::NewL();
+    //checking xml
+    TL(pattern->Matches(*pattern2) == TRUE);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    pattern2 = NULL;
+    
+    CSenXmlServiceDescription* xmlDescr = CSenXmlServiceDescription::NewL();
+    TL(pattern->Matches(*xmlDescr) == FALSE);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlDescr);
+    xmlDescr = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;    
+    Teardown();
+    return KErrNone;    
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_SetConsumerIapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    
+    TUint32 iap(0);
+    TL(pattern->ConsumerIapId(iap) == KErrNotFound);
+
+    
+    pattern->SetConsumerIapIdL(1);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerIapId(iap));
+    TL(pattern->ConsumerIapId(iap) == KErrNone);
+
+    TL(iap == 1);
+    pattern->SetConsumerIapIdL(2);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerIapId(iap));
+    TL(pattern->ConsumerIapId(iap) == KErrNone);
+
+    TL(iap == 2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerIapIdL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    MT_CSenServicePattern_SetConsumerIapIdLL(aResult);
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServDesc::MT_CSenServicePattern_SetConsumerSnapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    
+    TUint32 iap(0);
+    TL(pattern->ConsumerSnapId(iap) == KErrNotFound);
+
+    
+    pattern->SetConsumerSnapIdL(1);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerSnapId(iap));
+    TL(pattern->ConsumerSnapId(iap) == KErrNone);
+
+    TL(iap == 1);
+
+    pattern->SetConsumerSnapIdL(0);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerSnapId(iap));
+    TL(pattern->ConsumerSnapId(iap) == KErrNotFound);
+
+   // TL(iap == 0);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerSnapIdL( TTestResult& aResult )
+    {
+    
+    SetupL();
+    
+    MT_CSenServicePattern_SetConsumerSnapIdLL(aResult);
+    Teardown();
+    
+    return KErrNone;
+    }
+
+
+TInt CSenServDesc::MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    pattern->AddConsumerIdentityProviderIdL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    array->AppendL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    array->AppendL(KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    
+    TL((pattern->ConsumerIdentityProviderIds8L()).Count() == 2);
+
+    TInt pos(0);
+    if(!((pattern->ConsumerIdentityProviderIds8L()).Find(KText, pos)==KErrNone))return KErrArgument;
+
+    if(!((pattern->ConsumerIdentityProviderIds8L()).Find(KText2, pos)==KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_AddConsumerIdentityProviderIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KNullDesC8) == KErrArgument))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText) == KErrNone))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText2) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerIdentityProviderIds8LL( TTestResult& aResult )
+    {
+    return MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_AcceptsConsumerPolicyL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    pattern->SetConsumerIapIdL(1);
+    array->AppendL(KText);
+    
+    CSenServicePattern* pattern2 = CSenServicePattern::NewL();
+    if(!(pattern2->RebuildFromConsumerPolicy(*pattern)==KErrNone))return KErrArgument;
+
+    if(!(pattern2->AcceptsConsumerPolicy(*pattern)==TRUE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    array = NULL;
+    pattern2 = NULL;
+//false
+    pattern2 = CSenServicePattern::NewL();
+    pattern2->SetConsumerIapIdL(2);
+    if(!(pattern2->AcceptsConsumerPolicy(*pattern)==FALSE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern2 = NULL;
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_RebuildFromConsumerPolicyL( TTestResult& aResult )
+    {
+    return MT_CSenServicePattern_AcceptsConsumerPolicyL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_ConsumerPolicyAsXmlLL( TTestResult& aResult )
+    {
+    SetupL();
+    HBufC8* retVal;
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    
+    retVal = pattern->ConsumerPolicyAsXmlL();
+    
+    if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenServicePattern_StartElementLL( TTestResult& aResult )
+    {
+    SetupL();
+    //HBufC8* retVal;
+    _LIT8(KText, "text");
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    RAttributeArray array;
+    pattern->StartElementL(KText, KText, KText, array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    if(xmlService == NULL)
+     return KErrNoMemory;
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLCL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC();
+    if(xmlService == NULL)
+     return KErrNoMemory;
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+    //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLC_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC(KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+     //checking xml
+    //_LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+     //checking xml
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewLC_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC(KText, KText);
+    if(xmlService == NULL)
+     return KErrNoMemory;
+     //checking xml
+    //_LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetFrameworkIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+
+    TL(xmlService->FrameworkId() == KNullDesC8);
+
+    _LIT8(KFr, "ID-WSF");
+    xmlService->SetFrameworkIdL(KFr);
+    //checking xml
+    _LIT16(KRef1, "<ServiceDescription framework=\"ID-WSF\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef1);
+
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("framework=\"ID-WSF\""));
+	TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->FrameworkId() == KFr);
+
+    //again
+    xmlService->SetFrameworkIdL(KFr);
+    //checking xml
+    //_LIT16(KRef2, "<ServiceDescription framework=\"ID-WSF\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+	TPtr16 ptr1 = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr1);
+	posId = messageToParse.Find(_L("framework=\"ID-WSF\""));
+	TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr1
+    TL(xmlService->FrameworkId() == KFr);
+
+    //again
+    xmlService->SetFrameworkIdL(KText);
+    //checking xml
+    //_LIT16(KRef3, "<ServiceDescription framework=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef3);
+	TPtr16 ptr2 = ConvertToPtr16LC(*xmlService);
+	posId =-1;
+    messageToParse.Set(ptr2);
+    posId = messageToParse.Find(_L("framework=\"text\""));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr2
+    TL(xmlService->FrameworkId() == KText);
+
+    //clear
+    xmlService->SetFrameworkIdL(KNullDesC8);
+    //checking xml
+    //_LIT16(KRef4, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef4);
+	TPtr16 ptr3 = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr3);
+    posId = messageToParse.Find(_L("ServiceDescription"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr3
+    TL(xmlService->FrameworkId() == KNullDesC8);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_NewElementNameL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    _LIT8(KRef, "ServiceDescription");
+    if(!(xmlService ->NewElementName() == KRef))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetIapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TUint32 iap(0);
+    if(!((xmlService ->IapId(iap)) == KErrNotFound))return KErrArgument;
+
+    xmlService ->SetIapIdL(1);
+    if(!(xmlService ->IapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(1))return KErrArgument;
+
+    xmlService ->SetIapIdL(2);
+    if(!(xmlService ->IapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_IapIdL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetIapIdLL(aResult);
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetSnapIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TUint32 iap(0);
+    if(!((xmlService ->SnapId(iap)) == KErrNotFound))return KErrArgument;
+
+    xmlService ->SetSnapIdL(1);
+    if(!(xmlService ->SnapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(1))return KErrArgument;
+
+    xmlService ->SetSnapIdL(2);
+    if(!(xmlService ->SnapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SnapIdL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetSnapIdLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    
+    TPtrC8 ptrText = KText();
+    xmlService->AddIdentityProviderIdL(ptrText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    array->AppendL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    array->AppendL(KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    
+    TL((xmlService->IdentityProviderIds8L()).Count() == 2);
+
+    TInt pos(0);
+    if(!((xmlService->IdentityProviderIds8L()).Find(KText, pos)==KErrNone))return KErrArgument;
+
+    if(!((xmlService->IdentityProviderIds8L()).Find(KText2, pos)==KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AddIdentityProviderIdLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TPtrC8 ptr = KNullDesC8();
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrArgument))return KErrArgument;
+
+    ptr.Set(KText);
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrAlreadyExists))return KErrArgument;
+
+    ptr.Set(KText2);
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument;
+
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy><IdentityProviderIDs><IdentityProviderID>text</IdentityProviderID><IdentityProviderID>text2</IdentityProviderID></IdentityProviderIDs></ProviderPolicy><ServicePolicy/></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_RebuildFromL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    xmlService->SetIapIdL(1);
+    array->AppendL(KText);
+    
+    CSenXmlServiceDescription* xmlService2 = CSenXmlServiceDescription::NewL();
+    if(!(xmlService2->RebuildFrom(*xmlService)==KErrNone))return KErrArgument;
+
+    if(!(xmlService2->Accepts(*xmlService)==TRUE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    array = NULL;
+    xmlService2 = NULL;
+//false
+    xmlService2 = CSenServicePattern::NewL();
+    xmlService2->SetIapIdL(2);
+    if(!(xmlService2->Accepts(*xmlService)==FALSE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService2 = NULL;
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_IdentityProviderIds8LL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AcceptsL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_RebuildFromL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_DescriptionClassTypeL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    if(!(xmlService ->DescriptionClassType() == MSenServiceDescription::EXmlServiceDescription))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_MatchesL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription *xmlService;
+    CSenXmlServiceDescription *xmlService2(NULL);
+    
+    xmlService = CSenXmlServiceDescription::NewL();
+    //EUNIT_ASSERT_EQUALS(xmlService->Matches(*xmlService2), FALSE);
+    
+    xmlService2 = CSenXmlServiceDescription::NewL();
+    //checking xml
+    TL(xmlService ->Matches(*xmlService2) == TRUE);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //EUNIT_ASSERT_EQUALS(xmlService->Matches(*pattern), FALSE);
+    TL(xmlService->Matches(*pattern) == TRUE);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;  
+    Teardown();
+    return KErrNone;
+      
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetProviderIDL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+     
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetProviderIdL(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetProviderIdL(KText)); 
+   
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8("")) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text/></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_1L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText, KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8(""), KText) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text>text</text></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPolicyL_2L( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText, KText, KText, KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8(""), _L8(""), KText, KText) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text text=\"text\">text</text></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ContractL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    xmlService ->SetContractL(KText);
+     //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Contract>text</Contract></ServiceDescription>");
+    
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Contract>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->Contract() == KText);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   
+    //2nd time
+    xmlService ->SetContractL(KText);
+     //checking xml
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+	ptr = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Contract>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->Contract() == KText);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   
+    xmlService ->SetContractL(KText2);
+     //checking xml
+    _LIT16(KRef2, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Contract>text2</Contract></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    TL(xmlService->Contract() == KText2);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+//================Facets
+TInt CSenServDesc::MT_CSenXmlServiceDescription_HasFacetLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_RemoveFacetL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FacetValueL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet* senFacet;
+    senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet->SetValueL(KText2);
+    
+
+    xmlService->AddFacetL(*senFacet);
+    TPtrC8 ptr=KText();
+    HBufC8* valueTo = NULL;
+    
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNone))return KErrArgument;
+
+    TL(*valueTo == KText2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete valueTo );
+    valueTo = NULL;
+    
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNone))return KErrArgument;
+
+    TL(*valueTo == KText2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete valueTo );
+    valueTo = NULL;
+    
+    ptr.Set(KText2);
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNotFound))return KErrArgument;
+
+     __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AddFacetLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet *senFacet;
+    CSenFacet *senFacet2;
+    
+    senFacet = CSenFacet::NewL();
+    senFacet2 = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet2->SetNameL(KText2);
+    RFacetArray array;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet2) == KErrNone))return KErrArgument;
+
+    //_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Facet name=\"text\"/><Facet name=\"text2\"/></ServiceDescription>");
+    //TPtrC16 ptrRef = KRef();
+    //TL(ConvertToPtr16LC(*xmlService) == ptrRef);
+
+    //CleanupStack::PopAndDestroy();//Ptr
+   	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Facet name=\"text\"/><Facet name=\"text2\"/>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet2);
+    senFacet2 = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetFacetLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet* senFacet;
+    senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet->SetValueL(KText);
+    
+    RFacetArray array;
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    senFacet->SetValueL(KText2);
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Facet name=\"text\">text2</Facet></ServiceDescription>");
+    //TPtrC16 ptrRef = KRef();
+    //TL(ConvertToPtr16LC(*xmlService) == ptrRef);
+    
+    //CleanupStack::PopAndDestroy();//Ptr
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	 TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Facet name=\"text\">text2</Facet>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_RemoveFacetL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet *senFacet;
+    CSenFacet *senFacet2;
+    
+    senFacet = CSenFacet::NewL();
+    senFacet2 = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet2->SetNameL(KText2);
+    RFacetArray array;
+
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet2) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 2))return KErrArgument;
+
+    array.ResetAndDestroy();
+//removing, haFacet
+    TBool has(FALSE);
+    if(!(xmlService->HasFacetL(KText, has) == KErrNone))return KErrArgument;
+
+    if(!(has == TRUE))return KErrArgument;
+
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == TRUE))return KErrArgument;
+
+    if(!(xmlService->RemoveFacet(KText2) == KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->RemoveFacet(KText2));
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == FALSE))return KErrArgument;
+
+    if(!(xmlService->RemoveFacet(KText2) == KErrNotFound))return KErrArgument;
+
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == FALSE))return KErrArgument;
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet2);
+    senFacet2 = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FacetsLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_AddFacetLL(aResult);
+    }
+//------------end facet
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AsXmlLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    HBufC8* xmlBuffer = xmlService->AsXmlL();
+    CleanupStack::PushL( xmlBuffer );
+    TPtr8 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    _LIT8(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/
+    //TL(ptr == KRef);
+    TInt posId(-1);
+    TPtrC8 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L8("<facet>"));
+    TL(posId == -1);
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_WriteAsXMLToLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    CleanupStack::PushL(xmlService);
+    xmlService->WriteAsXMLToL(ElemntStream);
+    
+    CleanupStack::PopAndDestroy(xmlService);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone ;
+    }
+
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_CredentialsL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->Credentials();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_AsXmlUnicodeLL( TTestResult& aResult )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    HBufC* xmlBuffer = xmlService->AsXmlUnicodeL();
+    CleanupStack::PushL( xmlBuffer );
+    TPtr ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    _LIT(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/
+    TL(ptr == KRef);
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetFrameworkIdL(KText);
+    CSenXmlServiceDescription* xmlService1= CSenXmlServiceDescription::NewL();
+    
+    retVal = xmlService->HasEqualPrimaryKeysL(*xmlService);
+    //TL(retVal == ETrue)
+	if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService1);
+    xmlService1 = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_IsLocalLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    retVal = xmlService->IsLocalL();
+    //TL(retVal == ETrue)
+	if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetTransportCueLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    retVal = xmlService->SetTransportCueL(KText);
+    if(!(retVal == 0)) return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_TransportCueL( TTestResult& aResult )
+    {
+    SetupL();
+    //TBool retVal;
+    //HBufC8* xmlBuffer;
+    //TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetTransportCueL(KText);
+    xmlService->TransportCue();
+    //ptr = xmBuffer.Desc(;)
+    //TL(ptr == KText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+/*    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ServicePolicyL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;
+    CServicePolicy* policy = CSenServicePolicy::NewL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    policy = (CServicePolicy)xmlService->ServicePolicyL();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+*/    
+    
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ProviderIdL( TTestResult& aResult )
+    {
+    SetupL();
+    //TBool retVal;
+    //TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->ProviderId();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetPromptUserInfoLL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool var = ETrue;
+    TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetPromptUserInfoL(var);
+		
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_PromptUserInfoL( TTestResult& aResult )
+    {
+    SetupL();
+    TBool retVal;;
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    retVal = xmlService->PromptUserInfo();
+	
+	if(retVal);
+		
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+TInt CSenServDesc::MT_CSenXmlServiceDescription_StartEndElementLL(TTestResult& aResult)
+	{
+/*_LIT8(KServiceDescription, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">&ltContent2&quot&gt</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+*/	
+
+
+_LIT8(KServiceDescription, "<ServiceDescription framework=\"WS-STAR\">\
+		<Contract>urn:wstar:sts</Contract>\
+		<Endpoint>http://10.21.32.20/WSStar/BgRsp/STS.aspx</Endpoint>\
+		<ProviderID>provider01</ProviderID>\
+		</ServiceDescription>");		
+/*
+	_LIT8(KServiceDescription, "<ServiceDescription framework=\"WS-STAR\">
+		<Contract>urn:wstar:sts</Contract>
+		<Endpoint>http://10.21.32.20/WSStar/BgRsp/STS.aspx</Endpoint>
+		<ProviderID>provider01</ProviderID>
+		<ProviderPolicy>
+       <Transport>
+           <IapId>
+               1234567890
+           </IapId>
+       </Transport>
+       <IdentityProviderIDs strict=\"true\">
+           <IdentityProviderID>
+             urn:first.id.example.com
+           </IdentityProviderID>
+           <IdentityProviderID>
+             urn:second.id.example.com
+           </IdentityProviderID>
+       </IdentityProviderIDs>
+   		</ProviderPolicy>
+		<Credentials CredentialsMaxID=\"1\">
+						<CredentialContainer>
+						<Identifier><garbage>1</garbage><Endpoint>http://10.21.32.20/WSStar/CredMan/WSService.aspx</Endpoint><ProviderID>provider01</ProviderID></Identifier>
+						<Properties>
+						<ServiceInterval>-60540625</ServiceInterval><ValidUntil>2020-06-19T10:28:31.000000Z</ValidUntil>
+						<Created>2007-06-18T10:23:52Z</Created><PhoneTimeWhenMTResolved>2007-06-18T10:24:52.504375Z</PhoneTimeWhenMTResolved>
+						<POP>cnqlXcxDmY4h4tjbgNssLMwhCkOnc+4c</POP>
+						<TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</TokenType>\
+						<BinaryType>simmetric</BinaryType>
+						</Properties></CredentialContainer></Credentials>
+		</ServiceDescription>");*/
+
+	CSenXmlServiceDescription* pDescription = CSenXmlServiceDescription::NewL(_L8("ServiceDescription"));
+	CleanupStack::PushL(pDescription);
+	CSenXmlReader *pXmlReader = CSenXmlReader::NewL();
+	CleanupStack::PushL(pXmlReader);
+	pDescription->SetReader(*pXmlReader );
+	TRAPD(retVal,pDescription->ParseL(KServiceDescription));
+	CleanupStack::PopAndDestroy(pXmlReader);
+	CleanupStack::PopAndDestroy(pDescription);
+	return retVal;
+	}
+
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_ScoreMatchLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription *xmlService;
+    CSenXmlServiceDescription *xmlService2;
+    
+    xmlService = CSenXmlServiceDescription::NewL();
+    xmlService2 = CSenXmlServiceDescription::NewL();
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 0))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText, KText2);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText2, KText);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 0))return KErrArgument;
+
+   __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText2, KText);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+    CSenFacet* senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    xmlService->AddFacetL(*senFacet);
+    xmlService2->AddFacetL(*senFacet);
+    
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_EndpointL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    
+    xmlService ->SetEndPointL(KText);
+     //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Endpoint>text</Endpoint></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    TL(xmlService->Endpoint() == KText);
+	TPtr16 ptr = ConvertToPtr16LC(*xmlService);
+	TInt posId(-1);
+    TPtrC16 messageToParse;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Endpoint>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    //2nd time
+    xmlService ->SetEndPointL(KText);
+     //checking xml
+    //TL(ConvertToPtr16LC(*xmlService) == KRef);
+	ptr = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Endpoint>"));
+    TL(posId != -1);
+    TL(xmlService->Endpoint() == KText);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+
+    xmlService ->SetEndPointL(KText2);
+     //checking xml
+    _LIT16(KRef2, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Endpoint>text2</Endpoint></ServiceDescription>");
+    //TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    TL(xmlService->Endpoint() == KText2);
+	ptr = ConvertToPtr16LC(*xmlService);
+	posId = -1;
+    messageToParse.Set(ptr);
+    posId = messageToParse.Find(_L("<Endpoint>"));
+    TL(posId != -1);
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FrameworkIdL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_SetFrameworkIdLL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_FrameworkVersionL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService ->FrameworkVersion());
+    if(!(xmlService ->FrameworkVersion() == KNullDesC8))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetContractLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_ContractL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetEndPointLL( TTestResult& aResult )
+    {
+    return MT_CSenXmlServiceDescription_EndpointL(aResult);
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_SetAttributesLL( TTestResult& aResult )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    RAttributeArray attributeArray;
+    xmlService->SetAttributesL(attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServDesc::MT_CSenXmlServiceDescription_CopyFromLL( TTestResult& aResult )
+    {
+    SetupL();
+    _LIT8(KContent, "content");
+    _LIT8(KFacet, "Facet");
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    TL(senFacet != (CSenFacet*)NULL);
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+    
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);    
+    
+    CSenXmlElement* xmlElem = CSenXmlElement::NewL(KText, KText, KText);
+    CSenXmlElement* xmlElem2 = CSenXmlElement::NewL(KText2);
+    xmlElem->AddElementL(*xmlElem2);
+    TL (xmlElem->SetContentL(KContent) == KContent);
+    xmlElem->SetAttributesL(attrArray);
+    
+    senFacet->CopyFromL(*xmlElem);
+    
+    TL (senFacet->LocalName() == KFacet);
+    TL (senFacet->NamespaceURI() == KNullDesC8);
+    TL (senFacet->NsPrefix() == KNullDesC8);
+    TL (senFacet->Content() == KContent);
+    RPointerArray<CSenElement>& xmlElemList = senFacet->ElementsL();
+    TL (xmlElemList.Count() == 1);
+    RPointerArray<CSenBaseAttribute>& xmlElemAttrList = senFacet->AttributesL();
+    TL (xmlElemAttrList.Count() == 1);    
+    
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlElem);
+    xmlElem = NULL;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    
+    Teardown();    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// ?classname::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?classname::?member_function(
+   ?arg_type arg,
+   ?arg_type arg )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ?function_name implements...
+// ?implementation_description.
+// Returns: ?value_1: ?description
+//          ?value_n: ?description
+//                    ?description
+// -----------------------------------------------------------------------------
+//
+/*
+?type  ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg )  // ?description
+    {
+
+    ?code
+
+    }
+*/
+//  End of File
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/Bmarm/senservdescTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/Bwins/senservdescTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/conf/senservdescTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,847 @@
+[Test]
+title NewL-CSenCredential
+create senservdescTester obj 
+obj NewL-CSenCredential 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential
+create senservdescTester obj 
+obj NewLC-CSenCredential 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential_baseElement
+create senservdescTester obj 
+obj NewL-CSenCredential_baseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential_baseElement
+create senservdescTester obj 
+obj NewLC-CSenCredential_baseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential_copy
+create senservdescTester obj 
+obj NewL-CSenCredential_copy 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential_copy
+create senservdescTester obj 
+obj NewLC-CSenCredential_copy 
+delete obj 
+[Endtest] 
+
+[Test]
+title ValidUntil-CSenCredential_ValidUntil
+create senservdescTester obj 
+obj ValidUntil-CSenCredential_ValidUntil 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetValidUntil-CSenCredential_SetValidUntil
+create senservdescTester obj 
+obj SetValidUntil-CSenCredential_SetValidUntil 
+delete obj 
+[Endtest] 
+
+[Test]
+title StartElement-CSenCredential_StartElement
+create senservdescTester obj 
+obj StartElement-CSenCredential_StartElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential2
+create senservdescTester obj 
+obj NewL-CSenCredential2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential2
+create senservdescTester obj 
+obj NewLC-CSenCredential2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential2 baseElement
+create senservdescTester obj 
+obj NewL-CSenCredential2 baseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential2 baseElement
+create senservdescTester obj 
+obj NewLC-CSenCredential2 baseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential2 
+create senservdescTester obj 
+obj NewL-CSenCredential2  
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential2 
+create senservdescTester obj 
+obj NewLC-CSenCredential2  
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential2_copy
+create senservdescTester obj 
+obj NewL-CSenCredential2_copy 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential2_copy
+create senservdescTester obj 
+obj NewLC-CSenCredential2_copy 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenCredential2_document
+create senservdescTester obj 
+obj NewL-CSenCredential2_document 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenCredential2_document
+create senservdescTester obj 
+obj NewLC-CSenCredential2_document 
+delete obj 
+[Endtest] 
+
+[Test]
+title Id-CSenCredential2_Id
+create senservdescTester obj 
+obj Id-CSenCredential2_Id 
+delete obj 
+[Endtest] 
+
+[Test]
+title ValidUntil-CSenCredential2_ValidUntil
+create senservdescTester obj 
+obj ValidUntil-CSenCredential2_ValidUntil 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetValidUntil-CSenCredential2_SetValidUntil
+create senservdescTester obj 
+obj SetValidUntil-CSenCredential2_SetValidUntil 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenFacet
+create senservdescTester obj 
+obj NewL-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenFacet copy
+create senservdescTester obj 
+obj NewL-CSenFacet copy 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenFacet attribute
+create senservdescTester obj 
+obj NewL-CSenFacet attribute 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNameL-CSenFacet
+create senservdescTester obj 
+obj SetNameL-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetTypeL-CSenFacet
+create senservdescTester obj 
+obj SetTypeL-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetValueL-CSenFacet
+create senservdescTester obj 
+obj SetValueL-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title Name-CSenFacet
+create senservdescTester obj 
+obj Name-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title Type-CSenFacet
+create senservdescTester obj 
+obj Type-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title Value-CSenFacet
+create senservdescTester obj 
+obj Value-CSenFacet 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-Endpoint
+create senservdescTester obj 
+obj NewL-Endpoint 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-Endpoint
+create senservdescTester obj 
+obj NewLC-Endpoint 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-Enpoint_+_Contract
+create senservdescTester obj 
+obj NewL-Enpoint_+_Contract 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-Enpoint_+_Contract
+create senservdescTester obj 
+obj NewLC-Enpoint_+_Contract 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-Provider_+_Contract_+_Endpoint
+create senservdescTester obj 
+obj NewL-Provider_+_Contract_+_Endpoint 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-Provider_+_Contract_+_Endpoint
+create senservdescTester obj 
+obj NewLC-Provider_+_Contract_+_Endpoint 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-ServiceID_+_Provider_+_Contract_+_Endpoint
+create senservdescTester obj 
+obj NewL-ServiceID_+_Provider_+_Contract_+_Endpoint 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-ServiceID_+_Provider_+_Contract_+_Endpoint
+create senservdescTester obj 
+obj NewLC-ServiceID_+_Provider_+_Contract_+_Endpoint 
+delete obj 
+[Endtest] 
+
+[Test]
+title AuthzID-IdentityProvider
+create senservdescTester obj 
+obj AuthzID-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title AdvisoryAuthnID-IdentityProvider
+create senservdescTester obj 
+obj AdvisoryAuthnID-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title ProviderID-IdentityProvider
+create senservdescTester obj 
+obj ProviderID-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title Password-IdentityProvider
+create senservdescTester obj 
+obj Password-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title IMEI-IdentityProvider
+create senservdescTester obj 
+obj IMEI-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title UserName-IdentityProvider
+create senservdescTester obj 
+obj UserName-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetProviderID-IdentityProvider
+create senservdescTester obj 
+obj SetProviderID-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetServiceID-IdentityProvider
+create senservdescTester obj 
+obj SetServiceID-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsTrustedByL-IdentityProvider
+create senservdescTester obj 
+obj IsTrustedByL-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsTrustedByL1-IdentityProvider
+create senservdescTester obj 
+obj IsTrustedByL1-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title HttpCredentialsL-IdentityProvider
+create senservdescTester obj 
+obj HttpCredentialsL-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsDefault-IdentityProvider
+create senservdescTester obj 
+obj IsDefault-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewElementName-IdentityProvider
+create senservdescTester obj 
+obj NewElementName-IdentityProvider 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenIdentityProviderIdArray8
+create senservdescTester obj 
+obj NewL-CSenIdentityProviderIdArray8 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenIdentityProviderIdArray8
+create senservdescTester obj 
+obj NewLC-CSenIdentityProviderIdArray8 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenIdentityProviderIdArray8
+create senservdescTester obj 
+obj NewL-CSenIdentityProviderIdArray8 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenIdentityProviderIdArray8
+create senservdescTester obj 
+obj NewLC-CSenIdentityProviderIdArray8 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsStrict-CSenIdentityProviderIdArray8
+create senservdescTester obj 
+obj IsStrict-CSenIdentityProviderIdArray8 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetStrict-CSenIdentityProviderIdArray8
+create senservdescTester obj 
+obj SetStrict-CSenIdentityProviderIdArray8 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenServicePattern
+create senservdescTester obj 
+obj NewL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenServicePattern
+create senservdescTester obj 
+obj NewLC-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenServicePattern
+create senservdescTester obj 
+obj NewL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenServicePattern
+create senservdescTester obj 
+obj NewLC-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenServicePattern
+create senservdescTester obj 
+obj NewL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenServicePattern
+create senservdescTester obj 
+obj NewLC-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title MatchesL-CSenServicePattern
+create senservdescTester obj 
+obj MatchesL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetConsumerIapIdL-CSenServicePattern
+create senservdescTester obj 
+obj SetConsumerIapIdL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsumerIapId-CSenServicePattern
+create senservdescTester obj 
+obj ConsumerIapId-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetConsumerIdentityProviderIdsL-CSenServicePattern
+create senservdescTester obj 
+obj SetConsumerIdentityProviderIdsL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsumerPolicyAsXmlL-CSenServicePattern
+create senservdescTester obj 
+obj ConsumerPolicyAsXmlL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title StartElementL-CSenServicePattern
+create senservdescTester obj 
+obj StartElementL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddConsumerIdentityProviderIdL-CSenServicePattern
+create senservdescTester obj 
+obj AddConsumerIdentityProviderIdL-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsumerIdentityProviderIds8L-CSenServicePattern
+create senservdescTester obj 
+obj ConsumerIdentityProviderIds8L-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title AcceptsConsumerPolicy-CSenServicePattern
+create senservdescTester obj 
+obj AcceptsConsumerPolicy-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title RebuildFromConsumerPolicy-CSenServicePattern
+create senservdescTester obj 
+obj RebuildFromConsumerPolicy-CSenServicePattern 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewLC-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewLC-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewLC-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetFrameworkIdL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetFrameworkIdL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewElementName-CSenXmlServiceDescription
+create senservdescTester obj 
+obj NewElementName-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetIapIdL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetIapIdL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title IapId-CSenXmlServiceDescription
+create senservdescTester obj 
+obj IapId-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetIdentityProviderIdsL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetIdentityProviderIdsL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddIdentityProviderIdL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj AddIdentityProviderIdL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title RebuildFrom-CSenXmlServiceDescription
+create senservdescTester obj 
+obj RebuildFrom-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title IdentityProviderIds8L-CSenXmlServiceDescription
+create senservdescTester obj 
+obj IdentityProviderIds8L-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title Accepts-CSenXmlServiceDescription
+create senservdescTester obj 
+obj Accepts-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title DescriptionClassType-CSenXmlServiceDescription
+create senservdescTester obj 
+obj DescriptionClassType-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title MatchesL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj MatchesL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetProviderIDL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetProviderIDL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPolicyLL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetPolicyLL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPolicyL_1L-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetPolicyL_1L-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPolicyL_2L-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetPolicyL_2L-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title Contract-CSenXmlServiceDescription
+create senservdescTester obj 
+obj Contract-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasFacetL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj HasFacetL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title FacetValue-CSenXmlServiceDescription
+create senservdescTester obj 
+obj FacetValue-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddFacetL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj AddFacetL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetFacetL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetFacetL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveFacet-CSenXmlServiceDescription
+create senservdescTester obj 
+obj RemoveFacet-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title FacetsL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj FacetsL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title ScoreMatchL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj ScoreMatchL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title Endpoint-CSenXmlServiceDescription
+create senservdescTester obj 
+obj Endpoint-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title FrameworkId-CSenXmlServiceDescription
+create senservdescTester obj 
+obj FrameworkId-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title FrameworkVersion-CSenXmlServiceDescription
+create senservdescTester obj 
+obj FrameworkVersion-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContractL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetContractL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetEndPointL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetEndPointL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetAttributesL-CSenXmlServiceDescription
+create senservdescTester obj 
+obj SetAttributesL-CSenXmlServiceDescription 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj AsXmlL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title WriteAsXMLToL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj WriteAsXMLToL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlUnicodeL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj AsXmlUnicodeL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title Credentials-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj Credentials-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title HasEqualPrimaryKeysL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj HasEqualPrimaryKeysL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title IsLocalL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj IsLocalL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title SetTransportCueL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj SetTransportCueL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title TransportCue-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj TransportCue-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title ProviderId-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj ProviderId-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPromptUserInfoL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj SetPromptUserInfoL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title PromptUserInfo-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj PromptUserInfo-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
+[Test]
+title StartElementL-CSenXmlServiceDescription 
+create senservdescTester obj 
+obj StartElementL-CSenXmlServiceDescription  
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/eabi/senservdescTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senservdesctester
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+senservdescTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for sensrvdesctester 
+*
+*/
+
+
+
+
+
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          senservdescTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         senservdescTester.def
+
+SYSTEMINCLUDE   /epoc32/include 
+MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          senservdescTester.cpp
+SOURCE          senservdescTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+
+LIBRARY                 bafl.lib
+LIBRARY         		charconv.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenMessages.lib
+LIBRARY                 SenFragment.lib
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LIBRARY                 XMLFRAMEWORK.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\senservdescTester.dll"   -   "c:\Sys\Bin\senservdescTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\senservdescTester.cfg"-"c:\testing\conf\senservdescTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/inc/TestServiceDescription.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef TESTSERVICEDESCRIPTION_H
+#define TESTSERVICEDESCRIPTION_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenXmlServiceDescription.h"
+#include "SenCredential.h"
+#include "SenServicePattern.h"
+
+
+class CTestServiceDescription :public CSenXmlServiceDescription
+{
+public:    
+    static CTestServiceDescription* NewL();
+    static CTestServiceDescription* NewLC();
+    IMPORT_C void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+                                            
+	IMPORT_C void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                      		const TDesC8& aQName);                                            
+
+
+};
+
+
+
+class CTestCredential :public CSenCredential
+{
+public:    
+    static CTestCredential* NewL();
+    static CTestCredential* NewLC();
+    IMPORT_C  void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttributes);
+
+    
+
+
+};
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/inc/senservdescTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,455 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENSERVDESCTESTER_H
+#define SENSERVDESCTESTER_H
+
+//  INCLUDES
+#include <StifTestModule.h>
+#include <StifLogger.h>
+#include "TestServiceDescription.h"
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+#include <TestScripterInternal.h>
+#include <SenCredential.h>
+#include <SenCredential2.h>
+#include <RSenDocument.h>
+#include <SenDomFragment.h>
+#include <SenFacet.h>
+#include <SenIdentityProvider.h>
+#include <SenIdentityProviderIdArray8.h>
+#include <SenNameSpace.h>
+#include <SenServicePattern.h>
+#include <SenSoapEnvelope.h>
+#include <SenXmlReader.h>
+#include <SenXmlServiceDescription.h>
+#include <MSenIdentityProviderIdArray.h>
+#include <SenDateUtils.h>
+#include <SenXmlUtils.h>
+#include <SenXmlConstants.h>
+#include <e32debug.h>
+#include <TestclassAssert.h>
+class CSenConsumerPolicy;
+class CSenBaseElement;
+class CSenBaseFragment;
+class CSenIdentityProvider;
+class CSenIdentityProviderIdArray8;
+class CSenSoapEnvelope;
+class CSenPolicy;
+class CSenCredential;
+class CSenCredential2;
+
+class CSenBaseAttribute;
+class CSenServicePattern;
+class CSenDomFragment;
+class CSenNamespace;
+class CSenFacet;
+class MSenIdentityProviderIdArray;
+class CSenXmlReader;
+class CSenXmlServiceDescription;
+class CSenProviderPolicy;
+class SenXmlUtils;
+class SenDateUtils;
+class TXmlEngElement;
+class RSenDocument;
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+namespace{
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+    _LIT8(KXmlSpecific, "\"&<>");
+}
+
+// Logging path
+_LIT( KsenservdescTesterLogPath, "\\logs\\testframework\\senservdescTester\\" ); 
+// Log file
+_LIT( KsenservdescTesterLogFile, "senservdescTester.txt" ); 
+_LIT( KsenservdescTesterLogFileWithTitle, "senservdescTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CsenservdescTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+typedef TInt (CsenservdescTester::* TestFunction)(CStifItemParser&);
+
+// CLASS DECLARATION
+
+/**
+*  CsenservdescTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+NONSHARABLE_CLASS(CsenservdescTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CsenservdescTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CsenservdescTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CsenservdescTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+     private:    // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         
+         TPtr16 ConvertToPtr16LC(CSenBaseFragment &fragment);
+         TPtr16 ConvertToPtr16LC(CSenBaseElement &element);
+                 
+         TInt MT_CSenConsumerPolicy_NewLL( CStifItemParser& aItem );
+         TInt MT_CSenConsumerPolicy_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenConsumerPolicy_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenConsumerPolicy_NewLC_1L(CStifItemParser& aItem);
+         void MT_CSenConsumerPolicy_RebuildFromL();
+         void MT_CSenConsumerPolicy_AcceptsL();
+
+         TInt MT_CSenCredential_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenCredential_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenCredential_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenCredential_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenCredential_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenCredential_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenCredential_IdL(CStifItemParser& aItem);
+         TInt MT_CSenCredential_ValidUntilL(CStifItemParser& aItem);
+         TInt MT_CSenCredential_SetValidUntilL(CStifItemParser& aItem);
+         TInt MT_CSenCredential_StartElementLL(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewL_3L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewLC_3L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewL_4L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_NewLC_4L(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_IdL(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_ValidUntilL(CStifItemParser& aItem);
+         TInt MT_CSenCredential2_SetValidUntilL(CStifItemParser& aItem);
+         
+         TInt MT_CSenFacet_NewLL( CStifItemParser& aItem );
+         TInt MT_CSenFacet_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenFacet_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenFacet_SetNameLL( CStifItemParser& aItem );
+         TInt MT_CSenFacet_SetTypeLL(CStifItemParser& aItem);
+         TInt MT_CSenFacet_SetValueLL(CStifItemParser& aItem);
+         TInt MT_CSenFacet_NameL(CStifItemParser& aItem);
+         TInt MT_CSenFacet_TypeL(CStifItemParser& aItem);
+         TInt MT_CSenFacet_ValueL(CStifItemParser& aItem);
+
+         TInt MT_CSenIdentityProvider_NewL_L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewLCL( CStifItemParser& aItem );
+         TInt MT_CSenIdentityProvider_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewL_3L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewLC_3L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_AuthzIDL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_AdvisoryAuthnIDL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_ProviderIDL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_PasswordL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_IMEIL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_UserNameL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_SetProviderIDL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_SetServiceIDL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_IsTrustedByLL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_IsTrustedByL1L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_IsDefaultL(CStifItemParser& aItem);
+         void MT_CSenIdentityProvider_SetUserInfoLL();
+         TInt MT_CSenIdentityProvider_HttpCredentialsLL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProvider_NewElementNameL(CStifItemParser& aItem);
+
+         TInt MT_CSenIdentityProviderIdArray8_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProviderIdArray8_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProviderIdArray8_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProviderIdArray8_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProviderIdArray8_IsStrictL(CStifItemParser& aItem);
+         TInt MT_CSenIdentityProviderIdArray8_SetStrictL(CStifItemParser& aItem);
+
+         void MT_CSenPolicy_NewLL();
+         void MT_CSenPolicy_NewLCL();
+         void MT_CSenPolicy_NewL_1L();
+         void MT_CSenPolicy_NewLC_1L();
+         void MT_CSenPolicy_SetIapIdLL();
+         void MT_CSenPolicy_IapIdL();
+         void MT_CSenPolicy_SetIdentityProviderIdsLL( CStifItemParser& aItem );
+         void MT_CSenPolicy_AddIdentityProviderIdLL( CStifItemParser& aItem );
+         void MT_CSenPolicy_RebuildFromL();
+         void MT_CSenPolicy_IdentityProviderIds8LL();
+         void MT_CSenPolicy_AcceptsL();
+
+         void MT_CSenProviderPolicy_NewLL();
+         void MT_CSenProviderPolicy_NewLCL();
+         void MT_CSenProviderPolicy_NewL_1L();
+         void MT_CSenProviderPolicy_NewLC_1L();
+         void MT_CSenProviderPolicy_AcceptsL();
+         void MT_CSenProviderPolicy_RebuildFromL();
+
+         TInt MT_CSenServicePattern_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_ConsumerPolicyAsXmlLL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_MatchesL(CStifItemParser& aItem);
+//         void MT_CSenServicePattern_StartElementLL();//need parsing some xml file
+         TInt MT_CSenServicePattern_SetConsumerIapIdLL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_ConsumerIapIdL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_AddConsumerIdentityProviderIdLL(CStifItemParser& aItem);
+         //TInt MT_CSenServicePattern_ConsumerPolicyAsXmlLL(CStifItemParser& aItem);
+         
+         TInt MT_CSenServicePattern_ConsumerIdentityProviderIds8LL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_AcceptsConsumerPolicyL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_RebuildFromConsumerPolicyL(CStifItemParser& aItem);
+         TInt MT_CSenServicePattern_StartElementLL(CStifItemParser& aItem);
+
+
+         TInt MT_CSenXmlServiceDescription_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetFrameworkIdLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_NewElementNameL(CStifItemParser& aItem);
+//         void MT_CSenXmlServiceDescription_CredentialsL();//need parsing some xml file
+         TInt MT_CSenXmlServiceDescription_SetIapIdLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_IapIdL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_AddIdentityProviderIdLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_RebuildFromL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_IdentityProviderIds8LL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_AcceptsL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_DescriptionClassTypeL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_MatchesL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetProviderIDL( CStifItemParser& aItem ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyLL( CStifItemParser& aItem ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyL_1L( CStifItemParser& aItem ) ;
+         TInt MT_CSenXmlServiceDescription_SetPolicyL_2L( CStifItemParser& aItem ) ;
+         TInt MT_CSenXmlServiceDescription_ContractL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_HasFacetLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_FacetValueL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_AddFacetLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetFacetLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_RemoveFacetL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_FacetsLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_ScoreMatchLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_EndpointL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_FrameworkIdL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_FrameworkVersionL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetContractLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetEndPointLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_AsXmlLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_WriteAsXMLToLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetAttributesLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_CredentialsL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_AsXmlUnicodeLL(CStifItemParser& aItem);
+         
+         
+         TInt MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_IsLocalLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetTransportCueLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_TransportCueL(CStifItemParser& aItem);
+         //TInt MT_CSenXmlServiceDescription_ServicePolicyL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_ProviderIdL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_SetPromptUserInfoLL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_PromptUserInfoL(CStifItemParser& aItem);
+         TInt MT_CSenXmlServiceDescription_StartEndElementLL(CStifItemParser& aItem);
+         
+//         void MT_CSenXmlServiceDescription_ResumeParsingFromLL();//need parsing some xml file
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENSERVDESCTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\senservdescTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/src/TestServiceDescription.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include "TestServiceDescription.h"
+
+
+//TestServiceDescription//
+
+CTestServiceDescription* CTestServiceDescription::NewL()
+{
+     return((CTestServiceDescription*)CSenXmlServiceDescription::NewL());
+}
+CTestServiceDescription* CTestServiceDescription::NewLC()
+{
+     return((CTestServiceDescription*)CSenXmlServiceDescription::NewLC());
+  
+}
+
+EXPORT_C void CTestServiceDescription::StartElementL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aQName,
+                                                       const RAttributeArray& aAttributes)
+{
+		 
+	return(CSenXmlServiceDescription::StartElementL(aNsUri,aLocalName,aQName,aAttributes));
+    
+}
+
+EXPORT_C void CTestServiceDescription::EndElementL(const TDesC8& aNsUri,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aQName )
+{
+	
+	return(CSenXmlServiceDescription::EndElementL(aNsUri,aLocalName,aQName ));
+    
+}
+
+
+///Credential///
+
+CTestCredential* CTestCredential::NewL()
+{
+	_LIT8(KText, "text");
+	RAttributeArray array;
+    return((CTestCredential*)CSenCredential::NewL(KText, KText, KText, array));
+}
+
+
+CTestCredential* CTestCredential::NewLC()
+{
+	_LIT8(KText, "text");
+	RAttributeArray array;
+    return((CTestCredential*)CSenCredential::NewLC(KText, KText, KText, array));
+  
+}
+
+
+
+
+EXPORT_C void CTestCredential::StartElementL(const TDesC8& aNsUri,
+    											const TDesC8& aLocalName,
+    											const TDesC8& aQName,
+    											const RAttributeArray& aAttributes)
+{
+	return(CSenCredential::StartElementL(aNsUri,aLocalName,aQName,aAttributes));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/src/senservdescTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senservdescTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::CsenservdescTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CsenservdescTester::CsenservdescTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CsenservdescTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KsenservdescTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KsenservdescTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KsenservdescTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CsenservdescTester* CsenservdescTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CsenservdescTester* self = new (ELeave) CsenservdescTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CsenservdescTester::~CsenservdescTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CsenservdescTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CsenservdescTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("senservdescTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CsenservdescTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/src/senservdescTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2841 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// [INCLUDE FILES]-do not remove
+#include <e32math.h>
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "senservdescTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CsenservdescTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CsenservdescTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+  //      FUNCENTRY( CsenservdescTester::PrintTest ),
+        //ENTRY( "Loop test", CsenservdescTester::LoopTest ),
+		ENTRY("NewL-CSenCredential",  CsenservdescTester::MT_CSenCredential_NewLL),
+		ENTRY("NewLC-CSenCredential",  CsenservdescTester::MT_CSenCredential_NewLCL),
+		ENTRY("NewL-CSenCredential_baseElement",  CsenservdescTester::MT_CSenCredential_NewL_1L),
+		ENTRY("NewLC-CSenCredential_baseElement",  CsenservdescTester::MT_CSenCredential_NewLC_1L),
+		ENTRY("NewL-CSenCredential_copy",  CsenservdescTester::MT_CSenCredential_NewL_2L),
+		ENTRY("NewLC-CSenCredential_copy",  CsenservdescTester::MT_CSenCredential_NewLC_2L),
+		ENTRY("ValidUntil-CSenCredential_ValidUntil",  CsenservdescTester::MT_CSenCredential_ValidUntilL),
+		ENTRY("SetValidUntil-CSenCredential_SetValidUntil",  CsenservdescTester::MT_CSenCredential_SetValidUntilL),
+		//ENTRY("NewLC-CSenCredential_Id",  CsenservdescTester::MT_CSenCredential_IdL),
+		ENTRY("StartElement-CSenCredential_StartElement",  CsenservdescTester::MT_CSenCredential_StartElementLL),
+
+		ENTRY("NewL-CSenCredential2",  CsenservdescTester::MT_CSenCredential2_NewLL),
+		ENTRY("NewLC-CSenCredential2",  CsenservdescTester::MT_CSenCredential2_NewLCL),
+		ENTRY("NewL-CSenCredential2 baseElement",  CsenservdescTester::MT_CSenCredential2_NewL_1L),
+		ENTRY("NewLC-CSenCredential2 baseElement",  CsenservdescTester::MT_CSenCredential2_NewLC_1L),
+		ENTRY("NewL-CSenCredential2 ",  CsenservdescTester::MT_CSenCredential2_NewL_2L),
+		ENTRY("NewLC-CSenCredential2 ",  CsenservdescTester::MT_CSenCredential2_NewLC_2L),
+		ENTRY("NewL-CSenCredential2_copy",  CsenservdescTester::MT_CSenCredential2_NewL_3L),
+		ENTRY("NewLC-CSenCredential2_copy",  CsenservdescTester::MT_CSenCredential2_NewLC_3L),
+		ENTRY("NewL-CSenCredential2_document",  CsenservdescTester::MT_CSenCredential2_NewL_4L),
+		ENTRY("NewLC-CSenCredential2_document",  CsenservdescTester::MT_CSenCredential2_NewLC_4L),
+		ENTRY("Id-CSenCredential2_Id",  CsenservdescTester::MT_CSenCredential2_IdL),
+		ENTRY("ValidUntil-CSenCredential2_ValidUntil",  CsenservdescTester::MT_CSenCredential2_ValidUntilL),
+		ENTRY("SetValidUntil-CSenCredential2_SetValidUntil",  CsenservdescTester::MT_CSenCredential2_SetValidUntilL),
+		ENTRY("NewL-CSenFacet",  CsenservdescTester::MT_CSenFacet_NewLL),
+		ENTRY("NewL-CSenFacet copy",  CsenservdescTester::MT_CSenFacet_NewL_1L),
+		ENTRY("NewL-CSenFacet attribute",  CsenservdescTester::MT_CSenFacet_NewL_2L),
+		ENTRY("SetNameL-CSenFacet",  CsenservdescTester::MT_CSenFacet_SetNameLL),
+		ENTRY("SetTypeL-CSenFacet",  CsenservdescTester::MT_CSenFacet_SetTypeLL),
+		ENTRY("SetValueL-CSenFacet",  CsenservdescTester::MT_CSenFacet_SetValueLL),
+		ENTRY("Name-CSenFacet",  CsenservdescTester::MT_CSenFacet_NameL),
+		ENTRY("Type-CSenFacet",  CsenservdescTester::MT_CSenFacet_TypeL),
+		ENTRY("Value-CSenFacet",  CsenservdescTester::MT_CSenFacet_ValueL),
+		ENTRY("NewL-Endpoint",  CsenservdescTester::MT_CSenIdentityProvider_NewL_L),
+		ENTRY("NewLC-Endpoint",  CsenservdescTester::MT_CSenIdentityProvider_NewLCL),
+		ENTRY("NewL-Enpoint_+_Contract",  CsenservdescTester::MT_CSenIdentityProvider_NewL_1L),
+		ENTRY("NewLC-Enpoint_+_Contract",  CsenservdescTester::MT_CSenIdentityProvider_NewLC_1L),
+		ENTRY("NewL-Provider_+_Contract_+_Endpoint",  CsenservdescTester::MT_CSenIdentityProvider_NewL_2L),
+		ENTRY("NewLC-Provider_+_Contract_+_Endpoint",  CsenservdescTester::MT_CSenIdentityProvider_NewLC_2L),
+		ENTRY("NewL-ServiceID_+_Provider_+_Contract_+_Endpoint",  CsenservdescTester::MT_CSenIdentityProvider_NewL_3L),
+		ENTRY("NewLC-ServiceID_+_Provider_+_Contract_+_Endpoint",  CsenservdescTester::MT_CSenIdentityProvider_NewLC_3L),
+		ENTRY("AuthzID-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_AuthzIDL),
+		ENTRY("AdvisoryAuthnID-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_AdvisoryAuthnIDL),
+		ENTRY("ProviderID-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_ProviderIDL),
+		ENTRY("Password-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_PasswordL),
+		ENTRY("IMEI-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_IMEIL),
+		ENTRY("UserName-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_UserNameL),
+		ENTRY("SetProviderID-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_SetProviderIDL),
+		ENTRY("SetServiceID-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_SetServiceIDL),
+		ENTRY("IsTrustedByL-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_IsTrustedByLL),
+		ENTRY("IsTrustedByL1-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_IsTrustedByL1L),		
+		ENTRY("HttpCredentialsL-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_HttpCredentialsLL),
+		ENTRY("IsDefault-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_IsDefaultL),		
+		
+		ENTRY("NewElementName-IdentityProvider",  CsenservdescTester::MT_CSenIdentityProvider_NewElementNameL),
+		ENTRY("NewL-CSenIdentityProviderIdArray8",  CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewLL),
+		ENTRY("NewLC-CSenIdentityProviderIdArray8",  CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewLCL),
+		ENTRY("NewL-CSenIdentityProviderIdArray8",  CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewL_1L),
+		ENTRY("NewLC-CSenIdentityProviderIdArray8",  CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewLC_1L),
+		ENTRY("IsStrict-CSenIdentityProviderIdArray8",  CsenservdescTester::MT_CSenIdentityProviderIdArray8_IsStrictL),
+		ENTRY("SetStrict-CSenIdentityProviderIdArray8",  CsenservdescTester::MT_CSenIdentityProviderIdArray8_SetStrictL),
+		ENTRY("NewL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_NewLL),
+		ENTRY("NewLC-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_NewLCL),
+		ENTRY("NewL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_NewL_1L),
+		ENTRY("NewLC-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_NewLC_1L),
+		ENTRY("NewL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_NewL_2L),
+		ENTRY("NewLC-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_NewLC_2L),
+		ENTRY("MatchesL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_MatchesL),		
+		ENTRY("SetConsumerIapIdL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_SetConsumerIapIdLL),
+		ENTRY("ConsumerIapId-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_ConsumerIapIdL),
+		ENTRY("SetConsumerIdentityProviderIdsL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL),
+		ENTRY("ConsumerPolicyAsXmlL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_ConsumerPolicyAsXmlLL),
+		ENTRY("StartElementL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_StartElementLL),
+		
+		
+		ENTRY("AddConsumerIdentityProviderIdL-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_AddConsumerIdentityProviderIdLL),
+		ENTRY("ConsumerIdentityProviderIds8L-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_ConsumerIdentityProviderIds8LL),
+		ENTRY("AcceptsConsumerPolicy-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_AcceptsConsumerPolicyL),
+		ENTRY("RebuildFromConsumerPolicy-CSenServicePattern",  CsenservdescTester::MT_CSenServicePattern_RebuildFromConsumerPolicyL),		
+		ENTRY("NewL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewLL),
+		ENTRY("NewLC-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewLCL),
+		ENTRY("NewL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewL_1L),
+		ENTRY("NewLC-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewLC_1L),
+		ENTRY("NewL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewL_2L),
+		ENTRY("NewLC-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewLC_2L),
+		ENTRY("SetFrameworkIdL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetFrameworkIdLL),
+		ENTRY("NewElementName-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_NewElementNameL),
+		ENTRY("SetIapIdL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetIapIdLL),
+		ENTRY("IapId-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_IapIdL),
+		ENTRY("SetIdentityProviderIdsL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL),
+		ENTRY("AddIdentityProviderIdL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_AddIdentityProviderIdLL),
+		ENTRY("RebuildFrom-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_RebuildFromL),
+		ENTRY("IdentityProviderIds8L-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_IdentityProviderIds8LL),
+		ENTRY("Accepts-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_AcceptsL),
+		ENTRY("DescriptionClassType-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_DescriptionClassTypeL),
+		ENTRY("MatchesL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_MatchesL),
+		ENTRY("SetProviderIDL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetProviderIDL),
+		ENTRY("SetPolicyLL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetPolicyLL),
+		ENTRY("SetPolicyL_1L-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetPolicyL_1L),
+		ENTRY("SetPolicyL_2L-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetPolicyL_2L),	
+		ENTRY("Contract-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_ContractL),
+		ENTRY("HasFacetL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_HasFacetLL),
+		ENTRY("FacetValue-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_FacetValueL),
+		ENTRY("AddFacetL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_AddFacetLL),
+		ENTRY("SetFacetL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetFacetLL),
+		ENTRY("RemoveFacet-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_RemoveFacetL),
+		ENTRY("FacetsL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_FacetsLL),
+		ENTRY("ScoreMatchL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_ScoreMatchLL),
+		ENTRY("Endpoint-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_EndpointL),
+		ENTRY("FrameworkId-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_FrameworkIdL),
+		ENTRY("FrameworkVersion-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_FrameworkVersionL),
+		ENTRY("SetContractL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetContractLL),
+		ENTRY("SetEndPointL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetEndPointLL),
+		ENTRY("SetAttributesL-CSenXmlServiceDescription",  CsenservdescTester::MT_CSenXmlServiceDescription_SetAttributesLL),		
+		ENTRY("AsXmlL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_AsXmlLL),
+		ENTRY("WriteAsXMLToL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_WriteAsXMLToLL),
+		ENTRY("AsXmlUnicodeL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_AsXmlUnicodeLL),
+		ENTRY("Credentials-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_CredentialsL),
+
+		ENTRY("HasEqualPrimaryKeysL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL),
+		ENTRY("IsLocalL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_IsLocalLL),
+		ENTRY("SetTransportCueL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_SetTransportCueLL),
+		ENTRY("TransportCue-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_TransportCueL),
+		//ENTRY("ServicePolicy-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_ServicePolicyL),
+		ENTRY("ProviderId-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_ProviderIdL),
+		ENTRY("SetPromptUserInfoL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_SetPromptUserInfoLL),
+		ENTRY("PromptUserInfo-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_PromptUserInfoL),
+		ENTRY("StartElementL-CSenXmlServiceDescription", CsenservdescTester::MT_CSenXmlServiceDescription_StartEndElementLL),
+		
+	
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CsenservdescTester::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CsenservdescTester::PrintTest, ETrue, 1, 3 ),
+        };
+        //ADD NEW ENTRY HERE
+        // [test cases entries]-Do not remove
+
+        //};
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+
+void CsenservdescTester::SetupL(  )
+    {
+
+    } 
+
+void CsenservdescTester::Teardown(  )
+    {
+
+    }
+TPtr16 CsenservdescTester::ConvertToPtr16LC(CSenBaseFragment &fragment){
+    HBufC16* xmlBuffer = fragment.AsElement().AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+TPtr16 CsenservdescTester::ConvertToPtr16LC(CSenBaseElement &element){
+    HBufC16* xmlBuffer = element.AsXmlUnicodeL();//Parent()->
+    CleanupStack::PushL( xmlBuffer );
+    TPtr16 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0){
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    }
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    return ptr;
+}
+
+TInt CsenservdescTester::MT_CSenCredential_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential*)NULL);
+  
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    //checking xml
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+ 
+	{TRAPD(err, CSenCredential::NewL(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+   
+ 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+ 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+TInt CsenservdescTester::MT_CSenCredential_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential = CSenCredential::NewLC(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential*)NULL);
+  
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+
+	  {TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 		{TRAPD(err, CSenCredential::NewLC(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+ 		{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+     Teardown();
+    return KErrNone;
+   }
+
+
+TInt CsenservdescTester::MT_CSenCredential_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenBaseElement* senBaseElement = CSenBaseElement::NewL(KText);
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributeArray, *senBaseElement);
+    TL(senCredential != (CSenCredential*)NULL);
+
+    //checking xml, parent we will not see so ref the same as previous NewL ctr 
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete senBaseElement;
+    senBaseElement = NULL;
+
+    senBaseElement = CSenBaseElement::NewL(KText);
+	 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KText, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KText, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KNullDesC8, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KText, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KText, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+    delete senBaseElement;
+    senBaseElement = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenCredential_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenBaseElement* senBaseElement = CSenBaseElement::NewL(KText);
+    CSenCredential* senCredential = CSenCredential::NewLC(KText, KText, KText, attributeArray, *senBaseElement);
+    TL(senCredential != (CSenCredential*)NULL);
+   
+    //checking xml, parent we will not see so ref the same as previous Newl ctr
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential)== KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete senBaseElement;
+    senBaseElement = NULL;
+
+    senBaseElement = CSenBaseElement::NewL(KText);
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KText, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KNullDesC8, KNullDesC8, attributeArray, *senBaseElement));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KText, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KText, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenCredential::NewLC(KText, KXmlSpecific, KXmlSpecific, attributeArray, *senBaseElement));if(err != (KErrSenInvalidCharacters))return err;}
+
+    delete senBaseElement;
+    senBaseElement = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenCredential_NewL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential, *orgSenCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    
+    senCredential = CSenCredential::NewL(*orgSenCredential);
+    
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(senCredential != (CSenCredential*)NULL);
+    
+   __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenCredential_NewLC_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential* senCredential, *orgSenCredential = CSenCredential::NewL(KText, KText, KText, attributeArray);
+    
+    senCredential = CSenCredential::NewLC(*orgSenCredential);
+    TL(senCredential != (CSenCredential*)NULL);
+    
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+   
+TInt CsenservdescTester::MT_CSenCredential_ValidUntilL( CStifItemParser& aItem )
+    {
+    SetupL();    
+    RAttributeArray attributes;
+    CSenCredential* senCredential = CSenCredential::NewL(KText, KText, KText, attributes);
+    TTime time;
+    _LIT(KTimeString1,"23:34.56");
+    time.Parse(KTimeString1);
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));*/
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));	
+    LOCAL_ASSERT(senCredential->ValidUntil() == time); 
+
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil()); */
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil());	
+
+    //checking xml
+	//_LIT16(KRef, "<text xmlns=\"text\" some valid stuff/>");
+    //_LIT16(KRef, "<text xmlns=\"text\" >");
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*senCredential), KRef);*/
+    TL(ConvertToPtr16LC(*senCredential) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    delete senCredential;
+    senCredential = NULL;
+    attributes.Reset();
+    attributes.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenCredential_SetValidUntilL( CStifItemParser& aItem )
+    {
+    return MT_CSenCredential_ValidUntilL(aItem);
+    }
+TInt CsenservdescTester::MT_CSenCredential_StartElementLL(CStifItemParser& aItem)
+	{
+	/*
+	_LIT8(KCredential, "<Credentials CredentialsMaxID=\"1\">
+						<CredentialContainer>
+						<Identifier><garbage>1</garbage><Endpoint>http://10.21.32.20/WSStar/CredMan/WSService.aspx</Endpoint><ProviderID>provider01</ProviderID></Identifier>
+						<Properties>
+						<ServiceInterval>-60540625</ServiceInterval><ValidUntil>2020-06-19T10:28:31.000000Z</ValidUntil>
+						<Created>2007-06-18T10:23:52Z</Created><PhoneTimeWhenMTResolved>2007-06-18T10:24:52.504375Z</PhoneTimeWhenMTResolved>
+						<POP>cnqlXcxDmY4h4tjbgNssLMwhCkOnc+4c</POP>
+						<TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</TokenType>\
+						<BinaryType>simmetric</BinaryType>
+						</Properties></CredentialContainer></Credentials>");
+    */	
+    
+	_LIT8(KCredential, "<Credentials CredentialsMaxID=\"1\">\
+						</Credentials>");
+    					
+	RAttributeArray attributes;
+	CSenCredential* pCredential = CSenCredential::NewL(_L8(""),_L8("Credentials"),_L8("Credentials"),attributes);
+	CleanupStack::PushL(pCredential);
+	CSenXmlReader *pXmlReader = CSenXmlReader::NewL();
+	CleanupStack::PushL(pXmlReader);
+	pCredential->SetReader(*pXmlReader );
+	TRAPD(retVal,pCredential->ParseL(KCredential));
+	CleanupStack::PopAndDestroy(pXmlReader);
+	CleanupStack::PopAndDestroy(pCredential);
+	return retVal;
+	}
+	
+
+TInt CsenservdescTester::MT_CSenCredential2_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenCredential2* senCredential = CSenCredential2::NewL();
+    TL(senCredential != (CSenCredential2*)NULL);
+  
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+    
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+
+TInt CsenservdescTester::MT_CSenCredential2_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenCredential2* senCredential = CSenCredential2::NewLC();
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+   
+    senCredential = NULL;
+
+	//CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CsenservdescTester::MT_CSenCredential2_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential2*)NULL);
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenCredential2_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray);
+    TL(senCredential != (CSenCredential2*)NULL);
+
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	//CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+   }
+   
+   
+TInt CsenservdescTester::MT_CSenCredential2_NewL_2L( CStifItemParser& aItem )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray, bodyElement);
+    TL(senCredential != (CSenCredential2*)NULL);
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    
+    Teardown();
+    return KErrNone;
+	}
+      
+TInt CsenservdescTester::MT_CSenCredential2_NewLC_2L( CStifItemParser& aItem )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray, bodyElement);
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    Teardown();
+    return KErrNone;
+	}
+
+TInt CsenservdescTester::MT_CSenCredential2_NewL_3L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2  *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewL(*orgSenCredential);
+    
+    
+   __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenCredential2_NewLC_3L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2 *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewLC(*orgSenCredential);
+    TL(senCredential != (CSenCredential2*)NULL);
+    
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CsenservdescTester::MT_CSenCredential2_NewL_4L( CStifItemParser& aItem )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray, bodyElement, document);
+    TL(senCredential != (CSenCredential2*)NULL);
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    
+    Teardown();
+    return KErrNone;
+	}
+      
+TInt CsenservdescTester::MT_CSenCredential2_NewLC_4L( CStifItemParser& aItem )
+	{
+    SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    RAttributeArray attributeArray;
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    CSenCredential2* senCredential = CSenCredential2::NewLC(KText, KText, KText, attributeArray, bodyElement, document);
+    TL(senCredential != (CSenCredential2*)NULL);
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+	CleanupStack::PopAndDestroy(1);
+    Teardown();
+    return KErrNone;
+	}
+
+
+TInt CsenservdescTester::MT_CSenCredential2_IdL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenCredential2 *senCredential;
+    CSenCredential2 *orgSenCredential = CSenCredential2::NewL(KText, KText, KText, attributeArray);
+    senCredential = CSenCredential2::NewL(*orgSenCredential);
+    senCredential->Id();
+    TL(senCredential != (CSenCredential2*)NULL);
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senCredential);
+    senCredential = NULL;
+    delete orgSenCredential;
+    orgSenCredential = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+
+TInt CsenservdescTester::MT_CSenCredential2_ValidUntilL( CStifItemParser& aItem )
+    {
+    SetupL();    
+    RAttributeArray attributes;
+    CSenCredential2* senCredential = CSenCredential2::NewL(KText, KText, KText, attributes);
+    TTime time;
+    _LIT(KTimeString1,"23:34.56");
+    time.Parse(KTimeString1);
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));*/
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->SetValidUntil(time));	
+    LOCAL_ASSERT(senCredential->ValidUntil() == time); 
+
+    /*__ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil()); */
+    __ASSERT_ALWAYS_NO_LEAVE(senCredential->ValidUntil());	
+
+    //checking xml
+	//_LIT16(KRef, "<text xmlns=\"text\" some valid stuff/>");
+    //_LIT16(KRef, "<text xmlns=\"text\" >");
+    //_LIT16(KRef, "<text xmlns=\"text\"/>");
+    /*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*senCredential), KRef);*/
+    //TL(ConvertToPtr16LC(*senCredential) == KRef);
+    //CleanupStack::PopAndDestroy();//Ptr
+    
+    delete senCredential;
+    senCredential = NULL;
+    attributes.Reset();
+    attributes.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenCredential2_SetValidUntilL( CStifItemParser& aItem )
+    {
+    return MT_CSenCredential2_ValidUntilL(aItem);
+    }
+
+	
+TInt CsenservdescTester::MT_CSenFacet_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenFacet* senFacet = CSenFacet::NewL();
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Facet/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenFacet_NewL_1L(CStifItemParser& aItem)
+    {
+    SetupL();
+    
+    CSenFacet *senFacet;
+    CSenFacet *senFacetOrg = CSenFacet::NewL();
+    
+    senFacet = CSenFacet::NewL(*senFacetOrg);
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<Facet/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    delete senFacetOrg;
+    senFacetOrg = NULL;
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenFacet_NewL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    RAttributeArray attributeArray;
+    CSenFacet* senFacet = CSenFacet::NewL(KText, KText, KText, attributeArray);
+    TL(senFacet != (CSenFacet*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<text xmlns=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KNullDesC8, KText, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KText, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KNullDesC8, KNullDesC8, attributeArray));if(err != (KErrSenZeroLengthDescriptor))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KXmlSpecific, KText, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KText, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+	 	{TRAPD(err, CSenFacet::NewL(KText, KXmlSpecific, KXmlSpecific, attributeArray));if(err != (KErrSenInvalidCharacters))return err;}
+
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+   }
+
+TInt CsenservdescTester::MT_CSenFacet_SetNameLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Name() == KNullDesC8))return KErrArgument;
+    
+    senFacet->SetNameL(KText);
+    if(!(senFacet->Name() == KText))return KErrArgument;
+    
+    //checking xml
+    _LIT16(KRef, "<Facet name=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+     if(!(senFacet->Name() == KText))return KErrArgument;
+
+   __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenFacet_SetTypeLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Type() == KNullDesC8))return KErrArgument;
+
+    senFacet->SetTypeL(KText);
+    if(!(senFacet->Type() == KText))return KErrArgument;
+   
+    //checking xml
+    _LIT16(KRef, "<Facet type=\"text\"/>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    if(!(senFacet->Type() == KText))return KErrArgument;
+
+    delete senFacet;
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenFacet_SetValueLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenFacet* senFacet = CSenFacet::NewL();
+    if(!(senFacet->Value() == KNullDesC8))return KErrArgument;
+
+    senFacet->SetValueL(KText);
+    if(!(senFacet->Value() == KText))return KErrArgument;
+
+    
+    //checking xml
+    _LIT16(KRef, "<Facet>text</Facet>");
+    TL(ConvertToPtr16LC(*senFacet) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    if(!(senFacet->Value() == KText))return KErrArgument;
+
+    delete senFacet;
+    senFacet = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenFacet_NameL( CStifItemParser& aItem )
+    {
+    return MT_CSenFacet_SetNameLL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenFacet_TypeL( CStifItemParser& aItem )
+    {
+    return MT_CSenFacet_SetTypeLL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenFacet_ValueL( CStifItemParser& aItem )
+    {
+    return MT_CSenFacet_SetValueLL(aItem);
+    }
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewL_L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    /*EUNIT_ASSERT_NOT_EQUALS(idProvider, (CSenIdentityProvider*)NULL);*/
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+ 	/*EUNIT_ASSERT_EQUALS(ConvertToPtr16LC(*idProvider), KRef);*/
+ 	TL(ConvertToPtr16LC(*idProvider) == KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    
+    /*__ASSERT_ALWAYS_NO_LEAVE(delete idProvider);*/
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);	
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewLC_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewL_3L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID><ServiceID>text</ServiceID></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewLC_3L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewLC(KText, KText, KText, KText);
+    TL(idProvider != (CSenIdentityProvider*)NULL);
+
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID><ServiceID>text</ServiceID></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_AuthzIDL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->AuthzID() == KNullDesC8);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->AuthzID());
+    idProvider->SetUserInfoL(KText2, KNullDesC8, KNullDesC8);
+    idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+    
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><AuthzID>text</AuthzID></IdentityProvider>");
+    TPtr temp=ConvertToPtr16LC(*idProvider);
+    TL(temp == KRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->AuthzID() == KText);
+    
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_AdvisoryAuthnIDL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->AdvisoryAuthnID() == KNullDesC8);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->AdvisoryAuthnID());
+    idProvider->SetUserInfoL(KNullDesC8, KText2, KNullDesC8);
+    idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8);
+    
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><AdvisoryAuthnID>text</AdvisoryAuthnID></IdentityProvider>");
+
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->AdvisoryAuthnID() == KText);
+
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_ProviderIDL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText, KText, KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->ProviderID());
+    TL(idProvider->ProviderID() == KText2);
+
+    delete idProvider;
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_PasswordL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->Password());
+    TL(idProvider->Password() == KNullDesC8);
+
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText2);
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText);
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><Password>text</Password></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+   CleanupStack::PopAndDestroy();//Ptr
+    
+    TL(idProvider->Password() == KText);
+
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_IMEIL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->IMEI());
+    idProvider->IMEI();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_UserNameL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->UserName());
+    TL(idProvider->UserName() == KNullDesC8);
+
+    idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8);
+    TL(idProvider->UserName()== KText);
+
+    idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+    TL(idProvider->UserName() == KText);
+
+    idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_SetProviderIDL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText)); 
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_SetServiceIDL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText)); 
+    //checking xml
+    _LIT16(KRef, "<IdentityProvider framework=\"ID-WSF\"><Endpoint>text</Endpoint><Contract>urn:liberty:as:2004-04</Contract><ProviderPolicy/><ServicePolicy/><ServiceID>text</ServiceID></IdentityProvider>");
+    TL(ConvertToPtr16LC(*idProvider) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_IsTrustedByLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* serviceDesc = CSenXmlServiceDescription::NewL(KText, KText2) ;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(_L8("endpoint"), _L8("contract"), KText, KText2);
+    retVal = idProvider->IsTrustedByL(*serviceDesc); 
+	
+	if(retVal);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_IsTrustedByL1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(_L8("endpoint"), _L8("contract"), KText, KText2);
+    retVal = idProvider->IsTrustedByL(KText); 
+
+    if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_IsDefaultL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    retVal = idProvider->IsDefault(); 
+	
+	if(retVal);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_HttpCredentialsLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    //retVal = idProvider->HttpCredentialsL(); 
+
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProvider_NewElementNameL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProvider* idProvider = CSenIdentityProvider::NewL(KText);
+    TL(idProvider->NewElementName() == _L8("IdentityProvider"));
+
+    __ASSERT_ALWAYS_NO_LEAVE(idProvider->NewElementName());
+    __ASSERT_ALWAYS_NO_LEAVE(delete idProvider);
+    idProvider = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewLC();
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL(FALSE);
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    
+    array = CSenIdentityProviderIdArray8::NewL(TRUE);
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+        
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProviderIdArray8_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewLC(FALSE);
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    
+    array = CSenIdentityProviderIdArray8::NewLC(TRUE);
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    CleanupStack::Pop();
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProviderIdArray8_IsStrictL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    __ASSERT_ALWAYS_NO_LEAVE(array->SetStrict(TRUE));
+    TL(array->IsStrict() == TRUE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(array->SetStrict(FALSE));
+    TL(array->IsStrict() == FALSE);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenIdentityProviderIdArray8_SetStrictL( CStifItemParser& aItem )
+    {
+    return MT_CSenIdentityProviderIdArray8_IsStrictL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC();
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL(KText);
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC(KText);
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_NewL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL(KText, KText);
+    
+    _LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_NewLC_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewLC(KText, KText);
+    
+    _LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_MatchesL( CStifItemParser& aItem )
+    {
+     SetupL();
+    CSenServicePattern *pattern2;
+    CSenServicePattern *pattern;
+    
+    pattern = CSenServicePattern::NewL();
+    //EUNIT_ASSERT_EQUALS(pattern->Matches(*pattern2), FALSE);
+    
+    pattern2 = CSenServicePattern::NewL();
+    //checking xml
+    TL(pattern->Matches(*pattern2) == TRUE);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    pattern2 = NULL;
+    
+    CSenXmlServiceDescription* xmlDescr = CSenXmlServiceDescription::NewL();
+    TL(pattern->Matches(*xmlDescr) == FALSE);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlDescr);
+    xmlDescr = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;    
+    Teardown();
+    return KErrNone;    
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_SetConsumerIapIdLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //checking xml
+    
+    TUint32 iap(0);
+    TL(pattern->ConsumerIapId(iap) == KErrNotFound);
+
+    
+    pattern->SetConsumerIapIdL(1);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerIapId(iap));
+    TL(pattern->ConsumerIapId(iap) == KErrNone);
+
+    TL(iap == 1);
+
+    pattern->SetConsumerIapIdL(0);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->ConsumerIapId(iap));
+    TL(pattern->ConsumerIapId(iap) == KErrNone);
+
+    TL(iap == 0);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_ConsumerIapIdL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    MT_CSenServicePattern_SetConsumerIapIdLL(aItem);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    pattern->AddConsumerIdentityProviderIdL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    array->AppendL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    array->AppendL(KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(pattern->SetConsumerIdentityProviderIdsL(*array));
+    
+    TL((pattern->ConsumerIdentityProviderIds8L()).Count() == 2);
+
+    TInt pos(0);
+    if(!((pattern->ConsumerIdentityProviderIds8L()).Find(KText, pos)==KErrNone))return KErrArgument;
+
+    if(!((pattern->ConsumerIdentityProviderIds8L()).Find(KText2, pos)==KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_AddConsumerIdentityProviderIdLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KNullDesC8) == KErrArgument))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText) == KErrNone))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(pattern->AddConsumerIdentityProviderIdL(KText2) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*pattern) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_ConsumerIdentityProviderIds8LL( CStifItemParser& aItem )
+    {
+    return MT_CSenServicePattern_SetConsumerIdentityProviderIdsLL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_AcceptsConsumerPolicyL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    pattern->SetConsumerIapIdL(1);
+    array->AppendL(KText);
+    
+    CSenServicePattern* pattern2 = CSenServicePattern::NewL();
+    if(!(pattern2->RebuildFromConsumerPolicy(*pattern)==KErrNone))return KErrArgument;
+
+    if(!(pattern2->AcceptsConsumerPolicy(*pattern)==TRUE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    array = NULL;
+    pattern2 = NULL;
+//false
+    pattern2 = CSenServicePattern::NewL();
+    pattern2->SetConsumerIapIdL(2);
+    if(!(pattern2->AcceptsConsumerPolicy(*pattern)==FALSE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern2 = NULL;
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_RebuildFromConsumerPolicyL( CStifItemParser& aItem )
+    {
+    return MT_CSenServicePattern_AcceptsConsumerPolicyL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_ConsumerPolicyAsXmlLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    HBufC8* retVal;
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    
+    retVal = pattern->ConsumerPolicyAsXmlL();
+    
+    if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenServicePattern_StartElementLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    //HBufC8* retVal;
+    _LIT8(KText, "text");
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    RAttributeArray array;
+    pattern->StartElementL(KText, KText, KText, array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewLCL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC();
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText);
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewLC_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC(KText);
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription xmlns=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewLC_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewLC(KText, KText);
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    CleanupStack::Pop();
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetFrameworkIdLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+
+    TL(xmlService->FrameworkId() == KNullDesC8);
+
+    _LIT8(KFr, "ID-WSF");
+    xmlService->SetFrameworkIdL(KFr);
+    //checking xml
+    _LIT16(KRef1, "<ServiceDescription framework=\"ID-WSF\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef1);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->FrameworkId() == KFr);
+
+    //again
+    xmlService->SetFrameworkIdL(KFr);
+    //checking xml
+    _LIT16(KRef2, "<ServiceDescription framework=\"ID-WSF\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->FrameworkId() == KFr);
+
+    //again
+    xmlService->SetFrameworkIdL(KText);
+    //checking xml
+    _LIT16(KRef3, "<ServiceDescription framework=\"text\"><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef3);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->FrameworkId() == KText);
+
+    //clear
+    xmlService->SetFrameworkIdL(KNullDesC8);
+    //checking xml
+    _LIT16(KRef4, "<ServiceDescription><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef4);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    TL(xmlService->FrameworkId() == KNullDesC8);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_NewElementNameL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    _LIT8(KRef, "ServiceDescription");
+    if(!(xmlService ->NewElementName() == KRef))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetIapIdLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TUint32 iap(0);
+    if(!((xmlService ->IapId(iap)) == KErrNotFound))return KErrArgument;
+
+    xmlService ->SetIapIdL(1);
+    if(!(xmlService ->IapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(1))return KErrArgument;
+
+    xmlService ->SetIapIdL(2);
+    if(!(xmlService ->IapId(iap) == KErrNone))return KErrArgument;
+
+    if(!(2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_IapIdL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_SetIapIdLL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    
+    TPtrC8 ptrText = KText();
+    xmlService->AddIdentityProviderIdL(ptrText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    array->AppendL(KText);
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    array->AppendL(KText2);
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetIdentityProviderIdsL(*array));
+    
+    TL((xmlService->IdentityProviderIds8L()).Count() == 2);
+
+    TInt pos(0);
+    if(!((xmlService->IdentityProviderIds8L()).Find(KText, pos)==KErrNone))return KErrArgument;
+
+    if(!((xmlService->IdentityProviderIds8L()).Find(KText2, pos)==KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    array = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_AddIdentityProviderIdLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    TPtrC8 ptr = KNullDesC8();
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrArgument))return KErrArgument;
+
+    ptr.Set(KText);
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrAlreadyExists))return KErrArgument;
+
+    ptr.Set(KText2);
+    if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument;
+
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy><IdentityProviderIDs><IdentityProviderID>text</IdentityProviderID><IdentityProviderID>text2</IdentityProviderID></IdentityProviderIDs></ProviderPolicy><ServicePolicy/></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_RebuildFromL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenIdentityProviderIdArray8* array = CSenIdentityProviderIdArray8::NewL();
+    
+    xmlService->SetIapIdL(1);
+    array->AppendL(KText);
+    
+    CSenXmlServiceDescription* xmlService2 = CSenXmlServiceDescription::NewL();
+    if(!(xmlService2->RebuildFrom(*xmlService)==KErrNone))return KErrArgument;
+
+    if(!(xmlService2->Accepts(*xmlService)==TRUE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete array);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    array = NULL;
+    xmlService2 = NULL;
+//false
+    xmlService2 = CSenServicePattern::NewL();
+    xmlService2->SetIapIdL(2);
+    if(!(xmlService2->Accepts(*xmlService)==FALSE))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService2 = NULL;
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_IdentityProviderIds8LL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_SetIdentityProviderIdsLL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_AcceptsL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_RebuildFromL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_DescriptionClassTypeL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    if(!(xmlService ->DescriptionClassType() == MSenServiceDescription::EXmlServiceDescription))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_MatchesL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription *xmlService;
+    CSenXmlServiceDescription *xmlService2(NULL);
+    
+    xmlService = CSenXmlServiceDescription::NewL();
+    //EUNIT_ASSERT_EQUALS(xmlService->Matches(*xmlService2), FALSE);
+    
+    xmlService2 = CSenXmlServiceDescription::NewL();
+    //checking xml
+    TL(xmlService ->Matches(*xmlService2) == TRUE);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+    
+    CSenServicePattern* pattern = CSenServicePattern::NewL();
+    //EUNIT_ASSERT_EQUALS(xmlService->Matches(*pattern), FALSE);
+    TL(xmlService->Matches(*pattern) == TRUE);
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete pattern);
+    pattern = NULL;  
+    Teardown();
+    return KErrNone;
+      
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetProviderIDL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+     
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetProviderIdL(KText2)); 
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->SetProviderIdL(KText)); 
+   
+    //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><ProviderID>text</ProviderID></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetPolicyLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8("")) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text/></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetPolicyL_1L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText, KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8(""), KText) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text>text</text></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetPolicyL_2L( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+	LOCAL_ASSERT(xmlService->SetPolicyL(KText, KText, KText, KText) == KErrNone);
+	LOCAL_ASSERT(xmlService->SetPolicyL(_L8(""), _L8(""), KText, KText) == KErrArgument);
+	
+	_LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy><ClientPolicy><text text=\"text\">text</text></ClientPolicy></ServicePolicy></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService)== KRef);
+    CleanupStack::PopAndDestroy();//Ptr
+    
+	__ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+	xmlService = NULL;
+    Teardown();
+    return KErrNone;
+	
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_ContractL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    xmlService ->SetContractL(KText);
+     //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Contract>text</Contract></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    TL(xmlService->Contract() == KText);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    //2nd time
+    xmlService ->SetContractL(KText);
+     //checking xml
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    TL(xmlService->Contract() == KText);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    xmlService ->SetContractL(KText2);
+     //checking xml
+    _LIT16(KRef2, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Contract>text2</Contract></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    TL(xmlService->Contract() == KText2);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+//================Facets
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_HasFacetLL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_RemoveFacetL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_FacetValueL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet* senFacet;
+    senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet->SetValueL(KText2);
+    
+
+    xmlService->AddFacetL(*senFacet);
+    TPtrC8 ptr=KText();
+    HBufC8* valueTo = NULL;
+    
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNone))return KErrArgument;
+
+    TL(*valueTo == KText2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete valueTo );
+    valueTo = NULL;
+    
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNone))return KErrArgument;
+
+    TL(*valueTo == KText2);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete valueTo );
+    valueTo = NULL;
+    
+    ptr.Set(KText2);
+    if(!(xmlService->FacetValue(ptr, valueTo)==KErrNotFound))return KErrArgument;
+
+     __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_AddFacetLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet *senFacet;
+    CSenFacet *senFacet2;
+    
+    senFacet = CSenFacet::NewL();
+    senFacet2 = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet2->SetNameL(KText2);
+    RFacetArray array;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet2) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Facet name=\"text\"/><Facet name=\"text2\"/></ServiceDescription>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*xmlService) == ptrRef);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet2);
+    senFacet2 = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetFacetLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet* senFacet;
+    senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet->SetValueL(KText);
+    
+    RFacetArray array;
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    senFacet->SetValueL(KText2);
+    if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Facet name=\"text\">text2</Facet></ServiceDescription>");
+    TPtrC16 ptrRef = KRef();
+    TL(ConvertToPtr16LC(*xmlService) == ptrRef);
+    
+    CleanupStack::PopAndDestroy();//Ptr
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_RemoveFacetL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    CSenFacet *senFacet;
+    CSenFacet *senFacet2;
+    
+    senFacet = CSenFacet::NewL();
+    senFacet2 = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    senFacet2->SetNameL(KText2);
+    RFacetArray array;
+
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet) == KErrAlreadyExists))return KErrArgument;
+
+    if(!(xmlService->AddFacetL(*senFacet2) == KErrNone))return KErrArgument;
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 2))return KErrArgument;
+
+    array.ResetAndDestroy();
+//removing, haFacet
+    TBool has(FALSE);
+    if(!(xmlService->HasFacetL(KText, has) == KErrNone))return KErrArgument;
+
+    if(!(has == TRUE))return KErrArgument;
+
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == TRUE))return KErrArgument;
+
+    if(!(xmlService->RemoveFacet(KText2) == KErrNone))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService->RemoveFacet(KText2));
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == FALSE))return KErrArgument;
+
+    if(!(xmlService->RemoveFacet(KText2) == KErrNotFound))return KErrArgument;
+
+    if(!(xmlService->HasFacetL(KText2, has) == KErrNone))return KErrArgument;
+
+    if(!(has == FALSE))return KErrArgument;
+
+    if(!(xmlService->FacetsL(array) == KErrNone))return KErrArgument;
+
+    if(!(array.Count() == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet2);
+    senFacet2 = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    array.ResetAndDestroy();
+    array.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_FacetsLL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_AddFacetLL(aItem);
+    }
+//------------end facet
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_AsXmlLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    HBufC8* xmlBuffer = xmlService->AsXmlL();
+    CleanupStack::PushL( xmlBuffer );
+    TPtr8 ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    _LIT8(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/
+    TL(ptr == KRef);
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_WriteAsXMLToLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    CleanupStack::PushL(xmlService);
+    xmlService->WriteAsXMLToL(ElemntStream);
+    
+    CleanupStack::PopAndDestroy(xmlService);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone ;
+    }
+
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_CredentialsL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->Credentials();
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_AsXmlUnicodeLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    HBufC* xmlBuffer = xmlService->AsXmlUnicodeL();
+    CleanupStack::PushL( xmlBuffer );
+    TPtr ptr = xmlBuffer->Des();
+    if (ptr.Length() > 0)
+        RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr);
+    else
+        RDebug::Print( _L( "WSModTester: xmlBuffer empty"));
+    _LIT(KRef, "<ServiceDescription><Endpoint>text</Endpoint><Contract>text</Contract><ProviderPolicy/><ServicePolicy/></ServiceDescription>");
+    /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/
+    TL(ptr == KRef);
+    CleanupStack::PopAndDestroy(xmlBuffer);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_HasEqualPrimaryKeysLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetFrameworkIdL(KText);
+    CSenXmlServiceDescription* xmlService1= CSenXmlServiceDescription::NewL();
+    
+    retVal = xmlService->HasEqualPrimaryKeysL(*xmlService);
+    //TL(retVal == ETrue)
+	if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService1);
+    xmlService1 = NULL;
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_IsLocalLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    retVal = xmlService->IsLocalL();
+    //TL(retVal == ETrue)
+	if(retVal);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetTransportCueLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    
+    retVal = xmlService->SetTransportCueL(KText);
+    if(!(retVal == 0)) return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_TransportCueL( CStifItemParser& aItem )
+    {
+    SetupL();
+    //TBool retVal;
+    //HBufC8* xmlBuffer;
+    //TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetTransportCueL(KText);
+    xmlService->TransportCue();
+    //ptr = xmBuffer.Desc(;)
+    //TL(ptr == KText);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+/*    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_ServicePolicyL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;
+    CServicePolicy* policy = CSenServicePolicy::NewL();
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    policy = (CServicePolicy)xmlService->ServicePolicyL();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+    
+*/    
+    
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_ProviderIdL( CStifItemParser& aItem )
+    {
+    SetupL();
+    //TBool retVal;
+    //TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->ProviderId();
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetPromptUserInfoLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool var = ETrue;
+    TPtrC8 ptr;
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    xmlService->SetPromptUserInfoL(var);
+		
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_PromptUserInfoL( CStifItemParser& aItem )
+    {
+    SetupL();
+    TBool retVal;;
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(KText, KText);
+    retVal = xmlService->PromptUserInfo();
+	
+	if(retVal);
+		
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+
+    Teardown();
+    return KErrNone ;
+    }
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_StartEndElementLL(CStifItemParser& aItem)
+	{
+/*_LIT8(KServiceDescription, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">&ltContent2&quot&gt</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+*/	
+
+
+_LIT8(KServiceDescription, "<ServiceDescription framework=\"WS-STAR\">\
+		<Contract>urn:wstar:sts</Contract>\
+		<Endpoint>http://10.21.32.20/WSStar/BgRsp/STS.aspx</Endpoint>\
+		<ProviderID>provider01</ProviderID>\
+		</ServiceDescription>");		
+/*
+	_LIT8(KServiceDescription, "<ServiceDescription framework=\"WS-STAR\">
+		<Contract>urn:wstar:sts</Contract>
+		<Endpoint>http://10.21.32.20/WSStar/BgRsp/STS.aspx</Endpoint>
+		<ProviderID>provider01</ProviderID>
+		<ProviderPolicy>
+       <Transport>
+           <IapId>
+               1234567890
+           </IapId>
+       </Transport>
+       <IdentityProviderIDs strict=\"true\">
+           <IdentityProviderID>
+             urn:first.id.example.com
+           </IdentityProviderID>
+           <IdentityProviderID>
+             urn:second.id.example.com
+           </IdentityProviderID>
+       </IdentityProviderIDs>
+   		</ProviderPolicy>
+		<Credentials CredentialsMaxID=\"1\">
+						<CredentialContainer>
+						<Identifier><garbage>1</garbage><Endpoint>http://10.21.32.20/WSStar/CredMan/WSService.aspx</Endpoint><ProviderID>provider01</ProviderID></Identifier>
+						<Properties>
+						<ServiceInterval>-60540625</ServiceInterval><ValidUntil>2020-06-19T10:28:31.000000Z</ValidUntil>
+						<Created>2007-06-18T10:23:52Z</Created><PhoneTimeWhenMTResolved>2007-06-18T10:24:52.504375Z</PhoneTimeWhenMTResolved>
+						<POP>cnqlXcxDmY4h4tjbgNssLMwhCkOnc+4c</POP>
+						<TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</TokenType>\
+						<BinaryType>simmetric</BinaryType>
+						</Properties></CredentialContainer></Credentials>
+		</ServiceDescription>");*/
+
+	CSenXmlServiceDescription* pDescription = CSenXmlServiceDescription::NewL(_L8("ServiceDescription"));
+	CleanupStack::PushL(pDescription);
+	CSenXmlReader *pXmlReader = CSenXmlReader::NewL();
+	CleanupStack::PushL(pXmlReader);
+	pDescription->SetReader(*pXmlReader );
+	TRAPD(retVal,pDescription->ParseL(KServiceDescription));
+	CleanupStack::PopAndDestroy(pXmlReader);
+	CleanupStack::PopAndDestroy(pDescription);
+	return retVal;
+	}
+
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_ScoreMatchLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription *xmlService;
+    CSenXmlServiceDescription *xmlService2;
+    
+    xmlService = CSenXmlServiceDescription::NewL();
+    xmlService2 = CSenXmlServiceDescription::NewL();
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 0))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText, KText2);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 2))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText2, KText);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 0))return KErrArgument;
+
+   __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+//---------------
+    xmlService = CSenXmlServiceDescription::NewL(KText2, KText);
+    xmlService2 = CSenXmlServiceDescription::NewL(KText, KText2);
+    CSenFacet* senFacet = CSenFacet::NewL();
+    senFacet->SetNameL(KText);
+    xmlService->AddFacetL(*senFacet);
+    xmlService2->AddFacetL(*senFacet);
+    
+    if(!(xmlService->ScoreMatchL(*xmlService2) == 1))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete senFacet);
+    senFacet = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService2);
+    xmlService2 = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_EndpointL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    
+    xmlService ->SetEndPointL(KText);
+     //checking xml
+    _LIT16(KRef, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Endpoint>text</Endpoint></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    TL(xmlService->Endpoint() == KText);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    //2nd time
+    xmlService ->SetEndPointL(KText);
+     //checking xml
+    TL(ConvertToPtr16LC(*xmlService) == KRef);
+
+    TL(xmlService->Endpoint() == KText);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+
+    xmlService ->SetEndPointL(KText2);
+     //checking xml
+    _LIT16(KRef2, "<ServiceDescription><ProviderPolicy/><ServicePolicy/><Endpoint>text2</Endpoint></ServiceDescription>");
+    TL(ConvertToPtr16LC(*xmlService) == KRef2);
+
+    TL(xmlService->Endpoint() == KText2);
+
+    CleanupStack::PopAndDestroy();//Ptr
+   
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_FrameworkIdL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_SetFrameworkIdLL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_FrameworkVersionL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    __ASSERT_ALWAYS_NO_LEAVE(xmlService ->FrameworkVersion());
+    if(!(xmlService ->FrameworkVersion() == KNullDesC8))return KErrArgument;
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetContractLL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_ContractL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetEndPointLL( CStifItemParser& aItem )
+    {
+    return MT_CSenXmlServiceDescription_EndpointL(aItem);
+    }
+
+TInt CsenservdescTester::MT_CSenXmlServiceDescription_SetAttributesLL( CStifItemParser& aItem )
+    {
+    SetupL();
+    
+    CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL();
+    RAttributeArray attributeArray;
+    xmlService->SetAttributesL(attributeArray);
+    __ASSERT_ALWAYS_NO_LEAVE(delete xmlService);
+    xmlService = NULL;
+    attributeArray.Reset();
+    attributeArray.Close();
+    Teardown();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservdescTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CsenservdescTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File]-Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_description_api/web_service_description_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="7e9aa27ca837b119f5bca97fc3b240ea" dataversion="1.0">
+  <name>Web Service Description API</name>
+  <description>This API consists of a family of classes for describing services and service accesses, providing ways to manage information on different services and frameworks. The most important functionality provided is XML type service description.</description>
+  <type>c++</type>
+  <collection>webservices</collection>
+  <libs>
+    <lib name="SenServDesc.LIB" />
+  </libs>
+  <release category="public" sinceversion="3.0"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                Web Service Manager API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SenServiceManager.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenServiceManager.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/inc/SenServiceManager.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,878 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenServiceManager class offers API for
+*                accessing and managing WebServicesFramework  
+*                (WSF) service and identity related data.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SERVICE_MANAGER_H
+#define SEN_SERVICE_MANAGER_H
+
+//  INCLUDES
+#include <e32base.h> // for CActive
+#include <e32std.h>  // for RPointerArray
+#include <badesca.h>
+
+#include <MSenServiceConsumer.h>
+#include <MSenServiceDescription.h>
+#include <SenCredential2.h>
+#include <SenXmlProperties.h>
+#include "MSenAuthenticationProvider.h"
+
+// FORWARD DECLARATIONS
+class CSenXmlServiceDescription;
+class CSenIdentityProvider;
+
+// DATA TYPES
+typedef RPointerArray<CSenXmlServiceDescription> RServiceDescriptionArray;
+typedef RPointerArray<CSenCredential2> RCredentialArray;
+typedef RPointerArray<CSenXmlProperties> RCredentialPropertiesArray;
+
+// CLASS DECLARATION
+
+/**
+* CSenServiceManager class offers API for accessing and managing 
+* WebServicesFramework (WSF) service and identity related data.
+* The class is designed using abstract factory pattern: 
+* it only offers a instance (pointer) to the actual implementation 
+* class meeting this interface.
+* Typically, service consumers use of CSenServiceManager to register service
+* or identity based data, which is required for accessing some invocable, 
+* possibly remote service.
+* The class is meant for both default frameworks offered by WSF 
+* and for any custom plug-in service invocation framework implementation.
+* The default frameworks are:
+*      1) Identity Based Web Services Framework (ID-WSF).
+*      2) Basic Web Services Framework.
+* For Basic Web Service consumer, the only applicable operations are 
+* Identity data managing methods. These can be used to make connection 
+* specific Basic Authentication (BASIC-AUTH) credentials available without 
+* later end-user interaction. Otherwise required authentication info 
+* will be requested via notifier dialog prompts.
+* ID-WSF consumer has to use the CSenServiceManager methods to register 
+* authentication service description and identity provider (which are 
+* the same service in ID-WSF) and finally associate some actual service 
+* (contract to a WSP) to this IDP.
+* 
+* The current client-server framework implementation of CSenServiceManager 
+* is synchronous, although class inherits CActive for future extensions.
+* So, the class instance will not be an active object handled 
+* by ActiveScheduler, and it does not have implementation 
+* in RunL() or DoCancel() methods.
+*
+*  @lib SenServMgr.lib
+*  @since Series60 3.0
+*/
+class CSenServiceManager : public CActive
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenServiceManager* NewL();
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenServiceManager* NewLC();
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenServiceManager* NewL(MSenAuthenticationProvider& aAuthProvider);
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenServiceManager* NewLC(MSenAuthenticationProvider& aAuthProvider);
+
+        // New functions
+
+        /**
+        * Consumers use this to find services with matching URI 
+        * (contract or endpoint) of the service. ID-WSF consumers
+        * typically use the service type (contract) they are
+        * interested on. 
+        * Contract is typically some URN and most endpoints are URLs.
+        * The Basic Web Service descriptions are not written into WSF
+        * database, so they cannot be searched using this method.
+        * @param    aUri specifies the search string (contract or endpoint)
+        *           which will be used to find matching service descriptions.
+        * @param    aList an array with 0 or more service descriptions which
+        *           are already registered to WSF.
+        *           The ownership of the array is passed to the caller so before
+        *           the array goes out of scope in the client, the caller must
+        *           call RPointerArray::ResetAndDestroy() on the array to free any
+        *           entries.
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrNotFound                  No matching service description was found.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt ServiceDescriptionsL(  const TDesC8& aURI,
+                                            RServiceDescriptionArray& aList) = 0;
+
+        /**
+        * Consumers use this to find services with matching 
+        * service description. The service description may 
+        * include specific contract or endpoint of the service
+        * as a searching criteria.
+        * Contract is typically some URN and most endpoints are URLs.
+        * The Basic Web Service descriptions are not written into WSF
+        * database, so they cannot be searched using this method.
+        * @param    aSD a service description specifying search pattern 
+        *           (which includes contract, URI or both) used to find 
+        *           matching service descriptions.
+        * @param    aList an array with 0 or more ServiceDescriptions which
+        *           are already registered to WSF.
+        *           The ownership of the array is passed to the caller so before
+        *           the array goes out of scope in the client, the caller must
+        *           call RPointerArray::ResetAndDestroy() on the array to free any
+        *           entries.
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrNotFound                  No matching service descriptions found.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt ServiceDescriptionsL(  MSenServiceDescription& aSD,
+                                            RServiceDescriptionArray& aList) = 0;
+
+        /**
+        * Used by consumer applications to register new service to WSF
+        * The service could not otherwise be discovered while creating 
+        * a service connection. ID-WSF Authentication Service is an 
+        * example of this kind of remote service.
+        * The Basic Web Service consumer does not need to and cannot 
+        * register any service related data.
+        * In service description, the default framework ID is "ID-WSF",
+        * through which frameworks performing the actual registration
+        * are looked up. For any custom framework plug-in, the framework
+        * ID must be separately set.
+        * For ID-WSF service descriptions  it is mandatory to set both 
+        * contract and endpoint.
+        * Calling the method performs one of the following:
+        *      1. It registers a new service description
+        *      2. It updates an existing service description
+        *         with matching contract and endpoint.
+        * @param    aSD a service description to be registered
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrNotReady                  Service description couldn't be registered,
+        *                               e.g. because end-user permission to modify
+        *                               WSF data was not granted (a dialog prompt).
+        * KErrNotFound                  Web Services framework couldn't find any
+        *                               required framework plug-in used to register 
+        *                               a service description of a given type
+        *                               (framework ID).
+        * KErrSenNoContract             Given service description didn't have
+        *                               a contract specified, even if the used
+        *                               framework needs one. For ID-WSF it is
+        *                               mandatory to define a contract for
+        *                               service description registration.
+        * KErrSenNoEndpoint             Given service description didn't have
+        *                               a endpoint specified, even if the used
+        *                               framework needs one. For ID-WSF it is
+        *                               mandatory to define an endpoint for
+        *                               service description registration.
+        * KErrSenNoContractNoEndPoint   Given service description didn't have
+        *                               an endpoint and contract specified, even if the used
+        *                               framework needs one. For ID-WSF it is
+        *                               mandatory to define both an endpoint and contract for
+        *                               service description registration.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt RegisterServiceDescriptionL(MSenServiceDescription& aSD) = 0;
+
+        /**
+        * Used by consumer application to to inform the ServiceManager 
+        * about a service which no longer is available. The ServiceManager
+        * will remove the service from its database as soon as it is no 
+        * longer used.
+        * @param    aSD a ServiceDescription to be unregistered
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrBadDescriptor             aSD was invalid service description and
+        *                               couldn't be unregistered.
+        * KErrNotReady                  Service description couldn't be registered,
+        *                               e.g. because end-user permission to modify
+        *                               WSF data was not granted (a dialog prompt).
+        * KErrNotFound                  Couldn't find a matching framework to 
+        *                               register service description or couldn't
+        *                               find a matching service description.
+        * KErrSenNoContract             Given service description didn't have
+        *                               a contract specified, even if the used
+        *                               framework needs one.
+        * KErrSenNoEndpoint             Given service description didn't have
+        *                               a endpoint specified, even if the used
+        *                               framework needs one.
+        * KErrSenNoContractNoEndPoint   Given service description didn't have
+        *                               an endpoint and contract specified, even if the used
+        *                               framework needs one. For ID-WSF it is
+        *                               mandatory to define both an endpoint and contract for
+        *                               service description registration.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt UnregisterServiceDescriptionL(
+                                                MSenServiceDescription& aSD) = 0;
+
+        /**
+        * Register an identity provider for the current active identity.
+        * It is required for both Basic Web Service and ID-WSF consumers
+        * that endpoint is defined in identity provider instance to make
+        * this data accessible later on while creating a service connection.
+        * @param    aProvider   an identity provider to be registered
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrBadDescriptor             aProvider was an invalid identity provider
+        *                               and couldn't be registered.
+        * KErrNotReady                  Service description couldn't be registered,
+        *                               e.g. because end-user permission to modify
+        *                               WSF data was not granted (a dialog prompt).
+        * KErrSenProviderIdInUseByAnotherEndpoint   
+        *                               attempt to register an identity provider
+        *                               failed, because ProviderID was already
+        *                               reserved in the use of another endpoint.
+        *
+        *                               A possible work-around for this would be
+        *                               to unregister such conflicting identity     
+        *                               provider using this particular ProviderID,
+        *                               but this solution is not recommended. Instead,
+        *                               separate providers, locating in different 
+        *                               endpoints, SHOULD always use different 
+        *                               ProviderIDs.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt RegisterIdentityProviderL(CSenIdentityProvider& aProvider) = 0;
+
+        /**
+        * Unregister an identity provider from the current active Identity.
+        * @param    aProvider an identity provider to be unregistered
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrBadDescriptor             aProvider was an invalid identity provider
+        *                               and couldn't be unregistered.
+        * KErrNotReady                  Identity provider couldn't be unregistered,
+        *                               e.g. because user didn't allow it.
+        * KErrNotFound                  aProvider was not found and couldn't be
+        *                               unregistered.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt UnregisterIdentityProviderL(
+                                        CSenIdentityProvider& aProvider) = 0;
+
+
+        /**
+        * Consumer applications use this method to associate 
+        * some pre-registered service to certain (registered)
+        * identity provider. The association adds the service ID
+        * (contract of the service that trusts this identity
+        * provider) into WSF identity database.
+        * In ID-WSF, consumers typically associate authentication
+        * service description with some identity provider. This
+        * way the ID-WSF framework can find the identity provider 
+        * by using the contract of the service as a search pattern
+        * (for e.g. liberty AS contract).
+        * @param aURI either the contract or the endpoint 
+        *             identifying some  service
+        * @param aProviderID the ID of an identity provider
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrArgument                  Either or both of the parameters were
+        *                               zero-length or invalid descriptors
+        * KErrNotReady                  Identity provider couldn't be unregistered,
+        *                               e.g. because user didn't allow it.
+        * KErrNotFound                  Web Services framework couldn't find
+        *                               the identity provider by given provider ID.
+        */
+        virtual TInt AssociateServiceL( const TDesC8& aURI,
+                                        const TDesC8& aProviderID) = 0;
+
+        /**
+        * Dissociate a service from an identity provider.
+        * @param aServiceID the contract or endpoint of a service
+        * @param aProviderID the id of an identity provider
+        * @return status/error code.
+        * Status codes:
+        * KErrNone                      ok
+        * Error codes:
+        * KErrArgument                  Either or both of the parameters were
+        *                               zero-length or invalid descriptors
+        * KErrNotReady                  Service couldn't be dissociated, 
+        *                               e.g. because user didn't allow it.
+        * KErrNotFound                  Web Services framework couldn't find
+        *                               the identity provider by given 
+        *                               provider ID.
+        */
+        virtual TInt DissociateServiceL(const TDesC8& aServiceID,
+                                        const TDesC8& aProviderID) = 0;
+         
+        /**
+        * Consumer applications use this method for finding Credentials.
+        * IdentityProvider or Username and Password are given either via 
+        * IdentityProviderL() callback or UsernameL() and Password()
+        * callbacks from MSenAuthenticationProvider (which can be given
+        * through specialized NewL or NewLC methods).
+        *
+        * @param    aEndpoint       the endpoint which identifies the Credential
+        * @param    aCredentials    an array with 0 or more Credentials.
+        *                           The ownership of the array (and Credentials)
+        *                           is passed to the caller so before the array
+        *                           goes out of scope in the client, the caller
+        *                           must call RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        * @param    aCredentialProperties    an array with 0 or more
+        *                           CredentialsProperties.
+        *                           The ownership of the array (and
+        *                           CredentialProperties) is passed to the caller
+        *                           so before the array goes out of scope in the 
+        *                           client, the caller must call
+        *                           RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the CredentialProperties in the array.
+        *                           Note: aCredentials array and
+        *                                 aCredentialProperties array are in
+        *                                 sync. If Credential has properties,
+        *                                 properties are placed in same 
+        *                                 position in aCredentialProperties array
+        *                                 as raleted Credential in aCredentials
+        *                                 array.
+        *                           Note: If Credential has no properties,
+        *                                 there is NULL in related position
+        *                                 in aCredentialProperties array.
+        *                           all the Credentials in the array.
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Endpoint.
+        * KErrSenNoPermission       Given IdentityProvider or Username and
+        *                           Password did not match for IdentityProvider
+        *                           which is related to found Credential(s).
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CredentialsL(const TDesC8& aEndpoint,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties) = 0;
+        
+        /**
+        * Consumer applications use this method for finding Credentials.
+        *
+        * @param    aEndpoint       the endpoint which identifies the Credential
+        * @param    aIdP            the IdentityProvider which should match
+        *                           for IdentityProvider which is related to
+        *                           found Credential(s).
+        * @param    aCredentials    an array with 0 or more Credentials.
+        *                           The ownership of the array (and Credentials)
+        *                           is passed to the caller so before the array
+        *                           goes out of scope in the client, the caller
+        *                           must call RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the Credentials in the array.
+        * @param    aCredentialProperties    an array with 0 or more
+        *                           CredentialsProperties.
+        *                           The ownership of the array (and
+        *                           CredentialProperties) is passed to the caller
+        *                           so before the array goes out of scope in the 
+        *                           client, the caller must call
+        *                           RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the CredentialProperties in the array.
+        *                           Note: aCredentials array and
+        *                                 aCredentialProperties array are in
+        *                                 sync. If Credential has properties,
+        *                                 properties are placed in same 
+        *                                 position in aCredentialProperties array
+        *                                 as raleted Credential in aCredentials
+        *                                 array.
+        *                           Note: If Credential has no properties,
+        *                                 there is NULL in related position
+        *                                 in aCredentialProperties array.
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Endpoint.
+        * KErrSenNoPermission       Given IdentityProvider did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CredentialsL(const TDesC8& aEndpoint,
+                                  const CSenIdentityProvider& aIdP,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties) = 0;
+        
+        /**
+        * Consumer applications use this method for finding Credentials.
+        *
+        * @param    aEndpoint       the endpoint which identifies the Credential
+        * @param    aUserName       the username which should match for 
+        *                           username in IdentityProvider which is related
+        *                           to found Credential(s).
+        * @param    aPassword       the password which should match for 
+        *                           password in IdentityProvider which is related
+        *                           to found Credential(s).
+        * @param    aCredentials    an array with 0 or more Credentials.
+        *                           The ownership of the array (and Credentials)
+        *                           is passed to the caller so before the array
+        *                           goes out of scope in the client, the caller
+        *                           must call RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the Credentials in the array.
+        * @param    aCredentialProperties    an array with 0 or more
+        *                           CredentialsProperties.
+        *                           The ownership of the array (and
+        *                           CredentialProperties) is passed to the caller
+        *                           so before the array goes out of scope in the 
+        *                           client, the caller must call
+        *                           RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the CredentialProperties in the array.
+        *                           Note: aCredentials array and
+        *                                 aCredentialProperties array are in
+        *                                 sync. If Credential has properties,
+        *                                 properties are placed in same 
+        *                                 position in aCredentialProperties array
+        *                                 as raleted Credential in aCredentials
+        *                                 array.
+        *                           Note: If Credential has no properties,
+        *                                 there is NULL in related position
+        *                                 in aCredentialProperties array.
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Endpoint.
+        * KErrSenNoPermission       Given IdentityProvider did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CredentialsL(const TDesC8& aEndpoint,
+                                  const TDesC8& aUserName,
+                                  const TDesC8& aPassword,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties) = 0;
+
+        /**
+        * Consumer applications use this method for finding Credentials.
+        * IdentityProvider or Username and Password are given either via 
+        * IdentityProviderL() callback or UsernameL() and Password()
+        * callbacks from MSenAuthenticationProvider (which can be given
+        * through specialized NewL or NewLC methods).
+        *
+        * @param    aPattern        the pattern which identifies the Credential
+        *                           Note: Pattern which was used to add Credential
+        *                                 has to be used for finding Credential.
+        *                           Note: Used Framework should specify what
+        *                                 kind of pattern should be used
+        *                                 for storing framework specific
+        *                                 Credentials.
+        * @param    aCredentials    an array with 0 or more Credentials.
+        *                           The ownership of the array (and Credentials)
+        *                           is passed to the caller so before the array
+        *                           goes out of scope in the client, the caller
+        *                           must call RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the Credentials in the array.
+        * @param    aCredentialProperties    an array with 0 or more
+        *                           CredentialsProperties.
+        *                           The ownership of the array (and
+        *                           CredentialProperties) is passed to the caller
+        *                           so before the array goes out of scope in the 
+        *                           client, the caller must call
+        *                           RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the CredentialProperties in the array.
+        *                           Note: aCredentials array and
+        *                                 aCredentialProperties array are in
+        *                                 sync. If Credential has properties,
+        *                                 properties are placed in same 
+        *                                 position in aCredentialProperties array
+        *                                 as raleted Credential in aCredentials
+        *                                 array.
+        *                           Note: If Credential has no properties,
+        *                                 there is NULL in related position
+        *                                 in aCredentialProperties array.
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Endpoint.
+        * KErrSenNoPermission       Given IdentityProvider or Username and
+        *                           Password did not match for IdentityProvider
+        *                           which is related to found Credential(s).
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CredentialsL(const MSenServiceDescription& aPattern,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties) = 0;
+        
+        /**
+        * Consumer applications use this method for finding Credentials.
+        *
+        * @param    aPattern        the pattern which identifies the Credential
+        *                           Note: Pattern which was used to add Credential
+        *                                 has to be used for finding Credential.
+        *                           Note: Used Framework should specify what
+        *                                 kind of pattern should be used
+        *                                 for storing framework specific
+        *                                 Credentials.
+        * @param    aIdP            the IdentityProvider which should match
+        *                           for IdentityProvider which is related to
+        *                           found Credential(s).
+        * @param    aCredentials    an array with 0 or more Credentials.
+        *                           The ownership of the array (and Credentials)
+        *                           is passed to the caller so before the array
+        *                           goes out of scope in the client, the caller
+        *                           must call RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the Credentials in the array.
+        * @param    aCredentialProperties    an array with 0 or more
+        *                           CredentialsProperties.
+        *                           The ownership of the array (and
+        *                           CredentialProperties) is passed to the caller
+        *                           so before the array goes out of scope in the 
+        *                           client, the caller must call
+        *                           RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the CredentialProperties in the array.
+        *                           Note: aCredentials array and
+        *                                 aCredentialProperties array are in
+        *                                 sync. If Credential has properties,
+        *                                 properties are placed in same 
+        *                                 position in aCredentialProperties array
+        *                                 as raleted Credential in aCredentials
+        *                                 array.
+        *                           Note: If Credential has no properties,
+        *                                 there is NULL in related position
+        *                                 in aCredentialProperties array.
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Endpoint.
+        * KErrSenNoPermission       Given IdentityProvider did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CredentialsL(const MSenServiceDescription& aPattern,
+                                  const CSenIdentityProvider& aIdP,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties) = 0;
+                                  
+        /**
+        * Consumer applications use this method for finding Credentials.
+        *
+        * @param    aPattern        the pattern which identifies the Credential
+        *                           Note: Pattern which was used to add Credential
+        *                                 has to be used for finding Credential.
+        *                           Note: Used Framework should specify what
+        *                                 kind of pattern should be used
+        *                                 for storing framework specific
+        *                                 Credentials.
+        * @param    aUserName       the username which should match for 
+        *                           username in IdentityProvider which is related
+        *                           to found Credential(s).
+        * @param    aPassword       the password which should match for 
+        *                           password in IdentityProvider which is related
+        *                           to found Credential(s).
+        * @param    aCredentials    an array with 0 or more Credentials.
+        *                           The ownership of the array (and Credentials)
+        *                           is passed to the caller so before the array
+        *                           goes out of scope in the client, the caller
+        *                           must call RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the Credentials in the array.
+        * @param    aCredentialProperties    an array with 0 or more
+        *                           CredentialsProperties.
+        *                           The ownership of the array (and
+        *                           CredentialProperties) is passed to the caller
+        *                           so before the array goes out of scope in the 
+        *                           client, the caller must call
+        *                           RPointerArray::ResetAndDestroy()
+        *                           on the array to close the array and delete
+        *                           all the CredentialProperties in the array.
+        *                           Note: aCredentials array and
+        *                                 aCredentialProperties array are in
+        *                                 sync. If Credential has properties,
+        *                                 properties are placed in same 
+        *                                 position in aCredentialProperties array
+        *                                 as raleted Credential in aCredentials
+        *                                 array.
+        *                           Note: If Credential has no properties,
+        *                                 there is NULL in related position
+        *                                 in aCredentialProperties array.
+        *                                 
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Endpoint.
+        * KErrSenNoPermission       Given IdentityProvider did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential.
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt CredentialsL(const MSenServiceDescription& aPattern,
+                                  const TDesC8& aUserName,
+                                  const TDesC8& aPassword,
+                                  RCredentialArray& aCredentials,
+                                  RCredentialPropertiesArray& aCredentialProperties) = 0;
+        /**
+        * Consumer applications use this method for adding Credential.
+        *
+        * @param    aEndpoint       the endpoint which identifies the Credential
+        * @param    aIdP            the IdentityProvider which will be related
+        *                           to added Credential.
+        * @param    aCredential     the Credential which will be added.
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrBadDescriptor         One of the parameters was invalid.
+        * KErrNotFound              Given IdentityProvider was not found
+        *                           and because of that Credential could
+        *                           not be added. (Fix: Register IdentityProvider
+        *                           first and try to add Credential after that.)
+        *                           
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt AddCredentialL(const TDesC8& aEndpoint,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential) = 0;
+                                        
+        /**
+        * Consumer applications use this method for adding Credential.
+        *
+        * @param    aPattern        the pattern which identifies the Credential
+        *                           Note: Exactly the same pattern has to be
+        *                                 used for finding Credential.
+        *                           Note: Used Framework should specify what
+        *                                 kind of pattern should be used
+        *                                 for handling framework specific
+        *                                 Credentials.
+        * @param    aIdP            the IdentityProvider which will be related
+        *                           to added Credential.
+        * @param    aCredential     the Credential which will be added.
+        *
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrBadDescriptor         One of the parameters was invalid.
+        * KErrNotFound              Given IdentityProvider was not found
+        *                           and because of that Credential could
+        *                           not be added. (Fix: Register IdentityProvider
+        *                           first and try to add Credential after that)
+        *                           
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt AddCredentialL(const MSenServiceDescription& aPattern,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential) = 0;
+                                    
+        /**
+        * Consumer applications use this method for adding Credential.
+        *
+        * @param    aEndpoint               the endpoint which identifies the
+        *                                   Credential
+        * @param    aIdP                    the IdentityProvider which will be
+        *                                   related to added Credential.
+        * @param    aCredential             the Credential which will be added.
+        * @param    aCredentialProperties   the properties for Credential
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrBadDescriptor         One of the parameters was invalid.
+        * KErrNotFound              Given IdentityProvider was not found
+        *                           and because of that Credential could
+        *                           not be added. (Fix: Register IdentityProvider
+        *                           first and try to add Credential after that.)
+        *                           
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt AddCredentialL(const TDesC8& aEndpoint,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential,
+                                    const CSenXmlProperties& aCredentialProperties) = 0;
+                                        
+        /**
+        * Consumer applications use this method for adding Credential.
+        *
+        * @param    aPattern                the pattern which identifies the
+        *                                   Credential
+        *                                   Note: Exactly the same pattern has
+        *                                         to be used for finding
+        *                                         Credential.
+        *                                   Note: Used Framework should specify
+        *                                         what kind of pattern should be
+        *                                         used for handling framework
+        *                                         specific Credentials.
+        * @param    aIdP                    the IdentityProvider which will be
+        *                                   related to added Credential.
+        * @param    aCredential             the Credential which will be added.
+        * @param    aCredentialProperties   the properties for Credential
+        *
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrBadDescriptor         One of the parameters was invalid.
+        * KErrNotFound              Given IdentityProvider was not found
+        *                           and because of that Credential could
+        *                           not be added. (Fix: Register IdentityProvider
+        *                           first and try to add Credential after that)
+        *                           
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt AddCredentialL(const MSenServiceDescription& aPattern,
+                                    const CSenIdentityProvider& aIdP,
+                                    const CSenCredential2& aCredential,
+                                    const CSenXmlProperties& aCredentialProperties) = 0;
+                                    
+        /**
+        * Consumer applications use this method for removing Credentials.
+        *
+        * @param    aPattern        the pattern which identifies the Credential
+        *                           Note: Pattern which was used to add Credential
+        *                                 has to be used for removing Credential.
+        *                           Note: Used Framework should specify what
+        *                                 kind of pattern should be used
+        *                                 for handling framework specific
+        *                                 Credentials.
+        * @param    aIdP            the IdentityProvider which should match
+        *                           for IdentityProvider which is related to
+        *                           found Credential(s).
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Pattern.
+        * KErrSenNoPermission       Given IdentityProvider did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential(s).
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt RemoveCredentialsL(const MSenServiceDescription& aPattern,
+                                        const CSenIdentityProvider& aIdP) = 0;
+
+        /**
+        * Consumer applications use this method for removing Credentials.
+        *
+        * @param    aIdP            the IdentityProvider which should match
+        *                           for IdentityProvider which is related to
+        *                           found Credential(s).
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Pattern.
+        * KErrSenNoPermission       Given IdentityProvider did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential(s).
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt RemoveCredentialsL(const CSenIdentityProvider& aIdP) = 0;
+
+        /**
+        * Consumer applications use this method for removing Credentials.
+        *
+        * @param    aPattern        the pattern which identifies the Credential
+        *                           Note: Pattern which was used to add Credential
+        *                                 has to be used for finding Credential.
+        *                           Note: Used Framework should specify what
+        *                                 kind of pattern should be used
+        *                                 for handling framework specific
+        *                                 Credentials.
+        * @param    aUserName       the username which should match for 
+        *                           username in IdentityProvider which is related
+        *                           to found Credential(s).
+        * @param    aPassword       the password which should match for 
+        *                           password in IdentityProvider which is related
+        *                           to found Credential(s).
+        * Status codes:
+        * KErrNone                  ok
+        *
+        * Error codes:
+        * KErrNotFound              Web Services framework couldn't find
+        *                           the Credentials using given Pattern.
+        * KErrSenNoPermission       Given Username and Password did not match for
+        *                           IdentityProvider which is related to
+        *                           found Credential(s).
+        * Other error codes are system-wide Symbian error codes.
+        */
+        virtual TInt RemoveCredentialsL(const MSenServiceDescription& aPattern,
+                                        const TDesC8& aUserName,
+                                        const TDesC8& aPassword) = 0;
+                                        
+        
+        /**
+        * This method provides an interface which is identified by unique ID (UID).
+        * @param aUID is the UID of the interface being requested
+        * @return TAny* pointer to the interface, or if no interface to 
+        * given UID exists, function returns NULL. In typical cases, returned
+        * pointer should be cast to some preknown M-class pointer (the actual
+        * new interface).
+        *
+        * Currently, there is only one supported interface:
+        * KSenInterfaceUidInternalServiceManager => MSenInternalServiceManager
+        */  
+        virtual TAny* InterfaceByUid( TUid aUID ) = 0;
+
+    protected:
+    
+        /**
+        * C++ default constructor 
+        */
+        CSenServiceManager();
+    };
+
+#endif //SEN_SERVICE_MANAGER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/bmarm/SenServiceManagerBCTestU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	LibEntryL__Fv @ 1 NONAME R3UNUSED ; LibEntryL(void)
+	SetRequirements__FRP16CTestModuleParamRUl @ 2 NONAME R3UNUSED ; SetRequirements(CTestModuleParam *&, unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/bwins/SenServiceManagerBCTestU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * __cdecl LibEntryL(void)
+	?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int __cdecl SetRequirements(class CTestModuleParam * &,unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/eabi/SenServiceManagerBCTestu.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/group/SenServiceManager.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senservicemanger 
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+TARGET          SenServiceManagerBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+VENDORID        VID_DEFAULT
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         SenServiceManagerBCTest.DEF
+
+SOURCEPATH      ../src
+SOURCE          SenServiceManager.cpp
+SOURCE          SenServiceManagerCases.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenXml.lib
+LIBRARY					efsrv.lib
+LIBRARY					SenServMgr.lib
+LIBRARY					XMLFRAMEWORK.lib
+library					ecom.lib
+LIBRARY					avkon.lib 
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+../sis/TestSM_c.bat		/epoc32/winscw/c/TestSM_c.bat
+../sis/TestSM_z.bat		/epoc32/winscw/c/TestSM_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_senservicemanager.ini/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+SenServiceManager.mmp
+
+//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/inc/SenServiceManagerBCTest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenServiceManager_stif test module.
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENSERVICEMANAGERBCTEST_H
+#define SENSERVICEMANAGERBCTEST_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenXmlServiceDescription.h>
+#include <SenServiceConnection.h>
+#include <f32file.h>
+
+
+//  INTERNAL INCLUDES
+namespace{
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+}
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 30
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 6
+
+// Logging path
+_LIT( KSenServiceManager_stifLogPath, "\\logs\\testframework\\SenServiceManager_stif\\" ); 
+// Log file
+_LIT( KSenServiceManager_stifLogFile, "SenServiceManager_stif.txt" ); 
+
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenServiceManagerBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenServiceManagerBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenServiceManagerBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a SenServiceManager_stif class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenServiceManagerBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenServiceManagerBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenServiceManagerBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenServiceManager_stif. It is called once for every instance of 
+        *       TestModuleSenServiceManager_stif after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenServiceManager_stif.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenServiceManager_stif. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+				
+				/**
+         * Method used to log version of test class
+         */
+        void SendTestModuleVersion();
+        
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceManagerBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+
+
+    private:    // methods
+    			
+         void Empty();
+
+         void SetupL();
+        
+         void Teardown();
+         void DeleteDBL();
+         
+         
+         TInt UT_CSenServiceManager_NewLL(TTestResult& aResult);
+        
+         TInt UT_CSenServiceManager_NewLCL(TTestResult& aResult);
+        
+        	  
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_nullL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(TTestResult& aResult);
+        
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(TTestResult& aResult);
+         
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(TTestResult& aResult);
+         
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(TTestResult& aResult);
+        
+        
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(TTestResult& aResult);
+
+        
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(TTestResult& aResult);
+        
+        
+         TInt UT_CSenServiceManager_AssociateServiceLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_AssociateServiceLL_argumentL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_AssociateServiceLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_AssociateServiceLL_notFoundL(TTestResult& aResult);
+        
+        
+         TInt UT_CSenServiceManager_DissociateServiceLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_DissociateServiceLL_argumentL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_DissociateServiceLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_DissociateServiceLL_notFoundL(TTestResult& aResult);
+        
+
+    private:    // Data
+        CSenServiceManager*         iServiceManager;
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenIdentityProvider*       iProvider;
+        RFs                         iFsSession;
+
+		CActiveScheduler* iActiveScheduler;
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENSERVICEMANAGERBCTEST_H
+
+// End of File
\ No newline at end of file
Binary file websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:        
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Manager"},(0x10282CAC),3,0,0,TYPE=SA
+[0x101F7961],0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenServiceManagerBCTest.dll"-"!:\sys\bin\SenServiceManagerBCTest.dll"
+"\Epoc32\winscw\c\testSM_c.bat"-"!:\testSM.bat"
+"\Epoc32\winscw\c\testframework\testframework_senservicemanager.ini"-"!:\testframework\testframework_senservicemanager.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\TestFramework_senservicemanager.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServiceManagerBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSManager.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_senservicemanager.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServiceManagerBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSManager.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServiceManagerBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,396 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenServiceManager_stif class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "SenServiceManagerBCTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::CSenServiceManagerBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenServiceManagerBCTest::CSenServiceManagerBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenServiceManager_stifLogPath, 
+                          KSenServiceManager_stifLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "SenServiceManager_stif logging starts!" );
+    iLog->Log( KLogStart );
+    
+    iActiveScheduler = new CActiveScheduler;
+	CActiveScheduler::Install( iActiveScheduler );
+	
+
+    }
+
+//-----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::SendTestModuleVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::SendTestModuleVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("SenServiceManagerBCTest.dll");
+	
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	TestModuleIf().SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenServiceManagerBCTest* CSenServiceManagerBCTest::NewL()
+    {
+    CSenServiceManagerBCTest* self = new (ELeave) CSenServiceManagerBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenServiceManagerBCTest::~CSenServiceManagerBCTest()
+    {
+    delete iLog;
+    
+    delete iActiveScheduler;
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceManagerBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceManagerBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceManagerBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+		SendTestModuleVersion();
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenServiceManagerBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenServiceManagerBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenServiceManagerBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManagerCases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1037 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "SenServiceManagerBCTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenServiceManagerBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServiceManager_stif.cpp file and to SenServiceManager_stif.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServiceManagerBCTest::PrintTest. Otherwise the compiler
+        // gives errors.
+        
+		ENTRY("NewL - test ", CSenServiceManagerBCTest::UT_CSenServiceManager_NewLL),
+		ENTRY("NewLC - test ", CSenServiceManagerBCTest::UT_CSenServiceManager_NewLCL),
+		ENTRY("normal - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_normalL),
+		ENTRY("notFound - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL),
+		ENTRY("badDescriptor - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL),
+		ENTRY("NULL - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_nullL),
+		ENTRY("randomPtr - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL),
+		ENTRY("normal(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL),
+		ENTRY("notFound(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL),
+		ENTRY("badDescriptor(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL),
+		ENTRY("XMLPattern(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL),
+		ENTRY("normal - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL),
+		ENTRY("badDescriptor - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL),
+		ENTRY("no Endpoint - RegisterServiceDescriptionL ", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL),
+		ENTRY("no Contract - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL),
+		ENTRY("bad Framework - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL),
+		ENTRY("random Ptr - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL),
+		ENTRY("NULL - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL),
+		ENTRY("normal - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL),
+		ENTRY("badDescriptor - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL),
+		ENTRY("noEndpoint - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL),
+		ENTRY("noContract - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL),
+		ENTRY("badFramework - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL),
+		ENTRY("randomPtr - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL),
+		ENTRY("NULL - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL),
+		ENTRY("normal - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_normalL),
+		ENTRY("badDescriptor - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL),
+		ENTRY("providerIDInUse - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL),
+		ENTRY("NULL - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_nullL),
+		ENTRY("randomPtr - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL),
+		ENTRY("normal - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL),
+		ENTRY("badDescriptor - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL),
+		ENTRY("notFound - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL),
+		ENTRY("NULL - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL),
+		ENTRY("randomPtr - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL),
+		ENTRY("normal - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_normalL),
+		ENTRY("argument - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_argumentL),
+		ENTRY("notReady - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notReadyL),
+		ENTRY("notFound - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notFoundL),
+		ENTRY("normal - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_normalL),
+		ENTRY("argument - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_argumentL),
+		ENTRY("notReady - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notReadyL),
+		ENTRY("notFound - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notFoundL),
+
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CSenServiceManagerBCTest::Empty(  )
+{
+}
+void CSenServiceManagerBCTest::DeleteDBL(){
+    TPtrC file;
+    TInt fileErr = KErrNone;
+    
+    CFileMan* fileMan = CFileMan::NewL(iFsSession);
+    CleanupStack::PushL(fileMan);
+    
+    fileErr = fileMan->Delete(KSessionsFile);
+    RDebug::Print( KSessionsFile);
+    RDebug::Print( _L( "WSModTester: DeleteFileL status %d" ), fileErr );
+
+	if(!(fileErr == KErrNone || fileErr == KErrNotFound))
+	{
+		User::LeaveIfError(fileErr);
+	}
+
+    fileErr = fileMan->Delete(KIdentitiesFile);
+    RDebug::Print( _L( "WSModTester: DeleteFileL status %d" ), fileErr );
+	if(!(fileErr == KErrNone || fileErr == KErrNotFound))
+	{
+		User::LeaveIfError(fileErr);
+	}
+
+    CleanupStack::PopAndDestroy();
+}
+
+void CSenServiceManagerBCTest::SetupL(  )
+    {
+    User::LeaveIfError(this->iFsSession.Connect());
+
+    DeleteDBL();
+	
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    iServiceManager = CSenServiceManager::NewL();
+    User::LeaveIfNull(iServiceManager);
+
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    User::LeaveIfNull(iSenXmlServiceDescription);
+    
+    if ( iProvider != NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+    iProvider = CSenIdentityProvider::NewL(KText, KText);
+    User::LeaveIfNull(iProvider);
+    
+    } 
+
+void CSenServiceManagerBCTest::Teardown(  )
+    {
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    if ( iProvider!= NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+    iFsSession.Close();
+    }
+    
+//-------------------------------------------
+//              METHODS
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_NewLL( TTestResult& aResult )
+    {
+    Empty();
+    
+    CSenServiceManager*     serviceManager = NULL;
+    CSenServiceManager*     serviceManager2 = NULL;
+    serviceManager = CSenServiceManager::NewL();
+    TL(serviceManager != (CSenServiceManager*)NULL);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+    
+    serviceManager = NULL;
+
+    serviceManager = CSenServiceManager::NewL();
+    TRAPD(error, serviceManager2 = CSenServiceManager::NewL());
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_NewL 2nd try with status %d" ), error);
+    LOCAL_ASSERT(error==KErrNone);
+
+    if (serviceManager != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+        serviceManager = NULL;
+    }
+
+    if (serviceManager2 != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager2 );
+        serviceManager2 = NULL;
+    }
+
+    Empty();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_NewLCL( TTestResult& aResult )
+    {
+    Empty();
+    
+    CSenServiceManager*     serviceManager = NULL;
+    serviceManager = CSenServiceManager::NewLC();
+    TL(serviceManager != (CSenServiceManager*)NULL);
+    CleanupStack::PopAndDestroy();
+    serviceManager = NULL;
+    Empty();
+	return KErrNone;
+    }
+
+//-------------------------------------------
+//              SEARCHING
+//-------------------------------------------
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+	   
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr) == KErrNone);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 1);
+    arr.ResetAndDestroy();
+    
+    //Added Vaibhav
+    iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+    RServiceDescriptionArray arr;
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+    RServiceDescriptionArray arr;
+	
+	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif     
+	iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+	
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+    RServiceDescriptionArray arr;
+
+	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException,EExcPageFault);
+	#endif      
+	iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+    
+    TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(TTestResult& aResult)
+    {
+    
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KText, arr) == KErrNone);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 1);
+    arr.ResetAndDestroy();
+
+	//Added Vaibhav
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(TTestResult& aResult)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KText, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(TTestResult& aResult)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+//    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KNullDesC8, arr) == KErrBadDescriptor);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(TTestResult& aResult)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    _LIT8(KXmlPattern, "&<>");
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KXmlPattern, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+//-------------------------------------------
+//              REGISTERING SERVICE
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(TTestResult& aResult){
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+ 	//Added Vaibhav
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+	
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult){
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+   TInt error = KErrNone;
+    
+    //not set
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetContractL(KText);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noEndpoint status %d" ), error);
+
+    //null
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noEndpoint status %d" ), error);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    TInt error = KErrNone;
+    
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+	error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    
+    //not set
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    LOCAL_ASSERT(error == KErrSenNoContract);
+    
+    //null
+    iSenXmlServiceDescription->SetContractL(KNullDesC8);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    LOCAL_ASSERT(error == KErrSenNoContract);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    _LIT8(KBadFramework,"bla");
+    iSenXmlServiceDescription->SetFrameworkIdL(KBadFramework);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+}
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(TTestResult& aResult){
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(TTestResult& aResult){
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+//-------------------------------------------
+//              UNREGISTERING SERVICE
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult){
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+   iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetContractL(KNullDesC8);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrSenNoContract);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    _LIT8(KBadFramework,"bla");
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetFrameworkIdL(KBadFramework);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              REGISTERING IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+	//Added Vaibhav
+	iServiceManager->UnregisterIdentityProviderL(*iProvider);
+	
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(TTestResult& aResult)
+    {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    iServiceManager->RegisterIdentityProviderL(*iProvider);
+    
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText2, KText2);
+    provider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*provider)) == KErrSenProviderIdInUseByAnotherEndpoint); 
+    delete provider;
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterIdentityProviderL(*iProvider);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = (CSenIdentityProvider *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterIdentityProviderL(*iProvider);
+
+    Teardown();
+    return KErrNone;
+    }
+
+//-------------------------------------------
+//              UNREGISTERING IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->UnregisterIdentityProviderL( *iProvider)) == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText2, KText2);
+    provider->SetProviderID(KText2);
+    LOCAL_ASSERT((iServiceManager->UnregisterIdentityProviderL( *provider)) == KErrNotFound);
+    delete provider;
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = (CSenIdentityProvider *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              ASSOCIATE IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_normalL(TTestResult& aResult)
+ {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText2);
+   	iProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+    //2nd time doesnt matter
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+
+	//Added Vaibhav
+	iServiceManager->DissociateServiceL(KText, KText2);
+	iServiceManager->UnregisterIdentityProviderL(*iProvider);
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_argumentL(TTestResult& aResult)
+ {
+	SetupL(); 
+
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KNullDesC8)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KText)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument);
+    _LIT8(KPattern, "&<>");
+    iProvider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notReadyL(TTestResult& aResult)
+ {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notFoundL(TTestResult& aResult)
+ {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    iProvider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText2, KText2)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+ }
+//-------------------------------------------
+//              DISSOCIATE IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText2);
+   	iProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+    TInt error = KErrNone;
+    error = iServiceManager->DissociateServiceL(KText, KText2);
+    RDebug::Print( _L( "WSModTester: DissociateService status %d" ), error);
+    LOCAL_ASSERT(error == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_argumentL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KNullDesC8)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KNullDesC8, KText)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notReadyL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notFoundL(TTestResult& aResult)
+    {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KText)) == KErrNotFound);
+    _LIT8(KPattern, "&<>");
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// ?classname::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?classname::?member_function(
+   ?arg_type arg,
+   ?arg_type arg )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ?function_name implements...
+// ?implementation_description.
+// Returns: ?value_1: ?description
+//          ?value_n: ?description
+//                    ?description
+// -----------------------------------------------------------------------------
+//
+/*
+?type  ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg )  // ?description
+    {
+
+    ?code
+
+    }
+*/
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for   web_service_manger_api test source
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+../senservicemanagerTester/group/senservicemanagerTester.mmp
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/bmarm/senservicemanagerbctestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__Fv @ 1 NONAME R3UNUSED ; LibEntryL(void)	SetRequirements__FRP16CTestModuleParamRUl @ 2 NONAME R3UNUSED ; SetRequirements(CTestModuleParam *&, unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/bwins/SenServiceManagerBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * __cdecl LibEntryL(void)
+	?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int __cdecl SetRequirements(class CTestModuleParam * &,unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/eabi/senservicemanagerbctestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/SenServiceManagerBCTest_UID_.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x1000008d,0x101fb3e7,EPriorityForeground,0x000ffffeu,0x00000000u,0x101fb3e7,0,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+../sis/testsm_c.bat		/epoc32/winscw/c/TestSM_c.bat
+../sis/testsm_z.bat		/epoc32/winscw/c/TestSM_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_senservicemanager.ini/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+senservicemanager.mmp
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/senservicemanager.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senservicemanger 
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+TARGET          SenServiceManagerBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+VENDORID        VID_DEFAULT
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         senservicemanagerbctest.def
+
+SOURCEPATH      ../src
+SOURCE          senservicemanager.cpp
+SOURCE          senservicemanagercases.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+SYSTEMINCLUDE   /epoc32/include/libc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenXml.lib
+LIBRARY					efsrv.lib
+LIBRARY					SenServMgr.lib
+LIBRARY					XMLFRAMEWORK.lib
+library					ecom.lib
+LIBRARY					avkon.lib 
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/group/senservicemanager.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Manager"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenServiceManagerBCTest.dll"-"!:\sys\bin\SenServiceManagerBCTest.dll"
+;"\Epoc32\winscw\c\testSM_c.bat"-"!:\testSM.bat"
+"..\init\SenServiceManagerBCTest.ini"-"!:\testframework\SenServiceManagerBCTest.ini"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/inc/senservicemanagerbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,404 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenServiceManager_stif test module.
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENSERVICEMANAGERBCTEST_H
+#define SENSERVICEMANAGERBCTEST_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenXmlServiceDescription.h>
+#include <SenServiceConnection.h>
+#include <f32file.h>
+
+
+//  INTERNAL INCLUDES
+namespace{
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+}
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// Logging path
+_LIT( KSenServiceManager_stifLogPath, "\\logs\\testframework\\SenServiceManager_stif\\" ); 
+// Log file
+_LIT( KSenServiceManager_stifLogFile, "SenServiceManager_stif.txt" ); 
+
+
+#define GETPTR &
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenServiceManagerBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenServiceManagerBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenServiceManagerBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a SenServiceManager_stif class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenServiceManagerBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenServiceManagerBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenServiceManagerBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       SenServiceManager_stif. It is called once for every instance of 
+        *       TestModuleSenServiceManager_stif after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of SenServiceManager_stif.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from SenServiceManager_stif. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenServiceManagerBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+
+
+    private:    // methods
+    			
+         void Empty();
+
+         void SetupL();
+        
+         void Teardown();
+         void DeleteDBL();
+         
+         
+         TInt UT_CSenServiceManager_NewLL(TTestResult& aResult);
+        
+         TInt UT_CSenServiceManager_NewLCL(TTestResult& aResult);
+        
+        	  
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_nullL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(TTestResult& aResult);
+        
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(TTestResult& aResult);
+         
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(TTestResult& aResult);
+         
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(TTestResult& aResult);
+        
+        
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(TTestResult& aResult);
+
+        
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(TTestResult& aResult);
+        
+        
+         TInt UT_CSenServiceManager_AssociateServiceLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_AssociateServiceLL_argumentL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_AssociateServiceLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_AssociateServiceLL_notFoundL(TTestResult& aResult);
+        
+        
+         TInt UT_CSenServiceManager_DissociateServiceLL_normalL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_DissociateServiceLL_argumentL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_DissociateServiceLL_notReadyL(TTestResult& aResult);
+         TInt UT_CSenServiceManager_DissociateServiceLL_notFoundL(TTestResult& aResult);
+        
+
+    private:    // Data
+        CSenServiceManager*         iServiceManager;
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenIdentityProvider*       iProvider;
+        RFs                         iFsSession;
+
+		CActiveScheduler* iActiveScheduler;
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENSERVICEMANAGERBCTEST_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/init/SenServiceManagerBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServiceManagerBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/rom/senservicemanager.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SENSERVICEMANAGER_IBY__
+#define SENSERVICEMANAGER_IBY__
+
+file=ABI_DIR\BUILD_DIR\SenServiceManagerBCTest.dll        PROGRAMS_DIR\SenServiceManagerBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/SenServiceManagerBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServiceManagerBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/senservicemanager.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Manager"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenServiceManagerBCTest.dll"-"!:\sys\bin\SenServiceManagerBCTest.dll"
+"\Epoc32\winscw\c\testSM_c.bat"-"!:\testSM.bat"
+"\Epoc32\winscw\c\testframework\testframework_senservicemanager.ini"-"!:\testframework\testframework_senservicemanager.ini"
Binary file websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/senservicemanager.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenServiceManagerBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/testsm_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,22 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\TestFramework_senservicemanager.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServiceManagerBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSManager.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/sis/testsm_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy z:\TestFramework\TestFramework_senservicemanager.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\Results
+
+ATSINTERFACE.EXE -testmodule SenServiceManagerBCTest
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSManager.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/src/senservicemanager.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          SenServiceManager_stif class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senservicemanagerbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::CSenServiceManagerBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenServiceManagerBCTest::CSenServiceManagerBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenServiceManager_stifLogPath, 
+                          KSenServiceManager_stifLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "SenServiceManager_stif logging starts!" );
+    iLog->Log( KLogStart );
+    
+    iActiveScheduler = new CActiveScheduler;
+	CActiveScheduler::Install( iActiveScheduler );
+	
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenServiceManagerBCTest* CSenServiceManagerBCTest::NewL()
+    {
+    CSenServiceManagerBCTest* self = new (ELeave) CSenServiceManagerBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenServiceManagerBCTest::~CSenServiceManagerBCTest()
+    {
+    delete iLog;
+    
+    delete iActiveScheduler;
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceManagerBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceManagerBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenServiceManagerBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenServiceManagerBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenServiceManagerBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenServiceManagerBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenServiceManagerBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanager/src/senservicemanagercases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1036 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <e32math.h>
+#include "senservicemanagerbctest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+
+//Macro for Porting to STIF
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenServiceManagerBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenServiceManagerBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenServiceManager_stif.cpp file and to SenServiceManager_stif.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        // To add new test cases, add new items to this array
+        
+        // NOTE: When compiled to GCCE, there must be Classname::
+        // declaration in front of the method name, e.g. 
+        // CSenServiceManagerBCTest::PrintTest. Otherwise the compiler
+        // gives errors.
+        
+		ENTRY("NewL - test ", CSenServiceManagerBCTest::UT_CSenServiceManager_NewLL),
+		ENTRY("NewLC - test ", CSenServiceManagerBCTest::UT_CSenServiceManager_NewLCL),
+		ENTRY("normal - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_normalL),
+		ENTRY("notFound - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL),
+		ENTRY("badDescriptor - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL),
+		ENTRY("NULL - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_nullL),
+		ENTRY("randomPtr - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL),
+		ENTRY("normal(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL),
+		ENTRY("notFound(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL),
+		ENTRY("badDescriptor(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL),
+		ENTRY("XMLPattern(URI) - ServiceDescriptionsL", CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL),
+		ENTRY("normal - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL),
+		ENTRY("badDescriptor - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL),
+		ENTRY("no Endpoint - RegisterServiceDescriptionL ", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL),
+		ENTRY("no Contract - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL),
+		ENTRY("bad Framework - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL),
+		ENTRY("random Ptr - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL),
+		ENTRY("NULL - RegisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL),
+		ENTRY("normal - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL),
+		ENTRY("badDescriptor - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL),
+		ENTRY("noEndpoint - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL),
+		ENTRY("noContract - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL),
+		ENTRY("badFramework - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL),
+		ENTRY("randomPtr - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL),
+		ENTRY("NULL - UnregisterServiceDescriptionL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL),
+		ENTRY("normal - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_normalL),
+		ENTRY("badDescriptor - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL),
+		ENTRY("providerIDInUse - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL),
+		ENTRY("NULL - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_nullL),
+		ENTRY("randomPtr - RegisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL),
+		ENTRY("normal - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL),
+		ENTRY("badDescriptor - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL),
+		ENTRY("notFound - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL),
+		ENTRY("NULL - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL),
+		ENTRY("randomPtr - UnregisterIdentityProviderL", CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL),
+		ENTRY("normal - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_normalL),
+		ENTRY("argument - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_argumentL),
+		ENTRY("notReady - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notReadyL),
+		ENTRY("notFound - AssociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notFoundL),
+		ENTRY("normal - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_normalL),
+		ENTRY("argument - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_argumentL),
+		ENTRY("notReady - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notReadyL),
+		ENTRY("notFound - DissociateServiceL", CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notFoundL),
+
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CSenServiceManagerBCTest::Empty(  )
+{
+}
+void CSenServiceManagerBCTest::DeleteDBL(){
+    TPtrC file;
+    TInt fileErr = KErrNone;
+    
+    CFileMan* fileMan = CFileMan::NewL(iFsSession);
+    CleanupStack::PushL(fileMan);
+    
+    fileErr = fileMan->Delete(KSessionsFile);
+    RDebug::Print( KSessionsFile);
+    RDebug::Print( _L( "WSModTester: DeleteFileL status %d" ), fileErr );
+
+	if(!(fileErr == KErrNone || fileErr == KErrNotFound))
+	{
+		User::LeaveIfError(fileErr);
+	}
+
+    fileErr = fileMan->Delete(KIdentitiesFile);
+    RDebug::Print( _L( "WSModTester: DeleteFileL status %d" ), fileErr );
+	if(!(fileErr == KErrNone || fileErr == KErrNotFound))
+	{
+		User::LeaveIfError(fileErr);
+	}
+
+    CleanupStack::PopAndDestroy();
+}
+
+void CSenServiceManagerBCTest::SetupL(  )
+    {
+    User::LeaveIfError(this->iFsSession.Connect());
+
+    DeleteDBL();
+	
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    iServiceManager = CSenServiceManager::NewL();
+    User::LeaveIfNull(iServiceManager);
+
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    User::LeaveIfNull(iSenXmlServiceDescription);
+    
+    if ( iProvider != NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+    iProvider = CSenIdentityProvider::NewL(KText, KText);
+    User::LeaveIfNull(iProvider);
+    
+    } 
+
+void CSenServiceManagerBCTest::Teardown(  )
+    {
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    if ( iProvider!= NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+    iFsSession.Close();
+    }
+    
+//-------------------------------------------
+//              METHODS
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_NewLL( TTestResult& aResult )
+    {
+    Empty();
+    
+    CSenServiceManager*     serviceManager = NULL;
+    CSenServiceManager*     serviceManager2 = NULL;
+    serviceManager = CSenServiceManager::NewL();
+    TL(serviceManager != (CSenServiceManager*)NULL);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+    
+    serviceManager = NULL;
+
+    serviceManager = CSenServiceManager::NewL();
+    TRAPD(error, serviceManager2 = CSenServiceManager::NewL());
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_NewL 2nd try with status %d" ), error);
+    LOCAL_ASSERT(error==KErrNone);
+
+    if (serviceManager != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+        serviceManager = NULL;
+    }
+
+    if (serviceManager2 != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager2 );
+        serviceManager2 = NULL;
+    }
+
+    Empty();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_NewLCL( TTestResult& aResult )
+    {
+    Empty();
+    
+    CSenServiceManager*     serviceManager = NULL;
+    serviceManager = CSenServiceManager::NewLC();
+    TL(serviceManager != (CSenServiceManager*)NULL);
+    CleanupStack::PopAndDestroy();
+    serviceManager = NULL;
+    Empty();
+	return KErrNone;
+    }
+
+//-------------------------------------------
+//              SEARCHING
+//-------------------------------------------
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+	   
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr) == KErrNone);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 1);
+    arr.ResetAndDestroy();
+    
+    //Added Vaibhav
+    iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+    RServiceDescriptionArray arr;
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+    RServiceDescriptionArray arr;
+	
+	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif     
+	iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+	
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+    RServiceDescriptionArray arr;
+
+	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException,EExcPageFault);
+	#endif      
+	iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+    
+    TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(TTestResult& aResult)
+    {
+    
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KText, arr) == KErrNone);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 1);
+    
+    arr.ResetAndDestroy();
+
+	//Added Vaibhav
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(TTestResult& aResult)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KText, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(TTestResult& aResult)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    //LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KNullDesC8, arr) == KErrBadDescriptor);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(TTestResult& aResult)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    _LIT8(KXmlPattern, "&<>");
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KXmlPattern, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+//-------------------------------------------
+//              REGISTERING SERVICE
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(TTestResult& aResult){
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+ 	//Added Vaibhav
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+	
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult){
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+   TInt error = KErrNone;
+    
+    //not set
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetContractL(KText);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noEndpoint status %d" ), error);
+
+    //null
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noEndpoint status %d" ), error);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    TInt error = KErrNone;
+    
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+	error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    
+    //not set
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    LOCAL_ASSERT(error == KErrSenNoContract);
+    
+    //null
+    iSenXmlServiceDescription->SetContractL(KNullDesC8);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    LOCAL_ASSERT(error == KErrSenNoContract);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    _LIT8(KBadFramework,"bla");
+    iSenXmlServiceDescription->SetFrameworkIdL(KBadFramework);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+}
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(TTestResult& aResult){
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(TTestResult& aResult){
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+//-------------------------------------------
+//              UNREGISTERING SERVICE
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(TTestResult& aResult){
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+}
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+   iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetContractL(KNullDesC8);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrSenNoContract);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    _LIT8(KBadFramework,"bla");
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetFrameworkIdL(KBadFramework);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              REGISTERING IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+	//Added Vaibhav
+	iServiceManager->UnregisterIdentityProviderL(*iProvider);
+	
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(TTestResult& aResult)
+    {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    iServiceManager->RegisterIdentityProviderL(*iProvider);
+    
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText2, KText2);
+    provider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*provider)) == KErrSenProviderIdInUseByAnotherEndpoint); 
+    delete provider;
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterIdentityProviderL(*iProvider);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = (CSenIdentityProvider *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterIdentityProviderL(*iProvider);
+
+    Teardown();
+    return KErrNone;
+    }
+
+//-------------------------------------------
+//              UNREGISTERING IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->UnregisterIdentityProviderL( *iProvider)) == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText2, KText2);
+    provider->SetProviderID(KText2);
+    LOCAL_ASSERT((iServiceManager->UnregisterIdentityProviderL( *provider)) == KErrNotFound);
+    delete provider;
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = (CSenIdentityProvider *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              ASSOCIATE IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_normalL(TTestResult& aResult)
+ {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText2);
+   	iProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+    //2nd time doesnt matter
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+
+	//Added Vaibhav
+	iServiceManager->DissociateServiceL(KText, KText2);
+	iServiceManager->UnregisterIdentityProviderL(*iProvider);
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_argumentL(TTestResult& aResult)
+ {
+	SetupL(); 
+
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KNullDesC8)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KText)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument);
+    _LIT8(KPattern, "&<>");
+    iProvider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notReadyL(TTestResult& aResult)
+ {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_AssociateServiceLL_notFoundL(TTestResult& aResult)
+ {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    iProvider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText2, KText2)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+ }
+//-------------------------------------------
+//              DISSOCIATE IDENTITY
+//-------------------------------------------
+
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_normalL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText2);
+   	iProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+    TInt error = KErrNone;
+    error = iServiceManager->DissociateServiceL(KText, KText2);
+    RDebug::Print( _L( "WSModTester: DissociateService status %d" ), error);
+    LOCAL_ASSERT(error == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_argumentL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KNullDesC8)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KNullDesC8, KText)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notReadyL(TTestResult& aResult)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenServiceManagerBCTest::UT_CSenServiceManager_DissociateServiceLL_notFoundL(TTestResult& aResult)
+    {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KText)) == KErrNotFound);
+    _LIT8(KPattern, "&<>");
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// ?classname::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?classname::?member_function(
+   ?arg_type arg,
+   ?arg_type arg )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// ?function_name implements...
+// ?implementation_description.
+// Returns: ?value_1: ?description
+//          ?value_n: ?description
+//                    ?description
+// -----------------------------------------------------------------------------
+//
+/*
+?type  ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg )  // ?description
+    {
+
+    ?code
+
+    }
+*/
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/Bmarm/senservicemanagerTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/Bwins/senservicemanagerTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/conf/senservicemanagerTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,315 @@
+[Test]
+title NewL-test
+create senservicemanagerTester obj 
+obj NewL-test 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test
+create senservicemanagerTester obj 
+obj NewLC-test 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-test1-CSenServiceManager
+create senservicemanagerTester obj 
+obj NewL-test1-CSenServiceManager 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-test1C-CSenServiceManager
+create senservicemanagerTester obj 
+obj NewLC-test1C-CSenServiceManager 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj normal-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notFound-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj notFound-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badDescriptor-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj badDescriptor-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NULL-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj NULL-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title randomPtr-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj randomPtr-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal(URI)-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj normal(URI)-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notFound(URI)-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj notFound(URI)-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badDescriptor(URI)-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj badDescriptor(URI)-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title XMLPattern(URI)-ServiceDescriptionsL
+create senservicemanagerTester obj 
+obj XMLPattern(URI)-ServiceDescriptionsL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-RegisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj normal-RegisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badDescriptor-RegisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj badDescriptor-RegisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title no_Endpoint-RegisterServiceDescriptionL 
+create senservicemanagerTester obj 
+obj no_Endpoint-RegisterServiceDescriptionL  
+delete obj 
+[Endtest] 
+
+[Test]
+title no_Contract-RegisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj no_Contract-RegisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title bad_Framework-RegisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj bad_Framework-RegisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title random_Ptr-RegisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj random_Ptr-RegisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NULL-RegisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj NULL-RegisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj normal-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badDescriptor-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj badDescriptor-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title noEndpoint-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj noEndpoint-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title noContract-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj noContract-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badFramework-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj badFramework-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title randomPtr-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj randomPtr-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NULL-UnregisterServiceDescriptionL
+create senservicemanagerTester obj 
+obj NULL-UnregisterServiceDescriptionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-RegisterIdentityProviderL
+create senservicemanagerTester obj 
+obj normal-RegisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badDescriptor-RegisterIdentityProviderL
+create senservicemanagerTester obj 
+obj badDescriptor-RegisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title providerIDInUse-RegisterIdentityProviderL
+create senservicemanagerTester obj 
+obj providerIDInUse-RegisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NULL-RegisterIdentityProviderL
+create senservicemanagerTester obj 
+obj NULL-RegisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title randomPtr-RegisterIdentityProviderL
+create senservicemanagerTester obj 
+obj randomPtr-RegisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-UnregisterIdentityProviderL
+create senservicemanagerTester obj 
+obj normal-UnregisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title badDescriptor-UnregisterIdentityProviderL
+create senservicemanagerTester obj 
+obj badDescriptor-UnregisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notFound-UnregisterIdentityProviderL
+create senservicemanagerTester obj 
+obj notFound-UnregisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title NULL-UnregisterIdentityProviderL
+create senservicemanagerTester obj 
+obj NULL-UnregisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title randomPtr-UnregisterIdentityProviderL
+create senservicemanagerTester obj 
+obj randomPtr-UnregisterIdentityProviderL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-AssociateServiceL
+create senservicemanagerTester obj 
+obj normal-AssociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title argument-AssociateServiceL
+create senservicemanagerTester obj 
+obj argument-AssociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notReady-AssociateServiceL
+create senservicemanagerTester obj 
+obj notReady-AssociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notFound-AssociateServiceL
+create senservicemanagerTester obj 
+obj notFound-AssociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title normal-DissociateServiceL
+create senservicemanagerTester obj 
+obj normal-DissociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title argument-DissociateServiceL
+create senservicemanagerTester obj 
+obj argument-DissociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notReady-DissociateServiceL
+create senservicemanagerTester obj 
+obj notReady-DissociateServiceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title notFound-DissociateServiceL
+create senservicemanagerTester obj 
+obj notFound-DissociateServiceL 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/eabi/senservicemanagerTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senservicemangertester
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+senservicemanagerTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senservicemangertester 
+*
+*/
+
+
+
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          senservicemanagerTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         senservicemanagerTester.def
+
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+SYSTEMINCLUDE   /epoc32/include 
+MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/libc
+
+SOURCE          senservicemanagerTester.cpp
+SOURCE          senservicemanagerTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         SenServDesc.lib
+LIBRARY         SenXml.lib
+LIBRARY			efsrv.lib
+LIBRARY			SenServMgr.lib
+LIBRARY			XMLFRAMEWORK.lib
+library			ecom.lib
+LIBRARY			avkon.lib 
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\senservicemanagerTester.dll"   -   "c:\Sys\Bin\senservicemanagerTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\senservicemanagerTester.cfg"-"c:\testing\conf\senservicemanagerTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/inc/senservicemanagerTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,319 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENSERVICEMANAGERTESTER_H
+#define SENSERVICEMANAGERTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <SenServiceManager.h>
+#include <SenIdentityProvider.h>
+#include <SenXmlServiceDescription.h>
+#include <SenServiceConnection.h>
+#include <f32file.h>
+#include <TestclassAssert.h>
+namespace{
+    _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
+    _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
+    _LIT8(KText,"text");
+    _LIT8(KText2,"text2");
+}
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KsenservicemanagerTesterLogPath, "\\logs\\testframework\\senservicemanagerTester\\" ); 
+// Log file
+_LIT( KsenservicemanagerTesterLogFile, "senservicemanagerTester.txt" ); 
+_LIT( KsenservicemanagerTesterLogFileWithTitle, "senservicemanagerTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CsenservicemanagerTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+typedef TInt (CsenservicemanagerTester::* TestFunction)(CStifItemParser&);
+
+// CLASS DECLARATION
+
+/**
+*  CsenservicemanagerTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+NONSHARABLE_CLASS(CsenservicemanagerTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CsenservicemanagerTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CsenservicemanagerTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CsenservicemanagerTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+    private:    // methods
+         void Empty();
+
+         void SetupL();
+        
+         void Teardown();
+         void DeleteDBL();
+         
+         
+         TInt UT_CSenServiceManager_NewLL(CStifItemParser& aItem);
+        
+         TInt UT_CSenServiceManager_NewLCL(CStifItemParser& aItem);
+         
+         TInt UT_CSenServiceManager_NewL_1L(CStifItemParser& aItem);
+        
+         TInt UT_CSenServiceManager_NewL_1CL(CStifItemParser& aItem);
+         
+        
+        	  
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_nullL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(CStifItemParser& aItem);
+        
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(CStifItemParser& aItem);
+         
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(CStifItemParser& aItem);
+         
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(CStifItemParser& aItem);
+        
+        
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_notReadyL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(CStifItemParser& aItem);
+
+        
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notReadyL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(CStifItemParser& aItem);
+        
+        
+         TInt UT_CSenServiceManager_AssociateServiceLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_AssociateServiceLL_argumentL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_AssociateServiceLL_notReadyL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_AssociateServiceLL_notFoundL(CStifItemParser& aItem);
+        
+        
+         TInt UT_CSenServiceManager_DissociateServiceLL_normalL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_DissociateServiceLL_argumentL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_DissociateServiceLL_notReadyL(CStifItemParser& aItem);
+         TInt UT_CSenServiceManager_DissociateServiceLL_notFoundL(CStifItemParser& aItem);
+        
+
+    private:    // Data
+        CSenServiceManager*         iServiceManager;
+        CSenXmlServiceDescription*  iSenXmlServiceDescription;
+        CSenIdentityProvider*       iProvider;
+        RFs                         iFsSession;
+
+		CActiveScheduler* iActiveScheduler;
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENSERVICEMANAGERTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\senservicemanagerTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/src/senservicemanagerTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senservicemanagerTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenservicemanagerTester::CsenservicemanagerTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CsenservicemanagerTester::CsenservicemanagerTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservicemanagerTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CsenservicemanagerTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KsenservicemanagerTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KsenservicemanagerTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KsenservicemanagerTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservicemanagerTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CsenservicemanagerTester* CsenservicemanagerTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CsenservicemanagerTester* self = new (ELeave) CsenservicemanagerTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CsenservicemanagerTester::~CsenservicemanagerTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CsenservicemanagerTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CsenservicemanagerTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("senservicemanagerTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CsenservicemanagerTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/src/senservicemanagerTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,994 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "senservicemanagerTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenservicemanagerTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CsenservicemanagerTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenservicemanagerTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CsenservicemanagerTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("NewL-test", CsenservicemanagerTester::UT_CSenServiceManager_NewLL),
+		ENTRY("NewLC-test", CsenservicemanagerTester::UT_CSenServiceManager_NewLCL),
+		ENTRY("NewL-test1-CSenServiceManager", CsenservicemanagerTester::UT_CSenServiceManager_NewL_1L),
+		ENTRY("NewLC-test1C-CSenServiceManager", UT_CSenServiceManager_NewL_1CL),
+		ENTRY("normal-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_normalL),
+		ENTRY("notFound-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL),
+		ENTRY("badDescriptor-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL),
+		ENTRY("NULL-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_nullL),
+		ENTRY("randomPtr-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL),
+		ENTRY("normal(URI)-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL),
+		ENTRY("notFound(URI)-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL),
+		ENTRY("badDescriptor(URI)-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL),
+		ENTRY("XMLPattern(URI)-ServiceDescriptionsL", CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL),
+		ENTRY("normal-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL),
+		ENTRY("badDescriptor-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL),
+		ENTRY("no_Endpoint-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL),
+		ENTRY("no_Contract-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL),
+		ENTRY("bad_Framework-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL),
+		ENTRY("random_Ptr-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL),
+		ENTRY("NULL-RegisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL),
+		ENTRY("normal-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL),
+		ENTRY("badDescriptor-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL),
+		ENTRY("noEndpoint-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL),
+		ENTRY("noContract-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL),
+		ENTRY("badFramework-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL),
+		ENTRY("randomPtr-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL),
+		ENTRY("NULL-UnregisterServiceDescriptionL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL),
+		ENTRY("normal-RegisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_normalL),
+		ENTRY("badDescriptor-RegisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL),
+		ENTRY("providerIDInUse-RegisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL),
+		ENTRY("NULL-RegisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_nullL),
+		ENTRY("randomPtr-RegisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL),
+		ENTRY("normal-UnregisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL),
+		ENTRY("badDescriptor-UnregisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL),
+		ENTRY("notFound-UnregisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL),
+		ENTRY("NULL-UnregisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL),
+		ENTRY("randomPtr-UnregisterIdentityProviderL", CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL),
+		ENTRY("normal-AssociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_normalL),
+		ENTRY("argument-AssociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_argumentL),
+		ENTRY("notReady-AssociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_notReadyL),
+		ENTRY("notFound-AssociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_notFoundL),
+		ENTRY("normal-DissociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_normalL),
+		ENTRY("argument-DissociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_argumentL),
+		ENTRY("notReady-DissociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_notReadyL),
+		ENTRY("notFound-DissociateServiceL", CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_notFoundL),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+
+void CsenservicemanagerTester::Empty(  )
+{
+}
+void CsenservicemanagerTester::DeleteDBL(){
+    TPtrC file;
+    TInt fileErr = KErrNone;
+    
+    CFileMan* fileMan = CFileMan::NewL(iFsSession);
+    CleanupStack::PushL(fileMan);
+    
+    fileErr = fileMan->Delete(KSessionsFile);
+    RDebug::Print( KSessionsFile);
+    RDebug::Print( _L( "WSModTester: DeleteFileL status %d" ), fileErr );
+
+	if(!(fileErr == KErrNone || fileErr == KErrNotFound))
+	{
+		User::LeaveIfError(fileErr);
+	}
+
+    fileErr = fileMan->Delete(KIdentitiesFile);
+    RDebug::Print( _L( "WSModTester: DeleteFileL status %d" ), fileErr );
+	if(!(fileErr == KErrNone || fileErr == KErrNotFound))
+	{
+		User::LeaveIfError(fileErr);
+	}
+
+    CleanupStack::PopAndDestroy();
+}
+
+void CsenservicemanagerTester::SetupL(  )
+    {
+    User::LeaveIfError(this->iFsSession.Connect());
+
+    DeleteDBL();
+	
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    iServiceManager = CSenServiceManager::NewL();
+    User::LeaveIfNull(iServiceManager);
+
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    User::LeaveIfNull(iSenXmlServiceDescription);
+    
+    if ( iProvider != NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+    iProvider = CSenIdentityProvider::NewL(KText, KText);
+    User::LeaveIfNull(iProvider);
+    
+    } 
+
+void CsenservicemanagerTester::Teardown(  )
+    {
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    if ( iProvider!= NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+    iFsSession.Close();
+    }
+    
+//-------------------------------------------
+//              METHODS
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_NewLL( CStifItemParser& aItem )
+    {
+    Empty();
+    
+    CSenServiceManager*     serviceManager = NULL;
+    CSenServiceManager*     serviceManager2 = NULL;
+    serviceManager = CSenServiceManager::NewL();
+    TL(serviceManager != (CSenServiceManager*)NULL);
+
+    __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+    
+    serviceManager = NULL;
+
+    serviceManager = CSenServiceManager::NewL();
+    TRAPD(error, serviceManager2 = CSenServiceManager::NewL());
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_NewL 2nd try with status %d" ), error);
+    LOCAL_ASSERT(error==KErrNone);
+
+    if (serviceManager != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+        serviceManager = NULL;
+    }
+
+    if (serviceManager2 != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager2 );
+        serviceManager2 = NULL;
+    }
+
+    Empty();
+    return KErrNone;
+    }
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_NewLCL( CStifItemParser& aItem )
+    {
+    Empty();
+    
+    CSenServiceManager*     serviceManager = NULL;
+    serviceManager = CSenServiceManager::NewLC();
+    TL(serviceManager != (CSenServiceManager*)NULL);
+    CleanupStack::PopAndDestroy();
+    serviceManager = NULL;
+    Empty();
+	return KErrNone;
+    }
+    
+TInt CsenservicemanagerTester::UT_CSenServiceManager_NewL_1L( CStifItemParser& aItem )
+    {
+    Empty();
+    CSenServiceManager*     serviceManager = NULL;
+    MSenAuthenticationProvider aProvider;
+    serviceManager = CSenServiceManager::NewL(aProvider);
+    TL(serviceManager != (CSenServiceManager*)NULL);
+    if (serviceManager != NULL){
+        __ASSERT_ALWAYS_NO_LEAVE(delete serviceManager );
+        serviceManager = NULL;
+    }
+    Empty();
+	return KErrNone;
+    
+    }
+    
+TInt CsenservicemanagerTester::UT_CSenServiceManager_NewL_1CL( CStifItemParser& aItem )
+    {
+    Empty();
+    CSenServiceManager*     serviceManager = NULL;
+    MSenAuthenticationProvider aProvider;
+    serviceManager = CSenServiceManager::NewLC(aProvider);
+    TL(serviceManager != (CSenServiceManager*)NULL);
+    CleanupStack::PopAndDestroy();
+    serviceManager = NULL;
+    Empty();
+	return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              SEARCHING
+//-------------------------------------------
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_normalL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+	   
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr) == KErrNone);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 1);
+    arr.ResetAndDestroy();
+    
+    //Added Vaibhav
+    iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+    RServiceDescriptionArray arr;
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_nullL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+    RServiceDescriptionArray arr;
+	
+	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif     
+	iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+	
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+    RServiceDescriptionArray arr;
+
+	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException,EExcPageFault);
+	#endif      
+	iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+    
+    TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(CStifItemParser& aItem)
+    {
+    
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KText, arr) == KErrNone);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 1);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    
+    arr.ResetAndDestroy();
+
+	//Added Vaibhav
+	//iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(CStifItemParser& aItem)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KText, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(CStifItemParser& aItem)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    //LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KNullDesC8, arr) == KErrBadDescriptor);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(CStifItemParser& aItem)
+{
+	SetupL(); 
+
+    RServiceDescriptionArray arr;
+    _LIT8(KXmlPattern, "&<>");
+    LOCAL_ASSERT(iServiceManager->ServiceDescriptionsL(KXmlPattern, arr) == KErrNotFound);
+  	TInt SDs = arr.Count();
+    LOCAL_ASSERT(SDs == 0);
+    arr.ResetAndDestroy();
+
+    Teardown();
+    return KErrNone;
+}
+//-------------------------------------------
+//              REGISTERING SERVICE
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(CStifItemParser& aItem){
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+ 
+ 	//Added Vaibhav
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+	
+    Teardown();
+    return KErrNone;
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(CStifItemParser& aItem){
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+   TInt error = KErrNone;
+    
+    //not set
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetContractL(KText);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noEndpoint status %d" ), error);
+
+    //null
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noEndpoint status %d" ), error);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    TInt error = KErrNone;
+    
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+	error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    
+    //not set
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    LOCAL_ASSERT(error == KErrSenNoContract);
+    
+    //null
+    iSenXmlServiceDescription->SetContractL(KNullDesC8);
+    error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+    RDebug::Print( _L( "WSModTester: CSenServiceManager_RegisterServiceDescriptionLL_noContract status %d" ), error);
+    LOCAL_ASSERT(error == KErrSenNoContract);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    _LIT8(KBadFramework,"bla");
+    iSenXmlServiceDescription->SetFrameworkIdL(KBadFramework);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+}
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(CStifItemParser& aItem){
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(CStifItemParser& aItem){
+	SetupL(); 
+
+    delete iSenXmlServiceDescription;
+    iSenXmlServiceDescription = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+//-------------------------------------------
+//              UNREGISTERING SERVICE
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(CStifItemParser& aItem){
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+}
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetEndPointL(KNullDesC8);
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+   iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetContractL(KNullDesC8);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrSenNoContract);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    _LIT8(KBadFramework,"bla");
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription->SetFrameworkIdL(KBadFramework);
+    LOCAL_ASSERT((iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription = (CSenXmlServiceDescription *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    iSenXmlServiceDescription = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              REGISTERING IDENTITY
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+	//Added Vaibhav
+	iServiceManager->UnregisterIdentityProviderL(*iProvider);
+	
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(CStifItemParser& aItem)
+    {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    iServiceManager->RegisterIdentityProviderL(*iProvider);
+    
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText2, KText2);
+    provider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*provider)) == KErrSenProviderIdInUseByAnotherEndpoint); 
+    delete provider;
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterIdentityProviderL(*iProvider);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = (CSenIdentityProvider *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->RegisterIdentityProviderL(*iProvider);
+
+    Teardown();
+    return KErrNone;
+    }
+
+//-------------------------------------------
+//              UNREGISTERING IDENTITY
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->UnregisterIdentityProviderL( *iProvider)) == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText);
+    iProvider->SetUserInfoL(KText, KText, KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+    CSenIdentityProvider* provider = CSenIdentityProvider::NewL(KText2, KText2);
+    provider->SetProviderID(KText2);
+    LOCAL_ASSERT((iServiceManager->UnregisterIdentityProviderL( *provider)) == KErrNotFound);
+    delete provider;
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = NULL;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    delete iProvider;
+    iProvider = (CSenIdentityProvider *)0xeaeaea;
+   	#ifdef __WINS__
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcAccessViolation) ;
+	#else
+		TestModuleIf().SetExitReason (TestModuleIf(). EException, EExcPageFault) ;
+	#endif      
+	iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+    Teardown();
+    return KErrNone;
+    
+    }
+
+//-------------------------------------------
+//              ASSOCIATE IDENTITY
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_normalL(CStifItemParser& aItem)
+ {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText2);
+   	iProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+    //2nd time doesnt matter
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+
+	//Added Vaibhav
+	iServiceManager->DissociateServiceL(KText, KText2);
+	iServiceManager->UnregisterIdentityProviderL(*iProvider);
+	iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_argumentL(CStifItemParser& aItem)
+ {
+	SetupL(); 
+
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KNullDesC8)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KText)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument);
+    _LIT8(KPattern, "&<>");
+    iProvider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_notReadyL(CStifItemParser& aItem)
+ {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+ }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_AssociateServiceLL_notFoundL(CStifItemParser& aItem)
+ {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    iProvider->SetProviderID(KText);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText2, KText2)) == KErrNotFound);
+
+    Teardown();
+    return KErrNone;
+ }
+//-------------------------------------------
+//              DISSOCIATE IDENTITY
+//-------------------------------------------
+
+TInt CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_normalL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    iProvider->SetProviderID(KText2);
+   	iProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8);
+
+    iSenXmlServiceDescription->SetEndPointL(KText);
+    iSenXmlServiceDescription->SetContractL(KText);
+    iSenXmlServiceDescription->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
+    LOCAL_ASSERT((iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription)) == KErrNone);
+    LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); 
+    LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KText2)) == KErrNone);
+    TInt error = KErrNone;
+    error = iServiceManager->DissociateServiceL(KText, KText2);
+    RDebug::Print( _L( "WSModTester: DissociateService status %d" ), error);
+    LOCAL_ASSERT(error == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_argumentL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KNullDesC8)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KNullDesC8, KText)) == KErrArgument);
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument);
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_notReadyL(CStifItemParser& aItem)
+    {
+	SetupL(); 
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenservicemanagerTester::UT_CSenServiceManager_DissociateServiceLL_notFoundL(CStifItemParser& aItem)
+    {
+    TRAPD(err, SetupL())
+    if(err != KErrNone)return err;
+
+    LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KText)) == KErrNotFound);
+    _LIT8(KPattern, "&<>");
+
+    Teardown();
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CsenservicemanagerTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CsenservicemanagerTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_manager_api/web_service_manager_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="2b62a948a70cbe7384add9c67bf681df" dataversion="1.0">
+  <name>Web Service Manager API</name>
+  <description>The Web Service Manager API is used to store and retrieve service and identity information.</description>
+  <type>c++</type>
+  <collection>webservices</collection>
+  <libs>
+    <lib name="SenServMgr.LIB" />
+  </libs>
+  <release category="public" sinceversion="3.0"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                Web Service Messaging API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/MSenMessage.h         		MW_LAYER_PUBLIC_EXPORT_PATH(MSenMessage.h)   
+../inc/SenSoapEnvelope2.h    		MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapEnvelope2.h)
+../inc/SenSoapFault2.h       		MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapFault2.h)   
+../inc/SenSoapMessage2.h     		MW_LAYER_PUBLIC_EXPORT_PATH(SenSoapMessage2.h)
+../inc/SenWsSecurityHeader2.h		MW_LAYER_PUBLIC_EXPORT_PATH(SenWsSecurityHeader2.h)
+//../inc/senatomfeed.h     	        MW_LAYER_PUBLIC_EXPORT_PATH(senatomfeed.h)
+//../inc/senatomentry.h     	        MW_LAYER_PUBLIC_EXPORT_PATH(senatomentry.h)
+//../inc/senatommessage.h 			MW_LAYER_PUBLIC_EXPORT_PATH(senatommessage.h)
+                                                                             
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/inc/MSenMessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This is the superclass interface for wider set of 
+*                concrete WSF message classes.
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef M_SEN_MESSAGE_H
+#define M_SEN_MESSAGE_H
+
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class CSenElement;
+class CSenXmlReader;
+
+//using namespace SenContext;
+
+// CONSTANTS
+//namespace SenContext // consider whether or not to declare new SenMessage c++ namespace
+//    {
+//    // Message class type enumeration for class casting:        
+//    }
+
+// FORWARD DECLARATIONS
+class MSenMessageContext;
+class MSenProperties;
+
+// CLASS DECLARATION
+/**
+* This is abstract interface defines set of WSF message classes, providing
+* convenience for other components, which typically cast this to some
+* subclass via IsSafeToCast() method.
+* @lib SenMessages.lib
+* @since Series60 4.0
+*/
+class MSenMessage
+    {
+    public:
+
+		/**
+		* Class Enumeration
+		*/
+        enum TClass
+            {
+            EMessageBase     = 0,
+            EHttpGetMsg      = 1,
+            EHttpPostMsg     = 2,
+            EHttpPutMsg      = 3,
+            EHttpDeleteMsg   = 4,
+            ESoapEnvelope    = 5, 
+            ESoapMessage     = 6,
+            ESoapEnvelope2   = 7,
+            ESoapMessage2    = 8,
+            ESoapMessageDom2 = 9,
+            EAtomMessage     = 10
+            };
+        /**
+        * Direction Enumeration
+        */    
+        enum TDirection
+            {
+            EOutbound        = 0,
+            EInbound         = 1
+            };        
+ 
+ 		/**
+ 		* Gets the Message Type
+ 		*/
+        virtual TClass Type() = 0;
+        /**
+        * Gets the Message Direction
+        */
+        virtual TDirection Direction() = 0;
+        
+        
+        /**
+        * Sets message context for this message. If context already
+        * exists, it is discarded and replaced by this context
+        * (context reset is performed).
+        * @param apNotOwnedContext is the context.
+        * Ownership is NOT transferred to this message.
+        * @return
+        *   KErrNone on success
+        *   KErrArgument if apOwnedContext == NULL
+        *   or system-wide errorcode otherwise.
+        */
+        virtual TInt SetContext(MSenMessageContext* apNotOwnedContext) = 0;
+        
+        /**
+        * Getter for message's context
+        * @return message context, if this message relates to
+        *         (has associated with) such context, or NULL.
+        */
+        virtual MSenMessageContext* Context() = 0;
+
+        /**
+        * Sets properties for this message. Most typical use case
+        * is to set message spesific transport properties.
+        * @param apOwnedProperties pointer to the properties, which
+        * ownership is transferred to this class. This is performed
+        * in two different manners:
+        *
+        *  1. If message has context, the properties are (re)set into that context,
+        *     discarding any pre-existing properties. 
+        *
+        *  2. If context is NOT available, properties will be directly owned by 
+        *     this message.
+        * @return
+        *   KErrNone on success
+        *   KErrArgument if apOwnedProperties == NULL
+        *   or system-wide errorcode otherwise.
+        */
+        virtual TInt SetProperties(MSenProperties* apOwnedProperties) = 0;
+
+        /**
+        * Getter for message specific (transport) properties
+        * @return (transport) properties of this message, 
+        *         if such have been applied to this message
+        *         or NULL otherwise.
+        */
+        virtual MSenProperties* Properties() = 0;
+
+        virtual TBool IsSafeToCast(TClass aType) = 0;
+        /**
+        * Getter for transaction ID of this message.
+        * In case of receiving a response message from 
+        * service provider, this transaction ID may be
+        * used to map the response with request that
+        * the service consumer sent via service connection.
+        * In such case, the consumer can store return 
+        * value from SendL method that was invoked in 
+        * order maintain this mapping.
+        * @return the transaction ID of this message
+        */        
+        virtual TInt TxnId() = 0; 
+
+        /**
+        * Clone method that duplicates this message 
+        * -- including all member data in the message.
+        * For the service consumers, a typical use case
+        * for cloning the message is when there is need
+        * to preserve the received response beyond the
+        * life time of a transaction. Normally, the
+        * response messages, that are owned by service
+        * connection are de-allocated after execution
+        * returns from MSenServiceConsumer interface's
+        * HandleMessageL or HandleErrorL method, back
+        * to the service connection.
+        * @return a pointer to a new message class instance,
+        * which ownership IS transferred to a caller. Note
+        * that caller is expected to cast this pointer to
+        * a proper subclass via the use of IsSafeToCast 
+        * method. In case of responses, the message type
+        * is normally equal with the type of the request
+        * message that was sent by the consumer.
+        */        
+        virtual MSenMessage* CloneL() = 0;
+    };
+
+#endif // M_SEN_MESSAGE_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/inc/SenSoapEnvelope2.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,350 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenSoapEnvelope is an utility class offering capability to
+*                parse XML SOAP envelope and manipulation methods to alter its
+*                contents.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_ENVELOPE2_H
+#define SEN_SOAP_ENVELOPE2_H
+
+//  INCLUDES
+#include <SenDomFragmentBase.h>
+#include <SenSoapConstants.h>
+#include <MSenMessage.h>
+
+// CONSTANTS
+/*
+// Now declared in <SenSoapConstants.h>
+_LIT8(KSenSoapEnvelopeName,    	        "Envelope");
+_LIT8(KSenSoapEnvelopePrefix,   	    "S");
+_LIT8(KSenSoapEnvelopeXmlns,            "http://schemas.xmlsoap.org/soap/envelope/");
+_LIT8(KSenSoap12EnvelopeXmlns,          "http://www.w3.org/2003/05/soap-envelope");
+_LIT8(KSenSoapEnvelopeHeaderName,       "Header");
+_LIT8(KSenSoapEnvelopeHeaderQName,      "S:Header");
+_LIT8(KSenSoapEnvelopeBodyName,         "Body");
+_LIT8(KSenSoapEnvelopeBodyQName,        "S:Body");
+_LIT8(KSenSoapFaultName,                "Fault");
+
+_LIT8(KSenSoapActionHeaderName,         "SOAPAction");
+_LIT8(KSenSoapActionHeaderValueEmpty,   "\"\"");
+
+const TInt KStateParsingSoapHeader  = 20; // ignore state   (even number)
+const TInt KStateParsingSoapBody    = 40; // ignore state   (even number)
+const TInt KStateParsingSoapFault   = 5;  // save state     (odd number)
+
+enum TSOAPVersion
+		{
+		ESOAP11 = 1,
+		ESOAP12
+		};
+*/
+
+// FORWARD DECLARATIONS
+class CSenSoapFault2;
+class CSenTransportProperties;
+class CSenMessageContext;
+class MSenMessageContext;
+
+// CLASS DECLARATION
+
+/**
+* CSenSoapEnvelope is an utility class offering capability to parse
+* XML SOAP envelope and manipulation methods to alter its contents.
+* Typically WSC uses this class to parse messages received through
+* WSF HandleMessageL() and HandleErrorL() callbacks.
+* Class has convenience methods for checking if a SOAP envelope body
+* contains a fault and functionality to detach SOAP Fault object out
+* from it. Also possibility to set SOAPAction HTTP header is supported.
+*  @lib SenUtils.lib
+*  @since Series60 4.0
+*/
+class CSenSoapEnvelope2 : public CSenFragmentBase, public MSenMessage
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope2* NewL();
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope2* NewLC();
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope2* NewL(MSenMessageContext& aContext);
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope2* NewLC(MSenMessageContext& aContext);
+
+        /**
+        * Two-phased copy constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope2* NewL(CSenSoapEnvelope2& aEnvelope);
+
+        /**
+        * Two-phased copy constructor.
+        */
+        IMPORT_C static CSenSoapEnvelope2* NewLC(CSenSoapEnvelope2& aEnvelope);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapEnvelope2();
+
+        // New functions
+
+        /**
+        * Sets body of the envelope.
+        * @since Series60 4.0
+        * @param aBody      Body (content) to be set.
+        * @return SOAP body (content) which was just set
+        */
+        IMPORT_C virtual TPtrC8 SetBodyL(const TDesC8& aBody);
+
+        /**
+        * Sets body of the envelope.
+        * @since Series60 4.0
+        * @param aBody      Body (content) to be set.
+        * @return SOAP body (content) which was just set
+        */
+        IMPORT_C virtual TXmlEngElement SetBodyL(TXmlEngElement aBodyElement);
+
+        /**
+        * Getter for envelopes body
+        * @since Series60 4.0
+        * @return body as TXmlEngElement
+        */
+        IMPORT_C virtual TXmlEngElement BodyL();
+
+        /**
+        * Getter for envelopes header
+        * @since Series60 4.0
+        * @return header as TXmlEngElement
+        */
+        IMPORT_C virtual TXmlEngElement HeaderL();
+
+        /**
+        * Adds an element to the header.
+        * @since Series60 4.0
+        * @param aHeaderElement new child element to be
+        *        added inside Header  element. Ownership
+        *        is always transferred to CSenSoapEnvelope.
+        * @return added TXmlEngElement
+        */
+        IMPORT_C virtual TXmlEngElement AddHeaderL(TXmlEngElement aHeaderElement);
+
+        /**
+        * Getter for the envelope body as a UTF-8 form XML string.
+        * @since Series60 4.0
+        * @return body as a HBufC8 pointer. Ownership is transferred to caller.
+        */
+        IMPORT_C virtual HBufC8* BodyAsStringL();
+
+        /**
+        * Checks if this SOAP envelope body contains SOAP fault or not.
+        * @since Series60 4.0
+        * @return TBool ETrue if there is a fault, EFalse if not.
+        */
+        IMPORT_C virtual TBool IsFault();
+
+        /**
+        * Detaches the <Fault> element from the envelope, removing the element
+        * from the envelope.
+        * @since Series60 4.0
+        * @return pointer to the soap fault. Caller takes the ownership.
+        *         NULL if <Fault> element is non-existent.
+        */
+        IMPORT_C virtual CSenSoapFault2* DetachFaultL();
+
+        /**
+        * Gets the <Fault> element. Ownership is not transferred.
+        * NULL if not a fault.
+        * @since Series60 4.0
+        * @return reference to SOAP fault object owned by this SOAP envelope
+        */
+        IMPORT_C virtual CSenSoapFault2* FaultL();
+
+        /**
+        * Sets the SOAP action HTTP header. WSF will use this value
+        * while submitting this SOAP envelope request over HTTP/S transport.
+        * @since Series60 4.0
+        * @param aSoapAction    the SOAP Action HTTP header to be set.
+        * The default value is KSenSoapActionHeaderValueEmpty, which is
+        * two double quotation marks - "" - without any character in between.
+        * SOAP specification requires double quotation marks, even if action
+        * is empty.
+        * If a string without double quotation marks is passed, it will be
+        * wrapped inside double quotation marks, added in the beginning and
+        * at the end of the actual SOAP Action string.
+        *
+        * @return newly set SOAP action header. String might have been
+        * extended to include double quotation marks, if those were missing
+        * from the argument.
+        */
+        IMPORT_C virtual TPtrC8 SetSoapActionL(const TDesC8& aSoapAction);
+
+        /**
+        * Gets the soap action header.
+        * @since Series60 4.0
+        * @return   current SOAP action header, which is always wrapped
+        * inside double quotation marks. If SOAPAction has not been set
+        * to this SOAP envelope instance, function will return zero-length
+        * descriptor (KNullDesC8)
+        */
+        IMPORT_C virtual TPtrC8 SoapAction();
+
+        /*
+        * Getter for checking whether this message has at least one
+        * valid <Header> element
+        * @return ETrue, if <Header> element exists, EFalse otherwise.
+        */
+        IMPORT_C TBool HasHeader();
+
+        /*
+        * Getter for checking whether this message has valid <Body> element
+        * @return ETrue, if <Body> element exists, EFalse otherwise.
+        */
+        IMPORT_C TBool HasBody();
+        
+        /**
+        * Getter for currently effecitve SOAP version.
+        * @return enumeration which dictates SOAP version.
+        */
+        IMPORT_C virtual TSOAPVersion SoapVersion();
+
+    public: // From MSenMessage
+        IMPORT_C virtual TClass Type();
+        IMPORT_C virtual TDirection Direction();
+        IMPORT_C virtual TInt SetContext(MSenMessageContext* apOwnedContext);
+        IMPORT_C virtual MSenMessageContext* Context();
+        IMPORT_C virtual TInt SetProperties(MSenProperties* apOwnedProperties);
+        IMPORT_C virtual MSenProperties* Properties();
+
+        IMPORT_C virtual TBool IsSafeToCast(TClass aType);
+        IMPORT_C virtual TInt TxnId();
+		IMPORT_C virtual MSenMessage* CloneL();
+
+    protected:
+
+        /**
+         *  Constructor.
+         */
+        CSenSoapEnvelope2();
+		/**
+		* This method should be called from the deriving
+		* classes ConstructL() methods.
+	    * @since Series60 4.0
+		*/
+	    IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
+
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL();
+
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(MSenMessageContext& aMessage);
+
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(MSenMessageContext& aMessage,
+                                     TSOAPVersion aVersion);
+
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(CSenSoapEnvelope2& aEnvelope);
+
+        // New functions
+
+        /**
+        * This method should be overridden by subclasses.
+        * Implements functionality to parse SOAP header if one is found
+        * during parsing the envelope.
+        * Parses all elements found under top <Header> element by
+        * using DOM fragment.
+        * @since Series60 4.0
+        * @param aNsUri         The namespace URI of the new element
+        * @param aLocalName     The local name of the new element
+        * @param aQName         The qualified name of the new element
+        * @param aAttributes    The attributes of the new element
+        */
+        IMPORT_C virtual void ParseHeaderL(const RTagInfo& aElement,
+                                           const RAttributeArray& aAttributes);
+
+        // Functions from base classes
+
+        // From CSenFragmentBase
+        IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
+    	                                      const RAttributeArray& aAttributes,
+    	                                      TInt aErrorCode);                                            
+
+        IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement,
+                                            TInt aErrorCode);
+
+        IMPORT_C virtual CSenFragmentBase* CreateBodyFragmentL(const TDesC8& aNsUri,
+                                                       const TDesC8& aLocalName,
+                                                       const TDesC8& aPrefix,
+                                                       const RAttributeArray& aAttributes,
+                                                       TXmlEngElement& aParent,
+                                                       RSenDocument& aOwnerDocument);
+
+    protected: // Data
+        // Internal members, protected so that deriving classes have access to them.
+        CSenFragmentBase*           ipBodyFragment;
+        CSenFragmentBase*           ipHeaderFragment;
+        HBufC8*                     ipSoapAction;
+        TInt                        iTransactionId;
+
+        MSenProperties*             ipProperties;      // owned => safe upward cast is performed in de-alloc
+        MSenMessageContext*         ipNotOwnedContext; // owned => safe upward cast is performed in de-alloc
+        
+        TAny* ipReserved;
+
+        TBool               iFault;
+        TDirection          iDirection;
+    };
+
+#endif // SEN_SOAP_ENVELOPE_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/inc/SenSoapFault2.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This utility class represents SOAP fault element according to
+*                SOAP fault specification. 
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_FAULT_H
+#define SEN_SOAP_FAULT_H
+
+//  INCLUDES
+#include <SenDomFragmentBase.h>
+#include <SenSoapConstants.h>
+
+// CLASS DECLARATION
+
+/**
+* This utility class represents SOAP fault element according to SOAP fault 
+* specification. 
+* SOAP fault element has following child elements: 
+*  faultcode, 
+*  faultstring, 
+*  faultactor 
+*  detail
+*
+*  @lib SenUtils.lib
+*  @since Series60 3.0
+*/
+class CSenSoapFault2 : public CSenDomFragmentBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Copy constructor, making a copy of the original source element.
+        * @since Series60 3.0
+        * @param aElement   Element which is copied into SoapFault.
+        */
+        IMPORT_C static CSenSoapFault2* NewL(TXmlEngElement& aElement);
+
+        /**
+        * Constructor which, takes
+        * 1) TXmlEngElement which is already owned by other Fragment and
+        * 2) RSenDocument which is owned by that same other Fragment.
+        * Constructor takes a copy of RSenDocument => given element
+        * will be destructed when both original Fragment and
+        * CSenSoapFault2 have been destructed. Given element will
+        * be root element of CSenSoapFault2.
+        *
+        * @since Series60 3.0
+        * @param aElement   Soap Fault element.
+        * @param aDocument  Original document holding given Soap Fault
+        *                   element.
+        */
+        IMPORT_C static CSenSoapFault2* NewL(TXmlEngElement& aElement,
+                                             RSenDocument& aDocument);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace of this SOAP fault
+        * @param aLocalName is the localname for this SOAP fault
+        * @param aQName is the qualifiedname for this SOAP fault
+        * @param aAttributes are the XML attributes for this SOAP fault
+        * Parameters are used to construct the soap fault.
+        */
+        IMPORT_C static CSenSoapFault2* NewL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aPrefix,
+                                            const RAttributeArray& aAttributes,
+                                            TXmlEngElement& aElement,
+                                            RSenDocument& aDocument);
+            
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapFault2();
+
+        // New functions
+        
+        /**
+        * @since Series60 3.0
+        * @return the content of <faultcode> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 FaultCode();
+
+		/**
+		* @since Series60 4.0
+		* @return the content of <Subcode> element as UTF-8 form string
+		* or KNullDesC8, if element is not available
+		*/
+		IMPORT_C TPtrC8 FaultSubcode();
+
+		/**
+        * @since Series60 3.0
+        * @return the content of <faultstring> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 FaultString();
+
+        /**
+        * @since Series60 3.0
+        * @return the content of <faultactor> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 FaultActor();
+
+        /**
+        * @since Series60 3.0
+        * @return the content of <detail> element as UTF-8 form string
+        * or KNullDesC8, if element is not available
+        */
+        IMPORT_C TPtrC8 Detail();
+        
+    protected:  
+        
+        /**
+        * C++ default constructor
+        */
+        IMPORT_C CSenSoapFault2();
+        
+        /**
+        * Basic ConstructL function
+        * @since Series60 3.0
+        * @param aElement is the TXmlEngElement from which data to this
+        *                 SOAP fault object is to be copied.
+        */
+        IMPORT_C void ConstructL(TXmlEngElement& aElement);
+
+        /**
+        * ConstructL method which takes
+        * 1) TXmlEngElement which is already owned by other Fragment and
+        * 2) RSenDocument which is owned by that same other Fragment.
+        * Constructor takes a copy of RSenDocument => given element
+        * will be destructed when both original Fragment and
+        * CSenSoapFault2 have been destructed. Given element will
+        * be root element of CSenSoapFault2.
+        *
+        * @since Series60 3.0
+        * @param aElement   Soap Fault element.
+        * @param aDocument  Original document holding given Soap Fault
+        *                   element.
+        */
+        IMPORT_C void ConstructL(TXmlEngElement& aElement, RSenDocument& aDocument);
+
+        /**
+        * Basic ConstructL function
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace URI of this SOAP fault
+        * @param aLocalName is the XML localname URI of this SOAP fault
+        * @param aQName is the XML qualifiedname URI of this SOAP fault
+        * @param aAttributes are the XML attributes for this SOAP fault
+        */
+        IMPORT_C void ConstructL(const TDesC8& aNsUri,
+                                 const TDesC8& aLocalName,
+                                 const TDesC8& aPrefix,
+                                 const RAttributeArray& aAttributes,
+                                 TXmlEngElement& aElement,
+                                 RSenDocument& aDocument);
+    };
+
+#endif // SEN_SOAP_ENVELOPE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/inc/SenSoapMessage2.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenSoapMessage is an utility class offering capability to
+*                parse XML SOAP envelope and manipulation methods to alter its
+*                contents.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_SOAP_MESSAGE2_H
+#define SEN_SOAP_MESSAGE2_H
+
+//  INCLUDES
+#include <SenWsSecurityHeader2.h>
+#include <SenSoapEnvelope2.h>
+
+class MSenMessageContext;
+
+// CLASS DECLARATION
+
+/**
+* CSenSoapMessage extends basic SOAP envelope functionality by
+* offering methods to set the security header and security token.
+* @lib SenUtils.lib
+* @since Series60 4.0
+*/
+class CSenSoapMessage2 : public CSenSoapEnvelope2
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewL();
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewLC();
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessage2* NewL(TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessage2* NewLC(TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewLC(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext);
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext,
+	                                           TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+	    IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext,
+	                                            TSOAPVersion aVersion);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext,
+                                               TSOAPVersion aVersion,
+                                               const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phase constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext,
+                                                TSOAPVersion aVersion,
+                                                const TDesC8& aSecurityNs);
+
+        /**
+        * Two-phased copy constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewL(CSenSoapMessage2& aMessage);
+
+        /**
+        * Two-phased copy constructor.
+        */
+        IMPORT_C static CSenSoapMessage2* NewLC(CSenSoapMessage2& aMessage);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenSoapMessage2();
+
+        // New functions
+
+        /**
+        * Sets a new security header for the soap message. If existant, the
+        * old security header is deleted and new one with given data is added.
+        * @since Series60 4.0
+        * @param    aData   Data to be used in the security header.
+        */
+        IMPORT_C void SetSecurityHeaderL(const TDesC8& aData);
+
+        /**
+        * Adds new token (content) to current security header,
+        * appending to existing. The token is appended after the
+        * current content of security token. Method instantiates
+        * and adds default security header (without data), if
+        * such was not set in beforehand.
+        * @since Series60 4.0
+        * @param    aNewToken   Token to be inserted.
+        * @return   KErrNone or some system-wide Symbian error codes.
+        */
+        IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken);
+        
+    public: // From MSenMessage
+        IMPORT_C virtual TClass Type();
+        IMPORT_C virtual MSenMessage* CloneL();
+
+    protected:
+
+        /**
+         *  C++ default constructor.
+         */
+        IMPORT_C CSenSoapMessage2::CSenSoapMessage2();
+
+        // New functions
+
+        /**
+        * Helper function to make a new security header.
+        * @since Series60 4.0
+        * @param    aData   Default=NULL. Data to be set in the security header.
+        * @return   new security header, which is located in the cleanup stack.
+        *           Caller takes ownership.
+        */
+        IMPORT_C virtual CSenWsSecurityHeader2* NewSecurityHeaderLC(
+                                                    const TDesC8* aData,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement element);
+
+        // Functions from base classes
+
+        // From CSenSoapEnvelope
+        IMPORT_C virtual void ParseHeaderL(const RTagInfo& aElement,
+                                           const RAttributeArray& aAttributes);
+
+        /**
+        * This method should be called from the deriving classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL();
+
+		/**
+		* This method should be called from the deriving classes ConstructL() methods.
+	    * @since Series60 4.0
+		*/
+	    IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
+	    
+		/**
+		* This method should be called from the deriving classes ConstructL() methods.
+	    * @since Series60 4.0
+		*/
+        IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);	    
+
+        /**
+        * This method should be called from the deriving classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(MSenMessageContext& aContext);
+
+		/**
+		* This method should be called from the deriving classes ConstructL() methods.
+	    * @since Series60 4.0
+		*/
+	    IMPORT_C void BaseConstructL(MSenMessageContext& aContext,
+	                                 TSOAPVersion aVersion);
+	    
+		/**
+		* This method should be called from the deriving classes ConstructL() methods.
+	    * @since Series60 4.0
+		*/
+        IMPORT_C void BaseConstructL(MSenMessageContext& aContext,
+                                     TSOAPVersion aVersion,
+                                     const TDesC8& aSecurityNs);	    
+
+        /**
+        * This method should be called from the deriving
+        * classes ConstructL() methods.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL(CSenSoapMessage2& aMessage);
+
+    protected: // Data
+        // Owned, but element not owned
+        CSenWsSecurityHeader2* ipSecurityHeader;
+    };
+
+#endif // SEN_SOAP_MESSAGE_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/inc/SenWsSecurityHeader2.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,384 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        CSenWsSecurityHeader represents security header functionality
+*                according to oasis wss spesifications (2004/01)
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_WS_SECURITY_HEADER2_H
+#define SEN_WS_SECURITY_HEADER2_H
+
+//  INCLUDES
+#include <SenFragmentBase.h>
+#include <SenSoapConstants.h>
+
+// FORWARD DECLARATIONS
+class CSenIdentityProvider;
+
+// CLASS DECLARATION
+
+/**
+* CSenWsSecurityHeader represents security header functionality according to 
+* oasis web services security (WSS) specifications (2004/01)
+* @lib SenUtils.lib
+* @since Series60 3.0
+*/
+class CSenWsSecurityHeader2 : public CSenFragmentBase
+    {
+    public:  // Constructors and destructor
+
+		/**
+		* PasswordType Enumeration
+		*/
+        enum TPasswordType
+            {
+            EText = 1,        // default, wsse:PasswordText
+            EDigest           // wsse:Digest
+            };
+
+        
+        /**
+        * Basic constructor
+        * @param    aDocument   The document which will be the owner of
+        *                       the elements of this header
+        * @param    aElement    An element which will be parent for this header.
+        * @return a pointer to new CSenWsSecurityHeader class instance.
+        */
+        IMPORT_C static CSenWsSecurityHeader2* NewL(RSenDocument aDocument,
+                                                    TXmlEngElement aElement);
+        
+        /**
+        * Basic constructor.
+        * @param    aDocument   The document which will be the owner of
+        *                       the elements of this header
+        * @param    aElement    An element which will be parent for this header.
+        * @return a new CSenWsSecurityHeader class instance, which pointer
+        * is left on cleanup stack.
+        */
+        IMPORT_C static CSenWsSecurityHeader2* NewLC(RSenDocument aDocument,
+                                                     TXmlEngElement aElement);
+        
+        /**
+        * Basic constructor.
+        * @param    aData       Data to be set as header's content.
+        * @param    aDocument   The document which will be the owner of
+        *                       the elements of this header
+        * @param    aElement    An element which will be parent for this header.
+        * @return a pointer to new CSenWsSecurityHeader class instance.
+        */
+        IMPORT_C static CSenWsSecurityHeader2* NewL(const TDesC8& aData,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement);
+
+        /**
+        * Basic constructor.
+        * @param    aData       Data to be set as header's content.
+        * @param    aDocument   The document which will be the owner of
+        *                       the elements of this header
+        * @param    aElement    An element which will be parent for this header.
+        * @return a new CSenWsSecurityHeader class instance, which pointer
+        * is left on cleanup stack.
+        */
+        IMPORT_C static CSenWsSecurityHeader2* NewLC(const TDesC8& aData,
+                                                     RSenDocument aDocument,
+                                                     TXmlEngElement aElement);
+
+        /**
+        * Basic constructor.
+        * @param    aData           Data to be set as header's content.
+        * @param    aSecurityNs     A namespace to be set to the header.
+        * @param    aDocument       The document which will be the owner of
+        *                           the elements of this header
+        * @param    aElement        An element which will be parent for this header.
+        * @return a pointer to new CSenWsSecurityHeader class instance.
+        */
+        IMPORT_C static CSenWsSecurityHeader2* NewL(const TDesC8& aData,
+                                                    const TDesC8& aSecurityNs,
+                                                    RSenDocument aDocument,
+                                                    TXmlEngElement aElement);
+
+        /**
+        * Basic constructor.
+        * @param    aData           Data to be set as header's content.
+        * @param    aSecurityNs     A namespace to be set to the header.
+        * @param    aDocument       The document which will be the owner of
+        *                           the elements of this header
+        * @param    aElement        An element which will be parent for this header.
+        * @return a new CSenWsSecurityHeader class instance, which pointer
+        * is left on cleanup stack.
+        */
+        IMPORT_C static CSenWsSecurityHeader2* NewLC(const TDesC8& aData,
+                                                     const TDesC8& aSecurityNs,
+                                                     RSenDocument aDocument,
+                                                     TXmlEngElement aElement);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenWsSecurityHeader2();
+
+        // New functions
+    
+        /**
+        * Constructs a username token.
+        * @since Series60 3.0
+        * @param  aIdentityProvider  Identity provider which is used to get
+        * the authorization ID used in username token. Method takes the
+        * AuthzID out from aIdentityProvider, and uses it as username for
+        * this token.
+        * Format of the token is as follows:
+        *
+        * <wsse:UsernameToken>
+        *   <wsse:Username>
+        *       username
+        *   </wsse:Username>
+        * </wsse:UsernameToken>"
+        *
+        * The above token assumes, that wsse namespace is declared in 
+        * top level of the security header.
+        * @return a pointer to buffer containing the username token. Does not
+        * return NULL. Ownership is transferred to the caller. Method leaves
+        * with value KErrNotSupported, if a password type is not supported.
+        */
+        IMPORT_C HBufC8* UsernameTokenL(CSenIdentityProvider &aIdentityProvider);
+
+        /**
+        * Constructs a username token.
+        * @since Series60 3.0
+        * @param  aIdentityProvider  Identity provider which is used to get
+        * the authorization ID used in username token. Method takes the
+        * AuthzID out from aIdentityProvider, and uses it as username for
+        * this token. Password is also fetched from aIdentityProvider via
+        * calling Password() getter, which must return a Base64 [XML-Schema]
+        * encoded, SHA-1 hash value, of the UTF8 encoded password.
+        * @param  aType Specifies the type of the password, either
+        * wsse:PasswordText or wsse:PasswordDigest
+        *
+        * Format of the token is as follows (if password type is wsse:PasswordText):
+        *
+        * <wsse:UsernameToken>
+        *   <wsse:Username>
+        *       username
+        *   </wsse:Username>
+        *   <wsse:Password>
+        *       password
+        *   </wsse:Password>
+        * </wsse:UsernameToken>"
+        *
+        * If the password type is wsse:Password:Digest, then the password element
+        * will be declared as follows:
+        *
+        *   <wsse:Password Type="wsse:PasswordDigest">
+        *
+        * The above token assumes, that wsse namespace is declared in 
+        * top level of the security header.
+        * @return a pointer to buffer containing the username token. Does not
+        * return NULL. Ownership is transferred to the caller. Method leaves
+        * with value KErrNotSupported, if a password type is not supported.
+        */
+        IMPORT_C HBufC8* UsernameTokenL(CSenIdentityProvider &aIdentityProvider,
+                                        CSenWsSecurityHeader2::TPasswordType aType);
+
+        // Static methods:
+
+        /**
+        * Constructs a username token. This method does not add the <Password>
+        * element, since it is optional for basic username tokens.
+        * @since Series60 3.0
+        * @param  aUsername     User name which is used in the username 
+        *                       token.
+        * @param  aToken        Ref-to-pointer where the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt UsernameTokenL(const TDesC8& aUsername,
+                                            HBufC8*& aToken);
+
+        /**
+        * Constructs a username token using a password, too.
+        * @since Series60 5.0
+        * @param  aUsername     User name which is to be used in new token.
+        * @param  aPassword     Password which is to be use in new token.
+        *                       The type will be set to default: wsse:PasswordDigest,
+        *                       defined in KSecurityAttrTypeText. This is
+        *                       a Base64 [XML-Schema] encoded, SHA-1 hash value, 
+        *                       of the UTF8 encoded password.
+        * @param  aToken        Ref-to-pointer in which the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt UsernameTokenL(const TDesC8& aUsername,
+                                            const TDesC8& aPassword,
+                                            HBufC8*& aToken);
+
+       /**
+        * Constructs a username token using a password, too.
+        * @since Series60 5.0
+        * @param  aUsername     User name which is to be used in new token.
+        * @param  aPassword     Password which is to be use in new token
+        *                       This is a Base64 [XML-Schema] encoded, SHA-1 
+        *                       hash value, of the UTF8 encoded password.
+        * @param  aType         Specifies the type of the password:
+        *                       - EText, being default refers to wsse:PasswordText,
+        *                       but this method does not add this, since it can
+        *                       be omitted.
+        *                       - EDigest: will add wsse:PasswordDigest attribute
+        *                       to the <Password> -element, as in here:
+        *
+        *                        <wsse:UsernameToken>
+        *                           <wsse:Username>
+        *                               username
+        *                           </wsse:Username>
+        *                           <wsse:Password Type="wsse:PasswordDigest">
+        *                               password
+        *                           </wsse:Password>
+        *                         </wsse:UsernameToken>"
+        *                        
+        * @param  aToken        Ref-to-pointer where the token will be
+        *                       allocated. Shouldn't contain any data when
+        *                       called, or that data will be lost.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt UsernameTokenL(const TDesC8& aUsername,
+                                            const TDesC8& aPassword,
+                                            CSenWsSecurityHeader2::TPasswordType aType,
+                                            HBufC8*& aToken);
+
+
+        /**
+        * Constructs a timestamp.
+        * @since Series60 5.0
+        * Format of the timestamp is as follows:
+        *   <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+        *       <wsu:Created>2001-09-13T08:42:00Z</wsu:Created>
+        *       <wsu:Expires>2002-09-13T08:42:00Z</wsu:Expires>
+        *   </wsu:Timestamp>
+        * The wsu namespace is declared inside this element.
+        *   Based on chapter 10 from WS-Security 2004
+        * @param aCreated - creation time of token
+        * @param aExpires - end of validation time for token
+        * @param aTimestamp - a pointer to buffer containing the timestamp. Does not
+        *         return NULL. Ownership is transferred to the caller.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt TimestampL(const TDesC8& aCreated, const TDesC8& aExpires, HBufC8*& aTimestamp);
+        
+        /**
+        * Constructs a timestamp.
+        * @since Series60 5.0
+        * Format of the timestamp is as follows:
+        *   <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+        *       <wsu:Created>2001-09-13T08:42:00Z</wsu:Created>
+        *   </wsu:Timestamp>
+        * The wsu namespace is declared inside this element.
+        *   Based on chapter 10 from WS-Security 2004
+        * @param aCreated - creation time of token
+        * @param aTimestamp - a pointer to buffer containing the timestamp. Does not
+        *         return NULL. Ownership is transferred to the caller.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+        IMPORT_C static TInt TimestampL(const TDesC8& aCreated, HBufC8*& aTimestamp);
+
+        /**
+        * Constructs a security token reference.
+        * @since Series60 5.0
+        * Format of the token reference is as follows:
+        *   <wsse:SecurityTokenReference wsu:Id="...">
+        *       <wsse:Reference URI="..."/>
+        *   </wsse:SecurityTokenReference>
+        *
+        * The above token assumes, that wsse namespace is declared in 
+        * top level of the security header.
+        * @param  
+        * @param aSTR - a pointer to buffer containing the token reference. Does not
+        *         return NULL. Ownership is transferred to the caller.
+        * @return KErrNone or some system-wide Symbian error code.
+        */
+//        IMPORT_C static TInt SecurityTokenReferenceL(const TDesC8& aURI, HBufC8*& aSTR); 
+
+       
+        // Virtual methods: 
+
+        /** Basic getter for XML namespace of the WS security header.
+        * Subclasses should override this to use different namespace 
+        * @since Series60 3.0
+        * @return the WS security header namespace as string
+        */
+        IMPORT_C virtual TPtrC8 XmlNs();
+        
+        /**
+        * Basic getter for XML namespace prefix of the WS security header.
+        * Subclasses should override this to use different namespace prefix
+        * @since Series60 3.0
+        * @return the WS security header namespace prefix as string
+        */
+        IMPORT_C virtual TPtrC8 XmlNsPrefix();    
+        
+    protected:  
+        
+        /**
+        * C++ default constructor
+        */
+        IMPORT_C CSenWsSecurityHeader2();
+        
+        /**
+        * Basic BaseConstructL function 
+        */
+        IMPORT_C void BaseConstructL(RSenDocument aDocument,
+                                     TXmlEngElement aElement);
+        
+        // Functions from base classes
+        
+        /**
+        * From CSenBaseFragment Basic BaseConstructL function 
+        * @since Series60 3.0
+        * @param    aData           Data which will be used as current token
+        *                           (content) of this security header
+        * @param    aDocument       The document which will be the owner of
+        *                           the elements of this header
+        * @param    aElement        An element which will be parent for this header.
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aData,
+                                     RSenDocument aDocument,
+                                     TXmlEngElement aElement);
+                                     
+        /**
+        * From CSenBaseFragment Basic BaseConstructL function 
+        * @since Series60 3.0
+        * @param    aData           Data which will be used as current token
+        *                           (content) of this security header
+        * @param    aSecurityNs     A namespace to be set to the header.
+        * @param    aDocument       The document which will be the owner of
+        *                           the elements of this header
+        * @param    aElement        An element which will be parent for this header.
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aData,
+                                     const TDesC8& aSecurityNs,
+                                     RSenDocument aDocument,
+                                     TXmlEngElement aElement);
+    };
+
+#endif // SEN_WS_SECURITY_HEADER2_H
+
+// End of File
Binary file websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/bwins/newsoapclassesbctestu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/eabi/NewSoapClassesBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI16CTestMSenMessage @ 3 NONAME ; #<TI>#
+	_ZTV16CTestMSenMessage @ 4 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+
+PRJ_EXPORTS
+
+testnsc_c.bat		/epoc32/winscw/c/testnsc_c.bat
+testnsc_z.bat		/epoc32/winscw/c/testnsc_z.bat	
+testframework.ini		/epoc32/winscw/c/testframework/testframework_newsoapclasses.ini
+
+PRJ_MMPFILES
+newsoapclasses.mmp
+
+PRJ_TESTMMPFILES
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/newsoapclasses.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for newsoapclasses  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          NewSoapClassesBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY              ALL -TCB
+VENDORID        VID_DEFAULT
+// VENDORID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE           newsoapclassesbctest.def
+
+SOURCEPATH              ../src
+SOURCE                  newsoapclasses.cpp
+SOURCE                  newsoapclassescases.cpp
+SOURCE         			testmsenmessage.cpp
+
+USERINCLUDE             ../inc
+
+SYSTEMINCLUDE           /epoc32/include/libc
+SYSTEMINCLUDE           /epoc32/include/oem
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 estlib.lib
+LIBRARY                 bafl.lib
+LIBRARY                 estor.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 hash.lib
+LIBRARY         				stiftestinterface.lib
+LIBRARY         				charconv.lib
+LIBRARY         				efsrv.lib
+LIBRARY                 SenFragment.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenMessages.lib
+LIBRARY                 XMLFRAMEWORK.lib
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    //LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    //LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LANG            SC
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= NewSoapClassesBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy C:\TestFramework\TestFramework_newsoapclasses.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule NewSoapClassesBCTest
+
+copy C:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_NewSoapClasses.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:        
+rem
+
+copy z:\TestFramework\TestFramework_newsoapclasses.ini c:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule NewSoapClassesBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_NewSoapClasses.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/inc/newsoapclassesbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,539 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          NewSoapClasses test module.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef NEWSOAPCLASSES_H
+#define NEWSOAPCLASSES_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+#include <SenParser.h>
+#include <SenSoapEnvelope2.h>
+#include <SenSoapFault2.h>
+#include <SenSoapMessage2.h>
+#include <SenSoapConstants.h>
+//#include <SenSoapMessageDom2.h>
+#include <SenWsSecurityHeader2.h>
+#include <SenIdentityProvider.h>
+//#include <SenMessageContext.h>
+#include <SenXmlProperties.h>
+#include <e32debug.h>
+#include <e32std.h>
+#include <e32def.h>
+#include <SenXmlConstants.h>
+
+
+
+
+
+//  FORWARD DECLARATIONS
+class CSenSoapFault2;
+class CSenSoapEnvelope2;
+class CSenSoapMessage2;
+class CSenWsSecurityHeader2;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 50
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 6
+
+
+// Logging path
+_LIT( KNewSoapClassesLogPath, "\\logs\\testframework\\NewSoapClassesBCTest\\" ); 
+// Log file
+_LIT( KNewSoapClassesLogFile, "NewSoapClassesBCTest.txt" ); 
+
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CNewSoapClassesBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CNewSoapClassesBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CNewSoapClassesBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a NewSoapClasses class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CNewSoapClassesBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CNewSoapClassesBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CNewSoapClassesBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       NewSoapClasses. It is called once for every instance of 
+        *       TestModuleNewSoapClasses after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of NewSoapClasses.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from NewSoapClasses. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+ 				/**
+         * Method used to log version of test module
+         */
+        void SendTestModuleVersion();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CNewSoapClassesBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+        void SetupL();
+        void Teardown();
+
+
+        /**
+        * Actual Hardcoded test case functions are listed below.
+        */
+         TInt MT_CSenSoapEnvelope2_NewLL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewLCL(TTestResult& aResult);
+        
+         TInt MT_CSenSoapEnvelope2_NewL_1L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewLC_1L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewL_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewLC_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_TypeL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_DirectionL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_TxnIdL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_CloneL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_SoapVersionL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_SetContextL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_ContextL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_SetPropertiesL(TTestResult& aResult);
+
+         TInt MT_CSenSoapEnvelope2_PropertiesL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_IsSafeToCastL(TTestResult& aResult); 
+
+
+         TInt MT_CSenSoapEnvelope2_SetBodyLL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenSoapEnvelope2_SetBodyL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_BodyLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_HeaderLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_AddHeaderLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_BodyAsStringLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_IsFaultL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_DetachFaultLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_FaultLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_SetSoapActionLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_SoapActionL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_HasHeaderL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_HasBodyL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenSoapEnvelope2_Parse1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_Parse2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_Parse3L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_NewLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_NewL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_NewL_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultCodeL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultSubcodeL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultStringL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultActorL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_DetailL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_NewLL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLCL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_NewL_1L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_NewL_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_3L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_3L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_4L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_4L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_5L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_5L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_6L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_6L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_TypeL(TTestResult& aResult);
+         
+		 TInt MT_CSenSoapMessage2_CloneL(TTestResult& aResult);
+		 
+		 TInt MT_CSenSoapMessage2_Parse1L(TTestResult& aResult);
+		 
+        
+        
+         TInt MT_CSenSoapMessage2_SetSecurityHeaderLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_AddSecurityTokenLL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenWsSecurityHeader2_NewLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewLCL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewLC_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewL_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewLC_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_3L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_4L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_TimestampLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_TimestampL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_XmlNsL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_XmlNsPrefixL(TTestResult& aResult);
+         
+		 TInt MT_CTestMSenMessage_Type(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_Direction(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_Context(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_SetContext(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_Properties(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_SetProperties(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_IsSafeToCast(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_TxnId(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_CloneL(TTestResult& aResult);
+     public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // NewSoapClasses_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/inc/testmsenmessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          test class implementation for MSenMessage.h.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef TestMSenMessage_H
+#define TestMSenMessage_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MSenMessage.h>
+
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestMSenMessage: public MSenMessage, public CBase
+    {
+ 	public:
+	 	static CTestMSenMessage* NewL();
+	 	static CTestMSenMessage* NewLC();
+	  	virtual MSenMessage::TClass Type() ;
+	  	virtual MSenMessage::TDirection Direction() ;
+		virtual TInt SetContext(MSenMessageContext* apNotOwnedContext) ;
+	    virtual MSenMessageContext* Context() ;
+	    virtual TInt SetProperties(MSenProperties* apOwnedProperties) ;
+	    virtual MSenProperties* Properties() ;
+	    virtual TBool IsSafeToCast(TClass aType) ;
+	    virtual TInt TxnId() ; 
+	    virtual MSenMessage* CloneL() ;
+	private:
+		CTestMSenMessage();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:        
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices SoapClasses"},(0x20015A26),3,0,0,TYPE=SA
+[0x101F7961],0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\NewSoapClassesBCTest.dll"-"!:\sys\bin\NewSoapClassesBCTest.dll"
+"\Epoc32\winscw\c\testNSC_c.bat"-"!:\testNSC.bat"
+"\Epoc32\winscw\c\testframework\testframework_newsoapclasses.ini"-"!:\testframework\testframework_newsoapclasses.ini"
\ No newline at end of file
Binary file websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclasses.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,413 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          NewSoapClasses class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "newsoapclassesbctest.h"
+#include <sys/reent.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::CNewSoapClassesBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CNewSoapClassesBCTest::CNewSoapClassesBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KNewSoapClassesLogPath, 
+                          KNewSoapClassesLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "NewSoapClasses logging starts!" );
+    iLog->Log( KLogStart );
+    
+   // if ( iXmlReader ){
+    //    delete iXmlReader;
+    //}
+    //iXmlReader = CSenXmlReader::NewL();
+
+    }
+//-----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::SendTestModuleVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("NewSoapClassesBCTest.dll");
+	
+
+	TBool newVersionOfMethod = ETrue;
+	CTestModuleIf &test=TestModuleIf();
+	test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	test.SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNewSoapClassesBCTest* CNewSoapClassesBCTest::NewL()
+    {
+    CNewSoapClassesBCTest* self = new (ELeave) CNewSoapClassesBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CNewSoapClassesBCTest::~CNewSoapClassesBCTest()
+    {
+    if (iLog)  delete iLog;
+    //if ( iXmlReader)
+    	//{
+        //delete iXmlReader;
+      //  iXmlReader = NULL;
+    //  }
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CNewSoapClassesBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CNewSoapClassesBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CNewSoapClassesBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+		SendTestModuleVersion();
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+		iLog->Log( _L("-------------------------------------------------------------"));
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+        CloseSTDLIB();
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CNewSoapClassesBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CNewSoapClassesBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CNewSoapClassesBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclassescases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3453 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include "newsoapclassesbctest.h"
+#include "testmsenmessage.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CNewSoapClassesBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    NewSoapClasses.cpp file and to NewSoapClasses.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        
+        ENTRY( "NewL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLL ),
+        ENTRY( "NewLC - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLCL ),
+        ENTRY( "NewL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_1L ),
+        ENTRY( "NewLC - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_1L ),
+        ENTRY( "NewL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_2L ),
+        ENTRY( "NewLC - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_2L ),
+        ENTRY( "Type - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TypeL ),
+        ENTRY( "Direction - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DirectionL ),
+        ENTRY( "TxnId - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TxnIdL ),
+        ENTRY( "Clone - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_CloneL ),
+        ENTRY( "SoapVersion - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapVersionL ),
+        ENTRY( "SetContext - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetContextL ),
+        ENTRY( "Context - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_ContextL ),
+        ENTRY( "SetProperties - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetPropertiesL ),
+        ENTRY( "SetBodyL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyLL ),
+        ENTRY( "Properties - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_PropertiesL ),
+        ENTRY( "IsSafeToCast - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsSafeToCastL ),
+        
+        ENTRY( "SetBodyL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyL_1L ),
+        ENTRY( "BodyL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyLL ),
+        ENTRY( "HeaderL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HeaderLL ),
+        ENTRY( "AddHeaderL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_AddHeaderLL ),
+        ENTRY( "BodyAsStringL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyAsStringLL ),
+        ENTRY( "IsFault - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsFaultL ),
+        ENTRY( "DetachFaultL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DetachFaultLL ),
+        ENTRY( "FaultL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_FaultLL ),
+        ENTRY( "SetSoapActionL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetSoapActionLL ),
+        ENTRY( "SoapAction - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapActionL ),
+        ENTRY( "HasHeader - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasHeaderL ),
+        ENTRY( "HasBody - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasBodyL ),
+        ENTRY( "Parse1 - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse1L ),
+        ENTRY( "Parse2 - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse2L ),
+        ENTRY( "Parse2 - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse3L ),
+        ENTRY( "NewL - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_NewLL ),
+        ENTRY( "NewL - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_1L ),
+        ENTRY( "NewL - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_2L ),
+        ENTRY( "FaultCode - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultCodeL ),
+        ENTRY( "FaultSubcode - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultSubcodeL ),
+        ENTRY( "FaultString - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultStringL ),
+        ENTRY( "FaultActor - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultActorL ),
+        ENTRY( "Detail - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_DetailL ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLL ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLCL ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_1L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_1L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_2L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_2L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_3L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_3L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_4L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_4L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_5L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_5L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_6L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_6L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLL ),
+        ENTRY( "Type - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_TypeL ),
+        ENTRY( "Clone - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_CloneL ),
+		ENTRY( "Parse - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_Parse1L ),        
+        ENTRY( "SetSecurityHeaderL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_SetSecurityHeaderLL ),
+        ENTRY( "AddSecurityTokenL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_AddSecurityTokenLL ),
+        ENTRY( "NewL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLL ),
+        ENTRY( "NewLC - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLCL ),
+        ENTRY( "NewL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_1L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_1L ),
+        ENTRY( "NewL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_2L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_2L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenLL ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_1L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_2L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_3L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_4L ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampLL ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampL_1L ),
+        ENTRY( "XmlNs - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsL ),
+        ENTRY( "XmlNsPrefix - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsPrefixL ),
+        ENTRY( "Type - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Type),
+        ENTRY( "Direction - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Direction),
+        ENTRY( "Context - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Context),
+        ENTRY( "SetContext - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_SetContext),
+        ENTRY( "Properties - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Properties),
+        ENTRY( "SetProperties - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_SetProperties),
+        ENTRY( "IsSafeToCast - MSenMessage", CNewSoapClassesBCTest:: MT_CTestMSenMessage_IsSafeToCast),
+        ENTRY( "TxnId - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_TxnId),
+        ENTRY( "CloneL - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_CloneL),
+        
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CNewSoapClassesBCTest::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CNewSoapClassesBCTest::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CNewSoapClassesBCTest::SetupL(  ){
+
+	} 
+
+void CNewSoapClassesBCTest::Teardown(  ){
+
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+    }
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLCL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewLC();
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    //CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;    
+    }    
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL(*mContext);
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);    
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_1L( TTestResult& aResult )
+	{
+	 SetupL();
+	 _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	 MSenMessageContext* mContext = NULL;
+	 CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewLC(*mContext);
+	 HBufC8* pAsXml = pEnvelope->AsXmlL();
+	 CleanupStack::PushL(pAsXml);
+     if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+     CleanupStack::PopAndDestroy(pAsXml);
+     CleanupStack::PopAndDestroy(pEnvelope);
+     //CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewL(*pEnvelope1);
+    CleanupStack::PushL(pEnvelope);
+
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_2L( TTestResult& aResult )
+    {
+	SetupL();
+   _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewLC(*pEnvelope1);
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pEnvelope);
+    //CleanupStack::PopAndDestroy();
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TypeL( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessage::TClass var = MSenMessage::ESoapEnvelope2;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->Type());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DirectionL( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessage::TDirection var = MSenMessage::EOutbound;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->Direction());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TxnIdL( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewL(*pEnvelope1);
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TInt var = pEnvelope->TxnId();
+    TBool Flag;
+    
+    if(var >= 0)
+    if(!(Flag)) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope);
+    pEnvelope = NULL;
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_CloneL( TTestResult& aResult )
+	{
+	SetupL();
+	TBool Flag;
+	CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+	CleanupStack::PushL(pEnvelope);
+	CSenSoapEnvelope2* pClone = NULL;
+    pClone = (CSenSoapEnvelope2*)pEnvelope->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pEnvelope);
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapVersionL( TTestResult& aResult )
+	{
+	SetupL();
+	TSOAPVersion var = ESOAP11;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->SoapVersion());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetContextL( TTestResult& aResult )
+	{
+	SetupL();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    MSenMessageContext* mContext = NULL;
+   
+	CSenXmlProperties* prop = CSenXmlProperties::NewL();
+//	CSenMessageContext* mContext1 = CSenMessageContext::NewL(SenContext::EOutgoing, prop);
+    TL(KErrArgument == pEnvelope->SetContext(mContext));
+  //  TL(KErrNone == pEnvelope->SetContext(mContext1));
+    TL(mContext == pEnvelope->Context());
+    CleanupStack::PopAndDestroy(pEnvelope);
+//    delete mContext1;
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_ContextL( TTestResult& aResult )
+	{
+	SetupL();
+	TTestResult Result;	
+	CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetContextL(Result);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetPropertiesL( TTestResult& aResult )
+	{
+	SetupL();
+    CSenXmlProperties* prop = CSenXmlProperties::NewL();
+    CleanupStack::PushL(prop);
+    
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::Pop();
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    TL(KErrNone == pEnvelope->SetProperties(prop));
+    CleanupStack::PopAndDestroy();
+    
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_PropertiesL( TTestResult& aResult )
+	{
+	SetupL();
+    CSenXmlProperties* prop = CSenXmlProperties::NewL();
+    CleanupStack::PushL(prop);
+    
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::Pop();
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    TL(KErrNone == pEnvelope->SetProperties(prop));
+    TL(prop == pEnvelope->Properties());
+    CleanupStack::PopAndDestroy();
+    
+    
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsSafeToCastL( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessage::TClass var = MSenMessage::ESoapEnvelope2;
+	TBool retVal = ETrue;
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    retVal == pEnvelope->IsSafeToCast(var);
+
+
+    if(retVal == EFalse)
+    	return KErrArgument;
+    
+    CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyContentString, "<Test>Content</Test>");
+
+    _LIT8(KEnvelopeString, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><Test>Content</Test></S:Body>\
+</S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    pEnvelope->SetBodyL(KBodyContentString);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,   "BodyElement");
+    _LIT8(KBodyContent,       "BodyContent");
+    _LIT8(KBodyElementName2,  "BodyElement2");
+    _LIT8(KBodyContent2,      "BodyContent2");
+
+    _LIT8(KEnvelopeString, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><BodyElement>BodyContent</BodyElement></S:Body>\
+</S:Envelope>");
+
+    _LIT8(KEnvelopeString2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><BodyElement2>BodyContent2</BodyElement2></S:Body>\
+</S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyContent());
+    pEnvelope->SetBodyL(bodyElement);
+
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelopeString )) KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TXmlEngElement bodyElement2 = document.CreateDocumentElementL(KBodyElementName2());
+    bodyElement2.AddTextL(KBodyContent2());
+    pEnvelope->SetBodyL(bodyElement2);
+
+    pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelopeString2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyContentString, "Test");
+    _LIT8(KBodyString, "<S:Body>Test</S:Body>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    pEnvelope->SetBodyL(KBodyContentString);
+
+    TXmlEngElement element = pEnvelope->BodyL();
+    RSenDocument document = pEnvelope->AsDocumentL();
+
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, element, options);
+
+    // Serialized body should contain only body as XML.
+    if(!( asXml == KBodyString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HeaderLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KHeaderString, "<S:Header/>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement element = pEnvelope->HeaderL();
+
+    RSenDocument document = pEnvelope->AsDocumentL();
+
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, element, options);
+
+    // Serialized header should contain only header as XML.
+    if(!( asXml == KHeaderString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_AddHeaderLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+    _LIT8(KHeaderElementName2,  "HeaderElement2");
+    _LIT8(KHeaderContent2,      "HeaderContent2");
+
+    _LIT8(KEnvelope,            "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+</S:Header>\
+<S:Body/></S:Envelope>");
+
+    _LIT8(KEnvelope2,            "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+<HeaderElement2>HeaderContent2</HeaderElement2>\
+</S:Header>\
+<S:Body/></S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement headerElement = document.CreateDocumentElementL(KHeaderElementName());
+    headerElement.AddTextL(KHeaderContent());
+    pEnvelope->AddHeaderL(headerElement);
+
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelope )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TXmlEngElement headerElement2 = document.CreateDocumentElementL(KHeaderElementName2());
+    headerElement2.AddTextL(KHeaderContent2());
+    pEnvelope->AddHeaderL(headerElement2);
+
+    pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelope2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyAsStringLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    _LIT8(KBodyElementContent, "BodyElementContent");
+    _LIT8(KBodyContent,        "BodyContent");
+
+    _LIT8(KBodyAsString1, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">BodyContent</S:Body>");
+    _LIT8(KBodyAsString2, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<BodyElement>BodyElementContent</BodyElement>\
+</S:Body>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyElementContent());
+
+    pEnvelope->SetBodyL(KBodyContent);
+
+    // If Body element does not contain any elements
+    // whole Body element is returned (and detached
+    // => needed namespace declarations are moved into
+    //    Body)
+    HBufC8* pAsXml = pEnvelope->BodyAsStringL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KBodyAsString1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    pEnvelope->SetBodyL(bodyElement);
+
+    // If Body element contains element(s)
+    // only first element (and all its child elements)
+    // from Body element is returned and detached
+    // (not Body element).
+    pAsXml = pEnvelope->BodyAsStringL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KBodyAsString2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsFaultL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultInputString,  "<SOAP:Envelope \
+xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<SOAP:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+</SOAP:Header>\
+<SOAP:Body><SOAP:Fault>FaultContent</SOAP:Fault></SOAP:Body>\
+</SOAP:Envelope>");
+
+    // 1. Test that IsFault return EFalse by default
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    //if(!( pEnvelope->IsFault() == EFalse )) return KErrArgument;
+    TL( pEnvelope->IsFault() == EFalse )
+
+    // 2. Test that IsFault returns ETrue when fault is added
+    //    using SetBodyL method
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName(),
+                                                            pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+    pEnvelope->SetBodyL(faultElement);
+
+    if(!( pEnvelope->IsFault())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+
+    // 3. Test that IsFault returns ETrue if fault is added
+    //    when Envelope is parsed
+
+    CSenParser* pParser = CSenParser::NewLC();
+    pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KFaultInputString, *pEnvelope);
+	if(!( pEnvelope->IsFault())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DetachFaultLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultElement,       "<S:Fault xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">FaultContent</S:Fault>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement body = pEnvelope->BodyL();
+    TXmlEngElement faultElement = body.AddNewElementWithNsL(KFaultElementName(),
+                                                      pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+
+    CSenSoapFault2* pFault = pEnvelope->DetachFaultL();
+    CleanupStack::PushL(pFault);
+
+    HBufC8* pAsXml = pFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFault);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_FaultLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultElement,       "<S:Fault>FaultContent</S:Fault>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement body = pEnvelope->BodyL();
+    TXmlEngElement faultElement = body.AddNewElementWithNsL(KFaultElementName(),
+                                                            pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+
+    CSenSoapFault2* pFault = pEnvelope->FaultL();
+    CleanupStack::PushL(pFault);
+
+    HBufC8* pAsXml = pFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFault);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetSoapActionLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapActionValue,         "SoapActionValue");
+    _LIT8(KSoapActionValueInQuotes, "\"SoapActionValue\"");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TPtrC8 retVal = pEnvelope->SetSoapActionL(KSoapActionValue);
+    if(!( retVal == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction = pEnvelope->SoapAction();
+    if(!( soapAction == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 retVal2 = pEnvelope->SetSoapActionL(KSoapActionValueInQuotes);
+    if(!( retVal2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction2 = pEnvelope->SoapAction();
+    if(!( soapAction2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapActionL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapActionValue,         "SoapActionValue");
+    _LIT8(KSoapActionValueInQuotes, "\"SoapActionValue\"");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TPtrC8 retVal = pEnvelope->SetSoapActionL(KSoapActionValue);
+    if(!( retVal == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction = pEnvelope->SoapAction();
+    if(!( soapAction == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 retVal2 = pEnvelope->SetSoapActionL(KSoapActionValueInQuotes) ;
+    if(!( retVal2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction2 = pEnvelope->SoapAction();
+    if(!( soapAction2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasHeaderL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    if(!( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement headerElement = document.CreateDocumentElementL(KHeaderElementName());
+    headerElement.AddTextL(KHeaderContent());
+    pEnvelope->AddHeaderL(headerElement);
+
+    if(!( pEnvelope->HasHeader())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasBodyL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    _LIT8(KBodyElementContent, "BodyElementContent");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    if(!( pEnvelope->HasBody() == EFalse )) return KErrArgument;
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyElementContent());
+
+    pEnvelope->SetBodyL(bodyElement);
+
+    if(!( pEnvelope->HasBody())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KInputString, *pEnvelope);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pEnvelope->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be detached from SoapEnvelope
+	//    correctly.
+	// Note: Following "BodyAsStringL()" call will detach
+	//       Body from SoapEnvelope
+	HBufC8* pBodyAsString = pEnvelope->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KBodyAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 3) Check that body can be detached from SoapEnvelope
+	//    twice
+	//    In this case body does not have child elements.
+	//    => Empty body should be returned.
+	//       Note: Empty body should contain namespace
+	//             declaration because body is detached
+	pBodyAsString = pEnvelope->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KEmptyBodyWithNsAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 4) Check that body was detached from SoapEnvelope
+	//    correctly
+	//    => Getting body again should result empty body to be returned.
+	TXmlEngElement bodyElement = pEnvelope->BodyL();
+	RSenDocument document = pEnvelope->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be empty because "BodyAsStringL()"
+    // previously detached body.
+    if(!( asXml == KEmptyBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,         "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+
+    _LIT8(KWholeBodyAsString,   "<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KWholeHeaderAsString, "<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KInputString, *pEnvelope);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pEnvelope->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be got from SoapEnvelope
+	//    correctly
+	// Note: Body won't be detached. Only reference for
+	//       body TXmlEngElement inside SoapEnvelope is returned.
+	TXmlEngElement bodyElement = pEnvelope->BodyL();
+	RSenDocument document = pEnvelope->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be in exactly the same form
+    // as in original SoapEnvelope
+    if(!( asXml == KWholeBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    // 3) Check that header TXmlEngElement can be got from SoapEnvelope
+	//    correctly
+    TXmlEngElement headerElement = pEnvelope->HeaderL();
+
+    RBuf8 headerAsXml;
+    CleanupClosePushL(headerAsXml);
+    document.SaveL(headerAsXml, headerElement, options);
+
+    // Serielized header should be in exactly the same form
+    // as in original SoapEnvelope
+    if(!( headerAsXml == KWholeHeaderAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&headerAsXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,         "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+<wsa:MessageID>urn:uuid:7837d733-b9f8-3eb1-5c3f-7a509797e6b2</wsa:MessageID>\
+<wsa:To>http://schemas.live.com/mws/2005/08/spaces</wsa:To>\
+<wsa:Action>http://schemas.live.com/mws/2005/08/spaces/Post</wsa:Action>\
+<wsa:ReplyTo><wsa:Address>id:7bbd5c5b-7857-44c4-b609-53498d0cab3b</wsa:Address></wsa:ReplyTo>\
+</S:Header>\
+<S:Body>\
+<PostRequest xmlns=\"http://schemas.live.com/mws/2005/08/spaces\">\
+<Item><Filename>sample1.wav</Filename><ItemType>8</ItemType><Image><Data></Data></Image></Item>\
+</PostRequest>\
+</S:Body>\
+</S:Envelope>");
+
+    _LIT8(KOuterXml,            "<S:Body>\
+<PostRequest xmlns=\"http://schemas.live.com/mws/2005/08/spaces\">\
+<Item><Filename>sample1.wav</Filename><ItemType>8</ItemType><Image><Data/></Image></Item>\
+</PostRequest>\
+</S:Body>");
+
+    CSenParser* pParser = CSenParser::NewL();
+    CleanupStack::PushL(pParser);
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    pParser->ParseL(KInputString, *pEnvelope);
+    TXmlEngElement element = pEnvelope->BodyL();
+
+    RBuf8 outerXml;
+    CleanupClosePushL(outerXml);
+    element.OuterXmlL(outerXml);
+
+    if(!( outerXml == KOuterXml )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&outerXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,    "Fault");
+    _LIT8(KFaultElementContent, "FaultContent");
+    _LIT8(KFaultElement,        "<Fault>FaultContent</Fault>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName());
+    faultElement.AddTextL(KFaultElementContent());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,    "Fault");
+    _LIT8(KFaultElementContent, "FaultContent");
+    _LIT8(KFaultElement,        "<Fault>FaultContent</Fault>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName());
+    faultElement.AddTextL(KFaultElementContent());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KParentName,          "Parent");
+
+    _LIT8(KAttributeNsUri,      "nsuri");
+    _LIT8(KAttributeNsPrefix,   "pr");
+    _LIT8(KAttributeLocalName,  "AttrName");
+    _LIT8(KAttributeValue,      "Value");
+
+    _LIT8(KFaultNsUri,          "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KFaultNsPrefix,       "S");
+    _LIT8(KFaultLocalName,      "Fault");
+
+    _LIT8(KFaultElement,        "<S:Fault \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" \
+xmlns:pr=\"nsuri\" pr:AttrName=\"Value\"/>");
+
+    _LIT8(KParentDocument,      "<Parent><S:Fault \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" \
+xmlns:pr=\"nsuri\" pr:AttrName=\"Value\"/>\
+</Parent>");
+
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(KParentName());
+
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+    RString nsUriRString        = stringPool.OpenStringL(KAttributeNsUri);
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(KAttributeNsPrefix);
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(KAttributeLocalName);
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(KAttributeValue);
+    CleanupClosePushL(valueRString);
+
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString,
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(KFaultNsUri,
+                                                      KFaultLocalName,
+                                                      KFaultNsPrefix,
+                                                      attrArray,
+                                                      parentElement,
+                                                      document);
+    CleanupStack::PushL(pSoapFault);
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    parentElement.OuterXmlL(buffer);
+
+    if(!( buffer == KParentDocument )) return KErrArgument;
+    CleanupStack::PopAndDestroy(&buffer);
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapFault);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(&document);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultCodeL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	//	Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultCodeLocalname());
+    faultCodeElement.AddTextL(KFaultCodeValue());
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PushL(pSoapFault);
+    TPtrC8 faultCode = pSoapFault->FaultCode();
+    if(!( faultCode == KFaultCodeValue )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2 = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultValueElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultCode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+   
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultSubcodeL( TTestResult& aResult )
+    {
+	SetupL();
+    // FaultSubcodeL is supported only in Soap 1.2
+    // If other version of Soap is used return value will always be KNullDesC
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+//    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12SubcodeLocalname,	"Subcode"); // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	// Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+    // 1) Fault subcode in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 there is _NO_ sobcode
+    //          => KNullDesC8 should be returned.
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement    = faultElement.AddNewElementL(KFault12CodeLocalname());
+    TXmlEngElement faultSubCodeElement = faultCodeElement.AddNewElementSameNsL(KFault12SubcodeLocalname());
+    TXmlEngElement faultValueElement   = faultSubCodeElement.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultSubcode();
+    if(!( faultCode == KNullDesC8 )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+ 	CleanupStack::PopAndDestroy(1); // document
+    
+    // 2) Fault subcode in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2    = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultSubCodeElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12SubcodeLocalname());
+    TXmlEngElement faultValueElement2   = faultSubCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultSubcode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultStringL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultStringLocalname,    "faultstring");
+
+    _LIT8(KFault12ReasonLocalname,	"Reason");  // Soap1.2
+    _LIT8(KFault12TextLocalname,	"Text");    // Soap1.2
+
+
+    _LIT8(KFaultStringValue,        "Fault code string");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultStringElement = faultElement.AddNewElementL(KFaultStringLocalname());
+    faultStringElement.AddTextL(KFaultStringValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultString();
+    if(!( faultCode == KFaultStringValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultReasonElement2 = faultElement2.AddNewElementSameNsL(KFault12ReasonLocalname());
+    TXmlEngElement faultTextElement2 = faultReasonElement2.AddNewElementSameNsL(KFault12TextLocalname());
+    faultTextElement2.AddTextL(KFaultStringValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultString();
+    if(!( faultCode2 == KFaultStringValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultActorL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultActorLocalname,     "faultactor");
+
+    _LIT8(KFault12NodeLocalname,	"Node");    // Node represents faultactor in Soap 1.2
+
+    _LIT8(KFaultActorValue,          "http://www.wrox.com/heroes/endpoint.asp");
+
+
+    // 1) Faultactor in Soap other than 1.2
+    //    "faultactor" is intended to provide information about which SOAP node
+    //    on the SOAP message path caused the fault to happen.
+    //    The value of the "faultactor" is a URI identifying the source of the fault.
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultActorLocalname());
+    faultCodeElement.AddTextL(KFaultActorValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultActor = pSoapFault->FaultActor();
+    if(!( faultActor == KFaultActorValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+    // 2) Faultactor in Soap 1.2
+    //    "Node" is intended to provide information about which SOAP node on the
+    //    SOAP message path caused the fault to happen.
+    //    "Node" contains the URI of the SOAP node that generated the fault.
+    //
+    //    Note: In Soap 1.2 "Node" represents "faultactor" from previous SOAP versions.
+
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultNodeElement2 = faultElement2.AddNewElementSameNsL(KFault12NodeLocalname());
+    faultNodeElement2.AddTextL(KFaultActorValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    HBufC8* pAsXml = pSoapFault2->AsXmlL();
+    delete pAsXml;
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultActor();
+    if(!( faultCode2 == KFaultActorValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_DetailL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KDetailLocalname,         "detail");
+
+    _LIT8(KFault12DetailLocalname,	"Detail");    // Soap 1.2
+
+    _LIT8(KFaultDetailValue,          "Detailed information");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultDetailElement = faultElement.AddNewElementL(KDetailLocalname());
+    faultDetailElement.AddTextL(KFaultDetailValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultDetail = pSoapFault->Detail();
+    if(!( faultDetail == KFaultDetailValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultDetailElement2 = faultElement2.AddNewElementSameNsL(KFault12DetailLocalname());
+    faultDetailElement2.AddTextL(KFaultDetailValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultDetail2 = pSoapFault2->Detail();
+    if(!( faultDetail2 == KFaultDetailValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLCL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC();
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KIllegalNamespace);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KIllegalNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapMessage2* pSoapMessage, *pSoapMessage1 = CSenSoapMessage2::NewL();
+    pSoapMessage = CSenSoapMessage2::NewL(*pSoapMessage1);
+    
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSoapMessage);
+    pSoapMessage = NULL;
+    delete pSoapMessage1;
+    pSoapMessage1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapMessage2* pSoapMessage, *pSoapMessage1 = CSenSoapMessage2::NewL();
+    pSoapMessage = CSenSoapMessage2::NewLC(*pSoapMessage1);
+    
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    delete pSoapMessage1;
+    pSoapMessage1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_4L( TTestResult& aResult )
+	{
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext);
+    CleanupStack::PushL(pSoapMessage);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_4L( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_5L( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+	
+    MSenMessageContext* mContext = NULL;
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP12 );
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_5L( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    MSenMessageContext* mContext = NULL;
+
+  
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext, ESOAP11);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext, ESOAP12);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_6L( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessageContext* mContext = NULL;
+
+    
+	_LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP11, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP11, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP11, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_6L(TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessageContext* mContext = NULL;
+    
+	 _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KIllegalNamespace);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KIllegalNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    Teardown();
+    return KErrNone;    
+	}
+	
+ 
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_TypeL( TTestResult& aResult )
+	{
+	SetupL();
+	CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+    
+    TL(MSenMessage::ESoapMessage2 == pSoapMessage->Type());
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_CloneL( TTestResult& aResult )
+	{
+	SetupL();
+	TBool Flag;
+	CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+
+	CSenSoapMessage2* pClone = NULL;
+    pClone = 	(CSenSoapMessage2*)pSoapMessage->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+    delete pClone;
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_Parse1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pMessage);
+
+	pParser->ParseL(KInputString, *pMessage);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pMessage->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be detached from SoapEnvelope
+	//    correctly.
+	// Note: Following "BodyAsStringL()" call will detach
+	//       Body from SoapEnvelope
+	HBufC8* pBodyAsString = pMessage->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KBodyAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 3) Check that body can be detached from SoapEnvelope
+	//    twice
+	//    In this case body does not have child elements.
+	//    => Empty body should be returned.
+	//       Note: Empty body should contain namespace
+	//             declaration because body is detached
+	pBodyAsString = pMessage->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KEmptyBodyWithNsAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 4) Check that body was detached from SoapEnvelope
+	//    correctly
+	//    => Getting body again should result empty body to be returned.
+	TXmlEngElement bodyElement = pMessage->BodyL();
+	RSenDocument document = pMessage->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be empty because "BodyAsStringL()"
+    // previously detached body.
+    if(!( asXml == KEmptyBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pMessage);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_SetSecurityHeaderLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11_1, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<Credential/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage11_2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_1, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<Credential/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_2, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KCredential,      "<Credential/>");
+
+    // 1) Soap 1.1 - Test setting of SecurityHeader WITH Credential
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KCredential);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Soap 1.1 - Test setting of SecurityHeader WITHOUT Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KNullDesC8);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 3) Soap 1.2 - Test setting of SecurityHeader WITH Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KCredential);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 4) Soap 1.2 - Test setting of SecurityHeader WITH Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KNullDesC8);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_AddSecurityTokenLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11_1, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage11_2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+<SecurityToken2/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_1, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_2, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+<SecurityToken2/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSecurityToken,   "<SecurityToken/>");
+    _LIT8(KSecurityToken2,   "<SecurityToken2/>");
+
+    // 1) Soap 1.1 - Test adding of SecurityToken
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Soap 1.1 - Test adding of two SecurityTokens
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+    pSoapMessage->AddSecurityTokenL(KSecurityToken2);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 3) Soap 1.2 - Test adding of SecurityToken
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 4) Soap 1.2 - Test adding of two SecurityTokens
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+    pSoapMessage->AddSecurityTokenL(KSecurityToken2);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+
+    _LIT8(KRootElementName, "RootElement");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLCL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+
+    _LIT8(KRootElementName, "RootElement");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(KSecurityToken,
+                                                                      document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(KSecurityToken,
+                                                                       document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+    _LIT8(KNamespace,       "namespace");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(KSecurityToken,
+                                                                      KNamespace,
+                                                                      document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+    _LIT8(KNamespace,       "namespace");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(KSecurityToken,
+                                                                       KNamespace,
+                                                                       document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KUserName,        "UserName");
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+
+    _LIT8(KFakeEndPoint,        "http://www.fake_endpoint.com/");
+    _LIT8(KUsername,            "Username");
+    _LIT8(KPassword,            "Password");
+
+    _LIT8(KUserNameToken,       "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    _LIT8(KUserNameTokenDigest, "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+<wsse:Password Type=\"wsse:PasswordDigest\">Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KFakeEndPoint());
+    pIdP->SetUserInfoL(KUsername, KNullDesC8, KPassword);
+
+    // 1) Test using CSenWsSecurityHeader2::EText
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP, CSenWsSecurityHeader2::EText);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    // 2) Test using CSenWsSecurityHeader2::EDigest
+    pWsSecHeader = CSenWsSecurityHeader2::NewLC(document, rootElement);
+
+    pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP, CSenWsSecurityHeader2::EDigest);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameTokenDigest )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(pIdP);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KUserName,        "UserName");
+    _LIT8(KPassword,        "Password");
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+    _LIT8(KUserName,            "UserName");
+    _LIT8(KPassword,            "Password");
+    _LIT8(KUserNameToken,       "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    _LIT8(KUserNameTokenDigest, "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password Type=\"wsse:PasswordDigest\">Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    // 1) Test using CSenWsSecurityHeader2::EText
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, CSenWsSecurityHeader2::EText,
+                                 pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    // 2) Test using CSenWsSecurityHeader2::EDigest
+    pWsSecHeader = CSenWsSecurityHeader2::NewLC(document, rootElement);
+
+    pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, CSenWsSecurityHeader2::EDigest,
+                                 pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameTokenDigest )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_4L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+
+    _LIT8(KFakeEndPoint,    "http://www.fake_endpoint.com/");
+    _LIT8(KUsername,        "Username");
+    _LIT8(KPassword,        "Password");
+
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KFakeEndPoint());
+    pIdP->SetUserInfoL(KUsername, KNullDesC8, KPassword);
+
+    HBufC8* pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pIdP);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KCreated,         "2001-09-13T08:42:00Z");
+    _LIT8(KExpires,         "2002-09-13T08:42:00Z");
+    _LIT8(KTimeStamp,       "\
+<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\
+<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>\
+<wsu:Expires>2002-09-13T08:42:00Z</wsu:Expires>\
+</wsu:Timestamp>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    HBufC8* pTimeStamp;
+    pWsSecHeader->TimestampL(KCreated, KExpires, pTimeStamp);
+    CleanupStack::PushL(pTimeStamp);
+    if(!( *pTimeStamp == KTimeStamp )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pTimeStamp);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KCreated,         "2001-09-13T08:42:00Z");
+    _LIT8(KTimeStamp,       "\
+<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\
+<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>\
+</wsu:Timestamp>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    HBufC8* pTimeStamp;
+    pWsSecHeader->TimestampL(KCreated, pTimeStamp);
+    CleanupStack::PushL(pTimeStamp);
+    if(!( *pTimeStamp == KTimeStamp )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pTimeStamp);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+    _LIT8(KSecurityNamespace,   "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TPtrC8 nameSpace = pWsSecHeader->XmlNs();
+    if(!( nameSpace == KSecurityNamespace )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsPrefixL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,         "RootElement");
+    _LIT8(KSecurityNamespacePrefix, "wsse");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TPtrC8 prefix = pWsSecHeader->XmlNsPrefix();
+    if(!( prefix == KSecurityNamespacePrefix )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Type( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Type());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Direction( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Direction());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Context( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Context());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_SetContext( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	MSenMessageContext* apNotOwnedContext =NULL;
+	TRAPD(res,pTest->SetContext(apNotOwnedContext));
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Properties( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Properties());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_SetProperties( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	MSenProperties* apOwnedProperties = NULL;
+	TRAPD(res,pTest->SetProperties(apOwnedProperties ));
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_IsSafeToCast( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->IsSafeToCast(MSenMessage::ESoapEnvelope2));
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_TxnId( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->TxnId());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_CloneL( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->CloneL());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+
+/*
+
+
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	//	Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+TFileName path( _L("c:\\abc.txt"));
+	RFile file;
+	RFs fileSession;
+	TInt err = fileSession.Connect(); 
+
+	err = file.Open(fileSession, path, EFileStreamText | EFileWrite);
+	if ( err != KErrNone)
+			err = file.Create(fileSession,path, EFileStreamText|EFileWrite|EFileShareAny);
+	   
+	TFileText filetext;
+	filetext.Set( file );
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    
+    filetext.Write(_L("RSenDocument::NewL"));
+    
+//    RSenDocument document1 = RSenDocument::NewL();
+    
+ //   filetext.Write(_L("RSenDocument::NewL"));
+    
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    
+    filetext.Write(_L("document.CreateDocumentElementL"));
+    
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultCodeLocalname());
+    
+    filetext.Write(_L("faultElement.AddNewElementL"));
+    
+    faultCodeElement.AddTextL(KFaultCodeValue());
+	
+	filetext.Write(_L("faultCodeElement.AddTextL(KFaultCodeValue());"));
+    
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement);//, document);
+    
+    filetext.Write(_L("CSenSoapFault2::NewL(faultElement, document);"));
+    
+    CleanupStack::PushL(pSoapFault);
+	
+	filetext.Write(_L("CleanupStack::PushL(pSoapFault);"));
+    
+    TPtrC8 faultCode = pSoapFault->FaultCode();
+    
+    filetext.Write(_L("TPtrC8 faultCode = pSoapFault->FaultCode();"));
+    
+    if(!( faultCode == KFaultCodeValue )) return KErrArgument;
+	
+	filetext.Write(_L("if(!( faultCode == KFaultCodeValue )) return KErrArgument;"));
+  
+    CleanupStack::PopAndDestroy(pSoapFault);
+  
+    filetext.Write(_L("CleanupStack::PopAndDestroy(pSoapFault);"));
+
+	CleanupStack::PopAndDestroy(1); // document
+
+	filetext.Write(_L("CleanupStack::PopAndDestroy(1); "));
+
+   /* // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2 = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultValueElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultCode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    *//*
+    Teardown();
+    filetext.Write(_L("Teardown"));
+    return KErrNone;    
+	*/
+	
+	
+	
+	
+	//  End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/testmsenmessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          test class implementation for MSenMessage.h.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "testmsenmessage.h"
+#include <e32base.h>
+
+ 	CTestMSenMessage* CTestMSenMessage::NewL()
+ 	{
+ 		CTestMSenMessage* pTestMSenMessage = new (ELeave) CTestMSenMessage();
+ 		return pTestMSenMessage;
+ 	}
+ 	CTestMSenMessage* CTestMSenMessage::NewLC()
+ 	{
+ 		CTestMSenMessage* pTestMSenMessage = new (ELeave) CTestMSenMessage();
+ 		CleanupStack::PushL(pTestMSenMessage);
+ 		return pTestMSenMessage;
+ 	}
+ 	CTestMSenMessage::CTestMSenMessage()
+ 	{
+ 		
+ 	}
+  	MSenMessage::TClass CTestMSenMessage::Type() 
+  	{
+  		EMessageBase;
+  	}
+  	MSenMessage::TDirection CTestMSenMessage::Direction() 
+  	{
+  		EOutbound;
+  	}
+	TInt CTestMSenMessage::SetContext(MSenMessageContext* apNotOwnedContext) 
+	{
+		return KErrNone;
+	}
+    MSenMessageContext* CTestMSenMessage::Context() 
+    {
+    	return NULL;
+    }
+    TInt CTestMSenMessage::SetProperties(MSenProperties* apOwnedProperties)
+    {
+    	return KErrNone;
+    }
+    MSenProperties* CTestMSenMessage::Properties() 
+    {
+    	return NULL;
+    }
+    TBool CTestMSenMessage::IsSafeToCast(TClass aType)
+    {
+    	return ETrue;
+    }
+    TInt CTestMSenMessage::TxnId() 
+    {
+    	return KErrNone;
+    } 
+    MSenMessage* CTestMSenMessage::CloneL() 
+    {
+    	return NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for web_service_messagind_api test source  
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+../newsoapclassesTester/group/newsoapclassesTester.mmp
+
+
+// End of file
Binary file websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/bwins/newsoapclassesbctestu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/eabi/NewSoapClassesBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,6 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI16CTestMSenMessage @ 3 NONAME ; #<TI>#
+	_ZTV16CTestMSenMessage @ 4 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+
+PRJ_EXPORTS
+
+../sis/testnsc_c.bat		/epoc32/winscw/c/testnsc_c.bat
+../sis/testnsc_z.bat		/epoc32/winscw/c/testnsc_z.bat	
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_newsoapclasses.ini
+
+PRJ_MMPFILES
+
+
+PRJ_TESTMMPFILES
+newsoapclasses.mmp
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group/newsoapclasses.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for newsoapclasses  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          NewSoapClassesBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+CAPABILITY              ALL -TCB
+VENDORID        VID_DEFAULT
+// VENDORID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE           NewSoapClassesBCTest.def
+
+SOURCEPATH              ../src
+SOURCE                  newsoapclasses.cpp
+SOURCE                  newsoapclassescases.cpp
+SOURCE         			testmsenmessage.cpp
+
+USERINCLUDE             ../inc
+
+SYSTEMINCLUDE           /epoc32/include/libc
+SYSTEMINCLUDE           /epoc32/include/oem
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 estlib.lib
+LIBRARY                 bafl.lib
+LIBRARY                 estor.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 hash.lib
+LIBRARY         				stiftestinterface.lib
+LIBRARY         				charconv.lib
+LIBRARY         				efsrv.lib
+LIBRARY                 SenFragment.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenMessages.lib
+LIBRARY                 XMLFRAMEWORK.lib
+
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    //LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    //LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LANG            SC
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/group/newsoapclasses.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices SoapClasses"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\NewSoapClassesBCTest.dll"-"!:\sys\bin\NewSoapClassesBCTest.dll"
+;"\Epoc32\winscw\c\testNSC_c.bat"-"!:\testNSC.bat"
+"..\init\NewSoapClassesBCTest.ini"-"!:\testframework\NewSoapClassesBCTest.ini"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/inc/newsoapclassesbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,530 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          NewSoapClasses test module.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef NEWSOAPCLASSES_H
+#define NEWSOAPCLASSES_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+#include <SenParser.h>
+#include <SenSoapEnvelope2.h>
+#include <SenSoapFault2.h>
+#include <SenSoapMessage2.h>
+#include <SenSoapConstants.h>
+//#include <SenSoapMessageDom2.h>
+#include <SenWsSecurityHeader2.h>
+#include <SenIdentityProvider.h>
+//#include <SenMessageContext.h>
+#include <SenXmlProperties.h>
+#include <e32debug.h>
+#include <e32std.h>
+#include <e32def.h>
+#include <SenXmlConstants.h>
+
+
+
+
+
+//  FORWARD DECLARATIONS
+class CSenSoapFault2;
+class CSenSoapEnvelope2;
+class CSenSoapMessage2;
+class CSenWsSecurityHeader2;
+
+
+
+// Logging path
+_LIT( KNewSoapClassesLogPath, "\\logs\\testframework\\NewSoapClassesBCTest\\" ); 
+// Log file
+_LIT( KNewSoapClassesLogFile, "NewSoapClassesBCTest.txt" ); 
+
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CNewSoapClassesBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CNewSoapClassesBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CNewSoapClassesBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a NewSoapClasses class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CNewSoapClassesBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CNewSoapClassesBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CNewSoapClassesBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       NewSoapClasses. It is called once for every instance of 
+        *       TestModuleNewSoapClasses after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of NewSoapClasses.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from NewSoapClasses. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CNewSoapClassesBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+        void SetupL();
+        void Teardown();
+
+
+        /**
+        * Actual Hardcoded test case functions are listed below.
+        */
+         TInt MT_CSenSoapEnvelope2_NewLL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewLCL(TTestResult& aResult);
+        
+         TInt MT_CSenSoapEnvelope2_NewL_1L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewLC_1L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewL_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_NewLC_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_TypeL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_DirectionL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_TxnIdL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_CloneL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_SoapVersionL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_SetContextL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_ContextL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_SetPropertiesL(TTestResult& aResult);
+
+         TInt MT_CSenSoapEnvelope2_PropertiesL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapEnvelope2_IsSafeToCastL(TTestResult& aResult); 
+
+
+         TInt MT_CSenSoapEnvelope2_SetBodyLL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenSoapEnvelope2_SetBodyL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_BodyLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_HeaderLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_AddHeaderLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_BodyAsStringLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_IsFaultL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_DetachFaultLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_FaultLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_SetSoapActionLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_SoapActionL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_HasHeaderL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_HasBodyL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenSoapEnvelope2_Parse1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_Parse2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapEnvelope2_Parse3L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_NewLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_NewL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_NewL_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultCodeL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultSubcodeL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultStringL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_FaultActorL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapFault2_DetailL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_NewLL(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLCL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_NewL_1L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_NewL_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_2L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_3L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_3L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_4L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_4L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_5L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_5L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewL_6L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_NewLC_6L(TTestResult& aResult);
+         
+         TInt MT_CSenSoapMessage2_TypeL(TTestResult& aResult);
+         
+		 TInt MT_CSenSoapMessage2_CloneL(TTestResult& aResult);
+		 
+		 TInt MT_CSenSoapMessage2_Parse1L(TTestResult& aResult);
+		 
+        
+        
+         TInt MT_CSenSoapMessage2_SetSecurityHeaderLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenSoapMessage2_AddSecurityTokenLL(TTestResult& aResult);
+         
+         
+         TInt MT_CSenWsSecurityHeader2_NewLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewLCL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewLC_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewL_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_NewLC_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_2L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_3L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_4L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_TimestampLL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_TimestampL_1L(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_XmlNsL(TTestResult& aResult);
+        
+        
+         TInt MT_CSenWsSecurityHeader2_XmlNsPrefixL(TTestResult& aResult);
+         
+		 TInt MT_CTestMSenMessage_Type(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_Direction(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_Context(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_SetContext(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_Properties(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_SetProperties(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_IsSafeToCast(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_TxnId(TTestResult& aResult);
+		 TInt MT_CTestMSenMessage_CloneL(TTestResult& aResult);
+     public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // NewSoapClasses_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/inc/testmsenmessage.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          test class implementation for MSenMessage.h.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+#ifndef TestMSenMessage_H
+#define TestMSenMessage_H
+
+// INCLUDES
+#include <e32base.h>
+#include <MSenMessage.h>
+
+
+
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class CTestMSenMessage: public MSenMessage, public CBase
+    {
+ 	public:
+	 	static CTestMSenMessage* NewL();
+	 	static CTestMSenMessage* NewLC();
+	  	virtual MSenMessage::TClass Type() ;
+	  	virtual MSenMessage::TDirection Direction() ;
+		virtual TInt SetContext(MSenMessageContext* apNotOwnedContext) ;
+	    virtual MSenMessageContext* Context() ;
+	    virtual TInt SetProperties(MSenProperties* apOwnedProperties) ;
+	    virtual MSenProperties* Properties() ;
+	    virtual TBool IsSafeToCast(TClass aType) ;
+	    virtual TInt TxnId() ; 
+	    virtual MSenMessage* CloneL() ;
+	private:
+		CTestMSenMessage();
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/init/NewSoapClassesBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= NewSoapClassesBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/rom/newsoapclasses.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef NEWSOAPCLASSES_IBY__
+#define NEWSOAPCLASSES_IBY__
+
+file=ABI_DIR\BUILD_DIR\NewSoapClassesBCTest.dll          PROGRAMS_DIR\NewSoapClassesBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/NewSoapClassesBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= NewSoapClassesBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/newsoapclasses.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices SoapClasses"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\NewSoapClassesBCTest.dll"-"!:\sys\bin\NewSoapClassesBCTest.dll"
+"\Epoc32\winscw\c\testNSC_c.bat"-"!:\testNSC.bat"
+"\Epoc32\winscw\c\testframework\testframework_newsoapclasses.ini"-"!:\testframework\testframework_newsoapclasses.ini"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= NewSoapClassesBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/testnsc_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\TestFramework_newsoapclasses.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule NewSoapClassesBCTest
+
+copy C:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_NewSoapClasses.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/sis/testnsc_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy z:\TestFramework\TestFramework_newsoapclasses.ini c:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule NewSoapClassesBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_NewSoapClasses.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/src/newsoapclasses.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,392 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          NewSoapClasses class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "newsoapclassesbctest.h"
+#include <sys/reent.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::CNewSoapClassesBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CNewSoapClassesBCTest::CNewSoapClassesBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KNewSoapClassesLogPath, 
+                          KNewSoapClassesLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "NewSoapClasses logging starts!" );
+    iLog->Log( KLogStart );
+    
+   // if ( iXmlReader ){
+    //    delete iXmlReader;
+    //}
+    //iXmlReader = CSenXmlReader::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNewSoapClassesBCTest* CNewSoapClassesBCTest::NewL()
+    {
+    CNewSoapClassesBCTest* self = new (ELeave) CNewSoapClassesBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CNewSoapClassesBCTest::~CNewSoapClassesBCTest()
+    {
+    if (iLog)  delete iLog;
+    //if ( iXmlReader)
+    	//{
+        //delete iXmlReader;
+      //  iXmlReader = NULL;
+    //  }
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CNewSoapClassesBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CNewSoapClassesBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CNewSoapClassesBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+		iLog->Log( _L("-------------------------------------------------------------"));
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+        CloseSTDLIB();
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CNewSoapClassesBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CNewSoapClassesBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CNewSoapClassesBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CNewSoapClassesBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason
+    {
+    return(KErrNone);
+
+    }
+#endif // EKA2
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/src/newsoapclassescases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3335 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// INCLUDE FILES
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include "newsoapclassesbctest.h"
+#include "testmsenmessage.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNewSoapClassesBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CNewSoapClassesBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    NewSoapClasses.cpp file and to NewSoapClasses.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        
+        ENTRY( "NewL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLL ),
+        ENTRY( "NewLC - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLCL ),
+        ENTRY( "NewL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_1L ),
+        ENTRY( "NewLC - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_1L ),
+        ENTRY( "NewL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_2L ),
+        ENTRY( "NewLC - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_2L ),
+        ENTRY( "Type - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TypeL ),
+        ENTRY( "Direction - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DirectionL ),
+        ENTRY( "TxnId - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TxnIdL ),
+        ENTRY( "Clone - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_CloneL ),
+        ENTRY( "SoapVersion - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapVersionL ),
+        ENTRY( "SetContext - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetContextL ),
+        ENTRY( "Context - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_ContextL ),
+        ENTRY( "SetProperties - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetPropertiesL ),
+        ENTRY( "SetBodyL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyLL ),
+        ENTRY( "Properties - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_PropertiesL ),
+        ENTRY( "IsSafeToCast - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsSafeToCastL ),
+        
+        ENTRY( "SetBodyL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyL_1L ),
+        ENTRY( "BodyL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyLL ),
+        ENTRY( "HeaderL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HeaderLL ),
+        ENTRY( "AddHeaderL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_AddHeaderLL ),
+        ENTRY( "BodyAsStringL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyAsStringLL ),
+        ENTRY( "IsFault - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsFaultL ),
+        ENTRY( "DetachFaultL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DetachFaultLL ),
+        ENTRY( "FaultL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_FaultLL ),
+        ENTRY( "SetSoapActionL - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetSoapActionLL ),
+        ENTRY( "SoapAction - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapActionL ),
+        ENTRY( "HasHeader - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasHeaderL ),
+        ENTRY( "HasBody - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasBodyL ),
+        ENTRY( "Parse1 - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse1L ),
+        ENTRY( "Parse2 - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse2L ),
+        ENTRY( "Parse2 - CSenSoapEnvelope2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse3L ),
+        ENTRY( "NewL - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_NewLL ),
+        ENTRY( "NewL - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_1L ),
+        ENTRY( "NewL - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_2L ),
+        ENTRY( "FaultCode - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultCodeL ),
+        ENTRY( "FaultSubcode - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultSubcodeL ),
+        ENTRY( "FaultString - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultStringL ),
+        ENTRY( "FaultActor - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultActorL ),
+        ENTRY( "Detail - CSenSoapFault2", CNewSoapClassesBCTest::MT_CSenSoapFault2_DetailL ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLL ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLCL ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_1L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_1L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_2L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_2L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_3L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_3L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_4L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_4L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_5L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_5L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_6L ),
+        ENTRY( "NewLC - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_6L ),
+        ENTRY( "NewL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLL ),
+        ENTRY( "Type - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_TypeL ),
+        ENTRY( "Clone - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_CloneL ),
+		ENTRY( "Parse - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_Parse1L ),        
+        ENTRY( "SetSecurityHeaderL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_SetSecurityHeaderLL ),
+        ENTRY( "AddSecurityTokenL - CSenSoapMessage2", CNewSoapClassesBCTest::MT_CSenSoapMessage2_AddSecurityTokenLL ),
+        ENTRY( "NewL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLL ),
+        ENTRY( "NewLC - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLCL ),
+        ENTRY( "NewL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_1L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_1L ),
+        ENTRY( "NewL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_2L ),
+        ENTRY( "NewLC - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_2L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenLL ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_1L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_2L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_3L ),
+        ENTRY( "UsernameTokenL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_4L ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampLL ),
+        ENTRY( "TimestampL - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampL_1L ),
+        ENTRY( "XmlNs - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsL ),
+        ENTRY( "XmlNsPrefix - CSenWsSecurityHeader2", CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsPrefixL ),
+        ENTRY( "Type - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Type),
+        ENTRY( "Direction - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Direction),
+        ENTRY( "Context - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Context),
+        ENTRY( "SetContext - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_SetContext),
+        ENTRY( "Properties - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_Properties),
+        ENTRY( "SetProperties - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_SetProperties),
+        ENTRY( "IsSafeToCast - MSenMessage", CNewSoapClassesBCTest:: MT_CTestMSenMessage_IsSafeToCast),
+        ENTRY( "TxnId - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_TxnId),
+        ENTRY( "CloneL - MSenMessage", CNewSoapClassesBCTest::MT_CTestMSenMessage_CloneL),
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CNewSoapClassesBCTest::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CNewSoapClassesBCTest::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = NULL;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CNewSoapClassesBCTest::SetupL(  ){
+
+	} 
+
+void CNewSoapClassesBCTest::Teardown(  ){
+
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+    }
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLCL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewLC();
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    //CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;    
+    }    
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL(*mContext);
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);    
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_1L( TTestResult& aResult )
+	{
+	 SetupL();
+	 _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	 MSenMessageContext* mContext = NULL;
+	 CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewLC(*mContext);
+	 HBufC8* pAsXml = pEnvelope->AsXmlL();
+	 CleanupStack::PushL(pAsXml);
+     if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+     CleanupStack::PopAndDestroy(pAsXml);
+     CleanupStack::PopAndDestroy(pEnvelope);
+     //CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewL(*pEnvelope1);
+    CleanupStack::PushL(pEnvelope);
+
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_NewLC_2L( TTestResult& aResult )
+    {
+	SetupL();
+   _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewLC(*pEnvelope1);
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pEnvelope);
+    //CleanupStack::PopAndDestroy();
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TypeL( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessage::TClass var = MSenMessage::ESoapEnvelope2;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->Type());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DirectionL( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessage::TDirection var = MSenMessage::EOutbound;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->Direction());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_TxnIdL( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewL(*pEnvelope1);
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TInt var = pEnvelope->TxnId();
+    TBool Flag;
+    
+    if(var >= 0)
+    if(!(Flag)) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope);
+    pEnvelope = NULL;
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_CloneL( TTestResult& aResult )
+	{
+	SetupL();
+	TBool Flag;
+	CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+	CleanupStack::PushL(pEnvelope);
+	CSenSoapEnvelope2* pClone = NULL;
+    pClone = (CSenSoapEnvelope2*)pEnvelope->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pEnvelope);
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapVersionL( TTestResult& aResult )
+	{
+	SetupL();
+	TSOAPVersion var = ESOAP11;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->SoapVersion());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetContextL( TTestResult& aResult )
+	{
+	SetupL();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    MSenMessageContext* mContext = NULL;
+   
+	CSenXmlProperties* prop = CSenXmlProperties::NewL();
+//	CSenMessageContext* mContext1 = CSenMessageContext::NewL(SenContext::EOutgoing, prop);
+    TL(KErrArgument == pEnvelope->SetContext(mContext));
+  //  TL(KErrNone == pEnvelope->SetContext(mContext1));
+    TL(mContext == pEnvelope->Context());
+    CleanupStack::PopAndDestroy(pEnvelope);
+//    delete mContext1;
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_ContextL( TTestResult& aResult )
+	{
+	SetupL();
+	TTestResult Result;	
+	CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetContextL(Result);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetPropertiesL( TTestResult& aResult )
+	{
+	SetupL();
+    CSenXmlProperties* prop = CSenXmlProperties::NewL();
+    CleanupStack::PushL(prop);
+    
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::Pop();
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    TL(KErrNone == pEnvelope->SetProperties(prop));
+    CleanupStack::PopAndDestroy();
+    
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_PropertiesL( TTestResult& aResult )
+	{
+	SetupL();
+    CSenXmlProperties* prop = CSenXmlProperties::NewL();
+    CleanupStack::PushL(prop);
+    
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::Pop();
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    TL(KErrNone == pEnvelope->SetProperties(prop));
+    TL(prop == pEnvelope->Properties());
+    CleanupStack::PopAndDestroy();
+    
+    
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsSafeToCastL( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessage::TClass var = MSenMessage::ESoapEnvelope2;
+	TBool retVal = ETrue;
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    retVal == pEnvelope->IsSafeToCast(var);
+
+
+    if(retVal == EFalse)
+    	return KErrArgument;
+    
+    CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyContentString, "<Test>Content</Test>");
+
+    _LIT8(KEnvelopeString, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><Test>Content</Test></S:Body>\
+</S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    pEnvelope->SetBodyL(KBodyContentString);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetBodyL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,   "BodyElement");
+    _LIT8(KBodyContent,       "BodyContent");
+    _LIT8(KBodyElementName2,  "BodyElement2");
+    _LIT8(KBodyContent2,      "BodyContent2");
+
+    _LIT8(KEnvelopeString, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><BodyElement>BodyContent</BodyElement></S:Body>\
+</S:Envelope>");
+
+    _LIT8(KEnvelopeString2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><BodyElement2>BodyContent2</BodyElement2></S:Body>\
+</S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyContent());
+    pEnvelope->SetBodyL(bodyElement);
+
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelopeString )) KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TXmlEngElement bodyElement2 = document.CreateDocumentElementL(KBodyElementName2());
+    bodyElement2.AddTextL(KBodyContent2());
+    pEnvelope->SetBodyL(bodyElement2);
+
+    pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelopeString2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyContentString, "Test");
+    _LIT8(KBodyString, "<S:Body>Test</S:Body>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    pEnvelope->SetBodyL(KBodyContentString);
+
+    TXmlEngElement element = pEnvelope->BodyL();
+    RSenDocument document = pEnvelope->AsDocumentL();
+
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, element, options);
+
+    // Serialized body should contain only body as XML.
+    if(!( asXml == KBodyString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HeaderLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KHeaderString, "<S:Header/>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement element = pEnvelope->HeaderL();
+
+    RSenDocument document = pEnvelope->AsDocumentL();
+
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, element, options);
+
+    // Serialized header should contain only header as XML.
+    if(!( asXml == KHeaderString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_AddHeaderLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+    _LIT8(KHeaderElementName2,  "HeaderElement2");
+    _LIT8(KHeaderContent2,      "HeaderContent2");
+
+    _LIT8(KEnvelope,            "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+</S:Header>\
+<S:Body/></S:Envelope>");
+
+    _LIT8(KEnvelope2,            "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+<HeaderElement2>HeaderContent2</HeaderElement2>\
+</S:Header>\
+<S:Body/></S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement headerElement = document.CreateDocumentElementL(KHeaderElementName());
+    headerElement.AddTextL(KHeaderContent());
+    pEnvelope->AddHeaderL(headerElement);
+
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelope )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TXmlEngElement headerElement2 = document.CreateDocumentElementL(KHeaderElementName2());
+    headerElement2.AddTextL(KHeaderContent2());
+    pEnvelope->AddHeaderL(headerElement2);
+
+    pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelope2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_BodyAsStringLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    _LIT8(KBodyElementContent, "BodyElementContent");
+    _LIT8(KBodyContent,        "BodyContent");
+
+    _LIT8(KBodyAsString1, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">BodyContent</S:Body>");
+    _LIT8(KBodyAsString2, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<BodyElement>BodyElementContent</BodyElement>\
+</S:Body>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyElementContent());
+
+    pEnvelope->SetBodyL(KBodyContent);
+
+    // If Body element does not contain any elements
+    // whole Body element is returned (and detached
+    // => needed namespace declarations are moved into
+    //    Body)
+    HBufC8* pAsXml = pEnvelope->BodyAsStringL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KBodyAsString1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    pEnvelope->SetBodyL(bodyElement);
+
+    // If Body element contains element(s)
+    // only first element (and all its child elements)
+    // from Body element is returned and detached
+    // (not Body element).
+    pAsXml = pEnvelope->BodyAsStringL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KBodyAsString2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_IsFaultL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultInputString,  "<SOAP:Envelope \
+xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<SOAP:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+</SOAP:Header>\
+<SOAP:Body><SOAP:Fault>FaultContent</SOAP:Fault></SOAP:Body>\
+</SOAP:Envelope>");
+
+    // 1. Test that IsFault return EFalse by default
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    //if(!( pEnvelope->IsFault() == EFalse )) return KErrArgument;
+    TL( pEnvelope->IsFault() == EFalse )
+
+    // 2. Test that IsFault returns ETrue when fault is added
+    //    using SetBodyL method
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName(),
+                                                            pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+    pEnvelope->SetBodyL(faultElement);
+
+    if(!( pEnvelope->IsFault())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+
+    // 3. Test that IsFault returns ETrue if fault is added
+    //    when Envelope is parsed
+
+    CSenParser* pParser = CSenParser::NewLC();
+    pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KFaultInputString, *pEnvelope);
+	if(!( pEnvelope->IsFault())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_DetachFaultLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultElement,       "<S:Fault xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">FaultContent</S:Fault>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement body = pEnvelope->BodyL();
+    TXmlEngElement faultElement = body.AddNewElementWithNsL(KFaultElementName(),
+                                                      pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+
+    CSenSoapFault2* pFault = pEnvelope->DetachFaultL();
+    CleanupStack::PushL(pFault);
+
+    HBufC8* pAsXml = pFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFault);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_FaultLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultElement,       "<S:Fault>FaultContent</S:Fault>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement body = pEnvelope->BodyL();
+    TXmlEngElement faultElement = body.AddNewElementWithNsL(KFaultElementName(),
+                                                            pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+
+    CSenSoapFault2* pFault = pEnvelope->FaultL();
+    CleanupStack::PushL(pFault);
+
+    HBufC8* pAsXml = pFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFault);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SetSoapActionLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapActionValue,         "SoapActionValue");
+    _LIT8(KSoapActionValueInQuotes, "\"SoapActionValue\"");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TPtrC8 retVal = pEnvelope->SetSoapActionL(KSoapActionValue);
+    if(!( retVal == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction = pEnvelope->SoapAction();
+    if(!( soapAction == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 retVal2 = pEnvelope->SetSoapActionL(KSoapActionValueInQuotes);
+    if(!( retVal2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction2 = pEnvelope->SoapAction();
+    if(!( soapAction2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_SoapActionL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapActionValue,         "SoapActionValue");
+    _LIT8(KSoapActionValueInQuotes, "\"SoapActionValue\"");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TPtrC8 retVal = pEnvelope->SetSoapActionL(KSoapActionValue);
+    if(!( retVal == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction = pEnvelope->SoapAction();
+    if(!( soapAction == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 retVal2 = pEnvelope->SetSoapActionL(KSoapActionValueInQuotes) ;
+    if(!( retVal2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction2 = pEnvelope->SoapAction();
+    if(!( soapAction2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasHeaderL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    if(!( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement headerElement = document.CreateDocumentElementL(KHeaderElementName());
+    headerElement.AddTextL(KHeaderContent());
+    pEnvelope->AddHeaderL(headerElement);
+
+    if(!( pEnvelope->HasHeader())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_HasBodyL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    _LIT8(KBodyElementContent, "BodyElementContent");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    if(!( pEnvelope->HasBody() == EFalse )) return KErrArgument;
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyElementContent());
+
+    pEnvelope->SetBodyL(bodyElement);
+
+    if(!( pEnvelope->HasBody())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KInputString, *pEnvelope);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pEnvelope->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be detached from SoapEnvelope
+	//    correctly.
+	// Note: Following "BodyAsStringL()" call will detach
+	//       Body from SoapEnvelope
+	HBufC8* pBodyAsString = pEnvelope->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KBodyAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 3) Check that body can be detached from SoapEnvelope
+	//    twice
+	//    In this case body does not have child elements.
+	//    => Empty body should be returned.
+	//       Note: Empty body should contain namespace
+	//             declaration because body is detached
+	pBodyAsString = pEnvelope->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KEmptyBodyWithNsAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 4) Check that body was detached from SoapEnvelope
+	//    correctly
+	//    => Getting body again should result empty body to be returned.
+	TXmlEngElement bodyElement = pEnvelope->BodyL();
+	RSenDocument document = pEnvelope->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be empty because "BodyAsStringL()"
+    // previously detached body.
+    if(!( asXml == KEmptyBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,         "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+
+    _LIT8(KWholeBodyAsString,   "<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KWholeHeaderAsString, "<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KInputString, *pEnvelope);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pEnvelope->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be got from SoapEnvelope
+	//    correctly
+	// Note: Body won't be detached. Only reference for
+	//       body TXmlEngElement inside SoapEnvelope is returned.
+	TXmlEngElement bodyElement = pEnvelope->BodyL();
+	RSenDocument document = pEnvelope->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be in exactly the same form
+    // as in original SoapEnvelope
+    if(!( asXml == KWholeBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    // 3) Check that header TXmlEngElement can be got from SoapEnvelope
+	//    correctly
+    TXmlEngElement headerElement = pEnvelope->HeaderL();
+
+    RBuf8 headerAsXml;
+    CleanupClosePushL(headerAsXml);
+    document.SaveL(headerAsXml, headerElement, options);
+
+    // Serielized header should be in exactly the same form
+    // as in original SoapEnvelope
+    if(!( headerAsXml == KWholeHeaderAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&headerAsXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_Parse3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,         "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+<wsa:MessageID>urn:uuid:7837d733-b9f8-3eb1-5c3f-7a509797e6b2</wsa:MessageID>\
+<wsa:To>http://schemas.live.com/mws/2005/08/spaces</wsa:To>\
+<wsa:Action>http://schemas.live.com/mws/2005/08/spaces/Post</wsa:Action>\
+<wsa:ReplyTo><wsa:Address>id:7bbd5c5b-7857-44c4-b609-53498d0cab3b</wsa:Address></wsa:ReplyTo>\
+</S:Header>\
+<S:Body>\
+<PostRequest xmlns=\"http://schemas.live.com/mws/2005/08/spaces\">\
+<Item><Filename>sample1.wav</Filename><ItemType>8</ItemType><Image><Data></Data></Image></Item>\
+</PostRequest>\
+</S:Body>\
+</S:Envelope>");
+
+    _LIT8(KOuterXml,            "<S:Body>\
+<PostRequest xmlns=\"http://schemas.live.com/mws/2005/08/spaces\">\
+<Item><Filename>sample1.wav</Filename><ItemType>8</ItemType><Image><Data/></Image></Item>\
+</PostRequest>\
+</S:Body>");
+
+    CSenParser* pParser = CSenParser::NewL();
+    CleanupStack::PushL(pParser);
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    pParser->ParseL(KInputString, *pEnvelope);
+    TXmlEngElement element = pEnvelope->BodyL();
+
+    RBuf8 outerXml;
+    CleanupClosePushL(outerXml);
+    element.OuterXmlL(outerXml);
+
+    if(!( outerXml == KOuterXml )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&outerXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,    "Fault");
+    _LIT8(KFaultElementContent, "FaultContent");
+    _LIT8(KFaultElement,        "<Fault>FaultContent</Fault>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName());
+    faultElement.AddTextL(KFaultElementContent());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,    "Fault");
+    _LIT8(KFaultElementContent, "FaultContent");
+    _LIT8(KFaultElement,        "<Fault>FaultContent</Fault>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName());
+    faultElement.AddTextL(KFaultElementContent());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KParentName,          "Parent");
+
+    _LIT8(KAttributeNsUri,      "nsuri");
+    _LIT8(KAttributeNsPrefix,   "pr");
+    _LIT8(KAttributeLocalName,  "AttrName");
+    _LIT8(KAttributeValue,      "Value");
+
+    _LIT8(KFaultNsUri,          "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KFaultNsPrefix,       "S");
+    _LIT8(KFaultLocalName,      "Fault");
+
+    _LIT8(KFaultElement,        "<S:Fault \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" \
+xmlns:pr=\"nsuri\" pr:AttrName=\"Value\"/>");
+
+    _LIT8(KParentDocument,      "<Parent><S:Fault \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" \
+xmlns:pr=\"nsuri\" pr:AttrName=\"Value\"/>\
+</Parent>");
+
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(KParentName());
+
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+    RString nsUriRString        = stringPool.OpenStringL(KAttributeNsUri);
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(KAttributeNsPrefix);
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(KAttributeLocalName);
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(KAttributeValue);
+    CleanupClosePushL(valueRString);
+
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString,
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(KFaultNsUri,
+                                                      KFaultLocalName,
+                                                      KFaultNsPrefix,
+                                                      attrArray,
+                                                      parentElement,
+                                                      document);
+    CleanupStack::PushL(pSoapFault);
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    parentElement.OuterXmlL(buffer);
+
+    if(!( buffer == KParentDocument )) return KErrArgument;
+    CleanupStack::PopAndDestroy(&buffer);
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapFault);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(&document);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultCodeL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	//	Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultCodeLocalname());
+    faultCodeElement.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultCode();
+    if(!( faultCode == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2 = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultValueElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultCode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultSubcodeL( TTestResult& aResult )
+    {
+	SetupL();
+    // FaultSubcodeL is supported only in Soap 1.2
+    // If other version of Soap is used return value will always be KNullDesC
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+//    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12SubcodeLocalname,	"Subcode"); // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	// Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+    // 1) Fault subcode in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 there is _NO_ sobcode
+    //          => KNullDesC8 should be returned.
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement    = faultElement.AddNewElementL(KFault12CodeLocalname());
+    TXmlEngElement faultSubCodeElement = faultCodeElement.AddNewElementSameNsL(KFault12SubcodeLocalname());
+    TXmlEngElement faultValueElement   = faultSubCodeElement.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultSubcode();
+    if(!( faultCode == KNullDesC8 )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+ 	CleanupStack::PopAndDestroy(1); // document
+
+    // 2) Fault subcode in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2    = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultSubCodeElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12SubcodeLocalname());
+    TXmlEngElement faultValueElement2   = faultSubCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultSubcode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultStringL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultStringLocalname,    "faultstring");
+
+    _LIT8(KFault12ReasonLocalname,	"Reason");  // Soap1.2
+    _LIT8(KFault12TextLocalname,	"Text");    // Soap1.2
+
+
+    _LIT8(KFaultStringValue,        "Fault code string");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultStringElement = faultElement.AddNewElementL(KFaultStringLocalname());
+    faultStringElement.AddTextL(KFaultStringValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultString();
+    if(!( faultCode == KFaultStringValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultReasonElement2 = faultElement2.AddNewElementSameNsL(KFault12ReasonLocalname());
+    TXmlEngElement faultTextElement2 = faultReasonElement2.AddNewElementSameNsL(KFault12TextLocalname());
+    faultTextElement2.AddTextL(KFaultStringValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultString();
+    if(!( faultCode2 == KFaultStringValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_FaultActorL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultActorLocalname,     "faultactor");
+
+    _LIT8(KFault12NodeLocalname,	"Node");    // Node represents faultactor in Soap 1.2
+
+    _LIT8(KFaultActorValue,          "http://www.wrox.com/heroes/endpoint.asp");
+
+
+    // 1) Faultactor in Soap other than 1.2
+    //    "faultactor" is intended to provide information about which SOAP node
+    //    on the SOAP message path caused the fault to happen.
+    //    The value of the "faultactor" is a URI identifying the source of the fault.
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultActorLocalname());
+    faultCodeElement.AddTextL(KFaultActorValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultActor = pSoapFault->FaultActor();
+    if(!( faultActor == KFaultActorValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+    // 2) Faultactor in Soap 1.2
+    //    "Node" is intended to provide information about which SOAP node on the
+    //    SOAP message path caused the fault to happen.
+    //    "Node" contains the URI of the SOAP node that generated the fault.
+    //
+    //    Note: In Soap 1.2 "Node" represents "faultactor" from previous SOAP versions.
+
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultNodeElement2 = faultElement2.AddNewElementSameNsL(KFault12NodeLocalname());
+    faultNodeElement2.AddTextL(KFaultActorValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    HBufC8* pAsXml = pSoapFault2->AsXmlL();
+    delete pAsXml;
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultActor();
+    if(!( faultCode2 == KFaultActorValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapFault2_DetailL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KDetailLocalname,         "detail");
+
+    _LIT8(KFault12DetailLocalname,	"Detail");    // Soap 1.2
+
+    _LIT8(KFaultDetailValue,          "Detailed information");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultDetailElement = faultElement.AddNewElementL(KDetailLocalname());
+    faultDetailElement.AddTextL(KFaultDetailValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultDetail = pSoapFault->Detail();
+    if(!( faultDetail == KFaultDetailValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+	CleanupStack::PopAndDestroy(1); // document
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultDetailElement2 = faultElement2.AddNewElementSameNsL(KFault12DetailLocalname());
+    faultDetailElement2.AddTextL(KFaultDetailValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultDetail2 = pSoapFault2->Detail();
+    if(!( faultDetail2 == KFaultDetailValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    CleanupStack::PopAndDestroy(1); // document2
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLCL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC();
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KIllegalNamespace);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KIllegalNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapMessage2* pSoapMessage, *pSoapMessage1 = CSenSoapMessage2::NewL();
+    pSoapMessage = CSenSoapMessage2::NewL(*pSoapMessage1);
+    
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSoapMessage);
+    pSoapMessage = NULL;
+    delete pSoapMessage1;
+    pSoapMessage1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapMessage2* pSoapMessage, *pSoapMessage1 = CSenSoapMessage2::NewL();
+    pSoapMessage = CSenSoapMessage2::NewLC(*pSoapMessage1);
+    
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    delete pSoapMessage1;
+    pSoapMessage1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_4L( TTestResult& aResult )
+	{
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext);
+    CleanupStack::PushL(pSoapMessage);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_4L( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_5L( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+	
+    MSenMessageContext* mContext = NULL;
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP12 );
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_5L( TTestResult& aResult )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    MSenMessageContext* mContext = NULL;
+
+  
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext, ESOAP11);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext, ESOAP12);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewL_6L( TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessageContext* mContext = NULL;
+
+    
+	_LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP11, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP11, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP11, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_NewLC_6L(TTestResult& aResult )
+	{
+	SetupL();
+	MSenMessageContext* mContext = NULL;
+    
+	 _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KIllegalNamespace);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KIllegalNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    Teardown();
+    return KErrNone;    
+	}
+	
+ 
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_TypeL( TTestResult& aResult )
+	{
+	SetupL();
+	CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+    
+    TL(MSenMessage::ESoapMessage2 == pSoapMessage->Type());
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_CloneL( TTestResult& aResult )
+	{
+	SetupL();
+	TBool Flag;
+	CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+
+	CSenSoapMessage2* pClone = NULL;
+    pClone = 	(CSenSoapMessage2*)pSoapMessage->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+    delete pClone;
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_Parse1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pMessage);
+
+	pParser->ParseL(KInputString, *pMessage);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pMessage->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be detached from SoapEnvelope
+	//    correctly.
+	// Note: Following "BodyAsStringL()" call will detach
+	//       Body from SoapEnvelope
+	HBufC8* pBodyAsString = pMessage->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KBodyAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 3) Check that body can be detached from SoapEnvelope
+	//    twice
+	//    In this case body does not have child elements.
+	//    => Empty body should be returned.
+	//       Note: Empty body should contain namespace
+	//             declaration because body is detached
+	pBodyAsString = pMessage->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KEmptyBodyWithNsAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 4) Check that body was detached from SoapEnvelope
+	//    correctly
+	//    => Getting body again should result empty body to be returned.
+	TXmlEngElement bodyElement = pMessage->BodyL();
+	RSenDocument document = pMessage->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be empty because "BodyAsStringL()"
+    // previously detached body.
+    if(!( asXml == KEmptyBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pMessage);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_SetSecurityHeaderLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11_1, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<Credential/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage11_2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_1, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<Credential/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_2, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KCredential,      "<Credential/>");
+
+    // 1) Soap 1.1 - Test setting of SecurityHeader WITH Credential
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KCredential);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Soap 1.1 - Test setting of SecurityHeader WITHOUT Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KNullDesC8);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 3) Soap 1.2 - Test setting of SecurityHeader WITH Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KCredential);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 4) Soap 1.2 - Test setting of SecurityHeader WITH Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KNullDesC8);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_AddSecurityTokenLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11_1, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage11_2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+<SecurityToken2/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_1, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_2, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+<SecurityToken2/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSecurityToken,   "<SecurityToken/>");
+    _LIT8(KSecurityToken2,   "<SecurityToken2/>");
+
+    // 1) Soap 1.1 - Test adding of SecurityToken
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Soap 1.1 - Test adding of two SecurityTokens
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+    pSoapMessage->AddSecurityTokenL(KSecurityToken2);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 3) Soap 1.2 - Test adding of SecurityToken
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 4) Soap 1.2 - Test adding of two SecurityTokens
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+    pSoapMessage->AddSecurityTokenL(KSecurityToken2);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+
+    _LIT8(KRootElementName, "RootElement");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLCL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+
+    _LIT8(KRootElementName, "RootElement");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(KSecurityToken,
+                                                                      document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(KSecurityToken,
+                                                                       document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+    _LIT8(KNamespace,       "namespace");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(KSecurityToken,
+                                                                      KNamespace,
+                                                                      document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_NewLC_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+    _LIT8(KNamespace,       "namespace");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(KSecurityToken,
+                                                                       KNamespace,
+                                                                       document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KUserName,        "UserName");
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+
+    _LIT8(KFakeEndPoint,        "http://www.fake_endpoint.com/");
+    _LIT8(KUsername,            "Username");
+    _LIT8(KPassword,            "Password");
+
+    _LIT8(KUserNameToken,       "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    _LIT8(KUserNameTokenDigest, "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+<wsse:Password Type=\"wsse:PasswordDigest\">Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KFakeEndPoint());
+    pIdP->SetUserInfoL(KUsername, KNullDesC8, KPassword);
+
+    // 1) Test using CSenWsSecurityHeader2::EText
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP, CSenWsSecurityHeader2::EText);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    // 2) Test using CSenWsSecurityHeader2::EDigest
+    pWsSecHeader = CSenWsSecurityHeader2::NewLC(document, rootElement);
+
+    pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP, CSenWsSecurityHeader2::EDigest);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameTokenDigest )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(pIdP);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_2L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KUserName,        "UserName");
+    _LIT8(KPassword,        "Password");
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_3L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+    _LIT8(KUserName,            "UserName");
+    _LIT8(KPassword,            "Password");
+    _LIT8(KUserNameToken,       "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    _LIT8(KUserNameTokenDigest, "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password Type=\"wsse:PasswordDigest\">Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    // 1) Test using CSenWsSecurityHeader2::EText
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, CSenWsSecurityHeader2::EText,
+                                 pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    // 2) Test using CSenWsSecurityHeader2::EDigest
+    pWsSecHeader = CSenWsSecurityHeader2::NewLC(document, rootElement);
+
+    pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, CSenWsSecurityHeader2::EDigest,
+                                 pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameTokenDigest )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_UsernameTokenL_4L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+
+    _LIT8(KFakeEndPoint,    "http://www.fake_endpoint.com/");
+    _LIT8(KUsername,        "Username");
+    _LIT8(KPassword,        "Password");
+
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KFakeEndPoint());
+    pIdP->SetUserInfoL(KUsername, KNullDesC8, KPassword);
+
+    HBufC8* pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pIdP);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampLL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KCreated,         "2001-09-13T08:42:00Z");
+    _LIT8(KExpires,         "2002-09-13T08:42:00Z");
+    _LIT8(KTimeStamp,       "\
+<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\
+<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>\
+<wsu:Expires>2002-09-13T08:42:00Z</wsu:Expires>\
+</wsu:Timestamp>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    HBufC8* pTimeStamp;
+    pWsSecHeader->TimestampL(KCreated, KExpires, pTimeStamp);
+    CleanupStack::PushL(pTimeStamp);
+    if(!( *pTimeStamp == KTimeStamp )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pTimeStamp);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_TimestampL_1L( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KCreated,         "2001-09-13T08:42:00Z");
+    _LIT8(KTimeStamp,       "\
+<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\
+<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>\
+</wsu:Timestamp>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    HBufC8* pTimeStamp;
+    pWsSecHeader->TimestampL(KCreated, pTimeStamp);
+    CleanupStack::PushL(pTimeStamp);
+    if(!( *pTimeStamp == KTimeStamp )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pTimeStamp);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+    _LIT8(KSecurityNamespace,   "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TPtrC8 nameSpace = pWsSecHeader->XmlNs();
+    if(!( nameSpace == KSecurityNamespace )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CSenWsSecurityHeader2_XmlNsPrefixL( TTestResult& aResult )
+    {
+	SetupL();
+    _LIT8(KRootElementName,         "RootElement");
+    _LIT8(KSecurityNamespacePrefix, "wsse");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TPtrC8 prefix = pWsSecHeader->XmlNsPrefix();
+    if(!( prefix == KSecurityNamespacePrefix )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Type( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Type());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Direction( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Direction());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+	
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Context( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Context());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_SetContext( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	MSenMessageContext* apNotOwnedContext =NULL;
+	TRAPD(res,pTest->SetContext(apNotOwnedContext));
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_Properties( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->Properties());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_SetProperties( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	MSenProperties* apOwnedProperties = NULL;
+	TRAPD(res,pTest->SetProperties(apOwnedProperties ));
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_IsSafeToCast( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->IsSafeToCast(MSenMessage::ESoapEnvelope2));
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_TxnId( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->TxnId());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+TInt CNewSoapClassesBCTest::MT_CTestMSenMessage_CloneL( TTestResult& aResult )
+	{
+	CTestMSenMessage* pTest = CTestMSenMessage::NewLC();
+	TRAPD(res,pTest->CloneL());
+	CleanupStack::PopAndDestroy(pTest);
+	return res;    
+	}
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclasses/src/testmsenmessage.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:          test class implementation for MSenMessage.h.
+*
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include "testmsenmessage.h"
+#include <e32base.h>
+
+ 	CTestMSenMessage* CTestMSenMessage::NewL()
+ 	{
+ 		CTestMSenMessage* pTestMSenMessage = new (ELeave) CTestMSenMessage();
+ 		return pTestMSenMessage;
+ 	}
+ 	CTestMSenMessage* CTestMSenMessage::NewLC()
+ 	{
+ 		CTestMSenMessage* pTestMSenMessage = new (ELeave) CTestMSenMessage();
+ 		CleanupStack::PushL(pTestMSenMessage);
+ 		return pTestMSenMessage;
+ 	}
+ 	CTestMSenMessage::CTestMSenMessage()
+ 	{
+ 		
+ 	}
+  	MSenMessage::TClass CTestMSenMessage::Type() 
+  	{
+  		EMessageBase;
+  	}
+  	MSenMessage::TDirection CTestMSenMessage::Direction() 
+  	{
+  		EOutbound;
+  	}
+	TInt CTestMSenMessage::SetContext(MSenMessageContext* apNotOwnedContext) 
+	{
+		return KErrNone;
+	}
+    MSenMessageContext* CTestMSenMessage::Context() 
+    {
+    	return NULL;
+    }
+    TInt CTestMSenMessage::SetProperties(MSenProperties* apOwnedProperties)
+    {
+    	return KErrNone;
+    }
+    MSenProperties* CTestMSenMessage::Properties() 
+    {
+    	return NULL;
+    }
+    TBool CTestMSenMessage::IsSafeToCast(TClass aType)
+    {
+    	return ETrue;
+    }
+    TInt CTestMSenMessage::TxnId() 
+    {
+    	return KErrNone;
+    } 
+    MSenMessage* CTestMSenMessage::CloneL() 
+    {
+    	return NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/Bmarm/newsoapclassesTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/Bwins/newsoapclassesTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/conf/newsoapclassesTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,455 @@
+[Test]
+title NewL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj NewLC-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj NewLC-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Type-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Type-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Direction-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Direction-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title TxnId-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj TxnId-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Clone-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Clone-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SoapVersion-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj SoapVersion-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetProperties-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj SetProperties-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetBodyL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj SetBodyL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Properties-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Properties-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsSafeToCast-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj IsSafeToCast-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetBodyL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj SetBodyL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title BodyL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj BodyL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title HeaderL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj HeaderL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddHeaderL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj AddHeaderL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title BodyAsStringL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj BodyAsStringL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title IsFault-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj IsFault-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title DetachFaultL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj DetachFaultL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj FaultL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetSoapActionL-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj SetSoapActionL-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SoapAction-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj SoapAction-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasHeader-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj HasHeader-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasBody-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj HasBody-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Parse1-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Parse1-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Parse2-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Parse2-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Parse2-CSenSoapEnvelope2
+create newsoapclassesTester obj 
+obj Parse2-CSenSoapEnvelope2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapFault2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapFault2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapFault2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultCode-CSenSoapFault2
+create newsoapclassesTester obj 
+obj FaultCode-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultSubcode-CSenSoapFault2
+create newsoapclassesTester obj 
+obj FaultSubcode-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultString-CSenSoapFault2
+create newsoapclassesTester obj 
+obj FaultString-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title FaultActor-CSenSoapFault2
+create newsoapclassesTester obj 
+obj FaultActor-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Detail-CSenSoapFault2
+create newsoapclassesTester obj 
+obj Detail-CSenSoapFault2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewLC-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewLC-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewLC-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewLC-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj NewL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Type-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj Type-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Clone-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj Clone-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title Parse-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj Parse-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetSecurityHeaderL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj SetSecurityHeaderL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddSecurityTokenL-CSenSoapMessage2
+create newsoapclassesTester obj 
+obj AddSecurityTokenL-CSenSoapMessage2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj NewL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj NewLC-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj NewL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj NewLC-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj NewL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj NewLC-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj UsernameTokenL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj UsernameTokenL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj UsernameTokenL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj UsernameTokenL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title UsernameTokenL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj UsernameTokenL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title TimestampL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj TimestampL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title TimestampL-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj TimestampL-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlNs-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj XmlNs-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
+[Test]
+title XmlNsPrefix-CSenWsSecurityHeader2
+create newsoapclassesTester obj 
+obj XmlNsPrefix-CSenWsSecurityHeader2 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/eabi/newsoapclassesTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for newsoapclassestester
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+newsoapclassesTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for newsoapclasses 
+*
+*/
+
+
+
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          newsoapclassesTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         newsoapclassesTester.def
+
+SYSTEMINCLUDE           /epoc32/include
+SYSTEMINCLUDE           /epoc32/include/xml
+SYSTEMINCLUDE           /epoc32/include/libc
+APP_LAYER_SYSTEMINCLUDE  //SYSTEMINCLUDE
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+LIBRARY                 bafl.lib
+LIBRARY                 estor.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 hash.lib
+LIBRARY         		stiftestinterface.lib
+LIBRARY         		charconv.lib
+LIBRARY         		efsrv.lib
+LIBRARY                 SenFragment.lib
+LIBRARY                 SenUtils.lib
+LIBRARY                 SenXml.lib
+LIBRARY                 SenServDesc.lib
+LIBRARY                 SenMessages.lib
+LIBRARY         				SenFramework.lib 
+
+LIBRARY                 XMLFRAMEWORK.lib
+
+SOURCE          newsoapclassesTester.cpp
+SOURCE          newsoapclassesTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+// LibXml2 libraries
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\newsoapclassesTester.dll"   -   "c:\Sys\Bin\newsoapclassesTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\newsoapclassesTester.cfg"-"c:\testing\conf\newsoapclassesTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/inc/newsoapclassesTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef NEWSOAPCLASSESTESTER_H
+#define NEWSOAPCLASSESTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <SenParser.h>
+#include <SenSoapEnvelope2.h>
+#include <SenSoapFault2.h>
+#include <SenSoapMessage2.h>
+#include <SenSoapConstants.h>
+//#include <SenSoapMessageDom2.h>
+#include <SenWsSecurityHeader2.h>
+#include <SenIdentityProvider.h>
+//#include <SenMessageContext.h>
+#include <SenXmlProperties.h>
+#include <e32debug.h>
+#include <e32std.h>
+#include <e32def.h>
+#include <SenXmlConstants.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KnewsoapclassesTesterLogPath, "\\logs\\testframework\\newsoapclassesTester\\" ); 
+// Log file
+_LIT( KnewsoapclassesTesterLogFile, "newsoapclassesTester.txt" ); 
+_LIT( KnewsoapclassesTesterLogFileWithTitle, "newsoapclassesTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenSoapFault2;
+class CSenSoapEnvelope2;
+class CSenSoapMessage2;
+class CSenWsSecurityHeader2;
+
+class CnewsoapclassesTester;
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+typedef TInt (CnewsoapclassesTester::* TestFunction)(CStifItemParser&);
+
+// CLASS DECLARATION
+
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+NONSHARABLE_CLASS(CnewsoapclassesTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CnewsoapclassesTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CnewsoapclassesTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CnewsoapclassesTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+        void SetupL();
+        void Teardown();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+         TInt MT_CSenSoapEnvelope2_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_TypeL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_DirectionL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_TxnIdL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_CloneL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_SoapVersionL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_SetContextL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_ContextL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_SetPropertiesL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_PropertiesL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_IsSafeToCastL(CStifItemParser& aItem); 
+         TInt MT_CSenSoapEnvelope2_SetBodyLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_SetBodyL_1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_BodyLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_HeaderLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_AddHeaderLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_BodyAsStringLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_IsFaultL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_DetachFaultLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_FaultLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_SetSoapActionLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_SoapActionL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_HasHeaderL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_HasBodyL(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_Parse1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_Parse2L(CStifItemParser& aItem);
+         TInt MT_CSenSoapEnvelope2_Parse3L(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_FaultCodeL(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_FaultSubcodeL(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_FaultStringL(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_FaultActorL(CStifItemParser& aItem);
+         TInt MT_CSenSoapFault2_DetailL(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewL_3L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLC_3L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewL_4L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLC_4L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewL_5L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLC_5L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewL_6L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_NewLC_6L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_TypeL(CStifItemParser& aItem);
+		 TInt MT_CSenSoapMessage2_CloneL(CStifItemParser& aItem);
+		 TInt MT_CSenSoapMessage2_Parse1L(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_SetSecurityHeaderLL(CStifItemParser& aItem);
+         TInt MT_CSenSoapMessage2_AddSecurityTokenLL(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_NewLL(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_NewLCL(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_NewL_1L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_NewLC_1L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_NewL_2L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_NewLC_2L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenLL(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_1L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_2L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_3L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_UsernameTokenL_4L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_TimestampLL(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_TimestampL_1L(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_XmlNsL(CStifItemParser& aItem);
+         TInt MT_CSenWsSecurityHeader2_XmlNsPrefixL(CStifItemParser& aItem);
+         
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // NEWSOAPCLASSESTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\newsoapclassesTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/src/newsoapclassesTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "newsoapclassesTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::CnewsoapclassesTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CnewsoapclassesTester::CnewsoapclassesTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CnewsoapclassesTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KnewsoapclassesTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KnewsoapclassesTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KnewsoapclassesTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CnewsoapclassesTester* CnewsoapclassesTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CnewsoapclassesTester* self = new (ELeave) CnewsoapclassesTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CnewsoapclassesTester::~CnewsoapclassesTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CnewsoapclassesTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CnewsoapclassesTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("newsoapclassesTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CnewsoapclassesTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/src/newsoapclassesTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3279 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "newsoapclassesTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CnewsoapclassesTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CnewsoapclassesTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+        ENTRY( "NewL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLL ),
+        ENTRY( "NewLC-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLCL ),
+        //ENTRY( "NewL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewL_1L ),
+        //ENTRY( "NewLC-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLC_1L ),
+        ENTRY( "NewL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewL_2L ),
+        ENTRY( "NewLC-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLC_2L ),
+        ENTRY( "Type-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_TypeL ),
+        ENTRY( "Direction-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_DirectionL ),
+        ENTRY( "TxnId-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_TxnIdL ),
+        ENTRY( "Clone-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_CloneL ),
+        ENTRY( "SoapVersion-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SoapVersionL ),
+        //ENTRY( "SetContext-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetContextL ),
+        //ENTRY( "Context-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_ContextL ),
+        ENTRY( "SetProperties-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetPropertiesL ),
+        ENTRY( "SetBodyL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetBodyLL ),
+        ENTRY( "Properties-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_PropertiesL ),
+        ENTRY( "IsSafeToCast-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_IsSafeToCastL ),
+        
+        ENTRY( "SetBodyL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetBodyL_1L ),
+        ENTRY( "BodyL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_BodyLL ),
+        ENTRY( "HeaderL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_HeaderLL ),
+        ENTRY( "AddHeaderL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_AddHeaderLL ),
+        ENTRY( "BodyAsStringL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_BodyAsStringLL ),
+        ENTRY( "IsFault-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_IsFaultL ),
+        ENTRY( "DetachFaultL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_DetachFaultLL ),
+        ENTRY( "FaultL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_FaultLL ),
+        ENTRY( "SetSoapActionL-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetSoapActionLL ),
+        ENTRY( "SoapAction-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_SoapActionL ),
+        ENTRY( "HasHeader-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_HasHeaderL ),
+        ENTRY( "HasBody-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_HasBodyL ),
+        ENTRY( "Parse1-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_Parse1L ),
+        ENTRY( "Parse2-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_Parse2L ),
+        ENTRY( "Parse2-CSenSoapEnvelope2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_Parse3L ),
+        ENTRY( "NewL-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_NewLL ),
+        ENTRY( "NewL-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_NewL_1L ),
+        ENTRY( "NewL-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_NewL_2L ),
+        ENTRY( "FaultCode-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_FaultCodeL ),
+        ENTRY( "FaultSubcode-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_FaultSubcodeL ),
+        ENTRY( "FaultString-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_FaultStringL ),
+        ENTRY( "FaultActor-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_FaultActorL ),
+        ENTRY( "Detail-CSenSoapFault2", CnewsoapclassesTester::MT_CSenSoapFault2_DetailL ),
+        ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLL ),
+        ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLCL ),
+        ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_1L ),
+        ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_1L ),
+        ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_2L ),
+        ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_2L ),
+        ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_3L ),
+        ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_3L ),
+        //ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_4L ),
+        //ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_4L ),
+        //ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_5L ),
+        //ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_5L ),
+        //ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_6L ),
+        //ENTRY( "NewLC-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_6L ),
+        ENTRY( "NewL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLL ),
+        ENTRY( "Type-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_TypeL ),
+        ENTRY( "Clone-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_CloneL ),
+		ENTRY( "Parse-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_Parse1L ),        
+        ENTRY( "SetSecurityHeaderL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_SetSecurityHeaderLL ),
+        ENTRY( "AddSecurityTokenL-CSenSoapMessage2", CnewsoapclassesTester::MT_CSenSoapMessage2_AddSecurityTokenLL ),
+        ENTRY( "NewL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLL ),
+        ENTRY( "NewLC-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLCL ),
+        ENTRY( "NewL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewL_1L ),
+        ENTRY( "NewLC-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLC_1L ),
+        ENTRY( "NewL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewL_2L ),
+        ENTRY( "NewLC-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLC_2L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenLL ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_1L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_2L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_3L ),
+        ENTRY( "UsernameTokenL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_4L ),
+        ENTRY( "TimestampL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_TimestampLL ),
+        ENTRY( "TimestampL-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_TimestampL_1L ),
+        ENTRY( "XmlNs-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_XmlNsL ),
+        ENTRY( "XmlNsPrefix-CSenWsSecurityHeader2", CnewsoapclassesTester::MT_CSenWsSecurityHeader2_XmlNsPrefixL ),
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CnewsoapclassesTester::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CnewsoapclassesTester::PrintTest, ETrue, 1, 3 ),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CnewsoapclassesTester::SetupL(  ){
+
+	} 
+
+void CnewsoapclassesTester::Teardown(  ){
+
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+    }
+    
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLCL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewLC();
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    //CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;    
+    }    
+/*    
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL(*mContext);
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);    
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLC_1L( CStifItemParser& aItem )
+	{
+	 SetupL();
+	 _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	 MSenMessageContext* mContext = NULL;
+	 CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewLC(*mContext);
+	 HBufC8* pAsXml = pEnvelope->AsXmlL();
+	 CleanupStack::PushL(pAsXml);
+     if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+     CleanupStack::PopAndDestroy(pAsXml);
+     CleanupStack::PopAndDestroy(pEnvelope);
+     //CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;    
+	}
+ */   
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewL_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewL(*pEnvelope1);
+    CleanupStack::PushL(pEnvelope);
+
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_NewLC_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+   _LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewLC(*pEnvelope1);
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pEnvelope);
+    //CleanupStack::PopAndDestroy();
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_TypeL( CStifItemParser& aItem )
+	{
+	SetupL();
+	MSenMessage::TClass var = MSenMessage::ESoapEnvelope2;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->Type());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_DirectionL( CStifItemParser& aItem )
+	{
+	SetupL();
+	MSenMessage::TDirection var = MSenMessage::EOutbound;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->Direction());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_TxnIdL( CStifItemParser& aItem )
+	{
+	SetupL();
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope, *pEnvelope1 = CSenSoapEnvelope2::NewL();
+    pEnvelope = CSenSoapEnvelope2::NewL(*pEnvelope1);
+    
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TInt var = pEnvelope->TxnId();
+    TBool Flag;
+    
+    if(var >= 0)
+    if(!(Flag)) return KErrArgument;
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope);
+    pEnvelope = NULL;
+    delete pEnvelope1;
+    pEnvelope1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_CloneL( CStifItemParser& aItem )
+	{
+	SetupL();
+	TBool Flag;
+	CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+	CleanupStack::PushL(pEnvelope);
+	CSenSoapEnvelope2* pClone = NULL;
+    pClone = (CSenSoapEnvelope2*)pEnvelope->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+   
+	delete pClone;
+    CleanupStack::PopAndDestroy(pEnvelope);
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SoapVersionL( CStifItemParser& aItem )
+	{
+	SetupL();
+	TSOAPVersion var = ESOAP11;
+	_LIT8(KEnvelopeString, "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    TL(var == pEnvelope->SoapVersion());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+/*	
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetContextL( CStifItemParser& aItem )
+	{
+	SetupL();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    MSenMessageContext* mContext = NULL;
+   
+	CSenXmlProperties* prop = CSenXmlProperties::NewL();
+	CSenMessageContext* mContext1 = CSenMessageContext::NewL(SenContext::EOutgoing, prop);
+    TL(KErrArgument == pEnvelope->SetContext(mContext));
+    TL(KErrNone == pEnvelope->SetContext(mContext1));
+    TL(mContext1 == pEnvelope->Context());
+    CleanupStack::PopAndDestroy(pEnvelope);
+    delete mContext1;
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_ContextL( CStifItemParser& aItem )
+	{
+	SetupL();
+	TTestResult Result;	
+	CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetContextL(Result);
+    Teardown();
+    return KErrNone;    
+	}
+*/
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetPropertiesL( CStifItemParser& aItem )
+	{
+	SetupL();
+    CSenXmlProperties* prop = CSenXmlProperties::NewL();
+    CleanupStack::PushL(prop);
+    
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::Pop();
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    TL(KErrNone == pEnvelope->SetProperties(prop));
+    CleanupStack::PopAndDestroy();
+    
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_PropertiesL( CStifItemParser& aItem )
+	{
+	SetupL();
+    CSenXmlProperties* prop = CSenXmlProperties::NewL();
+    CleanupStack::PushL(prop);
+    
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::Pop();
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    TL(KErrNone == pEnvelope->SetProperties(prop));
+    TL(prop == pEnvelope->Properties());
+    CleanupStack::PopAndDestroy();
+    
+    
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_IsSafeToCastL( CStifItemParser& aItem )
+	{
+	SetupL();
+	MSenMessage::TClass var = MSenMessage::ESoapEnvelope2;
+	TBool retVal = ETrue;
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    
+    CleanupStack::PushL(pEnvelope);
+    
+    
+    retVal == pEnvelope->IsSafeToCast(var);
+
+
+    if(retVal == EFalse)
+    	return KErrArgument;
+    
+    CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetBodyLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KBodyContentString, "<Test>Content</Test>");
+
+    _LIT8(KEnvelopeString, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><Test>Content</Test></S:Body>\
+</S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    pEnvelope->SetBodyL(KBodyContentString);
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+
+    if(!( *pAsXml == KEnvelopeString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetBodyL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,   "BodyElement");
+    _LIT8(KBodyContent,       "BodyContent");
+    _LIT8(KBodyElementName2,  "BodyElement2");
+    _LIT8(KBodyContent2,      "BodyContent2");
+
+    _LIT8(KEnvelopeString, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><BodyElement>BodyContent</BodyElement></S:Body>\
+</S:Envelope>");
+
+    _LIT8(KEnvelopeString2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Body><BodyElement2>BodyContent2</BodyElement2></S:Body>\
+</S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyContent());
+    pEnvelope->SetBodyL(bodyElement);
+
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelopeString )) KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TXmlEngElement bodyElement2 = document.CreateDocumentElementL(KBodyElementName2());
+    bodyElement2.AddTextL(KBodyContent2());
+    pEnvelope->SetBodyL(bodyElement2);
+
+    pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelopeString2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_BodyLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KBodyContentString, "Test");
+    _LIT8(KBodyString, "<S:Body>Test</S:Body>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+    pEnvelope->SetBodyL(KBodyContentString);
+
+    TXmlEngElement element = pEnvelope->BodyL();
+    RSenDocument document = pEnvelope->AsDocumentL();
+
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, element, options);
+
+    // Serialized body should contain only body as XML.
+    if(!( asXml == KBodyString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_HeaderLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KHeaderString, "<S:Header/>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement element = pEnvelope->HeaderL();
+
+    RSenDocument document = pEnvelope->AsDocumentL();
+
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, element, options);
+
+    // Serialized header should contain only header as XML.
+    if(!( asXml == KHeaderString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_AddHeaderLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+    _LIT8(KHeaderElementName2,  "HeaderElement2");
+    _LIT8(KHeaderContent2,      "HeaderContent2");
+
+    _LIT8(KEnvelope,            "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+</S:Header>\
+<S:Body/></S:Envelope>");
+
+    _LIT8(KEnvelope2,            "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+<HeaderElement2>HeaderContent2</HeaderElement2>\
+</S:Header>\
+<S:Body/></S:Envelope>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement headerElement = document.CreateDocumentElementL(KHeaderElementName());
+    headerElement.AddTextL(KHeaderContent());
+    pEnvelope->AddHeaderL(headerElement);
+
+    HBufC8* pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelope )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    TXmlEngElement headerElement2 = document.CreateDocumentElementL(KHeaderElementName2());
+    headerElement2.AddTextL(KHeaderContent2());
+    pEnvelope->AddHeaderL(headerElement2);
+
+    pAsXml = pEnvelope->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KEnvelope2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_BodyAsStringLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    _LIT8(KBodyElementContent, "BodyElementContent");
+    _LIT8(KBodyContent,        "BodyContent");
+
+    _LIT8(KBodyAsString1, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">BodyContent</S:Body>");
+    _LIT8(KBodyAsString2, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<BodyElement>BodyElementContent</BodyElement>\
+</S:Body>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyElementContent());
+
+    pEnvelope->SetBodyL(KBodyContent);
+
+    // If Body element does not contain any elements
+    // whole Body element is returned (and detached
+    // => needed namespace declarations are moved into
+    //    Body)
+    HBufC8* pAsXml = pEnvelope->BodyAsStringL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KBodyAsString1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    pEnvelope->SetBodyL(bodyElement);
+
+    // If Body element contains element(s)
+    // only first element (and all its child elements)
+    // from Body element is returned and detached
+    // (not Body element).
+    pAsXml = pEnvelope->BodyAsStringL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KBodyAsString2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_IsFaultL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultInputString,  "<SOAP:Envelope \
+xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<SOAP:Header>\
+<HeaderElement>HeaderContent</HeaderElement>\
+</SOAP:Header>\
+<SOAP:Body><SOAP:Fault>FaultContent</SOAP:Fault></SOAP:Body>\
+</SOAP:Envelope>");
+
+    // 1. Test that IsFault return EFalse by default
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    //if(!( pEnvelope->IsFault() == EFalse )) return KErrArgument;
+    TL( pEnvelope->IsFault() == EFalse )
+
+    // 2. Test that IsFault returns ETrue when fault is added
+    //    using SetBodyL method
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName(),
+                                                            pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+    pEnvelope->SetBodyL(faultElement);
+
+    if(!( pEnvelope->IsFault())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+
+    // 3. Test that IsFault returns ETrue if fault is added
+    //    when Envelope is parsed
+
+    CSenParser* pParser = CSenParser::NewLC();
+    pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KFaultInputString, *pEnvelope);
+	if(!( pEnvelope->IsFault())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_DetachFaultLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultElement,       "<S:Fault xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">FaultContent</S:Fault>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement body = pEnvelope->BodyL();
+    TXmlEngElement faultElement = body.AddNewElementWithNsL(KFaultElementName(),
+                                                      pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+
+    CSenSoapFault2* pFault = pEnvelope->DetachFaultL();
+    CleanupStack::PushL(pFault);
+
+    HBufC8* pAsXml = pFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFault);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+	
+	
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_FaultLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,  "Fault");
+    _LIT8(KFaultContent,      "FaultContent");
+    _LIT8(KFaultElement,       "<S:Fault>FaultContent</S:Fault>");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TXmlEngElement body = pEnvelope->BodyL();
+    TXmlEngElement faultElement = body.AddNewElementWithNsL(KFaultElementName(),
+                                                            pEnvelope->NsUri());
+    faultElement.AddTextL(KFaultContent());
+
+    CSenSoapFault2* pFault = pEnvelope->FaultL();
+    CleanupStack::PushL(pFault);
+
+    HBufC8* pAsXml = pFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFault);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SetSoapActionLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapActionValue,         "SoapActionValue");
+    _LIT8(KSoapActionValueInQuotes, "\"SoapActionValue\"");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TPtrC8 retVal = pEnvelope->SetSoapActionL(KSoapActionValue);
+    if(!( retVal == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction = pEnvelope->SoapAction();
+    if(!( soapAction == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 retVal2 = pEnvelope->SetSoapActionL(KSoapActionValueInQuotes);
+    if(!( retVal2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction2 = pEnvelope->SoapAction();
+    if(!( soapAction2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_SoapActionL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapActionValue,         "SoapActionValue");
+    _LIT8(KSoapActionValueInQuotes, "\"SoapActionValue\"");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    TPtrC8 retVal = pEnvelope->SetSoapActionL(KSoapActionValue);
+    if(!( retVal == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction = pEnvelope->SoapAction();
+    if(!( soapAction == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 retVal2 = pEnvelope->SetSoapActionL(KSoapActionValueInQuotes) ;
+    if(!( retVal2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    TPtrC8 soapAction2 = pEnvelope->SoapAction();
+    if(!( soapAction2 == KSoapActionValueInQuotes )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_HasHeaderL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KHeaderElementName,   "HeaderElement");
+    _LIT8(KHeaderContent,       "HeaderContent");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    if(!( pEnvelope->HasHeader() == EFalse )) return KErrArgument;
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement headerElement = document.CreateDocumentElementL(KHeaderElementName());
+    headerElement.AddTextL(KHeaderContent());
+    pEnvelope->AddHeaderL(headerElement);
+
+    if(!( pEnvelope->HasHeader())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_HasBodyL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KBodyElementName,    "BodyElement");
+    _LIT8(KBodyElementContent, "BodyElementContent");
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    if(!( pEnvelope->HasBody() == EFalse )) return KErrArgument;
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement bodyElement = document.CreateDocumentElementL(KBodyElementName());
+    bodyElement.AddTextL(KBodyElementContent());
+
+    pEnvelope->SetBodyL(bodyElement);
+
+    if(!( pEnvelope->HasBody())) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PopAndDestroy(pEnvelope);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_Parse1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KInputString, *pEnvelope);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pEnvelope->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be detached from SoapEnvelope
+	//    correctly.
+	// Note: Following "BodyAsStringL()" call will detach
+	//       Body from SoapEnvelope
+	HBufC8* pBodyAsString = pEnvelope->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KBodyAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 3) Check that body can be detached from SoapEnvelope
+	//    twice
+	//    In this case body does not have child elements.
+	//    => Empty body should be returned.
+	//       Note: Empty body should contain namespace
+	//             declaration because body is detached
+	pBodyAsString = pEnvelope->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KEmptyBodyWithNsAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 4) Check that body was detached from SoapEnvelope
+	//    correctly
+	//    => Getting body again should result empty body to be returned.
+	TXmlEngElement bodyElement = pEnvelope->BodyL();
+	RSenDocument document = pEnvelope->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be empty because "BodyAsStringL()"
+    // previously detached body.
+    if(!( asXml == KEmptyBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_Parse2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KInputString,         "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+
+    _LIT8(KWholeBodyAsString,   "<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+
+    _LIT8(KWholeHeaderAsString, "<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+	pParser->ParseL(KInputString, *pEnvelope);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pEnvelope->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be got from SoapEnvelope
+	//    correctly
+	// Note: Body won't be detached. Only reference for
+	//       body TXmlEngElement inside SoapEnvelope is returned.
+	TXmlEngElement bodyElement = pEnvelope->BodyL();
+	RSenDocument document = pEnvelope->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be in exactly the same form
+    // as in original SoapEnvelope
+    if(!( asXml == KWholeBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    // 3) Check that header TXmlEngElement can be got from SoapEnvelope
+	//    correctly
+    TXmlEngElement headerElement = pEnvelope->HeaderL();
+
+    RBuf8 headerAsXml;
+    CleanupClosePushL(headerAsXml);
+    document.SaveL(headerAsXml, headerElement, options);
+
+    // Serielized header should be in exactly the same form
+    // as in original SoapEnvelope
+    if(!( headerAsXml == KWholeHeaderAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&headerAsXml);
+
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapEnvelope2_Parse3L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KInputString,         "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+<wsa:MessageID>urn:uuid:7837d733-b9f8-3eb1-5c3f-7a509797e6b2</wsa:MessageID>\
+<wsa:To>http://schemas.live.com/mws/2005/08/spaces</wsa:To>\
+<wsa:Action>http://schemas.live.com/mws/2005/08/spaces/Post</wsa:Action>\
+<wsa:ReplyTo><wsa:Address>id:7bbd5c5b-7857-44c4-b609-53498d0cab3b</wsa:Address></wsa:ReplyTo>\
+</S:Header>\
+<S:Body>\
+<PostRequest xmlns=\"http://schemas.live.com/mws/2005/08/spaces\">\
+<Item><Filename>sample1.wav</Filename><ItemType>8</ItemType><Image><Data></Data></Image></Item>\
+</PostRequest>\
+</S:Body>\
+</S:Envelope>");
+
+    _LIT8(KOuterXml,            "<S:Body>\
+<PostRequest xmlns=\"http://schemas.live.com/mws/2005/08/spaces\">\
+<Item><Filename>sample1.wav</Filename><ItemType>8</ItemType><Image><Data/></Image></Item>\
+</PostRequest>\
+</S:Body>");
+
+    CSenParser* pParser = CSenParser::NewL();
+    CleanupStack::PushL(pParser);
+
+    CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL();
+    CleanupStack::PushL(pEnvelope);
+
+    pParser->ParseL(KInputString, *pEnvelope);
+    TXmlEngElement element = pEnvelope->BodyL();
+
+    RBuf8 outerXml;
+    CleanupClosePushL(outerXml);
+    element.OuterXmlL(outerXml);
+
+    if(!( outerXml == KOuterXml )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&outerXml);
+    CleanupStack::PopAndDestroy(pEnvelope);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_NewLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,    "Fault");
+    _LIT8(KFaultElementContent, "FaultContent");
+    _LIT8(KFaultElement,        "<Fault>FaultContent</Fault>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName());
+    faultElement.AddTextL(KFaultElementContent());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_NewL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KFaultElementName,    "Fault");
+    _LIT8(KFaultElementContent, "FaultContent");
+    _LIT8(KFaultElement,        "<Fault>FaultContent</Fault>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementName());
+    faultElement.AddTextL(KFaultElementContent());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_NewL_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KParentName,          "Parent");
+
+    _LIT8(KAttributeNsUri,      "nsuri");
+    _LIT8(KAttributeNsPrefix,   "pr");
+    _LIT8(KAttributeLocalName,  "AttrName");
+    _LIT8(KAttributeValue,      "Value");
+
+    _LIT8(KFaultNsUri,          "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KFaultNsPrefix,       "S");
+    _LIT8(KFaultLocalName,      "Fault");
+
+    _LIT8(KFaultElement,        "<S:Fault \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" \
+xmlns:pr=\"nsuri\" pr:AttrName=\"Value\"/>");
+
+    _LIT8(KParentDocument,      "<Parent><S:Fault \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" \
+xmlns:pr=\"nsuri\" pr:AttrName=\"Value\"/>\
+</Parent>");
+
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(KParentName());
+
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+
+    RString nsUriRString        = stringPool.OpenStringL(KAttributeNsUri);
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(KAttributeNsPrefix);
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(KAttributeLocalName);
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(KAttributeValue);
+    CleanupClosePushL(valueRString);
+
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString,
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(KFaultNsUri,
+                                                      KFaultLocalName,
+                                                      KFaultNsPrefix,
+                                                      attrArray,
+                                                      parentElement,
+                                                      document);
+    CleanupStack::PushL(pSoapFault);
+    HBufC8* pAsXml = pSoapFault->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KFaultElement )) return KErrArgument;
+
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    parentElement.OuterXmlL(buffer);
+
+    if(!( buffer == KParentDocument )) return KErrArgument;
+    CleanupStack::PopAndDestroy(&buffer);
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapFault);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(&document);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_FaultCodeL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	//	Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultCodeLocalname());
+    faultCodeElement.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultCode();
+    if(!( faultCode == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2 = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultValueElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    CleanupStack::PopAndDestroy(1); // document2
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultCode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_FaultSubcodeL( CStifItemParser& aItem )
+    {
+	SetupL();
+    // FaultSubcodeL is supported only in Soap 1.2
+    // If other version of Soap is used return value will always be KNullDesC
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+//    _LIT8(KFaultCodeLocalname,      "faultcode");
+
+    _LIT8(KFault12CodeLocalname,    "Code");    // Soap 1.2
+    _LIT8(KFault12SubcodeLocalname,	"Subcode"); // Soap 1.2
+    _LIT8(KFault12ValueLocalname,	"Value");	// Soap1.2
+
+    _LIT8(KFaultCodeValue,          "123");
+
+
+    // 1) Fault subcode in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 there is _NO_ sobcode
+    //          => KNullDesC8 should be returned.
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement    = faultElement.AddNewElementL(KFault12CodeLocalname());
+    TXmlEngElement faultSubCodeElement = faultCodeElement.AddNewElementSameNsL(KFault12SubcodeLocalname());
+    TXmlEngElement faultValueElement   = faultSubCodeElement.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultSubcode();
+    if(!( faultCode == KNullDesC8 )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+
+    // 2) Fault subcode in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultCodeElement2    = faultElement2.AddNewElementSameNsL(KFault12CodeLocalname());
+    TXmlEngElement faultSubCodeElement2 = faultCodeElement2.AddNewElementSameNsL(KFault12SubcodeLocalname());
+    TXmlEngElement faultValueElement2   = faultSubCodeElement2.AddNewElementSameNsL(KFault12ValueLocalname());
+    faultValueElement2.AddTextL(KFaultCodeValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    CleanupStack::PopAndDestroy(1); // document2
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultSubcode();
+    if(!( faultCode2 == KFaultCodeValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_FaultStringL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultStringLocalname,    "faultstring");
+
+    _LIT8(KFault12ReasonLocalname,	"Reason");  // Soap1.2
+    _LIT8(KFault12TextLocalname,	"Text");    // Soap1.2
+
+
+    _LIT8(KFaultStringValue,        "Fault code string");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultStringElement = faultElement.AddNewElementL(KFaultStringLocalname());
+    faultStringElement.AddTextL(KFaultStringValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultCode = pSoapFault->FaultString();
+    if(!( faultCode == KFaultStringValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultReasonElement2 = faultElement2.AddNewElementSameNsL(KFault12ReasonLocalname());
+    TXmlEngElement faultTextElement2 = faultReasonElement2.AddNewElementSameNsL(KFault12TextLocalname());
+    faultTextElement2.AddTextL(KFaultStringValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    CleanupStack::PopAndDestroy(1); // document2
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultString();
+    if(!( faultCode2 == KFaultStringValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_FaultActorL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KFaultActorLocalname,     "faultactor");
+
+    _LIT8(KFault12NodeLocalname,	"Node");    // Node represents faultactor in Soap 1.2
+
+    _LIT8(KFaultActorValue,          "http://www.wrox.com/heroes/endpoint.asp");
+
+
+    // 1) Faultactor in Soap other than 1.2
+    //    "faultactor" is intended to provide information about which SOAP node
+    //    on the SOAP message path caused the fault to happen.
+    //    The value of the "faultactor" is a URI identifying the source of the fault.
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultCodeElement = faultElement.AddNewElementL(KFaultActorLocalname());
+    faultCodeElement.AddTextL(KFaultActorValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultActor = pSoapFault->FaultActor();
+    if(!( faultActor == KFaultActorValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+
+    // 2) Faultactor in Soap 1.2
+    //    "Node" is intended to provide information about which SOAP node on the
+    //    SOAP message path caused the fault to happen.
+    //    "Node" contains the URI of the SOAP node that generated the fault.
+    //
+    //    Note: In Soap 1.2 "Node" represents "faultactor" from previous SOAP versions.
+
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultNodeElement2 = faultElement2.AddNewElementSameNsL(KFault12NodeLocalname());
+    faultNodeElement2.AddTextL(KFaultActorValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    CleanupStack::PopAndDestroy(1); // document2
+    CleanupStack::PushL(pSoapFault2);
+
+    HBufC8* pAsXml = pSoapFault2->AsXmlL();
+    delete pAsXml;
+
+    TPtrC8 faultCode2 = pSoapFault2->FaultActor();
+    if(!( faultCode2 == KFaultActorValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapFault2_DetailL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSenSoapEnvelopeXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
+    _LIT8(KSenSoap12EnvelopeXmlns,             "http://www.w3.org/2003/05/soap-envelope");
+
+    _LIT8(KFaultElementLocalname,   "Fault");
+    _LIT8(KFaultNsPrefix,           "S");
+
+    _LIT8(KDetailLocalname,         "detail");
+
+    _LIT8(KFault12DetailLocalname,	"Detail");    // Soap 1.2
+
+    _LIT8(KFaultDetailValue,          "Detailed information");
+
+
+    // 1) Fault code in Soap other than 1.2
+    //    Note: In SOAP older than 1.2 fault elements are _NOT_ namespace qualified
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement faultElement = document.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                  KSenSoapEnvelopeXmlns(),
+                                                                  KFaultNsPrefix());
+    TXmlEngElement faultDetailElement = faultElement.AddNewElementL(KDetailLocalname());
+    faultDetailElement.AddTextL(KFaultDetailValue());
+
+    CSenSoapFault2* pSoapFault = CSenSoapFault2::NewL(faultElement, document);
+    CleanupStack::PopAndDestroy(1); // document
+    CleanupStack::PushL(pSoapFault);
+
+    TPtrC8 faultDetail = pSoapFault->Detail();
+    if(!( faultDetail == KFaultDetailValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault);
+
+    // 2) Fault code in Soap 1.2
+    //    Note: SOAP 1.2 faults are structured differently to SOAP 1.1.
+    //          In particular all fault elements are now namespace _qualified_,
+    //          many have been renamed and fault codes are now hierarchical
+    RSenDocument document2 = RSenDocument::NewLC();
+    TXmlEngElement faultElement2 = document2.CreateDocumentElementL(KFaultElementLocalname(),
+                                                                    KSenSoap12EnvelopeXmlns(),
+                                                                    KFaultNsPrefix());
+    TXmlEngElement faultDetailElement2 = faultElement2.AddNewElementSameNsL(KFault12DetailLocalname());
+    faultDetailElement2.AddTextL(KFaultDetailValue());
+
+    CSenSoapFault2* pSoapFault2 = CSenSoapFault2::NewL(faultElement2, document2);
+    CleanupStack::PopAndDestroy(1); // document2
+    CleanupStack::PushL(pSoapFault2);
+
+    TPtrC8 faultDetail2 = pSoapFault2->Detail();
+    if(!( faultDetail2 == KFaultDetailValue )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pSoapFault2);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLCL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC();
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KIllegalNamespace);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP11, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KIllegalNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(ESOAP12, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_3L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapMessage2* pSoapMessage, *pSoapMessage1 = CSenSoapMessage2::NewL();
+    pSoapMessage = CSenSoapMessage2::NewL(*pSoapMessage1);
+    
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    
+    __ASSERT_ALWAYS_NO_LEAVE(delete pSoapMessage);
+    pSoapMessage = NULL;
+    delete pSoapMessage1;
+    pSoapMessage1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+    
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_3L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    CSenSoapMessage2* pSoapMessage, *pSoapMessage1 = CSenSoapMessage2::NewL();
+    pSoapMessage = CSenSoapMessage2::NewLC(*pSoapMessage1);
+    
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    delete pSoapMessage1;
+    pSoapMessage1 = NULL;
+    Teardown();
+    return KErrNone;    
+	}
+/*    
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_4L( CStifItemParser& aItem )
+	{
+	SetupL();
+    _LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext);
+    CleanupStack::PushL(pSoapMessage);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_4L( CStifItemParser& aItem )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+	MSenMessageContext* mContext = NULL;
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_5L( CStifItemParser& aItem )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+	
+    MSenMessageContext* mContext = NULL;
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP12 );
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_5L( CStifItemParser& aItem )
+	{
+	SetupL();
+	_LIT8(KSoapMessage11,   "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,   "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    MSenMessageContext* mContext = NULL;
+
+  
+    // 1) Test creating of SOAP 1.1 version SoapMessage
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext, ESOAP11);
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+
+    // 2) Test creating of SOAP 1.2 version SoapMessage
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext, ESOAP12);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewL_6L( CStifItemParser& aItem )
+	{
+	SetupL();
+	MSenMessageContext* mContext = NULL;
+
+    
+	_LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(*mContext, ESOAP11, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP11, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP11, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KIllegalNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KSecuritySchemeXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewL(*mContext,ESOAP12, KSecurityXmlNamespace);
+    CleanupStack::PushL(pSoapMessage);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_NewLC_6L(CStifItemParser& aItem )
+	{
+	SetupL();
+	MSenMessageContext* mContext = NULL;
+    
+	 _LIT8(KIllegalNamespace,            "illegalNamespace");
+    _LIT8(KSecuritySchemeXmlNamespace,  "http://schemas.xmlsoap.org/ws/2003/06/secext");
+    _LIT8(KSecurityXmlNamespace,        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    _LIT8(KSoapMessage11,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+    _LIT8(KSoapMessage12,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage13,    "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage21,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\"/>");
+    _LIT8(KSoapMessage22,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+    _LIT8(KSoapMessage23,    "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/></S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    // 1.1) Test creating of SOAP 1.1 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KIllegalNamespace);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.2) Test creating of SOAP 1.1 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 1.3) Test creating of SOAP 1.1 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP11, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage13 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.1) Test creating of SOAP 1.2 version SoapMessage with illegal namespace
+    //      => No security header should be added.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KIllegalNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage21 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.2) Test creating of SOAP 1.2 version SoapMessage with scheme namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KSecuritySchemeXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage22 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2.3) Test creating of SOAP 1.2 version SoapMessage with security namespace
+    //      => Security header should be created with given namespace.
+    pSoapMessage = CSenSoapMessage2::NewLC(*mContext,ESOAP12, KSecurityXmlNamespace);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage23 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    Teardown();
+    return KErrNone;    
+	}
+*/	
+ 
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_TypeL( CStifItemParser& aItem )
+	{
+	SetupL();
+	CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+    
+    TL(MSenMessage::ESoapMessage2 == pSoapMessage->Type());
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_CloneL( CStifItemParser& aItem )
+	{
+	SetupL();
+	TBool Flag;
+	CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pSoapMessage);
+
+	CSenSoapMessage2* pClone = NULL;
+    pClone = 	(CSenSoapMessage2*)pSoapMessage->CloneL(); 
+    if(pClone != NULL)
+    	Flag = 1;
+    if(!(Flag)) return KErrArgument;
+    delete pClone;
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+	
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_Parse1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KInputString,             "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<sb:Correlation xmlns:sb=\"urn:liberty:sb:2003-08\" \
+messageID=\"URN:UUID:860949DC-134D-A989-E328-2FD7F20E31CE\" timestamp=\"2006-06-01T14:53:19Z\"/>\
+<wsse:Security xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2003/06/secext\"/>\
+</S:Header>\
+<S:Body>\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>\
+</S:Envelope>");
+    _LIT8(KBodyAsString,     "\
+<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sa=\"urn:liberty:sa:2004-04\">\
+<sa:SASLRequest xmlns:sa=\"urn:liberty:sa:2004-04\" mechanism=\"ANONYMOUS PLAIN CRAM-MD5\" authzID=\"testuser1\"/>\
+</S:Body>");
+    
+
+    _LIT8(KEmptyBodyAsString,       "<S:Body/>");
+
+    _LIT8(KEmptyBodyWithNsAsString, "<S:Body xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"/>");
+
+    CSenParser* pParser = CSenParser::NewLC();
+    CSenSoapMessage2* pMessage = CSenSoapMessage2::NewL();
+    CleanupStack::PushL(pMessage);
+
+	pParser->ParseL(KInputString, *pMessage);
+
+	// 1) Check that parsed SoapEnvelope can be
+	//    serialized correctly
+	HBufC8* pAsXml = pMessage->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+	if(!( *pAsXml == KInputString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pAsXml);
+
+	// 2) Check that body can be detached from SoapEnvelope
+	//    correctly.
+	// Note: Following "BodyAsStringL()" call will detach
+	//       Body from SoapEnvelope
+	HBufC8* pBodyAsString = pMessage->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KBodyAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 3) Check that body can be detached from SoapEnvelope
+	//    twice
+	//    In this case body does not have child elements.
+	//    => Empty body should be returned.
+	//       Note: Empty body should contain namespace
+	//             declaration because body is detached
+	pBodyAsString = pMessage->BodyAsStringL();
+	CleanupStack::PushL(pBodyAsString);
+	if(!( *pBodyAsString == KEmptyBodyWithNsAsString )) return KErrArgument;
+	CleanupStack::PopAndDestroy(pBodyAsString);
+
+	// 4) Check that body was detached from SoapEnvelope
+	//    correctly
+	//    => Getting body again should result empty body to be returned.
+	TXmlEngElement bodyElement = pMessage->BodyL();
+	RSenDocument document = pMessage->AsDocumentL();
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, bodyElement, options);
+
+    // Serielized body should be empty because "BodyAsStringL()"
+    // previously detached body.
+    if(!( asXml == KEmptyBodyAsString )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    CleanupStack::PopAndDestroy(pMessage);
+    CleanupStack::PopAndDestroy(pParser);
+    Teardown();
+    return KErrNone;    
+	}
+	
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_SetSecurityHeaderLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11_1, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<Credential/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage11_2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_1, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<Credential/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_2, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KCredential,      "<Credential/>");
+
+    // 1) Soap 1.1 - Test setting of SecurityHeader WITH Credential
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KCredential);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Soap 1.1 - Test setting of SecurityHeader WITHOUT Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KNullDesC8);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 3) Soap 1.2 - Test setting of SecurityHeader WITH Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KCredential);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 4) Soap 1.2 - Test setting of SecurityHeader WITH Credential
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->SetSecurityHeaderL(KNullDesC8);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenSoapMessage2_AddSecurityTokenLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KSoapMessage11_1, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage11_2, "<S:Envelope \
+xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+<SecurityToken2/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_1, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSoapMessage12_2, "<S:Envelope \
+xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<SecurityToken/>\
+<SecurityToken2/>\
+</wsse:Security>\
+</S:Header>\
+<S:Body/>\
+</S:Envelope>");
+
+    _LIT8(KSecurityToken,   "<SecurityToken/>");
+    _LIT8(KSecurityToken2,   "<SecurityToken2/>");
+
+    // 1) Soap 1.1 - Test adding of SecurityToken
+    CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+
+    HBufC8* pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 2) Soap 1.1 - Test adding of two SecurityTokens
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP11);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+    pSoapMessage->AddSecurityTokenL(KSecurityToken2);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage11_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 3) Soap 1.2 - Test adding of SecurityToken
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_1 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+
+    // 4) Soap 1.2 - Test adding of two SecurityTokens
+    pSoapMessage = CSenSoapMessage2::NewL(ESOAP12);
+    CleanupStack::PushL(pSoapMessage);
+
+    pSoapMessage->AddSecurityTokenL(KSecurityToken);
+    pSoapMessage->AddSecurityTokenL(KSecurityToken2);
+
+    pAsXml = pSoapMessage->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSoapMessage12_2 )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pSoapMessage);
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+
+    _LIT8(KRootElementName, "RootElement");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLCL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>");
+
+    _LIT8(KRootElementName, "RootElement");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(KSecurityToken,
+                                                                      document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLC_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(KSecurityToken,
+                                                                       document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewL_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+    _LIT8(KNamespace,       "namespace");
+
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewL(KSecurityToken,
+                                                                      KNamespace,
+                                                                      document,
+                                                                      rootElement);
+    CleanupStack::PushL(pWsSecHeader);
+
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_NewLC_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElement,     "<RootElement>\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>\
+</RootElement>");
+
+    _LIT8(KSecurityHeader,  "\
+<wsse:Security xmlns:wsse=\"namespace\">\
+SecurityToken\
+</wsse:Security>");
+
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KSecurityToken,   "SecurityToken");
+    _LIT8(KNamespace,       "namespace");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(KSecurityToken,
+                                                                       KNamespace,
+                                                                       document,
+                                                                       rootElement);
+    TUint optionFlags = 0;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    optionFlags = optionFlags | TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+
+    // Allow encoding declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionEncoding;
+
+    // Allow standalone declaration (if KOptionOmitXMLDeclaration is _not_ set)
+    //optionFlags = optionFlags | TSerializationOptions::KOptionStandalone;
+
+    TXmlEngSerializationOptions options(optionFlags);
+
+    RBuf8 asXml;
+    CleanupClosePushL(asXml);
+    document.SaveL(asXml, rootElement, options);
+
+    // Serialized document should contain all the Fragment data as XML.
+    if(!( asXml == KRootElement )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(&asXml);
+
+    HBufC8* pAsXml = pWsSecHeader->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    if(!( *pAsXml == KSecurityHeader )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KUserName,        "UserName");
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+
+    _LIT8(KFakeEndPoint,        "http://www.fake_endpoint.com/");
+    _LIT8(KUsername,            "Username");
+    _LIT8(KPassword,            "Password");
+
+    _LIT8(KUserNameToken,       "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    _LIT8(KUserNameTokenDigest, "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+<wsse:Password Type=\"wsse:PasswordDigest\">Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KFakeEndPoint());
+    pIdP->SetUserInfoL(KUsername, KNullDesC8, KPassword);
+
+    // 1) Test using CSenWsSecurityHeader2::EText
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP, CSenWsSecurityHeader2::EText);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    // 2) Test using CSenWsSecurityHeader2::EDigest
+    pWsSecHeader = CSenWsSecurityHeader2::NewLC(document, rootElement);
+
+    pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP, CSenWsSecurityHeader2::EDigest);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameTokenDigest )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(pIdP);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_2L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KUserName,        "UserName");
+    _LIT8(KPassword,        "Password");
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_3L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+    _LIT8(KUserName,            "UserName");
+    _LIT8(KPassword,            "Password");
+    _LIT8(KUserNameToken,       "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password>Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    _LIT8(KUserNameTokenDigest, "<wsse:UsernameToken>\
+<wsse:Username>UserName</wsse:Username>\
+<wsse:Password Type=\"wsse:PasswordDigest\">Password</wsse:Password>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    // 1) Test using CSenWsSecurityHeader2::EText
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    HBufC8* pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, CSenWsSecurityHeader2::EText,
+                                 pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    // 2) Test using CSenWsSecurityHeader2::EDigest
+    pWsSecHeader = CSenWsSecurityHeader2::NewLC(document, rootElement);
+
+    pUserNameToken = NULL;
+    pWsSecHeader->UsernameTokenL(KUserName, KPassword, CSenWsSecurityHeader2::EDigest,
+                                 pUserNameToken);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameTokenDigest )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_UsernameTokenL_4L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+
+    _LIT8(KFakeEndPoint,    "http://www.fake_endpoint.com/");
+    _LIT8(KUsername,        "Username");
+    _LIT8(KPassword,        "Password");
+
+    _LIT8(KUserNameToken,   "<wsse:UsernameToken>\
+<wsse:Username>Username</wsse:Username>\
+</wsse:UsernameToken>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+
+    CSenIdentityProvider* pIdP = CSenIdentityProvider::NewLC(KFakeEndPoint());
+    pIdP->SetUserInfoL(KUsername, KNullDesC8, KPassword);
+
+    HBufC8* pUserNameToken = pWsSecHeader->UsernameTokenL(*pIdP);
+    CleanupStack::PushL(pUserNameToken);
+    if(!( *pUserNameToken == KUserNameToken )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pUserNameToken);
+
+    CleanupStack::PopAndDestroy(pIdP);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_TimestampLL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KCreated,         "2001-09-13T08:42:00Z");
+    _LIT8(KExpires,         "2002-09-13T08:42:00Z");
+    _LIT8(KTimeStamp,       "\
+<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\
+<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>\
+<wsu:Expires>2002-09-13T08:42:00Z</wsu:Expires>\
+</wsu:Timestamp>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    HBufC8* pTimeStamp;
+    pWsSecHeader->TimestampL(KCreated, KExpires, pTimeStamp);
+    CleanupStack::PushL(pTimeStamp);
+    if(!( *pTimeStamp == KTimeStamp )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pTimeStamp);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_TimestampL_1L( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName, "RootElement");
+    _LIT8(KCreated,         "2001-09-13T08:42:00Z");
+    _LIT8(KTimeStamp,       "\
+<wsu:Timestamp xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\
+<wsu:Created>2001-09-13T08:42:00Z</wsu:Created>\
+</wsu:Timestamp>");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    HBufC8* pTimeStamp;
+    pWsSecHeader->TimestampL(KCreated, pTimeStamp);
+    CleanupStack::PushL(pTimeStamp);
+    if(!( *pTimeStamp == KTimeStamp )) return KErrArgument;
+    CleanupStack::PopAndDestroy(pTimeStamp);
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_XmlNsL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName,     "RootElement");
+    _LIT8(KSecurityNamespace,   "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TPtrC8 nameSpace = pWsSecHeader->XmlNs();
+    if(!( nameSpace == KSecurityNamespace )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+TInt CnewsoapclassesTester::MT_CSenWsSecurityHeader2_XmlNsPrefixL( CStifItemParser& aItem )
+    {
+	SetupL();
+    _LIT8(KRootElementName,         "RootElement");
+    _LIT8(KSecurityNamespacePrefix, "wsse");
+
+    RSenDocument document = RSenDocument::NewLC();
+    TXmlEngElement rootElement = document.CreateDocumentElementL(KRootElementName());
+
+    CSenWsSecurityHeader2* pWsSecHeader = CSenWsSecurityHeader2::NewLC(document,
+                                                                       rootElement);
+    TPtrC8 prefix = pWsSecHeader->XmlNsPrefix();
+    if(!( prefix == KSecurityNamespacePrefix )) return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pWsSecHeader);
+
+    CleanupStack::PopAndDestroy(1); // document
+    Teardown();
+    return KErrNone;    
+	}
+
+// -----------------------------------------------------------------------------
+// CnewsoapclassesTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CnewsoapclassesTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/web_service_messaging_api/web_service_messaging_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<api id="05ea62bfa2dae27cc35f0faf44ab6845" dataversion="1.0">
+<name>Web Service Messaging API</name>
+<description>This API provides message objects that ease up communication between service consumers and providers. Functionality is based on XML, including implementation that meets SOAP standards.</description>
+<type>c++</type>
+<collection>webservices</collection>
+<libs><lib name="senmessages.lib"/>
+</libs>
+<release category="public" sinceversion="5.0"/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                XML Extensions API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/SenBaseFragment.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenBaseFragment.h)
+../inc/MSenElement.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenElement.h)
+../inc/MSenContentHandlerClient.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenContentHandlerClient.h)
+../inc/SenXmlUtils.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenXmlUtils.h)
+../inc/SenBaseElement.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenBaseElement.h)
+../inc/SenElement.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenElement.h)
+../inc/SenFragment.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenFragment.h)
+../inc/SenDomFragment.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenDomFragment.h)
+../inc/MSenFragment.h     MW_LAYER_PUBLIC_EXPORT_PATH(MSenFragment.h)
+../inc/SenNameSpace.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenNameSpace.h)
+../inc/SenBaseAttribute.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenBaseAttribute.h)
+../inc/SenXmlReader.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenXmlReader.h)
+../inc/SenXmlConstants.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenXmlConstants.h)
+../inc/SenXmlElement.h     MW_LAYER_PUBLIC_EXPORT_PATH(SenXmlElement.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/MSenContentHandlerClient.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for SAX Parser Callback events.       
+*
+*/
+
+#ifndef __MSENCONTENTHANDLERCLIENT_H
+#define __MSENCONTENTHANDLERCLIENT_H
+
+//  INCLUDES
+#include <stringpool.h>
+#include <xml/attribute.h>
+
+using namespace Xml;
+
+// CLASS DECLARATION
+
+/**
+*  Interface for SAX Parser Callback events.
+*  If an application (client) needs to be informed of basic parsing events, 
+*  it implements this interface and registers an instance with the SAX parser 
+*  using the SetContentHandler() method.
+*  The parser uses the instance to report basic document-related events like 
+*  the start and end of elements.*  
+*
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class MSenContentHandlerClient
+    {
+    public: // New functions
+        /**
+        * Receive notification of the beginning of a document.
+        * Called when OnStartDocumentL callback is received from Symbian XML framework.
+        * @return KErrNone or some of the system-wide Symbian error codes.
+        */      
+        virtual TInt StartDocument() = 0;
+
+        /**
+        * Receive notification of the end of a document.
+        * Called when OnEndDocumentL callback is received from Symbian XML framework.
+        * @return KErrNone or some of the system-wide Symbian error codes.
+        */
+        virtual TInt EndDocument() = 0;
+
+        /**
+        * Receive notification of the beginning of an element.
+        * Called when OnStartElementL callback is received from Symbian XML framework.
+        * @param aURI:          The Namespace URI, or the empty string if the element 
+        *                       has no Namespace URI or if Namespace processing is not 
+        *                       being performed.
+        * @param aLocalName:    The local name (without prefix)
+        * @param aName:         The qualified name
+        * @param apAttrs:       The attributes attached to the element. 
+        *                       If there are no attributes, it shall be an empty array.
+        *                       Namespaces declared in the current element will be 
+        *                       located in the array also.
+        *        
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt StartElement(   const TDesC8& /*aURI*/, 
+                                            const TDesC8& /*aLocalName*/, 
+                                            const TDesC8& /*aName*/, 
+                                            const RAttributeArray& /* apAttrs */)
+            {
+            return KErrNotSupported;
+            }
+
+        /**
+        * Receive notification of the end of an element.
+        * Called when OnEndElementL callback is received from Symbian XML framework.
+        * @param aURI:          The Namespace URI, or the empty string if the element 
+        *                       has no Namespace URI or if Namespace processing is not 
+        *                       being performed.
+        * @param aLocalName:    The local name (without prefix)
+        * @param aName:         The qualified name
+        *
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt EndElement( const TDesC8& /*aURI*/, 
+                                        const TDesC8& /*aLocalName*/, 
+                                        const TDesC8& /*aName*/)
+            {
+            return KErrNotSupported;
+            }
+
+
+        /**
+        * Receive notification of character data inside an element.
+        * Called when OnContentL callback is received from Symbian XML framework.
+        * @param aBuff: The characters.
+        * @param aStart: The start position in the character buffer.
+        * @param aLength: The number of characters to use from the character buffer.
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt Characters(const TDesC8& /*aBuf*/, 
+                                       const TInt /*aStart*/, 
+                                       const TInt /*aLength*/)
+            {
+            return KErrNotSupported;
+            }
+
+        /**
+        * Receive notification of a processing instruction
+        * Called when OnProcessingInstructionL callback is received from Symbian XML framework.
+        * @deprefaceted This method is currently not in use - inlined.
+        * @param aTarget:       The processing instruction target.
+        * @param aData:         The processing instruction data, 
+        *                       or null if none is supplied.
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt ProcessingInstructions(const TDesC8& /*aTarget*/, 
+                                                   const TDesC8& /*aData*/)
+            {
+            return KErrNotSupported;
+            }
+
+        /**
+        * Receive notification of a skipped entity.
+        * Called when OnSkippedEntityL callback is received from Symbian XML framework.
+        * @param aName: The name of the skipped entity.
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt SkippedEntity(const TDesC8& /*aName*/)
+            {
+            return KErrNotSupported;
+            } 
+
+
+        /**
+        * Receive notification of error situation during parsing.
+        * Called when OnError callback is received from Symbian XML framework.
+        * Complete list of error codes is listed under <Xml\XmlFrameworkErrors.h>
+        * @param aErrorCode: Error status code.
+        * @param aSeverity: Error Severity.
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt Error(TInt /*aErrorCode*/)
+            {
+            return KErrNotSupported;
+            }
+
+        /**
+        * Receive notification of prefix mapping start.
+        * Called when OnStartPrefixMappingL callback is received from Symbian XML framework.
+        * @param aPrefix: The prefix
+        * @param aUri: The URI mapped to the prefix.
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt StartPrefixMappingL(  const TDesC8& /* aPrefix */, 
+                                                  const TDesC8& /* aUri */)
+            {
+            return KErrNotSupported;
+            }
+            
+        /**
+        * Receive notification of prefix mapping end.
+        * Called when OnEndPrefixMappingL callback is received from Symbian XML framework.
+        * @param aPrefix: The prefix
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt EndPrefixMappingL(const TDesC8& /* aPrefix */)
+            {
+            return KErrNotSupported;
+            }
+            
+        /**
+        * Receive notification of ignorable whitespace in element content.
+        * Called when OnIgnorableWhiteSpaceL callback is received from Symbian XML framework.
+        * @param aBytes: The whitespace characters.
+        * @return               KErrNotSupported    If the class implementing this 
+        *                                           interface doesn't override this.
+        *                       KErrNone or other system-wide Symbian error codes.
+        */
+        inline virtual TInt OnIgnorableWhiteSpaceL(const TDesC8& /* aBytes */) 
+            {
+            return KErrNotSupported;
+            }
+
+        /**
+        * Method obtains the interface matching the specified UID.
+        * @param    aUid    the UID identifying the required interface.
+        * @return   NULL if no interface matching the UID is found or method is not
+        *           overridden in the implementing class.
+        *           Otherwise, the this pointer cast to that interface.
+        */
+        inline virtual TAny* GetExtendedInterface(const TInt32 /* aUid */)
+            {
+            return NULL;
+            }
+    };
+
+#endif      // __MSENCONTENTHANDLERCLIENT_H   
+            
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/MSenElement.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,486 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        The abstract interface of an XML element
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_ELEMENT_H
+#define M_SEN_ELEMENT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <xml/attribute.h>
+
+// FORWARD DECLARATIONS
+class CSenElement;
+class CSenBaseAttribute;
+class CSenNamespace;
+
+using namespace Xml;
+
+// CLASS DECLARATION
+
+/**
+*  The abstract interface of an XML element
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class MSenElement
+    {
+    public: // New functions
+
+        /**
+        *   Getter for Element's local name.
+        *  @return KNullDesC if not set
+        */
+        virtual const TDesC8& LocalName() const = 0;
+
+        /**
+        *   Getter for Element's namespace URI.
+        *   @return Namespace URI or KNullDesC if not set.
+        */
+        virtual const TDesC8& NamespaceURI() const = 0;
+
+        /**
+        *   Setter for Element's namespace URI.
+        *   @param aNsUri:  Namespace URI
+        */
+        virtual void SetNamespaceL(const TDesC8& aNsUri) = 0;
+
+        /**
+        *   Setter for Element's namespace URI.
+        *   @param aNsPrefix:   Namespace prefix
+        *   @param aNsUri:      Namespace URI
+        */
+        virtual void SetNamespaceL( const TDesC8& aNsPrefix,
+                                    const TDesC8& aNsUri) = 0;
+
+        /**
+        *   Method for adding a namespace for the Element.
+        *   @param aNsPrefix:   Namespace prefix
+        *   @param aNsUri:      Namespace URI
+        *   @return the added Namespace, or the equivalent pre-existing one.
+        */
+        virtual const CSenNamespace* AddNamespaceL( const TDesC8& aPrefix,
+                                                    const TDesC8& aUri) = 0;
+
+        /**
+         * Adds a namespace declaration.
+         * If this element (or its parent if parameter aCheckInParent is ETrue) 
+         * already has a Namespace with the same prefix and URI the given
+         * Namespace is not added.
+         * @param aNewNamespace
+         * @param aCheckInParent
+         * @return the added Namespace, or the equivalent pre-existing one.
+         */
+        virtual const CSenNamespace* AddNamespaceL( CSenNamespace& aNewNamespace,
+                                                    TBool aCheckInParent) = 0;
+        /**
+        *   Getter for Element's namespace.
+        *   @return const pointer to the CSenNamespace object of this Element.
+        *           NULL if not set.
+        */
+        virtual const CSenNamespace* Namespace() = 0;
+
+        /**
+         * Get namespace that is declared for the given prefix
+         * @param aNsPrefix:    The prefix to be used in searching.
+        * @return the found Namespace that is declared for the given prefix
+        * within the scope of this Element or NULL if not found.
+         */
+        virtual const CSenNamespace* Namespace( const TDesC8& aNsPrefix) = 0;
+
+        /**
+         * Get namespace that is declared for the given prefix and namespace
+         * URI within the scope of this Element. 
+         *
+         * @param aNsPrefix:    The prefix used to search
+         * @param aUri:         The namespace URI used to search.
+        * @return the found Namespace that is declared for the given prefix and namespace
+        * URI within the scope of this Element or NULL if not found.
+         */
+        virtual const CSenNamespace* Namespace( const TDesC8& aNsPrefix,
+                                                const TDesC8& aUri) = 0;
+
+        /**
+         * Get namespace that is declared for the given prefix and namespace
+         * URI within the scope of this Element. 
+         *
+         * @param aNsPrefix:        The prefix used to search
+         * @param aCheckInParent:   The flag indicating whether to check parent's
+         *                          namespaces too if not found in the current 
+         *                          element. 
+         *                          ETrue to check, EFalse for not to check.
+        * @return the found Namespace that is declared for the given prefix and namespace
+        * URI within the scope of this Element or NULL if not found
+         */
+        virtual const CSenNamespace* Namespace( const TDesC8& aNsPrefix,
+                                                const TBool aCheckInParent) = 0;
+
+        /**
+         *  Getter for namespace prefix of this element.
+         *  @return namespace prefix or KNullDesC8 if not set.
+         */
+        virtual const TDesC8& NsPrefix() const = 0;
+
+        /**
+         *  Setter for namespace prefix of this element.
+         *  @param aPrefix: new namespace prefix for the element.
+         */
+        virtual void SetPrefixL(const TDesC8& aPrefix) = 0;
+        
+        /**
+         *  Method for checking if the element has any content within.
+         *  @return ETrue if has content, EFalse if not.
+         */
+        virtual TBool HasContent() const = 0;
+
+        /**
+         *  Getter for the content of the element.
+         *  @return the content or KNullDesC8 if empty.
+         */
+        virtual TPtrC8 Content() const = 0;
+
+        /**
+         *  Getter for the content of the element, unicode version.
+         *  @return content as unicode. Ownership IS TRANSFERRED to the caller.
+         */
+        virtual HBufC* ContentUnicodeL() const = 0;
+
+        /**
+         *  Sets the content to the element. Old content is overwritten.
+         *  @param  aContent:   The content to be set. Can be KNullDesC8.
+         *  @return The content of the element or KNullDesC8 if no content was set.
+         */
+        virtual TPtrC8 SetContentL(const TDesC8& aContent) = 0;
+
+        /**
+         *  Gets the write stream for the content for easy appending.
+         *  Writing 8-bit (UTF-8) string to the returned stream will be appended
+         *  to the content.
+         *  @return reference to the RWriteStream.
+         */
+        virtual RWriteStream& ContentWriteStreamL() = 0;
+
+        /**
+         * Checks if element matches to another element by its content and 
+         * child elements. Element can contain more data than the given 
+         * pattern.
+         * @since Series60 3.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                      less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *          to given pattern. EFalse otherwise.
+         */
+        virtual TBool ConsistsOfL(MSenElement& aCandidate) = 0;
+        
+        /**
+         *  Getting the child elements of this element.
+         *  @return an array of child elements. This is an empty array if there
+         *          are no children. Any modifications made on the returned array
+         *          modify the element object.
+         */
+        virtual RPointerArray<CSenElement>& ElementsL() = 0;
+
+        /**
+         *  Gets a child element from a specified index.
+         *  @param  aIndex: the index what to get
+         *  @return child element from a current index. NULL if no child in given
+         *          index is found
+         */
+        virtual CSenElement* Child(TInt aIndex) = 0;
+
+        /**
+         *  Gets the value of the given attribute.
+         *  @param aName:   Name of the attribute in question.
+         *  @return the value of the attribute, or NULL if not found. Ownership is
+         *          NOT TRANSFERRED.
+         */
+        virtual const TDesC8* AttrValue(const TDesC8& aName) = 0;
+
+        /**
+         *  Adds an attribute. If attribute is already existing, 
+         *  the value of the attribute will be replaced.
+         * @param aName     Name of the attribute to be added.
+         * @param aValue    Value of the attribute to be added.
+         */
+        virtual void AddAttrL(const TDesC8& aName, const TDesC8& aValue) = 0;
+
+        /**
+         *  Gets all the attributes of this element in an array.
+         *  @return array of attributes. Array will be empty if element has 
+         *          no attributes.
+         */
+        virtual RPointerArray<CSenBaseAttribute>& AttributesL() = 0;
+
+        /**
+         *  Gets all the namespaces of this element in an array.
+         *  @return array of namespaces. Array will be empty if element has 
+         *          no namespaces.
+         */
+        virtual RPointerArray<CSenNamespace>& NamespacesL() = 0;
+
+        /**
+         *  Gets the parent element of this element.
+         *  @return the parent element or NULL if no parent set. 
+         *          Ownership is NOT transferred to the caller.
+         */
+        virtual CSenElement* Parent() = 0;
+
+        /**
+         *  Sets the parent element to this element. Notice that the element is not
+         *  automatically added as a child of the parent. Parent's 
+         *  AddElementL() should be called instead.
+         *  @param apParent:    The wanted parent. Can be NULL.
+         *  @return the parent element
+         */
+        virtual CSenElement* SetParent(CSenElement* apParent) = 0;
+
+        /**
+         * Detach the element from its parent.
+         * If the element, or one of its children, is dependent
+         * on a namespace declared in the scope of the parent
+         * copy those namespace declarations to this element.
+         * @return this Element. Ownership is NOT transferred to the caller.
+         *          Returns NULL if no parent was set, and nothing was detached.
+         */
+        virtual CSenElement* DetachL() = 0;
+
+        /**
+         *  Gets the root element. If no parent element, returns this element.
+         *  @return the root of the tree. Ownership is not transferred.
+         */
+        virtual MSenElement& Root() = 0;
+
+        /**
+         *  Gets the child element with the specified local name.
+         *  Assumes that namespace is the same as this parent element.
+         *  @return the child element or NULL if the child with the specified 
+         *          local name is not found. Ownership is NOT transferred.
+         */
+        virtual CSenElement* Element(const TDesC8& aLocalName) = 0;
+
+        /**
+         *  Gets the child element with the specified local name and namespace URI.
+         *  @return the child element or NULL if the child with the specified 
+         *          criterias is not found. Ownership is NOT transferred.
+         */
+        virtual CSenElement* Element(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName) = 0;
+
+        /**
+         * Create a new element ready for adding or insertion.
+         * If the given namespace prefix is not declared yet
+         * the element will not be created and NULL will be returned.
+         * @param aNsPrefix:    The namespace prefix
+         * @param aLocalName:   The new elements localname
+         * @return  the new Element just created, or NULL if given prefix was not
+         *          declared yet. Ownership is transferred to the caller.
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+         *      characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        virtual CSenElement* CreateElementL(const TDesC8& aNsPrefix,
+                                            const TDesC8& aLocalName) = 0;
+
+        /**
+         * Insert an Element into the list of children elements
+         * so that the inserted Element is placed right before the aBeforeElement.
+         * If aBeforeElement is not found, element will be appended to the last
+         * position.
+         * Function leaves if error occurs in inserting.
+         * @param aInsertedElement: the element to be inserted. 
+         *                          Ownership is transferred.
+         * @param aBeforeElement:   the element which will be right next to the 
+         *                          element just inserted.
+         * @return the inserted Element
+         */
+        virtual CSenElement& InsertElementL(CSenElement& aInsertedElement,
+                                            const CSenElement& aBeforeElement) = 0;
+
+        /**
+         * Adds an Element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aElement: the element to be added. Ownership is transferred.
+         * @return the added Element
+         */
+        virtual CSenElement& AddElementL(CSenElement& aElement) = 0;
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aNsUri:       namespace URI of the new element
+         * @param aLocalName:   local name of the new element
+         * @return the added Element
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName) = 0;
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aNsUri:       namespace URI of the new element
+         * @param aLocalName:   local name of the new element
+         * @param aQName:       qualified name of the new element
+         * @return the added Element
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+         *      characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName) = 0;
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * Note: Element is created with no specific namespace, default namespace
+         * of some of the upper level elements are in effect if there is such a 
+         * namespace.
+         * @param aLocalName:   local name of the new element
+         * @return the added Element
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        virtual CSenElement& AddElementL(const TDesC8& aLocalName) = 0;
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aElement:   the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */
+        virtual CSenElement* RemoveElement(CSenElement& aElement) = 0;
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aNsUri:     the namespace URI of the element to be removed.
+         *  @param  aLocalName: the local name of the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */
+        virtual CSenElement* RemoveElement( const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName) = 0;
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aLocalName: the local name of the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */
+        virtual CSenElement* RemoveElement(const TDesC8& aLocalName) = 0;
+
+        /**
+         *  Replaces an element from the childs with another element. 
+         *  Element's local name and namespace URI will be used to match the
+         *  element to be replaced. If matching element is not found, will
+         *  normally add the given element to the childs.
+         *  
+         *  @param  aElement:   the element to be added. Ownership is transferred.
+         *  @return The old element. May be NULL if nothing was replaced
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the old element.
+         */
+        virtual CSenElement* ReplaceElementL(CSenElement& aElement) = 0;
+
+        /**
+         *  Gets element as an UTF-8 form XML.
+         *  @return element as XML (in UTF-8 format). Caller takes ownership.
+         */
+        virtual HBufC8* AsXmlL() = 0;
+
+        /**
+        * Gets the element as XML fragment in Unicode UCS2 format.
+        * @since Series60 3.0
+        * @return the service description as XML, which ownership is
+        *         transferred to the caller.
+        */
+        virtual HBufC* AsXmlUnicodeL() = 0;
+
+        /**
+        * Writes this element as XML, in UTF-8 form to a stream
+        * @since Series60 3.0
+        * @param aWriteStream   to write into.
+        */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+         *  Element writes its namespaces to a write stream using UTF-8 charset 
+         *  encoding.
+         *
+         *  @param aWriteStream:    The stream to write to.
+         */
+        virtual void WriteNamespacesToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+         *  Gets the current element as XML element. Mostly used to get the
+         *  classes which implement this interface as an instance of this 
+         *  interface.
+         *  @return the current object as element. Ownership is NOT transferred.
+         */
+        virtual MSenElement* AsElement() = 0;
+
+        /**
+         *  Copies content from given element to this element appending to the 
+         *  existing content if there is any.
+         *  @param aSource: The source element.
+         */
+        virtual void CopyFromL(CSenElement& aSource) = 0;
+
+        /**
+         * (Re-) Set the name and namespace of this Element. The element will be
+         * given the localName in the the given namespace. A prefix will be
+         * computed from the qualified name.
+         *
+         * This method should be used with care and is mainly intended for
+         * protected use in implementations.
+         *
+         * @param aNamespaceURI:    The new namespace URI.
+         * @param aLocalName:       The new local name.
+         * @param aQName:           The new qualified name.
+         */
+        virtual void Set(const TDesC8& aNamespaceURI,
+                         const TDesC8& aLocalName,
+                         const TDesC8& aQName) = 0;
+
+        /**
+         *  Adds new attributes to the element.
+         *  @param  aAttrs: the array of attributes.
+         */
+        virtual void AddAttributesL(const RAttributeArray& aAttrs) = 0;
+
+};
+
+#endif // M_SEN_ELEMENT_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/MSenFragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,269 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This abstract class defines the interface for WSF XML
+*                fragment classes.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef M_SEN_FRAGMENT_H
+#define M_SEN_FRAGMENT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <xml/attribute.h>
+#include <SenXmlReader.h>
+#include <MSenElement.h>
+
+// FORWARD DECLARATIONS
+class CSenElement;
+
+using namespace Xml;
+
+
+// CLASS DECLARATION
+
+/**
+*  This abstract class defines the interface for XML fragment classes.
+*  The subclasses are used to extract certain part of XML document into
+*  a separate XML subtree, called fragment. This M-class is typically used
+*  when a safe reference to some actual implementation is required.
+*  Fragment classes are content handlers for SAX callback events received
+*  from CSenXmlReader class. They typically inherit MSenContentHandlerClient
+*  to achive this.
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class MSenFragment
+    {
+    public: // New functions
+        /**
+         *  Getting the fragment as an XML element. This method will panic if 
+         *  element has not been initialized (EFragmentElementNotInitialized).
+         *  @since Series60 3.0
+         *  @return the current object as element. Ownership is not transferred.
+         */
+        virtual CSenElement& AsElement() = 0;
+
+        /**
+         *  Method extracts the root element (whole data) from this fragment.
+         *  After calling this method, the fragment does not have any
+         *  internal element. Method is often called before fragment is
+         *  destroyed, in order to fetch its content and transfer ownership
+         *  to that content to some other object.
+         *  @since Series60 3.0
+         *  @return the current object as element. May return NULL.
+         *          Ownership is transferred to the caller.
+         */
+        virtual CSenElement* ExtractElement() = 0;
+
+        /**
+         *  Sets the XML reader to be used for parsing for the fragment.
+         *  @since Series60 3.0
+         *  @param aReader:     the reader to be used. 
+         *                      Ownership is NOT transferred.
+         */
+        virtual void SetReader(CSenXmlReader& aReader) = 0;
+
+        /**
+         *  Gets the XML reader which this fragment uses for parsing.
+         *  @since Series60 3.0
+         *  @param aReader:     the reader to be used. 
+         *                      Ownerships is not transferred.
+         *                      May return NULL.
+         */
+        virtual CSenXmlReader* Reader() = 0;
+
+        /**
+         *  Method to invoke parsing of a UTF-8 form XML data.
+         *  Note that SetReader() must be called before this 
+         *  method can be used.
+         *  Parsing is dependent of preset localname or qualifiedname
+         *  and possible namespace for this fragment.
+         *  @since Series60 3.0
+         *  @param aBuf:    The XML to be parsed.
+         */
+        virtual void ParseL(const TDesC8& aBuf) = 0;
+
+        /**
+         *  Same as ParseL() except that it doesn't leave in case of an error. 
+         *  Instead errors are trapped and error is returned.
+         *  SetReader() must be called before this method can be used.
+         *  @since Series60 3.0
+         *  @param aBuf:    The XML to be parsed.
+         *  @return KErrNone or other system-wide Symbian error codes
+         */
+        virtual TInt BuildFrom(const TDesC8& aBuf) = 0;
+
+        /**
+         *  Let the delegate MSenFragment handle the following SAX events.
+         *  This fragment is made the owner of the delegate and the delegate
+         *  is expected to make this MSenFragment the receiver of SAX events
+         *  once it has seen the end element for itself. This is achieved by
+         *  ResumeParsingFromL(), which delegate will call from his parent.
+         *  The currently set XML reader is used to parse XML for the delagate,
+         *  too.
+         *  @since Series60 3.0
+         *  @param aDelegate:   the fragment to start handling the SAX events.
+         */
+        virtual void DelegateParsingL(MSenFragment& aDelegate) = 0;
+
+        /**
+         *  Creates a new delegate (fragment) using the given arguments
+         *  and lets it handle the SAX events according
+         *  to given localname (or qualifiedname) and possible namespace.
+         *  This instance is made the owner of the delegate and the delegate 
+         *  is expected to resume parsing to this MSenFragment after it has
+         *  finished handling the dedicated part of XML document in question.
+         *  at the EndElementL().
+         *  The currently set XML reader is used to parse XML for the delagate,
+         *  too.
+         *  @since Series60 3.0
+         *  @param aNsUri:      the namespace URI of the new delegate
+         *  @param aLocalName:  the local name of the new delegate
+         *  @param aQName:      the qualified name of the new delegate
+         *  @param aAttrs:      the attributes which to be set for the new delegate
+         */
+        virtual void DelegateParsingL(  const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) = 0;
+
+        /**
+         *  Method sets the reader for this fragment and sets this to be the 
+         *  content handler for the SAX events according to preset localname
+         *  (or qualifiedname) and possible namespace.
+         *  @since Series60 3.0
+         *  @param aReader: Reader to be used.
+         */
+        virtual void ParseWithL(CSenXmlReader& aReader) = 0;
+
+        /**
+         *  Sets a new owner (parent) for this fragment.
+         *  @since Series60 3.0
+         *  @param aFragment:   the new parent.
+         */
+        virtual void SetOwner(MSenFragment& aFragment) = 0;
+
+        /**
+         *  Resumes the parsing. Usually called by some delegate 
+         *  fragment which was parsing itself through DelegateParsingL()
+         *  call from this instance.
+         *  @since Series60 3.0
+         *  @param aNsUri       The namespace URI of the current element
+         *  @param aLocalName   The local name of the current element
+         *  @param aQName       The qualified name of the current element
+         */
+        virtual void ResumeParsingFromL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName) = 0;
+
+        /**
+         *  Sets the attributes for the fragment.
+         *  @since Series60 3.0
+         *  @param aAttrs:  the array of attributes.
+         */
+        virtual void SetAttributesL(const RAttributeArray& aAttrs) = 0;
+
+        /**
+         *  Writes the start element tag to the content stream. 
+         *  Subclasses typically override this.
+         *  @since Series60 3.0
+         *  @param aNsUri       The namespace URI of the current element
+         *  @param aLocalName   The local name of the current element
+         *  @param aQName       The qualified name of the current element
+         *  @param aAttrs:  the array of attributes.
+         */
+        virtual void WriteStartElementL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) = 0;
+
+        /**
+         *  Writes the end element tag to the content stream. 
+         *  Subclasses typically override this
+         *  @since Series60 3.0
+         *  @param aNsUri       The namespace URI of the current element
+         *  @param aLocalName   The local name of the current element
+         *  @param aQName       The qualified name of the current element
+         */
+        virtual void WriteEndElementL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName) = 0;
+
+        /**
+        *   Getter for fragment XML local name.
+        *   @since Series60 3.0
+        *   @return localname or KNullDesC8 if not set.
+        */
+        virtual const TDesC8& LocalName() const = 0;
+        
+        /**
+        *   Getter for fragment XML namespace URI.
+        *   @since Series60 3.0
+        *   @return namespace URI or KNullDesC8 if not set.
+        */
+        virtual const TDesC8& NsUri() const = 0;
+
+        /**
+         *  Getter for XML namespace prefix of this fragment.
+         *  @since Series60 3.0
+         *  @return namespace prefix or KNullDesC8 if not set.
+         */
+        virtual const TDesC8& NsPrefix() const = 0;
+
+        /**
+         *  Fragment writes itself to a write stream using UTF-8 encoding.
+         *  @since Series60 3.0
+         *  @param aWriteStream:    The stream to write to.
+         */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+         *  Gets the fragment as Unicode (UCS-2) form XML. 
+         *  @since Series60 3.0
+         *  @return fragment as XML. Caller takes ownership.
+         */
+        virtual HBufC* AsXmlUnicodeL() = 0;
+
+        /**
+         *  Gets the fragment as a UTF-8 form XML.
+         *  @since Series60 3.0
+         *  @return fragment as XML. Caller takes ownership.
+         */
+        virtual HBufC8* AsXmlL() = 0;
+
+        /**
+         * Checks if fragment matches to another fragment by its content and 
+         * child elements. Fragment can contain more data than the given 
+         * candidate.
+         * @since Series60 3.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                      less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *          to given pattern. EFalse otherwise.
+         */
+        virtual TBool ConsistsOfL(MSenFragment& aCandidate) = 0;
+    };
+
+#endif // M_SEN_FRAGMENT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenBaseAttribute.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class offers basic implementation of an XML attribute
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_BASE_ATTRIBUTE_H
+#define SEN_BASE_ATTRIBUTE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+
+// CLASS DECLARATION
+
+/**
+*  Class offers basic implementation of an XML attribute
+*  XML attribute is a name-value pair type value object,
+*  which may or may not have a namespace prefix. Note 
+*  that both name and value may contain a namespace prefix.
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class CSenBaseAttribute : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+         *  Basic two-phased constructor.
+         *  @since Series60 3.0
+         *  @param aName:   Name of the attribute
+         *  @param aValue:  Attribute's value.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aName contains illegal characters.      
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenBaseAttribute* NewL(const TDesC8& aName,
+                                                const TDesC8& aValue);
+
+        /**
+         *  Basic constructor.
+         *  @since Series60 3.0
+         *  @param aQName:  Qualified name of the attribute
+         *  @param aName:   Name of the attribute
+         *  @param aValue:  Attribute's value.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aName or aQName contain 
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenBaseAttribute* NewL(const TDesC8& aQName,
+                                                const TDesC8& aName,
+                                                const TDesC8& aValue);
+            
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenBaseAttribute();
+        
+        // New functions
+        
+        /**
+         * Getter for the attribute name.
+         * @since Series60 3.0
+         * @return the attribute name.
+         */
+        virtual const TDesC8& Name() const;
+
+        /**
+         * Getter for the attribute value.
+         * @since Series60 3.0
+         * @return the attribute value.
+         */
+        virtual const TDesC8& Value() const;
+        
+        /**
+         * Setter for the attribute value.
+         * @since Series60 3.0
+         * @param aValue:   value to be set
+         * @return the new value.
+         */
+        virtual const TDesC8& SetValueL(const TDesC8& aValue);
+    
+    protected:  
+    
+        /**
+        * C++ default constructor
+        * @since Series60 3.0
+        */
+        IMPORT_C CSenBaseAttribute();
+    
+        /**
+         * Following BaseConstructL methods should be called from the deriving
+         * classes ConstructL() methods. Parameter info is found in the
+         * corresponding NewL-methods.
+         * @since Series60 3.0
+         * @param aName is the name of this attribute. Cannot contain characters
+         *        that are illegal in XML (like basic entities in decoded form)
+         * @param aValue is the value of this attribute. Cannot contain characters
+         *        that are illegal in XML (like basic entities in decoded form)
+         */
+        IMPORT_C void BaseConstructL(const TDesC8& aName,
+                                    const TDesC8& aValue);
+
+        /**
+        * @since Series60 3.0
+        * @param aName is the name of this attribute. Cannot contain characters
+        *        that are illegal in XML (like basic entities in decoded form)
+        * @param aQName is the qualified, prefixed name of this XML attribute.
+        *        Cannot contain characters which are illegal in XML.
+        * @param aValue is the value of this attribute. Cannot contain characters
+        *        that are illegal in XML (like basic entities in decoded form)
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aName,
+                                     const TDesC8& aQName,
+                                     const TDesC8& aValue);
+        
+    private:    // Data
+        HBufC8* ipName;
+        HBufC8* ipValue;
+    };
+
+#endif // SEN_BASE_ATTRIBUTE_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenBaseElement.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,731 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Implementation of an XML element functionality
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_BASE_ELEMENT_H
+#define SEN_BASE_ELEMENT_H
+
+//  INCLUDES
+#include <s32mem.h>
+#include <SenElement.h>
+#include <SenNameSpace.h>
+#include <SenBaseAttribute.h>
+
+// CLASS DECLARATION
+
+/**
+*  Implementation of an XML element functionality
+*  Content is stored in UTF-8 form XML. Note, that
+*  setting any 8-bit content into XML without encoding
+*  it into form of legal is illegal. Instead, one
+*  should use encoding methods, like ones introduced 
+*  in SenXmlUtils class to encode basic entities, or
+*  use use some other encoding like MD5 for binary 
+*  data content.
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class CSenBaseElement : public CSenElement
+    {
+    public:  // Constructors and destructor
+
+        /**
+         *  Standard constructor.
+         *  @param aLocalName   the local name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+
+        IMPORT_C static CSenBaseElement* NewL(const TDesC8& aLocalName);
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        IMPORT_C static CSenBaseElement* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenBaseElement* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  @param apAttrs      the attributes for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenBaseElement* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& apAttrs);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  @param apAttrs      the attributes for this element.
+         *  @param aParent: the parent element for the new element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenBaseElement* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& apAttrs,
+                                              CSenElement& aParent);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenBaseElement();
+
+        // New functions
+    
+        /**
+         * Adds attributes to the element. Calls internally AddAttributesL()
+         * Can be overridden to replace old attributes.
+         * @param   aAttrs: the array of attributes.
+         */
+        IMPORT_C virtual void SetAttributesL(const RAttributeArray& apAttrs);
+    
+        // Functions from base classes
+    
+        // From CSenElement
+    
+        /**
+        *   Getter for Element's local name.
+        *   @return Localname or KNullDesC if not set.
+        */  
+        IMPORT_C virtual const TDesC8& LocalName() const;
+
+        /**
+        *   Getter for Element's namespace URI.
+        *   @return Namespace URI or KNullDesC if not set.
+        */
+        IMPORT_C virtual const TDesC8& NamespaceURI() const;
+
+        /**
+         *  Getter for namespace prefix of this element.
+         *  @return namespace prefix or KNullDesC if not set.
+         */
+        IMPORT_C virtual const TDesC8& NsPrefix() const;
+
+        /**
+         *  Setter for namespace prefix of this element.
+         *  @param aPrefix: new namespace prefix for the element.
+         */
+        IMPORT_C virtual void SetPrefixL(const TDesC8& aPrefix);
+
+        /**
+         *  Method for checking if the element has any content within.
+         *  @return ETrue if has content, EFalse if not.
+         */
+        IMPORT_C virtual TBool HasContent() const;
+
+        /**
+         *  Getter for the content of the element.
+         *  @return the content or KNullDesC if empty.
+         */
+        IMPORT_C virtual TPtrC8 Content() const;
+
+        /**
+         *  Getter for the content of the element, unicode version.
+         *  @return content as unicode. Ownership IS TRANSFERRED to the caller.
+         */
+        IMPORT_C virtual HBufC* ContentUnicodeL() const;
+
+        /**
+         *  Sets the content to the element. Old content is overwritten.
+         *  @param  aContent:   The content to be set. Can be KNullDesC8.
+         *  @return The content of the element or KNullDesC8 if no content was set.
+         */
+        IMPORT_C virtual TPtrC8 SetContentL(const TDesC8& aContent);
+
+        /**
+         *  Gets the write stream for the content for easy appending.
+         *  Writing 8-bit (UTF-8) string to the returned stream will be appended
+         *  to the content.
+         *  @return reference to the RWriteStream.
+         */
+        IMPORT_C virtual RWriteStream& ContentWriteStreamL();
+
+        /**
+         * Checks if element matches to another element
+         * by its content and child elements. Element
+         * can contain more data than the given pattern.
+         * @since Series60 3.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                  less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *          to given pattern. EFalse otherwise.
+         */
+        IMPORT_C virtual TBool ConsistsOfL(MSenElement& aCandidate);
+
+        /**
+        *   Setter for Element's namespace URI.
+        *   @param aNsUri:  Namespace URI
+         */
+        IMPORT_C virtual void SetNamespaceL(const TDesC8& aNsUri);
+
+        /**
+        *   Setter for Element's namespace URI.
+        *   @param aNsPrefix:   Namespace prefix
+        *   @param aNsUri:      Namespace URI
+         */
+        IMPORT_C virtual void SetNamespaceL(const TDesC8& aNsPrefix,
+                                            const TDesC8& aNsUri);
+
+        /**
+         * Adds a namespace declaration.
+         * If this element (or its parent if parameter aCheckInParent is ETrue) 
+         * already has a Namespace with the same prefix and URI the given
+         * Namespace is not added.
+         * @param aNewNamespace
+         * @param aCheckInParent
+         * @return the added Namespace, or the equivalent pre-existing one.
+         */ 
+        IMPORT_C virtual const CSenNamespace* AddNamespaceL(
+                                            CSenNamespace& aNewNamespace,
+                                            TBool aCheckInParent);
+        /**
+        *   Method for adding a namespace for the Element.
+        *   @param aPrefix: Namespace prefix
+        *   @param aUri:    Namespace URI
+        *   @return the added Namespace, or the equivalent pre-existing one.
+         */
+        IMPORT_C virtual const CSenNamespace* AddNamespaceL(const TDesC8& aPrefix,
+                                                            const TDesC8& aUri);
+        /**
+        *   Getter for Element's namespace.
+        *   @return const pointer to the CSenNamespace object of this Element.
+        *           NULL if not set.
+         */ 
+        IMPORT_C virtual const CSenNamespace* Namespace();
+
+        /**
+         * @param prefix
+         * @return the found Namespace that is declared for the given prefix
+         * within the scope of this Element. If no such prefix is
+         * declared return null.
+         */     
+        IMPORT_C virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix);
+
+        /**
+         * @param aNsPrefix:        The prefix used to search
+         * @param aCheckInParent:   The flag indicating whether to check parent's
+         *                          namespaces too if not found in the current 
+         *                          element. 
+         *                          ETrue to check, EFalse for not to check.
+         * @return the found Namespace that is declared for the given prefix 
+         *                   and namespace URI within the scope of this Element
+         *                   or NULL if not found
+         */ 
+        IMPORT_C virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix,
+                                                        const TBool aCheckInParent);
+
+        /**
+         * @param aNsPrefix:    The prefix used to search
+         * @param aUri:         The namespace URI used to search.
+         * @return the found Namespace that is declared for the given prefix 
+         *                   and namespace URI within the scope of this Element
+         *                   or NULL if not found.
+         */     
+        IMPORT_C virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix,
+                                                        const TDesC8& aUri);
+
+        /**
+         *  Getting the child elements of this element matching the given criteria.
+         *  @param aElementArray:   Array to be filled with the matching elements,
+         *                          or empty array if no matching found. 
+         *                          Any modifications made on the returned items
+         *                          modify the real childs too.
+         *  @param aNsUri:          namespace URI to be matched
+         *  @param aLocalName:      local name to be matched
+         *  @return KErrNone        ok
+         *          KErrNotFound    No child elements exist.
+         */     
+        IMPORT_C virtual TInt ElementsL(RPointerArray<CSenElement>& aElementArray,
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName);
+        
+        /**
+         *  Getting the child elements of this element matching the given criteria.
+         *  @param aElementArray:   Array to be filled with the matching elements,
+         *                          or empty array if no matching found. 
+         *                          Any modifications made on the returned items
+         *                          modify the real childs too.
+         *  @param aNsUri:          namespace URI to be matched
+         *  @param aLocalName:      local name to be matched
+         *  @return KErrNone        ok
+         *          KErrNotFound    No child elements exist.
+         */     
+        IMPORT_C virtual TInt ElementsL(RPointerArray<CSenElement>& aElementArray,
+                                        const TDesC8& aLocalName);
+
+        /**
+         *  Getting the child elements of this element.
+         *  @return an array of child elements. This is an empty array if there
+         *          are no children. Any modifications made on the returned array
+         *          modify the element object.
+         */     
+        IMPORT_C virtual RPointerArray<CSenElement>& ElementsL();
+
+        /**
+         *  Gets all the attributes of this element in an array.
+         *  @return array of attributes. Array will be empty if element has 
+         *          no attributes.
+         */     
+        IMPORT_C virtual RPointerArray<CSenBaseAttribute>& AttributesL();
+
+        /**
+         *  Gets all the namespaces of this element in an array.
+         *  @return array of namespaces. Array will be empty if element has 
+         *          no namespaces.
+         */     
+        IMPORT_C virtual RPointerArray<CSenNamespace>& NamespacesL();
+
+        /**
+         *  Gets the value of the given attribute.
+         *  @param aName:   Name of the attribute in question.
+         *  @return the value of the attribute, or NULL if not found. Ownership is
+         *          NOT TRANSFERRED.
+         */     
+        IMPORT_C virtual const TDesC8* AttrValue(const TDesC8& aName);
+        
+        /**
+         *  Adds an attribute. If attribute is already existing, 
+         *  the value of the attribute will be replaced.
+         */
+        IMPORT_C virtual void AddAttrL(const TDesC8& aName, const TDesC8& aValue);
+
+        /**
+         *  Gets the parent element of this element.
+         *  @return the parent element or NULL if no parent set. 
+         *          Ownership is NOT transferred to the caller.
+         */     
+        IMPORT_C virtual CSenElement* Parent();
+
+        /**
+         *  Sets the parent element to this element. Notice that the element is not
+         *  automatically added as a child of the parent. Parent's 
+         *  AddElementL() should be called instead.
+         *  @param apParent:    The wanted parent. Can be NULL.
+         *  @return the parent element
+         */ 
+        IMPORT_C virtual CSenElement* SetParent(CSenElement* apParent);
+
+        /**
+         *  Gets the root element. If no parent element, returns this element.
+         *  @return the root of the tree. Ownership is NOT transferred.
+         */     
+        IMPORT_C virtual MSenElement& Root();
+
+        /**
+         *  Gets the child element with the specified local name.
+         *  Assumes that namespace is the same as this parent element.
+         *  @return the child element or NULL if the child with the specified 
+         *          local name is not found. Ownership is NOT transferred.
+         */ 
+        IMPORT_C virtual CSenElement* Element(const TDesC8& aLocalName);
+
+        /**
+         *  Gets the child element with the specified local name and namespace URI.
+         *  @return the child element or NULL if the child with the specified 
+         *          criterias is not found. Ownership is NOT transferred.
+         */ 
+        IMPORT_C virtual CSenElement* Element(  const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName);
+
+        /**
+         * Create a new element ready for adding or insertion.
+         * If the given namespace prefix is not declared yet
+         * the element will not be created and NULL will be returned.
+         * @param aNsPrefix:    The namespace prefix
+         * @param aLocalName:   The new elements localname
+         * @return  the new Element just created, or NULL if given prefix was not
+         *          declared yet. Ownership is transferred to the caller.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */     
+        IMPORT_C virtual CSenElement* CreateElementL(const TDesC8& aNsPrefix,
+                                                     const TDesC8& aLocalName);
+
+        /**
+         * Insert an Element into the list of children elements
+         * so that the inserted Element is placed right before the aBeforeElement.
+         * If aBeforeElement is not found, element will be appended to the last
+         * position.
+         * Function leaves if error occurs in inserting.
+         * @param aInsertedElement: the element to be inserted. 
+         *                          Ownership is transferred.
+         * @param aBeforeElement:   the element which will be right next to the 
+         *                          element just inserted.
+         * @return the inserted Element
+         */     
+        IMPORT_C virtual CSenElement& InsertElementL(CSenElement& aElement,
+                                                     const CSenElement& aBeforeElement);
+
+        /**
+         * Adds an Element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aElement: the element to be added. Ownership is transferred.
+         * @return the added Element
+         */ 
+        IMPORT_C virtual CSenElement& AddElementL(CSenElement& aElement);
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aNsUri:       namespace URI of the new element
+         * @param aLocalName:   local name of the new element
+         * @return the added Element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */     
+        IMPORT_C virtual CSenElement& AddElementL(  const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName);
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aNsUri:       namespace URI of the new element
+         * @param aLocalName:   local name of the new element
+         * @param aQName:       qualified name of the new element
+         * @return the added Element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+         *      characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */ 
+        IMPORT_C virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aQName);
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * Note: Element is created with no specific namespace, default namespace
+         * of some of the upper level elements are in effect if there is such a 
+         * namespace.
+         * @param aLocalName:   local name of the new element
+         * @return the added Element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */     
+        IMPORT_C virtual CSenElement& AddElementL(const TDesC8& aLocalName);
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aElement:   the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */     
+        IMPORT_C virtual CSenElement* RemoveElement(CSenElement& aElement);
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aNsUri:     the namespace URI of the element to be removed.
+         *  @param  aLocalName: the local name of the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */     
+        IMPORT_C virtual CSenElement* RemoveElement(const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName);
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aLocalName: the local name of the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */     
+        IMPORT_C virtual CSenElement* RemoveElement(const TDesC8& aLocalName);
+
+        /**
+         *  Replaces an element from the childs with another element. 
+         *  Element's local name and namespace URI will be used to match the
+         *  element to be replaced. If matching element is not found, will
+         *  normally add the given element to the childs.
+         *  @param  aElement:   the element to be added. Ownership is transferred.
+         *  @return The old element. May be NULL if nothing was replaced
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the old element.
+         */ 
+        IMPORT_C virtual CSenElement* ReplaceElementL(CSenElement& aElement);
+
+        /**
+         *  Gets the element as an XML buffer. Buffer will contain all the childs
+         *  @return element as XML. Caller takes ownership.
+         */ 
+        IMPORT_C virtual HBufC8* AsXmlL();
+
+        /**
+         *  Gets the element as an unicode XML buffer. 
+         *  Buffer will contain all the childs etc.
+         *  @return element as XML. Caller takes ownership.
+         */     
+        IMPORT_C virtual HBufC* AsXmlUnicodeL();
+
+        /**
+         *  Element writes itself to a write stream using UTF-8 charset encoding.
+         *  @param aWriteStream:    The stream to write to.
+         */     
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+
+        /**
+         *  Element writes its namespaces to a write stream using UTF-8 charset 
+         *  encoding.
+         *  @param aWriteStream:    The stream to write to.
+         */     
+        IMPORT_C virtual void WriteNamespacesToL(RWriteStream& aWriteStream);
+
+        /**
+         *  Gets the current element as XML element. Mostly used to get the
+         *  classes which implement this interface as an instance of this 
+         *  interface.
+         *  @return the current object as element. Ownership is NOT transferred.
+         */     
+        IMPORT_C virtual MSenElement* AsElement();
+
+        /**
+         *  Copies content from given element to this element appending to the 
+         *  existing content if there is any.
+         *  @param aSource: The source element.
+         */ 
+        IMPORT_C void CopyFromL(CSenElement& aSource);
+
+        /**
+         * Detach the element from its parent.
+         * If the element, or one of its children, is dependent
+         * on a namespace declared in the scope of the parent
+         * copy those namespace declarations to this element.
+         * @return this Element. Ownership IS TRANSFERRED to the caller.
+         */ 
+        IMPORT_C virtual CSenElement* DetachL();
+
+        /**
+         *  Gets a child element from a specified index.
+         *  @param  aIndex: the index what to get
+         *  @return child element from a current index. NULL if no child in given
+         *          index is found
+         */ 
+        IMPORT_C virtual CSenElement* Child(TInt aIndex);
+
+        /**
+         * (Re-) Set the name and namespace of this Element. The element will be
+         * given the localName in the the given namespace. A prefix will be
+         * computed from the qualified name.
+         * This method should be used with care and is mainly intended for
+         * protected use in implementations.
+         * @param aNamespaceURI:    The new namespace URI.
+         * @param aLocalName:       The new local name.
+         * @param aQName:           The new qualified name.
+         */ 
+        IMPORT_C virtual void Set(const TDesC8& aNsUri, 
+                                  const TDesC8& aLocalName,
+                                    const TDesC8& aQName);
+
+        /**
+         *  Adds new attributes to the element.
+         *  @param  aAttrs: the array of attributes.
+         */ 
+        IMPORT_C virtual void AddAttributesL(const RAttributeArray& apAttrs);
+
+    protected:  
+    
+        /**
+         * C++ default constructor.
+         */
+        IMPORT_C CSenBaseElement();
+
+        /**
+         * Following BaseConstructL methods should be called from the deriving
+         * classes ConstructL() methods. Parameter info is found in the
+         * corresponding NewL-methods.
+         */
+        IMPORT_C void BaseConstructL(   const TDesC8& aLocalName);
+        
+        IMPORT_C void BaseConstructL(   const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName);
+        
+        IMPORT_C void BaseConstructL(   const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName);
+
+        IMPORT_C void BaseConstructL(   const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& apAttrs);
+
+        IMPORT_C void BaseConstructL(   const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& apAttrs,
+                                        CSenElement& aParent);
+    
+        // New functions
+        
+        /**
+         * Method for finding an attribute with given name.
+         * @param aName a name of the attribute to be searched for
+         * @return the 1st attribute with the name, or NULL. 
+         *              Ownership is not transferred.
+         */
+        IMPORT_C virtual CSenBaseAttribute* FindAttr(const TDesC8& aName);
+
+        /**
+         * Method for finding index for a wanted element.
+         * @param aNsUri        a namespace URI which needs to match
+         * @param aLocalName    a local name which needs to match
+         * @return Index of the element with given characteristics.
+         *          or KErrNotFound if none matching
+         */
+        IMPORT_C virtual TInt IndexOfElement(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName) const;
+        
+        /**
+         * Writes element's attributes into a writestream.
+         * @param aWriteStream  writestream to write into
+         */
+        IMPORT_C virtual void WriteAttrsToL(RWriteStream& aWriteStream);
+
+        /**
+         * Helper function to write an attribute into a writestream.
+         * @param aWriteStream  writestream to write into
+         * @param aName attribute name
+         * @param aValue    attribute value
+         */
+        IMPORT_C virtual void WriteAttrToL(RWriteStream& aWriteStream,
+                                           const TDesC8& aName,
+                                           const TDesC8& aValue);
+
+        /**
+         * Writes all internal elements into a writestream.
+         * @param aWriteStream  writestream to write into
+         */
+        IMPORT_C virtual void WriteElementsToL(RWriteStream& aWriteStream);
+
+        /**
+         * Writes all element's content into a writestream.
+         * @param aWriteStream  writestream to write into
+         */
+        IMPORT_C virtual void WriteContentToL(RWriteStream& aWriteStream);
+
+        /**
+        * Adds an attribute into this element. Used also adding new namespaces
+        * into the element.
+        * @param aQName     Attribute's qualified name
+        * @param aLocalName Attribute's local name
+        * @param aValue     Attribute's value
+        * @return value of the attribute as string (TDesC&)
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+        *       characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C virtual const TDesC8& AddAttributeL(const TDesC8& aQName,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aValue);
+
+        /**
+        * Adds an attribute into this element. Used also adding new namespaces
+        * into the element.
+        * @param aLocalName Attribute's local name
+        * @param aValue     Attribute's value
+        * @return value of the attribute as string (TDesC&)
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aAttrName is zero length, or
+        *       if the local name part of it is zero length.
+        */
+        IMPORT_C virtual const TDesC8& AddAttributeL(const TDesC8& aAttrName,
+                                                     const TDesC8& aValue);
+
+        /** 
+        * Adds an attribute into this element.
+        * @param apAttribute    Attribute to be added. Ownership is transferred
+        *                       to this element.
+        * @return attribute value as a string (TDesC8&)
+        */
+        IMPORT_C const TDesC8& AddAttributeL(CSenBaseAttribute* apAttribute);
+
+        /**
+        *   Allocates a new buffer for saving content, if none allocated yet.
+        */
+        IMPORT_C virtual void AllocContentBufL();
+        
+        /**
+        * Writes element into a dynamic buffer.
+        * @param aBuf   a dynamic buffer where to append everything.
+        * @return the modified buffer as TPtrC8.
+        */
+        IMPORT_C virtual TPtrC8 WriteToBufL(CBufBase& aBuf);
+
+    private: // New functions
+            
+        void AddNamespaceMissingFromL(RPointerArray<CSenNamespace>& aNamespaces);
+
+    private: // Data
+        HBufC8* ipLocalName; // Owned
+        HBufC8* iNotUsed;   // Not used (kept for binary compatibility)
+        CBufFlat* ipContentBuf; // Owned
+        RBufWriteStream iContentWriteStream;
+        RPointerArray<CSenBaseAttribute> iAttrs;    // Elements owned
+        RPointerArray<CSenElement> iElements;       // Elements owned
+        RPointerArray<CSenNamespace> iNamespaces;   // Elements owned
+        CSenElement*    ipParent;                   // Not owned
+        CSenNamespace*  ipNamespace;                // Not Owned (deleted in upper level array)
+    };
+
+#endif // SEN_BASE_ELEMENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenBaseFragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,651 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements basic functionality of an XML fragment
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_BASE_FRAGMENT_H
+#define SEN_BASE_FRAGMENT_H
+
+//  INCLUDES
+#include <MSenContentHandlerClient.h>
+#include <SenElement.h>
+#include <SenFragment.h>
+
+// CONSTANTS
+
+// Fragment's internal states.
+const TInt KStateNotSet = -1;
+const TInt KStateIgnore =  0;
+const TInt KStateSave   =  1;
+const TInt KStateResume =  2;
+
+// FORWARD DECLARATIONS
+class CSenXmlReader;
+
+// CLASS DECLARATION
+
+/**
+* Class implements basic functionality of an XML fragment
+* Typically BaseFragment is used to parse certain part of some XML document.
+* The element is identified by localname (or qualifiedname) and namespace.
+* All child elements between start tag and and end tag defined this fragment
+* will become content of this BaseFragment. In other words, BaseFragment has
+* all data inside a single element.
+* BaseFragment will parse only namespace (xmlns) attributes from a document
+* and rest of the attributes are to be handled by subclasses, which should
+* overwrite SetAttributesL() method to achieve this.
+* The CSenXmlReader class will do the actual parsing and this class will
+* act as content handler for XML parser SAX events.
+* @lib SenXML.dll
+* @since Series60 3.0
+*/
+class CSenBaseFragment : public CSenFragment, public MSenContentHandlerClient 
+    {
+    public:  // Constructors and destructor
+        
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 3.0
+         *  @param aElement is the element where construction 
+         *                  data will be copied from.
+         */
+        IMPORT_C static CSenBaseFragment* NewL(const CSenElement& aElement);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         *  @since Series60 3.0
+         *  @param aLocalName: is the XML localname for this fragment
+         */
+        IMPORT_C static CSenBaseFragment* NewL(const TDesC8& aLocalName);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         *  @since Series60 3.0
+         *  @param aNsUri:  XML namespace URI
+         *  @param aLocalName:  XML localname
+         */
+        IMPORT_C static CSenBaseFragment* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         *  @since Series60 3.0
+         *  @param aNsUri:  XML namespace URI
+         *  @param aLocalName:  XML localname
+         *  @param aQName:  XML qualifiedname
+         */
+        IMPORT_C static CSenBaseFragment* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aQName);
+
+        /**
+         * Standard 2 phase constructor.
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         * @since Series60 3.0
+         * @param aNsUri:   XML namespace URI
+         * @param aLocalName:   XML localname
+         * @param aQName:   XML qualifiedname
+         * @param apAttrs:  XML attributes
+         */
+         IMPORT_C static CSenBaseFragment* NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aQName,
+                                                const RAttributeArray& apAttrs);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParent  Element to be set as fragment's parent element.
+         *    Leave codes:  
+         *          KErrSenInvalidCharacters if aLocalName or aQName contains
+         *          illegal characters.     
+         *          KErrSenZeroLengthDescriptor if aLocalName or aQName is of
+         *      zero length.
+         *  @since Series60 3.0
+         *  @param aNsUri:  XML namespace URI
+         *  @param aLocalName:  XML localname
+         *  @param aQName:  XML qualifiedname
+         *  @param apAttrs: XML attributes
+         *  @param aParent: Parent element
+         */
+        IMPORT_C static CSenBaseFragment* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aQName,
+                                               const RAttributeArray& apAttrs,
+                                               CSenElement& aParent);
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C virtual ~CSenBaseFragment();
+
+
+        // New functions
+    
+        /**
+         * Getter for the content,which is returned as UTF-8 form XML.
+         * @since Series60 3.0
+         * @return content as UTF-8 form XML.
+         */
+        IMPORT_C virtual TPtrC8 Content();
+        /**
+         * Gets the namespace object with a given prefix.
+         * @since Series60 3.0
+         * @param   aPrefix:    prefix that wanted namespace should have.
+         * @return namespace with the given prefix. If not found or given prefix
+         * is zero length, will return NULL.
+         */
+        IMPORT_C virtual CSenNamespace* Namespace(const TDesC8& aPrefix);
+        
+        /**
+         * @since Series60 3.0
+         * @param aPrefix is the XML namespace prefix
+         */
+        IMPORT_C virtual void EnsureNamespace(const TDesC8& aPrefix);
+        
+        /**
+         * @since Series60 3.0
+         * @return Detaches this fragment from its owner. All namespace
+         * references from possible parent fragments are declared in
+         * the scope of this fragment prior detaching.
+         */
+        IMPORT_C virtual void DetachL();
+        
+        /**
+         * @since Series60 3.0
+         * @param aAttrs are the attributes from which the namespaces
+         *        are searched from.
+         * @param aEnsure if set to TRUE, the namespaces are copied into
+         *         this fragment. If FALSE, then the namespaces are only
+         *         referenced, but not copied and owned by this class.
+         */
+        IMPORT_C virtual void SaveNamespacesL(const RAttributeArray& aAttrs,
+                                              TBool aEnsure);
+
+        /**
+         * Resets the content of the fragment, and resets the namespaces.
+         * @since Series60 3.0
+         */
+        IMPORT_C virtual void ResetContentL();
+
+        // Functions from base classes
+
+        // From CSenFragment 
+        
+        /** 
+         * @since Series60 3.0
+         * @return the localname of this fragment as UTF-8 form descriptor
+         */
+        IMPORT_C virtual const TDesC8& LocalName() const;
+        
+        /**
+         * Getter for Fragment's namespace URI..
+         * @since Series60 3.0
+         * @return Namespace URI or KNullDesC if not set.
+         */
+        IMPORT_C virtual const TDesC8& NsUri() const;
+
+        /**
+         * Getter for namespace prefix of this fragment.
+         * @since Series60 3.0
+         * @return namespace prefix or KNullDesC if not set.
+         */
+        IMPORT_C virtual const TDesC8& NsPrefix() const;    
+
+        /**
+         * Getting the fragment as an XML element. This method will panic if 
+         * element has not been initialized for any reason.
+         * @since Series60 3.0
+         * @return the current object as element. Ownership is not transferred.
+         */
+        IMPORT_C virtual CSenElement& AsElement();
+
+        /**
+         * Etracts the XML element from the fragment, leaving the fragment empty.
+         * Note(!): the return value (CSenElement) STRONGLY suggests that
+         * subclasses INHERIT CSenFragment in order properly comply the
+         * requirement of the ExtractElement() implementation.
+         * @since Series60 3.0
+         * @return the current object as element. May return NULL.
+         * Ownership IS TRANSFERRED to the caller.
+         */
+        IMPORT_C virtual CSenElement* ExtractElement();
+        
+        /**
+         * Gets the XML reader which this fragment uses for parsing.
+         * @since Series60 3.0
+         * @return the XML reader. Ownerships is not transferred,
+         * due even this class does not own the XML reader instance.
+         */
+        IMPORT_C virtual CSenXmlReader* Reader();
+
+        /**
+         * Sets the XML reader to be used for parsing for the fragment.
+         * @since Series60 3.0
+         * @param aReader:      the reader to be used. 
+         *                      Ownership is NOT transferred.
+         */ 
+        IMPORT_C virtual void SetReader(CSenXmlReader& aReader);
+
+        /**
+         *  Leave codes:    
+         *  KErrSenXmlReaderNotSet  if XML reader has not been set.
+         *  Method to invoke parsing of a XML data.
+         *  Note that SetReader() must be called before this method can be used.
+         *  Note that CSenBaseFragment does not parse any other
+         *  attributes, but XML namespace attributes only. This
+         *  is due to allow subclasses to process only those attributes
+         *  they are interested in, and not others.
+         *  @since Series60 3.0
+         *  @param aXml:    The data to be parsed.
+         */ 
+        IMPORT_C virtual void ParseL(const TDesC8& aXml);
+
+        /**
+         * Same as ParseL() except that it doesn't leave in case of an error. 
+         * Instead errors are trapped and error is returned.
+         * SetReader() must be called before this method can be used.
+         * @since Series60 3.0
+         * @param aXml: The data to be parsed.
+         * @return KErrNone or other system-wide Symbian error codes.
+         */ 
+        IMPORT_C virtual TInt BuildFrom(const TDesC8& aXml);
+
+        /**
+         * Leave codes: 
+         * KErrSenXmlReaderNotSet   if XML reader has not been set.
+         * Let the delegate MSenFragment handle the following SAX events.
+         * This fragment is made the owner of the delegate and the delegate
+         * is expected to make this MSenFragment the receiver of SAX events
+         * once it has seen the end element for itself.
+         * @since Series60 3.0
+         * @param aDelegate is the fragment to start handling the SAX events.
+         */
+        IMPORT_C virtual void DelegateParsingL(MSenFragment& aDelegate);
+
+        /**
+         * Leave codes: 
+         * KErrSenXmlReaderNotSet   if XML reader has not been set.
+         * Creates a new fragment and lets the created MSenFragment handle the 
+         * following SAX events. This fragment is made the owner of the delegate
+         * and the delegate is expected to make this MSenFragment act as receiver
+         * for SAX events (callbacks) once it has seen the end element for itself.
+         * @since Series60 3.0
+         * @param aNsUri    The XML namespace URI for the delegate to be created
+         * @param aLocalName    The XML localname for the delegate to be created
+         * @param aQName    The XML qualifiedname for the delegate to be created
+         * @param aAttrs:   The XML attributes for the delegate to be created
+         */
+        IMPORT_C virtual void DelegateParsingL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aQName,
+                                               const RAttributeArray& aAttrs);
+        
+        /**
+         * Sets the reader for this fragment and sets this to be the 
+         * content handler of the following SAX events.
+         * @since Series60 3.0
+         * @param aReader is the XML parser to be used.
+         */ 
+        IMPORT_C virtual void ParseWithL(CSenXmlReader& aReader);
+
+        /**
+         * Sets a new parent for this fragment.
+         * @since Series60 3.0
+         * @param aFragment:    the new parent.
+         */
+        IMPORT_C virtual void SetOwner(MSenFragment& aFragment);
+
+        /**
+         * Leave codes: 
+         * KErrSenXmlReaderNotSet   if XML reader has not been set.  Resumes 
+         *     parsing to be handled by this fragment. Usually called by some
+         *     delegate fragment which was set to be content handler because this
+         *     fragment called DelegateParsingL().
+         * @since Series60 3.0
+         * @param aNsUri    The namespace URI of the current element
+         * @param aLocalName    The local name of the current element
+         * @param aQName    The qualified name of the current element
+         */ 
+        IMPORT_C virtual void ResumeParsingFromL(const TDesC8& aNsUri,
+                                                 const TDesC8& aLocalName,
+                                                 const TDesC8& aQName);
+
+        /**
+         * Sets the attributes for the fragment. BaseFragment parses only
+         * namespace (xmlns) attributes from the document.
+         * Subclasses should override this method if they are intrested
+         * of handling any other XML attributes and their corresponding
+         * values.
+         * @since Series60 3.0
+         * @param aAttrs:   the array of attributes.
+         */
+        IMPORT_C virtual void SetAttributesL(const RAttributeArray& aAttrs);
+        
+        /**
+         * Writes the start element tag to the content stream. 
+         * Derivants can override the basic usage used in BaseFragment.
+         * @since Series60 3.0
+         * @param aNsUri        The namespace URI of the current element
+         * @param aLocalName        The local name of the current element
+         * @param aQName        The qualified name of the current element
+         * @param aAttrs        is the array of attributes.
+         */
+        IMPORT_C void WriteStartElementL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttrs);
+        
+        /**
+         * Writes the end element tag to the content stream. 
+         * Derivants can override the basic usage used in BaseFragment.
+         * @since Series60 3.0
+         * @param aNsUri        The namespace URI of the current element
+         * @param aLocalName    The local name of the current element
+         * @param aQName        The qualified name of the current element
+         */
+        IMPORT_C void WriteEndElementL(const TDesC8& aNsUri,
+                                       const TDesC8& aLocalName,
+                                       const TDesC8& aQName);
+
+        /**
+         * Gets the fragment data as an unicode XML.
+         * @since Series60 3.0
+         * @return  fragment as XML. Caller takes ownership.
+         */ 
+        IMPORT_C virtual HBufC* AsXmlUnicodeL();
+
+        /**
+         * Gets the fragment data as an UTF-8 form XML.
+         * @since Series60 3.0
+         * @return  fragment as XML. Caller takes ownership.
+         */ 
+        IMPORT_C virtual HBufC8* AsXmlL();
+
+        /**
+         * Invokes AsElement()->WriteAsXMLToL(aWs);
+         * @since Series60 3.0
+         * @param aWs is the stream into which the UTF-8 form XML will
+         *            be written.
+         */
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWs);
+
+        /**
+         * Checks if fragment matches to another fragment 
+         * by its content and child elements. 
+         * Fragment can contain more data than the given candidate.
+         * @since Series60 3.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                      less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *               to given pattern. EFalse otherwise.
+         */
+        IMPORT_C virtual TBool ConsistsOfL(MSenFragment& aCandidate);
+
+    protected:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenBaseFragment();        
+        
+        /**
+         * Following BaseConstructL methods should be called from ConstructL() 
+         * methods of some deriving (fragment) class.
+         */
+
+        /**
+        * BaseConstructL, where an element is given as initializer.
+        * @since Series60 3.0
+        * @param aElement from which this fragment will be constructed from.
+        */
+        IMPORT_C void BaseConstructL(const CSenElement& aElement);
+        
+        /**
+        * BaseConstructL setting XML localname for this fragment.
+        * @since Series60 3.0
+        * @param aLocalName XML localname for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
+
+        /**
+        * BaseConstructL offering possibility to set XML namespace and localname.
+        * @since Series60 3.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName);
+
+        /**
+        * Base constructor
+        * @since Series60 3.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        * @param aQName XML qualifiedname for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName);
+        /**
+        * Base constructor
+        * @since Series60 3.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        * @param aQName XML qualifiedname for this fragment
+        * @param aAttrs XML attributes for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttrs);
+
+        /**
+        * Base constructor
+        * @since Series60 3.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        * @param aQName XML qualifiedname for this fragment
+        * @param aAttrs XML attributes for this fragment
+        * @param aParent parent to be set for this fragmemt
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttrs,
+                                     CSenElement& aParent);
+
+        /**
+        * BaseConstructL() setting the XML reader for this fragment
+        * @since Series60 3.0
+        * @param aReader is the XML reader for this fragment
+        */
+        IMPORT_C void BaseConstructL(CSenXmlReader& aReader);
+        
+        // New functions
+         
+        /**
+        * Makes the content internal stream for content saving available.
+        * @since Series60 3.0
+        */
+        IMPORT_C virtual void AllocContentSaverL();     
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.0
+         * @param aNsUri        The namespace URI of the new element
+         * @param aLocalName    The local name of the new element
+         * @param aQName        The qualified name of the new element
+         * @param aAttrs        The attributes of the new element
+         */
+        IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttrs);
+
+        /**
+        * Callback function which implement the XML content handler interface.
+        * Inheriting classes can override these.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName     The local name of the new element
+        * @param aQName     The qualified name of the new element
+        */
+        IMPORT_C virtual void EndElementL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName);
+
+        /**
+        * Function which implement the XML content handler interface.
+        * Inheriting classes can override these.
+        * This one is called when content is starting.
+        * @since Series60 3.0
+        * @param aChars     The content characters.
+        * @param aStart     The starting index
+        * @param aLength        The length of the characters.
+        */
+        IMPORT_C virtual void CharactersL(const TDesC8& aChars,
+                                          TInt aStart,
+                                          TInt aLength);
+
+        /**
+        *  Callback function which implement the XML content handler interface.
+        *  Inheriting classes can override these. Note that overrides should
+        *  return TRUE (1) on success and FALSE (0) on failure to parser.
+        *
+        *  @since Series60 3.0
+        *  @param aName     The entity name
+        *
+        */
+        IMPORT_C TInt StartEntity(TDesC8& aName);
+
+        /**
+         * Sets content to a child element. If no element with given local name
+         * is not found, new one is added and content is set to that one.
+         * @since Series60 3.0
+         * @param aLocalName    The local name of element which content
+         *                      is about to be set
+         * @param aContent      Content to be set.
+         * @return              the element where content was set.
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        IMPORT_C MSenElement& SetContentOfL(const TDesC8& aLocalName,
+                                            const TDesC8& aContent);
+        /**
+         * Gets the content of a given element.
+         * @since Series60 3.0
+         * @param aLocalName    The local name of the element which content is 
+         *                      asked
+         * @return  the content which was asked
+         */
+        IMPORT_C TPtrC8 ContentOf(const TDesC8& aLocalName);        
+
+    private: // New functions
+        
+        /**
+         * Leaving variant which is then trapped in the non-leaving function.
+         */
+        TPtrC8 ContentL();
+    
+        // Functions from base classes
+
+        // From MSenContentHandlerClient
+        
+        IMPORT_C virtual TInt StartDocument();
+        IMPORT_C virtual TInt EndDocument();
+        IMPORT_C virtual TInt StartElement(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& aAttrs);
+        
+        IMPORT_C virtual TInt EndElement(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName);
+
+        IMPORT_C virtual TInt Characters(const TDesC8& aChars,
+                                         const TInt aStart,
+                                         const TInt aLength);
+
+        IMPORT_C virtual TInt Error(TInt aErrorCode);
+
+        //IMPORT_C TInt StartEntityL(const TDesC8& aName);
+
+
+    protected: // Data
+
+        // State variable indicating what this fragment
+        // is currently parsing. Even states (like 0)
+        // mean that this fragment is ignoring the
+        // data, and odd states indicate, that fragment
+        // is storing the data into itself.
+        TInt iState;
+        // Owned element containing this XML fragment data.
+        CSenElement* ipElement;
+        // Pointer to XML parser. Not owned.
+        CSenXmlReader* iXmlReader;      
+        // Possible owner fragment, if such exists. Not owned.
+        MSenFragment* ipOwner;
+        // Internal write stream, into which UTF-8 form XML is stored
+        RWriteStream iWs;
+
+    private: // Data
+         
+        // Owned pointer to delegate fragment
+        CSenFragment* ipDelegate;
+        // Not owned. Holds namespaces that are referred to from 
+        // within the content but were not declared within this 
+        // BaseFragment.
+        RPointerArray<CSenNamespace> iNamespaces;
+        // Owned. Holds prefixes that have been declared within the 
+        // scope of this BaseFragment
+        RPointerArray<HBufC8> iPrefixes;
+        // Actual flat buffer to content which includes namespaces.
+        CBufFlat* ipContentWithNamespaces;
+        // Indicating that content writing stream is initialized.
+        TBool hasContentWriteStream;
+        // Indicates whether or not ipElement member is an owned
+        TBool iElementOwned;
+    };
+
+#endif //SEN_BASE_FRAGMENT_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenDomFragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,338 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements DOM fragment functionality
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_DOM_FRAGMENT_H
+#define SEN_DOM_FRAGMENT_H
+
+//  INCLUDES
+#include <SenBaseFragment.h>
+
+// FORWARD DECLARATIONS
+class RFileLogger;
+
+// CLASS DECLARATION
+
+/**
+* Class implements DOM fragment functionality
+* The implementation further extends CSenBaseFragment
+* functionality. In DOM fragment, all child elements
+* are parsed into separate element objects. This makes
+* it possible to reference any child which offer methods
+* declared in XML element interface. Any such element
+* can also be easily extracted (detached) from this
+* root DOM fragmet.
+* @lib SenXML.dll
+* @since Series60 3.0
+*/
+class CSenDomFragment : public CSenBaseFragment
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Basic contructor. Should be used only for parsing new fragments etc. 
+        * Constructing DomFragments for other use should be done with at least 
+        * localname parameter.
+        * @since Series60 3.0
+        */
+        IMPORT_C static CSenDomFragment* NewL();
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aElement Element to copy construction data from.
+        */
+        IMPORT_C static CSenDomFragment* NewL(
+            const CSenElement& aElement);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aLocalName is the XML localname of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        IMPORT_C static CSenDomFragment* NewL(const TDesC8& aLocalName);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace user of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace user of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aQName is the XML qualifiedname of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aQName is the qualifiedname of this fragment
+        * @param aAttrs are the XML attributes of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& aAttrs);
+
+        /**
+        * Basic constructor.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aQName is the qualifiedname of this fragment
+        * @param aAttrs are the XML attributes of this fragment
+        * @param aParent is the parent XML element of this fragment
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contains
+        *       illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static CSenDomFragment* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aQName,
+                                              const RAttributeArray& aAttrs,
+                                              CSenElement& aParent);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenDomFragment();
+
+        // New functions
+    
+        /**
+        * Initiates the parsing chain where new delegate will be created with
+        * given parameters and parsing will be delegated to it. Should not be
+        * called externally.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the new element
+        * @param aLocalName The local name of the new element
+        * @param aQName     The qualified name of the new element
+        * @param aAttrs     The attributes of the new element
+        */
+        IMPORT_C virtual void ExpandL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName,
+                                      const RAttributeArray& aAttrs);
+                                      
+        // Functions from base classes
+
+        // From CSenBaseFragment
+        
+        /**
+        * Resumes the parsing. Usually called by the delegate fragment which was
+        *                       parsing itself after DelegateParsingL().
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the current element
+        * @param aLocalName The local name of the current element
+        * @param aQName     The qualified name of the current element
+        */
+        IMPORT_C void ResumeParsingFromL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName);
+
+        /**
+        * Sets the reader for this fragment and sets this to be the 
+        * content handler of the following SAX events.
+        * @since Series60 3.0
+        * @param aReader:   Reader to be used.
+        */
+        IMPORT_C virtual void ParseWithL(CSenXmlReader& aReader);
+
+        /**
+        * Sets the attributes for the fragment.
+        * @since Series60 3.0
+        * @param aAttrs the array of attributes.
+        */
+        IMPORT_C virtual void SetAttributesL(const RAttributeArray& aAttrs);
+
+    protected:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenDomFragment();
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aElement is the XML element of this fragment.
+        */
+        IMPORT_C void BaseConstructL(const CSenElement& aElement);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aLocalName The local name of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aQName     The qualified name of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aQName     The qualified name of the element
+        * @param aAttrs     The attributes of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttrs);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aQName     The qualified name of the element
+        * @param aAttrs     The attributes of the element
+        * @param aParent    The parent of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& aAttrs,
+                                     CSenElement& aParent);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 3.0
+        * @param aReader is the XML reader for this fragment.
+        */
+        IMPORT_C void BaseConstructL(CSenXmlReader& aReader);
+        
+        // Functions from base classes
+        
+        /**
+         *  Callback functions which implement the XML content handler interface.
+         *  Inheriting classes can override these.
+         */
+         
+        // From CSenBaseFragment 
+        
+        /**
+        * @since Series60 3.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aQName     The qualified name of the element
+        * @param aAttrs     The attributes of the element
+        */
+        IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName,
+                                            const RAttributeArray& aAttrs);
+        
+        /**
+        * Callback functions which implement the XML content handler interface.
+        * This one is called when content is starting.
+        * @since Series60 3.0
+        * @param aChars     The content characters.
+        * @param aStart     The starting index
+        * @param aLength    The length of the characters.
+        */
+        IMPORT_C virtual void CharactersL(const TDesC8& aChars,TInt aStart,TInt aLength);
+
+        /**
+        * Overriding content writing from CSenBaseFragment to do nothing in
+        * DOM fragment (because the tree is expanded).
+        * @since Series60 3.0
+        * @param aNsUri     not used
+        * @param aLocalName not used
+        * @param aQName     not used
+        * @param aAttrs     not used
+        */
+        IMPORT_C void WriteStartElementL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttrs);
+
+        /**
+        * Overriding content writing from CSenBaseFragment to do nothing in
+        * DOM fragment (because the tree is expanded).
+        * @since Series60 3.0
+        * @param aNsUri     not used
+        * @param aLocalName not used
+        * @param aQName     not used
+        */
+        IMPORT_C void WriteEndElementL(const TDesC8& aNsUri,
+                                       const TDesC8& aLocalName,
+                                       const TDesC8& aQName);
+
+    protected: // Data
+        CSenDomFragment* ipDomDelegate;
+    };
+
+#endif //SEN_DOM_FRAGMENT_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenElement.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,559 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Central place for debug-type macros
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_ELEMENT_H
+#define SEN_ELEMENT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <xml/attribute.h>
+#include <stringpool.h>
+
+#include <MSenElement.h>
+
+using namespace Xml;
+
+// CLASS DECLARATION
+
+/**
+*  Abstract class definition of XML element
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class CSenElement : public CBase, public MSenElement
+    {
+    public: // Functions from base classes
+
+        // From MSenElement 
+        
+        /**
+        * Getter for local name.
+        * @since Series60 3.0
+        * @return KNullDesC if not set (argumentless constructor).
+        */
+        virtual const TDesC8& LocalName() const = 0;
+
+        /**
+        * Getter for namespace URI.
+        * @since Series60 3.0
+        * @return KNullDesC if not set.
+        */      
+        virtual const TDesC8& NamespaceURI() const = 0;
+
+        /**
+        * Setter for Element's namespace URI.
+        * @since Series60 3.0
+        * @param @param aNsUri: Namespace URI
+        */      
+        virtual void SetNamespaceL(const TDesC8& aNsUri) = 0;
+
+        /**
+        * Setter for Element's namespace URI.
+        * @since Series60 3.0
+        * @param aNsPrefix: Namespace prefix
+        * @param aNsUri:        Namespace URI
+        */      
+        virtual void SetNamespaceL( const TDesC8& aNsPrefix,
+                                    const TDesC8& aNsUri) = 0;
+
+        /**
+        * Method for adding a namespace for the Element.
+        * @since Series60 3.0
+        * @param aPrefix:   Namespace prefix
+        * @param aUri:  Namespace URI
+        * @return the added Namespace, or the equivalent pre-existing one.
+        */      
+        virtual const CSenNamespace* AddNamespaceL( const TDesC8& aPrefix,
+                                                    const TDesC8& aUri) = 0;
+
+        /**
+        * Getter for Element's namespace.
+        * @since Series60 3.0
+        * @return const pointer to the CSenNamespace object of this Element.
+        *         Returns NULL, if not set.
+        */      
+        virtual const CSenNamespace* Namespace() = 0;
+
+        /**
+        * @since Series60 3.0
+        * @param prefix
+        * @return the namespace that is declared for the given prefix
+        *         within the scope of this Element. If no such prefix is
+        *         declared return NULL.
+        */      
+        virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix) = 0;
+
+        /**
+        * Get namespace that is declared for the given prefix and namespace 
+        * URI within the scope of this element. 
+        * @since Series60 3.0
+        * @param aNsPrefix  The prefix used to search
+        * @param aUri           The namespace URI used to search.
+        * @return the found namespace that is declared for the given prefix 
+        *                   and namespace URI within the scope of this Element
+        *                   or NULL if not found.
+        */
+        virtual const CSenNamespace* Namespace( const TDesC8& aNsPrefix,
+                                                const TDesC8& aUri) = 0;
+
+        /**
+        * @since Series60 3.0
+        * @param aNsPrefix      The prefix used to search
+        * @param aCheckInParent The flag indicating whether to check parent's
+        *                       namespaces too if not found in the current 
+        *                       element. 
+        *                       ETrue to check, EFalse for not to check.
+        * @return the found Namespace that is declared for the given prefix 
+        *                   and namespace URI within the scope of this Element
+        *                   or NULL if not found
+        */
+        virtual const CSenNamespace* Namespace( const TDesC8& aNsPrefix,
+                                                const TBool aCheckInParent) = 0;
+
+        /**
+        * Getter for namespace prefix of this element.
+        * @since Series60 3.0
+        * @return namespace prefix or KNullDesC8 if not set.
+        */
+        virtual const TDesC8& NsPrefix() const = 0;
+
+        /**
+        * Setter for namespace prefix of this element.
+        * @since Series60 3.0
+        * @param aPrefix:   new namespace prefix for the element.
+        */
+        virtual void SetPrefixL(const TDesC8& aPrefix) = 0;
+
+        /**
+        * Method for checking if the element has any content within.
+        * @since Series60 3.0
+        * @return ETrue if has content, EFalse if not.
+        */
+        virtual TBool HasContent() const = 0;
+
+        /**
+        * Getter for the content of the element.
+        * @since Series60 3.0
+        * @return the content or KNullDesC8 if empty.
+        */
+        virtual TPtrC8 Content() const = 0;
+
+        /**
+        * Getter for the content of the element, Unicode (UCS2) version
+        * @since Series60 3.0
+        * @return content as Unicode. Ownership is transferred to the caller.
+        */
+        virtual HBufC* ContentUnicodeL() const = 0;
+        
+        /**
+        * Sets the content to the element. Old content is overwritten.
+        * @since Series60 3.0
+        * @param aContent   The content to be set. Can be KNullDesC8.
+        * @return The content of the element or KNullDesC8 if no content was set.
+        */
+        virtual TPtrC8 SetContentL(const TDesC8& aContent) = 0;
+
+        /**
+        * Gets the write stream for the content for easy appending.
+        * Writing 8-bit (UTF-8) string to the returned stream will be appended
+        * to the content.
+        * @since Series60 3.0
+        * @return reference to the RWriteStream.
+        */
+        virtual RWriteStream& ContentWriteStreamL() = 0;
+
+        /**
+         * Checks if element matches to another element
+         * by it's content and child elements. Element
+         * can contain more data than the given pattern.
+         * @since Series60 3.0
+         * @param   aCandidate The pattern to be matched. Must contain 
+         *          same or less data for match to come true.
+         * @return  ETrue if content and possible children match exactly 
+         *          to given pattern. EFalse otherwise.
+         */
+        virtual TBool ConsistsOfL(MSenElement& aCandidate) = 0;
+
+        /**
+        * Get a list of direct children element that have the given
+        * name and namespace.
+        * @since Series60 3.0
+        * @param    aElementArray RPointerArray that will hold matching elements
+        * @param    namespaceURI
+        * @param    localName
+        * @return   KErrNone or some system-wide error code, 
+        *           if an error has occurred.
+        */
+        virtual TInt ElementsL(RPointerArray<CSenElement>& aElementArray,
+                                const TDesC8& aNsUri,
+                                const TDesC8& aLocalName) = 0;
+
+        /**
+        * Get a list of direct children element that have the given
+        * name and same namespace as this parent Element.
+        * @since Series60 3.0
+        * @param    aElementArray RPointerArray that will hold matching elements
+        * @param    localName
+        * @return   KErrNone or some system-wide error code, 
+        *           if an error has occurred.
+        */
+        virtual TInt ElementsL(RPointerArray<CSenElement>& aElementArray,
+                                const TDesC8& aLocalName) = 0;
+
+        /**
+        * @since Series60 3.0
+        * @return an array of child elements. This is an empty array if there
+        * are no children. Any modifications made on the returned array modify
+        * the element object.
+        */
+        virtual RPointerArray<CSenElement>& ElementsL() = 0;
+        
+        /**
+        * Adds a namespace declaration.
+        * If this element (or its parent if parameter aCheckInParent is ETrue) 
+        * already has a namespace with the same prefix and URI the given
+        * namespace is not added.
+        * @since Series60 3.0
+        * @param aNewNamespace
+        * @param aCheckInParent
+        * @return the added Namespace, or the equivalent pre-existing one.
+        */
+        virtual const CSenNamespace* AddNamespaceL(CSenNamespace& aNewNamespace,
+                                                    TBool aCheckInParent) = 0;
+
+        /**
+        * Gets the value of the given attribute.
+        * @since Series60 3.0
+        * @param aName: Name of the attribute in question.
+        * @return the value of the attribute, or NULL if not found. 
+        * Ownership is not transferred to caller.
+        */
+        virtual const TDesC8* AttrValue(const TDesC8& aName) = 0;
+
+        /**
+        * Adds an attribute. If attribute is already existing, 
+        *                  the value of the attribute will be replaced.
+        * @since Series60 3.0
+        * @param aName      Name of the attribute to be added.
+        * @param aValue Value of the attribute to be added.
+        */
+        virtual void AddAttrL(const TDesC8& aName, const TDesC8& aValue) = 0;
+
+        /**
+        * Gets all the attributes of this element in an array.
+        * @since Series60 3.0
+        * @return array of attributes. Array will be empty if element has 
+        *         no attributes.
+        */
+        virtual RPointerArray<CSenBaseAttribute>& AttributesL() = 0;
+
+        /**
+        * Gets all the namespaces of this element in an array.
+        * @since Series60 3.0
+        * @return array of namespaces. Array will be empty if element has 
+        *         no namespaces.
+        */
+        virtual RPointerArray<CSenNamespace>& NamespacesL() = 0;
+
+        /**
+        * Gets the parent element of this element.
+        * @since Series60 3.0
+        * @return the parent element or NULL if no parent set. 
+        *           Ownership is NOT transferred to the caller.
+        */
+        virtual CSenElement* Parent() = 0;
+
+        /**
+        * From MSenElement  Sets the parent element to this element. 
+        * Notice that the element is not automatically added as a 
+        * child of the parent. Parent's AddElementL() must be called 
+        * to achieve that.
+        *
+        * @since Series60 3.0
+        * @param apParent:  The wanted parent. Can be NULL.
+        * @return   the parent element
+        */
+        virtual CSenElement* SetParent(CSenElement* apParent) = 0;
+
+        /**
+        * Detach the element from its parent.
+        * If the element, or one of its children, is dependent
+        * on a namespace declared in the scope of the parent
+        * copy those namespace declarations to this element.
+        * @since Series60 3.0
+        * @return this Element. Ownership is NOT transferred to the caller.
+        *         or NULL if no parent was set, and nothing was detached.
+        */
+        virtual CSenElement* DetachL() = 0;
+
+        /**
+        * Gets a child element from a specified index.
+        * @since Series60 3.0
+        * @param  aIndex:   the index what to get
+        * @return child element from a current index. NULL if no child in given
+        *         index is found
+        */
+        virtual CSenElement* Child(TInt aIndex) = 0;
+
+        /**
+        * Gets the root element. If no parent element, returns this element.
+        * @since Series60 3.0
+        * @return the root of the tree. Ownership is not transferred.
+        */
+        virtual MSenElement& Root() = 0;
+
+        /**
+        * Gets the child element with the specified local name.
+        * Assumes that namespace is the same as this parent element.
+        * @since Series60 3.0
+        * @param aLocalName is the XML localname of the requested child element
+        * @return   the child element or NULL if the child with the specified 
+        *           local name is not found. Ownership is NOT transferred.
+        */
+        virtual CSenElement* Element(const TDesC8& aLocalName) = 0;
+
+        /**
+        * Gets the child element with the specified local name and namespace URI.
+        * @since Series60 3.0
+        * @param aNsUri is the XML namespace of the requested child element
+        * @param aLocalName  is the XML localname of the requested child element
+        * @return   the child element or NULL if the child with the specified 
+        *           criterias is not found. Ownership is NOT transferred.
+        */
+        virtual CSenElement* Element(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName) = 0;
+
+        /**
+        * Create a new element ready for adding or insertion.
+        * If the given namespace prefix is not declared yet
+        * the element will not be created and NULL will be returned.
+        * @since Series60 3.0
+        * @param aNsPrefix: The namespace prefix
+        * @param aLocalName:    The new elements localname
+        * @return   the new Element just created, or NULL if given prefix was not
+        *           declared yet. Ownership is transferred to the caller.
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contain illegal characters.      
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        virtual CSenElement* CreateElementL(const TDesC8& aNsPrefix,
+                                            const TDesC8& aLocalName) = 0;
+
+        /**
+        * Insert an Element into the list of children elements
+        * so that the inserted Element is placed right before the aBeforeElement.
+        * If aBeforeElement is not found, element will be appended to the last
+        * position.
+        * Function leaves if error occurs in inserting.
+        * @since Series60 3.0
+        * @param aInsertedElement   the element to be inserted. 
+        *                           Ownership is transferred.
+        * @param aBeforeElement     the element which will be right next to the 
+        *                           element just inserted.
+        * @return the inserted Element
+        */
+        virtual CSenElement& InsertElementL(CSenElement& aInsertedElement,
+                                            const CSenElement& aBeforeElement) = 0;
+
+        /**
+        * Adds an Element to the children elements. 
+        * Sets this element to be the new parent of the given element.
+        * @since Series60 3.0
+        * @param aElement:  the element to be added. Ownership is transferred.
+        * @return the added Element
+        */
+        virtual CSenElement& AddElementL(CSenElement& aElement) = 0;
+
+        /**
+        * Constructs and adds a new element to the children elements. 
+        * Sets this element to be the new parent of the given element.
+        * @since Series60 3.0
+        * @param aNsUri     namespace URI of the new element
+        * @param aLocalName local name of the new element
+        * @return the added Element
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        virtual CSenElement& AddElementL(   const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName) = 0;
+        
+        /**
+        * Constructs and adds a new element to the children elements. 
+        * Sets this element to be the new parent of the given element.
+        * @since Series60 3.0
+        * @param aNsUri     namespace URI of the new element
+        * @param aLocalName local name of the new element
+        * @param aQName     qualified name of the new element
+        * @return the added Element
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+        *       characters.     
+        *
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero 
+        *       length.
+        */
+        virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName) = 0;
+
+        /**
+        * Constructs and adds a new element to the children elements. 
+        * Sets this element to be the new parent of the given element.
+        * Note: Element is created with no specific namespace, default namespace
+        * of some of the upper level elements are in effect if there is such a 
+        * namespace.
+        * @since Series60 3.0
+        * @param aLocalName local name of the new element
+        * @return the added Element
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains illegal 
+        *       characters.     
+        *
+        *       KErrSenZeroLengthDescriptor if aLocalName is zero length.
+        */
+        virtual CSenElement& AddElementL(const TDesC8& aLocalName) = 0;
+
+        /**
+        * Remove an element from the childs.
+        * @since Series60 3.0
+        * @param aElement:  the element to be removed.
+        * @return The removed element. May be NULL if nothing was removed
+        *           (if child element was not found).
+        *           The caller TAKES OWNERSHIP of the removed element.
+        */
+        virtual CSenElement* RemoveElement(CSenElement& aElement) = 0;
+
+        /**
+        * Remove an element from the childs.
+        * @since Series60 3.0
+        * @param    aNsUri:     the namespace URI of the element to be removed.
+        * @param    aLocalName: the local name of the element to be removed.
+        * @return The removed element. May be NULL if nothing was removed
+        *           (if child element was not found).
+        *           The caller TAKES OWNERSHIP of the removed element.
+        */
+        virtual CSenElement* RemoveElement( const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName) = 0;
+
+        /**
+        * Remove a child element.
+        * @since Series60 3.0
+        * @param    aLocalName: the local name of the element to be removed.
+        * @return The removed element. May be NULL if nothing was removed
+        *           (if child element was not found).
+        *
+        * The caller takes ownership of the removed element.
+        */
+        virtual CSenElement* RemoveElement(const TDesC8& aLocalName) = 0;
+
+        /**
+        * Replaces a child element with another element.
+        * Element's local name and namespace URI will be used to check
+        * whether or not that element matches with any existing child.
+        * If no matching child element is found this method will add a 
+        * new child element.
+        *
+        * @since Series60 3.0
+        * @param aElement:  the element to be added. Ownership is transferred.
+        * @return The old element. May be NULL if nothing was replaced
+        *           (if element was not found from the childs).
+        *           The caller TAKES OWNERSHIP of the old element.
+        */
+        virtual CSenElement* ReplaceElementL(CSenElement& aElement) = 0;
+
+        /**
+        * Gets the element as an XML buffer. Buffer will 
+        * contain all the child elements.
+        * @since Series60 3.0
+        * @return element as XML. Caller takes ownership.
+        */
+        virtual HBufC8* AsXmlL() = 0;
+        
+        /**
+        * Gets the element as an unicode (UCS2) XML buffer.
+        * Buffer will contain all the child elements.
+        * @since Series60 3.0
+        * @return element as XML. Caller takes ownership.
+        */
+        virtual HBufC* AsXmlUnicodeL() = 0;
+
+        /**
+        * Element writes itself to a write stream using UTF-8 
+        * character-set encoding.
+        * @since Series60 3.0
+        * @param aWriteStream The stream to write to.
+        */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+        * Element writes its namespaces to a write stream 
+        * using UTF-8 character-set encoding.
+        * @since Series60 3.0
+        * @param aWriteStream The stream to write to.
+        */
+        virtual void WriteNamespacesToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+        * Offers the M-class interface pointer to this XML 
+        * element.
+        * @since Series60 3.0
+        * @return the current object as element. Ownership is NOT transferred.
+        */
+        virtual MSenElement* AsElement() = 0;
+
+        /**
+        * Copies content from given element to this element appending to the 
+        * existing content if there is any.
+        * @since Series60 3.0
+        * @param aSource The source element.
+        */
+        virtual void CopyFromL(CSenElement& aSource) = 0;
+
+        /**
+        * (Re-) Set the name and namespace of this Element. The element will be
+        * given the localName in the the given namespace. A prefix will be
+        * computed from the qualified name.
+        * This method should be used with care and is mainly intended for
+        * protected use in implementations.
+        * @since Series60 3.0
+        * @param aNamespaceURI The new namespace URI.
+        * @param aLocalName The new local name.
+        * @param aQName The new qualified name.
+        */
+        virtual void Set(const TDesC8& aNamespaceURI, const TDesC8& aLocalName, const TDesC8& aQName) = 0;
+
+        /**
+        * Adds new attributes to the element.
+        * @since Series60 3.0
+        * @param aAttrs:    the array of attributes.
+        */
+        virtual void AddAttributesL(const RAttributeArray& apAttrs) = 0;
+    };
+
+#endif //SEN_ELEMENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenFragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Central place for debug-type macros
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_FRAGMENT_H
+#define SEN_FRAGMENT_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <xml/attribute.h>
+#include <SenXmlReader.h>
+#include <SenElement.h>
+#include <MSenFragment.h>
+// CLASS DECLARATION
+
+/**
+* Abstract base class declaring XML fragment interface.
+* @lib SenXML.dll
+* @since Series60 3.0
+*/
+class CSenFragment : public CBase, public MSenFragment
+    {
+    public: // New functions
+
+        /**
+         * Getting the fragment as an XML element. This method will panic if 
+         * element has not been initialized for any reason.
+         * @return the current object as element. Ownership is not transferred.
+         */
+        virtual CSenElement& AsElement() = 0;
+
+        /**
+         * @return the current object as element. May return NULL.
+         *          Caller takes ownership.
+         *
+         * Note(!): the return value (CSenElement) STRONGLY suggests that
+         * subclasses INHERIT CSenFragment in order properly comply the
+         * requirement of the ExtractElement() implementation.
+         */
+        virtual CSenElement* ExtractElement() = 0;
+
+        /**
+         * Sets the XML reader to be used for parsing for the fragment.
+         * @param aReader:      the reader to be used. 
+         *                      Ownership is NOT transferred.
+         */
+        virtual void SetReader(CSenXmlReader& aReader) = 0;
+
+        /**
+         * Gets the XML reader which this fragment uses for parsing.
+         * @param aReader:      the reader to be used. 
+         *                      Ownerships is not transferred.
+         */
+        virtual CSenXmlReader* Reader() = 0;
+
+        /**
+         * Method to invoke parsing of a XML data.
+         * Note: SetReader() must be called before this method can be used.
+         * @param aXml: The XML data to be parsed.
+         */
+        virtual void ParseL(const TDesC8& aXml) = 0;
+
+        /**
+         * Same as ParseL() except that it doesn't leave in case of an error. 
+         * Instead errors are trapped and error is returned.
+         * SetReader() must be called before this method can be used.
+         * @return KErrNone or other system-wide Symbian error codes.
+         */
+        virtual TInt BuildFrom(const TDesC8& aBuf) = 0;
+
+        /**
+         * Let the delegate MSenFragment handle the following SAX events.
+         * This fragment is made the owner of the delegate and
+         * the delegate is expected to make this MSenFragment the receiver
+         * of SAX events once it has seen the end element for itself.
+         * @param aDelegate:    the fragment to start handling the SAX events.
+         */
+        virtual void DelegateParsingL(MSenFragment& aDelegate) = 0;
+
+        /**
+         * Creates a new fragment and lets the created MSenFragment handle 
+         * the following SAX events.
+         * This fragment is made the owner of the delegate and
+         * the delegate is expected to make this MSenFragment the receiver
+         * of SAX events once it has seen the end element for itself.
+         * @param aNsUri:       the namespace URI of the new delegate
+         * @param aLocalName:   the local name of the new delegate
+         * @param aQName:       the qualified name of the new delegate
+         * @param aAttrs:       the attributes which to be set for the new delegate
+         */
+        virtual void DelegateParsingL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName,
+                                      const RAttributeArray& aAttrs) = 0;
+
+        /**
+         * Sets the reader for this fragment and sets this to be the 
+         * content handler of the following SAX events.
+         * @param aReader:  Reader to be used.
+         */
+        virtual void ParseWithL(CSenXmlReader& aReader) = 0;
+
+        /**
+         * Sets a new parent for this fragment.
+         * @param aFragment:    the new parent.
+         */
+        virtual void SetOwner(MSenFragment& aFragment) = 0;
+
+        /**
+         * Resumes the parsing. Usually called by the delegate fragment which was
+         * parsing itself after DelegateParsingL().
+         * @param aNsUri        The namespace URI of the current element
+         * @param aLocalName    The local name of the current element
+         * @param aQName        The qualified name of the current element
+         */
+        virtual void ResumeParsingFromL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName) = 0;
+
+        /**
+         * Sets the attributes for the fragment.
+         * @param aAttrs:   the array of attributes.
+         */
+        virtual void SetAttributesL(const RAttributeArray& aAttrs) = 0;
+
+        /**
+         * Writes the start element tag to the content stream. 
+         * Derivants can override the basic usage used in BaseFragment.
+         * @param aNsUri        The namespace URI of the current element
+         * @param aLocalName    The local name of the current element
+         * @param aQName        The qualified name of the current element
+         * @param aAttrs:       the array of attributes.
+         */
+        virtual void WriteStartElementL(const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName,
+                                        const TDesC8& aQName,
+                                        const RAttributeArray& aAttrs) = 0;
+
+        /**
+         * Writes the end element tag to the content stream. 
+         * Derivants can override the basic usage used in BaseFragment.
+         * @param aNsUri        The namespace URI of the current element
+         * @param aLocalName    The local name of the current element
+         * @param aQName        The qualified name of the current element
+         */
+        virtual void WriteEndElementL(const TDesC8& aNsUri,
+                                      const TDesC8& aLocalName,
+                                      const TDesC8& aQName) = 0;
+
+        /**
+        * Getter for Fragment's local name.
+        * @return Localname or KNullDesC if not set.
+        */
+        virtual const TDesC8& LocalName() const = 0;
+
+        /**
+        * Getter for Fragment's namespace URI.
+        * @return Namespace URI or KNullDesC if not set.
+        */
+        virtual const TDesC8& NsUri() const = 0;
+
+        /**
+         * Getter for namespace prefix of this fragment.
+         * @return namespace prefix or KNullDesC if not set.
+         */
+        virtual const TDesC8& NsPrefix() const = 0;
+
+        /**
+         * Fragment writes itself to a write stream using UTF-8 charset encoding.
+         * @param aWriteStream: The stream to write to.
+         */
+        virtual void WriteAsXMLToL(RWriteStream& aWriteStream) = 0;
+
+        /**
+         * Gets the fragment as an unicode XML buffer. 
+         * Buffer will contain all the childs etc.
+         * @return  fragment as XML. Caller takes ownership.
+         */
+        virtual HBufC* AsXmlUnicodeL() = 0;
+
+        /**
+         * Gets the fragment as an XML buffer.
+         * @return  fragment as XML. Caller takes ownership.
+         */
+        virtual HBufC8* AsXmlL() = 0;
+
+        /**
+         * Getter for the content. Returns content namespaces if there are any.
+         * @return Content.
+         */
+        virtual TPtrC8 Content() = 0;
+
+        /**
+         * Checks if fragment matches to another fragment 
+         * by its content and child elements. 
+         * Fragment can contain more data than the given candidate.
+         * @since Series60 3.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                      less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *          to given pattern. EFalse otherwise.
+         */
+        virtual TBool ConsistsOfL(MSenFragment& aCandidate) = 0;
+    };
+
+#endif // SEN_FRAGMENT_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenNameSpace.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Implementation of XML namespace functionality
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_NAME_SPACE_H
+#define SEN_NAME_SPACE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32mem.h>
+
+// CLASS DECLARATION
+
+/**
+* Implementation of XML namespace functionality
+* All data is in UTF-8 form.
+* @lib SenXML.dll
+* @since Series60 3.0
+*/
+class CSenNamespace :   public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+         * Basic constructor.
+         * @param   aPrefix The prefix for the namespace.
+         * @param   aUri    The namespace uri for the namespace.
+         */
+        IMPORT_C static CSenNamespace* NewL(const TDesC8& aPrefix,
+                                            const TDesC8& aUri);
+        /**
+         * Basic constructor.
+         * @param   aPrefix The prefix for the namespace.
+         * @param   aUri    The namespace uri for the namespace.
+         */
+        IMPORT_C static CSenNamespace* NewLC(const TDesC8& aPrefix,
+                                             const TDesC8& aUri);
+        /**
+         * Basic constructor.
+         * @param   aUri    The namespace uri for the namespace.
+         */
+        IMPORT_C static CSenNamespace* NewL(const TDesC8& aUri);
+
+        /**
+         * Basic constructor.
+         * @param   aUri    The namespace uri for the namespace.
+         */
+        IMPORT_C static CSenNamespace* NewLC(const TDesC8& aUri);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenNamespace();
+        
+    public: // New functions
+        
+        /**
+         * Getter for the URI of the namespace object.
+         * @return  The URI
+         */
+        IMPORT_C const TDesC8& URI() const;
+
+        /**
+         * Getter for the prefix of the namespace object.
+         * @return  The prefix
+         */
+        IMPORT_C const TDesC8& Prefix() const;
+
+        /**
+         * Setter for the URI of the namespace object.
+         * @param aUri  The URI.
+         */
+        IMPORT_C void SetUriL(const TDesC8& aUri);
+
+        /**
+         * Setter for the prefix of the namespace object.
+         * @param aPrefix   The prefix.
+         */
+        IMPORT_C void SetPrefixL(const TDesC8& aPrefix);
+
+        /**
+         * Method for comparing the namespace object to other prefix 
+         * and URI.
+         * @param aOtherPrefix  The prefix to be compared to
+         * @param aOtherUri     The URI to be compared to.
+         * @return ETrue if both of the parameters were matching to the 
+         *               object's corresponding ones. EFalse otherwise
+         */
+        IMPORT_C TBool Compare(const TDesC8& aOtherPrefix,
+                               const TDesC8& aOtherUri) const;
+
+        /**
+         * Method for comparing the namespace object to other namespace 
+         * object.
+         * @param aOtherNamespace       The namespace to be compared to.
+         * @return ETrue if the given namespace has same URI and prefix as the
+         *              current one. EFalse otherwise.
+         */
+        IMPORT_C TBool Compare(const CSenNamespace& aOtherNamespace) const;
+        
+        /**
+         * Method for comparing the namespace object to other namespace 
+         * object. Differs from Compare(...) methods so that this one
+         * compares only URIs.
+         * @return  ETrue   if the given namespace has the same URI as 
+         *                  the current one. EFalse otherwise.
+         */
+        IMPORT_C TBool MatchesL(const CSenNamespace& aOtherNamespace) const;
+
+        /**
+         * Method to ask this namespace object to write itself into a 
+         * writestream. Doesn't write anything if no URI has been set.
+         * @param aWs   The writestream where object should be written.
+         */
+        IMPORT_C void InsertL(RBufWriteStream& aWs);
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenNamespace();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(const TDesC8& aPrefix, const TDesC8& aUri);
+
+    private: // Data
+        HBufC8* ipPrefix;
+        HBufC8* ipUri;
+    };
+
+#endif // SEN_NAME_SPACE_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenXmlConstants.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This header lists all constants of XML Extensions library
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_XML_CONSTANTS_H
+#define SEN_XML_CONSTANTS_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+// Leave codes
+const TInt KErrSenInvalidCharacters         =   -30300;
+const TInt KErrSenZeroLengthDescriptor      =   -30301;
+const TInt KErrSenXmlReaderNotSet           =   -30302;
+const TInt KErrSenXmlContentHandlerNotSet   =   -30303;
+
+// Panics
+_LIT(KSenXmlPanic, "SenXml");
+
+
+
+// XML String constants
+const TInt KSenMaxXmlEscapedLength = 8;
+_LIT8(KSenSlash,                    "/");
+_LIT8(KSenColon,                    ":");
+_LIT8(KSenLessThan,                 "<");
+_LIT8(KSenGreaterThan,              ">");
+_LIT8(KSenSpace,                    " ");
+_LIT8(KSenQuot,                     "'");
+_LIT8(KSenDblQuot,                  "\"");
+_LIT8(KSenEquals,                   "=");
+_LIT8(KSenEqualsDblQuot,            "=\"");
+_LIT8(KSenSlashGreaterThan,         "/>");
+_LIT8(KSenLessThanSlash,            "</");
+_LIT8(KSenSpaceXmlns,               " xmlns");
+_LIT8(KSenXmlns,                    "xmlns");
+_LIT8(KSenXmlNsAttNamePlusColon,    "xmlns:");
+_LIT8(KSenXmlCommentStart,          "<!--");
+_LIT8(KSenXmlCommentEnd,            "-->");
+_LIT8(KSenXmlInstructionStart,      "<?");
+_LIT8(KSenXmlInstructionEnd,         "?>");
+_LIT8(KSenXmlEntityStart,            "<!");
+
+// The predeclared, basic XML entities:
+// &apos;    (')
+// &quot;    (")
+// &gt;      (>)
+// &lt;      (<)
+// &amp;     (&)
+
+_LIT8(KSenEscapedAmp,     "&amp;");
+_LIT8(KSenEscapedApos,    "&apos;");
+_LIT8(KSenEscapedDblQuot, "&quot;");
+_LIT8(KSenEscapedGt,      "&gt;");
+_LIT8(KSenEscapedLt,      "&lt;");
+
+// XML-escaping chars as descriptors
+_LIT8(KSenAmpersandDesC8,  "&");
+_LIT8(KSenAposDesC8,       "\'");
+_LIT8(KSenDblQuotDesC8,    "\"");
+_LIT8(KSenGtDesC8,         ">");
+_LIT8(KSenLtDesC8,         "<");
+
+
+/*
+_LIT8(KSenQuotedAmp,     "&amp;");
+_LIT8(KSenQuotedApos,    "&apos;");
+_LIT8(KSenQuotedDblQuot, "&quot;");
+_LIT8(KSenQuotedGt,      "&gt;");
+_LIT8(KSenQuotedLt,      "&lt;");
+*/
+
+/**
+* SenXmlPanic Enumeration
+*/
+enum TSenXmlPanic
+    {
+    EBadNamespace = 1,
+    EBadNamespacePrefix,
+    EBufNot16Bit,
+    EFragmentElementNotInitialized,
+    EDelegatedFragmentAlreadySet,
+    EInconsistentTokens,
+    EBadInternalState
+    };
+
+#endif // SEN_XML_CONSTANTS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenXmlElement.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,742 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This is an optimized variant of XML element, which consumes
+*                significantly less heap when compared to CSenBaseElement
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_XML_ELEMENT_H
+#define SEN_XML_ELEMENT_H
+
+//  INCLUDES
+#include <s32mem.h>
+#include <SenElement.h>
+#include <SenNameSpace.h>
+#include <SenBaseAttribute.h>
+
+// CLASS DECLARATION
+
+/**
+*  Implementation of an XML element functionality
+*  Content is stored in UTF-8 form XML. Note, that
+*  setting any 8-bit content into XML without encoding
+*  it into form of legal is illegal. Instead, one
+*  should use encoding methods, like ones introduced 
+*  in SenXmlUtils class to encode basic entities, or
+*  use use some other encoding like MD5 for binary 
+*  data content.
+*  @lib SenXML.dll
+*  @since Series60 3.1
+*/
+class CSenXmlElement : public CSenElement
+    {
+    public:  // Constructors and destructor
+
+        /**
+         *  Standard constructor.
+         *  @param aLocalName   the local name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+
+        IMPORT_C static CSenXmlElement* NewL(const TDesC8& aLocalName);
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        IMPORT_C static CSenXmlElement* NewL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenXmlElement* NewL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  @param apAttrs      the attributes for this element.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenXmlElement* NewL(const TDesC8& aNsUri, 
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& apAttrs);
+
+        /**
+         *  Standard constructor.
+         *  @param aNsUri       the namespace URI for this element.
+         *  @param aLocalName   the local name for this element.
+         *  @param aQName       the qualified name for this element.
+         *  @param apAttrs      the attributes for this element.
+         *  @param aParent: the parent element for the new element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contains
+         *      illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */
+        IMPORT_C static CSenXmlElement* NewL(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName,
+                                             const TDesC8& aQName,
+                                             const RAttributeArray& apAttrs,
+                                             CSenElement& aParent);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenXmlElement();
+
+    public: // New functions
+    
+        /**
+         *  Adds attributes to the element. Calls internally AddAttributesL()
+         *  Can be overridden to replace old attributes.
+         *  @param  aAttrs: the array of attributes.
+         */
+        IMPORT_C virtual void SetAttributesL(const RAttributeArray& apAttrs);
+    
+        // Functions from base classes
+    
+        // From CSenElement
+    
+        /**
+        *   Getter for Element's local name.
+        *   @return Localname or KNullDesC if not set.
+        */  
+        IMPORT_C virtual const TDesC8& LocalName() const;
+
+        /**
+        *   Getter for Element's namespace URI.
+        *   @return Namespace URI or KNullDesC if not set.
+        */
+        IMPORT_C virtual const TDesC8& NamespaceURI() const;
+
+        /**
+         *  Getter for namespace prefix of this element.
+         *  @return namespace prefix or KNullDesC if not set.
+         */
+        IMPORT_C virtual const TDesC8& NsPrefix() const;
+
+        /**
+         *  Setter for namespace prefix of this element.
+         *  @param aPrefix: new namespace prefix for the element.
+         */
+        IMPORT_C virtual void SetPrefixL(const TDesC8& aPrefix);
+
+        /**
+         *  Method for checking if the element has any content within.
+         *  @return ETrue if has content, EFalse if not.
+         */
+        IMPORT_C virtual TBool HasContent() const;
+
+        /**
+         *  Getter for the content of the element.
+         *  @return the content or KNullDesC if empty.
+         */
+        IMPORT_C virtual TPtrC8 Content() const;
+
+        /**
+         *  Getter for the content of the element, unicode version.
+         *  @return content as unicode. Ownership IS TRANSFERRED to the caller.
+         */
+        IMPORT_C virtual HBufC* ContentUnicodeL() const;
+
+        /**
+         *  Sets the content to the element. Old content is overwritten.
+         *  @param  aContent:   The content to be set. Can be KNullDesC8.
+         *  @return The content of the element or KNullDesC8 if no content was set.
+         */
+        IMPORT_C virtual TPtrC8 SetContentL(const TDesC8& aContent);
+
+        /**
+         *  Gets the write stream for the content for easy appending.
+         *  Writing 8-bit (UTF-8) string to the returned stream will be appended
+         *  to the content.
+         *  @return reference to the RWriteStream.
+         */
+        IMPORT_C virtual RWriteStream& ContentWriteStreamL();
+
+        /**
+         * Checks if element matches to another element
+         * by its content and child elements. Element
+         * can contain more data than the given pattern.
+         * @since Series60 3.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                  less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *          to given pattern. EFalse otherwise.
+         */
+        IMPORT_C virtual TBool ConsistsOfL(MSenElement& aCandidate);
+
+        /**
+        *   Setter for Element's namespace URI.
+        *   @param aNsUri:  Namespace URI
+        */
+        IMPORT_C virtual void SetNamespaceL(const TDesC8& aNsUri);
+
+        /**
+        *   Setter for Element's namespace URI.
+        *   @param aNsPrefix:   Namespace prefix
+        *   @param aNsUri:      Namespace URI
+        */
+        IMPORT_C virtual void SetNamespaceL(const TDesC8& aNsPrefix,
+                                            const TDesC8& aNsUri);
+
+        /**
+         * Adds a namespace declaration.
+         * If this element (or its parent if parameter aCheckInParent is ETrue) 
+         * already has a Namespace with the same prefix and URI the given
+         * Namespace is not added.
+         * @param aNewNamespace
+         * @param aCheckInParent
+         * @return the added Namespace, or the equivalent pre-existing one.
+         */ 
+        IMPORT_C virtual const CSenNamespace* AddNamespaceL(CSenNamespace& aNewNamespace,
+                                                            TBool aCheckInParent);
+        /**
+        *   Method for adding a namespace for the Element.
+        *   @param aPrefix: Namespace prefix
+        *   @param aUri:    Namespace URI
+        *   @return the added Namespace, or the equivalent pre-existing one.
+        */
+        IMPORT_C virtual const CSenNamespace* AddNamespaceL(const TDesC8& aPrefix,
+                                                            const TDesC8& aUri);
+        /**
+        *   Getter for Element's namespace.
+        *   @return const pointer to the CSenNamespace object of this Element.
+        *           NULL if not set.
+        */ 
+        IMPORT_C virtual const CSenNamespace* Namespace();
+
+        /**
+         * Getter for new namespace, using a namespace prefix as a search criteria.
+         * @param aNsPrefix is the new namespace prefix for this element
+         * @return the found Namespace that is declared for the given prefix
+         * within the scope of this Element. If no such prefix is
+         * declared return null.
+         */     
+        IMPORT_C virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix);
+
+        /**
+         * Getter for new namespace, using a namespace prefix as a search criteria,
+         * supporting both normal and recursive search mode (checking the parent).
+         * @param aNsPrefix:        The prefix used to search
+         * @param aCheckInParent:   The flag indicating whether to check parent's
+         *                          namespaces too if not found in the current 
+         *                          element. 
+         *                          ETrue to check, EFalse for not to check.
+         * @return the found Namespace that is declared for the given prefix 
+         *                   and namespace URI within the scope of this Element
+         *                   or NULL if not found
+         */ 
+        IMPORT_C virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix,
+                                                        const TBool aCheckInParent);
+
+        /**
+         * Getter for new namespace, using both namespace prefix and namespace URI as search criteria.
+         * @param aNsPrefix:    The prefix used to search
+         * @param aUri:         The namespace URI used to search.
+         * @return the found Namespace that is declared for the given prefix 
+         *                   and namespace URI within the scope of this Element
+         *                   or NULL if not found.
+         */     
+        IMPORT_C virtual const CSenNamespace* Namespace(const TDesC8& aNsPrefix,
+                                                        const TDesC8& aUri);
+
+        /**
+         *  Getting the child elements of this element matching the given criteria.
+         *  @param aElementArray:   Array to be filled with the matching elements,
+         *                          or empty array if no matching found. 
+         *                          Any modifications made on the returned items
+         *                          modify the real childs too.
+         *  @param aNsUri:          namespace URI to be matched
+         *  @param aLocalName:      local name to be matched
+         *  @return KErrNone        ok
+         *          KErrNotFound    No child elements exist.
+         */     
+        IMPORT_C virtual TInt ElementsL(RPointerArray<CSenElement>& aElementArray,
+                                        const TDesC8& aNsUri,
+                                        const TDesC8& aLocalName);
+        
+        /**
+         *  Getting the child elements of this element matching the given criteria.
+         *  @param aElementArray:   Array to be filled with the matching elements,
+         *                          or empty array if no matching found. 
+         *                          Any modifications made on the returned items
+         *                          modify the real childs too.
+         *  @param aNsUri:          namespace URI to be matched
+         *  @param aLocalName:      local name to be matched
+         *  @return KErrNone        ok
+         *          KErrNotFound    No child elements exist.
+         */     
+        IMPORT_C virtual TInt ElementsL(RPointerArray<CSenElement>& aElementArray,
+                                        const TDesC8& aLocalName);
+
+        /**
+         *  Getting the child elements of this element.
+         *  @return an array of child elements. This is an empty array if there
+         *          are no children. Any modifications made on the returned array
+         *          modify the element object.
+         */     
+        IMPORT_C virtual RPointerArray<CSenElement>& ElementsL();
+
+        /**
+         *  Gets all the attributes of this element in an array.
+         *  @return array of attributes. Array will be empty if element has 
+         *          no attributes.
+         */     
+        IMPORT_C virtual RPointerArray<CSenBaseAttribute>& AttributesL();
+
+        /**
+         *  Gets all the namespaces of this element in an array.
+         *  @return array of namespaces. Array will be empty if element has 
+         *          no namespaces.
+         */     
+        IMPORT_C virtual RPointerArray<CSenNamespace>& NamespacesL();
+
+        /**
+         *  Gets the value of the given attribute.
+         *  @param aName:   Name of the attribute in question.
+         *  @return the value of the attribute, or NULL if not found. Ownership is
+         *          NOT TRANSFERRED.
+         */     
+        IMPORT_C virtual const TDesC8* AttrValue(const TDesC8& aName);
+        
+        /**
+         *  Adds an attribute. If attribute is already existing, 
+         *  the value of the attribute will be replaced.
+         */
+        IMPORT_C virtual void AddAttrL(const TDesC8& aName, const TDesC8& aValue);
+
+        /**
+         *  Gets the parent element of this element.
+         *  @return the parent element or NULL if no parent set. 
+         *          Ownership is NOT transferred to the caller.
+         */     
+        IMPORT_C virtual CSenElement* Parent();
+
+        /**
+         *  Sets the parent element to this element. Notice that the element is not
+         *  automatically added as a child of the parent. Parent's 
+         *  AddElementL() should be called instead.
+         *  @param apParent:    The wanted parent. Can be NULL.
+         *  @return the parent element
+         */ 
+        IMPORT_C virtual CSenElement* SetParent(CSenElement* apParent);
+
+        /**
+         *  Gets the root element. If no parent element, returns this element.
+         *  @return the root of the tree. Ownership is NOT transferred.
+         */     
+        IMPORT_C virtual MSenElement& Root();
+
+        /**
+         *  Gets the child element with the specified local name.
+         *  Assumes that namespace is the same as this parent element.
+         *  @return the child element or NULL if the child with the specified 
+         *          local name is not found. Ownership is NOT transferred.
+         */ 
+        IMPORT_C virtual CSenElement* Element(const TDesC8& aLocalName);
+
+        /**
+         *  Gets the child element with the specified local name and namespace URI.
+         *  @return the child element or NULL if the child with the specified 
+         *          criterias is not found. Ownership is NOT transferred.
+         */ 
+        IMPORT_C virtual CSenElement* Element(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName);
+
+        /**
+         * Create a new element ready for adding or insertion.
+         * If the given namespace prefix is not declared yet
+         * the element will not be created and NULL will be returned.
+         * @param aNsPrefix:    The namespace prefix
+         * @param aLocalName:   The new elements localname
+         * @return  the new Element just created, or NULL if given prefix was not
+         *          declared yet. Ownership is transferred to the caller.
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */     
+        IMPORT_C virtual CSenElement* CreateElementL(const TDesC8& aNsPrefix,
+                                                     const TDesC8& aLocalName);
+
+        /**
+         * Insert an Element into the list of children elements
+         * so that the inserted Element is placed right before the aBeforeElement.
+         * If aBeforeElement is not found, element will be appended to the last
+         * position.
+         * Function leaves if error occurs in inserting.
+         * @param aInsertedElement: the element to be inserted. 
+         *                          Ownership is transferred.
+         * @param aBeforeElement:   the element which will be right next to the 
+         *                          element just inserted.
+         * @return the inserted Element
+         */     
+        IMPORT_C virtual CSenElement& InsertElementL(CSenElement& aElement,
+                                                     const CSenElement& aBeforeElement);
+
+        /**
+         * Adds an Element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aElement: the element to be added. Ownership is transferred.
+         * @return the added Element
+         */ 
+        IMPORT_C virtual CSenElement& AddElementL(CSenElement& aElement);
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aNsUri:       namespace URI of the new element
+         * @param aLocalName:   local name of the new element
+         * @return the added Element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */     
+        IMPORT_C virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName);
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * @param aNsUri:       namespace URI of the new element
+         * @param aLocalName:   local name of the new element
+         * @param aQName:       qualified name of the new element
+         * @return the added Element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+         *      characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+         */ 
+        IMPORT_C virtual CSenElement& AddElementL(const TDesC8& aNsUri,
+                                                  const TDesC8& aLocalName,
+                                                  const TDesC8& aQName);
+
+        /**
+         * Constructs and adds a new element to the children elements. 
+         * Sets this element to be the new parent of the given element.
+         * Note: Element is created with no specific namespace, default namespace
+         * of some of the upper level elements are in effect if there is such a 
+         * namespace.
+         * @param aLocalName:   local name of the new element
+         * @return the added Element
+         *  Leave codes:    
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */     
+        IMPORT_C virtual CSenElement& AddElementL(const TDesC8& aLocalName);
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aElement:   the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */     
+        IMPORT_C virtual CSenElement* RemoveElement(CSenElement& aElement);
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aNsUri:     the namespace URI of the element to be removed.
+         *  @param  aLocalName: the local name of the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */     
+        IMPORT_C virtual CSenElement* RemoveElement(const TDesC8& aNsUri,
+                                                    const TDesC8& aLocalName);
+
+        /**
+         *  Remove an element from the childs.
+         *  @param  aLocalName: the local name of the element to be removed.
+         *  @return The removed element. May be NULL if nothing was removed
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the removed element.
+         */     
+        IMPORT_C virtual CSenElement* RemoveElement(const TDesC8& aLocalName);
+
+        /**
+         *  Replaces an element from the childs with another element. 
+         *  Element's local name and namespace URI will be used to match the
+         *  element to be replaced. If matching element is not found, will
+         *  normally add the given element to the childs.
+         *  @param  aElement:   the element to be added. Ownership is transferred.
+         *  @return The old element. May be NULL if nothing was replaced
+         *          (if element was not found from the childs).
+         *          The caller TAKES OWNERSHIP of the old element.
+         */ 
+        IMPORT_C virtual CSenElement* ReplaceElementL(CSenElement& aElement);
+
+        /**
+         *  Gets the element as an XML buffer. Buffer will contain all the childs
+         *  @return element as XML. Caller takes ownership.
+         */
+        IMPORT_C virtual HBufC8* AsXmlL();
+
+        /**
+         *  Gets the element as an unicode XML buffer. 
+         *  Buffer will contain all the childs etc.
+         *  @return element as XML. Caller takes ownership.
+         */     
+        IMPORT_C virtual HBufC* AsXmlUnicodeL();
+
+        /**
+         *  Element writes itself to a write stream using UTF-8 charset encoding.
+         *  @param aWriteStream:    The stream to write to.
+         */     
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
+
+        /**
+         *  Element writes its namespaces to a write stream using UTF-8 charset 
+         *  encoding.
+         *  @param aWriteStream:    The stream to write to.
+         */     
+        IMPORT_C virtual void WriteNamespacesToL(RWriteStream& aWriteStream);
+
+        /**
+         *  Gets the current element as XML element. Mostly used to get the
+         *  classes which implement this interface as an instance of this 
+         *  interface.
+         *  @return the current object as element. Ownership is NOT transferred.
+         */     
+        IMPORT_C virtual MSenElement* AsElement();
+
+        /**
+         *  Copies content from given element to this element appending to the 
+         *  existing content if there is any.
+         *  @param aSource: The source element.
+         */ 
+        IMPORT_C void CopyFromL(CSenElement& aSource);
+
+        /**
+         * Detach the element from its parent.
+         * If the element, or one of its children, is dependent
+         * on a namespace declared in the scope of the parent
+         * copy those namespace declarations to this element.
+         * @return this Element. Ownership IS TRANSFERRED to the caller.
+         */ 
+        IMPORT_C virtual CSenElement* DetachL();
+
+        /**
+         *  Gets a child element from a specified index.
+         *  @param  aIndex: the index what to get
+         *  @return child element from a current index. NULL if no child in given
+         *          index is found
+         */ 
+        IMPORT_C virtual CSenElement* Child(TInt aIndex);
+
+        /**
+         * (Re-) Set the name and namespace of this Element. The element will be
+         * given the localName in the the given namespace. A prefix will be
+         * computed from the qualified name.
+         * This method should be used with care and is mainly intended for
+         * protected use in implementations.
+         * @param aNamespaceURI:    The new namespace URI.
+         * @param aLocalName:       The new local name.
+         * @param aQName:           The new qualified name.
+         */ 
+        IMPORT_C virtual void Set(const TDesC8& aNsUri,
+                                  const TDesC8& aLocalName,
+                                  const TDesC8& aQName);
+
+        /**
+         *  Adds new attributes to the element.
+         *  @param  aAttrs: the array of attributes.
+         */ 
+        IMPORT_C virtual void AddAttributesL(const RAttributeArray& apAttrs);
+
+        void Compress();
+        
+    protected:  // New functions
+    
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenXmlElement();
+
+        /**
+         *  Following BaseConstructL methods should be called from the deriving
+         *  classes ConstructL() methods. Parameter info is found in the
+         *  corresponding NewL-methods.
+         */
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
+
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName);
+        
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName);
+
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& apAttrs);
+
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aQName,
+                                     const RAttributeArray& apAttrs,
+                                     CSenElement& aParent);
+    
+        /**
+         *  Method for finding an attribute with given name.
+         *  @param aName    a name of the attribute to be searched for
+         *  @return the 1st attribute with the name, or NULL. 
+         *              Ownership is not transferred.
+         */
+        IMPORT_C virtual CSenBaseAttribute* FindAttr(const TDesC8& aName);
+
+        /**
+         *  Method for finding index for a wanted element.
+         *  @param aNsUri       a namespace URI which needs to match
+         *  @param aLocalName   a local name which needs to match
+         *  @return Index of the element with given characteristics.
+         *          or KErrNotFound if none matching
+         */
+        IMPORT_C virtual TInt IndexOfElement(const TDesC8& aNsUri,
+                                             const TDesC8& aLocalName) const;
+        
+        /**
+         *  Writes element's attributes into a writestream.
+         *  @param aWriteStream writestream to write into
+         */
+        IMPORT_C virtual void WriteAttrsToL(RWriteStream& aWriteStream);
+
+        /**
+         *  Helper function to write an attribute into a writestream.
+         *  @param aWriteStream writestream to write into
+         *  @param aName    attribute name
+         *  @param aValue   attribute value
+         */
+        IMPORT_C virtual void WriteAttrToL(RWriteStream& aWriteStream,
+                                           const TDesC8& aName,
+                                           const TDesC8& aValue);
+
+        /**
+         *  Writes all internal elements into a writestream.
+         *  @param aWriteStream writestream to write into
+         */
+        IMPORT_C virtual void WriteElementsToL(RWriteStream& aWriteStream);
+
+        /**
+         *  Writes all element's content into a writestream.
+         *  @param aWriteStream writestream to write into
+         */
+        IMPORT_C virtual void WriteContentToL(RWriteStream& aWriteStream);
+
+        /**
+        *   Adds an attribute into this element. Used also adding new namespaces
+        *   into the element.
+        * @param aQName     Attribute's qualified name
+        * @param aLocalName Attribute's local name
+        * @param aValue     Attribute's value
+        * @return value of the attribute as string (TDesC&)
+        *   Leave codes:    
+        *       KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+        *       characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C virtual const TDesC8& AddAttributeL(const TDesC8& aQName,
+                                                     const TDesC8& aLocalName,
+                                                     const TDesC8& aValue);
+
+        /**
+        *   Adds an attribute into this element. Used also adding new namespaces
+        *   into the element.
+        * @param aLocalName Attribute's local name
+        * @param aValue     Attribute's value
+        * @return value of the attribute as string (TDesC&)
+        *   Leave codes:    
+        *       KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aAttrName is zero length, or
+        *       if the local name part of it is zero length.
+        */
+        IMPORT_C virtual const TDesC8& AddAttributeL(const TDesC8& aAttrName,
+                                                     const TDesC8& aValue);
+
+        /** 
+        * Adds an attribute into this element.
+        * @param apAttribute    Attribute to be added. Ownership is transferred
+        *                       to this element.
+        * @return attribute value as a string (TDesC8&)
+        */
+        IMPORT_C const TDesC8& AddAttributeL(CSenBaseAttribute* apAttribute);
+
+        /**
+         *  Allocates a new buffer for saving content, if none allocated yet.
+         */
+        IMPORT_C virtual void AllocContentBufL();
+        
+        /**
+         *  Writes element into a dynamic buffer.
+         *  @param aBuf a dynamic buffer where to append everything.
+         *  @return the modified buffer as TPtrC8.
+         */
+        IMPORT_C virtual TPtrC8 WriteToBufL(CBufBase& aBuf);
+
+    private:
+        void AddNamespaceMissingFromL(RPointerArray<CSenNamespace>& aNamespaces);
+
+    private:    // Data
+         
+        HBufC8* ipLocalName;                            // Owned
+
+        CBufFlat* ipContentBuf;                         // Owned
+
+        RBufWriteStream* ipContentWriteStream;          // Owned
+
+        RPointerArray<CSenBaseAttribute>* ipAttrs;      // Elements owned
+
+        RPointerArray<CSenElement>* ipElements;         // Elements owned
+
+        RPointerArray<CSenNamespace>* ipNamespaces;     // Elements owned
+
+        CSenElement*    ipParent;                       // Not owned
+
+        CSenNamespace*  ipNamespace;                    // Not Owned (deleted in upper level array)
+        
+    };
+
+#endif // SEN_XML_ELEMENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenXmlReader.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,437 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class extends Symbian XML framework parser functionality
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SEN_XMLREADER_H
+#define SEN_XMLREADER_H
+
+//  INCLUDES
+#include <xml/parser.h>
+#include <xml/parserfeature.h> // for TParserFeature enumeration
+#include <xml/contenthandler.h>
+#include <badesca.h>
+
+using namespace Xml;
+
+// CONSTANTS
+const TInt KSenDefaultParserFeature = (TInt)EReportNamespaceMapping;
+
+
+#ifdef RD_SEN_FORCE_LIBXML_SAX_PLUGIN_MIMETYPE
+    _LIT8(KXmlParserMimeType,   "text/wsstarlibxml2");
+    _LIT8(KXmlVariant,          "wsstarlibxml2");
+#else
+    _LIT8(KXmlParserMimeType,   "text/xml");
+    _LIT8(KXmlVariant,          "libxml2");  // LibXml2 SAX parser
+#endif
+   
+// FORWARD DECLARATIONS
+class MSenContentHandlerClient;
+class RFs;
+
+// CLASS DECLARATION
+
+/**
+*  Class extends Symbian XML framework parser functionality
+*  Callers of this class must register some handler which will
+*  then receive XML callback events from underlying Symbian
+*  XML framework.
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class CSenXmlReader : public CBase, public MContentHandler 
+    {
+    public:  // Constructors and destructor
+    
+        /**
+        * Standard two-phase constructor.
+        * Creates new parser instance using default
+        * MIME type "text/xml" (KXmlParserMimeType).
+        * @since Series60 3.0
+        * @return pointer to a new CSenXmlReader instance.
+        */
+        IMPORT_C static CSenXmlReader* NewL();
+
+        /**
+        * Standard two-phase constructor.
+        * Creates new parser instance using default
+        * MIME type "text/xml" (KXmlParserMimeType).
+        * @since Series60 3.0
+        * @return pointer to a new CSenXmlReader instance
+        * which is left on cleanup stack.
+        */
+        IMPORT_C static CSenXmlReader* NewLC();
+
+        /**
+        * A constructor with parser feature enabling. Uses default
+        * parser MIME type "text/xml" (KXmlParserMimeType).        
+        * @since Series60 3.0
+        * @param aParserFeature is typically some enumeration introduced 
+        *      in Xml::TParserFeature or some other feature introduced in 
+        *      some XML parser implementation.
+        *  Leave codes:
+        *      KErrArgument    if aParserFeature value is negative.
+        */ 
+        IMPORT_C static CSenXmlReader* NewL(TInt aParserFeature);
+
+        /**
+        * A constructor with parser feature enabling. Uses default
+        * parser MIME type "text/xml" (KXmlParserMimeType). 
+        * @since Series60 3.0
+        * @param aParserMimeType is the XML parser MIME type.
+        *      If descriptor is of zero-length, then default 
+        *      MIME type KXmlParserMimeType is used ("text/xml").
+        *      Availability of other MIME types depends on 
+        *      underlying parser implementation.
+        * @param aParserFeature is typically some enumeration introduced 
+        *      in Xml::TParserFeature or some other feature introduced in 
+        *      some XML parser implementation.
+        *  Leave codes:
+        *      KErrArgument    if aParserFeature value is negative.
+        */ 
+        IMPORT_C static CSenXmlReader* NewLC(TInt aParserFeature);
+
+        /**
+        * A constructor with parser MIME type.
+        * Standard two-phase constructor.
+        * @since Series60 3.0
+        * @param aParserMimeType is the XML parser MIME type.
+        *      If descriptor is of zero-length, then default 
+        *      MIME type KXmlParserMimeType is used ("text/xml").
+        *      Availability of other MIME types depends on 
+        *      underlying parser implementation.
+        * @return pointer to a new CSenXmlReader instance.
+        */
+        IMPORT_C static CSenXmlReader* NewL(const TDesC8& aParserMimeType);
+
+        /**
+        * A constructor with parser MIME type.
+        * @since Series60 3.0
+        * @param aParserMimeType is the XML parser MIME type.
+        *      If descriptor is of zero-length, then default 
+        *      MIME type KXmlParserMimeType is used ("text/xml").
+        *      Availability of other MIME types depends on 
+        *      underlying parser implementation.
+        * @return pointer to a new CSenXmlReader instance
+        * which is left on cleanup stack.
+        */
+        IMPORT_C static CSenXmlReader* NewLC(const TDesC8& aParserMimeType);
+
+        /**
+        * A constructor with parser MIME type and parser feature enabling.
+        * @since Series60 3.0
+        * @param aParserFeature is typically some enumeration introduced 
+        *      in Xml::TParserFeature or some other feature introduced in 
+        *      some XML parser implementation.
+        *  Leave codes:
+        *      KErrArgument    if aParserFeature value is negative.
+        */ 
+        IMPORT_C static CSenXmlReader* NewL(const TDesC8& aParserMimeType,
+                                            TInt aParserFeature);
+
+        /**
+        * A constructor with parser MIME type and parser feature enabling.
+        * @since Series60 3.0
+        * @param aParserMimeType is the XML parser MIME type.
+        *      If descriptor is of zero-length, then default 
+        *      MIME type KXmlParserMimeType is used ("text/xml").
+        *      Availability of other MIME types depends on 
+        *      underlying parser implementation.
+        * @param aParserFeature is typically some enumeration introduced 
+        *      in Xml::TParserFeature or some other feature introduced in 
+        *      some XML parser implementation.
+        *  Leave codes:
+        *      KErrArgument    if aParserFeature value is negative.
+        */ 
+        IMPORT_C static CSenXmlReader* NewLC(const TDesC8& aParserMimeType,
+                                             TInt aParserFeature);
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenXmlReader();
+
+        // New functions
+
+        /**
+        * Method to allow client to register a content event handler (for XML) for
+        * the current reader.
+        * @since Series60 3.0
+        * @param aContentHandler The new event handler.
+        */
+        IMPORT_C virtual void SetContentHandler(
+                    MSenContentHandlerClient& aContentHandler);
+
+        /**
+        * Method for checking which feature has been enabled in the parser.
+        * @since Series60 3.0
+        * @return the corresponding integer id of the feature
+        */
+        IMPORT_C virtual TInt EnabledParserFeature();
+
+        /**
+        * @deprecated - use EnabledParserFeature() instead.
+        */
+        IMPORT_C virtual TInt ParserFeature();
+
+        /**
+        * Method for enabling a parser feature.
+        * @since Series60 3.0
+        * @param aParserFeature is typically some enumeration introduced 
+        *           in Xml::TParserFeature or some other feature introduced in 
+        *           some XML parser implementation.
+        * @return KErrNone or some system-wide error code, if an error has 
+        *         occurred.
+        */
+        TInt SetParserFeature(TInt aParserFeature);     
+
+        /**
+        * Parse an XML buffer.
+        * @since Series60 3.0
+        * @param aBuff Buffer containing document to parse.
+        * Note that this method will also leave, if an error
+        * is returned from Symbian XML framework. Here are
+        * the corresponding enums, and their respective
+        * error code values (-1000, -999... and up)
+        * (XML-specific errors returned by the XML parser)
+        * [from XmlParserErrors.h]
+    	* EXmlParserError = -1000,
+    	* EXmlSyntax = 2+EXmlParserError,		// -998
+    	* EXmlNoElements,						// -997
+    	* EXmlInvalidToken,					    // -996
+    	* EXmlUnclosedToken,					// -995
+    	* EXmlPartialChar,                      // -994
+    	* EXmlTagMismatch,                      // -993
+    	* EXmlDuplicateAttribute,               // -992
+    	* EXmlJunkAfterDocElement,              // -991
+    	* EXmlPeRef,                            // -990
+    	* EXmlUndefinedEntity,                  // -989
+    	* EXmlRecursiveEntity,                  // -988
+    	* EXmlAsyncEntity,                      // -987
+    	* EXmlBadCharRef,                       // -986
+    	* EXmlBinaryEntityRef,                  // -985
+    	* EXmlAttributeExternalEntityRef,       // -984
+    	* EXmlMisplacedPi,                      // -983
+    	* EXmlUnknownEncoding,                  // -982
+    	* EXmlIncorrectEncoding,                // -981
+    	* EXmlUnclosedCdata,                    // -980
+    	* EXmlExternalEntityHandling,           // -979
+    	* EXmlNotStandalone,                    // -978
+    	* EXmlUnexpectedState,                  // -977
+    	* EXmlEntityDeclInPe,                   // -976
+    	* EXmlDtdRequired,                      // -975
+    	* EXmlFeatureLockedWhileParsing         // -974
+        */
+        IMPORT_C void ParseL(const TDesC8& aBuff);
+
+        /**
+        * Parse an XML document.
+        * @since Series60 3.0
+        * @param aRFs An open filesession.
+        * @param aFileToParse Filename of file to parse.
+        */
+        IMPORT_C void ParseL(RFs &aRFs, const TDesC& aFileToParse);
+        
+        // Functions from base classes 
+        
+        // Callback functions implementing Symbian MContentHandler interface
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *               be avoided calling SetContentHandlerL() method prior
+        *               parsing some XML document.
+        */
+        virtual void OnStartDocumentL(const RDocumentParameters& aDocParam, 
+                                      TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnEndDocumentL(TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnStartElementL(const RTagInfo& aElement, 
+                                     const RAttributeArray& aAttributes, 
+                                     TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        * @param aBytes is the actual XML data, content in UTF-8 form
+        * @param aErrorCode KErrNone, or some system-wide error code
+        *        if an error has occured.
+        */
+        virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnStartPrefixMappingL(const RString& aPrefix, 
+                                           const RString& aUri, 
+                                           TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+
+        /**
+        * @since Series60 3.0
+        *   Leave codes:
+        *       KErrSenXmlContentHandlerNotSet  if XML content handler
+        *       for this XML reader has not been set. This leave can
+        *       be avoided calling SetContentHandlerL() method prior
+        *       parsing some XML document.
+        */
+        virtual void OnProcessingInstructionL(const TDesC8& aTarget, 
+                                              const TDesC8& aData, 
+                                              TInt aErrorCode);
+
+        /**
+        * OnError is a callback method signalled by Symbian XML
+        * framework. Current implementation of this class issues
+        * a leave in original ParseL() call on any received by
+        * this callback implementation. Used leave code will be
+        * the received error code.
+        *
+        * @since Series60 3.0
+        * @param aErrorCode is one of the Symbian XML framework
+        * errors listed in XmlFrameworkErrors.h
+        *
+        * Currently any s
+        *
+        * If content handler was not set, ParseL will leaves with
+        * KErrSenXmlContentHandlerNotSet.
+        */
+        virtual void OnError(TInt aErrorCode);
+
+        /**
+        * This method obtains the interface matching the specified UID.
+        * @since Series60 3.0
+        * @param    aUid    the UID identifying the required interface.
+        * @return   NULL    if no interface matching the UID is found or
+        *                    if content handler was not set. Otherwise, 
+        *                    returns pointer to the interface.
+        */
+        virtual TAny* GetExtendedInterface(const TInt32 aUid);
+        
+    protected:
+        
+        /**
+        * C++ constructor.
+        */
+        IMPORT_C CSenXmlReader(TInt aParserFeature);
+        
+        /**
+        * Symbian 2nd phase constructor.
+        * @param aParserMimeType sets the MIME type of 
+        * this XML parser.
+        */
+        void ConstructL(const TDesC8& aParserMimeType);
+        
+        // New functions
+        
+        /**
+        * This method re-initializes encapsulated CParser class instance.
+        * @since Series60 3.0
+        */
+        void RecreateParserL();
+        
+    private:
+        static void CleanupParser(TAny* apReader);
+
+        void CleanUp();
+
+    private:    // Data
+            // Owned instance of Symbian XML framework (default) XML parser
+        CParser* iParser;
+            // Not owned pointer to XML content handler.
+        MSenContentHandlerClient* iContentHandler;
+        // Owned pointer to XML namespace prefix strings
+        CDesC8Array* ipNsPrefixes;
+        // Owned pointer to XML namespace URI strings
+        CDesC8Array* ipNsUris;
+        // Owned string pool for XML attribute handling.
+        RStringPool iStringPool;
+            // Integer indicating currently enabled features
+        TInt iEnabledFeature;
+    };
+
+#endif  // SEN_XMLREADER_H
+    
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/inc/SenXmlUtils.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,361 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This class offers a set of utility functions for XML data
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_XML_UTILS_H
+#define SEN_XML_UTILS_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <stringpool.h>
+
+
+namespace Xml
+    {
+    // FORWARD DECLARES
+    class RAttribute;
+
+    // TYPE DEFINITIONS
+    typedef RArray<RAttribute> RAttributeArray;
+    }
+
+using namespace Xml;
+
+class CSenElement;
+class CSenBaseAttribute;
+
+
+// CONSTANTS
+namespace
+    {
+    const TInt KMaxEscapedLength = 8;
+
+/*
+    // Moved to SenXmlConstants.hß
+
+    // Five basic entities as descriptors
+    _LIT8(KSenEscapedApos,     "&apos;");
+    _LIT8(KSenEscapedDblQuot,  "&quot;");
+    _LIT8(KSenEscapedGt,       "&gt;");
+    _LIT8(KSenEscapedLt,       "&lt;");
+    _LIT8(KSenEscapedAmp,      "&amp;");
+
+    // XML-escaping chars as descriptors
+    _LIT8(KSenAmpersandDesC8,  "&");
+    _LIT8(KSenAposDesC8,       "\'");
+    _LIT8(KSenDblQuotDesC8,    "\"");
+    _LIT8(KSenGtDesC8,         ">");
+    _LIT8(KSenLtDesC8,         "<");
+*/    
+    }
+    
+// CLASS DECLARATION
+
+/**
+*  This class offers a set of utility functions for XML data
+*  The helper methods include Unicode (UCS2) and UTF-8 encoding
+*  and decoding as well as convenience methods to encode and
+*  decode the five basic XML entities. There are functions
+*  for extracting XML prefixes and building of qualifiedname
+*  and a functionality for checking if an element name value 
+*  is illegal or not.
+*  @lib SenXML.dll
+*  @since Series60 3.0
+*/
+class SenXmlUtils
+    {
+    public: // New functions
+        /**
+         * Helper function to convert unicode string to UTF-8 encoded.
+         * @since Series60 3.0
+         * @param aUnicodeString    string to be converted.
+         * @return buffer as UTF-8, caller takes ownership.
+        */
+        IMPORT_C static HBufC8* ToUtf8LC(const TDesC16& aUnicodeString);
+
+        /**
+         * Helper function to convert UTF-8 string to unicode encoded.
+         * @since Series60 3.0
+         * @param aUtf8String   string to be converted.
+         * @return buffer as unicode, caller takes ownership.
+         */
+        IMPORT_C static HBufC16* ToUnicodeLC(const TDesC8& aUtf8String);
+
+        /**
+         * Helper function to determine if a string starts with another string.
+         * @since Series60 3.0
+         * @param aDes  string to be searched from.
+         * @param aPrefix   the prefix to be searched.
+         * @return ETrue if given string starts with given prefix, 
+         *          otherwise EFalse.
+         */
+        IMPORT_C static TBool StartsWith(const TDesC8& aDes,
+                                         const TDesC8& aPrefix);
+
+        /**
+         * Helper function to determine if a string ends with another string.
+         * @since Series60 3.0
+         * @param aDes  string to be searched from.
+         * @param aPrefix   the prefix to be searched.
+         * @return ETrue if given string ends with given prefix, 
+         *          otherwise EFalse.
+         */
+        IMPORT_C static TBool EndsWith(const TDesC8& aDes, const TDesC8& aPostfix);
+
+        /**
+         * Helper function to find a value of a given attribute.
+         * @since Series60 3.0
+         * @param aAttributes   Array which contains the attributes.
+         * @param aAttrName The name of the attribute which value is asked.
+         * @return The value of the wanted attribute, or KNullDesC8 if given
+         *          attribute name was not found.
+         */
+        IMPORT_C static TPtrC8  AttrValue(  const RAttributeArray& aAttributes,
+                                            const TDesC8& aAttrName);
+
+        /**
+         * Get a newly allocated copy of the attribute.
+         * @since Series60 3.0
+         * @param apAttrs       Array which contains the attributes.
+         * @param aAttrName The name of the attribute which value is asked.
+         * @return A buffer containing the value of the wanted attribute.
+         *          Buffer is newly allocated and ownership is transferred 
+         *          to the caller. Can be NULL if attribute was not found.
+         */
+        IMPORT_C static HBufC8* AllocAttrValueL(const RAttributeArray& apAttrs,
+                                                const TDesC8& aAttrName);
+
+        /**
+         * Helper function to construct a qualified name.
+         * @since Series60 3.0
+         * @param aPrefix       the prefix to be used.
+         * @param aLocalName    the local name to be used.
+         * @param   aQName      a ref-to-pointer which will contain the allocated
+         *                      qualified name. This param should be NULL when
+         *                      passed, otherwise memory leak will occur.
+         *                      Caller has the ownership of this buffer.
+         */
+        IMPORT_C static void BuildQNameL(   const TDesC8& aPrefix, 
+                                            const TDesC8& aLocalName,
+                                            HBufC8*& aQName);
+
+        /**
+         * Encodes XML-escaping characters found from aOriginal 
+         * to XML Basic Entities. 
+         * Note, that aEncoded is not re-assigned IF there were NO
+         * XML-escaping characters - '&', ''', '"', '<' or '>' -found.   
+         * Otherwise, when encoding has been done, the aEncoded points
+         * to newly allocated descriptor, which ownership belongs to
+         * the caller (who should have given aEncoded pointer as NULL
+         * in any case).
+         * @since Series60 3.0
+         * @param aOriginal the original descriptor.
+         * @param aEncoded      a ref-to-pointer which will contain the allocated
+         *                      encoded string. This param should be NULL when
+         *                      passed, otherwise memory leak will occur.
+         *                      Caller has the ownership of this buffer.
+         */
+        IMPORT_C static TBool EncodeHttpCharactersL(const TDesC8& aOriginal,
+                                                    HBufC8*& aEncoded);
+        /**
+         * Method leaves if aCandidate contains illegal, XML-escaping characters.
+         * Those characters, which will cause a leave are:
+         *                           '&', ''', '"', '<' and '>'
+         * @since Series60 3.0
+         * @param   aCandidate  string to be checked.
+         * Leave codes:
+         *      KErrSenInvalidCharacters    if contains invalid characters.
+         */
+        IMPORT_C static void LeaveOnXmlEscapesL(const TDesC8& aCandidate); 
+ 
+        /**
+         * Method leaves if aCandidate contains illegal, XML-escaping characters
+         * or is an empty descriptor.
+         * Those characters, which will cause a leave are:
+         *                           '&', ''', '"', '<' and '>'
+         * @since Series60 3.0
+         * @param   aCandidate  string to be checked.
+         * Leave codes:
+         *      KErrSenInvalidCharacters    if contains invalid characters.
+         *      KErrSenZeroLengthDescriptor if aCandidate is zero length
+         */
+        static void LeaveOnInvalidElementNameL(const TDesC8& aCandidate);
+        
+        /**
+         * Encodes XML-escaping characters found from aOriginal 
+         * to XML Basic Entities. 
+         *          Example: '&' -> '&amp;'
+         * Note! Function returns a copy of aOriginal descriptor,
+         * even if not a single illegal, XML-escaping character
+         * was encoded.
+         * The returned pointer to heap allocated descriptor is
+         * pushed to the cleanup stack.
+         * @since Series60 3.0
+         * @param   aOriginal   the string to be encoded.
+         * @return  a buffer containing the encoded string. 
+         *          Ownership is transferred to the caller.
+         */
+        IMPORT_C static HBufC8* EncodeHttpCharactersLC(const TDesC8& aOriginal);
+
+        /**
+         * Method to provide functionality for decoding HTTP characters into
+         * XML escaping characters.
+         * @since Series60 3.0
+         * @param   aOriginal   the string to be decoded.
+         * @param   aDecoded    the buffer that will contain the decoded string
+         *                      on return. Caller has the ownership of this.
+         *                      Will be similar as aOriginal if nothing was 
+         *                      replaced.
+         * @return ETrue if any XML escaping (some Basic Entity) 
+         *                  character-sequence was decoded.
+         */
+        IMPORT_C static TBool DecodeHttpCharactersL(const TDesC8& aOriginal,
+                                                HBufC8*& aDecoded);
+        
+        /**
+         * Same as DecodeHttpCharactersL(), but the decoded string OR
+         * exact copy of the aOriginal descriptor is returned and pushed
+         * to cleanup stack.
+         * @since Series60 3.0
+         * @param   aOriginal   the string to be decoded.
+         * @return buffer located in the cleanup stack containing the decoded 
+         *          string
+         */
+        IMPORT_C static HBufC8* DecodeHttpCharactersLC(const TDesC8& aOriginal);
+
+        /**
+         * Helper function to get a prefix from a qualified name.
+         * @since Series60 3.0
+         * @param   aQName  the qualified name
+         * @return the namespace prefix for the element, e.g. 'soap' for
+         *      'soap:Body'. The returned pointer is empty if there is no prefix.
+         */
+        IMPORT_C static TPtrC8 NsPrefix(const TDesC8& aQName);
+
+        /**
+         *  Helper function to get a local name from a qualified name.
+         *  @since Series60 3.0
+         *  @param  aQName  the qualified name
+         *  @return the local name for the element, e.g. 'Body' for
+         *      'soap:Body'.
+         */
+        IMPORT_C static TPtrC8 LocalName(const TDesC8& aQName);
+
+        /**
+        * Removes certain attribute from given element. May also be used when
+        * removing namespaces from the element.
+        * @param aElement   Element from which attribute will be removed.
+        * @param aAttrName  Attribute's local name
+        * @return pointer to removed attribute, which ownership is transferred to
+        * caller or NULL, if no matching attribute was found from this element. 
+        */
+        IMPORT_C static CSenBaseAttribute* RemoveAttributeL(CSenElement& aElement,
+                                                            const TDesC8& aAttrName);
+
+        /** 
+        * Removes attribute from this element.
+        * @param aElement       Element from which attribute will be removed.
+        * @param apAttribute    is the attribute to be removed.
+        * transferred to this element.
+        * @return pointer to removed attribute, which ownership is transferred to
+        * caller or NULL, if no matching attribute was found from this element. 
+        */
+        IMPORT_C static CSenBaseAttribute* RemoveAttributeL(CSenElement& aElement,
+                                                            CSenBaseAttribute* apAttribute);
+
+        /**
+        * Adds an attribute into this element. Used also adding new namespaces
+        * into the element.
+        * @param aQName     Attribute's qualified name
+        * @param aLocalName Attribute's local name
+        * @param aValue     Attribute's value
+        * @return value of the attribute as string (TDesC&)
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName or aQName contain illegal 
+        *       characters.     
+        *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
+        */
+        IMPORT_C static const TDesC8& AddAttributeL(CSenElement& aElement,
+                                                    const TDesC8& aQName,
+                                                    const TDesC8& aLocalName,
+                                                    const TDesC8& aValue);
+
+        /**
+        * Adds an attribute into this element. Used also adding new namespaces
+        * into the element.
+        * @param aLocalName Attribute's local name
+        * @param aValue     Attribute's value
+        * @return value of the attribute as string (TDesC&)
+        * Leave codes:  
+        *       KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+        *       KErrSenZeroLengthDescriptor if aAttrName is zero length, or
+        *       if the local name part of it is zero length.
+        */
+        IMPORT_C static const TDesC8& AddAttributeL(CSenElement& aElement,
+                                                    const TDesC8& aAttrName,
+                                                    const TDesC8& aValue);
+        /** 
+        * Adds an attribute into this element.
+        * @param apAttribute    Attribute to be added. Ownership is transferred
+        *                       to this element.
+        * @return attribute value as a string (TDesC8&)
+        */
+        IMPORT_C static const TDesC8& AddAttributeL(CSenElement& aElement,
+                                                    CSenBaseAttribute* apAttribute);
+        
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        SenXmlUtils() { }
+
+        /**
+        * Prohibit copy constructor if not deriving from CBase.
+        */
+        SenXmlUtils( const SenXmlUtils& );
+        
+        /** 
+        * Prohibit assignment operator if not deriving from CBase.
+        */
+        SenXmlUtils& operator=( const SenXmlUtils& );
+
+        /**
+        * Replaces the destination with the given values
+        */
+        static TBool ReplaceAll( TPtr8 aDestination, 
+                                 const TDesC8& aFrom,
+                                 const TDesC8& aTo );        
+
+		/**
+		* Finds the attribute with the given name
+		*/
+        static CSenBaseAttribute* FindAttrL( CSenElement& aElement,
+                                             const TDesC8& aName );
+    };
+
+#endif // SEN_XML_UTILS_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/Bwins/WSTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
Binary file websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/WS.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/eabi/WSTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,7 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+	_ZTI10CSAXTester @ 2 NONAME ; #<TI>#
+	_ZTI9CWSTester @ 3 NONAME ; #<TI>#
+	_ZTV10CSAXTester @ 4 NONAME ; #<VT>#
+	_ZTV9CWSTester @ 5 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/WSTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          WSTester.dll
+TARGETTYPE      dll
+//UID             0x1000008D 0x01111111
+UID             0x1000008D 0x101FB3E3 //generated by bat templates
+//UID             0x1000008D 0x101FB3E7 SAPREgiste from Yomi
+
+#if defined(EKA2)
+CAPABILITY	ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID 	0x00000000
+#endif
+
+//TARGETPATH      ?target_path
+DEFFILE         WSTester.DEF
+
+SOURCEPATH      ../src
+SOURCE          WSTester.cpp
+SOURCE          WSTesterBlocks.cpp
+SOURCE		SAXTester.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+
+LIBRARY         SENSERVCONN.lib
+LIBRARY		SENSERVDESC.LIB
+LIBRARY		SenXml.lib
+LIBRARY		SenServMgr.lib
+//LIBRARY		SenXmlInterface.lib // after Symbian XML integration it has to be removed
+LIBRARY		SenUtils.lib
+
+LIBRARY		efsrv.lib
+LIBRARY		imut.lib // base64 enc/dec
+LIBRARY		estor.lib
+LIBRARY		XMLFRAMEWORK.lib
+LIBRARY 	bafl.lib
+LIBRARY 	commdb.lib
+
+
+LANG			SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+//THUMB WINS WINSCW ARMV5
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+../sis/TestInit.bat		/epoc32/winscw/c/TestInit.bat
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+WSTester.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/ConnectionTimer.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+#ifndef CONNECTIONTIMER_H
+#define CONNECTIONTIMER_H
+
+//  INCLUDES
+
+#include <e32std.h>
+#include <e32base.h>
+
+class CConnectionTimer : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CConnectionTimer* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CConnectionTimer();
+
+    public: // New functions
+        
+        void SetConnectionTimer(TTimeIntervalMicroSeconds32 aTimeOut);
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CConnectionTimer( );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        //From Active
+        void RunL();
+		void DoCancel();
+		private:    // Data
+        //logging
+        RTimer iTimer;
+            };
+
+#endif      // CONNECTIONTIMER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/SAXTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef ADDRESSBOOKENGINE_H
+#define ADDRESSBOOKENGINE_H
+
+#include <SenBaseFragment.h>
+//#include <RXMLReader.h>
+#include <SenXmlReader.h>
+
+// FORWARD DECLARATIONS
+class CSAXTester : public CSenBaseFragment
+	{
+	public:
+		static CSAXTester* NewL( const TDesC8& aLocalName );
+		static CSAXTester* NewL( const TDesC8& aNsUri, const TDesC8& aLocalName );
+		static CSAXTester* NewL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName );
+		static CSAXTester* NewL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs );
+		static CSAXTester* NewL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs, CSenElement& aParent );
+		static CSAXTester* NewL( CSenElement& aParent );
+
+		void ConstructL();
+		void ConstructL( const TDesC8& aLocalName );
+		void ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName );
+		void ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName );
+		void ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs );
+		void ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs, CSenElement& aParent );
+		void ConstructL( CSenElement& aParent );
+		
+		virtual ~CSAXTester();
+		TBool CheckParsingStatus(TInt aStart, TInt aEnd, TInt aContent );
+		void SetRunCase(TInt aCase);
+   		CSenBaseFragment* GetDetachedDelegate();
+		CSenBaseFragment* GetDelegate();
+	
+		HBufC8* iAsXml;
+	protected:
+		virtual void StartElementL(
+			const TDesC8& aNsUri,
+			const TDesC8& aLocalName,
+			const TDesC8& aQName,
+			const RAttributeArray& aAttrs
+			);
+		virtual void EndElementL(
+			const TDesC8& aNsUri,
+			const TDesC8& aLocalName,
+			const TDesC8& aQName
+			);
+
+		virtual void CharactersL(
+			const TDesC8& aChars,
+			TInt aStart,
+			TInt aLength
+			);
+		
+		CSAXTester();
+		
+	private:
+
+		CSenXmlReader* iXmlReader;
+		TInt iStartElem;
+		TInt iEndElem;
+		TInt iContent;
+		TInt iRunCase;
+		CSenBaseFragment* iDelegate;
+		
+
+};
+
+#endif // ADDRESSBOOKENGINE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/WSTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,537 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+#ifndef WSTESTER_H
+#define WSTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <f32file.h>
+#include <imcvcodc.h> // for base64 codec
+#include <s32strm.h>
+
+//Sen
+#include <SenXmlServiceDescription.h>
+#include <SenServiceConnection.h>
+#include <SenCredential.h>
+
+#include <SenSoapMessage.h>
+#include <SenServiceManager.h>
+//#include <SenServiceManagerImpl.h>
+#include <SenIdentityProvider.h>
+#include <SenXmlUtils.h>
+#include <SenDateUtils.h>
+#include <SenServicePattern.h>
+#include "SAXTester.h"
+#include <SenBaseElement.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_MODULE_VERSION_MAJOR 30
+#define TEST_MODULE_VERSION_MINOR 9
+#define TEST_MODULE_VERSION_BUILD 38
+// Logging path
+_LIT( KWSTesterLogPath, "\\logs\\testframework\\WSTester\\" ); 
+// Log file
+_LIT( KWSTesterLogFile, "WSTester.txt" ); 
+_LIT8(KFixedHTTPPrefix, "http://");
+_LIT8(KFixedHTTPSPrefix, "https://");
+
+
+// Literals for SAX testing purposes
+_LIT8(KLName8, "Level1");
+_LIT8(KL2Name8, "Level2");
+_LIT8(KDefaultNS, "Default:NS:Test");
+_LIT8(KQName, "TestPre:Level1");
+_LIT8(KNsPrefix, "TestPre");
+_LIT8(KParseLocalMsg, "<Level1><Level2>Level2 content</Level2><Level2_b>Level2_b content</Level2_b></Level1>");
+_LIT8(KParseDifferentLocalMsg, "<Dif1><Level2>Level2 content</Level2></Dif1>");
+_LIT8(KParseLocalNs, "<Level1 xmlns=\"Default:NS:Test\"><Level2>Level2 content</Level2></Level1>");
+_LIT8(KParseLocalNsQ, "<TestPre:Level1 xmlns:TestPre=\"Default:NS:Test\"><Level2>Level2 content</Level2></TestPre:Level1>");
+_LIT8(KAttribute, "Atripuutti");
+_LIT8(KAttributeValue, "JustValue");
+_LIT8(KParseElemMsg, "<BaseFrag><Level2>Level2 content</Level2></BaseFrag>");
+_LIT8(KElementXml, "<BaseFrag></BaseFrag>");
+
+/**
+* Result and reference are indentical Test case should be passed.
+*/
+const TInt KResultOK = 0;
+/**
+* There is no result. Test case should be failed.
+*/
+const TInt KResultFailedNoResult = 1;
+/**
+* There is no reference. Test case should be failed.
+*/
+const TInt KResultFailedNoReference = 2;
+/**
+* Tesult and  reference are not identical. Test case should be failed.
+*/
+const TInt KResultFailedNotIdentical = 3;
+
+/**
+* A string in reference file was not found on the source.  Test case should be failed.
+*/
+const TInt KResultFailedFound = 4;
+
+//===============================Serene status
+const TInt KSubmit			= 1;
+const TInt KSend			= 2;
+const TInt KNewUriL			= 3;
+const TInt KNewUriLC		= 4;
+const TInt KNewSDescLC		= 5;
+const TInt KNewSDescL		= 6;
+const TInt KNewFooASURL		= 7;
+const TInt KNewLocalhost	= 8;
+const TInt KSendFoobar		= 9;
+const TInt KSendFW1			= 10;
+const TInt KSendFW2			= 11;
+const TInt KSendRegistered	= 12;
+const TInt KGetListTrue		= 13;
+const TInt KGetListFalse	= 14;
+const TInt KGetListTrueUE	= 15;
+const TInt KSendSOAP		= 16;
+const TInt KSubmitSOAP		= 17;
+const TInt KRegisterAndSend    = 18;
+const TInt KNewSPatternL	= 19;
+const TInt KNewSPatternLC	= 20;
+const TInt KBasicNewL		= 21;
+const TInt KBasicNewLC		= 22;
+const TInt KBasicEndpointURINewL		= 23;
+const TInt KBasicEndpointURINewLC		= 24;
+const TInt KSendEndPContr				= 25;
+const TInt KBasicAuthentication			= 26;
+const TInt KRegisterAndSendFalseLogin	= 27;
+const TInt KSubmitNonAlloc				= 28;
+const TInt KSubmitSOAPRequest			= 29;
+const TInt KBasicAuthenticationFalse	= 30;
+const TInt KSendSOAPRequest				= 31;
+const TInt KImplTesting					= 32;
+const TInt KSendLong					= 33;
+const TInt KEndpointMovedTest			= 34;
+const TInt KGetConnectionFooContaract	= 35;
+const TInt KSendASAbort					= 36;
+const TInt KInvalidLogin				= 37;
+const TInt KInvalidHost					= 38;
+const TInt KLowercase					= 40;
+const TInt KUppercase 					= 41;
+const TInt KAllowed 					= 42;
+const TInt KAllowedUppercase			= 43;
+const TInt KUppercaseAllowed			= 44;
+const TInt KAllowUpperTrun 				= 45;
+const TInt KInitialOK					= 46;
+const TInt KBasicDisco 					= 47;
+const TInt KInvalidCredentials 			= 48;
+const TInt KUnexistantDS				= 49;
+const TInt KTruncate 					= 50;
+const TInt KMultippleROs 				= 51;
+const TInt KDSFailed 					= 52;
+const TInt KDSFailedResult 				= 53;
+const TInt KNoCredentials 				= 54;
+const TInt KConnectAS					= 55;
+const TInt KSendBUCF	 				= 56;
+const TInt KSendBUCFBody 				= 57;
+const TInt KSendBUCFEnvelope			= 58;
+const TInt KInvalidWSP					= 59;
+const TInt KFacets						= 60;
+const TInt KDSEcrypted					= 61;
+const TInt KNoResourceID				= 62;
+const TInt KSendInvalidXML				= 63;
+const TInt KSendInvalidSOAP				= 64;
+const TInt KSendYomi					= 65;
+const TInt KSendBUCFEnvelope2			= 66;
+const TInt KDelegateParsing				= 67;	
+const TInt KDelegateParsing2			= 68;	
+const TInt KDetach						= 69;
+const TInt KNonSupportedAM				= 70;
+const TInt KCredentialsExpires			= 71;
+const TInt KServerError500				= 72;
+const TInt KServerError404				= 73;
+const TInt KHasFacet					= 74;
+const TInt KIsReady						= 75;
+const TInt KCompleteServerMessagesOnOff_1 = 76;
+const TInt KCompleteServerMessagesOnOff_2 = 77;
+const TInt KCompleteServerMessagesOnOff_3 = 78;
+const TInt KCompleteServerMessagesOnOff_4 = 79;
+const TInt KPerformanceSOAPSubmit		= 80;
+
+
+
+//NONSHARABLE_CLASS(CWSTester)
+class CWSTester: public CScriptBase, 	public MSenServiceConsumer
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CWSTester* NewL( CTestModuleIf& aTestModuleIf );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CWSTester();
+
+    public: // New functions
+        
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+        /**
+         * Method used to log version of test module
+         */
+        void SendTestModuleVersion();
+                
+    protected:  // New functions
+        
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+        
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CWSTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+    
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+        
+
+
+		TInt CheckNonIncludanceL(TPtrC aSrcFile, TPtrC aReferenceFile);
+		TInt CheckIncludanceL(TPtrC aSrcFile, TPtrC aReferenceFile);
+		TInt TestFacets();
+		HBufC8* DeBase64DescL(TDesC8& aMessage);
+        /**
+        * Test methods are listed below. 
+        */
+
+/*################################################
+*
+*        
+*   SERVICE MANAGER DLL
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            Service Manager
+-----------------------------------------------*/
+
+    virtual TInt _S_NewServiceManager( CStifItemParser& aItem );
+    virtual TInt _S_RegisterIdentityProvider( CStifItemParser& aItem );
+    virtual TInt _S_UnregisterIdentityProvider( CStifItemParser& aItem );
+    virtual TInt _S_AssociateService( CStifItemParser& aItem );
+    virtual TInt _S_DissociateService( CStifItemParser& aItem );
+    virtual TInt _S_RegisterServiceDescription( CStifItemParser& aItem );
+    virtual TInt _S_UnregisterServiceDescription( CStifItemParser& aItem );
+    virtual TInt _S_ServiceDescriptions( CStifItemParser& aItem );
+   	virtual TInt _S_ServiceDescriptionsByUri( CStifItemParser& aItem );
+	virtual TInt _S_InstallFramework( CStifItemParser& aItem );
+
+
+/*################################################
+*
+*        
+*   XML DLL
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            SAX based parsing
+-----------------------------------------------*/
+virtual TInt _S_NewSAXFragment( CStifItemParser& aItem );
+virtual TInt _S_SAXTest( CStifItemParser& aItem );
+
+/*-----------------------------------------------
+            DOM based parsing
+-----------------------------------------------*/
+		virtual TInt _S_LocalName( CStifItemParser& aItem );
+		virtual TInt _S_NamespaceURI( CStifItemParser& aItem );
+		virtual TInt _S_SetNamespace( CStifItemParser& aItem );
+		virtual TInt _S_NsPrefix( CStifItemParser& aItem );
+		virtual TInt _S_SetPrefix( CStifItemParser& aItem );
+		virtual TInt _S_HasContent( CStifItemParser& aItem );
+		virtual TInt _S_Content( CStifItemParser& aItem );
+		virtual TInt _S_ContentUnicode( CStifItemParser& aItem );
+		virtual TInt _S_SetContent( CStifItemParser& aItem );
+		virtual TInt _S_AddNamespace( CStifItemParser& aItem );
+		virtual TInt _S_AttrValue( CStifItemParser& aItem );
+		virtual TInt _S_AddAttr( CStifItemParser& aItem );
+		virtual TInt _C_Namespace( CStifItemParser& aItem );
+		virtual TInt _C_Elements( CStifItemParser& aItem );
+		virtual TInt _C_Attributes( CStifItemParser& aItem );
+		virtual TInt _C_Namespaces( CStifItemParser& aItem );
+		virtual TInt _C_Parent( CStifItemParser& aItem );
+		virtual TInt _C_Root( CStifItemParser& aItem );
+		virtual TInt _C_SetParent( CStifItemParser& aItem );
+		virtual TInt _C_Element( CStifItemParser& aItem );
+		virtual TInt _C_CreateElement( CStifItemParser& aItem );
+		virtual TInt _C_InsertElement( CStifItemParser& aItem );
+		virtual TInt _S_AddElement( CStifItemParser& aItem );
+		virtual TInt _S_RemoveElement( CStifItemParser& aItem );
+		virtual TInt _C_ReplaceElement( CStifItemParser& aItem );
+		virtual TInt _S_AsXml( CStifItemParser& aItem );
+		virtual TInt _S_AsXmlUnicode( CStifItemParser& aItem );
+		virtual TInt _C_AsElement( CStifItemParser& aItem );
+		virtual TInt _C_CopyFrom( CStifItemParser& aItem );
+		virtual TInt _C_Detach( CStifItemParser& aItem );
+		virtual TInt _C_Child( CStifItemParser& aItem );
+		virtual TInt _C_AllocAttrValue( CStifItemParser& aItem );
+		virtual TInt _S_Set( CStifItemParser& aItem );
+		virtual TInt _S_WriteAsXMLTo( CStifItemParser& aItem );
+		virtual TInt _S_WriteNamespacesTo( CStifItemParser& aItem );
+		virtual TInt _S_ContentWriteStream( CStifItemParser& aItem );
+		virtual TInt _S_SetAttributes( CStifItemParser& aItem );
+
+/*################################################
+*
+*        
+*   SERVICE DESCRIPTION DLL
+*
+*
+*################################################*/
+/*-----------------------------------------------
+            Service Connection
+-----------------------------------------------*/
+        virtual TInt _S_NewServiceConnection( CStifItemParser& aItem );
+   		virtual TInt _S_CompleteServerMessagesOnOff( CStifItemParser& aItem );
+		virtual TInt _S_TransactionCompleted( CStifItemParser& aItem );
+		virtual TInt _S_StartTransaction( CStifItemParser& aItem );
+
+/*-----------------------------------------------
+            XML Service Description
+-----------------------------------------------*/
+        
+        virtual TInt _S_NewXMLServiceDescription( CStifItemParser& aItem );
+        virtual TInt _S_EndPoint( CStifItemParser& aItem );
+        virtual TInt _S_Contract( CStifItemParser& aItem );
+        virtual TInt _S_FrameworkId( CStifItemParser& aItem );
+        virtual TInt _C_ProviderIDToService( CStifItemParser& aItem );
+        virtual TInt _S_ConsumerIapId( CStifItemParser& aItem );
+/*-----------------------------------------------
+            Service Pattern
+-----------------------------------------------*/
+        virtual TInt _S_NewServicePattern( CStifItemParser& aItem );
+/*-----------------------------------------------
+            IdentityProvider
+-----------------------------------------------*/
+        virtual TInt _S_NewIdentityProvider( CStifItemParser& aItem );
+        virtual TInt _S_ProviderID( CStifItemParser& aItem );
+        virtual TInt _S_UserInfo( CStifItemParser& aItem );
+/*################################################
+*
+*        
+*   UTILS
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            SoapEnvelope
+-----------------------------------------------*/
+        virtual TInt _C_Body( CStifItemParser& aItem );
+/*-----------------------------------------------
+            SoapDateUtils
+-----------------------------------------------*/
+        virtual TInt _C_FromXmlDateTime( CStifItemParser& aItem );
+        virtual TInt _C_ToXmlDateTimeUtf( CStifItemParser& aItem );
+
+
+
+/*################################################
+            MService Consumer implementation
+################################################*/
+		virtual void HandleMessageL(const TDesC8& aMessage);
+		//virtual void HandleErrorL(const TDesC8& aError);
+        virtual void HandleErrorL(const int aErrorCode, const TDesC8& aError);
+		virtual void SetStatus(const TInt aStatus);
+
+/*################################################
+            Common
+################################################*/
+        virtual TInt _X_WaitForResponse( CStifItemParser& aItem );
+        virtual TInt _X_Reference( CStifItemParser& aItem );
+        virtual TInt _X_ReferenceFragment( CStifItemParser& aItem );
+        virtual TInt _X_CheckResultFL( CStifItemParser& aItem );
+        virtual TInt _X_LogResult( CStifItemParser& aItem );
+        virtual TInt _X_Init( CStifItemParser& aItem );
+        virtual TInt _X_DeleteFile( CStifItemParser& aItem );
+		virtual TInt _X_TimeOut(CStifItemParser& aItem );
+        virtual TInt _X_Flag(CStifItemParser& aItem );
+		virtual TInt _X_NonIncludance( CStifItemParser& aItem );
+		virtual TInt _X_Includance( CStifItemParser& aItem );
+		virtual TInt _X_DeBase64( CStifItemParser& aItem );
+		virtual TInt _X_CheckDir( CStifItemParser& aItem );
+		virtual TInt _X_CheckFile( CStifItemParser& aItem );
+		virtual TInt _X_SOAPRequest( CStifItemParser& aItem );		
+		virtual TInt _X_NonExistence( CStifItemParser& aItem );
+		virtual TInt _X_Iteration( CStifItemParser& aItem );
+
+/*################################################
+            IAP Selection
+################################################*/
+
+
+		virtual TInt _X_IAPList( CStifItemParser& aItem );
+//		virtual TInt _C_SetIAP( CStifItemParser& aItem );
+		
+
+/*################################################
+            Complex
+################################################*/
+        virtual TInt _C_ParseDomFragment( CStifItemParser& aItem );
+        virtual TInt _C_ParseXMLDocument( CStifItemParser& aItem );
+        virtual TInt _C_Dump(CStifItemParser& aItem );
+   		virtual TInt _C_ParseToElement(CStifItemParser& aItem );
+
+
+		void SendBUCFTest();
+		void SendYomiTest();
+		void SendInvalidTest();
+		void SendInvalidSOAPTest();
+		void SendBUCFBodyTest();
+		void SendBUCFEnvelopeTest();
+		void SendBUCFEnvelopeTest2();
+        void SendSOAPTest();
+        void SubmitSOAPTest();
+   		void SendSOAPRequest(TInt aDelay);
+		void SubmitSOAPRequest();        
+		void CheckConnection();
+		void PerformanceSOAPSubmit();
+
+        TInt CheckResultL(TPtrC aSrcFile, TPtrC aReferenceFile);
+        TInt CheckResultFragmentL(TPtrC aSrcFile, TPtrC aReferenceFile);
+        void LogResultL(const TDesC16& aDesc16);
+        void LogResultL(const TDesC8& aDesc8);
+        TPtrC8 GetParC(CStifItemParser& aItem);
+        void PopAndDestroyArgc();
+   		CSenElement* ParseToElementL( HBufC8* pTestXml );
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+    
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+		RStringPool iStringPool;
+        //logging
+        CStifLogger* iLog;
+        //For decrypting data....
+		TImCodecB64 iBase64Codec;
+        RFs	iFsSession;
+        TInt iRunCase;
+        TInt iStarted;
+        //for implemented void methos, if f.ex. handle message is wrongwe have to signalize error
+        TInt iErrorsOccured;
+        //counter for arguments in script, arguments have to destroyed after parsing
+        TInt iArgc;
+   		//RXMLReader iXmlReader;
+        CSenXmlReader* iXmlReader;
+   		CSenElement* iElement;
+
+
+        RFile iResultFile;
+        RFileWriteStream iWriter;
+        TInt result;
+        TPtrC iResFile;
+        TInt iTestIteracion;
+
+        // simple query
+		TBuf8<255>	iSOAPRequest;
+
+		TBool iCasePassed;
+
+        
+        CSenSoapMessage* iSOAPMessage;
+//Service Connection
+        CSenServiceConnection* iSenServiceConnection;
+//Service Description
+        CSenXmlServiceDescription* iSenXmlServiceDescription;
+//Service manager
+        CSenServiceManager*     iServiceManager;
+//IdentityProvider
+        CSenIdentityProvider*   iProvider;
+//Credential
+        CSenCredential*   iSenCredential;
+
+		CSAXTester*		iSaxTester;
+		CSenBaseFragment* iFrg;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+#endif      // WSTESTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,35 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+; Languages
+; none -  English only by default
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices XMLExtensions"},(0x10282C8A),1,0,0,TYPE=SA
+[0x101F7961],3,*,*,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\wstester.dll"-"!:\sys\bin\wstester.dll"
+"\Epoc32\winscw\c\TestInit.bat"-"!:\TestInit.bat"
Binary file websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/TestInit.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,25 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+e:
+
+cd ws
+
+setup
+
+Wscopy
+
+c:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/ConnectionTimer.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "ConnectionTimer.h"
+
+CConnectionTimer* CConnectionTimer::NewL(){
+       CConnectionTimer* self = new(ELeave) CConnectionTimer;
+       CleanupStack::PushL(self);
+       self->ConstructL();
+       return self;
+}
+CConnectionTimer::CConnectionTimer():CActive(0){
+}
+CConnectionTimer::~CConnectionTimer(){
+    Cancel();
+    iTimer.Close();
+}
+void CConnectionTimer::ConstructL(){
+    User::LeaveIfError(iTimer.CreateLocal());
+    CActiveScheduler::Add(this);
+}
+void CConnectionTimer::SetConnectionTimer(TTimeIntervalMicroSeconds32 aTimeOut){
+    iTimer.After(iStatus, aTimeOut);
+    SetActive();
+}
+
+void CConnectionTimer::RunL(){
+    CActiveScheduler::Stop();
+}
+void CConnectionTimer::DoCancel(){
+    iTimer.Cancel();
+}
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/SAXTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,322 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "SAXTester.h"
+#include "WSTester.h"
+
+#define STATUS_NEW 0
+#define STATUS_READY 1
+#define STATUS_EXPIRED 2
+
+namespace
+	{
+	}
+
+enum TErrorState
+	{
+	ENoError = 0,
+	ESoapError,
+	ENestedError
+	};
+
+CSAXTester::CSAXTester( ):
+	iDelegate(NULL)
+    {
+	iStartElem = 0;
+	iEndElem = 0;
+	iContent = 0;
+	iRunCase = 0;
+	iAsXml	 = NULL;
+    }
+CSAXTester::~CSAXTester()
+	{
+	delete iXmlReader;
+	delete iAsXml;
+	if(iDelegate)
+		{
+//		iDelegate->ExtractElement(); // if delegate's element is onwned by this class
+		delete iDelegate;
+		}
+	}
+
+CSAXTester* CSAXTester::NewL(const TDesC8& aLocalName)
+	{
+	CSAXTester* saxTester = new (ELeave) CSAXTester();
+	CleanupStack::PushL(saxTester);
+	saxTester->ConstructL( aLocalName );
+	CleanupStack::Pop();
+	return saxTester;
+	}
+
+CSAXTester* CSAXTester::NewL(const TDesC8& aNsUri, const TDesC8& aLocalName )
+	{
+	CSAXTester* saxTester = new (ELeave) CSAXTester();
+	CleanupStack::PushL(saxTester);
+	saxTester->ConstructL( aNsUri, aLocalName );
+	CleanupStack::Pop();
+	return saxTester;
+	}
+CSAXTester* CSAXTester::NewL(const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName  )
+	{
+	CSAXTester* saxTester = new (ELeave) CSAXTester();
+	CleanupStack::PushL(saxTester);
+	saxTester->ConstructL( aNsUri, aLocalName, aQName );
+	CleanupStack::Pop();
+	return saxTester;
+	}
+CSAXTester* CSAXTester::NewL(const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs  )
+	{
+	CSAXTester* saxTester = new (ELeave) CSAXTester();
+	CleanupStack::PushL(saxTester);
+	saxTester->ConstructL( aNsUri, aLocalName, aQName, apAttrs );
+	CleanupStack::Pop();
+	return saxTester;
+	}
+CSAXTester* CSAXTester::NewL(const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs, CSenElement& aParent  )
+	{
+	CSAXTester* saxTester = new (ELeave) CSAXTester();
+	CleanupStack::PushL(saxTester);
+	saxTester->ConstructL( aNsUri, aLocalName, aQName, apAttrs, aParent );
+	CleanupStack::Pop();
+	return saxTester;
+	}
+
+CSAXTester* CSAXTester::NewL(CSenElement& aParent  )
+	{
+	CSAXTester* saxTester = new (ELeave) CSAXTester();
+	CleanupStack::PushL(saxTester);
+	saxTester->ConstructL( aParent );
+	CleanupStack::Pop();
+	return saxTester;
+	}
+
+void CSAXTester::ConstructL()
+	{
+//	CSenBaseFragment::BaseConstructL(KPpContract, KQueryResponseLocalName);
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+void CSAXTester::ConstructL( const TDesC8& aLocalName )
+	{
+	CSenBaseFragment::BaseConstructL( aLocalName );
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+
+void CSAXTester::ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName  )
+	{
+	CSenBaseFragment::BaseConstructL( aNsUri, aLocalName );
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+
+void CSAXTester::ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName )
+	{
+	CSenBaseFragment::BaseConstructL( aNsUri, aLocalName, aQName );
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+void CSAXTester::ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs )
+	{
+	CSenBaseFragment::BaseConstructL( aNsUri, aLocalName, aQName, apAttrs );
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+void CSAXTester::ConstructL( const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const RAttributeArray& apAttrs, CSenElement& aParent )
+	{
+	CSenBaseFragment::BaseConstructL( aNsUri, aLocalName, aQName, apAttrs, aParent );
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+void CSAXTester::ConstructL( CSenElement& aParent )
+	{
+	CSenBaseFragment::BaseConstructL( aParent );
+	//iReader.CreateL();
+	iXmlReader = CSenXmlReader::NewL();
+	}
+
+void CSAXTester::StartElementL(	const TDesC8& aNsUri,
+										const TDesC8& aLocalName,
+										const TDesC8& aQName,
+										const RAttributeArray& aAttrs)
+	{
+	
+	iStartElem++;
+
+	if (iRunCase == KDelegateParsing && aLocalName == KL2Name8)
+		{
+		iState = KStateIgnore;
+		iDelegate = CSenBaseFragment::NewL(KL2Name8);
+		DelegateParsingL( *iDelegate );
+		}
+	else if (iRunCase == KDelegateParsing2 && iStartElem == 2)
+		{
+		iState = KStateIgnore;
+		DelegateParsingL( aNsUri, aLocalName, aQName, aAttrs );
+		
+		}
+   	else if (iRunCase == KDetach && aLocalName == KL2Name8)
+		{
+		iState = KStateIgnore;
+		iDelegate = CSenBaseFragment::NewL( KDefaultNS(), KL2Name8()  );
+		DelegateParsingL( *iDelegate );
+
+		}
+	else 
+		{
+		CSenBaseFragment::StartElementL( aNsUri, aLocalName, aQName , aAttrs );
+		}
+
+	
+//	LOG_L("CAddressBookEngine::StartElementL() ***");
+//	LOG_FORMAT((_L("- namespace URI  (%S)"), aNsUri));
+//	LOG_FORMAT((_L("- localname      (%S)"), aLocalName));
+//	LOG_FORMAT((_L("- qualified name (%S)"), aQName));
+//
+//	if (aLocalName == KStatus)
+//		{
+//		
+//		if (SenXmlUtils::LocalName(SenXmlUtils::AttrValue(aAttrs, KCode)) != KOk)
+//			{
+//			iErrorState = ENestedError;
+//			delete iFaultDelegate;
+//			iFaultDelegate = NULL;
+//			iFaultDelegate = CSenDomFragment::NewL(aNsUri,
+//							aLocalName, aQName, aAttrs);
+//			DelegateParsingL(*iFaultDelegate);
+//			return;
+//			}
+//		}
+//	else if (aLocalName == KCard)
+//		{
+//		iErrorState = ENoError;
+//
+//		CContact* delegate = CContact::NewL();
+//		iContacts.Append(delegate);
+//		DelegateParsingL(*delegate);
+//		return;
+//		}
+	}
+void CSAXTester::EndElementL(	const TDesC8& aNsUri,
+										const TDesC8& aLocalName,
+										const TDesC8& aQName)
+	{
+	iEndElem++;
+	if(iRunCase == KDelegateParsing || iRunCase == KDelegateParsing2 || 
+		iRunCase == KDetach )
+		{
+		if(aLocalName == KL2Name8 )
+			{
+			// got a call from delegate created by this class
+			iState = KStateSave;
+
+			// we could delete delegate here to efficiently free memory
+			// asap
+			}
+		else
+			{
+			CSenBaseFragment::EndElementL( aNsUri, aLocalName, aQName );
+			}
+		}
+	else
+		{
+		CSenBaseFragment::EndElementL( aNsUri, aLocalName, aQName );
+		}
+//	if(aLocalName == KStatus)
+//		{
+//		if (iErrorState == ENestedError)
+//			{
+//			iErrorState = ENoError;
+//			CSenElement* statusElement = NULL;
+//			if (iFaultDelegate)
+//				{
+//					statusElement =
+//						iFaultDelegate->AsElement().Element(KStatus);
+//				}
+//
+//			if(statusElement)
+//				{
+//				const TDesC8* errorCode = statusElement->AttrValue(KCode);
+//				iContacts.ResetAndDestroy();
+//				if (errorCode)
+//					{
+//					if (SenXmlUtils::LocalName(*errorCode) == KTooManyMatches)
+//						{
+//						iObserver.ErrorL(ETooManyMatches);
+//						}
+//					else
+//						{
+//						iObserver.ErrorL(ESearchFailed); // Default error
+//						}
+//					}
+//				}
+//			else
+//				{
+//				// could not find status element:
+//				iObserver.ErrorL(ESearchFailed); // Default error
+//				}
+//			}
+//		else if (iErrorState == ESoapError)
+//			{
+//			iErrorState = ENoError;
+//			delete iFaultDelegate;
+//			iFaultDelegate = NULL;
+//			iContacts.ResetAndDestroy();
+//			iObserver.ErrorL(ESearchFailed); // Default error
+//			}
+//
+//		}
+//	else
+//		{
+//		CSenBaseFragment::EndElementL(aNsUri, aLocalName, aQName);
+//		}
+	}
+
+void CSAXTester::CharactersL(	const TDesC8& aChars,
+								TInt aStart,
+								TInt aLength
+							)
+	{
+	CSenBaseFragment::CharactersL( aChars, aStart, aLength );
+
+	iContent++;
+	}
+
+TBool CSAXTester::CheckParsingStatus(TInt aStart, TInt aEnd, TInt aContent )
+	{
+		if (aStart != iStartElem || aEnd != iEndElem || aContent != iContent )
+			{
+			return EFalse;
+			}
+		else
+			{
+			return ETrue;
+			}
+	}
+void CSAXTester::SetRunCase(TInt aCase)
+	{
+	iRunCase = aCase;
+	}
+CSenBaseFragment* CSAXTester::GetDetachedDelegate()
+	{
+	iDelegate->DetachL();
+	return iDelegate;
+	}
+CSenBaseFragment* CSAXTester::GetDelegate()
+	{
+	return iDelegate;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "WSTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWSTester::CWSTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CWSTester::CWSTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf ),
+		iFrg(NULL)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CWSTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CWSTester::ConstructL()
+    {
+    //__UHEAP_MARK;
+    iLog = CStifLogger::NewL( KWSTesterLogPath, 
+                          KWSTesterLogFile,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    User::LeaveIfError(this->iFsSession.Connect());
+	iXmlReader = CSenXmlReader::NewL();
+    iErrorsOccured = FALSE;
+	iCasePassed = EFalse;
+    iLog->Log(_L("                     /------------\\"));
+    iLog->Log(_L("--------------------- New testcase -------------"));
+    iLog->Log(_L("                     \\------------/"));
+	iStringPool.OpenL();
+	iElement = NULL;
+	iFrg = NULL;
+	iProvider = NULL;
+	iArgc = 0;
+	iRunCase = 0;
+	iSaxTester = NULL;
+	iSenCredential = NULL;
+	iSenServiceConnection = NULL;
+	iSenXmlServiceDescription = NULL;
+	iServiceManager = NULL;
+	iSOAPMessage = NULL;
+	SendTestModuleVersion();
+    }
+//-----------------------------------------------------------------------------
+// CWSTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CWSTester::SendTestModuleVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("WSTester.dll");
+	
+
+	TBool newVersionOfMethod = ETrue;
+	CTestModuleIf &test=TestModuleIf();
+	test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	test.SetBehavior(CTestModuleIf::ETestLeaksHandles);
+	}
+
+// -----------------------------------------------------------------------------
+// CWSTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CWSTester* CWSTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CWSTester* self = new (ELeave) CWSTester( aTestModuleIf );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    
+    }
+    
+// Destructor
+CWSTester::~CWSTester()
+    { 
+    
+    // Delete resources allocated from test methods
+    Delete();
+    iWriter.Close();
+    iFsSession.Close();    
+    // Delete logger
+    delete iLog;  
+
+    if ( iSenServiceConnection != NULL ){
+        delete iSenServiceConnection ;
+	    iSenServiceConnection = NULL;
+    }
+    if ( iSenXmlServiceDescription!= NULL ){
+        delete iSenXmlServiceDescription;
+	    iSenXmlServiceDescription = NULL;
+    }
+    if ( iServiceManager!= NULL ){
+        delete iServiceManager;
+	    iServiceManager = NULL;
+    }
+    if ( iProvider!= NULL ){
+        delete iProvider;
+	    iProvider = NULL;
+    }
+	if ( iXmlReader != NULL ){
+        delete iXmlReader;
+	    iXmlReader = NULL;
+    }
+    
+    if ( iSOAPMessage != NULL ){
+        delete iSOAPMessage;
+	    iSOAPMessage = NULL;
+    }
+    if ( iSaxTester != NULL ){
+        delete iSaxTester;
+	    iSaxTester = NULL;
+    }
+   	if ( iElement != NULL ){
+        delete iElement;
+        iElement = NULL;
+    }
+
+	iStringPool.Close();
+
+	delete iFrg;
+	iFrg = NULL;
+
+    //__UHEAP_MARKEND;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+    
+    return ( CScriptBase* ) CWSTester::NewL( aTestModuleIf );
+        
+    }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function.
+// Returns: KErrNone
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+    TDllReason /*aReason*/) // Reason code
+    {
+    return(KErrNone);
+    
+    }
+#endif // EKA2
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,4535 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include <SenNameSpace.h>
+#include "WSTester.h"
+#include "SAXTester.h"
+#include <commdb.h>
+
+
+
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CWSTester::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void CWSTester::Delete()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CWSTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CWSTester::RunMethodL(
+    CStifItemParser& aItem )
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {
+        // Copy this line for every implemented function.
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function.
+        ENTRY( "_S_NewXMLServiceDescription", CWSTester::_S_NewXMLServiceDescription),
+        ENTRY( "_S_NewServicePattern", CWSTester::_S_NewServicePattern),
+        ENTRY( "_S_RegisterServiceDescription", CWSTester::_S_RegisterServiceDescription),
+        ENTRY( "_S_UnregisterServiceDescription", CWSTester::_S_UnregisterServiceDescription),
+  		ENTRY( "_S_InstallFramework", CWSTester::_S_InstallFramework),
+        ENTRY( "_S_EndPoint", CWSTester::_S_EndPoint),
+        ENTRY( "_S_Contract", CWSTester::_S_Contract),
+        ENTRY( "_S_ConsumerIapId", CWSTester::_S_ConsumerIapId),
+        ENTRY( "_C_ProviderIDToService", CWSTester::_C_ProviderIDToService),
+        ENTRY( "_S_FrameworkId", CWSTester::_S_FrameworkId),
+        ENTRY( "_S_NewServiceConnection", CWSTester::_S_NewServiceConnection),
+        ENTRY( "_C_Body", CWSTester::_C_Body),
+        ENTRY( "_C_Dump", CWSTester::_C_Dump),
+        ENTRY( "_S_NewServiceManager", CWSTester::_S_NewServiceManager),
+        ENTRY( "_S_NewIdentityProvider", CWSTester::_S_NewIdentityProvider),
+        ENTRY( "_S_ProviderID", CWSTester::_S_ProviderID),
+        ENTRY( "_S_UserInfo", CWSTester::_S_UserInfo),
+        ENTRY( "_S_RegisterIdentityProvider", CWSTester::_S_RegisterIdentityProvider),
+        ENTRY( "_S_UnregisterIdentityProvider", CWSTester::_S_UnregisterIdentityProvider),
+        ENTRY( "_S_AssociateService", CWSTester::_S_AssociateService),
+        ENTRY( "_S_DissociateService", CWSTester::_S_DissociateService),
+        ENTRY( "_S_ServiceDescriptions", CWSTester::_S_ServiceDescriptions),
+ 		ENTRY( "_S_ServiceDescriptionsByUri", CWSTester::_S_ServiceDescriptionsByUri),
+		ENTRY( "_C_ParseDomFragment", CWSTester::_C_ParseDomFragment),
+        ENTRY( "_C_ParseXMLDocument", CWSTester::_C_ParseXMLDocument),
+        ENTRY( "_C_FromXmlDateTime", CWSTester::_C_FromXmlDateTime),
+        ENTRY( "_C_ToXmlDateTimeUtf", CWSTester::_C_ToXmlDateTimeUtf),
+        ENTRY( "_X_WaitForResponse", CWSTester::_X_WaitForResponse),
+        ENTRY( "_X_Reference", CWSTester::_X_Reference),
+        ENTRY( "_X_ReferenceFragment", CWSTester::_X_ReferenceFragment),
+        ENTRY( "_X_LogResult", CWSTester::_X_LogResult),
+        ENTRY( "_X_Init", CWSTester::_X_Init),
+        ENTRY( "_X_DeleteFile", CWSTester::_X_DeleteFile),
+		ENTRY( "_X_TimeOut", CWSTester::_X_TimeOut),
+        ENTRY( "_X_Flag", CWSTester::_X_Flag),
+        ENTRY( "_X_NonIncludance", CWSTester::_X_NonIncludance),
+        ENTRY( "_X_Includance", CWSTester::_X_Includance),
+        ENTRY( "_X_DeBase64", CWSTester::_X_DeBase64),
+   		ENTRY( "_X_CheckDir", CWSTester::_X_CheckDir),
+		ENTRY( "_X_CheckFile", CWSTester::_X_CheckFile),
+		ENTRY( "_S_CompleteServerMessagesOnOff", CWSTester::_S_CompleteServerMessagesOnOff),
+		ENTRY( "_X_SOAPRequest", CWSTester::_X_SOAPRequest),
+		ENTRY( "_X_NonExistence", CWSTester::_X_NonExistence ),
+   		ENTRY( "_S_NewSAXFragment", CWSTester::_S_NewSAXFragment ),
+		ENTRY( "_S_SAXTest", CWSTester::_S_SAXTest ),
+        		ENTRY( "_C_ParseToElement", CWSTester::_C_ParseToElement),
+		ENTRY( "_S_LocalName", CWSTester::_S_LocalName),
+		ENTRY( "_S_NamespaceURI", CWSTester::_S_NamespaceURI),
+		ENTRY( "_S_SetNamespace", CWSTester::_S_SetNamespace),
+		ENTRY( "_S_NsPrefix", CWSTester::_S_NsPrefix),
+        ENTRY( "_S_SetPrefix", CWSTester::_S_SetPrefix),
+		ENTRY( "_S_HasContent", CWSTester::_S_HasContent),
+		ENTRY( "_S_Content", CWSTester::_S_Content),
+		ENTRY( "_S_ContentUnicode", CWSTester::_S_ContentUnicode),
+		ENTRY( "_S_SetContent", CWSTester::_S_SetContent),
+		ENTRY( "_S_AddNamespace", CWSTester::_S_AddNamespace),
+		ENTRY( "_S_AttrValue", CWSTester::_S_AttrValue),
+		ENTRY( "_S_AddAttr", CWSTester::_S_AddAttr),
+		ENTRY( "_C_Namespace", CWSTester::_C_Namespace),
+		ENTRY( "_C_Elements", CWSTester::_C_Elements),
+		ENTRY( "_C_Attributes", CWSTester::_C_Attributes),
+		ENTRY( "_C_Namespaces", CWSTester::_C_Namespaces),
+		ENTRY( "_C_Parent", CWSTester::_C_Parent),
+		ENTRY( "_C_Root", CWSTester::_C_Root),
+		ENTRY( "_C_SetParent", CWSTester::_C_SetParent),
+		ENTRY( "_C_Element", CWSTester::_C_Element),
+		ENTRY( "_C_CreateElement", CWSTester::_C_CreateElement),
+		ENTRY( "_C_InsertElement", CWSTester::_C_InsertElement),
+		ENTRY( "_S_AddElement", CWSTester::_S_AddElement),
+		ENTRY( "_S_RemoveElement", CWSTester::_S_RemoveElement),
+		ENTRY( "_C_ReplaceElement", CWSTester::_C_ReplaceElement),
+		ENTRY( "_S_AsXml", CWSTester::_S_AsXml),
+		ENTRY( "_S_AsXmlUnicode", CWSTester::_S_AsXmlUnicode),
+		ENTRY( "_C_AsElement", CWSTester::_C_AsElement),
+		ENTRY( "_C_CopyFrom", CWSTester::_C_CopyFrom),
+		ENTRY( "_C_Detach", CWSTester::_C_Detach),
+		ENTRY( "_C_Child", CWSTester::_C_Child),
+		ENTRY( "_C_AllocAttrValue", CWSTester::_C_AllocAttrValue),
+		ENTRY( "_S_SetAttributes", CWSTester::_S_SetAttributes),
+		ENTRY( "_S_Set", CWSTester::_S_Set),
+		ENTRY( "_S_WriteAsXMLTo", CWSTester::_S_WriteAsXMLTo),
+		ENTRY( "_S_WriteNamespacesTo", CWSTester::_S_WriteNamespacesTo),
+		ENTRY( "_S_ContentWriteStream", CWSTester::_S_ContentWriteStream),
+   		ENTRY( "_S_TransactionCompleted", CWSTester::_S_TransactionCompleted),
+		ENTRY( "_S_StartTransaction", CWSTester::_S_StartTransaction),
+   		ENTRY( "_X_Iteration", CWSTester::_X_Iteration),
+   		ENTRY( "_X_IAPList", CWSTester::_X_IAPList),
+        ENTRY( "_X_CheckResultFL", CWSTester::_X_CheckResultFL),
+   		
+        };
+
+    const TInt count = sizeof( KFunctions ) /
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+/*################################################
+*
+*
+*   SERVICE MANAGER DLL
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            Service Manager
+-----------------------------------------------*/
+
+TInt CWSTester::_S_NewServiceManager( CStifItemParser& aItem ){
+        iLog->Log(_L("*******NewServiceManager -> Started!********"));
+		iLog->Log(_L("Creating service manager instance..."));
+
+        if ( iServiceManager!= NULL ){
+            delete iServiceManager;
+	        iServiceManager = NULL;
+        }
+    	iServiceManager = CSenServiceManager::NewL();
+        if (iServiceManager == NULL){
+            return KErrNotFound;
+        }
+        iLog->Log(_L("Service manager instance created!"));
+        return KErrNone;
+}
+
+TInt CWSTester::_S_RegisterIdentityProvider( CStifItemParser& aItem ){
+
+        iLog->Log(_L("*******"));
+		iLog->Log(_L("Registering identity provider 1 with values: "));
+		LogResultL( iProvider->Endpoint() );
+		LogResultL( iProvider->Contract() );
+		LogResultL( iProvider->AdvisoryAuthnID() );
+		LogResultL( iProvider->AuthzID() );
+		LogResultL( iProvider->Password());
+		LogResultL( iProvider->ProviderID());
+
+        TInt error = iServiceManager->RegisterIdentityProviderL( *iProvider);
+
+		if (error != KErrNone )
+		{
+			// Test case not passed
+			iLog->Log(_L("Registering identity provider 1 failed. Error: %d"), error );
+			return error;
+		}
+        return KErrNone;
+}
+TInt CWSTester::_S_UnregisterIdentityProvider( CStifItemParser& aItem ){
+        iLog->Log(_L("*******"));
+		iLog->Log(_L("Unregistering identity provider with values: "));
+		iLog->Log( iProvider->Endpoint() );
+		iLog->Log( iProvider->Contract() );
+		iLog->Log( iProvider->AdvisoryAuthnID() );
+		iLog->Log( iProvider->AuthzID() );
+		iLog->Log( iProvider->Password());
+		iLog->Log( iProvider->ProviderID());
+
+        TInt error = iServiceManager->UnregisterIdentityProviderL( *iProvider);
+
+		if (error != KErrNone )
+		{
+			// Test case not passed
+			iLog->Log(_L("Unregistering identity provider 1 failed. Error: %d"), error );
+			return error;
+		}
+        return KErrNone;
+}
+TInt CWSTester::_S_RegisterServiceDescription( CStifItemParser& aItem ){
+    iLog->Log(_L("*******"));
+	iLog->Log(_L("Registering Service Description"));
+	TInt error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
+	if (error != KErrNone )
+	{
+		iLog->Log(_L("Registering Service Description failed. Error: %d"), error );
+		return error;
+	}
+    return KErrNone;
+}
+TInt CWSTester::_S_UnregisterServiceDescription( CStifItemParser& aItem ){
+    iLog->Log(_L("*******"));
+	iLog->Log(_L("Unregistering Service Description"));
+	TInt error = iServiceManager->UnregisterServiceDescriptionL( *iSenXmlServiceDescription);
+	if (error != KErrNone )
+	{
+		iLog->Log(_L("Unregistering Service Description failed. Error: %d"), error );
+		return error;
+	}
+    return KErrNone;
+}
+
+TInt CWSTester::_S_AssociateService( CStifItemParser& aItem ){
+    iLog->Log(_L("*******"));
+	iLog->Log(_L("Associate service"));
+
+    TInt result;
+    TPtrC8 arg1 = GetParC(aItem);
+    TPtrC8 arg2 = GetParC(aItem);
+    result = iServiceManager->AssociateServiceL(arg1, arg2);
+    PopAndDestroyArgc();
+    return result;
+}
+TInt CWSTester::_S_DissociateService( CStifItemParser& aItem ){
+    iLog->Log(_L("*******"));
+	iLog->Log(_L("Dissociate service"));
+
+    TInt result;
+    TPtrC8 arg1 = GetParC(aItem);
+    TPtrC8 arg2 = GetParC(aItem);
+    result = iServiceManager->DissociateServiceL(arg1, arg2);
+    PopAndDestroyArgc();
+    return result;
+}
+TInt CWSTester::_S_ServiceDescriptions( CStifItemParser& aItem ){
+    iLog->Log(_L("*******"));
+	iLog->Log(_L("ServiceDescriptions"));
+    RServiceDescriptionArray arr;
+    TInt error = iServiceManager->ServiceDescriptionsL(*iSenXmlServiceDescription, arr);
+  	TInt SDs = arr.Count();
+    TBuf8<20> buf;
+    _LIT8(KFound, "Found: %d");
+    buf.Format(KFound, SDs);
+    LogResultL(buf);
+    arr.ResetAndDestroy();
+    //PopAndDestroyArgc();
+    return error;
+}
+TInt CWSTester::_S_ServiceDescriptionsByUri( CStifItemParser& aItem ){
+    iLog->Log(_L("*******"));
+	iLog->Log(_L("ServiceDescriptions"));
+    const TPtrC8 arg = GetParC(aItem);
+    RServiceDescriptionArray arr;
+    TInt error = KErrNone;
+    //TRAP(error, iServiceManager->ServiceDescriptionsL(arg, arr));
+	error = iServiceManager->ServiceDescriptionsL(arg, arr);
+    if (error == KErrNone){
+        TInt SDs = arr.Count();
+        TBuf8<20> buf;
+        _LIT8(KFound, "Found: %d");
+        buf.Format(KFound, SDs);
+        LogResultL(buf);
+    }  	
+    arr.ResetAndDestroy();
+    PopAndDestroyArgc();
+    return error;
+}
+
+
+TInt CWSTester::_S_InstallFramework( CStifItemParser& aItem ) {
+
+	iLog->Log(_L("*******_S_InstallFramework -> Started!********"));
+
+	TPtrC arg;
+	aItem.GetNextString(arg);
+
+	HBufC8* frmID = SenXmlUtils::ToUtf8LC(arg);
+
+	TInt error(KErrNone);
+/*	TInt error = ((CSenServiceManagerImpl*)iServiceManager)->InstallFrameworkL( *frmID );*/
+
+	if (error != KErrNone)
+	{
+		// Test case not passed
+		iLog->Log(_L("Installing framework failed" ) );
+		LogResultL(_L8("Could not install framework!"));
+		CleanupStack::PopAndDestroy(1);
+		return error;
+    }
+
+	// Test case passed
+	LogResultL(_L8("InstallFramework passed"));
+	CleanupStack::PopAndDestroy(1);
+
+	iLog->Log(_L("*******_S_InstallFramework -> Finished!********"));
+
+	return KErrNone;
+}
+
+/*################################################
+*
+*
+*   SERVICE CONNECTION DLL
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            Service Connection
+-----------------------------------------------*/
+TInt CWSTester::_S_NewServiceConnection( CStifItemParser& aItem ){
+    iLog->Log(_L("###NewServiceConnection -> started###"));
+	if ( iSenServiceConnection != NULL )
+	{
+    	delete iSenServiceConnection ;
+	    iSenServiceConnection  = NULL;
+	}
+
+
+  	TPtrC arg;
+    if(!(aItem.GetNextString(arg)))
+    {
+		HBufC8* aContract = SenXmlUtils::ToUtf8LC(arg);
+    	iSenServiceConnection = CSenServiceConnection::NewL(*this, *aContract );
+		CleanupStack::PopAndDestroy(1);
+    }
+    else iSenServiceConnection =	CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription);
+
+
+    if ( iSenServiceConnection != NULL )
+	{
+	    iLog->Log(_L("Connection received"));
+	}
+	else
+	{
+        //to do> to refrence file
+		iLog->Log(_L("Connection NULL!"));
+        return KErrNotFound;
+    }
+
+
+    return KErrNone;
+}
+TInt CWSTester::_S_CompleteServerMessagesOnOff( CStifItemParser& aItem ) {
+
+	iLog->Log(_L("###Setting CompleteServerMessagesOnOff flag -> started###"));
+
+	if ( iSenServiceConnection == NULL )
+	{
+		return KErrGeneral;
+	}
+    TPtrC string;
+    if (!(aItem.GetNextString ( string )))
+		{
+        if (string.Compare(_L16("TRUE")) == 0)
+			{
+			TBool aTrue = ETrue;
+			TInt retVal = iSenServiceConnection->CompleteServerMessagesOnOff(aTrue);
+			return retVal;
+			}
+		else
+			{
+			TBool aTrue = EFalse;
+			TInt retVal = iSenServiceConnection->CompleteServerMessagesOnOff(aTrue);
+			return retVal;
+			}
+	}
+	else
+	{
+		return KErrGeneral;
+	}
+
+
+}
+
+TInt CWSTester::_S_StartTransaction( CStifItemParser& aItem ) {
+
+	iLog->Log(_L("### _S_StartTransaction -> started###"));
+
+	TInt retVal = iSenServiceConnection->StartTransaction();
+	
+	iLog->Log(_L("### _S_StartTransaction -> ended###"));
+	return retVal;
+}
+
+TInt CWSTester::_S_TransactionCompleted( CStifItemParser& aItem ) {
+
+	iLog->Log(_L("### _S_TransactionCompleted -> started###"));
+
+	TInt retVal = iSenServiceConnection->TransactionCompleted();
+	
+	iLog->Log(_L("### _S_TransactionCompleted -> ended###"));
+	return retVal;
+}
+
+/*################################################
+*
+*
+*   SERVICE DESCRIPTION DLL
+*
+*
+*################################################*/
+
+
+
+/*-----------------------------------------------
+            XML Service Description
+-----------------------------------------------*/
+
+TInt CWSTester::_S_NewXMLServiceDescription( CStifItemParser& aItem ){
+    iLog->Log(_L("###NewXMLServiceDescription -> started###"));
+    iSenXmlServiceDescription = CSenXmlServiceDescription::NewL();
+    iLog->Log(_L("  created new XML service description###"));
+    if (iSenXmlServiceDescription != NULL)
+        return KErrNone;
+    else
+        return KErrGeneral;
+}
+
+TInt CWSTester::_S_EndPoint( CStifItemParser& aItem ){
+    iLog->Log(_L("###EndPoint -> started###"));
+    iSenXmlServiceDescription->SetEndPointL(GetParC(aItem));//(TDesC8)
+    PopAndDestroyArgc();
+   return KErrNone;
+}
+TInt CWSTester::_S_ConsumerIapId( CStifItemParser& aItem ){
+ 	if (!iSenXmlServiceDescription)
+	    return KErrGeneral;
+    iLog->Log(_L("###IAP -> started###"));
+    TInt iap = 0;
+    aItem.GetNextInt( iap );
+    //in fact servicePattern instance
+	((CSenServicePattern*)iSenXmlServiceDescription)->SetConsumerIapIdL(iap);
+    return KErrNone;
+}
+
+TInt CWSTester::_S_Contract( CStifItemParser& aItem ){
+    iLog->Log(_L("###Contract -> started###"));
+
+    iSenXmlServiceDescription->SetContractL(GetParC(aItem));//(TDesC8)
+    PopAndDestroyArgc();
+   return KErrNone;
+}
+
+TInt CWSTester::_S_FrameworkId( CStifItemParser& aItem ){
+    iLog->Log(_L("###FrameworkId -> started###"));
+
+    iSenXmlServiceDescription->SetFrameworkIdL(GetParC(aItem));
+    PopAndDestroyArgc();
+    return KErrNone;
+}
+TInt CWSTester::_C_ProviderIDToService( CStifItemParser& aItem ){
+    iLog->Log(_L("###Setting providerId for service -> started###"));
+
+    iSenXmlServiceDescription->AsElement().AddElementL(_L8("ProviderID")).SetContentL(GetParC(aItem));
+    PopAndDestroyArgc();
+    return KErrNone;
+}
+
+/*-----------------------------------------------
+            Service PAttern
+-----------------------------------------------*/
+TInt CWSTester::_S_NewServicePattern( CStifItemParser& aItem ){
+    iLog->Log(_L("###NewServicePattern -> started###"));
+    iSenXmlServiceDescription = CSenServicePattern::NewL();
+
+    if (iSenXmlServiceDescription != NULL)
+        return KErrNone;
+    else
+        return KErrGeneral;
+}
+/*-----------------------------------------------
+            IdentityProvider
+-----------------------------------------------*/
+
+
+TInt CWSTester::_S_NewIdentityProvider( CStifItemParser& aItem ){
+
+    iLog->Log(_L("###_S_NewIdentityProvider -> started###"));
+
+    TPtrC8 arg1 = GetParC(aItem);
+    TPtrC8 arg2 = GetParC(aItem);
+    iProvider = CSenIdentityProvider::NewL( arg1, arg2);
+    PopAndDestroyArgc();
+    return KErrNone;
+}
+
+
+TInt CWSTester::_S_ProviderID( CStifItemParser& aItem ){
+
+    iLog->Log(_L("###_S_ProviderID -> started###"));
+
+    iProvider->SetProviderID( GetParC(aItem));
+    PopAndDestroyArgc();
+    return KErrNone;
+}
+TInt CWSTester::_S_UserInfo( CStifItemParser& aItem ){
+    iLog->Log(_L("###_S_UserInfo -> started###"));
+
+    TPtrC8 arg1 = GetParC(aItem);
+    TPtrC8 arg2 = GetParC(aItem);
+    TPtrC8 arg3 = GetParC(aItem);
+
+	iProvider->SetUserInfoL( arg1,
+                            arg2,
+                            arg3);
+    PopAndDestroyArgc();
+    return KErrNone;
+}
+/*################################################
+*
+*
+*   UTILS
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            SoapEnvelope
+-----------------------------------------------*/
+
+TInt CWSTester::_C_Body( CStifItemParser& aItem ){
+        iLog->Log(_L("### Body -> started ###"));
+        TBuf8<255> pRequestBody;
+		TPtrC arg;
+        aItem.GetNextString(arg);
+        //iRequestBody->Des().Append(arg);
+        pRequestBody.Append(arg);
+
+		while (!(aItem.GetNextString(arg)))
+		{
+			//iRequestBody->Des().Append(_L(" "));
+			//iRequestBody->Des().Append(arg);
+       		pRequestBody.Append(_L(" "));
+			pRequestBody.Append(arg);
+
+		}
+
+        //iLog->Log(*requestBody);
+        iLog->Log(pRequestBody);
+        iSOAPMessage = CSenSoapMessage::NewL();
+        iLog->Log(_L("Creating SOAP message.."));
+        iSOAPMessage->SetBodyL(pRequestBody);
+	    iLog->Log(_L("SOAP message created.."));
+
+        return KErrNone;
+
+    //Append(_L8("<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:CARDS/ab:CARD[ab:N/ab:FAMILY=\"Doe\" and ab:N/ab:GIVEN=\"John\"]</ab:Select></ab:QueryItem></ab:Query>"));
+}
+
+/*-----------------------------------------------
+            SoapDateUtils
+
+-----------------------------------------------*/
+
+TInt CWSTester::_C_FromXmlDateTime( CStifItemParser& aItem ){
+    TPtrC string;
+    TPtrC stringTime;
+    TTime ttime;
+    iLog->Log(_L("### FromXMLDateTime -> started ###"));
+
+    aItem.GetNextString ( string );
+    aItem.GetNextString ( stringTime );
+    if (string.Compare(_L16("16")) == 0){
+        HBufC16* writeBuf=HBufC16::New(stringTime.Length());
+        CleanupStack::PushL(writeBuf);
+        TPtr16 ptr = writeBuf->Des();
+        ptr.Copy(stringTime);
+        iLog->Log(ptr);
+		//API removed
+        /*TRAPD(errorConverter, ttime = SenDateUtils::FromXmlDateTimeL(ptr));
+	    if (errorConverter != KErrNone) {
+            CleanupStack::PopAndDestroy(1);
+            return errorConverter;
+        }*/
+    }else{
+        HBufC8* writeBuf=HBufC8::New(stringTime.Length());
+        CleanupStack::PushL(writeBuf);
+        TPtr8 ptr = writeBuf->Des();
+        ptr.Copy(stringTime);
+        iLog->Log(ptr);
+        TRAPD(errorConverter, ttime = SenDateUtils::FromXmlDateTimeL(ptr));
+	    if (errorConverter != KErrNone) {
+            CleanupStack::PopAndDestroy(1);
+            return errorConverter;
+        }
+
+    }
+
+    TBuf<30> dateString;
+    _LIT(KDateString1,"%E%D%X%N%Y %1 %2 %3");
+    ttime.FormatL(dateString,KDateString1);
+    LogResultL(dateString);
+    _LIT(KDateString4,"%-B%:0%J%:1%T%:2%S%.%*C4%:3%+B");
+    ttime.FormatL(dateString,KDateString4);
+    LogResultL(dateString);
+    CleanupStack::PopAndDestroy(1);
+    return KErrNone;
+
+}
+TInt CWSTester::_C_ToXmlDateTimeUtf( CStifItemParser& aItem ){
+    TPtrC string;
+    TPtrC stringTime;
+    TPtrC stringBufforLength;
+
+    HBufC16* writeBufTime;
+    TTime ttime;
+    iLog->Log(_L("### ToXmlDateTimeUtf -> started ###"));
+
+    aItem.GetNextString ( string );
+    aItem.GetNextString ( stringBufforLength );
+    aItem.GetNextString ( stringTime );
+
+    writeBufTime = HBufC16::New(stringTime.Length());
+    TPtr16 ptr = writeBufTime->Des();
+	iLog->Log(_L("...copying"));
+    ptr.Copy(stringTime);
+    iLog->Log(_L("ok"));
+	iLog->Log(ptr);
+    iLog->Log(_L("...parsing"));
+	TInt error  = ttime.Parse(ptr);
+    iLog->Log(_L("ok"));
+	if ( writeBufTime!= NULL ){
+        delete writeBufTime;
+	    writeBufTime = NULL;
+    }
+
+    if (error < KErrNone) {
+        return error;
+    }
+    if (string.Compare(_L16("16")) == 0){
+        HBufC16* writeBuf;
+        if (stringBufforLength.Compare(_L16("over")) == 0){
+            writeBuf=HBufC16::New(SenDateUtils::KXmlDateTimeMaxLength + 5);
+        }else if(stringBufforLength.Compare(_L16("under")) == 0){
+            writeBuf=HBufC16::New(SenDateUtils::KXmlDateTimeMaxLength - 20);
+        }else if(stringBufforLength.Compare(_L16("equal")) == 0){
+            writeBuf=HBufC16::New(SenDateUtils::KXmlDateTimeMaxLength);
+        }else{
+            return KResultFailedFound;
+        }
+
+        TPtr16 ptrResult = writeBuf->Des();
+        iLog->Log(_L("converting to XmlDateTime"));
+		//API removed
+        /*TRAPD(errorConverter, SenDateUtils::ToXmlDateTimeL(ptrResult, ttime));
+	    if (errorConverter != KErrNone) {
+			iLog->Log(_L("...fail"));
+            return errorConverter;
+        }*/
+        LogResultL(ptrResult);
+		if ( writeBuf!= NULL ){
+            delete writeBuf;
+	        writeBuf = NULL;
+        }
+    }else{
+        HBufC8* writeBuf;
+        if (stringBufforLength.Compare(_L16("over")) == 0){
+            writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength + 5);
+        }else if(stringBufforLength.Compare(_L16("under")) == 0){
+            writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength - 20);
+        }else if(stringBufforLength.Compare(_L16("equal")) == 0){
+            writeBuf=HBufC8::New(SenDateUtils::KXmlDateTimeMaxLength);
+        }else{
+            return KResultFailedFound;
+        }
+        TPtr8 ptrResult = writeBuf->Des();
+        iLog->Log(_L("converting to XmlDateTime"));
+        TRAPD(errorConverter, SenDateUtils::ToXmlDateTimeUtf8L(ptrResult, ttime));
+        if (errorConverter != KErrNone) {
+      		iLog->Log(_L("...fail"));
+            return errorConverter;
+        }
+        LogResultL(ptrResult);
+	    if ( writeBuf!= NULL ){
+            delete writeBuf;
+	        writeBuf = NULL;
+        }
+      
+    }
+    return KErrNone;
+}
+/*################################################
+*
+*
+*   XML DLL
+*
+*
+*################################################*/
+
+/*-----------------------------------------------
+            SAX based parsing
+-----------------------------------------------*/
+TInt CWSTester::_S_NewSAXFragment( CStifItemParser& aItem )
+	{
+
+    iLog->Log(_L("### _S_NewSAXFragment -> started ###"));
+
+
+    TPtrC string;
+    if (!(aItem.GetNextString ( string )))
+	{
+        if (string.Compare(_L16("ConstructLocal")) == 0)
+			{
+			iSaxTester = CSAXTester::NewL( KLName8() );
+			iSaxTester->SetReader( *iXmlReader );
+		    }
+		else if(string.Compare(_L16("ConstructLocalNs")) == 0)
+			{
+			iSaxTester = CSAXTester::NewL( KDefaultNS(), KLName8() );
+			iSaxTester->SetReader( *iXmlReader );
+			}
+		else if(string.Compare(_L16("ConstructLocalNsQ")) == 0)
+			{
+			iSaxTester = CSAXTester::NewL( KDefaultNS(), KLName8(), KQName() );
+			iSaxTester->SetReader( *iXmlReader );
+			}
+
+		else if(string.Compare(_L16("ConstructLocalNsQAttr")) == 0)
+			{
+			RAttribute justAttribute;
+			CleanupClosePushL(justAttribute);
+			TRAPD(err, justAttribute.Open(
+					iStringPool.OpenStringL(KNullDesC8()),
+					iStringPool.OpenStringL(KNullDesC8()),
+					iStringPool.OpenStringL(KAttribute()),
+					iStringPool.OpenStringL(KAttributeValue())));
+
+			// make a new array for all attributes including namespace (to be added)
+			RAttributeArray justAttributes;
+
+			// append the namespace attribute (declaration)
+			justAttributes.Append(justAttribute);
+
+			iSaxTester = CSAXTester::NewL( KDefaultNS(), KLName8(), KQName(), justAttributes);
+			iSaxTester->SetReader( *iXmlReader );
+
+			justAttributes[0].Close();
+			CleanupStack::Pop(); // justAttribute has been safely closed
+
+
+			// close the actual array
+			justAttributes.Close();
+		}
+		else if(string.Compare(_L16("ConstructLocalNsQAttrElem")) == 0)
+			{
+			RAttribute justAttribute;
+			CleanupClosePushL(justAttribute);
+			TRAPD(err,justAttribute.Open(
+					iStringPool.OpenStringL(KNullDesC8()),
+					iStringPool.OpenStringL(KNullDesC8()),
+					iStringPool.OpenStringL(KAttribute()),
+					iStringPool.OpenStringL(KAttributeValue())));
+
+			RAttributeArray justAttributes;
+			justAttributes.Append(justAttribute);
+
+			iFrg = CSenBaseFragment::NewL(_L8("BaseFrag"));
+			iFrg->SetReader( *iXmlReader );
+			iFrg->ParseL(KElementXml);
+
+			CSenElement &elem = iFrg->AsElement();
+
+			iSaxTester = CSAXTester::NewL( KDefaultNS(), KLName8(), KQName(), justAttributes, elem );
+			iSaxTester->SetReader( *iXmlReader );
+
+			HBufC8* xmlBuffer = iSaxTester->AsElement().Parent()->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			justAttributes[0].Close();
+			CleanupStack::Pop(); // justAttribute has been safely closed
+
+
+			// close the actual array
+			justAttributes.Close();
+		}
+		else if(string.Compare(_L16("ConstructElem")) == 0)
+			{
+
+			CSenBaseFragment* frg = CSenBaseFragment::NewL(_L8("BaseFrag"));
+			frg->SetReader( *iXmlReader );
+			frg->ParseL(KElementXml);
+
+			CSenElement &elem = frg->AsElement();
+
+			iSaxTester = CSAXTester::NewL( elem );
+			iSaxTester->SetReader( *iXmlReader );
+
+			delete frg;
+		}
+
+
+
+
+	}
+
+    iLog->Log(_L("### _S_NewSAXFragment -> finished ###"));
+
+	return KErrNone;
+	}
+TInt CWSTester::_S_SAXTest( CStifItemParser& aItem )
+	{
+
+    iLog->Log(_L("### _S_SAXTest -> started ###"));
+
+	HBufC8* xmlBuffer = iSaxTester->AsXmlL();
+	CleanupStack::PushL( xmlBuffer );
+	iLog->Log( xmlBuffer->Des() );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+
+    TPtrC string;
+    if (!(aItem.GetNextString ( string )))
+	{
+        if (string.Compare(_L16("KParseLocal")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,2) && length == 85 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseDifferenLocal")) == 0)
+			{
+			iSaxTester->ParseL( KParseDifferentLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 9 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseLocalNs")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNs() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 72 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseLocalNsDif")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,2) && length == 33 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+
+		else if(string.Compare(_L16("KParseLocalNsQ")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseLocalNsQNOK")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,2) && length == 49 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseLocalNsQAttr")) == 0)
+			{
+			// Yep. This is ok. Atributes are not checked.
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 119 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseLocalNsQAttrElem")) == 0)
+			{
+			// Yep. This is ok. Atributes are not checked.
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+
+			xmlBuffer = iSaxTester->AsElement().Parent()->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length2 = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 119
+					&& length2 == 11)
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KParseElem")) == 0)
+			{
+			// Yep. This is ok. Atributes are not checked.
+			iSaxTester->ParseL( KParseElemMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 52 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KCheckGetters")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				TBool passed = ETrue;
+
+				const TDesC8 &localName = iSaxTester->LocalName();
+				iLog->Log( localName );
+				if ( localName != KLName8 )
+						passed = EFalse;
+
+				const TDesC8 &nsUri = iSaxTester->NsUri();
+				iLog->Log( nsUri );
+				if ( nsUri != KDefaultNS )
+						passed = EFalse;
+
+				const TDesC8 &nsPrefix = iSaxTester->NsPrefix();
+				iLog->Log( nsPrefix );
+				if ( nsPrefix != KNsPrefix )
+						passed = EFalse;
+
+
+				if ( passed )
+					{
+					return KErrNone;
+					}
+				else
+					{
+					return KErrGeneral;
+					}
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KCheckElement")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				CSenElement &elem = iSaxTester->AsElement();
+				HBufC8* elemAsXml = elem.AsXmlL();
+				if (elemAsXml->Length() != length )
+					{
+					delete elemAsXml;
+					return KErrGeneral;
+					}
+				delete elemAsXml;
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KCheckExtract")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				CSenElement* elem = iSaxTester->ExtractElement();
+				HBufC8* elemAsXml = elem->AsXmlL();
+				if (elemAsXml->Length() != length )
+					{
+					delete elemAsXml;
+					delete elem;
+					return KErrGeneral;
+					}
+				delete elemAsXml;
+				delete elem;
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KCheckReader")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				CSenXmlReader* reader = iSaxTester->Reader();
+				if (reader != iXmlReader)
+					{
+					return KErrGeneral;
+					}
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+        else if (string.Compare(_L16("KCheckBuildFrom")) == 0)
+			{
+			TInt err = iSaxTester->BuildFrom( KParseLocalMsg() );
+			if ( err != KErrNone )
+				{
+				return KErrGeneral;
+				}
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,2) && length == 85 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+        else if (string.Compare(_L16("KDelegateParsing")) == 0)
+			{
+			iSaxTester->SetRunCase(KDelegateParsing );
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,1) && length == 54 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+        else if (string.Compare(_L16("KDelegateParsing2")) == 0)
+			{
+			iSaxTester->SetRunCase( KDelegateParsing2 );
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,1) && length == 85 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+        else if (string.Compare(_L16("KParseWith")) == 0)
+			{
+			iSaxTester->ParseWithL( *iXmlReader );
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,2) && length == 85 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+        else if (string.Compare(_L16("KSetOwner")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalMsg() );
+
+			CSenBaseFragment *frg = CSenBaseFragment::NewL( KLName8() );
+			frg->SetReader( *iXmlReader );
+			frg->ParseL(KParseLocalMsg() );
+			frg->SetOwner( *iSaxTester );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(3,3,2) && length == 85 )
+				{
+				delete frg;
+				return KErrNone;
+				}
+			else
+				{
+				delete frg;
+				return KErrGeneral;
+				}
+			}
+
+		else if(string.Compare(_L16("KNameSpaceGetter")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// not owned. null check tells if found(!)
+			CSenNamespace* ns = iSaxTester->Namespace( KNsPrefix() );
+			iLog->Log( ns->Prefix() );
+			iLog->Log( ns->URI() );
+
+			if ( ns->URI() != KDefaultNS() )
+				{
+				return KErrGeneral;
+				}
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+		else if(string.Compare(_L16("KEnsureNS")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNsQ() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			iSaxTester->EnsureNamespace( KNsPrefix() );
+
+			// not owned
+			CSenNamespace* ns = iSaxTester->Namespace( KNsPrefix() );
+			iLog->Log( ns->Prefix() );
+			iLog->Log( ns->URI() );
+
+			if ( ns->URI() != KDefaultNS() )
+				{
+				return KErrGeneral;
+				}
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 96 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+        else if (string.Compare(_L16("KDetach")) == 0)
+			{
+
+			iSaxTester->SetRunCase( KDetach );
+			iSaxTester->ParseL( KParseLocalNs() );
+
+			// not owned, before detaching
+			CSenBaseFragment* frg = iSaxTester->GetDelegate();			
+			xmlBuffer = frg->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// not owned
+			CSenBaseFragment* frg2 = iSaxTester->GetDetachedDelegate();
+			
+			xmlBuffer = frg2->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length2 = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			
+				// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			if ( iSaxTester->CheckParsingStatus(2,2,0) && length == 31 && length2 == 55 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+
+			}
+        else if (string.Compare(_L16("KResetContent")) == 0)
+			{
+			iSaxTester->ParseL( KParseLocalNs() );
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			TInt length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			iSaxTester->ResetContentL();
+
+			xmlBuffer = iSaxTester->AsXmlL();
+			CleanupStack::PushL( xmlBuffer );
+			iLog->Log( xmlBuffer->Des() );
+			length = xmlBuffer->Length();
+			CleanupStack::PopAndDestroy(); // xmlBuffer
+
+			// using hard coded numbers. Do not change the PARSED MESSAGES!!!
+			// AFTER RESETTING CONTENT
+			if ( iSaxTester->CheckParsingStatus(2,2,1) && length == 33 )
+				{
+				return KErrNone;
+				}
+			else
+				{
+				return KErrGeneral;
+				}
+			}
+
+	}
+
+    iLog->Log(_L("### _S_SAXTest -> ended ###"));
+	return KErrNone;
+	}
+
+/*-----------------------------------------------
+            DOM based parsing
+-----------------------------------------------*/
+
+CSenElement* CWSTester::ParseToElementL( HBufC8* pTestXml )
+{
+	CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+	pDom->SetReader(*iXmlReader);
+
+	iXmlReader->SetContentHandler(*pDom);
+
+	//parse xml fragment
+	iXmlReader->ParseL( *pTestXml );
+
+	//parsed document to SenElement
+	CSenElement* element = pDom->ExtractElement();
+    CleanupStack::PopAndDestroy();
+	return element;
+}
+
+TInt CWSTester::_C_ParseToElement( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_ParseToElement -> Started!********"));
+	iLog->Log(_L("Parse XML document"));
+
+	TPtrC arg;
+	TBuf8<3072> xmlDoc;
+	aItem.GetNextString(arg);
+
+	xmlDoc.Append(arg);
+
+	//concatenating args to one string
+	while (!(aItem.GetNextString(arg)))
+	{
+		xmlDoc.Append(_L(" "));
+		xmlDoc.Append(arg);
+	}
+
+	HBufC8* pTestXml = HBufC8::NewLC(
+		xmlDoc.Length() );
+
+	pTestXml->Des().Append(xmlDoc);
+
+	iLog->Log( _L(" Delete old iElement") );
+
+	//removing old iElement
+	if ( iElement!= NULL ){
+        delete iElement;
+	    iElement = NULL;
+    }
+
+	//adding parsed document to SenElement
+    iLog->Log( _L(" Parsing message....") );
+	
+	TRAPD(rParse, iElement = ParseToElementL(pTestXml));
+	if (rParse != KErrNone) {
+		iLog->Log(_L("Parsing failed. Error: %d"), rParse );
+		CleanupStack::PopAndDestroy();
+		return rParse;
+	}
+
+//===============
+
+    CleanupStack::PopAndDestroy();
+
+	iLog->Log(_L("******* _C_ParseToElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_LocalName( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_LocalName -> Started!********"));
+
+	LogResultL(iElement->LocalName());
+
+	iLog->Log(_L("******* _S_LocalName -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_NamespaceURI( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_NamespaceURI -> Started!********"));
+
+	const TDesC8* nsUri = &(iElement->NamespaceURI());
+	LogResultL(*nsUri);
+
+	iLog->Log(_L("******* _S_NamespaceURI -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_SetNamespace( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_SetNamespace -> Started!********"));
+
+	//1. argument - NsUri, 2. argument - NsPrefix
+	TPtrC8 arg1 = GetParC(aItem);
+	TPtrC arg2;
+	TBuf8<128> nsUri;
+	nsUri.Append(arg1);
+
+	if (!(aItem.GetNextString(arg2))) {
+		TBuf8<128> nsPrefix;
+		nsPrefix.Append(arg2);
+		iElement->SetNamespaceL(nsPrefix, nsUri);
+	} else
+		iElement->SetNamespaceL(nsUri);
+
+	CleanupStack::PopAndDestroy();
+	iLog->Log(_L("******* _S_SetNamespace -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_NsPrefix( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_NsPrefix -> Started!********"));
+
+	LogResultL(iElement->NsPrefix());
+
+	iLog->Log(_L("******* _S_NsPrefix -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_SetPrefix ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_SetPrefix -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> prefix;
+	prefix.Append(arg);
+
+	((CSenBaseElement*)iElement)->SetPrefixL(prefix);
+
+	iLog->Log(_L("******* _S_SetPrefix -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_HasContent( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_HasContent -> Started!********"));
+
+	if (iElement->HasContent() == EFalse)
+		error = KErrNotFound;
+
+	iLog->Log(_L("******* _S_HasContent -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_Content( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_Content -> Started!********"));
+
+	LogResultL(iElement->Content());
+
+	iLog->Log(_L("******* _S_Content -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_ContentUnicode( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_ContentUnicode -> Started!********"));
+
+	HBufC16* xmlBuffer = iElement->ContentUnicodeL();
+	CleanupStack::PushL( xmlBuffer );
+	LogResultL( *xmlBuffer );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+	iLog->Log(_L("******* _S_ContentUnicode -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_SetContent( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_SetContent -> Started!********"));
+
+	TPtrC arg;
+	TBuf8<1024> content;
+    aItem.GetNextString(arg);
+	content.Append(arg);
+
+	//concatenating args to one string
+	while (!(aItem.GetNextString(arg)))
+	{
+		content.Append(_L(" "));
+		content.Append(arg);
+	}
+
+	iElement->SetContentL(content);
+
+	iLog->Log(_L("******* _S_SetContent -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_AddNamespace( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_AddNamespace -> Started!********"));
+
+	//1. argument - NsUri, 2. argument - NsPrefix, 3. argument - CheckInParent (TRUE/FALSE) - it causes call overloaded function
+	TPtrC8 arg1 = GetParC(aItem);
+	TPtrC arg2;
+	TPtrC arg3;
+	TBuf8<128> nsUri;
+	nsUri.Append(arg1);
+	TBuf8<128> nsPrefix;
+	aItem.GetNextString(arg2);
+	nsPrefix.Append(arg2);
+
+	if (!(aItem.GetNextString(arg3))) {
+		TBool checkInParent = FALSE;
+		if (arg3.Compare(_L("TRUE")) == 0) checkInParent = TRUE;
+		CSenNamespace* ns = CSenNamespace::NewLC(nsPrefix, nsUri);
+		iElement->AddNamespaceL(*ns, checkInParent);
+		CleanupStack::PopAndDestroy();
+	} else
+		iElement->AddNamespaceL(nsPrefix, nsUri);
+
+	CleanupStack::PopAndDestroy();
+
+	iLog->Log(_L("******* _S_AddNamespace -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_AttrValue( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_AttrValue -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	const TDesC8* attr = iElement->AttrValue(name);
+	if (attr != NULL)
+		LogResultL(*attr);
+
+	iLog->Log(_L("******* _S_AttrValue -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_AddAttr( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_AddAttr -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+    aItem.GetNextString(arg);
+	TBuf8<1024> value;
+	value.Append(arg);
+	//concatenating args to one string
+	while (!(aItem.GetNextString(arg)))
+	{
+		value.Append(_L(" "));
+		value.Append(arg);
+	}
+
+	iElement->AddAttrL(name, value);
+
+	iLog->Log(_L("******* _S_AddAttr -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Namespace( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Namespace -> Started!********"));
+
+	const CSenNamespace* ns = iElement->Namespace();
+
+	TBuf8<1024> output;
+	if (ns) {
+		output.Append(ns->URI());
+		output.Append(_L8(", "));
+		output.Append(ns->Prefix());
+	} else
+		output.Append(_L8("no namespaces"));
+	LogResultL(output);
+
+	iLog->Log(_L("******* _C_Namespace -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Elements( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Elements -> Started!********"));
+
+	RPointerArray<CSenElement> elements = iElement->ElementsL();
+
+	TBuf8<1024> output;
+	TInt size = elements.Count();
+	for (TInt i = 0; i < size; i++) {
+		output.Append(_L("\n"));
+		output.Append(elements[i]->LocalName());
+	}
+	LogResultL(output);
+
+	iLog->Log(_L("******* _C_Elements -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Attributes( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Attributes -> Started!********"));
+
+	RPointerArray<CSenBaseAttribute> attributes = iElement->AttributesL();
+
+	TBuf8<1024> output;
+	TInt size = attributes.Count();
+	for (TInt i = 0; i < size; i++) {
+		output.Append(_L("\n"));
+		output.Append(attributes[i]->Name());
+	}
+	LogResultL(output);
+
+	iLog->Log(_L("******* _C_Attributes -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Namespaces( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Namespaces -> Started!********"));
+
+	RPointerArray<CSenNamespace> namespaces = iElement->NamespacesL();
+
+	TBuf8<1024> output;
+	TInt size = namespaces.Count();
+	for (TInt i = 0; i < size; i++) {
+		output.Append(_L("\n"));
+		output.Append(namespaces[i]->URI());
+		output.Append(_L8(", "));
+		output.Append(namespaces[i]->Prefix());
+	}
+	LogResultL(output);
+
+	iLog->Log(_L("******* _C_Namespaces -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Parent( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Parent -> Started!********"));
+
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	//set pointer to child
+	CSenElement* childElement;
+	childElement = iElement->Element(name);
+
+	//get parent from child
+	if (!(childElement->Parent() == iElement))
+		error = KErrGeneral;
+
+	iLog->Log(_L("******* _C_Parent -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Root( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Root -> Started!********"));
+
+	TPtrC arg;
+	CSenElement* secondElement;
+
+	//optional argument
+	if (!(aItem.GetNextString(arg))) {
+		TBuf8<128> name;
+		name.Append(arg);
+		//set pointer to child
+		secondElement = iElement->Element(name);
+	} else
+		secondElement = iElement;
+
+	//get root
+	if (!(&secondElement->Root() == iElement))
+		error = KErrGeneral;
+
+	iLog->Log(_L("******* _C_Root -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_SetParent( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_SetParent -> Started!********"));
+
+	//new element
+	CSenBaseElement* parentElement = CSenBaseElement::NewL(_L8("NewRoot"));
+	CleanupStack::PushL(parentElement);
+	//add namespace
+	parentElement->SetNamespaceL(_L8("nok"), _L8("http://www.nokia.com"));
+
+	//set parent
+	iElement->SetParent(parentElement);
+
+	HBufC8* xmlBuffer = iElement->Parent()->AsXmlL();
+	CleanupStack::PushL( xmlBuffer );
+	LogResultL( *xmlBuffer );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+	xmlBuffer = iElement->AsXmlL();
+	CleanupStack::PushL( xmlBuffer );
+	LogResultL( *xmlBuffer );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+	CleanupStack::PopAndDestroy(); // parentElement
+
+	iLog->Log(_L("******* _C_SetParent -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Element ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Element -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	CSenElement* element = iElement->Element(name);
+
+	if (element != NULL)
+	{
+		HBufC8* xmlBuffer = element->AsXmlL();
+		CleanupStack::PushL( xmlBuffer );
+		LogResultL( *xmlBuffer );
+		CleanupStack::PopAndDestroy(); // xmlBuffer
+	}
+
+	iLog->Log(_L("******* _C_Element -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_CreateElement ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_CreateElement -> Started!********"));
+
+	TPtrC arg1, arg2;
+	//first param
+    aItem.GetNextString(arg1);
+	TBuf8<128> localName;
+	localName.Append(arg1);
+	//second param
+    aItem.GetNextString(arg2);
+	TBuf8<128> nsPrefix;
+	nsPrefix.Append(arg2);
+
+	//create element and dump it
+	CSenElement* element = iElement->CreateElementL(nsPrefix, localName);
+	CleanupStack::PushL(element);
+
+	if (element != NULL)
+	{
+		HBufC8* xmlBuffer = element->AsXmlL();
+		CleanupStack::PushL( xmlBuffer );
+		LogResultL( *xmlBuffer );
+		CleanupStack::PopAndDestroy(); // xmlBuffer
+	}
+
+	CleanupStack::PopAndDestroy();
+
+	iLog->Log(_L("******* _C_CreateElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_InsertElement ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_InsertElement -> Started!********"));
+
+	TPtrC arg;
+	//param
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	//create new element
+	CSenElement* element1 = CSenBaseElement::NewL(_L8("NewElement"));
+	CSenElement* element2 = iElement->Element(name);
+
+	//insert element
+	iElement->InsertElementL(*element1, *element2);
+
+	iLog->Log(_L("******* _C_InsertElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_AddElement ( CStifItemParser& aItem )
+{
+	iLog->Log(_L("*******_S_AddElement -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	TRAPD(error, iElement->AddElementL(name));
+
+	iLog->Log(_L("******* _S_AddElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_RemoveElement ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_RemoveElement -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	CSenElement* element;
+	element = iElement->RemoveElement(name);
+
+	if ( element!= NULL ){
+        delete element;
+	    element = NULL;
+    }
+
+	iLog->Log(_L("******* _S_RemoveElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_ReplaceElement ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_ReplaceElement -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	CSenElement* oldElement;
+	CSenElement* element = CSenBaseElement::NewL(name);
+
+	oldElement = iElement->ReplaceElementL(*element);
+
+	CleanupStack::PushL(oldElement);
+	CleanupStack::PopAndDestroy(); // oldElement
+	iLog->Log(_L("******* _C_ReplaceElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_AsXml( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_AsXml -> Started!********"));
+
+	HBufC8* xmlBuffer = iElement->AsXmlL();
+	CleanupStack::PushL( xmlBuffer );
+	LogResultL( *xmlBuffer );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+	iLog->Log(_L("******* _S_AsXml -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_AsXmlUnicode( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_AsXmlUnicode -> Started!********"));
+
+	HBufC16* xmlBuffer = iElement->AsXmlUnicodeL();
+	CleanupStack::PushL( xmlBuffer );
+	LogResultL( *xmlBuffer );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+	iLog->Log(_L("******* _S_AsXmlUnicode -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_AsElement( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_AsElement -> Started!********"));
+
+	HBufC8* xmlBuffer = iElement->AsElement()->AsXmlL();
+	CleanupStack::PushL( xmlBuffer );
+	LogResultL( *xmlBuffer );
+	CleanupStack::PopAndDestroy(); // xmlBuffer
+
+	iLog->Log(_L("******* _C_AsElement -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_CopyFrom( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_CopyFrom -> Started!********"));
+
+	TPtrC arg;
+	TBuf8<3072> xmlDoc;
+	aItem.GetNextString(arg);
+
+	xmlDoc.Append(arg);
+
+	//concatenating args to one string
+	while (!(aItem.GetNextString(arg)))
+	{
+		xmlDoc.Append(_L(" "));
+		xmlDoc.Append(arg);
+	}
+
+	HBufC8* pTestXml = HBufC8::NewLC( xmlDoc.Length() );
+	pTestXml->Des().Append(xmlDoc);
+	CSenElement* newElement;
+
+	//adding parsed document to SenElement and copy it to iElement
+
+	TRAPD(rParse, newElement = ParseToElementL(pTestXml));
+	if (rParse != KErrNone) {
+		iLog->Log(_L("Parsing failed. Error: %d"), rParse );
+		CleanupStack::PopAndDestroy();
+		return rParse;
+	}
+	CleanupStack::PushL(newElement);
+
+	iElement->CopyFromL( *newElement );
+
+    CleanupStack::PopAndDestroy(2);
+	iLog->Log(_L("******* _C_CopyFrom -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Detach ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Detach -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	//pointer to the child
+	CSenElement* element = iElement->Element(name);
+	CleanupStack::PushL(element);
+
+	element->DetachL();
+
+	CleanupStack::PopAndDestroy();
+
+	iLog->Log(_L("******* _C_Detach -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_Child ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_Detach -> Started!********"));
+
+	TInt arg;
+    aItem.GetNextInt(arg);
+
+	CSenElement* element = iElement->Child(arg);
+
+	if (element)
+	{
+		HBufC8* xmlBuffer = element->AsXmlL();
+		CleanupStack::PushL( xmlBuffer );
+		LogResultL( *xmlBuffer );
+		CleanupStack::PopAndDestroy(); // xmlBuffer
+	}
+
+	iLog->Log(_L("******* _C_Child -> Ended! ********"));
+	return error;
+}
+
+
+TInt CWSTester::_S_Set ( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_Set -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> nsUri;
+	nsUri.Append(arg);
+
+    aItem.GetNextString(arg);
+	TBuf8<128> localName;
+	localName.Append(arg);
+
+    aItem.GetNextString(arg);
+	TBuf8<128> qName;
+	qName.Append(arg);
+
+	iElement->Set(nsUri, localName, qName);
+
+	iLog->Log(_L("******* _S_Set -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_WriteAsXMLTo( CStifItemParser& aItem ){
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_WriteAsXMLTo -> Started!********"));
+
+	iElement->WriteAsXMLToL(iWriter);
+
+	iWriter.CommitL();
+
+	iLog->Log(_L("******* _S_WriteAsXMLTo -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_WriteNamespacesTo( CStifItemParser& aItem ){
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_WriteNamespacesTo -> Started!********"));
+
+	iElement->WriteNamespacesToL(iWriter);
+
+	iWriter.CommitL();
+
+	iLog->Log(_L("******* _S_WriteNamespacesTo -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_ContentWriteStream( CStifItemParser& aItem ){
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_S_ContentWriteStream -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<1024> content;
+	content.Append(arg);
+
+	//concatenating args to one string
+	while (!(aItem.GetNextString(arg)))
+	{
+		content.Append(_L(" "));
+		content.Append(arg);
+	}
+
+	RWriteStream writer = iElement->ContentWriteStreamL();
+
+	writer.WriteL(content);
+
+	writer.CommitL();
+	writer.Close();
+
+	iLog->Log(_L("******* _S_ContentWriteStream -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_AllocAttrValue ( CStifItemParser& aItem )
+{
+	//NOT COMPLETED!
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_AllocAttrValue -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+
+	RAttributeArray apAttrs;
+
+	HBufC8* newAttr;
+
+	/*TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) );
+	if (r != KErrNone) {
+		iLog->Log(_L("AllocAttrValueL failed. Error: %d"), r );
+		return r;
+	}*/
+
+	if ( newAttr!= NULL ){
+        delete newAttr;
+	    newAttr = NULL;
+    }
+
+	iLog->Log(_L("******* _C_AllocAttrValue -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_S_SetAttributes ( CStifItemParser& aItem )
+{
+	//NOT COMPLETED!
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_AllocAttrValue -> Started!********"));
+
+	TPtrC arg;
+    aItem.GetNextString(arg);
+	TBuf8<128> name;
+	name.Append(arg);
+	RAttributeArray apAttrs;
+	RStringPool stringPool;
+/*
+	RAttribute nsAttribute;
+	CleanupClosePushL(nsAttribute);
+	nsAttribute.Open(stringPool.OpenStringL(_L8("uri")),
+					stringPool.OpenStringL(_L8("prefix")), //iStringPool.OpenStringL(KNullDesC8()),  //iXmlNsPrefix.Copy(),
+					stringPool.OpenStringL(_L8("prefix")),
+					stringPool.OpenStringL(_L8("uri")));
+
+	apAttrs.Append(nsAttribute);
+
+	((CSenBaseElement*)iElement)->SetAttributesL(apAttrs);
+*/
+	iLog->Log(_L("******* _C_AllocAttrValue -> Ended! ********"));
+	return error;
+}
+
+
+/*################################################
+            MService Consumer implementation
+################################################*/
+
+void CWSTester::HandleMessageL(const TDesC8& aMessage)
+	{
+	_LIT8(	KEnv, "<S:Envelope");
+	_LIT8(	KBody, "<ab:QueryResponse");
+	TInt aFound = 0;
+
+    iLog->Log(_L("### HandleMessageL -> Started! ###"));
+    iLog->Log(_L("Retrieved: "));
+    //LogResultL( _L8("=================message===================") );
+	LogResultL( aMessage );
+
+
+
+	if ( iStarted )
+		{
+		// Received a response from server. This do not take any statement about
+		// the received message.
+		//iErrorsOccured = EFalse;
+	// Here is the Switch - Case for checking the error values for cases. The
+	// iCasePassed is checked in
+		switch( iRunCase )
+			{
+			case KNoResourceID:
+				iLog->Log( _L("The message from service received. Ok." ));
+				iCasePassed = TRUE;
+				break;
+			case KDSEcrypted:
+				iLog->Log( _L("The message from service received. Ok." ));
+				iCasePassed = TRUE;
+				break;
+
+			case KEndpointMovedTest:
+				iLog->Log( _L("The message from service received. Ok." ));
+				iCasePassed = TRUE;
+				break;
+
+			case KMultippleROs:
+				iLog->Log( _L("The message from service received. Ok." ));
+				iCasePassed = TRUE;
+				break;
+			case KNoCredentials:
+				iLog->Log( _L("The message from service received. Ok." ));
+				iCasePassed = TRUE;
+				break;
+		    case KSendSOAP:
+			    iLog->Log( _L("Received a whole SOAPEnvelope." ));
+                iCasePassed = TRUE;
+			    //TestParsing( aMessage );
+			    break;
+   		    case KSendSOAPRequest:
+			    iLog->Log( _L("The message from service received. Ok." ));
+                iCasePassed = TRUE;
+			    break;
+   		    case KSendBUCF:
+			    iLog->Log( _L("Received a response from server. Thats enough." ));
+                iCasePassed = TRUE;
+			    //TestParsing( aMessage );
+			    break;
+		    case KSendYomi:
+			    iLog->Log( _L("Received a response from server. Thats enough." ));
+                iCasePassed = TRUE;
+			    //TestParsing( aMessage );
+			    break;
+		    case KSendBUCFBody:
+				iLog->Log( _L("Received a response from server. Checking if it starts correctly..." ));
+			    aFound = aMessage.Find( KBody );
+				if ( aFound == 0)
+					{
+					iCasePassed = TRUE;
+					}
+				else
+					{
+					iCasePassed = FALSE;
+					}
+			    break;
+		    case KSendBUCFEnvelope:
+				iLog->Log( _L("Received a response from server. Checking if it starts correctly..." ));
+				aFound = aMessage.Find( KEnv() );
+				if ( aFound == 0)
+					{
+					iCasePassed = TRUE;
+					}
+				else
+					{
+					iCasePassed = FALSE;
+					}
+			    break;
+		    case KSendBUCFEnvelope2:
+				iLog->Log( _L("Received a response from server. Checking if it starts correctly..." ));
+				aFound = aMessage.Find( KEnv() );
+				if ( aFound == 0)
+					{
+					iCasePassed = TRUE;
+					}
+				else
+					{
+					iCasePassed = FALSE;
+					}
+			    break;
+   		    case KPerformanceSOAPSubmit:
+			    iLog->Log( _L("The message from service received. Ok." ));
+                iCasePassed = TRUE;
+			    break;	
+   		    case KCompleteServerMessagesOnOff_1:
+   		        iLog->Log( _L("The message from service received. Ok." ));
+   		        iCasePassed = TRUE;
+   		        break;  			                    
+            case KCompleteServerMessagesOnOff_3:
+                iLog->Log( _L("The message from service received. Ok." ));
+                iCasePassed = TRUE;
+                break;                                  
+            
+            default:
+				iCasePassed = FALSE;
+				break;
+			}
+    HBufC8* aSD;
+
+    iLog->Log( _L("Getting the services description....") );
+	iSenServiceConnection->ServiceDescriptionL( aSD );
+    //LogResultL( _L8("=================description===================") );
+    //LogResultL( *aSD );
+
+	delete aSD;
+
+		iLog->Log(_L("Stopping active scheduler..."));
+		CActiveScheduler::Stop();
+		iStarted = EFalse;
+		}
+
+	iLog->Log(_L("******* HandleMessageL -> Finished! ********"));
+
+	}
+void CWSTester::HandleErrorL(const int aErrorCode, const TDesC8& aError)
+//void CWSTester::HandleErrorL(const TDesC8& aError)
+	{
+	iLog->Log(_L("******* HandleErrorL -> Started! ********"));
+
+	iLog->Log(_L("Run case: %d"), iRunCase );
+	iLog->Log(_L("Retrieved: "));
+  LogResultL(_L8("HandleErrorL"));
+	//LogResultL( aError );
+    TBuf8<20> buf;
+    _LIT8(KError, "Error code: %d");
+    buf.Format(KError, aErrorCode);
+    LogResultL(buf);
+
+
+	// Here is the Switch - Case for checking the error values for cases. The
+	// iCasePassed is checked after the ActiveSceduler is stopped in _X_WaitForResponse
+	// Note that every case now fails because the ErrorCodes are not cheked. All the
+	// cases must be checked with codes (Niko).
+	if ( iStarted )
+		{
+		switch( iRunCase ) {
+			case KSendInvalidXML:
+				iLog->Log( _L("Invalid XML send. Should become an html error..." ));
+				if ( aErrorCode == 500 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = TRUE;
+					}
+				else
+					{
+					// Failed. Invalid code.
+					iCasePassed = FALSE;
+					}
+				break;
+			case KSendInvalidSOAP:
+				iLog->Log( _L("The service is unreachable for now! Thats ok" ));
+				if ( aErrorCode == KErrSenSoapFault )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = TRUE;
+					}
+				else
+					{
+					iCasePassed = FALSE;
+					}
+				break;
+			case KInvalidHost:
+				iLog->Log( _L("The service is unreachable for now! Thats ok" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KInvalidLogin:
+				iLog->Log( _L("The user should have cancelled the login dialog" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KSendASAbort:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KTruncate:
+				iLog->Log( _L("The AS aborted now" ));
+				iCasePassed = EFalse;
+				break;
+			case KLowercase:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KUppercase:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KUppercaseAllowed:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KAllowUpperTrun:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KAllowedUppercase:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KAllowed:
+				iLog->Log( _L("The AS should have been aborted now" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KInvalidCredentials:
+				iLog->Log( _L("The error should have been received when Credentials are invalid" ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KUnexistantDS:
+				iLog->Log( _L("Unexistant DS case. Error should have been received..." ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KDSFailed:
+				iLog->Log( _L("DS returns fail code..." ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KDSFailedResult:
+				iLog->Log( _L("DS returns fail code..." ));
+				if ( aErrorCode == -1 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = ETrue;
+					}
+				else
+					{
+					iCasePassed = EFalse;
+					}
+				break;
+			case KInvalidWSP:
+				iLog->Log( _L("WSP returns fail code..." ));
+				if ( aErrorCode == 502 )//2.8 versin( aErrorCode == -5120 )
+					{
+					iLog->Log( _L("The received error was correct!" ));
+					iCasePassed = TRUE;
+					}
+				else
+					{
+					iCasePassed = FALSE;
+					}
+				break;
+			case KNonSupportedAM:
+					iLog->Log( _L("The service is unreachable for now! Thats ok" ));
+					if ( aErrorCode == -1 )
+						{
+						iLog->Log( _L("The received error was correct!" ));
+						iCasePassed = TRUE;
+						}
+					else
+						{
+						iCasePassed = FALSE;
+						}
+					break;
+			    case KServerError500:
+				    iLog->Log( _L("WSP returns server error 500..." ));
+				    if ( aErrorCode == 500 )
+					    {
+					    iLog->Log( _L("The received error 500 from WSP was expected!" ));
+					    iCasePassed = TRUE;
+					    }
+				    else
+					    {
+					    iCasePassed = FALSE;
+					    }
+				    break;
+			    case KServerError404:
+				    iLog->Log( _L("WSP returns server error 404..." ));
+				    if ( aErrorCode == 404 )
+					    {
+					    iLog->Log( _L("The received error 404 from WSP was expected!" ));
+					    iCasePassed = TRUE;
+					    }
+				    else
+					    {
+					    iCasePassed = FALSE;
+					    }
+				    break;
+	            case KCompleteServerMessagesOnOff_1:
+	                iLog->Log( _L("The message from service received. NOT Ok." ));
+	                iCasePassed = FALSE;
+	                break;                                  
+	            case KCompleteServerMessagesOnOff_3:
+	                iLog->Log( _L("The message from service received. NOT Ok." ));
+	                iCasePassed = FALSE;
+	                break;                                  
+				   
+			default:
+				iCasePassed = EFalse;
+				break;
+	      }
+		iLog->Log(_L("Stopping active scheduler..."));
+		CActiveScheduler::Stop();
+		iStarted = EFalse;
+		}
+
+	iLog->Log(_L("******* HandleErrorL -> Finished! ********"));
+	}
+void CWSTester::SetStatus(const TInt aStatus)
+	{
+
+		iLog->Log(_L("******* SetStatus -> Started! ********"));
+
+	switch( aStatus )
+		{
+		case 0: // new connection
+			iLog->Log( _L("New Connection (status==0)" ));
+			break;
+
+		case 1: // connection initialized
+			iLog->Log( _L("Connection initialized (status==1)" ));
+			if ( iRunCase == KSendBUCF )
+				{
+				iLog->Log( _L("KSendBUCF: connection initialized!" ));
+				SendBUCFTest();
+				}
+			else if ( iRunCase == KEndpointMovedTest )
+				{
+				iLog->Log( _L("KEndpointMovedTest: connection initialized!" ));
+				SendBUCFTest();
+				}
+			else if ( iRunCase == KSendInvalidSOAP)
+				{
+				iLog->Log( _L("KSendInvalidSOAP: connection initialized!" ));
+				SendInvalidSOAPTest();
+				}
+			else if ( iRunCase == KTruncate)
+				{
+				iLog->Log( _L("KTruncate: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KSendInvalidXML )
+				{
+				iLog->Log( _L("KSendInvalidXML: connection initialized!" ));
+				SendInvalidTest();
+				}
+			else if ( iRunCase == KNoResourceID )
+				{
+				iLog->Log( _L("KNoResourceID: connection initialized!" ));
+				SendBUCFBodyTest();
+				}
+			else if ( iRunCase == KDSEcrypted )
+				{
+				iLog->Log( _L("KDSEcrypted: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KFacets )
+				{
+				iLog->Log( _L("KFacets: connection initialized!" ));
+				TInt value = TestFacets();
+				if (value == KErrNotFound)
+					{
+					iLog->Log( _L("KFacets: FAILED!" ));
+					iCasePassed = FALSE;
+					}
+				else
+					{
+					iLog->Log( _L("KFacets: SUCCES!" ));
+					iCasePassed = TRUE;
+					}
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KSendBUCFBody )
+				{
+				iLog->Log( _L("KSendBUCFBody: connection initialized!" ));
+				SendBUCFBodyTest();
+				}
+			else if ( iRunCase == KMultippleROs )
+				{
+				iLog->Log( _L("KConnectAS: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KSendBUCFEnvelope )
+				{
+				iLog->Log( _L("KSendBUCFEnvelope: connection initialized!" ));
+				SendBUCFEnvelopeTest();
+				}
+			else if ( iRunCase == KSendBUCFEnvelope2 )
+				{
+				iLog->Log( _L("KSendBUCFEnvelope: connection initialized!" ));
+				SendBUCFEnvelopeTest2();
+				}
+			else if ( iRunCase == KConnectAS )
+				{
+				iLog->Log( _L("KConnectAS: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KLowercase )
+				{
+				iLog->Log( _L("KLowercase: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KUppercase )
+				{
+				iLog->Log( _L("KUppercase: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KAllowed )
+				{
+				iLog->Log( _L("KAllowed: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KAllowedUppercase )
+				{
+				iLog->Log( _L("KAllowedUppercase: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KUppercaseAllowed )
+				{
+				iLog->Log( _L("KUppercaseAllowed: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KAllowUpperTrun )
+				{
+				iLog->Log( _L("KAllowUpperTrun: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KInitialOK )
+				{
+				iLog->Log( _L("KInitialOK: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KBasicDisco )
+				{
+				iLog->Log( _L("KBasicDisco: connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+						else if ( iRunCase == KInvalidWSP )
+				{
+				iLog->Log( _L("KInvalidWSP : connection initialized!" ));
+				SendBUCFTest();
+
+				}
+			else if ( iRunCase == KNoCredentials )
+				{
+				iLog->Log( _L("KNoCredentials : connection initialized!" ));
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KSendYomi)
+				{
+				iLog->Log( _L("KSendYomi : connection initialized!" ));
+				SendYomiTest();
+				}
+			else if ( iRunCase == KServerError404)
+				{
+				SendSOAPRequest(NULL);
+				}
+			else if ( iRunCase == KServerError500)
+				{
+				SendSOAPRequest(NULL);
+				}
+			else if ( iRunCase == KCredentialsExpires)
+				{
+				SendSOAPRequest(310); // argument delay time for credential to expire (value on the tgx should be smaller)
+				}
+			else if ( iRunCase == KSendSOAP)
+				{
+                iCasePassed = TRUE;
+				SendSOAPTest();
+				}
+			else if ( iRunCase == KSendSOAPRequest)
+				{
+				SendSOAPRequest(NULL);
+				}
+			else if ( iRunCase == KSubmitSOAPRequest)
+				{
+				SubmitSOAPRequest();
+				}
+			else if ( iRunCase == KGetConnectionFooContaract)
+				{
+				 SendSOAPRequest(NULL);
+				}
+			else if ( iRunCase == KHasFacet)
+				{
+				CheckConnection();
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KIsReady)
+				{
+				CheckConnection();
+				iCasePassed = TRUE;
+				CActiveScheduler::Stop();
+				}
+			else if ( iRunCase == KCompleteServerMessagesOnOff_1)
+				{
+                iCasePassed = TRUE;
+				iSenServiceConnection->CompleteServerMessagesOnOff(TRUE);
+				SendSOAPRequest(NULL);
+				}
+			else if ( iRunCase == KCompleteServerMessagesOnOff_2)
+				{
+                iCasePassed = TRUE;
+				iSenServiceConnection->CompleteServerMessagesOnOff(TRUE);
+				SubmitSOAPRequest();
+				}
+			else if ( iRunCase == KSubmitSOAP)
+				{
+                iCasePassed = TRUE;
+				SubmitSOAPTest();
+				}
+			else if ( iRunCase == KCompleteServerMessagesOnOff_3)
+				{
+                iCasePassed = TRUE;
+				iSenServiceConnection->CompleteServerMessagesOnOff(TRUE);
+				SendSOAPTest();
+				}
+			else if ( iRunCase == KCompleteServerMessagesOnOff_4)
+				{
+                iCasePassed = TRUE;
+				iSenServiceConnection->CompleteServerMessagesOnOff(TRUE);
+				SubmitSOAPTest();
+                }
+   			else if ( iRunCase == KPerformanceSOAPSubmit)
+				{
+                iCasePassed = TRUE;
+				PerformanceSOAPSubmit();
+                }
+			else
+				{
+                iLog->Log(_L("Stopping active scheduler..."));
+				CActiveScheduler::Stop();
+				}
+			break;
+		case 2: // Connection expired
+			iLog->Log( _L("Connection Expired(status==2)" ));
+			break;
+		}
+	iLog->Log(_L("******* SetStatus -> Finished! ********"));
+	}
+/*################################################
+            Complex
+################################################*/
+
+TInt CWSTester::_C_ParseDomFragment( CStifItemParser& aItem )
+{
+	TInt error = KErrNone;
+	iLog->Log(_L("*******_C_ParseDomFragment -> Started!********"));
+	iLog->Log(_L("Parse XML document"));
+
+	TPtrC arg;
+	TBuf8<3072> xmlDoc;
+	aItem.GetNextString(arg);
+
+	xmlDoc.Append(arg);
+
+	//concatenating args to one string
+	while (!(aItem.GetNextString(arg)))
+	{
+		xmlDoc.Append(_L(" "));
+		xmlDoc.Append(arg);
+	}
+
+	HBufC8* pTestXml = HBufC8::NewLC(
+		xmlDoc.Length() );
+
+	TPtr8 ptr = pTestXml->Des();
+	ptr.Append(xmlDoc);
+
+	CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+	pDom->SetReader(*iXmlReader);
+
+	iXmlReader->SetContentHandler(*pDom);
+
+	iLog->Log( _L(" Parsing message....") );
+
+	TRAPD(rParse, iXmlReader->ParseL( *pTestXml ));
+	if (rParse != KErrNone) {
+		error = rParse;
+		iLog->Log(_L("Parsing failed. Error: %d"), rParse );
+		CleanupStack::PopAndDestroy(2);
+		return error;
+	}
+//AsXML "UTF8"
+	HBufC8* pBuf;
+
+	TRAPD(rAsXml, pBuf = pDom->AsXmlL());
+	if (rAsXml != KErrNone)
+		iLog->Log(_L("Converting to text failed. Error: %d"), rAsXml );
+
+	CleanupStack::PushL(pBuf);
+
+	iLog->Log( _L("Parsed message:") );
+	iLog->Log(*pBuf);
+	LogResultL( *pBuf );
+//AsXMLUnicode
+    HBufC16* pBuf2;
+
+	TRAPD(rAsXmlUnicode, pBuf2 = pDom->AsXmlUnicodeL());
+	if (rAsXmlUnicode != KErrNone)
+		iLog->Log(_L("Converting to text failed. Error: %d"), rAsXmlUnicode );
+
+	CleanupStack::PushL(pBuf2);
+
+	iLog->Log( _L("Parsed message Unicode:") );
+	iLog->Log(*pBuf2);
+	LogResultL( *pBuf2 );
+//===============
+
+
+    CleanupStack::PopAndDestroy(4);
+
+	iLog->Log(_L("******* _C_ParseDomFragment -> Ended! ********"));
+	return error;
+}
+
+TInt CWSTester::_C_ParseXMLDocument( CStifItemParser& aItem )
+{
+	iLog->Log(_L("******* _C_ParseXMLDocument Method ********"));
+	iLog->Log(_L("Parse XML document"));
+	// Get file nmae from script
+	TPtrC srcFile;
+	aItem.GetNextString(srcFile);
+    // Create DOM Element
+//__UHEAP_MARK;
+	CSenDomFragment* pDom = CSenDomFragment::NewL();
+    CleanupStack::PushL(pDom);
+	pDom->SetReader(*iXmlReader);
+	iXmlReader->SetContentHandler(*pDom);
+	// Open session to file
+	RFs fsSession;
+	CleanupClosePushL(fsSession);
+	// Check if FS is aviable
+	TRAPD(rFile, fsSession.Connect(););
+	if (rFile != KErrNone) {
+		// Test case not passed
+	    // Unable to connect to FS
+		iLog->Log(_L("Unable to connect to FS. Error: %d"), rFile);
+		LogResultL(_L8("Unable to connect to FS" ));
+		CleanupStack::PopAndDestroy(2);
+		return KErrGeneral;
+	}
+	// Parse the document specified by file
+	TRAPD(rParse, iXmlReader->ParseL(fsSession, srcFile));
+	if (rParse != KErrNone) {
+		// Test case not passed
+	    // Parser error
+		TBuf8<25> buf;
+		_LIT8(KFound, "Parse error: %d");
+		buf.Format(KFound, rParse);
+		iLog->Log(buf);
+		LogResultL(buf);
+		CleanupStack::PopAndDestroy(2);
+		return KErrNone;
+	}
+#ifdef _PROFILE
+	_X_TimeOut(aItem);
+#endif
+
+	// close fsSession
+	CleanupStack::PopAndDestroy();
+	// Store parsed documed in file
+	HBufC8* pBuf;
+	// Convert document
+	TRAPD(rAsXml, pBuf = pDom->AsXmlL());
+	if (rAsXml != KErrNone)
+		iLog->Log(_L("Converting to text failed. Error: %d"), rAsXml );
+	//Write information to log files
+	CleanupStack::PushL(pBuf);
+	iLog->Log( _L("Parsed message:") );
+	iLog->Log(*pBuf);
+	LogResultL( *pBuf );
+	// Clean stack
+	CleanupStack::PopAndDestroy(2);
+//__UHEAP_MARKEND;
+	// Return function
+	iLog->Log(_L("******* _C_ParseXMLDocument -> Ended! ********"));
+		return KErrNone;
+}
+
+/*################################################
+            Common
+################################################*/
+
+TInt CWSTester::_X_DeBase64( CStifItemParser& aItem )
+    {
+
+	_LIT8(KEndOfLine,"\n");
+
+
+    TPtrC aSrcFile;
+    TPtrC aRefFile;
+    iLog->Log(_L("******* _X_DeBase64-> Started! ********"));
+    if (iErrorsOccured==TRUE) {
+        iLog->Log(_L("### iErrorsOccured==TRUE###"));
+        return KErrGeneral;
+    }
+    aItem.GetNextString ( aSrcFile );
+    aItem.GetNextString ( aRefFile );
+
+	RFile srcFile;
+    RFile referenceFile;
+
+
+    TFileName srcFileName;
+	srcFileName.Copy(aSrcFile);
+
+    TFileName referenceFileName;
+	referenceFileName.Copy(aRefFile);
+
+    TInt nResult = KResultOK;
+
+
+    if(srcFile.Open(iFsSession, srcFileName, EFileRead) == KErrNone)
+	    {
+		// Does reference file exist.
+		if(referenceFile.Open(iFsSession, referenceFileName, EFileRead) == KErrNone)
+		    {
+	        // Integer variables for compare to length of files (result and reference).
+	        TInt resSize;
+	        TInt refSize;
+	        srcFile.Size(resSize);
+	        referenceFile.Size(refSize);
+
+			HBufC8* resBuf = HBufC8::NewLC(resSize) ;
+			HBufC8* refBuf = HBufC8::NewLC(refSize) ;
+
+			TPtr8 resPtr = resBuf->Des();
+			TPtr8 refPtr = refBuf->Des();
+
+			nResult = KResultOK;
+			// Read result file
+			srcFile.Read(resPtr);
+
+			// Read reference file
+			referenceFile.Read(refPtr);
+			// Checking the <data> value and modify the refPtr
+			// to match the case
+
+			HBufC8* pDecodedBuf8 = DeBase64DescL(resPtr); // ownership transfered!!
+			CleanupStack::PushL( pDecodedBuf8 );
+
+			if ( pDecodedBuf8 == NULL )
+				{
+				nResult = KResultFailedFound;
+				CleanupStack::PopAndDestroy(3); //pDecodedBuf8, refBuf, resBuf
+				referenceFile.Close();
+				srcFile.Close();
+				return nResult;
+				}
+
+			TPtr8 pDecoded = pDecodedBuf8->Des();
+
+
+			TInt endOfLine;
+			TInt startPos;
+			TInt delDength;
+
+			// Do the checking
+			while (TRUE)
+				{
+				endOfLine = refPtr.Find(KEndOfLine);
+				if ( refPtr.Length() == 0 )
+					{
+					break;
+					}
+				TPtr8 searchPtr = refPtr.AllocLC()->Des();
+				if ( endOfLine != KErrNotFound )
+					{
+					startPos = endOfLine - 1;
+					delDength = refSize - startPos;
+
+					searchPtr.Delete(startPos, delDength );
+					}
+				TInt found = pDecoded.Find(searchPtr);
+				if ( found == KErrNotFound )
+					{
+					CleanupStack::PopAndDestroy(); //"searchPtr"
+					nResult = KResultFailedFound;
+					break;
+					}
+
+				CleanupStack::PopAndDestroy(); //"searchPtr"
+				if (endOfLine != KErrNotFound )
+					{
+					refPtr.Delete(0, endOfLine + 1);
+					}
+				else
+					{
+					refPtr.Delete(0, refPtr.Length());
+					}
+				}
+            srcFile.Close();
+            referenceFile.Close();
+			CleanupStack::PopAndDestroy(3); //refBuf, resBuf
+			}
+		else
+			{
+			nResult = KResultFailedNoReference;
+			srcFile.Close();
+			}
+		}
+	else
+		{
+		nResult = KResultFailedNoResult;
+		}
+	return nResult;
+	}
+
+/***************
+ * This function does the Base64 decoding.
+ ****************/
+HBufC8* CWSTester::DeBase64DescL(TDesC8& aMessage)
+{
+	_LIT8(KStartData,"<sa:Data>");
+	_LIT8(KEndData,"</sa:Data>");
+
+	TInt foundStart = aMessage.Find(KStartData());
+	TInt foundEnd = aMessage.Find(KEndData());
+	if ( foundStart == KErrNotFound || foundEnd == KErrNotFound )
+		{
+		return NULL;
+		}
+
+	HBufC8* pSource8 = aMessage.AllocLC();
+	TPtr8 source8 = pSource8->Des();
+	source8.Delete(0, foundStart + KStartData().Length() );
+	foundEnd = source8.Find(KEndData());
+	source8.Delete(foundEnd, source8.Length() - foundEnd );
+
+	HBufC8* pResult8 = HBufC8::NewLC( source8.Length() );
+	TPtr8 result8 = pResult8->Des();
+	iBase64Codec.Initialise();
+	iBase64Codec.Decode(source8	, result8);
+	aMessage = result8;
+	CleanupStack::Pop(); // pResult8
+	CleanupStack::PopAndDestroy(); // pSource8
+	return pResult8;
+}
+
+TInt CWSTester::_X_NonIncludance( CStifItemParser& aItem )
+	{
+    TPtrC srcFile;
+    TPtrC refFile;
+    iLog->Log(_L("******* _X_NonIncludance-> Started! ********"));
+    if (iErrorsOccured==TRUE)
+		{
+        iLog->Log(_L("### iErrorsOccured==TRUE###"));
+        return KErrGeneral;
+		}
+    aItem.GetNextString ( srcFile );
+    aItem.GetNextString ( refFile );
+   	TBool answer;
+    iFsSession.IsFileOpen(srcFile, answer);
+    if (answer == TRUE)
+		{
+        iResultFile.Flush();
+	    iResultFile.Close();
+		}
+    return CheckNonIncludanceL(srcFile, refFile);
+	}
+
+TInt CWSTester::CheckNonIncludanceL(TPtrC aSrcFile, TPtrC aReferenceFile)
+    {
+
+	_LIT8(KEndOfLine,"\n");
+
+	RFile srcFile;
+    RFile referenceFile;
+
+
+    TFileName srcFileName;
+	srcFileName.Copy(aSrcFile);
+
+    TFileName referenceFileName;
+	referenceFileName.Copy(aReferenceFile);
+
+    TInt nResult = KResultOK;
+
+
+    if(srcFile.Open(iFsSession, srcFileName, EFileRead) == KErrNone)
+	    {
+		// Does reference file exist.
+		if(referenceFile.Open(iFsSession, referenceFileName, EFileRead) == KErrNone)
+		    {
+	        // Integer variables for compare to length of files (result and reference).
+	        TInt resSize;
+	        TInt refSize;
+	        srcFile.Size(resSize);
+	        referenceFile.Size(refSize);
+
+			HBufC8* resBuf = HBufC8::NewLC(resSize) ;
+			HBufC8* refBuf = HBufC8::NewLC(refSize) ;
+
+			TPtr8 resPtr = resBuf->Des();
+			TPtr8 refPtr = refBuf->Des();
+
+			nResult = KResultOK;
+			// Read result file
+			srcFile.Read(resPtr);
+
+			// Read reference file
+			referenceFile.Read(refPtr);
+
+			TInt endOfLine;
+			TInt startPos;
+			TInt delDength;
+
+			// Do the checking
+			while (TRUE)
+				{
+				endOfLine = refPtr.Find(KEndOfLine);
+				if ( refPtr.Length() == 0 )
+					{
+					break;
+					}
+				TPtr8 searchPtr = refPtr.AllocLC()->Des();
+				if ( endOfLine != KErrNotFound )
+					{
+					startPos = endOfLine - 1;
+					delDength = refSize - startPos;
+
+					searchPtr.Delete(startPos, delDength );
+					}
+				TInt found = resPtr.Find(searchPtr);
+				if ( found != KErrNotFound )
+					{
+					CleanupStack::PopAndDestroy(); //"searchPtr"
+					nResult = KResultFailedFound;
+					break;
+					}
+
+				CleanupStack::PopAndDestroy(); //"searchPtr"
+				if (endOfLine != KErrNotFound )
+					{
+					refPtr.Delete(0, endOfLine + 1);
+					}
+				else
+					{
+					refPtr.Delete(0, refPtr.Length());
+					}
+				}
+			CleanupStack::PopAndDestroy(2); //refBuf, resBuf
+            referenceFile.Close();
+            srcFile.Close();
+			}
+		else
+			{
+			nResult = KResultFailedNoReference;
+			}
+		srcFile.Close();
+		}
+	else
+		{
+		nResult = KResultFailedNoResult;
+		}
+	return nResult;
+    }
+TInt CWSTester::_X_NonExistence( CStifItemParser& aItem )
+	{
+	TPtrC aSrcFile;
+	iLog->Log(_L("******* _X_NonExistence-> Started! ********"));
+	aItem.GetNextString ( aSrcFile );
+
+	RFile srcFile;
+
+    TFileName srcFileName;
+	srcFileName.Copy(aSrcFile);
+
+    if(srcFile.Open(iFsSession, srcFileName, EFileRead) == KErrNone)
+		{
+		return KErrGeneral;
+		}
+	else
+		{
+		return KErrNone;
+		}
+	}
+TInt CWSTester::_X_Includance( CStifItemParser& aItem )
+	{
+	TPtrC srcFile;
+	TPtrC refFile;
+	iLog->Log(_L("******* _X_Includance-> Started! ********"));
+	if (iErrorsOccured==TRUE)
+		{
+		iLog->Log(_L("### iErrorsOccured==TRUE###"));
+		return KErrGeneral;
+		}
+	aItem.GetNextString ( srcFile );
+	aItem.GetNextString ( refFile );
+	TBool answer;
+	iFsSession.IsFileOpen(srcFile, answer);
+	if (answer == TRUE)
+		{
+		iResultFile.Flush();
+		iResultFile.Close();
+		}
+   	return CheckIncludanceL(srcFile, refFile);
+	}
+
+
+TInt CWSTester::CheckIncludanceL(TPtrC aSrcFile, TPtrC aReferenceFile)
+    {
+	_LIT8(KEndOfLine,"\n");
+
+	RFile srcFile;
+    RFile referenceFile;
+
+
+    TFileName srcFileName;
+	srcFileName.Copy(aSrcFile);
+
+    TFileName referenceFileName;
+	referenceFileName.Copy(aReferenceFile);
+
+    TInt nResult = KResultOK;
+
+
+    if(srcFile.Open(iFsSession, srcFileName, EFileRead) == KErrNone)
+	    {
+		// Does reference file exist.
+		if(referenceFile.Open(iFsSession, referenceFileName, EFileRead) == KErrNone)
+		    {
+	        // Integer variables for compare to length of files (result and reference).
+	        TInt resSize;
+	        TInt refSize;
+	        srcFile.Size(resSize);
+	        referenceFile.Size(refSize);
+
+			HBufC8* resBuf = HBufC8::NewLC(resSize) ;
+			HBufC8* refBuf = HBufC8::NewLC(refSize) ;
+
+			TPtr8 resPtr = resBuf->Des();
+			TPtr8 refPtr = refBuf->Des();
+
+			nResult = KResultOK;
+			// Read result file
+			srcFile.Read(resPtr);
+
+			// Read reference file
+			referenceFile.Read(refPtr);
+
+			TInt endOfLine;
+			TInt startPos;
+			TInt delDength;
+
+			// Do the checking
+			// Searches for EndOfLine. This algorithm reads line by line
+			// from the file and searches the pattern from the target file.
+			// The file may or may not end to a EndOfLine. Both are
+			// accepted.
+			while (TRUE)
+				{
+				endOfLine = refPtr.Find(KEndOfLine);
+				if ( refPtr.Length() == 0 )
+					{
+					break;
+					}
+				TPtr8 searchPtr = refPtr.AllocLC()->Des();
+				if ( endOfLine != KErrNotFound )
+					{
+					startPos = endOfLine - 1;
+					delDength = refSize - startPos;
+					searchPtr.Delete(startPos, delDength );
+					}
+				TInt found = resPtr.Find(searchPtr);
+				if ( found == KErrNotFound )
+					{
+					CleanupStack::PopAndDestroy(); //"searchPtr"
+					nResult = KResultFailedNotIdentical;
+					break;
+					}
+
+				CleanupStack::PopAndDestroy(); //"searchPtr"
+				if (endOfLine != KErrNotFound )
+					{
+					refPtr.Delete(0, endOfLine + 1);
+					}
+				else
+					{
+					refPtr.Delete(0, refPtr.Length());
+					}
+				}
+			CleanupStack::PopAndDestroy(2); //refBuf, resBuf
+            referenceFile.Close();
+            srcFile.Close();
+			}
+		else
+			{
+			nResult = KResultFailedNoReference;
+			}
+		srcFile.Close();
+		}
+	else
+		{
+		nResult = KResultFailedNoResult;
+		}
+	return nResult;
+    }
+
+TInt CWSTester::_X_WaitForResponse( CStifItemParser& aItem )
+	{
+    iLog->Log(_L("### WaitForResponse -> started ###"));
+    iStarted = TRUE;
+	iCasePassed = EFalse;
+    CActiveScheduler::Start();
+	iLog->Log(_L("### WaitForResponse -> finished ###"));
+    iLog->Log(_L("### Checking if everything went ok... ###"));
+	if ( iCasePassed == TRUE )
+		{
+        iLog->Log(_L("### CasePassed is TRUE###"));
+		return KErrNone;
+		}
+	else
+		{
+        iLog->Log(_L("### CasePassed is FALSE###"));
+        return KErrGeneral;
+		}
+	}
+
+
+TInt CWSTester::_X_Reference( CStifItemParser& aItem ){
+    TPtrC srcFile;
+    TPtrC refFile;
+    iLog->Log(_L("******* _X_Reference-> Started! ********"));
+    if (iErrorsOccured==TRUE) {
+        iLog->Log(_L("### iErrorsOccured==TRUE###"));
+        return KErrGeneral;
+    }
+    aItem.GetNextString ( srcFile );
+    aItem.GetNextString ( refFile );
+   	TBool answer;
+#ifndef _PERFORMANCE   	
+    iFsSession.IsFileOpen(srcFile, answer);
+    if (answer == TRUE){
+    	iWriter.Close();
+        //iResultFile.Flush();
+	    //iResultFile.Close();
+    }
+    return CheckResultL(srcFile, refFile);
+#else 
+    return KErrNone;
+#endif
+
+}
+TInt CWSTester::_X_ReferenceFragment( CStifItemParser& aItem ){
+    TPtrC srcFile;
+    TPtrC refFile;
+    iLog->Log(_L("******* _X_ReferenceFragment-> Started ! ********"));
+    if (iErrorsOccured==TRUE) {
+        iLog->Log(_L("### iErrorsOccured==TRUE###"));
+        return KErrGeneral;
+    }
+    aItem.GetNextString ( srcFile );
+    aItem.GetNextString ( refFile );
+   	TBool answer;
+    iFsSession.IsFileOpen(srcFile, answer);
+    if (answer == TRUE){
+		iWriter.Close();
+        //iResultFile.Flush();
+	    //iResultFile.Close();
+    }
+    return CheckResultFragmentL(srcFile, refFile);
+}
+TInt CWSTester::_X_LogResult( CStifItemParser& aItem ){
+    //TPtrC resFile;
+    TInt err;
+	TInt size = 0;
+    aItem.GetNextString ( iResFile );
+    TFileName resultFileName;
+#ifndef _PERFORMANCE
+    resultFileName.Copy(iResFile);
+    TInt res = iResultFile.Create(iFsSession, resultFileName, EFileStreamText|EFileWrite);
+    err = iResultFile.Size(size);
+    if (err != KErrNone){
+        return err;
+    }
+	iWriter.Attach(iResultFile, (size));
+    return res;
+#else 
+    return KErrNone;
+#endif
+}
+TInt CWSTester::_X_Init( CStifItemParser& aItem ){
+    TPtrC srcFile;
+    TPtrC dstFile;
+    TInt result;
+    aItem.GetNextString ( srcFile );
+    aItem.GetNextString ( dstFile );
+    CFileMan* fileMan = CFileMan::NewL(iFsSession);
+    CleanupStack::PushL(fileMan);
+    result = fileMan->Copy(srcFile, dstFile, CFileMan::EOverWrite);
+    CleanupStack::PopAndDestroy();
+   	return result;
+}
+TInt CWSTester::_X_DeleteFile( CStifItemParser& aItem ){
+    TPtrC file;
+    TInt result;
+    aItem.GetNextString ( file );
+    CFileMan* fileMan = CFileMan::NewL(iFsSession);
+    CleanupStack::PushL(fileMan);
+    result = fileMan->Delete(file);
+        if (result == KErrNotFound){
+        result = KErrNone;
+    }
+    CleanupStack::PopAndDestroy();
+   	return result;
+}
+
+TInt CWSTester::_X_TimeOut( CStifItemParser& aItem ){
+
+	iLog->Log(_L("### TimeOut -> started ###"));
+	RTimer timer;  // The synchronous timer
+	TInt result( KErrNone );
+	TInt aMicroSecs (10); // default value
+	TRequestStatus timerStatus; // associated with timer
+
+    aItem.GetNextInt( aMicroSecs );
+	result = timer.CreateLocal();   // Always created for this thread.
+	timer.After(timerStatus,aMicroSecs*1000000);
+	User::WaitForRequest(timerStatus);
+	timer.Close();
+	iLog->Log(_L("### TimeOut -> finished  ###"));
+	return result;
+}
+TInt CWSTester::_X_Flag(CStifItemParser& aItem ){
+    iLog->Log(_L("### Setting flag -> started ###"));
+
+    TPtrC string;
+    if (!(aItem.GetNextString ( string ))){
+        if (string.Compare(_L16("KSendSOAP")) == 0){
+            iRunCase = KSendSOAP;
+        }else if(string.Compare(_L16("KSendYomi")) == 0){
+            iRunCase = KSendYomi;
+        }else if(string.Compare(_L16("KEndpointMovedTest")) == 0){
+            iRunCase = KEndpointMovedTest;
+        }else if(string.Compare(_L16("KSendInvalidSOAP")) == 0){
+            iRunCase = KSendInvalidSOAP;
+        }else if(string.Compare(_L16("KSubmitSOAP")) == 0){
+            iRunCase = KSubmitSOAP;
+        }else if (string.Compare(_L16("KSendSOAPRequest")) == 0){
+            iRunCase = KSendSOAPRequest;
+        }else if (string.Compare(_L16("KSubmitSOAPRequest")) == 0){
+            iRunCase = KSubmitSOAPRequest;
+        }else if(string.Compare(_L16("KSendInvalidXML")) == 0){
+            iRunCase = KSendInvalidXML;
+        }else if(string.Compare(_L16("KNoResourceID")) == 0){
+            iRunCase = KNoResourceID;
+		}else if(string.Compare(_L16("KDSEcrypted")) == 0){
+            iRunCase = KDSEcrypted;
+        }else if(string.Compare(_L16("KConnectAS")) == 0){
+            iRunCase = KConnectAS;
+        }else if(string.Compare(_L16("KInvalidLogin")) == 0){
+            iRunCase = KInvalidLogin;
+        }else if (string.Compare(_L16("KInvalidHost")) == 0){
+            iRunCase = KInvalidHost;
+        }else if(string.Compare(_L16("KBasicDisco")) == 0){
+            iRunCase = KBasicDisco;
+        }else if(string.Compare(_L16("KDSFailedResult")) == 0){
+            iRunCase = KDSFailedResult;
+        }else if(string.Compare(_L16("KDSFailed")) == 0){
+            iRunCase = KDSFailed;
+        }else if(string.Compare(_L16("KSendBUCF")) == 0){
+            iRunCase = KSendBUCF;
+        }else if(string.Compare(_L16("KSendBUCFBody")) == 0){
+            iRunCase = KSendBUCFBody;
+        }else if(string.Compare(_L16("KSendBUCFEnvelope2")) == 0){
+            iRunCase = KSendBUCFEnvelope2;
+        }else if(string.Compare(_L16("KSendBUCFEnvelope")) == 0){
+            iRunCase = KSendBUCFEnvelope;
+        }else if(string.Compare(_L16("KSendASAbort")) == 0){
+            iRunCase = KSendASAbort;
+        }else if(string.Compare(_L16("KLowercase")) == 0){
+            iRunCase = KLowercase;
+        }else if(string.Compare(_L16("KUppercase")) == 0){
+            iRunCase = KUppercase;
+        }else if(string.Compare(_L16("KTruncate")) == 0){
+            iRunCase = KTruncate;
+        }else if(string.Compare(_L16("KInvalidWSP")) == 0){
+            iRunCase = KInvalidWSP;
+        }else if(string.Compare(_L16("KInitialOK")) == 0){
+            iRunCase = KInitialOK;
+        }else if(string.Compare(_L16("KUppercaseAllowed")) == 0){
+            iRunCase = KUppercaseAllowed;
+        }else if(string.Compare(_L16("KAllowedUppercase")) == 0){
+            iRunCase = KAllowedUppercase;
+        }else if(string.Compare(_L16("KAllowed")) == 0){
+            iRunCase = KAllowed;
+		}else if(string.Compare(_L16("KAllowUpperTrun")) == 0){
+            iRunCase = KAllowUpperTrun;
+        }else if(string.Compare(_L16("KInvalidCredentials")) == 0){
+            iRunCase = KInvalidCredentials;
+        }else if(string.Compare(_L16("KUnexistantDS")) == 0){
+            iRunCase = KUnexistantDS;
+        }else if(string.Compare(_L16("KMultippleROs")) == 0){
+            iRunCase = KMultippleROs;
+        }else if(string.Compare(_L16("KFacets")) == 0){
+            iRunCase = KFacets;
+        }else if(string.Compare(_L16("KNoCredentials")) == 0){
+            iRunCase = KNoCredentials;
+        }else if(string.Compare(_L16("KNonSupportedAM")) == 0){
+	          iRunCase = KNonSupportedAM;
+        }else if(string.Compare(_L16("KCredentialsExpires")) == 0){
+        	iRunCase = KCredentialsExpires;
+        }else if(string.Compare(_L16("KServerError500")) == 0){
+        	iRunCase = KServerError500;
+        }else if(string.Compare(_L16("KServerError404")) == 0){
+        	iRunCase = KServerError404;
+	    }else if(string.Compare(_L16("KHasFacet")) == 0){
+        	iRunCase = KHasFacet;
+	    }else if(string.Compare(_L16("KIsReady")) == 0){
+        	iRunCase = KIsReady;
+	    }else if(string.Compare(_L16("KCompleteServerMessagesOnOff_1")) == 0){
+        	iRunCase = KCompleteServerMessagesOnOff_1;
+	    }else if(string.Compare(_L16("KCompleteServerMessagesOnOff_2")) == 0){
+        	iRunCase = KCompleteServerMessagesOnOff_2;
+	    }else if(string.Compare(_L16("KCompleteServerMessagesOnOff_3")) == 0){
+        	iRunCase = KCompleteServerMessagesOnOff_3;
+	    }else if(string.Compare(_L16("KCompleteServerMessagesOnOff_4")) == 0){
+        	iRunCase = KCompleteServerMessagesOnOff_4;
+	    }else if(string.Compare(_L16("KPerformanceSOAPSubmit")) == 0){
+        	iRunCase = KPerformanceSOAPSubmit;	    
+	    }
+
+        return KErrNone;
+    }
+    return KErrNotFound;
+}
+TInt CWSTester::_X_CheckDir(CStifItemParser& aItem ){
+    iLog->Log(_L("### Openning a directory -> started ###"));
+
+	RDir dir;
+	TPtrC dirName;
+	aItem.GetNextString ( dirName );
+	TInt error = KErrNone;
+	error = dir.Open(iFsSession, dirName, KEntryAttNormal);
+	dir.Close();
+    return error;
+}
+
+TInt CWSTester::_X_CheckFile(CStifItemParser& aItem ){
+    iLog->Log(_L("### Openning a file -> started ###"));
+
+	RFile file;
+	TPtrC fileName;
+	aItem.GetNextString ( fileName );
+	//TBuf8<1> buf;
+	TInt error = KErrNone;
+	error = file.Open(iFsSession, fileName, EFileRead);
+	//file.Read(buf);
+	file.Close();
+    return error;
+}
+
+TInt CWSTester::_C_Dump(CStifItemParser& aItem ){
+    iLog->Log(_L("### Dumping -> started ###"));
+	TPtrC part;
+    TPtrC way;
+
+    aItem.GetNextString(part);
+    aItem.GetNextString(way);
+    //===============ENVELOPE
+    if (part.Compare(_L16("Envelope")) == 0){
+        if (way.Compare(_L16("Xml")) == 0){
+            HBufC8* xml = iSOAPMessage->AsXmlL();
+            LogResultL( xml->Des() );
+            delete xml;
+            xml = NULL;
+        }else if (way.Compare(_L16("String")) == 0){
+            iLog->Log(_L("### wrong combination###"));
+            return KErrGeneral;
+        }
+    }
+    //===============HEADER
+
+    else if (part.Compare(_L16("Header")) == 0){
+        MSenElement* header = iSOAPMessage->HeaderL().AsElement();
+        if (way.Compare(_L16("Xml")) == 0){
+            HBufC8* xml = header->AsXmlL();
+            LogResultL( xml ->Des());
+            delete xml;
+            xml = NULL;
+        }else if (way.Compare(_L16("String")) == 0){
+            iLog->Log(_L("### wrong combination###"));
+            return KErrGeneral;
+        }
+    }
+    //===============BODY
+    else if (part.Compare(_L16("Body")) == 0){
+        MSenElement* body = iSOAPMessage->BodyL().AsElement();
+        if (way.Compare(_L16("Xml")) == 0){
+            HBufC8* xml = body->AsXmlL();
+            LogResultL( xml ->Des() );
+            delete xml;
+            xml = NULL;
+        }else if (way.Compare(_L16("String")) == 0){
+            HBufC8* bodyAsString = iSOAPMessage->BodyAsStringL();
+            LogResultL( bodyAsString ->Des());
+            delete bodyAsString;
+            bodyAsString = NULL;
+        }
+    }else{
+        iLog->Log(_L("### wrong combination###"));
+        return KErrGeneral;
+    }
+    iLog->Log(_L("### Dumping -> finished###"));
+    return KErrNone;
+}
+
+TInt CWSTester::_X_Iteration( CStifItemParser& aItem ){
+        iLog->Log(_L("### TestItteration seter -> started ###"));
+		//TInt iTestIteracion (1); // default value
+    	aItem.GetNextInt( iTestIteracion );
+	    iLog->Log(_L("TestItteration set"));
+        return KErrNone;
+
+}
+/*################################################
+            IAP Selection
+################################################*/
+
+TInt CWSTester::_X_IAPList(CStifItemParser& aItem ){
+	TInt error = KErrNone;
+	//Get all existing IAPs
+    CCommsDatabase* CommDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(CommDb);
+    CCommsDbTableView* tableIAP = CommDb->OpenTableLC(TPtrC(IAP));
+    iLog->Log(_L("### Openning a CommDB -> started ###"));
+    if (tableIAP->GotoFirstRecord()==KErrNone)
+    {         
+       do {
+            TUint32 uid(0);
+            tableIAP->ReadUintL(TPtrC(COMMDB_ID),uid);
+    		TBuf<KCommsDbSvrMaxColumnNameLength> bufName;
+            tableIAP->ReadTextL(TPtrC(COMMDB_NAME),bufName);
+            
+             TBuf<KCommsDbSvrMaxColumnNameLength + 10> buf;
+    		_LIT(KFormat,"%S - %d\n");
+    		buf.Format(KFormat, &bufName, uid);
+    		LogResultL(buf);
+        }
+        while(tableIAP->GotoNextRecord()==KErrNone);
+    }
+    else 
+    {
+    	error = tableIAP->GotoFirstRecord();
+    }
+
+    CleanupStack::PopAndDestroy(tableIAP);
+    CleanupStack::PopAndDestroy(CommDb);
+    return error;
+}
+
+TInt CWSTester::_X_SOAPRequest( CStifItemParser& aItem ){
+        iLog->Log(_L("### RequestQuery -> started ###"));
+        TBuf8<255> pRequestBody;
+		TPtrC arg;
+        aItem.GetNextString(arg);
+        pRequestBody.Append(arg);
+
+		while (!(aItem.GetNextString(arg)))
+		{
+       		pRequestBody.Append(_L(" "));
+			pRequestBody.Append(arg);
+
+		}
+
+        iLog->Log(pRequestBody);
+
+		iSOAPRequest = pRequestBody;
+		//LogResultL( iSOAPRequest );
+
+
+	    iLog->Log(_L("RequestQuery created.."));
+
+        return KErrNone;
+
+}
+void CWSTester::SendSOAPRequest(TInt aDelay){
+
+    iLog->Log(_L("### SendRequest -> started ###"));
+    if(aDelay !=NULL)
+    {
+    	iLog->Log(_L("### Delay -> started ###"));
+		RTimer timer;  // The synchronous timer
+		TInt aMicroSecs (aDelay); // default value
+		TRequestStatus timerStatus; // associated with timer
+		timer.CreateLocal();   // Always created for this thread.
+		timer.After(timerStatus,aMicroSecs*1000000);
+		User::WaitForRequest(timerStatus);
+		timer.Close();
+		iLog->Log(_L("### Delay -> finished  ###"));
+    }
+
+	iSenServiceConnection->SendL(iSOAPRequest);
+
+	iLog->Log(_L("******* SendRequest -> Ended! ********"));
+
+	}
+
+void CWSTester::PerformanceSOAPSubmit(){
+
+    iLog->Log(_L("### Performance - SubmitSOAP -> started ###"));
+	HBufC8* pResponse = NULL;    
+	for(TInt i = 0; i < iTestIteracion; i++)
+	{
+		iSenServiceConnection->SubmitL(iSOAPRequest, pResponse);
+		if(pResponse)
+			{
+			iLog->Log( _L("Received response:") );
+			}
+		else
+			{
+			iLog->Log( _L(" Response NULL! ") );
+        	iErrorsOccured = TRUE;
+			}		
+	}
+	iCasePassed = TRUE;
+	CActiveScheduler::Stop();
+	iLog->Log(_L("******* Performance - SubmitSOAP -> Ended! ********"));
+
+	}	
+
+void CWSTester::SubmitSOAPRequest(){
+
+    iLog->Log(_L("### SubmitRequest -> started ###"));
+
+	HBufC8* pResponse = NULL;
+
+	iSenServiceConnection->SubmitL(iSOAPRequest, pResponse);
+
+	if(pResponse)
+		{
+		CleanupStack::PushL(pResponse);
+		//HBufC* pUnicode = SenXmlUtils::ToUnicodeLC( pResponse->Des() );
+		iLog->Log( _L("Received response:") );
+		//iLog->Log( pUnicode->Des() );
+		//LogResultL( pUnicode->Des() );
+        LogResultL( *pResponse );
+		//CleanupStack::PopAndDestroy(); // pUnicode
+		CleanupStack::PopAndDestroy(); // pResponse
+		}
+	else
+		{
+		iLog->Log( _L(" Response NULL! ") );
+        iErrorsOccured = TRUE;
+		}
+
+	iCasePassed = TRUE;
+	CActiveScheduler::Stop();
+	iLog->Log(_L("******* SubmitSOAPRequest -> Ended! ********"));
+
+	}
+
+
+void CWSTester::SendSOAPTest()
+	{
+	iLog->Log(_L("******* SendSOAPTest -> Started! ********"));
+
+    if(iSOAPMessage)
+		{
+        //change serene
+        //HBufC16* pInitRequest = iSOAPMessage->AsXmlUnicodeL();	// as xml{
+		HBufC8* pInitRequest = iSOAPMessage->AsXmlL();	// as xml
+
+		if(pInitRequest)
+			{
+			CleanupStack::PushL(pInitRequest);
+			iLog->Log(_L("Sending:"));
+            //LogResultL(*pInitRequest);
+			CleanupStack::PopAndDestroy(); // pInitRequest
+			}
+
+		iSenServiceConnection->SendL( *iSOAPMessage );
+		iLog->Log(_L("SOAP message sent!"));
+    }else{
+        iSOAPMessage = CSenSoapMessage::NewL();
+        iLog->Log(_L("Creating empty SOAP message.."));
+        iSenServiceConnection->SendL( *iSOAPMessage  );
+		iLog->Log(_L("empty SOAP message sent!"));
+    }
+
+
+	iLog->Log(_L("******* SendSOAPTest -> Ended! ********"));
+
+	}
+void CWSTester::SendInvalidSOAPTest()
+	{
+	iLog->Log(_L("******* SendInvalidSOAPTest -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "<ab:Querykikka xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItemJorma><ab:Select>/ab:Card[ab:N/ab:FAMILY='Smith' and ab:N/ab:GIVEN='John']</ab:Select></ab:QueryItemJorma></ab:Querykikka>");
+
+
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendInvalidSOAPTest -> Ended! ********"));
+
+	}
+void CWSTester::SendInvalidTest()
+	{
+	iLog->Log(_L("******* SendInvalidTest -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[ab:N/ab:FAMILY='Smith' and ab:N/ab:GIVEN='John']</ab:Select></ab:QueryItem></ab:Query>");
+
+
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendBUCFTest -> Ended! ********"));
+
+	}
+void CWSTester::SendYomiTest()
+	{
+	iLog->Log(_L("******* SendYomiTest -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "<GetStationInfoRequest xmlns=\"http://radio.aol.com/xsd/2.0/ns/\" ><Stations><Station><Id>6546</Id></Station></Stations><Fields/></GetStationInfoRequest>");
+
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendYomiTest -> Ended! ********"));
+
+	}
+void CWSTester::SendBUCFTest()
+	{
+	iLog->Log(_L("******* SendBUCFTest -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[ab:N/ab:FAMILY='Smith' and ab:N/ab:GIVEN='John']</ab:Select></ab:QueryItem></ab:Query>");
+
+
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendBUCFTest -> Ended! ********"));
+
+	}
+void CWSTester::SendBUCFEnvelopeTest2()
+	{
+	iLog->Log(_L("******* SendBUCFEnvelopeTest2 -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFEnvelopeTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[ab:N/ab:FAMILY='Smith' and ab:N/ab:GIVEN='John']</ab:Select></ab:QueryItem></ab:Query>");
+
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendBUCFEnvelopeTest2 -> Ended! ********"));
+
+	}
+
+void CWSTester::SendBUCFEnvelopeTest()
+	{
+	iLog->Log(_L("******* SendBUCFEnvelopeTest -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFEnvelopeTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[ab:N/ab:FAMILY='Smith' and ab:N/ab:GIVEN='John']</ab:Select></ab:QueryItem></ab:Query>");
+
+	TBool completeOn = ETrue;
+
+	TInt err = iSenServiceConnection->CompleteServerMessagesOnOff( completeOn );
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendBUCFEnvelopeTest -> Ended! ********"));
+
+	}
+void CWSTester::SendBUCFBodyTest()
+	{
+	iLog->Log(_L("******* SendBUCFBodyTest -> Started! ********"));
+
+	iLog->Log( _L("SendBUCFTest() SENDING REQUEST.... ") );
+
+	_LIT8(KRequest, "<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\"><ab:QueryItem><ab:Select>/ab:Card[ab:N/ab:FAMILY='Smith' and ab:N/ab:GIVEN='John']</ab:Select></ab:QueryItem></ab:Query>");
+
+	TBool completeOn = EFalse;
+
+	TInt err = iSenServiceConnection->CompleteServerMessagesOnOff( completeOn );
+	iSenServiceConnection->SendL(KRequest);
+
+	iLog->Log(_L("******* SendBUCFTest -> Ended! ********"));
+
+	}
+
+void CWSTester::SubmitSOAPTest()
+	{
+    TInt error = KErrNone;
+	iLog->Log(_L("******* SubmitSOAPTest -> Started! ********"));
+	if(iSOAPMessage)
+		{
+		HBufC8* pInitRequest = iSOAPMessage->AsXmlL();	// as xml
+
+		if(pInitRequest)
+			{
+			CleanupStack::PushL(pInitRequest);
+			iLog->Log(_L("Submitting:"));
+			LogResultL( *pInitRequest );
+			CleanupStack::PopAndDestroy(); // pInitRequest
+			}
+
+		}
+
+	HBufC8* pResponse = NULL;
+
+	error = iSenServiceConnection->SubmitL(*iSOAPMessage, pResponse);
+
+    if (error == KErrSenSoapFault){
+        LogResultL(_L8("KErrSenSoapFault"));
+        iLog->Log( _L("Received Fault response:") );
+	    iErrorsOccured = TRUE;
+	
+    }else if (error != KErrNone){
+        LogResultL(_L("error"));
+        iErrorsOccured = TRUE;
+    }
+
+	if(pResponse)
+		{
+		CleanupStack::PushL(pResponse);
+		//HBufC* pUnicode = SenXmlUtils::ToUnicodeLC( pResponse->Des() );
+		iLog->Log( _L("Received Normal Body response:") );
+		//LogResultL( pUnicode->Des() );
+        LogResultL(*pResponse);
+		//CleanupStack::PopAndDestroy(); // pUnicode
+		CleanupStack::PopAndDestroy(); // pResponse
+		}
+	else
+		{
+		iLog->Log( _L(" Response NULL! ") );
+        iErrorsOccured = TRUE;
+		}
+
+	CActiveScheduler::Stop();
+	iLog->Log(_L("******* SubmitSOAPTest -> Ended! ********"));
+	}
+void CWSTester::CheckConnection(){
+	TBool pIsReady = TRUE;
+	if ( iRunCase == KHasFacet )
+	{
+		TBool pHasFacet = TRUE;
+
+		_LIT8(KFacet, "urn:liberty:id-sis-pp");
+		iSenServiceConnection->HasFacetL(KFacet,pHasFacet);
+
+		if(pHasFacet == TRUE) LogResultL(_L8("Has defined Facet"));
+	}
+	else
+	{
+   	    TInt retVal = iSenServiceConnection->IsReady( pIsReady );
+        if(pIsReady == TRUE) LogResultL(_L8("Connection received"));
+
+
+	    iLog->Log(_L("###Validating service connection IsReady -> started###"));
+
+
+	    TInt retVal2 = iSenServiceConnection->IsReady( pIsReady );
+
+	    if(pIsReady == TRUE)
+	    {
+		    HBufC8* aSD;
+		    iLog->Log(_L("Connection validated"));
+		    iLog->Log( _L("Getting the services description....") );
+		    iSenServiceConnection->ServiceDescriptionL( aSD );
+    	    LogResultL( *aSD );
+    	    delete aSD;
+	    } else iLog->Log(_L("Connection NOT validated!!!"));
+	}
+}
+
+TInt CWSTester::CheckResultFragmentL(TPtrC aSrcFile, TPtrC aReferenceFile){
+    RFile srcFile;
+    RFile referenceFile;
+
+
+    TFileName srcFileName;
+	srcFileName.Copy(aSrcFile);
+
+    TFileName referenceFileName;
+	referenceFileName.Copy(aReferenceFile);
+    TInt nResult = KResultFailedNotIdentical;
+    if(srcFile.Open(iFsSession, srcFileName, EFileStreamText|EFileRead) == KErrNone)
+	    {
+		// Does reference file exist.
+		if(referenceFile.Open(iFsSession, referenceFileName, EFileStreamText|EFileRead) == KErrNone)
+		    {
+	        // Integer variables for compare to length of files (result and reference).
+	        TInt resSize;
+	        TInt refSize;
+	        srcFile.Size(resSize);
+	        referenceFile.Size(refSize);
+
+	        TBuf8<1> resBuf;
+	        TBuf8<1> refBuf;
+	        nResult = KResultFailedNotIdentical;
+            TInt j = 0;
+	        for(TInt i = 0; i < resSize; i++)
+		    {
+		        // Read result file
+		        srcFile.Read(resBuf);
+			        // Read reference file
+    	        referenceFile.Read(refBuf);
+			        // Compare single letter at the time.
+
+		        if(resBuf[0] == refBuf[0])
+			    {
+                    j++;
+                    if (refSize == j) {
+                        nResult = KResultOK;
+                        break;//ok
+                    }
+			    }else{
+                    TInt zero = 0;
+                    referenceFile.Seek(ESeekStart, zero);//reset
+                    j=0;
+                }
+		    }
+            referenceFile.Close();
+            srcFile.Close();
+			}
+		else
+			{
+			nResult = KResultFailedNoReference;
+			}
+		srcFile.Close();
+		}
+	else
+		{
+		nResult = KResultFailedNoResult;
+		}
+	return nResult;
+}
+TInt CWSTester::CheckResultL(TPtrC aSrcFile, TPtrC aReferenceFile)
+    {
+    RFile srcFile;
+    RFile referenceFile;
+
+
+    TFileName srcFileName;
+	srcFileName.Copy(aSrcFile);
+
+    TFileName referenceFileName;
+	referenceFileName.Copy(aReferenceFile);
+
+    TInt nResult = KResultOK;
+
+
+    if(srcFile.Open(iFsSession, srcFileName, EFileStreamText|EFileRead) == KErrNone)
+	    {
+		// Does reference file exist.
+		if(referenceFile.Open(iFsSession, referenceFileName, EFileStreamText|EFileRead) == KErrNone)
+		    {
+	        // Integer variables for compare to length of files (result and reference).
+	        TInt resSize;
+	        TInt refSize;
+	        srcFile.Size(resSize);
+	        referenceFile.Size(refSize);
+
+            // Next compare one letter at the time, but only if files have same length.
+            if(resSize == refSize)
+		        {
+		        TBuf8<1> resBuf;
+		        TBuf8<1> refBuf;
+		        nResult = KResultOK;
+		        for(TInt i = 0; i < resSize; i++)
+			        {
+			        // Read result file
+			        srcFile.Read(resBuf);
+
+			        // Read reference file
+			        referenceFile.Read(refBuf);
+
+			        // Compare single letter at the time.
+
+			        if(resBuf[0] != refBuf[0])
+				        {
+				        nResult = KResultFailedNotIdentical;
+				        break;
+				        }
+			        }
+		        }
+	        else
+		        {
+		        nResult = KResultFailedNotIdentical;
+		        } // if(resSize==refSize)
+            referenceFile.Close();
+            srcFile.Close();
+			}
+		else
+			{
+			nResult = KResultFailedNoReference;
+			}
+		srcFile.Close();
+		}
+	else
+		{
+		nResult = KResultFailedNoResult;
+		}
+	return nResult;
+    }
+    
+TInt CWSTester::_X_CheckResultFL(CStifItemParser& aItem)
+{
+    TPtrC asrcFile;
+    TPtrC arefFile;
+    iLog->Log(_L("******* _X_CheckResultF-> Started! ********"));
+    if (iErrorsOccured==TRUE) {
+        iLog->Log(_L("### iErrorsOccured==TRUE###"));
+        return KErrGeneral;
+    }
+    aItem.GetNextString ( asrcFile );
+    aItem.GetNextString ( arefFile );
+    TBool answer;
+   
+    iFsSession.IsFileOpen(asrcFile, answer);
+    if (answer == TRUE){
+        iWriter.Close();
+        //iResultFile.Flush();
+        //iResultFile.Close();
+    }
+    RFile srcFile;
+    RFile referenceFile;
+
+    TFileName srcFileName;
+    srcFileName.Copy(asrcFile);
+
+    TFileName referenceFileName;
+    referenceFileName.Copy(arefFile);
+
+    TInt nResult = KResultOK;
+
+//    TDes8& refBuf;
+    //TDes8& resBuf;
+
+    if(srcFile.Open(iFsSession, srcFileName, EFileStreamText|EFileRead) == KErrNone)
+        {
+         // Does reference file exist.
+         if(referenceFile.Open(iFsSession, referenceFileName, EFileStreamText|EFileRead) == KErrNone)
+             {
+             TInt resSize;
+             TInt refSize;
+             srcFile.Size(resSize);
+             referenceFile.Size(refSize);
+             
+             HBufC8* hresBuf = HBufC8::NewL( resSize ); // create new dynamic buffer (can be reallocated with ReAlloc() )
+             CleanupStack::PushL(hresBuf);             
+             TDes8 resBuf = hresBuf->Des();
+                         
+             HBufC8* hrefBuf = HBufC8::NewL( refSize ); // create new dynamic buffer (can be reallocated with ReAlloc() )
+             CleanupStack::PushL(hrefBuf);
+             TDes8 refBuf = hrefBuf->Des();
+
+             srcFile.Read(resBuf);
+             referenceFile.Read(refBuf);
+             
+             nResult = resBuf.MatchF(refBuf);
+             
+             }
+         else
+             {
+             nResult = KResultFailedNoReference;             
+             }
+        }
+    if(nResult < 0)
+        {
+            nResult = KResultFailedNoResult;
+        }
+    CleanupStack::PopAndDestroy(2); 
+    referenceFile.Close();
+    srcFile.Close();
+    
+   	return nResult;
+}
+TInt CWSTester::TestFacets()
+    {
+	 _LIT8(KFacet1, "urn:liberty:id-sis-pp");
+	 _LIT8(KFacet2, "urn:liberty:id-sis-pp:cn");
+	 _LIT8(KFacet3, "urn:liberty:id-sis-pp:can");
+	 _LIT8(KFacet4, "urn:liberty:id-sis-pp:can:cn");
+ 	 _LIT8(KFacet5, "urn:should:not:exists");
+
+
+	TInt retValue = KErrNone;
+	TBool hasFacet = TRUE;
+	retValue = iSenServiceConnection->HasFacetL(KFacet1, hasFacet);
+	if (retValue != KErrNone || hasFacet == FALSE )
+		{
+		return KErrNotFound;
+		}
+	retValue = iSenServiceConnection->HasFacetL(KFacet2, hasFacet);
+	if (retValue != KErrNone || hasFacet == FALSE )
+		{
+		return KErrNotFound;
+		}
+	retValue = iSenServiceConnection->HasFacetL(KFacet3, hasFacet);
+	if (retValue != KErrNone || hasFacet == FALSE )
+		{
+		return KErrNotFound;
+		}
+	retValue = iSenServiceConnection->HasFacetL(KFacet4, hasFacet);
+	if (retValue != KErrNone || hasFacet == FALSE )
+		{
+		return KErrNotFound;
+		}
+	retValue = iSenServiceConnection->HasFacetL(KFacet5, hasFacet);
+	if (retValue != KErrNone || hasFacet == TRUE )
+		{
+		return KErrNotFound;
+		}
+	return KErrNone;
+}
+
+void CWSTester::LogResultL(const TDesC8& aDesc8){
+    /*HBufC8* writeBuf=HBufC8::New(aDesc8.Length()+2);
+    CleanupStack::PushL(writeBuf);
+	TPtr8 ptr = writeBuf->Des();
+	ptr.Copy(aDesc8);
+    ptr.Append(_L8("\r\n"));
+	User::LeaveIfError(iResultFile.Write(ptr));
+	User::LeaveIfError(iResultFile.Flush());
+    CleanupStack::PopAndDestroy(1);*/
+#ifndef _PERFORMANCE
+    iWriter.WriteL(aDesc8);
+	iWriter.WriteL(_L8("\r\n"));
+	iWriter.CommitL();
+#endif
+}
+void CWSTester::LogResultL(const TDesC16& aDesc16)
+	{
+#ifndef _PERFORMANCE
+	iWriter.WriteL(aDesc16);
+	iWriter.WriteL(_L16("\r\n"));
+	iWriter.CommitL();
+#endif
+	//writer.Close();
+
+
+    /*HBufC8* writeBuf=HBufC8::New(aDesc16.Length()+2);//13,10 new Line
+    CleanupStack::PushL(writeBuf);
+	TPtr8 ptr = writeBuf->Des();
+
+	//ptr.Copy(aDesc16);
+    ptr.Append(_L8("\r\n"));
+
+	//User::LeaveIfError(iResultFile.Seek(ESeekEnd, pos));
+	User::LeaveIfError(iResultFile.Write(ptr));//(pos, ptr));
+	User::LeaveIfError(iResultFile.Flush());
+    CleanupStack::PopAndDestroy(1);*/
+	}
+
+
+
+void CWSTester::PopAndDestroyArgc(){
+    CleanupStack::PopAndDestroy(iArgc);
+    iArgc = 0;
+}
+TPtrC8 CWSTester::GetParC(CStifItemParser& aItem){
+    TPtrC string;
+    TBool flag = FALSE;
+    TBool secure = FALSE;
+    TInt offset = 0;
+    if (!(aItem.GetNextString ( string ))){
+        if (string.Compare(_L16("http:")) == 0){
+            flag = TRUE;
+            offset = 7;
+        }else if (string.Compare(_L16("https:")) == 0){
+            flag = TRUE;
+            secure = TRUE;
+            offset = 8;
+        }else if(string.Compare(_L16("NULL")) == 0){
+	        //HBufC8* writeBuf=HBufC8::New(0);
+	        //TPtr8 ptr = writeBuf->Des();
+	        //ptr.Copy(KNullDesC8);
+	        //return ptr;
+            //return KNullDesC8;
+            return TPtrC8(KNullDesC8);
+        }
+        iArgc++;
+        if (flag){
+            aItem.GetNextString ( string );
+        }
+        HBufC8* writeBuf=HBufC8::New(string.Length() + offset);
+        CleanupStack::PushL(writeBuf);
+	    TPtr8 ptr = writeBuf->Des();
+        if (flag){
+            if (secure){
+	            ptr.Copy(KFixedHTTPSPrefix);
+            }else{
+                ptr.Copy(KFixedHTTPPrefix);
+            }
+            ptr.Append(string);
+        }else{
+            ptr.Copy(string);
+        }
+        iLog->Log(ptr);
+        return ptr;
+    }else{
+        //HBufC8* writeBuf=HBufC8::New(0);
+        //TPtr8 ptr = writeBuf->Des();
+        //ptr.Copy(KNullDesC8);
+        //return ptr;
+        //return KNullDesC8;
+        return TPtrC8(KNullDesC8);
+    }
+}
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for xml_extensions_api test source  
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+../senxmlTester/group/senxmlTester.mmp
+
+
+
+
+// End of file
Binary file websrv_pub/xml_extensions_api/tsrc/senxml/bwins/senxmlbctestu.def has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/eabi/SenXmlBCTestu.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,10 @@
+EXPORTS
+	_Z9LibEntryLv @ 1 NONAME
+	_Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+	_ZTI15CTestXmlElement @ 3 NONAME ; #<TI>#
+	_ZTI16CTestBaseElement @ 4 NONAME ; #<TI>#
+	_ZTI17CTestBaseFragment @ 5 NONAME ; #<TI>#
+	_ZTV15CTestXmlElement @ 6 NONAME ; #<VT>#
+	_ZTV16CTestBaseElement @ 7 NONAME ; #<VT>#
+	_ZTV17CTestBaseFragment @ 8 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/group/SenXmlBCTest_UID_.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x1000008d,0x101fb3e7,EPriorityForeground,0x000ffffeu,0x00000000u,0x101fb3e7,0x00000000,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senxml
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+
+../group/wf_constraint_elem.xml  /epoc32/winscw/c/wf_constraint_elem.xml
+
+../sis/testsx_c.bat		/epoc32/winscw/c/TestSX_c.bat
+../sis/testsx_z.bat		/epoc32/winscw/c/TestSX_z.bat
+../sis/testframework.ini		/epoc32/winscw/c/testframework/testframework_senxml.ini
+
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+// NOTE: If using ARS requirements .mmp file operation should be done under this.
+// 'abld test build'
+senxml.mmp
+
+PRJ_MMPFILES
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/group/senxml.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senxml
+*
+*/
+
+
+
+
+
+
+
+
+#if defined(__SERIES60_) && defined(EKA2)
+
+    #ifndef __SERIES60_30__
+        // To get the OS_LAYER_SYSTEMINCLUDE-definition
+        #include <platform_paths.hrh>
+    #endif
+
+#endif
+
+TARGET         SenXmlBCTest.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E7
+
+#if defined(EKA2)
+CAPABILITY      ALL -TCB
+VENDORID VID_DEFAULT
+// SECUREID     0x00000000
+#endif
+
+//TARGETPATH      ?target_path
+DEFFILE         SenXmlBCTest.def
+
+SOURCEPATH      ../src
+SOURCE          SenXml.cpp
+SOURCE          SenXmlCases.cpp
+SOURCE					testxml.cpp
+
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+USERINCLUDE     ../inc
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/libc
+
+#if defined(__SERIES60_) && defined(EKA2)
+
+    #ifndef __SERIES60_30__
+        OS_LAYER_SYSTEMINCLUDE
+    #endif
+
+
+#endif
+
+LIBRARY         bafl.lib
+LIBRARY         charconv.lib
+LIBRARY         euser.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         euser.lib
+LIBRARY         SenXml.lib
+LIBRARY         XMLFRAMEWORK.lib
+
+LANG            SC
+
+
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+LIBRARY                 XMLFRAMEWORK.lib
+
+LANG            SC
+
+// AIF ?filename// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/group/senxml.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,34 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"WebServices Utils"},(0x101FB3E7),3,0,0,TYPE=SA
+(0x101F7 1),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\Epoc32\Release\armv5\urel\SenXmlBCTest.dll"-"!:\sys\bin\SenXmlBCTest.dll"
+;"\Epoc32\winscw\c\testSU_c.bat"-"!:\testSU.bat"
+"..\init\SenXmlBCTest.ini"-"!:\testframework\SenXmlBCTest.ini"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/group/wf_constraint_elem.xml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+
+<!-- Testcase: wf_constraint_elem.xml -->
+
+<!-- Description: To test well-formed constraints in XML. This tests 'element type match', a well-formed constraint of 'element' -->
+
+<!-- Author:  Christine Dreckman  Date: 10/28/99 -->
+
+<!-- 
+   - The contents of this file are subject to the Mozilla Public
+   - License Version 1.1 (the "License"); you may not use this file
+   - except in compliance with the License. You may obtain a copy of
+   - the License at http://www.mozilla.org/MPL/
+   - 
+   - Software distributed under the License is distributed on an "AS
+   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+   - implied. See the License for the specific language governing
+   - rights and limitations under the License.
+   - 
+   - The Original Code is Mozilla Communicator Test Cases.
+   - 
+   - The Initial Developer of the Original Code is Netscape Communications
+   - Corp.  Portions created by Netscape Communications Corp. are 
+   - Copyright (C) 1999 Netscape Communications Corp.  All
+   - Rights Reserved.
+   - 
+   - Contributor(s): 
+  -->
+<!-- Purpose: To test 'element type match', a well-formed constraint of 'element'. Per spec, the Name in an element's end-tag must match the element type in the start-tag  -->
+
+<!-- Expected result: This document is well-formed. The text should display -->
+
+<doc>
+
+<match>This document is well-formed. If text displays, there is no bug.
+
+</match>
+
+</doc>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/inc/senxmlbctest.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,733 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenXml test module.
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef __SENXML_H__
+#define __SENXML_H__
+
+//  EXTERNAL INCLUDES
+#include "StifTestModule.h"
+#include <StifLogger.h>
+
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+#include <SenElement.h>
+#include <SenNamespace.h>
+#include <SenXmlElement.h>
+#include <SenXmlReader.h>
+#include <SenXmlUtils.h>
+#include <f32file.h>
+#include <e32debug.h>
+#include <e32std.h>
+#include <e32def.h>
+
+
+
+//  FORWARD DECLARATIONS
+
+class CSenBaseAttribute;
+class CSenElement;
+class CSenBaseFragment;
+class CSenNamespace;
+class SenXmlUtils;
+class CSenDomFragment;
+class CSenBaseElement;
+class CSenXmlReader;
+class CSenXmlElement;
+
+//#include <e32def.h>
+//#ifndef NONSHARABLE_CLASS
+//    #define NONSHARABLE_CLASS(x) class x
+//#endif
+
+// Logging path
+_LIT( KSenXmlLogPath, "\\logs\\testframework\\SenXmlBCTest\\" ); 
+// Log file
+_LIT( KSenXmlLogFile, "SenXmlBCTest.txt" );
+
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling 
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif  
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenXmlBCTest;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type 
+// TInt CSenXmlBCTest::<NameOfFunction> ( TTestResult& aResult )
+typedef TInt (CSenXmlBCTest::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  An internal structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+
+// CLASS DECLARATION
+
+/**
+*  This a NewSoapClasses class.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenXmlBCTest) : public CTestModuleBase
+    {
+    public:  // Constructors and destructor
+
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenXmlBCTest* NewL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenXmlBCTest();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CTestModuleBase InitL is used to initialize the 
+        *       NewSoapClasses. It is called once for every instance of 
+        *       TestModuleNewSoapClasses after its creation.
+        * @since ?Series60_version
+        * @param aIniFile Initialization file for the test module (optional)
+        * @param aFirstTime Flag is true when InitL is executed for first 
+        *               created instance of NewSoapClasses.
+        * @return Symbian OS error code
+        */
+        TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+        /**
+        * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
+        *   from NewSoapClasses. 
+        * @since ?Series60_version
+        * @param aTestCaseFile Test case file (optional)
+        * @param aTestCases  Array of TestCases returned to test framework
+        * @return Symbian OS error code
+        */
+        TInt GetTestCasesL( const TFileName& aTestCaseFile, 
+                            RPointerArray<TTestCaseInfo>& aTestCases );
+
+        /**
+        * From CTestModuleBase RunTestCaseL is used to run an individual 
+        *   test case. 
+        * @since ?Series60_version
+        * @param aCaseNumber Test case number
+        * @param aTestCaseFile Test case file (optional)
+        * @param aResult Test case result returned to test framework (PASS/FAIL)
+        * @return Symbian OS error code (test case execution error, which is 
+        *           not reported in aResult parameter as test case failure).
+        */   
+        TInt RunTestCaseL( const TInt aCaseNumber, 
+                           const TFileName& aTestCaseFile,
+                           TTestResult& aResult );
+
+        /**
+        * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+        * test case going to be executed using OOM conditions
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailureType OOM failure type (optional)
+        * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+        * @param aLastMemFailure The last heap memory allocation failure value (optional)
+        * @return TBool
+        */
+        virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
+                                     const TInt /* aCaseNumber */, 
+                                     TOOMFailureType& aFailureType, 
+                                     TInt& /* aFirstMemFailure */, 
+                                     TInt& /* aLastMemFailure */ );
+
+        /**
+        * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        */
+        virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
+                                    const TInt /* aCaseNumber */ ); 
+
+        /**
+        * From CTestModuleBase; OOMHandleWarningL
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @param aFailNextValue FailNextValue for OOM test execution (optional)
+        * @return None
+        *
+        * User may add implementation for OOM test warning handling. Usually no
+        * implementation is required.           
+        */
+        virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+                                        const TInt /* aCaseNumber */, 
+                                        TInt& /* aFailNextValue */); 
+
+        /**
+        * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+        * test environment
+        * @param aTestCaseFile Test case file (optional)
+        * @param aCaseNumber Test case number (optional)
+        * @return None
+        *
+        */
+        virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
+                                       const TInt /* aCaseNumber */ );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenXmlBCTest();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Function returning test case name and pointer to test case function.
+        * @since ?Series60_version
+        * @param aCaseNumber test case number
+        * @return TCaseInfo 
+        */
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+        void SetupL();
+        void Teardown();
+
+
+        /**
+        * Actual Hardcoded test case functions are listed below.
+        */         TInt CSenBaseAttribute_NewLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseAttribute_NewL_1L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_NewLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_NewL_1L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_NewL_2L( TTestResult& aResult );
+         
+         
+         TInt CSenBaseElement_NewL_3L( TTestResult& aResult );
+         
+         
+         TInt CSenBaseElement_NewL_4L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_SetAttributesLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_LocalNameL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_NamespaceURIL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_NsPrefixL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_SetPrefixLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_HasContentTL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_HasContentFL( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_ContentL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_Content_NullL( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_ContentUnicodeLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_SetContentLL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_SetContentL_NullL( TTestResult& aResult );        
+         
+         TInt CSenBaseElement_SetContentL_OverRightL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_SetContentL_WithEscCharsL( TTestResult& aResult );
+        
+         TInt CSenBaseElement_ConsistsOfLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_SetNamespaceLL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_SetNamespaceL_NullL( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_SetNamespaceL_1L( TTestResult& aResult );
+        
+         TInt CSenBaseElement_SetNamespaceL_2same1L( TTestResult& aResult );
+         
+         TInt CSenBaseElement_SetNamespaceL_2Diff1L( TTestResult& aResult );
+       
+         TInt CSenBaseElement_SetNamespaceL_DPSU1L( TTestResult& aResult );
+        
+         TInt CSenBaseElement_SetNamespaceL_SNsPC1L( TTestResult& aResult );
+        
+         TInt CSenBaseElement_AddNamespaceL_FL( TTestResult& aResult );        
+         
+         TInt CSenBaseElement_AddNamespaceL_TL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_AddNamespaceL_TSPL( TTestResult& aResult ); 
+         
+         TInt CSenBaseElement_AddNamespaceL_TDPL( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_AddNamespaceL_1L( TTestResult& aResult );
+         
+         TInt CSenBaseElement_AddNamespaceL_2same1L( TTestResult& aResult );
+         
+         TInt CSenBaseElement_AddNamespaceL_2Diff1L( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_NamespaceL( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_Namespace_1L( TTestResult& aResult );
+         
+         TInt CSenBaseElement_Namespace_WP1L( TTestResult& aResult );        
+        
+         TInt CSenBaseElement_Namespace_2L( TTestResult& aResult );
+        
+		 	        
+        
+         TInt CSenBaseElement_Namespace_3L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_ElementsLL( TTestResult& aResult );
+        
+        
+         
+        
+         TInt CSenBaseElement_AttributesLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_NamespacesLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AttrValueL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AddAttrLL( TTestResult& aResult );
+         TInt CSenBaseElement_AddAttributeLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_ParentL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_SetParentL( TTestResult& aResult );
+        
+         TInt CSenBaseElement_RootL( TTestResult& aResult );
+        
+         TInt CSenBaseElement_ElementL( TTestResult& aResult );
+		TInt CSenBaseElement_ElementsL1( TTestResult& aResult );
+         TInt CSenBaseElement_ElementsL2( TTestResult& aResult );
+         
+         TInt CSenBaseElement_CreateElementLL( TTestResult& aResult );
+     
+         TInt CSenBaseElement_InsertElementLL( TTestResult& aResult );
+         
+		 TInt CSenBaseElement_InsertElementL_NoBeforeL( TTestResult& aResult );                 
+        
+         TInt CSenBaseElement_AddElementLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AddElementL_1L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AddElementL_2L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AddElementL_3L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_RemoveElementL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_RemoveElement_1L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_RemoveElement_2L( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_ReplaceElementLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AsXmlLL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_AsXmlUnicodeLL( TTestResult& aResult );
+        
+         TInt CSenBaseElement_CopyFromLL( TTestResult& aResult );
+        
+         TInt CSenBaseElement_DetachLL( TTestResult& aResult );
+        
+         TInt CSenBaseElement_ChildL( TTestResult& aResult );
+        
+        
+         TInt CSenBaseElement_SetL( TTestResult& aResult );
+         
+         
+         TInt CSenBaseElement_AddAttributesLL( TTestResult& aResult );
+         
+         TInt CSenBaseElement_AsElementL( TTestResult& aResult );
+         TInt CSenBaseElement_ContentWriteStreamLL( TTestResult& aResult );
+		 TInt CSenBaseElement_RemoveAttributeLL( TTestResult& aResult );
+         TInt CSenXmlElement_NewLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_NewL_1L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_NewL_2L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_SetAttributesLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_LocalNameL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_NamespaceURIL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_NsPrefixL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_SetPrefixLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_HasContentL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_ContentL( TTestResult& aResult );
+         
+         TInt CSenXmlElement_ContentWriteStreamLL( TTestResult& aResult );
+         
+        
+         TInt CSenXmlElement_ContentUnicodeLL( TTestResult& aResult );
+                
+         TInt CSenXmlElement_SetContentLL( TTestResult& aResult );        
+        
+         TInt CSenXmlElement_ConsistsOfLL( TTestResult& aResult );
+         
+         TInt CSenXmlElement_ConsistsOfL1L( TTestResult& aResult );
+         
+         TInt CSenXmlElement_ConsistsOfL2L( TTestResult& aResult );        
+        
+         TInt CSenXmlElement_SetNamespaceLL( TTestResult& aResult );
+         
+         TInt CSenXmlElement_SetNamespaceL_1L( TTestResult& aResult );
+         
+         TInt CSenXmlElement_SetNamespaceL_2same1L( TTestResult& aResult );
+         
+         TInt CSenXmlElement_SetNamespaceL_2Diff1L( TTestResult& aResult ) ;      
+        
+         TInt CSenXmlElement_AddNamespaceLL( TTestResult& aResult );
+         
+         TInt CSenXmlElement_AddNamespaceLFL( TTestResult& aResult );
+        
+         TInt CSenXmlElement_AddNamespaceL_1L( TTestResult& aResult );
+      
+        
+         TInt CSenXmlElement_NamespaceL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_Namespace_1L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_Namespace_2L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_Namespace_3L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_ElementsLL( TTestResult& aResult );
+                
+         TInt CSenXmlElement_AttributesLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_NamespacesLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AttrValueL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AddAttrLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_ParentL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_SetParentL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_RootL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_ElementL( TTestResult& aResult );
+        
+         TInt CSenXmlElement_CreateElementLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_InsertElementLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AddElementLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AddElementL_1L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AddElementL_2L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AddElementL_3L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_RemoveElementL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_RemoveElement_1L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_RemoveElement_2L( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_ReplaceElementLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AsXmlLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AsXmlUnicodeLL( TTestResult& aResult );
+        
+         TInt CSenXmlElement_CopyFromLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_DetachLL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_ChildL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_SetL( TTestResult& aResult );
+        
+        
+         TInt CSenXmlElement_AddAttributesLL( TTestResult& aResult );
+         TInt CSenXmlElement_AddAttributeLL( TTestResult& aResult );
+         TInt CSenXmlElement_RemoveAttributeLL( TTestResult& aResult );
+         TInt CSenXmlElement_AsElementL( TTestResult& aResult );
+         TInt CSenBaseFragment_AsXmlUnicodeLL( TTestResult& aResult );
+         
+         TInt CSenBaseFragment_NewL_L( TTestResult& aResult );
+         TInt CSenBaseFragment_NewL_1L( TTestResult& aResult );
+         TInt CSenBaseFragment_NewL_2L( TTestResult& aResult );
+         TInt CSenBaseFragment_NewL_3L( TTestResult& aResult );
+         TInt CSenBaseFragment_NewL_4L( TTestResult& aResult );
+         TInt CSenBaseFragment_NewL_5L( TTestResult& aResult );
+         TInt CSenBaseFragment_WriteAsXMLToLL( TTestResult& aResult );
+         TInt CSenBaseFragment_ContentL( TTestResult& aResult );
+         TInt CSenBaseFragment_NamespaceL( TTestResult& aResult );
+         TInt CSenBaseFragment_EnsureNamespaceL( TTestResult& aResult );
+         TInt CSenBaseFragment_DetachLL( TTestResult& aResult );
+         TInt CSenBaseFragment_SaveNamespacesLL( TTestResult& aResult );
+         TInt CSenBaseFragment_ResetContentLL( TTestResult& aResult );
+         TInt CSenBaseFragment_LocalNameL( TTestResult& aResult );
+         TInt CSenBaseFragment_NsUriL( TTestResult& aResult );
+         TInt CSenBaseFragment_NsPrefixL( TTestResult& aResult );
+         TInt CSenBaseFragment_ExtractElementL( TTestResult& aResult );
+         TInt CSenBaseFragment_SetAttributesLL( TTestResult& aResult );
+         TInt CSenBaseFragment_ConsistsOfLL( TTestResult& aResult );
+         TInt CSenBaseFragment_AllocContentSaverLL( TTestResult& aResult );
+         TInt CSenBaseFragment_ParseLL( TTestResult& aResult );
+         TInt CSenBaseFragment_ParseL1L( TTestResult& aResult );
+         TInt CSenBaseFragment_SetContentOfLL( TTestResult& aResult );
+         TInt CSenBaseFragment_ContentOfL( TTestResult& aResult );
+         TInt CSenXMLReader_ParserFeatureL( TTestResult& aResult );
+		 TInt CSenXMLReader_ParseLL( TTestResult& aResult );
+         TInt CSenDomFragment_ConsistsOfLL( TTestResult& aResult );
+         
+         TInt CSenDomFragment_NewL_L( TTestResult& aResult );
+         TInt CSenDomFragment_NewL_1L( TTestResult& aResult );
+         TInt CSenDomFragment_NewL_2L( TTestResult& aResult );
+         TInt CSenDomFragment_NewL_3L( TTestResult& aResult );
+         TInt CSenDomFragment_NewL_4L( TTestResult& aResult );
+         TInt CSenDomFragment_NewL_5L( TTestResult& aResult );
+         TInt CSenDomFragment_NewL_6L( TTestResult& aResult );
+         
+         //TInt CSenDomFragment_ExpandLL( TTestResult& aResult );
+         //TInt CSenDomFragment_ResumeParsingFromLL( TTestResult& aResult );
+         TInt CSenDomFragment_ParseWithLL( TTestResult& aResult );
+         TInt CSenDomFragment_SetAttributesLL( TTestResult& aResult );
+         TInt CSenDomFragment_ParseL1L( TTestResult& aResult );
+         
+         TInt CSenNamespace_NewL_L( TTestResult& aResult );
+         TInt CSenNamespace_NewLC_L( TTestResult& aResult );
+         TInt CSenNamespace_NewL_1L( TTestResult& aResult );
+         TInt CSenNamespace_NewLC_1L( TTestResult& aResult );
+         TInt CSenNamespace_MatchesL_L( TTestResult& aResult );
+         TInt CSenNamespace_InsertLL( TTestResult& aResult );
+         TInt CSenXmlReader_NewL_L( TTestResult& aResult );
+         TInt CSenXmlReader_NewLC_L( TTestResult& aResult );
+         TInt CSenXmlReader_NewL_1L( TTestResult& aResult );
+         TInt CSenXmlReader_NewLC_1L( TTestResult& aResult );
+         TInt CSenXmlReader_NewL_2L( TTestResult& aResult );
+         TInt CSenXmlReader_NewLC_2L( TTestResult& aResult );
+         TInt CSenXmlReader_NewL_3L( TTestResult& aResult );
+         TInt CSenXmlReader_NewLC_3L( TTestResult& aResult );
+
+         TInt CSenXmlReader_EnabledParserFeature_L( TTestResult& aResult );        
+         
+         TInt CSenXmlUtils_ToUtf8LCL( TTestResult& aResult );        
+         TInt CSenXmlUtils_StartsWithL( TTestResult& aResult );        
+         TInt CSenXmlUtils_EndsWithL( TTestResult& aResult );        
+         TInt CSenXmlUtils_AttrValueL( TTestResult& aResult );        
+         TInt CSenXmlUtils_AllocAttrValueLL( TTestResult& aResult );        
+         TInt CSenXmlUtils_DecodeHttpCharactersLL( TTestResult& aResult );        
+         TInt CSenXmlUtils_DecodeHttpCharactersLCL( TTestResult& aResult );        
+         TInt CSenXmlUtils_NsPrefixL( TTestResult& aResult );        
+         TInt CSenXmlUtils_LocalNameL( TTestResult& aResult );        
+         TInt CSenXmlUtils_RemoveAttributeLL( TTestResult& aResult );        
+         TInt CSenXmlUtils_RemoveAttributeL1L( TTestResult& aResult );        
+         TInt CSenXmlUtils_AddAttributeLL( TTestResult& aResult );        
+         TInt CSenXmlUtils_AddAttributeL1L( TTestResult& aResult );        
+         TInt CSenXmlUtils_AddAttributeL2L( TTestResult& aResult );        
+         TInt CSenXmlUtils_EncodeHttpCharactersLCL( TTestResult& aResult ); 
+         TInt CSenDomFragment_BaseConstructL( TTestResult& aResult );
+         TInt CSenBaseFragment_BaseConstructL( TTestResult& aResult );
+
+
+
+     public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // NewSoapClasses_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/inc/testxml.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef TESTXML_H
+#define TESTXML_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenBaseFragment.h"
+#include "SenDomFragment.h"
+#include "SenBaseElement.h"
+#include "SenXmlElement.h"
+
+
+class CTestBaseFragment:public CSenBaseFragment
+{
+public:    
+    static CTestBaseFragment* NewL(const TDesC8& aLocalName);
+    ~CTestBaseFragment();
+    
+	MSenElement& SetContentOfL(const TDesC8& aLocalName,const TDesC8& aContent);
+	TPtrC8 ContentOf(const TDesC8& aLocalName);        
+   void BaseConstructL(CSenXmlReader& aReader);
+
+private:
+
+    CTestBaseFragment();
+    
+};
+
+class CTestDomFragment:public CSenDomFragment
+{
+public:    
+   static CTestDomFragment* NewL(const TDesC8& aLocalName);
+   void BaseConstructL(CSenXmlReader& aReader);
+    ~CTestDomFragment();
+    	
+
+private:
+
+    CTestDomFragment();
+    
+};
+
+class CTestBaseElement:public CSenBaseElement
+{
+public:    
+   static CTestBaseElement* NewL(const TDesC8& aLocalName);
+   const TDesC8& AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue);
+    ~CTestBaseElement();
+    	
+
+private:
+
+    CTestBaseElement();
+    
+};
+
+class CTestXmlElement:public CSenXmlElement
+{
+public:    
+   static CTestXmlElement* NewL(const TDesC8& aLocalName);
+   const TDesC8& AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue);
+    ~CTestXmlElement();
+    	
+
+private:
+
+    CTestXmlElement();
+    
+};
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/init/SenXmlBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenXmlBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/rom/senxml.iby	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        
+*
+*/
+
+
+
+
+
+
+
+
+#ifndef SENXML_IBY__
+#define SENXML_IBY__
+
+file=ABI_DIR\BUILD_DIR\SenXmlBCTest.dll        PROGRAMS_DIR\SenXmlBCTest.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/sis/SenXmlBCTest.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenXmlBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
Binary file websrv_pub/xml_extensions_api/tsrc/senxml/sis/senxml.pkg has changed
Binary file websrv_pub/xml_extensions_api/tsrc/senxml/sis/senxml.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/sis/testframework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= SenXmlBCTest
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/sis/testsx_c.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,23 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy C:\TestFramework\TestFramework_SenXml.ini C:\TestFramework\TestFramework.ini
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule SenXmlBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenXml.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/sis/testsx_z.bat	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:      
+rem
+
+copy Z:\TestFramework\TestFramework_SenXml.ini C:\TestFramework\TestFramework.ini
+
+md e:\BCTest
+md e:\BCTest\results
+
+ATSINTERFACE.EXE -testmodule SenXmlBCTest
+
+copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenXml.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/src/senxml.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        SenXml class member functions
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "SenXmlBCTest.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::CSenXmlBCTest
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenXmlBCTest::CSenXmlBCTest()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
+// allocates memory from heap and therefore causes error situations with OOM 
+// testing. For more information about STIF Logger construction, see STIF Users 
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void CSenXmlBCTest::ConstructL()
+    {
+    iLog = CStifLogger::NewL( KSenXmlLogPath, 
+                          KSenXmlLogFile);
+
+    // Sample how to use logging
+    _LIT( KLogStart, "CSenXmlBCTest logging starts!" );
+    iLog->Log( KLogStart );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenXmlBCTest* CSenXmlBCTest::NewL()
+    {
+    CSenXmlBCTest* self = new (ELeave) CSenXmlBCTest;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenXmlBCTest::~CSenXmlBCTest()
+    {
+    delete iLog;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt CSenXmlBCTest::InitL( 
+    TFileName& /*aIniFile*/, 
+    TBool /*aFirstTime*/ )
+    {
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be 
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation. 
+// -----------------------------------------------------------------------------
+//
+TInt CSenXmlBCTest::GetTestCasesL( 
+    const TFileName& /*aConfig*/, 
+    RPointerArray<TTestCaseInfo>& aTestCases )
+    {
+
+    // Loop through all test cases and create new
+    // TTestCaseInfo items and append items to aTestCase array    
+    for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+        {
+
+        // Allocate new TTestCaseInfo from heap for a testcase definition.
+        TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+        // PushL TTestCaseInfo to CleanupStack.    
+        CleanupStack::PushL( newCase );
+
+        // Set number for the testcase.
+        // When the testcase is run, this comes as a parameter to RunTestCaseL.
+        newCase->iCaseNumber = i;
+
+        // Set title for the test case. This is shown in UI to user.
+        newCase->iTitle.Copy( Case(i).iCaseName );
+
+        // Append TTestCaseInfo to the testcase array. After appended 
+        // successfully the TTestCaseInfo object is owned (and freed) 
+        // by the TestServer. 
+        User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+        // Pop TTestCaseInfo from the CleanupStack.
+        CleanupStack::Pop( newCase );
+
+        }
+
+    return KErrNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified 
+// by aTestCase. Test cases that can be run may be requested from 
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt CSenXmlBCTest::RunTestCaseL( 
+    const TInt aCaseNumber,   
+    const TFileName& /*aConfig*/,
+    TTestResult& aResult )
+    {
+
+    // Return value
+    TInt execStatus = KErrNone;
+
+    // Get the pointer to test case function
+    TCaseInfo tmp = Case ( aCaseNumber );
+
+    _LIT( KLogStartTC, "Starting testcase [%S]" );
+    iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+    // Check that case number was valid
+    if ( tmp.iMethod != NULL )
+        {
+        // Valid case was found, call it via function pointer
+        iMethod = tmp.iMethod;        
+        execStatus  = ( this->*iMethod )( aResult );
+        }
+    else
+        {
+        // Valid case was not found, return error.
+        execStatus = KErrNotFound;
+        }
+
+    // Return case execution status (not the result of the case execution)
+    return execStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and 
+// which memory allocations should fail.    
+// -----------------------------------------------------------------------------
+//
+TBool CSenXmlBCTest::OOMTestQueryL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt aCaseNumber, 
+                                TOOMFailureType& /* aFailureType */, 
+                                TInt& aFirstMemFailure, 
+                                TInt& aLastMemFailure ) 
+    {
+    _LIT( KLogOOMTestQueryL, "CSenXmlBCTest::OOMTestQueryL" );
+    iLog->Log( KLogOOMTestQueryL );     
+
+    aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+    aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+    return Case( aCaseNumber ).iIsOOMTest;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case. 
+// Test Modules may use the initialization file to read parameters for Test 
+// Module initialization but they can also have their own configure file or 
+// some other routine to initialize themselves.  
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenXmlBCTest::OOMTestInitializeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even 
+// inside the tested components which are implemented this way on purpose (by 
+// design), so it is important to give the tester a way to bypass allocation 
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenXmlBCTest::OOMHandleWarningL( 
+                                const TFileName& /* aTestCaseFile */,
+                                const TInt /* aCaseNumber */, 
+                                TInt& /* aFailNextValue */ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenXmlBCTest::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void CSenXmlBCTest::OOMTestFinalizeL( 
+                                const TFileName& /* aTestCaseFile */, 
+                                const TInt /* aCaseNumber */ )
+    {
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+    {
+    return CSenXmlBCTest::NewL();
+
+    }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
+                                TUint32& /*aParameterValid*/ )
+    {
+
+    /* --------------------------------- NOTE ---------------------------------
+    USER PANICS occurs in test thread creation when:
+    1) "The panic occurs when the value of the stack size is negative."
+    2) "The panic occurs if the minimum heap size specified is less
+       than KMinHeapSize".
+       KMinHeapSize: "Functions that require a new heap to be allocated will
+       either panic, or will reset the required heap size to this value if
+       a smaller heap size is specified".
+    3) "The panic occurs if the minimum heap size specified is greater than
+       the maximum size to which the heap can grow".
+    Other:
+    1) Make sure that your hardware or Symbian OS is supporting given sizes.
+       e.g. Hardware might support only sizes that are divisible by four.
+    ------------------------------- NOTE end ------------------------------- */
+
+    // Normally STIF uses default heap and stack sizes for test thread, see:
+    // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+    // If needed heap and stack sizes can be configured here by user. Remove
+    // comments and define sizes.
+
+/*
+    aParameterValid = KStifTestModuleParameterChanged;
+
+    CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+    // Stack size
+    param->iTestThreadStackSize= 16384; // 16K stack
+    // Heap sizes
+    param->iTestThreadMinHeap = 4096;   // 4K heap min
+    param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+    aTestModuleParam = param;
+*/
+    return KErrNone;
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/src/senxmlcases.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,5480 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestModule.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include "SenXmlBCTest.h"
+#include "TestXml.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenUtilsBCTest::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases 
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+// 
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo CSenXmlBCTest::Case ( 
+    const TInt aCaseNumber ) const 
+     {
+
+    /**
+    * To add new test cases, implement new test case function and add new 
+    * line to KCases array specify the name of the case and the function 
+    * doing the test case
+    * In practice, do following
+    * 1) Make copy of existing test case function and change its name
+    *    and functionality. Note that the function must be added to 
+    *    SenUtils.cpp file and to SenUtils.h 
+    *    header file.
+    *
+    * 2) Add entry to following KCases array either by using:
+    *
+    * 2.1: FUNCENTRY or ENTRY macro
+    * ENTRY macro takes two parameters: test case name and test case 
+    * function name.
+    *
+    * FUNCENTRY macro takes only test case function name as a parameter and
+    * uses that as a test case name and test case function name.
+    *
+    * Or
+    *
+    * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+    * only with OOM (Out-Of-Memory) testing!
+    *
+    * OOM_ENTRY macro takes five parameters: test case name, test case 
+    * function name, TBool which specifies is method supposed to be run using
+    * OOM conditions, TInt value for first heap memory allocation failure and 
+    * TInt value for last heap memory allocation failure.
+    * 
+    * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+    * that as a test case name, TBool which specifies is method supposed to be
+    * run using OOM conditions, TInt value for first heap memory allocation 
+    * failure and TInt value for last heap memory allocation failure. 
+    */ 
+
+    static TCaseInfoInternal const KCases[] =
+        {
+        //  TEST TABLE
+		ENTRY("NewL - CSenBaseAttribute ", CSenXmlBCTest::CSenBaseAttribute_NewLL),
+		ENTRY("NewL - CSenBaseAttribute ", CSenXmlBCTest::CSenBaseAttribute_NewL_1L),
+		ENTRY("NewL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NewLL),
+		ENTRY("NewL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NewL_1L),
+		ENTRY("NewL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NewL_2L),
+		ENTRY("NewL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NewL_3L),
+		ENTRY("NewL - CSenBaseElement", CSenXmlBCTest::CSenBaseElement_NewL_4L),
+		ENTRY("SetAttributesL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetAttributesLL),
+		ENTRY("LocalName - CSenBaseElement ",CSenXmlBCTest::CSenBaseElement_LocalNameL),
+		ENTRY("NamespaceURI - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NamespaceURIL),
+		ENTRY("NsPrefix - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NsPrefixL),
+		ENTRY("SetPrefixL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetPrefixLL),
+		ENTRY("HasContentTrue - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_HasContentTL),
+		ENTRY("HasContentFalse - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_HasContentFL),
+
+		ENTRY("Content - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ContentL),
+    
+		ENTRY("ContentNull - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_Content_NullL),
+
+		ENTRY("ContentUnicodeL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ContentUnicodeLL),
+
+		ENTRY("SetContentL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetContentLL),
+
+		ENTRY("SetContentNullL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetContentL_NullL),
+    
+		ENTRY("SetContentoverrightL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetContentL_OverRightL),
+    
+		ENTRY("SetContentEscCharL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetContentL_WithEscCharsL),
+
+		ENTRY("ConsistsOfL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ConsistsOfLL),
+
+		ENTRY("SetNamespaceL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceLL),
+    
+		ENTRY("SetNamespaceNullL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceL_NullL),
+
+		ENTRY("SetNamespaceL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceL_1L),
+
+		ENTRY("SetNamespace2SameL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceL_2same1L),
+    
+		ENTRY("SetNamespace2DiffL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceL_2Diff1L),
+    
+		ENTRY("SetNamespaceDPSUL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceL_DPSU1L),       
+    
+		ENTRY("SetNamespaceSameNsforPC1L - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetNamespaceL_SNsPC1L),           
+
+		ENTRY("AddNamespace_FalseL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_FL),
+    
+		ENTRY("AddNamespace_TrueL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_TL),    
+    
+		ENTRY("AddNamespace_TrueSameParentNSL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_TSPL),      
+    
+		ENTRY("AddNamespace_TrueDiffParentNSL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_TDPL),          
+
+		ENTRY("AddNamespaceL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_1L),
+
+		ENTRY("AddNamespace2SameL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_2same1L),
+    
+		ENTRY("AddNamespace2DiffL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddNamespaceL_2Diff1L),
+    
+		ENTRY("Namespace - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NamespaceL),
+    
+
+		ENTRY("Namespace - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_Namespace_1L),
+    
+		ENTRY("Namespace_with parent1 - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_Namespace_WP1L),
+
+		ENTRY("Namespace - test2 - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_Namespace_2L),
+    
+		ENTRY("Namespace - test3 - CSenBaseElement", CSenXmlBCTest::CSenBaseElement_Namespace_3L),
+
+		ENTRY("ElementsL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ElementsLL),
+
+		ENTRY("AttributesL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AttributesLL),
+
+		ENTRY("NamespacesL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_NamespacesLL),
+
+		ENTRY("AttrValue - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AttrValueL),
+
+		ENTRY("AddAttrL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddAttrLL),
+
+		ENTRY("AddAttributeL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddAttributeLL),		
+		ENTRY("Parent - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ParentL),
+
+		ENTRY("SetParent - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetParentL),
+
+		ENTRY("Root - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_RootL),
+
+		ENTRY("Element - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ElementL),
+		ENTRY("Elements1 - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ElementsL1),
+		ENTRY("Elements2 - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ElementsL2),
+
+		ENTRY("CreateElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_CreateElementLL),
+
+		ENTRY("InsertElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_InsertElementLL),
+    
+		ENTRY("InsertElement_No_BeforeElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_InsertElementL_NoBeforeL),
+
+		ENTRY("AddElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddElementLL),
+
+		ENTRY("AddElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddElementL_1L),
+
+		ENTRY("AddElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddElementL_2L),
+
+		ENTRY("AddElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddElementL_3L),
+
+		ENTRY("RemoveElement - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_RemoveElementL),
+
+		ENTRY("RemoveElement - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_RemoveElement_1L),
+
+		ENTRY("RemoveElement - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_RemoveElement_2L),
+
+		ENTRY("ReplaceElementL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ReplaceElementLL),
+
+		ENTRY("AsXmlL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AsXmlLL),
+
+		ENTRY("AsXmlUnicodeL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AsXmlUnicodeLL),
+
+		ENTRY("CopyFromL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_CopyFromLL),
+
+		ENTRY("DetachL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_DetachLL),
+
+		ENTRY("Child - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ChildL),
+
+		ENTRY("Set - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_SetL),
+    
+		ENTRY("AddAttributesL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AddAttributesLL),
+
+		ENTRY("AsElement - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_AsElementL),
+
+		ENTRY("ContentWriteStreamL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_ContentWriteStreamLL),
+    
+		ENTRY("RemoveAttributeL - CSenBaseElement ", CSenXmlBCTest::CSenBaseElement_RemoveAttributeLL),
+
+		ENTRY("NewL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NewLL),
+
+		ENTRY("NewL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NewL_1L),
+
+		ENTRY("NewL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NewL_2L),
+
+		ENTRY("SetAttributesL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetAttributesLL),
+
+		ENTRY("LocalName - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_LocalNameL),
+
+		ENTRY("NamespaceURI - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NamespaceURIL),
+
+		ENTRY("NsPrefix - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NsPrefixL),
+
+		ENTRY("SetPrefixL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetPrefixLL),
+
+		ENTRY("HasContent - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_HasContentL),
+
+		ENTRY("Content - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ContentL),
+		
+		ENTRY("ContentWriteStreamL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ContentWriteStreamLL),
+		
+
+		ENTRY("ContentUnicodeL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ContentUnicodeLL),
+
+		ENTRY("SetContentL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetContentLL),
+
+		ENTRY("ConsistsOfL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ConsistsOfLL),
+    
+		ENTRY("ConsistsOfL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ConsistsOfL1L),
+    
+		ENTRY("ConsistsOfL - Extratest CSenXmlElement", CSenXmlBCTest::CSenXmlElement_ConsistsOfL1L),
+
+		ENTRY("SetNamespaceL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetNamespaceLL),
+
+		ENTRY("SetNamespaceL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetNamespaceL_1L),
+    
+		ENTRY("SetNamespaceL - Sametest CSenXmlElement", CSenXmlBCTest::CSenXmlElement_SetNamespaceL_2same1L),
+
+		ENTRY("SetNamespaceL - Difftest CSenXmlElement", CSenXmlBCTest::CSenXmlElement_SetNamespaceL_2Diff1L),
+
+		ENTRY("AddNamespaceL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddNamespaceLL),
+
+		ENTRY("AddNamespaceL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddNamespaceL_1L),
+
+		ENTRY("Namespace - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NamespaceL),
+
+		ENTRY("Namespace - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_Namespace_1L),
+
+		ENTRY("Namespace - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_Namespace_2L),
+
+		ENTRY("Namespace - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_Namespace_3L),
+
+		ENTRY("ElementsL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ElementsLL),
+
+		ENTRY("AttributesL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AttributesLL),
+		ENTRY("AttributeLL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddAttributeLL),
+
+		ENTRY("NamespacesL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_NamespacesLL),
+
+		ENTRY("AttrValue - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AttrValueL),
+
+		ENTRY("AddAttrL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddAttrLL),
+
+		ENTRY("Parent - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ParentL),
+
+		ENTRY("SetParent - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetParentL),
+
+		ENTRY("Root - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_RootL),
+
+		ENTRY("Element - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ElementL),
+
+		ENTRY("CreateElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_CreateElementLL),
+
+		ENTRY("InsertElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_InsertElementLL),
+
+		ENTRY("AddElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddElementLL),
+
+		ENTRY("AddElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddElementL_1L),
+
+		ENTRY("AddElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddElementL_2L),
+
+		ENTRY("AddElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddElementL_3L),
+
+		ENTRY("RemoveElement - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_RemoveElementL),
+
+		ENTRY("RemoveElement - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_RemoveElement_1L),
+
+		ENTRY("RemoveElement - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_RemoveElement_2L),
+
+		ENTRY("ReplaceElementL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ReplaceElementLL),
+
+		ENTRY("AsXmlL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AsXmlLL),
+
+		ENTRY("AsXmlUnicodeL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AsXmlUnicodeLL),
+
+		ENTRY("CopyFromL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_CopyFromLL),
+
+		ENTRY("DetachL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_DetachLL),
+
+		ENTRY("Child - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_ChildL),
+
+		ENTRY("Set - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_SetL),
+
+		ENTRY("AddAttributesL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AddAttributesLL),
+/*    
+		ENTRY("RemoveAttributeL - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_RemoveAttributeLL),
+*/    
+		ENTRY("AsElement - CSenXmlElement ", CSenXmlBCTest::CSenXmlElement_AsElementL),
+    
+		ENTRY("NewL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NewL_L),
+    
+		ENTRY("NewL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NewL_1L),
+    
+		ENTRY("NewL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NewL_2L),
+    
+		ENTRY("NewL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NewL_3L),
+    
+		ENTRY("NewL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NewL_4L),
+    
+		ENTRY("NewL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NewL_5L),
+
+		ENTRY("AsXmlUnicodeL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_AsXmlUnicodeLL),
+
+		ENTRY("WriteAsXMLToL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_WriteAsXMLToLL),
+    
+    	ENTRY("Content - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ContentL),
+    	ENTRY("Namespace - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NamespaceL),
+    	ENTRY("EnsureNamespace - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_EnsureNamespaceL),
+    	ENTRY("DetachL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_DetachLL),
+		ENTRY("SaveNamespacesLL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_SaveNamespacesLL),
+		ENTRY("ResetContentLL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ResetContentLL),
+		ENTRY("LocalNameL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_LocalNameL),
+		ENTRY("NsUriL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NsUriL),
+		ENTRY("NsPrefixL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_NsPrefixL),
+		ENTRY("ExtractElementL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ExtractElementL),
+		ENTRY("SetAttributesL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_SetAttributesLL),
+		ENTRY("ConsistsOfL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ConsistsOfLL),
+		ENTRY("ParseL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ParseLL),
+		ENTRY("ErrorParseL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ParseL1L),
+		ENTRY("SetContentOfL- CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_SetContentOfLL),
+		ENTRY("ContentOf- CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_ContentOfL),
+		ENTRY("ParserFeature - CSenXMLReader", CSenXmlBCTest::CSenXMLReader_ParserFeatureL),
+		ENTRY("ParseL - CSenXMLReader", CSenXmlBCTest::CSenXMLReader_ParseLL),
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_1L),
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_L),
+
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_2L),
+
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_3L),
+
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_4L),
+
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_5L),
+
+		ENTRY("NewL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_NewL_6L),
+
+		//ENTRY("ExpandL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_ExpandLL),
+		
+		//ENTRY("ResumeParsingFromL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_ResumeParsingFromLL),
+		
+		ENTRY("ParseWithL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_ParseWithLL),
+
+
+		ENTRY("SetAttributesL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_SetAttributesLL),
+
+		ENTRY("ParseL1 - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_ParseL1L),
+
+		ENTRY("NewL - CSenNamespace ", CSenXmlBCTest::CSenNamespace_NewL_L),    
+    
+		ENTRY("NewLC - CSenNamespace ", CSenXmlBCTest::CSenNamespace_NewLC_L),
+
+		ENTRY("NewL - CSenNamespace ", CSenXmlBCTest::CSenNamespace_NewL_1L),
+
+		ENTRY("NewLC - CSenNamespace ", CSenXmlBCTest::CSenNamespace_NewLC_1L),
+    
+		ENTRY("MatchesL - CSenNamespace ", CSenXmlBCTest::CSenNamespace_MatchesL_L),
+		
+		ENTRY("InsertL - CSenNamespace ", CSenXmlBCTest::CSenNamespace_InsertLL),
+		
+    
+		ENTRY("NewL - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewL_L),
+  
+		ENTRY("NewLC - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewLC_L),
+    
+		ENTRY("NewL - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewL_1L),
+    
+		ENTRY("NewLC - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewLC_1L),
+    
+		ENTRY("NewL - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewL_2L),
+    
+		ENTRY("NewLC - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewLC_2L),
+    
+		ENTRY("NewL - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewL_3L),
+    
+		ENTRY("NewLC - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_NewLC_3L),
+
+		ENTRY("EnabledParserFeature - CSenXmlReader ", CSenXmlBCTest::CSenXmlReader_EnabledParserFeature_L),
+		
+		ENTRY("ToUtf8LC - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_ToUtf8LCL),
+		
+		ENTRY("StartsWith - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_StartsWithL),
+
+		ENTRY("EndsWith - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_EndsWithL),
+
+		ENTRY("AttrValue - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_AttrValueL),
+
+		ENTRY("AllocAttrValueL - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_AllocAttrValueLL),
+
+		ENTRY("DecodeHttpCharactersL - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_DecodeHttpCharactersLL),
+
+		ENTRY("DecodeHttpCharactersLC - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_DecodeHttpCharactersLCL),
+
+		ENTRY("NsPrefix - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_NsPrefixL),
+
+		ENTRY("LocalName - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_LocalNameL),
+
+		ENTRY("RemoveAttributeL - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_RemoveAttributeLL),
+
+		ENTRY("RemoveAttributeL1 - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_RemoveAttributeL1L),
+
+		ENTRY("AddAttributeL - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_AddAttributeLL),
+
+		ENTRY("AddAttributeL1 - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_AddAttributeL1L),
+
+		ENTRY("AddAttributeL1 - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_AddAttributeL2L),
+		
+		ENTRY("EncodeHttpCharactersLC - CSenXmlUtils ", CSenXmlBCTest::CSenXmlUtils_EncodeHttpCharactersLCL),
+		ENTRY("BaseConstructL - CSenDomFragment ", CSenXmlBCTest::CSenDomFragment_BaseConstructL),
+		ENTRY("BaseConstructL - CSenBaseFragment ", CSenXmlBCTest::CSenBaseFragment_BaseConstructL),
+		
+    
+        // Example how to use OOM functionality
+        //OOM_ENTRY( "Loop test with OOM", CSenUtilsBCTest::LoopTest, ETrue, 2, 3),
+        //OOM_FUNCENTRY( CSenUtilsBCTest::PrintTest, ETrue, 1, 3 ),
+        };
+
+    // Verify that case number is valid
+    if( (TUint) aCaseNumber >= sizeof( KCases ) / 
+                               sizeof( TCaseInfoInternal ) )
+        {
+        // Invalid case, construct empty object
+        TCaseInfo null( (const TText*) L"" );
+        null.iMethod = 0 ;
+        null.iIsOOMTest = EFalse;
+        null.iFirstMemoryAllocation = 0;
+        null.iLastMemoryAllocation = 0;
+        return null;
+        } 
+
+    // Construct TCaseInfo object and return it
+    TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+    tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+    tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+    tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+    tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+    return tmp;
+
+    }
+
+void CSenXmlBCTest::SetupL(  ){
+    if ( iXmlReader ){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+    iXmlReader = CSenXmlReader::NewL(
+    );
+} 
+
+void CSenXmlBCTest::Teardown(  ){
+    if ( iXmlReader){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+}
+
+TInt CSenXmlBCTest::CSenBaseAttribute_NewLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseAttribute* pAttr=CSenBaseAttribute::NewL(_L8("Attr1"),_L8("value"));
+    CleanupStack::PushL(pAttr);
+    if(pAttr)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pAttr);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseAttribute_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();    
+    TBool Flag;
+    CSenBaseAttribute* pAttr=CSenBaseAttribute::NewL(_L8("N:Attr1"),_L8("Attr1"),_L8("value"));
+    CleanupStack::PushL(pAttr);
+    if(pAttr)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pAttr);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_NewLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+	Teardown();
+    return KErrNone;    
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_NewL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_NewL_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_NewL_4L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs, *parent);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_SetAttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseElement *pElement = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    /*EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;   
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_LocalNameL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KLName,"Nokia");
+ 
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& pLName=pElement->LocalName(); 
+    if(pLName==_L8("Nokia"))
+	 	Flag=1;
+	else
+		Flag=0;
+/*    EUNIT_ASSERT(Flag);*/
+    if(!Flag)
+    return KErrArgument;
+    
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_NamespaceURIL (TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KNSUri,"nsuria");
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const TDesC8 &pNSUri=pElement->NamespaceURI();
+    if(pNSUri==KNSUri)
+    	Flag=1;
+    else
+    	Flag=0;
+    CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_NsPrefixL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KNSPrefix,"N");
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    const TDesC8& pNSPrefix=pElement->NsPrefix();
+    if(pNSPrefix==KNSPrefix)
+    	Flag=1;
+    else
+    	Flag=0;
+    delete pElement;    
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_SetPrefixLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetPrefixL(_L8("N"));
+	const TDesC8& pNSPrefix=pElement->NsPrefix();
+    /*EUNIT_ASSERT_EQUALS(pNSPrefix, _L8("N"));*/
+    TL(pNSPrefix == _L8("N"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_HasContentTL (TTestResult& aResult)
+    {
+    SetupL();	
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	pElement->SetContentL(_L8("Nokia content"));
+	TBool Flag=pElement->HasContent();
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_HasContentFL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	TBool pHasContnt=pElement->HasContent();
+	if(pHasContnt)
+		Flag=0;
+	else
+		Flag=1;
+	    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	delete pElement;
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CSenXmlBCTest::CSenBaseElement_ContentL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	pElement->SetContentL(_L8("Nokia content"));
+	TPtrC8 pContent=pElement->Content();
+	if(pContent==_L8("Nokia content"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_Content_NullL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	TPtrC8 pContent=pElement->Content();
+	if(pContent==KNullDesC8())
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+   	delete pElement;
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CSenXmlBCTest::CSenBaseElement_ContentUnicodeLL (TTestResult& aResult)
+    {    
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetContentL(_L8("Nokia content"));
+	HBufC* ElementBuf=pElement->ContentUnicodeL();
+/*	EUNIT_ASSERT_EQUALS(*ElementBuf,_L("Nokia content"));*/
+	TL(*ElementBuf == _L("Nokia content"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_SetContentLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	TPtrC8 pContent=pElement->SetContentL(_L8("Nokia Content"));
+	if(pContent==_L8("Nokia Content"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_SetContentL_NullL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetContentL(_L8("element content"));
+	TPtrC8 pContent=pElement->SetContentL(KNullDesC8);
+	if(pContent==KNullDesC8())
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_SetContentL_OverRightL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetContentL(_L8("Nokia Content1"));
+	pElement->SetContentL(_L8("Nokia Content2"));	
+	TPtrC8 pContent=pElement->Content();
+	if(pContent==_L8("Nokia Content2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }
+      
+TInt CSenXmlBCTest::CSenBaseElement_SetContentL_WithEscCharsL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	TPtrC8 pContent=pElement->SetContentL(_L8("N&o'k\"ia <Content>"));
+	if(pContent==_L8("N&o'k\"ia <Content>"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }      
+       
+TInt CSenXmlBCTest::CSenBaseElement_ConsistsOfLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElementA=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenBaseElement* pChild1A=CSenBaseElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenBaseElement* pChild2A=CSenBaseElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenBaseElement* pElementB=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenBaseElement* pChild1B=CSenBaseElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenBaseElement* pChild2B=CSenBaseElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+    /*EUNIT_ASSERT( ConsistOfFlag );*/
+    if(!ConsistOfFlag)
+    return KErrArgument;   
+    
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	if(pNsURI==_L8("namespaceuri"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceL_NullL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8(""));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	if(pNsURI==_L8(""))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement)	;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceL_1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceL_2same1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==1 );*/
+    if(!( pNsList.Count()==1 ))
+    return KErrArgument;   
+ 	
+	CleanupStack::PopAndDestroy(pElement); 
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceL_2Diff1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pElement->SetNamespaceL(_L8("N2"),_L8("namespaceuri2"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri2")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==2 );*/
+    if(!( pNsList.Count()==2 ))
+    return KErrArgument;   
+ 	
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceL_DPSU1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pElement->SetNamespaceL(_L8("N2"),_L8("namespaceuri1"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri1")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==2 );*/
+    if(!( pNsList.Count()==2 ))
+    return KErrArgument;   
+ 	
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }       
+    
+TInt CSenXmlBCTest::CSenBaseElement_SetNamespaceL_SNsPC1L (TTestResult& aResult)
+	{
+	SetupL();
+	 CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+   	 CleanupStack::PushL(pElement);
+     CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+   	 CleanupStack::PushL(pParent);
+   	 pElement->SetParent(pParent);
+   	 pParent->SetNamespaceL(_L8("n"),_L8("nsuri"));
+   	 pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+   	 RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/*   	 EUNIT_ASSERT(pNsList.Count()==0);*/
+    if(!(pNsList.Count()==0))
+    return KErrArgument;   
+
+   	 CleanupStack::PopAndDestroy(pParent);
+   	 CleanupStack::PopAndDestroy(pElement);   	 
+	Teardown();
+    return KErrNone;
+    }
+        
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_FL (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+     TBool CheckParent=FALSE;
+     CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+   	 CleanupStack::PushL(pElement);
+   	 CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+     CleanupStack::PushL(pNs1);
+     const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+	 const TDesC8& pNsURI=pNs->URI();
+	 const TDesC8& pNsPrefix=pNs->Prefix();
+	 if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+	 	Flag=1;
+	 else
+		Flag=0;
+     CleanupStack::PopAndDestroy(pNs1);	
+	 CleanupStack::PopAndDestroy(pElement);
+         /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_TL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    TBool CheckParent=TRUE;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==1);*/
+    if(!(pNsList.Count()==1))
+    return KErrArgument;   
+
+   	CleanupStack::PopAndDestroy(pNs1);
+   	CleanupStack::PopAndDestroy(pParent);	
+	CleanupStack::PopAndDestroy(pElement);
+	
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_TSPL (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+     TBool CheckParent=TRUE;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    pParent->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==0);*/
+    if(!(pNsList.Count()==0))
+    return KErrArgument; 
+
+   	CleanupStack::PopAndDestroy(pNs1);	
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_TDPL (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+     TBool CheckParent=TRUE;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    pParent->AddNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==1);*/
+    if(!(pNsList.Count()==1))
+    return KErrArgument; 
+
+   	CleanupStack::PopAndDestroy(pNs1);	
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_2same1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+    pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==1 );*/
+    if(!(pNsList.Count()==1))
+    return KErrArgument;   
+ 	
+	CleanupStack::PopAndDestroy(pElement); 
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CSenXmlBCTest::CSenBaseElement_AddNamespaceL_2Diff1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+	const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pNs=pElement->AddNamespaceL(_L8("N2"),_L8("namespaceuri2"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri2")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==2 );*/
+ 	if(!(pNsList.Count()==2))
+    return KErrArgument;  
+ 	
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+    
+
+TInt CSenXmlBCTest::CSenBaseElement_NamespaceL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,Flag1,Flag2;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    //NULL
+    pElement->SetNamespaceL(_L8(""));
+    const CSenNamespace* pNs2=pElement->Namespace();
+    if(pNs2==NULL)
+    	Flag2=1;
+    else
+    	Flag2=0;
+    /*EUNIT_ASSERT(Flag2);*/
+   	if(!Flag2)
+    return KErrArgument;  
+
+   
+    //only URI
+    pElement->SetNamespaceL(_L8("nsuri"));
+    const CSenNamespace* pNs1=pElement->Namespace();
+    if(pNs1->Prefix()==_L8("")&&pNs1->URI()==_L8("nsuri"))
+    	Flag1=1;
+    else
+    	Flag1=0;
+    /*EUNIT_ASSERT(Flag1);*/
+  	if(!Flag1)
+    return KErrArgument;  
+
+    //URI and Prefix
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace();
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_Namespace_1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag,Flag1;
+     //True case
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace(_L8("n"));
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    //False case
+    pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    pNs=pElement->Namespace(_L8("N"));
+    if(pNs==NULL)
+    	Flag1=1;
+    else
+    	Flag1=0;
+    /*EUNIT_ASSERT(Flag1);*/
+  	if(!Flag1)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_Namespace_WP1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag,Flag1;
+ 	CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent")) ;
+ 	CleanupStack::PushL(pParent);
+ 	pParent->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+    const CSenNamespace* pNs=pElement->Namespace(_L8("n"));
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    //False case
+    pParent=CSenBaseElement::NewL(_L8("Parent")) ;
+ 	CleanupStack::PushL(pParent);
+ 	pParent->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+	pNs=pElement->Namespace(_L8("N"));
+	if(pNs==NULL)
+    	Flag1=1;
+    else
+    	Flag1=0;
+   /* EUNIT_ASSERT( Flag1 );*/
+  	if(!Flag1)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_Namespace_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,Flag1;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pParent->SetNamespaceL(_L8("p"),_L8("nsurip"));
+    pElement->SetNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->SetParent(pParent);
+    //aCheckInParent=FALSE and parent prefix
+    const CSenNamespace* pPNs=pElement->Namespace(_L8("p"),FALSE);
+    if(pPNs==NULL)
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    //aCheckInParent=TRUE and parent prefix
+    pPNs=pElement->Namespace(_L8("p"),TRUE);
+    if(pPNs->Prefix()==_L8("p") && pPNs->URI()==_L8("nsurip"))
+    	Flag1=1; 
+   	else
+   		Flag1=0;
+    /*EUNIT_ASSERT( Flag1 );*/
+  	if(!Flag1)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+   
+TInt CSenXmlBCTest::CSenBaseElement_Namespace_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNsList.Count()==3 );*/
+  	if(!( pNsList.Count()==3 ))
+    return KErrArgument;  
+    
+    const CSenNamespace* pNs=pElement->Namespace(_L8("m"),_L8("nsurim"));
+    if(pNs->Prefix()==_L8("m") && pNs->URI()==_L8("nsurim"))
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT(Flag);*/
+  	if(!Flag)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_ElementsLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia")) ;
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pChild1=CSenBaseElement::NewL(_L8("element1")) ;
+    CleanupStack::PushL(pChild1);
+    CSenBaseElement* pChild2=CSenBaseElement::NewL(_L8("element2")) ;
+    CleanupStack::PushL(pChild2);
+    CSenBaseElement* pChild3=CSenBaseElement::NewL(_L8("element3")) ;
+    CleanupStack::PushL(pChild3);
+    pElement->AddElementL(*pChild1);
+    pElement->AddElementL(*pChild2);
+    pElement->AddElementL(*pChild3);
+    RPointerArray<CSenElement>& ElList=pElement->ElementsL();
+/*    EUNIT_ASSERT( ElList.Count()==3);*/
+  	if(!(ElList.Count()==3))
+    return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia")) ;
+    CleanupStack::PushL(pElement);
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==4 );*/
+  	if(!( pAttrList.Count()==4 ))
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_NamespacesLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    const RPointerArray<CSenNamespace>& pNs=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNs.Count()==3);*/
+  	if(!(pNs.Count()==3))
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AttrValueL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,NegFlag;
+    _LIT8(KValue,"value4");
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia")) ;
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr4"));
+    if(pAttrVal!=NULL)
+    {
+    	Flag=1;
+    }
+    else
+    	Flag=0;
+/*    EUNIT_ASSERT(Flag);*/
+  	if(!Flag)
+    return KErrArgument;  
+    
+    const TDesC8* pNegAttrVal=pElement->AttrValue(_L8("attr1"));
+    if(pNegAttrVal==NULL)
+    	NegFlag=1;
+    else
+    	NegFlag=0;
+/*    EUNIT_ASSERT(NegFlag);*/
+  	if(!NegFlag)
+    return KErrArgument;  
+    
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AddAttrLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==1 );*/
+  	if(!( pAttrList.Count()==1 ))
+    return KErrArgument;  
+    
+    pElement->AddAttrL(_L8("Attr1"),_L8("Duplicatevalue1"));
+/*    EUNIT_ASSERT( pAttrList.Count()==1 );*/
+  	if(!( pAttrList.Count()==1 ))
+    return KErrArgument;  
+
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8(" value2"));//improve here by comparing TDesC8* AttrValue()
+    /*EUNIT_ASSERT( pAttrList.Count()==2 );*/
+  	if(!( pAttrList.Count()==2 ))
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenXmlBCTest::CSenBaseElement_AddAttributeLL (TTestResult& aResult)
+    {
+    SetupL();
+    CTestBaseElement* pElement=CTestBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributeL(_L8("Attr1"),_L8("value1"));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_ParentL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,PFlag,PPFlag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CSenBaseElement* pPParent=CSenBaseElement::NewL(_L8("parent of parent"));
+    pElement->SetParent(pParent);
+    pParent->SetParent(pPParent);
+    CSenElement* pEl1= pElement->Parent();
+    CSenElement* pEl2= pParent->Parent();
+    CSenElement* pEl3= pPParent->Parent();
+    const TDesC8& pLName1=pEl1->LocalName();
+    if(pLName1==_L8("Parent"))
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    const TDesC8& pLName2=pEl2->LocalName();
+    if(pLName2==_L8("parent of parent"))
+    	PFlag=1;
+    else
+    	PFlag=0;
+/*    EUNIT_ASSERT(PFlag);*/
+  	if(!PFlag)
+    return KErrArgument;  
+    
+    if(pEl3==NULL)
+    	PPFlag=1;
+    else
+    	PPFlag=0;
+    /*EUNIT_ASSERT(PPFlag);*/
+  	if(!PFlag)
+    return KErrArgument;  
+    
+    delete pElement;
+    delete pParent;
+    delete pPParent;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_SetParentL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pElement->SetNamespaceL(_L8("Nsuria"));
+    pParent->SetNamespaceL(_L8("nsurip"));
+    pElement->SetParent(pParent);
+    CSenElement* pPar=pElement->Parent();
+    const TDesC8& ParName=pPar->LocalName();
+    /*EUNIT_ASSERT_EQUALS( ParName,_L8("Parent") );*/
+    TL(ParName == _L8("Parent"));
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_RootL (TTestResult& aResult)
+    {
+    SetupL();    
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    const MSenElement& pElRoot=pElement->Root();
+    const TDesC8& pElLName=pElRoot.LocalName();
+    if(pElLName==_L8("Nokia"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenBaseElement* pParent1=CSenBaseElement::NewL(_L8("Parent1"));
+    pElement->SetParent(pParent1);
+    const MSenElement& pElRoot1=pElement->Root();
+    const TDesC8& pElLName1=pElRoot1.LocalName();
+    if(pElLName1==_L8("Parent1"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenBaseElement* pParent2=CSenBaseElement::NewL(_L8("Parent2"));
+    pParent1->SetParent(pParent2);
+    const MSenElement& pElRoot2=pElement->Root();
+    const TDesC8& pElLName2=pElRoot2.LocalName();
+	const MSenElement& pParRoot=pParent1->Root();
+    const TDesC8& pParLName=pParRoot.LocalName();
+    if(pElLName2==_L8("Parent2") && pParLName==_L8("Parent2"))
+    	Flag=1;
+    else
+    	Flag=0;
+        
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    delete pParent1;
+    delete pParent2;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_ElementL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    CSenElement* element=pParent->Element(_L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+  	if(!(element->LocalName()==_L8("Nokia1")))
+    return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenXmlBCTest::CSenBaseElement_ElementsL1 (TTestResult& aResult)
+    {
+    SetupL();
+    //RPointerArray<CSenElement> &array;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    pParent->ElementsL(elementList, _L8("Nokia1"), _L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+  	//if(!(element->LocalName()==_L8("Nokia1")))
+    //return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CSenXmlBCTest::CSenBaseElement_ElementsL2 (TTestResult& aResult)
+    {
+    SetupL();
+    //RPointerArray<CSenElement> &array;
+    
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+
+    pParent->ElementsL(elementList, _L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+  	//if(!(element->LocalName()==_L8("Nokia1")))
+    //return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::Pop(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_CreateElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("nsuri"));
+    CSenElement* pNewElement=pElement->CreateElementL(_L8("N"),_L8("Nokia"));
+    CleanupStack::PushL(pNewElement);
+    HBufC8* ElementBuf=pNewElement->AsXmlL();
+/*    EUNIT_ASSERT_EQUALS(*ElementBuf,_L8("<N:Nokia xmlns:N=\"nsuri\"/>"));*/
+    TL(*ElementBuf == _L8("<N:Nokia xmlns:N=\"nsuri\"/>"));
+    CleanupStack::PopAndDestroy(pNewElement);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_InsertElementLL (TTestResult& aResult)
+    {
+    SetupL(); 
+     TBool Flag;
+     CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+     CleanupStack::PushL(pParent);
+     CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+     CleanupStack::PushL(pElement1);
+     CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+     CleanupStack::PushL(pElement2);
+     CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+     CleanupStack::PushL(pElement3);
+     CSenBaseElement* pElement5=CSenBaseElement::NewL(_L8("Nokia5"));
+     CleanupStack::PushL(pElement5);
+     pParent->AddElementL(*pElement1);
+     pParent->AddElementL(*pElement2);
+     pParent->AddElementL(*pElement3);
+     pParent->AddElementL(*pElement5);
+     CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Nokia4"));
+     CleanupStack::PushL(pElement4);
+     pParent->InsertElementL(*pElement4,*pElement5);
+     RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+     const TDesC8& localName=elementList[3]->LocalName();
+     if(localName==_L8("Nokia4"))
+     	Flag=1;
+     else
+     	Flag=0;
+     /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+     if(!Flag)
+     return KErrArgument;
+     
+     CleanupStack::Pop(pElement4);
+	 CleanupStack::Pop(pElement5);
+     CleanupStack::Pop(pElement3);
+     CleanupStack::Pop(pElement2);
+     CleanupStack::Pop(pElement1);
+     CleanupStack::PopAndDestroy(pParent); 
+    Teardown();
+    return KErrNone;
+    }
+	 
+TInt CSenXmlBCTest::CSenBaseElement_InsertElementL_NoBeforeL (TTestResult& aResult)               
+	{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+	CleanupStack::PushL(pParent);
+	CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("nokia"));
+	CleanupStack::PushL(pElement1);
+	
+	CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("nokia2"));
+	CleanupStack::PushL(pElement2);
+	
+	CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("nokia3"));
+	CleanupStack::PushL(pElement3);
+	pParent->AddElementL(*pElement1);
+	pParent->AddElementL(*pElement2);
+	pParent->AddElementL(*pElement3);
+	
+	
+	CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("nokia4"));
+	CleanupStack::PushL(pElement4);
+	
+	
+	CSenBaseElement* pElement5=CSenBaseElement::NewL(_L8("nokia5"));
+	CleanupStack::PushL(pElement5);
+	
+	pParent->InsertElementL(*pElement4,*pElement5);
+	RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+	const TDesC8& localName=elementList[(elementList.Count()-1)]->LocalName();
+	if(localName==_L8("nokia4"))
+		Flag=1;
+	else
+		Flag=0;
+		
+/*	EUNIT_ASSERT(Flag);*/
+	if(!Flag)
+    return KErrArgument;
+	
+	CleanupStack::PopAndDestroy(pElement5);
+	CleanupStack::Pop(pElement4);
+    CleanupStack::Pop(pElement3);
+    CleanupStack::Pop(pElement2);
+    CleanupStack::Pop(pElement1);
+    CleanupStack::PopAndDestroy(pParent); 
+ 	Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AddElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    CSenElement& newElement=pParent->AddElementL(*pElement);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName();
+    if(localName==_L8("nokia") && elementList.Count()==1 )
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+	if(!Flag)
+    return KErrArgument;
+	
+    CleanupStack::Pop(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AddElementL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    if(localName==_L8("element") && elementList.Count()==1 )
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+   	if(!Flag)
+    return KErrArgument;
+	
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AddElementL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AddElementL_3L (TTestResult& aResult)
+    {
+    SetupL();
+	TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"),_L8("e:element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+     /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+	
+    CleanupStack::PopAndDestroy(pParent);    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_RemoveElementL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool TFlag;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4);
+    //true case
+    CSenElement* pRmdElement=pParent->RemoveElement(*pElement3);
+    const TDesC8& localName=pRmdElement->LocalName();
+    /*CSenElement* pParElement=pElement3->Parent();//intentional
+    const TDesC8& localnmae1=pParElement->LocalName();*/
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    if(localName==_L8("Element3") && elList.Count()==3 )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+	
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pRmdElement;
+    //delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_RemoveElement_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    pParent->AddElementL(_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("element1"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    if(pRmdElement->LocalName()==_L8("element1") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+	
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("none"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+	if(!FFlag)
+    return KErrArgument;
+
+	CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	//delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_RemoveElement_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("nsuri1"),_L8("element1"));
+    pParent->AddElementL(_L8("nsuri2"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri2a"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri4"),_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("nsuri2a"),_L8("element2"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    const TDesC8& localName=pRmdElement->LocalName();
+    const TDesC8& nsURI=pRmdElement->NamespaceURI();
+    if(localName==_L8("element2") && nsURI==_L8("nsuri2a") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+    /*EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("element1"),_L8("nothing"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+	if(!FFlag)
+    return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	delete pRmdElement1;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_ReplaceElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    _LIT8(KNewElement,"<a:Element1 xmlns:a=\"nsuria\"><subelement1/>New content</a:Element1>");
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    //true case
+    CSenBaseElement* pNewElement=CSenBaseElement::NewL(_L8("Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement);
+    pNewElement->AddElementL(_L8("subelement1"));
+    pNewElement->SetContentL(_L8("New content"));
+    CSenElement* pReplacedElement=pParent->ReplaceElementL(*pNewElement);
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    HBufC8* pRepBuf=elList[(elList.Count()-1)]->AsXmlL();
+    if(pReplacedElement!=NULL && elList.Count()==4 && 
+    	elList[(elList.Count()-1)]->LocalName()==_L8("Element1") && 
+    	*pRepBuf==KNewElement && elList[(elList.Count()-1)]->Content()==_L8("New content") )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+
+    //False case
+    CSenBaseElement* pNewElement1=CSenBaseElement::NewL(_L8("New Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement1);
+    CSenElement* pReplacedElement1=pParent->ReplaceElementL(*pNewElement1);
+    RPointerArray<CSenElement>& elList1=pParent->ElementsL();
+    if(pReplacedElement1==NULL && elList1.Count()==5)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+	if(!FFlag)
+    return KErrArgument;
+
+    CleanupStack::Pop(pNewElement1);
+    CleanupStack::Pop(pNewElement);
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pReplacedElement;
+    delete pRepBuf;
+    delete pReplacedElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AsXmlLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC8* parBuf=pParent->AsXmlL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AsXmlUnicodeLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC* parBuf=pParent->AsXmlUnicodeL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_CopyFromLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("xml element"));
+    CleanupStack::PushL(pElement);
+    pElement->AddElementL(_L8("child1"));
+    pElement->AddElementL(_L8("child2"));
+    pElement->SetContentL(_L8("element content"));
+    pElement->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    CSenBaseElement* pCopied=CSenBaseElement::NewL(_L8("copied element"));
+    CleanupStack::PushL(pCopied);
+    pCopied->SetContentL(_L8("copy content"));
+    pCopied->AddElementL(_L8("child1"));
+    pCopied->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    pCopied->CopyFromL(*pElement);
+    const TDesC8& content=pCopied->Content();
+    const RPointerArray<CSenElement>& copElList=pCopied->ElementsL();
+    const RPointerArray<CSenNamespace>& copNSList=pCopied->NamespacesL();
+    if(copElList.Count()==3 && copNSList.Count()==2)
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pCopied);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_DetachLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    CSenElement* dElement=pElement1->DetachL();
+    const RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    /*EUNIT_ASSERT( elList.Count()==3 );*/
+	if(!(elList.Count()==3))
+    return KErrArgument;
+
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete dElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_ChildL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    CSenBaseElement*pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    CSenElement* pElement=pParent->Child(0);
+    if(pElement->LocalName()==_L8("element1"))
+    	TFlag=1;
+    else
+    	TFlag=0;
+    /*EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+    
+    CSenElement* pElement1=pParent->Child(4);
+    if(pElement1==NULL)
+    	FFlag=1;
+    else
+    	FFlag=0;
+    /*EUNIT_ASSERT( FFlag );*/
+    if(!FFlag)
+    return KErrArgument;    
+    
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseElement_SetL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->Set(_L8("nsuri"),_L8("element"),_L8("e:e:lement"));
+    if(pElement->LocalName()==_L8("element") && pElement->NamespaceURI()==_L8("nsuri") 
+    		&& pElement->NsPrefix()==_L8("e"))
+    		Flag=1;
+    else
+    		Flag=0;
+    
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    if(!Flag)
+    return KErrArgument;    
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+  
+TInt CSenXmlBCTest::CSenBaseElement_AddAttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseElement *pElement = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    /*EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!(*pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;    
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseElement_AsElementL(TTestResult& aResult)
+	{
+    SetupL();
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	MSenElement* pAsElement=pElement->AsElement();
+	HBufC8* pElementBuf=pElement->AsXmlL();
+/*	EUNIT_ASSERT_EQUALS(*pElementBuf,_L8("<Nokia><webservices/></Nokia>"));*/
+	TL(*pElementBuf == _L8("<Nokia><webservices/></Nokia>"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete pElementBuf;
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenBaseElement_ContentWriteStreamLL(TTestResult& aResult)
+	{
+    SetupL();
+	TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	TRAPD(res,ElemntStream.WriteL(StreamBuf));
+	CleanupStack::PopAndDestroy(pElement);
+	//EUNIT_ASSERT(FALSE);
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenBaseElement_RemoveAttributeLL(TTestResult& aResult)
+	{
+    SetupL();/*
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseElement *pElement = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    CSenBaseAttribute* RmdElement=pElement->RemoveAttributeL(_L8("pr:LocalName"));
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    RPointerArray<CSenBaseAttribute>& AttrList=pElement->AttributesL();
+    //EUNIT_ASSERT( *pElementBuf == _L8("<Nokia/>" ));
+    if(!(*pElementBuf == _L8("<Nokia/>")))
+    return KErrArgument;   
+
+    //EUNIT_ASSERT_EQUALS(AttrList.Count(),0);
+    TL(AttrList.Count() == 0);
+   	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+	delete RmdElement;
+	//EUNIT_ASSERT(FALSE);
+	Teardown();
+    return KErrNone;
+    */
+   	Teardown();
+    return KErrNone;
+
+    }
+	
+TInt CSenXmlBCTest::CSenXmlElement_NewLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("elment"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+/*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+        
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_NewL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+   /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_SetAttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenXmlElement *pElement = CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+/*    EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;   
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_LocalNameL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& lName=pElement->LocalName();
+    if(lName==_L8("element"))
+    	Flag=1;
+    else
+    	Flag=0;
+   /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+   
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_NamespaceURIL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& nsURI=pElement->NamespaceURI();
+    if(nsURI==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+   /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_NsPrefixL (TTestResult& aResult)
+    {
+    SetupL(); 
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& nsPrefix=pElement->NsPrefix();
+    if(nsPrefix==_L8("a"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_SetPrefixLL (TTestResult& aResult)
+    {
+    SetupL();//some thing
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetPrefixL(_L8("pre"));
+    const TDesC8& lName=pElement->LocalName();
+    const TDesC8& nsPrefix=pElement->NsPrefix();
+    if(nsPrefix==_L8("pre") && lName==_L8("element"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+  
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_HasContentL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    //False case
+    Flag=pElement->HasContent();
+/*    EUNIT_ASSERT( !Flag );*/
+  	if(Flag)
+    return KErrArgument;  
+
+    //True case
+    pElement->SetContentL(_L8("CONTENT"));
+    Flag=pElement->HasContent();
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ContentL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetContentL(_L8("CONTENT"));
+    const TDesC8& content=pElement->Content();
+    if(content==_L8("CONTENT"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlElement_ContentWriteStreamLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+	RWriteStream stream = pElement->ContentWriteStreamL();
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CSenXmlBCTest::CSenXmlElement_ContentUnicodeLL (TTestResult& aResult)
+    {
+    SetupL();    
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetContentL(_L8("Nokia content"));
+	HBufC* ElementBuf=pElement->ContentUnicodeL();
+/*	EUNIT_ASSERT_EQUALS(*ElementBuf,_L("Nokia content"));*/
+	TL(*ElementBuf == _L("Nokia content"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_SetContentLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetContentL(_L8("CONTENT"));
+    TBool ContentFlag=pElement->HasContent();
+    const TDesC8& content=pElement->Content();
+    if(content==_L8("CONTENT") && ContentFlag)
+   		Flag=1;
+    else 
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    pElement->SetContentL(_L8("NEW CONTENT"));
+    const TDesC8& newContent=pElement->Content();
+    if(newContent==_L8("NEW CONTENT") )
+   		Flag=1;
+    else 
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ConsistsOfLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElementA=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenXmlElement* pChild1A=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2A=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenXmlElement* pElementB=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenXmlElement* pChild1B=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2B=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+/*    EUNIT_ASSERT( ConsistOfFlag );*/
+    if(!ConsistOfFlag)
+    return KErrArgument;   
+    
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlElement_ConsistsOfL1L (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElementA=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenXmlElement* pChild1A=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2A=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenXmlElement* pElementB=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenXmlElement* pChild1B=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2B=CSenXmlElement::NewL(_L8("Xml"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+/*    EUNIT_ASSERT( !ConsistOfFlag );*/
+    if(ConsistOfFlag)
+    return KErrArgument;   
+
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenXmlElement_ConsistsOfL2L (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElementA=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenXmlElement* pChild1A=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2A=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    CSenXmlElement* pChild3A=CSenXmlElement::NewL(_L8("Xml"));
+    CleanupStack::PushL(pChild3A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    pElementA->AddElementL(*pChild3A);
+    
+    CSenXmlElement* pElementB=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenXmlElement* pChild1B=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2B=CSenXmlElement::NewL(_L8("Xml"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+/*    EUNIT_ASSERT( ConsistOfFlag );*/
+    if(!ConsistOfFlag)
+    return KErrArgument;   
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+	Teardown();
+    return KErrNone;
+    }	
+
+TInt CSenXmlBCTest::CSenXmlElement_SetNamespaceLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	if(pNsURI==_L8("namespaceuri"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlElement_SetNamespaceL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenXmlBCTest::CSenXmlElement_SetNamespaceL_2same1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/* 	EUNIT_ASSERT( pNsList.Count()==1 );*/
+    if(!( pNsList.Count()==1 ))
+    return KErrArgument;   
+
+	CleanupStack::PopAndDestroy(pElement); 
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CSenXmlBCTest::CSenXmlElement_SetNamespaceL_2Diff1L (TTestResult& aResult)
+    {
+    SetupL();
+     TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pElement->SetNamespaceL(_L8("N2"),_L8("namespaceuri2"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri2")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/* 	EUNIT_ASSERT( pNsList.Count()==2 );*/
+    if(!( pNsList.Count()==2 ))
+    return KErrArgument;   
+
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CSenXmlBCTest::CSenXmlElement_AddNamespaceLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    TBool CheckParent=TRUE;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==1);*/
+    if(!( pNsList.Count()==1 ))
+    return KErrArgument;   
+
+   	CleanupStack::PopAndDestroy(pNs1);
+   	CleanupStack::PopAndDestroy(pParent);	
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddNamespaceL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_NamespaceL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,Flag1,Flag2;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    //NULL
+    pElement->SetNamespaceL(_L8(""));
+    const CSenNamespace* pNs2=pElement->Namespace();
+    if(pNs2==NULL)
+    	Flag2=1;
+    else
+    	Flag2=0;
+/*    EUNIT_ASSERT(Flag2);*/
+    if(!Flag2)
+    return KErrArgument;   
+   
+   
+    //only URI
+    pElement->SetNamespaceL(_L8("nsuri"));
+    const CSenNamespace* pNs1=pElement->Namespace();
+    if(pNs1->Prefix()==_L8("")&&pNs1->URI()==_L8("nsuri"))
+    	Flag1=1;
+    else
+    	Flag1=0;
+/*    EUNIT_ASSERT(Flag1);*/
+    if(!Flag1)
+    return KErrArgument;   
+
+    //URI and Prefix
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace();
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_Namespace_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,Flag1;
+     //True case
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace(_L8("n"));
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    //False case
+    pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    pNs=pElement->Namespace(_L8("N"));
+    if(pNs==NULL)
+    	Flag1=1;
+    else
+    	Flag1=0;
+/*    EUNIT_ASSERT(Flag1);*/
+    if(!Flag1)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_Namespace_2L (TTestResult& aResult)
+    {
+    SetupL();
+	TBool Flag,Flag1;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pParent->SetNamespaceL(_L8("p"),_L8("nsurip"));
+    pElement->SetNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->SetParent(pParent);
+    //aCheckInParent=FALSE and parent prefix
+    const CSenNamespace* pPNs=pElement->Namespace(_L8("p"),FALSE);
+    if(pPNs==NULL)
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    //aCheckInParent=TRUE and parent prefix
+    pPNs=pElement->Namespace(_L8("p"),TRUE);
+    if(pPNs->Prefix()==_L8("p") && pPNs->URI()==_L8("nsurip"))
+    	Flag1=1; 
+   	else
+   		Flag1=0;
+/*    EUNIT_ASSERT( Flag1 );*/
+    if(!Flag1)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_Namespace_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNsList.Count()==3 );*/
+    if(!( pNsList.Count()==3 ))
+    return KErrArgument;   
+
+    const CSenNamespace* pNs=pElement->Namespace(_L8("m"),_L8("nsurim"));
+    if(pNs->Prefix()==_L8("m") && pNs->URI()==_L8("nsurim"))
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT(Flag);*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ElementsLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia")) ;
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pChild1=CSenXmlElement::NewL(_L8("element1")) ;
+    CleanupStack::PushL(pChild1);
+    CSenXmlElement* pChild2=CSenXmlElement::NewL(_L8("element2")) ;
+    CleanupStack::PushL(pChild2);
+    CSenXmlElement* pChild3=CSenXmlElement::NewL(_L8("element3")) ;
+    CleanupStack::PushL(pChild3);
+    pElement->AddElementL(*pChild1);
+    pElement->AddElementL(*pChild2);
+    pElement->AddElementL(*pChild3);
+    RPointerArray<CSenElement>& ElList=pElement->ElementsL();
+    /*EUNIT_ASSERT( ElList.Count()==3);*/
+    if(!( ElList.Count()==3 ))
+    return KErrArgument;  
+    
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia")) ;
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==4 );*/
+    if(!( pAttrList.Count()==4 ))
+    return KErrArgument;  
+    
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenXmlBCTest::CSenXmlElement_AddAttributeLL (TTestResult& aResult)
+    {
+    SetupL();
+    CTestXmlElement* pElement=CTestXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributeL(_L8("Attr1"),_L8("value1"));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_NamespacesLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    const RPointerArray<CSenNamespace>& pNs=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNs.Count()==3);*/
+    if(!( pNs.Count()==3 ))
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AttrValueL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,NegFlag;
+    _LIT8(KValue,"value4");
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia")) ;
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr4"));
+    if(pAttrVal!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+/*    EUNIT_ASSERT(Flag);*/
+    if(!(Flag))
+    return KErrArgument;  
+    
+    const TDesC8* pNegAttrVal=pElement->AttrValue(_L8("attr1"));
+    if(pNegAttrVal==NULL)
+    	NegFlag=1;
+    else
+    	NegFlag=0;
+    /*EUNIT_ASSERT(NegFlag);*/
+    if(!(NegFlag))
+    return KErrArgument;  
+    
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddAttrLL (TTestResult& aResult)
+    {
+    SetupL();
+	CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==1 );*/
+    if(!(pAttrList.Count()==1))
+    return KErrArgument;  
+
+    pElement->AddAttrL(_L8("Attr1"),_L8("Duplicatevalue1"));
+    /*EUNIT_ASSERT( pAttrList.Count()==1 );*/
+    if(!(pAttrList.Count()==1))
+    return KErrArgument;  
+    
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8(" value2"));//improve here by comparing TDesC8* AttrValue()
+    /*EUNIT_ASSERT( pAttrList.Count()==2 );*/
+    if(!(pAttrList.Count()==2))
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ParentL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag,PFlag,PPFlag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CSenXmlElement* pPParent=CSenXmlElement::NewL(_L8("parent of parent"));
+    pElement->SetParent(pParent);
+    pParent->SetParent(pPParent);
+    CSenElement* pEl1= pElement->Parent();
+    CSenElement* pEl2= pParent->Parent();
+    CSenElement* pEl3= pPParent->Parent();
+    const TDesC8& pLName1=pEl1->LocalName();
+    if(pLName1==_L8("Parent"))
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    const TDesC8& pLName2=pEl2->LocalName();
+    if(pLName2==_L8("parent of parent"))
+    	PFlag=1;
+    else
+    	PFlag=0;
+/*    EUNIT_ASSERT(PFlag);*/
+    if(!PFlag)
+    return KErrArgument;  
+    
+    if(pEl3==NULL)
+    	PPFlag=1;
+    else
+    	PPFlag=0;
+    /*EUNIT_ASSERT(PPFlag);*/
+    if(!PPFlag)
+    return KErrArgument;  
+    
+    delete pElement;
+    delete pParent;
+    delete pPParent;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_SetParentL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pElement->SetNamespaceL(_L8("Nsuria"));
+    pParent->SetNamespaceL(_L8("nsurip"));
+    pElement->SetParent(pParent);
+    CSenElement* pPar=pElement->Parent();
+    const TDesC8& ParName=pPar->LocalName();
+/*    EUNIT_ASSERT_EQUALS( ParName,_L8("Parent") ); */
+    TL(ParName == _L8("Parent"));
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_RootL (TTestResult& aResult)
+    {
+    SetupL();
+	TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    const MSenElement& pElRoot=pElement->Root();
+    const TDesC8& pElLName=pElRoot.LocalName();
+    if(pElLName==_L8("Nokia"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenXmlElement* pParent1=CSenXmlElement::NewL(_L8("Parent1"));
+    pElement->SetParent(pParent1);
+    const MSenElement& pElRoot1=pElement->Root();
+    const TDesC8& pElLName1=pElRoot1.LocalName();
+    if(pElLName1==_L8("Parent1"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenXmlElement* pParent2=CSenXmlElement::NewL(_L8("Parent2"));
+    pParent1->SetParent(pParent2);
+    const MSenElement& pElRoot2=pElement->Root();
+    const TDesC8& pElLName2=pElRoot2.LocalName();
+	const MSenElement& pParRoot=pParent1->Root();
+    const TDesC8& pParLName=pParRoot.LocalName();
+    if(pElLName2==_L8("Parent2") && pParLName==_L8("Parent2"))
+    	Flag=1;
+    else
+    	Flag=0;
+        
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    delete pParent1;
+    delete pParent2;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ElementL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    CSenElement* element=pParent->Element(_L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+    if(!(element->LocalName()==_L8("Nokia1")))
+    return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_CreateElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("nsuri"));
+    CSenElement* pNewElement=pElement->CreateElementL(_L8("N"),_L8("Nokia"));
+    CleanupStack::PushL(pNewElement);
+    HBufC8* ElementBuf=pNewElement->AsXmlL();
+/*    EUNIT_ASSERT_EQUALS(*ElementBuf,_L8("<N:Nokia xmlns:N=\"nsuri\"/>"));*/
+    TL(*ElementBuf == _L8("<N:Nokia xmlns:N=\"nsuri\"/>"));
+    CleanupStack::PopAndDestroy(pNewElement);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_InsertElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    
+     TBool Flag;
+     CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+     CleanupStack::PushL(pParent);
+     CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Nokia1"));
+     CleanupStack::PushL(pElement1);
+     CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Nokia2"));
+     CleanupStack::PushL(pElement2);
+     CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Nokia3"));
+     CleanupStack::PushL(pElement3);
+     CSenXmlElement* pElement5=CSenXmlElement::NewL(_L8("Nokia5"));
+     CleanupStack::PushL(pElement5);
+     pParent->AddElementL(*pElement1);
+     pParent->AddElementL(*pElement2);
+     pParent->AddElementL(*pElement3);
+     pParent->AddElementL(*pElement5);
+     CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Nokia4"));
+     CleanupStack::PushL(pElement4);
+     pParent->InsertElementL(*pElement4,*pElement5);
+     RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+     const TDesC8& localName=elementList[3]->LocalName();
+     if(localName==_L8("Nokia4"))
+     	Flag=1;
+     else
+     	Flag=0;
+         /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+     CleanupStack::Pop(pElement4);
+	 CleanupStack::Pop(pElement5);
+     CleanupStack::Pop(pElement3);
+     CleanupStack::Pop(pElement2);
+     CleanupStack::Pop(pElement1);
+     CleanupStack::PopAndDestroy(pParent); 
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    CSenElement& newElement=pParent->AddElementL(*pElement);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName();
+    const TDesC8& localName1=newElement.LocalName();    
+    if(localName==_L8("nokia") && elementList.Count()==1 )//&& newElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::Pop(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddElementL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    if(localName==_L8("element") && elementList.Count()==1 )
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddElementL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddElementL_3L (TTestResult& aResult)
+    {
+    SetupL();
+	TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"),_L8("e:element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_RemoveElementL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool TFlag;
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4);
+    //true case
+    CSenElement* pRmdElement=pParent->RemoveElement(*pElement3);
+    const TDesC8& localName=pRmdElement->LocalName();
+    /*CSenElement* pParElement=pElement3->Parent();//intentional
+    const TDesC8& localnmae1=pParElement->LocalName();*/
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    if(localName==_L8("Element3") && elList.Count()==3 )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+    
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pRmdElement;
+    //delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_RemoveElement_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    pParent->AddElementL(_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("element1"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    if(pRmdElement->LocalName()==_L8("element1") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("none"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+    if(!FFlag)
+    return KErrArgument;  
+
+	CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	//delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_RemoveElement_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("nsuri1"),_L8("element1"));
+    pParent->AddElementL(_L8("nsuri2"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri2a"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri4"),_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("nsuri2a"),_L8("element2"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    const TDesC8& localName=pRmdElement->LocalName();
+    const TDesC8& nsURI=pRmdElement->NamespaceURI();
+    if(localName==_L8("element2") && nsURI==_L8("nsuri2a") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("element1"),_L8("nothing"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+    if(!FFlag)
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	delete pRmdElement1;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ReplaceElementLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    _LIT8(KNewElement,"<a:Element1 xmlns:a=\"nsuria\"><subelement1/>New content</a:Element1>");
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    //true case
+    CSenXmlElement* pNewElement=CSenXmlElement::NewL(_L8("Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement);
+    pNewElement->AddElementL(_L8("subelement1"));
+    pNewElement->SetContentL(_L8("New content"));
+    CSenElement* pReplacedElement=pParent->ReplaceElementL(*pNewElement);
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    HBufC8* pRepBuf=elList[(elList.Count()-1)]->AsXmlL();
+    if(pReplacedElement!=NULL && elList.Count()==4 && 
+    	elList[(elList.Count()-1)]->LocalName()==_L8("Element1") && 
+    	*pRepBuf==KNewElement && elList[(elList.Count()-1)]->Content()==_L8("New content") )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    //False case
+    CSenXmlElement* pNewElement1=CSenXmlElement::NewL(_L8("New Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement1);
+    CSenElement* pReplacedElement1=pParent->ReplaceElementL(*pNewElement1);
+    RPointerArray<CSenElement>& elList1=pParent->ElementsL();
+    if(pReplacedElement1==NULL && elList1.Count()==5)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+    if(!FFlag)
+    return KErrArgument;  
+
+    CleanupStack::Pop(pNewElement1);
+    CleanupStack::Pop(pNewElement);
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pReplacedElement;
+    delete pRepBuf;
+    delete pReplacedElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AsXmlLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC8* parBuf=pParent->AsXmlL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AsXmlUnicodeLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC* parBuf=pParent->AsXmlUnicodeL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_CopyFromLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("xml element"));
+    CleanupStack::PushL(pElement);
+    pElement->AddElementL(_L8("child1"));
+    pElement->AddElementL(_L8("child2"));
+    pElement->SetContentL(_L8("element content"));
+    pElement->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    CSenXmlElement* pCopied=CSenXmlElement::NewL(_L8("copied element"));
+    CleanupStack::PushL(pCopied);
+    pCopied->SetContentL(_L8("copy content"));
+    pCopied->AddElementL(_L8("child1"));
+    pCopied->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    pCopied->CopyFromL(*pElement);
+    const TDesC8& content=pCopied->Content();
+    const RPointerArray<CSenElement>& copElList=pCopied->ElementsL();
+    const RPointerArray<CSenNamespace>& copNSList=pCopied->NamespacesL();
+    if(copElList.Count()==3 && copNSList.Count()==2)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pCopied);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_DetachLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    CSenElement* dElement=pElement1->DetachL();
+    const RPointerArray<CSenElement>& elList=pParent->ElementsL();
+/*    EUNIT_ASSERT( elList.Count()==3 );*/
+    if(!( elList.Count()==3 ))
+    return KErrArgument;  
+
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete dElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_ChildL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    CSenXmlElement*pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    CSenElement* pElement=pParent->Child(0);
+    if(pElement->LocalName()==_L8("element1"))
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    CSenElement* pElement1=pParent->Child(4);
+    if(pElement1==NULL)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT( FFlag );*/
+    if(!FFlag)
+    return KErrArgument;  
+    
+    
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_SetL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->Set(_L8("nsuri"),_L8("element"),_L8("e:e:lement"));
+    if(pElement->LocalName()==_L8("element") && pElement->NamespaceURI()==_L8("nsuri") 
+    		&& pElement->NsPrefix()==_L8("e"))
+    		Flag=1;
+    else
+    		Flag=0;
+    
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlElement_AddAttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenXmlElement *pElement = CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+/*    EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;  
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+/*    
+TInt CSenXmlBCTest::CSenXmlElement_RemoveAttributeLL (TTestResult& aResult)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenXmlElement *pElement = CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    CSenBaseAttribute* RmdElement=pElement->RemoveAttributeL(_L8("pr:LocalName"));
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    RPointerArray<CSenBaseAttribute>& AttrList=pElement->AttributesL();
+    EUNIT_ASSERT( *pElementBuf == _L8("<Nokia/>" ));
+    EUNIT_ASSERT_EQUALS(AttrList.Count(),0);
+    TL(AttrList.Count() == 0);
+   	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+	delete RmdElement;
+    Teardown();
+    return KErrNone;
+    }
+*/
+TInt CSenXmlBCTest::CSenXmlElement_AsElementL(TTestResult& aResult)
+	{
+    SetupL();
+	CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	MSenElement* pAsElement=pElement->AsElement();
+	HBufC8* pElementBuf=pElement->AsXmlL();
+/*	EUNIT_ASSERT_EQUALS(*pElementBuf,_L8("<Nokia><webservices/></Nokia>"));*/
+	TL(*pElementBuf == _L8("<Nokia><webservices/></Nokia>"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete pElementBuf;
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenBaseFragment_NewL_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(*ele);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenBaseFragment_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseFragment_NewL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenBaseFragment_NewL_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseFragment_NewL_4L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseFragment_NewL_5L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs, *parent);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenBaseFragment_AsXmlUnicodeLL(TTestResult& aResult)
+	{
+    SetupL();
+	CSenBaseFragment* pFragment=CSenBaseFragment::NewL(_L8("Fragment"));
+	CleanupStack::PushL(pFragment);
+	HBufC* pFragBuf=pFragment->AsXmlUnicodeL();
+/*	EUNIT_ASSERT_EQUALS(*pFragBuf,_L("<Fragment/>"));*/
+	TL(*pFragBuf == _L("<Fragment/>"));
+	CleanupStack::PopAndDestroy(pFragment);
+	delete pFragBuf;
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenBaseFragment_WriteAsXMLToLL(TTestResult& aResult)
+    {
+    SetupL();
+    // Test serialization of Dom tree which has two child elements
+    CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    CSenElement& element = pFragment->AsElement();
+    CSenElement& element2 = element.AddElementL(_L8("Child"));
+    CBufFlat* pBuf = CBufFlat::NewL(200);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+    pFragment->WriteAsXMLToL(bufWs);
+/*    EUNIT_ASSERT( pBuf->Ptr(0) == _L8("<Test><Child/></Test>"));*/
+    if(!( pBuf->Ptr(0) == _L8("<Test><Child/></Test>")))
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(&bufWs);
+    CleanupStack::PopAndDestroy(pBuf);
+    CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenBaseFragment_ContentL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_Content = pFragment->Content();
+    if(frag_Content == _L8("Test Content"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_NamespaceL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuria"),_L8("Test"),_L8("a:Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_NameSpace = pFragment->NsUri();
+    TPtrC8 frag_prefix = pFragment->NsPrefix();
+    if(frag_NameSpace == _L8("nsuria") && frag_prefix == _L8("a"))
+    	Flag = 1;
+    else
+    	Flag = 0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_EnsureNamespaceL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuria"),_L8("Test"),_L8("a:Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    pFragment->EnsureNamespace(_L8("a"));
+    CSenNamespace* frag_NameSpace;
+    frag_NameSpace = pFragment->Namespace(_L8("a"));
+    if(frag_NameSpace)
+    	Flag = 1;
+    else
+    	Flag = 0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_DetachLL( TTestResult& aResult )
+	{
+	TBool Flag;
+	_LIT8(KFragment,"<Test xmlns=\"nsuri\"><Child/>Test Content</Test>");
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    element.SetParent(pParent);
+    TRAPD(retval,pFragment->DetachL());
+    CleanupStack::PopAndDestroy(pFragment);
+    return retval;
+	}	
+TInt CSenXmlBCTest::CSenBaseFragment_SaveNamespacesLL( TTestResult& aResult )
+	{
+    TBool Flag;
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("xmlns"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseFragment *pFragment = CSenBaseFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pFragment);
+    pFragment->SaveNamespacesL(attrArray,TRUE);
+    TPtrC8 frag_NameSpace = pFragment->NsUri();
+    if(frag_NameSpace == _L8("Value"))
+    	Flag = 1;
+    else
+    	Flag = 0;
+
+	CleanupStack::PopAndDestroy(pFragment);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    if (Flag)	return KErrNone;
+    else return KErrArgument;
+    }
+TInt CSenXmlBCTest::CSenBaseFragment_ResetContentLL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_Content = pFragment->Content();
+    if(frag_Content == _L8("Test Content"))
+    	Flag =1;
+    else
+    	Flag =0;
+    pFragment->ResetContentL();
+    //frag_Content = pFragment->Content();
+	if(pFragment->Content() == KNullDesC8)
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_LocalNameL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_LocalName = pFragment->LocalName();
+    if(frag_LocalName == _L8("Test"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_NsUriL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_NsUri= pFragment->NsUri();
+    if(frag_NsUri == _L8("nsuri"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_NsPrefixL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_NsUri= pFragment->NsUri();
+    if(frag_NsUri == _L8("nsuri"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_ExtractElementL( TTestResult& aResult )
+	{
+	TBool Flag;
+	_LIT8(KFragment,"<Test xmlns=\"nsuri\"><Child/>Test Content</Test>");
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    CSenElement* Extr_Element = pFragment->ExtractElement();
+    CleanupStack::PushL(Extr_Element);
+    HBufC8* Ext_ElementBuf = Extr_Element->AsXmlL();
+    if(!(KFragment().Compare(*Ext_ElementBuf )))
+    	Flag =1;
+    else
+    	Flag =0;
+    
+    CleanupStack::PopAndDestroy(Extr_Element);
+    CleanupStack::PopAndDestroy(pFragment);
+    delete Ext_ElementBuf ;
+
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_SetAttributesLL( TTestResult& aResult )
+	{
+    TBool Flag;   
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("xmlns"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseFragment *pFragment = CSenBaseFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pFragment);
+    pFragment->SetAttributesL(attrArray);
+    TPtrC8 frag_NameSpace = pFragment->NsUri();
+    if(frag_NameSpace == _L8("Value"))
+    	Flag = 1;
+    else
+    	Flag = 0;
+
+	CleanupStack::PopAndDestroy(pFragment);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    if (Flag)	return KErrNone;
+    else return KErrArgument;
+    }
+TInt CSenXmlBCTest::CSenBaseFragment_ConsistsOfLL( TTestResult& aResult )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    
+    CSenBaseFragment* pFragment2 = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment2);
+	CSenElement& element2 = pFragment2->AsElement();
+    element2.AddElementL(_L8("Child"));
+    element2.SetContentL(_L8("Test Content"));
+    
+    Flag = pFragment->ConsistsOfL(*pFragment2);
+    
+    CleanupStack::PopAndDestroy(pFragment2);
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CSenXmlBCTest::CSenBaseFragment_ParseLL( TTestResult& aResult )	
+	{
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	
+	pFragment->SetReader(*iXmlReader);
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+    CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    return retVal;
+	}
+	
+TInt CSenXmlBCTest::CSenBaseFragment_ParseL1L( TTestResult& aResult )	
+	{
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;&#34;assa\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2<Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	
+	pFragment->SetReader(*iXmlReader);
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+	CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    if (retVal == -993) return KErrNone;
+    else return retVal;
+	}
+
+TInt CSenXmlBCTest::CSenBaseFragment_SetContentOfLL( TTestResult& aResult )
+{
+	CTestBaseFragment *pTestFragment = CTestBaseFragment::NewL(_L8("Test Fragment"));
+	CleanupStack::PushL(pTestFragment);
+	CSenElement& element = pTestFragment->AsElement();
+	element.AddElementL(_L8("Test Child"));
+	MSenElement& element1 = pTestFragment->SetContentOfL(_L8("Test Child"),_L8("Child Content"));
+	TInt retVal = element1.Content().Compare(_L8("Child Content"));
+	CleanupStack::PopAndDestroy(pTestFragment);
+	return retVal;
+}
+TInt CSenXmlBCTest::CSenBaseFragment_ContentOfL( TTestResult& aResult )
+{
+	CTestBaseFragment *pTestFragment = CTestBaseFragment::NewL(_L8("Test Fragment"));
+	CleanupStack::PushL(pTestFragment);
+	pTestFragment->SetContentOfL(_L8("Test Child"),_L8("Child Content"));
+	TInt retVal = pTestFragment->ContentOf(_L8("Test Child")).Compare(_L8("Child Content"));
+	CleanupStack::PopAndDestroy(pTestFragment);
+	return retVal;
+}
+
+TInt CSenXmlBCTest::CSenXMLReader_ParserFeatureL( TTestResult& aResult )
+	{
+	TBool Flag;
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">&lt;Content2&quot;&gt;</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	pFragment->SetReader(*iXmlReader);
+	TInt feature = iXmlReader->ParserFeature();
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+    CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    if (retVal == KErrNone && feature  == 64) return KErrNone;
+    else return KErrArgument;
+	}
+	
+//	EXPORT_C void CSenXmlReader::ParseL(RFs &aRFs, const TDesC& aFileToParse)
+
+TInt CSenXmlBCTest::CSenXMLReader_ParseLL( TTestResult& aResult )
+	{
+	SetupL();
+	CSenDomFragment* pFragment = CSenDomFragment::NewL();
+	CleanupStack::PushL(pFragment);
+	pFragment->SetReader(*iXmlReader);
+	iXmlReader->SetContentHandler(*pFragment);
+	_LIT(KFile,"c:\\wf_constraint_elem.xml");
+	RFs fs;
+	CleanupClosePushL(fs);
+	TRAPD(rFile, fs.Connect());
+	TRAPD(retVal,iXmlReader->ParseL(fs,KFile));
+	CleanupStack::PopAndDestroy();
+	CleanupStack::PopAndDestroy(pFragment);
+	Teardown();
+	return retVal;
+	}
+TInt CSenXmlBCTest::CSenDomFragment_NewL_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenDomFragment_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenDomFragment* pElement=CSenDomFragment::NewL(*ele);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+	
+TInt CSenXmlBCTest::CSenDomFragment_NewL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenDomFragment_NewL_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenDomFragment_NewL_4L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenDomFragment_NewL_5L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenDomFragment_NewL_6L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenDomFragment* pElement = CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs, *parent);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+/*	
+TInt CSenXmlBCTest::CSenDomFragment_ExpandLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    
+    CleanupStack::PushL(pElement);
+	pElement->ExpandL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenDomFragment_ResumeParsingFromLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    
+    CleanupStack::PushL(pElement);
+	pElement->ResumeParsingFromL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+*/    
+    TInt CSenXmlBCTest::CSenDomFragment_ParseWithLL (TTestResult& aResult)
+    {
+    SetupL();
+    CSenXmlReader* aReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(aReader);
+    
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->ParseWithL(*aReader);
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(aReader);
+    
+    Teardown();
+    return KErrNone;
+    }
+
+    TInt CSenXmlBCTest::CSenDomFragment_SetAttributesLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    pElement->SetAttributesL(aAttrs);
+    CleanupStack::PushL(pElement);
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenXmlBCTest::CSenDomFragment_ParseL1L( TTestResult& aResult )	
+	{
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;&#34;assa\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2<Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenDomFragment* pFragment = CSenDomFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	
+	pFragment->SetReader(*iXmlReader);
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+	CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    if (retVal == -993) return KErrNone;
+    else return retVal;
+	}    
+/*    
+TInt CSenXmlBCTest::CSenDomFragment_ConsistsOfLL()
+	{
+    SetupL();
+    CSenDomFragment* pFragmentA=CSenDomFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pFragmentA);
+    CSenElement pElement=pFragmentA->AsElement();
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    CSenDomFragment* pChildFragment1A=CSenDomFragment::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenDomFragment* pChild2A=CSenDomFragment::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AsElement()
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenDomFragment* pElementB=CSenDomFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenDomFragment* pChild1B=CSenDomFragment::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenDomFragment* pChild2B=CSenDomFragment::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+    EUNIT_ASSERT( ConsistOfFlag );
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+    Teardown();
+    return KErrNone;
+    }
+*/
+
+TInt CSenXmlBCTest::CSenNamespace_NewL_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewL(_L8("n:"),_L8("nsuri"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenNamespace_NewLC_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewLC(_L8("n:"),_L8("nsuri"));
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CSenXmlBCTest::CSenNamespace_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewL(_L8("nsuri"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CSenXmlBCTest::CSenNamespace_NewLC_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewLC(_L8("nsuri"));
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenNamespace_MatchesL_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement = CSenNamespace::NewL(_L8("nsuri"));
+    CSenNamespace* pEle = CSenNamespace::NewL(_L8("nsuri"));
+
+    CleanupStack::PushL(pElement);
+    CleanupStack::PushL(pEle);
+    
+    
+    if(pElement!=NULL && pEle!=NULL)
+    	Flag = pEle->MatchesL(*pElement);
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pEle);
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenNamespace_InsertLL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    const TInt KFlatBufSize = 64;
+	CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+	CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs); 
+      
+    CSenNamespace* pElement = CSenNamespace::NewL(_L8("nsuri"));
+    CleanupStack::PushL(pElement);
+	
+    pElement->InsertL(bufWs);
+    CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(); // bufWs.Close();
+    CleanupStack::PopAndDestroy(); // pBuf;    
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+    
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewL_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewL();
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    pElement = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewLC_L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC();
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewL_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(param);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewLC_1L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC(param);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewL_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(_L8(""));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewLC_2L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC(_L8(""));
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewL_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(_L8(""), param);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlReader_NewLC_3L (TTestResult& aResult)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC(_L8(""), param);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlReader_EnabledParserFeature_L (TTestResult& aResult)
+    {
+    SetupL();
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(param);
+    CleanupStack::PushL(pElement);
+/*    EUNIT_ASSERT_EQUALS(param,pElement->EnabledParserFeature());*/
+    TL(param == pElement->EnabledParserFeature());
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_ToUtf8LCL (TTestResult& aResult)
+    {
+    SetupL();
+    HBufC8* buf; 
+    
+    _LIT16(KText, "text");
+    _LIT8(KText1, "text");
+    buf = SenXmlUtils::ToUtf8LC(KText);
+    TPtr8 ptr = buf->Des();
+    TL(ptr == KText1);
+    CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;
+    }
+ 
+TInt CSenXmlBCTest::CSenXmlUtils_StartsWithL (TTestResult& aResult)
+    {
+    SetupL();
+    HBufC8* buf; 
+    TBool retVal;
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+    retVal = SenXmlUtils::StartsWith(KText, KText1);
+    TL(retVal == KErrNone);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlUtils_EndsWithL (TTestResult& aResult)
+    {
+    SetupL();
+    TBool retVal;
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+    retVal = SenXmlUtils::EndsWith(KText, KText1);
+    TL(retVal == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_AttrValueL (TTestResult& aResult)
+    {
+    SetupL();
+	RAttributeArray  array;   
+    _LIT8(KText, "text");
+    TPtrC8 ptr = SenXmlUtils::AttrValue(array, KText);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlUtils_AllocAttrValueLL(TTestResult& aResult)
+    {
+    SetupL();
+	RAttributeArray  array;   
+    _LIT8(KText, "text");
+    HBufC8* ptr = SenXmlUtils::AllocAttrValueL(array, KText);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_DecodeHttpCharactersLL(TTestResult& aResult)
+    {
+    SetupL();
+    TBool retVal;
+    HBufC8* ptr = NULL;
+    _LIT8(KText, "text");
+    retVal = SenXmlUtils::DecodeHttpCharactersL(KText, ptr);
+    TL(retVal == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+TInt CSenXmlBCTest::CSenXmlUtils_DecodeHttpCharactersLCL(TTestResult& aResult)
+    {
+    SetupL();
+    TBool retVal;
+    _LIT8(KText, "text");
+    HBufC8* buf = SenXmlUtils::DecodeHttpCharactersLC(KText);
+    TPtr8 ptr = buf->Des();
+    CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CSenXmlBCTest::CSenXmlUtils_NsPrefixL(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "m:");
+    _LIT8(KText1, "m");
+    
+    TPtrC8 ptr = SenXmlUtils::NsPrefix(KText);
+    //TL(ptr == KText1);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_LocalNameL(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "http:\\");
+    _LIT8(KText1, "\\");
+    TPtrC8 ptr = SenXmlUtils::LocalName(KText);
+    //TL(ptr == KText1);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_RemoveAttributeLL(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	CSenBaseAttribute* attr = CSenBaseAttribute::NewL(KText, KText1);
+    attr = SenXmlUtils::RemoveAttributeL(*element, KText);
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_RemoveAttributeL1L(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	CSenBaseAttribute* attr = CSenBaseAttribute::NewL(KText, KText1);
+	CSenBaseAttribute* attr1 = CSenBaseAttribute::NewL(KText, KText1);
+	
+	
+    attr = SenXmlUtils::RemoveAttributeL(*element, attr1);
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_AddAttributeLL(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	
+    TDesC8 desc = SenXmlUtils::AddAttributeL(*element, KText,  KText , KText );
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CSenXmlBCTest::CSenXmlUtils_AddAttributeL1L(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+    TDesC8 desc = SenXmlUtils::AddAttributeL(*element, KText,  KText );
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenXmlUtils_AddAttributeL2L(TTestResult& aResult)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	CSenBaseAttribute* attr = CSenBaseAttribute::NewL(KText, KText1);
+	
+    TDesC8 desc = SenXmlUtils::AddAttributeL(*element, attr);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CSenXmlBCTest::CSenXmlUtils_EncodeHttpCharactersLCL(TTestResult& aResult)
+    {
+    SetupL();
+    TBool retVal;
+    _LIT8(KText, "text");
+    HBufC8* buf = SenXmlUtils::EncodeHttpCharactersLC(KText);
+    //TPtr8 ptr = buf->Des();
+    CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CSenXmlBCTest::CSenDomFragment_BaseConstructL( TTestResult& aResult )
+{
+	    SetupL();
+
+	CTestDomFragment *pTestFragment = CTestDomFragment::NewL(_L8("Test Fragment"));
+	TInt retVal = 0;
+    CSenXmlReader* aReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(aReader);
+
+	CleanupStack::PushL(pTestFragment);
+	pTestFragment->BaseConstructL(*aReader);
+	CleanupStack::PopAndDestroy(pTestFragment);
+    CleanupStack::PopAndDestroy(aReader);
+	
+	    Teardown();
+
+	return retVal;
+}
+
+TInt CSenXmlBCTest::CSenBaseFragment_BaseConstructL( TTestResult& aResult )
+{
+	    SetupL();
+
+	CTestBaseFragment *pTestFragment = CTestBaseFragment::NewL(_L8("Test Fragment"));
+	TInt retVal = 0;
+    CSenXmlReader* aReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(aReader);
+
+	CleanupStack::PushL(pTestFragment);
+	pTestFragment->BaseConstructL(*aReader);
+	CleanupStack::PopAndDestroy(pTestFragment);
+    CleanupStack::PopAndDestroy(aReader);
+	
+	    Teardown();
+
+	return retVal;
+}
+//  END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxml/src/testxml.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include "Testxml.h"
+
+CTestBaseFragment* CTestBaseFragment::NewL(const TDesC8& aLocalName)
+{
+	return((CTestBaseFragment*)CSenBaseFragment::NewL(aLocalName));
+}
+
+CTestBaseFragment::~CTestBaseFragment()
+{
+	
+}
+
+MSenElement& CTestBaseFragment::SetContentOfL(const TDesC8& aLocalName,const TDesC8& aContent)
+{
+	return(CSenBaseFragment::SetContentOfL(aLocalName,aContent));
+}
+
+TPtrC8 CTestBaseFragment::ContentOf(const TDesC8& aLocalName)
+{
+	return(CSenBaseFragment::ContentOf(aLocalName));
+}
+
+void CTestBaseFragment::BaseConstructL(CSenXmlReader& aReader)
+{
+	return(CSenBaseFragment::BaseConstructL(aReader));
+}
+
+
+CTestDomFragment* CTestDomFragment::NewL(const TDesC8& aLocalName)
+{
+	return((CTestDomFragment*)CSenDomFragment::NewL(aLocalName));
+}
+
+
+void CTestDomFragment::BaseConstructL(CSenXmlReader& aReader)
+{
+	return(CSenDomFragment::BaseConstructL(aReader));
+}
+
+
+CTestBaseElement* CTestBaseElement::NewL(const TDesC8& aLocalName)
+{
+	return((CTestBaseElement*)CSenBaseElement::NewL(aLocalName));
+}
+
+
+const TDesC8& CTestBaseElement::AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue)
+{
+	return(CSenBaseElement::AddAttributeL(aAttrName, aValue));
+}
+
+
+CTestBaseElement::~CTestBaseElement()
+{
+	
+}
+
+CTestXmlElement* CTestXmlElement::NewL(const TDesC8& aLocalName)
+{
+	return((CTestXmlElement*)CSenXmlElement::NewL(aLocalName));
+}
+
+
+const TDesC8& CTestXmlElement::AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue)
+{
+	return(CSenXmlElement::AddAttributeL(aAttrName, aValue));
+}
+
+
+CTestXmlElement::~CTestXmlElement()
+{
+	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/Bmarm/senxmlTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/Bwins/senxmlTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/conf/senxmlTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,1372 @@
+[Test]
+title NewL-CSenBaseAttribute
+create senxmlTester obj 
+obj NewL-CSenBaseAttribute 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseAttribute
+create senxmlTester obj 
+obj NewL-CSenBaseAttribute 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseElement
+create senxmlTester obj 
+obj NewL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseElement
+create senxmlTester obj 
+obj NewL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseElement
+create senxmlTester obj 
+obj NewL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseElement
+create senxmlTester obj 
+obj NewL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseElement
+create senxmlTester obj 
+obj NewL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetAttributesL-CSenBaseElement
+create senxmlTester obj 
+obj SetAttributesL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title LocalName-CSenBaseElement
+create senxmlTester obj 
+obj LocalName-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NamespaceURI-CSenBaseElement
+create senxmlTester obj 
+obj NamespaceURI-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NsPrefix-CSenBaseElement
+create senxmlTester obj 
+obj NsPrefix-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPrefixL-CSenBaseElement
+create senxmlTester obj 
+obj SetPrefixL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasContentTrue-CSenBaseElement
+create senxmlTester obj 
+obj HasContentTrue-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasContentFalse-CSenBaseElement
+create senxmlTester obj 
+obj HasContentFalse-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Content-CSenBaseElement
+create senxmlTester obj 
+obj Content-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ContentNull-CSenBaseElement
+create senxmlTester obj 
+obj ContentNull-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ContentUnicodeL-CSenBaseElement
+create senxmlTester obj 
+obj ContentUnicodeL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContentL-CSenBaseElement
+create senxmlTester obj 
+obj SetContentL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContentNullL-CSenBaseElement
+create senxmlTester obj 
+obj SetContentNullL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContentoverrightL-CSenBaseElement
+create senxmlTester obj 
+obj SetContentoverrightL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContentEscCharL-CSenBaseElement
+create senxmlTester obj 
+obj SetContentEscCharL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsistsOfL-CSenBaseElement
+create senxmlTester obj 
+obj ConsistsOfL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceL-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespaceL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceNullL-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespaceNullL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceL-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespaceL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespace2SameL-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespace2SameL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespace2DiffL-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespace2DiffL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceDPSUL-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespaceDPSUL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceSameNsforPC1L-CSenBaseElement
+create senxmlTester obj 
+obj SetNamespaceSameNsforPC1L-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespace_FalseL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespace_FalseL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespace_TrueL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespace_TrueL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespace_TrueSameParentNSL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespace_TrueSameParentNSL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespace_TrueDiffParentNSL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespace_TrueDiffParentNSL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespaceL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespaceL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespace2SameL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespace2SameL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespace2DiffL-CSenBaseElement
+create senxmlTester obj 
+obj AddNamespace2DiffL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenBaseElement
+create senxmlTester obj 
+obj Namespace-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenBaseElement
+create senxmlTester obj 
+obj Namespace-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace_with_parent1-CSenBaseElement
+create senxmlTester obj 
+obj Namespace_with_parent1-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-test2-CSenBaseElement
+create senxmlTester obj 
+obj Namespace-test2-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-test3-CSenBaseElement
+create senxmlTester obj 
+obj Namespace-test3-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ElementsL-CSenBaseElement
+create senxmlTester obj 
+obj ElementsL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AttributesL-CSenBaseElement
+create senxmlTester obj 
+obj AttributesL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NamespacesL-CSenBaseElement
+create senxmlTester obj 
+obj NamespacesL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AttrValue-CSenBaseElement
+create senxmlTester obj 
+obj AttrValue-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttrL-CSenBaseElement
+create senxmlTester obj 
+obj AddAttrL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttributeL-CSenBaseElement
+create senxmlTester obj 
+obj AddAttributeL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Parent-CSenBaseElement
+create senxmlTester obj 
+obj Parent-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetParent-CSenBaseElement
+create senxmlTester obj 
+obj SetParent-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Root-CSenBaseElement
+create senxmlTester obj 
+obj Root-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Element-CSenBaseElement
+create senxmlTester obj 
+obj Element-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Elements1-CSenBaseElement
+create senxmlTester obj 
+obj Elements1-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Elements2-CSenBaseElement
+create senxmlTester obj 
+obj Elements2-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title CreateElementL-CSenBaseElement
+create senxmlTester obj 
+obj CreateElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title InsertElementL-CSenBaseElement
+create senxmlTester obj 
+obj InsertElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title InsertElement_No_BeforeElementL-CSenBaseElement
+create senxmlTester obj 
+obj InsertElement_No_BeforeElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenBaseElement
+create senxmlTester obj 
+obj AddElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenBaseElement
+create senxmlTester obj 
+obj AddElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenBaseElement
+create senxmlTester obj 
+obj AddElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenBaseElement
+create senxmlTester obj 
+obj AddElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveElement-CSenBaseElement
+create senxmlTester obj 
+obj RemoveElement-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveElement-CSenBaseElement
+create senxmlTester obj 
+obj RemoveElement-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveElement-CSenBaseElement
+create senxmlTester obj 
+obj RemoveElement-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ReplaceElementL-CSenBaseElement
+create senxmlTester obj 
+obj ReplaceElementL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlL-CSenBaseElement
+create senxmlTester obj 
+obj AsXmlL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlUnicodeL-CSenBaseElement
+create senxmlTester obj 
+obj AsXmlUnicodeL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title CopyFromL-CSenBaseElement
+create senxmlTester obj 
+obj CopyFromL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title DetachL-CSenBaseElement
+create senxmlTester obj 
+obj DetachL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Child-CSenBaseElement
+create senxmlTester obj 
+obj Child-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Set-CSenBaseElement
+create senxmlTester obj 
+obj Set-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttributesL-CSenBaseElement
+create senxmlTester obj 
+obj AddAttributesL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsElement-CSenBaseElement
+create senxmlTester obj 
+obj AsElement-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ContentWriteStreamL-CSenBaseElement
+create senxmlTester obj 
+obj ContentWriteStreamL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveAttributeL-CSenBaseElement
+create senxmlTester obj 
+obj RemoveAttributeL-CSenBaseElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlElement
+create senxmlTester obj 
+obj NewL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlElement
+create senxmlTester obj 
+obj NewL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlElement
+create senxmlTester obj 
+obj NewL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetAttributesL-CSenXmlElement
+create senxmlTester obj 
+obj SetAttributesL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title LocalName-CSenXmlElement
+create senxmlTester obj 
+obj LocalName-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NamespaceURI-CSenXmlElement
+create senxmlTester obj 
+obj NamespaceURI-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NsPrefix-CSenXmlElement
+create senxmlTester obj 
+obj NsPrefix-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetPrefixL-CSenXmlElement
+create senxmlTester obj 
+obj SetPrefixL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title HasContent-CSenXmlElement
+create senxmlTester obj 
+obj HasContent-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Content-CSenXmlElement
+create senxmlTester obj 
+obj Content-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ContentWriteStreamL-CSenXmlElement
+create senxmlTester obj 
+obj ContentWriteStreamL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ContentUnicodeL-CSenXmlElement
+create senxmlTester obj 
+obj ContentUnicodeL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContentL-CSenXmlElement
+create senxmlTester obj 
+obj SetContentL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsistsOfL-CSenXmlElement
+create senxmlTester obj 
+obj ConsistsOfL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsistsOfL-CSenXmlElement
+create senxmlTester obj 
+obj ConsistsOfL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsistsOfL-Extratest_CSenXmlElement
+create senxmlTester obj 
+obj ConsistsOfL-Extratest_CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceL-CSenXmlElement
+create senxmlTester obj 
+obj SetNamespaceL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceL-CSenXmlElement
+create senxmlTester obj 
+obj SetNamespaceL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceL-Sametest_CSenXmlElement
+create senxmlTester obj 
+obj SetNamespaceL-Sametest_CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetNamespaceL-Difftest_CSenXmlElement
+create senxmlTester obj 
+obj SetNamespaceL-Difftest_CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespaceL-CSenXmlElement
+create senxmlTester obj 
+obj AddNamespaceL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddNamespaceL-CSenXmlElement
+create senxmlTester obj 
+obj AddNamespaceL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenXmlElement
+create senxmlTester obj 
+obj Namespace-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenXmlElement
+create senxmlTester obj 
+obj Namespace-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenXmlElement
+create senxmlTester obj 
+obj Namespace-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenXmlElement
+create senxmlTester obj 
+obj Namespace-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ElementsL-CSenXmlElement
+create senxmlTester obj 
+obj ElementsL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AttributesL-CSenXmlElement
+create senxmlTester obj 
+obj AttributesL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AttributeLL-CSenXmlElement
+create senxmlTester obj 
+obj AttributeLL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NamespacesL-CSenXmlElement
+create senxmlTester obj 
+obj NamespacesL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AttrValue-CSenXmlElement
+create senxmlTester obj 
+obj AttrValue-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttrL-CSenXmlElement
+create senxmlTester obj 
+obj AddAttrL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Parent-CSenXmlElement
+create senxmlTester obj 
+obj Parent-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetParent-CSenXmlElement
+create senxmlTester obj 
+obj SetParent-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Root-CSenXmlElement
+create senxmlTester obj 
+obj Root-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Element-CSenXmlElement
+create senxmlTester obj 
+obj Element-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title CreateElementL-CSenXmlElement
+create senxmlTester obj 
+obj CreateElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title InsertElementL-CSenXmlElement
+create senxmlTester obj 
+obj InsertElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenXmlElement
+create senxmlTester obj 
+obj AddElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenXmlElement
+create senxmlTester obj 
+obj AddElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenXmlElement
+create senxmlTester obj 
+obj AddElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddElementL-CSenXmlElement
+create senxmlTester obj 
+obj AddElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveElement-CSenXmlElement
+create senxmlTester obj 
+obj RemoveElement-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveElement-CSenXmlElement
+create senxmlTester obj 
+obj RemoveElement-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveElement-CSenXmlElement
+create senxmlTester obj 
+obj RemoveElement-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title ReplaceElementL-CSenXmlElement
+create senxmlTester obj 
+obj ReplaceElementL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlL-CSenXmlElement
+create senxmlTester obj 
+obj AsXmlL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlUnicodeL-CSenXmlElement
+create senxmlTester obj 
+obj AsXmlUnicodeL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title CopyFromL-CSenXmlElement
+create senxmlTester obj 
+obj CopyFromL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title DetachL-CSenXmlElement
+create senxmlTester obj 
+obj DetachL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Child-CSenXmlElement
+create senxmlTester obj 
+obj Child-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title Set-CSenXmlElement
+create senxmlTester obj 
+obj Set-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttributesL-CSenXmlElement
+create senxmlTester obj 
+obj AddAttributesL-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsElement-CSenXmlElement
+create senxmlTester obj 
+obj AsElement-CSenXmlElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseFragment
+create senxmlTester obj 
+obj NewL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseFragment
+create senxmlTester obj 
+obj NewL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseFragment
+create senxmlTester obj 
+obj NewL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseFragment
+create senxmlTester obj 
+obj NewL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseFragment
+create senxmlTester obj 
+obj NewL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenBaseFragment
+create senxmlTester obj 
+obj NewL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title AsXmlUnicodeL-CSenBaseFragment
+create senxmlTester obj 
+obj AsXmlUnicodeL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title WriteAsXMLToL-CSenBaseFragment
+create senxmlTester obj 
+obj WriteAsXMLToL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title Content-CSenBaseFragment
+create senxmlTester obj 
+obj Content-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title Namespace-CSenBaseFragment
+create senxmlTester obj 
+obj Namespace-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title EnsureNamespace-CSenBaseFragment
+create senxmlTester obj 
+obj EnsureNamespace-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title DetachL-CSenBaseFragment
+create senxmlTester obj 
+obj DetachL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title SaveNamespacesLL-CSenBaseFragment
+create senxmlTester obj 
+obj SaveNamespacesLL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ResetContentLL-CSenBaseFragment
+create senxmlTester obj 
+obj ResetContentLL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title LocalNameL-CSenBaseFragment
+create senxmlTester obj 
+obj LocalNameL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NsUriL-CSenBaseFragment
+create senxmlTester obj 
+obj NsUriL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NsPrefixL-CSenBaseFragment
+create senxmlTester obj 
+obj NsPrefixL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ExtractElementL-CSenBaseFragment
+create senxmlTester obj 
+obj ExtractElementL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetAttributesL-CSenBaseFragment
+create senxmlTester obj 
+obj SetAttributesL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ConsistsOfL-CSenBaseFragment
+create senxmlTester obj 
+obj ConsistsOfL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParseL-CSenBaseFragment
+create senxmlTester obj 
+obj ParseL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ErrorParseL-CSenBaseFragment
+create senxmlTester obj 
+obj ErrorParseL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetContentOfL-CSenBaseFragment
+create senxmlTester obj 
+obj SetContentOfL-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ContentOf-CSenBaseFragment
+create senxmlTester obj 
+obj ContentOf-CSenBaseFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParserFeature-CSenXMLReader
+create senxmlTester obj 
+obj ParserFeature-CSenXMLReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParseL-CSenXMLReader
+create senxmlTester obj 
+obj ParseL-CSenXMLReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenDomFragment
+create senxmlTester obj 
+obj NewL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParseWithL-CSenDomFragment
+create senxmlTester obj 
+obj ParseWithL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title SetAttributesL-CSenDomFragment
+create senxmlTester obj 
+obj SetAttributesL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title ParseL1-CSenDomFragment
+create senxmlTester obj 
+obj ParseL1-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenNamespace
+create senxmlTester obj 
+obj NewL-CSenNamespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenNamespace
+create senxmlTester obj 
+obj NewLC-CSenNamespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenNamespace
+create senxmlTester obj 
+obj NewL-CSenNamespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenNamespace
+create senxmlTester obj 
+obj NewLC-CSenNamespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title MatchesL-CSenNamespace
+create senxmlTester obj 
+obj MatchesL-CSenNamespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title InsertL-CSenNamespace
+create senxmlTester obj 
+obj InsertL-CSenNamespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlReader
+create senxmlTester obj 
+obj NewL-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlReader
+create senxmlTester obj 
+obj NewLC-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlReader
+create senxmlTester obj 
+obj NewL-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlReader
+create senxmlTester obj 
+obj NewLC-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlReader
+create senxmlTester obj 
+obj NewL-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlReader
+create senxmlTester obj 
+obj NewLC-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewL-CSenXmlReader
+create senxmlTester obj 
+obj NewL-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title NewLC-CSenXmlReader
+create senxmlTester obj 
+obj NewLC-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title EnabledParserFeature-CSenXmlReader
+create senxmlTester obj 
+obj EnabledParserFeature-CSenXmlReader 
+delete obj 
+[Endtest] 
+
+[Test]
+title ToUtf8LC-CSenXmlUtils
+create senxmlTester obj 
+obj ToUtf8LC-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title StartsWith-CSenXmlUtils
+create senxmlTester obj 
+obj StartsWith-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title EndsWith-CSenXmlUtils
+create senxmlTester obj 
+obj EndsWith-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title AttrValue-CSenXmlUtils
+create senxmlTester obj 
+obj AttrValue-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title AllocAttrValueL-CSenXmlUtils
+create senxmlTester obj 
+obj AllocAttrValueL-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title DecodeHttpCharactersL-CSenXmlUtils
+create senxmlTester obj 
+obj DecodeHttpCharactersL-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title DecodeHttpCharactersLC-CSenXmlUtils
+create senxmlTester obj 
+obj DecodeHttpCharactersLC-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title NsPrefix-CSenXmlUtils
+create senxmlTester obj 
+obj NsPrefix-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title LocalName-CSenXmlUtils
+create senxmlTester obj 
+obj LocalName-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveAttributeL-CSenXmlUtils
+create senxmlTester obj 
+obj RemoveAttributeL-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title RemoveAttributeL1-CSenXmlUtils
+create senxmlTester obj 
+obj RemoveAttributeL1-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttributeL-CSenXmlUtils
+create senxmlTester obj 
+obj AddAttributeL-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttributeL1-CSenXmlUtils
+create senxmlTester obj 
+obj AddAttributeL1-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title AddAttributeL1-CSenXmlUtils
+create senxmlTester obj 
+obj AddAttributeL1-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title EncodeHttpCharactersLC-CSenXmlUtils
+create senxmlTester obj 
+obj EncodeHttpCharactersLC-CSenXmlUtils 
+delete obj 
+[Endtest] 
+
+[Test]
+title BaseConstructL-CSenDomFragment
+create senxmlTester obj 
+obj BaseConstructL-CSenDomFragment 
+delete obj 
+[Endtest] 
+
+[Test]
+title BaseConstructL-CSenBaseFragment 
+create senxmlTester obj 
+obj BaseConstructL-CSenBaseFragment  
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/eabi/senxmlTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senxmltester
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+senxmlTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senxmltester 
+*
+*/
+
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          senxmlTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         senxmlTester.def
+
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          senxmlTester.cpp
+SOURCE          senxmlTesterBlocks.cpp
+SOURCE					testxml.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+SYSTEMINCLUDE   /epoc32/include 
+SYSTEMINCLUDE   /epoc32/include/libc
+MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE
+LIBRARY         bafl.lib
+LIBRARY         charconv.lib
+LIBRARY         euser.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         SenXml.lib
+LIBRARY                 XMLFRAMEWORK.lib
+
+LANG            SC
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\senxmlTester.dll"   -   "c:\Sys\Bin\senxmlTester.dll"
+  
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\senxmlTester.cfg"-"c:\testing\conf\senxmlTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/inc/senxmlTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,659 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENXMLTESTER_H
+#define SENXMLTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <SenBaseAttribute.h>
+#include <SenBaseElement.h>
+#include <SenBaseFragment.h>
+#include <SenDomFragment.h>
+#include <SenElement.h>
+#include <SenNameSpace.h>
+#include <SenXmlElement.h>
+#include <SenXmlReader.h>
+#include <SenXmlUtils.h>
+#include <f32file.h>
+#include <e32debug.h>
+#include <e32std.h>
+#include <e32def.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+//  FORWARD DECLARATIONS
+class CSenBaseAttribute;
+class CSenElement;
+class CSenBaseFragment;
+class CSenNamespace;
+class SenXmlUtils;
+class CSenDomFragment;
+class CSenBaseElement;
+class CSenXmlReader;
+class CSenXmlElement;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KsenxmlTesterLogPath, "\\logs\\testframework\\senxmlTester\\" ); 
+// Log file
+_LIT( KsenxmlTesterLogFile, "senxmlTester.txt" ); 
+_LIT( KsenxmlTesterLogFileWithTitle, "senxmlTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CsenxmlTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+typedef TInt (CsenxmlTester::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+*  CsenxmlTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfoInternal
+    {
+    public:
+        const TText*    iCaseName;
+        TestFunction    iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A structure containing a test case name and
+*  the pointer to function doing the test
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+class TCaseInfo
+    {
+    public:
+        TPtrC iCaseName;
+        TestFunction iMethod;
+        TBool           iIsOOMTest;
+        TInt            iFirstMemoryAllocation;
+        TInt            iLastMemoryAllocation;
+
+    TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+        {
+        };
+
+    };
+
+NONSHARABLE_CLASS(CsenxmlTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CsenxmlTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CsenxmlTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CsenxmlTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+        const TCaseInfo Case ( const TInt aCaseNumber ) const;
+        
+        void SetupL();
+        void Teardown();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+         TInt CSenBaseAttribute_NewLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseAttribute_NewL_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_NewLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_NewL_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_NewL_2L( CStifItemParser& aItem );
+         
+         
+         TInt CSenBaseElement_NewL_3L( CStifItemParser& aItem );
+         
+         
+         TInt CSenBaseElement_NewL_4L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_SetAttributesLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_LocalNameL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_NamespaceURIL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_NsPrefixL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_SetPrefixLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_HasContentTL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_HasContentFL( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_ContentL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_Content_NullL( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_ContentUnicodeLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_SetContentLL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_SetContentL_NullL( CStifItemParser& aItem );        
+         
+         TInt CSenBaseElement_SetContentL_OverRightL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_SetContentL_WithEscCharsL( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_ConsistsOfLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_SetNamespaceLL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_SetNamespaceL_NullL( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_SetNamespaceL_1L( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_SetNamespaceL_2same1L( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_SetNamespaceL_2Diff1L( CStifItemParser& aItem );
+       
+         TInt CSenBaseElement_SetNamespaceL_DPSU1L( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_SetNamespaceL_SNsPC1L( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_AddNamespaceL_FL( CStifItemParser& aItem );        
+         
+         TInt CSenBaseElement_AddNamespaceL_TL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_AddNamespaceL_TSPL( CStifItemParser& aItem ); 
+         
+         TInt CSenBaseElement_AddNamespaceL_TDPL( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_AddNamespaceL_1L( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_AddNamespaceL_2same1L( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_AddNamespaceL_2Diff1L( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_NamespaceL( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_Namespace_1L( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_Namespace_WP1L( CStifItemParser& aItem );        
+        
+         TInt CSenBaseElement_Namespace_2L( CStifItemParser& aItem );
+        
+		 	        
+        
+         TInt CSenBaseElement_Namespace_3L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_ElementsLL( CStifItemParser& aItem );
+        
+        
+         
+        
+         TInt CSenBaseElement_AttributesLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_NamespacesLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AttrValueL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AddAttrLL( CStifItemParser& aItem );
+         TInt CSenBaseElement_AddAttributeLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_ParentL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_SetParentL( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_RootL( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_ElementL( CStifItemParser& aItem );
+		TInt CSenBaseElement_ElementsL1( CStifItemParser& aItem );
+         TInt CSenBaseElement_ElementsL2( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_CreateElementLL( CStifItemParser& aItem );
+     
+         TInt CSenBaseElement_InsertElementLL( CStifItemParser& aItem );
+         
+		 TInt CSenBaseElement_InsertElementL_NoBeforeL( CStifItemParser& aItem );                 
+        
+         TInt CSenBaseElement_AddElementLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AddElementL_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AddElementL_2L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AddElementL_3L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_RemoveElementL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_RemoveElement_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_RemoveElement_2L( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_ReplaceElementLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AsXmlLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_AsXmlUnicodeLL( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_CopyFromLL( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_DetachLL( CStifItemParser& aItem );
+        
+         TInt CSenBaseElement_ChildL( CStifItemParser& aItem );
+        
+        
+         TInt CSenBaseElement_SetL( CStifItemParser& aItem );
+         
+         
+         TInt CSenBaseElement_AddAttributesLL( CStifItemParser& aItem );
+         
+         TInt CSenBaseElement_AsElementL( CStifItemParser& aItem );
+         TInt CSenBaseElement_ContentWriteStreamLL( CStifItemParser& aItem );
+		 TInt CSenBaseElement_RemoveAttributeLL( CStifItemParser& aItem );
+         TInt CSenXmlElement_NewLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_NewL_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_NewL_2L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_SetAttributesLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_LocalNameL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_NamespaceURIL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_NsPrefixL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_SetPrefixLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_HasContentL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_ContentL( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_ContentWriteStreamLL( CStifItemParser& aItem );
+         
+        
+         TInt CSenXmlElement_ContentUnicodeLL( CStifItemParser& aItem );
+                
+         TInt CSenXmlElement_SetContentLL( CStifItemParser& aItem );        
+        
+         TInt CSenXmlElement_ConsistsOfLL( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_ConsistsOfL1L( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_ConsistsOfL2L( CStifItemParser& aItem );        
+        
+         TInt CSenXmlElement_SetNamespaceLL( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_SetNamespaceL_1L( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_SetNamespaceL_2same1L( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_SetNamespaceL_2Diff1L( CStifItemParser& aItem ) ;      
+        
+         TInt CSenXmlElement_AddNamespaceLL( CStifItemParser& aItem );
+         
+         TInt CSenXmlElement_AddNamespaceLFL( CStifItemParser& aItem );
+        
+         TInt CSenXmlElement_AddNamespaceL_1L( CStifItemParser& aItem );
+      
+        
+         TInt CSenXmlElement_NamespaceL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_Namespace_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_Namespace_2L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_Namespace_3L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_ElementsLL( CStifItemParser& aItem );
+                
+         TInt CSenXmlElement_AttributesLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_NamespacesLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AttrValueL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AddAttrLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_ParentL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_SetParentL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_RootL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_ElementL( CStifItemParser& aItem );
+        
+         TInt CSenXmlElement_CreateElementLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_InsertElementLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AddElementLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AddElementL_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AddElementL_2L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AddElementL_3L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_RemoveElementL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_RemoveElement_1L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_RemoveElement_2L( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_ReplaceElementLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AsXmlLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AsXmlUnicodeLL( CStifItemParser& aItem );
+        
+         TInt CSenXmlElement_CopyFromLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_DetachLL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_ChildL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_SetL( CStifItemParser& aItem );
+        
+        
+         TInt CSenXmlElement_AddAttributesLL( CStifItemParser& aItem );
+         TInt CSenXmlElement_AddAttributeLL( CStifItemParser& aItem );
+         TInt CSenXmlElement_RemoveAttributeLL( CStifItemParser& aItem );
+         TInt CSenXmlElement_AsElementL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_AsXmlUnicodeLL( CStifItemParser& aItem );
+         
+         TInt CSenBaseFragment_NewL_L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NewL_1L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NewL_2L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NewL_3L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NewL_4L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NewL_5L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_WriteAsXMLToLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ContentL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NamespaceL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_EnsureNamespaceL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_DetachLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_SaveNamespacesLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ResetContentLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_LocalNameL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NsUriL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_NsPrefixL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ExtractElementL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_SetAttributesLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ConsistsOfLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_AllocContentSaverLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ParseLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ParseL1L( CStifItemParser& aItem );
+         TInt CSenBaseFragment_SetContentOfLL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_ContentOfL( CStifItemParser& aItem );
+         TInt CSenXMLReader_ParserFeatureL( CStifItemParser& aItem );
+		 TInt CSenXMLReader_ParseLL( CStifItemParser& aItem );
+         TInt CSenDomFragment_ConsistsOfLL( CStifItemParser& aItem );
+         
+         TInt CSenDomFragment_NewL_L( CStifItemParser& aItem );
+         TInt CSenDomFragment_NewL_1L( CStifItemParser& aItem );
+         TInt CSenDomFragment_NewL_2L( CStifItemParser& aItem );
+         TInt CSenDomFragment_NewL_3L( CStifItemParser& aItem );
+         TInt CSenDomFragment_NewL_4L( CStifItemParser& aItem );
+         TInt CSenDomFragment_NewL_5L( CStifItemParser& aItem );
+         TInt CSenDomFragment_NewL_6L( CStifItemParser& aItem );
+         
+         //TInt CSenDomFragment_ExpandLL( CStifItemParser& aItem );
+         //TInt CSenDomFragment_ResumeParsingFromLL( CStifItemParser& aItem );
+         TInt CSenDomFragment_ParseWithLL( CStifItemParser& aItem );
+         TInt CSenDomFragment_SetAttributesLL( CStifItemParser& aItem );
+         TInt CSenDomFragment_ParseL1L( CStifItemParser& aItem );
+         
+         TInt CSenNamespace_NewL_L( CStifItemParser& aItem );
+         TInt CSenNamespace_NewLC_L( CStifItemParser& aItem );
+         TInt CSenNamespace_NewL_1L( CStifItemParser& aItem );
+         TInt CSenNamespace_NewLC_1L( CStifItemParser& aItem );
+         TInt CSenNamespace_MatchesL_L( CStifItemParser& aItem );
+         TInt CSenNamespace_InsertLL( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewL_L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewLC_L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewL_1L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewLC_1L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewL_2L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewLC_2L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewL_3L( CStifItemParser& aItem );
+         TInt CSenXmlReader_NewLC_3L( CStifItemParser& aItem );
+
+         TInt CSenXmlReader_EnabledParserFeature_L( CStifItemParser& aItem );        
+         
+         TInt CSenXmlUtils_ToUtf8LCL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_StartsWithL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_EndsWithL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_AttrValueL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_AllocAttrValueLL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_DecodeHttpCharactersLL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_DecodeHttpCharactersLCL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_NsPrefixL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_LocalNameL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_RemoveAttributeLL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_RemoveAttributeL1L( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_AddAttributeLL( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_AddAttributeL1L( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_AddAttributeL2L( CStifItemParser& aItem );        
+         TInt CSenXmlUtils_EncodeHttpCharactersLCL( CStifItemParser& aItem ); 
+         TInt CSenDomFragment_BaseConstructL( CStifItemParser& aItem );
+         TInt CSenBaseFragment_BaseConstructL( CStifItemParser& aItem );
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        // Pointer to test (function) to be executed
+        TestFunction iMethod;
+
+        // Pointer to logger
+        CStifLogger * iLog; 
+
+		CSenXmlReader* iXmlReader;
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // SENXMLTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/inc/testxml.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+#ifndef TESTXML_H
+#define TESTXML_H
+
+#include <e32std.h>
+#include <f32file.h>
+#include "SenBaseFragment.h"
+#include "SenDomFragment.h"
+#include "SenBaseElement.h"
+#include "SenXmlElement.h"
+
+
+class CTestBaseFragment:public CSenBaseFragment
+{
+public:    
+    static CTestBaseFragment* NewL(const TDesC8& aLocalName);
+    ~CTestBaseFragment();
+    
+	MSenElement& SetContentOfL(const TDesC8& aLocalName,const TDesC8& aContent);
+	TPtrC8 ContentOf(const TDesC8& aLocalName);        
+   void BaseConstructL(CSenXmlReader& aReader);
+
+private:
+
+    CTestBaseFragment();
+    
+};
+
+class CTestDomFragment:public CSenDomFragment
+{
+public:    
+   static CTestDomFragment* NewL(const TDesC8& aLocalName);
+   void BaseConstructL(CSenXmlReader& aReader);
+    ~CTestDomFragment();
+    	
+
+private:
+
+    CTestDomFragment();
+    
+};
+
+class CTestBaseElement:public CSenBaseElement
+{
+public:    
+   static CTestBaseElement* NewL(const TDesC8& aLocalName);
+   const TDesC8& AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue);
+    ~CTestBaseElement();
+    	
+
+private:
+
+    CTestBaseElement();
+    
+};
+
+class CTestXmlElement:public CSenXmlElement
+{
+public:    
+   static CTestXmlElement* NewL(const TDesC8& aLocalName);
+   const TDesC8& AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue);
+    ~CTestXmlElement();
+    	
+
+private:
+
+    CTestXmlElement();
+    
+};
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\senxmlTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/src/senxmlTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "senxmlTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenxmlTester::CsenxmlTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CsenxmlTester::CsenxmlTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CsenxmlTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CsenxmlTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KsenxmlTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KsenxmlTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KsenxmlTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CsenxmlTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CsenxmlTester* CsenxmlTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CsenxmlTester* self = new (ELeave) CsenxmlTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CsenxmlTester::~CsenxmlTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CsenxmlTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CsenxmlTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("senxmlTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CsenxmlTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/src/senxmlTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,5499 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include <e32math.h>
+#include <libc/assert.h>
+#include <e32panic.h>
+#include "testxml.h"
+#include "senxmlTester.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CsenxmlTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CsenxmlTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CsenxmlTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CsenxmlTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+		ENTRY("NewL-CSenBaseAttribute", CsenxmlTester::CSenBaseAttribute_NewLL),
+		ENTRY("NewL-CSenBaseAttribute", CsenxmlTester::CSenBaseAttribute_NewL_1L),
+		ENTRY("NewL-CSenBaseElement", CsenxmlTester::CSenBaseElement_NewLL),
+		ENTRY("NewL-CSenBaseElement", CsenxmlTester::CSenBaseElement_NewL_1L),
+		ENTRY("NewL-CSenBaseElement", CsenxmlTester::CSenBaseElement_NewL_2L),
+		ENTRY("NewL-CSenBaseElement", CsenxmlTester::CSenBaseElement_NewL_3L),
+		ENTRY("NewL-CSenBaseElement", CsenxmlTester::CSenBaseElement_NewL_4L),
+		ENTRY("SetAttributesL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetAttributesLL),
+		ENTRY("LocalName-CSenBaseElement",CsenxmlTester::CSenBaseElement_LocalNameL),
+		ENTRY("NamespaceURI-CSenBaseElement", CsenxmlTester::CSenBaseElement_NamespaceURIL),
+		ENTRY("NsPrefix-CSenBaseElement", CsenxmlTester::CSenBaseElement_NsPrefixL),
+		ENTRY("SetPrefixL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetPrefixLL),
+		ENTRY("HasContentTrue-CSenBaseElement", CsenxmlTester::CSenBaseElement_HasContentTL),
+		ENTRY("HasContentFalse-CSenBaseElement", CsenxmlTester::CSenBaseElement_HasContentFL),
+
+		ENTRY("Content-CSenBaseElement", CsenxmlTester::CSenBaseElement_ContentL),
+    
+		ENTRY("ContentNull-CSenBaseElement", CsenxmlTester::CSenBaseElement_Content_NullL),
+
+		ENTRY("ContentUnicodeL-CSenBaseElement", CsenxmlTester::CSenBaseElement_ContentUnicodeLL),
+
+		ENTRY("SetContentL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetContentLL),
+
+		ENTRY("SetContentNullL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetContentL_NullL),
+    
+		ENTRY("SetContentoverrightL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetContentL_OverRightL),
+    
+		ENTRY("SetContentEscCharL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetContentL_WithEscCharsL),
+
+		ENTRY("ConsistsOfL-CSenBaseElement", CsenxmlTester::CSenBaseElement_ConsistsOfLL),
+
+		ENTRY("SetNamespaceL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceLL),
+    
+		ENTRY("SetNamespaceNullL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceL_NullL),
+
+		ENTRY("SetNamespaceL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceL_1L),
+
+		ENTRY("SetNamespace2SameL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceL_2same1L),
+    
+		ENTRY("SetNamespace2DiffL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceL_2Diff1L),
+    
+		ENTRY("SetNamespaceDPSUL-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceL_DPSU1L),       
+    
+		ENTRY("SetNamespaceSameNsforPC1L-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetNamespaceL_SNsPC1L),           
+
+		ENTRY("AddNamespace_FalseL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_FL),
+    
+		ENTRY("AddNamespace_TrueL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_TL),    
+    
+		ENTRY("AddNamespace_TrueSameParentNSL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_TSPL),      
+    
+		ENTRY("AddNamespace_TrueDiffParentNSL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_TDPL),          
+
+		ENTRY("AddNamespaceL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_1L),
+
+		ENTRY("AddNamespace2SameL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_2same1L),
+    
+		ENTRY("AddNamespace2DiffL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddNamespaceL_2Diff1L),
+    
+		ENTRY("Namespace-CSenBaseElement", CsenxmlTester::CSenBaseElement_NamespaceL),
+    
+
+		ENTRY("Namespace-CSenBaseElement", CsenxmlTester::CSenBaseElement_Namespace_1L),
+    
+		ENTRY("Namespace_with_parent1-CSenBaseElement", CsenxmlTester::CSenBaseElement_Namespace_WP1L),
+
+		ENTRY("Namespace-test2-CSenBaseElement", CsenxmlTester::CSenBaseElement_Namespace_2L),
+    
+		ENTRY("Namespace-test3-CSenBaseElement", CsenxmlTester::CSenBaseElement_Namespace_3L),
+
+		ENTRY("ElementsL-CSenBaseElement", CsenxmlTester::CSenBaseElement_ElementsLL),
+
+		ENTRY("AttributesL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AttributesLL),
+
+		ENTRY("NamespacesL-CSenBaseElement", CsenxmlTester::CSenBaseElement_NamespacesLL),
+
+		ENTRY("AttrValue-CSenBaseElement", CsenxmlTester::CSenBaseElement_AttrValueL),
+
+		ENTRY("AddAttrL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddAttrLL),
+
+		ENTRY("AddAttributeL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddAttributeLL),		
+		ENTRY("Parent-CSenBaseElement", CsenxmlTester::CSenBaseElement_ParentL),
+
+		ENTRY("SetParent-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetParentL),
+
+		ENTRY("Root-CSenBaseElement", CsenxmlTester::CSenBaseElement_RootL),
+
+		ENTRY("Element-CSenBaseElement", CsenxmlTester::CSenBaseElement_ElementL),
+		ENTRY("Elements1-CSenBaseElement", CsenxmlTester::CSenBaseElement_ElementsL1),
+		ENTRY("Elements2-CSenBaseElement", CsenxmlTester::CSenBaseElement_ElementsL2),
+
+		ENTRY("CreateElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_CreateElementLL),
+
+		ENTRY("InsertElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_InsertElementLL),
+    
+		ENTRY("InsertElement_No_BeforeElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_InsertElementL_NoBeforeL),
+
+		ENTRY("AddElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddElementLL),
+
+		ENTRY("AddElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddElementL_1L),
+
+		ENTRY("AddElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddElementL_2L),
+
+		ENTRY("AddElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddElementL_3L),
+
+		ENTRY("RemoveElement-CSenBaseElement", CsenxmlTester::CSenBaseElement_RemoveElementL),
+
+		ENTRY("RemoveElement-CSenBaseElement", CsenxmlTester::CSenBaseElement_RemoveElement_1L),
+
+		ENTRY("RemoveElement-CSenBaseElement", CsenxmlTester::CSenBaseElement_RemoveElement_2L),
+
+		ENTRY("ReplaceElementL-CSenBaseElement", CsenxmlTester::CSenBaseElement_ReplaceElementLL),
+
+		ENTRY("AsXmlL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AsXmlLL),
+
+		ENTRY("AsXmlUnicodeL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AsXmlUnicodeLL),
+
+		ENTRY("CopyFromL-CSenBaseElement", CsenxmlTester::CSenBaseElement_CopyFromLL),
+
+		ENTRY("DetachL-CSenBaseElement", CsenxmlTester::CSenBaseElement_DetachLL),
+
+		ENTRY("Child-CSenBaseElement", CsenxmlTester::CSenBaseElement_ChildL),
+
+		ENTRY("Set-CSenBaseElement", CsenxmlTester::CSenBaseElement_SetL),
+    
+		ENTRY("AddAttributesL-CSenBaseElement", CsenxmlTester::CSenBaseElement_AddAttributesLL),
+
+		ENTRY("AsElement-CSenBaseElement", CsenxmlTester::CSenBaseElement_AsElementL),
+
+		ENTRY("ContentWriteStreamL-CSenBaseElement", CsenxmlTester::CSenBaseElement_ContentWriteStreamLL),
+    
+		ENTRY("RemoveAttributeL-CSenBaseElement", CsenxmlTester::CSenBaseElement_RemoveAttributeLL),
+
+		ENTRY("NewL-CSenXmlElement", CsenxmlTester::CSenXmlElement_NewLL),
+
+		ENTRY("NewL-CSenXmlElement", CsenxmlTester::CSenXmlElement_NewL_1L),
+
+		ENTRY("NewL-CSenXmlElement", CsenxmlTester::CSenXmlElement_NewL_2L),
+
+		ENTRY("SetAttributesL-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetAttributesLL),
+
+		ENTRY("LocalName-CSenXmlElement", CsenxmlTester::CSenXmlElement_LocalNameL),
+
+		ENTRY("NamespaceURI-CSenXmlElement", CsenxmlTester::CSenXmlElement_NamespaceURIL),
+
+		ENTRY("NsPrefix-CSenXmlElement", CsenxmlTester::CSenXmlElement_NsPrefixL),
+
+		ENTRY("SetPrefixL-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetPrefixLL),
+
+		ENTRY("HasContent-CSenXmlElement", CsenxmlTester::CSenXmlElement_HasContentL),
+
+		ENTRY("Content-CSenXmlElement", CsenxmlTester::CSenXmlElement_ContentL),
+		
+		ENTRY("ContentWriteStreamL-CSenXmlElement", CsenxmlTester::CSenXmlElement_ContentWriteStreamLL),
+		
+
+		ENTRY("ContentUnicodeL-CSenXmlElement", CsenxmlTester::CSenXmlElement_ContentUnicodeLL),
+
+		ENTRY("SetContentL-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetContentLL),
+
+		ENTRY("ConsistsOfL-CSenXmlElement", CsenxmlTester::CSenXmlElement_ConsistsOfLL),
+    
+		ENTRY("ConsistsOfL-CSenXmlElement", CsenxmlTester::CSenXmlElement_ConsistsOfL1L),
+    
+		ENTRY("ConsistsOfL-Extratest_CSenXmlElement", CsenxmlTester::CSenXmlElement_ConsistsOfL1L),
+
+		ENTRY("SetNamespaceL-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetNamespaceLL),
+
+		ENTRY("SetNamespaceL-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetNamespaceL_1L),
+    
+		ENTRY("SetNamespaceL-Sametest_CSenXmlElement", CsenxmlTester::CSenXmlElement_SetNamespaceL_2same1L),
+
+		ENTRY("SetNamespaceL-Difftest_CSenXmlElement", CsenxmlTester::CSenXmlElement_SetNamespaceL_2Diff1L),
+
+		ENTRY("AddNamespaceL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddNamespaceLL),
+
+		ENTRY("AddNamespaceL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddNamespaceL_1L),
+
+		ENTRY("Namespace-CSenXmlElement", CsenxmlTester::CSenXmlElement_NamespaceL),
+
+		ENTRY("Namespace-CSenXmlElement", CsenxmlTester::CSenXmlElement_Namespace_1L),
+
+		ENTRY("Namespace-CSenXmlElement", CsenxmlTester::CSenXmlElement_Namespace_2L),
+
+		ENTRY("Namespace-CSenXmlElement", CsenxmlTester::CSenXmlElement_Namespace_3L),
+
+		ENTRY("ElementsL-CSenXmlElement", CsenxmlTester::CSenXmlElement_ElementsLL),
+
+		ENTRY("AttributesL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AttributesLL),
+		ENTRY("AttributeLL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddAttributeLL),
+
+		ENTRY("NamespacesL-CSenXmlElement", CsenxmlTester::CSenXmlElement_NamespacesLL),
+
+		ENTRY("AttrValue-CSenXmlElement", CsenxmlTester::CSenXmlElement_AttrValueL),
+
+		ENTRY("AddAttrL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddAttrLL),
+
+		ENTRY("Parent-CSenXmlElement", CsenxmlTester::CSenXmlElement_ParentL),
+
+		ENTRY("SetParent-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetParentL),
+
+		ENTRY("Root-CSenXmlElement", CsenxmlTester::CSenXmlElement_RootL),
+
+		ENTRY("Element-CSenXmlElement", CsenxmlTester::CSenXmlElement_ElementL),
+
+		ENTRY("CreateElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_CreateElementLL),
+
+		ENTRY("InsertElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_InsertElementLL),
+
+		ENTRY("AddElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddElementLL),
+
+		ENTRY("AddElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddElementL_1L),
+
+		ENTRY("AddElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddElementL_2L),
+
+		ENTRY("AddElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddElementL_3L),
+
+		ENTRY("RemoveElement-CSenXmlElement", CsenxmlTester::CSenXmlElement_RemoveElementL),
+
+		ENTRY("RemoveElement-CSenXmlElement", CsenxmlTester::CSenXmlElement_RemoveElement_1L),
+
+		ENTRY("RemoveElement-CSenXmlElement", CsenxmlTester::CSenXmlElement_RemoveElement_2L),
+
+		ENTRY("ReplaceElementL-CSenXmlElement", CsenxmlTester::CSenXmlElement_ReplaceElementLL),
+
+		ENTRY("AsXmlL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AsXmlLL),
+
+		ENTRY("AsXmlUnicodeL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AsXmlUnicodeLL),
+
+		ENTRY("CopyFromL-CSenXmlElement", CsenxmlTester::CSenXmlElement_CopyFromLL),
+
+		ENTRY("DetachL-CSenXmlElement", CsenxmlTester::CSenXmlElement_DetachLL),
+
+		ENTRY("Child-CSenXmlElement", CsenxmlTester::CSenXmlElement_ChildL),
+
+		ENTRY("Set-CSenXmlElement", CsenxmlTester::CSenXmlElement_SetL),
+
+		ENTRY("AddAttributesL-CSenXmlElement", CsenxmlTester::CSenXmlElement_AddAttributesLL),
+
+		//ENTRY("RemoveAttributeL-CSenXmlElement", CsenxmlTester::CSenXmlElement_RemoveAttributeLL),
+
+		ENTRY("AsElement-CSenXmlElement", CsenxmlTester::CSenXmlElement_AsElementL),
+    
+		ENTRY("NewL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NewL_L),
+    
+		ENTRY("NewL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NewL_1L),
+    
+		ENTRY("NewL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NewL_2L),
+    
+		ENTRY("NewL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NewL_3L),
+    
+		ENTRY("NewL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NewL_4L),
+    
+		ENTRY("NewL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NewL_5L),
+
+		ENTRY("AsXmlUnicodeL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_AsXmlUnicodeLL),
+
+		ENTRY("WriteAsXMLToL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_WriteAsXMLToLL),
+    
+    	ENTRY("Content-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ContentL),
+    	ENTRY("Namespace-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NamespaceL),
+    	ENTRY("EnsureNamespace-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_EnsureNamespaceL),
+    	ENTRY("DetachL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_DetachLL),
+		ENTRY("SaveNamespacesLL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_SaveNamespacesLL),
+		ENTRY("ResetContentLL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ResetContentLL),
+		ENTRY("LocalNameL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_LocalNameL),
+		ENTRY("NsUriL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NsUriL),
+		ENTRY("NsPrefixL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_NsPrefixL),
+		ENTRY("ExtractElementL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ExtractElementL),
+		ENTRY("SetAttributesL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_SetAttributesLL),
+		ENTRY("ConsistsOfL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ConsistsOfLL),
+		ENTRY("ParseL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ParseLL),
+		ENTRY("ErrorParseL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ParseL1L),
+		ENTRY("SetContentOfL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_SetContentOfLL),
+		ENTRY("ContentOf-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_ContentOfL),
+		ENTRY("ParserFeature-CSenXMLReader", CsenxmlTester::CSenXMLReader_ParserFeatureL),
+		ENTRY("ParseL-CSenXMLReader", CsenxmlTester::CSenXMLReader_ParseLL),
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_1L),
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_L),
+
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_2L),
+
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_3L),
+
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_4L),
+
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_5L),
+
+		ENTRY("NewL-CSenDomFragment", CsenxmlTester::CSenDomFragment_NewL_6L),
+
+		//ENTRY("ExpandL-CSenDomFragment", CsenxmlTester::CSenDomFragment_ExpandLL),
+		
+		//ENTRY("ResumeParsingFromL-CSenDomFragment", CsenxmlTester::CSenDomFragment_ResumeParsingFromLL),
+		
+		ENTRY("ParseWithL-CSenDomFragment", CsenxmlTester::CSenDomFragment_ParseWithLL),
+
+
+		ENTRY("SetAttributesL-CSenDomFragment", CsenxmlTester::CSenDomFragment_SetAttributesLL),
+
+		ENTRY("ParseL1-CSenDomFragment", CsenxmlTester::CSenDomFragment_ParseL1L),
+
+		ENTRY("NewL-CSenNamespace", CsenxmlTester::CSenNamespace_NewL_L),    
+    
+		ENTRY("NewLC-CSenNamespace", CsenxmlTester::CSenNamespace_NewLC_L),
+
+		ENTRY("NewL-CSenNamespace", CsenxmlTester::CSenNamespace_NewL_1L),
+
+		ENTRY("NewLC-CSenNamespace", CsenxmlTester::CSenNamespace_NewLC_1L),
+    
+		ENTRY("MatchesL-CSenNamespace", CsenxmlTester::CSenNamespace_MatchesL_L),
+		
+		ENTRY("InsertL-CSenNamespace", CsenxmlTester::CSenNamespace_InsertLL),
+		
+    
+		ENTRY("NewL-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewL_L),
+  
+		ENTRY("NewLC-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewLC_L),
+    
+		ENTRY("NewL-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewL_1L),
+    
+		ENTRY("NewLC-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewLC_1L),
+    
+		ENTRY("NewL-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewL_2L),
+    
+		ENTRY("NewLC-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewLC_2L),
+    
+		ENTRY("NewL-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewL_3L),
+    
+		ENTRY("NewLC-CSenXmlReader", CsenxmlTester::CSenXmlReader_NewLC_3L),
+
+		ENTRY("EnabledParserFeature-CSenXmlReader", CsenxmlTester::CSenXmlReader_EnabledParserFeature_L),
+		
+		ENTRY("ToUtf8LC-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_ToUtf8LCL),
+		
+		ENTRY("StartsWith-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_StartsWithL),
+
+		ENTRY("EndsWith-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_EndsWithL),
+
+		ENTRY("AttrValue-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_AttrValueL),
+
+		ENTRY("AllocAttrValueL-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_AllocAttrValueLL),
+
+		ENTRY("DecodeHttpCharactersL-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_DecodeHttpCharactersLL),
+
+		ENTRY("DecodeHttpCharactersLC-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_DecodeHttpCharactersLCL),
+
+		ENTRY("NsPrefix-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_NsPrefixL),
+
+		ENTRY("LocalName-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_LocalNameL),
+
+		ENTRY("RemoveAttributeL-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_RemoveAttributeLL),
+
+		ENTRY("RemoveAttributeL1-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_RemoveAttributeL1L),
+
+		ENTRY("AddAttributeL-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_AddAttributeLL),
+
+		ENTRY("AddAttributeL1-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_AddAttributeL1L),
+
+		ENTRY("AddAttributeL1-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_AddAttributeL2L),
+		
+		ENTRY("EncodeHttpCharactersLC-CSenXmlUtils", CsenxmlTester::CSenXmlUtils_EncodeHttpCharactersLCL),
+		ENTRY("BaseConstructL-CSenDomFragment", CsenxmlTester::CSenDomFragment_BaseConstructL),
+		ENTRY("BaseConstructL-CSenBaseFragment", CsenxmlTester::CSenBaseFragment_BaseConstructL),
+        //ADD NEW ENTRY HERE
+        // [test cases entries]-Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+void CsenxmlTester::SetupL(  ){
+    if ( iXmlReader ){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+    iXmlReader = CSenXmlReader::NewL(
+    );
+} 
+
+void CsenxmlTester::Teardown(  ){
+    if ( iXmlReader){
+        delete iXmlReader;
+        iXmlReader = NULL;
+    }
+}
+
+TInt CsenxmlTester::CSenBaseAttribute_NewLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseAttribute* pAttr=CSenBaseAttribute::NewL(_L8("Attr1"),_L8("value"));
+    CleanupStack::PushL(pAttr);
+    if(pAttr)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pAttr);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseAttribute_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();    
+    TBool Flag;
+    CSenBaseAttribute* pAttr=CSenBaseAttribute::NewL(_L8("N:Attr1"),_L8("Attr1"),_L8("value"));
+    CleanupStack::PushL(pAttr);
+    if(pAttr)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pAttr);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_NewLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+	Teardown();
+    return KErrNone;    
+    }
+
+TInt CsenxmlTester::CSenBaseElement_NewL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_NewL_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_NewL_4L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs, *parent);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_SetAttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseElement *pElement = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    /*EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;   
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_LocalNameL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KLName,"Nokia");
+ 
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& pLName=pElement->LocalName(); 
+    if(pLName==_L8("Nokia"))
+	 	Flag=1;
+	else
+		Flag=0;
+/*    EUNIT_ASSERT(Flag);*/
+    if(!Flag)
+    return KErrArgument;
+    
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_NamespaceURIL (CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KNSUri,"nsuria");
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const TDesC8 &pNSUri=pElement->NamespaceURI();
+    if(pNSUri==KNSUri)
+    	Flag=1;
+    else
+    	Flag=0;
+    CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_NsPrefixL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KNSPrefix,"N");
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    const TDesC8& pNSPrefix=pElement->NsPrefix();
+    if(pNSPrefix==KNSPrefix)
+    	Flag=1;
+    else
+    	Flag=0;
+    delete pElement;    
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_SetPrefixLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetPrefixL(_L8("N"));
+	const TDesC8& pNSPrefix=pElement->NsPrefix();
+    /*EUNIT_ASSERT_EQUALS(pNSPrefix, _L8("N"));*/
+    TL(pNSPrefix == _L8("N"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_HasContentTL (CStifItemParser& aItem)
+    {
+    SetupL();	
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	pElement->SetContentL(_L8("Nokia content"));
+	TBool Flag=pElement->HasContent();
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_HasContentFL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	TBool pHasContnt=pElement->HasContent();
+	if(pHasContnt)
+		Flag=0;
+	else
+		Flag=1;
+	    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	delete pElement;
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CsenxmlTester::CSenBaseElement_ContentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	pElement->SetContentL(_L8("Nokia content"));
+	TPtrC8 pContent=pElement->Content();
+	if(pContent==_L8("Nokia content"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_Content_NullL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+	TPtrC8 pContent=pElement->Content();
+	if(pContent==KNullDesC8())
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+   	delete pElement;
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CsenxmlTester::CSenBaseElement_ContentUnicodeLL (CStifItemParser& aItem)
+    {    
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetContentL(_L8("Nokia content"));
+	HBufC* ElementBuf=pElement->ContentUnicodeL();
+/*	EUNIT_ASSERT_EQUALS(*ElementBuf,_L("Nokia content"));*/
+	TL(*ElementBuf == _L("Nokia content"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_SetContentLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	TPtrC8 pContent=pElement->SetContentL(_L8("Nokia Content"));
+	if(pContent==_L8("Nokia Content"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_SetContentL_NullL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetContentL(_L8("element content"));
+	TPtrC8 pContent=pElement->SetContentL(KNullDesC8);
+	if(pContent==KNullDesC8())
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_SetContentL_OverRightL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetContentL(_L8("Nokia Content1"));
+	pElement->SetContentL(_L8("Nokia Content2"));	
+	TPtrC8 pContent=pElement->Content();
+	if(pContent==_L8("Nokia Content2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }
+      
+TInt CsenxmlTester::CSenBaseElement_SetContentL_WithEscCharsL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	TPtrC8 pContent=pElement->SetContentL(_L8("N&o'k\"ia <Content>"));
+	if(pContent==_L8("N&o'k\"ia <Content>"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);   
+    Teardown();
+    return KErrNone;
+    }      
+       
+TInt CsenxmlTester::CSenBaseElement_ConsistsOfLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElementA=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenBaseElement* pChild1A=CSenBaseElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenBaseElement* pChild2A=CSenBaseElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenBaseElement* pElementB=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenBaseElement* pChild1B=CSenBaseElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenBaseElement* pChild2B=CSenBaseElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+    /*EUNIT_ASSERT( ConsistOfFlag );*/
+    if(!ConsistOfFlag)
+    return KErrArgument;   
+    
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	if(pNsURI==_L8("namespaceuri"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceL_NullL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8(""));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	if(pNsURI==_L8(""))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement)	;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceL_2same1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==1 );*/
+    if(!( pNsList.Count()==1 ))
+    return KErrArgument;   
+ 	
+	CleanupStack::PopAndDestroy(pElement); 
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceL_2Diff1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pElement->SetNamespaceL(_L8("N2"),_L8("namespaceuri2"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri2")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==2 );*/
+    if(!( pNsList.Count()==2 ))
+    return KErrArgument;   
+ 	
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceL_DPSU1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pElement->SetNamespaceL(_L8("N2"),_L8("namespaceuri1"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri1")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==2 );*/
+    if(!( pNsList.Count()==2 ))
+    return KErrArgument;   
+ 	
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }       
+    
+TInt CsenxmlTester::CSenBaseElement_SetNamespaceL_SNsPC1L (CStifItemParser& aItem)
+	{
+	SetupL();
+	 CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+   	 CleanupStack::PushL(pElement);
+     CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+   	 CleanupStack::PushL(pParent);
+   	 pElement->SetParent(pParent);
+   	 pParent->SetNamespaceL(_L8("n"),_L8("nsuri"));
+   	 pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+   	 RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/*   	 EUNIT_ASSERT(pNsList.Count()==0);*/
+    if(!(pNsList.Count()==0))
+    return KErrArgument;   
+
+   	 CleanupStack::PopAndDestroy(pParent);
+   	 CleanupStack::PopAndDestroy(pElement);   	 
+	Teardown();
+    return KErrNone;
+    }
+        
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_FL (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+     TBool CheckParent=FALSE;
+     CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+   	 CleanupStack::PushL(pElement);
+   	 CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+     CleanupStack::PushL(pNs1);
+     const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+	 const TDesC8& pNsURI=pNs->URI();
+	 const TDesC8& pNsPrefix=pNs->Prefix();
+	 if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+	 	Flag=1;
+	 else
+		Flag=0;
+     CleanupStack::PopAndDestroy(pNs1);	
+	 CleanupStack::PopAndDestroy(pElement);
+         /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_TL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    TBool CheckParent=TRUE;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==1);*/
+    if(!(pNsList.Count()==1))
+    return KErrArgument;   
+
+   	CleanupStack::PopAndDestroy(pNs1);
+   	CleanupStack::PopAndDestroy(pParent);	
+	CleanupStack::PopAndDestroy(pElement);
+	
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_TSPL (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+     TBool CheckParent=TRUE;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    pParent->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==0);*/
+    if(!(pNsList.Count()==0))
+    return KErrArgument; 
+
+   	CleanupStack::PopAndDestroy(pNs1);	
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_TDPL (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+     TBool CheckParent=TRUE;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    pParent->AddNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==1);*/
+    if(!(pNsList.Count()==1))
+    return KErrArgument; 
+
+   	CleanupStack::PopAndDestroy(pNs1);	
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_2same1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+    pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==1 );*/
+    if(!(pNsList.Count()==1))
+    return KErrArgument;   
+ 	
+	CleanupStack::PopAndDestroy(pElement); 
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CsenxmlTester::CSenBaseElement_AddNamespaceL_2Diff1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+	const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pNs=pElement->AddNamespaceL(_L8("N2"),_L8("namespaceuri2"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri2")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+ 	/*EUNIT_ASSERT( pNsList.Count()==2 );*/
+ 	if(!(pNsList.Count()==2))
+    return KErrArgument;  
+ 	
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+    
+
+TInt CsenxmlTester::CSenBaseElement_NamespaceL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,Flag1,Flag2;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    //NULL
+    pElement->SetNamespaceL(_L8(""));
+    const CSenNamespace* pNs2=pElement->Namespace();
+    if(pNs2==NULL)
+    	Flag2=1;
+    else
+    	Flag2=0;
+    /*EUNIT_ASSERT(Flag2);*/
+   	if(!Flag2)
+    return KErrArgument;  
+
+   
+    //only URI
+    pElement->SetNamespaceL(_L8("nsuri"));
+    const CSenNamespace* pNs1=pElement->Namespace();
+    if(pNs1->Prefix()==_L8("")&&pNs1->URI()==_L8("nsuri"))
+    	Flag1=1;
+    else
+    	Flag1=0;
+    /*EUNIT_ASSERT(Flag1);*/
+  	if(!Flag1)
+    return KErrArgument;  
+
+    //URI and Prefix
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace();
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_Namespace_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag,Flag1;
+     //True case
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace(_L8("n"));
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    //False case
+    pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    pNs=pElement->Namespace(_L8("N"));
+    if(pNs==NULL)
+    	Flag1=1;
+    else
+    	Flag1=0;
+    /*EUNIT_ASSERT(Flag1);*/
+  	if(!Flag1)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_Namespace_WP1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag,Flag1;
+ 	CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent")) ;
+ 	CleanupStack::PushL(pParent);
+ 	pParent->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+    const CSenNamespace* pNs=pElement->Namespace(_L8("n"));
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    //False case
+    pParent=CSenBaseElement::NewL(_L8("Parent")) ;
+ 	CleanupStack::PushL(pParent);
+ 	pParent->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetParent(pParent);
+	pNs=pElement->Namespace(_L8("N"));
+	if(pNs==NULL)
+    	Flag1=1;
+    else
+    	Flag1=0;
+   /* EUNIT_ASSERT( Flag1 );*/
+  	if(!Flag1)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_Namespace_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,Flag1;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pParent->SetNamespaceL(_L8("p"),_L8("nsurip"));
+    pElement->SetNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->SetParent(pParent);
+    //aCheckInParent=FALSE and parent prefix
+    const CSenNamespace* pPNs=pElement->Namespace(_L8("p"),FALSE);
+    if(pPNs==NULL)
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    //aCheckInParent=TRUE and parent prefix
+    pPNs=pElement->Namespace(_L8("p"),TRUE);
+    if(pPNs->Prefix()==_L8("p") && pPNs->URI()==_L8("nsurip"))
+    	Flag1=1; 
+   	else
+   		Flag1=0;
+    /*EUNIT_ASSERT( Flag1 );*/
+  	if(!Flag1)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+   
+TInt CsenxmlTester::CSenBaseElement_Namespace_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNsList.Count()==3 );*/
+  	if(!( pNsList.Count()==3 ))
+    return KErrArgument;  
+    
+    const CSenNamespace* pNs=pElement->Namespace(_L8("m"),_L8("nsurim"));
+    if(pNs->Prefix()==_L8("m") && pNs->URI()==_L8("nsurim"))
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT(Flag);*/
+  	if(!Flag)
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_ElementsLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia")) ;
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pChild1=CSenBaseElement::NewL(_L8("element1")) ;
+    CleanupStack::PushL(pChild1);
+    CSenBaseElement* pChild2=CSenBaseElement::NewL(_L8("element2")) ;
+    CleanupStack::PushL(pChild2);
+    CSenBaseElement* pChild3=CSenBaseElement::NewL(_L8("element3")) ;
+    CleanupStack::PushL(pChild3);
+    pElement->AddElementL(*pChild1);
+    pElement->AddElementL(*pChild2);
+    pElement->AddElementL(*pChild3);
+    RPointerArray<CSenElement>& ElList=pElement->ElementsL();
+/*    EUNIT_ASSERT( ElList.Count()==3);*/
+  	if(!(ElList.Count()==3))
+    return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia")) ;
+    CleanupStack::PushL(pElement);
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==4 );*/
+  	if(!( pAttrList.Count()==4 ))
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_NamespacesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    const RPointerArray<CSenNamespace>& pNs=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNs.Count()==3);*/
+  	if(!(pNs.Count()==3))
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AttrValueL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,NegFlag;
+    _LIT8(KValue,"value4");
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia")) ;
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr4"));
+    if(pAttrVal!=NULL)
+    {
+    	Flag=1;
+    }
+    else
+    	Flag=0;
+/*    EUNIT_ASSERT(Flag);*/
+  	if(!Flag)
+    return KErrArgument;  
+    
+    const TDesC8* pNegAttrVal=pElement->AttrValue(_L8("attr1"));
+    if(pNegAttrVal==NULL)
+    	NegFlag=1;
+    else
+    	NegFlag=0;
+/*    EUNIT_ASSERT(NegFlag);*/
+  	if(!NegFlag)
+    return KErrArgument;  
+    
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AddAttrLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==1 );*/
+  	if(!( pAttrList.Count()==1 ))
+    return KErrArgument;  
+    
+    pElement->AddAttrL(_L8("Attr1"),_L8("Duplicatevalue1"));
+/*    EUNIT_ASSERT( pAttrList.Count()==1 );*/
+  	if(!( pAttrList.Count()==1 ))
+    return KErrArgument;  
+
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8(" value2"));//improve here by comparing TDesC8* AttrValue()
+    /*EUNIT_ASSERT( pAttrList.Count()==2 );*/
+  	if(!( pAttrList.Count()==2 ))
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenxmlTester::CSenBaseElement_AddAttributeLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CTestBaseElement* pElement=CTestBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributeL(_L8("Attr1"),_L8("value1"));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_ParentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,PFlag,PPFlag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CSenBaseElement* pPParent=CSenBaseElement::NewL(_L8("parent of parent"));
+    pElement->SetParent(pParent);
+    pParent->SetParent(pPParent);
+    CSenElement* pEl1= pElement->Parent();
+    CSenElement* pEl2= pParent->Parent();
+    CSenElement* pEl3= pPParent->Parent();
+    const TDesC8& pLName1=pEl1->LocalName();
+    if(pLName1==_L8("Parent"))
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    const TDesC8& pLName2=pEl2->LocalName();
+    if(pLName2==_L8("parent of parent"))
+    	PFlag=1;
+    else
+    	PFlag=0;
+/*    EUNIT_ASSERT(PFlag);*/
+  	if(!PFlag)
+    return KErrArgument;  
+    
+    if(pEl3==NULL)
+    	PPFlag=1;
+    else
+    	PPFlag=0;
+    /*EUNIT_ASSERT(PPFlag);*/
+  	if(!PFlag)
+    return KErrArgument;  
+    
+    delete pElement;
+    delete pParent;
+    delete pPParent;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_SetParentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pElement->SetNamespaceL(_L8("Nsuria"));
+    pParent->SetNamespaceL(_L8("nsurip"));
+    pElement->SetParent(pParent);
+    CSenElement* pPar=pElement->Parent();
+    const TDesC8& ParName=pPar->LocalName();
+    /*EUNIT_ASSERT_EQUALS( ParName,_L8("Parent") );*/
+    TL(ParName == _L8("Parent"));
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_RootL (CStifItemParser& aItem)
+    {
+    SetupL();    
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+    const MSenElement& pElRoot=pElement->Root();
+    const TDesC8& pElLName=pElRoot.LocalName();
+    if(pElLName==_L8("Nokia"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenBaseElement* pParent1=CSenBaseElement::NewL(_L8("Parent1"));
+    pElement->SetParent(pParent1);
+    const MSenElement& pElRoot1=pElement->Root();
+    const TDesC8& pElLName1=pElRoot1.LocalName();
+    if(pElLName1==_L8("Parent1"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenBaseElement* pParent2=CSenBaseElement::NewL(_L8("Parent2"));
+    pParent1->SetParent(pParent2);
+    const MSenElement& pElRoot2=pElement->Root();
+    const TDesC8& pElLName2=pElRoot2.LocalName();
+	const MSenElement& pParRoot=pParent1->Root();
+    const TDesC8& pParLName=pParRoot.LocalName();
+    if(pElLName2==_L8("Parent2") && pParLName==_L8("Parent2"))
+    	Flag=1;
+    else
+    	Flag=0;
+        
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    delete pParent1;
+    delete pParent2;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_ElementL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    CSenElement* element=pParent->Element(_L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+  	if(!(element->LocalName()==_L8("Nokia1")))
+    return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenxmlTester::CSenBaseElement_ElementsL1 (CStifItemParser& aItem)
+    {
+    SetupL();
+    //RPointerArray<CSenElement> &array;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    pParent->ElementsL(elementList, _L8("Nokia1"), _L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+  	//if(!(element->LocalName()==_L8("Nokia1")))
+    //return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+
+TInt CsenxmlTester::CSenBaseElement_ElementsL2 (CStifItemParser& aItem)
+    {
+    SetupL();
+    //RPointerArray<CSenElement> &array;
+    
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+
+    pParent->ElementsL(elementList, _L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+  	//if(!(element->LocalName()==_L8("Nokia1")))
+    //return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::Pop(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_CreateElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("nsuri"));
+    CSenElement* pNewElement=pElement->CreateElementL(_L8("N"),_L8("Nokia"));
+    CleanupStack::PushL(pNewElement);
+    HBufC8* ElementBuf=pNewElement->AsXmlL();
+/*    EUNIT_ASSERT_EQUALS(*ElementBuf,_L8("<N:Nokia xmlns:N=\"nsuri\"/>"));*/
+    TL(*ElementBuf == _L8("<N:Nokia xmlns:N=\"nsuri\"/>"));
+    CleanupStack::PopAndDestroy(pNewElement);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_InsertElementLL (CStifItemParser& aItem)
+    {
+    SetupL(); 
+     TBool Flag;
+     CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("Parent"));
+     CleanupStack::PushL(pParent);
+     CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Nokia1"));
+     CleanupStack::PushL(pElement1);
+     CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Nokia2"));
+     CleanupStack::PushL(pElement2);
+     CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Nokia3"));
+     CleanupStack::PushL(pElement3);
+     CSenBaseElement* pElement5=CSenBaseElement::NewL(_L8("Nokia5"));
+     CleanupStack::PushL(pElement5);
+     pParent->AddElementL(*pElement1);
+     pParent->AddElementL(*pElement2);
+     pParent->AddElementL(*pElement3);
+     pParent->AddElementL(*pElement5);
+     CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Nokia4"));
+     CleanupStack::PushL(pElement4);
+     pParent->InsertElementL(*pElement4,*pElement5);
+     RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+     const TDesC8& localName=elementList[3]->LocalName();
+     if(localName==_L8("Nokia4"))
+     	Flag=1;
+     else
+     	Flag=0;
+     /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+     if(!Flag)
+     return KErrArgument;
+     
+     CleanupStack::Pop(pElement4);
+	 CleanupStack::Pop(pElement5);
+     CleanupStack::Pop(pElement3);
+     CleanupStack::Pop(pElement2);
+     CleanupStack::Pop(pElement1);
+     CleanupStack::PopAndDestroy(pParent); 
+    Teardown();
+    return KErrNone;
+    }
+	 
+TInt CsenxmlTester::CSenBaseElement_InsertElementL_NoBeforeL (CStifItemParser& aItem)               
+	{
+    SetupL();
+	TBool Flag;
+	CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+	CleanupStack::PushL(pParent);
+	CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("nokia"));
+	CleanupStack::PushL(pElement1);
+	
+	CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("nokia2"));
+	CleanupStack::PushL(pElement2);
+	
+	CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("nokia3"));
+	CleanupStack::PushL(pElement3);
+	pParent->AddElementL(*pElement1);
+	pParent->AddElementL(*pElement2);
+	pParent->AddElementL(*pElement3);
+	
+	
+	CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("nokia4"));
+	CleanupStack::PushL(pElement4);
+	
+	
+	CSenBaseElement* pElement5=CSenBaseElement::NewL(_L8("nokia5"));
+	CleanupStack::PushL(pElement5);
+	
+	pParent->InsertElementL(*pElement4,*pElement5);
+	RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+	const TDesC8& localName=elementList[(elementList.Count()-1)]->LocalName();
+	if(localName==_L8("nokia4"))
+		Flag=1;
+	else
+		Flag=0;
+		
+/*	EUNIT_ASSERT(Flag);*/
+	if(!Flag)
+    return KErrArgument;
+	
+	CleanupStack::PopAndDestroy(pElement5);
+	CleanupStack::Pop(pElement4);
+    CleanupStack::Pop(pElement3);
+    CleanupStack::Pop(pElement2);
+    CleanupStack::Pop(pElement1);
+    CleanupStack::PopAndDestroy(pParent); 
+ 	Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AddElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    CSenElement& newElement=pParent->AddElementL(*pElement);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName();
+    if(localName==_L8("nokia") && elementList.Count()==1 )
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+	if(!Flag)
+    return KErrArgument;
+	
+    CleanupStack::Pop(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AddElementL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    if(localName==_L8("element") && elementList.Count()==1 )
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+   	if(!Flag)
+    return KErrArgument;
+	
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AddElementL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AddElementL_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+	TBool Flag;
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"),_L8("e:element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+     /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+	
+    CleanupStack::PopAndDestroy(pParent);    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_RemoveElementL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool TFlag;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4);
+    //true case
+    CSenElement* pRmdElement=pParent->RemoveElement(*pElement3);
+    const TDesC8& localName=pRmdElement->LocalName();
+    /*CSenElement* pParElement=pElement3->Parent();//intentional
+    const TDesC8& localnmae1=pParElement->LocalName();*/
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    if(localName==_L8("Element3") && elList.Count()==3 )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+	
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pRmdElement;
+    //delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_RemoveElement_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    pParent->AddElementL(_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("element1"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    if(pRmdElement->LocalName()==_L8("element1") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+	
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("none"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+	if(!FFlag)
+    return KErrArgument;
+
+	CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	//delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_RemoveElement_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("nsuri1"),_L8("element1"));
+    pParent->AddElementL(_L8("nsuri2"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri2a"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri4"),_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("nsuri2a"),_L8("element2"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    const TDesC8& localName=pRmdElement->LocalName();
+    const TDesC8& nsURI=pRmdElement->NamespaceURI();
+    if(localName==_L8("element2") && nsURI==_L8("nsuri2a") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+    /*EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("element1"),_L8("nothing"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+	if(!FFlag)
+    return KErrArgument;
+
+    CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	delete pRmdElement1;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_ReplaceElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    _LIT8(KNewElement,"<a:Element1 xmlns:a=\"nsuria\"><subelement1/>New content</a:Element1>");
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    //true case
+    CSenBaseElement* pNewElement=CSenBaseElement::NewL(_L8("Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement);
+    pNewElement->AddElementL(_L8("subelement1"));
+    pNewElement->SetContentL(_L8("New content"));
+    CSenElement* pReplacedElement=pParent->ReplaceElementL(*pNewElement);
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    HBufC8* pRepBuf=elList[(elList.Count()-1)]->AsXmlL();
+    if(pReplacedElement!=NULL && elList.Count()==4 && 
+    	elList[(elList.Count()-1)]->LocalName()==_L8("Element1") && 
+    	*pRepBuf==KNewElement && elList[(elList.Count()-1)]->Content()==_L8("New content") )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+
+    //False case
+    CSenBaseElement* pNewElement1=CSenBaseElement::NewL(_L8("New Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement1);
+    CSenElement* pReplacedElement1=pParent->ReplaceElementL(*pNewElement1);
+    RPointerArray<CSenElement>& elList1=pParent->ElementsL();
+    if(pReplacedElement1==NULL && elList1.Count()==5)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+	if(!FFlag)
+    return KErrArgument;
+
+    CleanupStack::Pop(pNewElement1);
+    CleanupStack::Pop(pNewElement);
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pReplacedElement;
+    delete pRepBuf;
+    delete pReplacedElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AsXmlLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC8* parBuf=pParent->AsXmlL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AsXmlUnicodeLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC* parBuf=pParent->AsXmlUnicodeL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_CopyFromLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("xml element"));
+    CleanupStack::PushL(pElement);
+    pElement->AddElementL(_L8("child1"));
+    pElement->AddElementL(_L8("child2"));
+    pElement->SetContentL(_L8("element content"));
+    pElement->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    CSenBaseElement* pCopied=CSenBaseElement::NewL(_L8("copied element"));
+    CleanupStack::PushL(pCopied);
+    pCopied->SetContentL(_L8("copy content"));
+    pCopied->AddElementL(_L8("child1"));
+    pCopied->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    pCopied->CopyFromL(*pElement);
+    const TDesC8& content=pCopied->Content();
+    const RPointerArray<CSenElement>& copElList=pCopied->ElementsL();
+    const RPointerArray<CSenNamespace>& copNSList=pCopied->NamespacesL();
+    if(copElList.Count()==3 && copNSList.Count()==2)
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pCopied);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_DetachLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenBaseElement* pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenBaseElement* pElement1=CSenBaseElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenBaseElement* pElement2=CSenBaseElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenBaseElement* pElement3=CSenBaseElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenBaseElement* pElement4=CSenBaseElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    CSenElement* dElement=pElement1->DetachL();
+    const RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    /*EUNIT_ASSERT( elList.Count()==3 );*/
+	if(!(elList.Count()==3))
+    return KErrArgument;
+
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete dElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_ChildL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    CSenBaseElement*pParent=CSenBaseElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    CSenElement* pElement=pParent->Child(0);
+    if(pElement->LocalName()==_L8("element1"))
+    	TFlag=1;
+    else
+    	TFlag=0;
+    /*EUNIT_ASSERT( TFlag );*/
+	if(!TFlag)
+    return KErrArgument;
+    
+    CSenElement* pElement1=pParent->Child(4);
+    if(pElement1==NULL)
+    	FFlag=1;
+    else
+    	FFlag=0;
+    /*EUNIT_ASSERT( FFlag );*/
+    if(!FFlag)
+    return KErrArgument;    
+    
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseElement_SetL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->Set(_L8("nsuri"),_L8("element"),_L8("e:e:lement"));
+    if(pElement->LocalName()==_L8("element") && pElement->NamespaceURI()==_L8("nsuri") 
+    		&& pElement->NsPrefix()==_L8("e"))
+    		Flag=1;
+    else
+    		Flag=0;
+    
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    if(!Flag)
+    return KErrArgument;    
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+  
+TInt CsenxmlTester::CSenBaseElement_AddAttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseElement *pElement = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    /*EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!(*pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;    
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseElement_AsElementL(CStifItemParser& aItem)
+	{
+    SetupL();
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	MSenElement* pAsElement=pElement->AsElement();
+	HBufC8* pElementBuf=pElement->AsXmlL();
+/*	EUNIT_ASSERT_EQUALS(*pElementBuf,_L8("<Nokia><webservices/></Nokia>"));*/
+	TL(*pElementBuf == _L8("<Nokia><webservices/></Nokia>"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete pElementBuf;
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenBaseElement_ContentWriteStreamLL(CStifItemParser& aItem)
+	{
+    SetupL();
+	TBuf8<50> StreamBuf;
+	CSenBaseElement* pElement=CSenBaseElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	RWriteStream& ElemntStream=pElement->ContentWriteStreamL();
+	TRAPD(res,ElemntStream.WriteL(StreamBuf));
+	CleanupStack::PopAndDestroy(pElement);
+	//EUNIT_ASSERT(FALSE);
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenBaseElement_RemoveAttributeLL(CStifItemParser& aItem)
+	{
+    SetupL();/*
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseElement *pElement = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    CSenBaseAttribute* RmdElement=pElement->RemoveAttributeL(_L8("pr:LocalName"));
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    RPointerArray<CSenBaseAttribute>& AttrList=pElement->AttributesL();
+    //EUNIT_ASSERT( *pElementBuf == _L8("<Nokia/>" ));
+    if(!(*pElementBuf == _L8("<Nokia/>")))
+    return KErrArgument;   
+
+    //EUNIT_ASSERT_EQUALS(AttrList.Count(),0);
+    TL(AttrList.Count() == 0);
+   	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+	delete RmdElement;
+	//EUNIT_ASSERT(FALSE);
+	Teardown();
+    return KErrNone;
+    */
+   	Teardown();
+    return KErrNone;
+
+    }
+	
+TInt CsenxmlTester::CSenXmlElement_NewLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("elment"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+/*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+        
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_NewL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+   /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_SetAttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenXmlElement *pElement = CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+/*    EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;   
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_LocalNameL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& lName=pElement->LocalName();
+    if(lName==_L8("element"))
+    	Flag=1;
+    else
+    	Flag=0;
+   /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+   
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_NamespaceURIL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& nsURI=pElement->NamespaceURI();
+    if(nsURI==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+   /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_NsPrefixL (CStifItemParser& aItem)
+    {
+    SetupL(); 
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"),_L8("a:element"));
+    CleanupStack::PushL(pElement);
+    const TDesC8& nsPrefix=pElement->NsPrefix();
+    if(nsPrefix==_L8("a"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_SetPrefixLL (CStifItemParser& aItem)
+    {
+    SetupL();//some thing
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetPrefixL(_L8("pre"));
+    const TDesC8& lName=pElement->LocalName();
+    const TDesC8& nsPrefix=pElement->NsPrefix();
+    if(nsPrefix==_L8("pre") && lName==_L8("element"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+  
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_HasContentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    //False case
+    Flag=pElement->HasContent();
+/*    EUNIT_ASSERT( !Flag );*/
+  	if(Flag)
+    return KErrArgument;  
+
+    //True case
+    pElement->SetContentL(_L8("CONTENT"));
+    Flag=pElement->HasContent();
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ContentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetContentL(_L8("CONTENT"));
+    const TDesC8& content=pElement->Content();
+    if(content==_L8("CONTENT"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlElement_ContentWriteStreamLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+	RWriteStream stream = pElement->ContentWriteStreamL();
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CsenxmlTester::CSenXmlElement_ContentUnicodeLL (CStifItemParser& aItem)
+    {
+    SetupL();    
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nsuria"),_L8("Nokia"),_L8("N:Nokia"));
+    CleanupStack::PushL(pElement);
+	pElement->SetContentL(_L8("Nokia content"));
+	HBufC* ElementBuf=pElement->ContentUnicodeL();
+/*	EUNIT_ASSERT_EQUALS(*ElementBuf,_L("Nokia content"));*/
+	TL(*ElementBuf == _L("Nokia content"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_SetContentLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetContentL(_L8("CONTENT"));
+    TBool ContentFlag=pElement->HasContent();
+    const TDesC8& content=pElement->Content();
+    if(content==_L8("CONTENT") && ContentFlag)
+   		Flag=1;
+    else 
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    pElement->SetContentL(_L8("NEW CONTENT"));
+    const TDesC8& newContent=pElement->Content();
+    if(newContent==_L8("NEW CONTENT") )
+   		Flag=1;
+    else 
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ConsistsOfLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElementA=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenXmlElement* pChild1A=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2A=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenXmlElement* pElementB=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenXmlElement* pChild1B=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2B=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+/*    EUNIT_ASSERT( ConsistOfFlag );*/
+    if(!ConsistOfFlag)
+    return KErrArgument;   
+    
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlElement_ConsistsOfL1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElementA=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenXmlElement* pChild1A=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2A=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenXmlElement* pElementB=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenXmlElement* pChild1B=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2B=CSenXmlElement::NewL(_L8("Xml"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+/*    EUNIT_ASSERT( !ConsistOfFlag );*/
+    if(ConsistOfFlag)
+    return KErrArgument;   
+
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenXmlElement_ConsistsOfL2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElementA=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementA);
+    CSenXmlElement* pChild1A=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2A=CSenXmlElement::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    CSenXmlElement* pChild3A=CSenXmlElement::NewL(_L8("Xml"));
+    CleanupStack::PushL(pChild3A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    pElementA->AddElementL(*pChild3A);
+    
+    CSenXmlElement* pElementB=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenXmlElement* pChild1B=CSenXmlElement::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenXmlElement* pChild2B=CSenXmlElement::NewL(_L8("Xml"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+/*    EUNIT_ASSERT( ConsistOfFlag );*/
+    if(!ConsistOfFlag)
+    return KErrArgument;   
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+	Teardown();
+    return KErrNone;
+    }	
+
+TInt CsenxmlTester::CSenXmlElement_SetNamespaceLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	if(pNsURI==_L8("namespaceuri"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlElement_SetNamespaceL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenxmlTester::CSenXmlElement_SetNamespaceL_2same1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+    pElement->SetNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/* 	EUNIT_ASSERT( pNsList.Count()==1 );*/
+    if(!( pNsList.Count()==1 ))
+    return KErrArgument;   
+
+	CleanupStack::PopAndDestroy(pElement); 
+    Teardown();
+    return KErrNone;
+    }    
+ 
+TInt CsenxmlTester::CSenXmlElement_SetNamespaceL_2Diff1L (CStifItemParser& aItem)
+    {
+    SetupL();
+     TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N1"),_L8("namespaceuri1"));
+    pElement->SetNamespaceL(_L8("N2"),_L8("namespaceuri2"));
+	const TDesC8& pNsURI=pElement->NamespaceURI();
+	const TDesC8& pNsPrefix=pElement->NsPrefix();
+	if(pNsURI==_L8("namespaceuri2")&&pNsPrefix==_L8("N2"))
+		Flag=1;
+	else
+		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+	RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/* 	EUNIT_ASSERT( pNsList.Count()==2 );*/
+    if(!( pNsList.Count()==2 ))
+    return KErrArgument;   
+
+ 	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }    
+
+TInt CsenxmlTester::CSenXmlElement_AddNamespaceLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    TBool CheckParent=TRUE;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("ParentElement"));
+    CleanupStack::PushL(pParent);
+    
+    pElement->SetParent(pParent);
+    CSenNamespace* pNs1=CSenNamespace::NewL(_L8("N"),_L8("namespaceuri"));
+    CleanupStack::PushL(pNs1);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(*pNs1,CheckParent);
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+/*    EUNIT_ASSERT( pNsList.Count()==1);*/
+    if(!( pNsList.Count()==1 ))
+    return KErrArgument;   
+
+   	CleanupStack::PopAndDestroy(pNs1);
+   	CleanupStack::PopAndDestroy(pParent);	
+	CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddNamespaceL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    const CSenNamespace* pNs=pElement->AddNamespaceL(_L8("N"),_L8("namespaceuri"));
+	const TDesC8& pNsURI=pNs->URI();
+	const TDesC8& pNsPrefix=pNs->Prefix();
+	if(pNsURI==_L8("namespaceuri")&&pNsPrefix==_L8("N"))
+		Flag=1;
+	else
+		Flag=0;
+	CleanupStack::PopAndDestroy(pElement);
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_NamespaceL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,Flag1,Flag2;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    //NULL
+    pElement->SetNamespaceL(_L8(""));
+    const CSenNamespace* pNs2=pElement->Namespace();
+    if(pNs2==NULL)
+    	Flag2=1;
+    else
+    	Flag2=0;
+/*    EUNIT_ASSERT(Flag2);*/
+    if(!Flag2)
+    return KErrArgument;   
+   
+   
+    //only URI
+    pElement->SetNamespaceL(_L8("nsuri"));
+    const CSenNamespace* pNs1=pElement->Namespace();
+    if(pNs1->Prefix()==_L8("")&&pNs1->URI()==_L8("nsuri"))
+    	Flag1=1;
+    else
+    	Flag1=0;
+/*    EUNIT_ASSERT(Flag1);*/
+    if(!Flag1)
+    return KErrArgument;   
+
+    //URI and Prefix
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace();
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_Namespace_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,Flag1;
+     //True case
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    const CSenNamespace* pNs=pElement->Namespace(_L8("n"));
+    if(pNs->Prefix()==_L8("n") && pNs->URI()==_L8("nsuri"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    //False case
+    pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("n"),_L8("nsuri"));
+    pNs=pElement->Namespace(_L8("N"));
+    if(pNs==NULL)
+    	Flag1=1;
+    else
+    	Flag1=0;
+/*    EUNIT_ASSERT(Flag1);*/
+    if(!Flag1)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_Namespace_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+	TBool Flag,Flag1;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pParent->SetNamespaceL(_L8("p"),_L8("nsurip"));
+    pElement->SetNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->SetParent(pParent);
+    //aCheckInParent=FALSE and parent prefix
+    const CSenNamespace* pPNs=pElement->Namespace(_L8("p"),FALSE);
+    if(pPNs==NULL)
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    //aCheckInParent=TRUE and parent prefix
+    pPNs=pElement->Namespace(_L8("p"),TRUE);
+    if(pPNs->Prefix()==_L8("p") && pPNs->URI()==_L8("nsurip"))
+    	Flag1=1; 
+   	else
+   		Flag1=0;
+/*    EUNIT_ASSERT( Flag1 );*/
+    if(!Flag1)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_Namespace_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    RPointerArray<CSenNamespace>& pNsList=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNsList.Count()==3 );*/
+    if(!( pNsList.Count()==3 ))
+    return KErrArgument;   
+
+    const CSenNamespace* pNs=pElement->Namespace(_L8("m"),_L8("nsurim"));
+    if(pNs->Prefix()==_L8("m") && pNs->URI()==_L8("nsurim"))
+    	Flag=1;
+    else
+    	Flag=0;
+    /*EUNIT_ASSERT(Flag);*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ElementsLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia")) ;
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pChild1=CSenXmlElement::NewL(_L8("element1")) ;
+    CleanupStack::PushL(pChild1);
+    CSenXmlElement* pChild2=CSenXmlElement::NewL(_L8("element2")) ;
+    CleanupStack::PushL(pChild2);
+    CSenXmlElement* pChild3=CSenXmlElement::NewL(_L8("element3")) ;
+    CleanupStack::PushL(pChild3);
+    pElement->AddElementL(*pChild1);
+    pElement->AddElementL(*pChild2);
+    pElement->AddElementL(*pChild3);
+    RPointerArray<CSenElement>& ElList=pElement->ElementsL();
+    /*EUNIT_ASSERT( ElList.Count()==3);*/
+    if(!( ElList.Count()==3 ))
+    return KErrArgument;  
+    
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia")) ;
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==4 );*/
+    if(!( pAttrList.Count()==4 ))
+    return KErrArgument;  
+    
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenxmlTester::CSenXmlElement_AddAttributeLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CTestXmlElement* pElement=CTestXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributeL(_L8("Attr1"),_L8("value1"));
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_NamespacesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddNamespaceL(_L8("l"),_L8("nsuril"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    pElement->AddNamespaceL(_L8("n"),_L8("nsurin"));
+    pElement->AddNamespaceL(_L8("m"),_L8("nsurim"));
+    const RPointerArray<CSenNamespace>& pNs=pElement->NamespacesL();
+/*    EUNIT_ASSERT( pNs.Count()==3);*/
+    if(!( pNs.Count()==3 ))
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AttrValueL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,NegFlag;
+    _LIT8(KValue,"value4");
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia")) ;
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8("value2"));
+    pElement->AddAttrL(_L8("Attr3"),_L8("value3"));
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    pElement->AddAttrL(_L8("Attr4"),_L8("value4"));    
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr4"));
+    if(pAttrVal!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+/*    EUNIT_ASSERT(Flag);*/
+    if(!(Flag))
+    return KErrArgument;  
+    
+    const TDesC8* pNegAttrVal=pElement->AttrValue(_L8("attr1"));
+    if(pNegAttrVal==NULL)
+    	NegFlag=1;
+    else
+    	NegFlag=0;
+    /*EUNIT_ASSERT(NegFlag);*/
+    if(!(NegFlag))
+    return KErrArgument;  
+    
+    delete pElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddAttrLL (CStifItemParser& aItem)
+    {
+    SetupL();
+	CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttrL(_L8("Attr1"),_L8("value1"));
+    RPointerArray<CSenBaseAttribute>& pAttrList=pElement->AttributesL();
+/*    EUNIT_ASSERT( pAttrList.Count()==1 );*/
+    if(!(pAttrList.Count()==1))
+    return KErrArgument;  
+
+    pElement->AddAttrL(_L8("Attr1"),_L8("Duplicatevalue1"));
+    /*EUNIT_ASSERT( pAttrList.Count()==1 );*/
+    if(!(pAttrList.Count()==1))
+    return KErrArgument;  
+    
+    const TDesC8* pAttrVal=pElement->AttrValue(_L8("Attr1"));
+    pElement->AddAttrL(_L8("Attr2"),_L8(" value2"));//improve here by comparing TDesC8* AttrValue()
+    /*EUNIT_ASSERT( pAttrList.Count()==2 );*/
+    if(!(pAttrList.Count()==2))
+    return KErrArgument;  
+    
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ParentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag,PFlag,PPFlag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CSenXmlElement* pPParent=CSenXmlElement::NewL(_L8("parent of parent"));
+    pElement->SetParent(pParent);
+    pParent->SetParent(pPParent);
+    CSenElement* pEl1= pElement->Parent();
+    CSenElement* pEl2= pParent->Parent();
+    CSenElement* pEl3= pPParent->Parent();
+    const TDesC8& pLName1=pEl1->LocalName();
+    if(pLName1==_L8("Parent"))
+    	Flag=1;
+   	else
+   		Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    const TDesC8& pLName2=pEl2->LocalName();
+    if(pLName2==_L8("parent of parent"))
+    	PFlag=1;
+    else
+    	PFlag=0;
+/*    EUNIT_ASSERT(PFlag);*/
+    if(!PFlag)
+    return KErrArgument;  
+    
+    if(pEl3==NULL)
+    	PPFlag=1;
+    else
+    	PPFlag=0;
+    /*EUNIT_ASSERT(PPFlag);*/
+    if(!PPFlag)
+    return KErrArgument;  
+    
+    delete pElement;
+    delete pParent;
+    delete pPParent;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_SetParentL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    pElement->SetNamespaceL(_L8("Nsuria"));
+    pParent->SetNamespaceL(_L8("nsurip"));
+    pElement->SetParent(pParent);
+    CSenElement* pPar=pElement->Parent();
+    const TDesC8& ParName=pPar->LocalName();
+/*    EUNIT_ASSERT_EQUALS( ParName,_L8("Parent") ); */
+    TL(ParName == _L8("Parent"));
+    CleanupStack::PopAndDestroy(pParent);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_RootL (CStifItemParser& aItem)
+    {
+    SetupL();
+	TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+    const MSenElement& pElRoot=pElement->Root();
+    const TDesC8& pElLName=pElRoot.LocalName();
+    if(pElLName==_L8("Nokia"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenXmlElement* pParent1=CSenXmlElement::NewL(_L8("Parent1"));
+    pElement->SetParent(pParent1);
+    const MSenElement& pElRoot1=pElement->Root();
+    const TDesC8& pElLName1=pElRoot1.LocalName();
+    if(pElLName1==_L8("Parent1"))
+    	Flag=1;
+    else
+    	Flag=0;
+    
+    CSenXmlElement* pParent2=CSenXmlElement::NewL(_L8("Parent2"));
+    pParent1->SetParent(pParent2);
+    const MSenElement& pElRoot2=pElement->Root();
+    const TDesC8& pElLName2=pElRoot2.LocalName();
+	const MSenElement& pParRoot=pParent1->Root();
+    const TDesC8& pParLName=pParRoot.LocalName();
+    if(pElLName2==_L8("Parent2") && pParLName==_L8("Parent2"))
+    	Flag=1;
+    else
+    	Flag=0;
+        
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    delete pParent1;
+    delete pParent2;    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ElementL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Nokia1"));
+    CleanupStack::PushL(pElement1);
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Nokia2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Nokia3"));
+    CleanupStack::PushL(pElement3);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    CSenElement* element=pParent->Element(_L8("Nokia1"));
+/*    EUNIT_ASSERT( element->LocalName()==_L8("Nokia1") );*/
+    if(!(element->LocalName()==_L8("Nokia1")))
+    return KErrArgument;  
+
+    CleanupStack::Pop(3);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_CreateElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("element"));
+    CleanupStack::PushL(pElement);
+    pElement->SetNamespaceL(_L8("N"),_L8("nsuri"));
+    CSenElement* pNewElement=pElement->CreateElementL(_L8("N"),_L8("Nokia"));
+    CleanupStack::PushL(pNewElement);
+    HBufC8* ElementBuf=pNewElement->AsXmlL();
+/*    EUNIT_ASSERT_EQUALS(*ElementBuf,_L8("<N:Nokia xmlns:N=\"nsuri\"/>"));*/
+    TL(*ElementBuf == _L8("<N:Nokia xmlns:N=\"nsuri\"/>"));
+    CleanupStack::PopAndDestroy(pNewElement);
+    CleanupStack::PopAndDestroy(pElement);
+    delete ElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_InsertElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    
+     TBool Flag;
+     CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("Parent"));
+     CleanupStack::PushL(pParent);
+     CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Nokia1"));
+     CleanupStack::PushL(pElement1);
+     CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Nokia2"));
+     CleanupStack::PushL(pElement2);
+     CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Nokia3"));
+     CleanupStack::PushL(pElement3);
+     CSenXmlElement* pElement5=CSenXmlElement::NewL(_L8("Nokia5"));
+     CleanupStack::PushL(pElement5);
+     pParent->AddElementL(*pElement1);
+     pParent->AddElementL(*pElement2);
+     pParent->AddElementL(*pElement3);
+     pParent->AddElementL(*pElement5);
+     CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Nokia4"));
+     CleanupStack::PushL(pElement4);
+     pParent->InsertElementL(*pElement4,*pElement5);
+     RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+     const TDesC8& localName=elementList[3]->LocalName();
+     if(localName==_L8("Nokia4"))
+     	Flag=1;
+     else
+     	Flag=0;
+         /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+     CleanupStack::Pop(pElement4);
+	 CleanupStack::Pop(pElement5);
+     CleanupStack::Pop(pElement3);
+     CleanupStack::Pop(pElement2);
+     CleanupStack::Pop(pElement1);
+     CleanupStack::PopAndDestroy(pParent); 
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    CSenElement& newElement=pParent->AddElementL(*pElement);
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName();
+    const TDesC8& localName1=newElement.LocalName();    
+    if(localName==_L8("nokia") && elementList.Count()==1 )//&& newElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::Pop(pElement);
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddElementL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    if(localName==_L8("element") && elementList.Count()==1 )
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddElementL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddElementL_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+	TBool Flag;
+    CSenXmlElement *pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenElement& newElement=pParent->AddElementL(_L8("nsuria"),_L8("element"),_L8("e:element"));
+    RPointerArray<CSenElement>& elementList=pParent->ElementsL();
+    const TDesC8& localName=elementList[0]->LocalName(); 
+    const TDesC8& nsUri=elementList[0]->NamespaceURI(); 
+    if(localName==_L8("element") && elementList.Count()==1 && nsUri==_L8("nsuria"))
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pParent);    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_RemoveElementL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool TFlag;
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4);
+    //true case
+    CSenElement* pRmdElement=pParent->RemoveElement(*pElement3);
+    const TDesC8& localName=pRmdElement->LocalName();
+    /*CSenElement* pParElement=pElement3->Parent();//intentional
+    const TDesC8& localnmae1=pParElement->LocalName();*/
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    if(localName==_L8("Element3") && elList.Count()==3 )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+    
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pRmdElement;
+    //delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_RemoveElement_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    pParent->AddElementL(_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("element1"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    if(pRmdElement->LocalName()==_L8("element1") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("none"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+    if(!FFlag)
+    return KErrArgument;  
+
+	CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	//delete pRmdElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_RemoveElement_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool TFlag,FFlag;
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("nsuri1"),_L8("element1"));
+    pParent->AddElementL(_L8("nsuri2"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri2a"),_L8("element2"));
+    pParent->AddElementL(_L8("nsuri4"),_L8("element4"));
+    //True case
+    CSenElement* pRmdElement=pParent->RemoveElement(_L8("nsuri2a"),_L8("element2"));
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();   
+    const TDesC8& localName=pRmdElement->LocalName();
+    const TDesC8& nsURI=pRmdElement->NamespaceURI();
+    if(localName==_L8("element2") && nsURI==_L8("nsuri2a") && elList.Count()==3)
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    //False case
+    CSenElement* pRmdElement1=pParent->RemoveElement(_L8("element1"),_L8("nothing"));
+    elList=pParent->ElementsL();
+    if(pRmdElement1==NULL && elList.Count()==3)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+    if(!FFlag)
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(pParent);
+	delete pRmdElement;
+	delete pRmdElement1;
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ReplaceElementLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    _LIT8(KNewElement,"<a:Element1 xmlns:a=\"nsuria\"><subelement1/>New content</a:Element1>");
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    //true case
+    CSenXmlElement* pNewElement=CSenXmlElement::NewL(_L8("Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement);
+    pNewElement->AddElementL(_L8("subelement1"));
+    pNewElement->SetContentL(_L8("New content"));
+    CSenElement* pReplacedElement=pParent->ReplaceElementL(*pNewElement);
+    RPointerArray<CSenElement>& elList=pParent->ElementsL();
+    HBufC8* pRepBuf=elList[(elList.Count()-1)]->AsXmlL();
+    if(pReplacedElement!=NULL && elList.Count()==4 && 
+    	elList[(elList.Count()-1)]->LocalName()==_L8("Element1") && 
+    	*pRepBuf==KNewElement && elList[(elList.Count()-1)]->Content()==_L8("New content") )
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    //False case
+    CSenXmlElement* pNewElement1=CSenXmlElement::NewL(_L8("New Element1"));
+    pNewElement->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    CleanupStack::PushL(pNewElement1);
+    CSenElement* pReplacedElement1=pParent->ReplaceElementL(*pNewElement1);
+    RPointerArray<CSenElement>& elList1=pParent->ElementsL();
+    if(pReplacedElement1==NULL && elList1.Count()==5)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT(FFlag);*/
+    if(!FFlag)
+    return KErrArgument;  
+
+    CleanupStack::Pop(pNewElement1);
+    CleanupStack::Pop(pNewElement);
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete pReplacedElement;
+    delete pRepBuf;
+    delete pReplacedElement1;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AsXmlLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT8(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC8* parBuf=pParent->AsXmlL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AsXmlUnicodeLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    _LIT(KString,"<parent><element1/><element2/><element3/>parent content</parent>");
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent) ;
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->SetContentL(_L8("parent content"));
+    pParent->AddElementL(_L8("element3"));
+    HBufC* parBuf=pParent->AsXmlUnicodeL();
+    if(*parBuf==KString)
+     	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete parBuf;
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_CopyFromLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("xml element"));
+    CleanupStack::PushL(pElement);
+    pElement->AddElementL(_L8("child1"));
+    pElement->AddElementL(_L8("child2"));
+    pElement->SetContentL(_L8("element content"));
+    pElement->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    CSenXmlElement* pCopied=CSenXmlElement::NewL(_L8("copied element"));
+    CleanupStack::PushL(pCopied);
+    pCopied->SetContentL(_L8("copy content"));
+    pCopied->AddElementL(_L8("child1"));
+    pCopied->AddNamespaceL(_L8("a"),_L8("nsuri"));
+    pCopied->CopyFromL(*pElement);
+    const TDesC8& content=pCopied->Content();
+    const RPointerArray<CSenElement>& copElList=pCopied->ElementsL();
+    const RPointerArray<CSenNamespace>& copNSList=pCopied->NamespacesL();
+    if(copElList.Count()==3 && copNSList.Count()==2)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pCopied);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_DetachLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlElement* pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    CSenXmlElement* pElement1=CSenXmlElement::NewL(_L8("Element1"));
+    CleanupStack::PushL(pElement1);
+    pElement1->SetNamespaceL(_L8("a"),_L8("nsuria"));
+    pElement1->SetContentL(_L8("old content"));
+    CSenXmlElement* pElement2=CSenXmlElement::NewL(_L8("Element2"));
+    CleanupStack::PushL(pElement2);
+    CSenXmlElement* pElement3=CSenXmlElement::NewL(_L8("Element3"));
+    CleanupStack::PushL(pElement3);
+    CSenXmlElement* pElement4=CSenXmlElement::NewL(_L8("Element4"));
+    CleanupStack::PushL(pElement4);
+    pParent->AddElementL(*pElement1);
+    pParent->AddElementL(*pElement2);
+    pParent->AddElementL(*pElement3);
+    pParent->AddElementL(*pElement4); 
+    CSenElement* dElement=pElement1->DetachL();
+    const RPointerArray<CSenElement>& elList=pParent->ElementsL();
+/*    EUNIT_ASSERT( elList.Count()==3 );*/
+    if(!( elList.Count()==3 ))
+    return KErrArgument;  
+
+    CleanupStack::Pop(4);
+    CleanupStack::PopAndDestroy(pParent);
+    delete dElement;
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_ChildL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool FFlag,TFlag;
+    CSenXmlElement*pParent=CSenXmlElement::NewL(_L8("parent"));
+    CleanupStack::PushL(pParent);
+    pParent->AddElementL(_L8("element1"));
+    pParent->AddElementL(_L8("element2"));
+    pParent->AddElementL(_L8("element3"));
+    CSenElement* pElement=pParent->Child(0);
+    if(pElement->LocalName()==_L8("element1"))
+    	TFlag=1;
+    else
+    	TFlag=0;
+/*    EUNIT_ASSERT( TFlag );*/
+    if(!TFlag)
+    return KErrArgument;  
+
+    CSenElement* pElement1=pParent->Child(4);
+    if(pElement1==NULL)
+    	FFlag=1;
+    else
+    	FFlag=0;
+/*    EUNIT_ASSERT( FFlag );*/
+    if(!FFlag)
+    return KErrArgument;  
+    
+    
+    CleanupStack::PopAndDestroy(pParent);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_SetL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->Set(_L8("nsuri"),_L8("element"),_L8("e:e:lement"));
+    if(pElement->LocalName()==_L8("element") && pElement->NamespaceURI()==_L8("nsuri") 
+    		&& pElement->NsPrefix()==_L8("e"))
+    		Flag=1;
+    else
+    		Flag=0;
+    
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlElement_AddAttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenXmlElement *pElement = CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    HBufC8* pElementBuf = pElement->AsXmlL();
+/*    EUNIT_ASSERT( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" ));*/
+    if(!( *pElementBuf == _L8("<Nokia pr:LocalName=\"Value\"/>" )))
+    return KErrArgument;  
+
+	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+    Teardown();
+    return KErrNone;
+    }
+/*    
+TInt CsenxmlTester::CSenXmlElement_RemoveAttributeLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenXmlElement *pElement = CSenXmlElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    pElement->AddAttributesL(attrArray);
+    CSenBaseAttribute* RmdElement=pElement->RemoveAttributeL(_L8("pr:LocalName"));
+    HBufC8* pElementBuf = pElement->AsXmlL();
+    RPointerArray<CSenBaseAttribute>& AttrList=pElement->AttributesL();
+    EUNIT_ASSERT( *pElementBuf == _L8("<Nokia/>" ));
+    EUNIT_ASSERT_EQUALS(AttrList.Count(),0);
+    TL(AttrList.Count() == 0);
+   	CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+	delete pElementBuf;
+	delete RmdElement;
+    Teardown();
+    return KErrNone;
+    }
+*/
+TInt CsenxmlTester::CSenXmlElement_AsElementL(CStifItemParser& aItem)
+	{
+    SetupL();
+	CSenXmlElement* pElement=CSenXmlElement::NewL(_L8("Nokia"));
+	CleanupStack::PushL(pElement);
+	pElement->AddElementL(_L8("webservices"));
+	MSenElement* pAsElement=pElement->AsElement();
+	HBufC8* pElementBuf=pElement->AsXmlL();
+/*	EUNIT_ASSERT_EQUALS(*pElementBuf,_L8("<Nokia><webservices/></Nokia>"));*/
+	TL(*pElementBuf == _L8("<Nokia><webservices/></Nokia>"));
+	CleanupStack::PopAndDestroy(pElement);
+	delete pElementBuf;
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenBaseFragment_NewL_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(*ele);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenBaseFragment_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseFragment_NewL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenBaseFragment_NewL_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseFragment_NewL_4L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseFragment_NewL_5L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenBaseFragment* pElement=CSenBaseFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs, *parent);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenBaseFragment_AsXmlUnicodeLL(CStifItemParser& aItem)
+	{
+    SetupL();
+	CSenBaseFragment* pFragment=CSenBaseFragment::NewL(_L8("Fragment"));
+	CleanupStack::PushL(pFragment);
+	HBufC* pFragBuf=pFragment->AsXmlUnicodeL();
+/*	EUNIT_ASSERT_EQUALS(*pFragBuf,_L("<Fragment/>"));*/
+	TL(*pFragBuf == _L("<Fragment/>"));
+	CleanupStack::PopAndDestroy(pFragment);
+	delete pFragBuf;
+	Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenBaseFragment_WriteAsXMLToLL(CStifItemParser& aItem)
+    {
+    SetupL();
+    // Test serialization of Dom tree which has two child elements
+    CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    CSenElement& element = pFragment->AsElement();
+    CSenElement& element2 = element.AddElementL(_L8("Child"));
+    CBufFlat* pBuf = CBufFlat::NewL(200);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+    pFragment->WriteAsXMLToL(bufWs);
+/*    EUNIT_ASSERT( pBuf->Ptr(0) == _L8("<Test><Child/></Test>"));*/
+    if(!( pBuf->Ptr(0) == _L8("<Test><Child/></Test>")))
+    return KErrArgument;  
+
+    CleanupStack::PopAndDestroy(&bufWs);
+    CleanupStack::PopAndDestroy(pBuf);
+    CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenBaseFragment_ContentL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_Content = pFragment->Content();
+    if(frag_Content == _L8("Test Content"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_NamespaceL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuria"),_L8("Test"),_L8("a:Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_NameSpace = pFragment->NsUri();
+    TPtrC8 frag_prefix = pFragment->NsPrefix();
+    if(frag_NameSpace == _L8("nsuria") && frag_prefix == _L8("a"))
+    	Flag = 1;
+    else
+    	Flag = 0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_EnsureNamespaceL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuria"),_L8("Test"),_L8("a:Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    pFragment->EnsureNamespace(_L8("a"));
+    CSenNamespace* frag_NameSpace;
+    frag_NameSpace = pFragment->Namespace(_L8("a"));
+    if(frag_NameSpace)
+    	Flag = 1;
+    else
+    	Flag = 0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_DetachLL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	_LIT8(KFragment,"<Test xmlns=\"nsuri\"><Child/>Test Content</Test>");
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    CSenBaseElement *pParent=CSenBaseElement::NewL(_L8("parent"));
+    element.SetParent(pParent);
+    TRAPD(retval,pFragment->DetachL());
+    CleanupStack::PopAndDestroy(pFragment);
+    return retval;
+	}	
+TInt CsenxmlTester::CSenBaseFragment_SaveNamespacesLL( CStifItemParser& aItem )
+	{
+    TBool Flag;
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("xmlns"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseFragment *pFragment = CSenBaseFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pFragment);
+    pFragment->SaveNamespacesL(attrArray,TRUE);
+    TPtrC8 frag_NameSpace = pFragment->NsUri();
+    if(frag_NameSpace == _L8("Value"))
+    	Flag = 1;
+    else
+    	Flag = 0;
+
+	CleanupStack::PopAndDestroy(pFragment);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    if (Flag)	return KErrNone;
+    else return KErrArgument;
+    }
+TInt CsenxmlTester::CSenBaseFragment_ResetContentLL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_Content = pFragment->Content();
+    if(frag_Content == _L8("Test Content"))
+    	Flag =1;
+    else
+    	Flag =0;
+    pFragment->ResetContentL();
+    //frag_Content = pFragment->Content();
+	if(pFragment->Content() == KNullDesC8)
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_LocalNameL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_LocalName = pFragment->LocalName();
+    if(frag_LocalName == _L8("Test"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_NsUriL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_NsUri= pFragment->NsUri();
+    if(frag_NsUri == _L8("nsuri"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_NsPrefixL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    TPtrC8 frag_NsUri= pFragment->NsUri();
+    if(frag_NsUri == _L8("nsuri"))
+    	Flag =1;
+    else
+    	Flag =0;
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_ExtractElementL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	_LIT8(KFragment,"<Test xmlns=\"nsuri\"><Child/>Test Content</Test>");
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("nsuri"),_L8("Test"),_L8("Pre"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    CSenElement* Extr_Element = pFragment->ExtractElement();
+    CleanupStack::PushL(Extr_Element);
+    HBufC8* Ext_ElementBuf = Extr_Element->AsXmlL();
+    if(!(KFragment().Compare(*Ext_ElementBuf )))
+    	Flag =1;
+    else
+    	Flag =0;
+    
+    CleanupStack::PopAndDestroy(Extr_Element);
+    CleanupStack::PopAndDestroy(pFragment);
+    delete Ext_ElementBuf ;
+
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_SetAttributesLL( CStifItemParser& aItem )
+	{
+    TBool Flag;   
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("xmlns"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    CleanupStack::Pop(4); 
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray); 
+      
+    CSenBaseFragment *pFragment = CSenBaseFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pFragment);
+    pFragment->SetAttributesL(attrArray);
+    TPtrC8 frag_NameSpace = pFragment->NsUri();
+    if(frag_NameSpace == _L8("Value"))
+    	Flag = 1;
+    else
+    	Flag = 0;
+
+	CleanupStack::PopAndDestroy(pFragment);
+	CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    if (Flag)	return KErrNone;
+    else return KErrArgument;
+    }
+TInt CsenxmlTester::CSenBaseFragment_ConsistsOfLL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	CSenElement& element = pFragment->AsElement();
+    element.AddElementL(_L8("Child"));
+    element.SetContentL(_L8("Test Content"));
+    
+    CSenBaseFragment* pFragment2 = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment2);
+	CSenElement& element2 = pFragment2->AsElement();
+    element2.AddElementL(_L8("Child"));
+    element2.SetContentL(_L8("Test Content"));
+    
+    Flag = pFragment->ConsistsOfL(*pFragment2);
+    
+    CleanupStack::PopAndDestroy(pFragment2);
+    CleanupStack::PopAndDestroy(pFragment);
+    if (Flag) return KErrNone;
+    else return KErrArgument;
+	}
+TInt CsenxmlTester::CSenBaseFragment_ParseLL( CStifItemParser& aItem )	
+	{
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	
+	pFragment->SetReader(*iXmlReader);
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+    CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    return retVal;
+	}
+	
+TInt CsenxmlTester::CSenBaseFragment_ParseL1L( CStifItemParser& aItem )	
+	{
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;&#34;assa\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2<Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	
+	pFragment->SetReader(*iXmlReader);
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+	CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    if (retVal == -993) return KErrNone;
+    else return retVal;
+	}
+
+TInt CsenxmlTester::CSenBaseFragment_SetContentOfLL( CStifItemParser& aItem )
+{
+	CTestBaseFragment *pTestFragment = CTestBaseFragment::NewL(_L8("Test Fragment"));
+	CleanupStack::PushL(pTestFragment);
+	CSenElement& element = pTestFragment->AsElement();
+	element.AddElementL(_L8("Test Child"));
+	MSenElement& element1 = pTestFragment->SetContentOfL(_L8("Test Child"),_L8("Child Content"));
+	TInt retVal = element1.Content().Compare(_L8("Child Content"));
+	CleanupStack::PopAndDestroy(pTestFragment);
+	return retVal;
+}
+TInt CsenxmlTester::CSenBaseFragment_ContentOfL( CStifItemParser& aItem )
+{
+	CTestBaseFragment *pTestFragment = CTestBaseFragment::NewL(_L8("Test Fragment"));
+	CleanupStack::PushL(pTestFragment);
+	pTestFragment->SetContentOfL(_L8("Test Child"),_L8("Child Content"));
+	TInt retVal = pTestFragment->ContentOf(_L8("Test Child")).Compare(_L8("Child Content"));
+	CleanupStack::PopAndDestroy(pTestFragment);
+	return retVal;
+}
+
+TInt CsenxmlTester::CSenXMLReader_ParserFeatureL( CStifItemParser& aItem )
+	{
+	TBool Flag;
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">&lt;Content2&quot;&gt;</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenBaseFragment* pFragment = CSenBaseFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	pFragment->SetReader(*iXmlReader);
+	TInt feature = iXmlReader->ParserFeature();
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+    CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    if (retVal == KErrNone && feature  == 64) return KErrNone;
+    else return KErrArgument;
+	}
+	
+//	EXPORT_C void CSenXmlReader::ParseL(RFs &aRFs, const TDesC& aFileToParse)
+
+TInt CsenxmlTester::CSenXMLReader_ParseLL( CStifItemParser& aItem )
+	{
+	SetupL();
+	CSenDomFragment* pFragment = CSenDomFragment::NewL();
+	CleanupStack::PushL(pFragment);
+	pFragment->SetReader(*iXmlReader);
+	iXmlReader->SetContentHandler(*pFragment);
+	_LIT(KFile,"c:\\wf_constraint_elem.xml");
+	RFs fs;
+	CleanupClosePushL(fs);
+	TRAPD(rFile, fs.Connect());
+	TRAPD(retVal,iXmlReader->ParseL(fs,KFile));
+	CleanupStack::PopAndDestroy();
+	CleanupStack::PopAndDestroy(pFragment);
+	Teardown();
+	return retVal;
+	}
+TInt CsenxmlTester::CSenDomFragment_NewL_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenDomFragment_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenDomFragment* pElement=CSenDomFragment::NewL(*ele);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+	
+TInt CsenxmlTester::CSenDomFragment_NewL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenDomFragment_NewL_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenDomFragment_NewL_4L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenDomFragment_NewL_5L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenDomFragment_NewL_6L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenBaseElement* ele = CSenBaseElement::NewL(_L8("Nokia"));
+    CleanupStack::PushL(ele);
+    CSenElement* parent = ele->Parent();
+    CSenDomFragment* pElement = CSenDomFragment::NewL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs, *parent);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(ele);
+    Teardown();
+    return KErrNone;
+    }
+/*	
+TInt CsenxmlTester::CSenDomFragment_ExpandLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    
+    CleanupStack::PushL(pElement);
+	pElement->ExpandL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"), aAttrs);
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenDomFragment_ResumeParsingFromLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    
+    CleanupStack::PushL(pElement);
+	pElement->ResumeParsingFromL(_L8("nsuri"),_L8("Nokia"),_L8("n:Nokia"));
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+*/    
+    TInt CsenxmlTester::CSenDomFragment_ParseWithLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    CSenXmlReader* aReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(aReader);
+    
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    CleanupStack::PushL(pElement);
+    pElement->ParseWithL(*aReader);
+    CleanupStack::PopAndDestroy(pElement);
+    CleanupStack::PopAndDestroy(aReader);
+    
+    Teardown();
+    return KErrNone;
+    }
+
+    TInt CsenxmlTester::CSenDomFragment_SetAttributesLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    RAttributeArray aAttrs;
+    CSenDomFragment* pElement=CSenDomFragment::NewL();
+    pElement->SetAttributesL(aAttrs);
+    CleanupStack::PushL(pElement);
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenxmlTester::CSenDomFragment_ParseL1L( CStifItemParser& aItem )	
+	{
+	SetupL();
+	_LIT8(KInputString, "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <a:Test character=\"&quot;&#34;assa\" xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2<Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenDomFragment* pFragment = CSenDomFragment::NewL(_L8("Test"));
+	CleanupStack::PushL(pFragment);
+	
+	pFragment->SetReader(*iXmlReader);
+	TRAPD(retVal,pFragment->ParseL(KInputString));
+	CleanupStack::PopAndDestroy(pFragment);
+    Teardown();
+    if (retVal == -993) return KErrNone;
+    else return retVal;
+	}    
+/*    
+TInt CsenxmlTester::CSenDomFragment_ConsistsOfLL()
+	{
+    SetupL();
+    CSenDomFragment* pFragmentA=CSenDomFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pFragmentA);
+    CSenElement pElement=pFragmentA->AsElement();
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    CSenDomFragment* pChildFragment1A=CSenDomFragment::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenDomFragment* pChild2A=CSenDomFragment::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2A);
+    pElementA->SetContentL(_L8("Nokia organisation structure"));
+    pElementA->AsElement()
+    pElementA->AddElementL(*pChild1A);
+    pElementA->AddElementL(*pChild2A);
+    
+    CSenDomFragment* pElementB=CSenDomFragment::NewL(_L8("Nokia"));
+    CleanupStack::PushL(pElementB);
+    CSenDomFragment* pChild1B=CSenDomFragment::NewL(_L8("Asp"));
+    CleanupStack::PushL(pChild1A);
+    CSenDomFragment* pChild2B=CSenDomFragment::NewL(_L8("WebServices"));
+    CleanupStack::PushL(pChild2B);
+    pElementB->SetContentL(_L8("Nokia organisation structure"));
+    pElementB->AddElementL(*pChild1B);
+    pElementB->AddElementL(*pChild2B);
+    
+    TBool ConsistOfFlag=pElementB->ConsistsOfL(*pElementA);
+    EUNIT_ASSERT( ConsistOfFlag );
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementB);
+    CleanupStack::Pop(2);
+    CleanupStack::PopAndDestroy(pElementA);
+    Teardown();
+    return KErrNone;
+    }
+*/
+
+TInt CsenxmlTester::CSenNamespace_NewL_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewL(_L8("n:"),_L8("nsuri"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenNamespace_NewLC_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewLC(_L8("n:"),_L8("nsuri"));
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CsenxmlTester::CSenNamespace_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewL(_L8("nsuri"));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+ TInt CsenxmlTester::CSenNamespace_NewLC_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement=CSenNamespace::NewLC(_L8("nsuri"));
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenNamespace_MatchesL_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenNamespace* pElement = CSenNamespace::NewL(_L8("nsuri"));
+    CSenNamespace* pEle = CSenNamespace::NewL(_L8("nsuri"));
+
+    CleanupStack::PushL(pElement);
+    CleanupStack::PushL(pEle);
+    
+    
+    if(pElement!=NULL && pEle!=NULL)
+    	Flag = pEle->MatchesL(*pElement);
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pEle);
+    CleanupStack::PopAndDestroy(pElement);
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenNamespace_InsertLL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    const TInt KFlatBufSize = 64;
+	CBufFlat *pBuf = CBufFlat::NewL(KFlatBufSize);
+	CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs); 
+      
+    CSenNamespace* pElement = CSenNamespace::NewL(_L8("nsuri"));
+    CleanupStack::PushL(pElement);
+	
+    pElement->InsertL(bufWs);
+    CleanupStack::PopAndDestroy(pElement);
+	CleanupStack::PopAndDestroy(); // bufWs.Close();
+    CleanupStack::PopAndDestroy(); // pBuf;    
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+    
+    
+TInt CsenxmlTester::CSenXmlReader_NewL_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewL();
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    delete pElement;
+    pElement = NULL;
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewLC_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC();
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewL_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(param);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewLC_1L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC(param);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewL_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(_L8(""));
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewLC_2L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC(_L8(""));
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewL_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(_L8(""), param);
+    CleanupStack::PushL(pElement);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlReader_NewLC_3L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool Flag;
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewLC(_L8(""), param);
+    if(pElement!=NULL)
+    	Flag=1;
+    else
+    	Flag=0;
+        /*EUNIT_ASSERT( Flag );*/
+    if(!Flag)
+    return KErrArgument;   
+
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlReader_EnabledParserFeature_L (CStifItemParser& aItem)
+    {
+    SetupL();
+    TInt param = 1;
+    CSenXmlReader* pElement=CSenXmlReader::NewL(param);
+    CleanupStack::PushL(pElement);
+/*    EUNIT_ASSERT_EQUALS(param,pElement->EnabledParserFeature());*/
+    TL(param == pElement->EnabledParserFeature());
+    CleanupStack::PopAndDestroy(pElement);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_ToUtf8LCL (CStifItemParser& aItem)
+    {
+    SetupL();
+    HBufC8* buf; 
+    
+    _LIT16(KText, "text");
+    _LIT8(KText1, "text");
+    buf = SenXmlUtils::ToUtf8LC(KText);
+    TPtr8 ptr = buf->Des();
+    TL(ptr == KText1);
+    CleanupStack::PopAndDestroy();
+    Teardown();
+    return KErrNone;
+    }
+ 
+TInt CsenxmlTester::CSenXmlUtils_StartsWithL (CStifItemParser& aItem)
+    {
+    SetupL();
+    HBufC8* buf; 
+    TBool retVal;
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+    retVal = SenXmlUtils::StartsWith(KText, KText1);
+    TL(retVal == KErrNone);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlUtils_EndsWithL (CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool retVal;
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+    retVal = SenXmlUtils::EndsWith(KText, KText1);
+    TL(retVal == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_AttrValueL (CStifItemParser& aItem)
+    {
+    SetupL();
+	RAttributeArray  array;   
+    _LIT8(KText, "text");
+    TPtrC8 ptr = SenXmlUtils::AttrValue(array, KText);
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlUtils_AllocAttrValueLL(CStifItemParser& aItem)
+    {
+    SetupL();
+	RAttributeArray  array;   
+    _LIT8(KText, "text");
+    HBufC8* ptr = SenXmlUtils::AllocAttrValueL(array, KText);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_DecodeHttpCharactersLL(CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool retVal;
+    HBufC8* ptr = NULL;
+    _LIT8(KText, "text");
+    retVal = SenXmlUtils::DecodeHttpCharactersL(KText, ptr);
+    TL(retVal == KErrNone);
+
+    Teardown();
+    return KErrNone;
+    }
+    
+    
+TInt CsenxmlTester::CSenXmlUtils_DecodeHttpCharactersLCL(CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool retVal;
+    _LIT8(KText, "text");
+    HBufC8* buf = SenXmlUtils::DecodeHttpCharactersLC(KText);
+    TPtr8 ptr = buf->Des();
+    CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+
+TInt CsenxmlTester::CSenXmlUtils_NsPrefixL(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "m:");
+    _LIT8(KText1, "m");
+    
+    TPtrC8 ptr = SenXmlUtils::NsPrefix(KText);
+    //TL(ptr == KText1);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_LocalNameL(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "http:\\");
+    _LIT8(KText1, "\\");
+    TPtrC8 ptr = SenXmlUtils::LocalName(KText);
+    //TL(ptr == KText1);
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_RemoveAttributeLL(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	CSenBaseAttribute* attr = CSenBaseAttribute::NewL(KText, KText1);
+    attr = SenXmlUtils::RemoveAttributeL(*element, KText);
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_RemoveAttributeL1L(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	CSenBaseAttribute* attr = CSenBaseAttribute::NewL(KText, KText1);
+	CSenBaseAttribute* attr1 = CSenBaseAttribute::NewL(KText, KText1);
+	
+	
+    attr = SenXmlUtils::RemoveAttributeL(*element, attr1);
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_AddAttributeLL(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	
+    TDesC8 desc = SenXmlUtils::AddAttributeL(*element, KText,  KText , KText );
+    
+    Teardown();
+    return KErrNone;
+    }
+    
+TInt CsenxmlTester::CSenXmlUtils_AddAttributeL1L(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+    TDesC8 desc = SenXmlUtils::AddAttributeL(*element, KText,  KText );
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenXmlUtils_AddAttributeL2L(CStifItemParser& aItem)
+    {
+    SetupL();
+    _LIT8(KText, "text");
+    _LIT8(KText1, "text1");
+	CSenBaseElement* element = CSenBaseElement::NewL(KText);
+	CSenBaseAttribute* attr = CSenBaseAttribute::NewL(KText, KText1);
+	
+    TDesC8 desc = SenXmlUtils::AddAttributeL(*element, attr);
+    
+    Teardown();
+    return KErrNone;
+    }
+TInt CsenxmlTester::CSenXmlUtils_EncodeHttpCharactersLCL(CStifItemParser& aItem)
+    {
+    SetupL();
+    TBool retVal;
+    _LIT8(KText, "text");
+    HBufC8* buf = SenXmlUtils::EncodeHttpCharactersLC(KText);
+    //TPtr8 ptr = buf->Des();
+    CleanupStack::PopAndDestroy();
+    
+    Teardown();
+    return KErrNone;
+    }
+
+TInt CsenxmlTester::CSenDomFragment_BaseConstructL( CStifItemParser& aItem )
+{
+	SetupL();
+
+	CTestDomFragment *pTestFragment = CTestDomFragment::NewL(_L8("Test Fragment"));
+	TInt retVal = 0;
+    CSenXmlReader* aReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(aReader);
+
+	CleanupStack::PushL(pTestFragment);
+	pTestFragment->BaseConstructL(*aReader);
+	CleanupStack::PopAndDestroy(pTestFragment);
+    CleanupStack::PopAndDestroy(aReader);
+	
+	Teardown();
+
+	return retVal;
+}
+
+TInt CsenxmlTester::CSenBaseFragment_BaseConstructL( CStifItemParser& aItem )
+{
+	SetupL();
+
+	CTestBaseFragment *pTestFragment = CTestBaseFragment::NewL(_L8("Test Fragment"));
+	TInt retVal = 0;
+    CSenXmlReader* aReader = CSenXmlReader::NewL();
+    CleanupStack::PushL(aReader);
+
+	CleanupStack::PushL(pTestFragment);
+	pTestFragment->BaseConstructL(*aReader);
+	CleanupStack::PopAndDestroy(pTestFragment);
+    CleanupStack::PopAndDestroy(aReader);
+	
+	Teardown();
+
+	return retVal;
+}
+
+// -----------------------------------------------------------------------------
+// CsenxmlTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CsenxmlTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File]-Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/src/testxml.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include "testxml.h"
+
+CTestBaseFragment* CTestBaseFragment::NewL(const TDesC8& aLocalName)
+{
+	return((CTestBaseFragment*)CSenBaseFragment::NewL(aLocalName));
+}
+
+CTestBaseFragment::~CTestBaseFragment()
+{
+	
+}
+
+MSenElement& CTestBaseFragment::SetContentOfL(const TDesC8& aLocalName,const TDesC8& aContent)
+{
+	return(CSenBaseFragment::SetContentOfL(aLocalName,aContent));
+}
+
+TPtrC8 CTestBaseFragment::ContentOf(const TDesC8& aLocalName)
+{
+	return(CSenBaseFragment::ContentOf(aLocalName));
+}
+
+void CTestBaseFragment::BaseConstructL(CSenXmlReader& aReader)
+{
+	return(CSenBaseFragment::BaseConstructL(aReader));
+}
+
+
+CTestDomFragment* CTestDomFragment::NewL(const TDesC8& aLocalName)
+{
+	return((CTestDomFragment*)CSenDomFragment::NewL(aLocalName));
+}
+
+
+void CTestDomFragment::BaseConstructL(CSenXmlReader& aReader)
+{
+	return(CSenDomFragment::BaseConstructL(aReader));
+}
+
+
+CTestBaseElement* CTestBaseElement::NewL(const TDesC8& aLocalName)
+{
+	return((CTestBaseElement*)CSenBaseElement::NewL(aLocalName));
+}
+
+
+const TDesC8& CTestBaseElement::AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue)
+{
+	return(CSenBaseElement::AddAttributeL(aAttrName, aValue));
+}
+
+
+CTestBaseElement::~CTestBaseElement()
+{
+	
+}
+
+CTestXmlElement* CTestXmlElement::NewL(const TDesC8& aLocalName)
+{
+	return((CTestXmlElement*)CSenXmlElement::NewL(aLocalName));
+}
+
+
+const TDesC8& CTestXmlElement::AddAttributeL(const TDesC8& aAttrName, const TDesC8& aValue)
+{
+	return(CSenXmlElement::AddAttributeL(aAttrName, aValue));
+}
+
+
+CTestXmlElement::~CTestXmlElement()
+{
+	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_extensions_api/xml_extensions_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="0659b9993700c2c727e9f2468d836adf" dataversion="1.0">
+  <name>XML Extensions API</name>
+  <description>API to Web Services Framework specific adaptations to standard XML APIs.</description>
+  <type>c++</type>
+  <collection>webservices</collection>
+  <libs>
+    <lib name="SenXml.LIB" />
+  </libs>
+  <release category="public" sinceversion="3.0"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        File that exports the files belonging to 
+:                Web Service Connection API
+*
+*/
+
+
+
+
+
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/RSenDocument.h      				MW_LAYER_PUBLIC_EXPORT_PATH(RSenDocument.h)
+../inc/SenDomFragmentBase.h				MW_LAYER_PUBLIC_EXPORT_PATH(SenDomFragmentBase.h)
+../inc/SenFragmentBase.h      		MW_LAYER_PUBLIC_EXPORT_PATH(SenFragmentBase.h)
+../inc/SenParser.h         				MW_LAYER_PUBLIC_EXPORT_PATH(SenParser.h)  
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/inc/RSenDocument.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class extends RDocument, enabling handle counting
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef R_SEN_DOCUMENT
+#define R_SEN_DOCUMENT
+
+#include <xmlengdocument.h>
+#include <xmlengdomimplementation.h>
+
+typedef struct
+    {
+    TInt* ipOpenDocuments;
+    void* iInternal;
+    RXmlEngDOMImplementation iDomImpl;
+    } TSenDocumentData;
+
+class RSenDocument : public RXmlEngDocument
+    {
+    public:
+
+
+        /**
+         * Default constructor.
+         *
+         * @since S60 v3.1
+         */
+        /*inline RSenDocument():RDocument()
+            {
+            ipOpenDocuments = new (ELeave) TInt(1);
+            }*/
+
+        /**
+        * Create new document.
+        *
+        * @since S60 v3.1
+        */
+        IMPORT_C static RSenDocument NewL();
+
+        /**
+        * Create new document and put it on cleanup stack.
+        *
+        * @since S60 v3.1
+        */
+        IMPORT_C static RSenDocument NewLC();
+
+        /**
+        * Create new document.
+        *
+        * @since S60 v3.1
+        * @param aInternal Document pointer
+        */
+        IMPORT_C static RSenDocument NewL(void* aInternal);
+
+        /**
+        * Create new document and put it on cleanup stack.
+        *
+        * @since S60 v3.1
+        * @param aInternal Document pointer
+        */
+        IMPORT_C static RSenDocument NewLC(void* aInternal);
+
+        /**
+        * Copies a RSenDocument.
+        * Both the original and the copy must be separately closed.
+        *
+        * @since S60 v3.1
+        * @return Copy of this RSenDocument
+        */
+        IMPORT_C RSenDocument Copy();
+        
+        /**
+        * Closes a RSenDocument.
+        *
+        * You must close (or destroy) every RSenDocument you create using NewL or NewLC.
+        * In other words, every call to RSenDocument::Copy(), RSenDocument::NewL() and
+        * RSenDocument::NewLC() must be matched by a close or destroy.
+        * Note: Also Destroy() method can be used to close RSenDocument.
+        *
+        * @since S60 v3.1
+        * @see RSenDocument::Destroy()
+        */        
+        IMPORT_C void Close();
+        
+        /**
+        * Closes a RSenDocument.
+        *
+        * You must destroy (or close) every RSenDocument you create using NewL or NewLC.
+        * In other words, every call to RSenDocument::Copy(), RSenDocument::NewL() and
+        * RSenDocument::NewLC() must be matched by a close or destroy.
+        * Note: Also Close() method can be used to destroy RSenDocument.
+        *
+        * @since S60 v3.1
+        * @see RSenDocument::Close()
+        */        
+        IMPORT_C void Destroy();
+        
+        /**
+        * Sets the Tls
+        *
+        * @return KErrNone
+        *		  KErrUnknown if the Tls is unknown
+        *		  KErrAlreadyExists	if the Tls already exist.
+        */
+        IMPORT_C static TInt ManualXmlEngineTlsAttachL();
+
+        /**
+        * Frees the Tls
+        *
+        * @return KErrNone
+        *		  KErrNotFound if the Tls is not found
+        */
+        IMPORT_C static TInt ManualXmlEngineTlsCleanup();
+
+    public:
+    	TSenDocumentData* ipData;
+    };
+
+#endif // R_SEN_DOCUMENT
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/inc/SenDomFragmentBase.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,478 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements XML DOM fragment using libxml2 classes
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_DOM_FRAGMENT_BASE_H
+#define SEN_DOM_FRAGMENT_BASE_H
+
+//  INCLUDES
+#include <SenFragmentBase.h>
+
+// FORWARD DECLARATIONS
+class RFileLogger;
+
+// CLASS DECLARATION
+
+/**
+* Class implements DOM fragment functionality
+* The implementation further extends CSenBaseFragment
+* functionality. In DOM fragment, all child elements
+* are parsed into separate element objects. This makes
+* it possible to reference any child which offer methods
+* declared in XML element interface. Any such element
+* can also be easily extracted (detached) from this
+* root DOM fragment.
+* @lib SenFragment.dll
+* @since Series60 4.0
+*/
+class CSenDomFragmentBase : public CSenFragmentBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Basic contructor. Should be used only for parsing new fragments etc. 
+        * Constructing DomFragments for other use should be done with at least 
+        * localname parameter.
+        * @since Series60 4.0
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL();
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aElement Element to copy construction data from.
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(
+            const TXmlEngElement& aElement);
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aLocalName is the XML localname of this fragment
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(const TDesC8& aLocalName);
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace user of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName);
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace user of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aPrefix    is the XML prefix of this fragment
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aPrefix);
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aPrefix    is the prefix of this fragment
+        * @param aAttrs     are the XML attributes of this fragment
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aPrefix,
+                                              const RAttributeArray& aAttrs);
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aNsUri     is the XML namespace of this fragment
+        * @param aLocalName is the XML localname of this fragment
+        * @param aPrefix    is the prefix of this fragment
+        * @param aAttrs     are the XML attributes of this fragment
+        * @param aParent    is the parent XML element of this fragment
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aPrefix,
+                                              const RAttributeArray& aAttrs,
+                                              TXmlEngElement& aParent);
+
+        /**
+        * Basic constructor.
+        * @since Series60 4.0
+        * @param aNsUri         is the XML namespace of this fragment
+        * @param aLocalName     is the XML localname of this fragment
+        * @param aPrefix        is the prefix of this fragment
+        * @param aAttrs         are the XML attributes of this fragment
+        * @param aParent        is the parent XML element of this fragment
+        * @param aOwnerDocument is the document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C static CSenDomFragmentBase* NewL(const TDesC8& aNsUri,
+                                              const TDesC8& aLocalName,
+                                              const TDesC8& aPrefix,
+                                              const RAttributeArray& aAttrs,
+                                              TXmlEngElement& aParent,
+                                              RSenDocument& aOwnerDocument);
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CSenDomFragmentBase();
+
+        // New functions
+    
+        /**
+        * Initiates the parsing chain where new delegate will be created with
+        * given parameters and parsing will be delegated to it. Should not be
+        * called externally.
+        * @since Series60 4.0
+        * @param aElement     The RTagInfo class holding information that describes
+        *                     the element.
+        * @param aAttributes  The attributes of the new element
+        * @param aErrorCode   Error code
+        */
+        IMPORT_C virtual void ExpandL(const RTagInfo& aElement,
+                                      const RAttributeArray& aAttributes,
+                                      TInt aErrorCode);
+                                      
+        // Functions from base classes
+
+        // From CSenBaseFragment
+        
+        /**
+        * Resumes the parsing. Usually called by the delegate fragment which was
+        *                      parsing itself after DelegateParsingL().
+        * @since Series60 4.0
+        * @param aElement     The RTagInfo class holding information that describes
+        *                     the element.
+        * @param aErrorCode   Error code
+        */
+        IMPORT_C virtual void OnResumeParsingFromL(const RTagInfo& aElement,
+                                           TInt aErrorCode);
+
+        /**
+        * Sets the attributes for the fragment.
+        * @since Series60 4.0
+        * @param aAttributes    The array of attributes.
+        */
+        IMPORT_C virtual void AddAttributesL(const RAttributeArray& aAttrs);
+        
+        /**
+         * Gets the fragment data as an UTF-8 form XML.
+         * @since Series60 4.0
+         * @return  fragment as XML. Caller takes ownership.
+         */ 
+        IMPORT_C virtual HBufC8* AsXmlL();
+        
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
+    	                                      const RAttributeArray& aAttributes,
+    	                                      TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+        IMPORT_C virtual void OnContentL(const TDesC8& aBytes,
+                                         TInt aErrorCode);
+        
+        /**
+         * Overriding content writing from CSenBaseFragment to do nothing in
+         * DOM fragment (because the tree is expanded).
+         * @since Series60 4.0
+         * @param aElement      The RTagInfo class holding information that
+         *                      describes the element.
+         * @param aAttributes   The attributes of the new element
+         */
+        IMPORT_C void OnWriteStartElementL(const RTagInfo& aElement, 
+                                           const RAttributeArray& aAttributes);
+
+        /**
+         * Overriding content writing from CSenBaseFragment to do nothing in
+         * DOM fragment (because the tree is expanded).
+         * @since Series60 4.0
+         * @param aElement      The RTagInfo class holding information that
+         *                      describes the element.
+         */
+        IMPORT_C void OnWriteEndElementL(const RTagInfo& aElement);        
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+        IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnEndDocumentL(TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt ErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnError(TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 4.0
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual TAny* GetExtendedInterface(const TInt32 aUid);
+
+        // From CSenBaseFragment
+        IMPORT_C virtual TPtrC8 ContentL();
+        
+        IMPORT_C virtual TXmlEngNamespace Namespace(const TDesC8& aPrefix);
+        
+//        IMPORT_C virtual void DetachL();
+        
+        IMPORT_C virtual void ResetContentL();
+
+        IMPORT_C virtual TPtrC8 LocalName() const;
+        
+        IMPORT_C virtual TPtrC8 NsUri() const;
+
+        IMPORT_C virtual TPtrC8 NsPrefix() const;    
+
+        IMPORT_C virtual TXmlEngElement AsElementL();
+
+        IMPORT_C virtual RSenDocument& AsDocumentL();
+
+        IMPORT_C virtual TXmlEngElement ExtractElement();
+        
+        IMPORT_C virtual void OnDelegateParsingL(CSenFragmentBase& aDelegate);
+
+        IMPORT_C virtual void OnDelegateParsingL(const RTagInfo& aElement, 
+                                                 const RAttributeArray& aAttributes, 
+                                                 TInt aErrorCode);
+        
+        IMPORT_C virtual void SetOwner(CSenFragmentBase& aFragment);
+
+        IMPORT_C virtual HBufC* AsXmlUnicodeL();
+
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWs);
+
+        IMPORT_C virtual TBool ConsistsOfL(CSenFragmentBase& aCandidate);
+        
+        IMPORT_C void SetContentHandler(CSenFragmentBase& aContentHandler);
+        
+    protected: // From CSenBaseFragment
+    
+        void RenameL(const TDesC8& aLocalName, const TDesC8& aPrefix, const TDesC8& aNamespace);
+
+        void RenameL(const TDesC8& aLocalName, const TDesC8& aNamespace);
+
+        void RenameLocalNameL(const TDesC8& aLocalName);
+
+        void RenameNamespaceL(const TDesC8& aNamespace);
+
+        void RenamePrefixL(const TDesC8& aPrefix);
+
+        void RenameNamespaceL(const TDesC8& aPrefix, const TDesC8& aNamespace);
+         
+        IMPORT_C TXmlEngElement SetContentOfL(const TDesC8& aLocalName,
+                                        const TDesC8& aContent);
+
+        IMPORT_C TPtrC8 ContentOf(const TDesC8& aLocalName);        
+
+        IMPORT_C virtual TBool ConsistsOfL(TXmlEngElement& aElement, TXmlEngElement& aCandidate);
+
+        IMPORT_C virtual void AddNamespacesL();
+
+    protected:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenDomFragmentBase();
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        */
+        IMPORT_C void BaseConstructL();
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aElement is the XML element of this fragment.
+        */
+        IMPORT_C void BaseConstructL(const TXmlEngElement& aElement);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aLocalName The local name of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aPrefix    The prefix of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aPrefix    The prefix of the element
+        * @param aAttrs     The attributes of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix,
+                                     const RAttributeArray& aAttrs);
+
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aNsUri     The namespace URI of the element
+        * @param aLocalName The local name of the element
+        * @param aPrefix    The prefix of the element
+        * @param aAttrs     The attributes of the element
+        * @param aParent    The parent of the element
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix,
+                                     const RAttributeArray& aAttrs,
+                                     TXmlEngElement& aParent);
+                                     
+        /**
+        * "ConstructL" method for calling the base classes ones.
+        * @since Series60 4.0
+        * @param aNsUri         The namespace URI of the element
+        * @param aLocalName     The local name of the element
+        * @param aPrefix        The prefix of the element
+        * @param aAttrs         The attributes of the element
+        * @param aParent        The parent of the element
+        * @param aOwnerDocument The document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix,
+                                     const RAttributeArray& aAttrs,
+                                     TXmlEngElement& aParent,
+                                     RSenDocument& aOwnerDocument);
+
+        /**
+         *  Callback functions which implement the XML content handler interface.
+         *  Inheriting classes can override these.
+         */
+         
+        // From CSenBaseFragment 
+                                       
+    protected: // Data
+        CSenDomFragmentBase* ipDomDelegate;
+    };
+
+#endif //SEN_DOM_FRAGMENT_BASE_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/inc/SenFragmentBase.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,750 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        Class implements XML base fragment using libxml2 classes
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_FRAGMENT_BASE_H
+#define SEN_FRAGMENT_BASE_H
+
+// INCLUDES
+#include <s32mem.h>
+
+#include <xml/contenthandler.h>
+#include <RSenDocument.h>
+#include <SenParser.h>
+#include <xmlengelement.h>
+
+using namespace Xml;
+
+// CONSTANTS
+
+// Fragment's internal states.
+const TInt KSenStateNotSet      = -1;
+const TInt KSenStateIgnore      =  0;
+const TInt KSenStateSave        =  1;
+const TInt KSenStateResume      =  2;
+const TInt KSenStateDelegate    =  3;
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+//class CSenParser;
+class CSenNamespaceData;
+
+// CLASS DECLARATION
+
+/**
+* Class implements basic functionality of an XML fragment
+* Typically base fragment is used to parse certain part of some XML document.
+* The element is identified by local name (or qualified name) and namespace.
+* All child elements between start tag and and end tag defined this fragment
+* will become content of this BaseFragment. In other words, BaseFragment has
+* all data inside a single element.
+* BaseFragment will parse only namespace (xmlns) attributes from a document
+* and rest of the attributes are to be handled by subclasses, which should
+* overwrite SetAttributesL() method to achieve this.
+* The CSenFragmentReader class will do the actual parsing and this class will
+* act as content handler for XML parser SAX events.
+* @lib SenFragment.dll
+* @since Series60 4.0
+*/
+class CSenFragmentBase : public CBase, public MContentHandler
+    {
+    friend class CSenParserImpl;
+    
+    public:  // Constructors and destructor
+        
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 4.0
+         *  @param aElement is the element where construction 
+         *                  data will be copied from.
+         */
+        IMPORT_C static CSenFragmentBase* NewL(const TXmlEngElement& aElement);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 4.0
+         *  @param aLocalName: is the XML localname for this fragment
+         */
+        IMPORT_C static CSenFragmentBase* NewL(const TDesC8& aLocalName);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 4.0
+         *  @param aNsUri:  XML namespace URI
+         *  @param aLocalName:  XML localname
+         */
+        IMPORT_C static CSenFragmentBase* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 4.0
+         *  @param aNsUri       XML namespace URI
+         *  @param aLocalName   XML localname
+         *  @param aPrefix      XML prefix
+         */
+        IMPORT_C static CSenFragmentBase* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aPrefix);
+
+        /**
+         * Standard 2 phase constructor.
+         * @since Series60 4.0
+         * @param aNsUri        XML namespace URI
+         * @param aLocalName    XML localname
+         * @param aPrefix       XML prefix
+         * @param apAttrs       XML attributes
+         */
+         IMPORT_C static CSenFragmentBase* NewL(const TDesC8& aNsUri,
+                                                const TDesC8& aLocalName,
+                                                const TDesC8& aPrefix,
+                                                const RAttributeArray& apAttrs);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParent  Element to be set as fragment's parent element.
+         *  @since Series60 4.0
+         *  @param aNsUri       XML namespace URI
+         *  @param aLocalName   XML localname
+         *  @param aPrefix      XML prefix
+         *  @param apAttrs      XML attributes
+         *  @param aParent      Parent element
+         */
+        IMPORT_C static CSenFragmentBase* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aPrefix,
+                                               const RAttributeArray& apAttrs,
+                                               TXmlEngElement& aParent);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParent  Element to be set as fragment's parent element.
+         *  @since Series60 4.0
+         *  @param aNsUri           XML namespace URI
+         *  @param aLocalName       XML localname
+         *  @param aPrefix          XML prefix
+         *  @param apAttrs          XML attributes
+         *  @param aParent          Parent element
+         *  @param aOwnerDocument   The document which will be the owner of
+         *                          the elements of this fragment
+         */
+        IMPORT_C static CSenFragmentBase* NewL(const TDesC8& aNsUri,
+                                               const TDesC8& aLocalName,
+                                               const TDesC8& aPrefix,
+                                               const RAttributeArray& apAttrs,
+                                               TXmlEngElement& aParent,
+                                               RSenDocument& aOwnerDocument);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParent  Element to be set as fragment's parent element.
+         *  @since Series60 4.0
+         *  @param aRootElement     The element which will be the root element
+         *                          of this fragment.
+         *  @param aOwnerDocument   The document which will be the owner of
+         *                          the elements of this fragment
+         */
+        IMPORT_C static CSenFragmentBase* NewL(TXmlEngElement& aRootElement,
+                                               RSenDocument& aOwnerDocument);
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C virtual ~CSenFragmentBase();
+
+        // Functions from base classes
+        
+        // From MContentHandler:
+        
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+        IMPORT_C virtual void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnEndDocumentL(TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt ErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual void OnError(TInt aErrorCode);
+
+        /**
+         * Callback function implementing the XML content handler interface.
+         * Inheriting classes can override these.
+         * @since Series60 3.1
+         * @see MContentHandler
+         */
+    	IMPORT_C virtual TAny* GetExtendedInterface(const TInt32 aUid);
+
+        // New functions
+    
+        /**
+         * Getter for the content,which is returned as UTF-8 form XML.
+         * @since Series60 4.0
+         * @return content as UTF-8 form XML.
+         */
+        IMPORT_C virtual TPtrC8 ContentL();
+        
+        /**
+         * Gets the namespace object with a given prefix.
+         * @since Series60 4.0
+         * @param   aPrefix:    prefix that wanted namespace should have.
+         * @return namespace with the given prefix. If not found or given prefix
+         * is zero length, will return NULL.
+         */
+        IMPORT_C virtual TXmlEngNamespace Namespace(const TDesC8& aPrefix);
+        
+        /**
+         * @since Series60 4.0
+         * @return Detaches this fragment from its owner. All namespace
+         * references from possible parent fragments are declared in
+         * the scope of this fragment prior detaching.
+         */
+//        IMPORT_C virtual void DetachL();
+        
+        /**
+         * Resets the content of the fragment, and resets the namespaces.
+         * @since Series60 4.0
+         */
+        IMPORT_C virtual void ResetContentL();
+
+        /** 
+         * @since Series60 4.0
+         * @return the localname of this fragment as UTF-8 form descriptor
+         */
+        IMPORT_C virtual TPtrC8 LocalName() const;
+        
+        /**
+         * Getter for Fragment's namespace URI..
+         * @since Series60 4.0
+         * @return Namespace URI or KNullDesC if not set.
+         */
+        IMPORT_C virtual TPtrC8 NsUri() const;
+
+        /**
+         * Getter for namespace prefix of this fragment.
+         * @since Series60 4.0
+         * @return namespace prefix or KNullDesC if not set.
+         */
+        IMPORT_C virtual TPtrC8 NsPrefix() const;    
+
+        /**
+        * Returns the current XML element of this fragment. If element
+        * has not been set, this method will initialize new, un-initialized
+        * element.
+        * Method leaves with if there is not enough memory (OOM)
+        * @return reference to the element of this fragment
+        */
+        IMPORT_C virtual TXmlEngElement AsElementL();
+
+        /**
+        * Returns the current XML element of this fragment. If element
+        * has not been set, this method will initialize new, un-initialized
+        * element.
+        * Method leaves with if there is not enough memory (OOM)
+        * @return reference to the element of this fragment
+        */
+        IMPORT_C virtual RSenDocument& AsDocumentL();
+
+        /**
+         * Etracts the XML element from the fragment, leaving the fragment empty.
+         * Note(!): the return value (CSenElement) STRONGLY suggests that
+         * subclasses INHERIT CSenFragment in order properly comply the
+         * requirement of the ExtractElement() implementation.
+         * @since Series60 4.0
+         * @return the current object as element. May return NULL.
+         * Ownership IS TRANSFERRED to the caller.
+         */
+        IMPORT_C virtual TXmlEngElement ExtractElement();
+        
+        /**
+         * Let the delegate MSenFragment handle the following SAX events.
+         * This fragment is made the owner of the delegate and the delegate
+         * is expected to make this MSenFragment the receiver of SAX events
+         * once it has seen the end element for itself.
+         * @since Series60 4.0
+         * @param aDelegate is the fragment to start handling the SAX events.
+         */
+        IMPORT_C virtual void OnDelegateParsingL(CSenFragmentBase& aDelegate);
+
+        /**
+         * Creates a new fragment and lets the created MSenFragment handle the 
+         * following SAX events. This fragment is made the owner of the delegate
+         * and the delegate is expected to make this MSenFragment act as receiver
+         * for SAX events (callbacks) once it has seen the end element for itself.
+         * @since Series60 4.0
+         * @param aElement      The RTagInfo class holding information that
+         *                      describes the element.
+         * @param aAttributes   The attributes of the new element
+         * @param aErrorCode    Error code
+         */
+        IMPORT_C virtual void OnDelegateParsingL(const RTagInfo& aElement, 
+                                                 const RAttributeArray& aAttributes, 
+                                                 TInt aErrorCode);
+        
+        /**
+         * Sets a new parent for this fragment.
+         * @since Series60 4.0
+         * @param aFragment:    the new parent.
+         */
+        IMPORT_C virtual void SetOwner(CSenFragmentBase& aFragment);
+
+        /**
+         * Leave codes: 
+         * Resumes parsing to be handled by this fragment. Usually called by some
+         * delegate fragment which was set to be content handler because this
+         * fragment called DelegateParsingL().
+         * @since Series60 4.0
+         * @param aElement      The RTagInfo class holding information that
+         *                      describes the element.
+         * @param aErrorCode    Error code
+         */
+        IMPORT_C virtual void OnResumeParsingFromL(const RTagInfo& aElement, TInt aErrorCode);
+
+        /**
+         * Sets the attributes for the fragment. BaseFragment parses only
+         * namespace (xmlns) attributes from the document.
+         * Subclasses should override this method if they are intrested
+         * of handling any other XML attributes and their corresponding
+         * values.
+         * @since Series60 4.0
+         * @param aAttrs:   the array of attributes.
+         */
+//        IMPORT_C virtual void SetAttributesL(const RAttributeArray& aAttrs);
+        
+        /**
+         * Writes the start element tag to the content stream. 
+         * Derivants can override the basic usage used in BaseFragment.
+         * @since Series60 4.0
+         * @param aElement      The RTagInfo class holding information that
+         *                      describes the element.
+         * @param aAttributes   The attributes of the new element
+         */
+        IMPORT_C void OnWriteStartElementL(const RTagInfo& aElement, 
+                                           const RAttributeArray& aAttributes);
+        
+        /**
+         * Writes the end element tag to the content stream. 
+         * Derivants can override the basic usage used in BaseFragment.
+         * @since Series60 4.0
+         * @param aElement      The RTagInfo class holding information that
+         *                      describes the element.
+         */
+        IMPORT_C void OnWriteEndElementL(const RTagInfo& aElement);
+
+        /**
+         * Gets the fragment data as an unicode XML.
+         * @since Series60 4.0
+         * @return  fragment as XML. Caller takes ownership.
+         */ 
+        IMPORT_C virtual HBufC* AsXmlUnicodeL();
+
+        /**
+         * Gets the fragment data as an UTF-8 form XML.
+         * @since Series60 4.0
+         * @return  fragment as XML. Caller takes ownership.
+         */ 
+        IMPORT_C virtual HBufC8* AsXmlL();
+
+        /**
+         * Invokes AsElement().WriteAsXMLToL(aWs);
+         * @since Series60 4.0
+         * @param aWs is the stream into which the UTF-8 form XML will
+         *            be written.
+         */
+        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWs);
+
+        /**
+         * Checks if fragment matches to another fragment 
+         * by its content and child elements. 
+         * Fragment can contain more data than the given candidate.
+         * @since Series60 4.0
+         * @param aCandidate    The pattern to be matched. Must contain same or 
+         *                      less data for match to come true.
+         * @return ETrue if content and possible children match exactly 
+         *               to given pattern. EFalse otherwise.
+         */
+        IMPORT_C virtual TBool ConsistsOfL(CSenFragmentBase& aCandidate);
+        
+        //From SenParserImpl.h
+        IMPORT_C void SetContentHandler(CSenFragmentBase& aContentHandler);
+        
+        /**
+        * Sets the RSenDocument
+        * @param aDocument
+        */
+        IMPORT_C void SetDocument(RSenDocument& aDocument);
+
+    protected:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CSenFragmentBase();        
+        
+        /**
+         * Following BaseConstructL methods should be called from ConstructL() 
+         * methods of some deriving (fragment) class.
+         */
+
+        /**
+        * BaseConstructL, where an element is given as initializer.
+        * @since Series60 4.0
+        * @param aElement from which this fragment will be constructed from.
+        */
+        IMPORT_C void BaseConstructL(const TXmlEngElement& aSrc);
+        
+        /**
+        * BaseConstructL setting XML localname for this fragment.
+        * @since Series60 4.0
+        * @param aLocalName XML localname for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aLocalName);
+
+        /**
+        * BaseConstructL offering possibility to set XML namespace and localname.
+        * @since Series60 4.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName);
+
+        /**
+        * Base constructor
+        * @since Series60 4.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        * @param aQName XML qualifiedname for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix);
+        /**
+        * Base constructor
+        * @since Series60 4.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        * @param aQName XML qualifiedname for this fragment
+        * @param aAttrs XML attributes for this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix,
+                                     const RAttributeArray& aAttrs);
+
+        /**
+        * Base constructor
+        * @since Series60 4.0
+        * @param aNsUri XML namespace URI for this fragment
+        * @param aLocalName XML localname for this fragment
+        * @param aQName XML qualifiedname for this fragment
+        * @param aAttrs XML attributes for this fragment
+        * @param aParent parent to be set for this fragmemt
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix,
+                                     const RAttributeArray& aAttrs,
+                                     TXmlEngElement& aParent);
+
+        /**
+        * Base constructor
+        * @since Series60 4.0
+        * @param aNsUri         XML namespace URI for this fragment
+        * @param aLocalName     XML localname for this fragment
+        * @param aQName         XML qualifiedname for this fragment
+        * @param aAttrs         XML attributes for this fragment
+        * @param aParent        Parent to be set for this fragmemt
+        * @param aOwnerDocument The document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
+                                     const TDesC8& aLocalName,
+                                     const TDesC8& aPrefix,
+                                     const RAttributeArray& aAttrs,
+                                     TXmlEngElement& aParent,
+                                     RSenDocument& aOwnerDocument);
+        
+        /**
+        * Base constructor
+        * @since Series60 4.0
+        * @param aRootElement   The element which will be the root element
+        *                       of this fragment
+        * @param aOwnerDocument The document which will be the owner of
+        *                       the elements of this fragment
+        */
+        IMPORT_C void BaseConstructL(TXmlEngElement& aRootElement,
+                                     RSenDocument& aOwnerDocument);
+        
+        // New functions
+
+        /**
+        *  Adds new XML attributes to this fragment.
+        *  Can be overridden to replace old attributes.
+        *  @param  aAttrs: the array of attributes.
+        */
+        IMPORT_C virtual void AddAttributesL(const RAttributeArray& apAttrs);
+
+        /**
+        *  Adds new XML attributes to specified element.
+        *  Can be overridden to replace old attributes.
+        *  @param  aAttrs: the array of attributes.
+        */
+        IMPORT_C virtual void AddAttributesToElementL(TXmlEngElement element,
+                                         const RAttributeArray& apAttrs);
+        
+        /** 
+        * Method renames the XML properties of this fragment.
+        * @param aLocalName XML localname for this fragment
+        * @param aPrefix XML namespace prefix for this fragment
+        * @param aNamespace XML namespace URI for this fragment
+        * Method leaves with if there is not enough memory (OOM)
+        */
+        void RenameL(const TDesC8& aLocalName, const TDesC8& aPrefix, const TDesC8& aNamespace);
+
+        /** 
+        * Method renames the XML properties of this fragment.
+        * @param aLocalName XML localname for this fragment
+        * @param aNamespace XML namespace URI for this fragment
+        * Method leaves with if there is not enough memory (OOM)
+        */
+        void RenameL(const TDesC8& aLocalName, const TDesC8& aNamespace);
+
+        /** 
+        * Renames local name for this XML fragment.
+        * @param aLocalName XML localname for this fragment
+        * Method leaves with if there is not enough memory (OOM)
+        */
+        void RenameLocalNameL(const TDesC8& aLocalName);
+
+        /** 
+        * Renames namespace URI for this XML fragment.
+        * @param aNamespace XML namespace URI for this fragment
+        * Method leaves with if there is not enough memory(OOM)
+        */
+        void RenameNamespaceL(const TDesC8& aNamespace);
+
+        /** 
+        * Renames namespace prefix for this XML fragment.
+        * @param aPrefix XML namespace prefix for this fragment
+        * Method leaves with if there is not enough memory (OOM)
+        */
+        void RenamePrefixL(const TDesC8& aPrefix);
+
+        /** 
+        * Renames namespace prefix and namespace URI for this XML fragment.
+        * @param aPrefix XML namespace prefix for this fragment
+        * @param aNamespace XML namespace URI for this fragment
+        * Method leaves with if there is not enough memory (OOM)
+        */
+        void RenameNamespaceL(const TDesC8& aPrefix, const TDesC8& aNamespace);
+         
+        /**
+         * Sets content to a child element. If no element with given local name
+         * is not found, new one is added and content is set to that one.
+         * @since Series60 4.0
+         * @param aLocalName    The local name of element which content
+         *                      is about to be set
+         * @param aContent      Content to be set.
+         * @return              the element where content was set.
+         * Leave codes: 
+         *      KErrSenInvalidCharacters if aLocalName contains illegal characters.     
+         *      KErrSenZeroLengthDescriptor if aLocalName is zero length.
+         */
+        IMPORT_C TXmlEngElement SetContentOfL(const TDesC8& aLocalName,
+                                              const TDesC8& aContent);
+        /**
+         * Gets the content of a given element.
+         * @since Series60 4.0
+         * @param aLocalName    The local name of the element which content is 
+         *                      asked
+         * @return  the content which was asked
+         */
+        IMPORT_C TPtrC8 ContentOf(const TDesC8& aLocalName);        
+
+        IMPORT_C virtual TBool ConsistsOfL(TXmlEngElement& aElement, TXmlEngElement& aCandidate);
+        
+        /**
+        * Adds namespaces from internal array for the fragment.
+        * @since Series60 4.0
+        */
+        IMPORT_C virtual void AddNamespacesL();
+        
+        /**
+         * Sets content to a child element. If no element with given local name
+         * is not found, new one is added and content is set to that one.
+         * @since Series60 4.0
+         * @param aContent      Content to be set.
+         */        
+        IMPORT_C virtual void SetContentL(const TDesC8& aContent);
+        
+        /**
+         * Adds the content. 
+         * @since Series60 4.0
+         * @param aContent      Content to be set.
+         */                
+        IMPORT_C virtual void AddContentL(const TDesC8& aContent);        
+        
+        /**
+        * StartSavingContent changes the internal SAX parsing state of
+        * this fragment to KSenStateSave, which means that next call
+        * to OnStartElementL is treated as data, and not ignored
+        * (in DOM fragment implementation, it would be "extended"
+        * into a DOM object).
+        */        
+        IMPORT_C void StartSavingContent();
+
+        
+    private: // New functions
+    
+        /**
+         * Sets the XML parser to be used for parsing for the fragment.
+         * @since Series60 4.0
+         * @param aReader:      the reader to be used. 
+         *                      Ownership is NOT transferred.
+         */ 
+        IMPORT_C virtual void SetParser(CSenParser& aParser);
+
+    protected: // Data
+
+        // State variable indicating what this fragment
+        // is currently parsing. Even states (like 0)
+        // mean that this fragment is ignoring the
+        // data, and odd states indicate, that fragment
+        // is storing the data into itself.
+        TInt                                iState;
+
+        // Owned element containing this XML fragment data.
+        TXmlEngElement                      iElement;
+        
+        // Owned document representing this XML fragment
+        RSenDocument                        iDocument;
+        
+        // Pointer to XML parser. Not owned.
+        CSenParser*                         ipParser;               // Not owned
+
+        // Possible owner fragment, if such exists. Not owned.
+        CSenFragmentBase*                   ipOwner;                // Not owned
+        CSenFragmentBase*                   ipDelegate;             // Owned
+        
+        RPointerArray<CSenNamespaceData>*   ipNamespaceArray;       // Owned
+        
+        CBufFlat*                           ipContentBuf;           // Owned
+        RBufWriteStream*                    ipContentWriteStream;   // Owned
+    };
+    
+class CSenNamespaceData : public CBase
+    {
+    public:
+        virtual ~CSenNamespaceData();
+    
+    public:
+        HBufC8* ipLocalName;
+        HBufC8* ipNamespaceUri;
+        HBufC8* ipPrefix;
+    };
+
+#endif //SEN_FRAGMENT_BASE_H
+
+// End of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/inc/SenParser.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        This is an abstract interface enabling factory pattern
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SEN_PARSER_H
+#define SEN_PARSER_H
+
+#include <xml/contenthandler.h>
+#include <xml/parser.h>
+
+using namespace Xml;
+
+// FORWARD DECLARATIONS
+class CSenContentHandler;
+class CSenFragmentBase;
+
+class CSenParser : public CBase
+    {
+    public: // Constructors and destructor
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 4.0
+         */
+        IMPORT_C static CSenParser* NewL();
+        /**
+         *  Standard 2 phase constructor.
+         *  @since Series60 4.0
+         */       
+        IMPORT_C static CSenParser* NewLC();
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParser : where construction 
+         *                  data will be copied from.         
+         *  @since Series60 4.0
+         */
+        IMPORT_C static CSenParser* NewL(CParser* aParser);
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParser : where construction 
+         *                  data will be copied from.         
+         *  @since Series60 4.0
+         */        
+        IMPORT_C static CSenParser* NewLC(CParser* aParser);
+
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParserMimeType : where construction 
+         *                  data will be copied from.         
+         *  @since Series60 4.0
+         */
+        IMPORT_C static CSenParser* NewL(const TDesC8& aParserMimeType);
+        /**
+         *  Standard 2 phase constructor.
+         *  @param aParserMimeType : where construction 
+         *                  data will be copied from.         
+         *  @since Series60 4.0
+         */        
+        IMPORT_C static CSenParser* NewLC(const TDesC8& aParserMimeType);
+
+		/**
+		 * Sets the ContentHandler
+		 * @param aContentHandler
+		 */	
+        virtual void SetContentHandler(CSenFragmentBase& aContentHandler) = 0;
+
+		/**
+		 * Parsing Begins
+		 */
+        virtual void ParseBeginL() = 0;
+        /**
+         * Parsing Begins
+         * @param aDocumentMimeType This contains the Mime Type
+         */
+        virtual void ParseBeginL(const TDesC8& aDocumentMimeType) = 0;
+
+		/**
+		 * Parsing
+		 * @param aFragment
+		 * @param aContentHandler
+		 */
+        virtual void ParseL(const TDesC8& aFragment,
+                                CSenFragmentBase& aContentHandler) = 0;
+		/**
+		 * Parsing
+		 * @param aFs
+		 * @param aFilename
+		 * @param aContentHandler
+		 */                                
+        virtual void ParseL(RFs& aFs, const TDesC& aFilename,
+                                 CSenFragmentBase& aContentHandler) = 0;
+		/**
+		 * Parsing
+		 * @param aFs
+		 * @param aContentHandler
+		 */                                                                 
+        virtual void ParseL(RFile& aFile, CSenFragmentBase& aContentHandler) = 0;
+        
+        /**
+         * Parsing Ends
+         */
+        virtual void ParseEndL() = 0;
+
+		/**
+		 * Sets the Processor Chain
+		 */
+        virtual void SetProcessorChainL(const RContentProcessorUids& aPlugins) = 0;
+
+		/**
+		 * Enables the Parsing Feature 
+		 */
+        virtual TInt EnableFeature(TInt aParserFeature) = 0;
+   		/**
+		 * Disables the Parsing Feature 
+		 */
+        virtual TInt DisableFeature(TInt aParserFeature) = 0;
+        /**
+         * @param aParserFeature
+         * @return True if parser feature is enabled
+         *		   False if parser feature is disabled
+         */
+        virtual TBool IsFeatureEnabled(TInt aParserFeature) const = 0;
+		/**
+		 * 
+		 */
+        virtual void AddPreloadedDictionaryL(const TDesC8& aPublicId) = 0;
+
+		/**
+		 * 
+		 */
+        virtual RStringPool& StringPool() = 0;
+        /**
+         * 
+         */
+        virtual RStringDictionaryCollection& StringDictionaryCollection() = 0;
+        
+    protected:
+        CSenParser();
+    };
+
+
+#endif //SEN_PARSER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for xml_fragment_api test source 
+*
+*/
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTMMPFILES
+
+../senfragmentTester/group/SenFragmentTester.mmp
+
+
+
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/Bmarm/SenFragmentTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/Bwins/SenFragmentTesterU.DEF	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/conf/SenFragmentTester.cfg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,756 @@
+[Test]
+title SDFB-NewL-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL1-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL1-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL2-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL2-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL3-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL3-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL4-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL4-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL5-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL5-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL6-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL6-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NewL7-test_CSenDomFragmentBase_NewL
+create senfragmentTester obj 
+obj SDFB-NewL7-test_CSenDomFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-ExpandL-test_CSenDomFragmentBase_ExpandL
+create senfragmentTester obj 
+obj SDFB-ExpandL-test_CSenDomFragmentBase_ExpandL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnResumeParsingFromL-test_CSenDomFragmentBase_OnResumeParsingFromL
+create senfragmentTester obj 
+obj SDFB-OnResumeParsingFromL-test_CSenDomFragmentBase_OnResumeParsingFromL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-AddAttributesL-test_CSenDomFragmentBase_AddAttributesL
+create senfragmentTester obj 
+obj SDFB-AddAttributesL-test_CSenDomFragmentBase_AddAttributesL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-AsXmlL-test_CSenDomFragmentBase_AsXmlL
+create senfragmentTester obj 
+obj SDFB-AsXmlL-test_CSenDomFragmentBase_AsXmlL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnStartElementL-test_CSenDomFragmentBase_OnStartElementL
+create senfragmentTester obj 
+obj SDFB-OnStartElementL-test_CSenDomFragmentBase_OnStartElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnContentL-test_CSenDomFragmentBase_OnContentL
+create senfragmentTester obj 
+obj SDFB-OnContentL-test_CSenDomFragmentBase_OnContentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnWriteStartElementL-test_CSenDomFragmentBase_OnWriteStartElementL
+create senfragmentTester obj 
+obj SDFB-OnWriteStartElementL-test_CSenDomFragmentBase_OnWriteStartElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnWriteEndElementL-test_CSenDomFragmentBase_OnWriteEndElementL
+create senfragmentTester obj 
+obj SDFB-OnWriteEndElementL-test_CSenDomFragmentBase_OnWriteEndElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnEndElementL-test_CSenDomFragmentBase_OnEndElementL
+create senfragmentTester obj 
+obj SDFB-OnEndElementL-test_CSenDomFragmentBase_OnEndElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnStartDocumentL-test_CSenDomFragmentBase_OnStartDocumentL
+create senfragmentTester obj 
+obj SDFB-OnStartDocumentL-test_CSenDomFragmentBase_OnStartDocumentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnEndDocumentL-test_CSenDomFragmentBase_OnEndDocumentL
+create senfragmentTester obj 
+obj SDFB-OnEndDocumentL-test_CSenDomFragmentBase_OnEndDocumentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnStartPrefixMappingL-test_CSenDomFragmentBase_OnStartPrefixMappingL
+create senfragmentTester obj 
+obj SDFB-OnStartPrefixMappingL-test_CSenDomFragmentBase_OnStartPrefixMappingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnEndPrefixMappingL-test_CSenDomFragmentBase_OnEndPrefixMappingL
+create senfragmentTester obj 
+obj SDFB-OnEndPrefixMappingL-test_CSenDomFragmentBase_OnEndPrefixMappingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnIgnorableWhiteSpaceL-test_CSenDomFragmentBase_OnIgnorableWhiteSpaceL
+create senfragmentTester obj 
+obj SDFB-OnIgnorableWhiteSpaceL-test_CSenDomFragmentBase_OnIgnorableWhiteSpaceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnSkippedEntityL-test_CSenDomFragmentBase_OnSkippedEntityL
+create senfragmentTester obj 
+obj SDFB-OnSkippedEntityL-test_CSenDomFragmentBase_OnSkippedEntityL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnProcessingInstructionL-test_CSenDomFragmentBase_OnProcessingInstructionL
+create senfragmentTester obj 
+obj SDFB-OnProcessingInstructionL-test_CSenDomFragmentBase_OnProcessingInstructionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnError-test_CSenDomFragmentBase_OnError
+create senfragmentTester obj 
+obj SDFB-OnError-test_CSenDomFragmentBase_OnError 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-GetExtendedInterface-test_CSenDomFragmentBase_GetExtendedInterface
+create senfragmentTester obj 
+obj SDFB-GetExtendedInterface-test_CSenDomFragmentBase_GetExtendedInterface 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-ContentL-test_CSenDomFragmentBase_ContentL
+create senfragmentTester obj 
+obj SDFB-ContentL-test_CSenDomFragmentBase_ContentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Namespace-test_CSenDomFragmentBase_Namespace
+create senfragmentTester obj 
+obj SDFB-Namespace-test_CSenDomFragmentBase_Namespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-ResetContentL-test_CSenDomFragmentBase_ResetContentL
+create senfragmentTester obj 
+obj SDFB-ResetContentL-test_CSenDomFragmentBase_ResetContentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-LocalName-test_CSenDomFragmentBase_LocalName
+create senfragmentTester obj 
+obj SDFB-LocalName-test_CSenDomFragmentBase_LocalName 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NsUri-test_CSenDomFragmentBase_NsUri
+create senfragmentTester obj 
+obj SDFB-NsUri-test_CSenDomFragmentBase_NsUri 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-NsPrefix-test_CSenDomFragmentBase_NsPrefix
+create senfragmentTester obj 
+obj SDFB-NsPrefix-test_CSenDomFragmentBase_NsPrefix 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-AsElementL-test_CSenDomFragmentBase_AsElementL
+create senfragmentTester obj 
+obj SDFB-AsElementL-test_CSenDomFragmentBase_AsElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-AsDocumentL-test_CSenDomFragmentBase_AsDocumentL
+create senfragmentTester obj 
+obj SDFB-AsDocumentL-test_CSenDomFragmentBase_AsDocumentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-ExtractElement-test_CSenDomFragmentBase_ExtractElement
+create senfragmentTester obj 
+obj SDFB-ExtractElement-test_CSenDomFragmentBase_ExtractElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnDelegateParsingL-test_CSenDomFragmentBase_OnDelegateParsingL
+create senfragmentTester obj 
+obj SDFB-OnDelegateParsingL-test_CSenDomFragmentBase_OnDelegateParsingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-OnDelegateParsingL-test_CSenDomFragmentBase_OnDelegateParsingL
+create senfragmentTester obj 
+obj SDFB-OnDelegateParsingL-test_CSenDomFragmentBase_OnDelegateParsingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-SetOwner-test_CSenDomFragmentBase_SetOwner
+create senfragmentTester obj 
+obj SDFB-SetOwner-test_CSenDomFragmentBase_SetOwner 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-AsXmlUnicodeL-test_CSenDomFragmentBase_AsXmlUnicodeL
+create senfragmentTester obj 
+obj SDFB-AsXmlUnicodeL-test_CSenDomFragmentBase_AsXmlUnicodeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-WriteAsXMLToL-test_CSenDomFragmentBase_WriteAsXMLToL
+create senfragmentTester obj 
+obj SDFB-WriteAsXMLToL-test_CSenDomFragmentBase_WriteAsXMLToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-ConsistsOfL-test_CSenDomFragmentBase_ConsistsOfL
+create senfragmentTester obj 
+obj SDFB-ConsistsOfL-test_CSenDomFragmentBase_ConsistsOfL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-SetContentHandler-test_CSenDomFragmentBase_SetContentHandler
+create senfragmentTester obj 
+obj SDFB-SetContentHandler-test_CSenDomFragmentBase_SetContentHandler 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsing-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsing-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsingdelegate-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsingdelegate-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsingnamespaces-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsingnamespaces-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsingnestedelements-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsingnestedelements-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsingnullednamespaces-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsingnullednamespaces-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsingusingemptyfragment-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsingusingemptyfragment-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-ParsingWSmessage-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-ParsingWSmessage-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SDFB-Parsing2.WSmessage-test_CSenDomFragmentBase_Parsing
+create senfragmentTester obj 
+obj SDFB-Parsing2.WSmessage-test_CSenDomFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL1-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL1-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL2-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL2-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL3-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL3-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL4-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL4-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL5-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL5-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL6-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL6-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NewL7-test_CSenFragmentBase_NewL
+create senfragmentTester obj 
+obj SFB-NewL7-test_CSenFragmentBase_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnStartElementL-test_CSenFragmentBase_OnStartElementL
+create senfragmentTester obj 
+obj SFB-OnStartElementL-test_CSenFragmentBase_OnStartElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnEndElementL-test_CSenFragmentBase_OnEndElementL
+create senfragmentTester obj 
+obj SFB-OnEndElementL-test_CSenFragmentBase_OnEndElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnStartDocumentL-test_CSenFragmentBase_OnStartDocumentL
+create senfragmentTester obj 
+obj SFB-OnStartDocumentL-test_CSenFragmentBase_OnStartDocumentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnEndDocumentL-test_CSenFragmentBase_OnEndDocumentL
+create senfragmentTester obj 
+obj SFB-OnEndDocumentL-test_CSenFragmentBase_OnEndDocumentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnContentL-test_CSenFragmentBase_OnContentL
+create senfragmentTester obj 
+obj SFB-OnContentL-test_CSenFragmentBase_OnContentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnStartPrefixMappingL-test_CSenFragmentBase_OnStartPrefixMappingL
+create senfragmentTester obj 
+obj SFB-OnStartPrefixMappingL-test_CSenFragmentBase_OnStartPrefixMappingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnEndPrefixMappingL-test_CSenFragmentBase_OnEndPrefixMappingL
+create senfragmentTester obj 
+obj SFB-OnEndPrefixMappingL-test_CSenFragmentBase_OnEndPrefixMappingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnIgnorableWhiteSpaceL-test_CSenFragmentBase_OnIgnorableWhiteSpaceL
+create senfragmentTester obj 
+obj SFB-OnIgnorableWhiteSpaceL-test_CSenFragmentBase_OnIgnorableWhiteSpaceL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnSkippedEntityL-test_CSenFragmentBase_OnSkippedEntityL
+create senfragmentTester obj 
+obj SFB-OnSkippedEntityL-test_CSenFragmentBase_OnSkippedEntityL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnProcessingInstructionL-test_CSenFragmentBase_OnProcessingInstructionL
+create senfragmentTester obj 
+obj SFB-OnProcessingInstructionL-test_CSenFragmentBase_OnProcessingInstructionL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnError-test_CSenFragmentBase_OnError
+create senfragmentTester obj 
+obj SFB-OnError-test_CSenFragmentBase_OnError 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-GetExtendedInterface-test_CSenFragmentBase_GetExtendedInterface
+create senfragmentTester obj 
+obj SFB-GetExtendedInterface-test_CSenFragmentBase_GetExtendedInterface 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-ContentL-test_CSenFragmentBase_ContentL
+create senfragmentTester obj 
+obj SFB-ContentL-test_CSenFragmentBase_ContentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-Namespace-test_CSenFragmentBase_Namespace
+create senfragmentTester obj 
+obj SFB-Namespace-test_CSenFragmentBase_Namespace 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-ResetContentL-test_CSenFragmentBase_ResetContentL
+create senfragmentTester obj 
+obj SFB-ResetContentL-test_CSenFragmentBase_ResetContentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-LocalName-test_CSenFragmentBase_LocalName
+create senfragmentTester obj 
+obj SFB-LocalName-test_CSenFragmentBase_LocalName 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NsUri-test_CSenFragmentBase_NsUri
+create senfragmentTester obj 
+obj SFB-NsUri-test_CSenFragmentBase_NsUri 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-NsPrefix-test_CSenFragmentBase_NsPrefix
+create senfragmentTester obj 
+obj SFB-NsPrefix-test_CSenFragmentBase_NsPrefix 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-AsElementL-test_CSenFragmentBase_AsElementL
+create senfragmentTester obj 
+obj SFB-AsElementL-test_CSenFragmentBase_AsElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-AsDocumentL-test_CSenFragmentBase_AsDocumentL
+create senfragmentTester obj 
+obj SFB-AsDocumentL-test_CSenFragmentBase_AsDocumentL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-ExtractElement-test_CSenFragmentBase_ExtractElement
+create senfragmentTester obj 
+obj SFB-ExtractElement-test_CSenFragmentBase_ExtractElement 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnDelegateParsingL-test_CSenFragmentBase_OnDelegateParsingL
+create senfragmentTester obj 
+obj SFB-OnDelegateParsingL-test_CSenFragmentBase_OnDelegateParsingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnDelegateParsingL-test_CSenFragmentBase_OnDelegateParsingL
+create senfragmentTester obj 
+obj SFB-OnDelegateParsingL-test_CSenFragmentBase_OnDelegateParsingL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-SetOwner-test_CSenFragmentBase_SetOwner
+create senfragmentTester obj 
+obj SFB-SetOwner-test_CSenFragmentBase_SetOwner 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnResumeParsingFromL-test_CSenFragmentBase_OnResumeParsingFromL
+create senfragmentTester obj 
+obj SFB-OnResumeParsingFromL-test_CSenFragmentBase_OnResumeParsingFromL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnWriteStartElementL-test_CSenFragmentBase_OnWriteStartElementL
+create senfragmentTester obj 
+obj SFB-OnWriteStartElementL-test_CSenFragmentBase_OnWriteStartElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-OnWriteEndElementL-test_CSenFragmentBase_OnWriteEndElementL
+create senfragmentTester obj 
+obj SFB-OnWriteEndElementL-test_CSenFragmentBase_OnWriteEndElementL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-AsXmlUnicodeL-test_CSenFragmentBase_AsXmlUnicodeL
+create senfragmentTester obj 
+obj SFB-AsXmlUnicodeL-test_CSenFragmentBase_AsXmlUnicodeL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-AsXmlL-test_CSenFragmentBase_AsXmlL
+create senfragmentTester obj 
+obj SFB-AsXmlL-test_CSenFragmentBase_AsXmlL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-WriteAsXMLToL-test_CSenFragmentBase_WriteAsXMLToL
+create senfragmentTester obj 
+obj SFB-WriteAsXMLToL-test_CSenFragmentBase_WriteAsXMLToL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-ConsistsOfL-test_CSenFragmentBase_ConsistsOfL
+create senfragmentTester obj 
+obj SFB-ConsistsOfL-test_CSenFragmentBase_ConsistsOfL 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-SetContentHandler-test_CSenFragmentBase_SetContentHandler
+create senfragmentTester obj 
+obj SFB-SetContentHandler-test_CSenFragmentBase_SetContentHandler 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-Parsing-test_CSenFragmentBase_Parsing
+create senfragmentTester obj 
+obj SFB-Parsing-test_CSenFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-Parsingdelegate-test_CSenFragmentBase_Parsing
+create senfragmentTester obj 
+obj SFB-Parsingdelegate-test_CSenFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-Parsingnamespaces-test_CSenFragmentBase_Parsing
+create senfragmentTester obj 
+obj SFB-Parsingnamespaces-test_CSenFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-Parsingnestedelements-test_CSenFragmentBase_Parsing
+create senfragmentTester obj 
+obj SFB-Parsingnestedelements-test_CSenFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title SFB-ParsingelementinsideDOMtree-test_CSenFragmentBase_Parsing
+create senfragmentTester obj 
+obj SFB-ParsingelementinsideDOMtree-test_CSenFragmentBase_Parsing 
+delete obj 
+[Endtest] 
+
+[Test]
+title CSP-NewL-test_CSenParser_NewL
+create senfragmentTester obj 
+obj CSP-NewL-test_CSenParser_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title CSP-NewLC-test_CSenParser_NewLC
+create senfragmentTester obj 
+obj CSP-NewLC-test_CSenParser_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title CSP-NewL1-test_CSenParser_NewL
+create senfragmentTester obj 
+obj CSP-NewL1-test_CSenParser_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title CSP-NewLC1-test_CSenParser_NewLC
+create senfragmentTester obj 
+obj CSP-NewLC1-test_CSenParser_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title CSP-NewL2-test_CSenParser_NewL
+create senfragmentTester obj 
+obj CSP-NewL2-test_CSenParser_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title CSP-NewLC2-test_CSenParser_NewLC
+create senfragmentTester obj 
+obj CSP-NewLC2-test_CSenParser_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-NewL-test_RSenDocument_NewL
+create senfragmentTester obj 
+obj RSD-NewL-test_RSenDocument_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-NewLC-test_RSenDocument_NewLC
+create senfragmentTester obj 
+obj RSD-NewLC-test_RSenDocument_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-NewL2-test_RSenDocument_NewL
+create senfragmentTester obj 
+obj RSD-NewL2-test_RSenDocument_NewL 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-NewLC2-test_RSenDocument_NewLC
+create senfragmentTester obj 
+obj RSD-NewLC2-test_RSenDocument_NewLC 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-Copy-test_RSenDocument_Copy
+create senfragmentTester obj 
+obj RSD-Copy-test_RSenDocument_Copy 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-Close-test_RSenDocument_Close
+create senfragmentTester obj 
+obj RSD-Close-test_RSenDocument_Close 
+delete obj 
+[Endtest] 
+
+[Test]
+title RSD-Destroy-test_RSenDocument_Destroy
+create senfragmentTester obj 
+obj RSD-Destroy-test_RSenDocument_Destroy 
+delete obj 
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/eabi/SenFragmentTesteru.def	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/group/SenFragmentTester.mmp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Project specification file for senfragmenttester 
+*
+*/
+#if defined(__S60_)
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          SenFragmentTester.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+
+#ifdef EKA2
+		EPOCALLOWDLLDATA
+#endif //EKA2
+
+//TARGETPATH      ?target_path
+DEFFILE         SenFragmentTester.def
+SOURCEPATH              ../src
+SOURCE                  mainfragment.cpp
+SOURCE                  delegatefragment.cpp
+SOURCE                  maindomfragment.cpp
+SOURCE                  delegatedomfragment.cpp
+
+USERINCLUDE             ../src
+
+
+MW_LAYER_SYSTEMINCLUDE // SRC-HRCHY-CHANGES
+
+SYSTEMINCLUDE           ../../../../../wsFragment/inc
+SYSTEMINCLUDE           /epoc32/include/libc
+
+LIBRARY                 bafl.lib
+LIBRARY                 charconv.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 estor.lib
+LIBRARY                 euser.lib
+
+#ifndef RD_SEN_COMPILE_SIS_PACKAGE_FILES
+// SOA for S60 libraries
+		LIBRARY SenFragment.lib
+#else
+		LIBRARY wsFragment.lib
+#endif
+#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES )
+    LIBRARY                 XmlEngine.lib
+    LIBRARY                 XmlEngineDOM.lib
+    LIBRARY                 XmlEngineUtils.lib
+#else
+    LIBRARY         WsStarXmlEngine.lib
+    LIBRARY         WsStarXmlEngineDOM.lib
+    LIBRARY         WsStarXmlEngineUtils.lib
+#endif
+LIBRARY                 XMLFRAMEWORK.lib
+#ifdef SBSV2
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#else // SBSV2 not defined
+	USERINCLUDE     ../inc 
+
+	#if defined(__S60_)
+	    OS_LAYER_SYSTEMINCLUDE
+	#else // __S60_ not defined
+	    SYSTEMINCLUDE   /epoc32/include 
+	#endif // __S60_
+
+	SOURCEPATH      ../src
+#endif // SBSV2
+
+SOURCE          SenFragmentTester.cpp
+SOURCE          SenFragmentTesterBlocks.cpp
+
+//RESOURCE        resource_file
+//RESOURCE        resource_file2
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/group/SenFragmentTester.pkg	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,53 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:      
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\urel\SenFragmentTester.dll"   -   "c:\Sys\Bin\SenFragmentTester.dll"
+
+;Init files
+"..\init\TestFramework.ini"-"c:\testframework\TestFramework.ini"
+
+;Conf Files
+"..\conf\SenFragmentTester.cfg"-"c:\testing\conf\SenFragmentTester.cfg"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/group/bld.inf	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Build information file for senfragmentTester
+*
+*/
+
+
+
+
+
+
+
+
+
+PRJ_PLATFORMS
+// specify the platforms your component needs to be built for here
+// defaults to WINS MARM so you can ignore this if you just build these
+DEFAULT
+
+PRJ_TESTEXPORTS
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+
+PRJ_EXPORTS
+// Specify the source file followed by its destination here
+// copy will be used to copy the source file to its destination
+// If there's no destination then the source file will be copied
+// to the same name in /epoc32/include
+// Example: 
+/*
+/agnmodel/inc/AGMCOMON.H
+*/
+
+PRJ_TESTMMPFILES
+SenFragmentTester.mmp
+
+PRJ_MMPFILES
+
+// Specify the .mmp files required for building the important component
+// releasables.
+//
+// Specify "tidy" if the component you need to build doesn't need to be
+// released. Specify "ignore" if the MMP file exists but should be
+// ignored.
+// Example:
+/*
+/agnmodel/group/agnmodel.mmp
+#if defined(MARM)
+/agnmodel/group/agsvexe.mmp
+#endif
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/SenFragmentTester.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,495 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+
+
+
+#ifndef SENFRAGMENTTESTER_H
+#define SENFRAGMENTTESTER_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KSenFragmentTesterLogPath, "\\logs\\testframework\\SenFragmentTester\\" ); 
+// Log file
+_LIT( KSenFragmentTesterLogFile, "SenFragmentTester.txt" ); 
+_LIT( KSenFragmentTesterLogFileWithTitle, "SenFragmentTester_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CSenFragmentTester;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CSenFragmentTester test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CSenFragmentTester) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CSenFragmentTester* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CSenFragmentTester();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    public: // Functions from base classes
+
+        /**
+        * From CScriptBase Runs a script line.
+        * @since ?Series60_version
+        * @param aItem Script line containing method name and parameters
+        * @return Symbian OS error code
+        */
+        virtual TInt RunMethodL( CStifItemParser& aItem );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CSenFragmentTester( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * Frees all resources allocated from test methods.
+        * @since ?Series60_version
+        */
+        void Delete();
+
+        /**
+        * Test methods are listed below. 
+        */
+
+        /**
+        * Example test method.
+        * @since ?Series60_version
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+         TInt MT_CSenDomFragmentBase_NewLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_1L();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_2L();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_3L();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_4L();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_5L();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_6L();
+        
+        
+         TInt MT_CSenDomFragmentBase_NewL_7L();
+        
+        
+         TInt MT_CSenDomFragmentBase_ExpandLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnResumeParsingFromLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_AddAttributesLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_AsXmlLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnStartElementLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnContentLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnWriteStartElementLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnWriteEndElementLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnEndElementLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnStartDocumentLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnEndDocumentLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnStartPrefixMappingLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnEndPrefixMappingLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnIgnorableWhiteSpaceLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnSkippedEntityLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnProcessingInstructionLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnErrorL();
+        
+        
+         TInt MT_CSenDomFragmentBase_GetExtendedInterfaceL();
+        
+        
+         TInt MT_CSenDomFragmentBase_ContentLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_NamespaceL();
+        
+        
+         TInt MT_CSenDomFragmentBase_ResetContentLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_LocalNameL();
+        
+        
+         TInt MT_CSenDomFragmentBase_NsUriL();
+        
+        
+         TInt MT_CSenDomFragmentBase_NsPrefixL();
+        
+        
+         TInt MT_CSenDomFragmentBase_AsElementLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_AsDocumentLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_ExtractElementL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnDelegateParsingLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_OnDelegateParsingL_1L();
+        
+        
+         TInt MT_CSenDomFragmentBase_SetOwnerL();
+        
+        
+         TInt MT_CSenDomFragmentBase_AsXmlUnicodeLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_WriteAsXMLToLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_ConsistsOfLL();
+        
+        
+         TInt MT_CSenDomFragmentBase_SetContentHandlerL();
+        
+        
+         TInt MT_CSenDomFragmentBase_Parsing1L();
+
+
+         TInt MT_CSenDomFragmentBase_Parsing2L();
+         
+         
+         TInt MT_CSenDomFragmentBase_Parsing3L();
+        
+        
+         TInt MT_CSenDomFragmentBase_Parsing4L();
+        
+        
+         TInt MT_CSenDomFragmentBase_Parsing5L();
+        
+        
+         TInt MT_CSenDomFragmentBase_Parsing6L();
+        
+        
+         TInt MT_CSenDomFragmentBase_Parsing7L();
+         
+         
+         TInt MT_CSenDomFragmentBase_Parsing8L();
+        
+        
+         TInt MT_CSenFragmentBase_NewLL();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_1L();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_2L();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_3L();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_4L();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_5L();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_6L();
+        
+        
+         TInt MT_CSenFragmentBase_NewL_7L();
+        
+        
+         TInt MT_CSenFragmentBase_OnStartElementLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnEndElementLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnStartDocumentLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnEndDocumentLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnContentLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnStartPrefixMappingLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnEndPrefixMappingLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnIgnorableWhiteSpaceLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnSkippedEntityLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnProcessingInstructionLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnErrorL();
+        
+        
+         TInt MT_CSenFragmentBase_GetExtendedInterfaceL();
+        
+        
+         TInt MT_CSenFragmentBase_ContentLL();
+        
+        
+         TInt MT_CSenFragmentBase_NamespaceL();
+        
+        
+         TInt MT_CSenFragmentBase_ResetContentLL();
+        
+        
+         TInt MT_CSenFragmentBase_LocalNameL();
+        
+        
+         TInt MT_CSenFragmentBase_NsUriL();
+        
+        
+         TInt MT_CSenFragmentBase_NsPrefixL();
+        
+        
+         TInt MT_CSenFragmentBase_AsElementLL();
+        
+        
+         TInt MT_CSenFragmentBase_AsDocumentLL();
+        
+        
+         TInt MT_CSenFragmentBase_ExtractElementL();
+        
+        
+         TInt MT_CSenFragmentBase_OnDelegateParsingLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnDelegateParsingL_1L();
+        
+        
+         TInt MT_CSenFragmentBase_SetOwnerL();
+        
+        
+         TInt MT_CSenFragmentBase_OnResumeParsingFromLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnWriteStartElementLL();
+        
+        
+         TInt MT_CSenFragmentBase_OnWriteEndElementLL();
+        
+        
+         TInt MT_CSenFragmentBase_AsXmlUnicodeLL();
+        
+        
+         TInt MT_CSenFragmentBase_AsXmlLL();
+        
+        
+         TInt MT_CSenFragmentBase_WriteAsXMLToLL();
+        
+        
+         TInt MT_CSenFragmentBase_ConsistsOfLL();
+        
+        
+         TInt MT_CSenFragmentBase_SetContentHandlerL();
+        
+        
+         TInt MT_CSenFragmentBase_Parsing1L();
+
+
+         TInt MT_CSenFragmentBase_Parsing2L();
+         
+         
+         TInt MT_CSenFragmentBase_Parsing3L();
+
+
+         TInt MT_CSenFragmentBase_Parsing4L();
+
+
+         TInt MT_CSenFragmentBase_Parsing5L();
+
+
+         TInt MT_CSenParser_NewLL();
+        
+        
+         TInt MT_CSenParser_NewLCL();
+        
+        
+         TInt MT_CSenParser_NewL_1L();
+        
+        
+         TInt MT_CSenParser_NewLC_1L();
+        
+        
+         TInt MT_CSenParser_NewL_2L();
+        
+        
+         TInt MT_CSenParser_NewLC_2L();
+        
+#if defined( __SERIES60_31__ ) || (!defined( __SERIES60_30__ ) && defined( SYMBIAN_SWI_POST_INSTALL_REVOCATION) )
+
+         TInt MT_CSenParser_NewL_3L();
+         TInt MT_CSenParser_NewLC_3L();
+
+#endif 
+        
+        
+         TInt MT_RSenDocument_NewLL();
+        
+        
+         TInt MT_RSenDocument_NewLCL();
+        
+        
+         TInt MT_RSenDocument_NewL_1L();
+        
+        
+         TInt MT_RSenDocument_NewLC_1L();
+        
+        
+         TInt MT_RSenDocument_CopyL();
+        
+        
+         TInt MT_RSenDocument_CloseL();
+        
+        
+         TInt MT_RSenDocument_DestroyL();
+        
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+
+    };
+
+#endif      // SENFRAGMENTTESTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/delegatedomfragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef DELEGATE_DOM_FRAGMENT_H
+#define DELEGATE_DOM_FRAGMENT_H
+
+//  INCLUDES
+#include "SenDomFragmentBase.h"
+
+class CDelegateDomFragment : public CSenDomFragmentBase
+    {
+    public:  // Constructors and destructor
+
+        static CDelegateDomFragment* NewL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName,
+                                          const RAttributeArray& aAttributes);
+
+        static CDelegateDomFragment* NewLC(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& aAttributes);
+
+        static CDelegateDomFragment* NewL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName,
+                                          const RAttributeArray& aAttributes,
+                                          TXmlEngElement& aParent);
+
+        static CDelegateDomFragment* NewLC(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& aAttributes,
+                                           TXmlEngElement& aParent);
+
+        static CDelegateDomFragment* NewL(const TDesC8& aNsUri,
+                                          const TDesC8& aLocalName,
+                                          const TDesC8& aQName,
+                                          const RAttributeArray& aAttrs,
+                                          TXmlEngElement& aParent,
+                                          RSenDocument& aOwnerDocument);                                         
+
+        static CDelegateDomFragment* NewLC(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName,
+                                           const RAttributeArray& aAttrs,
+                                           TXmlEngElement& aParent,
+                                           RSenDocument& aOwnerDocument);                                         
+        /**
+        * Destructor.
+        */
+        virtual ~CDelegateDomFragment();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CDelegateDomFragment();
+    };
+
+#endif // DELEGATE_DOM_FRAGMENT_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/delegatefragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef DELEGATE_FRAGMENT_H
+#define DELEGATE_FRAGMENT_H
+
+//  INCLUDES
+#include "SenFragmentBase.h"
+
+class CDelegateFragment : public CSenFragmentBase
+    {
+    public:  // Constructors and destructor
+
+        static CDelegateFragment* NewL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes);
+
+        static CDelegateFragment* NewLC(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes);
+
+        static CDelegateFragment* NewL(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes,
+                                         TXmlEngElement& aParent);
+
+        static CDelegateFragment* NewLC(const TDesC8& aNsUri,
+                                         const TDesC8& aLocalName,
+                                         const TDesC8& aQName,
+                                         const RAttributeArray& aAttributes,
+                                         TXmlEngElement& aParent);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CDelegateFragment();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CDelegateFragment();
+    };
+
+#endif // DELEGATE_FRAGMENT_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/maindomfragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef MAIN_DOM_FRAGMENT_H
+#define MAIN_DOM_FRAGMENT_H
+
+// INCLUDES
+#include "SenDomFragmentBase.h"
+#include "delegatedomfragment.h"
+
+// CLASS DECLARATIONS
+class CMainDomFragment :  public CSenDomFragmentBase
+    {
+    public: // Constructors and destructor
+
+        static CMainDomFragment* NewL();
+        static CMainDomFragment* NewLC();
+        static CMainDomFragment* NewL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName);
+        static CMainDomFragment* NewLC(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName);
+        virtual ~CMainDomFragment();
+
+        CDelegateDomFragment& DelegateFragment();        
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CMainDomFragment();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL();
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            const TDesC8& aQName);
+
+        virtual void OnStartElementL(const RTagInfo& aElement,
+        							 const RAttributeArray& aAttributes,
+        						 	 TInt aErrorCode);
+
+        virtual void OnEndElementL(const RTagInfo& aElement,
+        						   TInt aErrorCode);
+
+        virtual void OnResumeParsingFromL(const RTagInfo& aElement, TInt aErrorCode);
+    private: // Data
+        CDelegateDomFragment* ipDelegateFragment;  // Owned
+    };
+
+#endif // MAIN_DOM_FRAGMENT_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/inc/mainfragment.h	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header declaration
+*
+*/
+
+
+
+
+
+
+#ifndef MAIN_FRAGMENT_H
+#define MAIN_FRAGMENT_H
+
+// INCLUDES
+#include "SenFragmentBase.h"
+#include "delegatefragment.h"
+
+// CLASS DECLARATIONS
+class CMainFragment :  public CSenFragmentBase
+    {
+    public: // Constructors and destructor
+
+        static CMainFragment* NewL();
+        static CMainFragment* NewLC();
+        static CMainFragment* NewL(const TDesC8& aNsUri,
+                                           const TDesC8& aLocalName,
+                                           const TDesC8& aQName);
+        static CMainFragment* NewLC(const TDesC8& aNsUri,
+                                            const TDesC8& aLocalName,
+                                            const TDesC8& aQName);
+        virtual ~CMainFragment();
+        
+        CDelegateFragment& DelegateFragment(); 
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CMainFragment();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void BaseConstructL();
+        void BaseConstructL(const TDesC8& aNsUri,
+                            const TDesC8& aLocalName,
+                            const TDesC8& aQName);
+
+        // Functions from base classes
+
+        // From CSenBaseFragment
+        virtual void OnStartElementL(const RTagInfo& aElement,
+        							 const RAttributeArray& aAttributes,
+        						 	 TInt aErrorCode);
+
+        virtual void OnEndElementL(const RTagInfo& aElement,
+        						   TInt aErrorCode);
+
+    private: // Data
+        CDelegateFragment* ipDelegateFragment;  // Owned
+    };
+
+#endif // MAIN_FRAGMENT_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/init/TestFramework.ini	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,178 @@
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+#	- Set Test Reporting mode. TestReportMode's possible values are:
+#		+ 'Summary': Summary of the tested test cases.
+#		+ 'Environment': Hardware and software info.
+#		+ 'TestCases': Test case report.
+#		+ 'FullReport': Set of all above ones.
+#		+ Example 'TestReportMode= Summary TestCases'
+#
+# 	- CreateTestReport setting controls report creation mode
+#		+ YES, Test report will created.
+#		+ NO, No Test report.
+#
+# 	- File path indicates the base path of the test report.
+# 	- File name indicates the name of the test report.
+#
+# 	- File format indicates the type of the test report.
+#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#		+ HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# 	- File output indicates output source of the test report.
+#		+ FILE, Test report logging to file.
+#		+ RDEBUG, Test report logging to using rdebug.
+#
+# 	- File Creation Mode indicates test report overwriting if file exist.
+#		+ OVERWRITE, Overwrites if the Test report file exist.
+#		+ APPEND, Continue logging after the old Test report information if 
+#                 report exist.
+# 	- Sets a device reset module's dll name(Reboot).
+#		+ If Nokia specific reset module is not available or it is not correct one
+#		  StifHWResetStub module may use as a template for user specific reset
+#		  module. 
+
+[Engine_Defaults]
+
+TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
+                                                               'TestCases' or 'FullReport'
+
+CreateTestReport= YES			# Possible values: YES or NO
+
+TestReportFilePath= c:\Testing\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT			# Possible values: TXT or HTML
+TestReportOutput= FILE			# Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= testscripter
+ConfigFile= c:\Testing\conf\SenFragmentTester.cfg
+
+[End_Module]
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# 	Hardware and emulator environment logging path and styles can
+# 	be configured from here to overwrite the Logger's implemented values.
+#	
+#	Settings description:
+#	- Indicates option for creation log directory/directories. If log directory/directories
+#         is/are not created by user they will make by software.
+#		+ YES, Create log directory/directories if not allready exist.
+#		+ NO, Log directory/directories not created. Only created one is used.
+#
+#	- Overwrite emulator path setting.
+#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+#	- Overwrite emulator's logging format.
+#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+#	- Overwrited emulator logging output source.
+#		+ FILE, Logging to file(s).
+#		+ RDEBUG, Logging to using rdebug(s).
+#
+#	- Overwrite hardware path setting (Same description as above in emulator path).
+#	- Overwrite hardware's logging format(Same description as above in emulator format).
+#	- Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+#	- File Creation Mode indicates file overwriting if file exist.
+#		+ OVERWRITE, Overwrites if file(s) exist.
+#		+ APPEND, Continue logging after the old logging information if file(s) exist.
+#
+#	- Will thread id include to the log filename.
+#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+#	- Will time stamps include the to log file.
+#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
+#                 for example'12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No time stamp(s).
+#
+#	- Will line breaks include to the log file.
+#		+ YES, Each logging event includes line break and next log event is in own line.
+#		+ NO, No line break(s).
+#
+#	- Will event ranking include to the log file.
+#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
+#                 depends on environment's tics, for example(includes time stamp also)
+#                 '012   12.Nov.2003 115958    LOGGING INFO'
+#		+ NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+#CreateLogDirectories= YES		# Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML			# Possible values: TXT or HTML
+#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML			# Possible values: TXT or HTML
+#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES			# Possible values: YES or NO
+#WithTimeStamp= YES			# Possible values: YES or NO
+#WithLineBreak= YES			# Possible values: YES or NO
+#WithEventRanking= YES			# Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/SenFragmentTester.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+
+
+
+
+
+
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "SenFragmentTester.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenFragmentTester::CSenFragmentTester
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSenFragmentTester::CSenFragmentTester( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSenFragmentTester::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSenFragmentTester::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    TInt ret = settingServer.Connect();
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings(loggerSettings);
+    if(ret != KErrNone)
+        {
+        User::Leave(ret);
+        } 
+    // Close Setting server session
+    settingServer.Close();
+
+    TFileName logFileName;
+    
+    if(loggerSettings.iAddTestCaseTitle)
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL(title);
+        logFileName.Format(KSenFragmentTesterLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KSenFragmentTesterLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KSenFragmentTesterLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CSenFragmentTester::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSenFragmentTester* CSenFragmentTester::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CSenFragmentTester* self = new (ELeave) CSenFragmentTester( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CSenFragmentTester::~CSenFragmentTester()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CSenFragmentTester::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CSenFragmentTester::SendTestClassVersion()
+	{
+	TVersion moduleVersion;
+	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+	
+	TFileName moduleName;
+	moduleName = _L("SenFragmentTester.dll");
+
+	TBool newVersionOfMethod = ETrue;
+	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+	}
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+
+    return ( CScriptBase* ) CSenFragmentTester::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/SenFragmentTesterBlocks.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,2800 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:        ?Description
+*
+*/
+
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "SenFragmentTester.h"
+//  EXTERNAL INCLUDES
+#include <SenDomFragmentBase.h>
+#include <SenFragmentBase.h>
+#include <SenParser.h>
+#include <RSenDocument.h>
+#include <xmlengdomutils.h>
+
+#if defined( __SERIES60_31__ ) || (!defined( __SERIES60_30__ ) && defined( SYMBIAN_SWI_POST_INSTALL_REVOCATION) )
+    #include <xml/matchdata.h>
+#endif    
+
+#include <xml/parserfeature.h>           // for TParserFeature enumeration
+#include <xmlengserializationoptions.h> // needed for TSerializationOptions
+#include <xmlengbinarycontainer.h>
+#include <s32mem.h>
+#include <xmlengdom.h>
+
+//  INTERNAL INCLUDES
+#include "maindomfragment.h"
+#include "mainfragment.h"
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define LOCAL_ASSERT(expression)	{if(!(expression)){return KErrArgument;}}
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSenFragmentTester::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CSenFragmentTester::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CSenFragmentTester::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CSenFragmentTester::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function. 
+		ENTRY("SDFB-NewL-test_CSenDomFragmentBase_NewL", MT_CSenDomFragmentBase_NewLL),
+		ENTRY("SDFB-NewL1-test_CSenDomFragmentBase_NewL", MT_CSenDomFragmentBase_NewL_1L),
+		ENTRY("SDFB-NewL2-test_CSenDomFragmentBase_NewL", CSenFragmentTester::MT_CSenDomFragmentBase_NewL_2L),
+		ENTRY("SDFB-NewL3-test_CSenDomFragmentBase_NewL", CSenFragmentTester::MT_CSenDomFragmentBase_NewL_3L),
+		ENTRY("SDFB-NewL4-test_CSenDomFragmentBase_NewL", CSenFragmentTester::MT_CSenDomFragmentBase_NewL_4L),
+		ENTRY("SDFB-NewL5-test_CSenDomFragmentBase_NewL", CSenFragmentTester::MT_CSenDomFragmentBase_NewL_5L),
+		ENTRY("SDFB-NewL6-test_CSenDomFragmentBase_NewL", CSenFragmentTester::MT_CSenDomFragmentBase_NewL_6L),
+		ENTRY("SDFB-NewL7-test_CSenDomFragmentBase_NewL", CSenFragmentTester::MT_CSenDomFragmentBase_NewL_7L),
+		ENTRY("SDFB-ExpandL-test_CSenDomFragmentBase_ExpandL", CSenFragmentTester::MT_CSenDomFragmentBase_ExpandLL),
+		ENTRY("SDFB-OnResumeParsingFromL-test_CSenDomFragmentBase_OnResumeParsingFromL", CSenFragmentTester::MT_CSenDomFragmentBase_OnResumeParsingFromLL),
+		ENTRY("SDFB-AddAttributesL-test_CSenDomFragmentBase_AddAttributesL", CSenFragmentTester::MT_CSenDomFragmentBase_AddAttributesLL),
+		ENTRY("SDFB-AsXmlL-test_CSenDomFragmentBase_AsXmlL", CSenFragmentTester::MT_CSenDomFragmentBase_AsXmlLL),
+		ENTRY("SDFB-OnStartElementL-test_CSenDomFragmentBase_OnStartElementL", CSenFragmentTester::MT_CSenDomFragmentBase_OnStartElementLL),
+		ENTRY("SDFB-OnContentL-test_CSenDomFragmentBase_OnContentL", CSenFragmentTester::MT_CSenDomFragmentBase_OnContentLL),
+		ENTRY("SDFB-OnWriteStartElementL-test_CSenDomFragmentBase_OnWriteStartElementL", CSenFragmentTester::MT_CSenDomFragmentBase_OnWriteStartElementLL),
+		ENTRY("SDFB-OnWriteEndElementL-test_CSenDomFragmentBase_OnWriteEndElementL", CSenFragmentTester::MT_CSenDomFragmentBase_OnWriteEndElementLL),
+		ENTRY("SDFB-OnEndElementL-test_CSenDomFragmentBase_OnEndElementL", CSenFragmentTester::MT_CSenDomFragmentBase_OnEndElementLL),
+		ENTRY("SDFB-OnStartDocumentL-test_CSenDomFragmentBase_OnStartDocumentL", CSenFragmentTester::MT_CSenDomFragmentBase_OnStartDocumentLL),
+		ENTRY("SDFB-OnEndDocumentL-test_CSenDomFragmentBase_OnEndDocumentL", CSenFragmentTester::MT_CSenDomFragmentBase_OnEndDocumentLL),
+		ENTRY("SDFB-OnStartPrefixMappingL-test_CSenDomFragmentBase_OnStartPrefixMappingL", CSenFragmentTester::MT_CSenDomFragmentBase_OnStartPrefixMappingLL),
+		ENTRY("SDFB-OnEndPrefixMappingL-test_CSenDomFragmentBase_OnEndPrefixMappingL", CSenFragmentTester::MT_CSenDomFragmentBase_OnEndPrefixMappingLL),
+		ENTRY("SDFB-OnIgnorableWhiteSpaceL-test_CSenDomFragmentBase_OnIgnorableWhiteSpaceL", CSenFragmentTester::MT_CSenDomFragmentBase_OnIgnorableWhiteSpaceLL),
+		ENTRY("SDFB-OnSkippedEntityL-test_CSenDomFragmentBase_OnSkippedEntityL", CSenFragmentTester::MT_CSenDomFragmentBase_OnSkippedEntityLL),
+		ENTRY("SDFB-OnProcessingInstructionL-test_CSenDomFragmentBase_OnProcessingInstructionL", CSenFragmentTester::MT_CSenDomFragmentBase_OnProcessingInstructionLL),
+		ENTRY("SDFB-OnError-test_CSenDomFragmentBase_OnError", CSenFragmentTester::MT_CSenDomFragmentBase_OnErrorL),
+		ENTRY("SDFB-GetExtendedInterface-test_CSenDomFragmentBase_GetExtendedInterface", CSenFragmentTester::MT_CSenDomFragmentBase_GetExtendedInterfaceL),
+		ENTRY("SDFB-ContentL-test_CSenDomFragmentBase_ContentL", CSenFragmentTester::MT_CSenDomFragmentBase_ContentLL),
+		ENTRY("SDFB-Namespace-test_CSenDomFragmentBase_Namespace", CSenFragmentTester::MT_CSenDomFragmentBase_NamespaceL),
+		ENTRY("SDFB-ResetContentL-test_CSenDomFragmentBase_ResetContentL", CSenFragmentTester::MT_CSenDomFragmentBase_ResetContentLL),
+		ENTRY("SDFB-LocalName-test_CSenDomFragmentBase_LocalName", CSenFragmentTester::MT_CSenDomFragmentBase_LocalNameL),
+		ENTRY("SDFB-NsUri-test_CSenDomFragmentBase_NsUri", CSenFragmentTester::MT_CSenDomFragmentBase_NsUriL),
+		ENTRY("SDFB-NsPrefix-test_CSenDomFragmentBase_NsPrefix", CSenFragmentTester::MT_CSenDomFragmentBase_NsPrefixL),
+		ENTRY("SDFB-AsElementL-test_CSenDomFragmentBase_AsElementL", CSenFragmentTester::MT_CSenDomFragmentBase_AsElementLL),
+		ENTRY("SDFB-AsDocumentL-test_CSenDomFragmentBase_AsDocumentL", CSenFragmentTester::MT_CSenDomFragmentBase_AsDocumentLL),
+		ENTRY("SDFB-ExtractElement-test_CSenDomFragmentBase_ExtractElement", CSenFragmentTester::MT_CSenDomFragmentBase_ExtractElementL),
+		ENTRY("SDFB-OnDelegateParsingL-test_CSenDomFragmentBase_OnDelegateParsingL", CSenFragmentTester::MT_CSenDomFragmentBase_OnDelegateParsingLL),
+		ENTRY("SDFB-OnDelegateParsingL-test_CSenDomFragmentBase_OnDelegateParsingL", CSenFragmentTester::MT_CSenDomFragmentBase_OnDelegateParsingL_1L),
+		ENTRY("SDFB-SetOwner-test_CSenDomFragmentBase_SetOwner", CSenFragmentTester::MT_CSenDomFragmentBase_SetOwnerL),
+		ENTRY("SDFB-AsXmlUnicodeL-test_CSenDomFragmentBase_AsXmlUnicodeL", CSenFragmentTester::MT_CSenDomFragmentBase_AsXmlUnicodeLL),
+		ENTRY("SDFB-WriteAsXMLToL-test_CSenDomFragmentBase_WriteAsXMLToL", CSenFragmentTester::MT_CSenDomFragmentBase_WriteAsXMLToLL),
+		ENTRY("SDFB-ConsistsOfL-test_CSenDomFragmentBase_ConsistsOfL", CSenFragmentTester::MT_CSenDomFragmentBase_ConsistsOfLL),
+		ENTRY("SDFB-SetContentHandler-test_CSenDomFragmentBase_SetContentHandler", CSenFragmentTester::MT_CSenDomFragmentBase_SetContentHandlerL),
+		ENTRY("SDFB-Parsing-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing1L),
+		ENTRY("SDFB-Parsingdelegate-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing2L),
+		ENTRY("SDFB-Parsingnamespaces-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing3L),
+		ENTRY("SDFB-Parsingnestedelements-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing4L),
+		ENTRY("SDFB-Parsingnullednamespaces-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing5L),
+		ENTRY("SDFB-Parsingusingemptyfragment-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing6L),
+		ENTRY("SDFB-ParsingWSmessage-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing7L),
+		ENTRY("SDFB-Parsing2.WSmessage-test_CSenDomFragmentBase_Parsing", CSenFragmentTester::MT_CSenDomFragmentBase_Parsing8L),
+		ENTRY("SFB-NewL-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewLL),
+		ENTRY("SFB-NewL1-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_1L),
+		ENTRY("SFB-NewL2-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_2L),
+		ENTRY("SFB-NewL3-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_3L),
+		ENTRY("SFB-NewL4-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_4L),
+		ENTRY("SFB-NewL5-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_5L),
+		ENTRY("SFB-NewL6-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_6L),
+		ENTRY("SFB-NewL7-test_CSenFragmentBase_NewL", CSenFragmentTester::MT_CSenFragmentBase_NewL_7L),
+		ENTRY("SFB-OnStartElementL-test_CSenFragmentBase_OnStartElementL", CSenFragmentTester::MT_CSenFragmentBase_OnStartElementLL),
+		ENTRY("SFB-OnEndElementL-test_CSenFragmentBase_OnEndElementL", CSenFragmentTester::MT_CSenFragmentBase_OnEndElementLL),
+		ENTRY("SFB-OnStartDocumentL-test_CSenFragmentBase_OnStartDocumentL", CSenFragmentTester::MT_CSenFragmentBase_OnStartDocumentLL),
+		ENTRY("SFB-OnEndDocumentL-test_CSenFragmentBase_OnEndDocumentL", CSenFragmentTester::MT_CSenFragmentBase_OnEndDocumentLL),
+		ENTRY("SFB-OnContentL-test_CSenFragmentBase_OnContentL", CSenFragmentTester::MT_CSenFragmentBase_OnContentLL),
+		ENTRY("SFB-OnStartPrefixMappingL-test_CSenFragmentBase_OnStartPrefixMappingL", CSenFragmentTester::MT_CSenFragmentBase_OnStartPrefixMappingLL),
+		ENTRY("SFB-OnEndPrefixMappingL-test_CSenFragmentBase_OnEndPrefixMappingL", CSenFragmentTester::MT_CSenFragmentBase_OnEndPrefixMappingLL),
+		ENTRY("SFB-OnIgnorableWhiteSpaceL-test_CSenFragmentBase_OnIgnorableWhiteSpaceL", CSenFragmentTester::MT_CSenFragmentBase_OnIgnorableWhiteSpaceLL),
+		ENTRY("SFB-OnSkippedEntityL-test_CSenFragmentBase_OnSkippedEntityL", CSenFragmentTester::MT_CSenFragmentBase_OnSkippedEntityLL),
+		ENTRY("SFB-OnProcessingInstructionL-test_CSenFragmentBase_OnProcessingInstructionL", CSenFragmentTester::MT_CSenFragmentBase_OnProcessingInstructionLL),
+		ENTRY("SFB-OnError-test_CSenFragmentBase_OnError", CSenFragmentTester::MT_CSenFragmentBase_OnErrorL),
+		ENTRY("SFB-GetExtendedInterface-test_CSenFragmentBase_GetExtendedInterface", CSenFragmentTester::MT_CSenFragmentBase_GetExtendedInterfaceL),
+		ENTRY("SFB-ContentL-test_CSenFragmentBase_ContentL", CSenFragmentTester::MT_CSenFragmentBase_ContentLL),
+		ENTRY("SFB-Namespace-test_CSenFragmentBase_Namespace", CSenFragmentTester::MT_CSenFragmentBase_NamespaceL),
+		ENTRY("SFB-ResetContentL-test_CSenFragmentBase_ResetContentL", CSenFragmentTester::MT_CSenFragmentBase_ResetContentLL),
+		ENTRY("SFB-LocalName-test_CSenFragmentBase_LocalName", CSenFragmentTester::MT_CSenFragmentBase_LocalNameL),
+		ENTRY("SFB-NsUri-test_CSenFragmentBase_NsUri", CSenFragmentTester::MT_CSenFragmentBase_NsUriL),
+		ENTRY("SFB-NsPrefix-test_CSenFragmentBase_NsPrefix", CSenFragmentTester::MT_CSenFragmentBase_NsPrefixL),
+		ENTRY("SFB-AsElementL-test_CSenFragmentBase_AsElementL", CSenFragmentTester::MT_CSenFragmentBase_AsElementLL),
+		ENTRY("SFB-AsDocumentL-test_CSenFragmentBase_AsDocumentL", CSenFragmentTester::MT_CSenFragmentBase_AsDocumentLL),
+		ENTRY("SFB-ExtractElement-test_CSenFragmentBase_ExtractElement", CSenFragmentTester::MT_CSenFragmentBase_ExtractElementL),
+		ENTRY("SFB-OnDelegateParsingL-test_CSenFragmentBase_OnDelegateParsingL", CSenFragmentTester::MT_CSenFragmentBase_OnDelegateParsingLL),
+		ENTRY("SFB-OnDelegateParsingL-test_CSenFragmentBase_OnDelegateParsingL", CSenFragmentTester::MT_CSenFragmentBase_OnDelegateParsingL_1L),
+		ENTRY("SFB-SetOwner-test_CSenFragmentBase_SetOwner", CSenFragmentTester::MT_CSenFragmentBase_SetOwnerL),
+		ENTRY("SFB-OnResumeParsingFromL-test_CSenFragmentBase_OnResumeParsingFromL", CSenFragmentTester::MT_CSenFragmentBase_OnResumeParsingFromLL),
+		ENTRY("SFB-OnWriteStartElementL-test_CSenFragmentBase_OnWriteStartElementL", CSenFragmentTester::MT_CSenFragmentBase_OnWriteStartElementLL),
+		ENTRY("SFB-OnWriteEndElementL-test_CSenFragmentBase_OnWriteEndElementL", CSenFragmentTester::MT_CSenFragmentBase_OnWriteEndElementLL),
+		ENTRY("SFB-AsXmlUnicodeL-test_CSenFragmentBase_AsXmlUnicodeL", CSenFragmentTester::MT_CSenFragmentBase_AsXmlUnicodeLL),
+		ENTRY("SFB-AsXmlL-test_CSenFragmentBase_AsXmlL", CSenFragmentTester::MT_CSenFragmentBase_AsXmlLL),
+		ENTRY("SFB-WriteAsXMLToL-test_CSenFragmentBase_WriteAsXMLToL", CSenFragmentTester::MT_CSenFragmentBase_WriteAsXMLToLL),
+		ENTRY("SFB-ConsistsOfL-test_CSenFragmentBase_ConsistsOfL", CSenFragmentTester::MT_CSenFragmentBase_ConsistsOfLL),
+		ENTRY("SFB-SetContentHandler-test_CSenFragmentBase_SetContentHandler", CSenFragmentTester::MT_CSenFragmentBase_SetContentHandlerL),
+		ENTRY("SFB-Parsing-test_CSenFragmentBase_Parsing", CSenFragmentTester::MT_CSenFragmentBase_Parsing1L),
+		ENTRY("SFB-Parsingdelegate-test_CSenFragmentBase_Parsing", CSenFragmentTester::MT_CSenFragmentBase_Parsing2L),
+		ENTRY("SFB-Parsingnamespaces-test_CSenFragmentBase_Parsing", CSenFragmentTester::MT_CSenFragmentBase_Parsing3L),
+		ENTRY("SFB-Parsingnestedelements-test_CSenFragmentBase_Parsing", CSenFragmentTester::MT_CSenFragmentBase_Parsing4L),
+		ENTRY("SFB-ParsingelementinsideDOMtree-test_CSenFragmentBase_Parsing", CSenFragmentTester::MT_CSenFragmentBase_Parsing5L),
+		ENTRY("CSP-NewL-test_CSenParser_NewL", CSenFragmentTester::MT_CSenParser_NewLL),
+		ENTRY("CSP-NewLC-test_CSenParser_NewLC", CSenFragmentTester::MT_CSenParser_NewLCL),
+		ENTRY("CSP-NewL1-test_CSenParser_NewL", CSenFragmentTester::MT_CSenParser_NewL_1L),
+		ENTRY("CSP-NewLC1-test_CSenParser_NewLC", CSenFragmentTester::MT_CSenParser_NewLC_1L),
+		ENTRY("CSP-NewL2-test_CSenParser_NewL", CSenFragmentTester::MT_CSenParser_NewL_2L),
+		ENTRY("CSP-NewLC2-test_CSenParser_NewLC", CSenFragmentTester::MT_CSenParser_NewLC_2L),
+		ENTRY("RSD-NewL-test_RSenDocument_NewL", MT_RSenDocument_NewLL),
+		ENTRY("RSD-NewLC-test_RSenDocument_NewLC", MT_RSenDocument_NewLCL),
+		ENTRY("RSD-NewL2-test_RSenDocument_NewL", MT_RSenDocument_NewL_1L),
+		ENTRY("RSD-NewLC2-test_RSenDocument_NewLC", MT_RSenDocument_NewLC_1L),
+		ENTRY("RSD-Copy-test_RSenDocument_Copy", MT_RSenDocument_CopyL),
+		ENTRY("RSD-Close-test_RSenDocument_Close", MT_RSenDocument_CloseL),
+		ENTRY("RSD-Destroy-test_RSenDocument_Destroy", MT_RSenDocument_DestroyL),
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewLL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL();
+    delete pFragment;
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_1L(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement element = document.CreateDocumentElementL(_L8("Test"));
+    element.SetEscapedTextL(_L8("<Element/>"));
+    
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(element);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    // Test that when CSenDomFragmentBase is serialized '<' and '>' characters
+    // are encoded (as all basic entities in content should be).
+    LOCAL_ASSERT( *pAsXml == _L8("<Test>&lt;Element/&gt;</Test>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_2L(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_3L(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"));
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns=\"NsUri\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_4L(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<t:Test xmlns:t=\"NsUri\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_5L(  )
+    {
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open( nsUriRString, nsPrefixRString, localNameRString,
+                    valueRString );
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+    
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"),
+                                                               attrArray);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_6L(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent"));
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+    
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+        
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"),
+                                                               attrArray,
+                                                               parentElement);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+
+    RBuf8 buffer;
+    parentElement.OuterXmlL(buffer);
+    
+    LOCAL_ASSERT( buffer == _L8("<Parent><t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/></Parent>") );
+    buffer.Close();
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NewL_7L(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent"));
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+        
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8(""),
+                                                               attrArray,
+                                                               parentElement,
+                                                               document);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+
+    RBuf8 buffer;
+    parentElement.OuterXmlL(buffer);
+    
+    LOCAL_ASSERT( buffer == _L8("<Parent><Test xmlns=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/></Parent>") );
+    buffer.Close();
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_ExpandLL(  )
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnResumeParsingFromLL(  )
+    {
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_AddAttributesLL(  )
+    {
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(4); // nsUriRString, nsPrefixRString, localNameRString,
+                          // valueRString
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);    
+    
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    
+    pFragment->AddAttributesL(attrArray);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+
+    CleanupStack::PopAndDestroy(pFragment);
+    
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_AsXmlLL(  )
+    {
+    // Test serialization of Dom tree which has two child elements
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix"));
+
+    element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2"));
+    
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns:prefix=\"nsuri\"><prefix:Child xmlns:prefix2=\"nsuri2\"><prefix2:Child2/></prefix:Child></Test>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnStartElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnContentLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnWriteStartElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnWriteEndElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnEndElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnStartDocumentLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnEndDocumentLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnStartPrefixMappingLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnEndPrefixMappingLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnIgnorableWhiteSpaceLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnSkippedEntityLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnProcessingInstructionLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnErrorL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_GetExtendedInterfaceL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_ContentLL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement element = document.CreateDocumentElementL(_L8("Test"));
+    element.SetEscapedTextL(_L8("<Element/>"));
+    
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(element);
+    CleanupStack::PushL(pFragment);
+    
+    TPtrC8 content = pFragment->ContentL();
+    LOCAL_ASSERT( content == _L8("<Element/>") );
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NamespaceL(  )
+    {
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(stringPool.OpenStringL(_L8("nsuri")), 
+                   stringPool.OpenStringL(_L8("pr")),
+                   stringPool.OpenStringL(_L8("LocalName")),
+                   stringPool.OpenStringL(_L8("Value")) );
+    // attribute took copies of all RStrings
+    // => All RStrings can be destroyed
+    CleanupStack::PopAndDestroy(4); // nsUriRString, nsPrefixRString, localNameRString,
+                                    // valueRString
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+    
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"),
+                                                               attrArray);
+    CleanupStack::PushL(pFragment);
+    
+    TXmlEngNamespace ns = pFragment->Namespace(_L8("pr"));
+    LOCAL_ASSERT( ns.Uri() == _L8("nsuri") );
+
+    TXmlEngNamespace ns2 = pFragment->Namespace(_L8("x"));
+    LOCAL_ASSERT( ns2.IsNull() );
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(); // attribute
+    CleanupStack::PopAndDestroy(); // attrArray
+    CleanupStack::PopAndDestroy(); // stringPool    
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_ResetContentLL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement element = document.CreateDocumentElementL(_L8("Test"));
+    element.SetEscapedTextL(_L8("Content"));
+    
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(element);
+    CleanupStack::PushL(pFragment);
+    
+    // Test that CSenFragmentBase has content before reset
+    TPtrC8 content = pFragment->ContentL();
+    LOCAL_ASSERT( content == _L8("Content") );
+    
+    pFragment->ResetContentL();
+    
+    // Test that CSenFragmentBase has no content after reset
+    TPtrC8 content2 = pFragment->ContentL();
+    LOCAL_ASSERT( content2 == KNullDesC8 );
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_LocalNameL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TPtrC8 localName = pFragment->LocalName();
+    LOCAL_ASSERT( localName == _L8("Test") );
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NsUriL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TPtrC8 localName = pFragment->NsUri();
+    LOCAL_ASSERT( localName == _L8("NsUri") );
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_NsPrefixL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TPtrC8 localName = pFragment->NsPrefix();
+    LOCAL_ASSERT( localName == _L8("t") );
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_AsElementLL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    element.OuterXmlL(buffer);
+    // Serialized element should contain all the Fragment data as XML.
+    LOCAL_ASSERT( buffer == _L8("<t:Test xmlns:t=\"NsUri\"/>") );
+    CleanupStack::PopAndDestroy(&buffer);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_AsDocumentLL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    RSenDocument document = pFragment->AsDocumentL();
+    TXmlEngElement element = document.DocumentElement();
+    
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    document.SaveL(asXml, element, options);
+    CleanupClosePushL(asXml);
+    
+    // Serialized document should contain all the Fragment data as XML.
+    LOCAL_ASSERT( asXml == _L8("<t:Test xmlns:t=\"NsUri\"/>") );
+
+    CleanupStack::PopAndDestroy(&asXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_ExtractElementL(  )
+    {
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"),
+                                                               _L8("Test"),
+                                                               _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->ExtractElement();
+    LOCAL_ASSERT( element.Name() == _L8("Test") );
+    element.Remove();
+    CleanupStack::PopAndDestroy(pFragment);    
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnDelegateParsingLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_OnDelegateParsingL_1L(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_SetOwnerL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_AsXmlUnicodeLL(  )
+    {
+    // Test serialization of Dom tree which has two child elements
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix"));
+
+    element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2"));
+    
+    HBufC* pAsXml = pFragment->AsXmlUnicodeL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L("<Test xmlns:prefix=\"nsuri\"><prefix:Child xmlns:prefix2=\"nsuri2\"><prefix2:Child2/></prefix:Child></Test>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_WriteAsXMLToLL(  )
+    {
+    // Test serialization of Dom tree which has two child elements
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix"));
+
+    element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2"));
+    CBufFlat* pBuf = CBufFlat::NewL(200);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+    pFragment->WriteAsXMLToL(bufWs);
+
+
+    LOCAL_ASSERT( pBuf->Ptr(0) == _L8("<Test xmlns:prefix=\"nsuri\"><prefix:Child xmlns:prefix2=\"nsuri2\"><prefix2:Child2/></prefix:Child></Test>") );
+    
+    CleanupStack::PopAndDestroy(&bufWs);
+    CleanupStack::PopAndDestroy(pBuf);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_ConsistsOfLL(  )
+    {
+    TDomUtils domUtils;
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement elementchild1 = element.AddNewElementL(_L8("DirectChild"));
+    elementchild1.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild1.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    
+    domUtils.XmlEngRenameElementL(elementchild1, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    TXmlEngElement elementchild2 = element.AddNewElementL(_L8("DirectChild"));
+    elementchild2.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild2.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    domUtils.XmlEngRenameElementL(elementchild2, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    elementchild2.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2"));
+
+    CSenDomFragmentBase* pFragment2 = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment2);
+    TXmlEngElement element2 = pFragment2->AsElementL();
+    
+    TXmlEngElement elementchild22 = element2.AddNewElementL(_L8("DirectChild"));
+    elementchild22.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild22.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    domUtils.XmlEngRenameElementL(elementchild22, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    elementchild22.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2"));
+
+    // ConsistOfL should return ETrue because
+    // root elements of both fragments match and the only element
+    // of pFragment2 = elementchild22 is exactly the same element as
+    // elementchild2.
+    LOCAL_ASSERT( pFragment->ConsistsOfL(*pFragment2) );
+
+    // ConsistOfL should return EFalse because
+    // Even though root elements of both fragments match
+    // there is extra element (= elementchild1) in pFragment.
+    //
+    // elementchild1 (of pFragment) can not be found from pFragment2
+    // and because of that pFragment2 does not consist of pFragment.
+    LOCAL_ASSERT( !pFragment2->ConsistsOfL(*pFragment) );
+    CleanupStack::PopAndDestroy(pFragment2);
+
+    CSenDomFragmentBase* pFragment3 = CSenDomFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment3);
+    TXmlEngElement element3 = pFragment3->AsElementL();
+    
+    TXmlEngElement elementchild32 = element3.AddNewElementL(_L8("DirectChild"));
+    elementchild32.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild32.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    domUtils.XmlEngRenameElementL(elementchild32, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    elementchild32.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2"));
+    elementchild32.SetEscapedTextL(_L8("Text"));
+    
+    // ConsistOfL should return EFalse because
+    // elementchild32 has content ("Text") which doesn't match
+    // to any child element of pFragment.
+    LOCAL_ASSERT( !pFragment->ConsistsOfL(*pFragment3) );
+    CleanupStack::PopAndDestroy(pFragment3);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_SetContentHandlerL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing1L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    // Default namespace declaration (xmlns="nsuri") from Parent element (Test)
+    // will be moved to all child elements (Element1, Element2, Element3 and
+    // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because
+    // the way CParser works <=> Namespaces are reported when namespaces are used
+    // for the first time.
+    _LIT8(KOutputString1, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nasurib\" \
+a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns=\"nsuri\" xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 xmlns=\"nsuri\" z=\"value4\">Content2</Element2>\
+<Element3 xmlns=\"nsuri\">Content3</Element3>\
+<Element4 xmlns=\"nsuri\"/></a:Test>");
+
+    // When EReportNamespaceMapping is enabled all the namespace declarations
+    // are reported in exactly the same element as they are defined in parsed
+    // XML document.
+    // Note: The Order of namespace declarations in root element tag may change.
+    // Namespace declaration for root tag is created when fragment is created
+    // and because of that namespace declaration for root tag will be the first.
+    // In this particular case namespace declaration for prefix "a" will be
+    // the first namespace declaration because it is declared when
+    // CSenDomFragmentBase is created.
+    _LIT8(KOutputString2, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>"); 
+    
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString1 );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+/*
+	pParser->EnableFeature(EReportNamespaceMapping);
+	//tma
+	pParser->DisableFeature(EReportNamespaceMapping);
+	TBool fEneabled(EFalse);
+	fEneabled = pParser->IsFeatureEnabled(EReportNamespaceMapping);
+	LOCAL_ASSERT( fEneabled == EFalse);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	//tma
+*/	
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+    CSenDomFragmentBase* pFragment2 = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment2);
+
+	pParser->ParseL(KInputString, *pFragment2);
+	
+	HBufC8* pAsXml2 = pFragment2->AsXmlL();
+	CleanupStack::PushL(pAsXml2);
+	                   
+    LOCAL_ASSERT( *pAsXml2 == KOutputString2 );
+    
+    CleanupStack::PopAndDestroy(pAsXml2);
+    CleanupStack::PopAndDestroy(pFragment2);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+    
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing2L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase which uses
+    // delegation.
+    _LIT8(KInputString, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nsurib\" \
+xmlns=\"nsuri\" a:x=\"value1\" b:z=\"value2\">\
+<DelegateFragment>DelegateContent</DelegateFragment>\
+<Element1 x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2></a:Test>");
+
+    // Default namespace declaration (xmlns="nsuri") from Parent element (Test)
+    // will be moved to all child elements (Element1, Element2, Element3 and
+    // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because
+    // the way CParser works <=> Namespaces are reported when namespaces are used
+    // for the first time.
+    _LIT8(KOutputString1, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nsurib\" \
+a:x=\"value1\" b:z=\"value2\">\
+<DelegateFragment xmlns=\"nsuri\">DelegateContent</DelegateFragment>\
+<Element1 xmlns=\"nsuri\" x=\"value4\">Content1</Element1>\
+<Element2 xmlns=\"nsuri\">Content2</Element2></a:Test>");
+
+    // When EReportNamespaceMapping is enabled all the namespace declarations
+    // are reported in exactly the same element as they are defined in parsed
+    // XML document.
+    // Note: The Order of namespace declarations in root element tag may change.
+    // Namespace declaration for root tag is created when fragment is created
+    // and because of that namespace declaration for root tag will be the first.
+    _LIT8(KOutputString2, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nsurib\" \
+xmlns=\"nsuri\" a:x=\"value1\" b:z=\"value2\">\
+<DelegateFragment>DelegateContent</DelegateFragment>\
+<Element1 x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2></a:Test>");
+     
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CMainDomFragment* pFragment = CMainDomFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString1 );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CDelegateDomFragment& delegate = pFragment->DelegateFragment();
+    HBufC8* pDelegateAsXml = delegate.AsXmlL();
+    CleanupStack::PushL(pDelegateAsXml);
+    // Note: When EReportNamespaceMapping is _NOT_ enabled namespace declaration
+    //       is added to delegate even though that namespace declaration was
+    //       originally declared (but not used) in root element of parsed document. 
+    LOCAL_ASSERT( *pDelegateAsXml ==
+                 _L8("<DelegateFragment xmlns=\"nsuri\">DelegateContent</DelegateFragment>") );
+    CleanupStack::PopAndDestroy(pDelegateAsXml);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+    CMainDomFragment* pFragment2 = CMainDomFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment2);
+
+	pParser->ParseL(KInputString, *pFragment2);
+	
+	HBufC8* pAsXml2 = pFragment2->AsXmlL();
+	CleanupStack::PushL(pAsXml2);
+    LOCAL_ASSERT( *pAsXml2 == KOutputString2 );
+    CleanupStack::PopAndDestroy(pAsXml2);
+    
+    CDelegateDomFragment& delegate2 = pFragment2->DelegateFragment();
+    HBufC8* pDelegateAsXml2 = delegate2.AsXmlL();
+    CleanupStack::PushL(pDelegateAsXml2);
+    LOCAL_ASSERT( *pDelegateAsXml2 ==
+                 _L8("<DelegateFragment>DelegateContent</DelegateFragment>") );
+    CleanupStack::PopAndDestroy(pDelegateAsXml2);
+    
+    CleanupStack::PopAndDestroy(pFragment2);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+    
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing3L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // In this test same namespaceuri is defined as default namespace in
+    // root element and 'c' prefixed namespace in Element2.
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<x:Element2 xmlns:x=\"nsuri\">Content2</x:Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    // Namespace declaration for prefix 'x' (and namespaceuri "nsuri")
+    // disappears from Element2 after parsing because default namespace
+    // declaration already declares namespace for uri "nsuri".
+    // => Double declaration for namespaceuri "nsuri" is not needed.
+    _LIT8(KOutputString, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+    
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }    
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing4L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // In this test nested elements (which have same name) are tested.
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">\
+<Element1>Content</Element1>\
+</Element1>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    _LIT8(KInputString2, "<Nested xmlns=\"nsuri\">\
+<Nested attr=\"attrvalue\"><Nested><Nested>Content</Nested></Nested></Nested>\
+</Nested>");
+
+    // Only namespace declaration order changes for output.
+    _LIT8(KOutputString, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">\
+<Element1>Content</Element1>\
+</Element1>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+
+    pFragment = CSenDomFragmentBase::NewL(_L8("nsuri"),_L8("Nested"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString2, *pFragment);
+	
+	pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KInputString2 );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+    
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing5L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // In this test nulling of default namespace is tested.
+/*    
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns="" xmlns:c=\"nsuric\" c:x=\"value4\">\
+<Element1 >Content</Element1>\
+</Element1>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+*/
+
+/*
+    // Only namespace declaration order changes for output.
+    _LIT8(KOutputString, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">\
+<Element1>Content</Element1>\
+</Element1>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+*/
+
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    /*CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);*/
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }  
+    
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing6L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // when constructor CSenDomFragmentBase::NewL() is used.
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 z=\"value4\">Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    // Default namespace declaration (xmlns="nsuri") from Parent element (Test)
+    // will be moved to all child elements (Element1, Element2, Element3 and
+    // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because
+    // the way CParser works <=> Namespaces are reported when namespaces are used
+    // for the first time.
+    _LIT8(KOutputString, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nasurib\" \
+a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns=\"nsuri\" xmlns:c=\"nsuric\" c:x=\"value3\">Content1</Element1>\
+<Element2 xmlns=\"nsuri\" z=\"value4\">Content2</Element2>\
+<Element3 xmlns=\"nsuri\">Content3</Element3>\
+<Element4 xmlns=\"nsuri\"/></a:Test>");
+
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL();
+    CleanupStack::PushL(pFragment);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing7L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // when constructor CSenDomFragmentBase::NewL() is used.
+    _LIT8(KInputString, "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<S:Header>\
+<wsa:MessageID>URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1</wsa:MessageID>\
+<wsa:To>http://10.132.11.35/WSStar/STS.aspx</wsa:To>\
+<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<wsse:UsernameToken>\
+<wsse:Username>PCNSA15\\wsstar</wsse:Username>\
+<wsse:Password>jaszmn\\3</wsse:Password>\
+</wsse:UsernameToken>\
+</wsse:Security>\
+</S:Header>\
+<S:Body>\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference>\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>\
+</S:Envelope>");
+
+    // Note: If EReportNamespaceMapping is not enabled output will be following:
+    //       (Namespace declaration for prefix "wsa" jumps from root element to
+    //        elements (MessageID, To, Action and EndpointReference) which actually
+    //        use above mentioned prefix. <=> Root element Envelope does not use
+    //        "wsa" prefix.)
+    _LIT8(KOutputString, "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<S:Header>\
+<wsa:MessageID xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1</wsa:MessageID>\
+<wsa:To xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">http://10.132.11.35/WSStar/STS.aspx</wsa:To>\
+<wsa:Action xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<wsse:UsernameToken>\
+<wsse:Username>PCNSA15\\wsstar</wsse:Username>\
+<wsse:Password>jaszmn\\3</wsse:Password>\
+</wsse:UsernameToken>\
+</wsse:Security>\
+</S:Header>\
+<S:Body>\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>\
+</S:Envelope>");
+
+    CSenParser* parser = CSenParser::NewLC();
+    //create a CSenDomFragment
+	CSenFragmentBase* pBase = CSenDomFragmentBase::NewL();
+	CleanupStack::PushL(pBase);
+	//do the parsing
+	parser->ParseL(KInputString, *pBase);
+	
+    HBufC8* pAsXml = pBase->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pBase);
+
+    pBase = CSenDomFragmentBase::NewL();
+    CleanupStack::PushL(pBase);
+    //Enable NamespaceMapping to ensure that namespace declarations will
+    //remain in exactly the same place as in original XML document
+    parser->EnableFeature(EReportNamespaceMapping);
+	//do the parsing
+	parser->ParseL(KInputString, *pBase);
+	
+    pAsXml = pBase->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KInputString );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pBase);
+    CleanupStack::PopAndDestroy(parser);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenDomFragmentBase_Parsing8L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // when constructor CSenDomFragmentBase::NewL() is used.
+    _LIT8(KInputString, "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<S:Header>\
+<wsa:MessageID>URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1</wsa:MessageID>\
+<wsa:To>http://10.132.11.35/WSStar/STS.aspx</wsa:To>\
+<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<wsse:UsernameToken>\
+<wsse:Username>PCNSA15\\wsstar</wsse:Username>\
+<wsse:Password>jaszmn\\3</wsse:Password>\
+</wsse:UsernameToken>\
+</wsse:Security>\
+</S:Header>\
+<S:Body>\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference>\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>\
+</S:Envelope>");
+
+    // Note: If EReportNamespaceMapping is not enabled output will be following:
+    //       (Namespace declaration for prefix "wsa" jumps from root element to
+    //        elements (MessageID, To, Action and EndpointReference) which actually
+    //        use above mentioned prefix. <=> Root element Envelope does not use
+    //        "wsa" prefix.)
+    _LIT8(KOutputString1, "<S:Body xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>");
+
+    _LIT8(KOutputString2, "<S:Body xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>");
+
+    CSenParser* parser = CSenParser::NewLC();
+    //create a CSenDomFragment
+	CSenFragmentBase* pBase = CSenDomFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"),
+	                                                    _L8("Body"),
+	                                                    _L8("S"));
+	CleanupStack::PushL(pBase);
+	//do the parsing
+	parser->ParseL(KInputString, *pBase);
+	
+    HBufC8* pAsXml = pBase->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString1 );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pBase);
+
+    pBase = CSenDomFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"),
+	                                  _L8("Body"),
+	                                  _L8("S"));
+    CleanupStack::PushL(pBase);
+    //Enable NamespaceMapping to ensure that namespace declarations will
+    //remain in exactly the same place as in original XML document
+    parser->EnableFeature(EReportNamespaceMapping);
+	//do the parsing
+	parser->ParseL(KInputString, *pBase);
+	
+    pAsXml = pBase->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString2 );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pBase);
+    CleanupStack::PopAndDestroy(parser);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewLL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement element = document.CreateDocumentElementL(_L8("Test"));
+    _LIT8(KElement, "<Element/>");
+    element.SetTextNoEncL(KElement);
+   
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(element);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    // Test that when CSenFragmentBase is serialized '<' and '>' characters
+    // are NOT encoded => The content of CSenFragmentBase can include
+    // XML elements
+    LOCAL_ASSERT( *pAsXml == _L8("<Test><Element/></Test>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_1L(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_2L(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"));
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns=\"NsUri\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_3L(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<t:Test xmlns:t=\"NsUri\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_4L(  )
+    {
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString,
+                   valueRString );
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+    
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+    
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"),
+                                                         attrArray);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool);    
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_5L(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent"));
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+        
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"),
+                                                         attrArray,
+                                                         parentElement);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+
+    RBuf8 buffer;
+    parentElement.OuterXmlL(buffer);
+    
+    LOCAL_ASSERT( buffer == _L8("<Parent><t:Test xmlns:t=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/></Parent>") );
+    buffer.Close();
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool); 
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_6L(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent"));
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+        
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8(""),
+                                                         attrArray,
+                                                         parentElement,
+                                                         document);
+    CleanupStack::PushL(pFragment);
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+
+    RBuf8 buffer;
+    parentElement.OuterXmlL(buffer);
+    
+    LOCAL_ASSERT( buffer == _L8("<Parent><Test xmlns=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/></Parent>") );
+    buffer.Close();
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool); 
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NewL_7L(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent"));
+    
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(nsUriRString, nsPrefixRString, localNameRString, 
+                   valueRString);
+    // attribute took ownership of all RStrings
+    // => All RStrings can be pop from CleanupStack
+    CleanupStack::Pop(&valueRString);
+    CleanupStack::Pop(&localNameRString);
+    CleanupStack::Pop(&nsPrefixRString);
+    CleanupStack::Pop(&nsUriRString);
+
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+        
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8(""),
+                                                         attrArray,
+                                                         parentElement,
+                                                         document);
+    CleanupStack::PushL(pFragment);
+    
+    RSenDocument doc = pFragment->AsDocumentL();
+    TXmlEngElement el = pFragment->AsElementL();
+    CSenFragmentBase* pFragment2 = CSenFragmentBase::NewL(el, doc);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PushL(pFragment2);
+        
+    HBufC8* pAsXml = pFragment2->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/>") );
+
+    RBuf8 buffer;
+    parentElement.OuterXmlL(buffer);
+    
+    LOCAL_ASSERT( buffer == _L8("<Parent><Test xmlns=\"NsUri\" xmlns:pr=\"nsuri\" pr:LocalName=\"Value\"/></Parent>") );
+    buffer.Close();
+    
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment2);
+    CleanupStack::PopAndDestroy(&attrArray);
+    CleanupStack::PopAndDestroy(&attribute);
+    CleanupStack::PopAndDestroy(&stringPool); 
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnStartElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnEndElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnStartDocumentLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnEndDocumentLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnContentLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnStartPrefixMappingLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnEndPrefixMappingLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnIgnorableWhiteSpaceLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnSkippedEntityLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnProcessingInstructionLL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnErrorL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_GetExtendedInterfaceL(  )
+    {
+    // There is no functionality in this method in CSenFragmentBase implementation
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_ContentLL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement element = document.CreateDocumentElementL(_L8("Test"));
+    element.SetEscapedTextL(_L8("<Element/>"));
+    
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(element);
+    CleanupStack::PushL(pFragment);
+    
+    TPtrC8 content = pFragment->ContentL();
+    LOCAL_ASSERT( content == _L8("<Element/>") );
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NamespaceL(  )
+    {
+    RStringPool stringPool;
+    stringPool.OpenL();
+    CleanupClosePushL(stringPool);
+    
+    RString nsUriRString        = stringPool.OpenStringL(_L8("nsuri"));
+    CleanupClosePushL(nsUriRString);
+    RString nsPrefixRString     = stringPool.OpenStringL(_L8("pr"));
+    CleanupClosePushL(nsPrefixRString);
+    RString localNameRString    = stringPool.OpenStringL(_L8("LocalName"));
+    CleanupClosePushL(localNameRString);
+    RString valueRString        = stringPool.OpenStringL(_L8("Value"));
+    CleanupClosePushL(valueRString);
+    
+    RAttribute attribute;
+    attribute.Open(stringPool.OpenStringL(_L8("nsuri")), 
+                   stringPool.OpenStringL(_L8("pr")),
+                   stringPool.OpenStringL(_L8("LocalName")),
+                   stringPool.OpenStringL(_L8("Value")) );
+    // attribute took copies of all RStrings
+    // => All RStrings can be destroyed
+    CleanupStack::PopAndDestroy(4); // nsUriRString, nsPrefixRString, localNameRString,
+                                    // valueRString
+    CleanupClosePushL(attribute);
+
+    RAttributeArray attrArray;
+    // append the namespace attribute (declaration)
+    attrArray.AppendL(attribute);
+    CleanupClosePushL(attrArray);
+    
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"),
+                                                         attrArray);
+    CleanupStack::PushL(pFragment);
+    
+    TXmlEngNamespace ns = pFragment->Namespace(_L8("pr"));
+    LOCAL_ASSERT( ns.Uri() == _L8("nsuri") );
+
+    TXmlEngNamespace ns2 = pFragment->Namespace(_L8("x"));
+    LOCAL_ASSERT( ns2.IsUndefined() );
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(); // attribute
+    CleanupStack::PopAndDestroy(); // attrArray
+    CleanupStack::PopAndDestroy(); // stringPool    
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_ResetContentLL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    CleanupClosePushL(document);
+    TXmlEngElement element = document.CreateDocumentElementL(_L8("Test"));
+    element.SetEscapedTextL(_L8("Content"));
+    
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(element);
+    CleanupStack::PushL(pFragment);
+    
+    // Test that CSenFragmentBase has content before reset
+    TPtrC8 content = pFragment->ContentL();
+    LOCAL_ASSERT( content == _L8("Content") );
+    
+    pFragment->ResetContentL();
+    
+    // Test that CSenFragmentBase has no content after reset
+    TPtrC8 content2 = pFragment->ContentL();
+    LOCAL_ASSERT( content2 == KNullDesC8 );
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(&document);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_LocalNameL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TPtrC8 localName = pFragment->LocalName();
+    LOCAL_ASSERT( localName == _L8("Test") );
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NsUriL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TPtrC8 localName = pFragment->NsUri();
+    LOCAL_ASSERT( localName == _L8("NsUri") );
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_NsPrefixL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TPtrC8 localName = pFragment->NsPrefix();
+    LOCAL_ASSERT( localName == _L8("t") );
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_AsElementLL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    element.OuterXmlL(buffer);
+    // Serialized element should contain all the Fragment data as XML.
+    LOCAL_ASSERT( buffer == _L8("<t:Test xmlns:t=\"NsUri\"/>") );
+    CleanupStack::PopAndDestroy(&buffer);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_AsDocumentLL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    RSenDocument document = pFragment->AsDocumentL();
+    TXmlEngElement element = document.DocumentElement();
+    
+    TXmlEngSerializationOptions options;
+    // Omit following declarations from the beginning of XML Document:
+    // <?xml version=\"1.0\...
+    //   encoding="..."
+    //   standalone="..."
+    // ?>
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    RBuf8 asXml;
+    document.SaveL(asXml, element, options);
+    CleanupClosePushL(asXml);
+    
+    // Serialized document should contain all the Fragment data as XML.
+    LOCAL_ASSERT( asXml == _L8("<t:Test xmlns:t=\"NsUri\"/>") );
+
+    CleanupStack::PopAndDestroy(&asXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_ExtractElementL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"),
+                                                         _L8("Test"),
+                                                         _L8("t"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->ExtractElement();
+    LOCAL_ASSERT( element.Name() == _L8("Test") );
+    element.Remove();
+    CleanupStack::PopAndDestroy(pFragment);    
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnDelegateParsingLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnDelegateParsingL_1L(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_SetOwnerL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnResumeParsingFromLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnWriteStartElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_OnWriteEndElementLL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_AsXmlUnicodeLL(  )
+    {
+    // Test serialization of Dom tree which has two child elements
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix"));
+
+    element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2"));
+    
+    HBufC* pAsXml = pFragment->AsXmlUnicodeL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L("<Test xmlns:prefix=\"nsuri\"><prefix:Child xmlns:prefix2=\"nsuri2\"><prefix2:Child2/></prefix:Child></Test>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_AsXmlLL(  )
+    {
+    // Test serialization of Dom tree which has two child elements
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix"));
+
+    element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2"));
+    
+    HBufC8* pAsXml = pFragment->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == _L8("<Test xmlns:prefix=\"nsuri\"><prefix:Child xmlns:prefix2=\"nsuri2\"><prefix2:Child2/></prefix:Child></Test>") );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_WriteAsXMLToLL(  )
+    {
+    // Test serialization of Dom tree which has two child elements
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix"));
+
+    element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2"));
+    
+    CBufFlat* pBuf = CBufFlat::NewL(200);
+    CleanupStack::PushL(pBuf);
+    RBufWriteStream bufWs(*pBuf);
+    CleanupClosePushL(bufWs);
+    pFragment->WriteAsXMLToL(bufWs);
+
+
+    LOCAL_ASSERT( pBuf->Ptr(0) == _L8("<Test xmlns:prefix=\"nsuri\"><prefix:Child xmlns:prefix2=\"nsuri2\"><prefix2:Child2/></prefix:Child></Test>") );
+    
+    CleanupStack::PopAndDestroy(&bufWs);
+    CleanupStack::PopAndDestroy(pBuf);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_ConsistsOfLL(  )
+    {
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    TXmlEngElement element = pFragment->AsElementL();
+    
+    TXmlEngElement elementchild1 = element.AddNewElementL(_L8("DirectChild"));
+    elementchild1.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild1.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    TDomUtils domUtils;
+    domUtils.XmlEngRenameElementL(elementchild1, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+
+    TXmlEngElement elementchild2 = element.AddNewElementL(_L8("DirectChild"));
+    elementchild2.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild2.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    domUtils.XmlEngRenameElementL(elementchild2, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    elementchild2.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2"));
+
+    CSenFragmentBase* pFragment2 = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment2);
+    TXmlEngElement element2 = pFragment2->AsElementL();
+    
+    TXmlEngElement elementchild22 = element2.AddNewElementL(_L8("DirectChild"));
+    elementchild22.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild22.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    domUtils.XmlEngRenameElementL(elementchild22, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    elementchild22.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2"));
+
+    // ConsistOfL should return ETrue because
+    // root elements of both fragments match and the only element
+    // of pFragment2 = elementchild22 is exactly the same element as
+    // elementchild2.
+    LOCAL_ASSERT( pFragment->ConsistsOfL(*pFragment2) );
+
+    // ConsistOfL should return EFalse because
+    // Even though root elements of both fragments match
+    // there is extra element (= elementchild1) in pFragment.
+    //
+    // elementchild1 (of pFragment) can not be found from pFragment2
+    // and because of that pFragment2 does not consist of pFragment.
+    LOCAL_ASSERT( !pFragment2->ConsistsOfL(*pFragment) );
+    CleanupStack::PopAndDestroy(pFragment2);
+
+    CSenFragmentBase* pFragment3 = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment3);
+    TXmlEngElement element3 = pFragment3->AsElementL();
+    
+    TXmlEngElement elementchild32 = element3.AddNewElementL(_L8("DirectChild"));
+    elementchild32.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix"));
+    //elementchild32.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+    domUtils.XmlEngRenameElementL(elementchild32, _L8("DirectChild"), _L8("nsuri"), _L8("prefix"));
+
+    elementchild32.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2"));
+    elementchild32.SetEscapedTextL(_L8("Text"));
+    
+    // ConsistOfL should return EFalse because
+    // elementchild32 has content ("Text") which doesn't match
+    // to any child element of pFragment.
+    LOCAL_ASSERT( !pFragment->ConsistsOfL(*pFragment3) );
+    CleanupStack::PopAndDestroy(pFragment3);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_SetContentHandlerL(  )
+    {
+    // Will be tested in Parse test cases
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+    
+TInt CSenFragmentTester::MT_CSenFragmentBase_Parsing1L(  )
+    {
+    // Parsing of XML document to CSenFragmentBase
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    // Default namespace declaration (xmlns="nsuri") from Parent element (Test)
+    // will be moved to all child elements (Element1, Element2, Element3 and
+    // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because
+    // the way CParser works <=> Namespaces are reported when namespaces are used.
+    _LIT8(KOutputString1, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nasurib\" \
+a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns=\"nsuri\" xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<Element2 xmlns=\"nsuri\">Content2</Element2>\
+<Element3 xmlns=\"nsuri\">Content3</Element3>\
+<Element4 xmlns=\"nsuri\"/></a:Test>");
+
+    // When EReportNamespaceMapping is enabled all the namespace declarations
+    // are reported in exactly the same element as they are defined in parsed
+    // XML document.
+    // Note: The Order of namespace declarations in root element tag may change.
+    // Namespace declaration for root tag is created when fragment is created
+    // and because of that namespace declaration for root tag will be the first.
+    // In this particular case namespace declaration for prefix "a" will be
+    // the first namespace declaration because it is declared when
+    // CSenFragmentBase is created.
+    _LIT8(KOutputString2, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+    
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+
+/*	
+	//tma
+	pParser->ParseBeginL();
+	
+	_LIT8(KXmlParserMimeType,   "text/xml");
+	pParser->ParseBeginL(KXmlParserMimeType);
+		
+    CMatchData* pMatchData = CMatchData::NewLC();
+    pMatchData->SetMimeTypeL(KXmlParserMimeType);
+    pParser->ParseBeginL(*pMatchData);
+    CleanupStack::PopAndDestroy(pMatchData);
+	//tma	
+*/
+
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString1 );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+    CSenFragmentBase* pFragment2 = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment2);
+
+	pParser->ParseL(KInputString, *pFragment2);
+	
+	HBufC8* pAsXml2 = pFragment2->AsXmlL();
+	CleanupStack::PushL(pAsXml2);
+	                   
+    LOCAL_ASSERT( *pAsXml2 == KOutputString2 );
+    
+    CleanupStack::PopAndDestroy(pAsXml2);
+    CleanupStack::PopAndDestroy(pFragment2);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+    
+TInt CSenFragmentTester::MT_CSenFragmentBase_Parsing2L(  )
+    {
+    // Parsing of XML document to CSenFragmentBase which uses
+    // delegation.
+    _LIT8(KInputString, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nsurib\" \
+xmlns=\"nsuri\" a:x=\"value1\" b:z=\"value2\">\
+<DelegateFragment>DelegateContent</DelegateFragment>\
+<Element1 x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2></a:Test>");
+
+    // Default namespace declaration (xmlns="nsuri") from Parent element (Test)
+    // will be moved to all child elements (Element1, Element2, Element3 and
+    // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because
+    // the way CParser works <=> Namespaces are reported when namespaces are used
+    // for the first time.
+    // Note: In CSenFragmentBase case DelegateFragment won't be in
+    //       content of parent fragment which did the delegation.
+    _LIT8(KOutputString1, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nsurib\" \
+a:x=\"value1\" b:z=\"value2\">\
+<Element1 xmlns=\"nsuri\" x=\"value4\">Content1</Element1>\
+<Element2 xmlns=\"nsuri\">Content2</Element2></a:Test>");
+
+    // When EReportNamespaceMapping is enabled all the namespace declarations
+    // are reported in exactly the same element as they are defined in parsed
+    // XML document.
+    // Note: The Order of namespace declarations in root element tag may change.
+    // Namespace declaration for root tag is created when fragment is created
+    // and because of that namespace declaration for root tag will be the first.
+    // Note: In CSenFragmentBase case DelegateFragment won't be in
+    //       content of parent fragment which did the delegation.
+    _LIT8(KOutputString2, "<a:Test xmlns:a=\"nasuria\" xmlns:b=\"nsurib\" \
+xmlns=\"nsuri\" a:x=\"value1\" b:z=\"value2\">\
+<Element1 x=\"value4\">Content1</Element1>\
+<Element2>Content2</Element2></a:Test>");
+     
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CMainFragment* pFragment = CMainFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString1 );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CDelegateFragment& delegate = pFragment->DelegateFragment();
+    HBufC8* pDelegateAsXml = delegate.AsXmlL();
+    CleanupStack::PushL(pDelegateAsXml);
+    LOCAL_ASSERT( *pDelegateAsXml ==
+                 _L8("<DelegateFragment xmlns=\"nsuri\">DelegateContent</DelegateFragment>") );
+    CleanupStack::PopAndDestroy(pDelegateAsXml);
+    
+    CleanupStack::PopAndDestroy(pFragment);
+
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+    CMainFragment* pFragment2 = CMainFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment2);
+
+	pParser->ParseL(KInputString, *pFragment2);
+	
+	HBufC8* pAsXml2 = pFragment2->AsXmlL();
+	CleanupStack::PushL(pAsXml2);
+    LOCAL_ASSERT( *pAsXml2 == KOutputString2 );
+    CleanupStack::PopAndDestroy(pAsXml2);
+    
+    CDelegateFragment& delegate2 = pFragment2->DelegateFragment();
+    HBufC8* pDelegateAsXml2 = delegate2.AsXmlL();
+    CleanupStack::PushL(pDelegateAsXml2);
+    LOCAL_ASSERT( *pDelegateAsXml2 ==
+                 _L8("<DelegateFragment xmlns=\"nsuri\">DelegateContent</DelegateFragment>") );
+    CleanupStack::PopAndDestroy(pDelegateAsXml2);
+    
+    CleanupStack::PopAndDestroy(pFragment2);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+    
+TInt CSenFragmentTester::MT_CSenFragmentBase_Parsing3L(  )
+    {
+    // Parsing of XML document to CSenFragmentBase
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<x:Element2 xmlns:x=\"nsuri\">Content2</x:Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    _LIT8(KOutputString, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">Content1</Element1>\
+<x:Element2 xmlns:x=\"nsuri\">Content2</x:Element2>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+    
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }    
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_Parsing4L(  )
+    {
+    // Parsing of XML document to CSenFragmentBase
+    // In this test nested elements (which have same name) are tested.
+    _LIT8(KInputString, "<a:Test xmlns=\"nsuri\" xmlns:a=\"nasuria\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">\
+<Element1>Content</Element1>\
+</Element1>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+    _LIT8(KInputString2, "<Nested xmlns=\"nsuri\">\
+<Nested attr=\"attrvalue\"><Nested><Nested>Content</Nested></Nested></Nested>\
+</Nested>");
+
+    // Only namespace declaration order changes for output.
+    // Element4 which has no content will be output with
+    // start and end tags.
+    _LIT8(KOutputString, "<a:Test xmlns:a=\"nasuria\" xmlns=\"nsuri\" \
+xmlns:b=\"nasurib\" a:x=\"value1\" b:z=\"value2\" z=\"value3\">\
+<Element1 xmlns:c=\"nsuric\" c:x=\"value4\">\
+<Element1>Content</Element1>\
+</Element1>\
+<Element3>Content3</Element3>\
+<Element4/></a:Test>");
+
+	CSenParser* pParser = CSenParser::NewLC();
+	
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString, *pFragment);
+	
+	HBufC8* pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KOutputString );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+
+    pFragment = CSenFragmentBase::NewL(_L8("nsuri"),_L8("Nested"));
+    CleanupStack::PushL(pFragment);
+	pParser->EnableFeature(EReportNamespaceMapping);
+	
+	pParser->ParseL(KInputString2, *pFragment);
+	
+	pAsXml = pFragment->AsXmlL();
+	CleanupStack::PushL(pAsXml);
+
+    LOCAL_ASSERT( *pAsXml == KInputString2 );
+
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pFragment);
+
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }    
+
+TInt CSenFragmentTester::MT_CSenFragmentBase_Parsing5L(  )
+    {
+    // Parsing of XML document to CSenDomFragmentBase
+    // when constructor CSenDomFragmentBase::NewL() is used.
+    _LIT8(KInputString, "<S:Envelope xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<S:Header>\
+<wsa:MessageID>URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1</wsa:MessageID>\
+<wsa:To>http://10.132.11.35/WSStar/STS.aspx</wsa:To>\
+<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>\
+<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<wsse:UsernameToken>\
+<wsse:Username>PCNSA15\\wsstar</wsse:Username>\
+<wsse:Password>jaszmn\\3</wsse:Password>\
+</wsse:UsernameToken>\
+</wsse:Security>\
+</S:Header>\
+<S:Body>\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference>\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>\
+</S:Envelope>");
+
+    // Note: If EReportNamespaceMapping is not enabled output will be following:
+    //       (Namespace declaration for prefix "wsa" jumps from root element to
+    //        elements (MessageID, To, Action and EndpointReference) which actually
+    //        use above mentioned prefix. <=> Root element Envelope does not use
+    //        "wsa" prefix.)
+    _LIT8(KOutputString1, "<S:Body xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>");
+
+    _LIT8(KOutputString2, "<S:Body xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\" \
+xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" \
+xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\
+<wst:RequestSecurityToken xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">\
+<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>\
+<wst:Renewing/>\
+<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</wst:TokenType>\
+<wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\
+<wsa:EndpointReference>\
+<wsa:Address>http://10.132.11.35/WSStar/WSService.aspx</wsa:Address>\
+</wsa:EndpointReference>\
+</wsp:AppliesTo>\
+</wst:RequestSecurityToken>\
+</S:Body>");
+
+    CSenParser* parser = CSenParser::NewLC();
+    //create a CSenDomFragment
+	CSenFragmentBase* pBase = CSenFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"),
+	                                                 _L8("Body"),
+	                                                 _L8("S"));
+	CleanupStack::PushL(pBase);
+	//do the parsing
+	parser->ParseL(KInputString, *pBase);
+	
+    HBufC8* pAsXml = pBase->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString1 );
+    CleanupStack::PopAndDestroy(pAsXml);
+    CleanupStack::PopAndDestroy(pBase);
+
+    pBase = CSenFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"),
+	                               _L8("Body"),
+	                               _L8("S"));
+    CleanupStack::PushL(pBase);
+    //Enable NamespaceMapping to ensure that namespace declarations will
+    //remain in exactly the same place as in original XML document
+    parser->EnableFeature(EReportNamespaceMapping);
+	//do the parsing
+	parser->ParseL(KInputString, *pBase);
+	
+    pAsXml = pBase->AsXmlL();
+    CleanupStack::PushL(pAsXml);
+    LOCAL_ASSERT( *pAsXml == KOutputString2 );
+    CleanupStack::PopAndDestroy(pAsXml);
+    
+    CleanupStack::PopAndDestroy(pBase);
+    CleanupStack::PopAndDestroy(parser);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenParser_NewLL(  )
+    {
+    CSenParser* pParser = CSenParser::NewL();
+    delete pParser;
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenParser_NewLCL(  )
+    {
+    CSenParser* pParser = CSenParser::NewLC();
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenParser_NewL_1L(  )
+    {
+    _LIT8(KXmlParserMimeType,   "text/xml");
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    CParser* pParser = CParser::NewL(KXmlParserMimeType, *pFragment);
+
+    // Ownership of the pParser is transfered to pSenParser
+    CSenParser* pSenParser = CSenParser::NewL(pParser);
+    delete pSenParser;
+
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenParser_NewLC_1L(  )
+    {
+    _LIT8(KXmlParserMimeType,   "text/xml");
+    CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test"));
+    CleanupStack::PushL(pFragment);
+    CParser* pParser = CParser::NewL(KXmlParserMimeType, *pFragment);
+
+    // Ownership of the pParser is transfered to pSenParser
+    CSenParser* pSenParser = CSenParser::NewLC(pParser);
+    CleanupStack::PopAndDestroy(pSenParser);
+
+    CleanupStack::PopAndDestroy(pFragment);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenParser_NewL_2L(  )
+    {
+    _LIT8(KXmlParserMimeType,   "text/xml");
+    CSenParser* pParser = CSenParser::NewL(KXmlParserMimeType);
+    delete pParser;
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_CSenParser_NewLC_2L(  )
+    {
+    _LIT8(KXmlParserMimeType,   "text/xml");
+    CSenParser* pParser = CSenParser::NewLC(KXmlParserMimeType);
+    CleanupStack::PopAndDestroy(pParser);
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_NewLL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    document.Close();
+    LOCAL_ASSERT( document.IsNull() );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_NewLCL(  )
+    {
+    RSenDocument document = RSenDocument::NewLC();
+    CleanupStack::PopAndDestroy();
+    
+    // Can't use IsNull() function because iInternal pointer
+    // (of document) is not NULLed. Only data for which iInternal
+    // points to is deleted.
+    //LOCAL_ASSERT( document.IsNull() );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_NewL_1L(  )
+    {
+    // Can't test RSenDocument::NewL(void* aInternal)
+    // because there is no way to get proper aInternal
+    // using public API.
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_NewLC_1L(  )
+    {
+    // Can't test RSenDocument::NewLC(void* aInternal)
+    // because there is no way to get proper aInternal
+    // using public API.
+    LOCAL_ASSERT( ETrue );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_CopyL(  )
+    {
+    RSenDocument document1 = RSenDocument::NewL();
+    TXmlEngElement element = document1.CreateDocumentElementL(_L8("Test"));
+    
+    element.AddTextL(_L8("testcontent"));
+    
+    RSenDocument document2 = document1.Copy();
+    
+    // Check that main elements of document1 and document2 
+    // are pointing to the same "in memory node" after copying.
+    LOCAL_ASSERT( element.IsSameNode(document2.DocumentElement()) );
+    
+    // Test that document2 contains the same data as document1
+    // did contain before closing document1.
+    document1.Close();
+    RBuf8 asXml;
+    TXmlEngSerializationOptions options;
+    options.iOptions = options.iOptions |
+                       TXmlEngSerializationOptions::KOptionOmitXMLDeclaration;
+    document2.SaveL(asXml, element, options);
+    CleanupClosePushL(asXml);
+    LOCAL_ASSERT( asXml == _L8("<Test>testcontent</Test>") );
+    CleanupStack::PopAndDestroy(&asXml);
+    
+    document2.Close();
+    LOCAL_ASSERT( document1.IsNull() && document2.IsNull() );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_CloseL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    document.Close();
+    LOCAL_ASSERT( document.IsNull() );
+    return KErrNone;
+    }
+
+TInt CSenFragmentTester::MT_RSenDocument_DestroyL(  )
+    {
+    RSenDocument document = RSenDocument::NewL();
+    document.Destroy();
+    LOCAL_ASSERT( document.IsNull() );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CSenFragmentTester::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CSenFragmentTester::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/delegatedomfragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+#include "delegatedomfragment.h"
+
+using namespace Xml;
+
+namespace
+    {
+    }
+
+CDelegateDomFragment* CDelegateDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CDelegateDomFragment* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CDelegateDomFragment* CDelegateDomFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CDelegateDomFragment* pNew = new (ELeave) CDelegateDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+CDelegateDomFragment* CDelegateDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent
+    )
+    {
+    CDelegateDomFragment* pNew = NewLC(aNsUri, aLocalName,
+                                aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CDelegateDomFragment* CDelegateDomFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent
+    )
+    {
+    CDelegateDomFragment* pNew = new (ELeave) CDelegateDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+    
+CDelegateDomFragment* CDelegateDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent,
+    RSenDocument& aOwnerDocument
+    )
+    {
+    CDelegateDomFragment* pNew = NewLC(aNsUri, aLocalName,
+                                       aQName, aAttributes,
+                                       aParent, aOwnerDocument);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CDelegateDomFragment* CDelegateDomFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent,
+    RSenDocument& aOwnerDocument
+    )
+    {
+    CDelegateDomFragment* pNew = new (ELeave) CDelegateDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent,
+                         aOwnerDocument);
+    return pNew;
+    }
+    
+
+CDelegateDomFragment::CDelegateDomFragment()
+    {
+    }
+
+CDelegateDomFragment::~CDelegateDomFragment()
+    {
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/delegatefragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+#include "delegatefragment.h"
+
+using namespace Xml;
+
+namespace
+    {
+    }
+
+CDelegateFragment* CDelegateFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CDelegateFragment* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CDelegateFragment* CDelegateFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes
+    )
+    {
+    CDelegateFragment* pNew = new (ELeave) CDelegateFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes);
+    return pNew;
+    }
+
+CDelegateFragment* CDelegateFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent
+    )
+    {
+    CDelegateFragment* pNew = NewLC(aNsUri, aLocalName,
+                                aQName, aAttributes, aParent);
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CDelegateFragment* CDelegateFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName,
+    const RAttributeArray& aAttributes,
+    TXmlEngElement& aParent
+    )
+    {
+    CDelegateFragment* pNew = new (ELeave) CDelegateFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent);
+    return pNew;
+    }
+
+CDelegateFragment::CDelegateFragment()
+    {
+    }
+
+CDelegateFragment::~CDelegateFragment()
+    {
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/maindomfragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+#include "maindomfragment.h"
+#include "SenFragmentBase.h"
+
+namespace
+    {
+	const TInt KStateParsingDelegate    = 100;
+    _LIT8(KMainFragmentXmlns,   "urn:main:fragment");
+    _LIT8(KMainFragmentName,    "MainFragment");
+    _LIT8(KMainFragmentQName,   "mn:MainFragment");	
+    _LIT8(KDelegateName,        "DelegateFragment");
+    }
+
+CMainDomFragment* CMainDomFragment::NewL()
+    {
+    CMainDomFragment* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CMainDomFragment* CMainDomFragment::NewLC()
+    {
+    CMainDomFragment* pNew = new (ELeave) CMainDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+CMainDomFragment* CMainDomFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CMainDomFragment* pNew = NewLC( aNsUri, aLocalName, aQName );
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CMainDomFragment* CMainDomFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CMainDomFragment* pNew = new (ELeave) CMainDomFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    return pNew;
+    }
+
+
+CMainDomFragment::CMainDomFragment()
+: ipDelegateFragment(NULL)
+    {
+    }
+
+void CMainDomFragment::BaseConstructL()
+    {
+    CSenDomFragmentBase::BaseConstructL(
+        KMainFragmentXmlns,
+        KMainFragmentName,
+        KMainFragmentQName
+        );
+    }
+
+void CMainDomFragment::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CSenDomFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName);
+    }
+
+CMainDomFragment::~CMainDomFragment()
+    {
+    delete ipDelegateFragment;
+    }
+
+void CMainDomFragment::OnStartElementL(const RTagInfo& aElement,
+                                    const RAttributeArray& aAttributes,
+                                    TInt aErrorCode)
+    {
+    switch (iState)
+        {
+        case KSenStateSave:
+            {
+            const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+            
+            if (saxLocalName == KDelegateName)
+                {
+                const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+                const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+                
+                TXmlEngElement element = AsElementL();
+                RSenDocument& document = AsDocumentL();
+
+				ipDelegateFragment = CDelegateDomFragment::NewL(
+					                         saxNsUri, saxLocalName,
+					                         saxPrefix, aAttributes,
+					                         element, document
+					                         );
+                
+                iState = KStateParsingDelegate;
+                
+                OnDelegateParsingL(*ipDelegateFragment);
+                }
+            else
+                {
+                CSenDomFragmentBase::OnStartElementL(aElement, aAttributes,
+                                                  aErrorCode);
+                }
+            break;
+            }
+        default:
+            {
+            CSenDomFragmentBase::OnStartElementL(aElement, aAttributes,
+                                            aErrorCode);
+            break;
+            }
+        }
+    }
+
+void CMainDomFragment::OnEndElementL(const RTagInfo& aElement,
+        						          TInt aErrorCode)
+
+    {
+    switch(iState)
+        {
+        case KStateParsingDelegate:
+            {
+            iState = KSenStateSave;
+            break;
+            }
+
+        default:
+            {
+            CSenDomFragmentBase::OnEndElementL(aElement, aErrorCode);
+            break;
+            }
+        }
+    }
+    
+void CMainDomFragment::OnResumeParsingFromL(const RTagInfo& aElement,
+                                                TInt aErrorCode)
+    {
+    SetContentHandler(*this);
+
+    switch (iState)
+        {
+        // no other states may be resumed(!)
+        case KStateParsingDelegate:
+            {
+            OnEndElementL(aElement, aErrorCode);
+            }
+            break;
+        }    
+    }
+    
+CDelegateDomFragment& CMainDomFragment::DelegateFragment()
+    {
+    return *ipDelegateFragment;
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/tsrc/senfragmentTester/src/mainfragment.cpp	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:      
+*
+*/
+
+
+
+
+
+
+#include "mainfragment.h"
+#include "SenFragmentBase.h"
+
+namespace
+    {
+	const TInt KStateParsingDelegate    = 100;
+    _LIT8(KMainFragmentXmlns,   "urn:main:fragment");
+    _LIT8(KMainFragmentName,    "MainFragment");
+    _LIT8(KMainFragmentQName,   "mn:MainFragment");
+    _LIT8(KDelegateName,        "DelegateFragment");
+    }
+
+CMainFragment* CMainFragment::NewL()
+    {
+    CMainFragment* pNew = NewLC();
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CMainFragment* CMainFragment::NewLC()
+    {
+    CMainFragment* pNew = new (ELeave) CMainFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL();
+    return pNew;
+    }
+
+
+CMainFragment* CMainFragment::NewL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CMainFragment* pNew = NewLC( aNsUri, aLocalName, aQName );
+    CleanupStack::Pop(); // pNew;
+    return pNew;
+    }
+
+CMainFragment* CMainFragment::NewLC(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CMainFragment* pNew = new (ELeave) CMainFragment;
+    CleanupStack::PushL(pNew);
+    pNew->BaseConstructL(aNsUri, aLocalName, aQName);
+    return pNew;
+    }
+
+
+CMainFragment::CMainFragment()
+: ipDelegateFragment(NULL)
+    {
+    }
+
+void CMainFragment::BaseConstructL()
+    {
+    CSenFragmentBase::BaseConstructL(
+        KMainFragmentXmlns,
+        KMainFragmentName,
+        KMainFragmentQName
+        );
+    }
+
+void CMainFragment::BaseConstructL(
+    const TDesC8& aNsUri,
+    const TDesC8& aLocalName,
+    const TDesC8& aQName
+    )
+    {
+    CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName);
+    }
+
+CMainFragment::~CMainFragment()
+    {
+    delete ipDelegateFragment;
+    }
+
+void CMainFragment::OnStartElementL(const RTagInfo& aElement,
+                                    const RAttributeArray& aAttributes,
+                                    TInt aErrorCode)
+    {
+    switch (iState)
+        {
+        case KSenStateSave:
+            {
+            const TPtrC8 saxLocalName   = aElement.LocalName().DesC();
+
+            if (saxLocalName == KDelegateName)
+                {
+                const TPtrC8 saxNsUri       = aElement.Uri().DesC();
+                const TPtrC8 saxPrefix      = aElement.Prefix().DesC();
+
+                TXmlEngElement element = AsElementL();
+
+				ipDelegateFragment = CDelegateFragment::NewL(
+					                         saxNsUri, saxLocalName,
+					                         saxPrefix, aAttributes
+					                         );
+
+                iState = KStateParsingDelegate;
+
+                OnDelegateParsingL(*ipDelegateFragment);
+                }
+            else
+                {
+                CSenFragmentBase::OnStartElementL(aElement, aAttributes,
+                                                  aErrorCode);
+                }
+            break;
+            }
+        default:
+            {
+            CSenFragmentBase::OnStartElementL(aElement, aAttributes,
+                                            aErrorCode);
+            break;
+            }
+        }
+    }
+
+void CMainFragment::OnEndElementL(const RTagInfo& aElement,
+        						          TInt aErrorCode)
+
+    {
+    switch(iState)
+        {
+        case KStateParsingDelegate:
+            {
+            iState = KSenStateSave;
+            break;
+            }
+
+        default:
+            {
+            CSenFragmentBase::OnEndElementL(aElement, aErrorCode);
+            break;
+            }
+        }
+    }
+    
+CDelegateFragment& CMainFragment::DelegateFragment()
+    {
+    return *ipDelegateFragment;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/websrv_pub/xml_fragment_api/xml_fragment_api.metaxml	Thu Jan 07 16:19:19 2010 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<api id="58321a190fa60c4db29a4ddea95ddc52" dataversion="1.0">
+<name>XML Fragment API</name>
+<description>API to Web Services Framework specific adaptations to standard XML APIs. New fragment classes provide efficient way to build XML Engine (libxml2) based DOM tree from SAX parsing output. Fragment can be described to be a specialized combination of both a SAX parser and content handler.</description>
+<type>c++</type>
+<collection>webservices</collection>
+<libs><lib name="senfragment.lib"/>
+</libs>
+<release category="public" sinceversion="5.0"/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>